@cdx-ui/components 0.0.1-alpha.9 → 0.0.1-beta.2
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 +53 -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 +28 -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/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 +204 -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/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/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 +25 -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/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 +17 -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/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/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/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 +17 -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/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 +41 -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.tsx +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/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.tsx +25 -0
- package/src/components/VirtualizedList/index.tsx +19 -0
- package/src/components/index.ts +17 -0
- package/src/index.ts +3 -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
package/README.md
CHANGED
|
@@ -24,11 +24,62 @@ import { Button } from '@cdx-ui/components';
|
|
|
24
24
|
|
|
25
25
|
export function Example() {
|
|
26
26
|
return (
|
|
27
|
-
<Button variant="
|
|
27
|
+
<Button variant="strong" color="action" size="default" onPress={() => console.log('pressed')}>
|
|
28
28
|
<Button.Label>Get Started</Button.Label>
|
|
29
29
|
</Button>
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Component stories live in [`apps/storybook`](../../apps/storybook/).
|
|
34
|
+
Component stories live in [`apps/storybook`](../../apps/storybook/). See the full [component reference](../../docs/README.md#components) for per-component docs.
|
|
35
|
+
|
|
36
|
+
### Components
|
|
37
|
+
|
|
38
|
+
AlertDialog, Avatar, BottomSheet, Button, Card, Checkbox, Chip, Dialog, Field, Form, Heading, HStack / VStack, Icon, IconButton, Image, Input, Link, OtpInput, ProgressBar, ProgressSegmented, Select, Switch, Text, VirtualizedList.
|
|
39
|
+
|
|
40
|
+
> `Box` is exported but deprecated — use React Native's `View` directly.
|
|
41
|
+
|
|
42
|
+
### Metro configuration helper
|
|
43
|
+
|
|
44
|
+
The package ships a `withCdxMetroConfig` helper that wraps your Metro config with CDX UI's styling-layer setup. This abstracts the underlying Uniwind configuration so consuming Metro configs stay stable if the styling layer changes.
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
const { withCdxMetroConfig } = require('@cdx-ui/components/metro');
|
|
48
|
+
|
|
49
|
+
module.exports = withCdxMetroConfig(config, {
|
|
50
|
+
cssEntryFile: './global.css',
|
|
51
|
+
generatedTypesFile: './uniwind-types.d.ts', // optional
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`withCdxMetroConfig` must be the **outermost** wrapper if you compose multiple Metro config helpers.
|
|
56
|
+
|
|
57
|
+
### React Native re-exports
|
|
58
|
+
|
|
59
|
+
For convenience, the package re-exports several core RN components and hooks with Uniwind `className` support:
|
|
60
|
+
|
|
61
|
+
| Export | Source |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `View` | `react-native` |
|
|
64
|
+
| `ScrollView` | `react-native` |
|
|
65
|
+
| `KeyboardAvoidingView` | `react-native` |
|
|
66
|
+
| `SafeAreaView` | `react-native-safe-area-context` |
|
|
67
|
+
| `useSafeAreaInsets` | `react-native-safe-area-context` |
|
|
68
|
+
|
|
69
|
+
## Testing
|
|
70
|
+
|
|
71
|
+
Tests live in [`__tests__/`](./__tests__/). **Jest** uses the repo-root **`jest.config.js`** with **two projects**: **`rntl`** (jest-expo native + **`@testing-library/react-native`**) for `*.test.tsx`, and **`axe`** (jest-expo web + jsdom + **`@testing-library/react`** + **`jest-axe`**) for `*.axe.test.tsx`.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# From monorepo root
|
|
75
|
+
pnpm nx run @cdx-ui/components:test
|
|
76
|
+
# or
|
|
77
|
+
pnpm test:all
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Production types use `tsconfig.json`; tests use `tsconfig.test.json`.
|
|
81
|
+
|
|
82
|
+
**Authoring:** See **[docs/internal/testing.md](../../docs/internal/testing.md)** (RNTL vs DOM, `fireEvent.press` vs `fireEvent.click`, file naming).
|
|
83
|
+
|
|
84
|
+
**A11y-only ad-hoc** (from `packages/components`):
|
|
85
|
+
`pnpm exec jest --config ../../jest.config.js --testNamePattern="a11y"`
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AlertDialog = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _Button = require("../Button");
|
|
11
|
+
var _Dialog = require("../Dialog");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// ALERT DIALOG ROOT (Dialog with non-dismissible defaults + alertdialog role)
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
const AlertDialogRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
19
|
+
closeOnBackdropPress = false,
|
|
20
|
+
closeOnEscKey = false,
|
|
21
|
+
role = 'alertdialog',
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.Dialog, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
closeOnBackdropPress: closeOnBackdropPress,
|
|
27
|
+
closeOnEscKey: closeOnEscKey,
|
|
28
|
+
role: role,
|
|
29
|
+
...props,
|
|
30
|
+
children: children
|
|
31
|
+
}));
|
|
32
|
+
AlertDialogRoot.displayName = 'AlertDialog';
|
|
33
|
+
|
|
34
|
+
// =============================================================================
|
|
35
|
+
// ALERT DIALOG ACTION
|
|
36
|
+
// =============================================================================
|
|
37
|
+
|
|
38
|
+
const AlertDialogAction = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
39
|
+
asChild = false,
|
|
40
|
+
children,
|
|
41
|
+
color = 'action',
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}, ref) => {
|
|
45
|
+
if (asChild && /*#__PURE__*/_react.default.isValidElement(children)) {
|
|
46
|
+
return /*#__PURE__*/_react.default.cloneElement(children, {
|
|
47
|
+
ref,
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
53
|
+
ref: ref,
|
|
54
|
+
variant: "strong",
|
|
55
|
+
color: color,
|
|
56
|
+
className: className,
|
|
57
|
+
...props,
|
|
58
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button.Label, {
|
|
59
|
+
children: children
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
AlertDialogAction.displayName = 'AlertDialog.Action';
|
|
64
|
+
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// ALERT DIALOG CANCEL
|
|
67
|
+
// =============================================================================
|
|
68
|
+
|
|
69
|
+
const AlertDialogCancel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
70
|
+
asChild = false,
|
|
71
|
+
children,
|
|
72
|
+
onPress,
|
|
73
|
+
className,
|
|
74
|
+
...props
|
|
75
|
+
}, ref) => {
|
|
76
|
+
const {
|
|
77
|
+
onOpenChange
|
|
78
|
+
} = (0, _primitives.useDialog)();
|
|
79
|
+
const handlePress = (0, _utils.composeEventHandlers)(onPress, () => onOpenChange(false));
|
|
80
|
+
if (asChild && /*#__PURE__*/_react.default.isValidElement(children)) {
|
|
81
|
+
return /*#__PURE__*/_react.default.cloneElement(children, {
|
|
82
|
+
ref,
|
|
83
|
+
onPress: handlePress,
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
89
|
+
ref: ref,
|
|
90
|
+
variant: "outline",
|
|
91
|
+
onPress: handlePress,
|
|
92
|
+
className: className,
|
|
93
|
+
...props,
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button.Label, {
|
|
95
|
+
children: children
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
AlertDialogCancel.displayName = 'AlertDialog.Cancel';
|
|
100
|
+
|
|
101
|
+
// =============================================================================
|
|
102
|
+
// COMPOUND EXPORT
|
|
103
|
+
// =============================================================================
|
|
104
|
+
|
|
105
|
+
const AlertDialog = exports.AlertDialog = Object.assign(AlertDialogRoot, {
|
|
106
|
+
Trigger: _Dialog.Dialog.Trigger,
|
|
107
|
+
Content: _Dialog.Dialog.Content,
|
|
108
|
+
Header: _Dialog.Dialog.Header,
|
|
109
|
+
Title: _Dialog.Dialog.Title,
|
|
110
|
+
Description: _Dialog.Dialog.Description,
|
|
111
|
+
Body: _Dialog.Dialog.Body,
|
|
112
|
+
Footer: _Dialog.Dialog.Footer,
|
|
113
|
+
Close: _Dialog.Dialog.Close,
|
|
114
|
+
Action: AlertDialogAction,
|
|
115
|
+
Cancel: AlertDialogCancel
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_primitives","_utils","_Button","_Dialog","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AlertDialogRoot","forwardRef","closeOnBackdropPress","closeOnEscKey","role","children","props","ref","jsx","Dialog","displayName","AlertDialogAction","asChild","color","className","React","isValidElement","cloneElement","Button","variant","Label","AlertDialogCancel","onPress","onOpenChange","useDialog","handlePress","composeEventHandlers","AlertDialog","exports","assign","Trigger","Content","Header","Title","Description","Body","Footer","Close","Action","Cancel"],"sourceRoot":"../../../../src","sources":["components/AlertDialog/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAyD,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YA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avatar = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
10
|
+
var _utils = require("@cdx-ui/utils");
|
|
11
|
+
var _Icon = require("../Icon");
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const SCOPE = 'AVATAR';
|
|
15
|
+
const Root = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
16
|
+
const useAvatarStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
17
|
+
const AvatarPrimitive = (0, _primitives.createAvatar)({
|
|
18
|
+
Root,
|
|
19
|
+
Image: _reactNative.Image,
|
|
20
|
+
Text: _reactNative.Text,
|
|
21
|
+
Icon: _Icon.Icon,
|
|
22
|
+
Badge: _reactNative.View
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// AVATAR ROOT
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
const AvatarRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
30
|
+
size = 'lg',
|
|
31
|
+
className,
|
|
32
|
+
children,
|
|
33
|
+
style,
|
|
34
|
+
...props
|
|
35
|
+
}, ref) => {
|
|
36
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarRootVariants)({
|
|
37
|
+
size
|
|
38
|
+
}), className);
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive, {
|
|
40
|
+
ref: ref,
|
|
41
|
+
className: computedClassName,
|
|
42
|
+
style: style,
|
|
43
|
+
context: {
|
|
44
|
+
size
|
|
45
|
+
},
|
|
46
|
+
...props,
|
|
47
|
+
children: children
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
AvatarRoot.displayName = 'Avatar';
|
|
51
|
+
|
|
52
|
+
// =============================================================================
|
|
53
|
+
// AVATAR IMAGE
|
|
54
|
+
// =============================================================================
|
|
55
|
+
|
|
56
|
+
const AvatarImage = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
57
|
+
className,
|
|
58
|
+
style,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) => {
|
|
61
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarImageVariants)(), className);
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Image, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
className: computedClassName,
|
|
65
|
+
style: style,
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
AvatarImage.displayName = 'Avatar.Image';
|
|
70
|
+
|
|
71
|
+
// =============================================================================
|
|
72
|
+
// AVATAR TEXT
|
|
73
|
+
// =============================================================================
|
|
74
|
+
|
|
75
|
+
const AvatarText = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
76
|
+
className,
|
|
77
|
+
children,
|
|
78
|
+
style,
|
|
79
|
+
...props
|
|
80
|
+
}, ref) => {
|
|
81
|
+
const {
|
|
82
|
+
size
|
|
83
|
+
} = useAvatarStyleContext();
|
|
84
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarTextVariants)({
|
|
85
|
+
size
|
|
86
|
+
}), className);
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Text, {
|
|
88
|
+
ref: ref,
|
|
89
|
+
className: computedClassName,
|
|
90
|
+
style: style,
|
|
91
|
+
...props,
|
|
92
|
+
children: children
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
AvatarText.displayName = 'Avatar.Text';
|
|
96
|
+
|
|
97
|
+
// =============================================================================
|
|
98
|
+
// AVATAR ICON
|
|
99
|
+
// =============================================================================
|
|
100
|
+
|
|
101
|
+
const AvatarIcon = ({
|
|
102
|
+
className,
|
|
103
|
+
style,
|
|
104
|
+
...props
|
|
105
|
+
}) => {
|
|
106
|
+
const {
|
|
107
|
+
size
|
|
108
|
+
} = useAvatarStyleContext();
|
|
109
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarIconVariants)({
|
|
110
|
+
size
|
|
111
|
+
}), className);
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Icon, {
|
|
113
|
+
className: computedClassName,
|
|
114
|
+
style: style,
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
AvatarIcon.displayName = 'Avatar.Icon';
|
|
119
|
+
|
|
120
|
+
// =============================================================================
|
|
121
|
+
// AVATAR BADGE
|
|
122
|
+
// =============================================================================
|
|
123
|
+
|
|
124
|
+
const AvatarBadge = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
125
|
+
className,
|
|
126
|
+
children,
|
|
127
|
+
style,
|
|
128
|
+
...props
|
|
129
|
+
}, ref) => {
|
|
130
|
+
const {
|
|
131
|
+
size
|
|
132
|
+
} = useAvatarStyleContext();
|
|
133
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarBadgeVariants)({
|
|
134
|
+
size
|
|
135
|
+
}), className);
|
|
136
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Badge, {
|
|
137
|
+
ref: ref,
|
|
138
|
+
className: computedClassName,
|
|
139
|
+
style: style,
|
|
140
|
+
...props,
|
|
141
|
+
children: children
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
AvatarBadge.displayName = 'Avatar.Badge';
|
|
145
|
+
|
|
146
|
+
// =============================================================================
|
|
147
|
+
// COMPOUND COMPONENT
|
|
148
|
+
// =============================================================================
|
|
149
|
+
|
|
150
|
+
const Avatar = exports.Avatar = Object.assign(AvatarRoot, {
|
|
151
|
+
Image: AvatarImage,
|
|
152
|
+
Text: AvatarText,
|
|
153
|
+
Icon: AvatarIcon,
|
|
154
|
+
Badge: AvatarBadge
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_Icon","_styles","_jsxRuntime","SCOPE","Root","withStyleContext","View","useAvatarStyleContext","useStyleContext","AvatarPrimitive","createAvatar","Image","Text","Icon","IconComponent","Badge","AvatarRoot","forwardRef","size","className","children","style","props","ref","computedClassName","cn","avatarRootVariants","jsx","context","displayName","AvatarImage","avatarImageVariants","AvatarText","avatarTextVariants","AvatarIcon","avatarIconVariants","AvatarBadge","avatarBadgeVariants","Avatar","exports","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Avatar/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAOkB,IAAAM,WAAA,GAAAN,OAAA;AAElB,MAAMO,KAAK,GAAG,QAAQ;AAEtB,MAAMC,IAAI,GAAG,IAAAC,uBAAgB,EAACC,iBAAI,EAAEH,KAAK,CAAC;AAE1C,MAAMI,qBAAqB,GAAGA,CAAA,KAAM,IAAAC,sBAAe,EAACL,KAAK,CAAuB;AAEhF,MAAMM,eAAe,GAAG,IAAAC,wBAAY,EAAC;EACnCN,IAAI;EACJO,KAAK,EAALA,kBAAK;EACLC,IAAI,EAAJA,iBAAI;EACJC,IAAI,EAAEC,UAAa;EACnBC,KAAK,EAAET;AACT,CAAC,CAAC;;AAEF;AACA;AACA;;AAOA,MAAMU,UAAU,gBAAG,IAAAC,iBAAU,EAC3B,CAAC;EAAEC,IAAI,GAAG,IAAI;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9D,MAAMC,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAC,0BAAkB,EAAC;IAAER;EAAK,CAAC,CAAC,EAAEC,SAAS,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ACA;;AASO,MAAMS,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAACzB,UAAU,EAAE;EAC9CL,KAAK,EAAEmB,WAAW;EAClBlB,IAAI,EAAEoB,UAAU;EAChBnB,IAAI,EAAEqB,UAAU;EAChBnB,KAAK,EAAEqB;AACT,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.avatarTextVariants = exports.avatarRootVariants = exports.avatarImageVariants = exports.avatarIconVariants = exports.avatarBadgeVariants = void 0;
|
|
7
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
+
var _primitives = require("../../styles/primitives");
|
|
9
|
+
// ── Root ─────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
const avatarRootVariants = exports.avatarRootVariants = (0, _classVarianceAuthority.cva)([_primitives.RADIUS_FULL, 'relative items-center justify-center', _primitives.COLOR_BG_MUTED], {
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
sm: 'w-8 h-8',
|
|
15
|
+
md: 'w-10 h-10',
|
|
16
|
+
lg: 'w-12 h-12',
|
|
17
|
+
xl: 'w-16 h-16',
|
|
18
|
+
'2xl': 'w-20 h-20'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: 'lg'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// ── Image ────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
const avatarImageVariants = exports.avatarImageVariants = (0, _classVarianceAuthority.cva)(['absolute top-0 left-0 w-full h-full', _primitives.RADIUS_FULL, 'overflow-hidden']);
|
|
29
|
+
|
|
30
|
+
// ── Text ─────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
const avatarTextVariants = exports.avatarTextVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_SECONDARY, 'font-semibold'], {
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
sm: 'text-xs',
|
|
36
|
+
md: 'text-sm',
|
|
37
|
+
lg: 'text-base',
|
|
38
|
+
xl: 'text-xl',
|
|
39
|
+
'2xl': 'text-2xl'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
size: 'lg'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// ── Icon ─────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
const avatarIconVariants = exports.avatarIconVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_SECONDARY], {
|
|
50
|
+
variants: {
|
|
51
|
+
size: {
|
|
52
|
+
sm: 'size-4',
|
|
53
|
+
md: 'size-5',
|
|
54
|
+
lg: 'size-6',
|
|
55
|
+
xl: 'size-8',
|
|
56
|
+
'2xl': 'size-10'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
size: 'lg'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ── Badge ────────────────────────────────────────────────
|
|
65
|
+
|
|
66
|
+
const avatarBadgeVariants = exports.avatarBadgeVariants = (0, _classVarianceAuthority.cva)(['absolute border-2 border-white', _primitives.RADIUS_FULL], {
|
|
67
|
+
variants: {
|
|
68
|
+
size: {
|
|
69
|
+
sm: 'w-2.5 h-2.5 bottom-0 right-0',
|
|
70
|
+
md: 'w-3 h-3 bottom-0 right-0',
|
|
71
|
+
lg: 'w-3.5 h-3.5 bottom-0 right-0',
|
|
72
|
+
xl: 'w-4 h-4 bottom-0.5 right-0.5',
|
|
73
|
+
'2xl': 'w-5 h-5 bottom-0.5 right-0.5'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
size: 'lg'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","_primitives","avatarRootVariants","exports","cva","RADIUS_FULL","COLOR_BG_MUTED","variants","size","sm","md","lg","xl","defaultVariants","avatarImageVariants","avatarTextVariants","COLOR_TEXT_SECONDARY","avatarIconVariants","avatarBadgeVariants"],"sourceRoot":"../../../../src","sources":["components/Avatar/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA;;AAEO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,2BAAG,EACnC,CAACC,uBAAW,EAAE,sCAAsC,EAAEC,0BAAc,CAAC,EACrE;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACf,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEO,MAAMM,mBAAmB,GAAAX,OAAA,CAAAW,mBAAA,GAAG,IAAAV,2BAAG,EAAC,CACrC,qCAAqC,EACrCC,uBAAW,EACX,iBAAiB,CAClB,CAAC;;AAEF;;AAEO,MAAMU,kBAAkB,GAAAZ,OAAA,CAAAY,kBAAA,GAAG,IAAAX,2BAAG,EAAC,CAACY,gCAAoB,EAAE,eAAe,CAAC,EAAE;EAC7ET,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,SAAS;MACb,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AAC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