-
Notifications
You must be signed in to change notification settings - Fork 20
Structure experiments #972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
LowGinWee
wants to merge
2,470
commits into
LifeSG:structure-experiments
Choose a base branch
from
LowGinWee:structure-experiments
base: structure-experiments
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2470 commits
Select commit
Hold shift + click to select a range
ef031a9
[#736][BL] Added tab index for link
benjaminLeongSK 5d3ac7c
Revert "[#736][BL] Remove old menu component"
benjaminLeongSK 91a0531
[#736][BL] Reform old menu to be used by mobile only
benjaminLeongSK 4d9ea8b
[#736][BL] Switched navbar to use between the correct menus
benjaminLeongSK 8ea3c0b
Revert "[#736][BL]Change button type if theres only 1 button"
benjaminLeongSK f1b94f6
[#736][BL] separate props by isModal
benjaminLeongSK 49e4703
[#736][BL] onKeyDown to be handled in navbar-items copmletely
benjaminLeongSK 12a986f
[#736][BL] removed unnecessary code
benjaminLeongSK dd30723
[#736][BL] extract to helper function
benjaminLeongSK 47f9b62
[#736][BL] Documenting new props
benjaminLeongSK 9b861c5
[#736][BL] misc changes
benjaminLeongSK 2967be5
[#736][BL] Fix code to use default tab behaviour
benjaminLeongSK 2e85971
[#736][BL] Shift keyboard behaviour to menucontent
benjaminLeongSK 4dffdc2
[#736][BL] Added test
benjaminLeongSK 97efaaf
[#736][BL] Remove arrow nav prop
benjaminLeongSK 6b757b9
[#736][BL] Remove comments and touch up codes
benjaminLeongSK beed813
[#736][BL] refactoring switch case
benjaminLeongSK d62d433
[#736][BL] Amend indicator to not follow focus unless submenu is opened
benjaminLeongSK e41a859
[#736][BL] Split component
benjaminLeongSK e862217
[#736][BL] Fix onFocus/onBlur behaviour
benjaminLeongSK 62a087f
[CCUBE-1683][JON]Resolve comment
hhung2710 d688da9
[BOOKINGSG-8931][RL] Run Storybook 9 upgrade
qroll a29d3e5
[BOOKINGSG-8931][RL] Update missed out @storybook/blocks, @storybook/…
qroll 6e0cab1
[BOOKINGSG-8931][RL] Update @storybook/react to framework specific im…
qroll e84cbf0
[BOOKINGSG-8931][RL] Migrate @storybook/types import to internal package
qroll ecc71af
[BOOKINGSG-8931][RL] Migrate storybook dark mode addon to community v…
qroll 825d3e6
[BOOKINGSG-8931][RL] Run Storybook 10 upgrade
qroll ba8baf8
[BOOKINGSG-8931][RL] Update tsconfig moduleResolution, dark mode addo…
qroll 230ef6c
[BOOKINGSG-8931][RL] Install vitest as workaround for failed Storyboo…
qroll 076404e
[BOOKINGSG-8931][RL] Enable code panel, disable interactions panel
qroll f81cde3
[CCUBE-1683][JON]Resolve comment
hhung2710 fc3f5d1
[CCUBE-1683][RL] Update documentation
cfb18b7
Merge pull request #946 from LifeSG/CCUBE-1683
qroll 040c271
[#736][BL] Refactoring base on PR comments
benjaminLeongSK 5b93ac2
[#736][RL] Update data-testid to be unique
1c22fd0
[#736][RL] Fix indicator style
f03968a
Merge pull request #943 from LifeSG/BL/736
qroll aac70ed
Bump qs from 6.14.1 to 6.14.2
dependabot[bot] 0240d0d
Merge pull request #959 from LifeSG/dependabot/npm_and_yarn/qs-6.14.2
qroll 78e5985
[MISC][RL] Bump 3.2.0-canary.5
qroll 715a2c1
Merge pull request #960 from LifeSG/bump-version
qroll b823b0c
Merge remote-tracking branch 'origin/master' into BOOKINGSG-8931
2594a23
[BOOKINGSG-8931][RL] Bump to latest storybook 10.2 to resolve some up…
6f68bc5
[MISC][RL] Bump pipeline timeout
e88a867
Merge pull request #957 from LifeSG/BOOKINGSG-8931
qroll 338936c
Bump fabric from 6.7.0 to 7.2.0
dependabot[bot] 57131f4
[MISC][RL] Fix image not staying centered after fabric update
0113f09
Merge pull request #962 from LifeSG/dependabot/npm_and_yarn/fabric-7.2.0
qroll e1352a9
[MISC][RL] Create V4 conventions doc
ebb8357
[MISC][RL] Update default PR template and add PR template for V4 comp…
cc8902a
[MISC][RL] Add workaround to select PR template
dea4125
[#876][BL] Changed dropdown to shared version
benjaminLeongSK 395642d
[#876][BL] Update storybook props
benjaminLeongSK 591c12e
[#876][BL] Added test
benjaminLeongSK b4a7a45
[#876][BL] Fix PR comments
benjaminLeongSK 2b8c86d
[#876][BL] Migrate types and fix test
benjaminLeongSK 04f4ff3
[#876][BL] Remove listStyleWidth
benjaminLeongSK fa3b4e8
[#876][BL] Add testId for dropdown
benjaminLeongSK 40e48b9
[#876][BL] Add keydown navigation for range select and update test
benjaminLeongSK 3658037
[#876][BL] Remove unused
benjaminLeongSK 764b9f0
[#876][BL] Fix test
benjaminLeongSK 3788c1f
[#876][BL] Fix focus error when moving from 1st dropdown to 2nd
benjaminLeongSK 3cc8691
[#876][BL] Fix test
benjaminLeongSK d1f5cb3
[#876][BL] Refactor focus error fix
benjaminLeongSK 60f4d83
[#876][BL] Restore useEffect and removed ref
benjaminLeongSK 02c1637
[#876][BL] Fixed test and keyboardPress logic
benjaminLeongSK d2cdc52
[MISC][RL] Include link for Figma
cb3639d
[#882][BL] Add accesibility for linklist
benjaminLeongSK 28f6857
[#876][BL] Remove useeffect
benjaminLeongSK 20074ba
[#876][RL] Minor coding style tweaks
f716d76
[MISC][RL] Group dropdown props
3a56145
Merge pull request #948 from LifeSG/BL/876
qroll 81aa603
[MISC][RL] Fix mismatched tags in code example
cf29a8f
Merge pull request #961 from LifeSG/v4-prep
qroll 69e4a78
[#882][BL] Fix MR comments
benjaminLeongSK 6856e49
[#882]BL] Minor MR fix
benjaminLeongSK a7eff64
[#883][BL] update accessibility for error description
benjaminLeongSK 17cfa1e
[#883][BL] Added logic to handle reminder base on interval
benjaminLeongSK a2331f6
Bump rollup from 3.29.5 to 3.30.0
dependabot[bot] 3a51e8c
[#883][BL] Extracted reminder logic to own file
benjaminLeongSK 5232277
[#883][BL] Update story to have countdown and reminderInterval defaul…
benjaminLeongSK ddbf61e
[#883][BL] Fix test cases
benjaminLeongSK d7bf8a3
Merge pull request #966 from LifeSG/dependabot/npm_and_yarn/rollup-3.…
qroll 1177d90
[#883][BL] Fix MR comments
benjaminLeongSK 52b3933
[#882][BL] Fix MR comments
benjaminLeongSK 1d0af26
Merge pull request #963 from LifeSG/BL/882
qroll 6b0f654
[MISC][RL] v3.3.0-canary.1
eaab48f
[#883][BL] Code Fix
benjaminLeongSK 92238a1
Merge pull request #969 from LifeSG/bump-version
qroll 02f4364
Bump minimatch
dependabot[bot] 3218132
Merge pull request #970 from LifeSG/dependabot/npm_and_yarn/multi-633…
qroll c95174f
Merge pull request #967 from LifeSG/BL/883
qroll 9f670c2
[MISC][GW] Upgrade Storybook from v7 to v10
ginweelow a3e9ff8
[MISC][GW] Add DS instructions and component catalog
ginweelow f3e8780
[#884][BL] Convert readonly to button
benjaminLeongSK a3e6299
[BOOKINGSG-8951][LS] Expose otp input ref and new props
lionel-sim bde9c6c
[BOOKINGSG-8951][LS] Add tests
lionel-sim 2da61b7
[#884][BL] Remove accessiblelabel prop and add aria label for readonly
benjaminLeongSK df83492
[#884][BL] Create unique id for fields
benjaminLeongSK ddf09d8
[BOOKINGSG-8951][LS] Update props table and resolve comments
lionel-sim fde5c6c
[#884][BL] Handle focus after unmask is clicked
benjaminLeongSK d83cb67
Merge pull request #975 from LifeSG/BOOKINGSG-8951
qroll 75fe5dc
[MISC][RL] v3.3.0-canary.2
10280e3
Merge pull request #977 from LifeSG/bump-version
qroll ddf10fb
[#884][BL] Handle focus for readonly masking
benjaminLeongSK 76ab69b
[#884][BL] Hide aria label for icon
benjaminLeongSK 746a5bf
[#884][BL] Add correct aria label for readonly
benjaminLeongSK 5fd28c0
[#884][BL] Amend test cases
benjaminLeongSK 5812eaf
Bump dompurify and @types/dompurify
dependabot[bot] 263a934
Bump svgo from 2.8.0 to 2.8.2
dependabot[bot] 67673f9
[#878][BL] Migrate timepicker to use shared dropdown
benjaminLeongSK 27526b6
[#878][BL] Match figma design
benjaminLeongSK e73e162
[#878][BL] Update storybook props
benjaminLeongSK ec1a614
[#878][BL] Added test cases
benjaminLeongSK a0834d1
[#878][BL] misc changes
benjaminLeongSK aa9dcde
[#878][BL] Remove animation
benjaminLeongSK d4e02cc
[#878][BL] Fix MR comments
benjaminLeongSK 0f2ea91
[#878][BL] Fix focus bring the page to the top
benjaminLeongSK 87eea75
[#878][BL] Fix MR comments
benjaminLeongSK a0664eb
[#880][BL] Migrate dial picker to shared dropdown
benjaminLeongSK 8ebc212
[#880][BL] Updated props table
benjaminLeongSK e535e92
[#880][BL] Added test cases
benjaminLeongSK 6040063
[#880][BL] Fix focus and PR comments
benjaminLeongSK 36799b4
[#880]BL] Minor MR fix and add test case
benjaminLeongSK ed7740d
[#880][BL] Fix test cases
benjaminLeongSK 892ffa8
Merge pull request #983 from LifeSG/time-picker-long-lived
qroll 3f4842b
Merge pull request #982 from LifeSG/dependabot/npm_and_yarn/svgo-2.8.2
qroll 03a8bae
Merge pull request #981 from LifeSG/dependabot/npm_and_yarn/multi-917…
qroll 2940c07
Bump dompurify from 3.2.5 to 3.3.2
dependabot[bot] e7b22be
Merge pull request #987 from LifeSG/dependabot/npm_and_yarn/dompurify…
qroll 092e0c3
[#884][BL] Fix MR comments
benjaminLeongSK 2453be6
[#884][BL] Add overflow style for span
benjaminLeongSK 5ad654a
[MOL-20666][DC] added optional counterOffset for timeline with tests
e3d3bcc
[MOL-20666][DC] update storybook docs for timeline
40b5202
[#884][BL] Remove padding
benjaminLeongSK eaff6d6
[#884][BL] Remove blur on masking
benjaminLeongSK fae22cd
Merge pull request #980 from LifeSG/BL/884
qroll 346a93d
[#889][BL] Added accessibility feature
benjaminLeongSK 368b3b9
[#889][BL] Update test cases
benjaminLeongSK c17e6fb
[#889][BL] Fix MR comments
benjaminLeongSK 80173da
[#889][BL] Fix test cases
benjaminLeongSK 5cfebb3
[#889][BL] Fix forward ref console error in testcases
benjaminLeongSK a53a9b9
[MOL-20666][DC] update testId to exclude offset and fix tests
2c3b382
[BOOKINGSG-9056][LS] Fix popover trigger dismissing when sibling port…
lionel-sim 09c83d1
[MOL-20666][DC] remove redundant test
8b56354
Merge pull request #993 from LifeSG/MOL-20666/update-timeline-with-nu…
qroll fc97fac
[BOOKINGSG-9056][LS] Add canvas for nested popover
lionel-sim 73ea05e
[#879][BL] Added accessibility for timepicker
benjaminLeongSK 6728974
[#879][BL] Remove labels
benjaminLeongSK bd00205
[MISC][RL] Update docs
qroll 29bf0c6
Merge pull request #997 from LifeSG/BOOKINGSG-9056
qroll 6cc6a64
[MISC][RL] v3.3.0-canary.3
7f5b5c9
Merge pull request #1000 from LifeSG/bump-version
qroll 7b34ad6
[MISC][RL] Tweak template to match latest conventions
50a505c
[CCUBE-1988][HUY] Add button type to otp verfication buttons to preve…
6335bc5
Merge pull request #1001 from LifeSG/v4-prep
qroll 563b473
[CCUBE-1988][HUY] Replace useTheme with useContext(ThemeProvider) for…
a30f4a7
[#889][BL] Fix slider not working on android talkback
benjaminLeongSK 2d2eb92
[#889][BL] Minor fixes
benjaminLeongSK 3657cb4
[#889][BL] Amend test cases
benjaminLeongSK 02edd41
Merge pull request #990 from LifeSG/BL/889
qroll aa3144a
Merge pull request #1002 from LifeSG/CCUBE-1988
qroll b3e455b
[#879][BL] Fix MR comments
benjaminLeongSK ec1aac0
[#879][BL] Amend id
benjaminLeongSK 08d3102
[MISC][RL] Fix unintended scroll jump after forced modal dismissal on…
7ad075f
Merge pull request #998 from LifeSG/BL/879
qroll 0545183
[#877][BL] Make individual selector tabable
benjaminLeongSK eeadc30
[#877][BL] Added accessibility text upon rendering dropdownlist
benjaminLeongSK 41b0eb7
[#877][BL] Make id unique
benjaminLeongSK 1cc6a78
[#877][BL] Fix focus for disabled and readonly
benjaminLeongSK 985ae3d
[#877][BL] Fix test case
benjaminLeongSK e85efe5
[#877][BL] Fix voiceover for windows
benjaminLeongSK 37ac4be
[#877][BL] Fix voiceover for android
benjaminLeongSK f454c7d
[#877][BL] Fix MR comments
benjaminLeongSK 352758d
[#877][BL] Create new util for live announcements
benjaminLeongSK 4b79ee8
[#877][BL] Fix test cases
benjaminLeongSK 0bc375b
[#877][BL] Replace util with react-aria liveannouncer
benjaminLeongSK 70b7e00
[#877][BL] Add styling for darkmode
benjaminLeongSK e85356d
[#877][BL] Replaced live-announcer
benjaminLeongSK 0a435b5
[#877][BL] Fix android voice over
benjaminLeongSK 94458a7
[#877][BL] MR fixes
benjaminLeongSK 8cec2cd
Merge pull request #986 from LifeSG/BL/877
qroll 2169e7c
[#885][BL] Install live-announcer
benjaminLeongSK 76233a6
[#885][BL] Added accessibility features for slider
benjaminLeongSK f9dccb6
[#885][BL] Code fixes and clean up
benjaminLeongSK 60f5ba3
[#885][BL] Fix MR comments
benjaminLeongSK 67a1eba
[#855][BL] Fix sync package-lock with package.json
benjaminLeongSK 83a6965
[#885][BL] Add additional aria props and hide instructions if disable…
benjaminLeongSK abcc760
[MISC][RL] Add further guards and rename for better specififity
d53562d
[MISC][RL] Resync lockfile
8fe8443
Merge pull request #1007 from LifeSG/fix-modal-jump
qroll f1f6cc0
Merge pull request #999 from LifeSG/BL/885
qroll 51b2e12
[#886][BL] Amend id for form slider
benjaminLeongSK 0c9abad
[#886][BL] Remove default id
benjaminLeongSK 541753d
[#886][BL] Remove label for 1 slider
benjaminLeongSK d094c45
[#886][BL] Amend inputId
benjaminLeongSK 321d14b
Merge pull request #1011 from LifeSG/BL/886
qroll 03a3da8
feat(calendar): add multi-select variant
qizhen-palo 7661c06
[MISC][RL] Update docs
cb254da
Merge pull request #995 from LifeSG/add-calendar-multi-select
qroll 855436c
[MISC][GW] Updated jsdoc prompt and generate-catalog script
ginweelow 5cce9b2
[#881][BL] Remove aria labels from button
benjaminLeongSK 7cb19e3
[#881][BL] Add accessibility for dial picker variant
benjaminLeongSK d7459a9
[#881][BL] Add accessibility for combobox variant
benjaminLeongSK b31d786
[#881][BL] Fix test cases
benjaminLeongSK 894566d
[#881][BL] Aria changes
benjaminLeongSK 51dc674
[#881][BL] Pass aria invalid prop
benjaminLeongSK eeecf46
[#881][BL] Remove undefined from aria
benjaminLeongSK 8f05d17
[MISC][HUY] Expose theme navbar and theme button to consumer
6a464aa
Merge pull request #1010 from LifeSG/BL/881
qroll f8cfe43
[MISC][HUY] Expose ThemeComponent including ThemeButton and ThemeNavbar
ca9c9cc
Merge pull request #1014 from LifeSG/misc-expose-navbar
qroll 20da075
[MISC][RL] v3.3.0-canary.4
beedc67
[#887][BL] Add missing accessibility features
benjaminLeongSK 696c18e
[#887][BL] Remove default id
benjaminLeongSK 5a20fb5
[#887][BL] Amend inputId
benjaminLeongSK 5831739
[#887][BL] Forward aria props
benjaminLeongSK eadd4d0
[#887][BL] Added range percentage aria description
benjaminLeongSK c344191
[#887][BL] Shift announcer logic to histogram slider
benjaminLeongSK 7caaeb5
[#887][BL] Move description into SliderThumb
benjaminLeongSK 2479813
Merge pull request #1015 from LifeSG/bump-version
qroll d332a34
Merge pull request #1012 from LifeSG/BL/887
qroll e66795a
[MISC][RL] Fix incorrect text colour for tab item
df2c717
Merge pull request #1019 from LifeSG/fix-tab-colour
qroll 3ff408b
[#888][BL] Make modalV2 compatible for fullscreen image carousel
benjaminLeongSK 25c8406
[#888][BL] Add accessibility features
benjaminLeongSK acc9a39
[#888][BL] Fix MR comments
benjaminLeongSK f9a18ae
[#888][BL] Added announcer for image
benjaminLeongSK f035900
[#888][BL] Fix MR comments
benjaminLeongSK c642a0c
[#888][BL] Refactor styling
benjaminLeongSK e6f0856
[#888][BL] Created util to replace handling of announcer function
benjaminLeongSK d61bb5a
[#888][BL] Amend path and names
benjaminLeongSK d1513c6
Merge pull request #1005 from LifeSG/BL/888
qroll 2d8fe61
[MISC][RL] v3.3.0-canary.5
b64d06b
Merge pull request #1021 from LifeSG/bump-version
qroll 67b70f0
[slider-talkback-accessibility-fix][BL] Fix slider interaction on and…
benjaminLeongSK 776f31b
[slider-talkback-accessibility-fix][BL] Fix MR comments
benjaminLeongSK 692caca
[MISC][GW] add jsdocs
ginweelow e80aaa4
[MISC][RL] Minor code convention fixes
qroll 287ab99
[slider-talkback-accessibility-fix][BL] Added back ariadescription fo…
benjaminLeongSK dad05f7
Merge pull request #1016 from LifeSG/slider-talkback-accessibility-fix
qroll 04699cf
[MISC][GW] Fix Storybook MDX: move Meta import to @storybook/blocks, …
ginweelow 99ec54a
Merge remote-tracking branch 'origin/master' into structure-experiments
ginweelow 3b66d93
[MISC][GW] Fix post-merge import paths: update to V2_Color and V2_Tex…
ginweelow 22db732
[MISC][GW] Add JSDoc to all component types.ts files (83 components)
ginweelow 000425f
[MISC][GW] Fix Storybook: restore text.style.tsx with v2 imports, fix…
ginweelow 861938c
[MISC][GW] Fix autodocs conflict: remove autodocs tag from button and…
ginweelow a9e330a
[MISC][GW] Migrate all props-tables to PropTableTabs
ginweelow 7c53bce
[MISC][GW] Filter HTML-inherited props; all tabs use ApiTable; fix ty…
ginweelow f988f67
[MISC][GW] Add @testing-library/dom dev dep; update .gitignore
ginweelow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| **Type of changes** | ||
|
|
||
| <!-- Put an `x` in the items that apply --> | ||
|
|
||
| - [ ] Bug fix (non-breaking change which fixes an issue) | ||
| - [ ] New feature (non-breaking change which adds functionality) | ||
| - [ ] Breaking change (fix or feature that would cause existing apis or functionality to change) | ||
|
|
||
| **Description of changes** | ||
|
|
||
| - Link to [ticket](url) | ||
| - Link to [Figma](url) | ||
| - Description of changes | ||
|
|
||
| **Checklist** | ||
|
|
||
| <!-- Put an `x` in items that apply --> | ||
|
|
||
| - [ ] Changes follow the project guidelines in [CONTRIBUTING.md](https://github.com/LifeSG/react-design-system/blob/master/CONTRIBUTING.md) and [CONVENTIONS.md](https://github.com/LifeSG/react-design-system/blob/master/CONVENTIONS.md) | ||
| - [ ] Looks good on mobile and tablet | ||
| - [ ] Updated documentation | ||
| - [ ] Added/updated tests | ||
|
|
||
| **Screenshots** | ||
|
|
||
| <!-- Include a screenshot or video recording of visual changes --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| **Checklist** | ||
|
|
||
| <!-- Put an `x` in all the items that apply, ~~strikethrough~~ items that are not applicable --> | ||
|
|
||
| - [ ] Migrated the component styles | ||
| - [ ] `className` is chained correctly with `clsx` | ||
| - [ ] User style prop is set as CSS variable | ||
| - [ ] Changes follow the project guidelines in [CONVENTIONS_V4.md](https://github.com/LifeSG/react-design-system/blob/master/CONVENTIONS_V4.md) | ||
| - [ ] Updated Storybook documentation | ||
| - [ ] Added/updated unit tests | ||
| - [ ] Added visual tests | ||
| - [ ] Listed breaking changes | ||
|
|
||
| **Breaking changes** | ||
|
|
||
| <!-- Remove this section if not required --> | ||
|
|
||
| List breaking style or api changes to be added to the migration docs | ||
|
|
||
| **Additional information** | ||
|
|
||
| <!-- Remove this section if not required --> | ||
|
|
||
| Provide additional information that might be useful to the reviewer |
108 changes: 108 additions & 0 deletions
108
.github/instructions/design-system-components.instructions.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| --- | ||
| description: "Component catalog and usage rules for @lifesg/react-design-system — consult foundations tokens first, then the component catalog, before writing any custom UI code." | ||
| applyTo: "**/*.{tsx,ts,jsx,js}" | ||
| --- | ||
|
|
||
| This project uses **@lifesg/react-design-system**. | ||
|
|
||
| ## Step 1 — Use foundations first | ||
|
|
||
| Before writing any custom styles or reaching for a third-party library, use the design system's foundation tokens. All styling must go through **styled-components** using these foundations. Never use inline styles, plain CSS, hardcoded hex values, or raw px/rem sizes. | ||
|
|
||
| ### Colors | ||
|
|
||
| ```tsx | ||
| import { Color } from "@lifesg/react-design-system/color"; | ||
| import { DesignToken } from "@lifesg/react-design-system/design-token"; | ||
| import styled from "styled-components"; | ||
|
|
||
| const Card = styled.div` | ||
| background: ${Color.Neutral[8]}; | ||
| border: 1px solid ${Color.Neutral[5]}; | ||
| box-shadow: ${DesignToken.ElevationBoxShadow}; | ||
| `; | ||
| ``` | ||
|
|
||
| ### Typography | ||
|
|
||
| ```tsx | ||
| import { Text, TextStyleHelper } from "@lifesg/react-design-system/text"; | ||
| import { Color } from "@lifesg/react-design-system/color"; | ||
| import styled from "styled-components"; | ||
|
|
||
| // In JSX — use Text components directly | ||
| <Text.H1>Heading</Text.H1> | ||
| <Text.Body>Body copy</Text.Body> | ||
|
|
||
| // In styled-components — use TextStyleHelper | ||
| const Label = styled.span` | ||
| ${TextStyleHelper.getTextStyle("Body", "regular")} | ||
| color: ${Color.Neutral[1]}; | ||
| `; | ||
| ``` | ||
|
|
||
| ### Responsive / media queries | ||
|
|
||
| ```tsx | ||
| import { MediaQuery } from "@lifesg/react-design-system/media"; | ||
| import styled from "styled-components"; | ||
|
|
||
| const Wrapper = styled.div` | ||
| padding: 2rem; | ||
|
|
||
| ${MediaQuery.MaxWidth.tablet} { | ||
| padding: 1rem; | ||
| } | ||
| `; | ||
| ``` | ||
|
|
||
| Available breakpoints (via `MediaQuery.MaxWidth` and `MediaQuery.MinWidth`): `mobileS`, `mobileM`, `mobileL`, `tablet`, `desktopM`, `desktopL`, `desktop4k`. | ||
|
|
||
| ### Layout | ||
|
|
||
| ```tsx | ||
| import { Layout } from "@lifesg/react-design-system/layout"; | ||
|
|
||
| <Layout.Section> | ||
| <Layout.Container> | ||
| <Layout.Content>...</Layout.Content> | ||
| </Layout.Container> | ||
| </Layout.Section>; | ||
| ``` | ||
|
|
||
| ### Spacing / gaps | ||
|
|
||
| There is no spacing token object — use multiples of `0.5rem` (8px grid). Prefer CSS `gap` in flex/grid containers over `margin` on individual children. | ||
|
|
||
| ```tsx | ||
| const Row = styled.div` | ||
| display: flex; | ||
| gap: 1rem; /* 16px */ | ||
| padding: 1.5rem; /* 24px */ | ||
| `; | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Step 2 — Use the component catalog | ||
|
|
||
| The machine-readable catalog lives at: | ||
|
|
||
| ``` | ||
| node_modules/@lifesg/react-design-system/component-catalog.json | ||
| ``` | ||
|
|
||
| **Always read this file before writing any component code.** Each entry contains: | ||
|
|
||
| | Field | Purpose | | ||
| | ------------- | -------------------------------------------------------- | | ||
| | `name` | Component name | | ||
| | `importPath` | Exact import path to use | | ||
| | `description` | What the component does | | ||
| | `searchKeys` | Intent keywords — match these against the user's request | | ||
|
|
||
| **Rules:** | ||
|
|
||
| 1. Read the catalog and match `searchKeys` against the user's intent to find the right component. | ||
| 2. Use the exact `importPath` — never import from the package root. | ||
| 3. Prefer components from this design system over third-party alternatives or custom implementations. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main instruction file that reads from the catalog