@openwarelabs/ui 0.1.1 → 0.3.0
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/README.md +2 -1
- package/dist/components/Avatar/Avatar.d.cts +13 -2
- package/dist/components/Avatar/Avatar.d.ts +13 -2
- package/dist/components/Avatar/AvatarGroup.d.cts +6 -5
- package/dist/components/Avatar/AvatarGroup.d.ts +6 -5
- package/dist/components/Steps/Steps.d.cts +1 -1
- package/dist/components/Steps/Steps.d.ts +1 -1
- package/dist/components/Table/Table.d.cts +6 -1
- package/dist/components/Table/Table.d.ts +6 -1
- package/dist/components/Text/Text.d.cts +26 -0
- package/dist/components/Text/Text.d.ts +26 -0
- package/dist/components/Tooltip/Tooltip.d.cts +3 -3
- package/dist/components/Tooltip/Tooltip.d.ts +3 -3
- package/dist/components.css +166 -22
- package/dist/hooks/useFloating.d.cts +2 -2
- package/dist/hooks/useFloating.d.ts +2 -2
- package/dist/index.cjs +616 -533
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +478 -395
- package/dist/index.js.map +4 -4
- package/dist/openware-ui.iife.js +6 -6
- package/dist/styles.css +170 -23
- package/dist/tailwind.css +1 -0
- package/dist/tokens.css +4 -1
- package/dist/tokens.json +12 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// src/components/Button/Button.tsx
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
|
|
4
1
|
// src/utils/cx.ts
|
|
5
2
|
function cx(...values) {
|
|
6
3
|
const classes = [];
|
|
@@ -15,6 +12,52 @@ function cx(...values) {
|
|
|
15
12
|
return classes.join(" ");
|
|
16
13
|
}
|
|
17
14
|
|
|
15
|
+
// src/components/Text/Text.tsx
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
var elements = {
|
|
18
|
+
hero: "h1",
|
|
19
|
+
"page-title": "h1",
|
|
20
|
+
"section-title": "h2",
|
|
21
|
+
heading: "h3",
|
|
22
|
+
lead: "p",
|
|
23
|
+
prose: "p",
|
|
24
|
+
"dialog-title": "h2",
|
|
25
|
+
"card-title": "h3",
|
|
26
|
+
body: "p",
|
|
27
|
+
copy: "p",
|
|
28
|
+
label: "span",
|
|
29
|
+
button: "span",
|
|
30
|
+
caption: "span",
|
|
31
|
+
badge: "span",
|
|
32
|
+
overline: "span",
|
|
33
|
+
code: "code",
|
|
34
|
+
kbd: "kbd"
|
|
35
|
+
};
|
|
36
|
+
var mutedByDefault = ["lead", "copy", "caption", "overline"];
|
|
37
|
+
function Text({ variant = "body", as, tone, align, truncate = false, className, children, ...props }) {
|
|
38
|
+
const Element = as ?? elements[variant];
|
|
39
|
+
const colour = tone ?? (mutedByDefault.includes(variant) ? "muted" : void 0);
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
Element,
|
|
42
|
+
{
|
|
43
|
+
className: cx(
|
|
44
|
+
"ow-text",
|
|
45
|
+
`ow-type-${variant}`,
|
|
46
|
+
`ow-text--${variant}`,
|
|
47
|
+
colour && `ow-text--${colour}`,
|
|
48
|
+
align && align !== "start" && `ow-text--${align}`,
|
|
49
|
+
truncate && "ow-text--truncate",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
...props,
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// src/components/Button/Button.tsx
|
|
59
|
+
import { forwardRef } from "react";
|
|
60
|
+
|
|
18
61
|
// src/utils/text.ts
|
|
19
62
|
function getInitials(name) {
|
|
20
63
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
@@ -27,9 +70,9 @@ function toAriaShortcut(shortcut) {
|
|
|
27
70
|
}
|
|
28
71
|
|
|
29
72
|
// src/components/Spinner/Spinner.tsx
|
|
30
|
-
import { jsx } from "react/jsx-runtime";
|
|
73
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
31
74
|
function Spinner({ size = "md", tone = "primary", label = "Loading", className }) {
|
|
32
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ jsx2(
|
|
33
76
|
"span",
|
|
34
77
|
{
|
|
35
78
|
className: cx("ow-spinner", `ow-spinner--${size}`, `ow-spinner--${tone}`, className),
|
|
@@ -39,7 +82,7 @@ function Spinner({ size = "md", tone = "primary", label = "Loading", className }
|
|
|
39
82
|
}
|
|
40
83
|
|
|
41
84
|
// src/components/Button/Button.tsx
|
|
42
|
-
import { jsx as
|
|
85
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
43
86
|
function buttonClassName({
|
|
44
87
|
variant = "secondary",
|
|
45
88
|
size = "md",
|
|
@@ -70,7 +113,7 @@ var Button = forwardRef(function Button2({
|
|
|
70
113
|
variant = "secondary",
|
|
71
114
|
...buttonProps
|
|
72
115
|
}, ref) {
|
|
73
|
-
const leading = loading ? /* @__PURE__ */
|
|
116
|
+
const leading = loading ? /* @__PURE__ */ jsx3(Spinner, { size: "sm", tone: "current", label: "" }) : startIcon;
|
|
74
117
|
return /* @__PURE__ */ jsxs(
|
|
75
118
|
"button",
|
|
76
119
|
{
|
|
@@ -88,10 +131,10 @@ var Button = forwardRef(function Button2({
|
|
|
88
131
|
"aria-keyshortcuts": shortcut ? toAriaShortcut(shortcut) : void 0,
|
|
89
132
|
...buttonProps,
|
|
90
133
|
children: [
|
|
91
|
-
leading ? /* @__PURE__ */
|
|
134
|
+
leading ? /* @__PURE__ */ jsx3("span", { className: "ow-button__icon", children: leading }) : null,
|
|
92
135
|
iconOnly && loading ? null : children,
|
|
93
|
-
endIcon && !iconOnly ? /* @__PURE__ */
|
|
94
|
-
shortcut && !iconOnly ? /* @__PURE__ */
|
|
136
|
+
endIcon && !iconOnly ? /* @__PURE__ */ jsx3("span", { className: "ow-button__icon", children: endIcon }) : null,
|
|
137
|
+
shortcut && !iconOnly ? /* @__PURE__ */ jsx3("kbd", { "aria-hidden": "true", className: "ow-button__shortcut", children: shortcut }) : null
|
|
95
138
|
]
|
|
96
139
|
}
|
|
97
140
|
);
|
|
@@ -123,10 +166,10 @@ function useControllableState(value, defaultValue, onChange) {
|
|
|
123
166
|
}
|
|
124
167
|
|
|
125
168
|
// src/icons.tsx
|
|
126
|
-
import { Fragment, jsx as
|
|
169
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
127
170
|
function icon(paths) {
|
|
128
171
|
return function Icon({ size = 16, strokeWidth = 2, ...props }) {
|
|
129
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ jsx4(
|
|
130
173
|
"svg",
|
|
131
174
|
{
|
|
132
175
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -146,160 +189,160 @@ function icon(paths) {
|
|
|
146
189
|
);
|
|
147
190
|
};
|
|
148
191
|
}
|
|
149
|
-
var CheckIcon = icon(/* @__PURE__ */
|
|
150
|
-
var ChevronDownIcon = icon(/* @__PURE__ */
|
|
192
|
+
var CheckIcon = icon(/* @__PURE__ */ jsx4("path", { d: "M20 6 9 17l-5-5" }));
|
|
193
|
+
var ChevronDownIcon = icon(/* @__PURE__ */ jsx4("path", { d: "m6 9 6 6 6-6" }));
|
|
151
194
|
var SearchIcon = icon(
|
|
152
195
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ jsx4("circle", { cx: "11", cy: "11", r: "8" }),
|
|
197
|
+
/* @__PURE__ */ jsx4("path", { d: "m21 21-4.3-4.3" })
|
|
155
198
|
] })
|
|
156
199
|
);
|
|
157
200
|
var CornerDownLeftIcon = icon(
|
|
158
201
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ jsx4("polyline", { points: "9 10 4 15 9 20" }),
|
|
203
|
+
/* @__PURE__ */ jsx4("path", { d: "M20 4v7a4 4 0 0 1-4 4H4" })
|
|
161
204
|
] })
|
|
162
205
|
);
|
|
163
206
|
var XIcon = icon(
|
|
164
207
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ jsx4("path", { d: "M18 6 6 18" }),
|
|
209
|
+
/* @__PURE__ */ jsx4("path", { d: "m6 6 12 12" })
|
|
167
210
|
] })
|
|
168
211
|
);
|
|
169
212
|
var UserIcon = icon(
|
|
170
213
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ jsx4("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
215
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "7", r: "4" })
|
|
173
216
|
] })
|
|
174
217
|
);
|
|
175
218
|
var TrashIcon = icon(
|
|
176
219
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ jsx4("path", { d: "M3 6h18" }),
|
|
221
|
+
/* @__PURE__ */ jsx4("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
|
|
222
|
+
/* @__PURE__ */ jsx4("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }),
|
|
223
|
+
/* @__PURE__ */ jsx4("line", { x1: "10", x2: "10", y1: "11", y2: "17" }),
|
|
224
|
+
/* @__PURE__ */ jsx4("line", { x1: "14", x2: "14", y1: "11", y2: "17" })
|
|
182
225
|
] })
|
|
183
226
|
);
|
|
184
227
|
var CircleCheckIcon = icon(
|
|
185
228
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "10" }),
|
|
230
|
+
/* @__PURE__ */ jsx4("path", { d: "m9 12 2 2 4-4" })
|
|
188
231
|
] })
|
|
189
232
|
);
|
|
190
233
|
var CircleAlertIcon = icon(
|
|
191
234
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "10" }),
|
|
236
|
+
/* @__PURE__ */ jsx4("line", { x1: "12", x2: "12", y1: "8", y2: "12" }),
|
|
237
|
+
/* @__PURE__ */ jsx4("line", { x1: "12", x2: "12.01", y1: "16", y2: "16" })
|
|
195
238
|
] })
|
|
196
239
|
);
|
|
197
|
-
var ChevronRightIcon = icon(/* @__PURE__ */
|
|
198
|
-
var ChevronLeftIcon = icon(/* @__PURE__ */
|
|
199
|
-
var ChevronUpIcon = icon(/* @__PURE__ */
|
|
200
|
-
var MinusIcon = icon(/* @__PURE__ */
|
|
240
|
+
var ChevronRightIcon = icon(/* @__PURE__ */ jsx4("path", { d: "m9 18 6-6-6-6" }));
|
|
241
|
+
var ChevronLeftIcon = icon(/* @__PURE__ */ jsx4("path", { d: "m15 18-6-6 6-6" }));
|
|
242
|
+
var ChevronUpIcon = icon(/* @__PURE__ */ jsx4("path", { d: "m18 15-6-6-6 6" }));
|
|
243
|
+
var MinusIcon = icon(/* @__PURE__ */ jsx4("path", { d: "M5 12h14" }));
|
|
201
244
|
var PlusIcon = icon(
|
|
202
245
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ jsx4("path", { d: "M5 12h14" }),
|
|
247
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 5v14" })
|
|
205
248
|
] })
|
|
206
249
|
);
|
|
207
250
|
var InfoIcon = icon(
|
|
208
251
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "10" }),
|
|
253
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 16v-4" }),
|
|
254
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 8h.01" })
|
|
212
255
|
] })
|
|
213
256
|
);
|
|
214
257
|
var TriangleAlertIcon = icon(
|
|
215
258
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ jsx4("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
260
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 9v4" }),
|
|
261
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 17h.01" })
|
|
219
262
|
] })
|
|
220
263
|
);
|
|
221
264
|
var PipetteIcon = icon(
|
|
222
265
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ jsx4("path", { d: "m2 22 1-1h3l9-9" }),
|
|
267
|
+
/* @__PURE__ */ jsx4("path", { d: "M3 21v-3l9-9" }),
|
|
268
|
+
/* @__PURE__ */ jsx4("path", { d: "m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" })
|
|
226
269
|
] })
|
|
227
270
|
);
|
|
228
271
|
var CopyIcon = icon(
|
|
229
272
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ jsx4("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
274
|
+
/* @__PURE__ */ jsx4("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
232
275
|
] })
|
|
233
276
|
);
|
|
234
277
|
var CalendarIcon = icon(
|
|
235
278
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ jsx4("path", { d: "M8 2v4" }),
|
|
280
|
+
/* @__PURE__ */ jsx4("path", { d: "M16 2v4" }),
|
|
281
|
+
/* @__PURE__ */ jsx4("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2" }),
|
|
282
|
+
/* @__PURE__ */ jsx4("path", { d: "M3 10h18" })
|
|
240
283
|
] })
|
|
241
284
|
);
|
|
242
285
|
var FileIcon = icon(
|
|
243
286
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ jsx4("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
288
|
+
/* @__PURE__ */ jsx4("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })
|
|
246
289
|
] })
|
|
247
290
|
);
|
|
248
291
|
var FolderIcon = icon(
|
|
249
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ jsx4("path", { d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" })
|
|
250
293
|
);
|
|
251
294
|
var FolderOpenIcon = icon(
|
|
252
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ jsx4("path", { d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" })
|
|
253
296
|
);
|
|
254
297
|
var UploadIcon = icon(
|
|
255
298
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ jsx4("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
300
|
+
/* @__PURE__ */ jsx4("polyline", { points: "17 8 12 3 7 8" }),
|
|
301
|
+
/* @__PURE__ */ jsx4("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
|
|
259
302
|
] })
|
|
260
303
|
);
|
|
261
304
|
var ArrowUpRightIcon = icon(
|
|
262
305
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ jsx4("path", { d: "M7 7h10v10" }),
|
|
307
|
+
/* @__PURE__ */ jsx4("path", { d: "M7 17 17 7" })
|
|
265
308
|
] })
|
|
266
309
|
);
|
|
267
310
|
var ArrowUpIcon = icon(
|
|
268
311
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ jsx4("path", { d: "m5 12 7-7 7 7" }),
|
|
313
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 19V5" })
|
|
271
314
|
] })
|
|
272
315
|
);
|
|
273
316
|
var ArrowDownIcon = icon(
|
|
274
317
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 5v14" }),
|
|
319
|
+
/* @__PURE__ */ jsx4("path", { d: "m19 12-7 7-7-7" })
|
|
277
320
|
] })
|
|
278
321
|
);
|
|
279
322
|
var ChevronsUpDownIcon = icon(
|
|
280
323
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ jsx4("path", { d: "m7 15 5 5 5-5" }),
|
|
325
|
+
/* @__PURE__ */ jsx4("path", { d: "m7 9 5-5 5 5" })
|
|
283
326
|
] })
|
|
284
327
|
);
|
|
285
328
|
var InboxIcon = icon(
|
|
286
329
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ jsx4("polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12" }),
|
|
331
|
+
/* @__PURE__ */ jsx4("path", { d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" })
|
|
289
332
|
] })
|
|
290
333
|
);
|
|
291
334
|
var EllipsisIcon = icon(
|
|
292
335
|
/* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "1" }),
|
|
337
|
+
/* @__PURE__ */ jsx4("circle", { cx: "19", cy: "12", r: "1" }),
|
|
338
|
+
/* @__PURE__ */ jsx4("circle", { cx: "5", cy: "12", r: "1" })
|
|
296
339
|
] })
|
|
297
340
|
);
|
|
298
341
|
|
|
299
342
|
// src/components/Button/ButtonGroup.tsx
|
|
300
|
-
import { jsx as
|
|
343
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
301
344
|
function ButtonGroup({ attached = true, orientation = "horizontal", className, ...props }) {
|
|
302
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ jsx5(
|
|
303
346
|
"div",
|
|
304
347
|
{
|
|
305
348
|
role: "group",
|
|
@@ -314,7 +357,7 @@ function ButtonGroup({ attached = true, orientation = "horizontal", className, .
|
|
|
314
357
|
);
|
|
315
358
|
}
|
|
316
359
|
var CloseButton = forwardRef2(function CloseButton2({ size = "md", label = "Close", className, type = "button", ...buttonProps }, ref) {
|
|
317
|
-
return /* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ jsx5(
|
|
318
361
|
"button",
|
|
319
362
|
{
|
|
320
363
|
ref,
|
|
@@ -322,13 +365,13 @@ var CloseButton = forwardRef2(function CloseButton2({ size = "md", label = "Clos
|
|
|
322
365
|
"aria-label": label,
|
|
323
366
|
className: cx("ow-close-button", `ow-close-button--${size}`, className),
|
|
324
367
|
...buttonProps,
|
|
325
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ jsx5(XIcon, { size: size === "sm" ? 14 : 17 })
|
|
326
369
|
}
|
|
327
370
|
);
|
|
328
371
|
});
|
|
329
372
|
var ToggleButton = forwardRef2(function ToggleButton2({ pressed, defaultPressed = false, onPressedChange, onClick, className, variant = "secondary", ...buttonProps }, ref) {
|
|
330
373
|
const [isPressed, setPressed] = useControllableState(pressed, defaultPressed, onPressedChange);
|
|
331
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ jsx5(
|
|
332
375
|
Button,
|
|
333
376
|
{
|
|
334
377
|
ref,
|
|
@@ -386,7 +429,7 @@ function useIndicator(containerRef, selector, key) {
|
|
|
386
429
|
}
|
|
387
430
|
|
|
388
431
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
389
|
-
import { jsx as
|
|
432
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
390
433
|
function SegmentedControl({
|
|
391
434
|
options,
|
|
392
435
|
value,
|
|
@@ -443,14 +486,14 @@ function SegmentedControl({
|
|
|
443
486
|
onClick: () => setCurrent(option.value),
|
|
444
487
|
onKeyDown: (event) => onKeyDown(event, index),
|
|
445
488
|
children: [
|
|
446
|
-
option.icon ? /* @__PURE__ */
|
|
489
|
+
option.icon ? /* @__PURE__ */ jsx6("span", { className: "ow-segmented__icon", children: option.icon }) : null,
|
|
447
490
|
option.label
|
|
448
491
|
]
|
|
449
492
|
},
|
|
450
493
|
option.value
|
|
451
494
|
);
|
|
452
495
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ jsx6("span", { className: "ow-indicator", "aria-hidden": "true" })
|
|
454
497
|
]
|
|
455
498
|
}
|
|
456
499
|
);
|
|
@@ -458,7 +501,7 @@ function SegmentedControl({
|
|
|
458
501
|
|
|
459
502
|
// src/components/ChoiceCard/ChoiceCard.tsx
|
|
460
503
|
import { forwardRef as forwardRef3 } from "react";
|
|
461
|
-
import { jsx as
|
|
504
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
462
505
|
var ChoiceCard = forwardRef3(function ChoiceCard2({ className, description, icon: icon2, recommended = false, shortcut, title, type = "button", ...buttonProps }, ref) {
|
|
463
506
|
return /* @__PURE__ */ jsxs4(
|
|
464
507
|
"button",
|
|
@@ -470,12 +513,12 @@ var ChoiceCard = forwardRef3(function ChoiceCard2({ className, description, icon
|
|
|
470
513
|
...buttonProps,
|
|
471
514
|
children: [
|
|
472
515
|
/* @__PURE__ */ jsxs4("span", { className: "ow-choice__top", children: [
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
shortcut ? /* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ jsx7("span", { className: "ow-choice__icon", children: icon2 }),
|
|
517
|
+
shortcut ? /* @__PURE__ */ jsx7("kbd", { "aria-hidden": "true", className: "ow-choice__shortcut", children: shortcut }) : null
|
|
475
518
|
] }),
|
|
476
519
|
/* @__PURE__ */ jsxs4("span", { className: "ow-choice__text", children: [
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ jsx7("span", { className: "ow-choice__title", children: title }),
|
|
521
|
+
/* @__PURE__ */ jsx7("span", { className: "ow-choice__description", children: description })
|
|
479
522
|
] })
|
|
480
523
|
]
|
|
481
524
|
}
|
|
@@ -510,7 +553,7 @@ async function copyText(text) {
|
|
|
510
553
|
}
|
|
511
554
|
|
|
512
555
|
// src/components/CodeBlock/CodeBlock.tsx
|
|
513
|
-
import { jsx as
|
|
556
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
514
557
|
function CopyButton({ value, label = "Copy", copiedLabel = "Copied", iconOnly = false, tone = "default", onCopy, className }) {
|
|
515
558
|
const [copied, setCopied] = useState2(false);
|
|
516
559
|
const timer = useRef3(0);
|
|
@@ -537,11 +580,11 @@ function CopyButton({ value, label = "Copy", copiedLabel = "Copied", iconOnly =
|
|
|
537
580
|
},
|
|
538
581
|
children: [
|
|
539
582
|
/* @__PURE__ */ jsxs5("span", { className: "ow-copy-button__icon", "aria-hidden": "true", children: [
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ jsx8(CopyIcon, { size: 14 }),
|
|
584
|
+
/* @__PURE__ */ jsx8(CheckIcon, { size: 14 })
|
|
542
585
|
] }),
|
|
543
|
-
iconOnly ? null : /* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
586
|
+
iconOnly ? null : /* @__PURE__ */ jsx8("span", { children: copied ? copiedLabel : label }),
|
|
587
|
+
/* @__PURE__ */ jsx8("span", { className: "ow-visually-hidden", "aria-live": "polite", children: copied ? copiedLabel : "" })
|
|
545
588
|
]
|
|
546
589
|
}
|
|
547
590
|
);
|
|
@@ -551,29 +594,29 @@ function CodeBlock({ code, html, title, language, showLineNumbers = false, copya
|
|
|
551
594
|
const lines = code.replace(/\n$/, "").split("\n");
|
|
552
595
|
return /* @__PURE__ */ jsxs5("div", { className: cx("ow-code-block", showLineNumbers && "ow-code-block--numbered", className), children: [
|
|
553
596
|
hasHeader ? /* @__PURE__ */ jsxs5("div", { className: "ow-code-block__header", children: [
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
language ? /* @__PURE__ */
|
|
556
|
-
copyable ? /* @__PURE__ */
|
|
557
|
-
] }) : copyable ? /* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ jsx8("span", { className: "ow-code-block__title", children: title }),
|
|
598
|
+
language ? /* @__PURE__ */ jsx8("span", { className: "ow-code-block__language", children: language }) : null,
|
|
599
|
+
copyable ? /* @__PURE__ */ jsx8(CopyButton, { value: code, tone: "onDark", iconOnly: true, label: "Copy code" }) : null
|
|
600
|
+
] }) : copyable ? /* @__PURE__ */ jsx8(CopyButton, { value: code, tone: "onDark", iconOnly: true, label: "Copy code", className: "ow-code-block__floating-copy" }) : null,
|
|
558
601
|
/* @__PURE__ */ jsxs5("pre", { className: "ow-code-block__pre", style: maxHeight ? { maxHeight } : void 0, tabIndex: 0, children: [
|
|
559
|
-
showLineNumbers ? /* @__PURE__ */
|
|
560
|
-
html ? /* @__PURE__ */
|
|
602
|
+
showLineNumbers ? /* @__PURE__ */ jsx8("span", { className: "ow-code-block__numbers", "aria-hidden": "true", children: lines.map((_, index) => /* @__PURE__ */ jsx8("span", { children: index + 1 }, index)) }) : null,
|
|
603
|
+
html ? /* @__PURE__ */ jsx8("code", { className: "ow-code-block__code", dangerouslySetInnerHTML: { __html: html } }) : /* @__PURE__ */ jsx8("code", { className: "ow-code-block__code", children: code.replace(/\n$/, "") })
|
|
561
604
|
] })
|
|
562
605
|
] });
|
|
563
606
|
}
|
|
564
607
|
function Snippet({ value, prompt = "$", className }) {
|
|
565
608
|
return /* @__PURE__ */ jsxs5("div", { className: cx("ow-snippet", className), children: [
|
|
566
609
|
/* @__PURE__ */ jsxs5("code", { className: "ow-snippet__code", children: [
|
|
567
|
-
prompt ? /* @__PURE__ */
|
|
610
|
+
prompt ? /* @__PURE__ */ jsx8("span", { className: "ow-snippet__prompt", "aria-hidden": "true", children: prompt }) : null,
|
|
568
611
|
value
|
|
569
612
|
] }),
|
|
570
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ jsx8(CopyButton, { value, iconOnly: true, label: `Copy ${value}` })
|
|
571
614
|
] });
|
|
572
615
|
}
|
|
573
616
|
|
|
574
617
|
// src/components/Field/Field.tsx
|
|
575
618
|
import { cloneElement, isValidElement, useId } from "react";
|
|
576
|
-
import { jsx as
|
|
619
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
577
620
|
function Field({ label, children, hint, error, className }) {
|
|
578
621
|
const generatedId = useId();
|
|
579
622
|
const hintId = `${generatedId}-hint`;
|
|
@@ -583,20 +626,20 @@ function Field({ label, children, hint, error, className }) {
|
|
|
583
626
|
const describedBy = [child?.props["aria-describedby"], hint ? hintId : void 0, error ? errorId : void 0].filter(Boolean).join(" ") || void 0;
|
|
584
627
|
const invalidProp = child && typeof child.type !== "string" ? { isInvalid: child.props.isInvalid ?? Boolean(error) } : { "aria-invalid": error ? true : void 0 };
|
|
585
628
|
return /* @__PURE__ */ jsxs6("div", { className: cx("ow-field", className), children: [
|
|
586
|
-
/* @__PURE__ */
|
|
629
|
+
/* @__PURE__ */ jsx9("label", { className: "ow-field__label", htmlFor: controlId, children: label }),
|
|
587
630
|
child ? cloneElement(child, { id: controlId, "aria-describedby": describedBy, ...invalidProp }) : children,
|
|
588
|
-
hint ? /* @__PURE__ */
|
|
589
|
-
error ? /* @__PURE__ */
|
|
631
|
+
hint ? /* @__PURE__ */ jsx9("p", { id: hintId, className: "ow-field__hint", children: hint }) : null,
|
|
632
|
+
error ? /* @__PURE__ */ jsx9("p", { id: errorId, role: "alert", className: "ow-field__error", children: error }) : null
|
|
590
633
|
] });
|
|
591
634
|
}
|
|
592
635
|
|
|
593
636
|
// src/components/Input/Input.tsx
|
|
594
637
|
import { forwardRef as forwardRef4 } from "react";
|
|
595
|
-
import { jsx as
|
|
638
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
596
639
|
var Input = forwardRef4(function Input2({ className, isInvalid = false, size = "md", startContent, endContent, ...inputProps }, ref) {
|
|
597
640
|
const invalid = isInvalid || void 0;
|
|
598
641
|
if (startContent === void 0 && endContent === void 0) {
|
|
599
|
-
return /* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ jsx10(
|
|
600
643
|
"input",
|
|
601
644
|
{
|
|
602
645
|
ref,
|
|
@@ -617,9 +660,9 @@ var Input = forwardRef4(function Input2({ className, isInvalid = false, size = "
|
|
|
617
660
|
className
|
|
618
661
|
),
|
|
619
662
|
children: [
|
|
620
|
-
startContent !== void 0 ? /* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
endContent !== void 0 ? /* @__PURE__ */
|
|
663
|
+
startContent !== void 0 ? /* @__PURE__ */ jsx10("span", { className: "ow-input-group__addon", children: startContent }) : null,
|
|
664
|
+
/* @__PURE__ */ jsx10("input", { ref, className: "ow-input-group__input", "aria-invalid": invalid, ...inputProps }),
|
|
665
|
+
endContent !== void 0 ? /* @__PURE__ */ jsx10("span", { className: "ow-input-group__addon", children: endContent }) : null
|
|
623
666
|
]
|
|
624
667
|
}
|
|
625
668
|
);
|
|
@@ -627,7 +670,7 @@ var Input = forwardRef4(function Input2({ className, isInvalid = false, size = "
|
|
|
627
670
|
|
|
628
671
|
// src/components/SearchField/SearchField.tsx
|
|
629
672
|
import { forwardRef as forwardRef5, useRef as useRef4 } from "react";
|
|
630
|
-
import { jsx as
|
|
673
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
631
674
|
function assignRef(ref, value) {
|
|
632
675
|
if (typeof ref === "function") ref(value);
|
|
633
676
|
else if (ref) ref.current = value;
|
|
@@ -657,7 +700,7 @@ var SearchField = forwardRef5(function SearchField2({
|
|
|
657
700
|
onSubmit?.(text);
|
|
658
701
|
}
|
|
659
702
|
}
|
|
660
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ jsx11(
|
|
661
704
|
Input,
|
|
662
705
|
{
|
|
663
706
|
ref: (element) => {
|
|
@@ -671,8 +714,8 @@ var SearchField = forwardRef5(function SearchField2({
|
|
|
671
714
|
value: text,
|
|
672
715
|
onChange: (event) => setText(event.target.value),
|
|
673
716
|
onKeyDown: handleKeyDown,
|
|
674
|
-
startContent: /* @__PURE__ */
|
|
675
|
-
endContent: loading ? /* @__PURE__ */
|
|
717
|
+
startContent: /* @__PURE__ */ jsx11(SearchIcon, { size: size === "sm" ? 14 : 16 }),
|
|
718
|
+
endContent: loading ? /* @__PURE__ */ jsx11(Spinner, { size: "sm", label: "Searching" }) : text ? /* @__PURE__ */ jsx11(
|
|
676
719
|
CloseButton,
|
|
677
720
|
{
|
|
678
721
|
size: "sm",
|
|
@@ -690,7 +733,7 @@ var SearchField = forwardRef5(function SearchField2({
|
|
|
690
733
|
|
|
691
734
|
// src/components/NumberField/NumberField.tsx
|
|
692
735
|
import { forwardRef as forwardRef6, useState as useState3 } from "react";
|
|
693
|
-
import { jsx as
|
|
736
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
694
737
|
var decimals = (step) => (String(step).split(".")[1] ?? "").length;
|
|
695
738
|
var NumberField = forwardRef6(function NumberField2({
|
|
696
739
|
value,
|
|
@@ -765,7 +808,7 @@ var NumberField = forwardRef6(function NumberField2({
|
|
|
765
808
|
className
|
|
766
809
|
),
|
|
767
810
|
children: [
|
|
768
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ jsx12(
|
|
769
812
|
"button",
|
|
770
813
|
{
|
|
771
814
|
type: "button",
|
|
@@ -774,10 +817,10 @@ var NumberField = forwardRef6(function NumberField2({
|
|
|
774
817
|
tabIndex: -1,
|
|
775
818
|
disabled: disabled || atMin,
|
|
776
819
|
onClick: () => stepBy(-1),
|
|
777
|
-
children: /* @__PURE__ */
|
|
820
|
+
children: /* @__PURE__ */ jsx12(MinusIcon, { size: 14 })
|
|
778
821
|
}
|
|
779
822
|
),
|
|
780
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ jsx12(
|
|
781
824
|
"input",
|
|
782
825
|
{
|
|
783
826
|
ref,
|
|
@@ -806,7 +849,7 @@ var NumberField = forwardRef6(function NumberField2({
|
|
|
806
849
|
...inputProps
|
|
807
850
|
}
|
|
808
851
|
),
|
|
809
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ jsx12(
|
|
810
853
|
"button",
|
|
811
854
|
{
|
|
812
855
|
type: "button",
|
|
@@ -815,7 +858,7 @@ var NumberField = forwardRef6(function NumberField2({
|
|
|
815
858
|
tabIndex: -1,
|
|
816
859
|
disabled: disabled || atMax,
|
|
817
860
|
onClick: () => stepBy(1),
|
|
818
|
-
children: /* @__PURE__ */
|
|
861
|
+
children: /* @__PURE__ */ jsx12(PlusIcon, { size: 14 })
|
|
819
862
|
}
|
|
820
863
|
)
|
|
821
864
|
]
|
|
@@ -825,7 +868,7 @@ var NumberField = forwardRef6(function NumberField2({
|
|
|
825
868
|
|
|
826
869
|
// src/components/InputOTP/InputOTP.tsx
|
|
827
870
|
import { useRef as useRef5 } from "react";
|
|
828
|
-
import { jsx as
|
|
871
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
829
872
|
function InputOTP({
|
|
830
873
|
length = 6,
|
|
831
874
|
value,
|
|
@@ -889,8 +932,8 @@ function InputOTP({
|
|
|
889
932
|
}
|
|
890
933
|
return /* @__PURE__ */ jsxs9("div", { role: "group", "aria-label": ariaLabel, className: cx("ow-otp", isInvalid && "ow-otp--invalid", className), children: [
|
|
891
934
|
chars.map((char, index) => /* @__PURE__ */ jsxs9("span", { className: "ow-otp__slot", children: [
|
|
892
|
-
groupSize && index > 0 && index % groupSize === 0 ? /* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
935
|
+
groupSize && index > 0 && index % groupSize === 0 ? /* @__PURE__ */ jsx13("span", { className: "ow-otp__separator", "aria-hidden": "true" }) : null,
|
|
936
|
+
/* @__PURE__ */ jsx13(
|
|
894
937
|
"input",
|
|
895
938
|
{
|
|
896
939
|
ref: (element) => {
|
|
@@ -918,7 +961,7 @@ function InputOTP({
|
|
|
918
961
|
}
|
|
919
962
|
)
|
|
920
963
|
] }, index)),
|
|
921
|
-
name ? /* @__PURE__ */
|
|
964
|
+
name ? /* @__PURE__ */ jsx13("input", { type: "hidden", name, value: code }) : null
|
|
922
965
|
] });
|
|
923
966
|
}
|
|
924
967
|
|
|
@@ -957,7 +1000,7 @@ function resizeTextArea(textArea) {
|
|
|
957
1000
|
}
|
|
958
1001
|
|
|
959
1002
|
// src/components/Textarea/Textarea.tsx
|
|
960
|
-
import { jsx as
|
|
1003
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
961
1004
|
var defaultAutoGrowMaxHeight = 180;
|
|
962
1005
|
function assignRef2(ref, element) {
|
|
963
1006
|
if (typeof ref === "function") ref(element);
|
|
@@ -991,7 +1034,7 @@ var Textarea = forwardRef7(function Textarea2({
|
|
|
991
1034
|
...style,
|
|
992
1035
|
maxHeight: typeof autoGrowMaxHeight === "number" ? `${autoGrowMaxHeight}px` : autoGrowMaxHeight
|
|
993
1036
|
} : style;
|
|
994
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ jsx14(
|
|
995
1038
|
"textarea",
|
|
996
1039
|
{
|
|
997
1040
|
...textareaProps,
|
|
@@ -1042,6 +1085,25 @@ function useFloating({
|
|
|
1042
1085
|
const rect = anchor.getBoundingClientRect();
|
|
1043
1086
|
const width = Math.max(floating.offsetWidth, matchWidth ? rect.width : 0);
|
|
1044
1087
|
const height = floating.scrollHeight;
|
|
1088
|
+
if (placement === "left" || placement === "right") {
|
|
1089
|
+
const roomLeft = rect.left - offset - margin;
|
|
1090
|
+
const roomRight = window.innerWidth - rect.right - offset - margin;
|
|
1091
|
+
const onLeft = placement === "left" ? width <= roomLeft || roomLeft > roomRight : width > roomRight && roomLeft > roomRight;
|
|
1092
|
+
const top2 = Math.min(Math.max(margin, rect.top + rect.height / 2 - height / 2), window.innerHeight - height - margin);
|
|
1093
|
+
floating.dataset.side = onLeft ? "left" : "right";
|
|
1094
|
+
setStyle({
|
|
1095
|
+
position: "fixed",
|
|
1096
|
+
inset: "auto",
|
|
1097
|
+
margin: 0,
|
|
1098
|
+
left: onLeft ? "auto" : rect.right + offset,
|
|
1099
|
+
right: onLeft ? window.innerWidth - rect.left + offset : "auto",
|
|
1100
|
+
top: top2,
|
|
1101
|
+
bottom: "auto",
|
|
1102
|
+
maxHeight: Math.max(120, Math.min(maxHeight, window.innerHeight - 2 * margin)),
|
|
1103
|
+
["--ow-floating-origin"]: `${onLeft ? "right" : "left"} center`
|
|
1104
|
+
});
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1045
1107
|
const below = window.innerHeight - rect.bottom - offset - margin;
|
|
1046
1108
|
const above = rect.top - offset - margin;
|
|
1047
1109
|
const wantsTop = placement.startsWith("top");
|
|
@@ -1137,7 +1199,7 @@ function usePresence(open, exitMs = exitDuration) {
|
|
|
1137
1199
|
}
|
|
1138
1200
|
|
|
1139
1201
|
// src/components/Select/Select.tsx
|
|
1140
|
-
import { Fragment as Fragment2, jsx as
|
|
1202
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1141
1203
|
var menuGap = 4;
|
|
1142
1204
|
var menuMaxHeight = 288;
|
|
1143
1205
|
var typeaheadResetMs = 600;
|
|
@@ -1326,10 +1388,10 @@ function Select({
|
|
|
1326
1388
|
onMouseDown: (event) => event.preventDefault(),
|
|
1327
1389
|
onClick: () => choose(index),
|
|
1328
1390
|
children: [
|
|
1329
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ jsx15("span", { className: "ow-option__check", children: isSelected ? /* @__PURE__ */ jsx15(CheckIcon, { size: 14 }) : null }),
|
|
1330
1392
|
/* @__PURE__ */ jsxs10("span", { className: "ow-option__text", children: [
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
option.description ? /* @__PURE__ */
|
|
1393
|
+
/* @__PURE__ */ jsx15("span", { className: cx("ow-option__label", valueClassName), children: option.label }),
|
|
1394
|
+
option.description ? /* @__PURE__ */ jsx15("span", { className: "ow-option__description", children: option.description }) : null
|
|
1333
1395
|
] })
|
|
1334
1396
|
]
|
|
1335
1397
|
},
|
|
@@ -1361,8 +1423,8 @@ function Select({
|
|
|
1361
1423
|
if (!menuRef.current?.contains(event.relatedTarget)) close();
|
|
1362
1424
|
},
|
|
1363
1425
|
children: [
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
/* @__PURE__ */
|
|
1426
|
+
/* @__PURE__ */ jsx15("span", { className: cx("ow-select__value", !selected && "ow-select__value--placeholder", valueClassName), children: selected ? selected.label : placeholder }),
|
|
1427
|
+
/* @__PURE__ */ jsx15(ChevronDownIcon, { size: size === "sm" ? 14 : 16, className: "ow-select__chevron" })
|
|
1366
1428
|
]
|
|
1367
1429
|
}
|
|
1368
1430
|
),
|
|
@@ -1382,11 +1444,11 @@ function Select({
|
|
|
1382
1444
|
children: [
|
|
1383
1445
|
options.map(
|
|
1384
1446
|
(item, groupIndex) => isGroup(item) ? /* @__PURE__ */ jsxs10("div", { role: "group", "aria-label": item.label, className: "ow-listbox__group", children: [
|
|
1385
|
-
/* @__PURE__ */
|
|
1447
|
+
/* @__PURE__ */ jsx15("div", { className: "ow-listbox__group-label", "aria-hidden": "true", children: item.label }),
|
|
1386
1448
|
item.options.map(renderOption)
|
|
1387
1449
|
] }, `group-${item.label}-${groupIndex}`) : renderOption(item)
|
|
1388
1450
|
),
|
|
1389
|
-
flat.length === 0 ? /* @__PURE__ */
|
|
1451
|
+
flat.length === 0 ? /* @__PURE__ */ jsx15("div", { className: "ow-listbox__empty", children: "No options" }) : null
|
|
1390
1452
|
]
|
|
1391
1453
|
}
|
|
1392
1454
|
) : null
|
|
@@ -1402,7 +1464,7 @@ import {
|
|
|
1402
1464
|
useRef as useRef8,
|
|
1403
1465
|
useState as useState7
|
|
1404
1466
|
} from "react";
|
|
1405
|
-
import { Fragment as Fragment3, jsx as
|
|
1467
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1406
1468
|
function assignRef3(ref, value) {
|
|
1407
1469
|
if (typeof ref === "function") ref(value);
|
|
1408
1470
|
else if (ref) ref.current = value;
|
|
@@ -1529,7 +1591,7 @@ var Combobox = forwardRef8(function Combobox2({
|
|
|
1529
1591
|
className
|
|
1530
1592
|
),
|
|
1531
1593
|
children: [
|
|
1532
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ jsx16(
|
|
1533
1595
|
"input",
|
|
1534
1596
|
{
|
|
1535
1597
|
ref: (element) => {
|
|
@@ -1560,7 +1622,7 @@ var Combobox = forwardRef8(function Combobox2({
|
|
|
1560
1622
|
...aria
|
|
1561
1623
|
}
|
|
1562
1624
|
),
|
|
1563
|
-
/* @__PURE__ */
|
|
1625
|
+
/* @__PURE__ */ jsx16(
|
|
1564
1626
|
"button",
|
|
1565
1627
|
{
|
|
1566
1628
|
type: "button",
|
|
@@ -1576,7 +1638,7 @@ var Combobox = forwardRef8(function Combobox2({
|
|
|
1576
1638
|
inputRef.current?.focus();
|
|
1577
1639
|
}
|
|
1578
1640
|
},
|
|
1579
|
-
children: /* @__PURE__ */
|
|
1641
|
+
children: /* @__PURE__ */ jsx16(ChevronDownIcon, { size: size === "sm" ? 14 : 16, className: cx("ow-select__chevron", isOpen && "ow-combobox__chevron--open") })
|
|
1580
1642
|
}
|
|
1581
1643
|
)
|
|
1582
1644
|
]
|
|
@@ -1613,17 +1675,17 @@ var Combobox = forwardRef8(function Combobox2({
|
|
|
1613
1675
|
onMouseDown: (event) => event.preventDefault(),
|
|
1614
1676
|
onClick: () => choose(option),
|
|
1615
1677
|
children: [
|
|
1616
|
-
/* @__PURE__ */
|
|
1678
|
+
/* @__PURE__ */ jsx16("span", { className: "ow-option__check", children: isSelected ? /* @__PURE__ */ jsx16(CheckIcon, { size: 14 }) : null }),
|
|
1617
1679
|
/* @__PURE__ */ jsxs11("span", { className: "ow-option__text", children: [
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
-
option.description ? /* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ jsx16("span", { className: "ow-option__label", children: option.label }),
|
|
1681
|
+
option.description ? /* @__PURE__ */ jsx16("span", { className: "ow-option__description", children: option.description }) : null
|
|
1620
1682
|
] })
|
|
1621
1683
|
]
|
|
1622
1684
|
},
|
|
1623
1685
|
option.value
|
|
1624
1686
|
);
|
|
1625
1687
|
}),
|
|
1626
|
-
results.length === 0 ? /* @__PURE__ */
|
|
1688
|
+
results.length === 0 ? /* @__PURE__ */ jsx16("div", { className: "ow-listbox__empty", role: "presentation", children: emptyMessage }) : null
|
|
1627
1689
|
]
|
|
1628
1690
|
}
|
|
1629
1691
|
) : null
|
|
@@ -1639,7 +1701,7 @@ import {
|
|
|
1639
1701
|
useId as useId4,
|
|
1640
1702
|
useRef as useRef9
|
|
1641
1703
|
} from "react";
|
|
1642
|
-
import { jsx as
|
|
1704
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1643
1705
|
var CheckboxGroupContext = createContext(null);
|
|
1644
1706
|
function assignRef4(ref, value) {
|
|
1645
1707
|
if (typeof ref === "function") ref(value);
|
|
@@ -1677,7 +1739,7 @@ var Checkbox = forwardRef9(function Checkbox2({
|
|
|
1677
1739
|
children === void 0 && className
|
|
1678
1740
|
),
|
|
1679
1741
|
children: [
|
|
1680
|
-
/* @__PURE__ */
|
|
1742
|
+
/* @__PURE__ */ jsx17(
|
|
1681
1743
|
"input",
|
|
1682
1744
|
{
|
|
1683
1745
|
ref: (element) => {
|
|
@@ -1698,7 +1760,7 @@ var Checkbox = forwardRef9(function Checkbox2({
|
|
|
1698
1760
|
...inputProps
|
|
1699
1761
|
}
|
|
1700
1762
|
),
|
|
1701
|
-
indeterminate ? /* @__PURE__ */
|
|
1763
|
+
indeterminate ? /* @__PURE__ */ jsx17(MinusIcon, { className: "ow-checkbox__check ow-checkbox__check--dash", size: size === "sm" ? 10 : 12, strokeWidth: 3 }) : /* @__PURE__ */ jsx17(CheckIcon, { className: "ow-checkbox__check", size: size === "sm" ? 10 : 12, strokeWidth: 3 })
|
|
1702
1764
|
]
|
|
1703
1765
|
}
|
|
1704
1766
|
);
|
|
@@ -1706,8 +1768,8 @@ var Checkbox = forwardRef9(function Checkbox2({
|
|
|
1706
1768
|
return /* @__PURE__ */ jsxs12("label", { className: cx("ow-check-label", (disabled || inGroup && group.disabled) && "ow-check-label--disabled", className), children: [
|
|
1707
1769
|
box,
|
|
1708
1770
|
/* @__PURE__ */ jsxs12("span", { className: "ow-check-label__text", children: [
|
|
1709
|
-
/* @__PURE__ */
|
|
1710
|
-
description ? /* @__PURE__ */
|
|
1771
|
+
/* @__PURE__ */ jsx17("span", { children }),
|
|
1772
|
+
description ? /* @__PURE__ */ jsx17("span", { id: descriptionId, className: "ow-check-label__description", children: description }) : null
|
|
1711
1773
|
] })
|
|
1712
1774
|
] });
|
|
1713
1775
|
});
|
|
@@ -1727,7 +1789,7 @@ function CheckboxGroup({
|
|
|
1727
1789
|
const [current, setCurrent] = useControllableState(value, defaultValue, onChange);
|
|
1728
1790
|
const generatedName = useId4();
|
|
1729
1791
|
const errorId = useId4();
|
|
1730
|
-
return /* @__PURE__ */
|
|
1792
|
+
return /* @__PURE__ */ jsx17(
|
|
1731
1793
|
CheckboxGroupContext.Provider,
|
|
1732
1794
|
{
|
|
1733
1795
|
value: {
|
|
@@ -1738,7 +1800,7 @@ function CheckboxGroup({
|
|
|
1738
1800
|
setCurrent(checked ? [...current.filter((v) => v !== item), item] : current.filter((v) => v !== item));
|
|
1739
1801
|
}
|
|
1740
1802
|
},
|
|
1741
|
-
children: /* @__PURE__ */
|
|
1803
|
+
children: /* @__PURE__ */ jsx17(
|
|
1742
1804
|
Fieldset,
|
|
1743
1805
|
{
|
|
1744
1806
|
legend: label,
|
|
@@ -1763,10 +1825,10 @@ function Fieldset({ legend, description, error, errorId, disabled, children, cla
|
|
|
1763
1825
|
disabled,
|
|
1764
1826
|
"aria-describedby": [description ? descriptionId : "", error ? resolvedErrorId : ""].filter(Boolean).join(" ") || void 0,
|
|
1765
1827
|
children: [
|
|
1766
|
-
/* @__PURE__ */
|
|
1767
|
-
description ? /* @__PURE__ */
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
error ? /* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ jsx17("legend", { className: "ow-fieldset__legend", children: legend }),
|
|
1829
|
+
description ? /* @__PURE__ */ jsx17("p", { id: descriptionId, className: "ow-fieldset__description", children: description }) : null,
|
|
1830
|
+
/* @__PURE__ */ jsx17("div", { className: "ow-fieldset__content", children }),
|
|
1831
|
+
error ? /* @__PURE__ */ jsx17("p", { id: resolvedErrorId, role: "alert", className: "ow-field__error", children: error }) : null
|
|
1770
1832
|
]
|
|
1771
1833
|
}
|
|
1772
1834
|
);
|
|
@@ -1774,7 +1836,7 @@ function Fieldset({ legend, description, error, errorId, disabled, children, cla
|
|
|
1774
1836
|
|
|
1775
1837
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
1776
1838
|
import { createContext as createContext2, useContext as useContext2, useId as useId5 } from "react";
|
|
1777
|
-
import { jsx as
|
|
1839
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1778
1840
|
var RadioGroupContext = createContext2(null);
|
|
1779
1841
|
function RadioGroup({
|
|
1780
1842
|
label,
|
|
@@ -1792,7 +1854,7 @@ function RadioGroup({
|
|
|
1792
1854
|
}) {
|
|
1793
1855
|
const [current, select] = useControllableState(value, defaultValue, onChange);
|
|
1794
1856
|
const generatedName = useId5();
|
|
1795
|
-
return /* @__PURE__ */
|
|
1857
|
+
return /* @__PURE__ */ jsx18(RadioGroupContext.Provider, { value: { name: name ?? generatedName, value: current, select, disabled }, children: /* @__PURE__ */ jsx18(
|
|
1796
1858
|
Fieldset,
|
|
1797
1859
|
{
|
|
1798
1860
|
legend: label,
|
|
@@ -1814,7 +1876,7 @@ function Radio({ value, children, description, disabled, className, ...inputProp
|
|
|
1814
1876
|
if (!group) throw new Error("Radio must be inside <RadioGroup>.");
|
|
1815
1877
|
const isDisabled = disabled || group.disabled;
|
|
1816
1878
|
return /* @__PURE__ */ jsxs13("label", { className: cx("ow-check-label", "ow-radio-label", isDisabled && "ow-check-label--disabled", className), children: [
|
|
1817
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx18("span", { className: "ow-radio", children: /* @__PURE__ */ jsx18(
|
|
1818
1880
|
"input",
|
|
1819
1881
|
{
|
|
1820
1882
|
type: "radio",
|
|
@@ -1829,17 +1891,17 @@ function Radio({ value, children, description, disabled, className, ...inputProp
|
|
|
1829
1891
|
}
|
|
1830
1892
|
) }),
|
|
1831
1893
|
/* @__PURE__ */ jsxs13("span", { className: "ow-check-label__text", children: [
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
description ? /* @__PURE__ */
|
|
1894
|
+
/* @__PURE__ */ jsx18("span", { children }),
|
|
1895
|
+
description ? /* @__PURE__ */ jsx18("span", { id: descriptionId, className: "ow-check-label__description", children: description }) : null
|
|
1834
1896
|
] })
|
|
1835
1897
|
] });
|
|
1836
1898
|
}
|
|
1837
1899
|
|
|
1838
1900
|
// src/components/Switch/Switch.tsx
|
|
1839
1901
|
import { forwardRef as forwardRef10 } from "react";
|
|
1840
|
-
import { jsx as
|
|
1902
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1841
1903
|
var Switch = forwardRef10(function Switch2({ checked, onChange, label, className, disabled, ...buttonProps }, ref) {
|
|
1842
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ jsx19(
|
|
1843
1905
|
"button",
|
|
1844
1906
|
{
|
|
1845
1907
|
ref,
|
|
@@ -1851,14 +1913,14 @@ var Switch = forwardRef10(function Switch2({ checked, onChange, label, className
|
|
|
1851
1913
|
className: cx("ow-switch", checked && "ow-switch--on", className),
|
|
1852
1914
|
onClick: () => onChange(!checked),
|
|
1853
1915
|
...buttonProps,
|
|
1854
|
-
children: /* @__PURE__ */
|
|
1916
|
+
children: /* @__PURE__ */ jsx19("span", { className: "ow-switch__knob" })
|
|
1855
1917
|
}
|
|
1856
1918
|
);
|
|
1857
1919
|
});
|
|
1858
1920
|
|
|
1859
1921
|
// src/components/Slider/Slider.tsx
|
|
1860
1922
|
import { useId as useId6 } from "react";
|
|
1861
|
-
import { jsx as
|
|
1923
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1862
1924
|
function Slider({
|
|
1863
1925
|
value,
|
|
1864
1926
|
defaultValue,
|
|
@@ -1884,7 +1946,7 @@ function Slider({
|
|
|
1884
1946
|
const end = () => onChangeEnd?.(current);
|
|
1885
1947
|
const input = (which) => {
|
|
1886
1948
|
const own = which === "low" ? low : high;
|
|
1887
|
-
return /* @__PURE__ */
|
|
1949
|
+
return /* @__PURE__ */ jsx20(
|
|
1888
1950
|
"input",
|
|
1889
1951
|
{
|
|
1890
1952
|
type: "range",
|
|
@@ -1911,11 +1973,11 @@ function Slider({
|
|
|
1911
1973
|
};
|
|
1912
1974
|
return /* @__PURE__ */ jsxs14("div", { className: cx("ow-slider", disabled && "ow-slider--disabled", className), children: [
|
|
1913
1975
|
label || showValue ? /* @__PURE__ */ jsxs14("div", { className: "ow-slider__header", children: [
|
|
1914
|
-
label ? /* @__PURE__ */
|
|
1915
|
-
showValue ? /* @__PURE__ */
|
|
1976
|
+
label ? /* @__PURE__ */ jsx20("span", { id: labelId, className: "ow-slider__label", children: label }) : /* @__PURE__ */ jsx20("span", {}),
|
|
1977
|
+
showValue ? /* @__PURE__ */ jsx20("output", { className: "ow-slider__value", "aria-hidden": "true", children: display }) : null
|
|
1916
1978
|
] }) : null,
|
|
1917
1979
|
/* @__PURE__ */ jsxs14("div", { className: "ow-slider__control", style, children: [
|
|
1918
|
-
/* @__PURE__ */
|
|
1980
|
+
/* @__PURE__ */ jsx20("span", { className: "ow-slider__track", "aria-hidden": "true", children: /* @__PURE__ */ jsx20("span", { className: "ow-slider__fill" }) }),
|
|
1919
1981
|
isRange ? input("low") : null,
|
|
1920
1982
|
input("high")
|
|
1921
1983
|
] })
|
|
@@ -1924,7 +1986,7 @@ function Slider({
|
|
|
1924
1986
|
|
|
1925
1987
|
// src/components/FileDropZone/FileDropZone.tsx
|
|
1926
1988
|
import { useId as useId7, useRef as useRef10, useState as useState8 } from "react";
|
|
1927
|
-
import { jsx as
|
|
1989
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1928
1990
|
function matches(file, accept) {
|
|
1929
1991
|
if (!accept) return true;
|
|
1930
1992
|
return accept.split(",").some((rule) => {
|
|
@@ -2001,7 +2063,7 @@ function FileDropZone({
|
|
|
2001
2063
|
take(event.dataTransfer.files);
|
|
2002
2064
|
},
|
|
2003
2065
|
children: [
|
|
2004
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ jsx21(
|
|
2005
2067
|
"input",
|
|
2006
2068
|
{
|
|
2007
2069
|
ref: inputRef,
|
|
@@ -2018,9 +2080,9 @@ function FileDropZone({
|
|
|
2018
2080
|
}
|
|
2019
2081
|
}
|
|
2020
2082
|
),
|
|
2021
|
-
/* @__PURE__ */
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2083
|
+
/* @__PURE__ */ jsx21("span", { className: "ow-dropzone__icon", children: icon2 ?? /* @__PURE__ */ jsx21(UploadIcon, { size: 20 }) }),
|
|
2084
|
+
/* @__PURE__ */ jsx21("span", { className: "ow-dropzone__label", children: isDragging ? "Drop to add" : label }),
|
|
2085
|
+
/* @__PURE__ */ jsx21("span", { id: hintId, className: "ow-dropzone__hint", "aria-live": "polite", children: error ?? problem ?? hint })
|
|
2024
2086
|
]
|
|
2025
2087
|
}
|
|
2026
2088
|
);
|
|
@@ -2065,7 +2127,7 @@ function formatDate(iso, locale, options) {
|
|
|
2065
2127
|
}
|
|
2066
2128
|
|
|
2067
2129
|
// src/components/Calendar/Calendar.tsx
|
|
2068
|
-
import { jsx as
|
|
2130
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2069
2131
|
var Calendar = forwardRef11(function Calendar2({ value, defaultValue = "", onChange, min, max, isDateDisabled, locale, weekStartsOn = 1, autoFocus = false, className }, ref) {
|
|
2070
2132
|
const [selected, setSelected] = useControllableState(value, defaultValue, onChange);
|
|
2071
2133
|
const today = todayISO();
|
|
@@ -2130,7 +2192,7 @@ var Calendar = forwardRef11(function Calendar2({ value, defaultValue = "", onCha
|
|
|
2130
2192
|
const canGoForward = !max || nextMonth <= max;
|
|
2131
2193
|
return /* @__PURE__ */ jsxs16("div", { className: cx("ow-calendar", className), children: [
|
|
2132
2194
|
/* @__PURE__ */ jsxs16("div", { className: "ow-calendar__header", children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2195
|
+
/* @__PURE__ */ jsx22(
|
|
2134
2196
|
"button",
|
|
2135
2197
|
{
|
|
2136
2198
|
type: "button",
|
|
@@ -2138,10 +2200,10 @@ var Calendar = forwardRef11(function Calendar2({ value, defaultValue = "", onCha
|
|
|
2138
2200
|
"aria-label": `Previous month, ${formatDate(prevMonth, locale, { month: "long", year: "numeric" })}`,
|
|
2139
2201
|
disabled: !canGoBack,
|
|
2140
2202
|
onClick: () => setFocused(clampDate(addMonths(focused, -1), min, max)),
|
|
2141
|
-
children: /* @__PURE__ */
|
|
2203
|
+
children: /* @__PURE__ */ jsx22(ChevronLeftIcon, { size: 16 })
|
|
2142
2204
|
}
|
|
2143
2205
|
),
|
|
2144
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ jsx22("h2", { className: "ow-calendar__title", "aria-live": "polite", children: /* @__PURE__ */ jsx22(
|
|
2145
2207
|
"span",
|
|
2146
2208
|
{
|
|
2147
2209
|
className: cx("ow-calendar__title-text", slide.current.direction && `ow-calendar__slide--${slide.current.direction}`),
|
|
@@ -2149,7 +2211,7 @@ var Calendar = forwardRef11(function Calendar2({ value, defaultValue = "", onCha
|
|
|
2149
2211
|
},
|
|
2150
2212
|
monthIndex
|
|
2151
2213
|
) }),
|
|
2152
|
-
/* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ jsx22(
|
|
2153
2215
|
"button",
|
|
2154
2216
|
{
|
|
2155
2217
|
type: "button",
|
|
@@ -2157,17 +2219,17 @@ var Calendar = forwardRef11(function Calendar2({ value, defaultValue = "", onCha
|
|
|
2157
2219
|
"aria-label": `Next month, ${formatDate(nextMonth, locale, { month: "long", year: "numeric" })}`,
|
|
2158
2220
|
disabled: !canGoForward,
|
|
2159
2221
|
onClick: () => setFocused(clampDate(addMonths(focused, 1), min, max)),
|
|
2160
|
-
children: /* @__PURE__ */
|
|
2222
|
+
children: /* @__PURE__ */ jsx22(ChevronRightIcon, { size: 16 })
|
|
2161
2223
|
}
|
|
2162
2224
|
)
|
|
2163
2225
|
] }),
|
|
2164
2226
|
/* @__PURE__ */ jsxs16("table", { ref: gridRef, role: "grid", className: "ow-calendar__grid", "aria-label": monthLabel, children: [
|
|
2165
|
-
/* @__PURE__ */
|
|
2166
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ jsx22("thead", { children: /* @__PURE__ */ jsx22("tr", { children: weekdayNames.map((name) => /* @__PURE__ */ jsx22("th", { scope: "col", abbr: name.long, className: "ow-calendar__weekday", children: name.short.slice(0, 2) }, name.long)) }) }),
|
|
2228
|
+
/* @__PURE__ */ jsx22("tbody", { className: cx(slide.current.direction && `ow-calendar__slide--${slide.current.direction}`), children: weeks.map((week) => /* @__PURE__ */ jsx22("tr", { children: week.map((date) => {
|
|
2167
2229
|
const inMonth = parseISO(date).month === month;
|
|
2168
2230
|
const isSelected = date === selected;
|
|
2169
2231
|
const disabled = isDisabled(date);
|
|
2170
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ jsx22("td", { role: "gridcell", "aria-selected": isSelected, className: "ow-calendar__cell", children: /* @__PURE__ */ jsx22(
|
|
2171
2233
|
"button",
|
|
2172
2234
|
{
|
|
2173
2235
|
type: "button",
|
|
@@ -2199,7 +2261,7 @@ function clampDate(date, min, max) {
|
|
|
2199
2261
|
|
|
2200
2262
|
// src/components/Calendar/DatePicker.tsx
|
|
2201
2263
|
import { forwardRef as forwardRef12, useCallback as useCallback4, useId as useId8, useRef as useRef12, useState as useState10 } from "react";
|
|
2202
|
-
import { Fragment as Fragment4, jsx as
|
|
2264
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2203
2265
|
function assignRef5(ref, value) {
|
|
2204
2266
|
if (typeof ref === "function") ref(value);
|
|
2205
2267
|
else if (ref) ref.current = value;
|
|
@@ -2267,12 +2329,12 @@ var DatePicker = forwardRef12(function DatePicker2({
|
|
|
2267
2329
|
}
|
|
2268
2330
|
},
|
|
2269
2331
|
children: [
|
|
2270
|
-
/* @__PURE__ */
|
|
2271
|
-
/* @__PURE__ */
|
|
2332
|
+
/* @__PURE__ */ jsx23(CalendarIcon, { size: size === "sm" ? 14 : 16, className: "ow-date-picker__icon" }),
|
|
2333
|
+
/* @__PURE__ */ jsx23("span", { id: `${panelId}-value`, className: cx("ow-select__value", !date && "ow-select__value--placeholder"), children: label })
|
|
2272
2334
|
]
|
|
2273
2335
|
}
|
|
2274
2336
|
),
|
|
2275
|
-
mounted ? /* @__PURE__ */
|
|
2337
|
+
mounted ? /* @__PURE__ */ jsx23(
|
|
2276
2338
|
"div",
|
|
2277
2339
|
{
|
|
2278
2340
|
ref: panelRef,
|
|
@@ -2283,7 +2345,7 @@ var DatePicker = forwardRef12(function DatePicker2({
|
|
|
2283
2345
|
"aria-label": "Choose a date",
|
|
2284
2346
|
className: "ow-popover ow-floating ow-date-picker__panel",
|
|
2285
2347
|
style,
|
|
2286
|
-
children: /* @__PURE__ */
|
|
2348
|
+
children: /* @__PURE__ */ jsx23(
|
|
2287
2349
|
Calendar,
|
|
2288
2350
|
{
|
|
2289
2351
|
...calendarProps,
|
|
@@ -2302,13 +2364,13 @@ var DatePicker = forwardRef12(function DatePicker2({
|
|
|
2302
2364
|
});
|
|
2303
2365
|
|
|
2304
2366
|
// src/components/Alert/Alert.tsx
|
|
2305
|
-
import { jsx as
|
|
2367
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2306
2368
|
var icons = {
|
|
2307
|
-
info: /* @__PURE__ */
|
|
2308
|
-
success: /* @__PURE__ */
|
|
2309
|
-
warning: /* @__PURE__ */
|
|
2310
|
-
danger: /* @__PURE__ */
|
|
2311
|
-
neutral: /* @__PURE__ */
|
|
2369
|
+
info: /* @__PURE__ */ jsx24(InfoIcon, { size: 16 }),
|
|
2370
|
+
success: /* @__PURE__ */ jsx24(CircleCheckIcon, { size: 16 }),
|
|
2371
|
+
warning: /* @__PURE__ */ jsx24(TriangleAlertIcon, { size: 16 }),
|
|
2372
|
+
danger: /* @__PURE__ */ jsx24(CircleAlertIcon, { size: 16 }),
|
|
2373
|
+
neutral: /* @__PURE__ */ jsx24(InfoIcon, { size: 16 })
|
|
2312
2374
|
};
|
|
2313
2375
|
function Alert({
|
|
2314
2376
|
variant = "info",
|
|
@@ -2328,30 +2390,30 @@ function Alert({
|
|
|
2328
2390
|
className: cx("ow-alert", `ow-alert--${variant}`, className),
|
|
2329
2391
|
...props,
|
|
2330
2392
|
children: [
|
|
2331
|
-
icon2 === false ? null : /* @__PURE__ */
|
|
2393
|
+
icon2 === false ? null : /* @__PURE__ */ jsx24("span", { className: "ow-alert__icon", children: icon2 ?? icons[variant] }),
|
|
2332
2394
|
/* @__PURE__ */ jsxs18("div", { className: "ow-alert__body", children: [
|
|
2333
|
-
title ? /* @__PURE__ */
|
|
2334
|
-
children ? /* @__PURE__ */
|
|
2335
|
-
actions ? /* @__PURE__ */
|
|
2395
|
+
title ? /* @__PURE__ */ jsx24("div", { className: "ow-alert__title", children: title }) : null,
|
|
2396
|
+
children ? /* @__PURE__ */ jsx24("div", { className: "ow-alert__description", children }) : null,
|
|
2397
|
+
actions ? /* @__PURE__ */ jsx24("div", { className: "ow-alert__actions", children: actions }) : null
|
|
2336
2398
|
] }),
|
|
2337
|
-
onClose ? /* @__PURE__ */
|
|
2399
|
+
onClose ? /* @__PURE__ */ jsx24(CloseButton, { size: "sm", label: "Dismiss", className: "ow-alert__close", onClick: onClose }) : null
|
|
2338
2400
|
]
|
|
2339
2401
|
}
|
|
2340
2402
|
);
|
|
2341
2403
|
}
|
|
2342
2404
|
|
|
2343
2405
|
// src/components/Badge/Badge.tsx
|
|
2344
|
-
import { jsx as
|
|
2406
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2345
2407
|
function Badge({ children, className, icon: icon2, size = "md", variant = "neutral", ...spanProps }) {
|
|
2346
2408
|
return /* @__PURE__ */ jsxs19("span", { className: cx("ow-badge", `ow-badge--${size}`, `ow-badge--${variant}`, className), ...spanProps, children: [
|
|
2347
|
-
icon2 ? /* @__PURE__ */
|
|
2348
|
-
/* @__PURE__ */
|
|
2409
|
+
icon2 ? /* @__PURE__ */ jsx25("span", { className: "ow-badge__icon", children: icon2 }) : null,
|
|
2410
|
+
/* @__PURE__ */ jsx25("span", { children })
|
|
2349
2411
|
] });
|
|
2350
2412
|
}
|
|
2351
2413
|
|
|
2352
2414
|
// src/components/Progress/Progress.tsx
|
|
2353
2415
|
import { useId as useId9 } from "react";
|
|
2354
|
-
import { jsx as
|
|
2416
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2355
2417
|
function ProgressBar({
|
|
2356
2418
|
value,
|
|
2357
2419
|
max = 100,
|
|
@@ -2369,10 +2431,10 @@ function ProgressBar({
|
|
|
2369
2431
|
const text = valueLabel ?? `${Math.round(pct)}%`;
|
|
2370
2432
|
return /* @__PURE__ */ jsxs20("div", { className: cx("ow-progress", `ow-progress--${size}`, `ow-progress--${tone}`, className), children: [
|
|
2371
2433
|
label || showValue && !indeterminate ? /* @__PURE__ */ jsxs20("div", { className: "ow-progress__header", children: [
|
|
2372
|
-
label ? /* @__PURE__ */
|
|
2373
|
-
showValue && !indeterminate ? /* @__PURE__ */
|
|
2434
|
+
label ? /* @__PURE__ */ jsx26("span", { id: labelId, className: "ow-progress__label", children: label }) : /* @__PURE__ */ jsx26("span", {}),
|
|
2435
|
+
showValue && !indeterminate ? /* @__PURE__ */ jsx26("span", { className: "ow-progress__value", children: text }) : null
|
|
2374
2436
|
] }) : null,
|
|
2375
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ jsx26(
|
|
2376
2438
|
"div",
|
|
2377
2439
|
{
|
|
2378
2440
|
role: "progressbar",
|
|
@@ -2383,7 +2445,7 @@ function ProgressBar({
|
|
|
2383
2445
|
"aria-valuenow": indeterminate ? void 0 : value,
|
|
2384
2446
|
"aria-valuetext": indeterminate ? void 0 : text,
|
|
2385
2447
|
className: cx("ow-progress__track", indeterminate && "ow-progress__track--indeterminate"),
|
|
2386
|
-
children: /* @__PURE__ */
|
|
2448
|
+
children: /* @__PURE__ */ jsx26("div", { className: "ow-progress__fill", style: indeterminate ? void 0 : { width: `${pct}%` } })
|
|
2387
2449
|
}
|
|
2388
2450
|
)
|
|
2389
2451
|
] });
|
|
@@ -2419,8 +2481,8 @@ function ProgressCircle({
|
|
|
2419
2481
|
style: { width: box, height: box },
|
|
2420
2482
|
children: [
|
|
2421
2483
|
/* @__PURE__ */ jsxs20("svg", { width: box, height: box, viewBox: `0 0 ${box} ${box}`, "aria-hidden": "true", children: [
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2484
|
+
/* @__PURE__ */ jsx26("circle", { className: "ow-progress-circle__track", cx: box / 2, cy: box / 2, r: radius, strokeWidth: stroke, fill: "none" }),
|
|
2485
|
+
/* @__PURE__ */ jsx26(
|
|
2424
2486
|
"circle",
|
|
2425
2487
|
{
|
|
2426
2488
|
className: "ow-progress-circle__fill",
|
|
@@ -2447,9 +2509,9 @@ function ProgressCircle({
|
|
|
2447
2509
|
|
|
2448
2510
|
// src/components/Skeleton/Skeleton.tsx
|
|
2449
2511
|
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
2450
|
-
import { jsx as
|
|
2512
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2451
2513
|
function Skeleton({ width = "100%", height = 14, soft = false, shape = "bar", className }) {
|
|
2452
|
-
return /* @__PURE__ */
|
|
2514
|
+
return /* @__PURE__ */ jsx27(
|
|
2453
2515
|
"span",
|
|
2454
2516
|
{
|
|
2455
2517
|
className: cx("ow-skeleton", soft && "ow-skeleton--soft", shape === "block" && "ow-skeleton--block", className),
|
|
@@ -2465,26 +2527,26 @@ function SkeletonRows({ label = "Loading", rows = 4, delayMs = 150 }) {
|
|
|
2465
2527
|
const timer = window.setTimeout(() => setIsVisible(true), delayMs);
|
|
2466
2528
|
return () => window.clearTimeout(timer);
|
|
2467
2529
|
}, [delayMs]);
|
|
2468
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx27("div", { role: "status", "aria-label": label, "aria-busy": "true", children: isVisible ? /* @__PURE__ */ jsx27("div", { className: "ow-skeleton-rows", "aria-hidden": "true", children: Array.from({ length: rows }, (_, index) => /* @__PURE__ */ jsxs21("div", { className: "ow-skeleton-rows__row", children: [
|
|
2469
2531
|
/* @__PURE__ */ jsxs21("div", { className: "ow-skeleton-rows__text", children: [
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
/* @__PURE__ */
|
|
2532
|
+
/* @__PURE__ */ jsx27(Skeleton, { width: `${28 + index * 17 % 22}%`, height: 14 }),
|
|
2533
|
+
/* @__PURE__ */ jsx27(Skeleton, { width: `${46 + index * 23 % 30}%`, height: 12, soft: true })
|
|
2472
2534
|
] }),
|
|
2473
|
-
/* @__PURE__ */
|
|
2535
|
+
/* @__PURE__ */ jsx27(Skeleton, { width: 96, height: 32, soft: true, shape: "block" })
|
|
2474
2536
|
] }, index)) }) : null });
|
|
2475
2537
|
}
|
|
2476
2538
|
|
|
2477
2539
|
// src/components/Toast/Toast.tsx
|
|
2478
2540
|
import { useEffect as useEffect9, useRef as useRef13 } from "react";
|
|
2479
2541
|
import { Toaster as SonnerToaster, toast } from "sonner";
|
|
2480
|
-
import { jsx as
|
|
2542
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2481
2543
|
var icons2 = {
|
|
2482
|
-
success: /* @__PURE__ */
|
|
2483
|
-
error: /* @__PURE__ */
|
|
2484
|
-
warning: /* @__PURE__ */
|
|
2485
|
-
info: /* @__PURE__ */
|
|
2486
|
-
loading: /* @__PURE__ */
|
|
2487
|
-
close: /* @__PURE__ */
|
|
2544
|
+
success: /* @__PURE__ */ jsx28(CircleCheckIcon, { size: 16 }),
|
|
2545
|
+
error: /* @__PURE__ */ jsx28(CircleAlertIcon, { size: 16 }),
|
|
2546
|
+
warning: /* @__PURE__ */ jsx28(TriangleAlertIcon, { size: 16 }),
|
|
2547
|
+
info: /* @__PURE__ */ jsx28(InfoIcon, { size: 16 }),
|
|
2548
|
+
loading: /* @__PURE__ */ jsx28(Spinner, { size: "sm", label: "" }),
|
|
2549
|
+
close: /* @__PURE__ */ jsx28(XIcon, { size: 12 })
|
|
2488
2550
|
};
|
|
2489
2551
|
function Toaster({
|
|
2490
2552
|
position = "bottom-center",
|
|
@@ -2515,7 +2577,7 @@ function Toaster({
|
|
|
2515
2577
|
observer.observe(document.body, { subtree: true, attributes: true, attributeFilter: ["open"] });
|
|
2516
2578
|
return () => observer.disconnect();
|
|
2517
2579
|
}, []);
|
|
2518
|
-
return /* @__PURE__ */
|
|
2580
|
+
return /* @__PURE__ */ jsx28("div", { ref: layerRef, ...manualPopover, className: "ow-toaster-layer", children: /* @__PURE__ */ jsx28(
|
|
2519
2581
|
SonnerToaster,
|
|
2520
2582
|
{
|
|
2521
2583
|
id,
|
|
@@ -2537,7 +2599,7 @@ function Toaster({
|
|
|
2537
2599
|
|
|
2538
2600
|
// src/components/Tooltip/Tooltip.tsx
|
|
2539
2601
|
import { useEffect as useEffect10, useRef as useRef14, useState as useState12 } from "react";
|
|
2540
|
-
import { jsx as
|
|
2602
|
+
import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2541
2603
|
var lastClosedAt = 0;
|
|
2542
2604
|
var warmWindow = 500;
|
|
2543
2605
|
function Tooltip({ children, label, placement = "top", delay = 400 }) {
|
|
@@ -2584,7 +2646,7 @@ function Tooltip({ children, label, placement = "top", delay = 400 }) {
|
|
|
2584
2646
|
onBlur: hide,
|
|
2585
2647
|
children: [
|
|
2586
2648
|
children,
|
|
2587
|
-
mounted ? /* @__PURE__ */
|
|
2649
|
+
mounted ? /* @__PURE__ */ jsx29("span", { ref: bubbleRef, ...manualPopover, "data-state": state, className: "ow-tooltip__bubble ow-floating", style, "aria-hidden": "true", children: label }) : null
|
|
2588
2650
|
]
|
|
2589
2651
|
}
|
|
2590
2652
|
);
|
|
@@ -2650,7 +2712,7 @@ function useModalDialog(open, onCancel) {
|
|
|
2650
2712
|
}
|
|
2651
2713
|
|
|
2652
2714
|
// src/components/Dialog/Dialog.tsx
|
|
2653
|
-
import { Fragment as Fragment5, jsx as
|
|
2715
|
+
import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2654
2716
|
function Dialog({
|
|
2655
2717
|
open,
|
|
2656
2718
|
onClose,
|
|
@@ -2671,13 +2733,13 @@ function Dialog({
|
|
|
2671
2733
|
if (!mounted) return null;
|
|
2672
2734
|
const body = /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
2673
2735
|
/* @__PURE__ */ jsxs23("div", { className: "ow-dialog__header", children: [
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
description ? /* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsx30("h2", { id: titleId, className: "ow-dialog__title", children: title }),
|
|
2737
|
+
description ? /* @__PURE__ */ jsx30("div", { id: descriptionId, className: "ow-dialog__description", children: description }) : null
|
|
2676
2738
|
] }),
|
|
2677
2739
|
children,
|
|
2678
|
-
actions ? /* @__PURE__ */
|
|
2740
|
+
actions ? /* @__PURE__ */ jsx30("div", { className: "ow-dialog__actions", children: actions }) : null
|
|
2679
2741
|
] });
|
|
2680
|
-
return /* @__PURE__ */
|
|
2742
|
+
return /* @__PURE__ */ jsx30(
|
|
2681
2743
|
"dialog",
|
|
2682
2744
|
{
|
|
2683
2745
|
ref: dialogRef,
|
|
@@ -2685,7 +2747,7 @@ function Dialog({
|
|
|
2685
2747
|
style: { width: `min(${width}px, calc(100% - 32px))` },
|
|
2686
2748
|
"aria-labelledby": titleId,
|
|
2687
2749
|
"aria-describedby": description ? descriptionId : void 0,
|
|
2688
|
-
children: onSubmit ? /* @__PURE__ */
|
|
2750
|
+
children: onSubmit ? /* @__PURE__ */ jsx30(
|
|
2689
2751
|
"form",
|
|
2690
2752
|
{
|
|
2691
2753
|
className: "ow-dialog__body",
|
|
@@ -2695,7 +2757,7 @@ function Dialog({
|
|
|
2695
2757
|
},
|
|
2696
2758
|
children: body
|
|
2697
2759
|
}
|
|
2698
|
-
) : /* @__PURE__ */
|
|
2760
|
+
) : /* @__PURE__ */ jsx30("div", { className: "ow-dialog__body", children: body })
|
|
2699
2761
|
}
|
|
2700
2762
|
);
|
|
2701
2763
|
}
|
|
@@ -2735,7 +2797,7 @@ function ConfirmDialog({
|
|
|
2735
2797
|
width: 380,
|
|
2736
2798
|
className: "ow-dialog--confirm",
|
|
2737
2799
|
title: /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
2738
|
-
destructive ? /* @__PURE__ */
|
|
2800
|
+
destructive ? /* @__PURE__ */ jsx30("span", { className: "ow-dialog__danger-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx30(TrashIcon, { size: 18 }) }) : null,
|
|
2739
2801
|
title
|
|
2740
2802
|
] }),
|
|
2741
2803
|
description,
|
|
@@ -2743,8 +2805,8 @@ function ConfirmDialog({
|
|
|
2743
2805
|
if (!confirmDisabled && !isWorking) void confirm();
|
|
2744
2806
|
},
|
|
2745
2807
|
actions: /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ jsx30(Button, { type: "button", disabled: isWorking, autoFocus: true, onClick: onClose, children: "Cancel" }),
|
|
2809
|
+
/* @__PURE__ */ jsx30(
|
|
2748
2810
|
Button,
|
|
2749
2811
|
{
|
|
2750
2812
|
type: "submit",
|
|
@@ -2756,7 +2818,7 @@ function ConfirmDialog({
|
|
|
2756
2818
|
] }),
|
|
2757
2819
|
children: [
|
|
2758
2820
|
children,
|
|
2759
|
-
error ? /* @__PURE__ */
|
|
2821
|
+
error ? /* @__PURE__ */ jsx30("span", { role: "alert", className: "ow-dialog__error", children: error }) : null
|
|
2760
2822
|
]
|
|
2761
2823
|
}
|
|
2762
2824
|
);
|
|
@@ -2764,7 +2826,7 @@ function ConfirmDialog({
|
|
|
2764
2826
|
|
|
2765
2827
|
// src/components/Drawer/Drawer.tsx
|
|
2766
2828
|
import { useId as useId11 } from "react";
|
|
2767
|
-
import { jsx as
|
|
2829
|
+
import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2768
2830
|
function Drawer({
|
|
2769
2831
|
open,
|
|
2770
2832
|
onClose,
|
|
@@ -2795,13 +2857,13 @@ function Drawer({
|
|
|
2795
2857
|
children: [
|
|
2796
2858
|
/* @__PURE__ */ jsxs24("header", { className: "ow-drawer__header", children: [
|
|
2797
2859
|
/* @__PURE__ */ jsxs24("div", { className: "ow-drawer__titles", children: [
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
description ? /* @__PURE__ */
|
|
2860
|
+
/* @__PURE__ */ jsx31("h2", { id: titleId, className: "ow-drawer__title", children: title }),
|
|
2861
|
+
description ? /* @__PURE__ */ jsx31("p", { id: descriptionId, className: "ow-drawer__description", children: description }) : null
|
|
2800
2862
|
] }),
|
|
2801
|
-
dismissible ? /* @__PURE__ */
|
|
2863
|
+
dismissible ? /* @__PURE__ */ jsx31(CloseButton, { onClick: onClose }) : null
|
|
2802
2864
|
] }),
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
footer ? /* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsx31("div", { className: "ow-drawer__body", children }),
|
|
2866
|
+
footer ? /* @__PURE__ */ jsx31("footer", { className: "ow-drawer__footer", children: footer }) : null
|
|
2805
2867
|
]
|
|
2806
2868
|
}
|
|
2807
2869
|
);
|
|
@@ -2816,7 +2878,7 @@ import {
|
|
|
2816
2878
|
useId as useId12,
|
|
2817
2879
|
useRef as useRef16
|
|
2818
2880
|
} from "react";
|
|
2819
|
-
import { Fragment as Fragment6, jsx as
|
|
2881
|
+
import { Fragment as Fragment6, jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2820
2882
|
function Popover({
|
|
2821
2883
|
trigger,
|
|
2822
2884
|
children,
|
|
@@ -2869,7 +2931,7 @@ function Popover({
|
|
|
2869
2931
|
}
|
|
2870
2932
|
}) : trigger;
|
|
2871
2933
|
return /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
2872
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx32("span", { ref: anchorRef, className: "ow-popover-anchor", children: triggerElement }),
|
|
2873
2935
|
mounted ? /* @__PURE__ */ jsxs25(
|
|
2874
2936
|
"div",
|
|
2875
2937
|
{
|
|
@@ -2888,7 +2950,7 @@ function Popover({
|
|
|
2888
2950
|
if (next && !panelRef.current?.contains(next) && !anchorRef.current?.contains(next)) setOpen(false);
|
|
2889
2951
|
},
|
|
2890
2952
|
children: [
|
|
2891
|
-
title ? /* @__PURE__ */
|
|
2953
|
+
title ? /* @__PURE__ */ jsx32("div", { id: `${id}-title`, className: "ow-popover__title", children: title }) : null,
|
|
2892
2954
|
children
|
|
2893
2955
|
]
|
|
2894
2956
|
}
|
|
@@ -2964,7 +3026,7 @@ function useMenuKeyboard({
|
|
|
2964
3026
|
}
|
|
2965
3027
|
|
|
2966
3028
|
// src/components/Menu/Menu.tsx
|
|
2967
|
-
import { jsx as
|
|
3029
|
+
import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2968
3030
|
var MenuContext = createContext3(null);
|
|
2969
3031
|
function Menu({ trigger, children, label, align = "start", above = false, width, defaultOpen = false, className }) {
|
|
2970
3032
|
const [open, setOpen] = useState15(defaultOpen);
|
|
@@ -3004,7 +3066,7 @@ function Menu({ trigger, children, label, align = "start", above = false, width,
|
|
|
3004
3066
|
}) : trigger;
|
|
3005
3067
|
return /* @__PURE__ */ jsxs26("span", { ref: rootRef, className: "ow-menu", children: [
|
|
3006
3068
|
triggerElement,
|
|
3007
|
-
mounted ? /* @__PURE__ */
|
|
3069
|
+
mounted ? /* @__PURE__ */ jsx33(
|
|
3008
3070
|
MenuContext.Provider,
|
|
3009
3071
|
{
|
|
3010
3072
|
value: {
|
|
@@ -3013,7 +3075,7 @@ function Menu({ trigger, children, label, align = "start", above = false, width,
|
|
|
3013
3075
|
triggerRef.current?.focus();
|
|
3014
3076
|
}
|
|
3015
3077
|
},
|
|
3016
|
-
children: /* @__PURE__ */
|
|
3078
|
+
children: /* @__PURE__ */ jsx33(
|
|
3017
3079
|
"div",
|
|
3018
3080
|
{
|
|
3019
3081
|
ref: menuRef,
|
|
@@ -3050,18 +3112,18 @@ var MenuItem = forwardRef13(function MenuItem2({ icon: icon2, onSelect, destruct
|
|
|
3050
3112
|
},
|
|
3051
3113
|
...buttonProps,
|
|
3052
3114
|
children: [
|
|
3053
|
-
icon2 ? /* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
shortcut ? /* @__PURE__ */
|
|
3115
|
+
icon2 ? /* @__PURE__ */ jsx33("span", { className: "ow-menu__icon", children: icon2 }) : null,
|
|
3116
|
+
/* @__PURE__ */ jsx33("span", { className: "ow-menu__label", children }),
|
|
3117
|
+
shortcut ? /* @__PURE__ */ jsx33("kbd", { className: "ow-menu__shortcut", children: shortcut }) : null
|
|
3056
3118
|
]
|
|
3057
3119
|
}
|
|
3058
3120
|
);
|
|
3059
3121
|
});
|
|
3060
3122
|
function MenuLabel({ children }) {
|
|
3061
|
-
return /* @__PURE__ */
|
|
3123
|
+
return /* @__PURE__ */ jsx33("div", { className: "ow-menu__group-label", role: "presentation", children });
|
|
3062
3124
|
}
|
|
3063
3125
|
function MenuSeparator() {
|
|
3064
|
-
return /* @__PURE__ */
|
|
3126
|
+
return /* @__PURE__ */ jsx33("div", { className: "ow-menu__separator", role: "separator" });
|
|
3065
3127
|
}
|
|
3066
3128
|
|
|
3067
3129
|
// src/components/CommandPalette/CommandPalette.tsx
|
|
@@ -3102,7 +3164,7 @@ function filterCommands(commands, query) {
|
|
|
3102
3164
|
}
|
|
3103
3165
|
|
|
3104
3166
|
// src/components/CommandPalette/CommandPalette.tsx
|
|
3105
|
-
import { jsx as
|
|
3167
|
+
import { jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3106
3168
|
function CommandPalette({ open, onClose, commands, placeholder = "Search commands\u2026" }) {
|
|
3107
3169
|
const { dialogRef, mounted } = useModalDialog(open, onClose);
|
|
3108
3170
|
const [query, setQuery] = useState16("");
|
|
@@ -3130,8 +3192,8 @@ function CommandPalette({ open, onClose, commands, placeholder = "Search command
|
|
|
3130
3192
|
}
|
|
3131
3193
|
return /* @__PURE__ */ jsxs27("dialog", { ref: dialogRef, className: "ow-dialog ow-palette", "aria-label": "Command palette", children: [
|
|
3132
3194
|
/* @__PURE__ */ jsxs27("div", { className: "ow-palette__search", children: [
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3195
|
+
/* @__PURE__ */ jsx34(SearchIcon, { size: 16, className: "ow-palette__search-icon" }),
|
|
3196
|
+
/* @__PURE__ */ jsx34(
|
|
3135
3197
|
"input",
|
|
3136
3198
|
{
|
|
3137
3199
|
autoFocus: true,
|
|
@@ -3158,13 +3220,13 @@ function CommandPalette({ open, onClose, commands, placeholder = "Search command
|
|
|
3158
3220
|
}
|
|
3159
3221
|
}
|
|
3160
3222
|
),
|
|
3161
|
-
/* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ jsx34("kbd", { className: "ow-palette__esc", children: "esc" })
|
|
3162
3224
|
] }),
|
|
3163
|
-
/* @__PURE__ */
|
|
3225
|
+
/* @__PURE__ */ jsx34("ul", { ref: listRef, id: listId, role: "listbox", "aria-label": "Commands", className: "ow-palette__list", children: results.length ? results.map((command, index) => {
|
|
3164
3226
|
const showGroup = !query.trim() && command.group && command.group !== results[index - 1]?.group;
|
|
3165
3227
|
const isActive = command === active;
|
|
3166
3228
|
return /* @__PURE__ */ jsxs27("li", { role: "presentation", children: [
|
|
3167
|
-
showGroup ? /* @__PURE__ */
|
|
3229
|
+
showGroup ? /* @__PURE__ */ jsx34("div", { className: "ow-palette__group", children: command.group }) : null,
|
|
3168
3230
|
/* @__PURE__ */ jsxs27(
|
|
3169
3231
|
"div",
|
|
3170
3232
|
{
|
|
@@ -3180,11 +3242,11 @@ function CommandPalette({ open, onClose, commands, placeholder = "Search command
|
|
|
3180
3242
|
onMouseMove: () => setActiveIndex(index),
|
|
3181
3243
|
onClick: () => run(command),
|
|
3182
3244
|
children: [
|
|
3183
|
-
/* @__PURE__ */
|
|
3184
|
-
/* @__PURE__ */
|
|
3185
|
-
command.disabled && isActive ? /* @__PURE__ */
|
|
3186
|
-
command.shortcut ? /* @__PURE__ */
|
|
3187
|
-
isActive && !command.disabled ? /* @__PURE__ */
|
|
3245
|
+
/* @__PURE__ */ jsx34("span", { className: "ow-palette__icon", "aria-hidden": "true", children: command.icon }),
|
|
3246
|
+
/* @__PURE__ */ jsx34("span", { className: "ow-palette__title", children: command.title }),
|
|
3247
|
+
command.disabled && isActive ? /* @__PURE__ */ jsx34("span", { className: "ow-palette__hint", children: command.disabled }) : command.hint ? /* @__PURE__ */ jsx34("span", { className: "ow-palette__hint", children: command.hint }) : null,
|
|
3248
|
+
command.shortcut ? /* @__PURE__ */ jsx34("kbd", { className: "ow-palette__shortcut", children: command.shortcut }) : null,
|
|
3249
|
+
isActive && !command.disabled ? /* @__PURE__ */ jsx34(CornerDownLeftIcon, { size: 13, className: "ow-palette__enter" }) : null
|
|
3188
3250
|
]
|
|
3189
3251
|
}
|
|
3190
3252
|
)
|
|
@@ -3205,7 +3267,7 @@ import {
|
|
|
3205
3267
|
useLayoutEffect as useLayoutEffect4,
|
|
3206
3268
|
useRef as useRef19
|
|
3207
3269
|
} from "react";
|
|
3208
|
-
import { jsx as
|
|
3270
|
+
import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3209
3271
|
var TabsContext = createContext4(null);
|
|
3210
3272
|
function useTabs(component) {
|
|
3211
3273
|
const context = useContext4(TabsContext);
|
|
@@ -3216,7 +3278,7 @@ var idPart = (value) => value.replace(/[^\w-]/g, "_");
|
|
|
3216
3278
|
function Tabs({ value, defaultValue = "", onValueChange, variant = "segmented", className, children, ...props }) {
|
|
3217
3279
|
const [current, select] = useControllableState(value, defaultValue, onValueChange);
|
|
3218
3280
|
const baseId = useId15();
|
|
3219
|
-
return /* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ jsx35(TabsContext.Provider, { value: { value: current, select, baseId, variant }, children: /* @__PURE__ */ jsx35("div", { className: cx("ow-tabs", `ow-tabs--${variant}`, className), ...props, children }) });
|
|
3220
3282
|
}
|
|
3221
3283
|
function TabList({ className, onKeyDown, children, ...props }) {
|
|
3222
3284
|
const { value, select } = useTabs("TabList");
|
|
@@ -3242,7 +3304,7 @@ function TabList({ className, onKeyDown, children, ...props }) {
|
|
|
3242
3304
|
}
|
|
3243
3305
|
return /* @__PURE__ */ jsxs28("div", { ref: listRef, role: "tablist", className: cx("ow-tabs__list", className), onKeyDown: handleKeyDown, ...props, children: [
|
|
3244
3306
|
children,
|
|
3245
|
-
/* @__PURE__ */
|
|
3307
|
+
/* @__PURE__ */ jsx35("span", { className: "ow-indicator", "aria-hidden": "true" })
|
|
3246
3308
|
] });
|
|
3247
3309
|
}
|
|
3248
3310
|
function Tab({ value, icon: icon2, className, children, onClick, ...props }) {
|
|
@@ -3265,7 +3327,7 @@ function Tab({ value, icon: icon2, className, children, onClick, ...props }) {
|
|
|
3265
3327
|
},
|
|
3266
3328
|
...props,
|
|
3267
3329
|
children: [
|
|
3268
|
-
icon2 ? /* @__PURE__ */
|
|
3330
|
+
icon2 ? /* @__PURE__ */ jsx35("span", { className: "ow-tab__icon", children: icon2 }) : null,
|
|
3269
3331
|
children
|
|
3270
3332
|
]
|
|
3271
3333
|
}
|
|
@@ -3275,7 +3337,7 @@ function TabPanel({ value, keepMounted = false, className, children, ...props })
|
|
|
3275
3337
|
const { value: current, baseId } = useTabs("TabPanel");
|
|
3276
3338
|
const selected = current === value;
|
|
3277
3339
|
if (!selected && !keepMounted) return null;
|
|
3278
|
-
return /* @__PURE__ */
|
|
3340
|
+
return /* @__PURE__ */ jsx35(
|
|
3279
3341
|
"div",
|
|
3280
3342
|
{
|
|
3281
3343
|
role: "tabpanel",
|
|
@@ -3298,7 +3360,7 @@ import {
|
|
|
3298
3360
|
useId as useId16,
|
|
3299
3361
|
useRef as useRef20
|
|
3300
3362
|
} from "react";
|
|
3301
|
-
import { jsx as
|
|
3363
|
+
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3302
3364
|
function DisclosureView({
|
|
3303
3365
|
open,
|
|
3304
3366
|
onToggle,
|
|
@@ -3320,7 +3382,7 @@ function DisclosureView({
|
|
|
3320
3382
|
}, [open]);
|
|
3321
3383
|
return /* @__PURE__ */ jsxs29("div", { className: cx(item ? "ow-accordion__item" : "ow-disclosure", className), "data-open": open, children: [
|
|
3322
3384
|
/* @__PURE__ */ jsxs29("div", { className: "ow-disclosure__header", children: [
|
|
3323
|
-
/* @__PURE__ */
|
|
3385
|
+
/* @__PURE__ */ jsx36(Heading, { className: "ow-disclosure__heading", children: /* @__PURE__ */ jsxs29(
|
|
3324
3386
|
"button",
|
|
3325
3387
|
{
|
|
3326
3388
|
type: "button",
|
|
@@ -3332,18 +3394,18 @@ function DisclosureView({
|
|
|
3332
3394
|
"data-accordion-trigger": item ? "" : void 0,
|
|
3333
3395
|
onClick: onToggle,
|
|
3334
3396
|
children: [
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
icon2 ? /* @__PURE__ */
|
|
3397
|
+
/* @__PURE__ */ jsx36(ChevronRightIcon, { size: 14, className: "ow-disclosure__chevron" }),
|
|
3398
|
+
icon2 ? /* @__PURE__ */ jsx36("span", { className: "ow-disclosure__icon", children: icon2 }) : null,
|
|
3337
3399
|
/* @__PURE__ */ jsxs29("span", { className: "ow-disclosure__titles", children: [
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
subtitle ? /* @__PURE__ */
|
|
3400
|
+
/* @__PURE__ */ jsx36("span", { className: "ow-disclosure__title", children: title }),
|
|
3401
|
+
subtitle ? /* @__PURE__ */ jsx36("span", { className: "ow-disclosure__subtitle", children: subtitle }) : null
|
|
3340
3402
|
] })
|
|
3341
3403
|
]
|
|
3342
3404
|
}
|
|
3343
3405
|
) }),
|
|
3344
|
-
actions ? /* @__PURE__ */
|
|
3406
|
+
actions ? /* @__PURE__ */ jsx36("div", { className: "ow-disclosure__actions", children: actions }) : null
|
|
3345
3407
|
] }),
|
|
3346
|
-
/* @__PURE__ */
|
|
3408
|
+
/* @__PURE__ */ jsx36(
|
|
3347
3409
|
"div",
|
|
3348
3410
|
{
|
|
3349
3411
|
ref: panelRef,
|
|
@@ -3351,7 +3413,7 @@ function DisclosureView({
|
|
|
3351
3413
|
role: "region",
|
|
3352
3414
|
"aria-labelledby": `${id}-trigger`,
|
|
3353
3415
|
className: "ow-disclosure__panel",
|
|
3354
|
-
children: /* @__PURE__ */
|
|
3416
|
+
children: /* @__PURE__ */ jsx36("div", { className: "ow-disclosure__clip", children: /* @__PURE__ */ jsx36("div", { className: "ow-disclosure__content", children }) })
|
|
3355
3417
|
}
|
|
3356
3418
|
)
|
|
3357
3419
|
] });
|
|
@@ -3366,7 +3428,7 @@ function Disclosure({
|
|
|
3366
3428
|
...props
|
|
3367
3429
|
}) {
|
|
3368
3430
|
const [isOpen, setOpen] = useControllableState(open, defaultOpen, onOpenChange);
|
|
3369
|
-
return /* @__PURE__ */
|
|
3431
|
+
return /* @__PURE__ */ jsx36(
|
|
3370
3432
|
DisclosureView,
|
|
3371
3433
|
{
|
|
3372
3434
|
...props,
|
|
@@ -3408,12 +3470,12 @@ function Accordion({
|
|
|
3408
3470
|
event.preventDefault();
|
|
3409
3471
|
triggers[(moves[event.key] + triggers.length) % triggers.length]?.focus();
|
|
3410
3472
|
}
|
|
3411
|
-
return /* @__PURE__ */
|
|
3473
|
+
return /* @__PURE__ */ jsx36(AccordionContext.Provider, { value: { isOpen: (item) => openValues.includes(item), toggle, headingLevel }, children: /* @__PURE__ */ jsx36("div", { className: cx("ow-accordion", `ow-accordion--${variant}`, className), onKeyDown: handleKeyDown, ...props, children }) });
|
|
3412
3474
|
}
|
|
3413
3475
|
function AccordionItem({ value, ...props }) {
|
|
3414
3476
|
const context = useContext5(AccordionContext);
|
|
3415
3477
|
if (!context) throw new Error("AccordionItem must be inside <Accordion>.");
|
|
3416
|
-
return /* @__PURE__ */
|
|
3478
|
+
return /* @__PURE__ */ jsx36(
|
|
3417
3479
|
DisclosureView,
|
|
3418
3480
|
{
|
|
3419
3481
|
...props,
|
|
@@ -3427,13 +3489,13 @@ function AccordionItem({ value, ...props }) {
|
|
|
3427
3489
|
|
|
3428
3490
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
3429
3491
|
import { forwardRef as forwardRef14 } from "react";
|
|
3430
|
-
import { Fragment as Fragment7, jsx as
|
|
3492
|
+
import { Fragment as Fragment7, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3431
3493
|
function Breadcrumbs({ items: items2, separator = "chevron", label = "Breadcrumb", className }) {
|
|
3432
|
-
return /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ jsx37("nav", { "aria-label": label, className: cx("ow-breadcrumbs", className), children: /* @__PURE__ */ jsx37("ol", { className: "ow-breadcrumbs__list", children: items2.map((item, index) => {
|
|
3433
3495
|
const isLast = index === items2.length - 1;
|
|
3434
3496
|
return /* @__PURE__ */ jsxs30("li", { className: "ow-breadcrumbs__item", children: [
|
|
3435
|
-
isLast ? /* @__PURE__ */
|
|
3436
|
-
isLast ? null : /* @__PURE__ */
|
|
3497
|
+
isLast ? /* @__PURE__ */ jsx37("span", { className: "ow-breadcrumbs__current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ jsx37("a", { className: "ow-breadcrumbs__link", href: item.href, onClick: item.onClick, children: item.label }) : /* @__PURE__ */ jsx37("button", { type: "button", className: "ow-breadcrumbs__link", onClick: item.onClick, children: item.label }),
|
|
3498
|
+
isLast ? null : /* @__PURE__ */ jsx37("span", { className: "ow-breadcrumbs__separator", "aria-hidden": "true", children: separator === "slash" ? "/" : /* @__PURE__ */ jsx37(ChevronRightIcon, { size: 14 }) })
|
|
3437
3499
|
] }, index);
|
|
3438
3500
|
}) }) });
|
|
3439
3501
|
}
|
|
@@ -3452,8 +3514,8 @@ var Link = forwardRef14(function Link2({ variant = "default", external = false,
|
|
|
3452
3514
|
children: [
|
|
3453
3515
|
children,
|
|
3454
3516
|
external ? /* @__PURE__ */ jsxs30(Fragment7, { children: [
|
|
3455
|
-
/* @__PURE__ */
|
|
3456
|
-
/* @__PURE__ */
|
|
3517
|
+
/* @__PURE__ */ jsx37(ArrowUpRightIcon, { size: 13, className: "ow-link__external" }),
|
|
3518
|
+
/* @__PURE__ */ jsx37("span", { className: "ow-visually-hidden", children: " (opens in a new tab)" })
|
|
3457
3519
|
] }) : null
|
|
3458
3520
|
]
|
|
3459
3521
|
}
|
|
@@ -3461,7 +3523,7 @@ var Link = forwardRef14(function Link2({ variant = "default", external = false,
|
|
|
3461
3523
|
});
|
|
3462
3524
|
|
|
3463
3525
|
// src/components/Pagination/Pagination.tsx
|
|
3464
|
-
import { jsx as
|
|
3526
|
+
import { jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3465
3527
|
function paginationItems(page, pageCount, siblingCount = 1, boundaryCount = 1) {
|
|
3466
3528
|
const range = (from, to) => Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => from + i);
|
|
3467
3529
|
const startPages = range(1, Math.min(boundaryCount, pageCount));
|
|
@@ -3494,8 +3556,8 @@ function Pagination({
|
|
|
3494
3556
|
}) {
|
|
3495
3557
|
const items2 = paginationItems(page, pageCount, siblingCount, boundaryCount);
|
|
3496
3558
|
const go = (next) => onPageChange(Math.min(Math.max(1, next), pageCount));
|
|
3497
|
-
return /* @__PURE__ */
|
|
3498
|
-
/* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx38("nav", { "aria-label": label, className: cx("ow-pagination", `ow-pagination--${size}`, className), children: /* @__PURE__ */ jsxs31("ul", { className: "ow-pagination__list", children: [
|
|
3560
|
+
/* @__PURE__ */ jsx38("li", { children: /* @__PURE__ */ jsx38(
|
|
3499
3561
|
"button",
|
|
3500
3562
|
{
|
|
3501
3563
|
type: "button",
|
|
@@ -3503,11 +3565,11 @@ function Pagination({
|
|
|
3503
3565
|
"aria-label": "Previous page",
|
|
3504
3566
|
disabled: page <= 1,
|
|
3505
3567
|
onClick: () => go(page - 1),
|
|
3506
|
-
children: /* @__PURE__ */
|
|
3568
|
+
children: /* @__PURE__ */ jsx38(ChevronLeftIcon, { size: 16 })
|
|
3507
3569
|
}
|
|
3508
3570
|
) }),
|
|
3509
3571
|
items2.map(
|
|
3510
|
-
(item) => typeof item === "number" ? /* @__PURE__ */
|
|
3572
|
+
(item) => typeof item === "number" ? /* @__PURE__ */ jsx38("li", { children: /* @__PURE__ */ jsx38(
|
|
3511
3573
|
"button",
|
|
3512
3574
|
{
|
|
3513
3575
|
type: "button",
|
|
@@ -3517,9 +3579,9 @@ function Pagination({
|
|
|
3517
3579
|
onClick: () => go(item),
|
|
3518
3580
|
children: item
|
|
3519
3581
|
}
|
|
3520
|
-
) }, item) : /* @__PURE__ */
|
|
3582
|
+
) }, item) : /* @__PURE__ */ jsx38("li", { className: "ow-pagination__gap", "aria-hidden": "true", children: "\u2026" }, item)
|
|
3521
3583
|
),
|
|
3522
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ jsx38("li", { children: /* @__PURE__ */ jsx38(
|
|
3523
3585
|
"button",
|
|
3524
3586
|
{
|
|
3525
3587
|
type: "button",
|
|
@@ -3527,7 +3589,7 @@ function Pagination({
|
|
|
3527
3589
|
"aria-label": "Next page",
|
|
3528
3590
|
disabled: page >= pageCount,
|
|
3529
3591
|
onClick: () => go(page + 1),
|
|
3530
|
-
children: /* @__PURE__ */
|
|
3592
|
+
children: /* @__PURE__ */ jsx38(ChevronRightIcon, { size: 16 })
|
|
3531
3593
|
}
|
|
3532
3594
|
) })
|
|
3533
3595
|
] }) });
|
|
@@ -3535,12 +3597,12 @@ function Pagination({
|
|
|
3535
3597
|
|
|
3536
3598
|
// src/components/Steps/Steps.tsx
|
|
3537
3599
|
import { useId as useId17 } from "react";
|
|
3538
|
-
import { jsx as
|
|
3600
|
+
import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3539
3601
|
function Steps({ items: items2, current = 0, orientation = "vertical", title, label = "Steps", className }) {
|
|
3540
3602
|
const statuses = items2.map((item, index) => item.status ?? (index < current ? "done" : index === current ? "current" : "upcoming"));
|
|
3541
3603
|
const doneCount = statuses.filter((status) => status === "done").length;
|
|
3542
3604
|
const headingId = useId17();
|
|
3543
|
-
const list = /* @__PURE__ */
|
|
3605
|
+
const list = /* @__PURE__ */ jsx39("ol", { className: "ow-steps__list", children: items2.map((item, index) => {
|
|
3544
3606
|
const status = statuses[index];
|
|
3545
3607
|
return /* @__PURE__ */ jsxs32(
|
|
3546
3608
|
"li",
|
|
@@ -3548,15 +3610,15 @@ function Steps({ items: items2, current = 0, orientation = "vertical", title, la
|
|
|
3548
3610
|
className: cx("ow-steps__item", `ow-steps__item--${status}`),
|
|
3549
3611
|
"aria-current": status === "current" ? "step" : void 0,
|
|
3550
3612
|
children: [
|
|
3551
|
-
/* @__PURE__ */
|
|
3613
|
+
/* @__PURE__ */ jsx39("span", { className: "ow-steps__marker", children: status === "done" ? /* @__PURE__ */ jsx39(CheckIcon, { size: 14, strokeWidth: 3 }) : index + 1 }),
|
|
3552
3614
|
/* @__PURE__ */ jsxs32("span", { className: "ow-steps__text", children: [
|
|
3553
3615
|
/* @__PURE__ */ jsxs32("span", { className: "ow-steps__title", children: [
|
|
3554
|
-
status === "done" ? /* @__PURE__ */
|
|
3616
|
+
status === "done" ? /* @__PURE__ */ jsx39("span", { className: "ow-visually-hidden", children: "Done: " }) : null,
|
|
3555
3617
|
item.title
|
|
3556
3618
|
] }),
|
|
3557
|
-
item.description && (orientation === "horizontal" || status !== "done") ? /* @__PURE__ */
|
|
3619
|
+
item.description && (orientation === "horizontal" || status !== "done") ? /* @__PURE__ */ jsx39("span", { className: "ow-steps__description", children: item.description }) : null
|
|
3558
3620
|
] }),
|
|
3559
|
-
item.action && status
|
|
3621
|
+
item.action && status === "current" && orientation === "vertical" ? /* @__PURE__ */ jsx39("span", { className: "ow-steps__action", children: item.action }) : null
|
|
3560
3622
|
]
|
|
3561
3623
|
},
|
|
3562
3624
|
index
|
|
@@ -3570,7 +3632,7 @@ function Steps({ items: items2, current = 0, orientation = "vertical", title, la
|
|
|
3570
3632
|
"aria-label": title && orientation === "vertical" ? void 0 : label,
|
|
3571
3633
|
children: [
|
|
3572
3634
|
title && orientation === "vertical" ? /* @__PURE__ */ jsxs32("div", { className: "ow-steps__header", children: [
|
|
3573
|
-
/* @__PURE__ */
|
|
3635
|
+
/* @__PURE__ */ jsx39("h3", { id: headingId, className: "ow-steps__heading", children: title }),
|
|
3574
3636
|
/* @__PURE__ */ jsxs32("span", { className: "ow-steps__count", children: [
|
|
3575
3637
|
doneCount,
|
|
3576
3638
|
" of ",
|
|
@@ -3586,25 +3648,25 @@ function Steps({ items: items2, current = 0, orientation = "vertical", title, la
|
|
|
3586
3648
|
|
|
3587
3649
|
// src/components/NavList/NavList.tsx
|
|
3588
3650
|
import { forwardRef as forwardRef15 } from "react";
|
|
3589
|
-
import { Fragment as Fragment8, jsx as
|
|
3651
|
+
import { Fragment as Fragment8, jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3590
3652
|
function NavList({ label, heading, orientation = "vertical", children, className }) {
|
|
3591
3653
|
return /* @__PURE__ */ jsxs33("nav", { "aria-label": label, className: cx("ow-nav", `ow-nav--${orientation}`, className), children: [
|
|
3592
|
-
heading && orientation === "vertical" ? /* @__PURE__ */
|
|
3654
|
+
heading && orientation === "vertical" ? /* @__PURE__ */ jsx40("span", { className: "ow-nav__heading", children: heading }) : null,
|
|
3593
3655
|
children
|
|
3594
3656
|
] });
|
|
3595
3657
|
}
|
|
3596
3658
|
var NavItem = forwardRef15(function NavItem2({ icon: icon2, active = false, className, children, type = "button", href, end, ...buttonProps }, ref) {
|
|
3597
3659
|
const content = /* @__PURE__ */ jsxs33(Fragment8, { children: [
|
|
3598
|
-
icon2 ? /* @__PURE__ */
|
|
3599
|
-
/* @__PURE__ */
|
|
3600
|
-
end !== void 0 ? /* @__PURE__ */
|
|
3660
|
+
icon2 ? /* @__PURE__ */ jsx40("span", { className: "ow-nav__icon", children: icon2 }) : null,
|
|
3661
|
+
/* @__PURE__ */ jsx40("span", { className: "ow-nav__label", children }),
|
|
3662
|
+
end !== void 0 ? /* @__PURE__ */ jsx40("span", { className: "ow-nav__end", children: end }) : null
|
|
3601
3663
|
] });
|
|
3602
3664
|
const shared = {
|
|
3603
3665
|
"aria-current": active ? "page" : void 0,
|
|
3604
3666
|
className: cx("ow-nav__item", active && "ow-nav__item--active", className)
|
|
3605
3667
|
};
|
|
3606
3668
|
if (href !== void 0) {
|
|
3607
|
-
return /* @__PURE__ */
|
|
3669
|
+
return /* @__PURE__ */ jsx40(
|
|
3608
3670
|
"a",
|
|
3609
3671
|
{
|
|
3610
3672
|
ref,
|
|
@@ -3615,12 +3677,12 @@ var NavItem = forwardRef15(function NavItem2({ icon: icon2, active = false, clas
|
|
|
3615
3677
|
}
|
|
3616
3678
|
);
|
|
3617
3679
|
}
|
|
3618
|
-
return /* @__PURE__ */
|
|
3680
|
+
return /* @__PURE__ */ jsx40("button", { ref, type, ...shared, ...buttonProps, children: content });
|
|
3619
3681
|
});
|
|
3620
3682
|
|
|
3621
3683
|
// src/components/Table/Table.tsx
|
|
3622
3684
|
import { useMemo as useMemo5 } from "react";
|
|
3623
|
-
import { jsx as
|
|
3685
|
+
import { jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3624
3686
|
function compare(a, b) {
|
|
3625
3687
|
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
3626
3688
|
return String(a).localeCompare(String(b), void 0, { numeric: true, sensitivity: "base" });
|
|
@@ -3639,6 +3701,7 @@ function Table({
|
|
|
3639
3701
|
selectedKeys,
|
|
3640
3702
|
defaultSelectedKeys = [],
|
|
3641
3703
|
onSelectionChange,
|
|
3704
|
+
rowLabel,
|
|
3642
3705
|
emptyContent = "Nothing here yet.",
|
|
3643
3706
|
density = "comfortable",
|
|
3644
3707
|
stickyHeader = false,
|
|
@@ -3648,6 +3711,11 @@ function Table({
|
|
|
3648
3711
|
const [currentSort, setSort] = useControllableState(sort, defaultSort, onSortChange);
|
|
3649
3712
|
const [selected, setSelected] = useControllableState(selectedKeys, defaultSelectedKeys, onSelectionChange);
|
|
3650
3713
|
const keyOf = (row) => typeof rowKey === "function" ? rowKey(row) : row[rowKey];
|
|
3714
|
+
const labelOf = (row, index) => {
|
|
3715
|
+
if (rowLabel) return rowLabel(row);
|
|
3716
|
+
const first = columns[0] ? row[columns[0].key] : void 0;
|
|
3717
|
+
return typeof first === "string" || typeof first === "number" ? String(first) : `row ${index + 1}`;
|
|
3718
|
+
};
|
|
3651
3719
|
const field = (row, key) => row[key];
|
|
3652
3720
|
const sorted = useMemo5(() => {
|
|
3653
3721
|
if (!currentSort || manualSort) return rows;
|
|
@@ -3665,16 +3733,16 @@ function Table({
|
|
|
3665
3733
|
);
|
|
3666
3734
|
}
|
|
3667
3735
|
const selectable = selectionMode === "multiple";
|
|
3668
|
-
return /* @__PURE__ */
|
|
3736
|
+
return /* @__PURE__ */ jsx41(
|
|
3669
3737
|
"div",
|
|
3670
3738
|
{
|
|
3671
3739
|
className: cx("ow-table-wrap", stickyHeader && "ow-table-wrap--sticky", className),
|
|
3672
3740
|
style: maxHeight ? { maxHeight } : void 0,
|
|
3673
3741
|
tabIndex: maxHeight ? 0 : void 0,
|
|
3674
3742
|
children: /* @__PURE__ */ jsxs34("table", { className: cx("ow-table", `ow-table--${density}`), children: [
|
|
3675
|
-
caption ? /* @__PURE__ */
|
|
3676
|
-
/* @__PURE__ */
|
|
3677
|
-
selectable ? /* @__PURE__ */
|
|
3743
|
+
caption ? /* @__PURE__ */ jsx41("caption", { className: cx("ow-table__caption", hideCaption && "ow-visually-hidden"), children: caption }) : null,
|
|
3744
|
+
/* @__PURE__ */ jsx41("thead", { children: /* @__PURE__ */ jsxs34("tr", { children: [
|
|
3745
|
+
selectable ? /* @__PURE__ */ jsx41("th", { className: "ow-table__select", scope: "col", children: /* @__PURE__ */ jsx41(
|
|
3678
3746
|
Checkbox,
|
|
3679
3747
|
{
|
|
3680
3748
|
size: "sm",
|
|
@@ -3688,7 +3756,7 @@ function Table({
|
|
|
3688
3756
|
) }) : null,
|
|
3689
3757
|
columns.map((column) => {
|
|
3690
3758
|
const direction = currentSort?.key === column.key ? currentSort.direction : void 0;
|
|
3691
|
-
return /* @__PURE__ */
|
|
3759
|
+
return /* @__PURE__ */ jsx41(
|
|
3692
3760
|
"th",
|
|
3693
3761
|
{
|
|
3694
3762
|
scope: "col",
|
|
@@ -3697,29 +3765,29 @@ function Table({
|
|
|
3697
3765
|
style: column.width !== void 0 ? { width: column.width } : void 0,
|
|
3698
3766
|
children: column.sortable ? /* @__PURE__ */ jsxs34("button", { type: "button", className: "ow-table__sort", onClick: () => toggleSort(column.key), children: [
|
|
3699
3767
|
column.header,
|
|
3700
|
-
/* @__PURE__ */
|
|
3768
|
+
/* @__PURE__ */ jsx41("span", { className: cx("ow-table__sort-icon", direction && "ow-table__sort-icon--active"), children: direction === "ascending" ? /* @__PURE__ */ jsx41(ArrowUpIcon, { size: 12 }) : direction === "descending" ? /* @__PURE__ */ jsx41(ArrowDownIcon, { size: 12 }) : /* @__PURE__ */ jsx41(ChevronsUpDownIcon, { size: 12 }) })
|
|
3701
3769
|
] }) : column.header
|
|
3702
3770
|
},
|
|
3703
3771
|
column.key
|
|
3704
3772
|
);
|
|
3705
3773
|
})
|
|
3706
3774
|
] }) }),
|
|
3707
|
-
/* @__PURE__ */
|
|
3775
|
+
/* @__PURE__ */ jsx41("tbody", { children: sorted.length === 0 ? /* @__PURE__ */ jsx41("tr", { children: /* @__PURE__ */ jsx41("td", { className: "ow-table__empty", colSpan: columns.length + (selectable ? 1 : 0), children: emptyContent }) }) : sorted.map((row, index) => {
|
|
3708
3776
|
const key = keyOf(row);
|
|
3709
3777
|
const isSelected = selected.includes(key);
|
|
3710
3778
|
return /* @__PURE__ */ jsxs34("tr", { className: cx(isSelected && "ow-table__row--selected"), children: [
|
|
3711
|
-
selectable ? /* @__PURE__ */
|
|
3779
|
+
selectable ? /* @__PURE__ */ jsx41("td", { className: "ow-table__select", children: /* @__PURE__ */ jsx41(
|
|
3712
3780
|
Checkbox,
|
|
3713
3781
|
{
|
|
3714
3782
|
size: "sm",
|
|
3715
|
-
"aria-label":
|
|
3783
|
+
"aria-label": `Select ${labelOf(row, index)}`,
|
|
3716
3784
|
checked: isSelected,
|
|
3717
3785
|
onChange: (event) => setSelected(
|
|
3718
3786
|
event.target.checked ? [...selected, key] : selected.filter((k) => k !== key)
|
|
3719
3787
|
)
|
|
3720
3788
|
}
|
|
3721
3789
|
) }) : null,
|
|
3722
|
-
columns.map((column) => /* @__PURE__ */
|
|
3790
|
+
columns.map((column) => /* @__PURE__ */ jsx41("td", { className: cx(`ow-table__cell--${column.align ?? "start"}`), children: column.render ? column.render(row) : field(row, column.key) }, column.key))
|
|
3723
3791
|
] }, key);
|
|
3724
3792
|
}) })
|
|
3725
3793
|
] })
|
|
@@ -3728,7 +3796,7 @@ function Table({
|
|
|
3728
3796
|
}
|
|
3729
3797
|
|
|
3730
3798
|
// src/components/Stat/Stat.tsx
|
|
3731
|
-
import { jsx as
|
|
3799
|
+
import { jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3732
3800
|
function Sparkline({ values }) {
|
|
3733
3801
|
const max = Math.max(...values);
|
|
3734
3802
|
const min = Math.min(...values);
|
|
@@ -3742,10 +3810,10 @@ function Sparkline({ values }) {
|
|
|
3742
3810
|
const [lastX, lastY] = points[points.length - 1];
|
|
3743
3811
|
return /* @__PURE__ */ jsxs35("div", { className: "ow-stat__trend", "aria-hidden": "true", children: [
|
|
3744
3812
|
/* @__PURE__ */ jsxs35("svg", { viewBox: "0 0 100 40", preserveAspectRatio: "none", children: [
|
|
3745
|
-
/* @__PURE__ */
|
|
3746
|
-
/* @__PURE__ */
|
|
3813
|
+
/* @__PURE__ */ jsx42("path", { d: `${line} L100 40 L0 40 Z`, className: "ow-stat__trend-area" }),
|
|
3814
|
+
/* @__PURE__ */ jsx42("path", { d: line, className: "ow-stat__trend-line", vectorEffect: "non-scaling-stroke" })
|
|
3747
3815
|
] }),
|
|
3748
|
-
/* @__PURE__ */
|
|
3816
|
+
/* @__PURE__ */ jsx42("span", { className: "ow-stat__trend-end", style: { left: `${lastX}%`, top: `${lastY / 40 * 100}%` } })
|
|
3749
3817
|
] });
|
|
3750
3818
|
}
|
|
3751
3819
|
function Stat({ label, value, icon: icon2, change, changeTone, description, trend, className }) {
|
|
@@ -3753,24 +3821,24 @@ function Stat({ label, value, icon: icon2, change, changeTone, description, tren
|
|
|
3753
3821
|
const rising = change ? !/^[-−]/.test(change) : false;
|
|
3754
3822
|
return /* @__PURE__ */ jsxs35("div", { className: cx("ow-stat", className), children: [
|
|
3755
3823
|
/* @__PURE__ */ jsxs35("div", { className: "ow-stat__label", children: [
|
|
3756
|
-
icon2 ? /* @__PURE__ */
|
|
3757
|
-
/* @__PURE__ */
|
|
3824
|
+
icon2 ? /* @__PURE__ */ jsx42("span", { className: "ow-stat__icon", children: icon2 }) : null,
|
|
3825
|
+
/* @__PURE__ */ jsx42("span", { children: label })
|
|
3758
3826
|
] }),
|
|
3759
3827
|
/* @__PURE__ */ jsxs35("div", { className: "ow-stat__row", children: [
|
|
3760
|
-
/* @__PURE__ */
|
|
3828
|
+
/* @__PURE__ */ jsx42("span", { className: "ow-stat__value", children: value }),
|
|
3761
3829
|
change ? /* @__PURE__ */ jsxs35("span", { className: cx("ow-stat__change", `ow-stat__change--${tone}`), children: [
|
|
3762
|
-
tone === "neutral" ? null : rising ? /* @__PURE__ */
|
|
3830
|
+
tone === "neutral" ? null : rising ? /* @__PURE__ */ jsx42(ArrowUpIcon, { size: 12 }) : /* @__PURE__ */ jsx42(ArrowDownIcon, { size: 12 }),
|
|
3763
3831
|
change
|
|
3764
3832
|
] }) : null
|
|
3765
3833
|
] }),
|
|
3766
|
-
description ? /* @__PURE__ */
|
|
3767
|
-
trend && trend.length > 1 ? /* @__PURE__ */
|
|
3834
|
+
description ? /* @__PURE__ */ jsx42("div", { className: "ow-stat__description", children: description }) : null,
|
|
3835
|
+
trend && trend.length > 1 ? /* @__PURE__ */ jsx42(Sparkline, { values: trend }) : null
|
|
3768
3836
|
] });
|
|
3769
3837
|
}
|
|
3770
3838
|
|
|
3771
3839
|
// src/components/FileTree/FileTree.tsx
|
|
3772
3840
|
import { useMemo as useMemo6, useRef as useRef21, useState as useState17 } from "react";
|
|
3773
|
-
import { jsx as
|
|
3841
|
+
import { jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3774
3842
|
function flatten(nodes, expanded, parent, level = 1) {
|
|
3775
3843
|
return nodes.flatMap((node) => {
|
|
3776
3844
|
const path = parent ? `${parent}/${node.name}` : node.name;
|
|
@@ -3848,7 +3916,7 @@ function FileTree({
|
|
|
3848
3916
|
const row = rows.find((entry) => entry.path === path);
|
|
3849
3917
|
if (!row) return null;
|
|
3850
3918
|
const isOpen = row.isFolder && expanded.has(path);
|
|
3851
|
-
const icon2 = node.icon ?? (row.isFolder ? isOpen ? /* @__PURE__ */
|
|
3919
|
+
const icon2 = node.icon ?? (row.isFolder ? isOpen ? /* @__PURE__ */ jsx43(FolderOpenIcon, { size: 16 }) : /* @__PURE__ */ jsx43(FolderIcon, { size: 16 }) : /* @__PURE__ */ jsx43(FileIcon, { size: 16 }));
|
|
3852
3920
|
return /* @__PURE__ */ jsxs36(
|
|
3853
3921
|
"li",
|
|
3854
3922
|
{
|
|
@@ -3877,51 +3945,51 @@ function FileTree({
|
|
|
3877
3945
|
activate(row);
|
|
3878
3946
|
},
|
|
3879
3947
|
children: [
|
|
3880
|
-
row.isFolder ? /* @__PURE__ */
|
|
3881
|
-
/* @__PURE__ */
|
|
3882
|
-
/* @__PURE__ */
|
|
3883
|
-
node.meta ? /* @__PURE__ */
|
|
3948
|
+
row.isFolder ? /* @__PURE__ */ jsx43(ChevronRightIcon, { size: 14, className: cx("ow-tree__chevron", isOpen && "ow-tree__chevron--open") }) : /* @__PURE__ */ jsx43("span", { className: "ow-tree__spacer" }),
|
|
3949
|
+
/* @__PURE__ */ jsx43("span", { className: cx("ow-tree__icon", row.isFolder && "ow-tree__icon--folder"), children: icon2 }),
|
|
3950
|
+
/* @__PURE__ */ jsx43("span", { className: "ow-tree__name", children: node.name }),
|
|
3951
|
+
node.meta ? /* @__PURE__ */ jsx43("span", { className: "ow-tree__meta", children: node.meta }) : null
|
|
3884
3952
|
]
|
|
3885
3953
|
}
|
|
3886
3954
|
),
|
|
3887
|
-
isOpen && node.children.length > 0 ? /* @__PURE__ */
|
|
3955
|
+
isOpen && node.children.length > 0 ? /* @__PURE__ */ jsx43("ul", { role: "group", className: "ow-tree__group", children: render(node.children, path, level + 1) }) : null
|
|
3888
3956
|
]
|
|
3889
3957
|
},
|
|
3890
3958
|
path
|
|
3891
3959
|
);
|
|
3892
3960
|
});
|
|
3893
3961
|
}
|
|
3894
|
-
return /* @__PURE__ */
|
|
3962
|
+
return /* @__PURE__ */ jsx43("ul", { role: "tree", "aria-label": label, className: cx("ow-tree", className), children: render(items2) });
|
|
3895
3963
|
}
|
|
3896
3964
|
|
|
3897
3965
|
// src/components/EmptyState/EmptyState.tsx
|
|
3898
|
-
import { jsx as
|
|
3966
|
+
import { jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3899
3967
|
function EmptyState({ title, description, icon: icon2, actions, bordered = false, className }) {
|
|
3900
3968
|
return /* @__PURE__ */ jsxs37("div", { className: cx("ow-empty", bordered && "ow-empty--bordered", className), children: [
|
|
3901
|
-
/* @__PURE__ */
|
|
3969
|
+
/* @__PURE__ */ jsx44("span", { className: "ow-empty__icon", "aria-hidden": "true", children: icon2 ?? /* @__PURE__ */ jsx44(InboxIcon, { size: 20 }) }),
|
|
3902
3970
|
/* @__PURE__ */ jsxs37("div", { className: "ow-empty__text", children: [
|
|
3903
|
-
/* @__PURE__ */
|
|
3904
|
-
description ? /* @__PURE__ */
|
|
3971
|
+
/* @__PURE__ */ jsx44("p", { className: "ow-empty__title", children: title }),
|
|
3972
|
+
description ? /* @__PURE__ */ jsx44("p", { className: "ow-empty__description", children: description }) : null
|
|
3905
3973
|
] }),
|
|
3906
|
-
actions ? /* @__PURE__ */
|
|
3974
|
+
actions ? /* @__PURE__ */ jsx44("div", { className: "ow-empty__actions", children: actions }) : null
|
|
3907
3975
|
] });
|
|
3908
3976
|
}
|
|
3909
3977
|
|
|
3910
3978
|
// src/components/Tag/Tag.tsx
|
|
3911
|
-
import { jsx as
|
|
3979
|
+
import { jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3912
3980
|
function Tag({ onRemove, variant = "neutral", size = "md", icon: icon2, removeLabel, className, children, ...props }) {
|
|
3913
3981
|
const name = removeLabel ?? (typeof children === "string" ? children : "tag");
|
|
3914
3982
|
return /* @__PURE__ */ jsxs38("span", { className: cx("ow-tag", `ow-tag--${variant}`, `ow-tag--${size}`, onRemove && "ow-tag--removable", className), ...props, children: [
|
|
3915
|
-
icon2 ? /* @__PURE__ */
|
|
3916
|
-
/* @__PURE__ */
|
|
3917
|
-
onRemove ? /* @__PURE__ */
|
|
3983
|
+
icon2 ? /* @__PURE__ */ jsx45("span", { className: "ow-tag__icon", children: icon2 }) : null,
|
|
3984
|
+
/* @__PURE__ */ jsx45("span", { className: "ow-tag__label", children }),
|
|
3985
|
+
onRemove ? /* @__PURE__ */ jsx45("button", { type: "button", className: "ow-tag__remove", "aria-label": `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ jsx45(XIcon, { size: 12 }) }) : null
|
|
3918
3986
|
] });
|
|
3919
3987
|
}
|
|
3920
3988
|
function TagGroup({ label, className, children, ...props }) {
|
|
3921
|
-
return /* @__PURE__ */
|
|
3989
|
+
return /* @__PURE__ */ jsx45("div", { role: "group", "aria-label": label, className: cx("ow-tag-group", className), ...props, children });
|
|
3922
3990
|
}
|
|
3923
3991
|
function ColorSwatch({ color, name, value, size = "md", shape = "square", className }) {
|
|
3924
|
-
const swatch = /* @__PURE__ */
|
|
3992
|
+
const swatch = /* @__PURE__ */ jsx45(
|
|
3925
3993
|
"span",
|
|
3926
3994
|
{
|
|
3927
3995
|
className: cx("ow-swatch", `ow-swatch--${size}`, shape === "circle" && "ow-swatch--circle"),
|
|
@@ -3929,43 +3997,53 @@ function ColorSwatch({ color, name, value, size = "md", shape = "square", classN
|
|
|
3929
3997
|
...name && !value ? { role: "img", "aria-label": name } : { "aria-hidden": true }
|
|
3930
3998
|
}
|
|
3931
3999
|
);
|
|
3932
|
-
if (!name && !value) return /* @__PURE__ */
|
|
4000
|
+
if (!name && !value) return /* @__PURE__ */ jsx45("span", { className, children: swatch });
|
|
3933
4001
|
return /* @__PURE__ */ jsxs38("span", { className: cx("ow-swatch-label", className), children: [
|
|
3934
4002
|
swatch,
|
|
3935
4003
|
/* @__PURE__ */ jsxs38("span", { className: "ow-swatch-label__text", children: [
|
|
3936
|
-
name ? /* @__PURE__ */
|
|
3937
|
-
/* @__PURE__ */
|
|
4004
|
+
name ? /* @__PURE__ */ jsx45("span", { className: "ow-swatch-label__name", children: name }) : null,
|
|
4005
|
+
/* @__PURE__ */ jsx45("span", { className: "ow-swatch-label__value", children: value })
|
|
3938
4006
|
] })
|
|
3939
4007
|
] });
|
|
3940
4008
|
}
|
|
3941
4009
|
|
|
3942
4010
|
// src/components/Avatar/Avatar.tsx
|
|
3943
4011
|
import { useState as useState18 } from "react";
|
|
3944
|
-
import { jsx as
|
|
4012
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4013
|
+
var namedSizes = { sm: 24, md: 28, lg: 36, xl: 48 };
|
|
4014
|
+
function avatarSize(size) {
|
|
4015
|
+
if (typeof size === "number") {
|
|
4016
|
+
return { className: "ow-avatar--custom", style: { "--ow-avatar-size": `${size}px` }, pixels: size };
|
|
4017
|
+
}
|
|
4018
|
+
return { className: `ow-avatar--${size}`, pixels: namedSizes[size] };
|
|
4019
|
+
}
|
|
3945
4020
|
function Avatar({ name, src, size = "md", label, className }) {
|
|
3946
4021
|
const initials = getInitials(name);
|
|
3947
4022
|
const [failedImage, setFailedImage] = useState18();
|
|
3948
4023
|
const showImage = src && src !== failedImage;
|
|
3949
|
-
|
|
4024
|
+
const sizing = avatarSize(size);
|
|
4025
|
+
return /* @__PURE__ */ jsx46(
|
|
3950
4026
|
"span",
|
|
3951
4027
|
{
|
|
3952
|
-
className: cx("ow-avatar",
|
|
4028
|
+
className: cx("ow-avatar", sizing.className, !initials && !showImage && "ow-avatar--empty", className),
|
|
4029
|
+
style: sizing.style,
|
|
3953
4030
|
...label ? { role: "img", "aria-label": label } : { "aria-hidden": true },
|
|
3954
|
-
children: showImage ? /* @__PURE__ */
|
|
4031
|
+
children: showImage ? /* @__PURE__ */ jsx46("img", { src, alt: "", className: "ow-avatar__image", onError: () => setFailedImage(src) }) : initials || /* @__PURE__ */ jsx46(UserIcon, { size: Math.round(sizing.pixels * 0.52) })
|
|
3955
4032
|
}
|
|
3956
4033
|
);
|
|
3957
4034
|
}
|
|
3958
4035
|
|
|
3959
4036
|
// src/components/Avatar/AvatarGroup.tsx
|
|
3960
4037
|
import { Children, cloneElement as cloneElement4, isValidElement as isValidElement4 } from "react";
|
|
3961
|
-
import { jsx as
|
|
4038
|
+
import { jsx as jsx47, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3962
4039
|
function AvatarGroup({ children, max = 4, size = "md", label, className }) {
|
|
3963
4040
|
const avatars = Children.toArray(children).filter(isValidElement4);
|
|
4041
|
+
const sizing = avatarSize(size);
|
|
3964
4042
|
const shown = avatars.slice(0, max);
|
|
3965
4043
|
const hidden = avatars.length - shown.length;
|
|
3966
4044
|
return /* @__PURE__ */ jsxs39("div", { role: "group", "aria-label": label, className: cx("ow-avatar-group", className), children: [
|
|
3967
4045
|
shown.map((avatar) => cloneElement4(avatar, { size })),
|
|
3968
|
-
hidden > 0 ? /* @__PURE__ */ jsxs39("span", { className: cx("ow-avatar",
|
|
4046
|
+
hidden > 0 ? /* @__PURE__ */ jsxs39("span", { className: cx("ow-avatar", sizing.className, "ow-avatar--count"), style: sizing.style, children: [
|
|
3969
4047
|
/* @__PURE__ */ jsxs39("span", { "aria-hidden": "true", children: [
|
|
3970
4048
|
"+",
|
|
3971
4049
|
hidden
|
|
@@ -3978,37 +4056,41 @@ function AvatarGroup({ children, max = 4, size = "md", label, className }) {
|
|
|
3978
4056
|
] }) : null
|
|
3979
4057
|
] });
|
|
3980
4058
|
}
|
|
4059
|
+
function userSize(size) {
|
|
4060
|
+
if (typeof size !== "number") return `ow-user--${size}`;
|
|
4061
|
+
return size >= 48 ? "ow-user--xl" : size >= 36 ? "ow-user--lg" : size >= 28 ? "ow-user--md" : "ow-user--sm";
|
|
4062
|
+
}
|
|
3981
4063
|
function User({ name, description, src, size = "md", className }) {
|
|
3982
|
-
return /* @__PURE__ */ jsxs39("div", { className: cx("ow-user",
|
|
3983
|
-
/* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsxs39("div", { className: cx("ow-user", userSize(size), className), children: [
|
|
4065
|
+
/* @__PURE__ */ jsx47(Avatar, { name, src, size }),
|
|
3984
4066
|
/* @__PURE__ */ jsxs39("div", { className: "ow-user__text", children: [
|
|
3985
|
-
/* @__PURE__ */
|
|
3986
|
-
description ? /* @__PURE__ */
|
|
4067
|
+
/* @__PURE__ */ jsx47("span", { className: "ow-user__name", children: name }),
|
|
4068
|
+
description ? /* @__PURE__ */ jsx47("span", { className: "ow-user__description", children: description }) : null
|
|
3987
4069
|
] })
|
|
3988
4070
|
] });
|
|
3989
4071
|
}
|
|
3990
4072
|
|
|
3991
4073
|
// src/components/Kbd/Kbd.tsx
|
|
3992
|
-
import { jsx as
|
|
4074
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3993
4075
|
function Kbd({ className, ...props }) {
|
|
3994
|
-
return /* @__PURE__ */
|
|
4076
|
+
return /* @__PURE__ */ jsx48("kbd", { className: cx("ow-kbd", className), ...props });
|
|
3995
4077
|
}
|
|
3996
4078
|
function Code({ className, ...props }) {
|
|
3997
|
-
return /* @__PURE__ */
|
|
4079
|
+
return /* @__PURE__ */ jsx48("code", { className: cx("ow-code", className), ...props });
|
|
3998
4080
|
}
|
|
3999
4081
|
|
|
4000
4082
|
// src/components/Card/Card.tsx
|
|
4001
|
-
import { jsx as
|
|
4083
|
+
import { jsx as jsx49, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4002
4084
|
function Card({ className, padding = "md", ...props }) {
|
|
4003
|
-
return /* @__PURE__ */
|
|
4085
|
+
return /* @__PURE__ */ jsx49("div", { className: cx("ow-card", `ow-card--pad-${padding}`, className), ...props });
|
|
4004
4086
|
}
|
|
4005
4087
|
function SettingsRow({ children, description, label, className }) {
|
|
4006
4088
|
return /* @__PURE__ */ jsxs40("div", { className: cx("ow-settings-row", className), children: [
|
|
4007
4089
|
/* @__PURE__ */ jsxs40("div", { className: "ow-settings-row__text", children: [
|
|
4008
|
-
/* @__PURE__ */
|
|
4009
|
-
description ? /* @__PURE__ */
|
|
4090
|
+
/* @__PURE__ */ jsx49("span", { className: "ow-settings-row__label", children: label }),
|
|
4091
|
+
description ? /* @__PURE__ */ jsx49("div", { className: "ow-settings-row__description", children: description }) : null
|
|
4010
4092
|
] }),
|
|
4011
|
-
/* @__PURE__ */
|
|
4093
|
+
/* @__PURE__ */ jsx49("div", { className: "ow-settings-row__control", children })
|
|
4012
4094
|
] });
|
|
4013
4095
|
}
|
|
4014
4096
|
|
|
@@ -4018,7 +4100,7 @@ import {
|
|
|
4018
4100
|
useRef as useRef22,
|
|
4019
4101
|
useState as useState19
|
|
4020
4102
|
} from "react";
|
|
4021
|
-
import { jsx as
|
|
4103
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4022
4104
|
var space = (token) => token === "none" ? "0" : `var(--ow-space-${token})`;
|
|
4023
4105
|
var alignments = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch", baseline: "baseline", between: "space-between" };
|
|
4024
4106
|
function Stack({
|
|
@@ -4034,7 +4116,7 @@ function Stack({
|
|
|
4034
4116
|
...props
|
|
4035
4117
|
}) {
|
|
4036
4118
|
const Element = as;
|
|
4037
|
-
return /* @__PURE__ */
|
|
4119
|
+
return /* @__PURE__ */ jsx50(
|
|
4038
4120
|
Element,
|
|
4039
4121
|
{
|
|
4040
4122
|
className: cx("ow-stack", className),
|
|
@@ -4054,9 +4136,9 @@ function Stack({
|
|
|
4054
4136
|
function Separator({ orientation = "horizontal", label, spacing = "none", className }) {
|
|
4055
4137
|
const margin2 = orientation === "horizontal" ? `${space(spacing)} 0` : `0 ${space(spacing)}`;
|
|
4056
4138
|
if (label && orientation === "horizontal") {
|
|
4057
|
-
return /* @__PURE__ */
|
|
4139
|
+
return /* @__PURE__ */ jsx50("div", { role: "separator", className: cx("ow-separator-label", className), style: { margin: margin2 }, children: /* @__PURE__ */ jsx50("span", { className: "ow-separator-label__text", children: label }) });
|
|
4058
4140
|
}
|
|
4059
|
-
return /* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ jsx50(
|
|
4060
4142
|
"div",
|
|
4061
4143
|
{
|
|
4062
4144
|
role: "separator",
|
|
@@ -4096,7 +4178,7 @@ function ScrollShadow({
|
|
|
4096
4178
|
observer?.disconnect();
|
|
4097
4179
|
};
|
|
4098
4180
|
}, [orientation]);
|
|
4099
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ jsx50(
|
|
4100
4182
|
"div",
|
|
4101
4183
|
{
|
|
4102
4184
|
ref,
|
|
@@ -4117,14 +4199,14 @@ function ScrollShadow({
|
|
|
4117
4199
|
);
|
|
4118
4200
|
}
|
|
4119
4201
|
function VisuallyHidden({ className, ...props }) {
|
|
4120
|
-
return /* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ jsx50("span", { className: cx("ow-visually-hidden", className), ...props });
|
|
4121
4203
|
}
|
|
4122
4204
|
|
|
4123
4205
|
// src/components/Marketing/Marketing.tsx
|
|
4124
4206
|
import { useRef as useRef23 } from "react";
|
|
4125
|
-
import { jsx as
|
|
4207
|
+
import { jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4126
4208
|
function Chip({ className, ...props }) {
|
|
4127
|
-
return /* @__PURE__ */
|
|
4209
|
+
return /* @__PURE__ */ jsx51("span", { className: cx("ow-chip", className), ...props });
|
|
4128
4210
|
}
|
|
4129
4211
|
function SectionHeading({
|
|
4130
4212
|
eyebrow,
|
|
@@ -4135,16 +4217,16 @@ function SectionHeading({
|
|
|
4135
4217
|
className
|
|
4136
4218
|
}) {
|
|
4137
4219
|
return /* @__PURE__ */ jsxs41("div", { className: cx("ow-section-heading", align === "center" && "ow-section-heading--center", className), children: [
|
|
4138
|
-
eyebrow ? /* @__PURE__ */
|
|
4139
|
-
/* @__PURE__ */
|
|
4140
|
-
intro ? /* @__PURE__ */
|
|
4220
|
+
eyebrow ? /* @__PURE__ */ jsx51(Chip, { children: eyebrow }) : null,
|
|
4221
|
+
/* @__PURE__ */ jsx51(Heading, { className: "ow-section-heading__title", children: title }),
|
|
4222
|
+
intro ? /* @__PURE__ */ jsx51("p", { className: "ow-section-heading__intro", children: intro }) : null
|
|
4141
4223
|
] });
|
|
4142
4224
|
}
|
|
4143
4225
|
function SiteHeader({ brand, nav, actions, className }) {
|
|
4144
4226
|
return /* @__PURE__ */ jsxs41("header", { className: cx("ow-site-header", className), children: [
|
|
4145
|
-
/* @__PURE__ */
|
|
4146
|
-
nav ? /* @__PURE__ */
|
|
4147
|
-
actions ? /* @__PURE__ */
|
|
4227
|
+
/* @__PURE__ */ jsx51("div", { className: "ow-site-header__brand", children: brand }),
|
|
4228
|
+
nav ? /* @__PURE__ */ jsx51("nav", { className: "ow-site-header__nav", children: nav }) : null,
|
|
4229
|
+
actions ? /* @__PURE__ */ jsx51("div", { className: "ow-site-header__actions", children: actions }) : null
|
|
4148
4230
|
] });
|
|
4149
4231
|
}
|
|
4150
4232
|
function DotGrid({ fade = false, interactive = false, className, children, onPointerMove, ...props }) {
|
|
@@ -4165,9 +4247,9 @@ function DotGrid({ fade = false, interactive = false, className, children, onPoi
|
|
|
4165
4247
|
onPointerMove: track,
|
|
4166
4248
|
...props,
|
|
4167
4249
|
children: [
|
|
4168
|
-
/* @__PURE__ */
|
|
4169
|
-
interactive ? /* @__PURE__ */
|
|
4170
|
-
/* @__PURE__ */
|
|
4250
|
+
/* @__PURE__ */ jsx51("span", { className: "ow-dot-grid__dots", "aria-hidden": "true" }),
|
|
4251
|
+
interactive ? /* @__PURE__ */ jsx51("span", { className: "ow-dot-grid__brass", "aria-hidden": "true" }) : null,
|
|
4252
|
+
/* @__PURE__ */ jsx51("div", { className: "ow-dot-grid__content", children })
|
|
4171
4253
|
]
|
|
4172
4254
|
}
|
|
4173
4255
|
);
|
|
@@ -4176,7 +4258,7 @@ function DotGrid({ fade = false, interactive = false, className, children, onPoi
|
|
|
4176
4258
|
// src/components/ColorPicker/ColorPicker.tsx
|
|
4177
4259
|
import { forwardRef as forwardRef16, useCallback as useCallback6, useEffect as useEffect18, useId as useId18, useRef as useRef24, useState as useState20 } from "react";
|
|
4178
4260
|
import { HexAlphaColorPicker, HexColorInput, HexColorPicker } from "react-colorful";
|
|
4179
|
-
import { Fragment as Fragment9, jsx as
|
|
4261
|
+
import { Fragment as Fragment9, jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4180
4262
|
var swatchColor = (swatch) => typeof swatch === "string" ? swatch : swatch.color;
|
|
4181
4263
|
var swatchName = (swatch) => typeof swatch === "string" ? swatch : swatch.name;
|
|
4182
4264
|
var same = (a, b) => a.toLowerCase().replace(/^#/, "") === b.toLowerCase().replace(/^#/, "");
|
|
@@ -4212,12 +4294,12 @@ function ColorPicker({
|
|
|
4212
4294
|
}
|
|
4213
4295
|
}
|
|
4214
4296
|
return /* @__PURE__ */ jsxs42("div", { ref: rootRef, role: "group", "aria-label": ariaLabel, className: cx("ow-color-picker", className), children: [
|
|
4215
|
-
/* @__PURE__ */
|
|
4297
|
+
/* @__PURE__ */ jsx52(Picker, { color, onChange: change }),
|
|
4216
4298
|
showInput || eyeDropper && canPick ? /* @__PURE__ */ jsxs42("div", { className: "ow-color-picker__row", children: [
|
|
4217
|
-
eyeDropper && canPick ? /* @__PURE__ */
|
|
4299
|
+
eyeDropper && canPick ? /* @__PURE__ */ jsx52("button", { type: "button", className: "ow-color-picker__dropper", "aria-label": "Pick a colour from the screen", onClick: pickFromScreen, children: /* @__PURE__ */ jsx52(PipetteIcon, { size: 15 }) }) : null,
|
|
4218
4300
|
showInput ? /* @__PURE__ */ jsxs42("span", { className: "ow-input-group ow-input-group--sm ow-color-picker__input", children: [
|
|
4219
|
-
/* @__PURE__ */
|
|
4220
|
-
/* @__PURE__ */
|
|
4301
|
+
/* @__PURE__ */ jsx52("span", { className: "ow-input-group__addon", "aria-hidden": "true", children: "#" }),
|
|
4302
|
+
/* @__PURE__ */ jsx52(
|
|
4221
4303
|
HexColorInput,
|
|
4222
4304
|
{
|
|
4223
4305
|
className: "ow-input-group__input",
|
|
@@ -4229,11 +4311,11 @@ function ColorPicker({
|
|
|
4229
4311
|
}
|
|
4230
4312
|
)
|
|
4231
4313
|
] }) : null,
|
|
4232
|
-
/* @__PURE__ */
|
|
4314
|
+
/* @__PURE__ */ jsx52("span", { className: "ow-color-picker__preview", style: { "--ow-color-picker-value": color }, "aria-hidden": "true" })
|
|
4233
4315
|
] }) : null,
|
|
4234
|
-
swatches?.length ? /* @__PURE__ */
|
|
4316
|
+
swatches?.length ? /* @__PURE__ */ jsx52("div", { className: "ow-color-picker__swatches", role: "group", "aria-label": "Swatches", children: swatches.map((swatch) => {
|
|
4235
4317
|
const swatchValue = swatchColor(swatch);
|
|
4236
|
-
return /* @__PURE__ */
|
|
4318
|
+
return /* @__PURE__ */ jsx52(
|
|
4237
4319
|
"button",
|
|
4238
4320
|
{
|
|
4239
4321
|
type: "button",
|
|
@@ -4318,13 +4400,13 @@ var ColorField = forwardRef16(function ColorField2({
|
|
|
4318
4400
|
}
|
|
4319
4401
|
},
|
|
4320
4402
|
children: [
|
|
4321
|
-
/* @__PURE__ */
|
|
4322
|
-
/* @__PURE__ */
|
|
4323
|
-
/* @__PURE__ */
|
|
4403
|
+
/* @__PURE__ */ jsx52("span", { className: "ow-color-field__swatch", style: { "--ow-color-picker-value": color }, "aria-hidden": "true" }),
|
|
4404
|
+
/* @__PURE__ */ jsx52("span", { id: `${panelId}-value`, className: "ow-select__value ow-color-field__value", children: color.toUpperCase() }),
|
|
4405
|
+
/* @__PURE__ */ jsx52(ChevronDownIcon, { size: size === "sm" ? 14 : 16, className: "ow-select__chevron" })
|
|
4324
4406
|
]
|
|
4325
4407
|
}
|
|
4326
4408
|
),
|
|
4327
|
-
mounted ? /* @__PURE__ */
|
|
4409
|
+
mounted ? /* @__PURE__ */ jsx52(
|
|
4328
4410
|
"div",
|
|
4329
4411
|
{
|
|
4330
4412
|
ref: panelRef,
|
|
@@ -4338,7 +4420,7 @@ var ColorField = forwardRef16(function ColorField2({
|
|
|
4338
4420
|
onKeyDown: (event) => {
|
|
4339
4421
|
if (event.key === "Enter" && event.target.closest(".react-colorful")) close();
|
|
4340
4422
|
},
|
|
4341
|
-
children: /* @__PURE__ */
|
|
4423
|
+
children: /* @__PURE__ */ jsx52(ColorPicker, { ...pickerProps, value: color, onChange: setColor })
|
|
4342
4424
|
}
|
|
4343
4425
|
) : null
|
|
4344
4426
|
] });
|
|
@@ -4613,6 +4695,7 @@ export {
|
|
|
4613
4695
|
Tabs,
|
|
4614
4696
|
Tag,
|
|
4615
4697
|
TagGroup,
|
|
4698
|
+
Text,
|
|
4616
4699
|
Textarea,
|
|
4617
4700
|
Toaster,
|
|
4618
4701
|
ToggleButton,
|