@usefidel/design-system 0.18.0 → 0.19.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 +331 -13
- package/dist/index.css +628 -1
- package/dist/index.d.cts +161 -8
- package/dist/index.d.ts +161 -8
- package/dist/index.js +332 -13
- package/package.json +1 -1
package/dist/fidel.manifest.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -32,10 +32,14 @@ __export(index_exports, {
|
|
|
32
32
|
DiffPropertyList: () => DiffPropertyList,
|
|
33
33
|
DiffSection: () => DiffSection,
|
|
34
34
|
EmptyState: () => EmptyState,
|
|
35
|
+
IconButton: () => IconButton,
|
|
36
|
+
Input: () => Input,
|
|
37
|
+
Menu: () => Menu,
|
|
35
38
|
MismatchCard: () => MismatchCard,
|
|
36
39
|
Modal: () => Modal,
|
|
37
40
|
MultiSelect: () => MultiSelect,
|
|
38
41
|
Pagination: () => Pagination,
|
|
42
|
+
PricingCard: () => PricingCard,
|
|
39
43
|
Radio: () => Radio,
|
|
40
44
|
SearchInput: () => SearchInput,
|
|
41
45
|
SectionHeader: () => SectionHeader,
|
|
@@ -49,6 +53,7 @@ __export(index_exports, {
|
|
|
49
53
|
Stat: () => Stat,
|
|
50
54
|
StepList: () => StepList,
|
|
51
55
|
TabNav: () => TabNav,
|
|
56
|
+
Table: () => Table,
|
|
52
57
|
Tag: () => Tag,
|
|
53
58
|
Toggle: () => Toggle,
|
|
54
59
|
breakpoints: () => breakpoints
|
|
@@ -407,7 +412,11 @@ var Select = (0, import_react3.forwardRef)(function Select2({
|
|
|
407
412
|
id,
|
|
408
413
|
name,
|
|
409
414
|
className,
|
|
410
|
-
containerClassName
|
|
415
|
+
containerClassName,
|
|
416
|
+
variant = "field",
|
|
417
|
+
size = "medium",
|
|
418
|
+
align = "start",
|
|
419
|
+
"aria-label": ariaLabel
|
|
411
420
|
}, ref) {
|
|
412
421
|
const genId = (0, import_react3.useId)();
|
|
413
422
|
const triggerId = id ?? genId;
|
|
@@ -426,7 +435,7 @@ var Select = (0, import_react3.forwardRef)(function Select2({
|
|
|
426
435
|
if (!searchable || !query.trim()) return options;
|
|
427
436
|
const q = query.trim().toLowerCase();
|
|
428
437
|
return options.filter(
|
|
429
|
-
(o) => o.label.toLowerCase().includes(q) || (o.secondary?.toLowerCase().includes(q) ?? false)
|
|
438
|
+
(o) => o.label.toLowerCase().includes(q) || (o.secondary?.toLowerCase().includes(q) ?? false) || (o.description?.toLowerCase().includes(q) ?? false)
|
|
430
439
|
);
|
|
431
440
|
}, [options, searchable, query]);
|
|
432
441
|
const hasMessage = Boolean(error ?? hint);
|
|
@@ -509,6 +518,8 @@ var Select = (0, import_react3.forwardRef)(function Select2({
|
|
|
509
518
|
};
|
|
510
519
|
const triggerClasses = [
|
|
511
520
|
"fds-select__trigger",
|
|
521
|
+
variant === "inline" ? "fds-select__trigger--inline" : "",
|
|
522
|
+
size === "small" ? "fds-select__trigger--small" : "",
|
|
512
523
|
error ? "fds-select__trigger--error" : "",
|
|
513
524
|
open ? "fds-select__trigger--open" : "",
|
|
514
525
|
className
|
|
@@ -517,7 +528,7 @@ var Select = (0, import_react3.forwardRef)(function Select2({
|
|
|
517
528
|
"div",
|
|
518
529
|
{
|
|
519
530
|
ref: rootRef,
|
|
520
|
-
className: ["fds-select-field", containerClassName].filter(Boolean).join(" "),
|
|
531
|
+
className: ["fds-select-field", variant === "inline" ? "fds-select-field--inline" : "", containerClassName].filter(Boolean).join(" "),
|
|
521
532
|
children: [
|
|
522
533
|
label != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: triggerId, className: "fds-select__label", children: label }),
|
|
523
534
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fds-select", children: [
|
|
@@ -534,6 +545,7 @@ var Select = (0, import_react3.forwardRef)(function Select2({
|
|
|
534
545
|
"aria-controls": open ? listId : void 0,
|
|
535
546
|
"aria-invalid": error ? true : void 0,
|
|
536
547
|
"aria-describedby": hasMessage ? msgId : void 0,
|
|
548
|
+
"aria-label": ariaLabel,
|
|
537
549
|
onClick: () => !disabled && setOpen((o) => !o),
|
|
538
550
|
onKeyDown,
|
|
539
551
|
children: [
|
|
@@ -549,7 +561,7 @@ var Select = (0, import_react3.forwardRef)(function Select2({
|
|
|
549
561
|
]
|
|
550
562
|
}
|
|
551
563
|
),
|
|
552
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className:
|
|
564
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `fds-select__popover fds-select__popover--${align}`, children: [
|
|
553
565
|
searchable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fds-select__search", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
554
566
|
"input",
|
|
555
567
|
{
|
|
@@ -594,9 +606,12 @@ var Select = (0, import_react3.forwardRef)(function Select2({
|
|
|
594
606
|
onClick: () => choose(i),
|
|
595
607
|
children: [
|
|
596
608
|
o.avatar != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fds-select__optAvatar", children: o.avatar }),
|
|
597
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "fds-
|
|
598
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.
|
|
599
|
-
|
|
609
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "fds-select__optBody", children: [
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "fds-select__optText", children: [
|
|
611
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fds-select__optLabel", children: o.label }),
|
|
612
|
+
o.secondary != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fds-select__optSecondary", children: o.secondary })
|
|
613
|
+
] }),
|
|
614
|
+
o.description != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fds-select__optDescription", children: o.description })
|
|
600
615
|
] }),
|
|
601
616
|
o.value === value && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fds-select__check", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckIcon, {}) })
|
|
602
617
|
]
|
|
@@ -858,6 +873,7 @@ function SegmentedControl({
|
|
|
858
873
|
value,
|
|
859
874
|
onChange,
|
|
860
875
|
"aria-label": ariaLabel,
|
|
876
|
+
variant = "underline",
|
|
861
877
|
className
|
|
862
878
|
}) {
|
|
863
879
|
const refs = (0, import_react8.useRef)([]);
|
|
@@ -874,7 +890,7 @@ function SegmentedControl({
|
|
|
874
890
|
onChange(options[next].value);
|
|
875
891
|
refs.current[next]?.focus();
|
|
876
892
|
};
|
|
877
|
-
const classes = ["fds-segmented", className].filter(Boolean).join(" ");
|
|
893
|
+
const classes = ["fds-segmented", variant === "pill" ? "fds-segmented--pill" : "", className].filter(Boolean).join(" ");
|
|
878
894
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { role: "tablist", "aria-label": ariaLabel, className: classes, children: options.map((option, i) => {
|
|
879
895
|
const selected = option.value === value;
|
|
880
896
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
@@ -1003,11 +1019,17 @@ var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
|
1003
1019
|
function ChevronIcon2() {
|
|
1004
1020
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 20 20", width: "20", height: "20", fill: "none", "aria-hidden": "true", className: "fds-multiselect__chevronIcon", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1005
1021
|
}
|
|
1022
|
+
function RemoveIcon() {
|
|
1023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 12 12", width: "10", height: "10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M3 3l6 6M9 3L3 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
|
|
1024
|
+
}
|
|
1006
1025
|
function CheckIcon2() {
|
|
1007
1026
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 12 12", width: "12", height: "12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M10 3L4.5 8.5 2 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1008
1027
|
}
|
|
1009
1028
|
function MultiSelect({
|
|
1010
1029
|
label,
|
|
1030
|
+
variant = "filter",
|
|
1031
|
+
placeholder,
|
|
1032
|
+
showActions,
|
|
1011
1033
|
options,
|
|
1012
1034
|
value,
|
|
1013
1035
|
onChange,
|
|
@@ -1078,8 +1100,59 @@ function MultiSelect({
|
|
|
1078
1100
|
}
|
|
1079
1101
|
};
|
|
1080
1102
|
const triggerClasses = ["fds-multiselect__trigger", open ? "fds-multiselect__trigger--open" : ""].filter(Boolean).join(" ");
|
|
1081
|
-
|
|
1082
|
-
|
|
1103
|
+
const isField = variant === "field";
|
|
1104
|
+
const withActions = showActions ?? !isField;
|
|
1105
|
+
const chosen = options.filter((o) => selected.has(o.value));
|
|
1106
|
+
const fieldBox = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1107
|
+
"div",
|
|
1108
|
+
{
|
|
1109
|
+
className: ["fds-multiselect__fieldBox", open ? "fds-multiselect__fieldBox--open" : "", disabled ? "fds-multiselect__fieldBox--disabled" : ""].filter(Boolean).join(" "),
|
|
1110
|
+
onClick: (e) => {
|
|
1111
|
+
if (disabled || e.target.closest("button")) return;
|
|
1112
|
+
setActiveIndex(0);
|
|
1113
|
+
setOpen((o) => !o);
|
|
1114
|
+
},
|
|
1115
|
+
children: [
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "fds-multiselect__chips", children: [
|
|
1117
|
+
chosen.length === 0 && placeholder != null && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fds-multiselect__placeholder", children: placeholder }),
|
|
1118
|
+
chosen.map((o) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "fds-multiselect__chip", children: [
|
|
1119
|
+
o.label,
|
|
1120
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1121
|
+
"button",
|
|
1122
|
+
{
|
|
1123
|
+
type: "button",
|
|
1124
|
+
className: "fds-multiselect__chipRemove",
|
|
1125
|
+
"aria-label": `Remove ${o.label}`,
|
|
1126
|
+
disabled,
|
|
1127
|
+
onClick: () => toggle(o),
|
|
1128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(RemoveIcon, {})
|
|
1129
|
+
}
|
|
1130
|
+
)
|
|
1131
|
+
] }, o.value))
|
|
1132
|
+
] }),
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1134
|
+
"button",
|
|
1135
|
+
{
|
|
1136
|
+
type: "button",
|
|
1137
|
+
id: triggerId,
|
|
1138
|
+
ref: triggerRef,
|
|
1139
|
+
className: "fds-multiselect__fieldBoxToggle",
|
|
1140
|
+
disabled,
|
|
1141
|
+
"aria-haspopup": "listbox",
|
|
1142
|
+
"aria-expanded": open,
|
|
1143
|
+
"aria-controls": open ? listId : void 0,
|
|
1144
|
+
"aria-label": `${label}: ${chosen.length === 0 ? "none chosen" : `${chosen.length} chosen`}`,
|
|
1145
|
+
onClick: () => setOpen((o) => !o),
|
|
1146
|
+
onKeyDown: onTriggerKeyDown,
|
|
1147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: `fds-multiselect__chevron${open ? " fds-multiselect__chevron--open" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronIcon2, {}) })
|
|
1148
|
+
}
|
|
1149
|
+
)
|
|
1150
|
+
]
|
|
1151
|
+
}
|
|
1152
|
+
);
|
|
1153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: rootRef, className: ["fds-multiselect", isField ? "fds-multiselect--field" : "", className].filter(Boolean).join(" "), children: [
|
|
1154
|
+
isField && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: triggerId, className: "fds-multiselect__fieldLabel", children: label }),
|
|
1155
|
+
isField ? fieldBox : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1083
1156
|
"button",
|
|
1084
1157
|
{
|
|
1085
1158
|
type: "button",
|
|
@@ -1145,7 +1218,7 @@ function MultiSelect({
|
|
|
1145
1218
|
})
|
|
1146
1219
|
}
|
|
1147
1220
|
),
|
|
1148
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "fds-multiselect__footer", children: [
|
|
1221
|
+
withActions && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "fds-multiselect__footer", children: [
|
|
1149
1222
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "fds-multiselect__action", onClick: () => onChange(enabled.map((o) => o.value)), children: selectAllLabel }),
|
|
1150
1223
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "fds-multiselect__action", onClick: () => onChange([]), children: clearLabel })
|
|
1151
1224
|
] })
|
|
@@ -1229,8 +1302,8 @@ function Pagination({ page, pageCount, onPageChange, total, pageSize, variant =
|
|
|
1229
1302
|
|
|
1230
1303
|
// src/components/EmptyState/EmptyState.tsx
|
|
1231
1304
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1232
|
-
function EmptyState({ illustration, title, description, action, footer, className, ...rest }) {
|
|
1233
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: ["fds-empty", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1305
|
+
function EmptyState({ illustration, title, description, action, footer, size = "default", className, ...rest }) {
|
|
1306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: ["fds-empty", size === "compact" ? "fds-empty--compact" : "", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1234
1307
|
illustration != null && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fds-empty__illustration", children: illustration }),
|
|
1235
1308
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "fds-empty__text", children: [
|
|
1236
1309
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { className: "fds-empty__title", children: title }),
|
|
@@ -1484,6 +1557,246 @@ function StepList({ steps, className, ...rest }) {
|
|
|
1484
1557
|
step.id
|
|
1485
1558
|
)) });
|
|
1486
1559
|
}
|
|
1560
|
+
|
|
1561
|
+
// src/components/Input/Input.tsx
|
|
1562
|
+
var import_react15 = require("react");
|
|
1563
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1564
|
+
var Input = (0, import_react15.forwardRef)(function Input2({ label, hint, error, leadingIcon, trailing, id, className, containerClassName, readOnly, disabled, ...rest }, ref) {
|
|
1565
|
+
const genId = (0, import_react15.useId)();
|
|
1566
|
+
const inputId = id ?? genId;
|
|
1567
|
+
const msgId = `${genId}-msg`;
|
|
1568
|
+
const message = error ?? hint;
|
|
1569
|
+
const boxClasses = [
|
|
1570
|
+
"fds-input__box",
|
|
1571
|
+
error ? "fds-input__box--error" : "",
|
|
1572
|
+
readOnly || disabled ? "fds-input__box--locked" : ""
|
|
1573
|
+
].filter(Boolean).join(" ");
|
|
1574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: ["fds-input", containerClassName].filter(Boolean).join(" "), children: [
|
|
1575
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: inputId, className: "fds-input__label", children: label }),
|
|
1576
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: boxClasses, children: [
|
|
1577
|
+
leadingIcon != null && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fds-input__icon", "aria-hidden": "true", children: leadingIcon }),
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1579
|
+
"input",
|
|
1580
|
+
{
|
|
1581
|
+
ref,
|
|
1582
|
+
id: inputId,
|
|
1583
|
+
className: ["fds-input__control", className].filter(Boolean).join(" "),
|
|
1584
|
+
readOnly,
|
|
1585
|
+
disabled,
|
|
1586
|
+
"aria-invalid": error ? true : void 0,
|
|
1587
|
+
"aria-describedby": message != null ? msgId : void 0,
|
|
1588
|
+
...rest
|
|
1589
|
+
}
|
|
1590
|
+
),
|
|
1591
|
+
trailing != null && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fds-input__trailing", children: trailing })
|
|
1592
|
+
] }),
|
|
1593
|
+
message != null && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { id: msgId, className: error ? "fds-input__error" : "fds-input__hint", children: message })
|
|
1594
|
+
] });
|
|
1595
|
+
});
|
|
1596
|
+
|
|
1597
|
+
// src/components/IconButton/IconButton.tsx
|
|
1598
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1599
|
+
function IconButton({
|
|
1600
|
+
icon,
|
|
1601
|
+
variant = "outlined",
|
|
1602
|
+
size = "medium",
|
|
1603
|
+
type = "button",
|
|
1604
|
+
className,
|
|
1605
|
+
...rest
|
|
1606
|
+
}) {
|
|
1607
|
+
const classes = ["fds-icon-button", `fds-icon-button--${variant}`, `fds-icon-button--${size}`, className].filter(Boolean).join(" ");
|
|
1608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type, className: classes, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fds-icon-button__icon", "aria-hidden": "true", children: icon }) });
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
// src/components/Menu/Menu.tsx
|
|
1612
|
+
var import_react16 = require("react");
|
|
1613
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1614
|
+
function Menu({ trigger, items, align = "end", className }) {
|
|
1615
|
+
const listId = (0, import_react16.useId)();
|
|
1616
|
+
const rootRef = (0, import_react16.useRef)(null);
|
|
1617
|
+
const listRef = (0, import_react16.useRef)(null);
|
|
1618
|
+
const [open, setOpen] = (0, import_react16.useState)(false);
|
|
1619
|
+
const [active, setActive] = (0, import_react16.useState)(0);
|
|
1620
|
+
const enabled = items.map((it, i) => it.disabled ? -1 : i).filter((i) => i >= 0);
|
|
1621
|
+
(0, import_react16.useEffect)(() => {
|
|
1622
|
+
if (!open) return;
|
|
1623
|
+
const onDown = (e) => {
|
|
1624
|
+
if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
|
|
1625
|
+
};
|
|
1626
|
+
document.addEventListener("mousedown", onDown);
|
|
1627
|
+
const raf = requestAnimationFrame(() => listRef.current?.focus());
|
|
1628
|
+
return () => {
|
|
1629
|
+
document.removeEventListener("mousedown", onDown);
|
|
1630
|
+
cancelAnimationFrame(raf);
|
|
1631
|
+
};
|
|
1632
|
+
}, [open]);
|
|
1633
|
+
const triggerEl = () => rootRef.current?.querySelector('[aria-haspopup="menu"]');
|
|
1634
|
+
const close = () => {
|
|
1635
|
+
setOpen(false);
|
|
1636
|
+
triggerEl()?.focus();
|
|
1637
|
+
};
|
|
1638
|
+
const openAt = (index) => {
|
|
1639
|
+
setActive(index);
|
|
1640
|
+
setOpen(true);
|
|
1641
|
+
};
|
|
1642
|
+
const choose = (i) => {
|
|
1643
|
+
const it = items[i];
|
|
1644
|
+
if (!it || it.disabled) return;
|
|
1645
|
+
close();
|
|
1646
|
+
it.onSelect();
|
|
1647
|
+
};
|
|
1648
|
+
const step = (dir) => {
|
|
1649
|
+
if (enabled.length === 0) return;
|
|
1650
|
+
const at = enabled.indexOf(active);
|
|
1651
|
+
setActive(enabled[(at + dir + enabled.length) % enabled.length]);
|
|
1652
|
+
};
|
|
1653
|
+
const onListKeyDown = (e) => {
|
|
1654
|
+
if (e.key === "ArrowDown") {
|
|
1655
|
+
e.preventDefault();
|
|
1656
|
+
step(1);
|
|
1657
|
+
} else if (e.key === "ArrowUp") {
|
|
1658
|
+
e.preventDefault();
|
|
1659
|
+
step(-1);
|
|
1660
|
+
} else if (e.key === "Home") {
|
|
1661
|
+
e.preventDefault();
|
|
1662
|
+
setActive(enabled[0] ?? 0);
|
|
1663
|
+
} else if (e.key === "End") {
|
|
1664
|
+
e.preventDefault();
|
|
1665
|
+
setActive(enabled[enabled.length - 1] ?? 0);
|
|
1666
|
+
} else if (e.key === "Enter" || e.key === " ") {
|
|
1667
|
+
e.preventDefault();
|
|
1668
|
+
choose(active);
|
|
1669
|
+
} else if (e.key === "Escape") {
|
|
1670
|
+
e.preventDefault();
|
|
1671
|
+
close();
|
|
1672
|
+
} else if (e.key === "Tab") setOpen(false);
|
|
1673
|
+
};
|
|
1674
|
+
const own = trigger.props;
|
|
1675
|
+
const wired = (0, import_react16.cloneElement)(trigger, {
|
|
1676
|
+
"aria-haspopup": "menu",
|
|
1677
|
+
"aria-expanded": open,
|
|
1678
|
+
"aria-controls": open ? listId : void 0,
|
|
1679
|
+
onClick: (e) => {
|
|
1680
|
+
own.onClick?.(e);
|
|
1681
|
+
if (open) setOpen(false);
|
|
1682
|
+
else openAt(enabled[0] ?? 0);
|
|
1683
|
+
},
|
|
1684
|
+
onKeyDown: (e) => {
|
|
1685
|
+
own.onKeyDown?.(e);
|
|
1686
|
+
if (!open && (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ")) {
|
|
1687
|
+
e.preventDefault();
|
|
1688
|
+
openAt(enabled[0] ?? 0);
|
|
1689
|
+
} else if (!open && e.key === "ArrowUp") {
|
|
1690
|
+
e.preventDefault();
|
|
1691
|
+
openAt(enabled[enabled.length - 1] ?? 0);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
});
|
|
1695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { ref: rootRef, className: ["fds-menu", className].filter(Boolean).join(" "), children: [
|
|
1696
|
+
wired,
|
|
1697
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1698
|
+
"div",
|
|
1699
|
+
{
|
|
1700
|
+
ref: listRef,
|
|
1701
|
+
id: listId,
|
|
1702
|
+
role: "menu",
|
|
1703
|
+
tabIndex: -1,
|
|
1704
|
+
className: `fds-menu__list fds-menu__list--${align}`,
|
|
1705
|
+
"aria-activedescendant": `${listId}-item-${active}`,
|
|
1706
|
+
onKeyDown: onListKeyDown,
|
|
1707
|
+
children: items.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1708
|
+
"div",
|
|
1709
|
+
{
|
|
1710
|
+
id: `${listId}-item-${i}`,
|
|
1711
|
+
role: "menuitem",
|
|
1712
|
+
"aria-disabled": it.disabled || void 0,
|
|
1713
|
+
className: [
|
|
1714
|
+
"fds-menu__item",
|
|
1715
|
+
it.tone === "danger" ? "fds-menu__item--danger" : "",
|
|
1716
|
+
i === active ? "fds-menu__item--active" : "",
|
|
1717
|
+
it.disabled ? "fds-menu__item--disabled" : ""
|
|
1718
|
+
].filter(Boolean).join(" "),
|
|
1719
|
+
onMouseEnter: () => !it.disabled && setActive(i),
|
|
1720
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1721
|
+
onClick: () => choose(i),
|
|
1722
|
+
children: [
|
|
1723
|
+
it.icon != null && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fds-menu__icon", "aria-hidden": "true", children: it.icon }),
|
|
1724
|
+
it.label
|
|
1725
|
+
]
|
|
1726
|
+
},
|
|
1727
|
+
i
|
|
1728
|
+
))
|
|
1729
|
+
}
|
|
1730
|
+
)
|
|
1731
|
+
] });
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
// src/components/Table/Table.tsx
|
|
1735
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1736
|
+
function Table({ columns, rows, rowKey, empty, className, "aria-label": ariaLabel, ...rest }) {
|
|
1737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: ["fds-table", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("table", { className: "fds-table__table", "aria-label": ariaLabel, children: [
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("tr", { children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1739
|
+
"th",
|
|
1740
|
+
{
|
|
1741
|
+
scope: "col",
|
|
1742
|
+
className: c.align === "end" ? "fds-table__cell--end" : void 0,
|
|
1743
|
+
style: c.width ? { width: c.width } : void 0,
|
|
1744
|
+
children: c.header
|
|
1745
|
+
},
|
|
1746
|
+
c.key
|
|
1747
|
+
)) }) }),
|
|
1748
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("tbody", { children: [
|
|
1749
|
+
rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("tr", { children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: c.align === "end" ? "fds-table__cell--end" : void 0, children: c.cell(row) }, c.key)) }, rowKey(row))),
|
|
1750
|
+
rows.length === 0 && empty != null && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { colSpan: columns.length, className: "fds-table__empty", children: empty }) })
|
|
1751
|
+
] })
|
|
1752
|
+
] }) });
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
// src/components/PricingCard/PricingCard.tsx
|
|
1756
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1757
|
+
function CheckIcon3() {
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M3.5 8.5l3 3 6-7", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1759
|
+
}
|
|
1760
|
+
function PricingCard({
|
|
1761
|
+
eyebrow,
|
|
1762
|
+
title,
|
|
1763
|
+
badge,
|
|
1764
|
+
price,
|
|
1765
|
+
period,
|
|
1766
|
+
description,
|
|
1767
|
+
action,
|
|
1768
|
+
featuresTitle = "Features",
|
|
1769
|
+
featuresIntro,
|
|
1770
|
+
features = [],
|
|
1771
|
+
highlighted = false,
|
|
1772
|
+
className,
|
|
1773
|
+
...rest
|
|
1774
|
+
}) {
|
|
1775
|
+
const classes = ["fds-pricing-card", highlighted ? "fds-pricing-card--highlighted" : "", className].filter(Boolean).join(" ");
|
|
1776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("article", { className: classes, ...rest, children: [
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "fds-pricing-card__top", children: [
|
|
1778
|
+
eyebrow != null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "fds-pricing-card__eyebrow", children: eyebrow }),
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("h3", { className: "fds-pricing-card__title", children: [
|
|
1780
|
+
title,
|
|
1781
|
+
badge
|
|
1782
|
+
] }),
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "fds-pricing-card__price", children: [
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "fds-pricing-card__amount", children: price }),
|
|
1785
|
+
period != null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "fds-pricing-card__period", children: period })
|
|
1786
|
+
] }),
|
|
1787
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "fds-pricing-card__description", children: description }),
|
|
1788
|
+
action != null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "fds-pricing-card__action", children: action })
|
|
1789
|
+
] }),
|
|
1790
|
+
features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "fds-pricing-card__features", children: [
|
|
1791
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "fds-pricing-card__featuresTitle", children: featuresTitle }),
|
|
1792
|
+
featuresIntro != null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "fds-pricing-card__intro", children: featuresIntro }),
|
|
1793
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "fds-pricing-card__list", children: features.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("li", { className: "fds-pricing-card__feature", children: [
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "fds-pricing-card__check", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CheckIcon3, {}) }),
|
|
1795
|
+
f
|
|
1796
|
+
] }, i)) })
|
|
1797
|
+
] })
|
|
1798
|
+
] });
|
|
1799
|
+
}
|
|
1487
1800
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1488
1801
|
0 && (module.exports = {
|
|
1489
1802
|
Accordion,
|
|
@@ -1498,10 +1811,14 @@ function StepList({ steps, className, ...rest }) {
|
|
|
1498
1811
|
DiffPropertyList,
|
|
1499
1812
|
DiffSection,
|
|
1500
1813
|
EmptyState,
|
|
1814
|
+
IconButton,
|
|
1815
|
+
Input,
|
|
1816
|
+
Menu,
|
|
1501
1817
|
MismatchCard,
|
|
1502
1818
|
Modal,
|
|
1503
1819
|
MultiSelect,
|
|
1504
1820
|
Pagination,
|
|
1821
|
+
PricingCard,
|
|
1505
1822
|
Radio,
|
|
1506
1823
|
SearchInput,
|
|
1507
1824
|
SectionHeader,
|
|
@@ -1515,6 +1832,7 @@ function StepList({ steps, className, ...rest }) {
|
|
|
1515
1832
|
Stat,
|
|
1516
1833
|
StepList,
|
|
1517
1834
|
TabNav,
|
|
1835
|
+
Table,
|
|
1518
1836
|
Tag,
|
|
1519
1837
|
Toggle,
|
|
1520
1838
|
breakpoints
|