@cdx-ui/components 0.0.1-alpha.34 → 0.0.1-alpha.36
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/{Form/FormLabelRoot.js → Field/FieldLabel.js} +4 -4
- package/lib/commonjs/components/Field/FieldLabel.js.map +1 -0
- package/lib/commonjs/components/{Form/FormLabelRoot.web.js → Field/FieldLabel.web.js} +9 -5
- package/lib/commonjs/components/Field/FieldLabel.web.js.map +1 -0
- package/lib/commonjs/components/Field/index.js +158 -0
- package/lib/commonjs/components/Field/index.js.map +1 -0
- package/lib/commonjs/components/Field/styles.js +16 -0
- package/lib/commonjs/components/Field/styles.js.map +1 -0
- package/lib/commonjs/components/Form/FormRoot.js.map +1 -1
- package/lib/commonjs/components/Form/index.js +6 -213
- package/lib/commonjs/components/Form/index.js.map +1 -1
- package/lib/commonjs/components/Form/styles.js +1 -49
- package/lib/commonjs/components/Form/styles.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +45 -0
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/styles.js +10 -0
- package/lib/commonjs/components/ProgressBar/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/styles.js +5 -5
- package/lib/commonjs/components/ProgressSegmented/styles.js.map +1 -1
- package/lib/commonjs/components/index.js +24 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/{Form/FormLabelRoot.js → Field/FieldLabel.js} +3 -3
- package/lib/module/components/Field/FieldLabel.js.map +1 -0
- package/lib/module/components/Field/FieldLabel.web.js +17 -0
- package/lib/module/components/Field/FieldLabel.web.js.map +1 -0
- package/lib/module/components/Field/index.js +155 -0
- package/lib/module/components/Field/index.js.map +1 -0
- package/lib/module/components/Field/styles.js +12 -0
- package/lib/module/components/Field/styles.js.map +1 -0
- package/lib/module/components/Form/FormRoot.js.map +1 -1
- package/lib/module/components/Form/index.js +8 -216
- package/lib/module/components/Form/index.js.map +1 -1
- package/lib/module/components/Form/styles.js +0 -48
- package/lib/module/components/Form/styles.js.map +1 -1
- package/lib/module/components/ProgressBar/index.js +41 -0
- package/lib/module/components/ProgressBar/index.js.map +1 -0
- package/lib/module/components/ProgressBar/styles.js +6 -0
- package/lib/module/components/ProgressBar/styles.js.map +1 -0
- package/lib/module/components/ProgressSegmented/styles.js +5 -5
- package/lib/module/components/ProgressSegmented/styles.js.map +1 -1
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/components/{Form/FormLabelRoot.d.ts → Field/FieldLabel.d.ts} +5 -5
- package/lib/typescript/components/Field/FieldLabel.d.ts.map +1 -0
- package/lib/typescript/components/{Form/FormLabelRoot.web.d.ts → Field/FieldLabel.web.d.ts} +3 -7
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -0
- package/lib/typescript/components/Field/index.d.ts +26 -0
- package/lib/typescript/components/Field/index.d.ts.map +1 -0
- package/lib/typescript/components/Field/styles.d.ts +16 -0
- package/lib/typescript/components/Field/styles.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.d.ts +2 -0
- package/lib/typescript/components/Form/FormRoot.d.ts.map +1 -1
- package/lib/typescript/components/Form/index.d.ts +4 -61
- package/lib/typescript/components/Form/index.d.ts.map +1 -1
- package/lib/typescript/components/Form/styles.d.ts +0 -20
- package/lib/typescript/components/Form/styles.d.ts.map +1 -1
- package/lib/typescript/components/ProgressBar/index.d.ts +17 -0
- package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/components/ProgressBar/styles.d.ts +5 -0
- package/lib/typescript/components/ProgressBar/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/styles.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/{Form/FormLabelRoot.tsx → Field/FieldLabel.tsx} +4 -4
- package/src/components/Field/FieldLabel.web.tsx +25 -0
- package/src/components/Field/index.tsx +171 -0
- package/src/components/Field/styles.ts +32 -0
- package/src/components/Form/FormRoot.tsx +1 -0
- package/src/components/Form/index.tsx +11 -245
- package/src/components/Form/styles.ts +1 -73
- package/src/components/ProgressBar/index.tsx +53 -0
- package/src/components/ProgressBar/styles.ts +9 -0
- package/src/components/ProgressSegmented/styles.ts +6 -5
- package/src/components/index.ts +2 -0
- package/lib/commonjs/components/Form/FormLabelRoot.js.map +0 -1
- package/lib/commonjs/components/Form/FormLabelRoot.web.js.map +0 -1
- package/lib/module/components/Form/FormLabelRoot.js.map +0 -1
- package/lib/module/components/Form/FormLabelRoot.web.js +0 -13
- package/lib/module/components/Form/FormLabelRoot.web.js.map +0 -1
- package/lib/typescript/components/Form/FormLabelRoot.d.ts.map +0 -1
- package/lib/typescript/components/Form/FormLabelRoot.web.d.ts.map +0 -1
- package/src/components/Form/FormLabelRoot.web.tsx +0 -18
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.BaseFieldLabel = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("@cdx-ui/utils");
|
|
@@ -12,7 +12,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
12
12
|
* Native: `Text` label row — tap focuses the field input via form context
|
|
13
13
|
* (parity with `<label htmlFor>` on web).
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const BaseFieldLabel = exports.BaseFieldLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
16
16
|
htmlFor: _omitHtmlFor,
|
|
17
17
|
onPress,
|
|
18
18
|
...props
|
|
@@ -29,5 +29,5 @@ const FormLabelRoot = exports.FormLabelRoot = /*#__PURE__*/(0, _react.forwardRef
|
|
|
29
29
|
onPress: (0, _utils.composeEventHandlers)(onPress, () => focusInput?.())
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=
|
|
32
|
+
BaseFieldLabel.displayName = 'BaseFieldLabel';
|
|
33
|
+
//# sourceMappingURL=FieldLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_jsxRuntime","BaseFieldLabel","exports","forwardRef","htmlFor","_omitHtmlFor","onPress","props","ref","focusInput","isDisabled","useFormControlContext","jsx","Text","disabled","Boolean","composeEventHandlers","displayName"],"sourceRoot":"../../../../src","sources":["components/Field/FieldLabel.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAA4E,IAAAG,WAAA,GAAAH,OAAA;AAS5E;AACA;AACA;AACA;AACO,MAAMI,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,iBAAU,EACtC,CAAC;EAAEC,OAAO,EAAEC,YAAY;EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACrD,KAAKH,YAAY;EAEjB,MAAM;IAAEI,UAAU;IAAEC;EAAW,CAAC,GAAG,IAAAC,4BAAqB,EAAC,CAAC;EAE1D,oBACE,IAAAX,WAAA,CAAAY,GAAA,EAACd,YAAA,CAAAe,IAAI;IACHL,GAAG,EAAEA,GAAI;IAAA,GACLD,KAAK;IACTO,QAAQ,EAAEC,OAAO,CAACL,UAAU,CAAE;IAC9BJ,OAAO,EAAE,IAAAU,2BAAoB,EAACV,OAAO,EAAE,MAAMG,UAAU,GAAG,CAAC;EAAE,CAC9D,CAAC;AAEN,CACF,CAAC;AAEDR,cAAc,CAACgB,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -3,16 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.BaseFieldLabel = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
9
|
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); }
|
|
10
|
+
// TODO: Why does dataSet need to be decomposed into individual data attributes?
|
|
11
|
+
|
|
10
12
|
/** Real `<label>` so clicking the label focuses the associated control (`htmlFor` → input `id`). */
|
|
11
|
-
const
|
|
13
|
+
const BaseFieldLabel = exports.BaseFieldLabel = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
12
14
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
13
15
|
ref: ref,
|
|
14
|
-
...props
|
|
16
|
+
...props,
|
|
17
|
+
"data-invalid": props.dataSet?.invalid,
|
|
18
|
+
"data-required": props.dataSet?.required
|
|
15
19
|
});
|
|
16
20
|
});
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=
|
|
21
|
+
BaseFieldLabel.displayName = 'BaseFieldLabel';
|
|
22
|
+
//# sourceMappingURL=FieldLabel.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BaseFieldLabel","exports","forwardRef","props","ref","jsx","dataSet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ACE,IAAAxB,WAAA,CAAAyB,GAAA;IACED,GAAG,EAAEA,GAAI;IAAA,GACJD,KAAK;IACV,gBAAcA,KAAK,CAACG,OAAO,EAAEC,OAAQ;IACrC,iBAAeJ,KAAK,CAACG,OAAO,EAAEE;EAAS,CACxC,CAAC;AAEN,CAAC,CAAC;AAEFR,cAAc,CAACS,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Field = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _icons = require("@cdx-ui/icons");
|
|
10
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
11
|
+
var _utils = require("@cdx-ui/utils");
|
|
12
|
+
var _Icon = require("../Icon");
|
|
13
|
+
var _FieldLabel = require("./FieldLabel");
|
|
14
|
+
var _styles = require("./styles");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
// =============================================================================
|
|
17
|
+
// PRIMITIVE
|
|
18
|
+
// =============================================================================
|
|
19
|
+
const FieldPrimitive = (0, _primitives.createField)({
|
|
20
|
+
Root: _reactNative.View,
|
|
21
|
+
Label: _FieldLabel.BaseFieldLabel,
|
|
22
|
+
Helper: _reactNative.View,
|
|
23
|
+
HelperText: _reactNative.Text,
|
|
24
|
+
Error: _reactNative.View,
|
|
25
|
+
ErrorText: _reactNative.Text,
|
|
26
|
+
ErrorIcon: _reactNative.View
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// FIELD ROOT
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Field wrapper + context. For **initial focus**, pass `autoFocus` on `Input.Field` (not here).
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
const FieldRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
style,
|
|
41
|
+
...props
|
|
42
|
+
}, ref) => {
|
|
43
|
+
const computedClassName = (0, _utils.cn)((0, _styles.fieldRootVariants)(), className);
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldPrimitive, {
|
|
45
|
+
ref: ref,
|
|
46
|
+
className: computedClassName,
|
|
47
|
+
style: style,
|
|
48
|
+
...props,
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
FieldRoot.displayName = 'Field';
|
|
53
|
+
|
|
54
|
+
// =============================================================================
|
|
55
|
+
// FIELD LABEL
|
|
56
|
+
// =============================================================================
|
|
57
|
+
|
|
58
|
+
const FieldLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
style,
|
|
62
|
+
htmlFor,
|
|
63
|
+
...props
|
|
64
|
+
}, ref) => {
|
|
65
|
+
const labelClassName = (0, _utils.cn)((0, _styles.fieldLabelVariants)(), className);
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldPrimitive.Label, {
|
|
67
|
+
ref: ref,
|
|
68
|
+
className: labelClassName,
|
|
69
|
+
style: style,
|
|
70
|
+
htmlFor: htmlFor,
|
|
71
|
+
requiredIndicator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
72
|
+
className: "text-red-500",
|
|
73
|
+
"aria-hidden": true,
|
|
74
|
+
children: ' *'
|
|
75
|
+
}),
|
|
76
|
+
...props,
|
|
77
|
+
children: children
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
FieldLabel.displayName = 'Field.Label';
|
|
81
|
+
|
|
82
|
+
// =============================================================================
|
|
83
|
+
// FIELD HELPER
|
|
84
|
+
// =============================================================================
|
|
85
|
+
|
|
86
|
+
const FieldHelper = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
87
|
+
className,
|
|
88
|
+
children,
|
|
89
|
+
style,
|
|
90
|
+
...props
|
|
91
|
+
}, ref) => {
|
|
92
|
+
const containerClassName = (0, _utils.cn)((0, _styles.fieldHelperVariants)(), className);
|
|
93
|
+
const textClassName = (0, _utils.cn)((0, _styles.fieldHelperTextVariants)());
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldPrimitive.Helper, {
|
|
95
|
+
ref: ref,
|
|
96
|
+
className: containerClassName,
|
|
97
|
+
style: style,
|
|
98
|
+
...props,
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldPrimitive.HelperText, {
|
|
100
|
+
className: textClassName,
|
|
101
|
+
children: children
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
FieldHelper.displayName = 'Field.Helper';
|
|
106
|
+
|
|
107
|
+
// =============================================================================
|
|
108
|
+
// FIELD ERROR (internal icon + text composition)
|
|
109
|
+
// =============================================================================
|
|
110
|
+
|
|
111
|
+
const FieldErrorIcon = ({
|
|
112
|
+
className,
|
|
113
|
+
style,
|
|
114
|
+
...props
|
|
115
|
+
}) => {
|
|
116
|
+
const computedClassName = (0, _utils.cn)((0, _styles.fieldErrorIconVariants)(), className);
|
|
117
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
118
|
+
as: _icons.ErrorIcon,
|
|
119
|
+
className: computedClassName,
|
|
120
|
+
style: style,
|
|
121
|
+
"aria-hidden": true,
|
|
122
|
+
...props
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
FieldErrorIcon.displayName = 'Field.ErrorIcon';
|
|
126
|
+
const FieldError = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
127
|
+
className,
|
|
128
|
+
children,
|
|
129
|
+
style,
|
|
130
|
+
...props
|
|
131
|
+
}, ref) => {
|
|
132
|
+
const containerClassName = (0, _utils.cn)((0, _styles.fieldErrorVariants)(), className);
|
|
133
|
+
const textClassName = (0, _utils.cn)((0, _styles.fieldErrorTextVariants)());
|
|
134
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(FieldPrimitive.Error, {
|
|
135
|
+
ref: ref,
|
|
136
|
+
className: containerClassName,
|
|
137
|
+
style: style,
|
|
138
|
+
...props,
|
|
139
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FieldPrimitive.ErrorIcon, {
|
|
140
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldErrorIcon, {})
|
|
141
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldPrimitive.ErrorText, {
|
|
142
|
+
className: textClassName,
|
|
143
|
+
children: children
|
|
144
|
+
})]
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
FieldError.displayName = 'Field.Error';
|
|
148
|
+
|
|
149
|
+
// =============================================================================
|
|
150
|
+
// COMPOUND EXPORT
|
|
151
|
+
// =============================================================================
|
|
152
|
+
|
|
153
|
+
const Field = exports.Field = Object.assign(FieldRoot, {
|
|
154
|
+
Label: FieldLabel,
|
|
155
|
+
Helper: FieldHelper,
|
|
156
|
+
Error: FieldError
|
|
157
|
+
});
|
|
158
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_icons","_primitives","_utils","_Icon","_FieldLabel","_styles","_jsxRuntime","FieldPrimitive","createField","Root","View","Label","BaseFieldLabel","Helper","HelperText","Text","Error","ErrorText","ErrorIcon","FieldRoot","forwardRef","className","children","style","props","ref","computedClassName","cn","fieldRootVariants","jsx","displayName","FieldLabel","htmlFor","labelClassName","fieldLabelVariants","requiredIndicator","FieldHelper","containerClassName","fieldHelperVariants","textClassName","fieldHelperTextVariants","FieldErrorIcon","fieldErrorIconVariants","Icon","as","FieldError","fieldErrorVariants","fieldErrorTextVariants","jsxs","Field","exports","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Field/index.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A,EAAEA;IAAQ,CAA2B,CAAC;EAAA,CACrE,CAAC;AAE3B,CACF,CAAC;AAEDuB,UAAU,CAACf,WAAW,GAAG,aAAa;;AAEtC;AACA;AACA;;AAQO,MAAMmB,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAGE,MAAM,CAACC,MAAM,CAACjC,SAAS,EAAE;EAC5CR,KAAK,EAAEoB,UAAU;EACjBlB,MAAM,EAAEuB,WAAW;EACnBpB,KAAK,EAAE6B;AACT,CAAC,CAA2B","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fieldRootVariants = exports.fieldLabelVariants = exports.fieldHelperVariants = exports.fieldHelperTextVariants = exports.fieldErrorVariants = exports.fieldErrorTextVariants = exports.fieldErrorIconVariants = void 0;
|
|
7
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
+
var _primitives = require("../../styles/primitives");
|
|
9
|
+
const fieldRootVariants = exports.fieldRootVariants = (0, _classVarianceAuthority.cva)(['flex-col gap-2', 'web:last:mb-0', _primitives.DISABLED_OPACITY]);
|
|
10
|
+
const fieldLabelVariants = exports.fieldLabelVariants = (0, _classVarianceAuthority.cva)(['body-md', 'font-medium', 'text-content-primary', 'flex-row items-center', _primitives.DISABLED_OPACITY, 'web:cursor-pointer', 'data-[invalid=true]:text-content-danger']);
|
|
11
|
+
const fieldHelperVariants = exports.fieldHelperVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center']);
|
|
12
|
+
const fieldHelperTextVariants = exports.fieldHelperTextVariants = (0, _classVarianceAuthority.cva)(['body-sm', 'text-content-tertiary']);
|
|
13
|
+
const fieldErrorVariants = exports.fieldErrorVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center gap-1']);
|
|
14
|
+
const fieldErrorTextVariants = exports.fieldErrorTextVariants = (0, _classVarianceAuthority.cva)(['body-sm', 'text-content-danger']);
|
|
15
|
+
const fieldErrorIconVariants = exports.fieldErrorIconVariants = (0, _classVarianceAuthority.cva)(['size-3.5', 'text-content-danger']);
|
|
16
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","_primitives","fieldRootVariants","exports","cva","DISABLED_OPACITY","fieldLabelVariants","fieldHelperVariants","fieldHelperTextVariants","fieldErrorVariants","fieldErrorTextVariants","fieldErrorIconVariants"],"sourceRoot":"../../../../src","sources":["components/Field/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,2BAAG,EAAC,CAAC,gBAAgB,EAAE,eAAe,EAAEC,4BAAgB,CAAC,CAAC;AAEpF,MAAMC,kBAAkB,GAAAH,OAAA,CAAAG,kBAAA,GAAG,IAAAF,2BAAG,EAAC,CACpC,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvBC,4BAAgB,EAChB,oBAAoB,EACpB,yCAAyC,CAC1C,CAAC;AAEK,MAAME,mBAAmB,GAAAJ,OAAA,CAAAI,mBAAA,GAAG,IAAAH,2BAAG,EAAC,CAAC,uBAAuB,CAAC,CAAC;AAE1D,MAAMI,uBAAuB,GAAAL,OAAA,CAAAK,uBAAA,GAAG,IAAAJ,2BAAG,EAAC,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;AAEzE,MAAMK,kBAAkB,GAAAN,OAAA,CAAAM,kBAAA,GAAG,IAAAL,2BAAG,EAAC,CAAC,6BAA6B,CAAC,CAAC;AAE/D,MAAMM,sBAAsB,GAAAP,OAAA,CAAAO,sBAAA,GAAG,IAAAN,2BAAG,EAAC,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;AAEtE,MAAMO,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAG,IAAAP,2BAAG,EAAC,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_jsxRuntime","BaseFormRoot","exports","forwardRef","onSubmit","_onSubmit","action","_action","method","_method","props","ref","jsx","View","displayName"],"sourceRoot":"../../../../src","sources":["components/Form/FormRoot.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoD,IAAAE,WAAA,GAAAF,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_jsxRuntime","BaseFormRoot","exports","forwardRef","onSubmit","_onSubmit","action","_action","method","_method","props","ref","jsx","View","displayName"],"sourceRoot":"../../../../src","sources":["components/Form/FormRoot.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoD,IAAAE,WAAA,GAAAF,OAAA;AAS7C,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAG,IAAAE,iBAAU,EACpC,CAAC;EAAEC,QAAQ,EAAEC,SAAS;EAAEC,MAAM,EAAEC,OAAO;EAAEC,MAAM,EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC5E,KAAKN,SAAS;EACd,KAAKE,OAAO;EACZ,KAAKE,OAAO;EACZ,oBAAO,IAAAT,WAAA,CAAAY,GAAA,EAACb,YAAA,CAAAc,IAAI;IAACF,GAAG,EAAEA,GAAI;IAAA,GAAKD;EAAK,CAAG,CAAC;AACtC,CACF,CAAC;AAEDT,YAAY,CAACa,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -4,36 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Form = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _primitives = require("@cdx-ui/primitives");
|
|
10
9
|
var _utils = require("@cdx-ui/utils");
|
|
11
|
-
var _Icon = require("../Icon");
|
|
12
10
|
var _FormRoot = require("./FormRoot");
|
|
13
|
-
var _FormLabelRoot = require("./FormLabelRoot");
|
|
14
11
|
var _styles = require("./styles");
|
|
15
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
|
|
17
|
-
// SCOPE + CONTEXT
|
|
18
|
-
// =============================================================================
|
|
19
|
-
const SCOPE = 'FORM';
|
|
20
|
-
const FieldRoot = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
21
|
-
const useFormStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
22
|
-
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
23
14
|
// =============================================================================
|
|
24
15
|
// PRIMITIVE
|
|
25
16
|
// =============================================================================
|
|
26
|
-
|
|
27
17
|
const FormPrimitive = (0, _primitives.createForm)({
|
|
28
|
-
Root: _FormRoot.BaseFormRoot
|
|
29
|
-
Field: FieldRoot,
|
|
30
|
-
Error: _reactNative.View,
|
|
31
|
-
ErrorText: _reactNative.Text,
|
|
32
|
-
ErrorIcon: _reactNative.View,
|
|
33
|
-
Label: _FormLabelRoot.FormLabelRoot,
|
|
34
|
-
Helper: _reactNative.View,
|
|
35
|
-
HelperText: _reactNative.Text
|
|
18
|
+
Root: _FormRoot.BaseFormRoot
|
|
36
19
|
});
|
|
20
|
+
FormPrimitive.displayName = 'FormPrimitive';
|
|
37
21
|
|
|
38
22
|
// =============================================================================
|
|
39
23
|
// FORM ROOT (container — <form> on web, <View> on RN)
|
|
@@ -57,199 +41,8 @@ const FormRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
57
41
|
FormRoot.displayName = 'Form';
|
|
58
42
|
|
|
59
43
|
// =============================================================================
|
|
60
|
-
//
|
|
61
|
-
// =============================================================================
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Field wrapper + context. For **initial focus**, pass `autoFocus` on `Input.Field` (not here).
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
const FormField = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
68
|
-
size = 'default',
|
|
69
|
-
className,
|
|
70
|
-
children,
|
|
71
|
-
style,
|
|
72
|
-
...props
|
|
73
|
-
}, ref) => {
|
|
74
|
-
const computedClassName = (0, _utils.cn)((0, _styles.formFieldVariants)(), className);
|
|
75
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormPrimitive.Field, {
|
|
76
|
-
ref: ref,
|
|
77
|
-
className: computedClassName,
|
|
78
|
-
style: style,
|
|
79
|
-
context: {
|
|
80
|
-
size
|
|
81
|
-
},
|
|
82
|
-
...props,
|
|
83
|
-
children: children
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
FormField.displayName = 'Form.Field';
|
|
87
|
-
|
|
88
|
-
// =============================================================================
|
|
89
|
-
// FORM LABEL
|
|
90
|
-
// =============================================================================
|
|
91
|
-
|
|
92
|
-
// TODO: Accept accessibility labels for required indicator as props to support i18n
|
|
93
|
-
|
|
94
|
-
const FormLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
95
|
-
className,
|
|
96
|
-
children,
|
|
97
|
-
style,
|
|
98
|
-
htmlFor,
|
|
99
|
-
...props
|
|
100
|
-
}, ref) => {
|
|
101
|
-
const {
|
|
102
|
-
size
|
|
103
|
-
} = useFormStyleContext();
|
|
104
|
-
const labelClassName = (0, _utils.cn)((0, _styles.formLabelVariants)({
|
|
105
|
-
size
|
|
106
|
-
}), className);
|
|
107
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormPrimitive.Label, {
|
|
108
|
-
ref: ref,
|
|
109
|
-
className: labelClassName,
|
|
110
|
-
style: style,
|
|
111
|
-
htmlFor: htmlFor,
|
|
112
|
-
requiredIndicator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
113
|
-
className: "text-red-500",
|
|
114
|
-
"aria-hidden": true,
|
|
115
|
-
children: ' *'
|
|
116
|
-
}),
|
|
117
|
-
...props,
|
|
118
|
-
children: children
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
FormLabel.displayName = 'Form.Label';
|
|
122
|
-
|
|
123
|
-
// =============================================================================
|
|
124
|
-
// FORM HELPER
|
|
125
|
-
// =============================================================================
|
|
126
|
-
|
|
127
|
-
const FormHelper = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
128
|
-
className,
|
|
129
|
-
children,
|
|
130
|
-
style,
|
|
131
|
-
...props
|
|
132
|
-
}, ref) => {
|
|
133
|
-
const computedClassName = (0, _utils.cn)((0, _styles.formHelperVariants)(), className);
|
|
134
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormPrimitive.Helper, {
|
|
135
|
-
ref: ref,
|
|
136
|
-
className: computedClassName,
|
|
137
|
-
style: style,
|
|
138
|
-
...props,
|
|
139
|
-
children: children
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
FormHelper.displayName = 'Form.Helper';
|
|
143
|
-
|
|
144
|
-
// =============================================================================
|
|
145
|
-
// FORM HELPER TEXT
|
|
146
|
-
// =============================================================================
|
|
147
|
-
|
|
148
|
-
const FormHelperText = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
149
|
-
className,
|
|
150
|
-
children,
|
|
151
|
-
style,
|
|
152
|
-
...props
|
|
153
|
-
}, ref) => {
|
|
154
|
-
const {
|
|
155
|
-
size
|
|
156
|
-
} = useFormStyleContext();
|
|
157
|
-
const computedClassName = (0, _utils.cn)((0, _styles.formHelperTextVariants)({
|
|
158
|
-
size
|
|
159
|
-
}), className);
|
|
160
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormPrimitive.HelperText, {
|
|
161
|
-
ref: ref,
|
|
162
|
-
className: computedClassName,
|
|
163
|
-
style: style,
|
|
164
|
-
...props,
|
|
165
|
-
children: children
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
FormHelperText.displayName = 'Form.HelperText';
|
|
169
|
-
|
|
170
|
-
// =============================================================================
|
|
171
|
-
// FORM ERROR
|
|
172
|
-
// =============================================================================
|
|
173
|
-
|
|
174
|
-
const FormError = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
175
|
-
className,
|
|
176
|
-
children,
|
|
177
|
-
style,
|
|
178
|
-
...props
|
|
179
|
-
}, ref) => {
|
|
180
|
-
const computedClassName = (0, _utils.cn)((0, _styles.formErrorVariants)(), className);
|
|
181
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormPrimitive.Error, {
|
|
182
|
-
ref: ref,
|
|
183
|
-
className: computedClassName,
|
|
184
|
-
style: style,
|
|
185
|
-
...props,
|
|
186
|
-
children: children
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
FormError.displayName = 'Form.Error';
|
|
190
|
-
|
|
191
|
-
// =============================================================================
|
|
192
|
-
// FORM ERROR TEXT
|
|
193
|
-
// =============================================================================
|
|
194
|
-
|
|
195
|
-
const FormErrorText = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
196
|
-
className,
|
|
197
|
-
children,
|
|
198
|
-
style,
|
|
199
|
-
...props
|
|
200
|
-
}, ref) => {
|
|
201
|
-
const {
|
|
202
|
-
size
|
|
203
|
-
} = useFormStyleContext();
|
|
204
|
-
const computedClassName = (0, _utils.cn)((0, _styles.formErrorTextVariants)({
|
|
205
|
-
size
|
|
206
|
-
}), className);
|
|
207
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormPrimitive.ErrorText, {
|
|
208
|
-
ref: ref,
|
|
209
|
-
className: computedClassName,
|
|
210
|
-
style: style,
|
|
211
|
-
...props,
|
|
212
|
-
children: children
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
FormErrorText.displayName = 'Form.ErrorText';
|
|
216
|
-
|
|
217
|
-
// =============================================================================
|
|
218
|
-
// FORM ERROR ICON
|
|
219
|
-
// =============================================================================
|
|
220
|
-
|
|
221
|
-
const FormErrorIcon = ({
|
|
222
|
-
className,
|
|
223
|
-
style,
|
|
224
|
-
as,
|
|
225
|
-
...props
|
|
226
|
-
}) => {
|
|
227
|
-
const {
|
|
228
|
-
size
|
|
229
|
-
} = useFormStyleContext();
|
|
230
|
-
const computedClassName = (0, _utils.cn)((0, _styles.formErrorIconVariants)({
|
|
231
|
-
size
|
|
232
|
-
}), className);
|
|
233
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
234
|
-
as: as,
|
|
235
|
-
className: computedClassName,
|
|
236
|
-
style: style,
|
|
237
|
-
...props
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
FormErrorIcon.displayName = 'Form.ErrorIcon';
|
|
241
|
-
|
|
242
|
-
// =============================================================================
|
|
243
|
-
// COMPOUND EXPORT
|
|
44
|
+
// EXPORT
|
|
244
45
|
// =============================================================================
|
|
245
46
|
|
|
246
|
-
const Form = exports.Form =
|
|
247
|
-
Field: FormField,
|
|
248
|
-
Label: FormLabel,
|
|
249
|
-
Helper: FormHelper,
|
|
250
|
-
HelperText: FormHelperText,
|
|
251
|
-
Error: FormError,
|
|
252
|
-
ErrorText: FormErrorText,
|
|
253
|
-
ErrorIcon: FormErrorIcon
|
|
254
|
-
});
|
|
47
|
+
const Form = exports.Form = FormRoot;
|
|
255
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_primitives","_utils","_FormRoot","_styles","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FormPrimitive","createForm","Root","BaseFormRoot","displayName","FormRoot","forwardRef","className","children","style","props","ref","computedClassName","cn","formRootVariants","jsx","Form","exports"],"sourceRoot":"../../../../src","sources":["components/Form/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA4C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,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,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAE5C;AACA;AACA;AAEA,MAAMkB,aAAa,GAAG,IAAAC,sBAAU,EAAC;EAAEC,IAAI,EAAEC;AAAa,CAAC,CAAC;AAExDH,aAAa,CAACI,WAAW,GAAG,eAAe;;AAE3C;AACA;AACA;;AAIA,MAAMC,QAAQ,gBAAG,IAAAC,iBAAU,EAAkB,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9F,MAAMC,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAC,wBAAgB,EAAC,CAAC,EAAEP,SAAS,CAAC;EAE3D,oBACE,IAAA3B,WAAA,CAAAmC,GAAA,EAACf,aAAa;IAACW,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEK,iBAAkB;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,EAC3EA;EAAQ,CACI,CAAC;AAEpB,CAAC,CAAC;AAEFH,QAAQ,CAACD,WAAW,GAAG,MAAM;;AAE7B;AACA;AACA;;AAEO,MAAMY,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAGX,QAAQ","ignoreList":[]}
|
|
@@ -3,55 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.formRootVariants =
|
|
6
|
+
exports.formRootVariants = void 0;
|
|
7
7
|
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
-
var _primitives = require("../../styles/primitives");
|
|
9
8
|
const formRootVariants = exports.formRootVariants = (0, _classVarianceAuthority.cva)(['flex-col gap-4']);
|
|
10
|
-
const formFieldVariants = exports.formFieldVariants = (0, _classVarianceAuthority.cva)(['flex-col gap-1.5 mb-4', 'web:last:mb-0', _primitives.DISABLED_OPACITY]);
|
|
11
|
-
const formLabelVariants = exports.formLabelVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center', _primitives.DISABLED_OPACITY, 'web:cursor-pointer', 'font-medium data-[invalid=true]:text-red-600'], {
|
|
12
|
-
variants: {
|
|
13
|
-
size: {
|
|
14
|
-
default: 'text-sm',
|
|
15
|
-
small: 'text-xs'
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
size: 'default'
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const formHelperVariants = exports.formHelperVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center']);
|
|
23
|
-
const formHelperTextVariants = exports.formHelperTextVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_SECONDARY], {
|
|
24
|
-
variants: {
|
|
25
|
-
size: {
|
|
26
|
-
default: 'text-xs',
|
|
27
|
-
small: 'text-[11px]'
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
defaultVariants: {
|
|
31
|
-
size: 'default'
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const formErrorVariants = exports.formErrorVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center gap-1']);
|
|
35
|
-
const formErrorTextVariants = exports.formErrorTextVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_INVALID, 'font-medium'], {
|
|
36
|
-
variants: {
|
|
37
|
-
size: {
|
|
38
|
-
default: 'text-xs',
|
|
39
|
-
small: 'text-[11px]'
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
size: 'default'
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const formErrorIconVariants = exports.formErrorIconVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_INVALID], {
|
|
47
|
-
variants: {
|
|
48
|
-
size: {
|
|
49
|
-
default: 'size-3.5',
|
|
50
|
-
small: 'size-3'
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
defaultVariants: {
|
|
54
|
-
size: 'default'
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
9
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classVarianceAuthority","require","
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","formRootVariants","exports","cva"],"sourceRoot":"../../../../src","sources":["components/Form/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,2BAAG,EAAC,CAAC,gBAAgB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ProgressBar = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
10
|
+
var _utils = require("@cdx-ui/utils");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
const ProgressPrimitive = (0, _primitives.createProgress)({
|
|
14
|
+
Root: _reactNative.View,
|
|
15
|
+
Indicator: _reactNative.View
|
|
16
|
+
});
|
|
17
|
+
const ProgressBarRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
18
|
+
className,
|
|
19
|
+
style,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
22
|
+
const trackClass = (0, _utils.cn)((0, _styles.progressBarTrackVariants)(), className);
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ProgressPrimitive, {
|
|
24
|
+
ref: ref,
|
|
25
|
+
className: trackClass,
|
|
26
|
+
style: style,
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
ProgressBarRoot.displayName = 'ProgressBar';
|
|
31
|
+
const ProgressBarIndicator = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
32
|
+
className,
|
|
33
|
+
style,
|
|
34
|
+
...props
|
|
35
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(ProgressPrimitive.Indicator, {
|
|
36
|
+
ref: ref,
|
|
37
|
+
className: (0, _utils.cn)((0, _styles.progressBarIndicatorVariants)(), className),
|
|
38
|
+
style: style,
|
|
39
|
+
...props
|
|
40
|
+
}));
|
|
41
|
+
ProgressBarIndicator.displayName = 'ProgressBar.Indicator';
|
|
42
|
+
const ProgressBar = exports.ProgressBar = Object.assign(ProgressBarRoot, {
|
|
43
|
+
Indicator: ProgressBarIndicator
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","ProgressPrimitive","createProgress","Root","View","Indicator","ProgressBarRoot","forwardRef","className","style","props","ref","trackClass","cn","progressBarTrackVariants","jsx","displayName","ProgressBarIndicator","progressBarIndicatorVariants","ProgressBar","exports","Object","assign"],"sourceRoot":"../../../../src","sources":["components/ProgressBar/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAIkB,IAAAK,WAAA,GAAAL,OAAA;AAElB,MAAMM,iBAAi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