@cdx-ui/components 0.0.1-beta.5 → 0.0.1-beta.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -18
- package/lib/commonjs/components/AlertDialog/index.js +1 -1
- package/lib/commonjs/components/AlertDialog/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/index.js +1 -1
- package/lib/commonjs/components/Avatar/styles.js +36 -29
- package/lib/commonjs/components/Avatar/styles.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +16 -1
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +85 -26
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/CLAUDE.md +90 -0
- package/lib/commonjs/components/Card/index.js +22 -4
- package/lib/commonjs/components/Card/index.js.map +1 -1
- package/lib/commonjs/components/Card/styles.js +27 -4
- package/lib/commonjs/components/Card/styles.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js +5 -29
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +39 -47
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +78 -9
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/Chip/styles.js +207 -21
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +8 -2
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Field/styles.js +4 -4
- package/lib/commonjs/components/Field/styles.js.map +1 -1
- package/lib/commonjs/components/Heading/styles.js +1 -1
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +3 -4
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +6 -1
- package/lib/commonjs/components/IconButton/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/styles.js +135 -10
- package/lib/commonjs/components/IconButton/styles.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +7 -6
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +22 -3
- package/lib/commonjs/components/Link/index.js.map +1 -1
- package/lib/commonjs/components/Link/styles.js +56 -6
- package/lib/commonjs/components/Link/styles.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +9 -9
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/components/ProgressSegmented/index.js +24 -10
- package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js +167 -0
- package/lib/commonjs/components/Radio/index.js.map +1 -0
- package/lib/commonjs/components/Radio/styles.js +31 -0
- package/lib/commonjs/components/Radio/styles.js.map +1 -0
- package/lib/commonjs/components/ScopedTheme/index.js +24 -0
- package/lib/commonjs/components/ScopedTheme/index.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +4 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +9 -3
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +17 -20
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +2 -2
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/components/Tile/index.js +251 -0
- package/lib/commonjs/components/Tile/index.js.map +1 -0
- package/lib/commonjs/components/Tile/styles.js +52 -0
- package/lib/commonjs/components/Tile/styles.js.map +1 -0
- package/lib/commonjs/components/index.js +36 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/Avatar.figma.js +54 -0
- package/lib/commonjs/figma/Avatar.figma.js.map +1 -0
- package/lib/commonjs/figma/Button.figma.js +28 -15
- package/lib/commonjs/figma/Button.figma.js.map +1 -1
- package/lib/commonjs/figma/CLAUDE.md +30 -0
- package/lib/commonjs/figma/Card.Header.figma.js +28 -0
- package/lib/commonjs/figma/Card.Header.figma.js.map +1 -0
- package/lib/commonjs/figma/Card.figma.js +42 -0
- package/lib/commonjs/figma/Card.figma.js.map +1 -0
- package/lib/commonjs/figma/Checkbox.figma.js +55 -0
- package/lib/commonjs/figma/Checkbox.figma.js.map +1 -0
- package/lib/commonjs/figma/Chip.figma.js +68 -0
- package/lib/commonjs/figma/Chip.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Input.figma.js +57 -0
- package/lib/commonjs/figma/Field.Input.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Select.figma.js +57 -0
- package/lib/commonjs/figma/Field.Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Heading.figma.js +30 -0
- package/lib/commonjs/figma/Heading.figma.js.map +1 -0
- package/lib/commonjs/figma/Icon.figma.js +20 -0
- package/lib/commonjs/figma/Icon.figma.js.map +1 -0
- package/lib/commonjs/figma/IconButton.figma.js +47 -0
- package/lib/commonjs/figma/IconButton.figma.js.map +1 -0
- package/lib/commonjs/figma/Input.figma.js +52 -0
- package/lib/commonjs/figma/Input.figma.js.map +1 -0
- package/lib/commonjs/figma/Link.figma.js +30 -0
- package/lib/commonjs/figma/Link.figma.js.map +1 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js +39 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/commonjs/figma/Radio.figma.js +40 -0
- package/lib/commonjs/figma/Radio.figma.js.map +1 -0
- package/lib/commonjs/figma/Select.figma.js +53 -0
- package/lib/commonjs/figma/Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Text.figma.js +29 -0
- package/lib/commonjs/figma/Text.figma.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.js +27 -0
- package/lib/commonjs/figma/icons.figma.batch.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.json +17705 -0
- package/lib/commonjs/hooks/index.js +19 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useForgeBottomTabScreenOptions.js +246 -0
- package/lib/commonjs/hooks/useForgeBottomTabScreenOptions.js.map +1 -0
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/metro/withCdxMetroConfig.js +7 -18
- package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -1
- package/lib/commonjs/metro/withForgeMetroConfig.js +24 -0
- package/lib/commonjs/metro/withForgeMetroConfig.js.map +1 -0
- package/lib/commonjs/navigation/forgeTabIcon.js +43 -0
- package/lib/commonjs/navigation/forgeTabIcon.js.map +1 -0
- package/lib/commonjs/navigation/forgeTabIcon.native.js +35 -0
- package/lib/commonjs/navigation/forgeTabIcon.native.js.map +1 -0
- package/lib/commonjs/navigation/index.js +13 -0
- package/lib/commonjs/navigation/index.js.map +1 -0
- package/lib/commonjs/navigation/types.js +40 -0
- package/lib/commonjs/navigation/types.js.map +1 -0
- package/lib/commonjs/styles/primitives.js +43 -6
- package/lib/commonjs/styles/primitives.js.map +1 -1
- package/lib/module/components/AlertDialog/index.js +1 -1
- package/lib/module/components/AlertDialog/index.js.map +1 -1
- package/lib/module/components/Avatar/index.js +1 -1
- package/lib/module/components/Avatar/styles.js +36 -29
- package/lib/module/components/Avatar/styles.js.map +1 -1
- package/lib/module/components/Button/index.js +17 -2
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +85 -26
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/CLAUDE.md +90 -0
- package/lib/module/components/Card/index.js +23 -4
- package/lib/module/components/Card/index.js.map +1 -1
- package/lib/module/components/Card/styles.js +27 -4
- package/lib/module/components/Card/styles.js.map +1 -1
- package/lib/module/components/Checkbox/index.js +6 -30
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +40 -48
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Chip/index.js +82 -13
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/Chip/styles.js +206 -20
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/components/Field/index.js +9 -3
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Field/styles.js +4 -4
- package/lib/module/components/Field/styles.js.map +1 -1
- package/lib/module/components/Heading/styles.js +1 -1
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/Icon/index.js +3 -4
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/IconButton/index.js +6 -1
- package/lib/module/components/IconButton/index.js.map +1 -1
- package/lib/module/components/IconButton/styles.js +135 -10
- package/lib/module/components/IconButton/styles.js.map +1 -1
- package/lib/module/components/Input/styles.js +7 -6
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/index.js +25 -6
- package/lib/module/components/Link/index.js.map +1 -1
- package/lib/module/components/Link/styles.js +55 -6
- package/lib/module/components/Link/styles.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +10 -10
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/components/ProgressSegmented/index.js +25 -11
- package/lib/module/components/ProgressSegmented/index.js.map +1 -1
- package/lib/module/components/Radio/index.js +164 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Radio/styles.js +27 -0
- package/lib/module/components/Radio/styles.js.map +1 -0
- package/lib/module/components/ScopedTheme/index.js +19 -0
- package/lib/module/components/ScopedTheme/index.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js +4 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -1
- package/lib/module/components/Select/index.js +10 -4
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +18 -21
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Text/styles.js +2 -2
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/components/Tile/index.js +243 -0
- package/lib/module/components/Tile/index.js.map +1 -0
- package/lib/module/components/Tile/styles.js +48 -0
- package/lib/module/components/Tile/styles.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/Avatar.figma.js +48 -0
- package/lib/module/figma/Avatar.figma.js.map +1 -0
- package/lib/module/figma/Button.figma.js +28 -15
- package/lib/module/figma/Button.figma.js.map +1 -1
- package/lib/module/figma/CLAUDE.md +30 -0
- package/lib/module/figma/Card.Header.figma.js +22 -0
- package/lib/module/figma/Card.Header.figma.js.map +1 -0
- package/lib/module/figma/Card.figma.js +36 -0
- package/lib/module/figma/Card.figma.js.map +1 -0
- package/lib/module/figma/Checkbox.figma.js +49 -0
- package/lib/module/figma/Checkbox.figma.js.map +1 -0
- package/lib/module/figma/Chip.figma.js +62 -0
- package/lib/module/figma/Chip.figma.js.map +1 -0
- package/lib/module/figma/Field.Input.figma.js +51 -0
- package/lib/module/figma/Field.Input.figma.js.map +1 -0
- package/lib/module/figma/Field.Select.figma.js +51 -0
- package/lib/module/figma/Field.Select.figma.js.map +1 -0
- package/lib/module/figma/Heading.figma.js +24 -0
- package/lib/module/figma/Heading.figma.js.map +1 -0
- package/lib/module/figma/Icon.figma.js +14 -0
- package/lib/module/figma/Icon.figma.js.map +1 -0
- package/lib/module/figma/IconButton.figma.js +41 -0
- package/lib/module/figma/IconButton.figma.js.map +1 -0
- package/lib/module/figma/Input.figma.js +46 -0
- package/lib/module/figma/Input.figma.js.map +1 -0
- package/lib/module/figma/Link.figma.js +24 -0
- package/lib/module/figma/Link.figma.js.map +1 -0
- package/lib/module/figma/ProgressSegmented.figma.js +33 -0
- package/lib/module/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/module/figma/Radio.figma.js +34 -0
- package/lib/module/figma/Radio.figma.js.map +1 -0
- package/lib/module/figma/Select.figma.js +47 -0
- package/lib/module/figma/Select.figma.js.map +1 -0
- package/lib/module/figma/Text.figma.js +23 -0
- package/lib/module/figma/Text.figma.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.js +22 -0
- package/lib/module/figma/icons.figma.batch.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.json +17705 -0
- package/lib/module/hooks/index.js +4 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useForgeBottomTabScreenOptions.js +242 -0
- package/lib/module/hooks/useForgeBottomTabScreenOptions.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/metro/withCdxMetroConfig.js +3 -17
- package/lib/module/metro/withCdxMetroConfig.js.map +1 -1
- package/lib/module/metro/withForgeMetroConfig.js +20 -0
- package/lib/module/metro/withForgeMetroConfig.js.map +1 -0
- package/lib/module/navigation/forgeTabIcon.js +39 -0
- package/lib/module/navigation/forgeTabIcon.js.map +1 -0
- package/lib/module/navigation/forgeTabIcon.native.js +31 -0
- package/lib/module/navigation/forgeTabIcon.native.js.map +1 -0
- package/lib/module/navigation/index.js +4 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/types.js +38 -0
- package/lib/module/navigation/types.js.map +1 -0
- package/lib/module/styles/primitives.js +43 -6
- package/lib/module/styles/primitives.js.map +1 -1
- package/lib/typescript/components/Avatar/styles.d.ts +4 -4
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts +13 -1
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +5 -3
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Card/index.d.ts +4 -3
- package/lib/typescript/components/Card/index.d.ts.map +1 -1
- package/lib/typescript/components/Card/styles.d.ts +13 -3
- package/lib/typescript/components/Card/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +1 -2
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -14
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +19 -6
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +13 -4
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +2 -2
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -1
- package/lib/typescript/components/Field/index.d.ts.map +1 -1
- package/lib/typescript/components/Field/styles.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts +1 -1
- package/lib/typescript/components/Icon/index.d.ts +5 -5
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts +3 -3
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/styles.d.ts +6 -2
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +2 -2
- package/lib/typescript/components/Link/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/styles.d.ts +9 -2
- package/lib/typescript/components/Link/styles.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
- package/lib/typescript/components/ProgressSegmented/index.d.ts +14 -3
- package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -1
- package/lib/typescript/components/Radio/index.d.ts +40 -0
- package/lib/typescript/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/components/Radio/styles.d.ts +8 -0
- package/lib/typescript/components/Radio/styles.d.ts.map +1 -0
- package/lib/typescript/components/ScopedTheme/index.d.ts +16 -0
- package/lib/typescript/components/ScopedTheme/index.d.ts.map +1 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +3 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +1 -1
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Stack/styles.d.ts +2 -2
- package/lib/typescript/components/Text/styles.d.ts +1 -1
- package/lib/typescript/components/Tile/index.d.ts +70 -0
- package/lib/typescript/components/Tile/index.d.ts.map +1 -0
- package/lib/typescript/components/Tile/styles.d.ts +18 -0
- package/lib/typescript/components/Tile/styles.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/Avatar.figma.d.ts +8 -0
- package/lib/typescript/figma/Avatar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Button.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Card.Header.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Card.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts +8 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Chip.figma.d.ts +8 -0
- package/lib/typescript/figma/Chip.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Heading.figma.d.ts +8 -0
- package/lib/typescript/figma/Heading.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Icon.figma.d.ts +8 -0
- package/lib/typescript/figma/Icon.figma.d.ts.map +1 -0
- package/lib/typescript/figma/IconButton.figma.d.ts +8 -0
- package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Link.figma.d.ts +8 -0
- package/lib/typescript/figma/Link.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts +8 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Radio.figma.d.ts +8 -0
- package/lib/typescript/figma/Radio.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Text.figma.d.ts +8 -0
- package/lib/typescript/figma/Text.figma.d.ts.map +1 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts +14 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts.map +1 -0
- package/lib/typescript/hooks/index.d.ts +2 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useForgeBottomTabScreenOptions.d.ts +137 -0
- package/lib/typescript/hooks/useForgeBottomTabScreenOptions.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/metro/withCdxMetroConfig.d.ts +4 -18
- package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -1
- package/lib/typescript/metro/withForgeMetroConfig.d.ts +19 -0
- package/lib/typescript/metro/withForgeMetroConfig.d.ts.map +1 -0
- package/lib/typescript/navigation/forgeTabIcon.d.ts +27 -0
- package/lib/typescript/navigation/forgeTabIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/forgeTabIcon.native.d.ts +15 -0
- package/lib/typescript/navigation/forgeTabIcon.native.d.ts.map +1 -0
- package/lib/typescript/navigation/index.d.ts +4 -0
- package/lib/typescript/navigation/index.d.ts.map +1 -0
- package/lib/typescript/navigation/types.d.ts +37 -0
- package/lib/typescript/navigation/types.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +38 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -1
- package/package.json +10 -8
- package/src/components/AlertDialog/index.tsx +1 -1
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Avatar/styles.ts +49 -34
- package/src/components/Button/index.tsx +39 -5
- package/src/components/Button/styles.ts +56 -27
- package/src/components/CLAUDE.md +90 -0
- package/src/components/Card/index.tsx +41 -16
- package/src/components/Card/styles.ts +42 -15
- package/src/components/Checkbox/index.tsx +8 -19
- package/src/components/Checkbox/styles.ts +82 -86
- package/src/components/Chip/index.tsx +104 -27
- package/src/components/Chip/styles.ts +232 -18
- package/src/components/Field/FieldLabel.web.tsx +1 -1
- package/src/components/Field/index.tsx +10 -3
- package/src/components/Field/styles.ts +5 -4
- package/src/components/Heading/styles.ts +1 -1
- package/src/components/Icon/index.tsx +6 -7
- package/src/components/IconButton/index.tsx +7 -6
- package/src/components/IconButton/styles.ts +136 -10
- package/src/components/Input/styles.ts +15 -9
- package/src/components/Link/index.tsx +22 -9
- package/src/components/Link/styles.ts +49 -9
- package/src/components/ListItem/styles.ts +12 -19
- package/src/components/ProgressSegmented/index.tsx +50 -14
- package/src/components/Radio/index.tsx +192 -0
- package/src/components/Radio/styles.ts +59 -0
- package/src/components/ScopedTheme/index.tsx +17 -0
- package/src/components/Select/SelectTriggerHost.web.tsx +8 -1
- package/src/components/Select/index.tsx +9 -4
- package/src/components/Select/styles.ts +49 -51
- package/src/components/Text/styles.ts +2 -2
- package/src/components/Tile/index.tsx +296 -0
- package/src/components/Tile/styles.ts +82 -0
- package/src/components/index.ts +3 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useForgeBottomTabScreenOptions.ts +245 -0
- package/src/index.ts +2 -0
- package/src/metro/withCdxMetroConfig.ts +4 -29
- package/src/metro/withForgeMetroConfig.ts +29 -0
- package/src/navigation/forgeTabIcon.native.ts +36 -0
- package/src/navigation/forgeTabIcon.ts +33 -0
- package/src/navigation/index.ts +3 -0
- package/src/navigation/types.ts +55 -0
- package/src/styles/primitives.ts +43 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef, useMemo } from 'react';
|
|
1
|
+
import { forwardRef, useEffect, useMemo } from 'react';
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { cn } from '@cdx-ui/utils';
|
|
4
4
|
import {
|
|
@@ -7,15 +7,32 @@ import {
|
|
|
7
7
|
type ProgressSegmentedVariants,
|
|
8
8
|
} from './styles';
|
|
9
9
|
|
|
10
|
+
/* `ProgressSegmentedProps.total` remains in the public API until the next major release. */
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
10
12
|
export interface ProgressSegmentedProps extends ViewProps, ProgressSegmentedVariants {
|
|
11
13
|
/** Current step (1-based index into the segment count) */
|
|
12
14
|
readonly step: number;
|
|
13
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Number of segments in the bar. Matches the Figma `segments` variant (2–6 in the design
|
|
17
|
+
* system file); the prop accepts any positive integer for backward compatibility.
|
|
18
|
+
*/
|
|
19
|
+
readonly segments?: number;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use {@link ProgressSegmentedProps.segments} instead. This alias will be removed
|
|
22
|
+
* in a future major release.
|
|
23
|
+
*/
|
|
14
24
|
readonly total?: number;
|
|
15
25
|
/** When true, the current step segment is marked as complete rather than in-progress */
|
|
16
26
|
readonly isStepComplete?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Returns the accessibility value text announced by screen readers. Receives the clamped
|
|
29
|
+
* step, segment count, and whether the step is complete.
|
|
30
|
+
*/
|
|
31
|
+
readonly getAccessibilityText?: (
|
|
32
|
+
step: number,
|
|
33
|
+
segmentCount: number,
|
|
34
|
+
isStepComplete: boolean,
|
|
35
|
+
) => string;
|
|
19
36
|
readonly className?: string;
|
|
20
37
|
}
|
|
21
38
|
|
|
@@ -23,7 +40,8 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
23
40
|
(
|
|
24
41
|
{
|
|
25
42
|
step,
|
|
26
|
-
|
|
43
|
+
segments,
|
|
44
|
+
total,
|
|
27
45
|
isStepComplete = false,
|
|
28
46
|
getAccessibilityText,
|
|
29
47
|
className,
|
|
@@ -32,10 +50,26 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
32
50
|
},
|
|
33
51
|
ref,
|
|
34
52
|
) => {
|
|
35
|
-
const
|
|
53
|
+
const segmentCount = segments ?? total ?? 5;
|
|
36
54
|
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
// TODO: Remove this once the `total` prop is removed.
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (
|
|
58
|
+
typeof process !== 'undefined' &&
|
|
59
|
+
process.env.NODE_ENV !== 'production' &&
|
|
60
|
+
total !== undefined &&
|
|
61
|
+
segments === undefined
|
|
62
|
+
) {
|
|
63
|
+
console.warn(
|
|
64
|
+
'[ProgressSegmented] The `total` prop is deprecated and will be removed in a future major release. Use `segments` instead.',
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}, [total, segments]);
|
|
68
|
+
|
|
69
|
+
const clampedStep = Math.max(0, Math.min(step, segmentCount));
|
|
70
|
+
|
|
71
|
+
const segmentStates = useMemo(() => {
|
|
72
|
+
return Array.from({ length: segmentCount }, (_, index) => {
|
|
39
73
|
const segmentIndex = index + 1;
|
|
40
74
|
let state: 'complete' | 'incomplete' | 'inprogress' = 'incomplete';
|
|
41
75
|
|
|
@@ -47,13 +81,13 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
47
81
|
|
|
48
82
|
return state;
|
|
49
83
|
});
|
|
50
|
-
}, [
|
|
84
|
+
}, [segmentCount, clampedStep, isStepComplete]);
|
|
51
85
|
|
|
52
|
-
let accessibilityText = `Step ${String(clampedStep)} of ${String(
|
|
86
|
+
let accessibilityText = `Step ${String(clampedStep)} of ${String(segmentCount)}`;
|
|
53
87
|
if (getAccessibilityText) {
|
|
54
|
-
accessibilityText = getAccessibilityText(clampedStep,
|
|
88
|
+
accessibilityText = getAccessibilityText(clampedStep, segmentCount, isStepComplete);
|
|
55
89
|
} else if (isStepComplete) {
|
|
56
|
-
accessibilityText = `Step ${String(clampedStep)} of ${String(
|
|
90
|
+
accessibilityText = `Step ${String(clampedStep)} of ${String(segmentCount)}, completed`;
|
|
57
91
|
}
|
|
58
92
|
|
|
59
93
|
return (
|
|
@@ -63,14 +97,14 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
63
97
|
accessibilityLabel={accessibilityLabel}
|
|
64
98
|
accessibilityValue={{
|
|
65
99
|
min: 0,
|
|
66
|
-
max:
|
|
100
|
+
max: segmentCount,
|
|
67
101
|
now: clampedStep,
|
|
68
102
|
text: accessibilityText,
|
|
69
103
|
}}
|
|
70
104
|
className={cn(progressSegmentedVariants(), className)}
|
|
71
105
|
{...props}
|
|
72
106
|
>
|
|
73
|
-
{
|
|
107
|
+
{segmentStates.map((state, index) => (
|
|
74
108
|
<View key={index} className={cn(segmentVariants({ state }))} />
|
|
75
109
|
))}
|
|
76
110
|
</View>
|
|
@@ -79,3 +113,5 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
79
113
|
);
|
|
80
114
|
|
|
81
115
|
ProgressSegmented.displayName = 'ProgressSegmented';
|
|
116
|
+
|
|
117
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
+
import { Pressable, Text, type TextProps, View, type ViewProps } from 'react-native';
|
|
3
|
+
import { createRadio, dataAttributes, type IRadioProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { cn } from '@cdx-ui/utils';
|
|
5
|
+
import {
|
|
6
|
+
radioGroupVariants,
|
|
7
|
+
radioIndicatorVariants,
|
|
8
|
+
radioInnerDotVariants,
|
|
9
|
+
radioLabelVariants,
|
|
10
|
+
radioRootVariants,
|
|
11
|
+
} from './styles';
|
|
12
|
+
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// STYLED INDICATOR BASE
|
|
15
|
+
// =============================================================================
|
|
16
|
+
|
|
17
|
+
const RadioIndicatorBase = forwardRef<View, ViewProps & { className?: string }>(
|
|
18
|
+
({ className, children, style, ...props }, ref) => {
|
|
19
|
+
// On web, data attributes arrive as `dataSet: { checked: true }`.
|
|
20
|
+
// On native, they arrive as individual `data-checked: "true"` props.
|
|
21
|
+
const ds = (props as any).dataSet;
|
|
22
|
+
const isChecked = ds ? ds.checked === true : (props as any)['data-checked'] === 'true';
|
|
23
|
+
const isInvalid = ds ? ds.invalid === true : (props as any)['data-invalid'] === 'true';
|
|
24
|
+
const isHovered = ds ? ds.hover === true : (props as any)['data-hover'] === 'true';
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<View ref={ref} className={cn(radioIndicatorVariants(), className)} style={style} {...props}>
|
|
28
|
+
<View
|
|
29
|
+
className={cn(radioInnerDotVariants())}
|
|
30
|
+
{...dataAttributes({ checked: isChecked, invalid: isInvalid, hover: isHovered })}
|
|
31
|
+
/>
|
|
32
|
+
{children}
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
RadioIndicatorBase.displayName = 'Radio.IndicatorBase';
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// PRIMITIVE ASSEMBLY
|
|
42
|
+
// =============================================================================
|
|
43
|
+
|
|
44
|
+
const RadioPrimitive = createRadio({
|
|
45
|
+
Root: Pressable,
|
|
46
|
+
Indicator: RadioIndicatorBase,
|
|
47
|
+
Label: Text,
|
|
48
|
+
Group: View,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// =============================================================================
|
|
52
|
+
// RADIO ROOT
|
|
53
|
+
// =============================================================================
|
|
54
|
+
|
|
55
|
+
export interface RadioProps extends IRadioProps {
|
|
56
|
+
className?: string;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const RadioRoot = forwardRef<View, RadioProps>(({ className, children, style, ...props }, ref) => {
|
|
61
|
+
const computedClassName = cn(radioRootVariants(), className);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<RadioPrimitive ref={ref as any} className={computedClassName} style={style} {...props}>
|
|
65
|
+
{children}
|
|
66
|
+
</RadioPrimitive>
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
RadioRoot.displayName = 'Radio';
|
|
71
|
+
|
|
72
|
+
// =============================================================================
|
|
73
|
+
// RADIO INDICATOR
|
|
74
|
+
// =============================================================================
|
|
75
|
+
|
|
76
|
+
export interface RadioIndicatorProps extends ViewProps {
|
|
77
|
+
className?: string;
|
|
78
|
+
children?: ReactNode;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const RadioIndicator = forwardRef<View, RadioIndicatorProps>(
|
|
82
|
+
({ className, children, style, ...props }, ref) => {
|
|
83
|
+
return (
|
|
84
|
+
<RadioPrimitive.Indicator ref={ref as any} className={className} style={style} {...props}>
|
|
85
|
+
{children}
|
|
86
|
+
</RadioPrimitive.Indicator>
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
RadioIndicator.displayName = 'Radio.Indicator';
|
|
92
|
+
|
|
93
|
+
// =============================================================================
|
|
94
|
+
// RADIO LABEL
|
|
95
|
+
// =============================================================================
|
|
96
|
+
|
|
97
|
+
export interface RadioLabelProps extends TextProps {
|
|
98
|
+
className?: string;
|
|
99
|
+
children?: ReactNode;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const RadioLabel = forwardRef<Text, RadioLabelProps>(
|
|
103
|
+
({ className, children, style, ...props }, ref) => {
|
|
104
|
+
const computedClassName = cn(radioLabelVariants(), className);
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<RadioPrimitive.Label ref={ref as any} className={computedClassName} style={style} {...props}>
|
|
108
|
+
{children}
|
|
109
|
+
</RadioPrimitive.Label>
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
RadioLabel.displayName = 'Radio.Label';
|
|
115
|
+
|
|
116
|
+
// =============================================================================
|
|
117
|
+
// RADIO GROUP
|
|
118
|
+
// =============================================================================
|
|
119
|
+
|
|
120
|
+
export interface RadioGroupProps extends ViewProps {
|
|
121
|
+
className?: string;
|
|
122
|
+
children?: ReactNode;
|
|
123
|
+
value?: string;
|
|
124
|
+
defaultValue?: string;
|
|
125
|
+
onChange?: (value: string) => void;
|
|
126
|
+
isDisabled?: boolean;
|
|
127
|
+
isInvalid?: boolean;
|
|
128
|
+
isRequired?: boolean;
|
|
129
|
+
isReadOnly?: boolean;
|
|
130
|
+
direction?: 'column' | 'row';
|
|
131
|
+
name?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const RadioGroup = forwardRef<View, RadioGroupProps>(
|
|
135
|
+
(
|
|
136
|
+
{
|
|
137
|
+
className,
|
|
138
|
+
children,
|
|
139
|
+
style,
|
|
140
|
+
direction = 'column',
|
|
141
|
+
value,
|
|
142
|
+
defaultValue,
|
|
143
|
+
onChange,
|
|
144
|
+
isDisabled,
|
|
145
|
+
isInvalid,
|
|
146
|
+
isRequired,
|
|
147
|
+
isReadOnly,
|
|
148
|
+
name,
|
|
149
|
+
...viewProps
|
|
150
|
+
},
|
|
151
|
+
ref,
|
|
152
|
+
) => {
|
|
153
|
+
const computedClassName = cn(radioGroupVariants({ direction }), className);
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<RadioPrimitive.Group
|
|
157
|
+
ref={ref as any}
|
|
158
|
+
className={computedClassName}
|
|
159
|
+
style={style}
|
|
160
|
+
value={value}
|
|
161
|
+
defaultValue={defaultValue}
|
|
162
|
+
onChange={onChange}
|
|
163
|
+
isDisabled={isDisabled}
|
|
164
|
+
isInvalid={isInvalid}
|
|
165
|
+
isRequired={isRequired}
|
|
166
|
+
isReadOnly={isReadOnly}
|
|
167
|
+
name={name}
|
|
168
|
+
{...viewProps}
|
|
169
|
+
>
|
|
170
|
+
{children}
|
|
171
|
+
</RadioPrimitive.Group>
|
|
172
|
+
);
|
|
173
|
+
},
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
RadioGroup.displayName = 'Radio.Group';
|
|
177
|
+
|
|
178
|
+
// =============================================================================
|
|
179
|
+
// COMPOUND COMPONENT
|
|
180
|
+
// =============================================================================
|
|
181
|
+
|
|
182
|
+
type RadioCompoundComponent = typeof RadioRoot & {
|
|
183
|
+
Indicator: typeof RadioIndicator;
|
|
184
|
+
Label: typeof RadioLabel;
|
|
185
|
+
Group: typeof RadioGroup;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export const Radio = Object.assign(RadioRoot, {
|
|
189
|
+
Indicator: RadioIndicator,
|
|
190
|
+
Label: RadioLabel,
|
|
191
|
+
Group: RadioGroup,
|
|
192
|
+
}) as RadioCompoundComponent;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
4
|
+
|
|
5
|
+
export const radioRootVariants = cva([
|
|
6
|
+
'flex-row items-center gap-2',
|
|
7
|
+
'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
|
|
8
|
+
DISABLED_CURSOR,
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
export const radioIndicatorVariants = cva([
|
|
12
|
+
'items-center justify-center',
|
|
13
|
+
'rounded-[var(--border-radius-round)]',
|
|
14
|
+
'border-2',
|
|
15
|
+
'h-5 w-5',
|
|
16
|
+
'bg-surface-primary',
|
|
17
|
+
'data-[checked=false]:border-content-secondary',
|
|
18
|
+
'data-[checked=true]:border-stroke-action',
|
|
19
|
+
'data-[invalid=true]:border-stroke-danger',
|
|
20
|
+
'data-[checked=true]:data-[invalid=true]:border-stroke-danger',
|
|
21
|
+
Platform.select({
|
|
22
|
+
web: [
|
|
23
|
+
TRANSITION_COLORS,
|
|
24
|
+
'data-[hover=true]:data-[checked=true]:border-surface-action-strong-hover',
|
|
25
|
+
'data-[hover=true]:data-[invalid=true]:border-surface-danger-strong-hover',
|
|
26
|
+
'web:data-[focus-visible=true]:outline-none',
|
|
27
|
+
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[var(--color-stroke-ring)] web:data-[focus-visible=true]:ring-offset-2',
|
|
28
|
+
].join(' '),
|
|
29
|
+
default: '',
|
|
30
|
+
}),
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
export const radioInnerDotVariants = cva([
|
|
34
|
+
'rounded-[var(--border-radius-round)]',
|
|
35
|
+
'h-2.5 w-2.5',
|
|
36
|
+
'scale-0',
|
|
37
|
+
'data-[checked=true]:scale-100',
|
|
38
|
+
'bg-surface-action-strong',
|
|
39
|
+
'data-[invalid=true]:bg-surface-danger-strong',
|
|
40
|
+
Platform.select({
|
|
41
|
+
web: [
|
|
42
|
+
'data-[hover=true]:bg-surface-action-strong-hover',
|
|
43
|
+
'data-[hover=true]:data-[invalid=true]:bg-surface-danger-strong-hover',
|
|
44
|
+
].join(' '),
|
|
45
|
+
default: '',
|
|
46
|
+
}),
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
export const radioLabelVariants = cva(['body-md', 'text-content-primary']);
|
|
50
|
+
|
|
51
|
+
export const radioGroupVariants = cva([], {
|
|
52
|
+
variants: {
|
|
53
|
+
direction: {
|
|
54
|
+
column: 'gap-2',
|
|
55
|
+
row: 'flex-row gap-4',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
defaultVariants: { direction: 'column' },
|
|
59
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { ScopedTheme as UniwindScopedTheme } from 'uniwind';
|
|
3
|
+
|
|
4
|
+
export type ScopedThemeProps = ComponentProps<typeof UniwindScopedTheme>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Forces a specific theme on a component subtree, regardless of the application's
|
|
8
|
+
* global theme. Useful for marketing heroes, embedded widgets, or preview surfaces
|
|
9
|
+
* that must render in a fixed mode.
|
|
10
|
+
*
|
|
11
|
+
* Wraps Uniwind's `ScopedTheme` to keep `uniwind` an internal implementation detail.
|
|
12
|
+
*
|
|
13
|
+
* Web requires `@custom-variant dark (&:where(.dark, .dark *));` in the consuming
|
|
14
|
+
* app's `global.css`. See the Storybook story (`Theming/ScopedTheme`) for the full
|
|
15
|
+
* mechanism, light-vs-dark asymmetry, and dynamic-switch caveat.
|
|
16
|
+
*/
|
|
17
|
+
export const ScopedTheme = (props: ScopedThemeProps) => <UniwindScopedTheme {...props} />;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import type { PressableProps } from 'react-native';
|
|
4
|
+
import { domDataAttributes, type DomDataAttributeValue } from '@cdx-ui/primitives';
|
|
4
5
|
|
|
5
|
-
export type SelectTriggerHostProps = PressableProps & {
|
|
6
|
+
export type SelectTriggerHostProps = PressableProps & {
|
|
7
|
+
className?: string;
|
|
8
|
+
dataSet?: Record<string, DomDataAttributeValue>;
|
|
9
|
+
};
|
|
6
10
|
|
|
7
11
|
/** Props that must not be forwarded to a DOM `<button>`. */
|
|
8
12
|
const OMIT = new Set<string>([
|
|
@@ -91,16 +95,19 @@ export const SelectTriggerHost = forwardRef<HTMLButtonElement, SelectTriggerHost
|
|
|
91
95
|
style,
|
|
92
96
|
className,
|
|
93
97
|
testID,
|
|
98
|
+
dataSet,
|
|
94
99
|
...rest
|
|
95
100
|
} = props;
|
|
96
101
|
|
|
97
102
|
const domProps = filterDomProps(rest);
|
|
103
|
+
const dataAttrs = domDataAttributes(dataSet ?? {});
|
|
98
104
|
const flattened = StyleSheet.flatten(style) as React.CSSProperties | undefined;
|
|
99
105
|
|
|
100
106
|
return (
|
|
101
107
|
<button
|
|
102
108
|
ref={ref}
|
|
103
109
|
{...domProps}
|
|
110
|
+
{...dataAttrs}
|
|
104
111
|
type="button"
|
|
105
112
|
disabled={!!disabled}
|
|
106
113
|
className={typeof className === 'string' ? className : undefined}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef, type ReactNode } from 'react';
|
|
2
2
|
import { Pressable, Text, type TextProps, View, type ViewProps } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { KeyboardArrowDown } from '@cdx-ui/icons';
|
|
4
4
|
import {
|
|
5
5
|
createSelect,
|
|
6
6
|
type ISelectContentProps,
|
|
@@ -83,7 +83,7 @@ const SelectTrigger = forwardRef<View, SelectTriggerProps>(
|
|
|
83
83
|
return (
|
|
84
84
|
<SelectPrimitive.Trigger ref={ref} className={computedClassName} style={style} {...props}>
|
|
85
85
|
{children}
|
|
86
|
-
<SelectIcon as={
|
|
86
|
+
<SelectIcon as={KeyboardArrowDown} />
|
|
87
87
|
</SelectPrimitive.Trigger>
|
|
88
88
|
);
|
|
89
89
|
},
|
|
@@ -115,12 +115,17 @@ SelectValue.displayName = 'Select.Value';
|
|
|
115
115
|
|
|
116
116
|
export interface SelectIconProps extends Omit<IconProps, 'children'> {}
|
|
117
117
|
|
|
118
|
-
const SelectIcon = ({ className, style, ...props }: SelectIconProps) => {
|
|
118
|
+
const SelectIcon = ({ className, style, as: IconComponent, ...props }: SelectIconProps) => {
|
|
119
119
|
const { size } = useSelectStyleContext();
|
|
120
120
|
|
|
121
121
|
const computedClassName = cn(selectIconVariants({ size }), className);
|
|
122
|
+
const iconSizeClass = size === 'small' ? 'size-4' : 'size-5';
|
|
122
123
|
|
|
123
|
-
return
|
|
124
|
+
return (
|
|
125
|
+
<SelectPrimitive.Icon className={computedClassName} style={style}>
|
|
126
|
+
<Icon as={IconComponent} className={iconSizeClass} {...props} />
|
|
127
|
+
</SelectPrimitive.Icon>
|
|
128
|
+
);
|
|
124
129
|
};
|
|
125
130
|
|
|
126
131
|
SelectIcon.displayName = 'Select.Icon';
|
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import {
|
|
4
|
-
COLOR_BG_PRIMARY,
|
|
5
|
-
COLOR_BORDER_DEFAULT,
|
|
6
|
-
COLOR_TEXT_MUTED,
|
|
7
|
-
COLOR_TEXT_PRIMARY,
|
|
8
|
-
DISABLED_CURSOR,
|
|
9
|
-
DISABLED_OPACITY,
|
|
10
|
-
RADIUS_SM,
|
|
11
|
-
RADIUS_MD,
|
|
12
|
-
SHADOW_SM,
|
|
13
|
-
SHADOW_MD,
|
|
14
|
-
SIZE_SCALE,
|
|
15
|
-
TRANSITION_COLORS,
|
|
16
|
-
} from '../../styles/primitives';
|
|
3
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
17
4
|
|
|
18
5
|
// ── Trigger ─────────────────────────────────────────────────
|
|
19
6
|
|
|
20
7
|
export const selectTriggerVariants = cva(
|
|
21
8
|
[
|
|
22
9
|
'flex w-full min-w-0 flex-row items-center justify-between text-start',
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
'bg-surface-primary',
|
|
11
|
+
'border border-stroke-primary',
|
|
12
|
+
'rounded-[var(--border-radius-default)]',
|
|
25
13
|
TRANSITION_COLORS,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DISABLED_OPACITY,
|
|
14
|
+
'data-[disabled=true]:bg-surface-secondary',
|
|
15
|
+
'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
|
|
29
16
|
DISABLED_CURSOR,
|
|
30
17
|
'data-[readonly=true]:cursor-default',
|
|
31
|
-
'data-[
|
|
32
|
-
'data-[
|
|
33
|
-
'data-[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
].join(' '),
|
|
41
|
-
}),
|
|
18
|
+
'data-[readonly=true]:bg-surface-secondary',
|
|
19
|
+
'web:data-[hover=true]:data-[focus=false]:data-[invalid=false]:border-stroke-hover',
|
|
20
|
+
'data-[focus=true]:border-[length:var(--border-width-focused)]',
|
|
21
|
+
'data-[focus=true]:data-[invalid=false]:border-stroke-action',
|
|
22
|
+
'data-[focus=true]:data-[invalid=true]:border-stroke-danger',
|
|
23
|
+
'data-[state=open]:border-[length:var(--border-width-focused)]',
|
|
24
|
+
'data-[state=open]:data-[invalid=false]:border-stroke-action',
|
|
25
|
+
'data-[state=open]:data-[invalid=true]:border-stroke-danger',
|
|
26
|
+
'data-[invalid=true]:border-stroke-danger',
|
|
42
27
|
],
|
|
43
28
|
{
|
|
44
29
|
variants: {
|
|
@@ -46,8 +31,20 @@ export const selectTriggerVariants = cva(
|
|
|
46
31
|
outline: [],
|
|
47
32
|
},
|
|
48
33
|
size: {
|
|
49
|
-
default:
|
|
50
|
-
|
|
34
|
+
default: [
|
|
35
|
+
'h-11 min-h-11 px-4 py-3 gap-4',
|
|
36
|
+
'data-[focus=true]:px-[calc(var(--spacing-4)-var(--spacing-px))]',
|
|
37
|
+
'data-[focus=true]:py-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
38
|
+
'data-[state=open]:px-[calc(var(--spacing-4)-var(--spacing-px))]',
|
|
39
|
+
'data-[state=open]:py-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
40
|
+
],
|
|
41
|
+
small: [
|
|
42
|
+
'h-8 min-h-8 px-3 py-2 gap-1.5',
|
|
43
|
+
'data-[focus=true]:px-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
44
|
+
'data-[focus=true]:py-[calc(var(--spacing-2)-var(--spacing-px))]',
|
|
45
|
+
'data-[state=open]:px-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
46
|
+
'data-[state=open]:py-[calc(var(--spacing-2)-var(--spacing-px))]',
|
|
47
|
+
],
|
|
51
48
|
},
|
|
52
49
|
},
|
|
53
50
|
defaultVariants: {
|
|
@@ -62,15 +59,15 @@ export const selectTriggerVariants = cva(
|
|
|
62
59
|
export const selectValueVariants = cva(
|
|
63
60
|
[
|
|
64
61
|
'min-w-0 flex-1 text-start',
|
|
65
|
-
'
|
|
66
|
-
'data-[
|
|
67
|
-
|
|
62
|
+
'text-content-primary',
|
|
63
|
+
'data-[placeholder=true]:text-content-tertiary',
|
|
64
|
+
'data-[invalid=true]:text-content-danger',
|
|
68
65
|
],
|
|
69
66
|
{
|
|
70
67
|
variants: {
|
|
71
68
|
size: {
|
|
72
|
-
default:
|
|
73
|
-
small:
|
|
69
|
+
default: 'text-[0.875rem]',
|
|
70
|
+
small: 'text-[0.75rem]',
|
|
74
71
|
},
|
|
75
72
|
},
|
|
76
73
|
defaultVariants: {
|
|
@@ -84,14 +81,15 @@ export const selectValueVariants = cva(
|
|
|
84
81
|
export const selectIconVariants = cva(
|
|
85
82
|
[
|
|
86
83
|
'shrink-0 items-center justify-center self-center',
|
|
87
|
-
|
|
88
|
-
'data-[invalid=true]:text-
|
|
84
|
+
'text-content-tertiary',
|
|
85
|
+
'data-[invalid=true]:text-content-danger',
|
|
86
|
+
'data-[state=open]:rotate-180',
|
|
89
87
|
],
|
|
90
88
|
{
|
|
91
89
|
variants: {
|
|
92
90
|
size: {
|
|
93
|
-
default: '
|
|
94
|
-
small: '
|
|
91
|
+
default: 'size-5',
|
|
92
|
+
small: 'size-4',
|
|
95
93
|
},
|
|
96
94
|
},
|
|
97
95
|
defaultVariants: {
|
|
@@ -103,12 +101,12 @@ export const selectIconVariants = cva(
|
|
|
103
101
|
// ── Content ─────────────────────────────────────────────────
|
|
104
102
|
|
|
105
103
|
export const selectContentVariants = cva([
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
'bg-surface-primary',
|
|
105
|
+
'border border-stroke-secondary',
|
|
108
106
|
'overflow-hidden',
|
|
109
|
-
|
|
107
|
+
'rounded-xl',
|
|
110
108
|
Platform.select({
|
|
111
|
-
web:
|
|
109
|
+
web: 'shadow-sm',
|
|
112
110
|
default: '',
|
|
113
111
|
}),
|
|
114
112
|
'max-h-60',
|
|
@@ -122,10 +120,10 @@ export const selectItemVariants = cva(
|
|
|
122
120
|
'flex-row items-center',
|
|
123
121
|
'transition-colors duration-100',
|
|
124
122
|
'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none',
|
|
125
|
-
'data-[state=checked]:bg-
|
|
123
|
+
'data-[state=checked]:bg-surface-action-tint data-[state=checked]:font-medium',
|
|
126
124
|
Platform.select({
|
|
127
|
-
default: 'data-[active=true]:bg-
|
|
128
|
-
web: 'data-[hover=true]:bg-
|
|
125
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
126
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active data-[highlighted=true]:bg-surface-action-tint-hover',
|
|
129
127
|
}),
|
|
130
128
|
],
|
|
131
129
|
{
|
|
@@ -144,12 +142,12 @@ export const selectItemVariants = cva(
|
|
|
144
142
|
// ── ItemLabel ───────────────────────────────────────────────
|
|
145
143
|
|
|
146
144
|
export const selectItemLabelVariants = cva(
|
|
147
|
-
[
|
|
145
|
+
['text-content-primary', 'data-[state=checked]:font-medium'],
|
|
148
146
|
{
|
|
149
147
|
variants: {
|
|
150
148
|
size: {
|
|
151
|
-
default:
|
|
152
|
-
small:
|
|
149
|
+
default: 'text-[0.875rem]',
|
|
150
|
+
small: 'text-[0.75rem]',
|
|
153
151
|
},
|
|
154
152
|
},
|
|
155
153
|
defaultVariants: {
|
|
@@ -3,9 +3,9 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
|
|
4
4
|
export const textStyle = cva(
|
|
5
5
|
[
|
|
6
|
-
|
|
6
|
+
'text-content-primary',
|
|
7
7
|
Platform.select({
|
|
8
|
-
web: 'font-
|
|
8
|
+
web: 'font-body my-0 bg-transparent no-underline',
|
|
9
9
|
default: '',
|
|
10
10
|
}),
|
|
11
11
|
],
|