@cdx-ui/components 0.0.1-beta.65 → 0.0.1-beta.67
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/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/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/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/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/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/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/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/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
|
@@ -6,40 +6,50 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.BaseSwitch = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
10
|
var _utils = require("@cdx-ui/utils");
|
|
10
11
|
var _styles = require("./styles");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* Native host for `Switch`. Renders `RNSwitch` with Uniwind className passthrough
|
|
15
|
+
* derived from the resolved interaction state in `switchState`.
|
|
16
|
+
*
|
|
17
|
+
* All state/a11y/interaction machinery lives in the `useSwitch` hook; this file
|
|
18
|
+
* is pure rendering (Standard 3: primitives must not carry styling machinery).
|
|
19
|
+
*/
|
|
12
20
|
const BaseSwitch = exports.BaseSwitch = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
13
|
-
|
|
21
|
+
switchState,
|
|
14
22
|
className,
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
size: _size,
|
|
24
|
+
onFocus,
|
|
25
|
+
onBlur,
|
|
17
26
|
...props
|
|
18
27
|
}, ref) => {
|
|
19
|
-
const isChecked = value ?? states?.checked ?? false;
|
|
20
|
-
const isDisabled = disabled ?? states?.disabled ?? false;
|
|
21
|
-
const isInvalid = states?.invalid ?? false;
|
|
22
28
|
const uniwindProps = {
|
|
23
29
|
className,
|
|
24
30
|
thumbColorClassName: (0, _utils.cn)((0, _styles.switchThumbColorVariants)({
|
|
25
|
-
isDisabled
|
|
31
|
+
isDisabled: switchState.isDisabled
|
|
26
32
|
})),
|
|
27
33
|
trackColorOnClassName: (0, _utils.cn)((0, _styles.switchTrackOnVariants)({
|
|
28
|
-
isInvalid
|
|
34
|
+
isInvalid: switchState.isInvalid
|
|
29
35
|
})),
|
|
30
36
|
trackColorOffClassName: (0, _utils.cn)((0, _styles.switchTrackOffVariants)({
|
|
31
|
-
isInvalid
|
|
37
|
+
isInvalid: switchState.isInvalid
|
|
32
38
|
})),
|
|
33
39
|
ios_backgroundColorClassName: (0, _utils.cn)((0, _styles.switchIosBgVariants)({
|
|
34
|
-
isInvalid
|
|
40
|
+
isInvalid: switchState.isInvalid
|
|
35
41
|
}))
|
|
36
42
|
};
|
|
37
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
|
|
38
44
|
ref: ref,
|
|
39
|
-
value:
|
|
40
|
-
disabled: isDisabled,
|
|
45
|
+
value: switchState.checked,
|
|
46
|
+
disabled: switchState.isDisabled,
|
|
47
|
+
onValueChange: switchState.setChecked,
|
|
48
|
+
onFocus: (0, _utils.composeEventHandlers)(onFocus, switchState.focusProps.onFocus),
|
|
49
|
+
onBlur: (0, _utils.composeEventHandlers)(onBlur, switchState.focusProps.onBlur),
|
|
41
50
|
...uniwindProps,
|
|
42
|
-
...props
|
|
51
|
+
...props,
|
|
52
|
+
...(0, _primitives.mergeDataAttributes)(props, switchState.dataAttrs)
|
|
43
53
|
});
|
|
44
54
|
});
|
|
45
55
|
BaseSwitch.displayName = 'BaseSwitch';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_utils","_styles","_jsxRuntime","BaseSwitch","exports","forwardRef","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","BaseSwitch","exports","forwardRef","switchState","className","size","_size","onFocus","onBlur","props","ref","uniwindProps","thumbColorClassName","cn","switchThumbColorVariants","isDisabled","trackColorOnClassName","switchTrackOnVariants","isInvalid","trackColorOffClassName","switchTrackOffVariants","ios_backgroundColorClassName","switchIosBgVariants","jsx","Switch","value","checked","disabled","onValueChange","setChecked","composeEventHandlers","focusProps","mergeDataAttributes","dataAttrs","displayName"],"sourceRoot":"../../../../src","sources":["components/Switch/BaseSwitch.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKkB,IAAAK,WAAA,GAAAL,OAAA;AAiBlB;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,UAAU,GAAAC,OAAA,CAAAD,UAAA,gBAAG,IAAAE,iBAAU,EAClC,CAAC;EAAEC,WAAW;EAAEC,SAAS;EAAEC,IAAI,EAAEC,KAAK;EAAEC,OAAO;EAAEC,MAAM;EAAE,G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
exports.BaseSwitch = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
10
|
var _utils = require("@cdx-ui/utils");
|
|
10
11
|
var _styles = require("./styles");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* Web host for `Switch`. Renders a custom `Pressable` + `View` toggle (preserving
|
|
15
|
+
* the existing visual contract) wired to the resolved state in `switchState`.
|
|
16
|
+
*
|
|
17
|
+
* `role="switch"` + `aria-checked` + keyboard semantics satisfy the same a11y
|
|
18
|
+
* contract that an `<input type="checkbox" role="switch">` would provide, without
|
|
19
|
+
* the visual rework an input swap would require (see spike notes in PR).
|
|
20
|
+
*/
|
|
12
21
|
const BaseSwitch = exports.BaseSwitch = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
13
|
-
|
|
14
|
-
onValueChange,
|
|
15
|
-
disabled,
|
|
16
|
-
states,
|
|
17
|
-
dataSet,
|
|
22
|
+
switchState,
|
|
18
23
|
className,
|
|
19
24
|
size = 'md',
|
|
25
|
+
accessibilityLabel,
|
|
20
26
|
onFocus,
|
|
21
27
|
onBlur,
|
|
22
28
|
...props
|
|
23
29
|
}, ref) => {
|
|
24
|
-
const isChecked = value ?? states?.checked ?? false;
|
|
25
|
-
const isDisabled = disabled ?? states?.disabled ?? false;
|
|
26
|
-
const isInvalid = states?.invalid ?? false;
|
|
27
30
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
28
31
|
ref: ref,
|
|
29
32
|
role: "switch",
|
|
30
|
-
"aria-checked":
|
|
31
|
-
"aria-disabled": isDisabled,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
"aria-checked": switchState.checked,
|
|
34
|
+
"aria-disabled": switchState.isDisabled,
|
|
35
|
+
accessibilityLabel: accessibilityLabel,
|
|
36
|
+
disabled: switchState.isDisabled,
|
|
37
|
+
onPress: () => switchState.setChecked(!switchState.checked),
|
|
38
|
+
onFocus: (0, _utils.composeEventHandlers)(onFocus, switchState.focusProps.onFocus),
|
|
39
|
+
onBlur: (0, _utils.composeEventHandlers)(onBlur, switchState.focusProps.onBlur),
|
|
40
|
+
onHoverIn: switchState.hoverProps.onHoverIn,
|
|
41
|
+
onHoverOut: switchState.hoverProps.onHoverOut,
|
|
36
42
|
tabIndex: 0,
|
|
37
43
|
className: (0, _utils.cn)((0, _styles.switchTrackVariants)({
|
|
38
44
|
size
|
|
39
45
|
}), (0, _styles.switchWebTrackColorVariants)({
|
|
40
|
-
isChecked,
|
|
41
|
-
isInvalid
|
|
42
|
-
}), className)
|
|
43
|
-
// @ts-expect-error dataSet is a RNW/Uniwind prop not in Pressable types
|
|
44
|
-
,
|
|
45
|
-
dataSet: dataSet,
|
|
46
|
+
isChecked: switchState.checked,
|
|
47
|
+
isInvalid: switchState.isInvalid
|
|
48
|
+
}), className),
|
|
46
49
|
...props,
|
|
50
|
+
...(0, _primitives.mergeDataAttributes)(props, switchState.dataAttrs),
|
|
47
51
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
48
52
|
className: (0, _utils.cn)((0, _styles.switchThumbVariants)({
|
|
49
53
|
size,
|
|
50
|
-
isChecked
|
|
54
|
+
isChecked: switchState.checked
|
|
51
55
|
}))
|
|
52
56
|
})
|
|
53
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_utils","_styles","_jsxRuntime","BaseSwitch","exports","forwardRef","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","BaseSwitch","exports","forwardRef","switchState","className","size","accessibilityLabel","onFocus","onBlur","props","ref","jsx","Pressable","role","checked","isDisabled","disabled","onPress","setChecked","composeEventHandlers","focusProps","onHoverIn","hoverProps","onHoverOut","tabIndex","cn","switchTrackVariants","switchWebTrackColorVariants","isChecked","isInvalid","mergeDataAttributes","dataAttrs","children","View","switchThumbVariants","displayName"],"sourceRoot":"../../../../src","sources":["components/Switch/BaseSwitch.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKkB,IAAAK,WAAA,GAAAL,OAAA;AAWlB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,UAAU,GAAAC,OAAA,CAAAD,UAAA,gBAAG,IAAAE,iBAAU,EAClC,CAAC;EAAEC,WAAW;EAAEC,SAAS;EAAEC,IAAI,GAAG,IAAI;EAAEC,kBAAkB;EAAEC,OAAO;EAAEC,MAAM;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC/F,oBACE,IAAAX,WAAA,CAAAY,GAAA,EAAChB,YAAA,CAAAiB,SAAS;IACRF,GAAG,EAAEA,GAAI;IACTG,IAAI,EAAC,QAAQ;IACb,gBAAcV,WAAW,CAACW,OAAQ;IAClC,iBAAeX,WAAW,CAACY,UAAW;IACtCT,kBAAkB,EAAEA,kBAAmB;IACvCU,QAAQ,EAAEb,WAAW,CAACY,UAAW;IACjCE,OAAO,EAAEA,CAAA,KAAMd,WAAW,CAACe,UAAU,CAAC,CAACf,WAAW,CAACW,OAAO,CAAE;IAC5DP,OAAO,EAAE,IAAAY,2BAAoB,EAACZ,OAAO,EAAEJ,WAAW,CAACiB,UAAU,CAACb,OAAqB,CAAE;IACrFC,MAAM,EAAE,IAAAW,2BAAoB,EAACX,MAAM,EAAEL,WAAW,CAACiB,UAAU,CAACZ,MAAoB,CAAE;IAClFa,SAAS,EAAElB,WAAW,CAACmB,UAAU,CAACD,SAAwB;IAC1DE,UAAU,EAAEpB,WAAW,CAACmB,UAAU,CAACC,UAAyB;IAC5DC,QAAQ,EAAE,CAAE;IACZpB,SAAS,EAAE,IAAAqB,SAAE,EACX,IAAAC,2BAAmB,EAAC;MAAErB;IAAK,CAAC,CAAC,EAC7B,IAAAsB,mCAA2B,EAAC;MAC1BC,SAAS,EAAEzB,WAAW,CAACW,OAAO;MAC9Be,SAAS,EAAE1B,WAAW,CAAC0B;IACzB,CAAC,CAAC,EACFzB,SACF,CAAE;IAAA,GACEK,KAAK;IAAA,GACL,IAAAqB,+BAAmB,EAACrB,KAAK,EAAEN,WAAW,CAAC4B,SAAS,CAAC;IAAAC,QAAA,eAErD,IAAAjC,WAAA,CAAAY,GAAA,EAAChB,YAAA,CAAAsC,IAAI;MAAC7B,SAAS,EAAE,IAAAqB,SAAE,EAAC,IAAAS,2BAAmB,EAAC;QAAE7B,IAAI;QAAEuB,SAAS,EAAEzB,WAAW,CAACW;MAAQ,CAAC,CAAC;IAAE,CAAE;EAAC,CAC7E,CAAC;AAEhB,CACF,CAAC;AAEDd,UAAU,CAACmC,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -4,10 +4,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Switch = void 0;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _primitives = require("@cdx-ui/primitives");
|
|
8
9
|
var _BaseSwitch = require("./BaseSwitch");
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
const Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
12
|
+
className,
|
|
13
|
+
size,
|
|
14
|
+
value,
|
|
15
|
+
isChecked,
|
|
16
|
+
defaultValue,
|
|
17
|
+
disabled,
|
|
18
|
+
isDisabled,
|
|
19
|
+
isInvalid,
|
|
20
|
+
onValueChange,
|
|
21
|
+
...props
|
|
22
|
+
}, ref) => {
|
|
23
|
+
const switchState = (0, _primitives.useSwitch)({
|
|
24
|
+
value,
|
|
25
|
+
isChecked,
|
|
26
|
+
defaultValue,
|
|
27
|
+
disabled,
|
|
28
|
+
isDisabled,
|
|
29
|
+
isInvalid,
|
|
30
|
+
onValueChange
|
|
31
|
+
});
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseSwitch.BaseSwitch, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
switchState: switchState,
|
|
35
|
+
className: className,
|
|
36
|
+
size: size,
|
|
37
|
+
...props,
|
|
38
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
39
|
+
slot: 'switch'
|
|
40
|
+
}))
|
|
41
|
+
});
|
|
11
42
|
});
|
|
12
|
-
|
|
43
|
+
Switch.displayName = 'Switch';
|
|
13
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","require","_primitives","_BaseSwitch","_jsxRuntime","Switch","exports","forwardRef","className","size","value","isChecked","defaultValue","disabled","isDisabled","isInvalid","onValueChange","props","ref","switchState","useSwitch","jsx","BaseSwitch","mergeDataAttributes","dataAttributes","slot","displayName"],"sourceRoot":"../../../../src","sources":["components/Switch/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,WAAA,GAAAF,OAAA;AAA0C,IAAAG,WAAA,GAAAH,OAAA;AAUnC,MAAMI,MAAM,GAAAC,OAAA,CAAAD,MAAA,gBAAG,IAAAE,iBAAU,EAC9B,CACE;EACEC,SAAS;EACTC,IAAI;EACJC,KAAK;EACLC,SAAS;EACTC,YAAY;EACZC,QAAQ;EACRC,UAAU;EACVC,SAAS;EACTC,aAAa;EACb,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,WAAW,GAAG,IAAAC,qBAAS,EAAC;IAC5BV,KAAK;IACLC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,UAAU;IACVC,SAAS;IACTC;EACF,CAAC,CAAC;EAEF,oBACE,IAAAZ,WAAA,CAAAiB,GAAA,EAAClB,WAAA,CAAAmB,UAAU;IACTJ,GAAG,EAAEA,GAAa;IAClBC,WAAW,EAAEA,WAAY;IACzBX,SAAS,EAAEA,SAAU;IACrBC,IAAI,EAAEA,IAAK;IAAA,GACPQ,KAAK;IAAA,GACL,IAAAM,+BAAmB,EAACN,KAAK,EAAE,IAAAO,0BAAc,EAAC;MAAEC,IAAI,EAAE;IAAS,CAAC,CAAC;EAAC,CACnE,CAAC;AAEN,CACF,CAAC;AAEDpB,MAAM,CAACqB,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -22,8 +22,6 @@ var _styles3 = require("./styles");
|
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const TILE_SCOPE = 'TILE';
|
|
24
24
|
const TILE_GROUP_SCOPE = 'TILE_GROUP';
|
|
25
|
-
const RootPressable = (0, _utils.withStyleContext)(_reactNative.Pressable, TILE_SCOPE);
|
|
26
|
-
const GroupView = (0, _utils.withStyleContext)(_reactNative.View, TILE_GROUP_SCOPE);
|
|
27
25
|
const useTileGroupStyleContext = () => {
|
|
28
26
|
// `useStyleContext` types the result as a `Record`, but at runtime the value is
|
|
29
27
|
// `undefined` when no provider is in scope (e.g. standalone Tile). Cast through
|
|
@@ -31,16 +29,6 @@ const useTileGroupStyleContext = () => {
|
|
|
31
29
|
const ctx = (0, _utils.useStyleContext)(TILE_GROUP_SCOPE);
|
|
32
30
|
return ctx ?? {};
|
|
33
31
|
};
|
|
34
|
-
const TilePrimitive = (0, _primitives.createTile)({
|
|
35
|
-
Pressable: RootPressable,
|
|
36
|
-
Group: GroupView,
|
|
37
|
-
LeadingSlot: _reactNative.View,
|
|
38
|
-
Content: _reactNative.View,
|
|
39
|
-
Title: _reactNative.Text,
|
|
40
|
-
Description: _reactNative.Text,
|
|
41
|
-
Indicator: _reactNative.View,
|
|
42
|
-
TrailingSlot: _reactNative.View
|
|
43
|
-
});
|
|
44
32
|
|
|
45
33
|
// =============================================================================
|
|
46
34
|
// TILE GROUP
|
|
@@ -56,7 +44,7 @@ const TilePrimitive = (0, _primitives.createTile)({
|
|
|
56
44
|
* - `direction="column"` + `spacing="none"` — tight vertical stack (rows touch).
|
|
57
45
|
* - `direction="row"` + `spacing="default"` — side-by-side horizontal layout.
|
|
58
46
|
*
|
|
59
|
-
* `shape` (when set) is propagated to child `Tile`s via `
|
|
47
|
+
* `shape` (when set) is propagated to child `Tile`s via `ParentContext`, matching the
|
|
60
48
|
* Avatar size-propagation pattern. A per-tile `shape` prop overrides the inherited value.
|
|
61
49
|
*/
|
|
62
50
|
|
|
@@ -68,19 +56,31 @@ const TileGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
68
56
|
spacing,
|
|
69
57
|
shape,
|
|
70
58
|
...props
|
|
71
|
-
}, ref) =>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
59
|
+
}, ref) => {
|
|
60
|
+
const parent = (0, _utils.useParentContext)();
|
|
61
|
+
const ctx = (0, _react.useMemo)(() => ({
|
|
62
|
+
...parent,
|
|
63
|
+
[TILE_GROUP_SCOPE]: {
|
|
64
|
+
shape
|
|
65
|
+
}
|
|
66
|
+
}), [parent, shape]);
|
|
67
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
68
|
+
value: ctx,
|
|
69
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.TileGroup, {
|
|
70
|
+
ref: ref,
|
|
71
|
+
className: (0, _utils.cn)((0, _styles3.tileGroupVariants)({
|
|
72
|
+
direction,
|
|
73
|
+
spacing
|
|
74
|
+
}), className),
|
|
75
|
+
style: style,
|
|
76
|
+
...props,
|
|
77
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
78
|
+
slot: 'tile-group'
|
|
79
|
+
})),
|
|
80
|
+
children: children
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
84
|
TileGroup.displayName = 'Tile.Group';
|
|
85
85
|
|
|
86
86
|
// =============================================================================
|
|
@@ -92,7 +92,6 @@ const TileRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
92
92
|
showSeparator,
|
|
93
93
|
className,
|
|
94
94
|
style,
|
|
95
|
-
context,
|
|
96
95
|
...props
|
|
97
96
|
}, ref) => {
|
|
98
97
|
const {
|
|
@@ -103,15 +102,24 @@ const TileRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
103
102
|
shape,
|
|
104
103
|
showSeparator
|
|
105
104
|
}), className);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
...context,
|
|
105
|
+
const parent = (0, _utils.useParentContext)();
|
|
106
|
+
const ctx = (0, _react.useMemo)(() => ({
|
|
107
|
+
...parent,
|
|
108
|
+
[TILE_SCOPE]: {
|
|
111
109
|
shape
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
}
|
|
111
|
+
}), [parent, shape]);
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
113
|
+
value: ctx,
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.TileRoot, {
|
|
115
|
+
ref: ref,
|
|
116
|
+
className: computedClassName,
|
|
117
|
+
style: style,
|
|
118
|
+
...props,
|
|
119
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
120
|
+
slot: 'tile'
|
|
121
|
+
}))
|
|
122
|
+
})
|
|
115
123
|
});
|
|
116
124
|
});
|
|
117
125
|
TileRoot.displayName = 'Tile';
|
|
@@ -120,57 +128,100 @@ TileRoot.displayName = 'Tile';
|
|
|
120
128
|
// SLOTS
|
|
121
129
|
// =============================================================================
|
|
122
130
|
|
|
131
|
+
const leadingSlotStyle = {
|
|
132
|
+
flexShrink: 0
|
|
133
|
+
};
|
|
123
134
|
const TileLeadingSlot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
135
|
+
asChild,
|
|
124
136
|
className,
|
|
125
137
|
style,
|
|
138
|
+
'aria-hidden': ariaHidden,
|
|
126
139
|
...props
|
|
127
|
-
}, ref) =>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
}, ref) => {
|
|
141
|
+
const accessibilityElementsHidden = ariaHidden !== false;
|
|
142
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
143
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
144
|
+
ref: ref,
|
|
145
|
+
accessibilityElementsHidden: accessibilityElementsHidden,
|
|
146
|
+
"aria-hidden": ariaHidden ?? true,
|
|
147
|
+
className: (0, _utils.cn)((0, _styles3.tileLeadingSlotVariants)(), className),
|
|
148
|
+
style: [leadingSlotStyle, style],
|
|
149
|
+
...props,
|
|
150
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
151
|
+
slot: 'tile-leading'
|
|
152
|
+
}))
|
|
153
|
+
});
|
|
154
|
+
});
|
|
133
155
|
TileLeadingSlot.displayName = 'Tile.LeadingSlot';
|
|
156
|
+
const contentStyle = {
|
|
157
|
+
flex: 1,
|
|
158
|
+
flexDirection: 'column',
|
|
159
|
+
minWidth: 0
|
|
160
|
+
};
|
|
134
161
|
const TileContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
162
|
+
asChild,
|
|
135
163
|
className,
|
|
136
164
|
style,
|
|
137
165
|
...props
|
|
138
|
-
}, ref) =>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
166
|
+
}, ref) => {
|
|
167
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
168
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
169
|
+
ref: ref,
|
|
170
|
+
className: (0, _utils.cn)((0, _styles3.tileContentVariants)(), className),
|
|
171
|
+
style: [contentStyle, style],
|
|
172
|
+
...props,
|
|
173
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
174
|
+
slot: 'tile-content'
|
|
175
|
+
}))
|
|
176
|
+
});
|
|
177
|
+
});
|
|
144
178
|
TileContent.displayName = 'Tile.Content';
|
|
179
|
+
const noUnderlineStyle = {
|
|
180
|
+
textDecorationLine: 'none'
|
|
181
|
+
};
|
|
145
182
|
const TileTitle = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
183
|
+
asChild,
|
|
146
184
|
className,
|
|
147
185
|
style,
|
|
148
186
|
numberOfLines = 1,
|
|
149
187
|
...props
|
|
150
|
-
}, ref) =>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
188
|
+
}, ref) => {
|
|
189
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
190
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
191
|
+
ref: ref,
|
|
192
|
+
className: (0, _utils.cn)((0, _styles3.tileTitleVariants)(), className),
|
|
193
|
+
style: [noUnderlineStyle, style],
|
|
194
|
+
numberOfLines: numberOfLines,
|
|
195
|
+
...props,
|
|
196
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
197
|
+
slot: 'tile-title'
|
|
198
|
+
}))
|
|
199
|
+
});
|
|
200
|
+
});
|
|
157
201
|
TileTitle.displayName = 'Tile.Title';
|
|
158
202
|
const TileDescription = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
203
|
+
asChild,
|
|
159
204
|
className,
|
|
160
205
|
style,
|
|
161
206
|
...props
|
|
162
|
-
}, ref) =>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
207
|
+
}, ref) => {
|
|
208
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
209
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
210
|
+
ref: ref,
|
|
211
|
+
className: (0, _utils.cn)((0, _styles3.tileDescriptionVariants)(), className),
|
|
212
|
+
style: [noUnderlineStyle, style],
|
|
213
|
+
...props,
|
|
214
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
215
|
+
slot: 'tile-description'
|
|
216
|
+
}))
|
|
217
|
+
});
|
|
218
|
+
});
|
|
168
219
|
TileDescription.displayName = 'Tile.Description';
|
|
169
220
|
|
|
170
221
|
/**
|
|
171
222
|
* Decorative selection affordance. Renders pure CVA-styled Views — no interactive hooks,
|
|
172
223
|
* no nested Pressable, zero runtime overhead. The Tile root owns the press target and
|
|
173
|
-
* ARIA role; this subtree is `aria-hidden
|
|
224
|
+
* ARIA role; this subtree is `aria-hidden`.
|
|
174
225
|
*
|
|
175
226
|
* The visual is inferred from the tile context: `single` (radio semantics) → radio ring,
|
|
176
227
|
* `multiple` (checkbox semantics) → checkbox square. An explicit `indicatorType` prop
|
|
@@ -211,33 +262,55 @@ function TileIndicatorVisual({
|
|
|
211
262
|
})
|
|
212
263
|
});
|
|
213
264
|
}
|
|
265
|
+
const indicatorStyle = {
|
|
266
|
+
flexShrink: 0,
|
|
267
|
+
pointerEvents: 'none'
|
|
268
|
+
};
|
|
214
269
|
const TileIndicator = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
270
|
+
asChild,
|
|
215
271
|
className,
|
|
216
272
|
children,
|
|
217
273
|
style,
|
|
218
274
|
indicatorType,
|
|
219
275
|
...props
|
|
220
|
-
}, ref) =>
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
276
|
+
}, ref) => {
|
|
277
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
278
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
279
|
+
ref: ref,
|
|
280
|
+
accessibilityElementsHidden: true,
|
|
281
|
+
"aria-hidden": true,
|
|
282
|
+
className: (0, _utils.cn)((0, _styles3.tileIndicatorVariants)(), className),
|
|
283
|
+
style: [indicatorStyle, style],
|
|
284
|
+
...props,
|
|
285
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
286
|
+
slot: 'tile-indicator'
|
|
287
|
+
})),
|
|
288
|
+
children: children ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(TileIndicatorVisual, {
|
|
289
|
+
indicatorType: indicatorType
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
});
|
|
230
293
|
TileIndicator.displayName = 'Tile.Indicator';
|
|
294
|
+
const trailingSlotStyle = {
|
|
295
|
+
flexShrink: 0
|
|
296
|
+
};
|
|
231
297
|
const TileTrailingSlot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
298
|
+
asChild,
|
|
232
299
|
className,
|
|
233
300
|
style,
|
|
234
301
|
...props
|
|
235
|
-
}, ref) =>
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
302
|
+
}, ref) => {
|
|
303
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
304
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
305
|
+
ref: ref,
|
|
306
|
+
className: (0, _utils.cn)((0, _styles3.tileTrailingSlotVariants)(), className),
|
|
307
|
+
style: [trailingSlotStyle, style],
|
|
308
|
+
...props,
|
|
309
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
310
|
+
slot: 'tile-trailing'
|
|
311
|
+
}))
|
|
312
|
+
});
|
|
313
|
+
});
|
|
241
314
|
TileTrailingSlot.displayName = 'Tile.TrailingSlot';
|
|
242
315
|
const Tile = exports.Tile = Object.assign(TileRoot, {
|
|
243
316
|
Group: TileGroup,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_primitives","_icons","_utils","_styles","_Icon","_styles2","_styles3","_jsxRuntime","TILE_SCOPE","TILE_GROUP_SCOPE","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_icons","_utils","_styles","_Icon","_styles2","_styles3","_jsxRuntime","TILE_SCOPE","TILE_GROUP_SCOPE","useTileGroupStyleContext","ctx","useStyleContext","TileGroup","forwardRef","className","style","children","direction","spacing","shape","props","ref","parent","useParentContext","useMemo","jsx","ParentContext","Provider","value","cn","tileGroupVariants","mergeDataAttributes","dataAttributes","slot","displayName","TileRoot","shapeProp","showSeparator","inheritedShape","computedClassName","tileRootVariants","leadingSlotStyle","flexShrink","TileLeadingSlot","asChild","ariaHidden","accessibilityElementsHidden","Comp","Slot","View","tileLeadingSlotVariants","contentStyle","flex","flexDirection","minWidth","TileContent","tileContentVariants","noUnderlineStyle","textDecorationLine","TileTitle","numberOfLines","Text","tileTitleVariants","TileDescription","tileDescriptionVariants","TileIndicatorVisual","indicatorType","isSelected","isDisabled","selectionType","useTileContext","effectiveType","stateAttrs","checked","disabled","radioIndicatorVariants","radioInnerDotVariants","invalid","checkboxIndicatorVariants","Icon","as","Check","checkboxIconVariants","indicatorStyle","pointerEvents","TileIndicator","tileIndicatorVariants","trailingSlotStyle","TileTrailingSlot","tileTrailingSlotVariants","Tile","exports","Object","assign","Group","LeadingSlot","Content","Title","Description","Indicator","TrailingSlot"],"sourceRoot":"../../../../src","sources":["components/Tile/index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;A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AChBuC,WAAW,EAAEnC,eAAe;EAC5BoC,SAAS,EAAEd,aAAa;EACxBe,YAAY,EAAEZ;AAChB,CAAC,CAAiB","ignoreList":[]}
|
|
@@ -60,9 +60,9 @@ var _default = exports.default = {
|
|
|
60
60
|
<Chip variant="${variant}" size="${size}" color="${color}"${disabledProp}>
|
|
61
61
|
${showAvatar ? _figma.default.code`<Chip.Avatar>
|
|
62
62
|
<Avatar.Image source={{ uri: '...' }} />
|
|
63
|
-
</Chip.Avatar>` : showLeadingIcon ? _figma.default.code`<Chip.Icon as={${leadingIconSnippet}}
|
|
63
|
+
</Chip.Avatar>` : showLeadingIcon ? _figma.default.code`<Chip.Icon as={${leadingIconSnippet}} position="leading" />` : null}
|
|
64
64
|
<Chip.Label>${label}</Chip.Label>
|
|
65
|
-
${showTrailingIcon ? _figma.default.code`<Chip.Icon as={${trailingIconSnippet}}
|
|
65
|
+
${showTrailingIcon ? _figma.default.code`<Chip.Icon as={${trailingIconSnippet}} position="trailing" />` : null}
|
|
66
66
|
</Chip>`
|
|
67
67
|
};
|
|
68
68
|
//# sourceMappingURL=Chip.figma.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","variant","getEnum","tint","outline","size","small","xsmall","color","action","danger","warning","success","info","isDisabled","true","false","undefined","disabledProp","helpers","react","renderProp","showLeadingIcon","getBoolean","showAvatar","showTrailingIcon","leadingIconResult","getInstanceSwap","executeTemplate","trailingIconResult","leadingIconName","metadata","props","componentName","trailingIconName","leadingIconSnippet","example","trailingIconSnippet","label","findText","textContent","iconImports","push","avatarImport","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Chip.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OA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eAAe,CAAC,mBAAmB,CAAC,EAAEC,eAAe,CAAC,CAAC,GAChEX,SAAS;AAEb,MAAMa,eAAe,GAAGJ,iBAAiB,EAAEK,QAAQ,EAAEC,KAAK,EAAEC,aAAmC;AAC/F,MAAMC,gBAAgB,GAAGL,kBAAkB,EAAEE,QAAQ,EAAEC,KAAK,EAAEC,aAAmC;AACjG,MAAME,kBAAkB,GAAGL,eAAe,IAAIJ,iBAAiB,EAAEU,OAAO;AACxE,MAAMC,mBAAmB,GAAGH,gBAAgB,IAAIL,kBAAkB,EAAEO,OAAO;AAE3E,MAAME,KAAK,GAAIxC,QAAQ,CAACyC,QAAQ,CAAC,YAAY,CAAC,CAAgCC,WAAW;AAEzF,MAAMC,WAAqB,GAAG,EAAE;AAChC,IAAInB,eAAe,IAAI,CAACE,UAAU,IAAIM,eAAe,EAAE;EACrDW,WAAW,CAACC,IAAI,CAAC,YAAYZ,eAAe,yBAAyB,CAAC;AACxE;AACA,IAAIL,gBAAgB,IAAIS,gBAAgB,EAAE;EACxCO,WAAW,CAACC,IAAI,CAAC,YAAYR,gBAAgB,yBAAyB,CAAC;AACzE;AACA,MAAMS,YAAY,GAAGnB,UAAU,GAAG,CAAC,6CAA6C,CAAC,GAAG,EAAE;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAhD,OAAA,GAExE;EACbiD,EAAE,EAAE,MAAM;EACVC,OAAO,EAAE,CAAC,2CAA2C,EAAE,GAAGJ,YAAY,EAAE,GAAGF,WAAW,CAAC;EACvFL,OAAO,EAAErC,cAAK,CAACiD,IAAI;AACrB,iBAAiB/C,OAAO,WAAWI,IAAI,YAAYG,KAAK,IAAIU,YAAY;AACxE,IACIM,UAAU,GACNzB,cAAK,CAACiD,IAAI;AAClB;AACA,iBAAiB,GACT1B,eAAe,GACbvB,cAAK,CAACiD,IAAI,kBAAkBb,kBAAkB,
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","variant","getEnum","tint","outline","size","small","xsmall","color","action","danger","warning","success","info","isDisabled","true","false","undefined","disabledProp","helpers","react","renderProp","showLeadingIcon","getBoolean","showAvatar","showTrailingIcon","leadingIconResult","getInstanceSwap","executeTemplate","trailingIconResult","leadingIconName","metadata","props","componentName","trailingIconName","leadingIconSnippet","example","trailingIconSnippet","label","findText","textContent","iconImports","push","avatarImport","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Chip.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,OAAO,GAAGH,QAAQ,CAACI,OAAO,CAAC,SAAS,EAAE;EAC1CC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE;AACX,CAAC,CAAC;AACF,MAAMC,IAAI,GAAGP,QAAQ,CAACI,OAAO,CAAC,MAAM,EAAE;EACpCL,OAAO,EAAE,SAAS;EAClBS,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACV,CAAC,CAAC;AACF,MAAMC,KAAK,GAAGV,QAAQ,CAACI,OAAO,CAAC,OAAO,EAAE;EACtCL,OAAO,EAAE,SAAS;EAClBY,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE;AACR,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGhB,QAAQ,CAACI,OAAO,CAAC,YAAY,EAAE;EAChDa,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,YAAY,GAAGnB,cAAK,CAACoB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,UAAU,EA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