@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
|
@@ -10,49 +10,6 @@ var _primitives = require("@cdx-ui/primitives");
|
|
|
10
10
|
var _utils = require("@cdx-ui/utils");
|
|
11
11
|
var _styles = require("./styles");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
// =============================================================================
|
|
14
|
-
// STYLED INDICATOR BASE
|
|
15
|
-
// =============================================================================
|
|
16
|
-
const RadioIndicatorBase = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
17
|
-
className,
|
|
18
|
-
children,
|
|
19
|
-
style,
|
|
20
|
-
...props
|
|
21
|
-
}, ref) => {
|
|
22
|
-
// On web, data attributes arrive as `dataSet: { checked: true }`.
|
|
23
|
-
// On native, they arrive as individual `data-checked: "true"` props.
|
|
24
|
-
const ds = props.dataSet;
|
|
25
|
-
const isChecked = ds ? ds.checked === true : props['data-checked'] === 'true';
|
|
26
|
-
const isInvalid = ds ? ds.invalid === true : props['data-invalid'] === 'true';
|
|
27
|
-
const isHovered = ds ? ds.hover === true : props['data-hover'] === 'true';
|
|
28
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
29
|
-
ref: ref,
|
|
30
|
-
className: (0, _utils.cn)((0, _styles.radioIndicatorVariants)(), className),
|
|
31
|
-
style: style,
|
|
32
|
-
...props,
|
|
33
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
34
|
-
className: (0, _utils.cn)((0, _styles.radioInnerDotVariants)()),
|
|
35
|
-
...(0, _primitives.dataAttributes)({
|
|
36
|
-
checked: isChecked,
|
|
37
|
-
invalid: isInvalid,
|
|
38
|
-
hover: isHovered
|
|
39
|
-
})
|
|
40
|
-
}), children]
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
RadioIndicatorBase.displayName = 'Radio.IndicatorBase';
|
|
44
|
-
|
|
45
|
-
// =============================================================================
|
|
46
|
-
// PRIMITIVE ASSEMBLY
|
|
47
|
-
// =============================================================================
|
|
48
|
-
|
|
49
|
-
const RadioPrimitive = (0, _primitives.createRadio)({
|
|
50
|
-
Root: _reactNative.Pressable,
|
|
51
|
-
Indicator: RadioIndicatorBase,
|
|
52
|
-
Label: _reactNative.Text,
|
|
53
|
-
Group: _reactNative.View
|
|
54
|
-
});
|
|
55
|
-
|
|
56
13
|
// =============================================================================
|
|
57
14
|
// RADIO ROOT
|
|
58
15
|
// =============================================================================
|
|
@@ -64,59 +21,96 @@ const RadioRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
64
21
|
...props
|
|
65
22
|
}, ref) => {
|
|
66
23
|
const computedClassName = (0, _utils.cn)((0, _styles.radioRootVariants)(), className);
|
|
67
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.RadioRoot, {
|
|
68
25
|
ref: ref,
|
|
69
26
|
className: computedClassName,
|
|
70
27
|
style: style,
|
|
71
28
|
...props,
|
|
72
|
-
|
|
29
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
30
|
+
slot: 'radio'
|
|
31
|
+
})),
|
|
32
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(RadioIndicator, {}), children]
|
|
73
33
|
});
|
|
74
34
|
});
|
|
75
35
|
RadioRoot.displayName = 'Radio';
|
|
76
36
|
|
|
77
37
|
// =============================================================================
|
|
78
|
-
// RADIO INDICATOR
|
|
38
|
+
// RADIO INDICATOR (styled-only, reads context for data-* styling)
|
|
79
39
|
// =============================================================================
|
|
80
40
|
|
|
81
41
|
const RadioIndicator = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
42
|
+
asChild,
|
|
82
43
|
className,
|
|
83
44
|
children,
|
|
84
45
|
style,
|
|
85
46
|
...props
|
|
86
47
|
}, ref) => {
|
|
87
|
-
|
|
48
|
+
const {
|
|
49
|
+
isChecked,
|
|
50
|
+
isDisabled,
|
|
51
|
+
isHovered,
|
|
52
|
+
isInvalid,
|
|
53
|
+
isReadOnly,
|
|
54
|
+
isPressed,
|
|
55
|
+
isFocusVisible
|
|
56
|
+
} = (0, _primitives.useRadioContext)();
|
|
57
|
+
const computedClassName = (0, _utils.cn)((0, _styles.radioIndicatorVariants)(), className);
|
|
58
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Comp, {
|
|
88
60
|
ref: ref,
|
|
89
|
-
className:
|
|
61
|
+
className: computedClassName,
|
|
90
62
|
style: style,
|
|
91
63
|
...props,
|
|
92
|
-
|
|
64
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
65
|
+
slot: 'radio-indicator',
|
|
66
|
+
hover: isHovered,
|
|
67
|
+
checked: isChecked,
|
|
68
|
+
disabled: isDisabled,
|
|
69
|
+
focusVisible: isFocusVisible,
|
|
70
|
+
invalid: isInvalid,
|
|
71
|
+
readonly: isReadOnly,
|
|
72
|
+
active: isPressed
|
|
73
|
+
})),
|
|
74
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
75
|
+
className: (0, _utils.cn)((0, _styles.radioInnerDotVariants)()),
|
|
76
|
+
...(0, _primitives.dataAttributes)({
|
|
77
|
+
checked: isChecked,
|
|
78
|
+
invalid: isInvalid,
|
|
79
|
+
hover: isHovered
|
|
80
|
+
})
|
|
81
|
+
}), children]
|
|
93
82
|
});
|
|
94
83
|
});
|
|
95
84
|
RadioIndicator.displayName = 'Radio.Indicator';
|
|
96
85
|
|
|
97
86
|
// =============================================================================
|
|
98
|
-
// RADIO LABEL
|
|
87
|
+
// RADIO LABEL (styled-only)
|
|
99
88
|
// =============================================================================
|
|
100
89
|
|
|
101
90
|
const RadioLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
91
|
+
asChild,
|
|
102
92
|
className,
|
|
103
93
|
children,
|
|
104
94
|
style,
|
|
105
95
|
...props
|
|
106
96
|
}, ref) => {
|
|
107
97
|
const computedClassName = (0, _utils.cn)((0, _styles.radioLabelVariants)(), className);
|
|
108
|
-
|
|
98
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
99
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
109
100
|
ref: ref,
|
|
110
101
|
className: computedClassName,
|
|
111
102
|
style: style,
|
|
112
103
|
...props,
|
|
104
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
105
|
+
slot: 'radio-label'
|
|
106
|
+
})),
|
|
113
107
|
children: children
|
|
114
108
|
});
|
|
115
109
|
});
|
|
116
110
|
RadioLabel.displayName = 'Radio.Label';
|
|
117
111
|
|
|
118
112
|
// =============================================================================
|
|
119
|
-
// RADIO GROUP
|
|
113
|
+
// RADIO GROUP (wraps the primitive)
|
|
120
114
|
// =============================================================================
|
|
121
115
|
|
|
122
116
|
const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
@@ -137,7 +131,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
137
131
|
const computedClassName = (0, _utils.cn)((0, _styles.radioGroupVariants)({
|
|
138
132
|
direction
|
|
139
133
|
}), className);
|
|
140
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
134
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RadioGroup, {
|
|
141
135
|
ref: ref,
|
|
142
136
|
className: computedClassName,
|
|
143
137
|
style: style,
|
|
@@ -149,7 +143,11 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
149
143
|
isRequired: isRequired,
|
|
150
144
|
isReadOnly: isReadOnly,
|
|
151
145
|
name: name,
|
|
146
|
+
direction: direction,
|
|
152
147
|
...viewProps,
|
|
148
|
+
...(0, _primitives.mergeDataAttributes)(viewProps, (0, _primitives.dataAttributes)({
|
|
149
|
+
slot: 'radio-group'
|
|
150
|
+
})),
|
|
153
151
|
children: children
|
|
154
152
|
});
|
|
155
153
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","RadioRoot","forwardRef","className","children","style","props","ref","computedClassName","cn","radioRootVariants","jsxs","mergeDataAttributes","dataAttributes","slot","jsx","RadioIndicator","displayName","asChild","isChecked","isDisabled","isHovered","isInvalid","isReadOnly","isPressed","isFocusVisible","useRadioContext","radioIndicatorVariants","Comp","Slot","View","hover","checked","disabled","focusVisible","invalid","readonly","active","radioInnerDotVariants","RadioLabel","radioLabelVariants","Text","RadioGroup","direction","value","defaultValue","onChange","isRequired","name","viewProps","radioGroupVariants","Radio","exports","Object","assign","Indicator","Label","Group"],"sourceRoot":"../../../../src","sources":["components/Radio/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAMkB,IAAAK,WAAA,GAAAL,OAAA;AAElB;AACA;AACA;;AAOA,MAAMM,SAAS,gBAAG,IAAAC,iBAAU,EAAmB,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC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EvC,cAAc;EACzBwC,KAAK,EAAEjB,UAAU;EACjBkB,KAAK,EAAEf;AACT,CAAC,CAA2B","ignoreList":[]}
|
|
@@ -10,24 +10,14 @@ var _icons = require("@cdx-ui/icons");
|
|
|
10
10
|
var _primitives = require("@cdx-ui/primitives");
|
|
11
11
|
var _utils = require("@cdx-ui/utils");
|
|
12
12
|
var _Icon = require("../Icon");
|
|
13
|
-
var
|
|
13
|
+
var _positionToDataIcon = require("../../utils/positionToDataIcon");
|
|
14
14
|
var _styles = require("./styles");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
const SCOPE = 'SELECT';
|
|
17
|
-
const Root = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
18
17
|
const useSelectStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
19
|
-
const SelectPrimitive = (0, _primitives.createSelect)({
|
|
20
|
-
Root,
|
|
21
|
-
Trigger: _SelectTriggerHost.SelectTriggerHost,
|
|
22
|
-
Value: _reactNative.Text,
|
|
23
|
-
Icon: _reactNative.View,
|
|
24
|
-
Content: _reactNative.View,
|
|
25
|
-
Item: _reactNative.Pressable,
|
|
26
|
-
ItemLabel: _reactNative.Text
|
|
27
|
-
});
|
|
28
18
|
|
|
29
19
|
// =============================================================================
|
|
30
|
-
// STYLED ROOT
|
|
20
|
+
// STYLED ROOT
|
|
31
21
|
// =============================================================================
|
|
32
22
|
|
|
33
23
|
const SelectRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
@@ -38,127 +28,188 @@ const SelectRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
38
28
|
style,
|
|
39
29
|
...props
|
|
40
30
|
}, ref) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
context: {
|
|
31
|
+
const parent = (0, _utils.useParentContext)();
|
|
32
|
+
const ctx = (0, _react.useMemo)(() => ({
|
|
33
|
+
...parent,
|
|
34
|
+
[SCOPE]: {
|
|
46
35
|
variant,
|
|
47
36
|
size
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
}
|
|
38
|
+
}), [parent, variant, size]);
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
40
|
+
value: ctx,
|
|
41
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SelectRoot, {
|
|
42
|
+
ref: ref,
|
|
43
|
+
className: className,
|
|
44
|
+
style: style,
|
|
45
|
+
...props,
|
|
46
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
47
|
+
slot: 'select'
|
|
48
|
+
})),
|
|
49
|
+
children: children
|
|
50
|
+
})
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
SelectRoot.displayName = 'Select';
|
|
54
54
|
|
|
55
55
|
// =============================================================================
|
|
56
|
-
// STYLED TRIGGER
|
|
56
|
+
// STYLED TRIGGER
|
|
57
57
|
// =============================================================================
|
|
58
58
|
|
|
59
59
|
const SelectTrigger = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
60
|
+
asChild,
|
|
60
61
|
className,
|
|
61
62
|
children,
|
|
62
63
|
style,
|
|
63
64
|
...props
|
|
64
65
|
}, ref) => {
|
|
66
|
+
const {
|
|
67
|
+
open
|
|
68
|
+
} = (0, _primitives.useSelectContext)();
|
|
65
69
|
const {
|
|
66
70
|
variant,
|
|
67
71
|
size
|
|
68
72
|
} = useSelectStyleContext();
|
|
69
|
-
const computedClassName = (0, _utils.cn)((0, _styles.selectTriggerVariants)({
|
|
73
|
+
const computedClassName = asChild ? className : (0, _utils.cn)((0, _styles.selectTriggerVariants)({
|
|
70
74
|
variant,
|
|
71
75
|
size
|
|
72
76
|
}), className);
|
|
73
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
77
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SelectTrigger, {
|
|
74
78
|
ref: ref,
|
|
79
|
+
asChild: asChild,
|
|
75
80
|
className: computedClassName,
|
|
76
81
|
style: style,
|
|
77
82
|
...props,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})
|
|
83
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
84
|
+
slot: 'select-trigger'
|
|
85
|
+
})),
|
|
86
|
+
children: asChild ? children : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
87
|
+
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectIcon, {
|
|
88
|
+
as: open ? _icons.KeyboardArrowUp : _icons.KeyboardArrowDown
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
81
91
|
});
|
|
82
92
|
});
|
|
83
93
|
SelectTrigger.displayName = 'Select.Trigger';
|
|
84
94
|
|
|
85
95
|
// =============================================================================
|
|
86
|
-
// STYLED VALUE
|
|
96
|
+
// STYLED VALUE (styled-only)
|
|
87
97
|
// =============================================================================
|
|
88
98
|
|
|
89
99
|
const SelectValue = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
100
|
+
asChild,
|
|
90
101
|
className,
|
|
91
102
|
style,
|
|
103
|
+
placeholder,
|
|
104
|
+
children,
|
|
92
105
|
...props
|
|
93
106
|
}, ref) => {
|
|
94
107
|
const {
|
|
95
108
|
size
|
|
96
109
|
} = useSelectStyleContext();
|
|
110
|
+
const {
|
|
111
|
+
value,
|
|
112
|
+
items,
|
|
113
|
+
invalid
|
|
114
|
+
} = (0, _primitives.useSelectContext)();
|
|
115
|
+
const hasValue = value !== undefined && value !== '';
|
|
116
|
+
const showPlaceholder = !hasValue;
|
|
117
|
+
const displayText = hasValue ? items.find(item => item.value === value)?.label : placeholder;
|
|
97
118
|
const computedClassName = (0, _utils.cn)((0, _styles.selectValueVariants)({
|
|
98
119
|
size
|
|
99
120
|
}), className);
|
|
100
|
-
|
|
121
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
101
123
|
ref: ref,
|
|
102
124
|
className: computedClassName,
|
|
103
125
|
style: style,
|
|
104
|
-
...props
|
|
126
|
+
...props,
|
|
127
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
128
|
+
slot: 'select-value',
|
|
129
|
+
placeholder: showPlaceholder,
|
|
130
|
+
invalid
|
|
131
|
+
})),
|
|
132
|
+
children: children ?? displayText
|
|
105
133
|
});
|
|
106
134
|
});
|
|
107
135
|
SelectValue.displayName = 'Select.Value';
|
|
108
136
|
|
|
109
137
|
// =============================================================================
|
|
110
|
-
// STYLED ICON
|
|
138
|
+
// STYLED ICON (styled-only, reads context for state=open / invalid)
|
|
111
139
|
// =============================================================================
|
|
112
140
|
|
|
113
141
|
const SelectIcon = ({
|
|
142
|
+
asChild,
|
|
114
143
|
className,
|
|
115
144
|
style,
|
|
116
|
-
as
|
|
145
|
+
as,
|
|
146
|
+
position,
|
|
117
147
|
...props
|
|
118
148
|
}) => {
|
|
119
149
|
const {
|
|
120
150
|
size
|
|
121
151
|
} = useSelectStyleContext();
|
|
152
|
+
const {
|
|
153
|
+
invalid
|
|
154
|
+
} = (0, _primitives.useSelectContext)();
|
|
122
155
|
const computedClassName = (0, _utils.cn)((0, _styles.selectIconVariants)({
|
|
123
156
|
size
|
|
124
157
|
}), className);
|
|
125
|
-
const
|
|
126
|
-
|
|
158
|
+
const slotData = (0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
159
|
+
slot: 'select-icon',
|
|
160
|
+
invalid
|
|
161
|
+
}), (0, _positionToDataIcon.positionToDataIcon)(position));
|
|
162
|
+
if (asChild) {
|
|
163
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Slot, {
|
|
164
|
+
className: computedClassName,
|
|
165
|
+
style: style,
|
|
166
|
+
...props,
|
|
167
|
+
...slotData
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
if (!as) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
174
|
+
as: as,
|
|
127
175
|
className: computedClassName,
|
|
128
176
|
style: style,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
className: iconSizeClass,
|
|
132
|
-
...props
|
|
133
|
-
})
|
|
177
|
+
...props,
|
|
178
|
+
...slotData
|
|
134
179
|
});
|
|
135
180
|
};
|
|
136
181
|
SelectIcon.displayName = 'Select.Icon';
|
|
137
182
|
|
|
138
183
|
// =============================================================================
|
|
139
|
-
// STYLED CONTENT
|
|
184
|
+
// STYLED CONTENT
|
|
140
185
|
// =============================================================================
|
|
141
186
|
|
|
142
187
|
const SelectContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
188
|
+
asChild,
|
|
143
189
|
className,
|
|
144
190
|
style,
|
|
145
191
|
...props
|
|
146
192
|
}, ref) => {
|
|
147
193
|
const computedClassName = (0, _utils.cn)((0, _styles.selectContentVariants)(), className);
|
|
148
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
194
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SelectContent, {
|
|
149
195
|
ref: ref,
|
|
196
|
+
asChild: asChild,
|
|
150
197
|
className: computedClassName,
|
|
151
198
|
style: style,
|
|
152
|
-
...props
|
|
199
|
+
...props,
|
|
200
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
201
|
+
slot: 'select-content'
|
|
202
|
+
}))
|
|
153
203
|
});
|
|
154
204
|
});
|
|
155
205
|
SelectContent.displayName = 'Select.Content';
|
|
156
206
|
|
|
157
207
|
// =============================================================================
|
|
158
|
-
// STYLED ITEM
|
|
208
|
+
// STYLED ITEM
|
|
159
209
|
// =============================================================================
|
|
160
210
|
|
|
161
211
|
const SelectItem = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
212
|
+
asChild,
|
|
162
213
|
className,
|
|
163
214
|
children,
|
|
164
215
|
style,
|
|
@@ -170,36 +221,51 @@ const SelectItem = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
170
221
|
const computedClassName = (0, _utils.cn)((0, _styles.selectItemVariants)({
|
|
171
222
|
size
|
|
172
223
|
}), className);
|
|
173
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
224
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SelectItem, {
|
|
174
225
|
ref: ref,
|
|
226
|
+
asChild: asChild,
|
|
175
227
|
className: computedClassName,
|
|
176
228
|
style: style,
|
|
177
229
|
...props,
|
|
230
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
231
|
+
slot: 'select-item'
|
|
232
|
+
})),
|
|
178
233
|
children: children
|
|
179
234
|
});
|
|
180
235
|
});
|
|
181
236
|
SelectItem.displayName = 'Select.Item';
|
|
182
237
|
|
|
183
238
|
// =============================================================================
|
|
184
|
-
// STYLED ITEM LABEL
|
|
239
|
+
// STYLED ITEM LABEL (styled-only, reads item context for checked state)
|
|
185
240
|
// =============================================================================
|
|
186
241
|
|
|
187
242
|
const SelectItemLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
243
|
+
asChild,
|
|
188
244
|
className,
|
|
189
245
|
style,
|
|
246
|
+
children,
|
|
190
247
|
...props
|
|
191
248
|
}, ref) => {
|
|
192
249
|
const {
|
|
193
250
|
size
|
|
194
251
|
} = useSelectStyleContext();
|
|
252
|
+
const {
|
|
253
|
+
checked
|
|
254
|
+
} = (0, _primitives.useSelectItemContext)();
|
|
195
255
|
const computedClassName = (0, _utils.cn)((0, _styles.selectItemLabelVariants)({
|
|
196
256
|
size
|
|
197
257
|
}), className);
|
|
198
|
-
|
|
258
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
259
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
199
260
|
ref: ref,
|
|
200
261
|
className: computedClassName,
|
|
201
262
|
style: style,
|
|
202
|
-
...props
|
|
263
|
+
...props,
|
|
264
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
265
|
+
slot: 'select-item-label',
|
|
266
|
+
state: checked ? 'checked' : 'unchecked'
|
|
267
|
+
})),
|
|
268
|
+
children: children
|
|
203
269
|
});
|
|
204
270
|
});
|
|
205
271
|
SelectItemLabel.displayName = 'Select.ItemLabel';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_icons","_primitives","_utils","_Icon","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_icons","_primitives","_utils","_Icon","_positionToDataIcon","_styles","_jsxRuntime","SCOPE","useSelectStyleContext","useStyleContext","SelectRoot","forwardRef","variant","size","className","children","style","props","ref","parent","useParentContext","ctx","useMemo","jsx","ParentContext","Provider","value","mergeDataAttributes","dataAttributes","slot","displayName","SelectTrigger","asChild","open","useSelectContext","computedClassName","cn","selectTriggerVariants","jsxs","Fragment","SelectIcon","as","KeyboardArrowUp","KeyboardArrowDown","SelectValue","placeholder","items","invalid","hasValue","undefined","showPlaceholder","displayText","find","item","label","selectValueVariants","Comp","Slot","Text","position","selectIconVariants","slotData","positionToDataIcon","Icon","SelectContent","selectContentVariants","SelectItem","selectItemVariants","SelectItemLabel","checked","useSelectItemContext","selectItemLabelVariants","state","Select","exports","Object","assign","Trigger","Value","Content","Item","ItemLabel"],"sourceRoot":"../../../../src","sources":["components/Select/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAiBA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA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xC,MAAM;IAAE6D;EAAQ,CAAC,GAAG,IAAAC,gCAAoB,EAAC,CAAC;EAE1C,MAAMnC,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAmC,+BAAuB,EAAC;IAAE1D;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAC1E,MAAM0C,IAAI,GAAGxB,OAAO,GAAGyB,gBAAI,GAAGC,iBAAI;EAElC,oBACE,IAAApD,WAAA,CAAAiB,GAAA,EAACiC,IAAI;IACHtC,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEqB,iBAAkB;IAC7BnB,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAA,GACL,IAAAU,+BAAmB,EACrBV,KAAK,EACL,IAAAW,0BAAc,EAAC;MACbC,IAAI,EAAE,mBAAmB;MACzB2C,KAAK,EAAEH,OAAO,GAAG,SAAS,GAAG;IAC/B,CAAC,CACH,CAAC;IAAAtD,QAAA,EAEAA;EAAQ,CACL,CAAC;AAEX,CACF,CAAC;AAEDqD,eAAe,CAACtC,WAAW,GAAG,kBAAkB;;AAEhD;AACA;AACA;;AAWO,MAAM2C,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAAClE,UAAU,EAAE;EAC9CmE,OAAO,EAAE9C,aAAa;EACtB+C,KAAK,EAAElC,WAAW;EAClBmB,IAAI,EAAEvB,UAAU;EAChBuC,OAAO,EAAEf,aAAa;EACtBgB,IAAI,EAAEd,UAAU;EAChBe,SAAS,EAAEb;AACb,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ var _classVarianceAuthority = require("class-variance-authority");
|
|
|
9
9
|
var _primitives = require("../../styles/primitives");
|
|
10
10
|
// ── Trigger ─────────────────────────────────────────────────
|
|
11
11
|
|
|
12
|
-
const selectTriggerVariants = exports.selectTriggerVariants = (0, _classVarianceAuthority.cva)(['flex w-full min-w-0 flex-row items-center justify-between text-start', 'bg-surface-primary', 'border border-stroke-primary', 'rounded-[var(--border-radius-default)]', _primitives.TRANSITION_COLORS, 'data-[disabled=true]:bg-surface-secondary', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', _primitives.DISABLED_CURSOR, 'data-[readonly=true]:cursor-default', 'data-[readonly=true]:bg-surface-secondary', 'web:
|
|
12
|
+
const selectTriggerVariants = exports.selectTriggerVariants = (0, _classVarianceAuthority.cva)(['flex w-full min-w-0 flex-row items-center justify-between text-start', 'bg-surface-primary', 'border border-stroke-primary', 'rounded-[var(--border-radius-default)]', _primitives.TRANSITION_COLORS, 'data-[disabled=true]:bg-surface-secondary', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', _primitives.DISABLED_CURSOR, 'data-[readonly=true]:cursor-default', 'data-[readonly=true]:bg-surface-secondary', 'web:hover:data-[focus=false]:data-[invalid=false]:border-stroke-hover', 'data-[focus=true]:border-[length:var(--border-width-focused)]', 'data-[focus=true]:data-[invalid=false]:border-stroke-action', 'data-[focus=true]:data-[invalid=true]:border-stroke-danger', 'data-[state=open]:border-[length:var(--border-width-focused)]', 'data-[state=open]:data-[invalid=false]:border-stroke-action', 'data-[state=open]:data-[invalid=true]:border-stroke-danger', 'data-[invalid=true]:border-stroke-danger'], {
|
|
13
13
|
variants: {
|
|
14
14
|
variant: {
|
|
15
15
|
outline: []
|
|
@@ -41,7 +41,7 @@ const selectValueVariants = exports.selectValueVariants = (0, _classVarianceAuth
|
|
|
41
41
|
|
|
42
42
|
// ── Icon ────────────────────────────────────────────────────
|
|
43
43
|
|
|
44
|
-
const selectIconVariants = exports.selectIconVariants = (0, _classVarianceAuthority.cva)(['shrink-0 items-center justify-center self-center', 'text-content-tertiary', 'data-[invalid=true]:text-content-danger'
|
|
44
|
+
const selectIconVariants = exports.selectIconVariants = (0, _classVarianceAuthority.cva)(['shrink-0 items-center justify-center self-center', 'text-content-tertiary', 'data-[invalid=true]:text-content-danger'], {
|
|
45
45
|
variants: {
|
|
46
46
|
size: {
|
|
47
47
|
default: 'size-5',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_classVarianceAuthority","_primitives","selectTriggerVariants","exports","cva","TRANSITION_COLORS","DISABLED_CURSOR","variants","variant","outline","size","default","small","defaultVariants","selectValueVariants","selectIconVariants","selectContentVariants","Platform","select","web","selectItemVariants","selectItemLabelVariants"],"sourceRoot":"../../../../src","sources":["components/Select/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;;AAEO,MAAMG,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,IAAAE,2BAAG,EACtC,CACE,sEAAsE,EACtE,oBAAoB,EACpB,8BAA8B,EAC9B,wCAAwC,EACxCC,6BAAiB,EACjB,2CAA2C,EAC3C,wDAAwD,EACxDC,2BAAe,EACf,qCAAqC,EACrC,2CAA2C,EAC3C,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_classVarianceAuthority","_primitives","selectTriggerVariants","exports","cva","TRANSITION_COLORS","DISABLED_CURSOR","variants","variant","outline","size","default","small","defaultVariants","selectValueVariants","selectIconVariants","selectContentVariants","Platform","select","web","selectItemVariants","selectItemLabelVariants"],"sourceRoot":"../../../../src","sources":["components/Select/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;;AAEO,MAAMG,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,IAAAE,2BAAG,EACtC,CACE,sEAAsE,EACtE,oBAAoB,EACpB,8BAA8B,EAC9B,wCAAwC,EACxCC,6BAAiB,EACjB,2CAA2C,EAC3C,wDAAwD,EACxDC,2BAAe,EACf,qCAAqC,EACrC,2CAA2C,EAC3C,uEAAuE,EACvE,+DAA+D,EAC/D,6DAA6D,EAC7D,4DAA4D,EAC5D,+DAA+D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BR,OAAO,EAAE;AACX,CAAC,CAAC,EACF,UAAU,EACV,MAAM,CACP,CAAC;;AAEF;;AAEO,MAAMS,kBAAkB,GAAAjB,OAAA,CAAAiB,kBAAA,GAAG,IAAAhB,2BAAG,EACnC,CACE,uBAAuB,EACvB,gCAAgC,EAChC,0EAA0E,EAC1E,8EAA8E,EAC9Ea,qBAAQ,CAACC,MAAM,CAAC;EACdP,OAAO,EAAE,kDAAkD;EAC3DQ,GAAG,EAAE;AACP,CAAC,CAAC,CACH,EACD;EACEZ,QAAQ,EAAE;IACRG,IAAI,EAAE;MACJC,OAAO,EAAE,WAAW;MACpBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEO,MAAMW,uBAAuB,GAAAlB,OAAA,CAAAkB,uBAAA,GAAG,IAAAjB,2BAAG,EACxC,CAAC,sBAAsB,EAAE,kCAAkC,CAAC,EAC5D;EACEG,QAAQ,EAAE;IACRG,IAAI,EAAE;MACJC,OAAO,EAAE,iBAAiB;MAC1BC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Skeleton = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _styles = require("./styles");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
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); }
|
|
13
|
+
const Skeleton = exports.Skeleton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
14
|
+
className,
|
|
15
|
+
style,
|
|
16
|
+
duration = 1000,
|
|
17
|
+
...props
|
|
18
|
+
}, ref) => {
|
|
19
|
+
const opacity = (0, _reactNativeReanimated.useSharedValue)(1);
|
|
20
|
+
(0, _react.useEffect)(() => {
|
|
21
|
+
opacity.set((0, _reactNativeReanimated.withRepeat)((0, _reactNativeReanimated.withTiming)(0.35, {
|
|
22
|
+
duration,
|
|
23
|
+
easing: _reactNativeReanimated.Easing.inOut(_reactNativeReanimated.Easing.ease)
|
|
24
|
+
}), -1, true));
|
|
25
|
+
}, [duration, opacity]);
|
|
26
|
+
const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
|
|
27
|
+
opacity: opacity.get()
|
|
28
|
+
}));
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
30
|
+
ref: ref,
|
|
31
|
+
className: (0, _utils.cn)((0, _styles.skeletonVariants)(), className),
|
|
32
|
+
style: [animatedStyle, style],
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
Skeleton.displayName = 'Skeleton';
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeReanimated","_interopRequireWildcard","_utils","_styles","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Skeleton","exports","forwardRef","className","style","duration","props","ref","opacity","useSharedValue","useEffect","withRepeat","withTiming","easing","Easing","inOut","ease","animatedStyle","useAnimatedStyle","jsx","View","cn","skeletonVariants","displayName"],"sourceRoot":"../../../../src","sources":["components/Skeleton/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAOA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA4C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAE,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP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