@cdx-ui/components 0.0.1-beta.64 → 0.0.1-beta.66
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/lib/commonjs/components/AlertDialog/index.js +12 -10
- package/lib/commonjs/components/AlertDialog/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/index.js +125 -25
- package/lib/commonjs/components/Avatar/index.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +127 -28
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +9 -3
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/CLAUDE.md +115 -11
- package/lib/commonjs/components/Checkbox/index.js +69 -22
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +1 -1
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +44 -36
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/Chip/styles.js +6 -35
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/components/Dialog/index.js +92 -72
- package/lib/commonjs/components/Dialog/index.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +70 -26
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Form/index.js +5 -12
- package/lib/commonjs/components/Form/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +5 -33
- package/lib/commonjs/components/IconButton/index.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +50 -20
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +14 -7
- package/lib/commonjs/components/Link/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js +129 -54
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/OtpInput/index.js +94 -28
- package/lib/commonjs/components/OtpInput/index.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +8 -13
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js +51 -53
- package/lib/commonjs/components/Radio/index.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +112 -46
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +2 -2
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Skeleton/index.js +37 -0
- package/lib/commonjs/components/Skeleton/index.js.map +1 -0
- package/lib/commonjs/components/Skeleton/styles.js +9 -0
- package/lib/commonjs/components/Skeleton/styles.js.map +1 -0
- package/lib/commonjs/components/Switch/BaseSwitch.js +23 -13
- package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -1
- package/lib/commonjs/components/Switch/BaseSwitch.web.js +25 -21
- package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -1
- package/lib/commonjs/components/Switch/index.js +34 -3
- package/lib/commonjs/components/Switch/index.js.map +1 -1
- package/lib/commonjs/components/Tile/index.js +150 -77
- package/lib/commonjs/components/Tile/index.js.map +1 -1
- package/lib/commonjs/components/index.js +12 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/Chip.figma.js +2 -2
- package/lib/commonjs/figma/Chip.figma.js.map +1 -1
- package/lib/commonjs/utils/positionToDataIcon.js +41 -0
- package/lib/commonjs/utils/positionToDataIcon.js.map +1 -0
- package/lib/module/components/AlertDialog/index.js +13 -11
- package/lib/module/components/AlertDialog/index.js.map +1 -1
- package/lib/module/components/Avatar/index.js +128 -28
- package/lib/module/components/Avatar/index.js.map +1 -1
- package/lib/module/components/Button/index.js +130 -32
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +8 -2
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/CLAUDE.md +115 -11
- package/lib/module/components/Checkbox/index.js +72 -25
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +1 -1
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Chip/index.js +47 -39
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/Chip/styles.js +6 -35
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/components/Dialog/index.js +96 -76
- package/lib/module/components/Dialog/index.js.map +1 -1
- package/lib/module/components/Field/index.js +74 -31
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Form/index.js +7 -14
- package/lib/module/components/Form/index.js.map +1 -1
- package/lib/module/components/IconButton/index.js +6 -34
- package/lib/module/components/IconButton/index.js.map +1 -1
- package/lib/module/components/Input/index.js +53 -23
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Link/index.js +16 -8
- package/lib/module/components/Link/index.js.map +1 -1
- package/lib/module/components/ListItem/index.js +134 -59
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/OtpInput/index.js +94 -28
- package/lib/module/components/OtpInput/index.js.map +1 -1
- package/lib/module/components/ProgressBar/index.js +9 -14
- package/lib/module/components/ProgressBar/index.js.map +1 -1
- package/lib/module/components/Radio/index.js +54 -57
- package/lib/module/components/Radio/index.js.map +1 -1
- package/lib/module/components/Select/index.js +118 -52
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +2 -2
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Skeleton/index.js +32 -0
- package/lib/module/components/Skeleton/index.js.map +1 -0
- package/lib/module/components/Skeleton/styles.js +5 -0
- package/lib/module/components/Skeleton/styles.js.map +1 -0
- package/lib/module/components/Switch/BaseSwitch.js +24 -14
- package/lib/module/components/Switch/BaseSwitch.js.map +1 -1
- package/lib/module/components/Switch/BaseSwitch.web.js +26 -22
- package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -1
- package/lib/module/components/Switch/index.js +35 -4
- package/lib/module/components/Switch/index.js.map +1 -1
- package/lib/module/components/Tile/index.js +155 -83
- package/lib/module/components/Tile/index.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/Chip.figma.js +2 -2
- package/lib/module/figma/Chip.figma.js.map +1 -1
- package/lib/module/utils/positionToDataIcon.js +38 -0
- package/lib/module/utils/positionToDataIcon.js.map +1 -0
- package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -1
- package/lib/typescript/components/Avatar/index.d.ts +6 -2
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts +31 -8
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +2 -1
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +3 -1
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +19 -9
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +0 -1
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
- package/lib/typescript/components/Dialog/index.d.ts +12 -6
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/components/Dialog/styles.d.ts +1 -1
- package/lib/typescript/components/Field/index.d.ts +14 -7
- package/lib/typescript/components/Field/index.d.ts.map +1 -1
- package/lib/typescript/components/Form/index.d.ts +4 -4
- package/lib/typescript/components/Form/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
- package/lib/typescript/components/Input/index.d.ts +11 -3
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +2 -0
- package/lib/typescript/components/Link/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +28 -6
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/OtpInput/index.d.ts +1 -1
- package/lib/typescript/components/OtpInput/index.d.ts.map +1 -1
- package/lib/typescript/components/ProgressBar/index.d.ts +4 -4
- package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -1
- package/lib/typescript/components/Radio/index.d.ts +4 -0
- package/lib/typescript/components/Radio/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +35 -2
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Skeleton/index.d.ts +9 -0
- package/lib/typescript/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/components/Skeleton/styles.d.ts +4 -0
- package/lib/typescript/components/Skeleton/styles.d.ts.map +1 -0
- package/lib/typescript/components/Switch/BaseSwitch.d.ts +12 -5
- package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -1
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +11 -5
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -1
- package/lib/typescript/components/Switch/index.d.ts +5 -1
- package/lib/typescript/components/Switch/index.d.ts.map +1 -1
- package/lib/typescript/components/Tile/index.d.ts +8 -2
- package/lib/typescript/components/Tile/index.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/utils/positionToDataIcon.d.ts +29 -0
- package/lib/typescript/utils/positionToDataIcon.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/components/AlertDialog/index.tsx +13 -14
- package/src/components/Avatar/index.tsx +134 -44
- package/src/components/Button/index.tsx +216 -44
- package/src/components/Button/styles.ts +50 -38
- package/src/components/CLAUDE.md +115 -11
- package/src/components/Checkbox/index.tsx +93 -32
- package/src/components/Checkbox/styles.ts +1 -1
- package/src/components/Chip/index.tsx +88 -61
- package/src/components/Chip/styles.ts +6 -18
- package/src/components/Dialog/index.tsx +139 -99
- package/src/components/Field/index.tsx +113 -49
- package/src/components/Form/index.tsx +18 -14
- package/src/components/IconButton/index.tsx +7 -31
- package/src/components/Input/index.tsx +75 -32
- package/src/components/Link/index.tsx +38 -12
- package/src/components/ListItem/index.tsx +158 -73
- package/src/components/OtpInput/index.tsx +126 -43
- package/src/components/ProgressBar/index.tsx +11 -16
- package/src/components/Radio/index.tsx +76 -54
- package/src/components/Select/index.tsx +174 -59
- package/src/components/Select/styles.ts +1 -2
- package/src/components/Skeleton/index.tsx +42 -0
- package/src/components/Skeleton/styles.ts +5 -0
- package/src/components/Switch/BaseSwitch.tsx +38 -16
- package/src/components/Switch/BaseSwitch.web.tsx +28 -35
- package/src/components/Switch/index.tsx +51 -4
- package/src/components/Tile/index.tsx +145 -94
- package/src/components/index.ts +1 -0
- package/src/utils/positionToDataIcon.ts +34 -0
- package/lib/commonjs/components/Field/FieldLabel.js +0 -33
- package/lib/commonjs/components/Field/FieldLabel.js.map +0 -1
- package/lib/commonjs/components/Field/FieldLabel.web.js +0 -22
- package/lib/commonjs/components/Field/FieldLabel.web.js.map +0 -1
- package/lib/commonjs/components/Form/FormRoot.js +0 -25
- package/lib/commonjs/components/Form/FormRoot.js.map +0 -1
- package/lib/commonjs/components/Form/FormRoot.web.js +0 -17
- package/lib/commonjs/components/Form/FormRoot.web.js.map +0 -1
- package/lib/commonjs/components/Input/BaseInput.android.js +0 -20
- package/lib/commonjs/components/Input/BaseInput.android.js.map +0 -1
- package/lib/commonjs/components/Input/BaseInput.js +0 -13
- package/lib/commonjs/components/Input/BaseInput.js.map +0 -1
- package/lib/commonjs/components/Input/BaseInput.web.js +0 -50
- package/lib/commonjs/components/Input/BaseInput.web.js.map +0 -1
- package/lib/commonjs/components/Select/SelectTriggerHost.js +0 -10
- package/lib/commonjs/components/Select/SelectTriggerHost.js.map +0 -1
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +0 -102
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +0 -1
- package/lib/module/components/Field/FieldLabel.js +0 -29
- package/lib/module/components/Field/FieldLabel.js.map +0 -1
- package/lib/module/components/Field/FieldLabel.web.js +0 -17
- package/lib/module/components/Field/FieldLabel.web.js.map +0 -1
- package/lib/module/components/Form/FormRoot.js +0 -21
- package/lib/module/components/Form/FormRoot.js.map +0 -1
- package/lib/module/components/Form/FormRoot.web.js +0 -12
- package/lib/module/components/Form/FormRoot.web.js.map +0 -1
- package/lib/module/components/Input/BaseInput.android.js +0 -16
- package/lib/module/components/Input/BaseInput.android.js.map +0 -1
- package/lib/module/components/Input/BaseInput.js +0 -4
- package/lib/module/components/Input/BaseInput.js.map +0 -1
- package/lib/module/components/Input/BaseInput.web.js +0 -45
- package/lib/module/components/Input/BaseInput.web.js.map +0 -1
- package/lib/module/components/Select/SelectTriggerHost.js +0 -7
- package/lib/module/components/Select/SelectTriggerHost.js.map +0 -1
- package/lib/module/components/Select/SelectTriggerHost.web.js +0 -97
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +0 -1
- package/lib/typescript/components/Field/FieldLabel.d.ts +0 -18
- package/lib/typescript/components/Field/FieldLabel.d.ts.map +0 -1
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +0 -16
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +0 -1
- package/lib/typescript/components/Form/FormRoot.d.ts +0 -14
- package/lib/typescript/components/Form/FormRoot.d.ts.map +0 -1
- package/lib/typescript/components/Form/FormRoot.web.d.ts +0 -10
- package/lib/typescript/components/Form/FormRoot.web.d.ts.map +0 -1
- package/lib/typescript/components/Input/BaseInput.android.d.ts +0 -3
- package/lib/typescript/components/Input/BaseInput.android.d.ts.map +0 -1
- package/lib/typescript/components/Input/BaseInput.d.ts +0 -2
- package/lib/typescript/components/Input/BaseInput.d.ts.map +0 -1
- package/lib/typescript/components/Input/BaseInput.web.d.ts +0 -3
- package/lib/typescript/components/Input/BaseInput.web.d.ts.map +0 -1
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts +0 -3
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts.map +0 -1
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +0 -16
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +0 -1
- package/src/components/Field/FieldLabel.tsx +0 -33
- package/src/components/Field/FieldLabel.web.tsx +0 -25
- package/src/components/Form/FormRoot.tsx +0 -20
- package/src/components/Form/FormRoot.web.tsx +0 -12
- package/src/components/Input/BaseInput.android.tsx +0 -13
- package/src/components/Input/BaseInput.tsx +0 -1
- package/src/components/Input/BaseInput.web.tsx +0 -41
- package/src/components/Select/SelectTriggerHost.tsx +0 -4
- package/src/components/Select/SelectTriggerHost.web.tsx +0 -143
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.buttonTextVariants = exports.buttonSpinnerVariants = exports.buttonRootVariants = exports.buttonIconVariants = exports.buttonGroupVariants = void 0;
|
|
6
|
+
exports.buttonTextVariants = exports.buttonSpinnerVariants = exports.buttonSpinnerColorVariants = exports.buttonRootVariants = exports.buttonIconVariants = exports.buttonGroupVariants = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _classVarianceAuthority = require("class-variance-authority");
|
|
9
9
|
var _primitives = require("../../styles/primitives");
|
|
@@ -222,7 +222,13 @@ const buttonTextVariants = exports.buttonTextVariants = (0, _classVarianceAuthor
|
|
|
222
222
|
size: 'default'
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
|
-
const buttonSpinnerVariants = exports.buttonSpinnerVariants = (0, _classVarianceAuthority.cva)([],
|
|
225
|
+
const buttonSpinnerVariants = exports.buttonSpinnerVariants = (0, _classVarianceAuthority.cva)(['data-[icon=inline-start]:me-1.5', 'data-[icon=inline-end]:ms-1.5']);
|
|
226
|
+
|
|
227
|
+
// Spinner color is set via Uniwind's `colorClassName` prop (maps to the native
|
|
228
|
+
// `color` prop on `ActivityIndicator`). `accent-*` utilities ONLY take effect
|
|
229
|
+
// when passed through `colorClassName` — putting them on `className` is a no-op
|
|
230
|
+
// because the underlying `color` prop is not part of the `style` object.
|
|
231
|
+
const buttonSpinnerColorVariants = exports.buttonSpinnerColorVariants = (0, _classVarianceAuthority.cva)([], {
|
|
226
232
|
variants: {
|
|
227
233
|
variant: {
|
|
228
234
|
solid: [],
|
|
@@ -317,7 +323,7 @@ const buttonGroupVariants = exports.buttonGroupVariants = (0, _classVarianceAuth
|
|
|
317
323
|
isAttached: false
|
|
318
324
|
}
|
|
319
325
|
});
|
|
320
|
-
const buttonIconVariants = exports.buttonIconVariants = (0, _classVarianceAuthority.cva)([], {
|
|
326
|
+
const buttonIconVariants = exports.buttonIconVariants = (0, _classVarianceAuthority.cva)(['data-[icon=inline-start]:me-1.5', 'data-[icon=inline-end]:ms-1.5'], {
|
|
321
327
|
variants: {
|
|
322
328
|
variant: {
|
|
323
329
|
solid: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_classVarianceAuthority","_primitives","buttonRootVariants","exports","cva","TRANSITION_COLORS","DISABLED_CURSOR","variants","variant","solid","outline","ghost","color","action","danger","warning","success","info","size","default","small","fullWidth","true","false","compoundVariants","className","Platform","select","web","defaultVariants","buttonTextVariants","buttonSpinnerVariants","buttonGroupVariants","flexDirection","row","column","isAttached","buttonIconVariants"],"sourceRoot":"../../../../src","sources":["components/Button/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;;AAEO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,2BAAG,EACnC,CACE,sCAAsC,EACtC,uCAAuC,EACvC,wEAAwE,EACxEC,6BAAiB,EACjB,wDAAwD,EACxDC,2BAAe,EACf,kIAAkI,CACnI,EACD;EACEC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,KAAK,EAAE,CAAC,4BAA4B,CAAC;MAAE;MACvCC,OAAO,EAAE,CAAC,gBAAgB,EAAE,8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,eAAe,EAAE;IACfrB,OAAO,EAAE,OAAO;IAChBI,KAAK,EAAE,QAAQ;IACfM,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEK,MAAMa,qBAAqB,GAAA5B,OAAA,CAAA4B,qBAAA,GAAG,IAAA3B,2BAAG,EAAC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_classVarianceAuthority","_primitives","buttonRootVariants","exports","cva","TRANSITION_COLORS","DISABLED_CURSOR","variants","variant","solid","outline","ghost","color","action","danger","warning","success","info","size","default","small","fullWidth","true","false","compoundVariants","className","Platform","select","web","defaultVariants","buttonTextVariants","buttonSpinnerVariants","buttonSpinnerColorVariants","buttonGroupVariants","flexDirection","row","column","isAttached","buttonIconVariants"],"sourceRoot":"../../../../src","sources":["components/Button/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;;AAEO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,2BAAG,EACnC,CACE,sCAAsC,EACtC,uCAAuC,EACvC,wEAAwE,EACxEC,6BAAiB,EACjB,wDAAwD,EACxDC,2BAAe,EACf,kIAAkI,CACnI,EACD;EACEC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,KAAK,EAAE,CAAC,4BAA4B,CAAC;MAAE;MACvCC,OAAO,EAAE,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;MAC3DC,KAAK,EAAE,CAAC,gBAAgB;IAC1B,CAAC;IACDC,KAAK,EAAE;MACLC,MAAM,EAAE,EAAE;MACVC,MAAM,EAAE,EAAE;MACVC,OAAO,EAAE,EAAE;MACXC,OAAO,EAAE,EAAE;MACXC,IAAI,EAAE;IACR,CAAC;IACDC,IAAI,EAAE;MACJC,OAAO,EAAE,iBAAiB;MAC1BC,KAAK,EAAE;IACT,CAAC;IACDC,SAAS,EAAE;MACTC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AChBI,KAAK,EAAE,QAAQ;IACfM,IAAI,EAAE;EACR;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -13,17 +13,117 @@ Styled components in `@cdx-ui/components` follow a consistent pattern. Read the
|
|
|
13
13
|
- `docs/internal/practices/types.md` — prop types, `I*Props` vs `*Props`, exporting
|
|
14
14
|
- `docs/internal/practices/styling.md` — `cn()`, CVA, token classes, `Platform.select()`
|
|
15
15
|
- `docs/internal/practices/state.md` — `useControllableState`, `composeEventHandlers`
|
|
16
|
-
- `docs/internal/practices/data-attributes.md` — `data-[state]` and `data-
|
|
16
|
+
- `docs/internal/practices/data-attributes.md` — `data-[state]`, `data-slot`, and `data-icon` conventions
|
|
17
|
+
- `docs/internal/practices/as-child.md` — styled-layer `asChild` via re-exported `Slot`
|
|
18
|
+
|
|
19
|
+
## Six standards (Standards 4–6 apply here)
|
|
20
|
+
|
|
21
|
+
Standards 1–3 govern primitive-layer authoring (see `packages/primitives/src/CLAUDE.md`).
|
|
22
|
+
Standards 4–6 govern the styled layer:
|
|
23
|
+
|
|
24
|
+
### Standard 4 — `data-slot` attributes
|
|
25
|
+
|
|
26
|
+
Every public styled slot emits a stable `data-slot="<component>-<part>"` attribute on its outermost rendered element. The convention is lowercase, kebab-case, `<component>` then `-<slot>` if not the root.
|
|
27
|
+
|
|
28
|
+
| Slot | Attribute |
|
|
29
|
+
| ------------------ | ---------------------------- |
|
|
30
|
+
| `<Button>` root | `data-slot="button"` |
|
|
31
|
+
| `<Button.Label>` | `data-slot="button-label"` |
|
|
32
|
+
| `<Button.Icon>` | `data-slot="button-icon"` |
|
|
33
|
+
| `<Button.Spinner>` | `data-slot="button-spinner"` |
|
|
34
|
+
| `<Button.Group>` | `data-slot="button-group"` |
|
|
35
|
+
| `<IconButton>` | `data-slot="icon-button"` |
|
|
36
|
+
| `<Dialog.Content>` | `data-slot="dialog-content"` |
|
|
37
|
+
|
|
38
|
+
Use `dataAttributes({ slot: '<component>-<part>' })` from `@cdx-ui/primitives` so the helper handles native (flat `data-*` keys) and web (RNW `dataSet`) correctly.
|
|
39
|
+
|
|
40
|
+
#### Combining multiple data-attribute sources — use `mergeDataAttributes`
|
|
41
|
+
|
|
42
|
+
When the same element receives `data-*` from more than one source (e.g. a slot identifier plus a position hint, or consumer-supplied data attrs flowing in through props), do **not** chain multiple `{...dataAttributes(...)}` spreads — on web each call returns `{ dataSet: {...} }` and a plain JSX spread replaces the `dataSet` key entirely, so the second source wipes out the first. Use `mergeDataAttributes(...)` from `@cdx-ui/primitives` to combine sources; later args win on key conflicts:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
|
|
46
|
+
|
|
47
|
+
<Element
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={...}
|
|
50
|
+
style={style}
|
|
51
|
+
{...props}
|
|
52
|
+
{...mergeDataAttributes(
|
|
53
|
+
props, // pulls in any consumer-supplied data attrs
|
|
54
|
+
dataAttributes({ slot: '<component>-<part>' }),
|
|
55
|
+
positionToDataIcon(position), // optional, may be undefined
|
|
56
|
+
)}
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Spread `{...props}` first, then the merge — so any keys that `mergeDataAttributes` produces overwrite their counterparts in props with the merged values.
|
|
61
|
+
|
|
62
|
+
When the styled component renders a primitive Root, the primitive Root applies the same pattern internally — incoming data attrs (slot from the styled layer) are merged with the primitive's own interaction-state data attrs and emitted once. The styled layer doesn't need to do anything special; just pass `data-slot` through and the primitive's merge does the rest.
|
|
63
|
+
|
|
64
|
+
### Standard 5 — Static design variants vs. interaction state
|
|
65
|
+
|
|
66
|
+
Variant functions take only static design inputs (`variant`/`color`/`size`/`fullWidth`/etc.). Interaction states (`hover`/`focus`/`active`/`disabled`/`focus-visible`) are expressed as `data-[...]:` selectors **inside** CVA variant strings, never as variant inputs.
|
|
67
|
+
|
|
68
|
+
- CSS-layer state changes are free of React work: when the primitive flips `data-hover=true`, the CSS engine (web) and Uniwind's native style layer reconcile styles without re-rendering React, re-running CVA, or invoking `cn()`/`tailwind-merge`.
|
|
69
|
+
- Variant-input state changes cascade React work: CVA re-runs, `cn()` re-merges, and className-prop reconciliation cascades through the tree.
|
|
70
|
+
- Sub-slots can react to root state via parent selectors (`data-[hover=true]:`) without each slot subscribing to context (per Standard 1).
|
|
71
|
+
|
|
72
|
+
### Standard 6 — Position hints (`data-icon="inline-start|inline-end"`)
|
|
73
|
+
|
|
74
|
+
Icon-/spinner-bearing styled slots accept an optional `position?: 'leading' | 'trailing'` prop that emits `data-icon="inline-start|inline-end"`. Spacing rules in CVA target the `data-icon` attribute via logical-property utilities (`me-*`/`ms-*`) so RTL is handled for free.
|
|
75
|
+
|
|
76
|
+
Mapping (via the shared `positionToDataIcon` helper at `packages/components/src/utils/positionToDataIcon.ts`):
|
|
77
|
+
|
|
78
|
+
- `position="leading"` → `data-icon="inline-start"`
|
|
79
|
+
- `position="trailing"` → `data-icon="inline-end"`
|
|
80
|
+
- `position` omitted → no `data-icon` attribute, baseline spacing applies
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { positionToDataIcon, type IconSlotPosition } from '../../utils/positionToDataIcon';
|
|
84
|
+
|
|
85
|
+
interface ButtonIconProps {
|
|
86
|
+
position?: IconSlotPosition;
|
|
87
|
+
// ...
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
<Icon {...positionToDataIcon(position)} {...props} />;
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<Button>
|
|
95
|
+
<Button.Icon as={CheckIcon} position="leading" />
|
|
96
|
+
<Button.Label>Confirm</Button.Label>
|
|
97
|
+
</Button>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
CVA expresses padding via logical-property selectors:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
cva(['data-[icon=inline-start]:me-1.5 data-[icon=inline-end]:ms-1.5'], { ... });
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Where: **styled layer.** Pure styling hint with no behavior or a11y semantics — fails Standard 3, so no primitive involvement.
|
|
107
|
+
|
|
108
|
+
## Canonical reference
|
|
109
|
+
|
|
110
|
+
`packages/components/src/components/Button/index.tsx` + `Button/styles.ts` is the canonical example for Standards 4–6:
|
|
111
|
+
|
|
112
|
+
- `data-slot` on `Button`, `Button.Label`, `Button.Icon`, `Button.Spinner`, `Button.Group`
|
|
113
|
+
- `asChild` re-uses `Slot` from `@cdx-ui/primitives` — no new primitive needed for sub-slots
|
|
114
|
+
- `buttonIconVariants` / `buttonSpinnerVariants` carry `data-[icon=inline-start]:me-1.5 data-[icon=inline-end]:ms-1.5` so leading/trailing padding works without per-call overrides
|
|
115
|
+
|
|
116
|
+
`packages/components/src/components/IconButton/index.tsx` shows the second axis of Standard 1: a styled-layer slot (the glyph) is the place that opts into `useButtonContext()` when its styling reacts to interaction state. The pattern is the same as the primitive Root — call `useButtonContext()`, spread `dataAttributes({ ... })` — only it lives in the styled layer.
|
|
17
117
|
|
|
18
118
|
### Pattern summary
|
|
19
119
|
|
|
20
|
-
Each component follows this structure (see `Button/index.tsx`
|
|
120
|
+
Each component follows this structure (see `Button/index.tsx`):
|
|
21
121
|
|
|
22
|
-
1. **Imports** — RN base components, primitive from `@cdx-ui/primitives`, `cn` + style context from `@cdx-ui/utils`, variant functions from `./styles`
|
|
23
|
-
2. **Scope constant** — `const SCOPE = 'COMPONENT_NAME'` for `withStyleContext` / `useStyleContext`
|
|
24
|
-
3. **Root
|
|
25
|
-
4. **
|
|
26
|
-
5. **
|
|
122
|
+
1. **Imports** — RN base components, primitive `Root` and `Slot` from `@cdx-ui/primitives`, `cn` + style context from `@cdx-ui/utils`, variant functions from `./styles`
|
|
123
|
+
2. **Scope constant** — `const SCOPE = 'COMPONENT_NAME'` for `withStyleContext` / `useStyleContext` (or a `ParentContext.Provider` wrapper for static variant context)
|
|
124
|
+
3. **Root component** — renders the primitive Root (or a host element directly when no primitive exists), spreads `dataAttributes({ slot: '<component>' })`
|
|
125
|
+
4. **Sub-slots** — each accepts `asChild`, renders a host element via `const Comp = asChild ? Slot : DefaultElement`, spreads `dataAttributes({ slot: '<component>-<slot>' })`. Sub-slots **do not** call `useButtonContext()` (or its equivalent) unless their own styling reacts to interaction state.
|
|
126
|
+
5. **Position-aware sub-slots** — icon/spinner-style slots accept `position?: 'leading' | 'trailing'` and emit `data-icon` via `dataAttributes({ icon: '...' })`.
|
|
27
127
|
6. **Compound export** — `Object.assign(RootComponent, { Sub1, Sub2 }) as CompoundType`
|
|
28
128
|
|
|
29
129
|
### Key rules
|
|
@@ -36,6 +136,9 @@ Each component follows this structure (see `Button/index.tsx` as the canonical e
|
|
|
36
136
|
- Never hardcode colors — use semantic token classes (`bg-surface-*`, `text-content-*`, `border-stroke-*`)
|
|
37
137
|
- Event handlers composed via `composeEventHandlers` from `@cdx-ui/utils`
|
|
38
138
|
- Third-party libraries fully abstracted — no adopted library types leak to consumers
|
|
139
|
+
- **`data-slot`** emitted on every styled slot via `dataAttributes({ slot: '<component>-<part>' })`
|
|
140
|
+
- **`asChild`** supported on every styled slot — `const Comp = asChild ? Slot : DefaultElement`
|
|
141
|
+
- **`position`** prop on icon/spinner-style slots maps to `data-icon="inline-start|inline-end"`
|
|
39
142
|
|
|
40
143
|
---
|
|
41
144
|
|
|
@@ -44,7 +147,7 @@ Each component follows this structure (see `Button/index.tsx` as the canonical e
|
|
|
44
147
|
Variant definitions live in co-located `styles.ts` files using CVA. Read the full guides before making changes:
|
|
45
148
|
|
|
46
149
|
- `docs/internal/practices/styling.md` — `cn()`, CVA, token architecture, dark mode, `Platform.select()`
|
|
47
|
-
- `docs/internal/practices/data-attributes.md` — `data-[state]`
|
|
150
|
+
- `docs/internal/practices/data-attributes.md` — `data-[state]` and `data-icon` selectors
|
|
48
151
|
|
|
49
152
|
### Pattern summary
|
|
50
153
|
|
|
@@ -57,11 +160,11 @@ import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
|
57
160
|
|
|
58
161
|
export const componentRootVariants = cva(
|
|
59
162
|
[
|
|
60
|
-
/* base classes */
|
|
163
|
+
/* base classes + interaction state selectors (data-[hover=true]:..., data-[active=true]:...) */
|
|
61
164
|
],
|
|
62
165
|
{
|
|
63
166
|
variants: {
|
|
64
|
-
/*
|
|
167
|
+
/* static design axes only — variant, color, size, fullWidth, etc. */
|
|
65
168
|
},
|
|
66
169
|
compoundVariants: [
|
|
67
170
|
/* variant × variant combinations */
|
|
@@ -78,7 +181,8 @@ export type ComponentVariantProps = VariantProps<typeof componentRootVariants>;
|
|
|
78
181
|
### Key rules
|
|
79
182
|
|
|
80
183
|
- **Semantic token classes only** — use `bg-surface-action-strong`, `text-content-primary`, `border-stroke-primary`, etc. Never hardcode hex colors, `bg-white`, `text-black`, or raw Tailwind color scales for themed values.
|
|
81
|
-
- **`data-[state]` selectors** — use `data-[disabled=true]:`, `data-[hover=true]:`, `data-[active=true]:`, `data-[focus-visible=true]:` for interaction states. Primitives emit these data attributes.
|
|
184
|
+
- **`data-[state]` selectors** — use `data-[disabled=true]:`, `data-[hover=true]:`, `data-[active=true]:`, `data-[focus-visible=true]:` for interaction states. Primitives emit these data attributes (Standard 1). **Interaction state is never a CVA variant input** (Standard 5).
|
|
185
|
+
- **`data-[icon=inline-start|inline-end]` selectors** for icon/spinner position spacing (Standard 6) — pair with logical-property utilities (`me-*`/`ms-*`) so RTL flips automatically.
|
|
82
186
|
- **`Platform.select()`** for platform-specific classes — web gets `data-[hover=true]` styles (hover exists on web); native responds only to `data-[active=true]` (press). Always set `default` (native) and `web` keys.
|
|
83
187
|
- **Shared style primitives** — import `DISABLED_CURSOR`, `TRANSITION_COLORS`, etc. from `../../styles/primitives` for cross-component consistency.
|
|
84
188
|
- **`web:` prefix** for web-only utilities — e.g., `web:outline-none`, `web:focus-visible:ring-2`.
|
|
@@ -12,14 +12,6 @@ var _utils = require("@cdx-ui/utils");
|
|
|
12
12
|
var _Icon = require("../Icon");
|
|
13
13
|
var _styles = require("./styles");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const CheckboxPrimitive = (0, _primitives.createCheckbox)({
|
|
16
|
-
Root: _reactNative.Pressable,
|
|
17
|
-
Indicator: _reactNative.View,
|
|
18
|
-
Icon: _reactNative.View,
|
|
19
|
-
Label: _reactNative.Text,
|
|
20
|
-
Group: _reactNative.View
|
|
21
|
-
});
|
|
22
|
-
|
|
23
15
|
// =============================================================================
|
|
24
16
|
// CHECKBOX ROOT
|
|
25
17
|
// =============================================================================
|
|
@@ -32,17 +24,18 @@ const CheckboxRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
32
24
|
...props
|
|
33
25
|
}, ref) => {
|
|
34
26
|
const computedClassName = (0, _utils.cn)((0, _styles.checkboxRootVariants)(), className);
|
|
35
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.CheckboxRoot, {
|
|
36
28
|
ref: ref,
|
|
37
29
|
className: computedClassName,
|
|
38
30
|
isIndeterminate: isIndeterminate,
|
|
39
31
|
style: style,
|
|
40
32
|
...props,
|
|
33
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
34
|
+
slot: 'checkbox'
|
|
35
|
+
})),
|
|
41
36
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CheckboxIndicator, {
|
|
42
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
43
|
-
|
|
44
|
-
as: isIndeterminate ? _icons.CheckIndeterminateSmall : _icons.Check
|
|
45
|
-
})
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckboxIconSlot, {
|
|
38
|
+
isIndeterminate: isIndeterminate
|
|
46
39
|
})
|
|
47
40
|
}), children]
|
|
48
41
|
});
|
|
@@ -50,28 +43,53 @@ const CheckboxRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
50
43
|
CheckboxRoot.displayName = 'Checkbox';
|
|
51
44
|
|
|
52
45
|
// =============================================================================
|
|
53
|
-
// CHECKBOX INDICATOR
|
|
46
|
+
// CHECKBOX INDICATOR (styled-only, reads context for data-* styling)
|
|
54
47
|
// =============================================================================
|
|
55
48
|
|
|
56
49
|
const CheckboxIndicator = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
50
|
+
asChild,
|
|
57
51
|
className,
|
|
58
52
|
children,
|
|
59
53
|
style,
|
|
60
54
|
...props
|
|
61
55
|
}, ref) => {
|
|
56
|
+
const {
|
|
57
|
+
isChecked,
|
|
58
|
+
isDisabled,
|
|
59
|
+
isHovered,
|
|
60
|
+
isInvalid,
|
|
61
|
+
isReadOnly,
|
|
62
|
+
isPressed,
|
|
63
|
+
isFocused,
|
|
64
|
+
isIndeterminate,
|
|
65
|
+
isFocusVisible
|
|
66
|
+
} = (0, _primitives.useCheckboxContext)();
|
|
62
67
|
const computedClassName = (0, _utils.cn)((0, _styles.checkboxIndicatorVariants)(), className);
|
|
63
|
-
|
|
68
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
64
70
|
ref: ref,
|
|
65
71
|
className: computedClassName,
|
|
66
72
|
style: style,
|
|
67
73
|
...props,
|
|
74
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
75
|
+
slot: 'checkbox-indicator',
|
|
76
|
+
hover: isHovered,
|
|
77
|
+
checked: isChecked,
|
|
78
|
+
disabled: isDisabled,
|
|
79
|
+
focusVisible: isFocusVisible,
|
|
80
|
+
invalid: isInvalid,
|
|
81
|
+
readonly: isReadOnly,
|
|
82
|
+
active: isPressed,
|
|
83
|
+
focused: isFocused,
|
|
84
|
+
indeterminate: isIndeterminate
|
|
85
|
+
})),
|
|
68
86
|
children: children
|
|
69
87
|
});
|
|
70
88
|
});
|
|
71
89
|
CheckboxIndicator.displayName = 'Checkbox.Indicator';
|
|
72
90
|
|
|
73
91
|
// =============================================================================
|
|
74
|
-
// CHECKBOX ICON
|
|
92
|
+
// CHECKBOX ICON (styled-only, reads context for conditional mount)
|
|
75
93
|
// =============================================================================
|
|
76
94
|
|
|
77
95
|
const CheckboxIcon = ({
|
|
@@ -83,34 +101,61 @@ const CheckboxIcon = ({
|
|
|
83
101
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
84
102
|
className: computedClassName,
|
|
85
103
|
style: style,
|
|
86
|
-
...props
|
|
104
|
+
...props,
|
|
105
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
106
|
+
slot: 'checkbox-icon'
|
|
107
|
+
}))
|
|
87
108
|
});
|
|
88
109
|
};
|
|
89
110
|
CheckboxIcon.displayName = 'Checkbox.Icon';
|
|
90
111
|
|
|
112
|
+
// Internal helper that reads context for conditional rendering
|
|
113
|
+
const CheckboxIconSlot = ({
|
|
114
|
+
isIndeterminate: isIndeterminateProp
|
|
115
|
+
}) => {
|
|
116
|
+
const {
|
|
117
|
+
isChecked,
|
|
118
|
+
isIndeterminate
|
|
119
|
+
} = (0, _primitives.useCheckboxContext)();
|
|
120
|
+
const showIcon = isChecked || isIndeterminateProp || isIndeterminate;
|
|
121
|
+
if (!showIcon) return null;
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckboxIcon, {
|
|
123
|
+
as: isIndeterminate || isIndeterminateProp ? _icons.CheckIndeterminateSmall : _icons.Check
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
91
127
|
// =============================================================================
|
|
92
|
-
// CHECKBOX LABEL
|
|
128
|
+
// CHECKBOX LABEL (styled-only)
|
|
93
129
|
// =============================================================================
|
|
94
130
|
|
|
95
131
|
const CheckboxLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
132
|
+
asChild,
|
|
96
133
|
className,
|
|
97
134
|
children,
|
|
98
135
|
style,
|
|
99
136
|
...props
|
|
100
137
|
}, ref) => {
|
|
138
|
+
const {
|
|
139
|
+
isDisabled
|
|
140
|
+
} = (0, _primitives.useCheckboxContext)();
|
|
101
141
|
const computedClassName = (0, _utils.cn)((0, _styles.checkboxLabelVariants)(), className);
|
|
102
|
-
|
|
142
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
143
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
103
144
|
ref: ref,
|
|
104
145
|
className: computedClassName,
|
|
105
146
|
style: style,
|
|
106
147
|
...props,
|
|
148
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
149
|
+
slot: 'checkbox-label',
|
|
150
|
+
disabled: isDisabled
|
|
151
|
+
})),
|
|
107
152
|
children: children
|
|
108
153
|
});
|
|
109
154
|
});
|
|
110
155
|
CheckboxLabel.displayName = 'Checkbox.Label';
|
|
111
156
|
|
|
112
157
|
// =============================================================================
|
|
113
|
-
// CHECKBOX GROUP
|
|
158
|
+
// CHECKBOX GROUP (wraps the primitive)
|
|
114
159
|
// =============================================================================
|
|
115
160
|
|
|
116
161
|
const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
@@ -128,7 +173,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
128
173
|
const computedClassName = (0, _utils.cn)((0, _styles.checkboxGroupVariants)({
|
|
129
174
|
direction
|
|
130
175
|
}), className);
|
|
131
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
176
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.CheckboxGroup, {
|
|
132
177
|
ref: ref,
|
|
133
178
|
className: computedClassName,
|
|
134
179
|
style: style,
|
|
@@ -137,7 +182,9 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
137
182
|
isDisabled: isDisabled,
|
|
138
183
|
isInvalid: isInvalid,
|
|
139
184
|
isReadOnly: isReadOnly,
|
|
140
|
-
...viewProps,
|
|
185
|
+
...(0, _primitives.mergeDataAttributes)(viewProps, (0, _primitives.dataAttributes)({
|
|
186
|
+
slot: 'checkbox-group'
|
|
187
|
+
})),
|
|
141
188
|
children: children
|
|
142
189
|
});
|
|
143
190
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_icons","_primitives","_utils","_Icon","_styles","_jsxRuntime","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_icons","_primitives","_utils","_Icon","_styles","_jsxRuntime","CheckboxRoot","forwardRef","className","isIndeterminate","children","style","props","ref","computedClassName","cn","checkboxRootVariants","jsxs","mergeDataAttributes","dataAttributes","slot","jsx","CheckboxIndicator","CheckboxIconSlot","displayName","asChild","isChecked","isDisabled","isHovered","isInvalid","isReadOnly","isPressed","isFocused","isFocusVisible","useCheckboxContext","checkboxIndicatorVariants","Comp","Slot","View","hover","checked","disabled","focusVisible","invalid","readonly","active","focused","indeterminate","CheckboxIcon","checkboxIconVariants","Icon","isIndeterminateProp","showIcon","as","CheckIndeterminateSmall","Check","CheckboxLabel","checkboxLabelVariants","Text","CheckboxGroup","direction","value","onChange","viewProps","checkboxGroupVariants","Checkbox","exports","Object","assign","Indicator","Label","Group"],"sourceRoot":"../../../../src","sources":["components/Checkbox/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAMkB,IAAAO,WAAA,GAAAP,OAAA;AAElB;AACA;AACA;;AAOA,MAAMQ,YAAY,gBAAG,IAAAC,iBAAU,EAC7B,CAAC;EAAEC,SAAS;EAAEC,eAAe;EAAEC,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S,GAAG,QAAQ;EACpBC,KAAK;EACLC,QAAQ;EACRnC,UAAU;EACVE,SAAS;EACTC,UAAU;EACV,GAAGiC;AACL,CAAC,EACDlD,GAAG,KACA;EACH,MAAMC,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAiD,6BAAqB,EAAC;IAAEJ;EAAU,CAAC,CAAC,EAAEpD,SAAS,CAAC;EAE7E,oBACE,IAAAH,WAAA,CAAAgB,GAAA,EAACpB,WAAA,CAAA0D,aAAsB;IACrB9C,GAAG,EAAEA,GAAI;IACTL,SAAS,EAAEM,iBAAkB;IAC7BH,KAAK,EAAEA,KAAM;IACbkD,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBC,QAAQ,EAAEA,QAAS;IACnBnC,UAAU,EAAEA,UAAW;IACvBE,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IAAA,GACnB,IAAAZ,+BAAmB,EAAC6C,SAAS,EAAE,IAAA5C,0BAAc,EAAC;MAAEC,IAAI,EAAE;IAAiB,CAAC,CAAC,CAAC;IAAAV,QAAA,EAE7EA;EAAQ,CACa,CAAC;AAE7B,CACF,CAAC;AAEDiD,aAAa,CAACnC,WAAW,GAAG,gBAAgB;;AAE5C;AACA;AACA;;AASO,MAAMyC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAACC,MAAM,CAAC9D,YAAY,EAAE;EAClD+D,SAAS,EAAE/C,iBAAiB;EAC5B4B,IAAI,EAAEF,YAAY;EAClBsB,KAAK,EAAEd,aAAa;EACpBe,KAAK,EAAEZ;AACT,CAAC,CAA8B","ignoreList":[]}
|
|
@@ -34,7 +34,7 @@ const checkboxIndicatorVariants = exports.checkboxIndicatorVariants = (0, _class
|
|
|
34
34
|
// data-[hover=true] guard ensures active beats hover by specificity (0,3,0 > 0,2,0).
|
|
35
35
|
'web:active:data-[hover=true]:data-[checked=true]:bg-surface-action-strong-active', 'web:active:data-[hover=true]:data-[checked=true]:border-[--color-surface-action-strong-active]', 'web:active:data-[hover=true]:data-[indeterminate=true]:bg-surface-action-strong-active', 'web:active:data-[hover=true]:data-[indeterminate=true]:border-[--color-surface-action-strong-active]', 'web:active:data-[hover=true]:data-[checked=true]:data-[invalid=true]:bg-surface-danger-strong-active', 'web:active:data-[hover=true]:data-[checked=true]:data-[invalid=true]:border-[--color-surface-danger-strong-active]', 'web:active:data-[hover=true]:data-[indeterminate=true]:data-[invalid=true]:bg-surface-danger-strong-active', 'web:active:data-[hover=true]:data-[indeterminate=true]:data-[invalid=true]:border-[--color-surface-danger-strong-active]',
|
|
36
36
|
// Focus ring
|
|
37
|
-
'web:data-[focus-visible=true]:outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-
|
|
37
|
+
'web:data-[focus-visible=true]:outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2'].join(' '),
|
|
38
38
|
default: [
|
|
39
39
|
// Invalid bg is NOT styled on native. Compound data-[] selectors cannot express
|
|
40
40
|
// "invalid AND checked" without false-matching other states (Uniwind only evaluates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_classVarianceAuthority","_primitives","checkboxRootVariants","exports","cva","DISABLED_OPACITY","DISABLED_CURSOR","checkboxIndicatorVariants","Platform","select","web","TRANSITION_COLORS","join","default","checkboxIconVariants","checkboxLabelVariants","checkboxGroupVariants","variants","direction","column","row","defaultVariants"],"sourceRoot":"../../../../src","sources":["components/Checkbox/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;;AAEO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,2BAAG,EAAC,CACtC,+BAA+B,EAC/BC,4BAAgB,EAChBC,2BAAe;AACf;AACA,wEAAwE,CACzE,CAAC;AAEK,MAAMC,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,GAAG,IAAAH,2BAAG,EAAC,CAC3C,6BAA6B,EAC7B,SAAS,EACT,SAAS,EACT,uBAAuB,EACvB,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,yCAAyC,EACzC,8CAA8C,EAC9C,oDAAoD;AACpD;AACA,+CAA+C,EAC/C,0CAA0C,EAC1C,gDAAgD,EAChD,0CAA0C,EAC1CI,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE;EACH;EACA,kEAAkE,EAClE,wEAAwE,EACxEC,6BAAiB;EACjB;EACA,+FAA+F;EAC/F;EACA,uHAAuH;EACvH;EACA,sEAAsE,EACtE,oFAAoF,EACpF,4EAA4E,EAC5E,0FAA0F,EAC1F,0FAA0F,EAC1F,wGAAwG,EACxG,gGAAgG,EAChG,8GAA8G;EAC9G;EACA;EACA,kFAAkF,EAClF,gGAAgG,EAChG,wFAAwF,EACxF,sGAAsG,EACtG,sGAAsG,EACtG,oHAAoH,EACpH,4GAA4G,EAC5G,0HAA0H;EAC1H;EACA,4CAA4C,EAC5C,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_classVarianceAuthority","_primitives","checkboxRootVariants","exports","cva","DISABLED_OPACITY","DISABLED_CURSOR","checkboxIndicatorVariants","Platform","select","web","TRANSITION_COLORS","join","default","checkboxIconVariants","checkboxLabelVariants","checkboxGroupVariants","variants","direction","column","row","defaultVariants"],"sourceRoot":"../../../../src","sources":["components/Checkbox/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;;AAEO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,2BAAG,EAAC,CACtC,+BAA+B,EAC/BC,4BAAgB,EAChBC,2BAAe;AACf;AACA,wEAAwE,CACzE,CAAC;AAEK,MAAMC,yBAA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Q,EAAE;IACRC,SAAS,EAAE;MACTC,MAAM,EAAE,OAAO;MACfC,GAAG,EAAE;IACP;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -10,15 +10,10 @@ var _primitives = require("@cdx-ui/primitives");
|
|
|
10
10
|
var _utils = require("@cdx-ui/utils");
|
|
11
11
|
var _Avatar = require("../Avatar");
|
|
12
12
|
var _Icon = require("../Icon");
|
|
13
|
+
var _positionToDataIcon = require("../../utils/positionToDataIcon");
|
|
13
14
|
var _styles = require("./styles");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
const SCOPE = 'CHIP';
|
|
16
|
-
const RootView = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
17
|
-
const RootPressable = (0, _utils.withStyleContext)(_reactNative.Pressable, SCOPE);
|
|
18
|
-
const ChipPrimitive = (0, _primitives.createChip)({
|
|
19
|
-
View: RootView,
|
|
20
|
-
Pressable: RootPressable
|
|
21
|
-
});
|
|
22
17
|
const useChipStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
23
18
|
|
|
24
19
|
// =============================================================================
|
|
@@ -32,43 +27,35 @@ const ChipRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
32
27
|
color = 'default',
|
|
33
28
|
className,
|
|
34
29
|
style,
|
|
35
|
-
asChild,
|
|
36
30
|
...props
|
|
37
31
|
}, ref) => {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
...
|
|
32
|
+
const parent = (0, _utils.useParentContext)();
|
|
33
|
+
const ctx = (0, _react.useMemo)(() => ({
|
|
34
|
+
...parent,
|
|
41
35
|
[SCOPE]: {
|
|
42
36
|
variant,
|
|
43
37
|
size,
|
|
44
38
|
color
|
|
45
39
|
}
|
|
46
|
-
}), [
|
|
40
|
+
}), [parent, variant, size, color]);
|
|
47
41
|
const computedClassName = (0, _utils.cn)((0, _styles.chipRootVariants)({
|
|
48
42
|
variant,
|
|
49
43
|
size,
|
|
50
44
|
color
|
|
51
45
|
}), className);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
47
|
+
value: ctx,
|
|
48
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ChipRoot, {
|
|
49
|
+
ref: ref,
|
|
50
|
+
className: computedClassName,
|
|
51
|
+
style: style,
|
|
52
|
+
...props,
|
|
53
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
54
|
+
slot: 'chip'
|
|
55
|
+
})),
|
|
56
|
+
children: children
|
|
57
|
+
})
|
|
64
58
|
});
|
|
65
|
-
if (asChild) {
|
|
66
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
67
|
-
value: styleContextValues,
|
|
68
|
-
children: root
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
return root;
|
|
72
59
|
});
|
|
73
60
|
ChipRoot.displayName = 'Chip';
|
|
74
61
|
|
|
@@ -77,6 +64,7 @@ ChipRoot.displayName = 'Chip';
|
|
|
77
64
|
// =============================================================================
|
|
78
65
|
|
|
79
66
|
const ChipLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
67
|
+
asChild,
|
|
80
68
|
className,
|
|
81
69
|
children,
|
|
82
70
|
style,
|
|
@@ -92,11 +80,15 @@ const ChipLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
92
80
|
variant,
|
|
93
81
|
color
|
|
94
82
|
}), className);
|
|
95
|
-
|
|
83
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
96
85
|
ref: ref,
|
|
97
86
|
className: computedClassName,
|
|
98
87
|
style: style,
|
|
99
88
|
...props,
|
|
89
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
90
|
+
slot: 'chip-label'
|
|
91
|
+
})),
|
|
100
92
|
children: children
|
|
101
93
|
});
|
|
102
94
|
});
|
|
@@ -107,10 +99,11 @@ ChipLabel.displayName = 'Chip.Label';
|
|
|
107
99
|
// =============================================================================
|
|
108
100
|
|
|
109
101
|
const ChipIcon = ({
|
|
102
|
+
asChild,
|
|
110
103
|
className,
|
|
111
104
|
style,
|
|
112
105
|
as,
|
|
113
|
-
|
|
106
|
+
position,
|
|
114
107
|
...props
|
|
115
108
|
}) => {
|
|
116
109
|
const {
|
|
@@ -119,14 +112,29 @@ const ChipIcon = ({
|
|
|
119
112
|
} = useChipStyleContext();
|
|
120
113
|
const computedClassName = (0, _utils.cn)((0, _styles.chipIconVariants)({
|
|
121
114
|
size,
|
|
122
|
-
color
|
|
123
|
-
slot
|
|
115
|
+
color
|
|
124
116
|
}), className);
|
|
117
|
+
if (asChild) {
|
|
118
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Slot, {
|
|
119
|
+
className: computedClassName,
|
|
120
|
+
style: style,
|
|
121
|
+
...props,
|
|
122
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
123
|
+
slot: 'chip-icon'
|
|
124
|
+
}), (0, _positionToDataIcon.positionToDataIcon)(position))
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (!as) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
125
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
126
131
|
as: as,
|
|
127
132
|
className: computedClassName,
|
|
128
133
|
style: style,
|
|
129
|
-
...props
|
|
134
|
+
...props,
|
|
135
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
136
|
+
slot: 'chip-icon'
|
|
137
|
+
}), (0, _positionToDataIcon.positionToDataIcon)(position))
|
|
130
138
|
});
|
|
131
139
|
};
|
|
132
140
|
ChipIcon.displayName = 'Chip.Icon';
|
|
@@ -144,7 +152,7 @@ const ChipAvatar = ({
|
|
|
144
152
|
const {
|
|
145
153
|
size
|
|
146
154
|
} = useChipStyleContext();
|
|
147
|
-
// chipAvatarVariants sets w/h and the leading
|
|
155
|
+
// chipAvatarVariants sets w/h and the leading-edge negative margin.
|
|
148
156
|
// Avatar renders with size="sm" (its smallest named size) but chipAvatarVariants
|
|
149
157
|
// overrides the w/h via tailwind-merge so the chip size wins.
|
|
150
158
|
const computedClassName = (0, _utils.cn)((0, _styles.chipAvatarVariants)({
|