@cdx-ui/components 0.0.1-alpha.9 → 0.0.1-beta.10
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 +59 -2
- package/lib/commonjs/components/AlertDialog/index.js +117 -0
- package/lib/commonjs/components/AlertDialog/index.js.map +1 -0
- package/lib/commonjs/components/Avatar/index.js +156 -0
- package/lib/commonjs/components/Avatar/index.js.map +1 -0
- package/lib/commonjs/components/Avatar/styles.js +80 -0
- package/lib/commonjs/components/Avatar/styles.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/index.js +248 -0
- package/lib/commonjs/components/BottomSheet/index.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/styles.js +61 -0
- package/lib/commonjs/components/BottomSheet/styles.js.map +1 -0
- package/lib/commonjs/components/Box/Box.js +1 -0
- package/lib/commonjs/components/Box/Box.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +20 -9
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +182 -163
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Card/index.js +104 -0
- package/lib/commonjs/components/Card/index.js.map +1 -0
- package/lib/commonjs/components/Card/styles.js +27 -0
- package/lib/commonjs/components/Card/styles.js.map +1 -0
- package/lib/commonjs/components/Checkbox/index.js +18 -11
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +17 -16
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +103 -0
- package/lib/commonjs/components/Chip/index.js.map +1 -0
- package/lib/commonjs/components/Chip/styles.js +52 -0
- package/lib/commonjs/components/Chip/styles.js.map +1 -0
- package/lib/commonjs/components/Dialog/index.js +275 -0
- package/lib/commonjs/components/Dialog/index.js.map +1 -0
- package/lib/commonjs/components/Dialog/styles.js +63 -0
- package/lib/commonjs/components/Dialog/styles.js.map +1 -0
- package/lib/commonjs/components/Field/FieldLabel.js +33 -0
- package/lib/commonjs/components/Field/FieldLabel.js.map +1 -0
- package/lib/commonjs/components/Field/FieldLabel.web.js +22 -0
- package/lib/commonjs/components/Field/FieldLabel.web.js.map +1 -0
- package/lib/commonjs/components/Field/index.js +158 -0
- package/lib/commonjs/components/Field/index.js.map +1 -0
- package/lib/commonjs/components/Field/styles.js +16 -0
- package/lib/commonjs/components/Field/styles.js.map +1 -0
- package/lib/commonjs/components/Form/FormRoot.js +25 -0
- package/lib/commonjs/components/Form/FormRoot.js.map +1 -0
- package/lib/commonjs/components/Form/FormRoot.web.js +17 -0
- package/lib/commonjs/components/Form/FormRoot.web.js.map +1 -0
- package/lib/commonjs/components/Form/index.js +48 -0
- package/lib/commonjs/components/Form/index.js.map +1 -0
- package/lib/commonjs/components/Form/styles.js +9 -0
- package/lib/commonjs/components/Form/styles.js.map +1 -0
- package/lib/commonjs/components/Heading/index.js +35 -0
- package/lib/commonjs/components/Heading/index.js.map +1 -0
- package/lib/commonjs/components/Heading/styles.js +23 -0
- package/lib/commonjs/components/Heading/styles.js.map +1 -0
- package/lib/commonjs/components/Icon/index.js +61 -0
- package/lib/commonjs/components/Icon/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/index.js +75 -0
- package/lib/commonjs/components/IconButton/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/styles.js +44 -0
- package/lib/commonjs/components/IconButton/styles.js.map +1 -0
- package/lib/commonjs/components/Image/Image.js +69 -0
- package/lib/commonjs/components/Image/Image.js.map +1 -0
- package/lib/commonjs/components/Image/index.js +13 -0
- package/lib/commonjs/components/Image/index.js.map +1 -0
- package/lib/commonjs/components/Input/BaseInput.android.js +20 -0
- package/lib/commonjs/components/Input/BaseInput.android.js.map +1 -0
- package/lib/commonjs/components/Input/index.js +10 -16
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +17 -30
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +94 -0
- package/lib/commonjs/components/Link/index.js.map +1 -0
- package/lib/commonjs/components/Link/styles.js +14 -0
- package/lib/commonjs/components/Link/styles.js.map +1 -0
- package/lib/commonjs/components/ListItem/index.js +283 -0
- package/lib/commonjs/components/ListItem/index.js.map +1 -0
- package/lib/commonjs/components/ListItem/styles.js +130 -0
- package/lib/commonjs/components/ListItem/styles.js.map +1 -0
- package/lib/commonjs/components/OtpInput/index.js +83 -0
- package/lib/commonjs/components/OtpInput/index.js.map +1 -0
- package/lib/commonjs/components/OtpInput/styles.js +48 -0
- package/lib/commonjs/components/OtpInput/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/index.js +45 -0
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/styles.js +10 -0
- package/lib/commonjs/components/ProgressBar/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/index.js +62 -0
- package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/styles.js +21 -0
- package/lib/commonjs/components/ProgressSegmented/styles.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.js +10 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +98 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -0
- package/lib/commonjs/components/Select/index.js +13 -13
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +29 -53
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +8 -21
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +8 -21
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/components/Stack/styles.js +44 -0
- package/lib/commonjs/components/Stack/styles.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +18 -9
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +23 -0
- package/lib/commonjs/components/Text/styles.js.map +1 -0
- package/lib/commonjs/components/VirtualizedList/index.js +19 -0
- package/lib/commonjs/components/VirtualizedList/index.js.map +1 -0
- package/lib/commonjs/components/index.js +216 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/Button.figma.js +69 -0
- package/lib/commonjs/figma/Button.figma.js.map +1 -0
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/index.js +17 -0
- package/lib/commonjs/styles/index.js.map +1 -0
- package/lib/commonjs/styles/primitives.js +122 -0
- package/lib/commonjs/styles/primitives.js.map +1 -0
- package/lib/module/components/AlertDialog/index.js +112 -0
- package/lib/module/components/AlertDialog/index.js.map +1 -0
- package/lib/module/components/Avatar/index.js +152 -0
- package/lib/module/components/Avatar/index.js.map +1 -0
- package/lib/module/components/Avatar/styles.js +77 -0
- package/lib/module/components/Avatar/styles.js.map +1 -0
- package/lib/module/components/BottomSheet/index.js +242 -0
- package/lib/module/components/BottomSheet/index.js.map +1 -0
- package/lib/module/components/BottomSheet/styles.js +58 -0
- package/lib/module/components/BottomSheet/styles.js.map +1 -0
- package/lib/module/components/Box/Box.js +1 -0
- package/lib/module/components/Box/Box.js.map +1 -1
- package/lib/module/components/Button/index.js +21 -10
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +181 -162
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Card/index.js +100 -0
- package/lib/module/components/Card/index.js.map +1 -0
- package/lib/module/components/Card/styles.js +24 -0
- package/lib/module/components/Card/styles.js.map +1 -0
- package/lib/module/components/Checkbox/index.js +19 -12
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +17 -16
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Chip/index.js +99 -0
- package/lib/module/components/Chip/index.js.map +1 -0
- package/lib/module/components/Chip/styles.js +48 -0
- package/lib/module/components/Chip/styles.js.map +1 -0
- package/lib/module/components/Dialog/index.js +267 -0
- package/lib/module/components/Dialog/index.js.map +1 -0
- package/lib/module/components/Dialog/styles.js +60 -0
- package/lib/module/components/Dialog/styles.js.map +1 -0
- package/lib/module/components/Field/FieldLabel.js +29 -0
- package/lib/module/components/Field/FieldLabel.js.map +1 -0
- package/lib/module/components/Field/FieldLabel.web.js +17 -0
- package/lib/module/components/Field/FieldLabel.web.js.map +1 -0
- package/lib/module/components/Field/index.js +155 -0
- package/lib/module/components/Field/index.js.map +1 -0
- package/lib/module/components/Field/styles.js +12 -0
- package/lib/module/components/Field/styles.js.map +1 -0
- package/lib/module/components/Form/FormRoot.js +21 -0
- package/lib/module/components/Form/FormRoot.js.map +1 -0
- package/lib/module/components/Form/FormRoot.web.js +12 -0
- package/lib/module/components/Form/FormRoot.web.js.map +1 -0
- package/lib/module/components/Form/index.js +44 -0
- package/lib/module/components/Form/index.js.map +1 -0
- package/lib/module/components/Form/styles.js +5 -0
- package/lib/module/components/Form/styles.js.map +1 -0
- package/lib/module/components/Heading/index.js +31 -0
- package/lib/module/components/Heading/index.js.map +1 -0
- package/lib/module/components/Heading/styles.js +19 -0
- package/lib/module/components/Heading/styles.js.map +1 -0
- package/lib/module/components/Icon/index.js +57 -0
- package/lib/module/components/Icon/index.js.map +1 -0
- package/lib/module/components/IconButton/index.js +71 -0
- package/lib/module/components/IconButton/index.js.map +1 -0
- package/lib/module/components/IconButton/styles.js +40 -0
- package/lib/module/components/IconButton/styles.js.map +1 -0
- package/lib/module/components/Image/Image.js +67 -0
- package/lib/module/components/Image/Image.js.map +1 -0
- package/lib/module/components/Image/index.js +4 -0
- package/lib/module/components/Image/index.js.map +1 -0
- package/lib/module/components/Input/BaseInput.android.js +16 -0
- package/lib/module/components/Input/BaseInput.android.js.map +1 -0
- package/lib/module/components/Input/index.js +10 -16
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Input/styles.js +17 -30
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/index.js +85 -0
- package/lib/module/components/Link/index.js.map +1 -0
- package/lib/module/components/Link/styles.js +11 -0
- package/lib/module/components/Link/styles.js.map +1 -0
- package/lib/module/components/ListItem/index.js +226 -0
- package/lib/module/components/ListItem/index.js.map +1 -0
- package/lib/module/components/ListItem/styles.js +127 -0
- package/lib/module/components/ListItem/styles.js.map +1 -0
- package/lib/module/components/OtpInput/index.js +79 -0
- package/lib/module/components/OtpInput/index.js.map +1 -0
- package/lib/module/components/OtpInput/styles.js +44 -0
- package/lib/module/components/OtpInput/styles.js.map +1 -0
- package/lib/module/components/ProgressBar/index.js +41 -0
- package/lib/module/components/ProgressBar/index.js.map +1 -0
- package/lib/module/components/ProgressBar/styles.js +6 -0
- package/lib/module/components/ProgressBar/styles.js.map +1 -0
- package/lib/module/components/ProgressSegmented/index.js +58 -0
- package/lib/module/components/ProgressSegmented/index.js.map +1 -0
- package/lib/module/components/ProgressSegmented/styles.js +17 -0
- package/lib/module/components/ProgressSegmented/styles.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.js +7 -0
- package/lib/module/components/Select/SelectTriggerHost.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js +93 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -0
- package/lib/module/components/Select/index.js +14 -14
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +29 -53
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +8 -21
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +8 -21
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/components/Stack/styles.js +40 -0
- package/lib/module/components/Stack/styles.js.map +1 -0
- package/lib/module/components/Text/index.js +19 -1
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/Text/styles.js +19 -0
- package/lib/module/components/Text/styles.js.map +1 -0
- package/lib/module/components/VirtualizedList/index.js +15 -0
- package/lib/module/components/VirtualizedList/index.js.map +1 -0
- package/lib/module/components/index.js +18 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/Button.figma.js +63 -0
- package/lib/module/figma/Button.figma.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/index.js +4 -0
- package/lib/module/styles/index.js.map +1 -0
- package/lib/module/styles/primitives.js +118 -0
- package/lib/module/styles/primitives.js.map +1 -0
- package/lib/typescript/components/AlertDialog/index.d.ts +30 -0
- package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -0
- package/lib/typescript/components/Avatar/index.d.ts +40 -0
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/components/Avatar/styles.d.ts +16 -0
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/index.d.ts +61 -0
- package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts +16 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -0
- package/lib/typescript/components/Box/Box.d.ts +1 -0
- package/lib/typescript/components/Box/Box.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts +6 -3
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +11 -8
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Card/index.d.ts +30 -0
- package/lib/typescript/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/components/Card/styles.d.ts +6 -0
- package/lib/typescript/components/Card/styles.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/index.d.ts +7 -5
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -4
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +27 -0
- package/lib/typescript/components/Chip/index.d.ts.map +1 -0
- package/lib/typescript/components/Chip/styles.d.ts +12 -0
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/index.d.ts +61 -0
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/styles.d.ts +14 -0
- package/lib/typescript/components/Dialog/styles.d.ts.map +1 -0
- package/lib/typescript/components/Field/FieldLabel.d.ts +18 -0
- package/lib/typescript/components/Field/FieldLabel.d.ts.map +1 -0
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +16 -0
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -0
- package/lib/typescript/components/Field/index.d.ts +26 -0
- package/lib/typescript/components/Field/index.d.ts.map +1 -0
- package/lib/typescript/components/Field/styles.d.ts +16 -0
- package/lib/typescript/components/Field/styles.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.d.ts +14 -0
- package/lib/typescript/components/Form/FormRoot.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.web.d.ts +10 -0
- package/lib/typescript/components/Form/FormRoot.web.d.ts.map +1 -0
- package/lib/typescript/components/Form/index.d.ts +7 -0
- package/lib/typescript/components/Form/index.d.ts.map +1 -0
- package/lib/typescript/components/Form/styles.d.ts +2 -0
- package/lib/typescript/components/Form/styles.d.ts.map +1 -0
- package/lib/typescript/components/Heading/index.d.ts +10 -0
- package/lib/typescript/components/Heading/index.d.ts.map +1 -0
- package/lib/typescript/components/Heading/styles.d.ts +6 -0
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -0
- package/lib/typescript/components/Icon/index.d.ts +27 -0
- package/lib/typescript/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/components/IconButton/index.d.ts +15 -0
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -0
- package/lib/typescript/components/IconButton/styles.d.ts +11 -0
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -0
- package/lib/typescript/components/Image/Image.d.ts +47 -0
- package/lib/typescript/components/Image/Image.d.ts.map +1 -0
- package/lib/typescript/components/Image/index.d.ts +2 -0
- package/lib/typescript/components/Image/index.d.ts.map +1 -0
- package/lib/typescript/components/Input/BaseInput.android.d.ts +3 -0
- package/lib/typescript/components/Input/BaseInput.android.d.ts.map +1 -0
- package/lib/typescript/components/Input/index.d.ts +7 -5
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts +5 -7
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +26 -0
- package/lib/typescript/components/Link/index.d.ts.map +1 -0
- package/lib/typescript/components/Link/styles.d.ts +6 -0
- package/lib/typescript/components/Link/styles.d.ts.map +1 -0
- package/lib/typescript/components/ListItem/index.d.ts +49 -0
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -0
- package/lib/typescript/components/ListItem/styles.d.ts +30 -0
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -0
- package/lib/typescript/components/OtpInput/index.d.ts +11 -0
- package/lib/typescript/components/OtpInput/index.d.ts.map +1 -0
- package/lib/typescript/components/OtpInput/styles.d.ts +14 -0
- package/lib/typescript/components/OtpInput/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressBar/index.d.ts +17 -0
- package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/components/ProgressBar/styles.d.ts +5 -0
- package/lib/typescript/components/ProgressBar/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/index.d.ts +15 -0
- package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/styles.d.ts +8 -0
- package/lib/typescript/components/ProgressSegmented/styles.d.ts.map +1 -0
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts +3 -0
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts.map +1 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +13 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -0
- package/lib/typescript/components/Select/index.d.ts +7 -4
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts +6 -8
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Stack/HStack.d.ts +1 -12
- package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/VStack.d.ts +1 -12
- package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/styles.d.ts +23 -0
- package/lib/typescript/components/Stack/styles.d.ts.map +1 -0
- package/lib/typescript/components/Switch/index.d.ts +0 -1
- package/lib/typescript/components/Switch/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/index.d.ts +9 -1
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/styles.d.ts +6 -0
- package/lib/typescript/components/Text/styles.d.ts.map +1 -0
- package/lib/typescript/components/VirtualizedList/index.d.ts +8 -0
- package/lib/typescript/components/VirtualizedList/index.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +18 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/Button.figma.d.ts +8 -0
- package/lib/typescript/figma/Button.figma.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/styles/index.d.ts +2 -0
- package/lib/typescript/styles/index.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +85 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -0
- package/package.json +15 -6
- package/src/components/AlertDialog/index.tsx +124 -0
- package/src/components/Avatar/index.tsx +172 -0
- package/src/components/Avatar/styles.ts +83 -0
- package/src/components/BottomSheet/index.tsx +316 -0
- package/src/components/BottomSheet/styles.ts +79 -0
- package/src/components/Box/Box.tsx +1 -0
- package/src/components/Button/index.tsx +14 -9
- package/src/components/Button/styles.ts +159 -209
- package/src/components/Card/index.tsx +115 -0
- package/src/components/Card/styles.ts +34 -0
- package/src/components/Checkbox/index.tsx +15 -23
- package/src/components/Checkbox/styles.ts +33 -24
- package/src/components/Chip/index.tsx +91 -0
- package/src/components/Chip/styles.ts +52 -0
- package/src/components/Dialog/index.tsx +304 -0
- package/src/components/Dialog/styles.ts +88 -0
- package/src/components/Field/FieldLabel.tsx +33 -0
- package/src/components/Field/FieldLabel.web.tsx +25 -0
- package/src/components/Field/index.tsx +171 -0
- package/src/components/Field/styles.ts +32 -0
- package/src/components/Form/FormRoot.tsx +20 -0
- package/src/components/Form/FormRoot.web.tsx +12 -0
- package/src/components/Form/index.tsx +38 -0
- package/src/components/Form/styles.ts +3 -0
- package/src/components/Heading/index.tsx +36 -0
- package/src/components/Heading/styles.ts +25 -0
- package/src/components/Icon/index.tsx +54 -0
- package/src/components/IconButton/index.tsx +92 -0
- package/src/components/IconButton/styles.ts +59 -0
- package/src/components/Image/Image.tsx +77 -0
- package/src/components/Image/index.ts +1 -0
- package/src/components/Input/BaseInput.android.tsx +13 -0
- package/src/components/Input/index.tsx +9 -22
- package/src/components/Input/styles.ts +36 -40
- package/src/components/Link/index.tsx +83 -0
- package/src/components/Link/styles.ts +21 -0
- package/src/components/ListItem/index.tsx +285 -0
- package/src/components/ListItem/styles.ts +160 -0
- package/src/components/OtpInput/index.tsx +79 -0
- package/src/components/OtpInput/styles.ts +45 -0
- package/src/components/ProgressBar/index.tsx +53 -0
- package/src/components/ProgressBar/styles.ts +9 -0
- package/src/components/ProgressSegmented/index.tsx +81 -0
- package/src/components/ProgressSegmented/styles.ts +20 -0
- package/src/components/Select/SelectTriggerHost.tsx +4 -0
- package/src/components/Select/SelectTriggerHost.web.tsx +136 -0
- package/src/components/Select/index.tsx +14 -14
- package/src/components/Select/styles.ts +68 -75
- package/src/components/Stack/HStack.tsx +8 -19
- package/src/components/Stack/VStack.tsx +8 -23
- package/src/components/Stack/styles.ts +42 -0
- package/src/components/Switch/index.tsx +0 -2
- package/src/components/Text/index.tsx +16 -0
- package/src/components/Text/styles.ts +25 -0
- package/src/components/VirtualizedList/index.tsx +19 -0
- package/src/components/index.ts +18 -0
- package/src/index.ts +3 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/primitives.ts +106 -0
- package/lib/commonjs/components/Text/Text.js +0 -30
- package/lib/commonjs/components/Text/Text.js.map +0 -1
- package/lib/module/components/Text/Text.js +0 -26
- package/lib/module/components/Text/Text.js.map +0 -1
- package/lib/typescript/components/Text/Text.d.ts +0 -11
- package/lib/typescript/components/Text/Text.d.ts.map +0 -1
- package/src/components/Text/Text.tsx +0 -58
- package/src/components/Text/index.ts +0 -1
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
+
import { Pressable, Text, View, type TextProps, type ViewProps } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
createListItem,
|
|
5
|
+
type IListItemLeadingSlotProps,
|
|
6
|
+
type IListItemProps,
|
|
7
|
+
type IListItemSectionHeaderProps,
|
|
8
|
+
type ListItemCrossAlign,
|
|
9
|
+
} from '@cdx-ui/primitives';
|
|
10
|
+
import { cn, useStyleContext, withStyleContext, type WithStyleContextProps } from '@cdx-ui/utils';
|
|
11
|
+
import {
|
|
12
|
+
listItemContentVariants,
|
|
13
|
+
listItemDescriptionVariants,
|
|
14
|
+
listItemLeadingSlotVariants,
|
|
15
|
+
listItemMetaVariants,
|
|
16
|
+
listItemRootVariants,
|
|
17
|
+
listItemSectionHeaderLabelVariants,
|
|
18
|
+
listItemSectionHeaderVariants,
|
|
19
|
+
listItemTitleVariants,
|
|
20
|
+
listItemTrailingSlotVariants,
|
|
21
|
+
type ListItemVariantProps,
|
|
22
|
+
} from './styles';
|
|
23
|
+
|
|
24
|
+
const SCOPE = 'LIST_ITEM';
|
|
25
|
+
|
|
26
|
+
const RootView = withStyleContext(View, SCOPE);
|
|
27
|
+
const RootPressable = withStyleContext(Pressable, SCOPE);
|
|
28
|
+
|
|
29
|
+
const ListItemPrimitive = createListItem({
|
|
30
|
+
View: RootView,
|
|
31
|
+
Pressable: RootPressable,
|
|
32
|
+
LeadingSlot: View,
|
|
33
|
+
Content: View,
|
|
34
|
+
Title: Text,
|
|
35
|
+
Description: Text,
|
|
36
|
+
Meta: Text,
|
|
37
|
+
TrailingSlot: View,
|
|
38
|
+
SectionHeader: View,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const useListItemStyleContext = (): Pick<ListItemVariantProps, 'size' | 'crossAlign'> => {
|
|
42
|
+
const ctx = useStyleContext(SCOPE) as ListItemVariantProps | undefined;
|
|
43
|
+
return { size: ctx?.size ?? 'default', crossAlign: ctx?.crossAlign ?? 'center' };
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// =============================================================================
|
|
47
|
+
// ROOT
|
|
48
|
+
// =============================================================================
|
|
49
|
+
|
|
50
|
+
export interface ListItemProps extends IListItemProps, WithStyleContextProps {
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const ListItemRoot = forwardRef<View, ListItemProps>(
|
|
55
|
+
(
|
|
56
|
+
{
|
|
57
|
+
size = 'default',
|
|
58
|
+
surface = 'default',
|
|
59
|
+
showSeparator = true,
|
|
60
|
+
crossAlign = 'center',
|
|
61
|
+
className,
|
|
62
|
+
style,
|
|
63
|
+
...props
|
|
64
|
+
},
|
|
65
|
+
ref,
|
|
66
|
+
) => {
|
|
67
|
+
const computedClassName = cn(
|
|
68
|
+
listItemRootVariants({ size, surface, showSeparator, crossAlign }),
|
|
69
|
+
className,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<ListItemPrimitive
|
|
74
|
+
ref={ref as never}
|
|
75
|
+
className={computedClassName}
|
|
76
|
+
context={{ size, surface, showSeparator, crossAlign }}
|
|
77
|
+
crossAlign={crossAlign}
|
|
78
|
+
showSeparator={showSeparator}
|
|
79
|
+
size={size}
|
|
80
|
+
style={style}
|
|
81
|
+
surface={surface}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
ListItemRoot.displayName = 'ListItem';
|
|
89
|
+
|
|
90
|
+
// =============================================================================
|
|
91
|
+
// SLOTS & TEXT
|
|
92
|
+
// =============================================================================
|
|
93
|
+
|
|
94
|
+
export interface ListItemLeadingSlotProps extends IListItemLeadingSlotProps {
|
|
95
|
+
className?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const ListItemLeadingSlot = forwardRef<View, ListItemLeadingSlotProps>(
|
|
99
|
+
({ className, style, ...props }, ref) => (
|
|
100
|
+
<ListItemPrimitive.LeadingSlot
|
|
101
|
+
ref={ref as never}
|
|
102
|
+
className={cn(listItemLeadingSlotVariants(), className)}
|
|
103
|
+
style={style}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
),
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
ListItemLeadingSlot.displayName = 'ListItem.LeadingSlot';
|
|
110
|
+
|
|
111
|
+
export interface ListItemContentProps extends ViewProps {
|
|
112
|
+
className?: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const ListItemContent = forwardRef<View, ListItemContentProps>(
|
|
116
|
+
({ className, style, ...props }, ref) => {
|
|
117
|
+
const { crossAlign } = useListItemStyleContext();
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<ListItemPrimitive.Content
|
|
121
|
+
ref={ref as never}
|
|
122
|
+
className={cn(listItemContentVariants({ crossAlign }), className)}
|
|
123
|
+
style={style}
|
|
124
|
+
{...props}
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
ListItemContent.displayName = 'ListItem.Content';
|
|
131
|
+
|
|
132
|
+
export interface ListItemTitleProps extends TextProps {
|
|
133
|
+
className?: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const ListItemTitle = forwardRef<Text, ListItemTitleProps>(
|
|
137
|
+
({ className, numberOfLines = 1, style, ...props }, ref) => {
|
|
138
|
+
const { size } = useListItemStyleContext();
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<ListItemPrimitive.Title
|
|
142
|
+
ref={ref as never}
|
|
143
|
+
className={cn(listItemTitleVariants({ size }), className)}
|
|
144
|
+
numberOfLines={numberOfLines}
|
|
145
|
+
style={style}
|
|
146
|
+
{...props}
|
|
147
|
+
/>
|
|
148
|
+
);
|
|
149
|
+
},
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
ListItemTitle.displayName = 'ListItem.Title';
|
|
153
|
+
|
|
154
|
+
export interface ListItemDescriptionProps extends TextProps {
|
|
155
|
+
className?: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const ListItemDescription = forwardRef<Text, ListItemDescriptionProps>(
|
|
159
|
+
({ className, style, ...props }, ref) => {
|
|
160
|
+
const { size } = useListItemStyleContext();
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<ListItemPrimitive.Description
|
|
164
|
+
ref={ref as never}
|
|
165
|
+
className={cn(listItemDescriptionVariants({ size }), className)}
|
|
166
|
+
style={style}
|
|
167
|
+
{...props}
|
|
168
|
+
/>
|
|
169
|
+
);
|
|
170
|
+
},
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
ListItemDescription.displayName = 'ListItem.Description';
|
|
174
|
+
|
|
175
|
+
export interface ListItemMetaProps extends TextProps {
|
|
176
|
+
className?: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const ListItemMeta = forwardRef<Text, ListItemMetaProps>(
|
|
180
|
+
({ className, numberOfLines = 1, style, ...props }, ref) => {
|
|
181
|
+
const { size } = useListItemStyleContext();
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<ListItemPrimitive.Meta
|
|
185
|
+
ref={ref as never}
|
|
186
|
+
className={cn(listItemMetaVariants({ size }), className)}
|
|
187
|
+
numberOfLines={numberOfLines}
|
|
188
|
+
style={style}
|
|
189
|
+
{...props}
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
},
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
ListItemMeta.displayName = 'ListItem.Meta';
|
|
196
|
+
|
|
197
|
+
export interface ListItemTrailingSlotProps extends ViewProps {
|
|
198
|
+
className?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const ListItemTrailingSlot = forwardRef<View, ListItemTrailingSlotProps>(
|
|
202
|
+
({ className, style, ...props }, ref) => {
|
|
203
|
+
const { crossAlign } = useListItemStyleContext();
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<ListItemPrimitive.TrailingSlot
|
|
207
|
+
ref={ref as never}
|
|
208
|
+
className={cn(listItemTrailingSlotVariants({ crossAlign }), className)}
|
|
209
|
+
style={style}
|
|
210
|
+
{...props}
|
|
211
|
+
/>
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
ListItemTrailingSlot.displayName = 'ListItem.TrailingSlot';
|
|
217
|
+
|
|
218
|
+
const wrapSectionHeaderLabel = (children: ReactNode): ReactNode => {
|
|
219
|
+
if (typeof children === 'string' || typeof children === 'number') {
|
|
220
|
+
return <Text className={cn(listItemSectionHeaderLabelVariants())}>{children}</Text>;
|
|
221
|
+
}
|
|
222
|
+
return children;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// =============================================================================
|
|
226
|
+
// SECTION HEADER
|
|
227
|
+
// =============================================================================
|
|
228
|
+
|
|
229
|
+
export interface ListItemSectionHeaderComponentProps extends IListItemSectionHeaderProps {
|
|
230
|
+
className?: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const ListItemSectionHeader = forwardRef<View, ListItemSectionHeaderComponentProps>(
|
|
234
|
+
({ children, className, showDivider = true, style, trailing, ...props }, ref) => (
|
|
235
|
+
<ListItemPrimitive.SectionHeader
|
|
236
|
+
ref={ref as never}
|
|
237
|
+
className={cn(listItemSectionHeaderVariants({ showDivider }), className)}
|
|
238
|
+
showDivider={showDivider}
|
|
239
|
+
style={style}
|
|
240
|
+
trailing={trailing}
|
|
241
|
+
{...props}
|
|
242
|
+
>
|
|
243
|
+
{wrapSectionHeaderLabel(children)}
|
|
244
|
+
</ListItemPrimitive.SectionHeader>
|
|
245
|
+
),
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
ListItemSectionHeader.displayName = 'ListItem.SectionHeader';
|
|
249
|
+
|
|
250
|
+
// =============================================================================
|
|
251
|
+
// COMPOUND EXPORT
|
|
252
|
+
// =============================================================================
|
|
253
|
+
|
|
254
|
+
type ListItemCompound = typeof ListItemRoot & {
|
|
255
|
+
LeadingSlot: typeof ListItemLeadingSlot;
|
|
256
|
+
Content: typeof ListItemContent;
|
|
257
|
+
Title: typeof ListItemTitle;
|
|
258
|
+
Description: typeof ListItemDescription;
|
|
259
|
+
Meta: typeof ListItemMeta;
|
|
260
|
+
TrailingSlot: typeof ListItemTrailingSlot;
|
|
261
|
+
SectionHeader: typeof ListItemSectionHeader;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export const ListItem = Object.assign(ListItemRoot, {
|
|
265
|
+
LeadingSlot: ListItemLeadingSlot,
|
|
266
|
+
Content: ListItemContent,
|
|
267
|
+
Title: ListItemTitle,
|
|
268
|
+
Description: ListItemDescription,
|
|
269
|
+
Meta: ListItemMeta,
|
|
270
|
+
TrailingSlot: ListItemTrailingSlot,
|
|
271
|
+
SectionHeader: ListItemSectionHeader,
|
|
272
|
+
}) as ListItemCompound;
|
|
273
|
+
|
|
274
|
+
export type { ListItemCrossAlign, ListItemVariantProps };
|
|
275
|
+
export {
|
|
276
|
+
listItemContentVariants,
|
|
277
|
+
listItemDescriptionVariants,
|
|
278
|
+
listItemLeadingSlotVariants,
|
|
279
|
+
listItemMetaVariants,
|
|
280
|
+
listItemRootVariants,
|
|
281
|
+
listItemSectionHeaderLabelVariants,
|
|
282
|
+
listItemSectionHeaderVariants,
|
|
283
|
+
listItemTitleVariants,
|
|
284
|
+
listItemTrailingSlotVariants,
|
|
285
|
+
} from './styles';
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
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';
|
|
10
|
+
|
|
11
|
+
// ── Root (row): density, surface, separator, interactive feedback ──────────
|
|
12
|
+
|
|
13
|
+
export const listItemRootVariants = cva(
|
|
14
|
+
[
|
|
15
|
+
'flex-row self-stretch w-full px-4',
|
|
16
|
+
'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none',
|
|
17
|
+
'data-[active=true]:opacity-70',
|
|
18
|
+
TRANSITION_COLORS,
|
|
19
|
+
Platform.select({
|
|
20
|
+
web: [
|
|
21
|
+
'outline-none',
|
|
22
|
+
'web:data-[hovered=true]:bg-slate-50',
|
|
23
|
+
'web:focus-visible:data-[disabled=false]:bg-slate-50',
|
|
24
|
+
'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
|
+
].join(' '),
|
|
26
|
+
default: '',
|
|
27
|
+
}),
|
|
28
|
+
],
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
default: 'gap-3 py-4',
|
|
33
|
+
compact: 'gap-2 py-3',
|
|
34
|
+
},
|
|
35
|
+
surface: {
|
|
36
|
+
default: 'bg-white',
|
|
37
|
+
negative: 'bg-red-50',
|
|
38
|
+
},
|
|
39
|
+
showSeparator: {
|
|
40
|
+
true: ['border-b border-solid', COLOR_BORDER_DEFAULT],
|
|
41
|
+
false: 'border-b-0',
|
|
42
|
+
},
|
|
43
|
+
crossAlign: {
|
|
44
|
+
center: 'items-center',
|
|
45
|
+
start: 'items-start',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
compoundVariants: [
|
|
49
|
+
{
|
|
50
|
+
surface: 'negative',
|
|
51
|
+
className: Platform.select({
|
|
52
|
+
web: 'web:data-[hovered=true]:bg-red-100/90',
|
|
53
|
+
default: '',
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
size: 'default',
|
|
59
|
+
surface: 'default',
|
|
60
|
+
showSeparator: true,
|
|
61
|
+
crossAlign: 'center',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
// ── Leading / trailing slots ─────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
export const listItemLeadingSlotVariants = cva(['flex shrink-0 items-center justify-center']);
|
|
69
|
+
|
|
70
|
+
export const listItemTrailingSlotVariants = cva(['flex shrink-0 flex-row justify-end gap-2'], {
|
|
71
|
+
variants: {
|
|
72
|
+
crossAlign: {
|
|
73
|
+
center: 'items-center',
|
|
74
|
+
start: 'items-start self-start',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {
|
|
78
|
+
crossAlign: 'center',
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// ── Content stack (title / description / meta) ───────────────────────────────
|
|
83
|
+
|
|
84
|
+
export const listItemContentVariants = cva(['flex min-w-0 flex-1 flex-col gap-1'], {
|
|
85
|
+
variants: {
|
|
86
|
+
crossAlign: {
|
|
87
|
+
center: 'justify-center',
|
|
88
|
+
start: 'justify-start',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
defaultVariants: {
|
|
92
|
+
crossAlign: 'center',
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// ── Typography ───────────────────────────────────────────────────────────────
|
|
97
|
+
|
|
98
|
+
export const listItemTitleVariants = cva([COLOR_TEXT_PRIMARY, 'font-medium'], {
|
|
99
|
+
variants: {
|
|
100
|
+
size: {
|
|
101
|
+
default: 'text-base leading-snug',
|
|
102
|
+
compact: 'text-sm leading-snug',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
defaultVariants: {
|
|
106
|
+
size: 'default',
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export const listItemDescriptionVariants = cva([COLOR_TEXT_SECONDARY], {
|
|
111
|
+
variants: {
|
|
112
|
+
size: {
|
|
113
|
+
default: 'text-sm leading-normal',
|
|
114
|
+
compact: 'text-xs leading-normal',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
defaultVariants: {
|
|
118
|
+
size: 'default',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export const listItemMetaVariants = cva([COLOR_TEXT_MUTED], {
|
|
123
|
+
variants: {
|
|
124
|
+
size: {
|
|
125
|
+
default: 'text-xs leading-normal',
|
|
126
|
+
compact: 'text-[11px] leading-normal',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
defaultVariants: {
|
|
130
|
+
size: 'default',
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// ── Section header (group label row inside lists / cards) ───────────────────
|
|
135
|
+
|
|
136
|
+
export const listItemSectionHeaderVariants = cva(
|
|
137
|
+
[
|
|
138
|
+
'flex-row items-center justify-between gap-2 border-b border-solid px-4 py-3',
|
|
139
|
+
COLOR_BORDER_DEFAULT,
|
|
140
|
+
],
|
|
141
|
+
{
|
|
142
|
+
variants: {
|
|
143
|
+
showDivider: {
|
|
144
|
+
true: ['border-t-4 border-solid border-t-surface-brand-strong/40', 'border-x-0'],
|
|
145
|
+
false: 'border-t-0',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
defaultVariants: {
|
|
149
|
+
showDivider: true,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
/** 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
|
+
COLOR_TEXT_SECONDARY,
|
|
158
|
+
]);
|
|
159
|
+
|
|
160
|
+
export type ListItemVariantProps = VariantProps<typeof listItemRootVariants>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ComponentProps, ComponentRef, ForwardedRef } from 'react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import type { View } from 'react-native';
|
|
4
|
+
import { createOtpInput, type IOtpInputRootProps } from '@cdx-ui/primitives';
|
|
5
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
6
|
+
import { HStack } from '../Stack/HStack';
|
|
7
|
+
import { Input, type InputProps } from '../Input';
|
|
8
|
+
import type { InputVariantProps } from '../Input/styles';
|
|
9
|
+
import {
|
|
10
|
+
otpCellVariants,
|
|
11
|
+
otpFieldVariants,
|
|
12
|
+
otpRootVariants,
|
|
13
|
+
type OtpInputVariantProps,
|
|
14
|
+
} from './styles';
|
|
15
|
+
|
|
16
|
+
const SCOPE = 'OTP_INPUT';
|
|
17
|
+
|
|
18
|
+
const OtpRoot = withStyleContext(HStack, SCOPE);
|
|
19
|
+
|
|
20
|
+
const useOtpInputStyleContext = () => useStyleContext(SCOPE) as InputVariantProps;
|
|
21
|
+
|
|
22
|
+
const OtpStyledCell = forwardRef<View, InputProps>(
|
|
23
|
+
({ className, children, ...props }, ref: ForwardedRef<View>) => {
|
|
24
|
+
const { size, variant } = useOtpInputStyleContext();
|
|
25
|
+
return (
|
|
26
|
+
<Input
|
|
27
|
+
ref={ref}
|
|
28
|
+
variant={variant}
|
|
29
|
+
size={size}
|
|
30
|
+
className={cn(otpCellVariants({ size }), className)}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</Input>
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
OtpStyledCell.displayName = 'OtpInput.Cell';
|
|
40
|
+
|
|
41
|
+
const OtpStyledField = forwardRef<
|
|
42
|
+
ComponentRef<typeof Input.Field>,
|
|
43
|
+
ComponentProps<typeof Input.Field>
|
|
44
|
+
>(({ className, ...props }, ref) => {
|
|
45
|
+
const { size } = useOtpInputStyleContext();
|
|
46
|
+
return <Input.Field ref={ref} className={cn(otpFieldVariants({ size }), className)} {...props} />;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
OtpStyledField.displayName = 'OtpInput.Field';
|
|
50
|
+
|
|
51
|
+
const OtpPrimitive = createOtpInput({
|
|
52
|
+
Root: OtpRoot,
|
|
53
|
+
Cell: OtpStyledCell,
|
|
54
|
+
Field: OtpStyledField,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export interface OtpInputProps extends Omit<IOtpInputRootProps, 'size'>, OtpInputVariantProps {
|
|
58
|
+
variant?: NonNullable<InputProps['variant']>;
|
|
59
|
+
size?: NonNullable<InputProps['size']>;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const OtpInput = forwardRef<View, OtpInputProps>(
|
|
64
|
+
({ variant = 'outline', size = 'default', fullWidth = true, className, style, ...rest }, ref) => {
|
|
65
|
+
const rootClassName = cn(otpRootVariants({ size, fullWidth }), className);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<OtpPrimitive
|
|
69
|
+
ref={ref}
|
|
70
|
+
className={rootClassName}
|
|
71
|
+
style={style}
|
|
72
|
+
context={{ variant, size }}
|
|
73
|
+
{...rest}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
OtpInput.displayName = 'OtpInput';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
export const otpRootVariants = cva('flex-row items-stretch gap-2.5', {
|
|
4
|
+
variants: {
|
|
5
|
+
size: {
|
|
6
|
+
default: '',
|
|
7
|
+
small: '',
|
|
8
|
+
},
|
|
9
|
+
fullWidth: {
|
|
10
|
+
true: 'w-full self-stretch justify-center',
|
|
11
|
+
false: 'self-start',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
size: 'default',
|
|
16
|
+
fullWidth: true,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/** Narrow cell chrome: overrides Input root `w-full` / wide horizontal padding for one digit. */
|
|
21
|
+
export const otpCellVariants = cva('shrink-0 justify-center', {
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
default: 'w-12 min-w-12 max-w-12 px-1',
|
|
25
|
+
small: 'w-10 min-w-10 max-w-10 px-0.5',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
size: 'default',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const otpFieldVariants = cva('min-w-0 w-full text-center tabular-nums', {
|
|
34
|
+
variants: {
|
|
35
|
+
size: {
|
|
36
|
+
default: 'text-xl leading-6',
|
|
37
|
+
small: 'text-base leading-5',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
size: 'default',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export type OtpInputVariantProps = VariantProps<typeof otpRootVariants>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { View, type ViewProps } from 'react-native';
|
|
3
|
+
import { createProgress, type IProgressProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { cn } from '@cdx-ui/utils';
|
|
5
|
+
import {
|
|
6
|
+
progressBarIndicatorVariants,
|
|
7
|
+
progressBarTrackVariants,
|
|
8
|
+
type ProgressBarTrackVariantProps,
|
|
9
|
+
} from './styles';
|
|
10
|
+
|
|
11
|
+
const ProgressPrimitive = createProgress({
|
|
12
|
+
Root: View,
|
|
13
|
+
Indicator: View,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export interface ProgressBarProps extends IProgressProps, ProgressBarTrackVariantProps {
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ProgressBarIndicatorProps extends ViewProps {
|
|
21
|
+
readonly className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const ProgressBarRoot = forwardRef<View, ProgressBarProps>(
|
|
25
|
+
({ className, style, ...props }, ref) => {
|
|
26
|
+
const trackClass = cn(progressBarTrackVariants(), className);
|
|
27
|
+
|
|
28
|
+
return <ProgressPrimitive ref={ref} className={trackClass} style={style} {...props} />;
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
ProgressBarRoot.displayName = 'ProgressBar';
|
|
33
|
+
|
|
34
|
+
const ProgressBarIndicator = forwardRef<View, ProgressBarIndicatorProps>(
|
|
35
|
+
({ className, style, ...props }, ref) => (
|
|
36
|
+
<ProgressPrimitive.Indicator
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(progressBarIndicatorVariants(), className)}
|
|
39
|
+
style={style}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
ProgressBarIndicator.displayName = 'ProgressBar.Indicator';
|
|
46
|
+
|
|
47
|
+
type ProgressBarCompoundComponent = typeof ProgressBarRoot & {
|
|
48
|
+
Indicator: typeof ProgressBarIndicator;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const ProgressBar = Object.assign(ProgressBarRoot, {
|
|
52
|
+
Indicator: ProgressBarIndicator,
|
|
53
|
+
}) as ProgressBarCompoundComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
export const progressBarTrackVariants = cva([
|
|
4
|
+
'w-full flex-row overflow-hidden rounded-full bg-surface-action-tint h-1',
|
|
5
|
+
]);
|
|
6
|
+
|
|
7
|
+
export const progressBarIndicatorVariants = cva(['rounded-full bg-surface-action-strong']);
|
|
8
|
+
|
|
9
|
+
export type ProgressBarTrackVariantProps = VariantProps<typeof progressBarTrackVariants>;
|