@usefidel/design-system 0.25.0 → 0.26.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/dist/fidel.manifest.json +2 -2
- package/dist/index.cjs +291 -16
- package/dist/index.css +553 -0
- package/dist/index.d.cts +165 -3
- package/dist/index.d.ts +165 -3
- package/dist/index.js +274 -7
- package/package.json +1 -1
package/dist/fidel.manifest.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -32,9 +32,11 @@ __export(index_exports, {
|
|
|
32
32
|
Callout: () => Callout,
|
|
33
33
|
Card: () => Card,
|
|
34
34
|
Checkbox: () => Checkbox,
|
|
35
|
+
Checklist: () => Checklist,
|
|
35
36
|
DiffPropertyList: () => DiffPropertyList,
|
|
36
37
|
DiffSection: () => DiffSection,
|
|
37
38
|
Divider: () => Divider,
|
|
39
|
+
Drawer: () => Drawer,
|
|
38
40
|
EmptyState: () => EmptyState,
|
|
39
41
|
IconButton: () => IconButton,
|
|
40
42
|
Input: () => Input,
|
|
@@ -43,11 +45,16 @@ __export(index_exports, {
|
|
|
43
45
|
MismatchCard: () => MismatchCard,
|
|
44
46
|
Modal: () => Modal,
|
|
45
47
|
MultiSelect: () => MultiSelect,
|
|
48
|
+
NumberedSteps: () => NumberedSteps,
|
|
49
|
+
OptionList: () => OptionList,
|
|
50
|
+
OptionRow: () => OptionRow,
|
|
46
51
|
PageHeader: () => PageHeader,
|
|
52
|
+
PageSkeleton: () => PageSkeleton,
|
|
47
53
|
Pagination: () => Pagination,
|
|
48
54
|
PricingCard: () => PricingCard,
|
|
49
55
|
Radio: () => Radio,
|
|
50
56
|
RadioCard: () => RadioCard,
|
|
57
|
+
ResourceCard: () => ResourceCard,
|
|
51
58
|
SearchInput: () => SearchInput,
|
|
52
59
|
SectionHeader: () => SectionHeader,
|
|
53
60
|
SegmentedControl: () => SegmentedControl,
|
|
@@ -63,6 +70,7 @@ __export(index_exports, {
|
|
|
63
70
|
Stat: () => Stat,
|
|
64
71
|
StatusDot: () => StatusDot,
|
|
65
72
|
StepList: () => StepList,
|
|
73
|
+
Stepper: () => Stepper,
|
|
66
74
|
Swatch: () => Swatch,
|
|
67
75
|
TabNav: () => TabNav,
|
|
68
76
|
Table: () => Table,
|
|
@@ -1022,12 +1030,23 @@ function Badge({ tone = "neutral", icon, className, children, ...rest }) {
|
|
|
1022
1030
|
}
|
|
1023
1031
|
|
|
1024
1032
|
// src/components/Tag/Tag.tsx
|
|
1033
|
+
var import_lucide_react = require("lucide-react");
|
|
1025
1034
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1026
|
-
function Tag({ dot, icon, className, children, ...rest }) {
|
|
1035
|
+
function Tag({ dot, icon, onRemove, removeLabel, className, children, ...rest }) {
|
|
1027
1036
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: ["fds-tag", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1028
1037
|
dot && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `fds-dot fds-dot--${dot}`, "aria-hidden": "true" }),
|
|
1029
1038
|
icon != null && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "fds-tag__icon", "aria-hidden": "true", children: icon }),
|
|
1030
|
-
children
|
|
1039
|
+
children,
|
|
1040
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1041
|
+
"button",
|
|
1042
|
+
{
|
|
1043
|
+
type: "button",
|
|
1044
|
+
className: "fds-tag__remove",
|
|
1045
|
+
"aria-label": `Remove ${removeLabel ?? (typeof children === "string" ? children : "")}`.trim(),
|
|
1046
|
+
onClick: onRemove,
|
|
1047
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react.X, { "aria-hidden": "true" })
|
|
1048
|
+
}
|
|
1049
|
+
)
|
|
1031
1050
|
] });
|
|
1032
1051
|
}
|
|
1033
1052
|
|
|
@@ -1320,15 +1339,18 @@ function Pagination({ page, pageCount, onPageChange, total, pageSize, variant =
|
|
|
1320
1339
|
|
|
1321
1340
|
// src/components/EmptyState/EmptyState.tsx
|
|
1322
1341
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1323
|
-
function EmptyState({ illustration, title, description, action, footer, size = "default", className, ...rest }) {
|
|
1342
|
+
function EmptyState({ illustration, title, description, action, secondaryAction, footer, size = "default", className, ...rest }) {
|
|
1324
1343
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: ["fds-empty", size === "compact" ? "fds-empty--compact" : "", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1325
1344
|
illustration != null && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fds-empty__illustration", children: illustration }),
|
|
1326
1345
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "fds-empty__text", children: [
|
|
1327
1346
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { className: "fds-empty__title", children: title }),
|
|
1328
1347
|
description != null && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "fds-empty__description", children: description })
|
|
1329
1348
|
] }),
|
|
1330
|
-
(action != null || footer != null) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "fds-empty__actions", children: [
|
|
1331
|
-
action,
|
|
1349
|
+
(action != null || secondaryAction != null || footer != null) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "fds-empty__actions", children: [
|
|
1350
|
+
(action != null || secondaryAction != null) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "fds-empty__buttons", children: [
|
|
1351
|
+
action,
|
|
1352
|
+
secondaryAction
|
|
1353
|
+
] }),
|
|
1332
1354
|
footer != null && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fds-empty__footer", children: footer })
|
|
1333
1355
|
] })
|
|
1334
1356
|
] });
|
|
@@ -1697,7 +1719,7 @@ function IconButton({
|
|
|
1697
1719
|
|
|
1698
1720
|
// src/components/Menu/Menu.tsx
|
|
1699
1721
|
var import_react17 = require("react");
|
|
1700
|
-
var
|
|
1722
|
+
var import_lucide_react2 = require("lucide-react");
|
|
1701
1723
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1702
1724
|
var isItem = (e) => !("type" in e);
|
|
1703
1725
|
function searchText(it) {
|
|
@@ -1853,7 +1875,7 @@ function Menu({
|
|
|
1853
1875
|
wired,
|
|
1854
1876
|
open && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: listClasses, onKeyDown: onListKeyDown, children: [
|
|
1855
1877
|
search && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "fds-menu__search", children: [
|
|
1856
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react2.Search, { "aria-hidden": "true" }),
|
|
1857
1879
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1858
1880
|
"input",
|
|
1859
1881
|
{
|
|
@@ -1909,7 +1931,7 @@ function Menu({
|
|
|
1909
1931
|
e.description != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fds-menu__description", children: e.description })
|
|
1910
1932
|
] }),
|
|
1911
1933
|
e.trailing != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fds-menu__trailing", children: e.trailing }),
|
|
1912
|
-
e.selected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1934
|
+
e.selected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react2.Check, { className: "fds-menu__check", "aria-hidden": "true" })
|
|
1913
1935
|
]
|
|
1914
1936
|
},
|
|
1915
1937
|
i
|
|
@@ -2098,12 +2120,12 @@ function Tooltip({ content, children, side = "right", delay = 400, disabled = fa
|
|
|
2098
2120
|
}
|
|
2099
2121
|
|
|
2100
2122
|
// src/components/BrandButton/BrandButton.tsx
|
|
2101
|
-
var
|
|
2123
|
+
var import_lucide_react3 = require("lucide-react");
|
|
2102
2124
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2103
2125
|
function BrandButton({ mark, hoverIcon, type = "button", className, ...rest }) {
|
|
2104
2126
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type, className: ["fds-brand-button", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2105
2127
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "fds-brand-button__mark", "aria-hidden": "true", children: mark }),
|
|
2106
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "fds-brand-button__hover", "aria-hidden": "true", children: hoverIcon ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "fds-brand-button__hover", "aria-hidden": "true", children: hoverIcon ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react3.PanelLeftOpen, {}) })
|
|
2107
2129
|
] });
|
|
2108
2130
|
}
|
|
2109
2131
|
|
|
@@ -2143,7 +2165,7 @@ function SidebarItem({
|
|
|
2143
2165
|
|
|
2144
2166
|
// src/components/Sidebar/Sidebar.tsx
|
|
2145
2167
|
var import_react20 = require("react");
|
|
2146
|
-
var
|
|
2168
|
+
var import_lucide_react4 = require("lucide-react");
|
|
2147
2169
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2148
2170
|
function SidebarRoot({
|
|
2149
2171
|
collapsed: controlled,
|
|
@@ -2212,7 +2234,7 @@ function SidebarBrand({
|
|
|
2212
2234
|
{
|
|
2213
2235
|
variant: "ghost",
|
|
2214
2236
|
size: "small",
|
|
2215
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2237
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react4.PanelLeftClose, {}),
|
|
2216
2238
|
"aria-label": collapseLabel,
|
|
2217
2239
|
"aria-keyshortcuts": "Meta+Backslash Control+Backslash",
|
|
2218
2240
|
onClick: () => sidebar?.setCollapsed(true)
|
|
@@ -2270,7 +2292,7 @@ var Sidebar = Object.assign(SidebarRoot, {
|
|
|
2270
2292
|
|
|
2271
2293
|
// src/components/WorkspaceSwitcher/WorkspaceSwitcher.tsx
|
|
2272
2294
|
var import_react21 = require("react");
|
|
2273
|
-
var
|
|
2295
|
+
var import_lucide_react5 = require("lucide-react");
|
|
2274
2296
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2275
2297
|
function WorkspaceAvatar({ name }) {
|
|
2276
2298
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fds-workspace-avatar", "aria-hidden": "true", children: name.trim().charAt(0).toUpperCase() || "?" });
|
|
@@ -2291,7 +2313,7 @@ var WorkspaceSwitcher = (0, import_react21.forwardRef)(function WorkspaceSwitche
|
|
|
2291
2313
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "fds-workspace-switcher__text", "aria-hidden": iconOnly || void 0, children: [
|
|
2292
2314
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fds-workspace-switcher__name", children: name }),
|
|
2293
2315
|
plan && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fds-workspace-switcher__plan", children: plan }),
|
|
2294
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react5.ChevronDown, { className: "fds-workspace-switcher__chevron", "aria-hidden": "true" })
|
|
2295
2317
|
] })
|
|
2296
2318
|
]
|
|
2297
2319
|
}
|
|
@@ -2349,7 +2371,7 @@ function PageHeader({ title, description, breadcrumb, actions, className, childr
|
|
|
2349
2371
|
|
|
2350
2372
|
// src/components/Toast/Toast.tsx
|
|
2351
2373
|
var import_react23 = require("react");
|
|
2352
|
-
var
|
|
2374
|
+
var import_lucide_react6 = require("lucide-react");
|
|
2353
2375
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2354
2376
|
function ToastRegion({ className, children, ...rest }) {
|
|
2355
2377
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: ["fds-toast-region", className].filter(Boolean).join(" "), "aria-live": "polite", ...rest, children });
|
|
@@ -2363,9 +2385,254 @@ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
|
|
|
2363
2385
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { role: "status", className: ["fds-toast", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2364
2386
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "fds-toast__message", children }),
|
|
2365
2387
|
action && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: "fds-toast__action", onClick: action.onClick, children: action.label }),
|
|
2366
|
-
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: "fds-toast__close", "aria-label": "Dismiss", onClick: onDismiss, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2388
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: "fds-toast__close", "aria-label": "Dismiss", onClick: onDismiss, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.X, { "aria-hidden": "true" }) })
|
|
2389
|
+
] });
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
// src/components/Stepper/Stepper.tsx
|
|
2393
|
+
var import_react24 = require("react");
|
|
2394
|
+
var import_lucide_react7 = require("lucide-react");
|
|
2395
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2396
|
+
function StepperStep(_) {
|
|
2397
|
+
return null;
|
|
2398
|
+
}
|
|
2399
|
+
function StepperRoot({ className, children, ...rest }) {
|
|
2400
|
+
const steps = import_react24.Children.toArray(children).filter(import_react24.isValidElement);
|
|
2401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ol", { className: ["fds-stepper", className].filter(Boolean).join(" "), ...rest, children: steps.map((step, i) => {
|
|
2402
|
+
const { status, children: label } = step.props;
|
|
2403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2404
|
+
"li",
|
|
2405
|
+
{
|
|
2406
|
+
className: `fds-stepper__step fds-stepper__step--${status}`,
|
|
2407
|
+
"aria-current": status === "current" ? "step" : void 0,
|
|
2408
|
+
children: [
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fds-stepper__marker", "aria-hidden": "true", children: status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react7.Check, {}) : i + 1 }),
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fds-stepper__label", children: label })
|
|
2411
|
+
]
|
|
2412
|
+
},
|
|
2413
|
+
i
|
|
2414
|
+
);
|
|
2415
|
+
}) });
|
|
2416
|
+
}
|
|
2417
|
+
var Stepper = Object.assign(StepperRoot, { Step: StepperStep });
|
|
2418
|
+
|
|
2419
|
+
// src/components/NumberedSteps/NumberedSteps.tsx
|
|
2420
|
+
var import_react25 = require("react");
|
|
2421
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2422
|
+
function NumberedStepsRoot({ className, children, ...rest }) {
|
|
2423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("ol", { className: ["fds-numbered-steps", className].filter(Boolean).join(" "), ...rest, children: import_react25.Children.toArray(children) });
|
|
2424
|
+
}
|
|
2425
|
+
function NumberedStepsItem({ className, children, ...rest }) {
|
|
2426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("li", { className: ["fds-numbered-steps__item", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2427
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "fds-numbered-steps__marker", "aria-hidden": "true" }),
|
|
2428
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "fds-numbered-steps__body", children })
|
|
2429
|
+
] });
|
|
2430
|
+
}
|
|
2431
|
+
var NumberedSteps = Object.assign(NumberedStepsRoot, { Item: NumberedStepsItem });
|
|
2432
|
+
|
|
2433
|
+
// src/components/OptionList/OptionList.tsx
|
|
2434
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2435
|
+
function OptionListRoot({ className, children, ...rest }) {
|
|
2436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: ["fds-option-list", className].filter(Boolean).join(" "), ...rest, children });
|
|
2437
|
+
}
|
|
2438
|
+
function OptionListLabel({ className, children, ...rest }) {
|
|
2439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: ["fds-option-list__label", className].filter(Boolean).join(" "), ...rest, children });
|
|
2440
|
+
}
|
|
2441
|
+
function OptionRow({ control = "radio", title, description, meta, className, checked, disabled, ...rest }) {
|
|
2442
|
+
const Control = control === "checkbox" ? Checkbox : Radio;
|
|
2443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2444
|
+
"div",
|
|
2445
|
+
{
|
|
2446
|
+
className: ["fds-option-row", checked ? "fds-option-row--checked" : "", className].filter(Boolean).join(" "),
|
|
2447
|
+
"data-disabled": disabled ? "" : void 0,
|
|
2448
|
+
children: [
|
|
2449
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Control, { label: title, description, checked, disabled, ...rest }),
|
|
2450
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "fds-option-row__meta", children: meta })
|
|
2451
|
+
]
|
|
2452
|
+
}
|
|
2453
|
+
);
|
|
2454
|
+
}
|
|
2455
|
+
var OptionList = Object.assign(OptionListRoot, { Label: OptionListLabel, Row: OptionRow });
|
|
2456
|
+
|
|
2457
|
+
// src/components/Checklist/Checklist.tsx
|
|
2458
|
+
var import_lucide_react8 = require("lucide-react");
|
|
2459
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2460
|
+
function ChecklistRoot({ title, className, children, ...rest }) {
|
|
2461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: ["fds-checklist", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2462
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "fds-checklist__title", children: title }),
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("ul", { className: "fds-checklist__items", children })
|
|
2464
|
+
] });
|
|
2465
|
+
}
|
|
2466
|
+
function ChecklistItem({ done, label, value }) {
|
|
2467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("li", { className: ["fds-checklist__item", done ? "fds-checklist__item--done" : ""].filter(Boolean).join(" "), children: [
|
|
2468
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fds-checklist__mark", "aria-hidden": "true", children: done && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react8.Check, {}) }),
|
|
2469
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fds-checklist__text", children: [
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fds-checklist__label", children: label }),
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fds-checklist__value", children: value })
|
|
2472
|
+
] })
|
|
2367
2473
|
] });
|
|
2368
2474
|
}
|
|
2475
|
+
var Checklist = Object.assign(ChecklistRoot, { Item: ChecklistItem });
|
|
2476
|
+
|
|
2477
|
+
// src/components/Drawer/Drawer.tsx
|
|
2478
|
+
var import_react26 = require("react");
|
|
2479
|
+
var import_react_dom3 = require("react-dom");
|
|
2480
|
+
var import_lucide_react9 = require("lucide-react");
|
|
2481
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2482
|
+
var FOCUSABLE2 = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
2483
|
+
function Drawer({ open, onClose, title, description, children, footer, dismissible = true }) {
|
|
2484
|
+
const titleId = (0, import_react26.useId)();
|
|
2485
|
+
const descriptionId = (0, import_react26.useId)();
|
|
2486
|
+
const panelRef = (0, import_react26.useRef)(null);
|
|
2487
|
+
const onCloseRef = (0, import_react26.useRef)(onClose);
|
|
2488
|
+
onCloseRef.current = onClose;
|
|
2489
|
+
const dismissibleRef = (0, import_react26.useRef)(dismissible);
|
|
2490
|
+
dismissibleRef.current = dismissible;
|
|
2491
|
+
(0, import_react26.useEffect)(() => {
|
|
2492
|
+
if (!open) return;
|
|
2493
|
+
const panel = panelRef.current;
|
|
2494
|
+
const previouslyFocused = document.activeElement;
|
|
2495
|
+
(panel?.querySelector("[data-autofocus]") ?? panel?.querySelector(`.fds-drawer__body ${FOCUSABLE2}`) ?? panel)?.focus();
|
|
2496
|
+
const previousOverflow = document.body.style.overflow;
|
|
2497
|
+
document.body.style.overflow = "hidden";
|
|
2498
|
+
const onKey = (e) => {
|
|
2499
|
+
if (e.key === "Escape" && dismissibleRef.current) {
|
|
2500
|
+
e.preventDefault();
|
|
2501
|
+
onCloseRef.current();
|
|
2502
|
+
return;
|
|
2503
|
+
}
|
|
2504
|
+
if (e.key === "Tab" && panel) {
|
|
2505
|
+
const focusable = Array.from(panel.querySelectorAll(FOCUSABLE2));
|
|
2506
|
+
if (focusable.length === 0) return;
|
|
2507
|
+
const first = focusable[0];
|
|
2508
|
+
const last = focusable[focusable.length - 1];
|
|
2509
|
+
if (e.shiftKey && (document.activeElement === first || document.activeElement === panel)) {
|
|
2510
|
+
e.preventDefault();
|
|
2511
|
+
last.focus();
|
|
2512
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
2513
|
+
e.preventDefault();
|
|
2514
|
+
first.focus();
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
window.addEventListener("keydown", onKey);
|
|
2519
|
+
return () => {
|
|
2520
|
+
window.removeEventListener("keydown", onKey);
|
|
2521
|
+
document.body.style.overflow = previousOverflow;
|
|
2522
|
+
previouslyFocused?.focus?.();
|
|
2523
|
+
};
|
|
2524
|
+
}, [open]);
|
|
2525
|
+
if (!open || typeof document === "undefined") return null;
|
|
2526
|
+
return (0, import_react_dom3.createPortal)(
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2528
|
+
"div",
|
|
2529
|
+
{
|
|
2530
|
+
className: "fds-drawer__scrim",
|
|
2531
|
+
onMouseDown: (e) => {
|
|
2532
|
+
if (e.target === e.currentTarget && dismissible) onClose();
|
|
2533
|
+
},
|
|
2534
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
2535
|
+
"div",
|
|
2536
|
+
{
|
|
2537
|
+
ref: panelRef,
|
|
2538
|
+
className: "fds-drawer",
|
|
2539
|
+
role: "dialog",
|
|
2540
|
+
"aria-modal": "true",
|
|
2541
|
+
"aria-labelledby": titleId,
|
|
2542
|
+
"aria-describedby": description != null ? descriptionId : void 0,
|
|
2543
|
+
tabIndex: -1,
|
|
2544
|
+
children: [
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("header", { className: "fds-drawer__header", children: [
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fds-drawer__heading", children: [
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { id: titleId, className: "fds-drawer__title", children: title }),
|
|
2548
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: descriptionId, className: "fds-drawer__description", children: description })
|
|
2549
|
+
] }),
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { type: "button", className: "fds-drawer__close", onClick: onClose, disabled: !dismissible, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react9.X, { "aria-hidden": "true" }) })
|
|
2551
|
+
] }),
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "fds-drawer__body", children }),
|
|
2553
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("footer", { className: "fds-drawer__footer", children: footer })
|
|
2554
|
+
]
|
|
2555
|
+
}
|
|
2556
|
+
)
|
|
2557
|
+
}
|
|
2558
|
+
),
|
|
2559
|
+
document.body
|
|
2560
|
+
);
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
// src/components/ResourceCard/ResourceCard.tsx
|
|
2564
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2565
|
+
function ResourceCard({ icon, title, badge, meta, stats, action, variant = "default", className, ...rest }) {
|
|
2566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: ["fds-resource-card", `fds-resource-card--${variant}`, className].filter(Boolean).join(" "), ...rest, children: [
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fds-resource-card__main", children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fds-resource-card__title", children: [
|
|
2569
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fds-resource-card__icon", "aria-hidden": "true", children: icon }),
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: title }),
|
|
2571
|
+
badge
|
|
2572
|
+
] }),
|
|
2573
|
+
meta?.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fds-resource-card__meta", children: line }, i))
|
|
2574
|
+
] }),
|
|
2575
|
+
stats && stats.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("dl", { className: "fds-resource-card__stats", children: stats.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fds-resource-card__stat", children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("dt", { children: s.label }),
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("dd", { children: s.value })
|
|
2578
|
+
] }, i)) }),
|
|
2579
|
+
action != null && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fds-resource-card__action", children: action })
|
|
2580
|
+
] });
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
// src/components/PageSkeleton/PageSkeleton.tsx
|
|
2584
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2585
|
+
function PageSkeletonRoot({ label = "Loading", children }) {
|
|
2586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SkeletonGroup, { label, className: "fds-page-skeleton", children });
|
|
2587
|
+
}
|
|
2588
|
+
function PageSkeletonHeader({ title, description, breadcrumb, action, tabs = 0 }) {
|
|
2589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2590
|
+
PageHeader,
|
|
2591
|
+
{
|
|
2592
|
+
breadcrumb: breadcrumb ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: 140 }) : void 0,
|
|
2593
|
+
title: title ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 220, height: 28 }),
|
|
2594
|
+
description: description === true ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: 320 }) : description || void 0,
|
|
2595
|
+
actions: action ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 128, height: 36 }) : void 0,
|
|
2596
|
+
children: tabs > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__tabs", children: Array.from({ length: tabs }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: 80 }, i)) })
|
|
2597
|
+
}
|
|
2598
|
+
);
|
|
2599
|
+
}
|
|
2600
|
+
function PageSkeletonToolbar({ filters = 2 }) {
|
|
2601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fds-page-skeleton__toolbar", children: [
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 280, height: 36 }),
|
|
2603
|
+
Array.from({ length: filters }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 140, height: 36 }, i))
|
|
2604
|
+
] });
|
|
2605
|
+
}
|
|
2606
|
+
function PageSkeletonTable({ rows = 5, columns = 5 }) {
|
|
2607
|
+
const cells = (key, width) => Array.from({ length: columns }, (_, c) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: c === 0 ? "60%" : width }, `${key}-${c}`));
|
|
2608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fds-page-skeleton__table", style: { ["--fds-page-skeleton-columns"]: columns }, children: [
|
|
2609
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__row fds-page-skeleton__row--head", children: cells("h", "40%") }),
|
|
2610
|
+
Array.from({ length: rows }, (_, r) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__row", children: cells(`r${r}`, "50%") }, r))
|
|
2611
|
+
] });
|
|
2612
|
+
}
|
|
2613
|
+
function PageSkeletonCards({ count = 3, height = 120, columns = 3 }) {
|
|
2614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__cards", style: { ["--fds-page-skeleton-columns"]: columns }, children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { height, className: "fds-page-skeleton__card" }, i)) });
|
|
2615
|
+
}
|
|
2616
|
+
function PageSkeletonForm({ fields = 3 }) {
|
|
2617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__form", children: Array.from({ length: fields }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fds-page-skeleton__field", children: [
|
|
2618
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: 120 }),
|
|
2619
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { height: 36 })
|
|
2620
|
+
] }, i)) });
|
|
2621
|
+
}
|
|
2622
|
+
function PageSkeletonSplit({ children, aside }) {
|
|
2623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fds-page-skeleton__split", children: [
|
|
2624
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__main", children }),
|
|
2625
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__aside", children: aside })
|
|
2626
|
+
] });
|
|
2627
|
+
}
|
|
2628
|
+
var PageSkeleton = Object.assign(PageSkeletonRoot, {
|
|
2629
|
+
Header: PageSkeletonHeader,
|
|
2630
|
+
Toolbar: PageSkeletonToolbar,
|
|
2631
|
+
Table: PageSkeletonTable,
|
|
2632
|
+
Cards: PageSkeletonCards,
|
|
2633
|
+
Form: PageSkeletonForm,
|
|
2634
|
+
Split: PageSkeletonSplit
|
|
2635
|
+
});
|
|
2369
2636
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2370
2637
|
0 && (module.exports = {
|
|
2371
2638
|
Accordion,
|
|
@@ -2380,9 +2647,11 @@ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
|
|
|
2380
2647
|
Callout,
|
|
2381
2648
|
Card,
|
|
2382
2649
|
Checkbox,
|
|
2650
|
+
Checklist,
|
|
2383
2651
|
DiffPropertyList,
|
|
2384
2652
|
DiffSection,
|
|
2385
2653
|
Divider,
|
|
2654
|
+
Drawer,
|
|
2386
2655
|
EmptyState,
|
|
2387
2656
|
IconButton,
|
|
2388
2657
|
Input,
|
|
@@ -2391,11 +2660,16 @@ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
|
|
|
2391
2660
|
MismatchCard,
|
|
2392
2661
|
Modal,
|
|
2393
2662
|
MultiSelect,
|
|
2663
|
+
NumberedSteps,
|
|
2664
|
+
OptionList,
|
|
2665
|
+
OptionRow,
|
|
2394
2666
|
PageHeader,
|
|
2667
|
+
PageSkeleton,
|
|
2395
2668
|
Pagination,
|
|
2396
2669
|
PricingCard,
|
|
2397
2670
|
Radio,
|
|
2398
2671
|
RadioCard,
|
|
2672
|
+
ResourceCard,
|
|
2399
2673
|
SearchInput,
|
|
2400
2674
|
SectionHeader,
|
|
2401
2675
|
SegmentedControl,
|
|
@@ -2411,6 +2685,7 @@ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
|
|
|
2411
2685
|
Stat,
|
|
2412
2686
|
StatusDot,
|
|
2413
2687
|
StepList,
|
|
2688
|
+
Stepper,
|
|
2414
2689
|
Swatch,
|
|
2415
2690
|
TabNav,
|
|
2416
2691
|
Table,
|