quirk-ui 0.1.77 → 0.1.79
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/{FormField-J7D8joVl.js → FormField-Rqe3qF_t.js} +62 -62
- package/dist/FormField-fg7Q2UyZ.cjs +1 -0
- package/dist/FormField.css +1 -1
- package/dist/core/components/DatePicker/index.cjs +2 -2
- package/dist/core/components/DatePicker/index.mjs +25 -25
- package/dist/core/components/Fieldset/index.cjs +1 -1
- package/dist/core/components/Fieldset/index.mjs +17 -17
- package/dist/core/components/Radio/index.cjs +1 -1
- package/dist/core/components/Radio/index.mjs +49 -49
- package/dist/core/components/Select/index.cjs +1 -1
- package/dist/core/components/Select/index.mjs +61 -61
- package/dist/core/components/Textarea/index.cjs +1 -1
- package/dist/core/components/Textarea/index.mjs +62 -62
- package/dist/index25.css +1 -1
- package/dist/index39.css +1 -1
- package/dist/index40.css +1 -1
- package/dist/index41.css +1 -1
- package/dist/index60.css +1 -1
- package/dist/next/blocks/FormBlock/FormField.cjs +1 -1
- package/dist/next/blocks/FormBlock/FormField.mjs +1 -1
- package/dist/next/blocks/FormBlock/index.cjs +1 -1
- package/dist/next/blocks/FormBlock/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/AccordionItem.css.d.ts +0 -13
- package/dist/CategoryFilters.css.d.ts +0 -31
- package/dist/FormField-CtUZKmKE.cjs +0 -1
- package/dist/FormField.css.d.ts +0 -27
- package/dist/HeroSubComponents.css.d.ts +0 -30
- package/dist/NavLink.css.d.ts +0 -72
- package/dist/index.css.d.ts +0 -1
- package/dist/index10.css.d.ts +0 -7
- package/dist/index11.css.d.ts +0 -26
- package/dist/index12.css.d.ts +0 -24
- package/dist/index13.css.d.ts +0 -33
- package/dist/index14.css.d.ts +0 -10
- package/dist/index15.css.d.ts +0 -18
- package/dist/index16.css.d.ts +0 -38
- package/dist/index17.css.d.ts +0 -16
- package/dist/index18.css.d.ts +0 -14
- package/dist/index19.css.d.ts +0 -17
- package/dist/index2.css.d.ts +0 -9
- package/dist/index20.css.d.ts +0 -13
- package/dist/index21.css.d.ts +0 -25
- package/dist/index22.css.d.ts +0 -5
- package/dist/index23.css.d.ts +0 -19
- package/dist/index24.css.d.ts +0 -21
- package/dist/index25.css.d.ts +0 -16
- package/dist/index26.css.d.ts +0 -10
- package/dist/index27.css.d.ts +0 -18
- package/dist/index28.css.d.ts +0 -16
- package/dist/index29.css.d.ts +0 -10
- package/dist/index3.css.d.ts +0 -12
- package/dist/index30.css.d.ts +0 -19
- package/dist/index31.css.d.ts +0 -15
- package/dist/index32.css.d.ts +0 -22
- package/dist/index33.css.d.ts +0 -15
- package/dist/index34.css.d.ts +0 -14
- package/dist/index35.css.d.ts +0 -23
- package/dist/index36.css.d.ts +0 -14
- package/dist/index37.css.d.ts +0 -18
- package/dist/index38.css.d.ts +0 -21
- package/dist/index39.css.d.ts +0 -20
- package/dist/index4.css.d.ts +0 -10
- package/dist/index40.css.d.ts +0 -17
- package/dist/index41.css.d.ts +0 -14
- package/dist/index42.css.d.ts +0 -22
- package/dist/index43.css.d.ts +0 -35
- package/dist/index44.css.d.ts +0 -13
- package/dist/index45.css.d.ts +0 -23
- package/dist/index46.css.d.ts +0 -12
- package/dist/index47.css.d.ts +0 -19
- package/dist/index48.css.d.ts +0 -20
- package/dist/index49.css.d.ts +0 -20
- package/dist/index5.css.d.ts +0 -22
- package/dist/index50.css.d.ts +0 -27
- package/dist/index51.css.d.ts +0 -17
- package/dist/index52.css.d.ts +0 -11
- package/dist/index53.css.d.ts +0 -12
- package/dist/index54.css.d.ts +0 -14
- package/dist/index55.css.d.ts +0 -20
- package/dist/index56.css.d.ts +0 -25
- package/dist/index57.css.d.ts +0 -13
- package/dist/index58.css.d.ts +0 -12
- package/dist/index59.css.d.ts +0 -20
- package/dist/index6.css.d.ts +0 -19
- package/dist/index60.css.d.ts +0 -20
- package/dist/index61.css.d.ts +0 -18
- package/dist/index62.css.d.ts +0 -22
- package/dist/index63.css.d.ts +0 -28
- package/dist/index64.css.d.ts +0 -26
- package/dist/index65.css.d.ts +0 -19
- package/dist/index7.css.d.ts +0 -40
- package/dist/index8.css.d.ts +0 -32
- package/dist/index9.css.d.ts +0 -9
- package/dist/styles.css.d.ts +0 -1
- package/dist/tokens.css.d.ts +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Input as
|
|
3
|
-
import { Textarea as
|
|
4
|
-
import { Select as
|
|
5
|
-
import { Checkbox as
|
|
6
|
-
import { Radio as
|
|
7
|
-
import { Fieldset as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Input as v } from "./core/components/Input/index.mjs";
|
|
3
|
+
import { Textarea as T } from "./core/components/Textarea/index.mjs";
|
|
4
|
+
import { Select as b } from "./core/components/Select/index.mjs";
|
|
5
|
+
import { Checkbox as d } from "./core/components/Checkbox/index.mjs";
|
|
6
|
+
import { Radio as W } from "./core/components/Radio/index.mjs";
|
|
7
|
+
import { Fieldset as h } from "./core/components/Fieldset/index.mjs";
|
|
8
8
|
import { DatePicker as k } from "./core/components/DatePicker/index.mjs";
|
|
9
9
|
import { Range as w } from "./core/components/Range/index.mjs";
|
|
10
|
-
import './FormField.css';const L = "
|
|
10
|
+
import './FormField.css';const L = "_formBlock_b7mbf_1", C = "_container_b7mbf_7", F = "_formInner_b7mbf_20", y = "_maxWidthSm_b7mbf_26", B = "_maxWidthMd_b7mbf_29", q = "_maxWidthLg_b7mbf_32", S = "_maxWidthFull_b7mbf_35", H = "_heading_b7mbf_41", G = "_eyebrow_b7mbf_47", M = "_title_b7mbf_51", $ = "_progress_b7mbf_57", I = "_progressHeader_b7mbf_63", D = "_stepLabel_b7mbf_69", O = "_stepCount_b7mbf_75", V = "_stepDescription_b7mbf_80", P = "_fields_b7mbf_88", R = "_fieldFull_b7mbf_95", j = "_fieldHalf_b7mbf_99", N = "_fieldThird_b7mbf_107", z = "_actions_b7mbf_117", A = "_submitButton_b7mbf_124", E = "_success_b7mbf_130", J = "_errorBanner_b7mbf_143", c = {
|
|
11
11
|
formBlock: L,
|
|
12
12
|
container: C,
|
|
13
13
|
formInner: F,
|
|
@@ -32,14 +32,14 @@ import './FormField.css';const L = "_formBlock_cu3uh_1", C = "_container_cu3uh_7
|
|
|
32
32
|
success: E,
|
|
33
33
|
errorBanner: J
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function u(e) {
|
|
36
36
|
return (e ?? []).map((r) => ({
|
|
37
37
|
label: r.label,
|
|
38
38
|
value: r.value.current,
|
|
39
39
|
disabled: r.disabled
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function p(e) {
|
|
43
43
|
return (e ?? []).map((r) => ({
|
|
44
44
|
label: r.label,
|
|
45
45
|
options: r.options.map((n) => ({
|
|
@@ -49,12 +49,12 @@ function _(e) {
|
|
|
49
49
|
}))
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
|
-
function ae({ field: e, value: r, error: n, onChange:
|
|
53
|
-
const a = e.name.current,
|
|
54
|
-
full:
|
|
55
|
-
half:
|
|
56
|
-
third:
|
|
57
|
-
}[e.width ?? "full"],
|
|
52
|
+
function ae({ field: e, value: r, error: n, onChange: o }) {
|
|
53
|
+
const a = e.name.current, _ = {
|
|
54
|
+
full: c.fieldFull,
|
|
55
|
+
half: c.fieldHalf,
|
|
56
|
+
third: c.fieldThird
|
|
57
|
+
}[e.width ?? "full"], i = {
|
|
58
58
|
id: a,
|
|
59
59
|
name: a,
|
|
60
60
|
label: e.label,
|
|
@@ -62,7 +62,7 @@ function ae({ field: e, value: r, error: n, onChange: l }) {
|
|
|
62
62
|
disabled: e.disabled,
|
|
63
63
|
helperText: e.helperText,
|
|
64
64
|
error: n
|
|
65
|
-
},
|
|
65
|
+
}, m = () => {
|
|
66
66
|
switch (e.fieldType) {
|
|
67
67
|
// ── Text-based inputs ──────────────────────────────────────────────
|
|
68
68
|
case "text":
|
|
@@ -70,103 +70,103 @@ function ae({ field: e, value: r, error: n, onChange: l }) {
|
|
|
70
70
|
case "phone":
|
|
71
71
|
case "number":
|
|
72
72
|
case "url":
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
|
|
73
|
+
return /* @__PURE__ */ s(
|
|
74
|
+
v,
|
|
75
75
|
{
|
|
76
|
-
...
|
|
76
|
+
...i,
|
|
77
77
|
type: e.fieldType === "phone" ? "tel" : e.fieldType,
|
|
78
78
|
placeholder: e.placeholder,
|
|
79
79
|
value: r ?? "",
|
|
80
80
|
minLength: e.minLength,
|
|
81
81
|
maxLength: e.maxLength,
|
|
82
82
|
fullWidth: !0,
|
|
83
|
-
onChange: (t) =>
|
|
83
|
+
onChange: (t) => o(a, t.target.value)
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
86
|
// ── Textarea ───────────────────────────────────────────────────────
|
|
87
87
|
case "textarea":
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
|
|
88
|
+
return /* @__PURE__ */ s(
|
|
89
|
+
T,
|
|
90
90
|
{
|
|
91
|
-
...
|
|
91
|
+
...i,
|
|
92
92
|
placeholder: e.placeholder,
|
|
93
93
|
value: r ?? "",
|
|
94
94
|
rows: e.rows ?? 4,
|
|
95
95
|
maxLength: e.maxLength,
|
|
96
96
|
showCharCount: e.showCharCount,
|
|
97
97
|
fullWidth: !0,
|
|
98
|
-
onChange: (t) =>
|
|
98
|
+
onChange: (t) => o(a, t.target.value)
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
101
|
// ── Select ─────────────────────────────────────────────────────────
|
|
102
102
|
case "select": {
|
|
103
|
-
const t = e.useOptionGroups ?
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
|
|
103
|
+
const t = e.useOptionGroups ? p(e.optionGroups) : u(e.options);
|
|
104
|
+
return /* @__PURE__ */ s(
|
|
105
|
+
b,
|
|
106
106
|
{
|
|
107
|
-
...
|
|
107
|
+
...i,
|
|
108
108
|
placeholder: e.placeholder,
|
|
109
109
|
options: t,
|
|
110
110
|
value: r ?? "",
|
|
111
111
|
fullWidth: !0,
|
|
112
|
-
onChange: (
|
|
112
|
+
onChange: (l) => o(a, l.target.value)
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
// ── Multi-select ───────────────────────────────────────────────────
|
|
117
117
|
case "multiselect": {
|
|
118
|
-
const t = e.useOptionGroups ?
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
|
|
118
|
+
const t = e.useOptionGroups ? p(e.optionGroups) : u(e.options);
|
|
119
|
+
return /* @__PURE__ */ s(
|
|
120
|
+
b,
|
|
121
121
|
{
|
|
122
|
-
...
|
|
122
|
+
...i,
|
|
123
123
|
multiple: !0,
|
|
124
124
|
options: t,
|
|
125
125
|
value: r ?? [],
|
|
126
126
|
showSelectedCount: !0,
|
|
127
|
-
onChange: (
|
|
127
|
+
onChange: (l) => o(a, l)
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
// ── Single checkbox ────────────────────────────────────────────────
|
|
132
132
|
case "checkbox":
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
|
|
133
|
+
return /* @__PURE__ */ s(
|
|
134
|
+
d,
|
|
135
135
|
{
|
|
136
|
-
id:
|
|
137
|
-
name:
|
|
136
|
+
id: i.id,
|
|
137
|
+
name: i.name,
|
|
138
138
|
label: e.label,
|
|
139
139
|
required: e.required,
|
|
140
140
|
disabled: e.disabled,
|
|
141
141
|
helperText: n ?? e.helperText,
|
|
142
142
|
error: !!n,
|
|
143
143
|
checked: r ?? !1,
|
|
144
|
-
onChange: (t) =>
|
|
144
|
+
onChange: (t) => o(a, t.target.checked)
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
147
|
// ── Checkbox group ─────────────────────────────────────────────────
|
|
148
148
|
case "checkboxGroup": {
|
|
149
149
|
const t = r ?? [];
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
|
|
150
|
+
return /* @__PURE__ */ s(h, { legend: e.label, error: !!n, helperText: n, children: u(e.options).map((l) => /* @__PURE__ */ s(
|
|
151
|
+
d,
|
|
152
152
|
{
|
|
153
|
-
id: `${a}-${
|
|
153
|
+
id: `${a}-${l.value}`,
|
|
154
154
|
name: `${a}[]`,
|
|
155
|
-
label:
|
|
156
|
-
checked: t.includes(
|
|
157
|
-
disabled:
|
|
155
|
+
label: l.label,
|
|
156
|
+
checked: t.includes(l.value),
|
|
157
|
+
disabled: l.disabled || e.disabled,
|
|
158
158
|
onChange: (x) => {
|
|
159
|
-
const
|
|
160
|
-
|
|
159
|
+
const f = x.target.checked ? [...t, l.value] : t.filter((g) => g !== l.value);
|
|
160
|
+
o(a, f);
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
|
|
163
|
+
l.value
|
|
164
164
|
)) });
|
|
165
165
|
}
|
|
166
166
|
// ── Radio group ────────────────────────────────────────────────────
|
|
167
167
|
case "radio":
|
|
168
|
-
return /* @__PURE__ */
|
|
169
|
-
|
|
168
|
+
return /* @__PURE__ */ s(h, { legend: e.label, error: !!n, helperText: n, children: u(e.options).map((t) => /* @__PURE__ */ s(
|
|
169
|
+
W,
|
|
170
170
|
{
|
|
171
171
|
id: `${a}-${t.value}`,
|
|
172
172
|
name: a,
|
|
@@ -175,32 +175,32 @@ function ae({ field: e, value: r, error: n, onChange: l }) {
|
|
|
175
175
|
checked: r === t.value,
|
|
176
176
|
disabled: t.disabled || e.disabled,
|
|
177
177
|
required: e.required,
|
|
178
|
-
onChange: () =>
|
|
178
|
+
onChange: () => o(a, t.value)
|
|
179
179
|
},
|
|
180
180
|
t.value
|
|
181
181
|
)) });
|
|
182
182
|
// ── Date picker ────────────────────────────────────────────────────
|
|
183
183
|
case "date":
|
|
184
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ s(
|
|
185
185
|
k,
|
|
186
186
|
{
|
|
187
|
-
id:
|
|
188
|
-
name:
|
|
187
|
+
id: i.id,
|
|
188
|
+
name: i.name,
|
|
189
189
|
label: e.label,
|
|
190
190
|
required: e.required,
|
|
191
191
|
disabled: e.disabled,
|
|
192
192
|
helperText: n ?? e.helperText,
|
|
193
193
|
error: !!n,
|
|
194
194
|
value: r ?? null,
|
|
195
|
-
onChange: (t) =>
|
|
195
|
+
onChange: (t) => o(a, t)
|
|
196
196
|
}
|
|
197
197
|
);
|
|
198
198
|
// ── Range ──────────────────────────────────────────────────────────
|
|
199
199
|
case "range":
|
|
200
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ s(
|
|
201
201
|
w,
|
|
202
202
|
{
|
|
203
|
-
...
|
|
203
|
+
...i,
|
|
204
204
|
value: r ?? e.rangeMin ?? 0,
|
|
205
205
|
min: e.rangeMin ?? 0,
|
|
206
206
|
max: e.rangeMax ?? 100,
|
|
@@ -208,12 +208,12 @@ function ae({ field: e, value: r, error: n, onChange: l }) {
|
|
|
208
208
|
valuePrefix: e.rangeValuePrefix,
|
|
209
209
|
valueSuffix: e.rangeValueSuffix,
|
|
210
210
|
showValue: !0,
|
|
211
|
-
onChange: (t) =>
|
|
211
|
+
onChange: (t) => o(a, t)
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
214
|
// ── Hidden ─────────────────────────────────────────────────────────
|
|
215
215
|
case "hidden":
|
|
216
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ s(
|
|
217
217
|
"input",
|
|
218
218
|
{
|
|
219
219
|
type: "hidden",
|
|
@@ -225,9 +225,9 @@ function ae({ field: e, value: r, error: n, onChange: l }) {
|
|
|
225
225
|
return null;
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
|
-
return e.fieldType === "hidden" ?
|
|
228
|
+
return e.fieldType === "hidden" ? m() : /* @__PURE__ */ s("div", { className: `${_}`, children: m() });
|
|
229
229
|
}
|
|
230
230
|
export {
|
|
231
231
|
ae as F,
|
|
232
|
-
|
|
232
|
+
c as s
|
|
233
233
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./FormField.css');const a=require("react/jsx-runtime"),v=require("./core/components/Input/index.cjs"),q=require("./core/components/Textarea/index.cjs"),b=require("./core/components/Select/index.cjs"),_=require("./core/components/Checkbox/index.cjs"),T=require("./core/components/Radio/index.cjs"),m=require("./core/components/Fieldset/index.cjs"),k=require("./core/components/DatePicker/index.cjs"),W=require("./core/components/Range/index.cjs"),F="_formBlock_b7mbf_1",j="_container_b7mbf_7",C="_formInner_b7mbf_20",w="_maxWidthSm_b7mbf_26",L="_maxWidthMd_b7mbf_29",y="_maxWidthLg_b7mbf_32",S="_maxWidthFull_b7mbf_35",B="_heading_b7mbf_41",$="_eyebrow_b7mbf_47",H="_title_b7mbf_51",G="_progress_b7mbf_57",I="_progressHeader_b7mbf_63",M="_stepLabel_b7mbf_69",D="_stepCount_b7mbf_75",O="_stepDescription_b7mbf_80",P="_fields_b7mbf_88",R="_fieldFull_b7mbf_95",V="_fieldHalf_b7mbf_99",N="_fieldThird_b7mbf_107",z="_actions_b7mbf_117",A="_submitButton_b7mbf_124",E="_success_b7mbf_130",J="_errorBanner_b7mbf_143",u={formBlock:F,container:j,formInner:C,maxWidthSm:w,maxWidthMd:L,maxWidthLg:y,maxWidthFull:S,heading:B,eyebrow:$,title:H,progress:G,progressHeader:I,stepLabel:M,stepCount:D,stepDescription:O,fields:P,fieldFull:R,fieldHalf:V,fieldThird:N,actions:z,submitButton:A,success:E,errorBanner:J};function i(e){return(e??[]).map(n=>({label:n.label,value:n.value.current,disabled:n.disabled}))}function h(e){return(e??[]).map(n=>({label:n.label,options:n.options.map(s=>({label:s.label,value:s.value.current,disabled:s.disabled}))}))}function K({field:e,value:n,error:s,onChange:l}){const r=e.name.current,p={full:u.fieldFull,half:u.fieldHalf,third:u.fieldThird}[e.width??"full"],c={id:r,name:r,label:e.label,required:e.required,disabled:e.disabled,helperText:e.helperText,error:s},d=()=>{switch(e.fieldType){case"text":case"email":case"phone":case"number":case"url":return a.jsx(v.Input,{...c,type:e.fieldType==="phone"?"tel":e.fieldType,placeholder:e.placeholder,value:n??"",minLength:e.minLength,maxLength:e.maxLength,fullWidth:!0,onChange:t=>l(r,t.target.value)});case"textarea":return a.jsx(q.Textarea,{...c,placeholder:e.placeholder,value:n??"",rows:e.rows??4,maxLength:e.maxLength,showCharCount:e.showCharCount,fullWidth:!0,onChange:t=>l(r,t.target.value)});case"select":{const t=e.useOptionGroups?h(e.optionGroups):i(e.options);return a.jsx(b.Select,{...c,placeholder:e.placeholder,options:t,value:n??"",fullWidth:!0,onChange:o=>l(r,o.target.value)})}case"multiselect":{const t=e.useOptionGroups?h(e.optionGroups):i(e.options);return a.jsx(b.Select,{...c,multiple:!0,options:t,value:n??[],showSelectedCount:!0,onChange:o=>l(r,o)})}case"checkbox":return a.jsx(_.Checkbox,{id:c.id,name:c.name,label:e.label,required:e.required,disabled:e.disabled,helperText:s??e.helperText,error:!!s,checked:n??!1,onChange:t=>l(r,t.target.checked)});case"checkboxGroup":{const t=n??[];return a.jsx(m.Fieldset,{legend:e.label,error:!!s,helperText:s,children:i(e.options).map(o=>a.jsx(_.Checkbox,{id:`${r}-${o.value}`,name:`${r}[]`,label:o.label,checked:t.includes(o.value),disabled:o.disabled||e.disabled,onChange:x=>{const g=x.target.checked?[...t,o.value]:t.filter(f=>f!==o.value);l(r,g)}},o.value))})}case"radio":return a.jsx(m.Fieldset,{legend:e.label,error:!!s,helperText:s,children:i(e.options).map(t=>a.jsx(T.Radio,{id:`${r}-${t.value}`,name:r,value:t.value,label:t.label,checked:n===t.value,disabled:t.disabled||e.disabled,required:e.required,onChange:()=>l(r,t.value)},t.value))});case"date":return a.jsx(k.DatePicker,{id:c.id,name:c.name,label:e.label,required:e.required,disabled:e.disabled,helperText:s??e.helperText,error:!!s,value:n??null,onChange:t=>l(r,t)});case"range":return a.jsx(W.Range,{...c,value:n??e.rangeMin??0,min:e.rangeMin??0,max:e.rangeMax??100,step:e.rangeStep??1,valuePrefix:e.rangeValuePrefix,valueSuffix:e.rangeValueSuffix,showValue:!0,onChange:t=>l(r,t)});case"hidden":return a.jsx("input",{type:"hidden",name:r,value:n??e.hiddenValue??""});default:return null}};return e.fieldType==="hidden"?d():a.jsx("div",{className:`${p}`,children:d()})}exports.FormField=K;exports.styles=u;
|
package/dist/FormField.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._formBlock_b7mbf_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_b7mbf_7{width:100%;max-width:var(--layout-width, 1250px);margin:0 auto;padding-left:var(--spacing-md);padding-right:var(--spacing-md);display:flex;flex-direction:column;gap:var(--spacing-lg)}._formInner_b7mbf_20{width:100%;margin-left:auto;margin-right:auto}._maxWidthSm_b7mbf_26{max-width:480px}._maxWidthMd_b7mbf_29{max-width:640px}._maxWidthLg_b7mbf_32{max-width:800px}._maxWidthFull_b7mbf_35{max-width:100%}._heading_b7mbf_41{display:flex;flex-direction:column;gap:var(--spacing-sm)}._eyebrow_b7mbf_47{font-weight:var(--font-weight-bold)}._title_b7mbf_51{text-wrap:balance}._progress_b7mbf_57{display:flex;flex-direction:column;gap:var(--spacing-sm)}._progressHeader_b7mbf_63{display:flex;justify-content:space-between;align-items:center}._stepLabel_b7mbf_69{font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);color:var(--color-text-primary)}._stepCount_b7mbf_75{font-size:var(--font-size-sm);color:var(--color-secondary-50)}._stepDescription_b7mbf_80{color:var(--color-secondary-75);font-size:var(--font-size-md);margin:0}._fields_b7mbf_88{display:flex;flex-wrap:wrap;gap:var(--spacing-md)}._fieldFull_b7mbf_95{width:100%}._fieldHalf_b7mbf_99{width:calc(50% - var(--spacing-md) / 2)}@media (max-width: 767px){._fieldHalf_b7mbf_99{width:100%}}._fieldThird_b7mbf_107{width:calc(33.333% - var(--spacing-md) * 2 / 3)}@media (max-width: 767px){._fieldThird_b7mbf_107{width:100%}}._actions_b7mbf_117{display:flex;align-items:center;gap:var(--spacing-md);padding-top:var(--spacing-sm)}._submitButton_b7mbf_124{margin-left:auto}._success_b7mbf_130{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-lg);padding:var(--spacing-xl);background-color:var(--color-states-success-bg);color:var(--color-states-success-text);border-radius:var(--radius-md)}._errorBanner_b7mbf_143{padding:var(--spacing-md);background-color:var(--color-states-error-bg);color:var(--color-states-error-text);border-radius:var(--radius-md);font-size:var(--font-size-sm)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index60.css');const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index60.css');const r=require("react/jsx-runtime"),i=require("react"),E=require("../../../index-rFLvzU5A.cjs"),O=require("../Label/index.cjs"),B=require("../../../x-Dft9NVe_.cjs"),P=require("../../../createLucideIcon-DpotSgUx.cjs");/**
|
|
2
2
|
* @license lucide-react v0.488.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const W=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],z=P.createLucideIcon("calendar",W),R="
|
|
6
|
+
*/const W=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],z=P.createLucideIcon("calendar",W),R="_wrapper_15mos_1",F="_inputWrapper_15mos_28",X="_input_15mos_28",A="_inputDisabled_15mos_61",G="_inputError_15mos_68",H="_icons_15mos_77",J="_calendarIcon_15mos_86",K="_iconDisabled_15mos_91",Q="_clearButton_15mos_100",U="_helperText_15mos_128",Y="_helperTextError_15mos_133",Z="_popover_15mos_138",e={wrapper:R,inputWrapper:F,input:X,inputDisabled:A,inputError:G,icons:H,calendarIcon:J,iconDisabled:K,clearButton:Q,helperText:U,helperTextError:Y,popover:Z};function V({id:k,name:D,label:y,value:a,defaultValue:$,placeholder:b="Select date",required:v=!1,disabled:s=!1,error:l=!1,helperText:_,minDate:h,maxDate:j,disabledDates:w,formatStr:I="yyyy-MM-dd",className:N,onChange:c,onValueChange:n,...S}){const[p,m]=i.useState($||a||null),[o,d]=i.useState(!1),f=i.useRef(null),u=k||`datepicker-${Math.random().toString(36).substr(2,9)}`;i.useEffect(()=>{a!==void 0&&m(a)},[a]),i.useEffect(()=>{const t=x=>{f.current&&!f.current.contains(x.target)&&d(!1)};return o&&document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[o]),i.useEffect(()=>{const t=x=>{x.key==="Escape"&&o&&d(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[o]);const L=t=>{m(t),d(!1),c==null||c(t),n==null||n(t)},T=t=>{t.stopPropagation(),m(null),c==null||c(null),n==null||n(null)},M=()=>{s||d(!o)},q=p?E.format(p,I):"";return r.jsxs("div",{ref:f,className:`${e.wrapper} ${N??""}`.trim(),children:[y&&r.jsx(O.Label,{htmlFor:u,intent:l?"error":s?"disabled":"default",required:v,disabled:s,size:"md",children:y}),r.jsxs("div",{className:e.inputWrapper,children:[r.jsx("input",{id:u,name:D,type:"text",readOnly:!0,value:q,onClick:M,placeholder:b,required:v,disabled:s,className:`${e.input} ${l?e.inputError:""} ${s?e.inputDisabled:""}`.trim(),"aria-invalid":l,"aria-describedby":_?`${u}-helper`:void 0,...S}),r.jsxs("div",{className:e.icons,children:[p&&!s&&r.jsx("button",{type:"button",onClick:T,className:e.clearButton,"aria-label":"Clear date",tabIndex:-1,children:r.jsx(B.X,{size:14})}),r.jsx(z,{size:18,className:`${e.calendarIcon} ${s?e.iconDisabled:""}`.trim()})]})]}),_&&r.jsx("div",{id:`${u}-helper`,className:`${e.helperText} ${l?e.helperTextError:""}`.trim(),children:_}),o&&r.jsx("div",{className:e.popover,children:r.jsx(E.Calendar,{selectedDate:p,onSelectDate:L,minDate:h,maxDate:j,disabledDates:w})})]})}exports.DatePicker=V;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as y, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as x, useRef as z, useEffect as v } from "react";
|
|
3
3
|
import { f as j, C as P } from "../../../index-DTDGFsW8.js";
|
|
4
4
|
import { Label as R } from "../Label/index.mjs";
|
|
@@ -15,7 +15,7 @@ const A = [
|
|
|
15
15
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
16
16
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
17
17
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
18
|
-
], G = X("calendar", A), H = "
|
|
18
|
+
], G = X("calendar", A), H = "_wrapper_15mos_1", J = "_inputWrapper_15mos_28", K = "_input_15mos_28", Q = "_inputDisabled_15mos_61", U = "_inputError_15mos_68", Y = "_icons_15mos_77", Z = "_calendarIcon_15mos_86", q = "_iconDisabled_15mos_91", V = "_clearButton_15mos_100", C = "_helperText_15mos_128", g = "_helperTextError_15mos_133", ee = "_popover_15mos_138", e = {
|
|
19
19
|
wrapper: H,
|
|
20
20
|
inputWrapper: J,
|
|
21
21
|
input: K,
|
|
@@ -29,11 +29,11 @@ const A = [
|
|
|
29
29
|
helperTextError: g,
|
|
30
30
|
popover: ee
|
|
31
31
|
};
|
|
32
|
-
function
|
|
32
|
+
function ie({
|
|
33
33
|
id: D,
|
|
34
34
|
name: $,
|
|
35
35
|
label: E,
|
|
36
|
-
value:
|
|
36
|
+
value: i,
|
|
37
37
|
defaultValue: h,
|
|
38
38
|
placeholder: b = "Select date",
|
|
39
39
|
required: k = !1,
|
|
@@ -45,36 +45,36 @@ function oe({
|
|
|
45
45
|
disabledDates: I,
|
|
46
46
|
formatStr: T = "yyyy-MM-dd",
|
|
47
47
|
className: L,
|
|
48
|
-
onChange:
|
|
49
|
-
onValueChange:
|
|
48
|
+
onChange: o,
|
|
49
|
+
onValueChange: c,
|
|
50
50
|
...M
|
|
51
51
|
}) {
|
|
52
52
|
const [a, _] = x(
|
|
53
|
-
h ||
|
|
54
|
-
), [
|
|
53
|
+
h || i || null
|
|
54
|
+
), [n, l] = x(!1), u = z(null), d = D || `datepicker-${Math.random().toString(36).substr(2, 9)}`;
|
|
55
55
|
v(() => {
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
const t = (
|
|
59
|
-
u.current && !u.current.contains(
|
|
56
|
+
i !== void 0 && _(i);
|
|
57
|
+
}, [i]), v(() => {
|
|
58
|
+
const t = (f) => {
|
|
59
|
+
u.current && !u.current.contains(f.target) && l(!1);
|
|
60
60
|
};
|
|
61
|
-
return
|
|
61
|
+
return n && document.addEventListener("mousedown", t), () => {
|
|
62
62
|
document.removeEventListener("mousedown", t);
|
|
63
63
|
};
|
|
64
|
-
}, [
|
|
65
|
-
const t = (
|
|
66
|
-
|
|
64
|
+
}, [n]), v(() => {
|
|
65
|
+
const t = (f) => {
|
|
66
|
+
f.key === "Escape" && n && l(!1);
|
|
67
67
|
};
|
|
68
68
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
69
|
-
}, [
|
|
69
|
+
}, [n]);
|
|
70
70
|
const S = (t) => {
|
|
71
|
-
_(t), l(!1),
|
|
71
|
+
_(t), l(!1), o == null || o(t), c == null || c(t);
|
|
72
72
|
}, B = (t) => {
|
|
73
|
-
t.stopPropagation(), _(null),
|
|
73
|
+
t.stopPropagation(), _(null), o == null || o(null), c == null || c(null);
|
|
74
74
|
}, O = () => {
|
|
75
|
-
s || l(!
|
|
75
|
+
s || l(!n);
|
|
76
76
|
}, W = a ? j(a, T) : "";
|
|
77
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ y(
|
|
78
78
|
"div",
|
|
79
79
|
{
|
|
80
80
|
ref: u,
|
|
@@ -91,7 +91,7 @@ function oe({
|
|
|
91
91
|
children: E
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ y("div", { className: e.inputWrapper, children: [
|
|
95
95
|
/* @__PURE__ */ r(
|
|
96
96
|
"input",
|
|
97
97
|
{
|
|
@@ -110,7 +110,7 @@ function oe({
|
|
|
110
110
|
...M
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ y("div", { className: e.icons, children: [
|
|
114
114
|
a && !s && /* @__PURE__ */ r(
|
|
115
115
|
"button",
|
|
116
116
|
{
|
|
@@ -139,7 +139,7 @@ function oe({
|
|
|
139
139
|
children: m
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
|
-
|
|
142
|
+
n && /* @__PURE__ */ r("div", { className: e.popover, children: /* @__PURE__ */ r(
|
|
143
143
|
P,
|
|
144
144
|
{
|
|
145
145
|
selectedDate: a,
|
|
@@ -154,5 +154,5 @@ function oe({
|
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
156
|
export {
|
|
157
|
-
|
|
157
|
+
ie as DatePicker
|
|
158
158
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index41.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index41.css');const l=require("react/jsx-runtime"),a=require("../Text/index.cjs"),f="_fieldset_l9gdh_1",u="_legend_l9gdh_12",g="_content_l9gdh_19",h="_helperText_l9gdh_25",x="_outlined_l9gdh_37",m="_filled_l9gdh_44",$="_disabled_l9gdh_50",T="_error_l9gdh_59",e={fieldset:f,legend:u,content:g,helperText:h,default:"_default_l9gdh_32",outlined:x,filled:m,disabled:$,error:T};function b({legend:t,variant:n="default",disabled:d=!1,error:i=!1,helperText:s,className:r,children:o,..._}){const c={default:e.default,outlined:e.outlined,filled:e.filled}[n];return l.jsxs("fieldset",{className:`${r??""} ${e.fieldset} ${c} ${d?e.disabled:""} ${i?e.error:""}`.trim(),disabled:d,..._,children:[t&&l.jsx("legend",{className:e.legend,children:t}),l.jsx("div",{className:e.content,children:o}),s&&l.jsx(a.Text,{variant:"small",className:e.helperText,children:s})]})}exports.Fieldset=b;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { Text as f } from "../Text/index.mjs";
|
|
3
|
-
import '../../../index41.css';const
|
|
4
|
-
fieldset:
|
|
5
|
-
legend:
|
|
6
|
-
content:
|
|
3
|
+
import '../../../index41.css';const h = "_fieldset_l9gdh_1", g = "_legend_l9gdh_12", u = "_content_l9gdh_19", m = "_helperText_l9gdh_25", x = "_outlined_l9gdh_37", p = "_filled_l9gdh_44", $ = "_disabled_l9gdh_50", N = "_error_l9gdh_59", e = {
|
|
4
|
+
fieldset: h,
|
|
5
|
+
legend: g,
|
|
6
|
+
content: u,
|
|
7
7
|
helperText: m,
|
|
8
|
-
default: "
|
|
9
|
-
outlined:
|
|
10
|
-
filled:
|
|
11
|
-
disabled:
|
|
12
|
-
error:
|
|
8
|
+
default: "_default_l9gdh_32",
|
|
9
|
+
outlined: x,
|
|
10
|
+
filled: p,
|
|
11
|
+
disabled: $,
|
|
12
|
+
error: N
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function v({
|
|
15
15
|
legend: t,
|
|
16
|
-
variant:
|
|
17
|
-
disabled:
|
|
18
|
-
error:
|
|
16
|
+
variant: n = "default",
|
|
17
|
+
disabled: d = !1,
|
|
18
|
+
error: i = !1,
|
|
19
19
|
helperText: s,
|
|
20
20
|
className: o,
|
|
21
21
|
children: r,
|
|
@@ -25,12 +25,12 @@ function N({
|
|
|
25
25
|
default: e.default,
|
|
26
26
|
outlined: e.outlined,
|
|
27
27
|
filled: e.filled
|
|
28
|
-
}[
|
|
28
|
+
}[n];
|
|
29
29
|
return /* @__PURE__ */ c(
|
|
30
30
|
"fieldset",
|
|
31
31
|
{
|
|
32
|
-
className: `${o ?? ""} ${e.fieldset} ${a} ${
|
|
33
|
-
disabled:
|
|
32
|
+
className: `${o ?? ""} ${e.fieldset} ${a} ${d ? e.disabled : ""} ${i ? e.error : ""}`.trim(),
|
|
33
|
+
disabled: d,
|
|
34
34
|
..._,
|
|
35
35
|
children: [
|
|
36
36
|
t && /* @__PURE__ */ l("legend", { className: e.legend, children: t }),
|
|
@@ -41,5 +41,5 @@ function N({
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
v as Fieldset
|
|
45
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index40.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index40.css');const a=require("react/jsx-runtime"),u=require("../Label/index.cjs"),j="_wrapper_1a3ho_1",w="_wrapperDisabled_1a3ho_9",x="_radioContainer_1a3ho_14",v="_radio_1a3ho_14",N="_radioCircle_1a3ho_33",f="_error_1a3ho_84",y="_sm_1a3ho_101",D="_md_1a3ho_111",E="_lg_1a3ho_121",q="_labelContainer_1a3ho_132",L="_label_1a3ho_132",R="_description_1a3ho_146",S="_descriptionError_1a3ho_153",r={wrapper:j,wrapperDisabled:w,radioContainer:x,radio:v,radioCircle:N,error:f,sm:y,md:D,lg:E,labelContainer:q,label:L,description:R,descriptionError:S};function z({id:_,name:n,value:t,label:p,checked:m,defaultChecked:h,disabled:e=!1,required:d=!1,error:o=!1,size:l="md",description:s,className:$,style:b,onChange:C,...g}){const i=_??`radio-${n}-${t}`.replace(/[^a-zA-Z0-9-]/g,"-"),c={sm:r.sm,md:r.md,lg:r.lg}[l];return a.jsxs("div",{className:`${$??""} ${r.wrapper} ${e?r.wrapperDisabled:""}`.trim(),style:b,children:[a.jsxs("div",{className:r.radioContainer,children:[a.jsx("input",{type:"radio",id:i,name:n,value:t,checked:m,defaultChecked:h,disabled:e,required:d,onChange:e?void 0:C,className:`${r.radio} ${c} ${o?r.error:""}`.trim(),"aria-invalid":o,"aria-describedby":s?`${i}-description`:void 0,...g}),a.jsx("span",{className:`${r.radioCircle} ${c}`.trim(),"aria-hidden":"true"})]}),a.jsxs("div",{className:r.labelContainer,children:[a.jsx(u.Label,{htmlFor:i,size:l,intent:o?"error":e?"disabled":"default",required:d,disabled:e,className:r.label,children:p}),s&&a.jsx("div",{id:`${i}-description`,className:`${r.description} ${o?r.descriptionError:""}`.trim(),children:s})]})]})}exports.Radio=z;
|