@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
|
@@ -65,19 +65,6 @@ var _utils = require("@cdx-ui/utils");
|
|
|
65
65
|
var _styles = require("./styles");
|
|
66
66
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
67
67
|
const SCOPE = 'LIST_ITEM';
|
|
68
|
-
const RootView = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
69
|
-
const RootPressable = (0, _utils.withStyleContext)(_reactNative.Pressable, SCOPE);
|
|
70
|
-
const ListItemPrimitive = (0, _primitives.createListItem)({
|
|
71
|
-
View: RootView,
|
|
72
|
-
Pressable: RootPressable,
|
|
73
|
-
LeadingSlot: _reactNative.View,
|
|
74
|
-
Content: _reactNative.View,
|
|
75
|
-
Title: _reactNative.Text,
|
|
76
|
-
Description: _reactNative.Text,
|
|
77
|
-
Meta: _reactNative.Text,
|
|
78
|
-
TrailingSlot: _reactNative.View,
|
|
79
|
-
SectionHeader: _reactNative.View
|
|
80
|
-
});
|
|
81
68
|
const useListItemStyleContext = () => {
|
|
82
69
|
const ctx = (0, _utils.useStyleContext)(SCOPE);
|
|
83
70
|
return {
|
|
@@ -92,27 +79,36 @@ const useListItemStyleContext = () => {
|
|
|
92
79
|
const ListItemRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
93
80
|
size = 'default',
|
|
94
81
|
showSeparator = true,
|
|
95
|
-
crossAlign = 'center',
|
|
82
|
+
crossAlign: crossAlignProp = 'center',
|
|
96
83
|
className,
|
|
97
84
|
style,
|
|
98
85
|
...props
|
|
99
86
|
}, ref) => {
|
|
87
|
+
const crossAlign = crossAlignProp ?? 'center';
|
|
88
|
+
const parent = (0, _utils.useParentContext)();
|
|
89
|
+
const ctx = (0, _react.useMemo)(() => ({
|
|
90
|
+
...parent,
|
|
91
|
+
[SCOPE]: {
|
|
92
|
+
crossAlign
|
|
93
|
+
}
|
|
94
|
+
}), [parent, crossAlign]);
|
|
100
95
|
const computedClassName = (0, _utils.cn)((0, _styles.listItemRootVariants)({
|
|
101
96
|
size,
|
|
102
97
|
showSeparator,
|
|
103
98
|
crossAlign
|
|
104
99
|
}), className);
|
|
105
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
100
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
101
|
+
value: ctx,
|
|
102
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ListItemRoot, {
|
|
103
|
+
ref: ref,
|
|
104
|
+
className: computedClassName,
|
|
105
|
+
crossAlign: crossAlign,
|
|
106
|
+
style: style,
|
|
107
|
+
...props,
|
|
108
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
109
|
+
slot: 'list-item'
|
|
110
|
+
}))
|
|
111
|
+
})
|
|
116
112
|
});
|
|
117
113
|
});
|
|
118
114
|
ListItemRoot.displayName = 'ListItem';
|
|
@@ -121,18 +117,38 @@ ListItemRoot.displayName = 'ListItem';
|
|
|
121
117
|
// SLOTS & TEXT
|
|
122
118
|
// =============================================================================
|
|
123
119
|
|
|
120
|
+
const leadingSlotStyle = {
|
|
121
|
+
flexShrink: 0
|
|
122
|
+
};
|
|
124
123
|
const ListItemLeadingSlot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
124
|
+
asChild,
|
|
125
125
|
className,
|
|
126
126
|
style,
|
|
127
|
+
'aria-hidden': ariaHidden,
|
|
127
128
|
...props
|
|
128
|
-
}, ref) =>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
}, ref) => {
|
|
130
|
+
const accessibilityElementsHidden = ariaHidden !== false;
|
|
131
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
132
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
133
|
+
ref: ref,
|
|
134
|
+
accessibilityElementsHidden: accessibilityElementsHidden,
|
|
135
|
+
"aria-hidden": ariaHidden ?? true,
|
|
136
|
+
className: (0, _utils.cn)((0, _styles.listItemLeadingSlotVariants)(), className),
|
|
137
|
+
style: [leadingSlotStyle, style],
|
|
138
|
+
...props,
|
|
139
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
140
|
+
slot: 'list-item-leading'
|
|
141
|
+
}))
|
|
142
|
+
});
|
|
143
|
+
});
|
|
134
144
|
ListItemLeadingSlot.displayName = 'ListItem.LeadingSlot';
|
|
145
|
+
const contentStyle = {
|
|
146
|
+
flex: 1,
|
|
147
|
+
flexDirection: 'column',
|
|
148
|
+
minWidth: 0
|
|
149
|
+
};
|
|
135
150
|
const ListItemContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
151
|
+
asChild,
|
|
136
152
|
className,
|
|
137
153
|
style,
|
|
138
154
|
...props
|
|
@@ -140,60 +156,80 @@ const ListItemContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
140
156
|
const {
|
|
141
157
|
crossAlign
|
|
142
158
|
} = useListItemStyleContext();
|
|
143
|
-
|
|
159
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
160
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
144
161
|
ref: ref,
|
|
145
162
|
className: (0, _utils.cn)((0, _styles.listItemContentVariants)({
|
|
146
163
|
crossAlign
|
|
147
164
|
}), className),
|
|
148
|
-
style: style,
|
|
149
|
-
...props
|
|
165
|
+
style: [contentStyle, style],
|
|
166
|
+
...props,
|
|
167
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
168
|
+
slot: 'list-item-content'
|
|
169
|
+
}))
|
|
150
170
|
});
|
|
151
171
|
});
|
|
152
172
|
ListItemContent.displayName = 'ListItem.Content';
|
|
153
173
|
const ListItemTitle = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
174
|
+
asChild,
|
|
154
175
|
className,
|
|
155
176
|
numberOfLines = 1,
|
|
156
177
|
style,
|
|
157
178
|
...props
|
|
158
179
|
}, ref) => {
|
|
159
|
-
|
|
180
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
181
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
160
182
|
ref: ref,
|
|
161
183
|
className: (0, _utils.cn)((0, _styles.listItemTitleVariants)(), className),
|
|
162
184
|
numberOfLines: numberOfLines,
|
|
163
185
|
style: style,
|
|
164
|
-
...props
|
|
186
|
+
...props,
|
|
187
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
188
|
+
slot: 'list-item-title'
|
|
189
|
+
}))
|
|
165
190
|
});
|
|
166
191
|
});
|
|
167
192
|
ListItemTitle.displayName = 'ListItem.Title';
|
|
168
193
|
const ListItemDescription = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
194
|
+
asChild,
|
|
169
195
|
className,
|
|
170
196
|
style,
|
|
171
197
|
...props
|
|
172
198
|
}, ref) => {
|
|
173
|
-
|
|
199
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
200
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
174
201
|
ref: ref,
|
|
175
202
|
className: (0, _utils.cn)((0, _styles.listItemDescriptionVariants)(), className),
|
|
176
203
|
style: style,
|
|
177
|
-
...props
|
|
204
|
+
...props,
|
|
205
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
206
|
+
slot: 'list-item-description'
|
|
207
|
+
}))
|
|
178
208
|
});
|
|
179
209
|
});
|
|
180
210
|
ListItemDescription.displayName = 'ListItem.Description';
|
|
181
211
|
const ListItemMeta = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
212
|
+
asChild,
|
|
182
213
|
className,
|
|
183
214
|
numberOfLines = 1,
|
|
184
215
|
style,
|
|
185
216
|
...props
|
|
186
217
|
}, ref) => {
|
|
187
|
-
|
|
218
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.Text;
|
|
219
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
188
220
|
ref: ref,
|
|
189
221
|
className: (0, _utils.cn)((0, _styles.listItemMetaVariants)(), className),
|
|
190
222
|
numberOfLines: numberOfLines,
|
|
191
223
|
style: style,
|
|
192
|
-
...props
|
|
224
|
+
...props,
|
|
225
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
226
|
+
slot: 'list-item-meta'
|
|
227
|
+
}))
|
|
193
228
|
});
|
|
194
229
|
});
|
|
195
230
|
ListItemMeta.displayName = 'ListItem.Meta';
|
|
196
231
|
const ListItemTrailingSlot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
232
|
+
asChild,
|
|
197
233
|
className,
|
|
198
234
|
style,
|
|
199
235
|
...props
|
|
@@ -201,13 +237,19 @@ const ListItemTrailingSlot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
201
237
|
const {
|
|
202
238
|
crossAlign
|
|
203
239
|
} = useListItemStyleContext();
|
|
204
|
-
|
|
240
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
241
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
205
242
|
ref: ref,
|
|
206
243
|
className: (0, _utils.cn)((0, _styles.listItemTrailingSlotVariants)({
|
|
207
244
|
crossAlign
|
|
208
245
|
}), className),
|
|
209
|
-
style:
|
|
210
|
-
|
|
246
|
+
style: [{
|
|
247
|
+
flexShrink: 0
|
|
248
|
+
}, style],
|
|
249
|
+
...props,
|
|
250
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
251
|
+
slot: 'list-item-trailing'
|
|
252
|
+
}))
|
|
211
253
|
});
|
|
212
254
|
});
|
|
213
255
|
ListItemTrailingSlot.displayName = 'ListItem.TrailingSlot';
|
|
@@ -225,24 +267,57 @@ const wrapSectionHeaderLabel = children => {
|
|
|
225
267
|
// SECTION HEADER
|
|
226
268
|
// =============================================================================
|
|
227
269
|
|
|
270
|
+
// TODO: ListItem.SectionHeader doesn't follow composition patterns (composing text, trailing prop, etc).
|
|
271
|
+
|
|
272
|
+
const sectionHeaderRow = {
|
|
273
|
+
flexDirection: 'row',
|
|
274
|
+
alignItems: 'center',
|
|
275
|
+
justifyContent: 'space-between',
|
|
276
|
+
gap: 8
|
|
277
|
+
};
|
|
278
|
+
const sectionHeaderLabelCell = {
|
|
279
|
+
flex: 1,
|
|
280
|
+
minWidth: 0,
|
|
281
|
+
/** Keeps the label column from stretching to a taller trailing sibling (e.g. Chip). */
|
|
282
|
+
alignSelf: 'center'
|
|
283
|
+
};
|
|
284
|
+
const sectionHeaderTrailingCell = {
|
|
285
|
+
flexShrink: 0,
|
|
286
|
+
/** Prevents the trailing slot from stretching vertically and “filling” the row. */
|
|
287
|
+
alignSelf: 'center'
|
|
288
|
+
};
|
|
228
289
|
const ListItemSectionHeader = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
290
|
+
asChild,
|
|
229
291
|
children,
|
|
230
292
|
className,
|
|
231
293
|
showDivider = true,
|
|
232
294
|
style,
|
|
233
295
|
trailing,
|
|
296
|
+
accessibilityRole = 'header',
|
|
234
297
|
...props
|
|
235
|
-
}, ref) =>
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
298
|
+
}, ref) => {
|
|
299
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
300
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Comp, {
|
|
301
|
+
ref: ref,
|
|
302
|
+
accessibilityRole: accessibilityRole,
|
|
303
|
+
className: (0, _utils.cn)((0, _styles.listItemSectionHeaderVariants)({
|
|
304
|
+
showDivider
|
|
305
|
+
}), className),
|
|
306
|
+
style: [sectionHeaderRow, style],
|
|
307
|
+
...props,
|
|
308
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
309
|
+
slot: 'list-section-header',
|
|
310
|
+
divider: showDivider
|
|
311
|
+
})),
|
|
312
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
313
|
+
style: sectionHeaderLabelCell,
|
|
314
|
+
children: wrapSectionHeaderLabel(children)
|
|
315
|
+
}), trailing ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
316
|
+
style: sectionHeaderTrailingCell,
|
|
317
|
+
children: trailing
|
|
318
|
+
}) : null]
|
|
319
|
+
});
|
|
320
|
+
});
|
|
246
321
|
ListItemSectionHeader.displayName = 'ListItem.SectionHeader';
|
|
247
322
|
|
|
248
323
|
// =============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","SCOPE","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","SCOPE","useListItemStyleContext","ctx","useStyleContext","crossAlign","ListItemRoot","forwardRef","size","showSeparator","crossAlignProp","className","style","props","ref","parent","useParentContext","useMemo","computedClassName","cn","listItemRootVariants","jsx","ParentContext","Provider","value","children","mergeDataAttributes","dataAttributes","slot","displayName","leadingSlotStyle","flexShrink","ListItemLeadingSlot","asChild","ariaHidden","accessibilityElementsHidden","Comp","Slot","View","listItemLeadingSlotVariants","contentStyle","flex","flexDirection","minWidth","ListItemContent","listItemContentVariants","ListItemTitle","numberOfLines","Text","listItemTitleVariants","ListItemDescription","listItemDescriptionVariants","ListItemMeta","listItemMetaVariants","ListItemTrailingSlot","listItemTrailingSlotVariants","wrapSectionHeaderLabel","listItemSectionHeaderLabelVariants","sectionHeaderRow","alignItems","justifyContent","gap","sectionHeaderLabelCell","alignSelf","sectionHeaderTrailingCell","ListItemSectionHeader","showDivider","trailing","accessibilityRole","jsxs","listItemSectionHeaderVariants","divider","ListItem","exports","Object","assign","LeadingSlot","Content","Title","Description","Meta","TrailingSlot","SectionHeader"],"sourceRoot":"../../../../src","sources":["components/ListItem/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,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Q,gBAAG,IAAAnE,WAAA,CAAAqB,GAAA,EAACzB,YAAA,CAAA0C,IAAI;MAAC1B,KAAK,EAAEoD,yBAA0B;MAAAvC,QAAA,EAAE0C;IAAQ,CAAO,CAAC,GAAG,IAAI;EAAA,CACxE,CAAC;AAEX,CACF,CAAC;AAEDF,qBAAqB,CAACpC,WAAW,GAAG,wBAAwB;;AAE5D;AACA;AACA;;AAYO,MAAM2C,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAACC,MAAM,CAACrE,YAAY,EAAE;EAClDsE,WAAW,EAAE5C,mBAAmB;EAChC6C,OAAO,EAAEjC,eAAe;EACxBkC,KAAK,EAAEhC,aAAa;EACpBiC,WAAW,EAAE7B,mBAAmB;EAChC8B,IAAI,EAAE5B,YAAY;EAClB6B,YAAY,EAAE3B,oBAAoB;EAClC4B,aAAa,EAAEjB;AACjB,CAAC,CAAqB","ignoreList":[]}
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.OtpInput = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
8
9
|
var _primitives = require("@cdx-ui/primitives");
|
|
9
10
|
var _utils = require("@cdx-ui/utils");
|
|
10
|
-
var _HStack = require("../Stack/HStack");
|
|
11
11
|
var _Input = require("../Input");
|
|
12
|
-
var _styles = require("
|
|
12
|
+
var _styles = require("../Input/styles");
|
|
13
|
+
var _styles2 = require("./styles");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
const SCOPE = 'OTP_INPUT';
|
|
15
|
-
const OtpRoot = (0, _utils.withStyleContext)(_HStack.HStack, SCOPE);
|
|
16
16
|
const useOtpInputStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
17
17
|
const OtpStyledCell = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
18
18
|
className,
|
|
@@ -27,7 +27,7 @@ const OtpStyledCell = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
27
27
|
ref: ref,
|
|
28
28
|
variant: variant,
|
|
29
29
|
size: size,
|
|
30
|
-
className: (0, _utils.cn)((0,
|
|
30
|
+
className: (0, _utils.cn)((0, _styles2.otpCellVariants)({
|
|
31
31
|
size
|
|
32
32
|
}), className),
|
|
33
33
|
...props,
|
|
@@ -35,48 +35,114 @@ const OtpStyledCell = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
OtpStyledCell.displayName = 'OtpInput.Cell';
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Bridges OtpInputField focus/blur events to the parent Input's context so
|
|
41
|
+
* InputRoot emits `data-focus=true` and the `border-stroke-action` CSS activates.
|
|
42
|
+
* The primitive OtpInputField doesn't know about InputContext — that coupling
|
|
43
|
+
* belongs here in the styled layer.
|
|
44
|
+
*/
|
|
45
|
+
const OtpStyledField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
42
46
|
const {
|
|
43
|
-
|
|
44
|
-
} =
|
|
45
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
47
|
+
setIsFocused
|
|
48
|
+
} = (0, _primitives.useInputContext)();
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.OtpInputField, {
|
|
46
50
|
ref: ref,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
...props,
|
|
52
|
+
onFocus: e => {
|
|
53
|
+
setIsFocused?.(true);
|
|
54
|
+
props.onFocus?.(e);
|
|
55
|
+
},
|
|
56
|
+
onBlur: e => {
|
|
57
|
+
setIsFocused?.(false);
|
|
58
|
+
props.onBlur?.(e);
|
|
59
|
+
}
|
|
51
60
|
});
|
|
52
61
|
});
|
|
53
62
|
OtpStyledField.displayName = 'OtpInput.Field';
|
|
54
|
-
const OtpPrimitive = (0, _primitives.createOtpInput)({
|
|
55
|
-
Root: OtpRoot,
|
|
56
|
-
Cell: OtpStyledCell,
|
|
57
|
-
Field: OtpStyledField
|
|
58
|
-
});
|
|
59
63
|
const OtpInput = exports.OtpInput = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
60
64
|
variant = 'outline',
|
|
61
65
|
size = 'default',
|
|
62
66
|
fullWidth = true,
|
|
63
67
|
className,
|
|
64
68
|
style,
|
|
69
|
+
cellCount,
|
|
70
|
+
value,
|
|
71
|
+
onChangeText,
|
|
72
|
+
onComplete,
|
|
73
|
+
isDisabled,
|
|
74
|
+
isInvalid,
|
|
75
|
+
isReadOnly,
|
|
76
|
+
smsOtpAutofill,
|
|
77
|
+
filterInput,
|
|
78
|
+
allowedCharacters,
|
|
79
|
+
characterPattern,
|
|
80
|
+
getCellProps,
|
|
81
|
+
cellTestIdPrefix,
|
|
82
|
+
accessibilityLabel,
|
|
65
83
|
...rest
|
|
66
84
|
}, ref) => {
|
|
67
|
-
const
|
|
85
|
+
const otpContext = (0, _primitives.useOtpInput)({
|
|
86
|
+
cellCount,
|
|
87
|
+
value,
|
|
88
|
+
onChangeText,
|
|
89
|
+
onComplete,
|
|
90
|
+
isDisabled,
|
|
91
|
+
isInvalid,
|
|
92
|
+
isReadOnly,
|
|
93
|
+
smsOtpAutofill,
|
|
94
|
+
filterInput,
|
|
95
|
+
allowedCharacters,
|
|
96
|
+
characterPattern,
|
|
97
|
+
getCellProps,
|
|
98
|
+
cellTestIdPrefix,
|
|
99
|
+
accessibilityLabel
|
|
100
|
+
});
|
|
101
|
+
const rootClassName = (0, _utils.cn)((0, _styles2.otpRootVariants)({
|
|
68
102
|
size,
|
|
69
103
|
fullWidth
|
|
70
104
|
}), className);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
context: {
|
|
105
|
+
const parent = (0, _utils.useParentContext)();
|
|
106
|
+
const ctx = (0, _react.useMemo)(() => ({
|
|
107
|
+
...parent,
|
|
108
|
+
[SCOPE]: {
|
|
76
109
|
variant,
|
|
77
110
|
size
|
|
78
|
-
}
|
|
79
|
-
|
|
111
|
+
}
|
|
112
|
+
}), [parent, variant, size]);
|
|
113
|
+
const fieldClassName = (0, _utils.cn)((0, _styles.inputFieldVariants)({
|
|
114
|
+
size
|
|
115
|
+
}), (0, _styles2.otpFieldVariants)({
|
|
116
|
+
size
|
|
117
|
+
}));
|
|
118
|
+
const cells = [];
|
|
119
|
+
for (let i = 0; i < cellCount; i++) {
|
|
120
|
+
cells.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.OtpCellIndexProvider, {
|
|
121
|
+
value: {
|
|
122
|
+
cellIndex: i
|
|
123
|
+
},
|
|
124
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OtpStyledCell, {
|
|
125
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OtpStyledField, {
|
|
126
|
+
className: fieldClassName
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
}, i));
|
|
130
|
+
}
|
|
131
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
132
|
+
value: ctx,
|
|
133
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.OtpInputProvider, {
|
|
134
|
+
value: otpContext,
|
|
135
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
136
|
+
ref: ref,
|
|
137
|
+
className: rootClassName,
|
|
138
|
+
style: style,
|
|
139
|
+
...rest,
|
|
140
|
+
...(0, _primitives.mergeDataAttributes)(rest, (0, _primitives.dataAttributes)({
|
|
141
|
+
slot: 'otp-input'
|
|
142
|
+
})),
|
|
143
|
+
children: cells
|
|
144
|
+
})
|
|
145
|
+
})
|
|
80
146
|
});
|
|
81
147
|
});
|
|
82
148
|
OtpInput.displayName = 'OtpInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_Input","_styles","_styles2","_jsxRuntime","SCOPE","useOtpInputStyleContext","useStyleContext","OtpStyledCell","forwardRef","className","children","props","ref","size","variant","jsx","Input","cn","otpCellVariants","displayName","OtpStyledField","setIsFocused","useInputContext","OtpInputField","onFocus","e","onBlur","OtpInput","exports","fullWidth","style","cellCount","value","onChangeText","onComplete","isDisabled","isInvalid","isReadOnly","smsOtpAutofill","filterInput","allowedCharacters","characterPattern","getCellProps","cellTestIdPrefix","accessibilityLabel","rest","otpContext","useOtpInput","rootClassName","otpRootVariants","parent","useParentContext","ctx","useMemo","fieldClassName","inputFieldVariants","otpFieldVariants","cells","i","push","OtpCellIndexProvider","cellIndex","ParentContext","Provider","OtpInputProvider","View","mergeDataAttributes","dataAttributes","slot"],"sourceRoot":"../../../../src","sources":["components/OtpInput/index.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAWA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKkB,IAAAO,WAAA,GAAAP,OAAA;AAElB,MAAMQ,KAAK,GAAG,WAAW;AAEzB,MAAMC,uBAAuB,GAAGA,CAAA,KAAM,IAAAC,sBAAe,EAACF,KAAK,CAAsB;AAEjF,MAAMG,aAAa,gBAAG,IAAAC,iBAAU,EAG9B,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAuB,KAAK;EAChE,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGT,uBAAuB,CAAC,CAAC;EACnD,oBACE,IAAAF,WAAA,CAAAY,GAAA,EAACf,MAAA,CAAAgB,KAAK;IACJJ,GAAG,EAAEA,GAA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e,CAAE;MAAC,CAChC;IAAC,GAHSI,CAIL,CACxB,CAAC;EACH;EAEA,oBACE,IAAAvD,WAAA,CAAAY,GAAA,EAAChB,MAAA,CAAA+D,aAAa,CAACC,QAAQ;IAAC/B,KAAK,EAAEoB,GAAI;IAAA1C,QAAA,eACjC,IAAAP,WAAA,CAAAY,GAAA,EAACjB,WAAA,CAAAkE,gBAAgB;MAAChC,KAAK,EAAEc,UAAW;MAAApC,QAAA,eAClC,IAAAP,WAAA,CAAAY,GAAA,EAAClB,YAAA,CAAAoE,IAAI;QACHrD,GAAG,EAAEA,GAAI;QACTH,SAAS,EAAEuC,aAAc;QACzBlB,KAAK,EAAEA,KAAM;QAAA,GACTe,IAAI;QAAA,GACJ,IAAAqB,+BAAmB,EAACrB,IAAI,EAAE,IAAAsB,0BAAc,EAAC;UAAEC,IAAI,EAAE;QAAY,CAAC,CAAC,CAAC;QAAA1D,QAAA,EAEnE+C;MAAK,CACF;IAAC,CACS;EAAC,CACG,CAAC;AAE7B,CACF,CAAC;AAED9B,QAAQ,CAACR,WAAW,GAAG,UAAU","ignoreList":[]}
|
|
@@ -5,41 +5,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ProgressBar = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
8
|
var _primitives = require("@cdx-ui/primitives");
|
|
10
9
|
var _utils = require("@cdx-ui/utils");
|
|
11
10
|
var _styles = require("./styles");
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
const
|
|
14
|
-
Root: _reactNative.View,
|
|
15
|
-
Indicator: _reactNative.View
|
|
16
|
-
});
|
|
17
|
-
const ProgressBarRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
12
|
+
const ProgressBarRootComponent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
18
13
|
className,
|
|
19
14
|
style,
|
|
20
15
|
...props
|
|
21
16
|
}, ref) => {
|
|
22
17
|
const trackClass = (0, _utils.cn)((0, _styles.progressBarTrackVariants)(), className);
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ProgressBarRoot, {
|
|
24
19
|
ref: ref,
|
|
25
20
|
className: trackClass,
|
|
26
21
|
style: style,
|
|
27
22
|
...props
|
|
28
23
|
});
|
|
29
24
|
});
|
|
30
|
-
|
|
31
|
-
const
|
|
25
|
+
ProgressBarRootComponent.displayName = 'ProgressBar';
|
|
26
|
+
const ProgressBarIndicatorComponent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
32
27
|
className,
|
|
33
28
|
style,
|
|
34
29
|
...props
|
|
35
|
-
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
30
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ProgressBarIndicator, {
|
|
36
31
|
ref: ref,
|
|
37
32
|
className: (0, _utils.cn)((0, _styles.progressBarIndicatorVariants)(), className),
|
|
38
33
|
style: style,
|
|
39
34
|
...props
|
|
40
35
|
}));
|
|
41
|
-
|
|
42
|
-
const ProgressBar = exports.ProgressBar = Object.assign(
|
|
43
|
-
Indicator:
|
|
36
|
+
ProgressBarIndicatorComponent.displayName = 'ProgressBar.Indicator';
|
|
37
|
+
const ProgressBar = exports.ProgressBar = Object.assign(ProgressBarRootComponent, {
|
|
38
|
+
Indicator: ProgressBarIndicatorComponent
|
|
44
39
|
});
|
|
45
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","
|
|
1
|
+
{"version":3,"names":["_react","require","_primitives","_utils","_styles","_jsxRuntime","ProgressBarRootComponent","forwardRef","className","style","props","ref","trackClass","cn","progressBarTrackVariants","jsx","ProgressBarRoot","displayName","ProgressBarIndicatorComponent","ProgressBarIndicator","progressBarIndicatorVariants","ProgressBar","exports","Object","assign","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