@deriv-web-design/ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1304 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +231 -0
- package/dist/index.d.ts +231 -0
- package/dist/index.js +1000 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +963 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
- package/tokens.css +348 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,963 @@
|
|
|
1
|
+
// primitives/Button/Button.module.css
|
|
2
|
+
var Button_default = {};
|
|
3
|
+
|
|
4
|
+
// primitives/Button/Button.tsx
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var Button = ({
|
|
7
|
+
colorScheme = "coral",
|
|
8
|
+
variant = "primary",
|
|
9
|
+
iconPosition = "none",
|
|
10
|
+
icon,
|
|
11
|
+
label,
|
|
12
|
+
fullWidth = false,
|
|
13
|
+
showFocusRing = false,
|
|
14
|
+
children,
|
|
15
|
+
disabled,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}) => {
|
|
19
|
+
const isIconOnly = iconPosition === "icon-only";
|
|
20
|
+
const classNames = [
|
|
21
|
+
Button_default.button,
|
|
22
|
+
Button_default[`${colorScheme}_${variant}`],
|
|
23
|
+
isIconOnly ? Button_default.iconOnly : "",
|
|
24
|
+
fullWidth ? Button_default.fullWidth : "",
|
|
25
|
+
className ?? ""
|
|
26
|
+
].filter(Boolean).join(" ");
|
|
27
|
+
const iconNode = icon ? /* @__PURE__ */ jsx("span", { className: Button_default.icon, children: icon }) : null;
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
29
|
+
"button",
|
|
30
|
+
{
|
|
31
|
+
className: classNames,
|
|
32
|
+
disabled,
|
|
33
|
+
"aria-label": isIconOnly && label ? label : void 0,
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
iconPosition === "icon-left" && iconNode,
|
|
37
|
+
!isIconOnly && /* @__PURE__ */ jsx("span", { className: Button_default.label, children: label ?? children }),
|
|
38
|
+
iconPosition === "icon-only" && iconNode,
|
|
39
|
+
iconPosition === "icon-right" && iconNode,
|
|
40
|
+
showFocusRing && /* @__PURE__ */ jsx("span", { className: Button_default.focusRing, "aria-hidden": "true" })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// primitives/Link/Link.module.css
|
|
47
|
+
var Link_default = {};
|
|
48
|
+
|
|
49
|
+
// primitives/Link/Link.tsx
|
|
50
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
51
|
+
var ChevronIcon = () => /* @__PURE__ */ jsx2("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("path", { d: "M3 8h10M9 4l4 4-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
52
|
+
var Link = ({
|
|
53
|
+
colorScheme = "coral",
|
|
54
|
+
label,
|
|
55
|
+
icon,
|
|
56
|
+
showChevron = true,
|
|
57
|
+
disabled = false,
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
onClick,
|
|
61
|
+
...props
|
|
62
|
+
}) => {
|
|
63
|
+
const hasIcon = !!icon;
|
|
64
|
+
const classNames = [
|
|
65
|
+
Link_default.link,
|
|
66
|
+
Link_default[colorScheme],
|
|
67
|
+
hasIcon ? Link_default.withIcon : Link_default.withChevron,
|
|
68
|
+
disabled ? Link_default.disabled : "",
|
|
69
|
+
className ?? ""
|
|
70
|
+
].filter(Boolean).join(" ");
|
|
71
|
+
const handleClick = (e) => {
|
|
72
|
+
if (disabled) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
onClick?.(e);
|
|
77
|
+
};
|
|
78
|
+
return /* @__PURE__ */ jsxs2(
|
|
79
|
+
"a",
|
|
80
|
+
{
|
|
81
|
+
className: classNames,
|
|
82
|
+
"aria-disabled": disabled || void 0,
|
|
83
|
+
tabIndex: disabled ? -1 : void 0,
|
|
84
|
+
onClick: handleClick,
|
|
85
|
+
...props,
|
|
86
|
+
children: [
|
|
87
|
+
hasIcon && /* @__PURE__ */ jsx2("span", { className: Link_default.icon, children: icon }),
|
|
88
|
+
/* @__PURE__ */ jsx2("span", { className: Link_default.label, children: label ?? children }),
|
|
89
|
+
!hasIcon && showChevron && /* @__PURE__ */ jsx2("span", { className: Link_default.chevron, "aria-hidden": "true", children: /* @__PURE__ */ jsx2(ChevronIcon, {}) })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// primitives/Chip/Chip.module.css
|
|
96
|
+
var Chip_default = {};
|
|
97
|
+
|
|
98
|
+
// primitives/Chip/Chip.tsx
|
|
99
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
100
|
+
var Chip = ({
|
|
101
|
+
size = "md",
|
|
102
|
+
label,
|
|
103
|
+
icon,
|
|
104
|
+
tag,
|
|
105
|
+
selected = false,
|
|
106
|
+
showFocusRing = false,
|
|
107
|
+
disabled = false,
|
|
108
|
+
children,
|
|
109
|
+
className,
|
|
110
|
+
...props
|
|
111
|
+
}) => {
|
|
112
|
+
const classNames = [
|
|
113
|
+
Chip_default.chip,
|
|
114
|
+
Chip_default[size],
|
|
115
|
+
selected ? Chip_default.selected : "",
|
|
116
|
+
className ?? ""
|
|
117
|
+
].filter(Boolean).join(" ");
|
|
118
|
+
return /* @__PURE__ */ jsxs3(
|
|
119
|
+
"button",
|
|
120
|
+
{
|
|
121
|
+
className: classNames,
|
|
122
|
+
disabled,
|
|
123
|
+
"aria-pressed": selected,
|
|
124
|
+
...props,
|
|
125
|
+
children: [
|
|
126
|
+
icon && /* @__PURE__ */ jsx3("span", { className: Chip_default.icon, children: icon }),
|
|
127
|
+
/* @__PURE__ */ jsx3("span", { className: Chip_default.label, children: label ?? children }),
|
|
128
|
+
tag && /* @__PURE__ */ jsx3("span", { className: Chip_default.tag, children: tag }),
|
|
129
|
+
showFocusRing && /* @__PURE__ */ jsx3("span", { className: Chip_default.focusRing, "aria-hidden": "true" })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// primitives/Tag/Tag.module.css
|
|
136
|
+
var Tag_default = {};
|
|
137
|
+
|
|
138
|
+
// primitives/Tag/Tag.tsx
|
|
139
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
140
|
+
var Tag = ({
|
|
141
|
+
size = "sm",
|
|
142
|
+
variant = "fill",
|
|
143
|
+
fontWeight = "regular",
|
|
144
|
+
label,
|
|
145
|
+
icon,
|
|
146
|
+
children,
|
|
147
|
+
className,
|
|
148
|
+
...props
|
|
149
|
+
}) => {
|
|
150
|
+
const classNames = [
|
|
151
|
+
Tag_default.tag,
|
|
152
|
+
Tag_default[size],
|
|
153
|
+
Tag_default[variant],
|
|
154
|
+
Tag_default[fontWeight],
|
|
155
|
+
className ?? ""
|
|
156
|
+
].filter(Boolean).join(" ");
|
|
157
|
+
return /* @__PURE__ */ jsxs4("span", { className: classNames, ...props, children: [
|
|
158
|
+
icon && /* @__PURE__ */ jsx4("span", { className: Tag_default.icon, children: icon }),
|
|
159
|
+
/* @__PURE__ */ jsx4("span", { className: Tag_default.label, children: label ?? children })
|
|
160
|
+
] });
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// primitives/Accordion/Accordion.tsx
|
|
164
|
+
import { useState } from "react";
|
|
165
|
+
|
|
166
|
+
// primitives/Accordion/Accordion.module.css
|
|
167
|
+
var Accordion_default = {};
|
|
168
|
+
|
|
169
|
+
// primitives/Accordion/Accordion.tsx
|
|
170
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
171
|
+
var ChevronIcon2 = () => /* @__PURE__ */ jsx5("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
172
|
+
var Accordion = ({
|
|
173
|
+
title,
|
|
174
|
+
children,
|
|
175
|
+
open,
|
|
176
|
+
defaultOpen = false,
|
|
177
|
+
onToggle,
|
|
178
|
+
showTopDivider = true,
|
|
179
|
+
showBottomDivider = true,
|
|
180
|
+
showFocusRing = false,
|
|
181
|
+
className
|
|
182
|
+
}) => {
|
|
183
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
184
|
+
const isControlled = open !== void 0;
|
|
185
|
+
const isOpen = isControlled ? open : internalOpen;
|
|
186
|
+
const handleToggle = () => {
|
|
187
|
+
const next = !isOpen;
|
|
188
|
+
if (!isControlled) setInternalOpen(next);
|
|
189
|
+
onToggle?.(next);
|
|
190
|
+
};
|
|
191
|
+
const classNames = [Accordion_default.accordion, className ?? ""].filter(Boolean).join(" ");
|
|
192
|
+
return /* @__PURE__ */ jsxs5(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
className: classNames,
|
|
196
|
+
style: {
|
|
197
|
+
borderTop: showTopDivider ? `1px solid var(--accordion-divider-color)` : void 0,
|
|
198
|
+
borderBottom: showBottomDivider ? `1px solid var(--accordion-divider-color)` : void 0
|
|
199
|
+
},
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ jsxs5(
|
|
202
|
+
"button",
|
|
203
|
+
{
|
|
204
|
+
className: Accordion_default.header,
|
|
205
|
+
onClick: handleToggle,
|
|
206
|
+
"aria-expanded": isOpen,
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx5("span", { className: Accordion_default.titleWrapper, children: /* @__PURE__ */ jsx5("span", { className: Accordion_default.title, children: title }) }),
|
|
209
|
+
/* @__PURE__ */ jsx5("span", { className: [Accordion_default.chevron, isOpen ? Accordion_default.chevronRotated : ""].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx5(ChevronIcon2, {}) }),
|
|
210
|
+
showFocusRing && /* @__PURE__ */ jsx5("span", { className: Accordion_default.focusRing, "aria-hidden": "true" })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
/* @__PURE__ */ jsx5("div", { className: [Accordion_default.bodyWrapper, isOpen ? Accordion_default.bodyWrapperOpen : ""].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx5("div", { className: Accordion_default.bodyInner, children: /* @__PURE__ */ jsx5("div", { className: Accordion_default.body, children }) }) })
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// primitives/TextField/TextField.tsx
|
|
221
|
+
import { forwardRef } from "react";
|
|
222
|
+
|
|
223
|
+
// primitives/TextField/TextField.module.css
|
|
224
|
+
var TextField_default = {};
|
|
225
|
+
|
|
226
|
+
// primitives/TextField/TextField.tsx
|
|
227
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
228
|
+
var SuccessIcon = () => /* @__PURE__ */ jsxs6("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
229
|
+
/* @__PURE__ */ jsx6("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
230
|
+
/* @__PURE__ */ jsx6("path", { d: "M5.5 8l2 2 3-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
231
|
+
] });
|
|
232
|
+
var FailIcon = () => /* @__PURE__ */ jsxs6("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
233
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 2.5L14 13.5H2L8 2.5Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }),
|
|
234
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 6.5v3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
235
|
+
/* @__PURE__ */ jsx6("circle", { cx: "8", cy: "11.5", r: "0.75", fill: "currentColor" })
|
|
236
|
+
] });
|
|
237
|
+
var TextField = forwardRef(
|
|
238
|
+
({
|
|
239
|
+
variant = "outline",
|
|
240
|
+
status = "neutral",
|
|
241
|
+
disabled,
|
|
242
|
+
className,
|
|
243
|
+
...inputProps
|
|
244
|
+
}, ref) => {
|
|
245
|
+
const wrapperClass = [
|
|
246
|
+
TextField_default.wrapper,
|
|
247
|
+
TextField_default[variant],
|
|
248
|
+
TextField_default[status],
|
|
249
|
+
className ?? ""
|
|
250
|
+
].filter(Boolean).join(" ");
|
|
251
|
+
return /* @__PURE__ */ jsxs6("div", { className: wrapperClass, "data-disabled": disabled || void 0, children: [
|
|
252
|
+
/* @__PURE__ */ jsx6(
|
|
253
|
+
"input",
|
|
254
|
+
{
|
|
255
|
+
ref,
|
|
256
|
+
className: TextField_default.input,
|
|
257
|
+
disabled,
|
|
258
|
+
...inputProps
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
status === "success" && /* @__PURE__ */ jsx6("span", { className: [TextField_default.iconSlot, TextField_default.iconSuccess].join(" "), children: /* @__PURE__ */ jsx6(SuccessIcon, {}) }),
|
|
262
|
+
status === "fail" && /* @__PURE__ */ jsx6("span", { className: [TextField_default.iconSlot, TextField_default.iconFail].join(" "), children: /* @__PURE__ */ jsx6(FailIcon, {}) })
|
|
263
|
+
] });
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
TextField.displayName = "TextField";
|
|
267
|
+
|
|
268
|
+
// primitives/SearchField/SearchField.tsx
|
|
269
|
+
import { forwardRef as forwardRef2, useRef, useState as useState2, useCallback } from "react";
|
|
270
|
+
|
|
271
|
+
// primitives/SearchField/SearchField.module.css
|
|
272
|
+
var SearchField_default = {};
|
|
273
|
+
|
|
274
|
+
// primitives/SearchField/SearchField.tsx
|
|
275
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
276
|
+
var SearchIcon = () => /* @__PURE__ */ jsxs7("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
277
|
+
/* @__PURE__ */ jsx7("circle", { cx: "6.5", cy: "6.5", r: "4", stroke: "currentColor", strokeWidth: "1.25" }),
|
|
278
|
+
/* @__PURE__ */ jsx7("path", { d: "M9.5 9.5L13 13", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round" })
|
|
279
|
+
] });
|
|
280
|
+
var ClearIcon = () => /* @__PURE__ */ jsxs7("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
281
|
+
/* @__PURE__ */ jsx7("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeWidth: "1.25" }),
|
|
282
|
+
/* @__PURE__ */ jsx7("path", { d: "M6 6l4 4M10 6l-4 4", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round" })
|
|
283
|
+
] });
|
|
284
|
+
var SuccessIcon2 = () => /* @__PURE__ */ jsxs7("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
285
|
+
/* @__PURE__ */ jsx7("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
286
|
+
/* @__PURE__ */ jsx7("path", { d: "M5.5 8l2 2 3-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
287
|
+
] });
|
|
288
|
+
var FailIcon2 = () => /* @__PURE__ */ jsxs7("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
289
|
+
/* @__PURE__ */ jsx7("path", { d: "M8 2.5L14 13.5H2L8 2.5Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }),
|
|
290
|
+
/* @__PURE__ */ jsx7("path", { d: "M8 6.5v3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
291
|
+
/* @__PURE__ */ jsx7("circle", { cx: "8", cy: "11.5", r: "0.75", fill: "currentColor" })
|
|
292
|
+
] });
|
|
293
|
+
var SearchField = forwardRef2(
|
|
294
|
+
({
|
|
295
|
+
status = "neutral",
|
|
296
|
+
value,
|
|
297
|
+
defaultValue,
|
|
298
|
+
onChange,
|
|
299
|
+
onClear,
|
|
300
|
+
disabled,
|
|
301
|
+
className,
|
|
302
|
+
...inputProps
|
|
303
|
+
}, ref) => {
|
|
304
|
+
const innerRef = useRef(null);
|
|
305
|
+
const setRef = useCallback(
|
|
306
|
+
(node) => {
|
|
307
|
+
innerRef.current = node;
|
|
308
|
+
if (typeof ref === "function") {
|
|
309
|
+
ref(node);
|
|
310
|
+
} else if (ref) {
|
|
311
|
+
ref.current = node;
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
[ref]
|
|
315
|
+
);
|
|
316
|
+
const isControlled = value !== void 0;
|
|
317
|
+
const [internalHasValue, setInternalHasValue] = useState2(
|
|
318
|
+
Boolean(defaultValue)
|
|
319
|
+
);
|
|
320
|
+
const hasValue = isControlled ? Boolean(value) : internalHasValue;
|
|
321
|
+
const handleChange = (e) => {
|
|
322
|
+
if (!isControlled) {
|
|
323
|
+
setInternalHasValue(Boolean(e.target.value));
|
|
324
|
+
}
|
|
325
|
+
onChange?.(e);
|
|
326
|
+
};
|
|
327
|
+
const handleClear = () => {
|
|
328
|
+
if (!isControlled && innerRef.current) {
|
|
329
|
+
innerRef.current.value = "";
|
|
330
|
+
setInternalHasValue(false);
|
|
331
|
+
}
|
|
332
|
+
onClear?.();
|
|
333
|
+
innerRef.current?.focus();
|
|
334
|
+
};
|
|
335
|
+
const showFailIcon = status === "fail" && !disabled;
|
|
336
|
+
const showSuccessIcon = status === "success" && hasValue && !disabled;
|
|
337
|
+
const showClearButton = hasValue && !disabled;
|
|
338
|
+
const wrapperClass = [
|
|
339
|
+
SearchField_default.wrapper,
|
|
340
|
+
SearchField_default[status],
|
|
341
|
+
className ?? ""
|
|
342
|
+
].filter(Boolean).join(" ");
|
|
343
|
+
return /* @__PURE__ */ jsxs7(
|
|
344
|
+
"div",
|
|
345
|
+
{
|
|
346
|
+
className: wrapperClass,
|
|
347
|
+
"data-disabled": disabled || void 0,
|
|
348
|
+
children: [
|
|
349
|
+
/* @__PURE__ */ jsx7("span", { className: SearchField_default.iconSlot, children: /* @__PURE__ */ jsx7(SearchIcon, {}) }),
|
|
350
|
+
/* @__PURE__ */ jsx7(
|
|
351
|
+
"input",
|
|
352
|
+
{
|
|
353
|
+
ref: setRef,
|
|
354
|
+
className: SearchField_default.input,
|
|
355
|
+
disabled,
|
|
356
|
+
value,
|
|
357
|
+
defaultValue,
|
|
358
|
+
onChange: handleChange,
|
|
359
|
+
...inputProps
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
showSuccessIcon && /* @__PURE__ */ jsx7("span", { className: [SearchField_default.iconSlot, SearchField_default.iconSuccess].join(" "), children: /* @__PURE__ */ jsx7(SuccessIcon2, {}) }),
|
|
363
|
+
showFailIcon && /* @__PURE__ */ jsx7("span", { className: [SearchField_default.iconSlot, SearchField_default.iconFail].join(" "), children: /* @__PURE__ */ jsx7(FailIcon2, {}) }),
|
|
364
|
+
showClearButton && /* @__PURE__ */ jsx7(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
type: "button",
|
|
368
|
+
className: SearchField_default.clearButton,
|
|
369
|
+
onClick: handleClear,
|
|
370
|
+
"aria-label": "Clear search",
|
|
371
|
+
tabIndex: -1,
|
|
372
|
+
children: /* @__PURE__ */ jsx7(ClearIcon, {})
|
|
373
|
+
}
|
|
374
|
+
)
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
SearchField.displayName = "SearchField";
|
|
381
|
+
|
|
382
|
+
// primitives/Breadcrumb/Breadcrumb.tsx
|
|
383
|
+
import { useState as useState3 } from "react";
|
|
384
|
+
|
|
385
|
+
// primitives/Breadcrumb/Breadcrumb.module.css
|
|
386
|
+
var Breadcrumb_default = {};
|
|
387
|
+
|
|
388
|
+
// primitives/Breadcrumb/Breadcrumb.tsx
|
|
389
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
390
|
+
var ChevronRightIcon = () => /* @__PURE__ */ jsx8(
|
|
391
|
+
"svg",
|
|
392
|
+
{
|
|
393
|
+
width: "1em",
|
|
394
|
+
height: "1em",
|
|
395
|
+
viewBox: "0 0 16 16",
|
|
396
|
+
fill: "none",
|
|
397
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
398
|
+
"aria-hidden": "true",
|
|
399
|
+
children: /* @__PURE__ */ jsx8(
|
|
400
|
+
"path",
|
|
401
|
+
{
|
|
402
|
+
d: "M6 3.5L10.5 8L6 12.5",
|
|
403
|
+
stroke: "currentColor",
|
|
404
|
+
strokeWidth: "1",
|
|
405
|
+
strokeLinecap: "round",
|
|
406
|
+
strokeLinejoin: "round"
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
}
|
|
410
|
+
);
|
|
411
|
+
function BreadcrumbLink({ item }) {
|
|
412
|
+
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
413
|
+
/* @__PURE__ */ jsx8("a", { href: item.href, onClick: item.onClick, className: Breadcrumb_default.link, children: item.label }),
|
|
414
|
+
/* @__PURE__ */ jsx8("span", { className: Breadcrumb_default.separator, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(ChevronRightIcon, {}) })
|
|
415
|
+
] });
|
|
416
|
+
}
|
|
417
|
+
function Breadcrumb({
|
|
418
|
+
items,
|
|
419
|
+
size = "md",
|
|
420
|
+
collapsible = true,
|
|
421
|
+
className,
|
|
422
|
+
...navProps
|
|
423
|
+
}) {
|
|
424
|
+
const [expanded, setExpanded] = useState3(false);
|
|
425
|
+
const truncatable = collapsible && items.length > 3;
|
|
426
|
+
const listClass = [
|
|
427
|
+
Breadcrumb_default.list,
|
|
428
|
+
Breadcrumb_default[size],
|
|
429
|
+
truncatable ? Breadcrumb_default.collapsible : "",
|
|
430
|
+
truncatable && expanded ? Breadcrumb_default.expanded : ""
|
|
431
|
+
].filter(Boolean).join(" ");
|
|
432
|
+
if (!truncatable) {
|
|
433
|
+
return /* @__PURE__ */ jsx8("nav", { "aria-label": "Breadcrumb", className, ...navProps, children: /* @__PURE__ */ jsx8("ol", { className: listClass, children: items.map((item, index) => {
|
|
434
|
+
const isLast = index === items.length - 1;
|
|
435
|
+
return /* @__PURE__ */ jsx8("li", { className: Breadcrumb_default.item, children: isLast ? /* @__PURE__ */ jsx8("span", { className: Breadcrumb_default.current, "aria-current": "page", children: item.label }) : /* @__PURE__ */ jsx8(BreadcrumbLink, { item }) }, index);
|
|
436
|
+
}) }) });
|
|
437
|
+
}
|
|
438
|
+
const firstItem = items[0];
|
|
439
|
+
const middleItems = items.slice(1, items.length - 2);
|
|
440
|
+
const parentItem = items[items.length - 2];
|
|
441
|
+
const currentItem = items[items.length - 1];
|
|
442
|
+
return /* @__PURE__ */ jsx8("nav", { "aria-label": "Breadcrumb", className, ...navProps, children: /* @__PURE__ */ jsxs8("ol", { className: listClass, children: [
|
|
443
|
+
/* @__PURE__ */ jsx8("li", { className: Breadcrumb_default.item, children: /* @__PURE__ */ jsx8(BreadcrumbLink, { item: firstItem }) }),
|
|
444
|
+
/* @__PURE__ */ jsxs8("li", { className: Breadcrumb_default.ellipsisItem, "aria-hidden": expanded, children: [
|
|
445
|
+
/* @__PURE__ */ jsx8(
|
|
446
|
+
"button",
|
|
447
|
+
{
|
|
448
|
+
className: Breadcrumb_default.ellipsisButton,
|
|
449
|
+
onClick: () => setExpanded(true),
|
|
450
|
+
"aria-label": "Show all breadcrumb items",
|
|
451
|
+
children: "\u2026"
|
|
452
|
+
}
|
|
453
|
+
),
|
|
454
|
+
/* @__PURE__ */ jsx8("span", { className: Breadcrumb_default.separator, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(ChevronRightIcon, {}) })
|
|
455
|
+
] }),
|
|
456
|
+
middleItems.map((item, index) => /* @__PURE__ */ jsx8("li", { className: Breadcrumb_default.middleItem, children: /* @__PURE__ */ jsx8(BreadcrumbLink, { item }) }, `m-${index}`)),
|
|
457
|
+
/* @__PURE__ */ jsx8("li", { className: Breadcrumb_default.item, children: /* @__PURE__ */ jsx8(BreadcrumbLink, { item: parentItem }) }),
|
|
458
|
+
/* @__PURE__ */ jsx8("li", { className: Breadcrumb_default.item, children: /* @__PURE__ */ jsx8("span", { className: Breadcrumb_default.current, "aria-current": "page", children: currentItem.label }) })
|
|
459
|
+
] }) });
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// primitives/ChipDropdown/ChipDropdown.tsx
|
|
463
|
+
import { useEffect, useRef as useRef2, useState as useState4 } from "react";
|
|
464
|
+
|
|
465
|
+
// primitives/ChipDropdown/ChipDropdown.module.css
|
|
466
|
+
var ChipDropdown_default = {};
|
|
467
|
+
|
|
468
|
+
// primitives/ChipDropdown/ChipDropdown.tsx
|
|
469
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
470
|
+
var ChevronDownIcon = () => /* @__PURE__ */ jsx9(
|
|
471
|
+
"svg",
|
|
472
|
+
{
|
|
473
|
+
width: "16",
|
|
474
|
+
height: "16",
|
|
475
|
+
viewBox: "0 0 16 16",
|
|
476
|
+
fill: "none",
|
|
477
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
478
|
+
"aria-hidden": "true",
|
|
479
|
+
children: /* @__PURE__ */ jsx9(
|
|
480
|
+
"path",
|
|
481
|
+
{
|
|
482
|
+
d: "M3 6l5 5 5-5",
|
|
483
|
+
stroke: "currentColor",
|
|
484
|
+
strokeWidth: "1.5",
|
|
485
|
+
strokeLinecap: "round",
|
|
486
|
+
strokeLinejoin: "round"
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
}
|
|
490
|
+
);
|
|
491
|
+
var CheckIcon = () => /* @__PURE__ */ jsx9(
|
|
492
|
+
"svg",
|
|
493
|
+
{
|
|
494
|
+
width: "12",
|
|
495
|
+
height: "12",
|
|
496
|
+
viewBox: "0 0 12 12",
|
|
497
|
+
fill: "none",
|
|
498
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
499
|
+
"aria-hidden": "true",
|
|
500
|
+
children: /* @__PURE__ */ jsx9(
|
|
501
|
+
"path",
|
|
502
|
+
{
|
|
503
|
+
d: "M2 6l3 3 5-5",
|
|
504
|
+
stroke: "currentColor",
|
|
505
|
+
strokeWidth: "1.5",
|
|
506
|
+
strokeLinecap: "round",
|
|
507
|
+
strokeLinejoin: "round"
|
|
508
|
+
}
|
|
509
|
+
)
|
|
510
|
+
}
|
|
511
|
+
);
|
|
512
|
+
var ChipDropdown = ({
|
|
513
|
+
size = "md",
|
|
514
|
+
label,
|
|
515
|
+
tag,
|
|
516
|
+
icon,
|
|
517
|
+
options,
|
|
518
|
+
value,
|
|
519
|
+
onChange,
|
|
520
|
+
disabled = false,
|
|
521
|
+
className,
|
|
522
|
+
...props
|
|
523
|
+
}) => {
|
|
524
|
+
const [open, setOpen] = useState4(false);
|
|
525
|
+
const wrapperRef = useRef2(null);
|
|
526
|
+
const selectedOption = options.find((o) => o.value === value) ?? null;
|
|
527
|
+
const displayLabel = selectedOption ? selectedOption.label : label;
|
|
528
|
+
const isSelected = selectedOption !== null;
|
|
529
|
+
useEffect(() => {
|
|
530
|
+
if (!open) return;
|
|
531
|
+
const handleClickOutside = (e) => {
|
|
532
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
533
|
+
setOpen(false);
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
537
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
538
|
+
}, [open]);
|
|
539
|
+
const triggerClassNames = [
|
|
540
|
+
ChipDropdown_default.trigger,
|
|
541
|
+
ChipDropdown_default[size],
|
|
542
|
+
isSelected ? ChipDropdown_default.selected : "",
|
|
543
|
+
open ? ChipDropdown_default.expand : "",
|
|
544
|
+
className ?? ""
|
|
545
|
+
].filter(Boolean).join(" ");
|
|
546
|
+
const handleKeyDown = (e) => {
|
|
547
|
+
if (e.key === "Escape") setOpen(false);
|
|
548
|
+
};
|
|
549
|
+
return /* @__PURE__ */ jsxs9("div", { ref: wrapperRef, className: ChipDropdown_default.wrapper, children: [
|
|
550
|
+
/* @__PURE__ */ jsxs9(
|
|
551
|
+
"button",
|
|
552
|
+
{
|
|
553
|
+
type: "button",
|
|
554
|
+
className: triggerClassNames,
|
|
555
|
+
disabled,
|
|
556
|
+
"aria-haspopup": "listbox",
|
|
557
|
+
"aria-expanded": open,
|
|
558
|
+
onClick: () => setOpen((prev) => !prev),
|
|
559
|
+
onKeyDown: handleKeyDown,
|
|
560
|
+
...props,
|
|
561
|
+
children: [
|
|
562
|
+
icon && /* @__PURE__ */ jsx9("span", { className: ChipDropdown_default.icon, children: icon }),
|
|
563
|
+
/* @__PURE__ */ jsx9("span", { className: ChipDropdown_default.label, children: displayLabel }),
|
|
564
|
+
tag && /* @__PURE__ */ jsx9("span", { className: ChipDropdown_default.tag, children: tag }),
|
|
565
|
+
/* @__PURE__ */ jsx9(
|
|
566
|
+
"span",
|
|
567
|
+
{
|
|
568
|
+
className: [ChipDropdown_default.chevron, open ? ChipDropdown_default.chevronOpen : ""].filter(Boolean).join(" "),
|
|
569
|
+
"aria-hidden": "true",
|
|
570
|
+
children: /* @__PURE__ */ jsx9(ChevronDownIcon, {})
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
),
|
|
576
|
+
open && /* @__PURE__ */ jsx9(
|
|
577
|
+
"ul",
|
|
578
|
+
{
|
|
579
|
+
role: "listbox",
|
|
580
|
+
"aria-label": label,
|
|
581
|
+
className: ChipDropdown_default.list,
|
|
582
|
+
children: options.map((option) => {
|
|
583
|
+
const isActive = option.value === value;
|
|
584
|
+
return /* @__PURE__ */ jsxs9(
|
|
585
|
+
"li",
|
|
586
|
+
{
|
|
587
|
+
role: "option",
|
|
588
|
+
"aria-selected": isActive,
|
|
589
|
+
className: [
|
|
590
|
+
ChipDropdown_default.item,
|
|
591
|
+
isActive ? ChipDropdown_default.itemSelected : ""
|
|
592
|
+
].filter(Boolean).join(" "),
|
|
593
|
+
onClick: () => {
|
|
594
|
+
onChange?.(option.value);
|
|
595
|
+
setOpen(false);
|
|
596
|
+
},
|
|
597
|
+
children: [
|
|
598
|
+
/* @__PURE__ */ jsx9("span", { className: ChipDropdown_default.itemLabel, children: option.label }),
|
|
599
|
+
isActive && /* @__PURE__ */ jsx9("span", { className: ChipDropdown_default.itemCheck, children: /* @__PURE__ */ jsx9(CheckIcon, {}) })
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
option.value
|
|
603
|
+
);
|
|
604
|
+
})
|
|
605
|
+
}
|
|
606
|
+
)
|
|
607
|
+
] });
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
// components/Card/CardPrimaryVariant.module.css
|
|
611
|
+
var CardPrimaryVariant_default = {};
|
|
612
|
+
|
|
613
|
+
// components/Card/CardPrimaryVariant.tsx
|
|
614
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
615
|
+
var ArrowRightIcon = () => /* @__PURE__ */ jsx10(
|
|
616
|
+
"svg",
|
|
617
|
+
{
|
|
618
|
+
"aria-hidden": "true",
|
|
619
|
+
fill: "none",
|
|
620
|
+
height: "16",
|
|
621
|
+
viewBox: "0 0 16 16",
|
|
622
|
+
width: "16",
|
|
623
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
624
|
+
children: /* @__PURE__ */ jsx10(
|
|
625
|
+
"path",
|
|
626
|
+
{
|
|
627
|
+
d: "M3 8h10M9 4l4 4-4 4",
|
|
628
|
+
stroke: "currentColor",
|
|
629
|
+
strokeLinecap: "round",
|
|
630
|
+
strokeLinejoin: "round",
|
|
631
|
+
strokeWidth: "1.5"
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
var CardPrimaryVariant = ({
|
|
637
|
+
colorScheme = "light",
|
|
638
|
+
title,
|
|
639
|
+
description,
|
|
640
|
+
image,
|
|
641
|
+
imageAlt = "",
|
|
642
|
+
showLink = true,
|
|
643
|
+
linkText = "Learn more",
|
|
644
|
+
onLinkClick,
|
|
645
|
+
className,
|
|
646
|
+
variant: _variant,
|
|
647
|
+
...props
|
|
648
|
+
}) => {
|
|
649
|
+
const isInverse = colorScheme === "dark" || colorScheme === "brand" || colorScheme === "image";
|
|
650
|
+
return /* @__PURE__ */ jsxs10(
|
|
651
|
+
"div",
|
|
652
|
+
{
|
|
653
|
+
className: [
|
|
654
|
+
CardPrimaryVariant_default.card,
|
|
655
|
+
CardPrimaryVariant_default[`style--${colorScheme}`],
|
|
656
|
+
className ?? ""
|
|
657
|
+
].filter(Boolean).join(" "),
|
|
658
|
+
...props,
|
|
659
|
+
children: [
|
|
660
|
+
colorScheme === "image" && image && /* @__PURE__ */ jsxs10("div", { "aria-hidden": "true", className: CardPrimaryVariant_default.imageOverlay, children: [
|
|
661
|
+
/* @__PURE__ */ jsx10("img", { alt: "", className: CardPrimaryVariant_default.overlayImg, src: image }),
|
|
662
|
+
/* @__PURE__ */ jsx10("div", { className: CardPrimaryVariant_default.gradient })
|
|
663
|
+
] }),
|
|
664
|
+
/* @__PURE__ */ jsxs10("div", { className: CardPrimaryVariant_default.content, children: [
|
|
665
|
+
/* @__PURE__ */ jsx10("p", { className: [CardPrimaryVariant_default.title, isInverse ? CardPrimaryVariant_default.textInverse : CardPrimaryVariant_default.textDefault].join(" "), children: title }),
|
|
666
|
+
/* @__PURE__ */ jsx10("p", { className: [CardPrimaryVariant_default.description, isInverse ? CardPrimaryVariant_default.textInverse : CardPrimaryVariant_default.textDefault].join(" "), children: description }),
|
|
667
|
+
showLink && /* @__PURE__ */ jsxs10(
|
|
668
|
+
"button",
|
|
669
|
+
{
|
|
670
|
+
className: [CardPrimaryVariant_default.link, isInverse ? CardPrimaryVariant_default.linkInverse : CardPrimaryVariant_default.linkCoral].join(" "),
|
|
671
|
+
onClick: onLinkClick,
|
|
672
|
+
type: "button",
|
|
673
|
+
children: [
|
|
674
|
+
/* @__PURE__ */ jsx10("span", { children: linkText }),
|
|
675
|
+
/* @__PURE__ */ jsx10(ArrowRightIcon, {})
|
|
676
|
+
]
|
|
677
|
+
}
|
|
678
|
+
)
|
|
679
|
+
] }),
|
|
680
|
+
colorScheme !== "image" && /* @__PURE__ */ jsx10("div", { className: CardPrimaryVariant_default.imageSection, children: image && /* @__PURE__ */ jsx10("img", { alt: imageAlt, className: CardPrimaryVariant_default.image, src: image }) })
|
|
681
|
+
]
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
// components/Card/CardSecondaryVariant.module.css
|
|
687
|
+
var CardSecondaryVariant_default = {};
|
|
688
|
+
|
|
689
|
+
// components/Card/CardSecondaryVariant.tsx
|
|
690
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
691
|
+
var ArrowRightIcon2 = () => /* @__PURE__ */ jsx11(
|
|
692
|
+
"svg",
|
|
693
|
+
{
|
|
694
|
+
"aria-hidden": "true",
|
|
695
|
+
fill: "none",
|
|
696
|
+
height: "16",
|
|
697
|
+
viewBox: "0 0 16 16",
|
|
698
|
+
width: "16",
|
|
699
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
700
|
+
children: /* @__PURE__ */ jsx11(
|
|
701
|
+
"path",
|
|
702
|
+
{
|
|
703
|
+
d: "M3 8h10M9 4l4 4-4 4",
|
|
704
|
+
stroke: "currentColor",
|
|
705
|
+
strokeLinecap: "round",
|
|
706
|
+
strokeLinejoin: "round",
|
|
707
|
+
strokeWidth: "1.5"
|
|
708
|
+
}
|
|
709
|
+
)
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
var CardSecondaryVariant = ({
|
|
713
|
+
title,
|
|
714
|
+
description,
|
|
715
|
+
icon,
|
|
716
|
+
showIcon = true,
|
|
717
|
+
showLink = true,
|
|
718
|
+
linkText = "Learn more",
|
|
719
|
+
onLinkClick,
|
|
720
|
+
className,
|
|
721
|
+
variant: _variant,
|
|
722
|
+
...props
|
|
723
|
+
}) => {
|
|
724
|
+
return /* @__PURE__ */ jsxs11(
|
|
725
|
+
"div",
|
|
726
|
+
{
|
|
727
|
+
className: [CardSecondaryVariant_default.card, className ?? ""].filter(Boolean).join(" "),
|
|
728
|
+
...props,
|
|
729
|
+
children: [
|
|
730
|
+
showIcon && icon && /* @__PURE__ */ jsx11("span", { className: CardSecondaryVariant_default.icon, children: icon }),
|
|
731
|
+
/* @__PURE__ */ jsx11("p", { className: CardSecondaryVariant_default.title, children: title }),
|
|
732
|
+
/* @__PURE__ */ jsx11("p", { className: CardSecondaryVariant_default.description, children: description }),
|
|
733
|
+
showLink && /* @__PURE__ */ jsxs11(
|
|
734
|
+
"button",
|
|
735
|
+
{
|
|
736
|
+
className: CardSecondaryVariant_default.link,
|
|
737
|
+
onClick: onLinkClick,
|
|
738
|
+
type: "button",
|
|
739
|
+
children: [
|
|
740
|
+
/* @__PURE__ */ jsx11("span", { children: linkText }),
|
|
741
|
+
/* @__PURE__ */ jsx11(ArrowRightIcon2, {})
|
|
742
|
+
]
|
|
743
|
+
}
|
|
744
|
+
)
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
// components/Card/CardThumbnailVariant.module.css
|
|
751
|
+
var CardThumbnailVariant_default = {};
|
|
752
|
+
|
|
753
|
+
// components/Card/CardThumbnailVariant.tsx
|
|
754
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
755
|
+
var LinkIcon = () => /* @__PURE__ */ jsxs12(
|
|
756
|
+
"svg",
|
|
757
|
+
{
|
|
758
|
+
"aria-hidden": "true",
|
|
759
|
+
fill: "none",
|
|
760
|
+
height: "14",
|
|
761
|
+
viewBox: "0 0 14 14",
|
|
762
|
+
width: "14",
|
|
763
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
764
|
+
children: [
|
|
765
|
+
/* @__PURE__ */ jsx12(
|
|
766
|
+
"path",
|
|
767
|
+
{
|
|
768
|
+
d: "M5.25 2.625H3.5A1.75 1.75 0 0 0 1.75 4.375v5.25A1.75 1.75 0 0 0 3.5 11.375h5.25a1.75 1.75 0 0 0 1.75-1.75V7.875",
|
|
769
|
+
stroke: "currentColor",
|
|
770
|
+
strokeLinecap: "round",
|
|
771
|
+
strokeLinejoin: "round",
|
|
772
|
+
strokeWidth: "1.25"
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ jsx12(
|
|
776
|
+
"path",
|
|
777
|
+
{
|
|
778
|
+
d: "M7.875 1.75h4.375v4.375M12.25 1.75 6.125 7.875",
|
|
779
|
+
stroke: "currentColor",
|
|
780
|
+
strokeLinecap: "round",
|
|
781
|
+
strokeLinejoin: "round",
|
|
782
|
+
strokeWidth: "1.25"
|
|
783
|
+
}
|
|
784
|
+
)
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
var PlayIcon = () => /* @__PURE__ */ jsxs12(
|
|
789
|
+
"svg",
|
|
790
|
+
{
|
|
791
|
+
"aria-hidden": "true",
|
|
792
|
+
fill: "none",
|
|
793
|
+
height: "80",
|
|
794
|
+
viewBox: "0 0 80 80",
|
|
795
|
+
width: "80",
|
|
796
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
797
|
+
children: [
|
|
798
|
+
/* @__PURE__ */ jsx12("circle", { cx: "40", cy: "40", fill: "rgba(255,255,255,0.88)", r: "40" }),
|
|
799
|
+
/* @__PURE__ */ jsx12("path", { d: "M32 27l22 13-22 13V27z", fill: "rgba(24,28,37,0.72)" })
|
|
800
|
+
]
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
var CardThumbnailVariant = ({
|
|
804
|
+
type = "video",
|
|
805
|
+
thumbnail,
|
|
806
|
+
thumbnailAlt = "",
|
|
807
|
+
title,
|
|
808
|
+
summary,
|
|
809
|
+
tags = [],
|
|
810
|
+
hideTags = false,
|
|
811
|
+
showCopyLink = true,
|
|
812
|
+
onCopyLink,
|
|
813
|
+
avatar,
|
|
814
|
+
avatarAlt = "",
|
|
815
|
+
className,
|
|
816
|
+
variant: _variant,
|
|
817
|
+
...props
|
|
818
|
+
}) => {
|
|
819
|
+
const isVideo = type === "video";
|
|
820
|
+
return /* @__PURE__ */ jsxs12(
|
|
821
|
+
"div",
|
|
822
|
+
{
|
|
823
|
+
className: [CardThumbnailVariant_default.card, className ?? ""].filter(Boolean).join(" "),
|
|
824
|
+
...props,
|
|
825
|
+
children: [
|
|
826
|
+
/* @__PURE__ */ jsxs12("div", { className: CardThumbnailVariant_default.thumbnailWrapper, children: [
|
|
827
|
+
/* @__PURE__ */ jsx12("img", { alt: thumbnailAlt, className: CardThumbnailVariant_default.thumbnailImage, src: thumbnail }),
|
|
828
|
+
isVideo && /* @__PURE__ */ jsx12("span", { "aria-label": "Play video", className: CardThumbnailVariant_default.playButton, children: /* @__PURE__ */ jsx12(PlayIcon, {}) }),
|
|
829
|
+
!isVideo && avatar && /* @__PURE__ */ jsx12("img", { alt: avatarAlt, className: CardThumbnailVariant_default.avatar, src: avatar })
|
|
830
|
+
] }),
|
|
831
|
+
/* @__PURE__ */ jsxs12("div", { className: CardThumbnailVariant_default.content, children: [
|
|
832
|
+
/* @__PURE__ */ jsxs12("div", { className: CardThumbnailVariant_default.metaRow, children: [
|
|
833
|
+
!hideTags && /* @__PURE__ */ jsx12("div", { className: CardThumbnailVariant_default.tagsList, children: tags.map((tag, i) => /* @__PURE__ */ jsx12(Tag, { icon: tag.icon, label: tag.label, size: "md", variant: "fill" }, i)) }),
|
|
834
|
+
showCopyLink && /* @__PURE__ */ jsx12(
|
|
835
|
+
"button",
|
|
836
|
+
{
|
|
837
|
+
"aria-label": "Copy link",
|
|
838
|
+
className: CardThumbnailVariant_default.copyLink,
|
|
839
|
+
onClick: onCopyLink,
|
|
840
|
+
type: "button",
|
|
841
|
+
children: /* @__PURE__ */ jsx12(LinkIcon, {})
|
|
842
|
+
}
|
|
843
|
+
)
|
|
844
|
+
] }),
|
|
845
|
+
/* @__PURE__ */ jsx12("p", { className: CardThumbnailVariant_default.title, children: title }),
|
|
846
|
+
/* @__PURE__ */ jsx12("p", { className: CardThumbnailVariant_default.summary, children: summary })
|
|
847
|
+
] })
|
|
848
|
+
]
|
|
849
|
+
}
|
|
850
|
+
);
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
// components/Card/Card.tsx
|
|
854
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
855
|
+
var Card = (props) => {
|
|
856
|
+
if (props.variant === "primary") {
|
|
857
|
+
return /* @__PURE__ */ jsx13(CardPrimaryVariant, { ...props });
|
|
858
|
+
}
|
|
859
|
+
if (props.variant === "secondary") {
|
|
860
|
+
return /* @__PURE__ */ jsx13(CardSecondaryVariant, { ...props });
|
|
861
|
+
}
|
|
862
|
+
return /* @__PURE__ */ jsx13(CardThumbnailVariant, { ...props });
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
// primitives/Pagination/Pagination.module.css
|
|
866
|
+
var Pagination_default = {};
|
|
867
|
+
|
|
868
|
+
// primitives/Pagination/Pagination.tsx
|
|
869
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
870
|
+
var ChevronLeft = () => /* @__PURE__ */ jsx14("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
871
|
+
var ChevronRight = () => /* @__PURE__ */ jsx14("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M6 4L10 8L6 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
872
|
+
function getPageItems(currentPage, totalPages) {
|
|
873
|
+
if (totalPages <= 5) {
|
|
874
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
875
|
+
}
|
|
876
|
+
if (currentPage <= 3) {
|
|
877
|
+
return [1, 2, 3, 4, 5, "ellipsis-right", totalPages];
|
|
878
|
+
}
|
|
879
|
+
if (currentPage >= totalPages - 2) {
|
|
880
|
+
return [1, "ellipsis-left", totalPages - 4, totalPages - 3, totalPages - 2, totalPages - 1, totalPages];
|
|
881
|
+
}
|
|
882
|
+
return [1, "ellipsis-left", currentPage - 1, currentPage, currentPage + 1, "ellipsis-right", totalPages];
|
|
883
|
+
}
|
|
884
|
+
var Pagination = ({
|
|
885
|
+
currentPage,
|
|
886
|
+
totalPages,
|
|
887
|
+
onPageChange,
|
|
888
|
+
className
|
|
889
|
+
}) => {
|
|
890
|
+
const items = getPageItems(currentPage, totalPages);
|
|
891
|
+
const isPrevDisabled = currentPage <= 1;
|
|
892
|
+
const isNextDisabled = currentPage >= totalPages;
|
|
893
|
+
return /* @__PURE__ */ jsxs13(
|
|
894
|
+
"nav",
|
|
895
|
+
{
|
|
896
|
+
className: [Pagination_default.pagination, className ?? ""].filter(Boolean).join(" "),
|
|
897
|
+
"aria-label": "Pagination navigation",
|
|
898
|
+
children: [
|
|
899
|
+
/* @__PURE__ */ jsx14(
|
|
900
|
+
"button",
|
|
901
|
+
{
|
|
902
|
+
className: [Pagination_default.navButton, isPrevDisabled ? Pagination_default.navButtonDisabled : ""].filter(Boolean).join(" "),
|
|
903
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
904
|
+
disabled: isPrevDisabled,
|
|
905
|
+
"aria-label": "Previous page",
|
|
906
|
+
children: /* @__PURE__ */ jsx14("span", { className: Pagination_default.navIcon, children: /* @__PURE__ */ jsx14(ChevronLeft, {}) })
|
|
907
|
+
}
|
|
908
|
+
),
|
|
909
|
+
items.map((item, index) => {
|
|
910
|
+
if (item === "ellipsis-left" || item === "ellipsis-right") {
|
|
911
|
+
return /* @__PURE__ */ jsx14(
|
|
912
|
+
"span",
|
|
913
|
+
{
|
|
914
|
+
className: Pagination_default.ellipsis,
|
|
915
|
+
"aria-hidden": "true",
|
|
916
|
+
children: "\u2026"
|
|
917
|
+
},
|
|
918
|
+
`${item}-${index}`
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
const isSelected = item === currentPage;
|
|
922
|
+
return /* @__PURE__ */ jsx14(
|
|
923
|
+
"button",
|
|
924
|
+
{
|
|
925
|
+
className: [Pagination_default.pageButton, isSelected ? Pagination_default.pageButtonSelected : ""].filter(Boolean).join(" "),
|
|
926
|
+
onClick: () => {
|
|
927
|
+
if (!isSelected) onPageChange(item);
|
|
928
|
+
},
|
|
929
|
+
"aria-current": isSelected ? "page" : void 0,
|
|
930
|
+
"aria-label": `Page ${item}`,
|
|
931
|
+
children: item
|
|
932
|
+
},
|
|
933
|
+
item
|
|
934
|
+
);
|
|
935
|
+
}),
|
|
936
|
+
/* @__PURE__ */ jsx14(
|
|
937
|
+
"button",
|
|
938
|
+
{
|
|
939
|
+
className: [Pagination_default.navButton, isNextDisabled ? Pagination_default.navButtonDisabled : ""].filter(Boolean).join(" "),
|
|
940
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
941
|
+
disabled: isNextDisabled,
|
|
942
|
+
"aria-label": "Next page",
|
|
943
|
+
children: /* @__PURE__ */ jsx14("span", { className: Pagination_default.navIcon, children: /* @__PURE__ */ jsx14(ChevronRight, {}) })
|
|
944
|
+
}
|
|
945
|
+
)
|
|
946
|
+
]
|
|
947
|
+
}
|
|
948
|
+
);
|
|
949
|
+
};
|
|
950
|
+
export {
|
|
951
|
+
Accordion,
|
|
952
|
+
Breadcrumb,
|
|
953
|
+
Button,
|
|
954
|
+
Card,
|
|
955
|
+
Chip,
|
|
956
|
+
ChipDropdown,
|
|
957
|
+
Link,
|
|
958
|
+
Pagination,
|
|
959
|
+
SearchField,
|
|
960
|
+
Tag,
|
|
961
|
+
TextField
|
|
962
|
+
};
|
|
963
|
+
//# sourceMappingURL=index.mjs.map
|