quirk-ui 0.1.206 → 0.1.208
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-CC54vtkW.js → FormField-CNsm6oUT.js} +86 -86
- package/dist/FormField-DKM8k1nK.cjs +1 -0
- package/dist/FormField.css +1 -1
- package/dist/core/components/Carousel/index.cjs +1 -1
- package/dist/core/components/Carousel/index.mjs +71 -71
- package/dist/core/components/Modal/index.cjs +1 -1
- package/dist/core/components/Modal/index.mjs +30 -30
- package/dist/core/tokens/theme.cjs +1 -1
- package/dist/core/tokens/theme.mjs +6 -2
- package/dist/index17.css +1 -1
- package/dist/index24.css +1 -1
- package/dist/index38.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/dist/next/cards/GridCard/index.cjs +1 -1
- package/dist/next/cards/GridCard/index.mjs +19 -19
- package/package.json +1 -1
- package/dist/AccordionItem.css.d.ts +0 -13
- package/dist/CategoryFilters.css.d.ts +0 -31
- package/dist/FormField-CrjRuF3o.cjs +0 -1
- package/dist/FormField.css.d.ts +0 -29
- package/dist/HeroSubComponents.css.d.ts +0 -36
- package/dist/NavLink.css.d.ts +0 -95
- package/dist/index.css.d.ts +0 -1
- package/dist/index10.css.d.ts +0 -10
- package/dist/index11.css.d.ts +0 -26
- package/dist/index12.css.d.ts +0 -24
- package/dist/index13.css.d.ts +0 -38
- package/dist/index14.css.d.ts +0 -9
- package/dist/index15.css.d.ts +0 -10
- package/dist/index16.css.d.ts +0 -18
- package/dist/index17.css.d.ts +0 -38
- package/dist/index18.css.d.ts +0 -16
- package/dist/index19.css.d.ts +0 -14
- package/dist/index2.css.d.ts +0 -12
- package/dist/index20.css.d.ts +0 -17
- package/dist/index21.css.d.ts +0 -13
- package/dist/index22.css.d.ts +0 -25
- package/dist/index23.css.d.ts +0 -5
- package/dist/index24.css.d.ts +0 -19
- package/dist/index25.css.d.ts +0 -21
- package/dist/index26.css.d.ts +0 -16
- package/dist/index27.css.d.ts +0 -10
- package/dist/index28.css.d.ts +0 -18
- package/dist/index29.css.d.ts +0 -16
- package/dist/index3.css.d.ts +0 -10
- package/dist/index30.css.d.ts +0 -10
- package/dist/index31.css.d.ts +0 -19
- package/dist/index32.css.d.ts +0 -15
- package/dist/index33.css.d.ts +0 -22
- package/dist/index34.css.d.ts +0 -15
- package/dist/index35.css.d.ts +0 -14
- package/dist/index36.css.d.ts +0 -23
- package/dist/index37.css.d.ts +0 -14
- package/dist/index38.css.d.ts +0 -23
- package/dist/index39.css.d.ts +0 -21
- package/dist/index4.css.d.ts +0 -22
- package/dist/index40.css.d.ts +0 -20
- package/dist/index41.css.d.ts +0 -17
- package/dist/index42.css.d.ts +0 -14
- package/dist/index43.css.d.ts +0 -22
- package/dist/index44.css.d.ts +0 -8
- package/dist/index45.css.d.ts +0 -35
- package/dist/index46.css.d.ts +0 -13
- package/dist/index47.css.d.ts +0 -23
- package/dist/index48.css.d.ts +0 -12
- package/dist/index49.css.d.ts +0 -19
- package/dist/index5.css.d.ts +0 -20
- package/dist/index50.css.d.ts +0 -20
- package/dist/index51.css.d.ts +0 -20
- package/dist/index52.css.d.ts +0 -27
- package/dist/index53.css.d.ts +0 -17
- package/dist/index54.css.d.ts +0 -11
- package/dist/index55.css.d.ts +0 -12
- package/dist/index56.css.d.ts +0 -14
- package/dist/index57.css.d.ts +0 -20
- package/dist/index58.css.d.ts +0 -24
- package/dist/index59.css.d.ts +0 -13
- package/dist/index6.css.d.ts +0 -40
- package/dist/index60.css.d.ts +0 -12
- package/dist/index61.css.d.ts +0 -20
- package/dist/index62.css.d.ts +0 -20
- package/dist/index63.css.d.ts +0 -18
- package/dist/index64.css.d.ts +0 -22
- package/dist/index65.css.d.ts +0 -28
- package/dist/index66.css.d.ts +0 -26
- package/dist/index67.css.d.ts +0 -19
- package/dist/index7.css.d.ts +0 -32
- package/dist/index8.css.d.ts +0 -9
- package/dist/index9.css.d.ts +0 -7
- package/dist/styles.css.d.ts +0 -1
- package/dist/tokens.css.d.ts +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Input as
|
|
3
|
-
import { Textarea as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Input as q } from "./core/components/Input/index.mjs";
|
|
3
|
+
import { Textarea as v } from "./core/components/Textarea/index.mjs";
|
|
4
4
|
import { Select as m } from "./core/components/Select/index.mjs";
|
|
5
5
|
import { Checkbox as _ } from "./core/components/Checkbox/index.mjs";
|
|
6
|
-
import { Radio as
|
|
6
|
+
import { Radio as T } from "./core/components/Radio/index.mjs";
|
|
7
7
|
import { Fieldset as h } from "./core/components/Fieldset/index.mjs";
|
|
8
|
-
import { DatePicker as
|
|
9
|
-
import { Range as
|
|
10
|
-
import './FormField.css';const
|
|
11
|
-
formBlock:
|
|
12
|
-
container:
|
|
13
|
-
formInner:
|
|
14
|
-
maxWidthSm:
|
|
15
|
-
maxWidthMd:
|
|
16
|
-
maxWidthLg:
|
|
8
|
+
import { DatePicker as W } from "./core/components/DatePicker/index.mjs";
|
|
9
|
+
import { Range as k } from "./core/components/Range/index.mjs";
|
|
10
|
+
import './FormField.css';const w = "_formBlock_18qf1_1", L = "_container_18qf1_7", C = "_formInner_18qf1_20", F = "_maxWidthSm_18qf1_26", y = "_maxWidthMd_18qf1_29", B = "_maxWidthLg_18qf1_32", S = "_maxWidthFull_18qf1_35", H = "_heading_18qf1_41", G = "_eyebrow_18qf1_47", M = "_title_18qf1_51", $ = "_disclaimer_18qf1_55", I = "_progress_18qf1_61", D = "_progressHeader_18qf1_67", O = "_stepLabel_18qf1_73", V = "_stepCount_18qf1_79", P = "_stepDescription_18qf1_84", R = "_fields_18qf1_92", j = "_fieldFull_18qf1_99", N = "_fieldHalf_18qf1_103", z = "_fieldThird_18qf1_111", A = "_actions_18qf1_121", E = "_submitButton_18qf1_128", J = "_success_18qf1_134", K = "_errorBanner_18qf1_149", u = {
|
|
11
|
+
formBlock: w,
|
|
12
|
+
container: L,
|
|
13
|
+
formInner: C,
|
|
14
|
+
maxWidthSm: F,
|
|
15
|
+
maxWidthMd: y,
|
|
16
|
+
maxWidthLg: B,
|
|
17
17
|
maxWidthFull: S,
|
|
18
18
|
heading: H,
|
|
19
19
|
eyebrow: G,
|
|
@@ -34,35 +34,35 @@ import './FormField.css';const L = "_formBlock_1lllk_1", C = "_container_1lllk_7
|
|
|
34
34
|
errorBanner: K
|
|
35
35
|
};
|
|
36
36
|
function c(e) {
|
|
37
|
-
return (e ?? []).map((
|
|
38
|
-
label:
|
|
39
|
-
value:
|
|
40
|
-
disabled:
|
|
37
|
+
return (e ?? []).map((r) => ({
|
|
38
|
+
label: r.label,
|
|
39
|
+
value: r.value.current,
|
|
40
|
+
disabled: r.disabled
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
43
|
function p(e) {
|
|
44
|
-
return (e ?? []).map((
|
|
45
|
-
label:
|
|
46
|
-
options:
|
|
47
|
-
label:
|
|
48
|
-
value:
|
|
49
|
-
disabled:
|
|
44
|
+
return (e ?? []).map((r) => ({
|
|
45
|
+
label: r.label,
|
|
46
|
+
options: r.options.map((n) => ({
|
|
47
|
+
label: n.label,
|
|
48
|
+
value: n.value.current,
|
|
49
|
+
disabled: n.disabled
|
|
50
50
|
}))
|
|
51
51
|
}));
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const
|
|
53
|
+
function ne({ field: e, value: r, error: n, onChange: o }) {
|
|
54
|
+
const a = e.name.current, b = {
|
|
55
55
|
full: u.fieldFull,
|
|
56
56
|
half: u.fieldHalf,
|
|
57
57
|
third: u.fieldThird
|
|
58
58
|
}[e.width ?? "full"], i = {
|
|
59
|
-
id:
|
|
60
|
-
name:
|
|
59
|
+
id: a,
|
|
60
|
+
name: a,
|
|
61
61
|
label: e.label,
|
|
62
62
|
required: e.required,
|
|
63
63
|
disabled: e.disabled,
|
|
64
64
|
helperText: e.helperText,
|
|
65
|
-
error:
|
|
65
|
+
error: n
|
|
66
66
|
}, d = () => {
|
|
67
67
|
switch (e.fieldType) {
|
|
68
68
|
// ── Text-based inputs ──────────────────────────────────────────────
|
|
@@ -71,67 +71,67 @@ function ae({ field: e, value: t, error: a, onChange: o }) {
|
|
|
71
71
|
case "phone":
|
|
72
72
|
case "number":
|
|
73
73
|
case "url":
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
|
|
74
|
+
return /* @__PURE__ */ s(
|
|
75
|
+
q,
|
|
76
76
|
{
|
|
77
77
|
...i,
|
|
78
78
|
type: e.fieldType === "phone" ? "tel" : e.fieldType,
|
|
79
79
|
placeholder: e.placeholder,
|
|
80
|
-
value:
|
|
80
|
+
value: r ?? "",
|
|
81
81
|
minLength: e.minLength,
|
|
82
82
|
maxLength: e.maxLength,
|
|
83
83
|
fullWidth: !0,
|
|
84
|
-
onChange: (
|
|
84
|
+
onChange: (t) => o(a, t.target.value)
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
// ── Textarea ───────────────────────────────────────────────────────
|
|
88
88
|
case "textarea":
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
89
|
+
return /* @__PURE__ */ s(
|
|
90
|
+
v,
|
|
91
91
|
{
|
|
92
92
|
...i,
|
|
93
93
|
placeholder: e.placeholder,
|
|
94
|
-
value:
|
|
94
|
+
value: r ?? "",
|
|
95
95
|
rows: e.rows ?? 4,
|
|
96
96
|
maxLength: e.maxLength,
|
|
97
97
|
showCharCount: e.showCharCount,
|
|
98
98
|
fullWidth: !0,
|
|
99
|
-
onChange: (
|
|
99
|
+
onChange: (t) => o(a, t.target.value)
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
// ── Select ─────────────────────────────────────────────────────────
|
|
103
103
|
case "select": {
|
|
104
|
-
const
|
|
105
|
-
return /* @__PURE__ */
|
|
104
|
+
const t = e.useOptionGroups ? p(e.optionGroups) : c(e.options);
|
|
105
|
+
return /* @__PURE__ */ s(
|
|
106
106
|
m,
|
|
107
107
|
{
|
|
108
108
|
...i,
|
|
109
109
|
placeholder: e.placeholder,
|
|
110
|
-
options:
|
|
111
|
-
value:
|
|
110
|
+
options: t,
|
|
111
|
+
value: r ?? "",
|
|
112
112
|
fullWidth: !0,
|
|
113
|
-
onChange: (
|
|
113
|
+
onChange: (l) => o(a, l.target.value)
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
// ── Multi-select ───────────────────────────────────────────────────
|
|
118
118
|
case "multiselect": {
|
|
119
|
-
const
|
|
120
|
-
return /* @__PURE__ */
|
|
119
|
+
const t = e.useOptionGroups ? p(e.optionGroups) : c(e.options);
|
|
120
|
+
return /* @__PURE__ */ s(
|
|
121
121
|
m,
|
|
122
122
|
{
|
|
123
123
|
...i,
|
|
124
124
|
multiple: !0,
|
|
125
|
-
options:
|
|
126
|
-
value:
|
|
125
|
+
options: t,
|
|
126
|
+
value: r ?? [],
|
|
127
127
|
showSelectedCount: !0,
|
|
128
|
-
onChange: (
|
|
128
|
+
onChange: (l) => o(a, l)
|
|
129
129
|
}
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
// ── Single checkbox ────────────────────────────────────────────────
|
|
133
133
|
case "checkbox":
|
|
134
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ s(
|
|
135
135
|
_,
|
|
136
136
|
{
|
|
137
137
|
id: i.id,
|
|
@@ -139,96 +139,96 @@ function ae({ field: e, value: t, error: a, onChange: o }) {
|
|
|
139
139
|
label: e.label,
|
|
140
140
|
required: e.required,
|
|
141
141
|
disabled: e.disabled,
|
|
142
|
-
helperText:
|
|
143
|
-
error: !!
|
|
144
|
-
checked:
|
|
145
|
-
onChange: (
|
|
142
|
+
helperText: n ?? e.helperText,
|
|
143
|
+
error: !!n,
|
|
144
|
+
checked: r ?? !1,
|
|
145
|
+
onChange: (t) => o(a, t.target.checked)
|
|
146
146
|
}
|
|
147
147
|
);
|
|
148
148
|
// ── Checkbox group ─────────────────────────────────────────────────
|
|
149
149
|
case "checkboxGroup": {
|
|
150
|
-
const
|
|
151
|
-
return /* @__PURE__ */
|
|
150
|
+
const t = r ?? [];
|
|
151
|
+
return /* @__PURE__ */ s(h, { legend: e.label, error: !!n, helperText: n, children: c(e.options).map((l) => /* @__PURE__ */ s(
|
|
152
152
|
_,
|
|
153
153
|
{
|
|
154
|
-
id: `${
|
|
155
|
-
name: `${
|
|
156
|
-
label:
|
|
157
|
-
checked:
|
|
158
|
-
disabled:
|
|
154
|
+
id: `${a}-${l.value}`,
|
|
155
|
+
name: `${a}[]`,
|
|
156
|
+
label: l.label,
|
|
157
|
+
checked: t.includes(l.value),
|
|
158
|
+
disabled: l.disabled || e.disabled,
|
|
159
159
|
onChange: (x) => {
|
|
160
|
-
const
|
|
161
|
-
o(
|
|
160
|
+
const f = x.target.checked ? [...t, l.value] : t.filter((g) => g !== l.value);
|
|
161
|
+
o(a, f);
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
|
-
|
|
164
|
+
l.value
|
|
165
165
|
)) });
|
|
166
166
|
}
|
|
167
167
|
// ── Radio group ────────────────────────────────────────────────────
|
|
168
168
|
case "radio":
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
|
|
169
|
+
return /* @__PURE__ */ s(h, { legend: e.label, error: !!n, helperText: n, children: c(e.options).map((t) => /* @__PURE__ */ s(
|
|
170
|
+
T,
|
|
171
171
|
{
|
|
172
|
-
id: `${
|
|
173
|
-
name:
|
|
174
|
-
value:
|
|
175
|
-
label:
|
|
176
|
-
checked:
|
|
177
|
-
disabled:
|
|
172
|
+
id: `${a}-${t.value}`,
|
|
173
|
+
name: a,
|
|
174
|
+
value: t.value,
|
|
175
|
+
label: t.label,
|
|
176
|
+
checked: r === t.value,
|
|
177
|
+
disabled: t.disabled || e.disabled,
|
|
178
178
|
required: e.required,
|
|
179
|
-
onChange: () => o(
|
|
179
|
+
onChange: () => o(a, t.value)
|
|
180
180
|
},
|
|
181
|
-
|
|
181
|
+
t.value
|
|
182
182
|
)) });
|
|
183
183
|
// ── Date picker ────────────────────────────────────────────────────
|
|
184
184
|
case "date":
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
|
|
185
|
+
return /* @__PURE__ */ s(
|
|
186
|
+
W,
|
|
187
187
|
{
|
|
188
188
|
id: i.id,
|
|
189
189
|
name: i.name,
|
|
190
190
|
label: e.label,
|
|
191
191
|
required: e.required,
|
|
192
192
|
disabled: e.disabled,
|
|
193
|
-
helperText:
|
|
194
|
-
error: !!
|
|
195
|
-
value:
|
|
196
|
-
onChange: (
|
|
193
|
+
helperText: n ?? e.helperText,
|
|
194
|
+
error: !!n,
|
|
195
|
+
value: r ?? null,
|
|
196
|
+
onChange: (t) => o(a, t)
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
199
|
// ── Range ──────────────────────────────────────────────────────────
|
|
200
200
|
case "range":
|
|
201
|
-
return /* @__PURE__ */
|
|
202
|
-
|
|
201
|
+
return /* @__PURE__ */ s(
|
|
202
|
+
k,
|
|
203
203
|
{
|
|
204
204
|
...i,
|
|
205
|
-
value:
|
|
205
|
+
value: r ?? e.rangeMin ?? 0,
|
|
206
206
|
min: e.rangeMin ?? 0,
|
|
207
207
|
max: e.rangeMax ?? 100,
|
|
208
208
|
step: e.rangeStep ?? 1,
|
|
209
209
|
valuePrefix: e.rangeValuePrefix,
|
|
210
210
|
valueSuffix: e.rangeValueSuffix,
|
|
211
211
|
showValue: !0,
|
|
212
|
-
onChange: (
|
|
212
|
+
onChange: (t) => o(a, t)
|
|
213
213
|
}
|
|
214
214
|
);
|
|
215
215
|
// ── Hidden ─────────────────────────────────────────────────────────
|
|
216
216
|
case "hidden":
|
|
217
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ s(
|
|
218
218
|
"input",
|
|
219
219
|
{
|
|
220
220
|
type: "hidden",
|
|
221
|
-
name:
|
|
222
|
-
value:
|
|
221
|
+
name: a,
|
|
222
|
+
value: r ?? e.hiddenValue ?? ""
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
225
|
default:
|
|
226
226
|
return null;
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
return e.fieldType === "hidden" ? d() : /* @__PURE__ */
|
|
229
|
+
return e.fieldType === "hidden" ? d() : /* @__PURE__ */ s("div", { className: `${b}`, children: d() });
|
|
230
230
|
}
|
|
231
231
|
export {
|
|
232
|
-
|
|
232
|
+
ne as F,
|
|
233
233
|
u as s
|
|
234
234
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./FormField.css');const a=require("react/jsx-runtime"),f=require("./core/components/Input/index.cjs"),v=require("./core/components/Textarea/index.cjs"),_=require("./core/components/Select/index.cjs"),h=require("./core/components/Checkbox/index.cjs"),T=require("./core/components/Radio/index.cjs"),p=require("./core/components/Fieldset/index.cjs"),k=require("./core/components/DatePicker/index.cjs"),W=require("./core/components/Range/index.cjs"),F="_formBlock_18qf1_1",j="_container_18qf1_7",C="_formInner_18qf1_20",w="_maxWidthSm_18qf1_26",L="_maxWidthMd_18qf1_29",y="_maxWidthLg_18qf1_32",S="_maxWidthFull_18qf1_35",B="_heading_18qf1_41",$="_eyebrow_18qf1_47",H="_title_18qf1_51",G="_disclaimer_18qf1_55",I="_progress_18qf1_61",M="_progressHeader_18qf1_67",D="_stepLabel_18qf1_73",O="_stepCount_18qf1_79",P="_stepDescription_18qf1_84",R="_fields_18qf1_92",V="_fieldFull_18qf1_99",N="_fieldHalf_18qf1_103",z="_fieldThird_18qf1_111",A="_actions_18qf1_121",E="_submitButton_18qf1_128",J="_success_18qf1_134",K="_errorBanner_18qf1_149",u={formBlock:F,container:j,formInner:C,maxWidthSm:w,maxWidthMd:L,maxWidthLg:y,maxWidthFull:S,heading:B,eyebrow:$,title:H,disclaimer:G,progress:I,progressHeader:M,stepLabel:D,stepCount:O,stepDescription:P,fields:R,fieldFull:V,fieldHalf:N,fieldThird:z,actions:A,submitButton:E,success:J,errorBanner:K};function i(e){return(e??[]).map(n=>({label:n.label,value:n.value.current,disabled:n.disabled}))}function m(e){return(e??[]).map(n=>({label:n.label,options:n.options.map(s=>({label:s.label,value:s.value.current,disabled:s.disabled}))}))}function Q({field:e,value:n,error:s,onChange:l}){const r=e.name.current,x={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(f.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(v.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?m(e.optionGroups):i(e.options);return a.jsx(_.Select,{...c,placeholder:e.placeholder,options:t,value:n??"",fullWidth:!0,onChange:o=>l(r,o.target.value)})}case"multiselect":{const t=e.useOptionGroups?m(e.optionGroups):i(e.options);return a.jsx(_.Select,{...c,multiple:!0,options:t,value:n??[],showSelectedCount:!0,onChange:o=>l(r,o)})}case"checkbox":return a.jsx(h.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(p.Fieldset,{legend:e.label,error:!!s,helperText:s,children:i(e.options).map(o=>a.jsx(h.Checkbox,{id:`${r}-${o.value}`,name:`${r}[]`,label:o.label,checked:t.includes(o.value),disabled:o.disabled||e.disabled,onChange:b=>{const q=b.target.checked?[...t,o.value]:t.filter(g=>g!==o.value);l(r,q)}},o.value))})}case"radio":return a.jsx(p.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:`${x}`,children:d()})}exports.FormField=Q;exports.styles=u;
|
package/dist/FormField.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._formBlock_18qf1_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_18qf1_7{width:100%;max-width:var(--layout-width, 1250px);margin:0 auto;padding-left:var(--site-gutter);padding-right:var(--site-gutter);display:flex;flex-direction:column;gap:var(--spacing-lg)}._formInner_18qf1_20{width:100%;margin-left:auto;margin-right:auto}._maxWidthSm_18qf1_26{max-width:480px}._maxWidthMd_18qf1_29{max-width:640px}._maxWidthLg_18qf1_32{max-width:800px}._maxWidthFull_18qf1_35{max-width:100%}._heading_18qf1_41{display:flex;flex-direction:column;gap:var(--spacing-sm)}._eyebrow_18qf1_47{font-weight:var(--font-weight-bold)}._title_18qf1_51{text-wrap:balance}._disclaimer_18qf1_55{font-size:var(--font-size-sm)}._progress_18qf1_61{display:flex;flex-direction:column;gap:var(--spacing-sm)}._progressHeader_18qf1_67{display:flex;justify-content:space-between;align-items:center}._stepLabel_18qf1_73{font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);color:var(--color-text-primary)}._stepCount_18qf1_79{font-size:var(--font-size-sm);color:var(--color-secondary-50)}._stepDescription_18qf1_84{color:var(--color-secondary-75);font-size:var(--font-size-md);margin:0}._fields_18qf1_92{display:flex;flex-wrap:wrap;gap:var(--spacing-md)}._fieldFull_18qf1_99{width:100%}._fieldHalf_18qf1_103{width:calc(50% - var(--spacing-md) / 2)}@media (max-width: 767px){._fieldHalf_18qf1_103{width:100%}}._fieldThird_18qf1_111{width:calc(33.333% - var(--spacing-md) * 2 / 3)}@media (max-width: 767px){._fieldThird_18qf1_111{width:100%}}._actions_18qf1_121{display:flex;align-items:center;gap:var(--spacing-md);padding-top:var(--spacing-sm)}._submitButton_18qf1_128{margin-left:auto}._success_18qf1_134{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-lg);padding:var(--spacing-md) 0 0}._success_18qf1_134 p{color:var(--color-states-success-bg);font-weight:var(--font-weight-semibold)}._errorBanner_18qf1_149{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)}.removePaddingAll ._container_18qf1_7{padding:0}.split ._container_18qf1_7{flex-direction:row;gap:3rem}.split ._heading_18qf1_41,.split form{flex:.5}@media (max-width: 767px){.split ._container_18qf1_7{flex-direction:column}.split ._heading_18qf1_41,.split form{flex:1}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index24.css');const c=require("react/jsx-runtime"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index24.css');const c=require("react/jsx-runtime"),s=require("react"),je=require("../../../arrow-left-4E3t8axP.cjs"),Ce=require("../../../arrow-right-DO6S4vfx.cjs"),Se="_carousel_jrudo_1",ke="_noPointerEvents_jrudo_21",Ee="_trackContainer_jrudo_25",De="_track_jrudo_25",Ie="_isMounted_jrudo_39",Xe="_page_jrudo_44",Ne="_controls_jrudo_54",Re="_indicators_jrudo_65",Ae="_indicator_jrudo_65",Te="_active_jrudo_87",Le="_buttons_jrudo_106",We="_prev_jrudo_111",Pe="_disabled_jrudo_111",qe="_next_jrudo_112",ze="_expandable_jrudo_147",a={carousel:Se,noPointerEvents:ke,trackContainer:Ee,track:De,isMounted:Ie,page:Xe,controls:Ne,indicators:Re,indicator:Ae,active:Te,buttons:Le,prev:We,disabled:Pe,next:qe,expandable:ze};function Ye({items:m,itemsPerPage:p=3,itemsPerRow:G=3,autoplay:J=!1,autoplayInterval:T=3,className:Q,parentRef:Z,siblingRef:v,isSplit:L=!1,isExpandable:ee=!1,ariaLabel:te="Carousel"}){const[i,_]=s.useState(0),[u,$]=s.useState(0),[M,D]=s.useState(0),[r,ne]=s.useState(p),[w,se]=s.useState(!1),[W,oe]=s.useState(J),[j,re]=s.useState(!1),[ae,ce]=s.useState(!1),le=s.useRef(null),h=s.useRef(null),b=s.useRef(null),C=Z,[x,I]=s.useState(!1),[P,q]=s.useState(null),[S,z]=s.useState(null),[Y,B]=s.useState(null),[ie,H]=s.useState(!1),[g,K]=s.useState(null),[X,O]=s.useState(null),ue=e=>{Math.abs((X??0)-(g??0))>25&&(e.stopPropagation(),e.preventDefault())},de=e=>{K(e.clientX)},he=e=>{g!==null&&Math.abs(e.clientX-g)>5&&(H(!0),O(e.clientX))},fe=()=>{if(!g||!X){N();return}const e=g-X;Math.abs(e)>50&&(e>0?k():E()),N()},pe=()=>{N()},N=()=>{H(!1),K(null),O(null)},ve=e=>{e.key==="ArrowLeft"?(e.preventDefault(),E()):e.key==="ArrowRight"?(e.preventDefault(),k()):e.key==="Home"?(e.preventDefault(),f(0)):e.key==="End"&&(e.preventDefault(),f(l-1))},_e=e=>{z(e.touches[0].clientX),q(e.touches[0].clientY),I(!1)},U=s.useRef(null);s.useEffect(()=>{ce(!0)},[]),s.useEffect(()=>{const e=U.current;if(!e)return;const t=n=>{const o=n.touches[0].clientX-(S??0),d=n.touches[0].clientY-(P??0);!x&&Math.abs(o)>Math.abs(d)&&I(!0),x&&(n.preventDefault(),B(n.touches[0].clientX))};return e.addEventListener("touchmove",t,{passive:!0}),()=>{e.removeEventListener("touchmove",t)}},[x,S,P]);const Me=()=>{if(S===null||Y===null)return;const e=S-Y;Math.abs(e)>50&&(e>0?k():E()),z(null),B(null),q(null),I(!1)},we=(e,t)=>{const n=[];for(let o=0;o<e.length;o+=t)n.push(e.slice(o,o+t));return n};s.useLayoutEffect(()=>{if(typeof window<"u"){const e=()=>{const t=window.innerWidth<768,n=t?1:p;se(t),ne(t?1:p),_(o=>Math.min(o,Math.ceil(m.length/n)-1))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}},[p]);const R=Math.ceil(r/G),V=we(m,r),l=V.length,me=3*16,be=3*16,xe=s.useCallback(e=>{if(e&&!j){const t=e.getBoundingClientRect().width;t>0&&t!==M&&(D(t),re(!0))}},[M,j]);s.useEffect(()=>{var e,t,n,o;if(j&&u>0&&h.current&&((t=(e=h.current.children[0])==null?void 0:e.children[0])!=null&&t.children[0])){const y=((o=(n=h.current.children[0])==null?void 0:n.children[0])==null?void 0:o.children[0]).getBoundingClientRect().width;y>0&&y!==M&&D(y)}},[u,j,M]),s.useEffect(()=>{const e=new ResizeObserver(t=>{var n,o;for(let d of t)if(d.contentRect){w?$(d.contentRect.width-be):L?v!=null&&v.current?$(d.contentRect.width-((n=v==null?void 0:v.current)==null?void 0:n.offsetWidth)-me):$(d.contentRect.width):($(d.contentRect.width),D(((o=h==null?void 0:h.current)==null?void 0:o.children[0].children[0].children[0].getBoundingClientRect().width)??0));const y=w?1:p;_($e=>Math.min($e,Math.ceil(m.length/y)-1))}});return C!=null&&C.current&&e.observe(C.current),()=>e.disconnect()},[w,L,m]);const A=()=>{b.current&&clearInterval(b.current),oe(!1)},k=()=>{A(),_(e=>Math.min(e+1,l-1))},E=()=>{A(),_(e=>Math.max(e-1,0))},f=e=>{A(),_(e)},ge=()=>u?`translateX(-${i*u}px)`:"translateX(0px)",F=()=>{_(e=>e>=l-1?0:e+1)};s.useEffect(()=>(W&&(b.current=setInterval(F,T*1e3)),()=>{b.current&&clearInterval(b.current)}),[W,T,F]);const ye={"--max-item-width":`${(u-(r-1)*16)/r}px`};return c.jsxs("div",{className:`${Q??""} ${a.carousel}`,ref:le,role:"region","aria-label":te,"aria-roledescription":"carousel",tabIndex:0,onKeyDown:ve,style:{outline:"none"},children:[c.jsx("div",{ref:U,className:`${a.trackContainer} ${ie||x?a.noPointerEvents:""}`,style:{maxWidth:`${u}px`,touchAction:x?"none":"pan-y"},onTouchStart:_e,onTouchEnd:Me,onMouseDown:de,onMouseMove:he,onMouseUp:fe,onMouseLeave:pe,children:c.jsx("div",{ref:h,className:`${a.track} ${ae?a.isMounted:""}`,style:{width:`${l*100}%`,transform:ge()},id:"carousel-track","aria-live":"polite","aria-atomic":"true","aria-label":`Slide ${i+1} of ${l}`,children:V.map((e,t)=>c.jsx("div",{className:`${a.page} ${ee?a.expandable:""}`,style:{display:R>1?"grid":"flex",gridTemplateColumns:`repeat(${Math.ceil(r/R)}, 1fr)`,gridTemplateRows:`repeat(${R}, 1fr)`,width:`${u}px`,margin:`${r>1?"unset":"0 auto"}`,justifyContent:`${r>1?"unset":"center"}`},children:e.map((n,o)=>c.jsx("div",{ref:t===0&&o===0?xe:null,onClickCapture:ue,style:{...ye,display:r>1?"unset":"flex",justifyContent:r>1?"unset":"center",alignItems:r>1?"unset":"flex-start",flexBasis:r>1?w?"100%":`${(u-(r-1)*16)/r}px`:"unset",width:r>1?w?`${u/r-16}px`:"unset":"100%"},children:n},o))},t))})}),l>1&&c.jsxs("div",{className:a.controls,style:{maxWidth:M>0&&p===1&&!w?`${M}px`:"unset"},children:[c.jsx("div",{className:a.indicators,role:"tablist","aria-label":"Slide indicators",children:Array.from({length:l}).map((e,t)=>c.jsx("button",{role:"tab","aria-selected":t===i,"aria-label":`Slide ${t+1} of ${l}`,"aria-controls":"carousel-track",tabIndex:t===i?0:-1,className:`${a.indicator} ${t===i?a.active:""}`,onClick:()=>f(t),onKeyDown:n=>{n.key==="ArrowRight"?(n.preventDefault(),f(Math.min(t+1,l-1))):n.key==="ArrowLeft"?(n.preventDefault(),f(Math.max(t-1,0))):n.key==="Home"?(n.preventDefault(),f(0)):n.key==="End"&&(n.preventDefault(),f(l-1))}},t))}),c.jsxs("div",{className:a.buttons,children:[c.jsx("button",{"aria-label":"Previous slide",className:`${a.prev} ${i===0?a.disabled:""}`,onClick:E,disabled:i===0,children:c.jsx(je.ArrowLeft,{size:36})}),c.jsx("button",{"aria-label":"Next slide",className:`${a.next} ${i>=l-1?a.disabled:""}`,onClick:k,disabled:i>=m.length-r,children:c.jsx(Ce.ArrowRight,{size:36})})]})]})]})}exports.Carousel=Ye;
|