@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
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
IFieldLabelProps,
|
|
9
9
|
type IFieldRootProps,
|
|
10
10
|
} from '@cdx-ui/primitives';
|
|
11
|
-
import { cn } from '@cdx-ui/utils';
|
|
11
|
+
import { cn, useFormControlContext } from '@cdx-ui/utils';
|
|
12
12
|
import { Icon } from '../Icon';
|
|
13
13
|
import { BaseFieldLabel } from './FieldLabel';
|
|
14
14
|
import {
|
|
@@ -70,7 +70,14 @@ export interface FieldLabelProps extends IFieldLabelProps, FieldLabelVariantProp
|
|
|
70
70
|
|
|
71
71
|
const FieldLabel = forwardRef<View, FieldLabelProps>(
|
|
72
72
|
({ className, children, style, htmlFor, ...props }, ref) => {
|
|
73
|
-
const
|
|
73
|
+
const { isLabelFocused, isInvalid } = useFormControlContext();
|
|
74
|
+
// Native: inject text-content-action via context (group-has CSS handles web).
|
|
75
|
+
// native: prefix keeps this class inert on web so it never conflicts with text-content-primary.
|
|
76
|
+
const labelClassName = cn(
|
|
77
|
+
fieldLabelVariants(),
|
|
78
|
+
isLabelFocused && !isInvalid && 'native:text-content-action',
|
|
79
|
+
className,
|
|
80
|
+
);
|
|
74
81
|
|
|
75
82
|
return (
|
|
76
83
|
<FieldPrimitive.Label
|
|
@@ -79,7 +86,7 @@ const FieldLabel = forwardRef<View, FieldLabelProps>(
|
|
|
79
86
|
style={style}
|
|
80
87
|
htmlFor={htmlFor}
|
|
81
88
|
requiredIndicator={
|
|
82
|
-
<Text className="text-
|
|
89
|
+
<Text className="text-content-danger" aria-hidden>
|
|
83
90
|
{' *'}
|
|
84
91
|
</Text>
|
|
85
92
|
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { DISABLED_OPACITY } from '../../styles/primitives';
|
|
3
3
|
|
|
4
|
-
export const fieldRootVariants = cva(['flex-col gap-2', 'web:last:mb-0', DISABLED_OPACITY]);
|
|
4
|
+
export const fieldRootVariants = cva(['group flex-col gap-2', 'web:last:mb-0', DISABLED_OPACITY]);
|
|
5
5
|
|
|
6
6
|
export const fieldLabelVariants = cva([
|
|
7
7
|
'body-md',
|
|
8
8
|
'font-medium',
|
|
9
9
|
'text-content-primary',
|
|
10
10
|
'flex-row items-center',
|
|
11
|
-
|
|
11
|
+
'overflow-hidden',
|
|
12
12
|
'web:cursor-pointer',
|
|
13
|
+
'web:group-has-[[data-focus=true]]:data-[invalid=false]:text-content-action',
|
|
13
14
|
'data-[invalid=true]:text-content-danger',
|
|
14
15
|
]);
|
|
15
16
|
|
|
16
|
-
export const fieldHelperVariants = cva(['flex-row items-center']);
|
|
17
|
+
export const fieldHelperVariants = cva(['flex-row items-center min-h-4']);
|
|
17
18
|
|
|
18
19
|
export const fieldHelperTextVariants = cva(['body-sm', 'text-content-tertiary']);
|
|
19
20
|
|
|
20
|
-
export const fieldErrorVariants = cva(['flex-row items-center gap-
|
|
21
|
+
export const fieldErrorVariants = cva(['flex-row items-center gap-0.5 min-h-4']);
|
|
21
22
|
|
|
22
23
|
export const fieldErrorTextVariants = cva(['body-sm', 'text-content-danger']);
|
|
23
24
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { withUniwind } from 'uniwind';
|
|
2
2
|
import { cn } from '@cdx-ui/utils';
|
|
3
|
-
import type {
|
|
4
|
-
import { COLOR_TEXT_PRIMARY } from '../../styles/primitives';
|
|
3
|
+
import type { ForgeIcon, ForgeIconProps } from '@cdx-ui/icons';
|
|
5
4
|
|
|
6
|
-
export type IconProps =
|
|
5
|
+
export type IconProps = ForgeIconProps & {
|
|
7
6
|
className?: string; // TODO: Why does this need to specified manually?
|
|
8
|
-
as:
|
|
7
|
+
as: ForgeIcon;
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
function IconImpl({ as: IconComponent, ...props }: IconProps) {
|
|
@@ -38,16 +37,16 @@ const StyledIcon = withUniwind(IconImpl, {
|
|
|
38
37
|
* <Icon as={ArrowRight} className="text-red-500 size-4" />
|
|
39
38
|
* ```
|
|
40
39
|
*
|
|
41
|
-
* @param {
|
|
40
|
+
* @param {ForgeIcon} as - The Forge icon component to render.
|
|
42
41
|
* @param {string} className - Utility classes to style the icon using Uniwind.
|
|
43
42
|
* @param {number} size - Icon size (overrides the size class).
|
|
44
|
-
* @param {...
|
|
43
|
+
* @param {...ForgeIconProps} ...props - Additional icon props passed to the "as" icon.
|
|
45
44
|
*/
|
|
46
45
|
export function Icon({ as: IconComponent, className, ...props }: IconProps) {
|
|
47
46
|
return (
|
|
48
47
|
<StyledIcon
|
|
49
48
|
as={IconComponent}
|
|
50
|
-
className={cn(
|
|
49
|
+
className={cn('text-content-primary size-5', className)}
|
|
51
50
|
{...props}
|
|
52
51
|
/>
|
|
53
52
|
);
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type IButtonProps,
|
|
7
7
|
useButtonContext,
|
|
8
8
|
} from '@cdx-ui/primitives';
|
|
9
|
-
import type {
|
|
9
|
+
import type { ForgeIcon } from '@cdx-ui/icons';
|
|
10
10
|
import { cn } from '@cdx-ui/utils';
|
|
11
11
|
import { Icon, type IconProps } from '../Icon';
|
|
12
12
|
import {
|
|
@@ -24,7 +24,7 @@ const IconButtonPrimitive = createButton({
|
|
|
24
24
|
Icon: View,
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
function IconButtonGlyph({ as: IconComponent, className }: { as:
|
|
27
|
+
function IconButtonGlyph({ as: IconComponent, className }: { as: ForgeIcon; className: string }) {
|
|
28
28
|
const { hover, focus, active, disabled, focusVisible } = useButtonContext();
|
|
29
29
|
return (
|
|
30
30
|
<Icon
|
|
@@ -43,8 +43,8 @@ function IconButtonGlyph({ as: IconComponent, className }: { as: CdxIcon; classN
|
|
|
43
43
|
|
|
44
44
|
export interface IconButtonProps extends PressableProps, IButtonProps, IconButtonVariantProps {
|
|
45
45
|
className?: string;
|
|
46
|
-
/**
|
|
47
|
-
as:
|
|
46
|
+
/** Forge icon component to render (icon-only control). */
|
|
47
|
+
as: ForgeIcon;
|
|
48
48
|
/** Passed through to the underlying `Icon`. */
|
|
49
49
|
iconClassName?: IconProps['className'];
|
|
50
50
|
}
|
|
@@ -53,6 +53,7 @@ const IconButtonRoot = forwardRef<View, IconButtonProps>(
|
|
|
53
53
|
(
|
|
54
54
|
{
|
|
55
55
|
variant = 'solid',
|
|
56
|
+
color = 'neutral',
|
|
56
57
|
size = 'default',
|
|
57
58
|
className,
|
|
58
59
|
style,
|
|
@@ -63,11 +64,11 @@ const IconButtonRoot = forwardRef<View, IconButtonProps>(
|
|
|
63
64
|
},
|
|
64
65
|
ref,
|
|
65
66
|
) => {
|
|
66
|
-
const rootClassName = cn(iconButtonRootVariants({ variant, size }), className);
|
|
67
|
+
const rootClassName = cn(iconButtonRootVariants({ variant, color, size }), className);
|
|
67
68
|
|
|
68
69
|
const glyphClassName = cn(
|
|
69
70
|
iconButtonGlyphVariants({ size }),
|
|
70
|
-
iconButtonIconColorVariants(),
|
|
71
|
+
iconButtonIconColorVariants({ variant, color }),
|
|
71
72
|
iconClassName,
|
|
72
73
|
);
|
|
73
74
|
|
|
@@ -8,35 +8,133 @@ export const iconButtonRootVariants = cva(
|
|
|
8
8
|
'rounded-[var(--border-radius-round)]',
|
|
9
9
|
'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
|
|
10
10
|
TRANSITION_COLORS,
|
|
11
|
-
'data-[disabled=true]:opacity-[--opacity-disabled]',
|
|
11
|
+
'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
|
|
12
12
|
DISABLED_CURSOR,
|
|
13
|
-
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[--color-stroke-ring] web:data-[focus-visible=true]:ring-offset-2',
|
|
13
|
+
'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',
|
|
14
14
|
],
|
|
15
15
|
{
|
|
16
16
|
variants: {
|
|
17
17
|
variant: {
|
|
18
|
-
solid: [
|
|
18
|
+
solid: [],
|
|
19
|
+
tint: [],
|
|
20
|
+
ghost: ['bg-transparent'],
|
|
21
|
+
},
|
|
22
|
+
color: {
|
|
23
|
+
neutral: [],
|
|
24
|
+
action: [],
|
|
25
|
+
danger: [],
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
default: 'h-11 w-11 min-w-11 shrink-0 p-2.5',
|
|
29
|
+
small: 'h-8 w-8 min-w-8 shrink-0 p-1.5',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
// ── solid × color ───────────────────────────────────────────────────
|
|
34
|
+
{
|
|
35
|
+
variant: 'solid',
|
|
36
|
+
color: 'neutral',
|
|
37
|
+
className: [
|
|
19
38
|
'bg-surface-primary border border-stroke-secondary',
|
|
20
39
|
Platform.select({
|
|
21
40
|
default: 'data-[active=true]:bg-surface-primary-active',
|
|
22
41
|
web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active',
|
|
23
42
|
}),
|
|
24
43
|
],
|
|
25
|
-
|
|
26
|
-
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
variant: 'solid',
|
|
47
|
+
color: 'action',
|
|
48
|
+
className: [
|
|
49
|
+
'bg-surface-action-strong',
|
|
50
|
+
Platform.select({
|
|
51
|
+
default: 'data-[active=true]:bg-surface-action-strong-active',
|
|
52
|
+
web: 'data-[hover=true]:bg-surface-action-strong-hover data-[active=true]:data-[hover=true]:bg-surface-action-strong-active',
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
variant: 'solid',
|
|
58
|
+
color: 'danger',
|
|
59
|
+
className: [
|
|
60
|
+
'bg-surface-danger-strong',
|
|
61
|
+
Platform.select({
|
|
62
|
+
default: 'data-[active=true]:bg-surface-danger-strong-active',
|
|
63
|
+
web: 'data-[hover=true]:bg-surface-danger-strong-hover data-[active=true]:data-[hover=true]:bg-surface-danger-strong-active',
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// ── tint × color ─────────────────────────────────────────────────
|
|
69
|
+
{
|
|
70
|
+
variant: 'tint',
|
|
71
|
+
color: 'neutral',
|
|
72
|
+
className: [
|
|
73
|
+
'bg-surface-neutral-tint',
|
|
74
|
+
Platform.select({
|
|
75
|
+
default: 'data-[active=true]:bg-surface-neutral-tint-active',
|
|
76
|
+
web: 'data-[hover=true]:bg-surface-neutral-tint-hover data-[active=true]:data-[hover=true]:bg-surface-neutral-tint-active',
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
variant: 'tint',
|
|
82
|
+
color: 'action',
|
|
83
|
+
className: [
|
|
84
|
+
'bg-surface-action-tint',
|
|
85
|
+
Platform.select({
|
|
86
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
87
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active',
|
|
88
|
+
}),
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
variant: 'tint',
|
|
93
|
+
color: 'danger',
|
|
94
|
+
className: [
|
|
95
|
+
'bg-surface-danger-tint',
|
|
96
|
+
Platform.select({
|
|
97
|
+
default: 'data-[active=true]:bg-surface-danger-tint-active',
|
|
98
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active',
|
|
99
|
+
}),
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
// ── ghost × color ──────────────────────────────────────────────────
|
|
104
|
+
{
|
|
105
|
+
variant: 'ghost',
|
|
106
|
+
color: 'neutral',
|
|
107
|
+
className: [
|
|
27
108
|
Platform.select({
|
|
28
109
|
default: 'data-[active=true]:bg-surface-primary-active',
|
|
29
110
|
web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active',
|
|
30
111
|
}),
|
|
31
112
|
],
|
|
32
113
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
114
|
+
{
|
|
115
|
+
variant: 'ghost',
|
|
116
|
+
color: 'action',
|
|
117
|
+
className: [
|
|
118
|
+
Platform.select({
|
|
119
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
120
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active',
|
|
121
|
+
}),
|
|
122
|
+
],
|
|
36
123
|
},
|
|
37
|
-
|
|
124
|
+
{
|
|
125
|
+
variant: 'ghost',
|
|
126
|
+
color: 'danger',
|
|
127
|
+
className: [
|
|
128
|
+
Platform.select({
|
|
129
|
+
default: 'data-[active=true]:bg-surface-danger-tint-active',
|
|
130
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active',
|
|
131
|
+
}),
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
38
135
|
defaultVariants: {
|
|
39
136
|
variant: 'solid',
|
|
137
|
+
color: 'neutral',
|
|
40
138
|
size: 'default',
|
|
41
139
|
},
|
|
42
140
|
},
|
|
@@ -54,6 +152,34 @@ export const iconButtonGlyphVariants = cva([], {
|
|
|
54
152
|
},
|
|
55
153
|
});
|
|
56
154
|
|
|
57
|
-
export const iconButtonIconColorVariants = cva([
|
|
155
|
+
export const iconButtonIconColorVariants = cva([], {
|
|
156
|
+
variants: {
|
|
157
|
+
variant: {
|
|
158
|
+
solid: [],
|
|
159
|
+
tint: [],
|
|
160
|
+
ghost: [],
|
|
161
|
+
},
|
|
162
|
+
color: {
|
|
163
|
+
neutral: [],
|
|
164
|
+
action: [],
|
|
165
|
+
danger: [],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
compoundVariants: [
|
|
169
|
+
{ variant: 'solid', color: 'neutral', className: 'text-content-primary' },
|
|
170
|
+
{ variant: 'solid', color: 'action', className: 'text-content-action-on-strong' },
|
|
171
|
+
{ variant: 'solid', color: 'danger', className: 'text-content-danger-on-strong' },
|
|
172
|
+
{ variant: 'tint', color: 'neutral', className: 'text-content-primary' },
|
|
173
|
+
{ variant: 'tint', color: 'action', className: 'text-content-action-on-subtle' },
|
|
174
|
+
{ variant: 'tint', color: 'danger', className: 'text-content-danger-on-subtle' },
|
|
175
|
+
{ variant: 'ghost', color: 'neutral', className: 'text-content-primary' },
|
|
176
|
+
{ variant: 'ghost', color: 'action', className: 'text-content-action' },
|
|
177
|
+
{ variant: 'ghost', color: 'danger', className: 'text-content-danger' },
|
|
178
|
+
],
|
|
179
|
+
defaultVariants: {
|
|
180
|
+
variant: 'solid',
|
|
181
|
+
color: 'neutral',
|
|
182
|
+
},
|
|
183
|
+
});
|
|
58
184
|
|
|
59
185
|
export type IconButtonVariantProps = VariantProps<typeof iconButtonRootVariants>;
|
|
@@ -3,13 +3,14 @@ import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
|
3
3
|
|
|
4
4
|
export const inputRootVariants = cva(
|
|
5
5
|
[
|
|
6
|
-
'w-full flex-row items-
|
|
6
|
+
'w-full flex-row items-center overflow-hidden',
|
|
7
7
|
'bg-surface-primary',
|
|
8
|
-
'border-solid border-
|
|
8
|
+
'border-solid border-stroke-primary',
|
|
9
|
+
'web:border-default native:border-[length:var(--border-width-default)]',
|
|
9
10
|
'rounded-[var(--border-radius-default)]',
|
|
10
11
|
TRANSITION_COLORS,
|
|
11
12
|
'data-[disabled=true]:bg-surface-secondary',
|
|
12
|
-
'data-[disabled=true]:opacity-[--opacity-disabled]',
|
|
13
|
+
'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
|
|
13
14
|
DISABLED_CURSOR,
|
|
14
15
|
'data-[readonly=true]:cursor-default',
|
|
15
16
|
'data-[readonly=true]:bg-surface-secondary',
|
|
@@ -24,11 +25,16 @@ export const inputRootVariants = cva(
|
|
|
24
25
|
outline: [],
|
|
25
26
|
},
|
|
26
27
|
size: {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
default: [
|
|
29
|
+
'h-11 min-h-11 px-4 py-3 gap-4',
|
|
30
|
+
// Subtract one hairline from padding when focused so the wider focus border doesn’t shift layout.
|
|
31
|
+
'data-[focus=true]:px-[calc(var(--spacing-4)-var(--spacing-px))]',
|
|
32
|
+
'data-[focus=true]:py-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
33
|
+
],
|
|
29
34
|
small: [
|
|
30
|
-
'h-8 px-3 py-
|
|
31
|
-
'data-[focus=true]:px-[
|
|
35
|
+
'h-8 min-h-8 px-3 py-2 gap-1.5',
|
|
36
|
+
'data-[focus=true]:px-[calc(var(--spacing-3)-var(--spacing-px))]',
|
|
37
|
+
'data-[focus=true]:py-[calc(var(--spacing-2)-var(--spacing-px))]',
|
|
32
38
|
],
|
|
33
39
|
},
|
|
34
40
|
},
|
|
@@ -42,7 +48,7 @@ export const inputRootVariants = cva(
|
|
|
42
48
|
export const inputFieldVariants = cva(
|
|
43
49
|
[
|
|
44
50
|
'flex-1 justify-center bg-transparent p-0',
|
|
45
|
-
'
|
|
51
|
+
'text-content-primary',
|
|
46
52
|
'placeholder:text-content-tertiary',
|
|
47
53
|
'web:outline-none',
|
|
48
54
|
'tracking-normal',
|
|
@@ -60,7 +66,7 @@ export const inputFieldVariants = cva(
|
|
|
60
66
|
},
|
|
61
67
|
);
|
|
62
68
|
|
|
63
|
-
export const inputSlotVariants = cva(['items-center justify-center self-center']);
|
|
69
|
+
export const inputSlotVariants = cva(['items-center justify-center self-center shrink-0']);
|
|
64
70
|
|
|
65
71
|
export const inputIconVariants = cva(['text-content-tertiary'], {
|
|
66
72
|
variants: {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
-
import { Pressable, Text
|
|
3
|
-
import { createLink, type ILinkProps } from '@cdx-ui/primitives';
|
|
2
|
+
import { Platform, Pressable, Text, View, type TextProps } from 'react-native';
|
|
3
|
+
import { createLink, useLinkInteractionContext, type ILinkProps } from '@cdx-ui/primitives';
|
|
4
4
|
import { cn } from '@cdx-ui/utils';
|
|
5
5
|
import { Icon, type IconProps } from '../Icon';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
linkIconVariants,
|
|
8
|
+
linkLabelVariants,
|
|
9
|
+
linkNativeUnderlineVariants,
|
|
10
|
+
linkRootVariants,
|
|
11
|
+
} from './styles';
|
|
7
12
|
|
|
8
13
|
export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
|
|
9
14
|
|
|
@@ -40,15 +45,22 @@ export interface LinkLabelProps extends TextProps {
|
|
|
40
45
|
children?: ReactNode;
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
const LinkLabel = forwardRef<
|
|
48
|
+
const LinkLabel = forwardRef<Text, LinkLabelProps>(
|
|
44
49
|
({ className, children, style, ...props }, ref) => {
|
|
45
|
-
const
|
|
50
|
+
const { visited } = useLinkInteractionContext();
|
|
51
|
+
const computedClassName = cn(linkLabelVariants({ visited }), className);
|
|
46
52
|
|
|
47
|
-
|
|
48
|
-
<
|
|
53
|
+
const textElement = (
|
|
54
|
+
<Text ref={ref} className={computedClassName} style={style} {...props}>
|
|
49
55
|
{children}
|
|
50
|
-
</
|
|
56
|
+
</Text>
|
|
51
57
|
);
|
|
58
|
+
|
|
59
|
+
if (Platform.OS === 'web') {
|
|
60
|
+
return textElement;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return <View className={cn(linkNativeUnderlineVariants({ visited }))}>{textElement}</View>;
|
|
52
64
|
},
|
|
53
65
|
);
|
|
54
66
|
|
|
@@ -61,7 +73,8 @@ LinkLabel.displayName = 'Link.Label';
|
|
|
61
73
|
export interface LinkIconProps extends Omit<IconProps, 'children'> {}
|
|
62
74
|
|
|
63
75
|
const LinkIcon = ({ className, style, as, ...props }: LinkIconProps) => {
|
|
64
|
-
const
|
|
76
|
+
const { visited } = useLinkInteractionContext();
|
|
77
|
+
const computedClassName = cn(linkIconVariants({ visited }), className);
|
|
65
78
|
|
|
66
79
|
return <Icon as={as} className={computedClassName} style={style} {...props} />;
|
|
67
80
|
};
|
|
@@ -1,21 +1,61 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
1
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
3
|
import { TRANSITION_COLORS } from '../../styles/primitives';
|
|
3
4
|
|
|
4
|
-
// TODO: Handle visited state
|
|
5
|
-
|
|
6
5
|
export const linkRootVariants = cva([
|
|
7
6
|
'flex-row items-center gap-1',
|
|
8
|
-
|
|
7
|
+
Platform.select({ web: 'web:inline-flex web:self-start', default: '' }),
|
|
9
8
|
TRANSITION_COLORS,
|
|
9
|
+
'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
|
|
10
|
+
'web:data-[focus-visible=true]:rounded-[2px]',
|
|
10
11
|
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2',
|
|
12
|
+
// Web: set color on the anchor so Label/Icon can text-inherit (incl. browser :visited).
|
|
13
|
+
'web:text-content-link',
|
|
14
|
+
'web:visited:text-content-link-visited',
|
|
15
|
+
'web:hover:text-content-primary',
|
|
16
|
+
'web:visited:hover:text-content-primary',
|
|
17
|
+
'data-[visited=true]:text-content-link-visited',
|
|
18
|
+
'web:data-[hover=true]:text-content-primary',
|
|
11
19
|
]);
|
|
12
20
|
|
|
13
|
-
export const linkLabelVariants = cva(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
export const linkLabelVariants = cva(
|
|
22
|
+
[
|
|
23
|
+
'body-md',
|
|
24
|
+
Platform.select({ web: 'underline underline-offset-4', default: '' }),
|
|
25
|
+
Platform.select({ web: 'text-inherit', default: 'text-content-link' }),
|
|
26
|
+
],
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
visited: {
|
|
30
|
+
true: Platform.select({ web: '', default: 'text-content-link-visited' }),
|
|
31
|
+
false: '',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: { visited: false },
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export const linkNativeUnderlineVariants = cva(['border-b border-content-link pb-0.5'], {
|
|
39
|
+
variants: {
|
|
40
|
+
visited: {
|
|
41
|
+
true: 'border-content-link-visited',
|
|
42
|
+
false: '',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: { visited: false },
|
|
46
|
+
});
|
|
18
47
|
|
|
19
|
-
export const linkIconVariants = cva(
|
|
48
|
+
export const linkIconVariants = cva(
|
|
49
|
+
['size-4', Platform.select({ web: 'text-inherit', default: 'text-content-link' })],
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
visited: {
|
|
53
|
+
true: Platform.select({ web: '', default: 'text-content-link-visited' }),
|
|
54
|
+
false: '',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
defaultVariants: { visited: false },
|
|
58
|
+
},
|
|
59
|
+
);
|
|
20
60
|
|
|
21
61
|
export type LinkVariantProps = VariantProps<typeof linkLabelVariants>;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import {
|
|
4
|
-
COLOR_BORDER_DEFAULT,
|
|
5
|
-
COLOR_TEXT_MUTED,
|
|
6
|
-
COLOR_TEXT_PRIMARY,
|
|
7
|
-
COLOR_TEXT_SECONDARY,
|
|
8
|
-
TRANSITION_COLORS,
|
|
9
|
-
} from '../../styles/primitives';
|
|
3
|
+
import { TRANSITION_COLORS } from '../../styles/primitives';
|
|
10
4
|
|
|
11
5
|
// ── Root (row): density, surface, separator, interactive feedback ──────────
|
|
12
6
|
|
|
@@ -19,7 +13,7 @@ export const listItemRootVariants = cva(
|
|
|
19
13
|
Platform.select({
|
|
20
14
|
web: [
|
|
21
15
|
'outline-none',
|
|
22
|
-
'web:data-[
|
|
16
|
+
'web:data-[hover=true]:bg-slate-50',
|
|
23
17
|
'web:focus-visible:data-[disabled=false]:bg-slate-50',
|
|
24
18
|
'web:focus-visible:data-[disabled=false]:ring-2 web:focus-visible:data-[disabled=false]:ring-slate-400/40 web:focus-visible:data-[disabled=false]:ring-offset-2',
|
|
25
19
|
].join(' '),
|
|
@@ -37,7 +31,7 @@ export const listItemRootVariants = cva(
|
|
|
37
31
|
negative: 'bg-red-50',
|
|
38
32
|
},
|
|
39
33
|
showSeparator: {
|
|
40
|
-
true:
|
|
34
|
+
true: 'border-b border-solid border-stroke-secondary',
|
|
41
35
|
false: 'border-b-0',
|
|
42
36
|
},
|
|
43
37
|
crossAlign: {
|
|
@@ -49,7 +43,7 @@ export const listItemRootVariants = cva(
|
|
|
49
43
|
{
|
|
50
44
|
surface: 'negative',
|
|
51
45
|
className: Platform.select({
|
|
52
|
-
web: 'web:data-[
|
|
46
|
+
web: 'web:data-[hover=true]:bg-red-100/90',
|
|
53
47
|
default: '',
|
|
54
48
|
}),
|
|
55
49
|
},
|
|
@@ -81,7 +75,7 @@ export const listItemTrailingSlotVariants = cva(['flex shrink-0 flex-row justify
|
|
|
81
75
|
|
|
82
76
|
// ── Content stack (title / description / meta) ───────────────────────────────
|
|
83
77
|
|
|
84
|
-
export const listItemContentVariants = cva(
|
|
78
|
+
export const listItemContentVariants = cva('flex min-w-0 flex-1 flex-col gap-1', {
|
|
85
79
|
variants: {
|
|
86
80
|
crossAlign: {
|
|
87
81
|
center: 'justify-center',
|
|
@@ -95,7 +89,7 @@ export const listItemContentVariants = cva(['flex min-w-0 flex-1 flex-col gap-1'
|
|
|
95
89
|
|
|
96
90
|
// ── Typography ───────────────────────────────────────────────────────────────
|
|
97
91
|
|
|
98
|
-
export const listItemTitleVariants = cva(
|
|
92
|
+
export const listItemTitleVariants = cva('text-content-primary font-medium', {
|
|
99
93
|
variants: {
|
|
100
94
|
size: {
|
|
101
95
|
default: 'text-base leading-snug',
|
|
@@ -107,7 +101,7 @@ export const listItemTitleVariants = cva([COLOR_TEXT_PRIMARY, 'font-medium'], {
|
|
|
107
101
|
},
|
|
108
102
|
});
|
|
109
103
|
|
|
110
|
-
export const listItemDescriptionVariants = cva(
|
|
104
|
+
export const listItemDescriptionVariants = cva('text-content-secondary', {
|
|
111
105
|
variants: {
|
|
112
106
|
size: {
|
|
113
107
|
default: 'text-sm leading-normal',
|
|
@@ -119,7 +113,7 @@ export const listItemDescriptionVariants = cva([COLOR_TEXT_SECONDARY], {
|
|
|
119
113
|
},
|
|
120
114
|
});
|
|
121
115
|
|
|
122
|
-
export const listItemMetaVariants = cva(
|
|
116
|
+
export const listItemMetaVariants = cva('text-content-tertiary', {
|
|
123
117
|
variants: {
|
|
124
118
|
size: {
|
|
125
119
|
default: 'text-xs leading-normal',
|
|
@@ -136,7 +130,7 @@ export const listItemMetaVariants = cva([COLOR_TEXT_MUTED], {
|
|
|
136
130
|
export const listItemSectionHeaderVariants = cva(
|
|
137
131
|
[
|
|
138
132
|
'flex-row items-center justify-between gap-2 border-b border-solid px-4 py-3',
|
|
139
|
-
|
|
133
|
+
'border-stroke-secondary',
|
|
140
134
|
],
|
|
141
135
|
{
|
|
142
136
|
variants: {
|
|
@@ -152,9 +146,8 @@ export const listItemSectionHeaderVariants = cva(
|
|
|
152
146
|
);
|
|
153
147
|
|
|
154
148
|
/** Default section-title typography; applied by `ListItem.SectionHeader` for string/number children. Exported for rare custom composition. */
|
|
155
|
-
export const listItemSectionHeaderLabelVariants = cva(
|
|
156
|
-
'text-xs font-semibold uppercase tracking-wide',
|
|
157
|
-
|
|
158
|
-
]);
|
|
149
|
+
export const listItemSectionHeaderLabelVariants = cva(
|
|
150
|
+
'text-xs font-semibold uppercase tracking-wide text-content-secondary',
|
|
151
|
+
);
|
|
159
152
|
|
|
160
153
|
export type ListItemVariantProps = VariantProps<typeof listItemRootVariants>;
|