@usefidel/design-system 0.25.1 → 0.27.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 +579 -18
- package/dist/index.css +1366 -0
- package/dist/index.d.cts +379 -4
- package/dist/index.d.ts +379 -4
- package/dist/index.js +548 -9
- package/package.json +8 -3
package/dist/index.cjs
CHANGED
|
@@ -32,22 +32,37 @@ __export(index_exports, {
|
|
|
32
32
|
Callout: () => Callout,
|
|
33
33
|
Card: () => Card,
|
|
34
34
|
Checkbox: () => Checkbox,
|
|
35
|
+
Checklist: () => Checklist,
|
|
36
|
+
ColorRamp: () => ColorRamp,
|
|
37
|
+
DescriptionList: () => DescriptionList,
|
|
35
38
|
DiffPropertyList: () => DiffPropertyList,
|
|
36
39
|
DiffSection: () => DiffSection,
|
|
37
40
|
Divider: () => Divider,
|
|
41
|
+
Drawer: () => Drawer,
|
|
42
|
+
EasingCurve: () => EasingCurve,
|
|
38
43
|
EmptyState: () => EmptyState,
|
|
44
|
+
FilterChips: () => FilterChips,
|
|
39
45
|
IconButton: () => IconButton,
|
|
40
46
|
Input: () => Input,
|
|
47
|
+
ListCard: () => ListCard,
|
|
41
48
|
ListLabel: () => ListLabel,
|
|
49
|
+
MeasureList: () => MeasureList,
|
|
42
50
|
Menu: () => Menu,
|
|
51
|
+
Meter: () => Meter,
|
|
43
52
|
MismatchCard: () => MismatchCard,
|
|
44
53
|
Modal: () => Modal,
|
|
45
54
|
MultiSelect: () => MultiSelect,
|
|
55
|
+
NumberedSteps: () => NumberedSteps,
|
|
56
|
+
OptionList: () => OptionList,
|
|
57
|
+
OptionRow: () => OptionRow,
|
|
46
58
|
PageHeader: () => PageHeader,
|
|
59
|
+
PageSkeleton: () => PageSkeleton,
|
|
47
60
|
Pagination: () => Pagination,
|
|
61
|
+
PreviewCard: () => PreviewCard,
|
|
48
62
|
PricingCard: () => PricingCard,
|
|
49
63
|
Radio: () => Radio,
|
|
50
64
|
RadioCard: () => RadioCard,
|
|
65
|
+
ResourceCard: () => ResourceCard,
|
|
51
66
|
SearchInput: () => SearchInput,
|
|
52
67
|
SectionHeader: () => SectionHeader,
|
|
53
68
|
SegmentedControl: () => SegmentedControl,
|
|
@@ -63,14 +78,21 @@ __export(index_exports, {
|
|
|
63
78
|
Stat: () => Stat,
|
|
64
79
|
StatusDot: () => StatusDot,
|
|
65
80
|
StepList: () => StepList,
|
|
81
|
+
Stepper: () => Stepper,
|
|
66
82
|
Swatch: () => Swatch,
|
|
83
|
+
SwatchList: () => SwatchList,
|
|
67
84
|
TabNav: () => TabNav,
|
|
68
85
|
Table: () => Table,
|
|
69
86
|
Tag: () => Tag,
|
|
87
|
+
Tile: () => Tile,
|
|
70
88
|
Toast: () => Toast,
|
|
71
89
|
ToastRegion: () => ToastRegion,
|
|
72
90
|
Toggle: () => Toggle,
|
|
91
|
+
TokenSample: () => TokenSample,
|
|
73
92
|
Tooltip: () => Tooltip,
|
|
93
|
+
TypeSample: () => TypeSample,
|
|
94
|
+
TypeScale: () => TypeScale,
|
|
95
|
+
TypeSpecimen: () => TypeSpecimen,
|
|
74
96
|
WorkspaceAvatar: () => WorkspaceAvatar,
|
|
75
97
|
WorkspaceSwitcher: () => WorkspaceSwitcher,
|
|
76
98
|
breakpoints: () => breakpoints,
|
|
@@ -1022,12 +1044,23 @@ function Badge({ tone = "neutral", icon, className, children, ...rest }) {
|
|
|
1022
1044
|
}
|
|
1023
1045
|
|
|
1024
1046
|
// src/components/Tag/Tag.tsx
|
|
1047
|
+
var import_lucide_react = require("lucide-react");
|
|
1025
1048
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1026
|
-
function Tag({ dot, icon, className, children, ...rest }) {
|
|
1049
|
+
function Tag({ dot, icon, onRemove, removeLabel, className, children, ...rest }) {
|
|
1027
1050
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: ["fds-tag", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1028
1051
|
dot && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `fds-dot fds-dot--${dot}`, "aria-hidden": "true" }),
|
|
1029
1052
|
icon != null && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "fds-tag__icon", "aria-hidden": "true", children: icon }),
|
|
1030
|
-
children
|
|
1053
|
+
children,
|
|
1054
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1055
|
+
"button",
|
|
1056
|
+
{
|
|
1057
|
+
type: "button",
|
|
1058
|
+
className: "fds-tag__remove",
|
|
1059
|
+
"aria-label": `Remove ${removeLabel ?? (typeof children === "string" ? children : "")}`.trim(),
|
|
1060
|
+
onClick: onRemove,
|
|
1061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react.X, { "aria-hidden": "true" })
|
|
1062
|
+
}
|
|
1063
|
+
)
|
|
1031
1064
|
] });
|
|
1032
1065
|
}
|
|
1033
1066
|
|
|
@@ -1700,7 +1733,7 @@ function IconButton({
|
|
|
1700
1733
|
|
|
1701
1734
|
// src/components/Menu/Menu.tsx
|
|
1702
1735
|
var import_react17 = require("react");
|
|
1703
|
-
var
|
|
1736
|
+
var import_lucide_react2 = require("lucide-react");
|
|
1704
1737
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1705
1738
|
var isItem = (e) => !("type" in e);
|
|
1706
1739
|
function searchText(it) {
|
|
@@ -1856,7 +1889,7 @@ function Menu({
|
|
|
1856
1889
|
wired,
|
|
1857
1890
|
open && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: listClasses, onKeyDown: onListKeyDown, children: [
|
|
1858
1891
|
search && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "fds-menu__search", children: [
|
|
1859
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1892
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react2.Search, { "aria-hidden": "true" }),
|
|
1860
1893
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1861
1894
|
"input",
|
|
1862
1895
|
{
|
|
@@ -1912,7 +1945,7 @@ function Menu({
|
|
|
1912
1945
|
e.description != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fds-menu__description", children: e.description })
|
|
1913
1946
|
] }),
|
|
1914
1947
|
e.trailing != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fds-menu__trailing", children: e.trailing }),
|
|
1915
|
-
e.selected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1948
|
+
e.selected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react2.Check, { className: "fds-menu__check", "aria-hidden": "true" })
|
|
1916
1949
|
]
|
|
1917
1950
|
},
|
|
1918
1951
|
i
|
|
@@ -2101,12 +2134,12 @@ function Tooltip({ content, children, side = "right", delay = 400, disabled = fa
|
|
|
2101
2134
|
}
|
|
2102
2135
|
|
|
2103
2136
|
// src/components/BrandButton/BrandButton.tsx
|
|
2104
|
-
var
|
|
2137
|
+
var import_lucide_react3 = require("lucide-react");
|
|
2105
2138
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2106
2139
|
function BrandButton({ mark, hoverIcon, type = "button", className, ...rest }) {
|
|
2107
2140
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type, className: ["fds-brand-button", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2108
2141
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "fds-brand-button__mark", "aria-hidden": "true", children: mark }),
|
|
2109
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "fds-brand-button__hover", "aria-hidden": "true", children: hoverIcon ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2142
|
+
/* @__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, {}) })
|
|
2110
2143
|
] });
|
|
2111
2144
|
}
|
|
2112
2145
|
|
|
@@ -2146,7 +2179,7 @@ function SidebarItem({
|
|
|
2146
2179
|
|
|
2147
2180
|
// src/components/Sidebar/Sidebar.tsx
|
|
2148
2181
|
var import_react20 = require("react");
|
|
2149
|
-
var
|
|
2182
|
+
var import_lucide_react4 = require("lucide-react");
|
|
2150
2183
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2151
2184
|
function SidebarRoot({
|
|
2152
2185
|
collapsed: controlled,
|
|
@@ -2215,7 +2248,7 @@ function SidebarBrand({
|
|
|
2215
2248
|
{
|
|
2216
2249
|
variant: "ghost",
|
|
2217
2250
|
size: "small",
|
|
2218
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2251
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react4.PanelLeftClose, {}),
|
|
2219
2252
|
"aria-label": collapseLabel,
|
|
2220
2253
|
"aria-keyshortcuts": "Meta+Backslash Control+Backslash",
|
|
2221
2254
|
onClick: () => sidebar?.setCollapsed(true)
|
|
@@ -2273,7 +2306,7 @@ var Sidebar = Object.assign(SidebarRoot, {
|
|
|
2273
2306
|
|
|
2274
2307
|
// src/components/WorkspaceSwitcher/WorkspaceSwitcher.tsx
|
|
2275
2308
|
var import_react21 = require("react");
|
|
2276
|
-
var
|
|
2309
|
+
var import_lucide_react5 = require("lucide-react");
|
|
2277
2310
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2278
2311
|
function WorkspaceAvatar({ name }) {
|
|
2279
2312
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fds-workspace-avatar", "aria-hidden": "true", children: name.trim().charAt(0).toUpperCase() || "?" });
|
|
@@ -2294,7 +2327,7 @@ var WorkspaceSwitcher = (0, import_react21.forwardRef)(function WorkspaceSwitche
|
|
|
2294
2327
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "fds-workspace-switcher__text", "aria-hidden": iconOnly || void 0, children: [
|
|
2295
2328
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fds-workspace-switcher__name", children: name }),
|
|
2296
2329
|
plan && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fds-workspace-switcher__plan", children: plan }),
|
|
2297
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react5.ChevronDown, { className: "fds-workspace-switcher__chevron", "aria-hidden": "true" })
|
|
2298
2331
|
] })
|
|
2299
2332
|
]
|
|
2300
2333
|
}
|
|
@@ -2336,13 +2369,17 @@ var AppLayout = Object.assign(AppLayoutRoot, { Panel: AppLayoutPanel });
|
|
|
2336
2369
|
|
|
2337
2370
|
// src/components/PageHeader/PageHeader.tsx
|
|
2338
2371
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2339
|
-
function PageHeader({ title, description, breadcrumb, actions, className, children, ...rest }) {
|
|
2372
|
+
function PageHeader({ title, description, leading, meta, breadcrumb, actions, className, children, ...rest }) {
|
|
2340
2373
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("header", { className: ["fds-page-header", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2374
|
+
breadcrumb != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "fds-page-header__breadcrumb", children: breadcrumb }),
|
|
2341
2375
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fds-page-header__row", children: [
|
|
2342
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fds-page-
|
|
2343
|
-
|
|
2344
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.
|
|
2345
|
-
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fds-page-header__lead", children: [
|
|
2377
|
+
leading != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "fds-page-header__leading", children: leading }),
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fds-page-header__text", children: [
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h1", { className: "fds-page-header__title", children: title }),
|
|
2380
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "fds-page-header__description", children: description }),
|
|
2381
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "fds-page-header__meta", children: meta })
|
|
2382
|
+
] })
|
|
2346
2383
|
] }),
|
|
2347
2384
|
actions != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "fds-page-header__actions", children: actions })
|
|
2348
2385
|
] }),
|
|
@@ -2352,7 +2389,7 @@ function PageHeader({ title, description, breadcrumb, actions, className, childr
|
|
|
2352
2389
|
|
|
2353
2390
|
// src/components/Toast/Toast.tsx
|
|
2354
2391
|
var import_react23 = require("react");
|
|
2355
|
-
var
|
|
2392
|
+
var import_lucide_react6 = require("lucide-react");
|
|
2356
2393
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2357
2394
|
function ToastRegion({ className, children, ...rest }) {
|
|
2358
2395
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: ["fds-toast-region", className].filter(Boolean).join(" "), "aria-live": "polite", ...rest, children });
|
|
@@ -2366,7 +2403,509 @@ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
|
|
|
2366
2403
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { role: "status", className: ["fds-toast", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2367
2404
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "fds-toast__message", children }),
|
|
2368
2405
|
action && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: "fds-toast__action", onClick: action.onClick, children: action.label }),
|
|
2369
|
-
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)(
|
|
2406
|
+
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" }) })
|
|
2407
|
+
] });
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
// src/components/Stepper/Stepper.tsx
|
|
2411
|
+
var import_react24 = require("react");
|
|
2412
|
+
var import_lucide_react7 = require("lucide-react");
|
|
2413
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2414
|
+
function StepperStep(_) {
|
|
2415
|
+
return null;
|
|
2416
|
+
}
|
|
2417
|
+
function StepperRoot({ className, children, ...rest }) {
|
|
2418
|
+
const steps = import_react24.Children.toArray(children).filter(import_react24.isValidElement);
|
|
2419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ol", { className: ["fds-stepper", className].filter(Boolean).join(" "), ...rest, children: steps.map((step, i) => {
|
|
2420
|
+
const { status, children: label } = step.props;
|
|
2421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2422
|
+
"li",
|
|
2423
|
+
{
|
|
2424
|
+
className: `fds-stepper__step fds-stepper__step--${status}`,
|
|
2425
|
+
"aria-current": status === "current" ? "step" : void 0,
|
|
2426
|
+
children: [
|
|
2427
|
+
/* @__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 }),
|
|
2428
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fds-stepper__label", children: label })
|
|
2429
|
+
]
|
|
2430
|
+
},
|
|
2431
|
+
i
|
|
2432
|
+
);
|
|
2433
|
+
}) });
|
|
2434
|
+
}
|
|
2435
|
+
var Stepper = Object.assign(StepperRoot, { Step: StepperStep });
|
|
2436
|
+
|
|
2437
|
+
// src/components/NumberedSteps/NumberedSteps.tsx
|
|
2438
|
+
var import_react25 = require("react");
|
|
2439
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2440
|
+
function NumberedStepsRoot({ className, children, ...rest }) {
|
|
2441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("ol", { className: ["fds-numbered-steps", className].filter(Boolean).join(" "), ...rest, children: import_react25.Children.toArray(children) });
|
|
2442
|
+
}
|
|
2443
|
+
function NumberedStepsItem({ className, children, ...rest }) {
|
|
2444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("li", { className: ["fds-numbered-steps__item", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2445
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "fds-numbered-steps__marker", "aria-hidden": "true" }),
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "fds-numbered-steps__body", children })
|
|
2447
|
+
] });
|
|
2448
|
+
}
|
|
2449
|
+
var NumberedSteps = Object.assign(NumberedStepsRoot, { Item: NumberedStepsItem });
|
|
2450
|
+
|
|
2451
|
+
// src/components/OptionList/OptionList.tsx
|
|
2452
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2453
|
+
function OptionListRoot({ className, children, ...rest }) {
|
|
2454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: ["fds-option-list", className].filter(Boolean).join(" "), ...rest, children });
|
|
2455
|
+
}
|
|
2456
|
+
function OptionListLabel({ className, children, ...rest }) {
|
|
2457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: ["fds-option-list__label", className].filter(Boolean).join(" "), ...rest, children });
|
|
2458
|
+
}
|
|
2459
|
+
function OptionRow({ control = "radio", title, description, meta, className, checked, disabled, ...rest }) {
|
|
2460
|
+
const Control = control === "checkbox" ? Checkbox : Radio;
|
|
2461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2462
|
+
"div",
|
|
2463
|
+
{
|
|
2464
|
+
className: ["fds-option-row", checked ? "fds-option-row--checked" : "", className].filter(Boolean).join(" "),
|
|
2465
|
+
"data-disabled": disabled ? "" : void 0,
|
|
2466
|
+
children: [
|
|
2467
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Control, { label: title, description, checked, disabled, ...rest }),
|
|
2468
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "fds-option-row__meta", children: meta })
|
|
2469
|
+
]
|
|
2470
|
+
}
|
|
2471
|
+
);
|
|
2472
|
+
}
|
|
2473
|
+
var OptionList = Object.assign(OptionListRoot, { Label: OptionListLabel, Row: OptionRow });
|
|
2474
|
+
|
|
2475
|
+
// src/components/Checklist/Checklist.tsx
|
|
2476
|
+
var import_lucide_react8 = require("lucide-react");
|
|
2477
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2478
|
+
function ChecklistRoot({ title, className, children, ...rest }) {
|
|
2479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: ["fds-checklist", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2480
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "fds-checklist__title", children: title }),
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("ul", { className: "fds-checklist__items", children })
|
|
2482
|
+
] });
|
|
2483
|
+
}
|
|
2484
|
+
function ChecklistItem({ done, label, value }) {
|
|
2485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("li", { className: ["fds-checklist__item", done ? "fds-checklist__item--done" : ""].filter(Boolean).join(" "), children: [
|
|
2486
|
+
/* @__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, {}) }),
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fds-checklist__text", children: [
|
|
2488
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fds-checklist__label", children: label }),
|
|
2489
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fds-checklist__value", children: value })
|
|
2490
|
+
] })
|
|
2491
|
+
] });
|
|
2492
|
+
}
|
|
2493
|
+
var Checklist = Object.assign(ChecklistRoot, { Item: ChecklistItem });
|
|
2494
|
+
|
|
2495
|
+
// src/components/Drawer/Drawer.tsx
|
|
2496
|
+
var import_react26 = require("react");
|
|
2497
|
+
var import_react_dom3 = require("react-dom");
|
|
2498
|
+
var import_lucide_react9 = require("lucide-react");
|
|
2499
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2500
|
+
var FOCUSABLE2 = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
2501
|
+
function Drawer({ open, onClose, title, description, children, footer, dismissible = true }) {
|
|
2502
|
+
const titleId = (0, import_react26.useId)();
|
|
2503
|
+
const descriptionId = (0, import_react26.useId)();
|
|
2504
|
+
const panelRef = (0, import_react26.useRef)(null);
|
|
2505
|
+
const onCloseRef = (0, import_react26.useRef)(onClose);
|
|
2506
|
+
onCloseRef.current = onClose;
|
|
2507
|
+
const dismissibleRef = (0, import_react26.useRef)(dismissible);
|
|
2508
|
+
dismissibleRef.current = dismissible;
|
|
2509
|
+
(0, import_react26.useEffect)(() => {
|
|
2510
|
+
if (!open) return;
|
|
2511
|
+
const panel = panelRef.current;
|
|
2512
|
+
const previouslyFocused = document.activeElement;
|
|
2513
|
+
(panel?.querySelector("[data-autofocus]") ?? panel?.querySelector(`.fds-drawer__body ${FOCUSABLE2}`) ?? panel)?.focus();
|
|
2514
|
+
const previousOverflow = document.body.style.overflow;
|
|
2515
|
+
document.body.style.overflow = "hidden";
|
|
2516
|
+
const onKey = (e) => {
|
|
2517
|
+
if (e.key === "Escape" && dismissibleRef.current) {
|
|
2518
|
+
e.preventDefault();
|
|
2519
|
+
onCloseRef.current();
|
|
2520
|
+
return;
|
|
2521
|
+
}
|
|
2522
|
+
if (e.key === "Tab" && panel) {
|
|
2523
|
+
const focusable = Array.from(panel.querySelectorAll(FOCUSABLE2));
|
|
2524
|
+
if (focusable.length === 0) return;
|
|
2525
|
+
const first = focusable[0];
|
|
2526
|
+
const last = focusable[focusable.length - 1];
|
|
2527
|
+
if (e.shiftKey && (document.activeElement === first || document.activeElement === panel)) {
|
|
2528
|
+
e.preventDefault();
|
|
2529
|
+
last.focus();
|
|
2530
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
2531
|
+
e.preventDefault();
|
|
2532
|
+
first.focus();
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
};
|
|
2536
|
+
window.addEventListener("keydown", onKey);
|
|
2537
|
+
return () => {
|
|
2538
|
+
window.removeEventListener("keydown", onKey);
|
|
2539
|
+
document.body.style.overflow = previousOverflow;
|
|
2540
|
+
previouslyFocused?.focus?.();
|
|
2541
|
+
};
|
|
2542
|
+
}, [open]);
|
|
2543
|
+
if (!open || typeof document === "undefined") return null;
|
|
2544
|
+
return (0, import_react_dom3.createPortal)(
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2546
|
+
"div",
|
|
2547
|
+
{
|
|
2548
|
+
className: "fds-drawer__scrim",
|
|
2549
|
+
onMouseDown: (e) => {
|
|
2550
|
+
if (e.target === e.currentTarget && dismissible) onClose();
|
|
2551
|
+
},
|
|
2552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
2553
|
+
"div",
|
|
2554
|
+
{
|
|
2555
|
+
ref: panelRef,
|
|
2556
|
+
className: "fds-drawer",
|
|
2557
|
+
role: "dialog",
|
|
2558
|
+
"aria-modal": "true",
|
|
2559
|
+
"aria-labelledby": titleId,
|
|
2560
|
+
"aria-describedby": description != null ? descriptionId : void 0,
|
|
2561
|
+
tabIndex: -1,
|
|
2562
|
+
children: [
|
|
2563
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("header", { className: "fds-drawer__header", children: [
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fds-drawer__heading", children: [
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { id: titleId, className: "fds-drawer__title", children: title }),
|
|
2566
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: descriptionId, className: "fds-drawer__description", children: description })
|
|
2567
|
+
] }),
|
|
2568
|
+
/* @__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" }) })
|
|
2569
|
+
] }),
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "fds-drawer__body", children }),
|
|
2571
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("footer", { className: "fds-drawer__footer", children: footer })
|
|
2572
|
+
]
|
|
2573
|
+
}
|
|
2574
|
+
)
|
|
2575
|
+
}
|
|
2576
|
+
),
|
|
2577
|
+
document.body
|
|
2578
|
+
);
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
// src/components/ResourceCard/ResourceCard.tsx
|
|
2582
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2583
|
+
function ResourceCard({ icon, title, badge, meta, stats, action, variant = "default", className, ...rest }) {
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: ["fds-resource-card", `fds-resource-card--${variant}`, className].filter(Boolean).join(" "), ...rest, children: [
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fds-resource-card__main", children: [
|
|
2586
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fds-resource-card__title", children: [
|
|
2587
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fds-resource-card__icon", "aria-hidden": "true", children: icon }),
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: title }),
|
|
2589
|
+
badge
|
|
2590
|
+
] }),
|
|
2591
|
+
meta?.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fds-resource-card__meta", children: line }, i))
|
|
2592
|
+
] }),
|
|
2593
|
+
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: [
|
|
2594
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("dt", { children: s.label }),
|
|
2595
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("dd", { children: s.value })
|
|
2596
|
+
] }, i)) }),
|
|
2597
|
+
action != null && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fds-resource-card__action", children: action })
|
|
2598
|
+
] });
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
// src/components/PageSkeleton/PageSkeleton.tsx
|
|
2602
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2603
|
+
function PageSkeletonRoot({ label = "Loading", children }) {
|
|
2604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SkeletonGroup, { label, className: "fds-page-skeleton", children });
|
|
2605
|
+
}
|
|
2606
|
+
function PageSkeletonHeader({ title, description, breadcrumb, action, tabs = 0 }) {
|
|
2607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2608
|
+
PageHeader,
|
|
2609
|
+
{
|
|
2610
|
+
breadcrumb: breadcrumb ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: 140 }) : void 0,
|
|
2611
|
+
title: title ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 220, height: 28 }),
|
|
2612
|
+
description: description === true ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: 320 }) : description || void 0,
|
|
2613
|
+
actions: action ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 128, height: 36 }) : void 0,
|
|
2614
|
+
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)) })
|
|
2615
|
+
}
|
|
2616
|
+
);
|
|
2617
|
+
}
|
|
2618
|
+
function PageSkeletonToolbar({ filters = 2 }) {
|
|
2619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fds-page-skeleton__toolbar", children: [
|
|
2620
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 280, height: 36 }),
|
|
2621
|
+
Array.from({ length: filters }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { width: 140, height: 36 }, i))
|
|
2622
|
+
] });
|
|
2623
|
+
}
|
|
2624
|
+
function PageSkeletonTable({ rows = 5, columns = 5 }) {
|
|
2625
|
+
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}`));
|
|
2626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fds-page-skeleton__table", style: { ["--fds-page-skeleton-columns"]: columns }, children: [
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__row fds-page-skeleton__row--head", children: cells("h", "40%") }),
|
|
2628
|
+
Array.from({ length: rows }, (_, r) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__row", children: cells(`r${r}`, "50%") }, r))
|
|
2629
|
+
] });
|
|
2630
|
+
}
|
|
2631
|
+
function PageSkeletonCards({ count = 3, height = 120, columns = 3 }) {
|
|
2632
|
+
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)) });
|
|
2633
|
+
}
|
|
2634
|
+
function PageSkeletonForm({ fields = 3 }) {
|
|
2635
|
+
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: [
|
|
2636
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { shape: "text", width: 120 }),
|
|
2637
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { height: 36 })
|
|
2638
|
+
] }, i)) });
|
|
2639
|
+
}
|
|
2640
|
+
function PageSkeletonSplit({ children, aside }) {
|
|
2641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fds-page-skeleton__split", children: [
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__main", children }),
|
|
2643
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fds-page-skeleton__aside", children: aside })
|
|
2644
|
+
] });
|
|
2645
|
+
}
|
|
2646
|
+
var PageSkeleton = Object.assign(PageSkeletonRoot, {
|
|
2647
|
+
Header: PageSkeletonHeader,
|
|
2648
|
+
Toolbar: PageSkeletonToolbar,
|
|
2649
|
+
Table: PageSkeletonTable,
|
|
2650
|
+
Cards: PageSkeletonCards,
|
|
2651
|
+
Form: PageSkeletonForm,
|
|
2652
|
+
Split: PageSkeletonSplit
|
|
2653
|
+
});
|
|
2654
|
+
|
|
2655
|
+
// src/components/PreviewCard/PreviewCard.tsx
|
|
2656
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2657
|
+
function PreviewCardRoot({ as, variant = "default", className, ...rest }) {
|
|
2658
|
+
const Root = as ?? "div";
|
|
2659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Root, { className: ["fds-preview-card", `fds-preview-card--${variant}`, className].filter(Boolean).join(" "), ...rest });
|
|
2660
|
+
}
|
|
2661
|
+
function PreviewCardPreview({ label, className, children, ...rest }) {
|
|
2662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: ["fds-preview-card__preview", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2663
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "fds-preview-card__label", children: label }),
|
|
2664
|
+
children
|
|
2665
|
+
] });
|
|
2666
|
+
}
|
|
2667
|
+
function PreviewCardTitle({ aside, className, children, ...rest }) {
|
|
2668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: ["fds-preview-card__title", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2669
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "fds-preview-card__name", children }),
|
|
2670
|
+
aside != null && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "fds-preview-card__aside", children: aside })
|
|
2671
|
+
] });
|
|
2672
|
+
}
|
|
2673
|
+
function part(name) {
|
|
2674
|
+
return function PreviewCardPart({ className, ...rest }) {
|
|
2675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: [`fds-preview-card__${name}`, className].filter(Boolean).join(" "), ...rest });
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
var PreviewCard = Object.assign(PreviewCardRoot, {
|
|
2679
|
+
Preview: PreviewCardPreview,
|
|
2680
|
+
Body: part("body"),
|
|
2681
|
+
Title: PreviewCardTitle,
|
|
2682
|
+
Meta: part("meta"),
|
|
2683
|
+
Footer: part("footer")
|
|
2684
|
+
});
|
|
2685
|
+
|
|
2686
|
+
// src/components/Tile/Tile.tsx
|
|
2687
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2688
|
+
function Tile({ label, aside, className, children, ...rest }) {
|
|
2689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("section", { className: ["fds-tile", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2690
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("header", { className: "fds-tile__head", children: [
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fds-tile__label", children: label }),
|
|
2692
|
+
aside
|
|
2693
|
+
] }),
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "fds-tile__body", children })
|
|
2695
|
+
] });
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
// src/components/ListCard/ListCard.tsx
|
|
2699
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2700
|
+
function ListCardRoot({ title, count, aside, footer, className, children, ...rest }) {
|
|
2701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { className: ["fds-list-card", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2702
|
+
(title != null || aside != null) && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("header", { className: "fds-list-card__head", children: [
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "fds-list-card__title", children: [
|
|
2704
|
+
title,
|
|
2705
|
+
count != null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fds-list-card__count", children: count })
|
|
2706
|
+
] }),
|
|
2707
|
+
aside != null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fds-list-card__aside", children: aside })
|
|
2708
|
+
] }),
|
|
2709
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "fds-list-card__rows", children }),
|
|
2710
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("footer", { className: "fds-list-card__footer", children: footer })
|
|
2711
|
+
] });
|
|
2712
|
+
}
|
|
2713
|
+
function ListCardRow({ icon, tone = "neutral", title, description, trailing, muted, className, ...rest }) {
|
|
2714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("li", { className: ["fds-list-card__row", muted ? "fds-list-card__row--muted" : "", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2715
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: `fds-list-card__icon fds-list-card__icon--${tone}`, "aria-hidden": "true", children: icon }),
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "fds-list-card__text", children: [
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fds-list-card__row-title", children: title }),
|
|
2718
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fds-list-card__description", children: description })
|
|
2719
|
+
] }),
|
|
2720
|
+
trailing != null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fds-list-card__trailing", children: trailing })
|
|
2721
|
+
] });
|
|
2722
|
+
}
|
|
2723
|
+
var ListCard = Object.assign(ListCardRoot, { Row: ListCardRow });
|
|
2724
|
+
|
|
2725
|
+
// src/components/DescriptionList/DescriptionList.tsx
|
|
2726
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2727
|
+
function DescriptionList({ title, action, items = [], note, className, children, ...rest }) {
|
|
2728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("section", { className: ["fds-description-list", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2729
|
+
(title != null || action != null) && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("header", { className: "fds-description-list__head", children: [
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fds-description-list__title", children: title }),
|
|
2731
|
+
action != null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fds-description-list__action", children: action })
|
|
2732
|
+
] }),
|
|
2733
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("dl", { className: "fds-description-list__items", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "fds-description-list__item", children: [
|
|
2734
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("dt", { children: item.label }),
|
|
2735
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("dd", { children: item.value })
|
|
2736
|
+
] }, i)) }),
|
|
2737
|
+
children,
|
|
2738
|
+
note != null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "fds-description-list__note", children: note })
|
|
2739
|
+
] });
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
// src/components/ColorRamp/ColorRamp.tsx
|
|
2743
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2744
|
+
function ColorRamp({ colors, size = "md", className, ...rest }) {
|
|
2745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: ["fds-color-ramp", `fds-color-ramp--${size}`, className].filter(Boolean).join(" "), "aria-hidden": "true", ...rest, children: colors.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "fds-color-ramp__step", style: { "--fds-ramp-color": c } }, i)) });
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
// src/components/SwatchList/SwatchList.tsx
|
|
2749
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2750
|
+
function SwatchList({ items, className, ...rest }) {
|
|
2751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("ul", { className: ["fds-swatch-list", className].filter(Boolean).join(" "), ...rest, children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("li", { className: "fds-swatch-list__item", children: [
|
|
2752
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2753
|
+
"span",
|
|
2754
|
+
{
|
|
2755
|
+
className: ["fds-swatch-list__dot", item.color ? "" : "fds-swatch-list__dot--empty"].filter(Boolean).join(" "),
|
|
2756
|
+
style: item.color ? { "--fds-swatch-list-color": item.color } : void 0,
|
|
2757
|
+
"aria-hidden": "true"
|
|
2758
|
+
}
|
|
2759
|
+
),
|
|
2760
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "fds-swatch-list__name", children: item.name }),
|
|
2761
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "fds-swatch-list__value", children: item.value })
|
|
2762
|
+
] }, i)) });
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
// src/components/TypeSpecimen/TypeSpecimen.tsx
|
|
2766
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2767
|
+
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789";
|
|
2768
|
+
function TypeSpecimen({ family, fontFamily, tokens, sample, weights = [], footer, className, ...rest }) {
|
|
2769
|
+
const face = { "--fds-specimen-font": fontFamily };
|
|
2770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("section", { className: ["fds-type-specimen", className].filter(Boolean).join(" "), style: face, ...rest, children: [
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("header", { className: "fds-type-specimen__head", children: [
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "fds-type-specimen__titles", children: [
|
|
2773
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("h3", { className: "fds-type-specimen__family", children: family }),
|
|
2774
|
+
tokens != null && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "fds-type-specimen__tokens", children: tokens })
|
|
2775
|
+
] }),
|
|
2776
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fds-type-specimen__glyph", "aria-hidden": "true", children: "Aa" })
|
|
2777
|
+
] }),
|
|
2778
|
+
sample != null && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "fds-type-specimen__sample", children: sample }),
|
|
2779
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "fds-type-specimen__alphabet", children: ALPHABET }),
|
|
2780
|
+
weights.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("ul", { className: "fds-type-specimen__weights", children: weights.map((w) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("li", { children: [
|
|
2781
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { style: { fontWeight: w.weight }, children: "Ag" }),
|
|
2782
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("small", { children: w.label })
|
|
2783
|
+
] }, w.label)) }),
|
|
2784
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("footer", { className: "fds-type-specimen__footer", children: footer })
|
|
2785
|
+
] });
|
|
2786
|
+
}
|
|
2787
|
+
function TypeSample({ fontFamily, caption, className, ...rest }) {
|
|
2788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: ["fds-type-sample", className].filter(Boolean).join(" "), style: { "--fds-specimen-font": fontFamily }, ...rest, children: [
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fds-type-sample__glyph", "aria-hidden": "true", children: "Aa" }),
|
|
2790
|
+
caption != null && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fds-type-sample__caption", children: caption })
|
|
2791
|
+
] });
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
// src/components/TypeScale/TypeScale.tsx
|
|
2795
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2796
|
+
function TypeScaleRoot({ className, ...rest }) {
|
|
2797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("ul", { className: ["fds-type-scale", className].filter(Boolean).join(" "), ...rest });
|
|
2798
|
+
}
|
|
2799
|
+
function TypeScaleRow({ name, detail, sampleStyle, sample = "Check every pull request", className, ...rest }) {
|
|
2800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("li", { className: ["fds-type-scale__row", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "fds-type-scale__label", children: [
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "fds-type-scale__name", children: name }),
|
|
2803
|
+
detail != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "fds-type-scale__detail", children: detail })
|
|
2804
|
+
] }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "fds-type-scale__sample", style: sampleStyle, children: sample })
|
|
2806
|
+
] });
|
|
2807
|
+
}
|
|
2808
|
+
var TypeScale = Object.assign(TypeScaleRoot, { Row: TypeScaleRow });
|
|
2809
|
+
|
|
2810
|
+
// src/components/MeasureList/MeasureList.tsx
|
|
2811
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2812
|
+
function MeasureList({ items, max, tone = "accent", className, ...rest }) {
|
|
2813
|
+
const top = max ?? Math.max(1, ...items.map((i) => i.amount));
|
|
2814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("ul", { className: ["fds-measure-list", `fds-measure-list--${tone}`, className].filter(Boolean).join(" "), ...rest, children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("li", { className: "fds-measure-list__item", children: [
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fds-measure-list__name", children: item.name }),
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fds-measure-list__value", children: item.value }),
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fds-measure-list__track", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fds-measure-list__bar", style: { "--fds-measure": `${Math.min(100, item.amount / top * 100)}%` } }) })
|
|
2818
|
+
] }, i)) });
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
// src/components/TokenSample/TokenSample.tsx
|
|
2822
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2823
|
+
function TokenSample({ kind, value, name, detail, className, ...rest }) {
|
|
2824
|
+
const style = { [kind === "radius" ? "--fds-sample-radius" : "--fds-sample-shadow"]: value };
|
|
2825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: ["fds-token-sample", `fds-token-sample--${kind}`, className].filter(Boolean).join(" "), ...rest, children: [
|
|
2826
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "fds-token-sample__shape", style, "aria-hidden": "true" }),
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "fds-token-sample__name", children: name }),
|
|
2828
|
+
detail != null && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "fds-token-sample__detail", children: detail })
|
|
2829
|
+
] });
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
// src/components/EasingCurve/EasingCurve.tsx
|
|
2833
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2834
|
+
var BEZIER = /cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)/;
|
|
2835
|
+
var W = 120;
|
|
2836
|
+
var H = 72;
|
|
2837
|
+
var PAD = 12;
|
|
2838
|
+
function easingPath(value) {
|
|
2839
|
+
const m = BEZIER.exec(value);
|
|
2840
|
+
const [x1, y1, x2, y2] = m ? m.slice(1).map(Number) : [0, 0, 1, 1];
|
|
2841
|
+
const x = (t) => PAD + t * (W - PAD * 2);
|
|
2842
|
+
const y = (t) => H - PAD - t * (H - PAD * 2);
|
|
2843
|
+
return `M${x(0)},${y(0)} C${x(x1)},${y(y1)} ${x(x2)},${y(y2)} ${x(1)},${y(1)}`;
|
|
2844
|
+
}
|
|
2845
|
+
function EasingCurve({ value, name, className, ...rest }) {
|
|
2846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: ["fds-easing-curve", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2847
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("svg", { className: "fds-easing-curve__plot", viewBox: `0 0 ${W} ${H}`, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { d: easingPath(value) }) }),
|
|
2848
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "fds-easing-curve__name", children: name }),
|
|
2849
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "fds-easing-curve__value", children: value })
|
|
2850
|
+
] });
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2853
|
+
// src/components/FilterChips/FilterChips.tsx
|
|
2854
|
+
var import_react27 = require("react");
|
|
2855
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2856
|
+
function FilterChips({ options, value, onChange, "aria-label": ariaLabel, className }) {
|
|
2857
|
+
const refs = (0, import_react27.useRef)([]);
|
|
2858
|
+
const onKeyDown = (e, index) => {
|
|
2859
|
+
const step = e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 0;
|
|
2860
|
+
if (!step) return;
|
|
2861
|
+
e.preventDefault();
|
|
2862
|
+
const next = (index + step + options.length) % options.length;
|
|
2863
|
+
onChange(options[next].value);
|
|
2864
|
+
refs.current[next]?.focus();
|
|
2865
|
+
};
|
|
2866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { role: "radiogroup", "aria-label": ariaLabel, className: ["fds-filter-chips", className].filter(Boolean).join(" "), children: options.map((o, i) => {
|
|
2867
|
+
const selected = o.value === value;
|
|
2868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
2869
|
+
"button",
|
|
2870
|
+
{
|
|
2871
|
+
ref: (el) => {
|
|
2872
|
+
refs.current[i] = el;
|
|
2873
|
+
},
|
|
2874
|
+
type: "button",
|
|
2875
|
+
role: "radio",
|
|
2876
|
+
"aria-checked": selected,
|
|
2877
|
+
tabIndex: selected ? 0 : -1,
|
|
2878
|
+
className: ["fds-filter-chips__chip", selected ? "fds-filter-chips__chip--selected" : ""].filter(Boolean).join(" "),
|
|
2879
|
+
onClick: () => onChange(o.value),
|
|
2880
|
+
onKeyDown: (e) => onKeyDown(e, i),
|
|
2881
|
+
children: [
|
|
2882
|
+
o.label,
|
|
2883
|
+
o.count != null && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fds-filter-chips__count", children: o.count })
|
|
2884
|
+
]
|
|
2885
|
+
},
|
|
2886
|
+
o.value
|
|
2887
|
+
);
|
|
2888
|
+
}) });
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
// src/components/Meter/Meter.tsx
|
|
2892
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2893
|
+
function Meter({ value, max, label, className, ...rest }) {
|
|
2894
|
+
const pct = max > 0 ? Math.min(100, Math.max(0, value / max * 100)) : 0;
|
|
2895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: ["fds-meter", className].filter(Boolean).join(" "), ...rest, children: [
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2897
|
+
"span",
|
|
2898
|
+
{
|
|
2899
|
+
className: "fds-meter__track",
|
|
2900
|
+
role: "meter",
|
|
2901
|
+
"aria-valuemin": 0,
|
|
2902
|
+
"aria-valuemax": max,
|
|
2903
|
+
"aria-valuenow": value,
|
|
2904
|
+
"aria-label": typeof label === "string" ? label : void 0,
|
|
2905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "fds-meter__fill", style: { "--fds-meter": `${pct}%` } })
|
|
2906
|
+
}
|
|
2907
|
+
),
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "fds-meter__label", children: label })
|
|
2370
2909
|
] });
|
|
2371
2910
|
}
|
|
2372
2911
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2383,22 +2922,37 @@ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
|
|
|
2383
2922
|
Callout,
|
|
2384
2923
|
Card,
|
|
2385
2924
|
Checkbox,
|
|
2925
|
+
Checklist,
|
|
2926
|
+
ColorRamp,
|
|
2927
|
+
DescriptionList,
|
|
2386
2928
|
DiffPropertyList,
|
|
2387
2929
|
DiffSection,
|
|
2388
2930
|
Divider,
|
|
2931
|
+
Drawer,
|
|
2932
|
+
EasingCurve,
|
|
2389
2933
|
EmptyState,
|
|
2934
|
+
FilterChips,
|
|
2390
2935
|
IconButton,
|
|
2391
2936
|
Input,
|
|
2937
|
+
ListCard,
|
|
2392
2938
|
ListLabel,
|
|
2939
|
+
MeasureList,
|
|
2393
2940
|
Menu,
|
|
2941
|
+
Meter,
|
|
2394
2942
|
MismatchCard,
|
|
2395
2943
|
Modal,
|
|
2396
2944
|
MultiSelect,
|
|
2945
|
+
NumberedSteps,
|
|
2946
|
+
OptionList,
|
|
2947
|
+
OptionRow,
|
|
2397
2948
|
PageHeader,
|
|
2949
|
+
PageSkeleton,
|
|
2398
2950
|
Pagination,
|
|
2951
|
+
PreviewCard,
|
|
2399
2952
|
PricingCard,
|
|
2400
2953
|
Radio,
|
|
2401
2954
|
RadioCard,
|
|
2955
|
+
ResourceCard,
|
|
2402
2956
|
SearchInput,
|
|
2403
2957
|
SectionHeader,
|
|
2404
2958
|
SegmentedControl,
|
|
@@ -2414,14 +2968,21 @@ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
|
|
|
2414
2968
|
Stat,
|
|
2415
2969
|
StatusDot,
|
|
2416
2970
|
StepList,
|
|
2971
|
+
Stepper,
|
|
2417
2972
|
Swatch,
|
|
2973
|
+
SwatchList,
|
|
2418
2974
|
TabNav,
|
|
2419
2975
|
Table,
|
|
2420
2976
|
Tag,
|
|
2977
|
+
Tile,
|
|
2421
2978
|
Toast,
|
|
2422
2979
|
ToastRegion,
|
|
2423
2980
|
Toggle,
|
|
2981
|
+
TokenSample,
|
|
2424
2982
|
Tooltip,
|
|
2983
|
+
TypeSample,
|
|
2984
|
+
TypeScale,
|
|
2985
|
+
TypeSpecimen,
|
|
2425
2986
|
WorkspaceAvatar,
|
|
2426
2987
|
WorkspaceSwitcher,
|
|
2427
2988
|
breakpoints,
|