@cdx-ui/components 0.0.1-alpha.29 → 0.0.1-alpha.30
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/Button/index.js +3 -0
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Form/FormLabelRoot.js +33 -0
- package/lib/commonjs/components/Form/FormLabelRoot.js.map +1 -0
- package/lib/commonjs/components/Form/FormLabelRoot.web.js +18 -0
- package/lib/commonjs/components/Form/FormLabelRoot.web.js.map +1 -0
- package/lib/commonjs/components/Form/FormRoot.js +25 -0
- package/lib/commonjs/components/Form/FormRoot.js.map +1 -0
- package/lib/commonjs/components/Form/FormRoot.web.js +17 -0
- package/lib/commonjs/components/Form/FormRoot.web.js.map +1 -0
- package/lib/commonjs/components/Form/index.js +255 -0
- package/lib/commonjs/components/Form/index.js.map +1 -0
- package/lib/commonjs/components/Form/styles.js +57 -0
- package/lib/commonjs/components/Form/styles.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.js +10 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +98 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -0
- package/lib/commonjs/components/Select/index.js +2 -1
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +3 -3
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/index.js +12 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Button/index.js +3 -0
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Form/FormLabelRoot.js +29 -0
- package/lib/module/components/Form/FormLabelRoot.js.map +1 -0
- package/lib/module/components/Form/FormLabelRoot.web.js +13 -0
- package/lib/module/components/Form/FormLabelRoot.web.js.map +1 -0
- package/lib/module/components/Form/FormRoot.js +21 -0
- package/lib/module/components/Form/FormRoot.js.map +1 -0
- package/lib/module/components/Form/FormRoot.web.js +12 -0
- package/lib/module/components/Form/FormRoot.web.js.map +1 -0
- package/lib/module/components/Form/index.js +252 -0
- package/lib/module/components/Form/index.js.map +1 -0
- package/lib/module/components/Form/styles.js +53 -0
- package/lib/module/components/Form/styles.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.js +7 -0
- package/lib/module/components/Select/SelectTriggerHost.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js +93 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -0
- package/lib/module/components/Select/index.js +2 -1
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +3 -3
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/Avatar/index.d.ts +1 -1
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Dialog/index.d.ts +0 -1
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/components/Form/FormLabelRoot.d.ts +18 -0
- package/lib/typescript/components/Form/FormLabelRoot.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormLabelRoot.web.d.ts +20 -0
- package/lib/typescript/components/Form/FormLabelRoot.web.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.d.ts +12 -0
- package/lib/typescript/components/Form/FormRoot.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.web.d.ts +10 -0
- package/lib/typescript/components/Form/FormRoot.web.d.ts.map +1 -0
- package/lib/typescript/components/Form/index.d.ts +64 -0
- package/lib/typescript/components/Form/index.d.ts.map +1 -0
- package/lib/typescript/components/Form/styles.d.ts +22 -0
- package/lib/typescript/components/Form/styles.d.ts.map +1 -0
- package/lib/typescript/components/Input/index.d.ts +1 -1
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts +3 -0
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts.map +1 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +13 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -0
- package/lib/typescript/components/Select/index.d.ts +1 -1
- 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/index.d.ts +0 -1
- package/lib/typescript/components/Switch/index.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/components/Avatar/index.tsx +0 -2
- package/src/components/Button/index.tsx +1 -0
- package/src/components/Checkbox/index.tsx +0 -2
- package/src/components/Dialog/index.tsx +0 -2
- package/src/components/Form/FormLabelRoot.tsx +33 -0
- package/src/components/Form/FormLabelRoot.web.tsx +18 -0
- package/src/components/Form/FormRoot.tsx +19 -0
- package/src/components/Form/FormRoot.web.tsx +12 -0
- package/src/components/Form/index.tsx +272 -0
- package/src/components/Form/styles.ts +75 -0
- package/src/components/Input/index.tsx +0 -2
- package/src/components/Select/SelectTriggerHost.tsx +4 -0
- package/src/components/Select/SelectTriggerHost.web.tsx +136 -0
- package/src/components/Select/index.tsx +2 -3
- package/src/components/Select/styles.ts +7 -3
- package/src/components/Switch/index.tsx +0 -2
- package/src/components/index.ts +1 -0
- package/src/index.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_Icon","_styles","_jsxRuntime","SCOPE","Root","withStyleContext","Pressable","useButtonStyleContext","useStyleContext","ButtonPrimitive","createButton","Text","Group","View","Spinner","ActivityIndicator","Icon","ButtonRoot","forwardRef","variant","color","size","mode","fullWidth","className","children","style","props","ref","computedClassName","cn","buttonRootVariants","jsx","context","displayName","ButtonLabel","buttonTextVariants","ButtonGroup","flexDirection","isAttached","groupClassName","buttonGroupVariants","ButtonIcon","as","buttonIconVariants","ButtonSpinner","colorClassName","computedColorClassName","buttonSpinnerVariants","Button","exports","Object","assign","Label"],"sourceRoot":"../../../../src","sources":["components/Button/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAQkB,IAAAM,WAAA,GAAAN,OAAA;AAElB,MAAMO,KAAK,GAAG,QAAQ;AAEtB,MAAMC,IAAI,GAAG,IAAAC,uBAAgB,EAACC,sBAAS,EAAEH,KAAK,CAAC;AAE/C,MAAMI,qBAAqB,GAAGA,CAAA,KAAM,IAAAC,sBAAe,EAACL,KAAK,CAAuB;AAEhF,MAAMM,eAAe,GAAG,IAAAC,wBAAY,EAAC;EACnCN,IAAI;EACJO,IAAI,EAAJA,iBAAI;EACJC,KAAK,EAAEC,iBAAI;EACXC,OAAO,EAAEC,8BAAiB;EAC1BC,IAAI,EAAEH;AACR,CAAC,CAAC;;AAEF;AACA;AACA;;AAOA,MAAMI,UAAU,gBAAG,IAAAC,iBAAU,EAC3B,CACE;EACEC,OAAO,GAAG,QAAQ;EAClBC,KAAK,GAAG,QAAQ;EAChBC,IAAI,GAAG,SAAS;EAChBC,IAAI,GAAG,OAAO;EACdC,SAAS,GAAG,KAAK;EACjBC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACL,GAAGC;AACL,CAAC,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reactNative","_primitives","_utils","_Icon","_styles","_jsxRuntime","SCOPE","Root","withStyleContext","Pressable","useButtonStyleContext","useStyleContext","ButtonPrimitive","createButton","Text","Group","View","Spinner","ActivityIndicator","Icon","ButtonRoot","forwardRef","variant","color","size","mode","fullWidth","className","children","style","props","ref","computedClassName","cn","buttonRootVariants","jsx","context","displayName","ButtonLabel","buttonTextVariants","ButtonGroup","flexDirection","isAttached","groupClassName","buttonGroupVariants","ButtonIcon","as","buttonIconVariants","ButtonSpinner","colorClassName","computedColorClassName","buttonSpinnerVariants","Button","exports","Object","assign","Label"],"sourceRoot":"../../../../src","sources":["components/Button/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAQkB,IAAAM,WAAA,GAAAN,OAAA;AAElB,MAAMO,KAAK,GAAG,QAAQ;AAEtB,MAAMC,IAAI,GAAG,IAAAC,uBAAgB,EAACC,sBAAS,EAAEH,KAAK,CAAC;AAE/C,MAAMI,qBAAqB,GAAGA,CAAA,KAAM,IAAAC,sBAAe,EAACL,KAAK,CAAuB;AAEhF,MAAMM,eAAe,GAAG,IAAAC,wBAAY,EAAC;EACnCN,IAAI;EACJO,IAAI,EAAJA,iBAAI;EACJC,KAAK,EAAEC,iBAAI;EACXC,OAAO,EAAEC,8BAAiB;EAC1BC,IAAI,EAAEH;AACR,CAAC,CAAC;;AAEF;AACA;AACA;;AAOA,MAAMI,UAAU,gBAAG,IAAAC,iBAAU,EAC3B,CACE;EACEC,OAAO,GAAG,QAAQ;EAClBC,KAAK,GAAG,QAAQ;EAChBC,IAAI,GAAG,SAAS;EAChBC,IAAI,GAAG,OAAO;EACdC,SAAS,GAAG,KAAK;EACjBC,SAAS;EACTC,QAAQ;EACRC,KA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EAAEM,SAAS;EAAEsB,cAAc;EAAEpB,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACvD,MAAM;IAAET,OAAO;IAAEC,KAAK;IAAEE;EAAK,CAAC,GAAGf,qBAAqB,CAAC,CAAC;EACxD,MAAMwC,sBAAsB,GAAG,IAAAjB,SAAE,EAC/B,IAAAkB,6BAAqB,EAAC;IAAE7B,OAAO;IAAEC,KAAK;IAAEE;EAAK,CAAC,CAAC,EAC/CwB,cACF,CAAC;EAED,oBACE,IAAA5C,WAAA,CAAA8B,GAAA,EAACvB,eAAe,CAACK,OAAO;IACtBc,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEA,SAAU;IACrBsB,cAAc,EAAEC,sBAAuB;IACvCrB,KAAK,EAAEA,KAAM;IAAA,GACTC;EAAK,CACV,CAAC;AAEN,CACF,CAAC;AAEDkB,aAAa,CAACX,WAAW,GAAG,gBAAgB;AASrC,MAAMe,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAACnC,UAAU,EAAE;EAC9CoC,KAAK,EAAElB,WAAW;EAClBvB,KAAK,EAAEyB,WAAW;EAClBrB,IAAI,EAAE0B,UAAU;EAChB5B,OAAO,EAAE+B;AACX,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FormLabelRoot = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* Native: `Text` label row — tap focuses the field input via form context
|
|
13
|
+
* (parity with `<label htmlFor>` on web).
|
|
14
|
+
*/
|
|
15
|
+
const FormLabelRoot = exports.FormLabelRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
16
|
+
htmlFor: _omitHtmlFor,
|
|
17
|
+
onPress,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) => {
|
|
20
|
+
void _omitHtmlFor;
|
|
21
|
+
const {
|
|
22
|
+
focusInput,
|
|
23
|
+
isDisabled
|
|
24
|
+
} = (0, _utils.useFormControlContext)();
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
...props,
|
|
28
|
+
disabled: Boolean(isDisabled),
|
|
29
|
+
onPress: (0, _utils.composeEventHandlers)(onPress, () => focusInput?.())
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
FormLabelRoot.displayName = 'FormLabelRoot';
|
|
33
|
+
//# sourceMappingURL=FormLabelRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_jsxRuntime","FormLabelRoot","exports","forwardRef","htmlFor","_omitHtmlFor","onPress","props","ref","focusInput","isDisabled","useFormControlContext","jsx","Text","disabled","Boolean","composeEventHandlers","displayName"],"sourceRoot":"../../../../src","sources":["components/Form/FormLabelRoot.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,aAAa,GAAAC,OAAA,CAAAD,aAAA,gBAAG,IAAAE,iBAAU,EACrC,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,aAAa,CAACgB,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FormLabelRoot = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
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
|
+
/** Real `<label>` so clicking the label focuses the associated control (`htmlFor` → input `id`). */
|
|
11
|
+
const FormLabelRoot = exports.FormLabelRoot = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
12
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
13
|
+
ref: ref,
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
FormLabelRoot.displayName = 'FormLabelRoot';
|
|
18
|
+
//# sourceMappingURL=FormLabelRoot.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","FormLabelRoot","exports","forwardRef","props","ref","jsx","displayName"],"sourceRoot":"../../../../src","sources":["components/Form/FormLabelRoot.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0D,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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;AAY1D;AACO,MAAMkB,aAAa,GAAAC,OAAA,CAAAD,aAAA,gBAAG,IAAAE,iBAAU,EAAuC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5F,oBAAO,IAAAxB,WAAA,CAAAyB,GAAA;IAAOD,GAAG,EAAEA,GAAI;IAAA,GAAMD;EAAK,CAAmD,CAAC;AACxF,CAAC,CAAC;AAEFH,aAAa,CAACM,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BaseFormRoot = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
const BaseFormRoot = exports.BaseFormRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
11
|
+
onSubmit: _onSubmit,
|
|
12
|
+
action: _action,
|
|
13
|
+
method: _method,
|
|
14
|
+
...props
|
|
15
|
+
}, ref) => {
|
|
16
|
+
void _onSubmit;
|
|
17
|
+
void _action;
|
|
18
|
+
void _method;
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
BaseFormRoot.displayName = 'BaseFormRoot';
|
|
25
|
+
//# sourceMappingURL=FormRoot.js.map
|
|
@@ -0,0 +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;AAQ7C,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":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BaseFormRoot = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
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
|
+
const BaseFormRoot = exports.BaseFormRoot = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
11
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
12
|
+
ref: ref,
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
BaseFormRoot.displayName = 'BaseFormRoot';
|
|
17
|
+
//# sourceMappingURL=FormRoot.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","BaseFormRoot","exports","forwardRef","props","ref","jsx","displayName"],"sourceRoot":"../../../../src","sources":["components/Form/FormRoot.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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;AAOnC,MAAMkB,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAG,IAAAE,iBAAU,EAAqC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACzF,oBAAO,IAAAxB,WAAA,CAAAyB,GAAA;IAAMD,GAAG,EAAEA,GAAI;IAAA,GAAKD;EAAK,CAAG,CAAC;AACtC,CAAC,CAAC;AAEFH,YAAY,CAACM,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Form = 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 _Icon = require("../Icon");
|
|
12
|
+
var _FormRoot = require("./FormRoot");
|
|
13
|
+
var _FormLabelRoot = require("./FormLabelRoot");
|
|
14
|
+
var _styles = require("./styles");
|
|
15
|
+
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
|
+
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// PRIMITIVE
|
|
25
|
+
// =============================================================================
|
|
26
|
+
|
|
27
|
+
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
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// =============================================================================
|
|
39
|
+
// FORM ROOT (container — <form> on web, <View> on RN)
|
|
40
|
+
// =============================================================================
|
|
41
|
+
|
|
42
|
+
const FormRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
43
|
+
className,
|
|
44
|
+
children,
|
|
45
|
+
style,
|
|
46
|
+
...props
|
|
47
|
+
}, ref) => {
|
|
48
|
+
const computedClassName = (0, _utils.cn)((0, _styles.formRootVariants)(), className);
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormPrimitive, {
|
|
50
|
+
ref: ref,
|
|
51
|
+
className: computedClassName,
|
|
52
|
+
style: style,
|
|
53
|
+
...props,
|
|
54
|
+
children: children
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
FormRoot.displayName = 'Form';
|
|
58
|
+
|
|
59
|
+
// =============================================================================
|
|
60
|
+
// FORM FIELD (per-field wrapper — provides context for label/error/helper/input)
|
|
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
|
|
244
|
+
// =============================================================================
|
|
245
|
+
|
|
246
|
+
const Form = exports.Form = Object.assign(FormRoot, {
|
|
247
|
+
Field: FormField,
|
|
248
|
+
Label: FormLabel,
|
|
249
|
+
Helper: FormHelper,
|
|
250
|
+
HelperText: FormHelperText,
|
|
251
|
+
Error: FormError,
|
|
252
|
+
ErrorText: FormErrorText,
|
|
253
|
+
ErrorIcon: FormErrorIcon
|
|
254
|
+
});
|
|
255
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_Icon","_FormRoot","_FormLabelRoot","_styles","_jsxRuntime","SCOPE","FieldRoot","withStyleContext","View","useFormStyleContext","useStyleContext","FormPrimitive","createForm","Root","BaseFormRoot","Field","Error","ErrorText","Text","ErrorIcon","Label","FormLabelRoot","Helper","HelperText","FormRoot","forwardRef","className","children","style","props","ref","computedClassName","cn","formRootVariants","jsx","displayName","FormField","size","formFieldVariants","context","FormLabel","htmlFor","labelClassName","formLabelVariants","requiredIndicator","FormHelper","formHelperVariants","FormHelperText","formHelperTextVariants","FormError","formErrorVariants","FormErrorText","formErrorTextVariants","FormErrorIcon","as","formErrorIconVariants","Icon","Form","exports","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Form/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,KAAA,GAAAJ,OA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C;EACtC,MAAMsB,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAuB,6BAAqB,EAAC;IAAElB;EAAK,CAAC,CAAC,EAAEX,SAAS,CAAC;EAExE,oBAAO,IAAAtB,WAAA,CAAA8B,GAAA,EAAClC,KAAA,CAAAwD,IAAI;IAACF,EAAE,EAAEA,EAAG;IAAC5B,SAAS,EAAEK,iBAAkB;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC;EAAK,CAAG,CAAC;AAChF,CAAC;AAEDwB,aAAa,CAAClB,WAAW,GAAG,gBAAgB;;AAE5C;AACA;AACA;;AAYO,MAAMsB,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAGE,MAAM,CAACC,MAAM,CAACpC,QAAQ,EAAE;EAC1CT,KAAK,EAAEqB,SAAS;EAChBhB,KAAK,EAAEoB,SAAS;EAChBlB,MAAM,EAAEuB,UAAU;EAClBtB,UAAU,EAAEwB,cAAc;EAC1B/B,KAAK,EAAEiC,SAAS;EAChBhC,SAAS,EAAEkC,aAAa;EACxBhC,SAAS,EAAEkC;AACb,CAAC,CAA0B","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formRootVariants = exports.formLabelVariants = exports.formHelperVariants = exports.formHelperTextVariants = exports.formFieldVariants = exports.formErrorVariants = exports.formErrorTextVariants = exports.formErrorIconVariants = void 0;
|
|
7
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
+
var _primitives = require("../../styles/primitives");
|
|
9
|
+
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
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","_primitives","formRootVariants","exports","cva","formFieldVariants","DISABLED_OPACITY","formLabelVariants","variants","size","default","small","defaultVariants","formHelperVariants","formHelperTextVariants","COLOR_TEXT_SECONDARY","formErrorVariants","formErrorTextVariants","COLOR_TEXT_INVALID","formErrorIconVariants"],"sourceRoot":"../../../../src","sources":["components/Form/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMO,MAAME,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,2BAAG,EAAC,CAAC,gBAAgB,CAAC,CAAC;AAEhD,MAAMC,iBAAiB,GAAAF,OAAA,CAAAE,iBAAA,GAAG,IAAAD,2BAAG,EAAC,CAAC,uBAAuB,EAAE,eAAe,EAAEE,4BAAgB,CAAC,CAAC;AAE3F,MAAMC,iBAAiB,GAAAJ,OAAA,CAAAI,iBAAA,GAAG,IAAAH,2BAAG,EAClC,CACE,uBAAuB,EACvBE,4BAAgB,EAChB,oBAAoB,EACpB,8CAA8C,CAC/C,EACD;EACEE,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,SAAS;MAClBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CACF,CAAC;AAEM,MAAMI,kBAAkB,GAAAV,OAAA,CAAAU,kBAAA,GAAG,IAAAT,2BAAG,EAAC,CAAC,uBAAuB,CAAC,CAAC;AAEzD,MAAMU,sBAAsB,GAAAX,OAAA,CAAAW,sBAAA,GAAG,IAAAV,2BAAG,EAAC,CAACW,gCAAoB,CAAC,EAAE;EAChEP,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,SAAS;MAClBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEK,MAAMO,iBAAiB,GAAAb,OAAA,CAAAa,iBAAA,GAAG,IAAAZ,2BAAG,EAAC,CAAC,6BAA6B,CAAC,CAAC;AAE9D,MAAMa,qBAAqB,GAAAd,OAAA,CAAAc,qBAAA,GAAG,IAAAb,2BAAG,EAAC,CAACc,8BAAkB,EAAE,aAAa,CAAC,EAAE;EAC5EV,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,SAAS;MAClBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEK,MAAMU,qBAAqB,GAAAhB,OAAA,CAAAgB,qBAAA,GAAG,IAAAf,2BAAG,EAAC,CAACc,8BAAkB,CAAC,EAAE;EAC7DV,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,UAAU;MACnBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectTriggerHost = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/** Native: `Pressable`. Web: `SelectTriggerHost.web` uses `<button>` so `<label htmlFor>` works. */
|
|
9
|
+
const SelectTriggerHost = exports.SelectTriggerHost = _reactNative.Pressable;
|
|
10
|
+
//# sourceMappingURL=SelectTriggerHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","SelectTriggerHost","exports","Pressable"],"sourceRoot":"../../../../src","sources":["components/Select/SelectTriggerHost.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,sBAAS","ignoreList":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectTriggerHost = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
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); }
|
|
11
|
+
/** Props that must not be forwarded to a DOM `<button>`. */
|
|
12
|
+
const OMIT = new Set(['hitSlop', 'pressRetentionOffset', 'android_ripple', 'android_disableSound', 'unstable_pressDelay', 'onLongPress', 'delayLongPress', 'onPress', 'onPressIn', 'onPressOut', 'onHoverIn', 'onHoverOut', 'disabled', 'style', 'className', 'testID', 'children', 'accessible', 'accessibilityActions', 'accessibilityElementsHidden', 'accessibilityHint', 'accessibilityIgnoresInvertColors', 'accessibilityLabel', 'accessibilityLabelledBy', 'accessibilityLiveRegion', 'accessibilityRole', 'accessibilityState', 'accessibilityValue', 'accessibilityViewIsModal', 'importantForAccessibility', 'needsOffscreenAlphaCompositing', 'collapsable', 'shouldRasterizeIOS', 'removeClippedSubviews', 'onAccessibilityAction', 'onAccessibilityEscape', 'onAccessibilityTap']);
|
|
13
|
+
function resolveChildren(children) {
|
|
14
|
+
if (typeof children === 'function') {
|
|
15
|
+
return children({
|
|
16
|
+
pressed: false
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return children;
|
|
20
|
+
}
|
|
21
|
+
function filterDomProps(rest) {
|
|
22
|
+
const entries = Object.entries(rest).filter(([key]) => !OMIT.has(key));
|
|
23
|
+
return Object.fromEntries(entries);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** UA `<button>` defaults (centered text, inline sizing) fight our flex + `justify-between` layout. */
|
|
27
|
+
const webButtonLayoutStyle = {
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'row',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
justifyContent: 'space-between',
|
|
32
|
+
width: '100%',
|
|
33
|
+
minWidth: 0,
|
|
34
|
+
textAlign: 'start',
|
|
35
|
+
boxSizing: 'border-box',
|
|
36
|
+
margin: 0,
|
|
37
|
+
font: 'inherit',
|
|
38
|
+
lineHeight: 'normal',
|
|
39
|
+
WebkitAppearance: 'none',
|
|
40
|
+
appearance: 'none'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Native `<button type="button">` so the trigger is HTML-labelable (`<label htmlFor>` focuses it).
|
|
45
|
+
* `Pressable` on web is a non-labelable div; no extra refs are needed for label association.
|
|
46
|
+
*/
|
|
47
|
+
const SelectTriggerHost = exports.SelectTriggerHost = /*#__PURE__*/(0, _react.forwardRef)(function SelectTriggerHost(props, ref) {
|
|
48
|
+
const {
|
|
49
|
+
children,
|
|
50
|
+
onPress,
|
|
51
|
+
onPressIn,
|
|
52
|
+
onPressOut,
|
|
53
|
+
onHoverIn,
|
|
54
|
+
onHoverOut,
|
|
55
|
+
disabled,
|
|
56
|
+
style,
|
|
57
|
+
className,
|
|
58
|
+
testID,
|
|
59
|
+
...rest
|
|
60
|
+
} = props;
|
|
61
|
+
const domProps = filterDomProps(rest);
|
|
62
|
+
const flattened = _reactNative.StyleSheet.flatten(style);
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
64
|
+
ref: ref,
|
|
65
|
+
...domProps,
|
|
66
|
+
type: "button",
|
|
67
|
+
disabled: !!disabled,
|
|
68
|
+
className: typeof className === 'string' ? className : undefined,
|
|
69
|
+
style: {
|
|
70
|
+
...webButtonLayoutStyle,
|
|
71
|
+
...(flattened ?? {})
|
|
72
|
+
},
|
|
73
|
+
"data-testid": testID,
|
|
74
|
+
onClick: e => {
|
|
75
|
+
if (!disabled) {
|
|
76
|
+
onPress?.(e);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
onPointerDown: e => {
|
|
80
|
+
onPressIn?.(e);
|
|
81
|
+
},
|
|
82
|
+
onPointerUp: e => {
|
|
83
|
+
onPressOut?.(e);
|
|
84
|
+
},
|
|
85
|
+
onPointerCancel: e => {
|
|
86
|
+
onPressOut?.(e);
|
|
87
|
+
},
|
|
88
|
+
onMouseEnter: e => {
|
|
89
|
+
onHoverIn?.(e);
|
|
90
|
+
},
|
|
91
|
+
onMouseLeave: e => {
|
|
92
|
+
onHoverOut?.(e);
|
|
93
|
+
},
|
|
94
|
+
children: resolveChildren(children)
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
SelectTriggerHost.displayName = 'SelectTriggerHost';
|
|
98
|
+
//# sourceMappingURL=SelectTriggerHost.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OMIT","Set","resolveChildren","children","pressed","filterDomProps","rest","entries","filter","key","fromEntries","webButtonLayoutStyle","display","flexDirection","alignItems","justifyContent","width","minWidth","textAlign","boxSizing","margin","font","lineHeight","WebkitAppearance","appearance","SelectTriggerHost","exports","forwardRef","props","ref","onPress","onPressIn","onPressOut","onHoverIn","onHoverOut","disabled","style","className","testID","domProps","flattened","StyleSheet","flatten","jsx","type","undefined","onClick","onPointerDown","onPointerUp","onPointerCancel","onMouseEnter","onMouseLeave","displayName"],"sourceRoot":"../../../../src","sources":["components/Select/SelectTriggerHost.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAA0C,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAA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GpE,CAAC,IAAK;MACtBmD,UAAU,GAAGnD,CAAwE,CAAC;IACxF,CAAE;IACFqE,YAAY,EAAGrE,CAAC,IAAK;MACnBoD,SAAS,GAAGpD,CAAuE,CAAC;IACtF,CAAE;IACFsE,YAAY,EAAGtE,CAAC,IAAK;MACnBqD,UAAU,GAAGrD,CAAwE,CAAC;IACxF,CAAE;IAAAsB,QAAA,EAEDD,eAAe,CAACC,QAAQ;EAAC,CACpB,CAAC;AAEb,CACF,CAAC;AAEDsB,iBAAiB,CAAC2B,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ var _icons = require("@cdx-ui/icons");
|
|
|
10
10
|
var _primitives = require("@cdx-ui/primitives");
|
|
11
11
|
var _utils = require("@cdx-ui/utils");
|
|
12
12
|
var _Icon = require("../Icon");
|
|
13
|
+
var _SelectTriggerHost = require("./SelectTriggerHost");
|
|
13
14
|
var _styles = require("./styles");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
const SCOPE = 'SELECT';
|
|
@@ -17,7 +18,7 @@ const Root = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
|
17
18
|
const useSelectStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
18
19
|
const SelectPrimitive = (0, _primitives.createSelect)({
|
|
19
20
|
Root,
|
|
20
|
-
Trigger:
|
|
21
|
+
Trigger: _SelectTriggerHost.SelectTriggerHost,
|
|
21
22
|
Value: _reactNative.Text,
|
|
22
23
|
Icon: _reactNative.View,
|
|
23
24
|
Content: _reactNative.View,
|