@jack.winter/pancake-ui 0.1.0 → 0.1.2
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/CHANGELOG.md +15 -2
- package/README.md +1 -1
- package/dist/components/DropdownMenu/menuKeyboard.d.ts +1 -1
- package/dist/components/TextField/field.shared.d.ts +16 -0
- package/dist/components/progress/Progress.d.ts +0 -1
- package/dist/foundations/kebab.d.ts +1 -0
- package/dist/foundations/tokens.d.ts +2 -2
- package/dist/index.js +231 -186
- package/dist/styles.css +1 -1
- package/docs/installation.md +5 -5
- package/docs/styling.md +2 -2
- package/docs/verification.md +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73,73 +73,73 @@ var d = Object.freeze({
|
|
|
73
73
|
}), g = Object.freeze({
|
|
74
74
|
opacityDisabled: .4,
|
|
75
75
|
opacityOverlay: .5
|
|
76
|
-
}), _ = (e) => Object.freeze(e),
|
|
77
|
-
body:
|
|
78
|
-
fontFamily:
|
|
76
|
+
}), _ = "Inter, sans-serif", v = (e) => Object.freeze(e), y = Object.freeze({
|
|
77
|
+
body: v({
|
|
78
|
+
fontFamily: _,
|
|
79
79
|
fontSize: 14,
|
|
80
80
|
fontWeight: "400",
|
|
81
81
|
fontStyle: "normal",
|
|
82
82
|
lineHeight: "16.8px",
|
|
83
83
|
letterSpacing: 0
|
|
84
84
|
}),
|
|
85
|
-
bodyStrong:
|
|
86
|
-
fontFamily:
|
|
85
|
+
bodyStrong: v({
|
|
86
|
+
fontFamily: _,
|
|
87
87
|
fontSize: 15,
|
|
88
88
|
fontWeight: "600",
|
|
89
89
|
fontStyle: "normal",
|
|
90
90
|
lineHeight: "18px",
|
|
91
91
|
letterSpacing: 0
|
|
92
92
|
}),
|
|
93
|
-
caption:
|
|
94
|
-
fontFamily:
|
|
93
|
+
caption: v({
|
|
94
|
+
fontFamily: _,
|
|
95
95
|
fontSize: 11,
|
|
96
96
|
fontWeight: "400",
|
|
97
97
|
fontStyle: "normal",
|
|
98
98
|
lineHeight: "13.2px",
|
|
99
99
|
letterSpacing: 0
|
|
100
100
|
}),
|
|
101
|
-
display:
|
|
102
|
-
fontFamily:
|
|
101
|
+
display: v({
|
|
102
|
+
fontFamily: _,
|
|
103
103
|
fontSize: 28,
|
|
104
104
|
fontWeight: "700",
|
|
105
105
|
fontStyle: "normal",
|
|
106
106
|
lineHeight: "33.6px",
|
|
107
107
|
letterSpacing: 0
|
|
108
108
|
}),
|
|
109
|
-
heading:
|
|
110
|
-
fontFamily:
|
|
109
|
+
heading: v({
|
|
110
|
+
fontFamily: _,
|
|
111
111
|
fontSize: 18,
|
|
112
112
|
fontWeight: "700",
|
|
113
113
|
fontStyle: "normal",
|
|
114
114
|
lineHeight: "21.6px",
|
|
115
115
|
letterSpacing: 0
|
|
116
116
|
}),
|
|
117
|
-
label:
|
|
118
|
-
fontFamily:
|
|
117
|
+
label: v({
|
|
118
|
+
fontFamily: _,
|
|
119
119
|
fontSize: 12,
|
|
120
120
|
fontWeight: "600",
|
|
121
121
|
fontStyle: "normal",
|
|
122
122
|
lineHeight: "14.4px",
|
|
123
123
|
letterSpacing: 0
|
|
124
124
|
}),
|
|
125
|
-
micro:
|
|
126
|
-
fontFamily:
|
|
125
|
+
micro: v({
|
|
126
|
+
fontFamily: _,
|
|
127
127
|
fontSize: 10,
|
|
128
128
|
fontWeight: "600",
|
|
129
129
|
fontStyle: "normal",
|
|
130
130
|
lineHeight: "12px",
|
|
131
131
|
letterSpacing: 0
|
|
132
132
|
}),
|
|
133
|
-
section:
|
|
134
|
-
fontFamily:
|
|
133
|
+
section: v({
|
|
134
|
+
fontFamily: _,
|
|
135
135
|
fontSize: 20,
|
|
136
136
|
fontWeight: "700",
|
|
137
137
|
fontStyle: "normal",
|
|
138
138
|
lineHeight: "24px",
|
|
139
139
|
letterSpacing: 0
|
|
140
140
|
}),
|
|
141
|
-
title:
|
|
142
|
-
fontFamily:
|
|
141
|
+
title: v({
|
|
142
|
+
fontFamily: _,
|
|
143
143
|
fontSize: 25,
|
|
144
144
|
fontWeight: "700",
|
|
145
145
|
fontStyle: "normal",
|
|
@@ -148,14 +148,14 @@ var d = Object.freeze({
|
|
|
148
148
|
})
|
|
149
149
|
});
|
|
150
150
|
// src/components/Surface/Surface.tsx
|
|
151
|
-
function
|
|
151
|
+
function b({ className: e = "", ...n }) {
|
|
152
152
|
return /* @__PURE__ */ t("div", {
|
|
153
153
|
className: `pancake-surface ${e}`,
|
|
154
154
|
...n
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
// src/components/Button/Button.tsx
|
|
158
|
-
function
|
|
158
|
+
function x({ variant: e = "primary", size: r = 48, loading: i = !1, disabled: a = !1, type: o = "button", className: s = "", children: c, ...l }) {
|
|
159
159
|
return /* @__PURE__ */ n("button", {
|
|
160
160
|
...l,
|
|
161
161
|
type: o,
|
|
@@ -169,7 +169,7 @@ function b({ variant: e = "primary", size: r = 48, loading: i = !1, disabled: a
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
// src/components/Checkbox/Checkbox.tsx
|
|
172
|
-
function
|
|
172
|
+
function S({ label: e, onCheckedChange: r, onChange: i, id: a, className: s = "", ...c }) {
|
|
173
173
|
let l = o(), u = a ?? l;
|
|
174
174
|
return /* @__PURE__ */ n("label", {
|
|
175
175
|
className: "pancake-checkbox-label",
|
|
@@ -185,9 +185,26 @@ function x({ label: e, onCheckedChange: r, onChange: i, id: a, className: s = ""
|
|
|
185
185
|
}), /* @__PURE__ */ t("span", { children: e })]
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
+
// src/components/TextField/field.shared.ts
|
|
189
|
+
function C({ generatedId: e, error: t, helperText: n, describedBy: r, invalid: i }) {
|
|
190
|
+
let a = `${e}-description`, o = t || n;
|
|
191
|
+
return {
|
|
192
|
+
id: a,
|
|
193
|
+
text: o,
|
|
194
|
+
describedBy: [r, o ? a : void 0].filter(Boolean).join(" ") || void 0,
|
|
195
|
+
invalid: t ? !0 : i,
|
|
196
|
+
live: t ? "assertive" : "polite"
|
|
197
|
+
};
|
|
198
|
+
}
|
|
188
199
|
// src/components/TextField/TextField.tsx
|
|
189
|
-
function
|
|
190
|
-
let p = o(), m = s ?? p, h =
|
|
200
|
+
function w({ label: e, type: r = "text", helperText: i, error: a, id: s, className: c = "", required: l, "aria-describedby": u, "aria-invalid": d, ...f }) {
|
|
201
|
+
let p = o(), m = s ?? p, h = C({
|
|
202
|
+
generatedId: p,
|
|
203
|
+
error: a,
|
|
204
|
+
helperText: i,
|
|
205
|
+
describedBy: u,
|
|
206
|
+
invalid: d
|
|
207
|
+
});
|
|
191
208
|
return /* @__PURE__ */ n("div", {
|
|
192
209
|
className: "pancake-field",
|
|
193
210
|
children: [
|
|
@@ -204,70 +221,71 @@ function S({ label: e, type: r = "text", helperText: i, error: a, id: s, classNa
|
|
|
204
221
|
id: m,
|
|
205
222
|
type: r,
|
|
206
223
|
required: l,
|
|
207
|
-
"aria-invalid":
|
|
208
|
-
"aria-describedby":
|
|
224
|
+
"aria-invalid": h.invalid,
|
|
225
|
+
"aria-describedby": h.describedBy,
|
|
209
226
|
className: `pancake-field-input ${c}`
|
|
210
227
|
}),
|
|
211
|
-
|
|
212
|
-
id: h,
|
|
228
|
+
h.text && /* @__PURE__ */ t("p", {
|
|
229
|
+
id: h.id,
|
|
213
230
|
className: "pancake-field-description",
|
|
214
|
-
"aria-live":
|
|
215
|
-
children:
|
|
231
|
+
"aria-live": h.live,
|
|
232
|
+
children: h.text
|
|
216
233
|
})
|
|
217
234
|
]
|
|
218
235
|
});
|
|
219
236
|
}
|
|
220
237
|
// src/components/layout/layout.shared.ts
|
|
221
|
-
var
|
|
238
|
+
var T = {
|
|
222
239
|
start: "flex-start",
|
|
223
240
|
center: "center",
|
|
224
241
|
end: "flex-end",
|
|
225
242
|
stretch: "stretch"
|
|
226
|
-
},
|
|
243
|
+
}, E = {
|
|
227
244
|
start: "flex-start",
|
|
228
245
|
center: "center",
|
|
229
246
|
end: "flex-end",
|
|
230
247
|
"space-between": "space-between"
|
|
231
|
-
},
|
|
248
|
+
}, D = (e) => `var(--spacing-pancake-${f[e]})`;
|
|
232
249
|
// src/components/layout/Stack.tsx
|
|
233
|
-
function
|
|
250
|
+
function O({ gap: e = "space16", padding: n, align: r = "stretch", justify: i = "start", className: a = "", style: o, ...s }) {
|
|
234
251
|
return /* @__PURE__ */ t("div", {
|
|
235
252
|
...s,
|
|
236
253
|
className: `pancake-stack ${a}`,
|
|
237
254
|
style: {
|
|
238
|
-
gap:
|
|
239
|
-
padding: n ?
|
|
240
|
-
alignItems:
|
|
241
|
-
justifyContent:
|
|
255
|
+
gap: D(e),
|
|
256
|
+
padding: n ? D(n) : void 0,
|
|
257
|
+
alignItems: T[r],
|
|
258
|
+
justifyContent: E[i],
|
|
242
259
|
...o
|
|
243
260
|
}
|
|
244
261
|
});
|
|
245
262
|
}
|
|
246
263
|
// src/components/layout/Inline.tsx
|
|
247
|
-
function
|
|
264
|
+
function k({ gap: e = "space12", padding: n, align: r = "center", justify: i = "start", wrap: a = !0, className: o = "", style: s, ...c }) {
|
|
248
265
|
return /* @__PURE__ */ t("div", {
|
|
249
266
|
...c,
|
|
250
267
|
className: `pancake-inline ${o}`,
|
|
251
268
|
style: {
|
|
252
|
-
gap:
|
|
253
|
-
padding: n ?
|
|
254
|
-
alignItems:
|
|
255
|
-
justifyContent:
|
|
269
|
+
gap: D(e),
|
|
270
|
+
padding: n ? D(n) : void 0,
|
|
271
|
+
alignItems: T[r],
|
|
272
|
+
justifyContent: E[i],
|
|
256
273
|
flexWrap: a ? "wrap" : "nowrap",
|
|
257
274
|
...s
|
|
258
275
|
}
|
|
259
276
|
});
|
|
260
277
|
}
|
|
278
|
+
// src/foundations/kebab.ts
|
|
279
|
+
var A = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
261
280
|
// src/components/layout/Text.tsx
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
let s = `--text-pancake-${O(t)}`, c = {
|
|
281
|
+
function j({ as: e = "span", variant: t = "body", color: n = "ink", className: r = "", style: a, ...o }) {
|
|
282
|
+
let s = `--text-pancake-${A(t)}`, c = {
|
|
265
283
|
fontFamily: "var(--font-pancake)",
|
|
266
284
|
fontSize: `var(${s})`,
|
|
267
285
|
lineHeight: `var(${s}--line-height)`,
|
|
268
286
|
fontWeight: `var(${s}--font-weight)`,
|
|
269
287
|
letterSpacing: `var(${s}--letter-spacing)`,
|
|
270
|
-
color: `var(--color-pancake-${
|
|
288
|
+
color: `var(--color-pancake-${A(n)})`,
|
|
271
289
|
...a
|
|
272
290
|
};
|
|
273
291
|
return i(e, {
|
|
@@ -277,18 +295,18 @@ function k({ as: e = "span", variant: t = "body", color: n = "ink", className: r
|
|
|
277
295
|
});
|
|
278
296
|
}
|
|
279
297
|
// src/components/identity/Avatar.tsx
|
|
280
|
-
function
|
|
298
|
+
function M(e) {
|
|
281
299
|
return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((e) => Array.from(e)[0]).join("").toLocaleUpperCase() || "?";
|
|
282
300
|
}
|
|
283
|
-
function
|
|
301
|
+
function N({ src: e, name: n }) {
|
|
284
302
|
let [r, i] = u(!1);
|
|
285
|
-
return r ?
|
|
303
|
+
return r ? M(n) : /* @__PURE__ */ t("img", {
|
|
286
304
|
src: e,
|
|
287
305
|
alt: "",
|
|
288
306
|
onError: () => i(!0)
|
|
289
307
|
});
|
|
290
308
|
}
|
|
291
|
-
function
|
|
309
|
+
function P({ name: e, src: n, size: r = 40, decorative: i = !1, className: a = "", style: o, ...s }) {
|
|
292
310
|
return /* @__PURE__ */ t("span", {
|
|
293
311
|
...s,
|
|
294
312
|
className: `pancake-avatar ${a}`,
|
|
@@ -300,21 +318,21 @@ function M({ name: e, src: n, size: r = 40, decorative: i = !1, className: a = "
|
|
|
300
318
|
role: i ? void 0 : "img",
|
|
301
319
|
"aria-label": i ? void 0 : e,
|
|
302
320
|
"aria-hidden": i || void 0,
|
|
303
|
-
children: n ? /* @__PURE__ */ t(
|
|
321
|
+
children: n ? /* @__PURE__ */ t(N, {
|
|
304
322
|
src: n,
|
|
305
323
|
name: e
|
|
306
|
-
}, n) :
|
|
324
|
+
}, n) : M(e)
|
|
307
325
|
});
|
|
308
326
|
}
|
|
309
327
|
// src/components/identity/AvatarGroup.tsx
|
|
310
|
-
function
|
|
328
|
+
function F({ items: e, max: r = 4, size: i = 40, className: a = "", "aria-label": o = "People", ...s }) {
|
|
311
329
|
if (!Number.isInteger(r) || r < 1) throw RangeError("AvatarGroup max must be a positive integer.");
|
|
312
330
|
let c = e.slice(0, r), l = e.slice(r);
|
|
313
331
|
return /* @__PURE__ */ n("ul", {
|
|
314
332
|
...s,
|
|
315
333
|
"aria-label": o,
|
|
316
334
|
className: `pancake-avatar-group ${a}`,
|
|
317
|
-
children: [c.map((e) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
335
|
+
children: [c.map((e) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(P, {
|
|
318
336
|
name: e.name,
|
|
319
337
|
src: e.src,
|
|
320
338
|
size: i
|
|
@@ -331,14 +349,14 @@ function N({ items: e, max: r = 4, size: i = 40, className: a = "", "aria-label"
|
|
|
331
349
|
});
|
|
332
350
|
}
|
|
333
351
|
// src/components/feedback/StatusChip.tsx
|
|
334
|
-
function
|
|
352
|
+
function ee({ tone: e = "neutral", className: n = "", ...r }) {
|
|
335
353
|
return /* @__PURE__ */ t("span", {
|
|
336
354
|
...r,
|
|
337
355
|
className: `pancake-status-chip pancake-tone-${e} ${n}`
|
|
338
356
|
});
|
|
339
357
|
}
|
|
340
358
|
// src/components/feedback/BannerToast.tsx
|
|
341
|
-
function
|
|
359
|
+
function te({ title: e, children: r, tone: i = "info", onDismiss: a, dismissLabel: o = "Dismiss notification", className: s = "", ...c }) {
|
|
342
360
|
return /* @__PURE__ */ n("div", {
|
|
343
361
|
...c,
|
|
344
362
|
role: i === "error" ? "alert" : "status",
|
|
@@ -367,7 +385,7 @@ function ee({ title: e, children: r, tone: i = "info", onDismiss: a, dismissLabe
|
|
|
367
385
|
});
|
|
368
386
|
}
|
|
369
387
|
// src/components/feedback/EmptyState.tsx
|
|
370
|
-
function
|
|
388
|
+
function ne({ title: e, description: r, icon: i, action: a, className: o = "", ...s }) {
|
|
371
389
|
return /* @__PURE__ */ n("div", {
|
|
372
390
|
...s,
|
|
373
391
|
className: `pancake-empty-state ${o}`,
|
|
@@ -393,7 +411,7 @@ function te({ title: e, description: r, icon: i, action: a, className: o = "", .
|
|
|
393
411
|
});
|
|
394
412
|
}
|
|
395
413
|
// src/components/navigation/SectionHeader.tsx
|
|
396
|
-
function
|
|
414
|
+
function re({ title: e, description: r, action: i, headingLevel: a = 2, className: o = "", ...s }) {
|
|
397
415
|
let c = `h${a}`;
|
|
398
416
|
return /* @__PURE__ */ n("div", {
|
|
399
417
|
...s,
|
|
@@ -414,7 +432,7 @@ function ne({ title: e, description: r, action: i, headingLevel: a = 2, classNam
|
|
|
414
432
|
});
|
|
415
433
|
}
|
|
416
434
|
// src/components/navigation/AppHeader.tsx
|
|
417
|
-
function
|
|
435
|
+
function I({ title: e, description: r, leading: i, trailing: a, className: o = "", ...s }) {
|
|
418
436
|
return /* @__PURE__ */ n("header", {
|
|
419
437
|
...s,
|
|
420
438
|
className: `pancake-app-header ${o}`,
|
|
@@ -441,7 +459,7 @@ function F({ title: e, description: r, leading: i, trailing: a, className: o = "
|
|
|
441
459
|
});
|
|
442
460
|
}
|
|
443
461
|
// src/components/navigation/BottomNavigation.tsx
|
|
444
|
-
function
|
|
462
|
+
function L({ items: e, activeId: r, className: i = "", "aria-label": a = "Main navigation", ...o }) {
|
|
445
463
|
return /* @__PURE__ */ t("nav", {
|
|
446
464
|
...o,
|
|
447
465
|
"aria-label": a,
|
|
@@ -457,7 +475,7 @@ function I({ items: e, activeId: r, className: i = "", "aria-label": a = "Main n
|
|
|
457
475
|
});
|
|
458
476
|
}
|
|
459
477
|
// src/components/navigation/SegmentedControl.tsx
|
|
460
|
-
function
|
|
478
|
+
function R({ label: e, options: r, value: i, defaultValue: a, onValueChange: s, name: c, disabled: l, required: u, className: d = "", ...f }) {
|
|
461
479
|
let p = o();
|
|
462
480
|
return /* @__PURE__ */ n("fieldset", {
|
|
463
481
|
...f,
|
|
@@ -485,29 +503,38 @@ function L({ label: e, options: r, value: i, defaultValue: a, onValueChange: s,
|
|
|
485
503
|
});
|
|
486
504
|
}
|
|
487
505
|
// src/components/navigation/StepProgress.tsx
|
|
488
|
-
function
|
|
506
|
+
function z({ steps: e, currentStep: r, className: i = "", "aria-label": a = "Progress", ...o }) {
|
|
489
507
|
if (!Number.isInteger(r) || r < 0 || r > e.length || e.length === 0) throw Error("StepProgress requires steps and a currentStep from 0 through steps.length (complete).");
|
|
490
508
|
return /* @__PURE__ */ t("ol", {
|
|
491
509
|
...o,
|
|
492
510
|
"aria-label": a,
|
|
493
511
|
className: `pancake-step-progress ${i}`,
|
|
494
|
-
children: e.map((e, i) =>
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
children:
|
|
504
|
-
|
|
505
|
-
|
|
512
|
+
children: e.map((e, i) => {
|
|
513
|
+
let a = i < r;
|
|
514
|
+
return /* @__PURE__ */ n("li", {
|
|
515
|
+
"aria-current": r === i ? "step" : void 0,
|
|
516
|
+
"data-complete": a || void 0,
|
|
517
|
+
children: [/* @__PURE__ */ t("span", {
|
|
518
|
+
className: "pancake-step-number",
|
|
519
|
+
"aria-hidden": "true",
|
|
520
|
+
children: a ? "✓" : i + 1
|
|
521
|
+
}), /* @__PURE__ */ n("span", { children: [e, a && /* @__PURE__ */ t("span", {
|
|
522
|
+
className: "pancake-navigation-sr-only",
|
|
523
|
+
children: " (complete)"
|
|
524
|
+
})] })]
|
|
525
|
+
}, `${i}-${e}`);
|
|
526
|
+
})
|
|
506
527
|
});
|
|
507
528
|
}
|
|
508
529
|
// src/components/Textarea/Textarea.tsx
|
|
509
|
-
function
|
|
510
|
-
let p = o(), m = s ?? p, h =
|
|
530
|
+
function B({ label: e, rows: r = 4, helperText: i, error: a, id: s, className: c = "", required: l, "aria-describedby": u, "aria-invalid": d, ...f }) {
|
|
531
|
+
let p = o(), m = s ?? p, h = C({
|
|
532
|
+
generatedId: p,
|
|
533
|
+
error: a,
|
|
534
|
+
helperText: i,
|
|
535
|
+
describedBy: u,
|
|
536
|
+
invalid: d
|
|
537
|
+
});
|
|
511
538
|
return /* @__PURE__ */ n("div", {
|
|
512
539
|
className: "pancake-field",
|
|
513
540
|
children: [
|
|
@@ -524,22 +551,28 @@ function z({ label: e, rows: r = 4, helperText: i, error: a, id: s, className: c
|
|
|
524
551
|
id: m,
|
|
525
552
|
rows: r,
|
|
526
553
|
required: l,
|
|
527
|
-
"aria-invalid":
|
|
528
|
-
"aria-describedby":
|
|
554
|
+
"aria-invalid": h.invalid,
|
|
555
|
+
"aria-describedby": h.describedBy,
|
|
529
556
|
className: `pancake-field-input pancake-textarea ${c}`
|
|
530
557
|
}),
|
|
531
|
-
|
|
532
|
-
id: h,
|
|
558
|
+
h.text && /* @__PURE__ */ t("p", {
|
|
559
|
+
id: h.id,
|
|
533
560
|
className: "pancake-field-description",
|
|
534
|
-
"aria-live":
|
|
535
|
-
children:
|
|
561
|
+
"aria-live": h.live,
|
|
562
|
+
children: h.text
|
|
536
563
|
})
|
|
537
564
|
]
|
|
538
565
|
});
|
|
539
566
|
}
|
|
540
567
|
// src/components/Select/Select.tsx
|
|
541
|
-
function
|
|
542
|
-
let f = o(), p = a ?? f, m =
|
|
568
|
+
function V({ label: e, helperText: r, error: i, id: a, className: s = "", required: c, "aria-describedby": l, "aria-invalid": u, ...d }) {
|
|
569
|
+
let f = o(), p = a ?? f, m = C({
|
|
570
|
+
generatedId: f,
|
|
571
|
+
error: i,
|
|
572
|
+
helperText: r,
|
|
573
|
+
describedBy: l,
|
|
574
|
+
invalid: u
|
|
575
|
+
});
|
|
543
576
|
return /* @__PURE__ */ n("div", {
|
|
544
577
|
className: "pancake-field",
|
|
545
578
|
children: [
|
|
@@ -557,8 +590,8 @@ function B({ label: e, helperText: r, error: i, id: a, className: s = "", requir
|
|
|
557
590
|
...d,
|
|
558
591
|
id: p,
|
|
559
592
|
required: c,
|
|
560
|
-
"aria-invalid":
|
|
561
|
-
"aria-describedby":
|
|
593
|
+
"aria-invalid": m.invalid,
|
|
594
|
+
"aria-describedby": m.describedBy,
|
|
562
595
|
className: `pancake-field-input pancake-select ${s}`
|
|
563
596
|
}), /* @__PURE__ */ t("span", {
|
|
564
597
|
className: "pancake-select-chevron",
|
|
@@ -566,18 +599,18 @@ function B({ label: e, helperText: r, error: i, id: a, className: s = "", requir
|
|
|
566
599
|
children: "⌄"
|
|
567
600
|
})]
|
|
568
601
|
}),
|
|
569
|
-
|
|
570
|
-
id: m,
|
|
602
|
+
m.text && /* @__PURE__ */ t("p", {
|
|
603
|
+
id: m.id,
|
|
571
604
|
className: "pancake-field-description",
|
|
572
|
-
"aria-live":
|
|
573
|
-
children:
|
|
605
|
+
"aria-live": m.live,
|
|
606
|
+
children: m.text
|
|
574
607
|
})
|
|
575
608
|
]
|
|
576
609
|
});
|
|
577
610
|
}
|
|
578
611
|
// src/components/Button/IconButton.tsx
|
|
579
|
-
function
|
|
580
|
-
return /* @__PURE__ */ t(
|
|
612
|
+
function H({ label: e, children: n, loading: r = !1, className: i = "", ...a }) {
|
|
613
|
+
return /* @__PURE__ */ t(x, {
|
|
581
614
|
...a,
|
|
582
615
|
loading: r,
|
|
583
616
|
"aria-label": e,
|
|
@@ -590,15 +623,15 @@ function V({ label: e, children: n, loading: r = !1, className: i = "", ...a })
|
|
|
590
623
|
});
|
|
591
624
|
}
|
|
592
625
|
// src/components/Button/ButtonLink.tsx
|
|
593
|
-
function
|
|
626
|
+
function U({ variant: e = "primary", size: n = 48, className: r = "", ...i }) {
|
|
594
627
|
return /* @__PURE__ */ t("a", {
|
|
595
628
|
...i,
|
|
596
629
|
className: `pancake-button pancake-button--${e} pancake-button--${n} pancake-button-link ${r}`
|
|
597
630
|
});
|
|
598
631
|
}
|
|
599
632
|
// src/components/Dialog/Dialog.tsx
|
|
600
|
-
function
|
|
601
|
-
let v = l(null), y = o()
|
|
633
|
+
function W({ open: e, onOpenChange: r, title: i, description: a, closeLabel: u = "Close dialog", children: d, ref: f, className: p = "", onCancel: m, onClose: h, "aria-describedby": g, ..._ }) {
|
|
634
|
+
let v = l(null), y = o(), b = `${y}-title`, x = `${y}-description`;
|
|
602
635
|
return s(f, () => v.current, []), c(() => {
|
|
603
636
|
let t = v.current;
|
|
604
637
|
if (t) return e && !t.open ? t.showModal() : !e && t.open && t.close(), () => {
|
|
@@ -608,27 +641,29 @@ function U({ open: e, onOpenChange: r, title: i, description: a, closeLabel: u =
|
|
|
608
641
|
..._,
|
|
609
642
|
ref: v,
|
|
610
643
|
className: `pancake-dialog ${p}`,
|
|
611
|
-
"aria-labelledby":
|
|
612
|
-
"aria-describedby": [g, a ?
|
|
644
|
+
"aria-labelledby": b,
|
|
645
|
+
"aria-describedby": [g, a ? x : void 0].filter(Boolean).join(" ") || void 0,
|
|
613
646
|
onCancel: (e) => {
|
|
614
647
|
m?.(e);
|
|
615
648
|
let t = e.defaultPrevented;
|
|
616
649
|
e.preventDefault(), t || r(!1);
|
|
617
650
|
},
|
|
618
651
|
onClose: (t) => {
|
|
619
|
-
h?.(t)
|
|
652
|
+
h?.(t);
|
|
653
|
+
let n = t.currentTarget.open;
|
|
654
|
+
e && !n && r(!1);
|
|
620
655
|
},
|
|
621
|
-
children: /* @__PURE__ */ n(
|
|
622
|
-
/* @__PURE__ */ n(
|
|
656
|
+
children: /* @__PURE__ */ n(O, { children: [
|
|
657
|
+
/* @__PURE__ */ n(k, {
|
|
623
658
|
justify: "space-between",
|
|
624
659
|
align: "start",
|
|
625
660
|
wrap: !1,
|
|
626
|
-
children: [/* @__PURE__ */ t(
|
|
627
|
-
id:
|
|
661
|
+
children: [/* @__PURE__ */ t(j, {
|
|
662
|
+
id: b,
|
|
628
663
|
as: "h2",
|
|
629
664
|
variant: "heading",
|
|
630
665
|
children: i
|
|
631
|
-
}), /* @__PURE__ */ t(
|
|
666
|
+
}), /* @__PURE__ */ t(H, {
|
|
632
667
|
label: u,
|
|
633
668
|
variant: "ghost",
|
|
634
669
|
size: 40,
|
|
@@ -636,8 +671,8 @@ function U({ open: e, onOpenChange: r, title: i, description: a, closeLabel: u =
|
|
|
636
671
|
children: "×"
|
|
637
672
|
})]
|
|
638
673
|
}),
|
|
639
|
-
a && /* @__PURE__ */ t(
|
|
640
|
-
id:
|
|
674
|
+
a && /* @__PURE__ */ t(j, {
|
|
675
|
+
id: x,
|
|
641
676
|
as: "p",
|
|
642
677
|
color: "muted",
|
|
643
678
|
children: a
|
|
@@ -647,7 +682,7 @@ function U({ open: e, onOpenChange: r, title: i, description: a, closeLabel: u =
|
|
|
647
682
|
});
|
|
648
683
|
}
|
|
649
684
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
650
|
-
function
|
|
685
|
+
function G({ label: e, options: r, value: i, defaultValue: a, onValueChange: s, required: c, helperText: l, error: u, name: d, disabled: f, className: p = "", "aria-describedby": m, "aria-invalid": h, ...g }) {
|
|
651
686
|
let _ = o(), v = `${_}-description`, y = u || l, b = [m, y ? v : void 0].filter(Boolean).join(" ") || void 0;
|
|
652
687
|
return /* @__PURE__ */ n("fieldset", {
|
|
653
688
|
...g,
|
|
@@ -663,7 +698,7 @@ function W({ label: e, options: r, value: i, defaultValue: a, onValueChange: s,
|
|
|
663
698
|
/* @__PURE__ */ t("div", {
|
|
664
699
|
className: "pancake-radio-options",
|
|
665
700
|
children: r.map((e, r) => {
|
|
666
|
-
let o = `${_}-option-${r}`;
|
|
701
|
+
let o = `${_}-label-${r}`, l = `${_}-option-${r}`;
|
|
667
702
|
return /* @__PURE__ */ n("label", {
|
|
668
703
|
className: "pancake-radio-option",
|
|
669
704
|
children: [/* @__PURE__ */ t("input", {
|
|
@@ -674,8 +709,8 @@ function W({ label: e, options: r, value: i, defaultValue: a, onValueChange: s,
|
|
|
674
709
|
value: e.value,
|
|
675
710
|
disabled: e.disabled,
|
|
676
711
|
required: c,
|
|
677
|
-
"aria-labelledby":
|
|
678
|
-
"aria-describedby": e.description ?
|
|
712
|
+
"aria-labelledby": o,
|
|
713
|
+
"aria-describedby": e.description ? l : void 0,
|
|
679
714
|
checked: i === void 0 ? void 0 : i === e.value,
|
|
680
715
|
defaultChecked: i === void 0 ? a === e.value : void 0,
|
|
681
716
|
onChange: (t) => {
|
|
@@ -684,10 +719,10 @@ function W({ label: e, options: r, value: i, defaultValue: a, onValueChange: s,
|
|
|
684
719
|
}), /* @__PURE__ */ n("span", {
|
|
685
720
|
className: "pancake-radio-copy",
|
|
686
721
|
children: [/* @__PURE__ */ t("span", {
|
|
687
|
-
id:
|
|
722
|
+
id: o,
|
|
688
723
|
children: e.label
|
|
689
724
|
}), e.description && /* @__PURE__ */ t("span", {
|
|
690
|
-
id:
|
|
725
|
+
id: l,
|
|
691
726
|
className: "pancake-radio-description",
|
|
692
727
|
children: e.description
|
|
693
728
|
})]
|
|
@@ -704,7 +739,7 @@ function W({ label: e, options: r, value: i, defaultValue: a, onValueChange: s,
|
|
|
704
739
|
});
|
|
705
740
|
}
|
|
706
741
|
// src/components/Switch/Switch.tsx
|
|
707
|
-
function
|
|
742
|
+
function K({ label: e, onChange: r, onCheckedChange: i, id: a, className: s = "", ...c }) {
|
|
708
743
|
let l = o(), u = a ?? l;
|
|
709
744
|
return /* @__PURE__ */ n("label", {
|
|
710
745
|
className: "pancake-switch-label",
|
|
@@ -722,9 +757,9 @@ function G({ label: e, onChange: r, onCheckedChange: i, id: a, className: s = ""
|
|
|
722
757
|
});
|
|
723
758
|
}
|
|
724
759
|
// src/components/Tabs/Tabs.tsx
|
|
725
|
-
function
|
|
726
|
-
let p = o(), [
|
|
727
|
-
e !==
|
|
760
|
+
function q({ label: e, items: r, value: i, defaultValue: a, onValueChange: s, orientation: c = "horizontal", activation: l = "automatic", className: d = "", ...f }) {
|
|
761
|
+
let p = o(), m = (e) => `${p}-tab-${e}`, h = (e) => `${p}-panel-${e}`, [g, _] = u(a), [v, y] = u(), b = r.filter((e) => !e.disabled), x = i ?? g, S = b.find((e) => e.value === x)?.value ?? b[0]?.value, C = b.find((e) => e.value === v)?.value ?? S, w = (e) => {
|
|
762
|
+
e !== S && (i === void 0 && _(e), s?.(e));
|
|
728
763
|
};
|
|
729
764
|
return /* @__PURE__ */ n("div", {
|
|
730
765
|
...f,
|
|
@@ -735,41 +770,41 @@ function K({ label: e, items: r, value: i, defaultValue: a, onValueChange: s, or
|
|
|
735
770
|
"aria-label": e,
|
|
736
771
|
"aria-orientation": c,
|
|
737
772
|
onBlur: (e) => {
|
|
738
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
773
|
+
e.currentTarget.contains(e.relatedTarget) || y(void 0);
|
|
739
774
|
},
|
|
740
775
|
children: r.map((e, n) => /* @__PURE__ */ t("button", {
|
|
741
|
-
id:
|
|
776
|
+
id: m(n),
|
|
742
777
|
className: "pancake-tabs-tab",
|
|
743
778
|
type: "button",
|
|
744
779
|
role: "tab",
|
|
745
|
-
"aria-selected": e.value ===
|
|
746
|
-
"aria-controls":
|
|
747
|
-
tabIndex: !e.disabled && e.value ===
|
|
780
|
+
"aria-selected": e.value === S,
|
|
781
|
+
"aria-controls": h(n),
|
|
782
|
+
tabIndex: !e.disabled && e.value === C ? 0 : -1,
|
|
748
783
|
disabled: e.disabled,
|
|
749
|
-
onFocus: () =>
|
|
750
|
-
onClick: () =>
|
|
784
|
+
onFocus: () => y(e.value),
|
|
785
|
+
onClick: () => w(e.value),
|
|
751
786
|
onKeyDown: (t) => {
|
|
752
|
-
let n = c === "vertical", i = getComputedStyle(t.currentTarget).direction === "rtl", a = n ? "ArrowUp" : i ? "ArrowRight" : "ArrowLeft", o = n ? "ArrowDown" : i ? "ArrowLeft" : "ArrowRight", s =
|
|
753
|
-
if (t.key === "Home" ? u =
|
|
787
|
+
let n = c === "vertical", i = getComputedStyle(t.currentTarget).direction === "rtl", a = n ? "ArrowUp" : i ? "ArrowRight" : "ArrowLeft", o = n ? "ArrowDown" : i ? "ArrowLeft" : "ArrowRight", s = b.findIndex((t) => t.value === e.value), u;
|
|
788
|
+
if (t.key === "Home" ? u = b[0] : t.key === "End" ? u = b.at(-1) : t.key === o ? u = b[(s + 1) % b.length] : t.key === a && (u = b[(s - 1 + b.length) % b.length]), !u) return;
|
|
754
789
|
t.preventDefault();
|
|
755
790
|
let d = r.indexOf(u);
|
|
756
|
-
t.currentTarget.ownerDocument.getElementById(
|
|
791
|
+
t.currentTarget.ownerDocument.getElementById(m(d))?.focus(), l === "automatic" && w(u.value);
|
|
757
792
|
},
|
|
758
793
|
children: e.label
|
|
759
794
|
}, e.value))
|
|
760
795
|
}), r.map((e, n) => /* @__PURE__ */ t("div", {
|
|
761
|
-
id:
|
|
796
|
+
id: h(n),
|
|
762
797
|
className: "pancake-tabs-panel",
|
|
763
798
|
role: "tabpanel",
|
|
764
|
-
"aria-labelledby":
|
|
765
|
-
hidden: e.value !==
|
|
799
|
+
"aria-labelledby": m(n),
|
|
800
|
+
hidden: e.value !== S,
|
|
766
801
|
tabIndex: 0,
|
|
767
802
|
children: e.content
|
|
768
803
|
}, e.value))]
|
|
769
804
|
});
|
|
770
805
|
}
|
|
771
806
|
// src/components/Disclosure/Disclosure.tsx
|
|
772
|
-
function
|
|
807
|
+
function J({ summary: e, children: r, open: i, defaultOpen: a = !1, onOpenChange: o, onToggle: s, onClick: c, className: d = "", ...f }) {
|
|
773
808
|
let [p] = u(a), m = l(p);
|
|
774
809
|
return /* @__PURE__ */ n("details", {
|
|
775
810
|
...f,
|
|
@@ -794,7 +829,7 @@ function q({ summary: e, children: r, open: i, defaultOpen: a = !1, onOpenChange
|
|
|
794
829
|
});
|
|
795
830
|
}
|
|
796
831
|
// src/components/progress/Progress.tsx
|
|
797
|
-
function
|
|
832
|
+
function Y({ label: e, value: r, max: i = 100, id: a, className: s = "", ...c }) {
|
|
798
833
|
let l = o(), u = a ?? l;
|
|
799
834
|
return /* @__PURE__ */ n("div", {
|
|
800
835
|
className: "pancake-progress-field",
|
|
@@ -812,7 +847,7 @@ function J({ label: e, value: r, max: i = 100, id: a, className: s = "", ...c })
|
|
|
812
847
|
});
|
|
813
848
|
}
|
|
814
849
|
// src/components/progress/LoadingIndicator.tsx
|
|
815
|
-
function
|
|
850
|
+
function ie({ label: e, className: r = "", ...i }) {
|
|
816
851
|
return /* @__PURE__ */ n("div", {
|
|
817
852
|
"aria-atomic": "true",
|
|
818
853
|
...i,
|
|
@@ -830,8 +865,14 @@ function Y({ label: e, className: r = "", ...i }) {
|
|
|
830
865
|
});
|
|
831
866
|
}
|
|
832
867
|
// src/components/FileField/FileField.tsx
|
|
833
|
-
function
|
|
834
|
-
let f = o(), p = a ?? f, m =
|
|
868
|
+
function ae({ label: e, helperText: r, error: i, id: a, className: s = "", required: c, "aria-describedby": l, "aria-invalid": u, ...d }) {
|
|
869
|
+
let f = o(), p = a ?? f, m = C({
|
|
870
|
+
generatedId: f,
|
|
871
|
+
error: i,
|
|
872
|
+
helperText: r,
|
|
873
|
+
describedBy: l,
|
|
874
|
+
invalid: u
|
|
875
|
+
});
|
|
835
876
|
return /* @__PURE__ */ n("div", {
|
|
836
877
|
className: "pancake-field",
|
|
837
878
|
children: [
|
|
@@ -848,21 +889,21 @@ function X({ label: e, helperText: r, error: i, id: a, className: s = "", requir
|
|
|
848
889
|
id: p,
|
|
849
890
|
type: "file",
|
|
850
891
|
required: c,
|
|
851
|
-
"aria-invalid":
|
|
852
|
-
"aria-describedby":
|
|
892
|
+
"aria-invalid": m.invalid,
|
|
893
|
+
"aria-describedby": m.describedBy,
|
|
853
894
|
className: `pancake-field-input pancake-file-field ${s}`
|
|
854
895
|
}),
|
|
855
|
-
|
|
856
|
-
id: m,
|
|
896
|
+
m.text && /* @__PURE__ */ t("p", {
|
|
897
|
+
id: m.id,
|
|
857
898
|
className: "pancake-field-description",
|
|
858
|
-
"aria-live":
|
|
859
|
-
children:
|
|
899
|
+
"aria-live": m.live,
|
|
900
|
+
children: m.text
|
|
860
901
|
})
|
|
861
902
|
]
|
|
862
903
|
});
|
|
863
904
|
}
|
|
864
905
|
// src/components/Popover/Popover.tsx
|
|
865
|
-
function
|
|
906
|
+
function oe({ label: e, onOpenChange: n, onToggle: r, className: i = "", ...a }) {
|
|
866
907
|
let o = l(!1);
|
|
867
908
|
return /* @__PURE__ */ t("div", {
|
|
868
909
|
...a,
|
|
@@ -877,41 +918,43 @@ function re({ label: e, onOpenChange: n, onToggle: r, className: i = "", ...a })
|
|
|
877
918
|
});
|
|
878
919
|
}
|
|
879
920
|
// src/components/DropdownMenu/menuKeyboard.ts
|
|
880
|
-
function
|
|
921
|
+
function X(e) {
|
|
881
922
|
return Array.from(e.querySelectorAll("[role=\"menuitem\"]"));
|
|
882
923
|
}
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
924
|
+
var se = 500;
|
|
925
|
+
function Z(e) {
|
|
926
|
+
let t = "", n = 0;
|
|
927
|
+
return (r, i) => {
|
|
928
|
+
if (r.defaultPrevented) return;
|
|
929
|
+
let a = r.currentTarget, o = X(a), s = o.indexOf(a.ownerDocument.activeElement), c;
|
|
930
|
+
if (r.key === "Tab") a.hidePopover(), i?.focus();
|
|
889
931
|
else {
|
|
890
|
-
if (
|
|
891
|
-
else if (
|
|
892
|
-
else if (
|
|
893
|
-
else if (
|
|
894
|
-
else if (
|
|
895
|
-
|
|
932
|
+
if (r.key === "ArrowDown") c = o[(s + 1) % o.length];
|
|
933
|
+
else if (r.key === "ArrowUp") c = o[(s - 1 + o.length) % o.length];
|
|
934
|
+
else if (r.key === "Home") c = o[0];
|
|
935
|
+
else if (r.key === "End") c = o.at(-1);
|
|
936
|
+
else if (r.key === " " && r.target instanceof HTMLAnchorElement) {
|
|
937
|
+
r.preventDefault(), r.target.click();
|
|
896
938
|
return;
|
|
897
|
-
} else if (
|
|
898
|
-
let
|
|
899
|
-
|
|
900
|
-
let
|
|
901
|
-
|
|
939
|
+
} else if (r.key.length === 1 && !r.ctrlKey && !r.metaKey && !r.altKey && r.key !== " ") {
|
|
940
|
+
let i = e();
|
|
941
|
+
t = i - n > se ? r.key : t + r.key, n = i;
|
|
942
|
+
let a = [...t].every((e) => e === t[0]) ? t[0] : t;
|
|
943
|
+
c = o.slice(s + 1).concat(o.slice(0, s + 1)).find((e) => e.textContent?.trim().toLocaleLowerCase().startsWith(a.toLocaleLowerCase())), r.preventDefault();
|
|
902
944
|
}
|
|
903
|
-
|
|
945
|
+
c && (r.preventDefault(), c.focus());
|
|
904
946
|
}
|
|
905
947
|
};
|
|
906
948
|
}
|
|
907
949
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
908
|
-
|
|
909
|
-
|
|
950
|
+
var Q = () => Date.now();
|
|
951
|
+
function ce({ label: r, items: a, triggerProps: d = {}, onOpenChange: f, onToggle: p, onKeyDown: m, ref: h, className: g = "", ..._ }) {
|
|
952
|
+
let v = o(), y = l(null), b = l(null), [S, C] = u(!1), w = l(!1), T = l(Z(Q)), E = l(void 0);
|
|
910
953
|
return c(() => {
|
|
911
|
-
y.current?.matches(":popover-open") && E.current !== void 0 && !a.some((e) => e.id === E.current) && (
|
|
912
|
-
}, [a]), s(h, () => y.current, []), s(d.ref, () =>
|
|
954
|
+
y.current?.matches(":popover-open") && E.current !== void 0 && !a.some((e) => e.id === E.current) && (X(y.current)[0]?.focus(), a.length || y.current.hidePopover());
|
|
955
|
+
}, [a]), s(h, () => y.current, []), s(d.ref, () => b.current, []), /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(x, {
|
|
913
956
|
...d,
|
|
914
|
-
ref:
|
|
957
|
+
ref: b,
|
|
915
958
|
type: "button",
|
|
916
959
|
disabled: d.disabled || a.length === 0,
|
|
917
960
|
popoverTarget: v,
|
|
@@ -919,11 +962,11 @@ function ie({ label: r, items: a, triggerProps: d = {}, onOpenChange: f, onToggl
|
|
|
919
962
|
"aria-expanded": S,
|
|
920
963
|
"aria-controls": v,
|
|
921
964
|
onClick: (e) => {
|
|
922
|
-
d.onClick?.(e), !e.defaultPrevented && y.current && (e.preventDefault(), y.current.matches(":popover-open") ? y.current.hidePopover() : (e.currentTarget.focus(), y.current.showPopover({ source: e.currentTarget }), y.current.matches(":popover-open") &&
|
|
965
|
+
d.onClick?.(e), !e.defaultPrevented && y.current && (e.preventDefault(), y.current.matches(":popover-open") ? y.current.hidePopover() : (e.currentTarget.focus(), y.current.showPopover({ source: e.currentTarget }), y.current.matches(":popover-open") && X(y.current)[0]?.focus()));
|
|
923
966
|
},
|
|
924
967
|
onKeyDown: (e) => {
|
|
925
968
|
if (d.onKeyDown?.(e), !e.defaultPrevented && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), y.current?.showPopover({ source: e.currentTarget }), y.current?.matches(":popover-open"))) {
|
|
926
|
-
let t =
|
|
969
|
+
let t = X(y.current);
|
|
927
970
|
(e.key === "ArrowUp" ? t.at(-1) : t[0])?.focus();
|
|
928
971
|
}
|
|
929
972
|
},
|
|
@@ -938,10 +981,10 @@ function ie({ label: r, items: a, triggerProps: d = {}, onOpenChange: f, onToggl
|
|
|
938
981
|
className: `pancake-popover pancake-dropdown-menu ${g}`,
|
|
939
982
|
onToggle: (e) => {
|
|
940
983
|
let t = e.currentTarget.matches(":popover-open");
|
|
941
|
-
C(t), t || (T.current = Q
|
|
984
|
+
C(t), t || (T.current = Z(Q)), t && e.currentTarget.ownerDocument.activeElement === b.current && X(e.currentTarget)[0]?.focus(), t !== w.current && (w.current = t, f?.(t)), p?.(e);
|
|
942
985
|
},
|
|
943
986
|
onKeyDown: (e) => {
|
|
944
|
-
m?.(e), T.current(e,
|
|
987
|
+
m?.(e), T.current(e, b.current);
|
|
945
988
|
},
|
|
946
989
|
children: a.map((e) => {
|
|
947
990
|
let t = {
|
|
@@ -953,7 +996,7 @@ function ie({ label: r, items: a, triggerProps: d = {}, onOpenChange: f, onToggl
|
|
|
953
996
|
E.current = e.id;
|
|
954
997
|
},
|
|
955
998
|
onClick: (t) => {
|
|
956
|
-
e.disabled ? t.preventDefault() : (y.current?.hidePopover(),
|
|
999
|
+
e.disabled ? t.preventDefault() : (y.current?.hidePopover(), b.current?.focus(), e.type === "action" && e.onSelect());
|
|
957
1000
|
}
|
|
958
1001
|
};
|
|
959
1002
|
return e.type === "link" ? /* @__PURE__ */ i("a", {
|
|
@@ -972,13 +1015,14 @@ function ie({ label: r, items: a, triggerProps: d = {}, onOpenChange: f, onToggl
|
|
|
972
1015
|
})] });
|
|
973
1016
|
}
|
|
974
1017
|
// src/components/Tooltip/useTooltip.ts
|
|
1018
|
+
var le = 150;
|
|
975
1019
|
function $() {
|
|
976
1020
|
let e = l(null), t = l(null), n = l(!1), r = l(!1), i = l(!1), o = l(!1), s = l(void 0), c = () => clearTimeout(s.current), u = () => {
|
|
977
1021
|
c(), t.current?.matches(":popover-open") && t.current.hidePopover();
|
|
978
1022
|
}, d = () => {
|
|
979
1023
|
c(), !i.current && !o.current && e.current && t.current && t.current.showPopover({ source: e.current });
|
|
980
1024
|
}, f = () => {
|
|
981
|
-
c(), !n.current && !r.current && (i.current = !1, s.current = setTimeout(u,
|
|
1025
|
+
c(), !n.current && !r.current && (i.current = !1, s.current = setTimeout(u, le));
|
|
982
1026
|
};
|
|
983
1027
|
return a(() => {
|
|
984
1028
|
let n = e.current.ownerDocument, r = (e) => {
|
|
@@ -1010,7 +1054,7 @@ function $() {
|
|
|
1010
1054
|
};
|
|
1011
1055
|
}
|
|
1012
1056
|
// src/components/Tooltip/Tooltip.tsx
|
|
1013
|
-
function
|
|
1057
|
+
function ue({ content: e, children: i, onOpenChange: a, onToggle: c, ref: u, className: d = "", ...f }) {
|
|
1014
1058
|
let p = o(), { anchor: m, panel: h, handlers: g } = $(), _ = l(!1);
|
|
1015
1059
|
return s(u, () => h.current, [h]), /* @__PURE__ */ n("span", {
|
|
1016
1060
|
ref: m,
|
|
@@ -1036,7 +1080,7 @@ function ae({ content: e, children: i, onOpenChange: a, onToggle: c, ref: u, cla
|
|
|
1036
1080
|
});
|
|
1037
1081
|
}
|
|
1038
1082
|
// src/components/Table/Table.tsx
|
|
1039
|
-
function
|
|
1083
|
+
function de({ caption: e, children: r, className: i = "", ...a }) {
|
|
1040
1084
|
let s = o();
|
|
1041
1085
|
return /* @__PURE__ */ t("div", {
|
|
1042
1086
|
className: "pancake-table-scroll",
|
|
@@ -1054,12 +1098,13 @@ function oe({ caption: e, children: r, className: i = "", ...a }) {
|
|
|
1054
1098
|
});
|
|
1055
1099
|
}
|
|
1056
1100
|
// src/components/Pagination/paginationPages.ts
|
|
1057
|
-
|
|
1101
|
+
var fe = 7;
|
|
1102
|
+
function pe(e, t) {
|
|
1058
1103
|
let n = Number.isFinite(t) ? Math.min(2 ** 53 - 1, Math.max(0, Math.trunc(t))) : 0, r = n ? Math.min(n, Math.max(1, Math.trunc(Number.isFinite(e) ? e : 1))) : 0;
|
|
1059
1104
|
return {
|
|
1060
1105
|
count: n,
|
|
1061
1106
|
current: r,
|
|
1062
|
-
pages: n <=
|
|
1107
|
+
pages: n <= fe ? Array.from({ length: n }, (e, t) => t + 1) : [.../* @__PURE__ */ new Set([
|
|
1063
1108
|
1,
|
|
1064
1109
|
r - 1,
|
|
1065
1110
|
r,
|
|
@@ -1069,31 +1114,31 @@ function se(e, t) {
|
|
|
1069
1114
|
};
|
|
1070
1115
|
}
|
|
1071
1116
|
// src/components/Pagination/Pagination.tsx
|
|
1072
|
-
function
|
|
1073
|
-
let { count: d, current: f, pages: p } =
|
|
1074
|
-
let
|
|
1117
|
+
function me({ label: e, page: r, pageCount: i, labels: a = {}, getPageHref: o, onPageChange: s, linkProps: c, className: l = "", ...u }) {
|
|
1118
|
+
let { count: d, current: f, pages: p } = pe(r, i), m = a.page ?? ((e) => `Page ${e}`), h = a.previous ?? "Previous", g = a.next ?? "Next", _ = (e, n, r, i = !1) => {
|
|
1119
|
+
let a = e === f;
|
|
1075
1120
|
return o ? i ? /* @__PURE__ */ t("span", {
|
|
1076
1121
|
className: "pancake-button pancake-button--secondary pancake-button--40 pancake-pagination-control pancake-pagination-unavailable",
|
|
1077
1122
|
"aria-disabled": "true",
|
|
1078
1123
|
children: n
|
|
1079
|
-
}) : /* @__PURE__ */ t(
|
|
1124
|
+
}) : /* @__PURE__ */ t(U, {
|
|
1080
1125
|
target: c?.target,
|
|
1081
1126
|
rel: c?.rel,
|
|
1082
1127
|
href: o(e),
|
|
1083
1128
|
size: 40,
|
|
1084
|
-
variant:
|
|
1129
|
+
variant: a ? "primary" : "secondary",
|
|
1085
1130
|
className: "pancake-pagination-control",
|
|
1086
1131
|
"aria-label": r,
|
|
1087
|
-
"aria-current":
|
|
1132
|
+
"aria-current": a ? "page" : void 0,
|
|
1088
1133
|
children: n
|
|
1089
|
-
}) : /* @__PURE__ */ t(
|
|
1134
|
+
}) : /* @__PURE__ */ t(x, {
|
|
1090
1135
|
type: "button",
|
|
1091
1136
|
size: 40,
|
|
1092
|
-
variant:
|
|
1137
|
+
variant: a ? "primary" : "secondary",
|
|
1093
1138
|
className: "pancake-pagination-control",
|
|
1094
1139
|
disabled: i,
|
|
1095
1140
|
"aria-label": r,
|
|
1096
|
-
"aria-current":
|
|
1141
|
+
"aria-current": a ? "page" : void 0,
|
|
1097
1142
|
onClick: () => {
|
|
1098
1143
|
e !== f && s?.(e);
|
|
1099
1144
|
},
|
|
@@ -1112,10 +1157,10 @@ function ce({ label: e, page: r, pageCount: i, labels: a = {}, getPageHref: o, o
|
|
|
1112
1157
|
"aria-hidden": "true",
|
|
1113
1158
|
className: "pancake-pagination-gap",
|
|
1114
1159
|
children: "…"
|
|
1115
|
-
}, `gap-${e}`)] : [], /* @__PURE__ */ t("li", { children: _(e, e, m(e)
|
|
1160
|
+
}, `gap-${e}`)] : [], /* @__PURE__ */ t("li", { children: _(e, e, m(e)) }, e)]),
|
|
1116
1161
|
/* @__PURE__ */ t("li", { children: _(f + 1, g, g, f >= d) })
|
|
1117
1162
|
]
|
|
1118
1163
|
})
|
|
1119
1164
|
});
|
|
1120
1165
|
}
|
|
1121
|
-
export {
|
|
1166
|
+
export { I as AppHeader, P as Avatar, F as AvatarGroup, te as BannerToast, L as BottomNavigation, x as Button, U as ButtonLink, S as Checkbox, W as Dialog, J as Disclosure, ce as DropdownMenu, ne as EmptyState, ae as FileField, H as IconButton, k as Inline, ie as LoadingIndicator, me as Pagination, oe as Popover, Y as Progress, G as RadioGroup, re as SectionHeader, R as SegmentedControl, V as Select, O as Stack, ee as StatusChip, z as StepProgress, b as Surface, K as Switch, de as Table, q as Tabs, j as Text, w as TextField, B as Textarea, ue as Tooltip, h as borders, d as colors, g as opacity, p as radii, m as sizing, f as spacing, y as typography };
|