@cdx-ui/components 0.0.1-alpha.3 → 0.0.1-alpha.31
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 +20 -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/buttonSharedVariants.js +200 -0
- package/lib/commonjs/components/Button/buttonSharedVariants.js.map +1 -0
- package/lib/commonjs/components/Button/index.js +31 -13
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +170 -187
- 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 +28 -0
- package/lib/commonjs/components/Card/styles.js.map +1 -0
- package/lib/commonjs/components/Checkbox/index.js +180 -0
- package/lib/commonjs/components/Checkbox/index.js.map +1 -0
- package/lib/commonjs/components/Checkbox/styles.js +68 -0
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -0
- 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 +50 -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/Form/FormLabelRoot.js +33 -0
- package/lib/commonjs/components/Form/FormLabelRoot.js.map +1 -0
- package/lib/commonjs/components/Form/FormLabelRoot.web.js +18 -0
- package/lib/commonjs/components/Form/FormLabelRoot.web.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 +255 -0
- package/lib/commonjs/components/Form/index.js.map +1 -0
- package/lib/commonjs/components/Form/styles.js +57 -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 +24 -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 +80 -0
- package/lib/commonjs/components/IconButton/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/styles.js +91 -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 +16 -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 +16 -0
- package/lib/commonjs/components/Link/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 +39 -0
- package/lib/commonjs/components/Stack/styles.js.map +1 -0
- package/lib/commonjs/components/Switch/BaseSwitch.js +46 -0
- package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -0
- package/lib/commonjs/components/Switch/BaseSwitch.web.js +56 -0
- package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -0
- package/lib/commonjs/components/Switch/index.js +13 -0
- package/lib/commonjs/components/Switch/index.js.map +1 -0
- package/lib/commonjs/components/Switch/styles.js +128 -0
- package/lib/commonjs/components/Switch/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 +24 -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 +192 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/metro/withCdxMetroConfig.js +24 -0
- package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/commonjs/styles/index.js +17 -0
- package/lib/commonjs/styles/index.js.map +1 -0
- package/lib/commonjs/styles/primitives.js +123 -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/buttonSharedVariants.js +195 -0
- package/lib/module/components/Button/buttonSharedVariants.js.map +1 -0
- package/lib/module/components/Button/index.js +32 -14
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +168 -186
- 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 +25 -0
- package/lib/module/components/Card/styles.js.map +1 -0
- package/lib/module/components/Checkbox/index.js +176 -0
- package/lib/module/components/Checkbox/index.js.map +1 -0
- package/lib/module/components/Checkbox/styles.js +64 -0
- package/lib/module/components/Checkbox/styles.js.map +1 -0
- 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 +46 -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/Form/FormLabelRoot.js +29 -0
- package/lib/module/components/Form/FormLabelRoot.js.map +1 -0
- package/lib/module/components/Form/FormLabelRoot.web.js +13 -0
- package/lib/module/components/Form/FormLabelRoot.web.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 +252 -0
- package/lib/module/components/Form/index.js.map +1 -0
- package/lib/module/components/Form/styles.js +53 -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 +20 -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 +76 -0
- package/lib/module/components/IconButton/index.js.map +1 -0
- package/lib/module/components/IconButton/styles.js +87 -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 +16 -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 +12 -0
- package/lib/module/components/Link/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 +35 -0
- package/lib/module/components/Stack/styles.js.map +1 -0
- package/lib/module/components/Switch/BaseSwitch.js +42 -0
- package/lib/module/components/Switch/BaseSwitch.js.map +1 -0
- package/lib/module/components/Switch/BaseSwitch.web.js +52 -0
- package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -0
- package/lib/module/components/Switch/index.js +9 -0
- package/lib/module/components/Switch/index.js.map +1 -0
- package/lib/module/components/Switch/styles.js +125 -0
- package/lib/module/components/Switch/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 +20 -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 +16 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/metro/withCdxMetroConfig.js +20 -0
- package/lib/module/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/module/styles/index.js +4 -0
- package/lib/module/styles/index.js.map +1 -0
- package/lib/module/styles/primitives.js +119 -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/buttonSharedVariants.d.ts +29 -0
- package/lib/typescript/components/Button/buttonSharedVariants.d.ts.map +1 -0
- 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 +14 -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 +46 -0
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/styles.d.ts +18 -0
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -0
- 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/Form/FormLabelRoot.d.ts +18 -0
- package/lib/typescript/components/Form/FormLabelRoot.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormLabelRoot.web.d.ts +20 -0
- package/lib/typescript/components/Form/FormLabelRoot.web.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.d.ts +12 -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 +64 -0
- package/lib/typescript/components/Form/index.d.ts.map +1 -0
- package/lib/typescript/components/Form/styles.d.ts +22 -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 +16 -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 +4 -0
- package/lib/typescript/components/Link/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 +10 -0
- package/lib/typescript/components/Stack/styles.d.ts.map +1 -0
- package/lib/typescript/components/Switch/BaseSwitch.d.ts +9 -0
- package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -0
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +15 -0
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -0
- package/lib/typescript/components/Switch/index.d.ts +7 -0
- package/lib/typescript/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/components/Switch/styles.d.ts +26 -0
- package/lib/typescript/components/Switch/styles.d.ts.map +1 -0
- 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 +16 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/metro/withCdxMetroConfig.d.ts +19 -0
- package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -0
- 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 +23 -16
- 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/buttonSharedVariants.ts +281 -0
- package/src/components/Button/index.tsx +24 -15
- package/src/components/Button/styles.ts +195 -229
- package/src/components/Card/index.tsx +115 -0
- package/src/components/Card/styles.ts +41 -0
- package/src/components/Checkbox/index.tsx +207 -0
- package/src/components/Checkbox/styles.ts +103 -0
- package/src/components/Chip/index.tsx +91 -0
- package/src/components/Chip/styles.ts +51 -0
- package/src/components/Dialog/index.tsx +304 -0
- package/src/components/Dialog/styles.ts +88 -0
- package/src/components/Form/FormLabelRoot.tsx +33 -0
- package/src/components/Form/FormLabelRoot.web.tsx +18 -0
- package/src/components/Form/FormRoot.tsx +19 -0
- package/src/components/Form/FormRoot.web.tsx +12 -0
- package/src/components/Form/index.tsx +272 -0
- package/src/components/Form/styles.ts +75 -0
- package/src/components/Heading/index.tsx +36 -0
- package/src/components/Heading/styles.tsx +26 -0
- package/src/components/Icon/index.tsx +54 -0
- package/src/components/IconButton/index.tsx +93 -0
- package/src/components/IconButton/styles.ts +131 -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 +42 -37
- package/src/components/Link/index.tsx +83 -0
- package/src/components/Link/styles.ts +20 -0
- package/src/components/ProgressSegmented/index.tsx +81 -0
- package/src/components/ProgressSegmented/styles.ts +19 -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 +37 -0
- package/src/components/Switch/BaseSwitch.tsx +38 -0
- package/src/components/Switch/BaseSwitch.web.tsx +69 -0
- package/src/components/Switch/index.tsx +11 -0
- package/src/components/Switch/styles.ts +120 -0
- package/src/components/Text/index.tsx +16 -0
- package/src/components/Text/styles.tsx +26 -0
- package/src/components/VirtualizedList/index.tsx +19 -0
- package/src/components/index.ts +16 -0
- package/src/index.ts +3 -0
- package/src/metro/withCdxMetroConfig.ts +29 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/primitives.ts +107 -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
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { Pressable, Text, View } from 'react-native';
|
|
5
|
+
import { ArrowDropDown } from '@cdx-ui/icons';
|
|
5
6
|
import { createSelect } from '@cdx-ui/primitives';
|
|
6
7
|
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
8
|
+
import { Icon } from '../Icon';
|
|
9
|
+
import { SelectTriggerHost } from './SelectTriggerHost';
|
|
7
10
|
import { selectContentVariants, selectIconVariants, selectItemLabelVariants, selectItemVariants, selectTriggerVariants, selectValueVariants } from './styles';
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
12
|
const SCOPE = 'SELECT';
|
|
10
13
|
const Root = withStyleContext(View, SCOPE);
|
|
11
14
|
const useSelectStyleContext = () => useStyleContext(SCOPE);
|
|
12
15
|
const SelectPrimitive = createSelect({
|
|
13
16
|
Root,
|
|
14
|
-
Trigger:
|
|
17
|
+
Trigger: SelectTriggerHost,
|
|
15
18
|
Value: Text,
|
|
16
19
|
Icon: View,
|
|
17
20
|
Content: View,
|
|
@@ -25,7 +28,7 @@ const SelectPrimitive = createSelect({
|
|
|
25
28
|
|
|
26
29
|
const SelectRoot = /*#__PURE__*/forwardRef(({
|
|
27
30
|
variant = 'outline',
|
|
28
|
-
size = '
|
|
31
|
+
size = 'default',
|
|
29
32
|
className,
|
|
30
33
|
children,
|
|
31
34
|
style,
|
|
@@ -63,12 +66,14 @@ const SelectTrigger = /*#__PURE__*/forwardRef(({
|
|
|
63
66
|
variant,
|
|
64
67
|
size
|
|
65
68
|
}), className);
|
|
66
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/_jsxs(SelectPrimitive.Trigger, {
|
|
67
70
|
ref: ref,
|
|
68
71
|
className: computedClassName,
|
|
69
72
|
style: style,
|
|
70
73
|
...props,
|
|
71
|
-
children: children
|
|
74
|
+
children: [children, /*#__PURE__*/_jsx(SelectIcon, {
|
|
75
|
+
as: ArrowDropDown
|
|
76
|
+
})]
|
|
72
77
|
});
|
|
73
78
|
});
|
|
74
79
|
SelectTrigger.displayName = 'Select.Trigger';
|
|
@@ -83,11 +88,9 @@ const SelectValue = /*#__PURE__*/forwardRef(({
|
|
|
83
88
|
...props
|
|
84
89
|
}, ref) => {
|
|
85
90
|
const {
|
|
86
|
-
variant,
|
|
87
91
|
size
|
|
88
92
|
} = useSelectStyleContext();
|
|
89
93
|
const computedClassName = cn(selectValueVariants({
|
|
90
|
-
variant,
|
|
91
94
|
size
|
|
92
95
|
}), className);
|
|
93
96
|
return /*#__PURE__*/_jsx(SelectPrimitive.Value, {
|
|
@@ -103,26 +106,23 @@ SelectValue.displayName = 'Select.Value';
|
|
|
103
106
|
// STYLED ICON COMPONENT
|
|
104
107
|
// =============================================================================
|
|
105
108
|
|
|
106
|
-
const SelectIcon =
|
|
109
|
+
const SelectIcon = ({
|
|
107
110
|
className,
|
|
108
111
|
style,
|
|
109
112
|
...props
|
|
110
|
-
}
|
|
113
|
+
}) => {
|
|
111
114
|
const {
|
|
112
|
-
variant,
|
|
113
115
|
size
|
|
114
116
|
} = useSelectStyleContext();
|
|
115
117
|
const computedClassName = cn(selectIconVariants({
|
|
116
|
-
variant,
|
|
117
118
|
size
|
|
118
119
|
}), className);
|
|
119
|
-
return /*#__PURE__*/_jsx(
|
|
120
|
-
ref: ref,
|
|
120
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
121
121
|
className: computedClassName,
|
|
122
122
|
style: style,
|
|
123
123
|
...props
|
|
124
124
|
});
|
|
125
|
-
}
|
|
125
|
+
};
|
|
126
126
|
SelectIcon.displayName = 'Select.Icon';
|
|
127
127
|
|
|
128
128
|
// =============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","Pressable","Text","View","createSelect","cn","useStyleContext","withStyleContext","selectContentVariants","selectIconVariants","selectItemLabelVariants","selectItemVariants","selectTriggerVariants","selectValueVariants","jsx","_jsx","SCOPE","Root","useSelectStyleContext","SelectPrimitive","Trigger","Value","
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","Text","View","ArrowDropDown","createSelect","cn","useStyleContext","withStyleContext","Icon","SelectTriggerHost","selectContentVariants","selectIconVariants","selectItemLabelVariants","selectItemVariants","selectTriggerVariants","selectValueVariants","jsx","_jsx","jsxs","_jsxs","SCOPE","Root","useSelectStyleContext","SelectPrimitive","Trigger","Value","Content","Item","ItemLabel","SelectRoot","variant","size","className","children","style","props","ref","context","displayName","SelectTrigger","computedClassName","SelectIcon","as","SelectValue","SelectContent","SelectItem","SelectItemLabel","Select","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Select/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,SAAS,EAAEC,IAAI,EAAkBC,IAAI,QAAwB,cAAc;AACpF,SAASC,aAAa,QAAQ,eAAe;AAC7C,SACEC,YAAY,QAOP,oBAAoB;AAC3B,SAASC,EAAE,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,eAAe;AACrE,SAASC,IAAI,QAAmB,SAAS;AACzC,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAEEC,qBAAqB,EACrBC,kBAAkB,EAClBC,uBAAuB,EACvBC,kBAAkB,EAClBC,qBAAqB,EACrBC,mBAAmB,QACd,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElB,MAAMC,KAAK,GAAG,QAAQ;AAEtB,MAAMC,IAAI,GAAGd,gBAAgB,CAACL,IAAI,EAAEkB,KAAK,CAAC;AAE1C,MAAME,qBAAqB,GAAGA,CAAA,KAAMhB,eAAe,CAACc,KAAK,CAAuB;AAEhF,MAAMG,eAAe,GAAGnB,YAAY,CAAC;EACnCiB,IAAI;EACJG,OAAO,EAAEf,iBAAiB;EAC1BgB,KAAK,EAAExB,IAAI;EACXO,IAAI,EAAEN,IAAI;EACVwB,OAAO,EAAExB,IAAI;EACbyB,IAAI,EAAE3B,SAAS;EACf4B,SAAS,EAAE3B;AACb,CA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E;EAC9CL,OAAO,EAAEe,aAAa;EACtBd,KAAK,EAAEkB,WAAW;EAClBnC,IAAI,EAAEiC,UAAU;EAChBf,OAAO,EAAEkB,aAAa;EACtBjB,IAAI,EAAEkB,UAAU;EAChBjB,SAAS,EAAEkB;AACb,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -2,116 +2,92 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { COLOR_BG_PRIMARY, COLOR_BORDER_DEFAULT, COLOR_TEXT_MUTED, COLOR_TEXT_PRIMARY, DISABLED_CURSOR, DISABLED_OPACITY, RADIUS_SM, RADIUS_MD, SHADOW_SM, SHADOW_MD, SIZE_SCALE, TRANSITION_COLORS } from '../../styles/primitives';
|
|
5
6
|
|
|
6
7
|
// ── Trigger ─────────────────────────────────────────────────
|
|
7
8
|
|
|
8
|
-
export const selectTriggerVariants = cva(['flex-row items-center justify-between
|
|
9
|
+
export const selectTriggerVariants = cva(['flex w-full min-w-0 flex-row items-center justify-between text-start', RADIUS_SM, SHADOW_SM, TRANSITION_COLORS, COLOR_BG_PRIMARY, `border ${COLOR_BORDER_DEFAULT}`, DISABLED_OPACITY, DISABLED_CURSOR, 'data-[readonly=true]:cursor-default', 'data-[state=open]:border-slate-900', 'data-[invalid=true]:border-red-500', 'data-[readonly=true]:bg-slate-50', Platform.select({
|
|
10
|
+
default: 'data-[active=true]:border-slate-300',
|
|
11
|
+
web: ['data-[hover=true]:border-slate-300 data-[active=true]:data-[hover=true]:border-slate-400', 'data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-slate-400/50 data-[focus-visible=true]:ring-offset-2', 'data-[state=open]:ring-2 data-[state=open]:ring-slate-400/50'].join(' ')
|
|
12
|
+
})], {
|
|
9
13
|
variants: {
|
|
10
14
|
variant: {
|
|
11
|
-
outline: [
|
|
12
|
-
default: 'data-[active=true]:border-gray-400',
|
|
13
|
-
web: 'data-[hover=true]:border-gray-400 data-[active=true]:data-[hover=true]:border-gray-500'
|
|
14
|
-
}), 'data-[state=open]:data-[invalid=false]:border-blue-500', 'data-[invalid=true]:border-red-500', 'data-[readonly=true]:bg-gray-50'],
|
|
15
|
-
filled: ['bg-gray-100 border border-transparent', Platform.select({
|
|
16
|
-
default: 'data-[active=true]:bg-gray-200',
|
|
17
|
-
web: 'data-[hover=true]:bg-gray-200 data-[active=true]:data-[hover=true]:bg-gray-300'
|
|
18
|
-
}), 'data-[state=open]:border-blue-500', 'data-[invalid=true]:border-red-500 data-[invalid=true]:border', 'data-[readonly=true]:bg-gray-200'],
|
|
19
|
-
ghost: ['bg-transparent border border-transparent', Platform.select({
|
|
20
|
-
default: 'data-[active=true]:bg-gray-100',
|
|
21
|
-
web: 'data-[hover=true]:bg-gray-50 data-[active=true]:data-[hover=true]:bg-gray-100'
|
|
22
|
-
}), 'data-[invalid=true]:border-red-500 data-[invalid=true]:border']
|
|
15
|
+
outline: []
|
|
23
16
|
},
|
|
24
17
|
size: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
lg: 'h-12 px-4 gap-2.5'
|
|
18
|
+
default: `${SIZE_SCALE.default.height} ${SIZE_SCALE.default.px} ${SIZE_SCALE.default.gap}`,
|
|
19
|
+
small: `${SIZE_SCALE.small.height} ${SIZE_SCALE.small.px} ${SIZE_SCALE.small.gap}`
|
|
28
20
|
}
|
|
29
21
|
},
|
|
30
22
|
defaultVariants: {
|
|
31
23
|
variant: 'outline',
|
|
32
|
-
size: '
|
|
24
|
+
size: 'default'
|
|
33
25
|
}
|
|
34
26
|
});
|
|
35
27
|
|
|
36
28
|
// ── Value ───────────────────────────────────────────────────
|
|
37
29
|
|
|
38
|
-
export const selectValueVariants = cva(['flex-1', 'data-[placeholder=true]:text-
|
|
30
|
+
export const selectValueVariants = cva(['min-w-0 flex-1 text-start', 'data-[placeholder=true]:text-slate-400', 'data-[invalid=true]:text-red-600', COLOR_TEXT_PRIMARY], {
|
|
39
31
|
variants: {
|
|
40
|
-
variant: {
|
|
41
|
-
outline: 'text-gray-900',
|
|
42
|
-
filled: 'text-gray-900',
|
|
43
|
-
ghost: 'text-gray-900'
|
|
44
|
-
},
|
|
45
32
|
size: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
lg: 'text-lg'
|
|
33
|
+
default: SIZE_SCALE.default.text,
|
|
34
|
+
small: SIZE_SCALE.small.text
|
|
49
35
|
}
|
|
50
36
|
},
|
|
51
37
|
defaultVariants: {
|
|
52
|
-
|
|
53
|
-
size: 'md'
|
|
38
|
+
size: 'default'
|
|
54
39
|
}
|
|
55
40
|
});
|
|
56
41
|
|
|
57
42
|
// ── Icon ────────────────────────────────────────────────────
|
|
58
43
|
|
|
59
|
-
export const selectIconVariants = cva(['items-center justify-center', 'data-[invalid=true]:text-red-500'], {
|
|
44
|
+
export const selectIconVariants = cva(['shrink-0 items-center justify-center self-center', COLOR_TEXT_MUTED, 'data-[invalid=true]:text-red-500'], {
|
|
60
45
|
variants: {
|
|
61
|
-
variant: {
|
|
62
|
-
outline: 'text-gray-500',
|
|
63
|
-
filled: 'text-gray-500',
|
|
64
|
-
ghost: 'text-gray-400'
|
|
65
|
-
},
|
|
66
46
|
size: {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
lg: 'h-6 w-6'
|
|
47
|
+
default: 'h-5 w-5',
|
|
48
|
+
small: 'h-4 w-4'
|
|
70
49
|
}
|
|
71
50
|
},
|
|
72
51
|
defaultVariants: {
|
|
73
|
-
|
|
74
|
-
size: 'md'
|
|
52
|
+
size: 'default'
|
|
75
53
|
}
|
|
76
54
|
});
|
|
77
55
|
|
|
78
56
|
// ── Content ─────────────────────────────────────────────────
|
|
79
57
|
|
|
80
|
-
export const selectContentVariants = cva([
|
|
81
|
-
web:
|
|
58
|
+
export const selectContentVariants = cva([COLOR_BG_PRIMARY, `border ${COLOR_BORDER_DEFAULT}`, 'overflow-hidden', RADIUS_MD, Platform.select({
|
|
59
|
+
web: SHADOW_MD,
|
|
82
60
|
default: ''
|
|
83
61
|
}), 'max-h-60', 'py-1']);
|
|
84
62
|
|
|
85
63
|
// ── Item ────────────────────────────────────────────────────
|
|
86
64
|
|
|
87
|
-
export const selectItemVariants = cva(['flex-row items-center', 'transition-colors duration-100', 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none', 'data-[state=checked]:bg-
|
|
88
|
-
default: 'data-[active=true]:bg-
|
|
89
|
-
web: 'data-[hover=true]:bg-
|
|
65
|
+
export const selectItemVariants = cva(['flex-row items-center', 'transition-colors duration-100', 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none', 'data-[state=checked]:bg-slate-50 data-[state=checked]:font-medium', Platform.select({
|
|
66
|
+
default: 'data-[active=true]:bg-slate-100',
|
|
67
|
+
web: 'data-[hover=true]:bg-slate-50 data-[active=true]:data-[hover=true]:bg-slate-100 data-[highlighted=true]:bg-slate-50'
|
|
90
68
|
})], {
|
|
91
69
|
variants: {
|
|
92
70
|
size: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
lg: 'px-4 py-2.5'
|
|
71
|
+
default: 'px-3 py-2',
|
|
72
|
+
small: 'px-2.5 py-1.5'
|
|
96
73
|
}
|
|
97
74
|
},
|
|
98
75
|
defaultVariants: {
|
|
99
|
-
size: '
|
|
76
|
+
size: 'default'
|
|
100
77
|
}
|
|
101
78
|
});
|
|
102
79
|
|
|
103
80
|
// ── ItemLabel ───────────────────────────────────────────────
|
|
104
81
|
|
|
105
|
-
export const selectItemLabelVariants = cva([
|
|
82
|
+
export const selectItemLabelVariants = cva([COLOR_TEXT_PRIMARY, 'data-[state=checked]:font-medium'], {
|
|
106
83
|
variants: {
|
|
107
84
|
size: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
lg: 'text-lg'
|
|
85
|
+
default: SIZE_SCALE.default.text,
|
|
86
|
+
small: SIZE_SCALE.small.text
|
|
111
87
|
}
|
|
112
88
|
},
|
|
113
89
|
defaultVariants: {
|
|
114
|
-
size: '
|
|
90
|
+
size: 'default'
|
|
115
91
|
}
|
|
116
92
|
});
|
|
117
93
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","
|
|
1
|
+
{"version":3,"names":["Platform","cva","COLOR_BG_PRIMARY","COLOR_BORDER_DEFAULT","COLOR_TEXT_MUTED","COLOR_TEXT_PRIMARY","DISABLED_CURSOR","DISABLED_OPACITY","RADIUS_SM","RADIUS_MD","SHADOW_SM","SHADOW_MD","SIZE_SCALE","TRANSITION_COLORS","selectTriggerVariants","select","default","web","join","variants","variant","outline","size","height","px","gap","small","defaultVariants","selectValueVariants","text","selectIconVariants","selectContentVariants","selectItemVariants","selectItemLabelVariants"],"sourceRoot":"../../../../src","sources":["components/Select/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AACjE,SACEC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,EAChBC,kBAAkB,EAClBC,eAAe,EACfC,gBAAgB,EAChBC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,iBAAiB,QACZ,yBAAyB;;AAEhC;;AAEA,OAAO,MAAMC,qBAAqB,GAAGb,GAAG,CACtC,CACE,sEAAsE,EACtEO,SAAS,EACTE,SAAS,EACTG,iBAAiB,EACjBX,gBAAgB,EAChB,UAAUC,oBAAoB,EAAE,EAChCI,gBAAgB,EAChBD,eAAe,EACf,qCAAqC,EACrC,oCAAoC,EACpC,oCAAoC,EACpC,kCAAkC,EAClCN,QAAQ,CAACe,MAAM,CAAC;EACdC,OAAO,EAAE,qCAAqC;EAC9CC,GAAG,EAAE,CACH,0FAA0F,EAC1F,sHAAsH,EACtH,8DAA8D,CAC/D,CAACC,IAAI,CAAC,GAAG;AACZ,CAAC,CAAC,CACH,EACD;EACEC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,OAAO,EAAE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AAM,CACP,CAAC;;AAEF;;AAEA,OAAO,MAAMgB,kBAAkB,GAAG/B,GAAG,CACnC,CACE,uBAAuB,EACvB,gCAAgC,EAChC,0EAA0E,EAC1E,mEAAmE,EACnED,QAAQ,CAACe,MAAM,CAAC;EACdC,OAAO,EAAE,iCAAiC;EAC1CC,GAAG,EAAE;AACP,CAAC,CAAC,CACH,EACD;EACEE,QAAQ,EAAE;IACRG,IAAI,EAAE;MACJN,OAAO,EAAE,WAAW;MACpBU,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,MAAMW,uBAAuB,GAAGhC,GAAG,CACxC,CAACI,kBAAkB,EAAE,kCAAkC,CAAC,EACxD;EACEc,QAAQ,EAAE;IACRG,IAAI,EAAE;MACJN,OAAO,EAAEJ,UAAU,CAACI,OAAO,CAACa,IAAI;MAChCH,KAAK,EAAEd,UAAU,CAACc,KAAK,CAACG;IAC1B;EACF,CAAC;EACDF,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -2,37 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// TODO: Integrate with tokens (multiply by spacing)
|
|
5
|
+
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { hStackRootVariants } from './styles';
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const spaceScale = {
|
|
10
|
-
xs: 1,
|
|
11
|
-
sm: 2,
|
|
12
|
-
md: 3,
|
|
13
|
-
lg: 4,
|
|
14
|
-
xl: 5,
|
|
15
|
-
'2xl': 6,
|
|
16
|
-
'3xl': 7,
|
|
17
|
-
'4xl': 8
|
|
18
|
-
};
|
|
19
8
|
export const HStack = /*#__PURE__*/forwardRef(({
|
|
9
|
+
reversed = false,
|
|
20
10
|
space,
|
|
21
|
-
reversed,
|
|
22
11
|
style,
|
|
23
12
|
className,
|
|
24
13
|
children,
|
|
25
14
|
...restProps
|
|
26
15
|
}, ref) => {
|
|
27
|
-
const gap = space ? spaceScale[space] : undefined;
|
|
28
16
|
return /*#__PURE__*/_jsx(View, {
|
|
29
17
|
ref: ref,
|
|
30
|
-
className:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
} : null, style],
|
|
18
|
+
className: cn(hStackRootVariants({
|
|
19
|
+
reversed,
|
|
20
|
+
space
|
|
21
|
+
}), className),
|
|
22
|
+
style: style,
|
|
36
23
|
...restProps,
|
|
37
24
|
children: children
|
|
38
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","View","
|
|
1
|
+
{"version":3,"names":["forwardRef","View","cn","hStackRootVariants","jsx","_jsx","HStack","reversed","space","style","className","children","restProps","ref","displayName"],"sourceRoot":"../../../../src","sources":["components/Stack/HStack.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,kBAAkB,QAAyB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ/D,OAAO,MAAMC,MAAM,gBAAGN,UAAU,CAC9B,CACE;EAAEO,QAAQ,GAAG,KAAK;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAU,CAAC,EACrEC,GAAuB,KACpB;EACH,oBACER,IAAA,CAACJ,IAAI;IACHY,GAAG,EAAEA,GAAI;IACTH,SAAS,EAAER,EAAE,CAACC,kBAAkB,CAAC;MAAEI,QAAQ;MAAEC;IAAM,CAAC,CAAC,EAAEE,SAAS,CAAE;IAClED,KAAK,EAAEA,KAAM;IAAA,GACTG,SAAS;IAAAD,QAAA,EAEZA;EAAQ,CACL,CAAC;AAEX,CACF,CAAC;AAEDL,MAAM,CAACQ,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -2,37 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// TODO: Integrate with tokens (multiply by spacing)
|
|
5
|
+
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { vStackRootVariants } from './styles';
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const spaceScale = {
|
|
10
|
-
xs: 1,
|
|
11
|
-
sm: 2,
|
|
12
|
-
md: 3,
|
|
13
|
-
lg: 4,
|
|
14
|
-
xl: 5,
|
|
15
|
-
'2xl': 6,
|
|
16
|
-
'3xl': 7,
|
|
17
|
-
'4xl': 8
|
|
18
|
-
};
|
|
19
8
|
export const VStack = /*#__PURE__*/forwardRef(({
|
|
9
|
+
reversed = false,
|
|
20
10
|
space,
|
|
21
|
-
reversed,
|
|
22
11
|
style,
|
|
23
12
|
className,
|
|
24
13
|
children,
|
|
25
14
|
...restProps
|
|
26
15
|
}, ref) => {
|
|
27
|
-
const gap = space ? spaceScale[space] : undefined;
|
|
28
16
|
return /*#__PURE__*/_jsx(View, {
|
|
29
17
|
ref: ref,
|
|
30
|
-
className:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
} : null, style],
|
|
18
|
+
className: cn(vStackRootVariants({
|
|
19
|
+
reversed,
|
|
20
|
+
space
|
|
21
|
+
}), className),
|
|
22
|
+
style: style,
|
|
36
23
|
...restProps,
|
|
37
24
|
children: children
|
|
38
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","View","
|
|
1
|
+
{"version":3,"names":["forwardRef","View","cn","vStackRootVariants","jsx","_jsx","VStack","reversed","space","style","className","children","restProps","ref","displayName"],"sourceRoot":"../../../../src","sources":["components/Stack/VStack.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,kBAAkB,QAAyB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ/D,OAAO,MAAMC,MAAM,gBAAGN,UAAU,CAC9B,CACE;EAAEO,QAAQ,GAAG,KAAK;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAU,CAAC,EACrEC,GAAuB,KACpB;EACH,oBACER,IAAA,CAACJ,IAAI;IACHY,GAAG,EAAEA,GAAI;IACTH,SAAS,EAAER,EAAE,CAACC,kBAAkB,CAAC;MAAEI,QAAQ;MAAEC;IAAM,CAAC,CAAC,EAAEE,SAAS,CAAE;IAClED,KAAK,EAAEA,KAAM;IAAA,GACTG,SAAS;IAAAD,QAAA,EAEZA;EAAQ,CACL,CAAC;AAEX,CACF,CAAC;AAEDL,MAAM,CAACQ,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
const spaceMap = {
|
|
5
|
+
xs: 'gap-1',
|
|
6
|
+
sm: 'gap-2',
|
|
7
|
+
md: 'gap-3',
|
|
8
|
+
lg: 'gap-4',
|
|
9
|
+
xl: 'gap-5'
|
|
10
|
+
};
|
|
11
|
+
export const hStackRootVariants = cva([], {
|
|
12
|
+
variants: {
|
|
13
|
+
reversed: {
|
|
14
|
+
true: 'flex-row-reverse',
|
|
15
|
+
false: 'flex-row'
|
|
16
|
+
},
|
|
17
|
+
space: spaceMap
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
reversed: false
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export const vStackRootVariants = cva([], {
|
|
24
|
+
variants: {
|
|
25
|
+
reversed: {
|
|
26
|
+
true: 'flex-col-reverse',
|
|
27
|
+
false: 'flex-col'
|
|
28
|
+
},
|
|
29
|
+
space: spaceMap
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
reversed: false
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cva","spaceMap","xs","sm","md","lg","xl","hStackRootVariants","variants","reversed","true","false","space","defaultVariants","vStackRootVariants"],"sourceRoot":"../../../../src","sources":["components/Stack/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAI9C,MAAMC,QAAQ,GAAG;EACfC,EAAE,EAAE,OAAO;EACXC,EAAE,EAAE,OAAO;EACXC,EAAE,EAAE,OAAO;EACXC,EAAE,EAAE,OAAO;EACXC,EAAE,EAAE;AACN,CAA+C;AAE/C,OAAO,MAAMC,kBAAkB,GAAGP,GAAG,CAAC,EAAE,EAAE;EACxCQ,QAAQ,EAAE;IACRC,QAAQ,EAAE;MACRC,IAAI,EAAE,kBAAkB;MACxBC,KAAK,EAAE;IACT,CAAC;IACDC,KAAK,EAAEX;EACT,CAAC;EACDY,eAAe,EAAE;IACfJ,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,OAAO,MAAMK,kBAAkB,GAAGd,GAAG,CAAC,EAAE,EAAE;EACxCQ,QAAQ,EAAE;IACRC,QAAQ,EAAE;MACRC,IAAI,EAAE,kBAAkB;MACxBC,KAAK,EAAE;IACT,CAAC;IACDC,KAAK,EAAEX;EACT,CAAC;EACDY,eAAe,EAAE;IACfJ,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Switch as RNSwitch } from 'react-native';
|
|
5
|
+
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { switchIosBgVariants, switchThumbColorVariants, switchTrackOffVariants, switchTrackOnVariants } from './styles';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const BaseSwitch = /*#__PURE__*/forwardRef(({
|
|
9
|
+
states,
|
|
10
|
+
className,
|
|
11
|
+
disabled,
|
|
12
|
+
value,
|
|
13
|
+
...props
|
|
14
|
+
}, ref) => {
|
|
15
|
+
const isChecked = value ?? states?.checked ?? false;
|
|
16
|
+
const isDisabled = disabled ?? states?.disabled ?? false;
|
|
17
|
+
const isInvalid = states?.invalid ?? false;
|
|
18
|
+
const uniwindProps = {
|
|
19
|
+
className,
|
|
20
|
+
thumbColorClassName: cn(switchThumbColorVariants({
|
|
21
|
+
isDisabled
|
|
22
|
+
})),
|
|
23
|
+
trackColorOnClassName: cn(switchTrackOnVariants({
|
|
24
|
+
isInvalid
|
|
25
|
+
})),
|
|
26
|
+
trackColorOffClassName: cn(switchTrackOffVariants({
|
|
27
|
+
isInvalid
|
|
28
|
+
})),
|
|
29
|
+
ios_backgroundColorClassName: cn(switchIosBgVariants({
|
|
30
|
+
isInvalid
|
|
31
|
+
}))
|
|
32
|
+
};
|
|
33
|
+
return /*#__PURE__*/_jsx(RNSwitch, {
|
|
34
|
+
ref: ref,
|
|
35
|
+
value: isChecked,
|
|
36
|
+
disabled: isDisabled,
|
|
37
|
+
...uniwindProps,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
BaseSwitch.displayName = 'BaseSwitch';
|
|
42
|
+
//# sourceMappingURL=BaseSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Switch","RNSwitch","cn","switchIosBgVariants","switchThumbColorVariants","switchTrackOffVariants","switchTrackOnVariants","jsx","_jsx","BaseSwitch","states","className","disabled","value","props","ref","isChecked","checked","isDisabled","isInvalid","invalid","uniwindProps","thumbColorClassName","trackColorOnClassName","trackColorOffClassName","ios_backgroundColorClassName","displayName"],"sourceRoot":"../../../../src","sources":["components/Switch/BaseSwitch.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,MAAM,IAAIC,QAAQ,QAA0B,cAAc;AACnE,SAASC,EAAE,QAAQ,eAAe;AAClC,SACEC,mBAAmB,EACnBC,wBAAwB,EACxBC,sBAAsB,EACtBC,qBAAqB,QAChB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASlB,OAAO,MAAMC,UAAU,gBAAGV,UAAU,CAClC,CAAC;EAAEW,MAAM;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACzD,MAAMC,SAAS,GAAGH,KAAK,IAAIH,MAAM,EAAEO,OAAO,IAAI,KAAK;EACnD,MAAMC,UAAU,GAAGN,QAAQ,IAAIF,MAAM,EAAEE,QAAQ,IAAI,KAAK;EACxD,MAAMO,SAAS,GAAGT,MAAM,EAAEU,OAAO,IAAI,KAAK;EAE1C,MAAMC,YAAgD,GAAG;IACvDV,SAAS;IACTW,mBAAmB,EAAEpB,EAAE,CAACE,wBAAwB,CAAC;MAAEc;IAAW,CAAC,CAAC,CAAC;IACjEK,qBAAqB,EAAErB,EAAE,CAACI,qBAAqB,CAAC;MAAEa;IAAU,CAAC,CAAC,CAAC;IAC/DK,sBAAsB,EAAEtB,EAAE,CAACG,sBAAsB,CAAC;MAAEc;IAAU,CAAC,CAAC,CAAC;IACjEM,4BAA4B,EAAEvB,EAAE,CAACC,mBAAmB,CAAC;MAAEgB;IAAU,CAAC,CAAC;EACrE,CAAC;EAED,oBACEX,IAAA,CAACP,QAAQ;IAACc,GAAG,EAAEA,GAAI;IAACF,KAAK,EAAEG,SAAU;IAACJ,QAAQ,EAAEM,UAAW;IAAA,GAAKG,YAAY;IAAA,GAAMP;EAAK,CAAG,CAAC;AAE/F,CACF,CAAC;AAEDL,UAAU,CAACiB,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Pressable, View } from 'react-native';
|
|
5
|
+
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { switchThumbVariants, switchTrackVariants, switchWebTrackColorVariants } from './styles';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const BaseSwitch = /*#__PURE__*/forwardRef(({
|
|
9
|
+
value,
|
|
10
|
+
onValueChange,
|
|
11
|
+
disabled,
|
|
12
|
+
states,
|
|
13
|
+
dataSet,
|
|
14
|
+
className,
|
|
15
|
+
size = 'md',
|
|
16
|
+
onFocus,
|
|
17
|
+
onBlur,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) => {
|
|
20
|
+
const isChecked = value ?? states?.checked ?? false;
|
|
21
|
+
const isDisabled = disabled ?? states?.disabled ?? false;
|
|
22
|
+
const isInvalid = states?.invalid ?? false;
|
|
23
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
24
|
+
ref: ref,
|
|
25
|
+
role: "switch",
|
|
26
|
+
"aria-checked": isChecked,
|
|
27
|
+
"aria-disabled": isDisabled,
|
|
28
|
+
disabled: isDisabled,
|
|
29
|
+
onPress: () => onValueChange?.(!isChecked),
|
|
30
|
+
onFocus: onFocus,
|
|
31
|
+
onBlur: onBlur,
|
|
32
|
+
tabIndex: 0,
|
|
33
|
+
className: cn(switchTrackVariants({
|
|
34
|
+
size
|
|
35
|
+
}), switchWebTrackColorVariants({
|
|
36
|
+
isChecked,
|
|
37
|
+
isInvalid
|
|
38
|
+
}), className)
|
|
39
|
+
// @ts-expect-error dataSet is a RNW/Uniwind prop not in Pressable types
|
|
40
|
+
,
|
|
41
|
+
dataSet: dataSet,
|
|
42
|
+
...props,
|
|
43
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
44
|
+
className: cn(switchThumbVariants({
|
|
45
|
+
size,
|
|
46
|
+
isChecked
|
|
47
|
+
}))
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
BaseSwitch.displayName = 'BaseSwitch';
|
|
52
|
+
//# sourceMappingURL=BaseSwitch.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","View","cn","switchThumbVariants","switchTrackVariants","switchWebTrackColorVariants","jsx","_jsx","BaseSwitch","value","onValueChange","disabled","states","dataSet","className","size","onFocus","onBlur","props","ref","isChecked","checked","isDisabled","isInvalid","invalid","role","onPress","tabIndex","children","displayName"],"sourceRoot":"../../../../src","sources":["components/Switch/BaseSwitch.web.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,EAAE,QAAQ,eAAe;AAClC,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,2BAA2B,QAEtB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAclB,OAAO,MAAMC,UAAU,gBAAGT,UAAU,CAClC,CACE;EACEU,KAAK;EACLC,aAAa;EACbC,QAAQ;EACRC,MAAM;EACNC,OAAO;EACPC,SAAS;EACTC,IAAI,GAAG,IAAI;EACXC,OAAO;EACPC,MAAM;EACN,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,SAAS,GAAGX,KAAK,IAAIG,MAAM,EAAES,OAAO,IAAI,KAAK;EACnD,MAAMC,UAAU,GAAGX,QAAQ,IAAIC,MAAM,EAAED,QAAQ,IAAI,KAAK;EACxD,MAAMY,SAAS,GAAGX,MAAM,EAAEY,OAAO,IAAI,KAAK;EAE1C,oBACEjB,IAAA,CAACP,SAAS;IACRmB,GAAG,EAAEA,GAAI;IACTM,IAAI,EAAC,QAAQ;IACb,gBAAcL,SAAU;IACxB,iBAAeE,UAAW;IAC1BX,QAAQ,EAAEW,UAAW;IACrBI,OAAO,EAAEA,CAAA,KAAMhB,aAAa,GAAG,CAACU,SAAS,CAAE;IAC3CJ,OAAO,EAAEA,OAAQ;IACjBC,MAAM,EAAEA,MAAO;IACfU,QAAQ,EAAE,CAAE;IACZb,SAAS,EAAEZ,EAAE,CACXE,mBAAmB,CAAC;MAAEW;IAAK,CAAC,CAAC,EAC7BV,2BAA2B,CAAC;MAAEe,SAAS;MAAEG;IAAU,CAAC,CAAC,EACrDT,SACF;IACA;IAAA;IACAD,OAAO,EAAEA,OAAQ;IAAA,GACbK,KAAK;IAAAU,QAAA,eAETrB,IAAA,CAACN,IAAI;MAACa,SAAS,EAAEZ,EAAE,CAACC,mBAAmB,CAAC;QAAEY,IAAI;QAAEK;MAAU,CAAC,CAAC;IAAE,CAAE;EAAC,CACxD,CAAC;AAEhB,CACF,CAAC;AAEDZ,UAAU,CAACqB,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSwitch","BaseSwitch","SwitchPrimitive","Root","Switch"],"sourceRoot":"../../../../src","sources":["components/Switch/index.tsx"],"mappings":";;AAAA,SAA4BA,YAAY,QAAQ,oBAAoB;AACpE,SAASC,UAAU,QAAQ,cAAc;AAGzC,MAAMC,eAAe,GAAGF,YAAY,CAAC;EAAEG,IAAI,EAAEF;AAAW,CAAC,CAAC;AAM1D,OAAO,MAAMG,MAAM,GAAGF,eAAe","ignoreList":[]}
|