quirk-ui 0.1.175 → 0.1.177

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.
@@ -1,31 +1,31 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
2
  import { Input as v } from "./core/components/Input/index.mjs";
3
3
  import { Textarea as T } 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
6
  import { Radio as W } from "./core/components/Radio/index.mjs";
7
- import { Fieldset as b } from "./core/components/Fieldset/index.mjs";
7
+ import { Fieldset as h } from "./core/components/Fieldset/index.mjs";
8
8
  import { DatePicker as f } from "./core/components/DatePicker/index.mjs";
9
9
  import { Range as k } from "./core/components/Range/index.mjs";
10
- import './FormField.css';const w = "_formBlock_1jbl0_1", L = "_container_1jbl0_7", C = "_formInner_1jbl0_20", F = "_maxWidthSm_1jbl0_26", y = "_maxWidthMd_1jbl0_29", B = "_maxWidthLg_1jbl0_32", q = "_maxWidthFull_1jbl0_35", S = "_heading_1jbl0_41", H = "_eyebrow_1jbl0_47", G = "_title_1jbl0_51", M = "_disclaimer_1jbl0_55", $ = "_progress_1jbl0_61", I = "_progressHeader_1jbl0_67", D = "_stepLabel_1jbl0_73", O = "_stepCount_1jbl0_79", V = "_stepDescription_1jbl0_84", P = "_fields_1jbl0_92", R = "_fieldFull_1jbl0_99", N = "_fieldHalf_1jbl0_103", z = "_fieldThird_1jbl0_111", A = "_actions_1jbl0_121", E = "_submitButton_1jbl0_128", J = "_success_1jbl0_134", K = "_errorBanner_1jbl0_149", u = {
10
+ import './FormField.css';const w = "_formBlock_8cqr5_1", L = "_container_8cqr5_7", C = "_formInner_8cqr5_20", F = "_maxWidthSm_8cqr5_26", y = "_maxWidthMd_8cqr5_29", B = "_maxWidthLg_8cqr5_32", S = "_maxWidthFull_8cqr5_35", H = "_heading_8cqr5_41", G = "_eyebrow_8cqr5_47", M = "_title_8cqr5_51", $ = "_disclaimer_8cqr5_55", I = "_progress_8cqr5_61", D = "_progressHeader_8cqr5_67", O = "_stepLabel_8cqr5_73", V = "_stepCount_8cqr5_79", P = "_stepDescription_8cqr5_84", R = "_fields_8cqr5_92", j = "_fieldFull_8cqr5_99", N = "_fieldHalf_8cqr5_103", z = "_fieldThird_8cqr5_111", A = "_actions_8cqr5_121", E = "_submitButton_8cqr5_128", J = "_success_8cqr5_134", K = "_errorBanner_8cqr5_149", u = {
11
11
  formBlock: w,
12
12
  container: L,
13
13
  formInner: C,
14
14
  maxWidthSm: F,
15
15
  maxWidthMd: y,
16
16
  maxWidthLg: B,
17
- maxWidthFull: q,
18
- heading: S,
19
- eyebrow: H,
20
- title: G,
21
- disclaimer: M,
22
- progress: $,
23
- progressHeader: I,
24
- stepLabel: D,
25
- stepCount: O,
26
- stepDescription: V,
27
- fields: P,
28
- fieldFull: R,
17
+ maxWidthFull: S,
18
+ heading: H,
19
+ eyebrow: G,
20
+ title: M,
21
+ disclaimer: $,
22
+ progress: I,
23
+ progressHeader: D,
24
+ stepLabel: O,
25
+ stepCount: V,
26
+ stepDescription: P,
27
+ fields: R,
28
+ fieldFull: j,
29
29
  fieldHalf: N,
30
30
  fieldThird: z,
31
31
  actions: A,
@@ -33,36 +33,36 @@ import './FormField.css';const w = "_formBlock_1jbl0_1", L = "_container_1jbl0_7
33
33
  success: J,
34
34
  errorBanner: K
35
35
  };
36
- function c(e) {
37
- return (e ?? []).map((r) => ({
38
- label: r.label,
39
- value: r.value.current,
40
- disabled: r.disabled
36
+ function i(e) {
37
+ return (e ?? []).map((t) => ({
38
+ label: t.label,
39
+ value: t.value.current,
40
+ disabled: t.disabled
41
41
  }));
42
42
  }
43
- function h(e) {
44
- return (e ?? []).map((r) => ({
45
- label: r.label,
46
- options: r.options.map((l) => ({
47
- label: l.label,
48
- value: l.value.current,
49
- disabled: l.disabled
43
+ function p(e) {
44
+ return (e ?? []).map((t) => ({
45
+ label: t.label,
46
+ options: t.options.map((n) => ({
47
+ label: n.label,
48
+ value: n.value.current,
49
+ disabled: n.disabled
50
50
  }))
51
51
  }));
52
52
  }
53
- function le({ field: e, value: r, error: l, onChange: o }) {
54
- const a = e.name.current, p = {
53
+ function ne({ field: e, value: t, error: n, onChange: c }) {
54
+ const a = e.name.current, b = {
55
55
  full: u.fieldFull,
56
56
  half: u.fieldHalf,
57
57
  third: u.fieldThird
58
- }[e.width ?? "full"], i = {
58
+ }[e.width ?? "full"], o = {
59
59
  id: a,
60
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: l
65
+ error: n
66
66
  }, d = () => {
67
67
  switch (e.fieldType) {
68
68
  // ── Text-based inputs ──────────────────────────────────────────────
@@ -71,164 +71,164 @@ function le({ field: e, value: r, error: l, onChange: o }) {
71
71
  case "phone":
72
72
  case "number":
73
73
  case "url":
74
- return /* @__PURE__ */ n(
74
+ return /* @__PURE__ */ s(
75
75
  v,
76
76
  {
77
- ...i,
77
+ ...o,
78
78
  type: e.fieldType === "phone" ? "tel" : e.fieldType,
79
79
  placeholder: e.placeholder,
80
- value: r ?? "",
80
+ value: t ?? "",
81
81
  minLength: e.minLength,
82
82
  maxLength: e.maxLength,
83
83
  fullWidth: !0,
84
- onChange: (t) => o(a, t.target.value)
84
+ onChange: (r) => c(a, r.target.value)
85
85
  }
86
86
  );
87
87
  // ── Textarea ───────────────────────────────────────────────────────
88
88
  case "textarea":
89
- return /* @__PURE__ */ n(
89
+ return /* @__PURE__ */ s(
90
90
  T,
91
91
  {
92
- ...i,
92
+ ...o,
93
93
  placeholder: e.placeholder,
94
- value: r ?? "",
94
+ value: t ?? "",
95
95
  rows: e.rows ?? 4,
96
96
  maxLength: e.maxLength,
97
97
  showCharCount: e.showCharCount,
98
98
  fullWidth: !0,
99
- onChange: (t) => o(a, t.target.value)
99
+ onChange: (r) => c(a, r.target.value)
100
100
  }
101
101
  );
102
102
  // ── Select ─────────────────────────────────────────────────────────
103
103
  case "select": {
104
- const t = e.useOptionGroups ? h(e.optionGroups) : c(e.options);
105
- return /* @__PURE__ */ n(
104
+ const r = e.useOptionGroups ? p(e.optionGroups) : i(e.options);
105
+ return /* @__PURE__ */ s(
106
106
  m,
107
107
  {
108
- ...i,
108
+ ...o,
109
109
  placeholder: e.placeholder,
110
- options: t,
111
- value: r ?? "",
110
+ options: r,
111
+ value: t ?? "",
112
112
  fullWidth: !0,
113
- onChange: (s) => o(a, s.target.value)
113
+ onChange: (l) => c(a, l.target.value)
114
114
  }
115
115
  );
116
116
  }
117
117
  // ── Multi-select ───────────────────────────────────────────────────
118
118
  case "multiselect": {
119
- const t = e.useOptionGroups ? h(e.optionGroups) : c(e.options);
120
- return /* @__PURE__ */ n(
119
+ const r = e.useOptionGroups ? p(e.optionGroups) : i(e.options);
120
+ return /* @__PURE__ */ s(
121
121
  m,
122
122
  {
123
- ...i,
123
+ ...o,
124
124
  multiple: !0,
125
- options: t,
126
- value: r ?? [],
125
+ options: r,
126
+ value: t ?? [],
127
127
  showSelectedCount: !0,
128
- onChange: (s) => o(a, s)
128
+ onChange: (l) => c(a, l)
129
129
  }
130
130
  );
131
131
  }
132
132
  // ── Single checkbox ────────────────────────────────────────────────
133
133
  case "checkbox":
134
- return /* @__PURE__ */ n(
134
+ return /* @__PURE__ */ s(
135
135
  _,
136
136
  {
137
- id: i.id,
138
- name: i.name,
137
+ id: o.id,
138
+ name: o.name,
139
139
  label: e.label,
140
140
  required: e.required,
141
141
  disabled: e.disabled,
142
- helperText: l ?? e.helperText,
143
- error: !!l,
144
- checked: r ?? !1,
145
- onChange: (t) => o(a, t.target.checked)
142
+ helperText: n ?? e.helperText,
143
+ error: !!n,
144
+ checked: t ?? !1,
145
+ onChange: (r) => c(a, r.target.checked)
146
146
  }
147
147
  );
148
148
  // ── Checkbox group ─────────────────────────────────────────────────
149
149
  case "checkboxGroup": {
150
- const t = r ?? [];
151
- return /* @__PURE__ */ n(b, { legend: e.label, error: !!l, helperText: l, children: c(e.options).map((s) => /* @__PURE__ */ n(
150
+ const r = t ?? [];
151
+ return /* @__PURE__ */ s(h, { legend: e.label, error: !!n, helperText: n, children: i(e.options).map((l) => /* @__PURE__ */ s(
152
152
  _,
153
153
  {
154
- id: `${a}-${s.value}`,
154
+ id: `${a}-${l.value}`,
155
155
  name: `${a}[]`,
156
- label: s.label,
157
- checked: t.includes(s.value),
158
- disabled: s.disabled || e.disabled,
156
+ label: l.label,
157
+ checked: r.includes(l.value),
158
+ disabled: l.disabled || e.disabled,
159
159
  onChange: (x) => {
160
- const g = x.target.checked ? [...t, s.value] : t.filter((j) => j !== s.value);
161
- o(a, g);
160
+ const g = x.target.checked ? [...r, l.value] : r.filter((q) => q !== l.value);
161
+ c(a, g);
162
162
  }
163
163
  },
164
- s.value
164
+ l.value
165
165
  )) });
166
166
  }
167
167
  // ── Radio group ────────────────────────────────────────────────────
168
168
  case "radio":
169
- return /* @__PURE__ */ n(b, { legend: e.label, error: !!l, helperText: l, children: c(e.options).map((t) => /* @__PURE__ */ n(
169
+ return /* @__PURE__ */ s(h, { legend: e.label, error: !!n, helperText: n, children: i(e.options).map((r) => /* @__PURE__ */ s(
170
170
  W,
171
171
  {
172
- id: `${a}-${t.value}`,
172
+ id: `${a}-${r.value}`,
173
173
  name: a,
174
- value: t.value,
175
- label: t.label,
176
- checked: r === t.value,
177
- disabled: t.disabled || e.disabled,
174
+ value: r.value,
175
+ label: r.label,
176
+ checked: t === r.value,
177
+ disabled: r.disabled || e.disabled,
178
178
  required: e.required,
179
- onChange: () => o(a, t.value)
179
+ onChange: () => c(a, r.value)
180
180
  },
181
- t.value
181
+ r.value
182
182
  )) });
183
183
  // ── Date picker ────────────────────────────────────────────────────
184
184
  case "date":
185
- return /* @__PURE__ */ n(
185
+ return /* @__PURE__ */ s(
186
186
  f,
187
187
  {
188
- id: i.id,
189
- name: i.name,
188
+ id: o.id,
189
+ name: o.name,
190
190
  label: e.label,
191
191
  required: e.required,
192
192
  disabled: e.disabled,
193
- helperText: l ?? e.helperText,
194
- error: !!l,
195
- value: r ?? null,
196
- onChange: (t) => o(a, t)
193
+ helperText: n ?? e.helperText,
194
+ error: !!n,
195
+ value: t ?? null,
196
+ onChange: (r) => c(a, r)
197
197
  }
198
198
  );
199
199
  // ── Range ──────────────────────────────────────────────────────────
200
200
  case "range":
201
- return /* @__PURE__ */ n(
201
+ return /* @__PURE__ */ s(
202
202
  k,
203
203
  {
204
- ...i,
205
- value: r ?? e.rangeMin ?? 0,
204
+ ...o,
205
+ value: t ?? 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: (t) => o(a, t)
212
+ onChange: (r) => c(a, r)
213
213
  }
214
214
  );
215
215
  // ── Hidden ─────────────────────────────────────────────────────────
216
216
  case "hidden":
217
- return /* @__PURE__ */ n(
217
+ return /* @__PURE__ */ s(
218
218
  "input",
219
219
  {
220
220
  type: "hidden",
221
221
  name: a,
222
- value: r ?? e.hiddenValue ?? ""
222
+ value: t ?? e.hiddenValue ?? ""
223
223
  }
224
224
  );
225
225
  default:
226
226
  return null;
227
227
  }
228
228
  };
229
- return e.fieldType === "hidden" ? d() : /* @__PURE__ */ n("div", { className: `${p}`, children: d() });
229
+ return e.fieldType === "hidden" ? d() : /* @__PURE__ */ s("div", { className: `${b}`, children: d() });
230
230
  }
231
231
  export {
232
- le as F,
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"),v=require("./core/components/Input/index.cjs"),T=require("./core/components/Textarea/index.cjs"),_=require("./core/components/Select/index.cjs"),h=require("./core/components/Checkbox/index.cjs"),k=require("./core/components/Radio/index.cjs"),p=require("./core/components/Fieldset/index.cjs"),W=require("./core/components/DatePicker/index.cjs"),F=require("./core/components/Range/index.cjs"),j="_formBlock_8cqr5_1",C="_container_8cqr5_7",w="_formInner_8cqr5_20",L="_maxWidthSm_8cqr5_26",y="_maxWidthMd_8cqr5_29",S="_maxWidthLg_8cqr5_32",B="_maxWidthFull_8cqr5_35",$="_heading_8cqr5_41",H="_eyebrow_8cqr5_47",G="_title_8cqr5_51",I="_disclaimer_8cqr5_55",M="_progress_8cqr5_61",D="_progressHeader_8cqr5_67",O="_stepLabel_8cqr5_73",P="_stepCount_8cqr5_79",R="_stepDescription_8cqr5_84",V="_fields_8cqr5_92",f="_fieldFull_8cqr5_99",N="_fieldHalf_8cqr5_103",z="_fieldThird_8cqr5_111",A="_actions_8cqr5_121",E="_submitButton_8cqr5_128",J="_success_8cqr5_134",K="_errorBanner_8cqr5_149",u={formBlock:j,container:C,formInner:w,maxWidthSm:L,maxWidthMd:y,maxWidthLg:S,maxWidthFull:B,heading:$,eyebrow:H,title:G,disclaimer:I,progress:M,progressHeader:D,stepLabel:O,stepCount:P,stepDescription:R,fields:V,fieldFull:f,fieldHalf:N,fieldThird:z,actions:A,submitButton:E,success:J,errorBanner:K};function i(e){return(e??[]).map(t=>({label:t.label,value:t.value.current,disabled:t.disabled}))}function m(e){return(e??[]).map(t=>({label:t.label,options:t.options.map(s=>({label:s.label,value:s.value.current,disabled:s.disabled}))}))}function Q({field:e,value:t,error:s,onChange:o}){const n=e.name.current,x={full:u.fieldFull,half:u.fieldHalf,third:u.fieldThird}[e.width??"full"],l={id:n,name:n,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,{...l,type:e.fieldType==="phone"?"tel":e.fieldType,placeholder:e.placeholder,value:t??"",minLength:e.minLength,maxLength:e.maxLength,fullWidth:!0,onChange:r=>o(n,r.target.value)});case"textarea":return a.jsx(T.Textarea,{...l,placeholder:e.placeholder,value:t??"",rows:e.rows??4,maxLength:e.maxLength,showCharCount:e.showCharCount,fullWidth:!0,onChange:r=>o(n,r.target.value)});case"select":{const r=e.useOptionGroups?m(e.optionGroups):i(e.options);return a.jsx(_.Select,{...l,placeholder:e.placeholder,options:r,value:t??"",fullWidth:!0,onChange:c=>o(n,c.target.value)})}case"multiselect":{const r=e.useOptionGroups?m(e.optionGroups):i(e.options);return a.jsx(_.Select,{...l,multiple:!0,options:r,value:t??[],showSelectedCount:!0,onChange:c=>o(n,c)})}case"checkbox":return a.jsx(h.Checkbox,{id:l.id,name:l.name,label:e.label,required:e.required,disabled:e.disabled,helperText:s??e.helperText,error:!!s,checked:t??!1,onChange:r=>o(n,r.target.checked)});case"checkboxGroup":{const r=t??[];return a.jsx(p.Fieldset,{legend:e.label,error:!!s,helperText:s,children:i(e.options).map(c=>a.jsx(h.Checkbox,{id:`${n}-${c.value}`,name:`${n}[]`,label:c.label,checked:r.includes(c.value),disabled:c.disabled||e.disabled,onChange:b=>{const q=b.target.checked?[...r,c.value]:r.filter(g=>g!==c.value);o(n,q)}},c.value))})}case"radio":return a.jsx(p.Fieldset,{legend:e.label,error:!!s,helperText:s,children:i(e.options).map(r=>a.jsx(k.Radio,{id:`${n}-${r.value}`,name:n,value:r.value,label:r.label,checked:t===r.value,disabled:r.disabled||e.disabled,required:e.required,onChange:()=>o(n,r.value)},r.value))});case"date":return a.jsx(W.DatePicker,{id:l.id,name:l.name,label:e.label,required:e.required,disabled:e.disabled,helperText:s??e.helperText,error:!!s,value:t??null,onChange:r=>o(n,r)});case"range":return a.jsx(F.Range,{...l,value:t??e.rangeMin??0,min:e.rangeMin??0,max:e.rangeMax??100,step:e.rangeStep??1,valuePrefix:e.rangeValuePrefix,valueSuffix:e.rangeValueSuffix,showValue:!0,onChange:r=>o(n,r)});case"hidden":return a.jsx("input",{type:"hidden",name:n,value:t??e.hiddenValue??""});default:return null}};return e.fieldType==="hidden"?d():a.jsx("div",{className:`${x}`,children:d()})}exports.FormField=Q;exports.styles=u;
@@ -1 +1 @@
1
- ._formBlock_1jbl0_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_1jbl0_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_1jbl0_20{width:100%;margin-left:auto;margin-right:auto}._maxWidthSm_1jbl0_26{max-width:480px}._maxWidthMd_1jbl0_29{max-width:640px}._maxWidthLg_1jbl0_32{max-width:800px}._maxWidthFull_1jbl0_35{max-width:100%}._heading_1jbl0_41{display:flex;flex-direction:column;gap:var(--spacing-sm)}._eyebrow_1jbl0_47{font-weight:var(--font-weight-bold)}._title_1jbl0_51{text-wrap:balance}._disclaimer_1jbl0_55{font-size:var(--font-size-sm)}._progress_1jbl0_61{display:flex;flex-direction:column;gap:var(--spacing-sm)}._progressHeader_1jbl0_67{display:flex;justify-content:space-between;align-items:center}._stepLabel_1jbl0_73{font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);color:var(--color-text-primary)}._stepCount_1jbl0_79{font-size:var(--font-size-sm);color:var(--color-secondary-50)}._stepDescription_1jbl0_84{color:var(--color-secondary-75);font-size:var(--font-size-md);margin:0}._fields_1jbl0_92{display:flex;flex-wrap:wrap;gap:var(--spacing-md)}._fieldFull_1jbl0_99{width:100%}._fieldHalf_1jbl0_103{width:calc(50% - var(--spacing-md) / 2)}@media (max-width: 767px){._fieldHalf_1jbl0_103{width:100%}}._fieldThird_1jbl0_111{width:calc(33.333% - var(--spacing-md) * 2 / 3)}@media (max-width: 767px){._fieldThird_1jbl0_111{width:100%}}._actions_1jbl0_121{display:flex;align-items:center;gap:var(--spacing-md);padding-top:var(--spacing-sm)}._submitButton_1jbl0_128{margin-left:auto}._success_1jbl0_134{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-lg);padding:var(--spacing-md) 0 0}._success_1jbl0_134 p{color:var(--color-states-success-bg);font-weight:var(--font-weight-semibold)}._errorBanner_1jbl0_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)}
1
+ ._formBlock_8cqr5_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_8cqr5_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_8cqr5_20{width:100%;margin-left:auto;margin-right:auto}._maxWidthSm_8cqr5_26{max-width:480px}._maxWidthMd_8cqr5_29{max-width:640px}._maxWidthLg_8cqr5_32{max-width:800px}._maxWidthFull_8cqr5_35{max-width:100%}._heading_8cqr5_41{display:flex;flex-direction:column;gap:var(--spacing-sm)}._eyebrow_8cqr5_47{font-weight:var(--font-weight-bold)}._title_8cqr5_51{text-wrap:balance}._disclaimer_8cqr5_55{font-size:var(--font-size-sm)}._progress_8cqr5_61{display:flex;flex-direction:column;gap:var(--spacing-sm)}._progressHeader_8cqr5_67{display:flex;justify-content:space-between;align-items:center}._stepLabel_8cqr5_73{font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);color:var(--color-text-primary)}._stepCount_8cqr5_79{font-size:var(--font-size-sm);color:var(--color-secondary-50)}._stepDescription_8cqr5_84{color:var(--color-secondary-75);font-size:var(--font-size-md);margin:0}._fields_8cqr5_92{display:flex;flex-wrap:wrap;gap:var(--spacing-md)}._fieldFull_8cqr5_99{width:100%}._fieldHalf_8cqr5_103{width:calc(50% - var(--spacing-md) / 2)}@media (max-width: 767px){._fieldHalf_8cqr5_103{width:100%}}._fieldThird_8cqr5_111{width:calc(33.333% - var(--spacing-md) * 2 / 3)}@media (max-width: 767px){._fieldThird_8cqr5_111{width:100%}}._actions_8cqr5_121{display:flex;align-items:center;gap:var(--spacing-md);padding-top:var(--spacing-sm)}._submitButton_8cqr5_128{margin-left:auto}._success_8cqr5_134{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-lg);padding:var(--spacing-md) 0 0}._success_8cqr5_134 p{color:var(--color-states-success-bg);font-weight:var(--font-weight-semibold)}._errorBanner_8cqr5_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)}.split ._container_8cqr5_7{flex-direction:row;gap:3rem}.split ._heading_8cqr5_41,.split form{flex:.5}
@@ -1 +1 @@
1
- "use strict";const n=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),r=require("../../../index-0SVQqhAg.cjs");require("../../../index-CW_Ehh1q.cjs");const a=e.vi.fn();e.vi.mock("../../context/ModalContext",()=>({useModal:()=>({open:a})}));e.describe("Button",()=>{e.describe("Rendering as button",()=>{e.it("renders as a button by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("BUTTON")}),e.it("renders as a button when 'as' is set to 'button'",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t).toHaveClass("button","primary")}),e.it("has type='button' by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("type","button")}),e.it("respects the disabled prop on buttons",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",disabled:!0,children:"Disabled"}));const t=e.screen.getByRole("button",{name:"Disabled"});e.globalExpect(t).toBeDisabled()}),e.it("calls onClick when clicked",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,children:"Click Me"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("does not call onClick when disabled",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).not.toHaveBeenCalled()})}),e.describe("Rendering as anchor",()=>{e.it("renders as an anchor when 'as' is set to 'a'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Click Me"}));const t=e.screen.getByRole("link",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("A"),e.globalExpect(t).toHaveAttribute("href","/test"),e.globalExpect(t).toHaveClass("button","link")}),e.it("adds rel='noopener noreferrer' when target is '_blank'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link",{name:"External"})).toHaveAttribute("rel","noopener noreferrer")}),e.it("preserves custom rel attribute and adds security",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",rel:"author",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("rel","author noopener noreferrer")}),e.it("does not add security rel for internal links",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Internal"})),e.globalExpect(e.screen.getByRole("link")).not.toHaveAttribute("rel")}),e.it("adds aria-disabled when disabled",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",disabled:!0,children:"Disabled Link"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("aria-disabled","true")})}),e.describe("Scroll button",()=>{e.it("renders as a scroll button when 'as' is set to 'scroll'",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"section-1",variant:"primary",children:"Scroll Down"})),e.globalExpect(e.screen.getByRole("button",{name:"Scroll to section-1"})).toBeInTheDocument()}),e.it("has proper aria-label for scroll button",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"footer",variant:"primary",children:"To Footer"})),e.globalExpect(e.screen.getByRole("button")).toHaveAttribute("aria-label","Scroll to footer")}),e.it("scrolls to target element when clicked",()=>{const t=document.createElement("div");t.id="target-section",document.body.appendChild(t);const o=e.vi.fn();t.scrollIntoView=o,e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"target-section",variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({behavior:"smooth",block:"start"}),document.body.removeChild(t)}),e.it("uses scrollTo with offset when scrollOffset is set",()=>{const t=document.createElement("div");t.id="offset-section",document.body.appendChild(t);const o=e.vi.fn();window.scrollTo=o,e.vi.spyOn(t,"getBoundingClientRect").mockReturnValue({top:200}),e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"offset-section",scrollOffset:80,variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({top:e.globalExpect.any(Number),behavior:"smooth"}),document.body.removeChild(t)}),e.it("does not error if scroll target does not exist",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"non-existent",variant:"primary",children:"Scroll"})),e.globalExpect(()=>e.fireEvent.click(e.screen.getByRole("button"))).not.toThrow()})}),e.describe("Modal button",()=>{e.it("renders as a button when 'as' is set to 'modal'",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]}},variant:"primary",children:"Open Modal"})),e.globalExpect(e.screen.getByRole("button",{name:"Open Modal"})).toBeInTheDocument()}),e.it("calls useModal open with the payload when clicked",()=>{const t={heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]},formReference:{_id:"form-123",heading:{title:[{_type:"block",_key:"c",children:[{_type:"span",_key:"d",text:"Contact",marks:[]}],markDefs:[],style:"normal"}]}}};e.render(n.jsx(r.Button,{as:"modal",modalPayload:t,variant:"primary",children:"Open Form"})),e.fireEvent.click(e.screen.getByRole("button",{name:"Open Form"})),e.globalExpect(a).toHaveBeenCalledWith(t)}),e.it("is disabled when disabled prop is set",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Test",marks:[]}],markDefs:[],style:"normal"}]}},variant:"primary",disabled:!0,children:"Disabled Modal"})),e.globalExpect(e.screen.getByRole("button")).toBeDisabled()}),e.it("does not call open when disabled",()=>{a.mockClear(),e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Test",marks:[]}],markDefs:[],style:"normal"}]}},variant:"primary",disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(a).not.toHaveBeenCalled()})}),e.describe("Variants",()=>{["primary","primaryInverted","secondary","secondaryInverted","link","linkInverted","underline","underlineInverted","blurred","blurredInverted"].forEach(o=>{e.it(`applies ${o} variant class`,()=>{e.render(n.jsx(r.Button,{variant:o,children:"Button"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass(o)})}),e.it("uses primary variant by default",()=>{e.render(n.jsx(r.Button,{children:"Default"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("primary")})}),e.describe("Icons",()=>{e.it("includes icon when icon prop is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Next"})),e.globalExpect(document.querySelector(".icon")).toBeInTheDocument(),e.globalExpect(document.querySelector(".icon svg")).toBeInTheDocument()}),e.it("places icon on the left when iconAlignment is 'left'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-left",iconAlignment:"left",children:"Back"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconLeft")}),e.it("places icon on the right when iconAlignment is 'right'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",iconAlignment:"right",children:"Next"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("uses right alignment by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Default Icon"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("icon has aria-hidden attribute",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"settings",children:"Settings"})),e.globalExpect(document.querySelector(".icon")).toHaveAttribute("aria-hidden","true")})}),e.describe("Image display",()=>{e.it("renders image when displayType is 'image' and imageSrc is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",imageAlt:"Company Logo",children:"Text not shown"}));const t=document.querySelector("img");e.globalExpect(t).toHaveAttribute("src","/logo.png"),e.globalExpect(t).toHaveAttribute("alt","Company Logo")}),e.it("renders ImageComponent when provided",()=>{const t=()=>n.jsx("div",{"data-testid":"custom-image",children:"Custom"});e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",ImageComponent:n.jsx(t,{}),children:"Text"})),e.globalExpect(e.screen.getByTestId("custom-image")).toBeInTheDocument()}),e.it("applies image class when displayType is image",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",children:"Text"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("image"),e.globalExpect(t).not.toHaveClass("primary")})}),e.describe("Custom className",()=>{e.it("applies custom className",()=>{e.render(n.jsx(r.Button,{variant:"primary",className:"custom-button",children:"Custom"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("custom-button","button","primary")})}),e.describe("Accessibility",()=>{e.it("has button role for button element",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click"})),e.globalExpect(e.screen.getByRole("button")).toBeInTheDocument()}),e.it("has link role for anchor element",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Link"})),e.globalExpect(e.screen.getByRole("link")).toBeInTheDocument()}),e.it("supports aria attributes",()=>{e.render(n.jsx(r.Button,{variant:"primary","aria-label":"Custom Label","aria-describedby":"desc",children:"Button"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("aria-label","Custom Label"),e.globalExpect(t).toHaveAttribute("aria-describedby","desc")})}),e.describe("Edge cases",()=>{e.it("handles undefined variant",()=>{e.render(n.jsx(r.Button,{variant:void 0,children:"No Variant"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("button")}),e.it("handles complex children",()=>{e.render(n.jsxs(r.Button,{variant:"primary",children:[n.jsx("span",{children:"Complex"}),n.jsx("strong",{children:"Children"})]})),e.globalExpect(e.screen.getByText("Complex")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Children")).toBeInTheDocument()})})});
1
+ "use strict";const n=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),r=require("../../../index-0SVQqhAg.cjs");require("../../../index-CW_Ehh1q.cjs");const a=e.vi.fn();e.vi.mock("../../context/ModalContext",()=>({useModal:()=>({open:a})}));e.describe("Button",()=>{e.describe("Rendering as button",()=>{e.it("renders as a button by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("BUTTON")}),e.it("renders as a button when 'as' is set to 'button'",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t).toHaveClass("button","primary")}),e.it("has type='button' by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("type","button")}),e.it("respects the disabled prop on buttons",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",disabled:!0,children:"Disabled"}));const t=e.screen.getByRole("button",{name:"Disabled"});e.globalExpect(t).toBeDisabled()}),e.it("calls onClick when clicked",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,children:"Click Me"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("does not call onClick when disabled",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).not.toHaveBeenCalled()})}),e.describe("Rendering as anchor",()=>{e.it("renders as an anchor when 'as' is set to 'a'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Click Me"}));const t=e.screen.getByRole("link",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("A"),e.globalExpect(t).toHaveAttribute("href","/test"),e.globalExpect(t).toHaveClass("button","link")}),e.it("adds rel='noopener noreferrer' when target is '_blank'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link",{name:"External"})).toHaveAttribute("rel","noopener noreferrer")}),e.it("preserves custom rel attribute and adds security",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",rel:"author",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("rel","author noopener noreferrer")}),e.it("does not add security rel for internal links",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Internal"})),e.globalExpect(e.screen.getByRole("link")).not.toHaveAttribute("rel")}),e.it("adds aria-disabled when disabled",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",disabled:!0,children:"Disabled Link"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("aria-disabled","true")})}),e.describe("Scroll button",()=>{e.it("renders as a scroll button when 'as' is set to 'scroll'",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"section-1",variant:"primary",children:"Scroll Down"})),e.globalExpect(e.screen.getByRole("button",{name:"Scroll to section-1"})).toBeInTheDocument()}),e.it("has proper aria-label for scroll button",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"footer",variant:"primary",children:"To Footer"})),e.globalExpect(e.screen.getByRole("button")).toHaveAttribute("aria-label","Scroll to footer")}),e.it("scrolls to target element when clicked",()=>{const t=document.createElement("div");t.id="target-section",document.body.appendChild(t);const o=e.vi.fn();t.scrollIntoView=o,e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"target-section",variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({behavior:"smooth",block:"start"}),document.body.removeChild(t)}),e.it("uses scrollTo with offset when scrollOffset is set",()=>{const t=document.createElement("div");t.id="offset-section",document.body.appendChild(t);const o=e.vi.fn();window.scrollTo=o,e.vi.spyOn(t,"getBoundingClientRect").mockReturnValue({top:200}),e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"offset-section",scrollOffset:80,variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({top:e.globalExpect.any(Number),behavior:"smooth"}),document.body.removeChild(t)}),e.it("does not error if scroll target does not exist",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"non-existent",variant:"primary",children:"Scroll"})),e.globalExpect(()=>e.fireEvent.click(e.screen.getByRole("button"))).not.toThrow()})}),e.describe("Modal button",()=>{e.it("renders as a button when 'as' is set to 'modal'",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{formReference:{_id:"form-modal",heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]}}},variant:"primary",children:"Open Modal"})),e.globalExpect(e.screen.getByRole("button",{name:"Open Modal"})).toBeInTheDocument()}),e.it("calls useModal open with the payload when clicked",()=>{const t={formReference:{_id:"form-123",heading:{title:[{_type:"block",_key:"c",children:[{_type:"span",_key:"d",text:"Contact",marks:[]}],markDefs:[],style:"normal"}]}}};e.render(n.jsx(r.Button,{as:"modal",modalPayload:t,variant:"primary",children:"Open Form"})),e.fireEvent.click(e.screen.getByRole("button",{name:"Open Form"})),e.globalExpect(a).toHaveBeenCalledWith(t)}),e.it("is disabled when disabled prop is set",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{formReference:{_id:"form-disabled"}},variant:"primary",disabled:!0,children:"Disabled Modal"})),e.globalExpect(e.screen.getByRole("button")).toBeDisabled()}),e.it("does not call open when disabled",()=>{a.mockClear(),e.render(n.jsx(r.Button,{as:"modal",modalPayload:{formReference:{_id:"form-disabled"}},variant:"primary",disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(a).not.toHaveBeenCalled()})}),e.describe("Variants",()=>{["primary","primaryInverted","secondary","secondaryInverted","link","linkInverted","underline","underlineInverted","blurred","blurredInverted"].forEach(o=>{e.it(`applies ${o} variant class`,()=>{e.render(n.jsx(r.Button,{variant:o,children:"Button"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass(o)})}),e.it("uses primary variant by default",()=>{e.render(n.jsx(r.Button,{children:"Default"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("primary")})}),e.describe("Icons",()=>{e.it("includes icon when icon prop is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Next"})),e.globalExpect(document.querySelector(".icon")).toBeInTheDocument(),e.globalExpect(document.querySelector(".icon svg")).toBeInTheDocument()}),e.it("places icon on the left when iconAlignment is 'left'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-left",iconAlignment:"left",children:"Back"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconLeft")}),e.it("places icon on the right when iconAlignment is 'right'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",iconAlignment:"right",children:"Next"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("uses right alignment by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Default Icon"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("icon has aria-hidden attribute",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"settings",children:"Settings"})),e.globalExpect(document.querySelector(".icon")).toHaveAttribute("aria-hidden","true")})}),e.describe("Image display",()=>{e.it("renders image when displayType is 'image' and imageSrc is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",imageAlt:"Company Logo",children:"Text not shown"}));const t=document.querySelector("img");e.globalExpect(t).toHaveAttribute("src","/logo.png"),e.globalExpect(t).toHaveAttribute("alt","Company Logo")}),e.it("renders ImageComponent when provided",()=>{const t=()=>n.jsx("div",{"data-testid":"custom-image",children:"Custom"});e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",ImageComponent:n.jsx(t,{}),children:"Text"})),e.globalExpect(e.screen.getByTestId("custom-image")).toBeInTheDocument()}),e.it("applies image class when displayType is image",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",children:"Text"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("image"),e.globalExpect(t).not.toHaveClass("primary")})}),e.describe("Custom className",()=>{e.it("applies custom className",()=>{e.render(n.jsx(r.Button,{variant:"primary",className:"custom-button",children:"Custom"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("custom-button","button","primary")})}),e.describe("Accessibility",()=>{e.it("has button role for button element",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click"})),e.globalExpect(e.screen.getByRole("button")).toBeInTheDocument()}),e.it("has link role for anchor element",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Link"})),e.globalExpect(e.screen.getByRole("link")).toBeInTheDocument()}),e.it("supports aria attributes",()=>{e.render(n.jsx(r.Button,{variant:"primary","aria-label":"Custom Label","aria-describedby":"desc",children:"Button"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("aria-label","Custom Label"),e.globalExpect(t).toHaveAttribute("aria-describedby","desc")})}),e.describe("Edge cases",()=>{e.it("handles undefined variant",()=>{e.render(n.jsx(r.Button,{variant:void 0,children:"No Variant"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("button")}),e.it("handles complex children",()=>{e.render(n.jsxs(r.Button,{variant:"primary",children:[n.jsx("span",{children:"Complex"}),n.jsx("strong",{children:"Children"})]})),e.globalExpect(e.screen.getByText("Complex")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Children")).toBeInTheDocument()})})});