@televet/kibble-ui 4.0.0-beta.51 → 4.0.0-beta.52
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/dist/chunks/{buttonGroup.component-CESNUX_O.js → buttonGroup.component-CdJUMIP-.js} +2 -2
- package/dist/chunks/{buttonGroup.component-CESNUX_O.js.map → buttonGroup.component-CdJUMIP-.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BLjEEBle.js → buttonGroup.component-Sr6-2Vc6.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BLjEEBle.js.map → buttonGroup.component-Sr6-2Vc6.js.map} +1 -1
- package/dist/chunks/{checkbox.component-DGQYgNkB.js → checkbox.component-D08XXKS7.js} +88 -86
- package/dist/chunks/{checkbox.component-DGQYgNkB.js.map → checkbox.component-D08XXKS7.js.map} +1 -1
- package/dist/chunks/checkbox.component-n9iftNxn.js +2 -0
- package/dist/chunks/{checkbox.component-jKQDjGYQ.js.map → checkbox.component-n9iftNxn.js.map} +1 -1
- package/dist/chunks/checkboxGroup.component-BG4HiBZ6.js +52 -0
- package/dist/chunks/{checkboxGroup.component-DAMxeo3c.js.map → checkboxGroup.component-BG4HiBZ6.js.map} +1 -1
- package/dist/chunks/checkboxGroup.component-BNmruJSQ.js +2 -0
- package/dist/chunks/{checkboxGroup.component-v0mNVsPd.js.map → checkboxGroup.component-BNmruJSQ.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-CFok-8U0.js → conversationCard.component-B7k9ZUSM.js} +2 -2
- package/dist/chunks/{conversationCard.component-CFok-8U0.js.map → conversationCard.component-B7k9ZUSM.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-CiFdjzC0.js → conversationCard.component-BnwJO_zP.js} +2 -2
- package/dist/chunks/{conversationCard.component-CiFdjzC0.js.map → conversationCard.component-BnwJO_zP.js.map} +1 -1
- package/dist/chunks/{datePicker.component-D7J1Ft-p.js → datePicker.component-BTWiLugt.js} +3 -3
- package/dist/chunks/{datePicker.component-D7J1Ft-p.js.map → datePicker.component-BTWiLugt.js.map} +1 -1
- package/dist/chunks/{datePicker.component-BvJzhMIq.js → datePicker.component-hLHLI87m.js} +2 -2
- package/dist/chunks/{datePicker.component-BvJzhMIq.js.map → datePicker.component-hLHLI87m.js.map} +1 -1
- package/dist/chunks/{menu.component-DZoyME_s.js → menu.component-BIQYdh3w.js} +3 -3
- package/dist/chunks/{menu.component-DZoyME_s.js.map → menu.component-BIQYdh3w.js.map} +1 -1
- package/dist/chunks/{menu.component-Bi2JPazM.js → menu.component-CUgSsflu.js} +2 -2
- package/dist/chunks/{menu.component-Bi2JPazM.js.map → menu.component-CUgSsflu.js.map} +1 -1
- package/dist/chunks/{pinInput.types-CU3UyhyT.js → pinInput.types-DGq4AUsB.js} +2 -2
- package/dist/chunks/{pinInput.types-CU3UyhyT.js.map → pinInput.types-DGq4AUsB.js.map} +1 -1
- package/dist/chunks/{pinInput.types-Q3gBjJrF.js → pinInput.types-Dz0csZHn.js} +2 -2
- package/dist/chunks/{pinInput.types-Q3gBjJrF.js.map → pinInput.types-Dz0csZHn.js.map} +1 -1
- package/dist/chunks/radioGroup.component-C07hSoK_.js +2 -0
- package/dist/chunks/{radioGroup.component-cFpOM0dT.js.map → radioGroup.component-C07hSoK_.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-sOmiKjNM.js → radioGroup.component-YuqCXd9N.js} +81 -80
- package/dist/chunks/{radioGroup.component-sOmiKjNM.js.map → radioGroup.component-YuqCXd9N.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-CdawEWbl.js → ratingDots.component-BV7FvAtk.js} +2 -2
- package/dist/chunks/{ratingDots.component-CdawEWbl.js.map → ratingDots.component-BV7FvAtk.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-CMDKq3_T.js → ratingDots.component-bRNtQP9O.js} +2 -2
- package/dist/chunks/{ratingDots.component-CMDKq3_T.js.map → ratingDots.component-bRNtQP9O.js.map} +1 -1
- package/dist/chunks/{select.component-BOSAKx8m.js → select.component-BA3X-v2U.js} +3 -3
- package/dist/chunks/{select.component-BOSAKx8m.js.map → select.component-BA3X-v2U.js.map} +1 -1
- package/dist/chunks/{select.component-C9Vj7Sk7.js → select.component-BsxkV8Vw.js} +2 -2
- package/dist/chunks/{select.component-C9Vj7Sk7.js.map → select.component-BsxkV8Vw.js.map} +1 -1
- package/dist/chunks/{switch.component-QSVPRhDJ.js → switch.component-Cn4tMUnr.js} +2 -2
- package/dist/chunks/{switch.component-QSVPRhDJ.js.map → switch.component-Cn4tMUnr.js.map} +1 -1
- package/dist/chunks/{switch.component-BQ9rEKP6.js → switch.component-c8nXep47.js} +2 -2
- package/dist/chunks/{switch.component-BQ9rEKP6.js.map → switch.component-c8nXep47.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-C0LIdK0o.js → tagBlock.component-BWOzDOXu.js} +2 -2
- package/dist/chunks/{tagBlock.component-C0LIdK0o.js.map → tagBlock.component-BWOzDOXu.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-BZtyjaQk.js → tagBlock.component-C9-GYeEN.js} +2 -2
- package/dist/chunks/{tagBlock.component-BZtyjaQk.js.map → tagBlock.component-C9-GYeEN.js.map} +1 -1
- package/dist/chunks/{textInput.component-BYpBgS2h.js → textInput.component-kvKxz33p.js} +2 -2
- package/dist/chunks/{textInput.component-BYpBgS2h.js.map → textInput.component-kvKxz33p.js.map} +1 -1
- package/dist/chunks/{textInput.component-BjQgcjCW.js → textInput.component-z9E8kUsZ.js} +2 -2
- package/dist/chunks/{textInput.component-BjQgcjCW.js.map → textInput.component-z9E8kUsZ.js.map} +1 -1
- package/dist/chunks/{textarea.component-BXtiF_l4.js → textarea.component-BFDGgi4k.js} +2 -2
- package/dist/chunks/{textarea.component-BXtiF_l4.js.map → textarea.component-BFDGgi4k.js.map} +1 -1
- package/dist/chunks/{textarea.component-B8X86Tqw.js → textarea.component-oH0HkBbz.js} +2 -2
- package/dist/chunks/{textarea.component-B8X86Tqw.js.map → textarea.component-oH0HkBbz.js.map} +1 -1
- package/dist/chunks/{theme.provider-DOj3vPkk.js → theme.provider-BrR7a4Qv.js} +3 -3
- package/dist/chunks/{theme.provider-DOj3vPkk.js.map → theme.provider-BrR7a4Qv.js.map} +1 -1
- package/dist/chunks/{theme.provider-C13bkPxl.js → theme.provider-_AjaCLru.js} +19 -9
- package/dist/chunks/{theme.provider-C13bkPxl.js.map → theme.provider-_AjaCLru.js.map} +1 -1
- package/dist/chunks/{timePicker.component-BwmHvV_9.js → timePicker.component-Bkqufqi7.js} +2 -2
- package/dist/chunks/{timePicker.component-BwmHvV_9.js.map → timePicker.component-Bkqufqi7.js.map} +1 -1
- package/dist/chunks/{timePicker.component-Bk5xtY7m.js → timePicker.component-C2XDU_7Q.js} +2 -2
- package/dist/chunks/{timePicker.component-Bk5xtY7m.js.map → timePicker.component-C2XDU_7Q.js.map} +1 -1
- package/dist/chunks/{timeRange.component-CWbreNV8.js → timeRange.component-Dh4kFTxD.js} +2 -2
- package/dist/chunks/{timeRange.component-CWbreNV8.js.map → timeRange.component-Dh4kFTxD.js.map} +1 -1
- package/dist/chunks/{timeRange.component-Du_CkwPc.js → timeRange.component-cT8BwcXk.js} +2 -2
- package/dist/chunks/{timeRange.component-Du_CkwPc.js.map → timeRange.component-cT8BwcXk.js.map} +1 -1
- package/dist/chunks/{toaster.records-BTc-Lbzv.js → toaster.records-Bkt2-n5c.js} +2 -2
- package/dist/chunks/{toaster.records-BTc-Lbzv.js.map → toaster.records-Bkt2-n5c.js.map} +1 -1
- package/dist/chunks/{toaster.records-DuvFE6c1.js → toaster.records-oUlJ-9y-.js} +2 -3
- package/dist/chunks/{toaster.records-DuvFE6c1.js.map → toaster.records-oUlJ-9y-.js.map} +1 -1
- package/dist/chunks/withFormControl-DoOQ6oLs.js +2 -0
- package/dist/chunks/{withFormControl-YVXep-WE.js.map → withFormControl-DoOQ6oLs.js.map} +1 -1
- package/dist/chunks/withFormControl-YhSGmDSm.js +376 -0
- package/dist/chunks/withFormControl-YhSGmDSm.js.map +1 -0
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/Toast/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/Toast/index.js +1 -1
- package/dist/esm/components/index.js +16 -16
- package/dist/esm/index.js +17 -17
- package/dist/esm/theme/index.js +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +1 -0
- package/dist/types/hocs/withFormControl/withFormControl.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/checkbox.component-jKQDjGYQ.js +0 -2
- package/dist/chunks/checkboxGroup.component-DAMxeo3c.js +0 -51
- package/dist/chunks/checkboxGroup.component-v0mNVsPd.js +0 -2
- package/dist/chunks/radioGroup.component-cFpOM0dT.js +0 -2
- package/dist/chunks/withFormControl-BRVK_J11.js +0 -375
- package/dist/chunks/withFormControl-BRVK_J11.js.map +0 -1
- package/dist/chunks/withFormControl-YVXep-WE.js +0 -2
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
import { j as o } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { W as K } from "./text.component-ByshUroO.js";
|
|
3
|
-
import { p as g, f as Q } from "./typography.records-BS1CFpJg.js";
|
|
4
|
-
import { I as U } from "./icon.component-BmcWaysM.js";
|
|
5
|
-
import { F as k } from "./flex-C2d2LH-K.js";
|
|
6
|
-
import * as V from "react";
|
|
7
|
-
import { forwardRef as P, useLayoutEffect as X, useEffect as ee, useState as q, useId as te, useRef as re, useMemo as m, Children as se } from "react";
|
|
8
|
-
import { c as L, b as M } from "./factory-gZxMesut.js";
|
|
9
|
-
import { c as oe } from "./create-slot-recipe-context-DJkLYvCT.js";
|
|
10
|
-
import { c as ae } from "./create-recipe-context-BcvaE0iS.js";
|
|
11
|
-
import { u as v, F as le } from "./use-field-context-Bxg2bkx0.js";
|
|
12
|
-
import { f as I, a as ne, b as ie, h as de } from "./use-locale-context-BnlMA8su.js";
|
|
13
|
-
import { Y as j, Z as ce, e as u, u as fe } from "./index-B8d8Hi2Q.js";
|
|
14
|
-
const B = P((l, t) => {
|
|
15
|
-
const r = v(), e = j(r.getErrorTextProps(), l);
|
|
16
|
-
return r?.invalid ? /* @__PURE__ */ o.jsx(I.span, { ...e, ref: t }) : null;
|
|
17
|
-
});
|
|
18
|
-
B.displayName = "FieldErrorText";
|
|
19
|
-
const O = P((l, t) => {
|
|
20
|
-
const r = v(), e = j(r?.getHelperTextProps(), l);
|
|
21
|
-
return /* @__PURE__ */ o.jsx(I.span, { ...e, ref: t });
|
|
22
|
-
});
|
|
23
|
-
O.displayName = "FieldHelperText";
|
|
24
|
-
const W = P((l, t) => {
|
|
25
|
-
const r = v(), e = j(r?.getLabelProps(), l);
|
|
26
|
-
return /* @__PURE__ */ o.jsx(I.label, { ...e, ref: t });
|
|
27
|
-
});
|
|
28
|
-
W.displayName = "FieldLabel";
|
|
29
|
-
const me = typeof window < "u" ? X : ee, [Me, ue] = ne({
|
|
30
|
-
name: "FieldsetContext",
|
|
31
|
-
hookName: "useFieldsetContext",
|
|
32
|
-
providerName: "<FieldsetProvider />",
|
|
33
|
-
strict: !1
|
|
34
|
-
}), pe = (l = {}) => {
|
|
35
|
-
const t = ue(), { ids: r, disabled: e = !!t?.disabled, invalid: s = !1, readOnly: a = !1, required: n = !1 } = l, [i, F] = q(!1), [T, N] = q(!1), d = l.id ?? te(), f = re(null), C = r?.control ?? `field::${d}`, c = r?.errorText ?? `field::${d}::error-text`, p = r?.helperText ?? `field::${d}::helper-text`, h = r?.label ?? `field::${d}::label`;
|
|
36
|
-
me(() => {
|
|
37
|
-
const b = f.current;
|
|
38
|
-
if (!b) return;
|
|
39
|
-
const _ = ce(b), A = _.document, H = () => {
|
|
40
|
-
F(!!A.getElementById(c)), N(!!A.getElementById(p));
|
|
41
|
-
};
|
|
42
|
-
H();
|
|
43
|
-
const $ = new _.MutationObserver(H);
|
|
44
|
-
return $.observe(b, { childList: !0, subtree: !0 }), () => $.disconnect();
|
|
45
|
-
}, [c, p]);
|
|
46
|
-
const y = m(() => {
|
|
47
|
-
const b = [];
|
|
48
|
-
return i && s && b.push(c), T && b.push(p), b.join(" ") || void 0;
|
|
49
|
-
}, [s, c, p, i, T]), w = m(
|
|
50
|
-
() => () => ({
|
|
51
|
-
...g.root.attrs,
|
|
52
|
-
id: C,
|
|
53
|
-
ref: f,
|
|
54
|
-
role: "group",
|
|
55
|
-
"data-disabled": u(e),
|
|
56
|
-
"data-invalid": u(s),
|
|
57
|
-
"data-readonly": u(a)
|
|
58
|
-
}),
|
|
59
|
-
[e, s, a, C]
|
|
60
|
-
), R = m(
|
|
61
|
-
() => () => ({
|
|
62
|
-
...g.label.attrs,
|
|
63
|
-
id: h,
|
|
64
|
-
"data-disabled": u(e),
|
|
65
|
-
"data-invalid": u(s),
|
|
66
|
-
"data-readonly": u(a),
|
|
67
|
-
htmlFor: d
|
|
68
|
-
}),
|
|
69
|
-
[e, s, a, d, h]
|
|
70
|
-
), x = m(
|
|
71
|
-
() => () => ({
|
|
72
|
-
"aria-describedby": y,
|
|
73
|
-
"aria-invalid": fe(s),
|
|
74
|
-
"data-invalid": u(s),
|
|
75
|
-
"data-required": u(n),
|
|
76
|
-
"data-readonly": u(a),
|
|
77
|
-
id: d,
|
|
78
|
-
required: n,
|
|
79
|
-
disabled: e,
|
|
80
|
-
readOnly: a
|
|
81
|
-
}),
|
|
82
|
-
[y, s, n, a, d, e]
|
|
83
|
-
), E = m(
|
|
84
|
-
() => () => ({
|
|
85
|
-
...x(),
|
|
86
|
-
...g.input.attrs
|
|
87
|
-
}),
|
|
88
|
-
[x]
|
|
89
|
-
), z = m(
|
|
90
|
-
() => () => ({
|
|
91
|
-
...x(),
|
|
92
|
-
...g.textarea.attrs
|
|
93
|
-
}),
|
|
94
|
-
[x]
|
|
95
|
-
), D = m(
|
|
96
|
-
() => () => ({
|
|
97
|
-
...x(),
|
|
98
|
-
...g.select.attrs
|
|
99
|
-
}),
|
|
100
|
-
[x]
|
|
101
|
-
), Y = m(
|
|
102
|
-
() => () => ({
|
|
103
|
-
id: p,
|
|
104
|
-
...g.helperText.attrs,
|
|
105
|
-
"data-disabled": u(e)
|
|
106
|
-
}),
|
|
107
|
-
[e, p]
|
|
108
|
-
), G = m(
|
|
109
|
-
() => () => ({
|
|
110
|
-
id: c,
|
|
111
|
-
...g.errorText.attrs,
|
|
112
|
-
"aria-live": "polite"
|
|
113
|
-
}),
|
|
114
|
-
[c]
|
|
115
|
-
), J = m(
|
|
116
|
-
() => () => ({
|
|
117
|
-
"aria-hidden": !0,
|
|
118
|
-
...g.requiredIndicator.attrs
|
|
119
|
-
}),
|
|
120
|
-
[]
|
|
121
|
-
);
|
|
122
|
-
return {
|
|
123
|
-
ariaDescribedby: y,
|
|
124
|
-
ids: {
|
|
125
|
-
root: C,
|
|
126
|
-
control: d,
|
|
127
|
-
label: h,
|
|
128
|
-
errorText: c,
|
|
129
|
-
helperText: p
|
|
130
|
-
},
|
|
131
|
-
refs: {
|
|
132
|
-
rootRef: f
|
|
133
|
-
},
|
|
134
|
-
disabled: e,
|
|
135
|
-
invalid: s,
|
|
136
|
-
readOnly: a,
|
|
137
|
-
required: n,
|
|
138
|
-
getLabelProps: R,
|
|
139
|
-
getRootProps: w,
|
|
140
|
-
getInputProps: E,
|
|
141
|
-
getTextareaProps: z,
|
|
142
|
-
getSelectProps: D,
|
|
143
|
-
getHelperTextProps: Y,
|
|
144
|
-
getErrorTextProps: G,
|
|
145
|
-
getRequiredIndicatorProps: J
|
|
146
|
-
};
|
|
147
|
-
}, Z = P((l, t) => {
|
|
148
|
-
const [r, e] = ie()(l, [
|
|
149
|
-
"id",
|
|
150
|
-
"ids",
|
|
151
|
-
"disabled",
|
|
152
|
-
"invalid",
|
|
153
|
-
"readOnly",
|
|
154
|
-
"required"
|
|
155
|
-
]), s = pe(r), a = j(s.getRootProps(), e);
|
|
156
|
-
return /* @__PURE__ */ o.jsx(le, { value: s, children: /* @__PURE__ */ o.jsx(I.div, { ...a, ref: de(t, s.refs.rootRef) }) });
|
|
157
|
-
});
|
|
158
|
-
Z.displayName = "FieldRoot";
|
|
159
|
-
const { useRecipeResult: xe } = ae({ key: "icon" }), he = V.forwardRef(
|
|
160
|
-
function(t, r) {
|
|
161
|
-
const {
|
|
162
|
-
styles: e,
|
|
163
|
-
className: s,
|
|
164
|
-
props: a
|
|
165
|
-
} = xe({ asChild: !t.as, ...t });
|
|
166
|
-
return /* @__PURE__ */ o.jsx(
|
|
167
|
-
L.svg,
|
|
168
|
-
{
|
|
169
|
-
ref: r,
|
|
170
|
-
focusable: !1,
|
|
171
|
-
"aria-hidden": "true",
|
|
172
|
-
...a,
|
|
173
|
-
css: [e, t.css],
|
|
174
|
-
className: M(s, t.className)
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
function ge(l) {
|
|
180
|
-
const {
|
|
181
|
-
viewBox: t = "0 0 24 24",
|
|
182
|
-
d: r,
|
|
183
|
-
displayName: e,
|
|
184
|
-
defaultProps: s = {}
|
|
185
|
-
} = l, a = se.toArray(l.path), n = P((i, F) => /* @__PURE__ */ o.jsx(
|
|
186
|
-
he,
|
|
187
|
-
{
|
|
188
|
-
ref: F,
|
|
189
|
-
asChild: !1,
|
|
190
|
-
viewBox: t,
|
|
191
|
-
...s,
|
|
192
|
-
...i,
|
|
193
|
-
children: a.length ? a : /* @__PURE__ */ o.jsx("path", { fill: "currentColor", d: r })
|
|
194
|
-
}
|
|
195
|
-
));
|
|
196
|
-
return n.displayName = e, n;
|
|
197
|
-
}
|
|
198
|
-
const {
|
|
199
|
-
withProvider: Fe,
|
|
200
|
-
withContext: S,
|
|
201
|
-
useStyles: be,
|
|
202
|
-
useClassNames: Te
|
|
203
|
-
} = oe({ key: "field" }), Ce = Fe(
|
|
204
|
-
Z,
|
|
205
|
-
"root",
|
|
206
|
-
{ forwardAsChild: !0 }
|
|
207
|
-
), Pe = S(
|
|
208
|
-
W,
|
|
209
|
-
"label",
|
|
210
|
-
{ forwardAsChild: !0 }
|
|
211
|
-
), ye = S(O, "helperText", { forwardAsChild: !0 }), Ne = S(
|
|
212
|
-
B,
|
|
213
|
-
"errorText",
|
|
214
|
-
{ forwardAsChild: !0 }
|
|
215
|
-
);
|
|
216
|
-
ge({
|
|
217
|
-
d: "M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"
|
|
218
|
-
});
|
|
219
|
-
const ve = P(function(t, r) {
|
|
220
|
-
const { fallback: e, children: s = "*", ...a } = t, n = v(), i = Te(), F = be();
|
|
221
|
-
return n?.required ? /* @__PURE__ */ o.jsx(
|
|
222
|
-
L.span,
|
|
223
|
-
{
|
|
224
|
-
ref: r,
|
|
225
|
-
"aria-hidden": "true",
|
|
226
|
-
...a,
|
|
227
|
-
className: M(i.requiredIndicator, t.className),
|
|
228
|
-
css: [F.requiredIndicator, t.css],
|
|
229
|
-
children: s
|
|
230
|
-
}
|
|
231
|
-
) : e;
|
|
232
|
-
}), Ie = {
|
|
233
|
-
sm: 10,
|
|
234
|
-
md: 12,
|
|
235
|
-
lg: 14
|
|
236
|
-
}, Be = (l) => {
|
|
237
|
-
const t = ({
|
|
238
|
-
disabled: r = !1,
|
|
239
|
-
errorText: e = "Field is invalid",
|
|
240
|
-
formControlStyle: s,
|
|
241
|
-
helperText: a,
|
|
242
|
-
inlineField: n = !1,
|
|
243
|
-
invalid: i = !1,
|
|
244
|
-
invalidIconColor: F = "warning",
|
|
245
|
-
label: T,
|
|
246
|
-
labelPosition: N = "start",
|
|
247
|
-
labelStyle: d,
|
|
248
|
-
onContrast: f = !1,
|
|
249
|
-
readOnly: C = !1,
|
|
250
|
-
required: c = !1,
|
|
251
|
-
showOptionalElement: p = !1,
|
|
252
|
-
size: h = "md",
|
|
253
|
-
useInvalidIcon: y = !1,
|
|
254
|
-
useInvalidText: w = !0,
|
|
255
|
-
...R
|
|
256
|
-
}) => {
|
|
257
|
-
const x = /* @__PURE__ */ o.jsxs(
|
|
258
|
-
Pe,
|
|
259
|
-
{
|
|
260
|
-
className: "FormControl__Label",
|
|
261
|
-
color: f ? "text.contrast" : "text",
|
|
262
|
-
fontSize: Q[h],
|
|
263
|
-
...d,
|
|
264
|
-
onClick: (E) => {
|
|
265
|
-
E.stopPropagation();
|
|
266
|
-
},
|
|
267
|
-
children: [
|
|
268
|
-
T,
|
|
269
|
-
/* @__PURE__ */ o.jsx(
|
|
270
|
-
ve,
|
|
271
|
-
{
|
|
272
|
-
className: "FormControl__RequiredIndicator",
|
|
273
|
-
color: f ? "text.danger.contrast" : "text.danger",
|
|
274
|
-
...!c && {
|
|
275
|
-
fallback: p ? /* @__PURE__ */ o.jsxs(
|
|
276
|
-
K,
|
|
277
|
-
{
|
|
278
|
-
variant: f ? "subtleOnContrast" : "subtle",
|
|
279
|
-
fontSize: Ie[h],
|
|
280
|
-
children: [
|
|
281
|
-
" ",
|
|
282
|
-
"(Optional)"
|
|
283
|
-
]
|
|
284
|
-
}
|
|
285
|
-
) : /* @__PURE__ */ o.jsx(o.Fragment, {})
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
)
|
|
289
|
-
]
|
|
290
|
-
}
|
|
291
|
-
);
|
|
292
|
-
return /* @__PURE__ */ o.jsxs(
|
|
293
|
-
Ce,
|
|
294
|
-
{
|
|
295
|
-
className: "FormControl group",
|
|
296
|
-
disabled: r,
|
|
297
|
-
invalid: i,
|
|
298
|
-
readOnly: C,
|
|
299
|
-
required: c,
|
|
300
|
-
width: "auto",
|
|
301
|
-
...s,
|
|
302
|
-
children: [
|
|
303
|
-
/* @__PURE__ */ o.jsxs(
|
|
304
|
-
k,
|
|
305
|
-
{
|
|
306
|
-
className: "FormControl__Container",
|
|
307
|
-
flexDirection: n ? "row" : "column",
|
|
308
|
-
w: n ? "max-content" : "100%",
|
|
309
|
-
gap: 2,
|
|
310
|
-
children: [
|
|
311
|
-
T && N === "start" && x,
|
|
312
|
-
/* @__PURE__ */ o.jsxs(
|
|
313
|
-
k,
|
|
314
|
-
{
|
|
315
|
-
className: "FormControl__Content",
|
|
316
|
-
alignItems: "center",
|
|
317
|
-
gap: 2,
|
|
318
|
-
w: n ? "max-content" : "100%",
|
|
319
|
-
children: [
|
|
320
|
-
/* @__PURE__ */ o.jsx(
|
|
321
|
-
l,
|
|
322
|
-
{
|
|
323
|
-
disabled: r,
|
|
324
|
-
invalid: i,
|
|
325
|
-
onContrast: f,
|
|
326
|
-
readOnly: C,
|
|
327
|
-
required: c,
|
|
328
|
-
size: h,
|
|
329
|
-
...R
|
|
330
|
-
}
|
|
331
|
-
),
|
|
332
|
-
y && i && /* @__PURE__ */ o.jsx(
|
|
333
|
-
U,
|
|
334
|
-
{
|
|
335
|
-
className: "FormControl__InvalidIcon",
|
|
336
|
-
name: "warningSign",
|
|
337
|
-
variant: F,
|
|
338
|
-
size: h
|
|
339
|
-
}
|
|
340
|
-
)
|
|
341
|
-
]
|
|
342
|
-
}
|
|
343
|
-
),
|
|
344
|
-
T && N === "end" && x
|
|
345
|
-
]
|
|
346
|
-
}
|
|
347
|
-
),
|
|
348
|
-
w && i && /* @__PURE__ */ o.jsx(
|
|
349
|
-
Ne,
|
|
350
|
-
{
|
|
351
|
-
className: "FormControl__ErrorText",
|
|
352
|
-
fontSize: "xs",
|
|
353
|
-
color: f ? "text.danger.contrast" : "text.danger",
|
|
354
|
-
children: e
|
|
355
|
-
}
|
|
356
|
-
),
|
|
357
|
-
a && /* @__PURE__ */ o.jsx(
|
|
358
|
-
ye,
|
|
359
|
-
{
|
|
360
|
-
className: "FormControl__HelperText",
|
|
361
|
-
fontSize: "xs",
|
|
362
|
-
color: f ? "text.subtle.contrast" : "text.subtle",
|
|
363
|
-
children: a
|
|
364
|
-
}
|
|
365
|
-
)
|
|
366
|
-
]
|
|
367
|
-
}
|
|
368
|
-
);
|
|
369
|
-
};
|
|
370
|
-
return t.displayName = `withFormControl(${l.displayName || l.name}`, t;
|
|
371
|
-
};
|
|
372
|
-
export {
|
|
373
|
-
Be as w
|
|
374
|
-
};
|
|
375
|
-
//# sourceMappingURL=withFormControl-BRVK_J11.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withFormControl-BRVK_J11.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from \"./withFormControl.types\";\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from \"react\";\nimport { Field } from \"@chakra-ui/react/field\";\nimport {\n FormControlLabelPosition,\n FormControlSize,\n} from \"./withFormControl.types\";\nimport { SystemStyleObject } from \"@chakra-ui/react/styled-system\";\nimport { TypographyVariant } from \"shared/types/typography\";\nimport { Text } from \"components/Text/text.component\";\nimport { optionalTextSizeMap } from \"./withFormControl.records\";\nimport { fontSizes } from \"theme/tokens/typography/typography.records\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { Icon } from \"components/Icon/icon.component\";\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = \"Field is invalid\",\n formControlStyle,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = \"warning\",\n label,\n labelPosition = \"start\",\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = \"md\",\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? \"text.contrast\" : \"text\"}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n fontSize={optionalTextSizeMap[size]}\n >\n {\" \"}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width=\"auto\"\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? \"row\" : \"column\"}\n w={inlineField ? \"max-content\" : \"100%\"}\n gap={2}\n >\n {label && labelPosition === \"start\" && labelComponent}\n <Flex\n className=\"FormControl__Content\"\n alignItems=\"center\"\n gap={2}\n w={inlineField ? \"max-content\" : \"100%\"}\n >\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n name=\"warningSign\"\n variant={invalidIconColor}\n size={size}\n />\n )}\n </Flex>\n {label && labelPosition === \"end\" && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.subtle.contrast\" : \"text.subtle\"}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC,MAAQ;AAChD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,EAAM,kBAAiB,GAAIF,CAAK;AAC/D,SAAIE,GAAO,UACcI,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK,IAEvD;AACT,CAAC;AACDH,EAAe,cAAc;ACR7B,MAAMU,IAAkBT,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,mBAAkB,GAAIF,CAAK;AACjE,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC9D,CAAC;AACDO,EAAgB,cAAc;ACL9B,MAAMC,IAAaV,EAAW,CAACC,GAAOC,MAAQ;AAC5C,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,cAAa,GAAIF,CAAK;AAC5D,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,OAAO,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC/D,CAAC;AACDQ,EAAW,cAAc;ACTzB,MAAMC,KAAsB,OAAO,SAAW,MAAcC,IAAkBC,ICAxE,CAACC,IAAkBC,EAAkB,IAAIC,GAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAAA,EACd,QAAQ;AACV,CAAC,GCDKC,KAAW,CAAChB,IAAQ,OAAO;AAC/B,QAAMiB,IAAWH,GAAoB,GAC/B,EAAE,KAAAI,GAAK,UAAAC,IAAW,EAAQF,GAAU,UAA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S;AAAA,cACT,OAAOmB,IAAa,yBAAyB;AAAA,cAE5C,UAAAN;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AACA,SAAAH,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IAEjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),Z=require("./text.component-Dcx3RoTp.js"),h=require("./typography.records-DZdHSCkY.js"),G=require("./icon.component-4aaCABoX.js"),M=require("./flex-DKWxn8hO.js"),o=require("react"),T=require("./factory-CkTX_WOU.js"),J=require("./create-slot-recipe-context-D-pJ8fgs.js"),K=require("./create-recipe-context-DdRyhQQD.js"),P=require("./use-field-context--wBJQY1R.js"),F=require("./use-locale-context-BdqHZ8L8.js"),l=require("./index-CZ42b9rT.js");function Q(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const t=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,t.get?t:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const U=Q(o),k=o.forwardRef((e,r)=>{const s=P.useFieldContext(),t=l.mergeProps(s.getErrorTextProps(),e);return s?.invalid?n.jsxRuntimeExports.jsx(F.ark.span,{...t,ref:r}):null});k.displayName="FieldErrorText";const H=o.forwardRef((e,r)=>{const s=P.useFieldContext(),t=l.mergeProps(s?.getHelperTextProps(),e);return n.jsxRuntimeExports.jsx(F.ark.span,{...t,ref:r})});H.displayName="FieldHelperText";const L=o.forwardRef((e,r)=>{const s=P.useFieldContext(),t=l.mergeProps(s?.getLabelProps(),e);return n.jsxRuntimeExports.jsx(F.ark.label,{...t,ref:r})});L.displayName="FieldLabel";const V=typeof window<"u"?o.useLayoutEffect:o.useEffect,[pe,X]=F.createContext({name:"FieldsetContext",hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),Y=(e={})=>{const r=X(),{ids:s,disabled:t=!!r?.disabled,invalid:a=!1,readOnly:i=!1,required:d=!1}=e,[c,g]=o.useState(!1),[b,y]=o.useState(!1),u=e.id??o.useId(),p=o.useRef(null),C=s?.control??`field::${u}`,x=s?.errorText??`field::${u}::error-text`,m=s?.helperText??`field::${u}::helper-text`,R=s?.label??`field::${u}::label`;V(()=>{const j=p.current;if(!j)return;const _=l.getWindow(j),q=_.document,A=()=>{g(!!q.getElementById(x)),y(!!q.getElementById(m))};A();const S=new _.MutationObserver(A);return S.observe(j,{childList:!0,subtree:!0}),()=>S.disconnect()},[x,m]);const E=o.useMemo(()=>{const j=[];return c&&a&&j.push(x),b&&j.push(m),j.join(" ")||void 0},[a,x,m,c,b]),w=o.useMemo(()=>()=>({...h.parts.root.attrs,id:C,ref:p,role:"group","data-disabled":l.dataAttr(t),"data-invalid":l.dataAttr(a),"data-readonly":l.dataAttr(i)}),[t,a,i,C]),N=o.useMemo(()=>()=>({...h.parts.label.attrs,id:R,"data-disabled":l.dataAttr(t),"data-invalid":l.dataAttr(a),"data-readonly":l.dataAttr(i),htmlFor:u}),[t,a,i,u,R]),f=o.useMemo(()=>()=>({"aria-describedby":E,"aria-invalid":l.ariaAttr(a),"data-invalid":l.dataAttr(a),"data-required":l.dataAttr(d),"data-readonly":l.dataAttr(i),id:u,required:d,disabled:t,readOnly:i}),[E,a,d,i,u,t]),v=o.useMemo(()=>()=>({...f(),...h.parts.input.attrs}),[f]),$=o.useMemo(()=>()=>({...f(),...h.parts.textarea.attrs}),[f]),z=o.useMemo(()=>()=>({...f(),...h.parts.select.attrs}),[f]),B=o.useMemo(()=>()=>({id:m,...h.parts.helperText.attrs,"data-disabled":l.dataAttr(t)}),[t,m]),D=o.useMemo(()=>()=>({id:x,...h.parts.errorText.attrs,"aria-live":"polite"}),[x]),W=o.useMemo(()=>()=>({"aria-hidden":!0,...h.parts.requiredIndicator.attrs}),[]);return{ariaDescribedby:E,ids:{root:C,control:u,label:R,errorText:x,helperText:m},refs:{rootRef:p},disabled:t,invalid:a,readOnly:i,required:d,getLabelProps:N,getRootProps:w,getInputProps:v,getTextareaProps:$,getSelectProps:z,getHelperTextProps:B,getErrorTextProps:D,getRequiredIndicatorProps:W}},O=o.forwardRef((e,r)=>{const[s,t]=F.createSplitProps()(e,["id","ids","disabled","invalid","readOnly","required"]),a=Y(s),i=l.mergeProps(a.getRootProps(),t);return n.jsxRuntimeExports.jsx(P.FieldProvider,{value:a,children:n.jsxRuntimeExports.jsx(F.ark.div,{...i,ref:F.composeRefs(r,a.refs.rootRef)})})});O.displayName="FieldRoot";const{useRecipeResult:ee}=K.createRecipeContext({key:"icon"}),te=U.forwardRef(function(r,s){const{styles:t,className:a,props:i}=ee({asChild:!r.as,...r});return n.jsxRuntimeExports.jsx(T.chakra.svg,{ref:s,focusable:!1,"aria-hidden":"true",...i,css:[t,r.css],className:T.cx(a,r.className)})});function re(e){const{viewBox:r="0 0 24 24",d:s,displayName:t,defaultProps:a={}}=e,i=o.Children.toArray(e.path),d=o.forwardRef((c,g)=>n.jsxRuntimeExports.jsx(te,{ref:g,asChild:!1,viewBox:r,...a,...c,children:i.length?i:n.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:s})}));return d.displayName=t,d}const{withProvider:se,withContext:I,useStyles:oe,useClassNames:ae}=J.createSlotRecipeContext({key:"field"}),ne=se(O,"root",{forwardAsChild:!0}),ie=I(L,"label",{forwardAsChild:!0}),le=I(H,"helperText",{forwardAsChild:!0}),de=I(k,"errorText",{forwardAsChild:!0});re({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"});const ce=o.forwardRef(function(r,s){const{fallback:t,children:a="*",...i}=r,d=P.useFieldContext(),c=ae(),g=oe();return d?.required?n.jsxRuntimeExports.jsx(T.chakra.span,{ref:s,"aria-hidden":"true",...i,className:T.cx(c.requiredIndicator,r.className),css:[g.requiredIndicator,r.css],children:a}):t}),ue={sm:10,md:12,lg:14},xe=e=>{const r=({disabled:s=!1,errorText:t="Field is invalid",formControlStyle:a,helperText:i,inlineField:d=!1,invalid:c=!1,invalidIconColor:g="warning",label:b,labelPosition:y="start",labelStyle:u,onContrast:p=!1,readOnly:C=!1,required:x=!1,showOptionalElement:m=!1,size:R="md",useInvalidIcon:E=!1,useInvalidText:w=!0,...N})=>{const f=n.jsxRuntimeExports.jsxs(ie,{className:"FormControl__Label",color:p?"text.contrast":"text",fontSize:h.fontSizes[R],...u,onClick:v=>{v.stopPropagation()},children:[b,n.jsxRuntimeExports.jsx(ce,{className:"FormControl__RequiredIndicator",color:p?"text.danger.contrast":"text.danger",...!x&&{fallback:m?n.jsxRuntimeExports.jsxs(Z.WrappedText,{variant:p?"subtleOnContrast":"subtle",fontSize:ue[R],children:[" ","(Optional)"]}):n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}})]});return n.jsxRuntimeExports.jsxs(ne,{className:"FormControl group",disabled:s,invalid:c,readOnly:C,required:x,width:"auto",...a,children:[n.jsxRuntimeExports.jsxs(M.Flex,{className:"FormControl__Container",flexDirection:d?"row":"column",w:d?"max-content":"100%",gap:2,children:[b&&y==="start"&&f,n.jsxRuntimeExports.jsxs(M.Flex,{className:"FormControl__Content",alignItems:"center",gap:2,w:d?"max-content":"100%",children:[n.jsxRuntimeExports.jsx(e,{disabled:s,invalid:c,onContrast:p,readOnly:C,required:x,size:R,...N}),E&&c&&n.jsxRuntimeExports.jsx(G.Icon,{className:"FormControl__InvalidIcon",name:"warningSign",variant:g,size:R})]}),b&&y==="end"&&f]}),w&&c&&n.jsxRuntimeExports.jsx(de,{className:"FormControl__ErrorText",fontSize:"xs",color:p?"text.danger.contrast":"text.danger",children:t}),i&&n.jsxRuntimeExports.jsx(le,{className:"FormControl__HelperText",fontSize:"xs",color:p?"text.subtle.contrast":"text.subtle",children:i})]})};return r.displayName=`withFormControl(${e.displayName||e.name}`,r};exports.withFormControl=xe;
|
|
2
|
-
//# sourceMappingURL=withFormControl-YVXep-WE.js.map
|