@usefidel/design-system 0.23.1 → 0.25.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/index.js CHANGED
@@ -1331,32 +1331,56 @@ function SkeletonGroup({ label = "Loading", className, children, ...rest }) {
1331
1331
  return /* @__PURE__ */ jsx22("div", { role: "status", "aria-busy": "true", "aria-label": label, className, ...rest, children });
1332
1332
  }
1333
1333
 
1334
+ // src/components/Spinner/Spinner.tsx
1335
+ import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
1336
+ function Spinner({ size = 24, label, className, ...rest }) {
1337
+ const a11y = label ? { role: "img", "aria-label": label } : { "aria-hidden": true };
1338
+ return /* @__PURE__ */ jsxs20(
1339
+ "svg",
1340
+ {
1341
+ className: ["fds-spinner", className].filter(Boolean).join(" "),
1342
+ width: size,
1343
+ height: size,
1344
+ viewBox: "0 0 24 24",
1345
+ fill: "none",
1346
+ strokeWidth: "2.5",
1347
+ strokeLinecap: "round",
1348
+ ...a11y,
1349
+ ...rest,
1350
+ children: [
1351
+ /* @__PURE__ */ jsx23("circle", { className: "fds-spinner__track", cx: "12", cy: "12", r: "10" }),
1352
+ /* @__PURE__ */ jsx23("path", { className: "fds-spinner__arc", d: "M12 2a10 10 0 0 1 10 10" })
1353
+ ]
1354
+ }
1355
+ );
1356
+ }
1357
+
1334
1358
  // src/components/Card/Card.tsx
1335
- import { jsx as jsx23 } from "react/jsx-runtime";
1359
+ import { jsx as jsx24 } from "react/jsx-runtime";
1336
1360
  function Card({ tone = "default", padding = "md", className, children, ...rest }) {
1337
1361
  const classes = ["fds-card", `fds-card--${tone}`, `fds-card--pad-${padding}`, className].filter(Boolean).join(" ");
1338
- return /* @__PURE__ */ jsx23("div", { className: classes, ...rest, children });
1362
+ return /* @__PURE__ */ jsx24("div", { className: classes, ...rest, children });
1339
1363
  }
1340
1364
 
1341
1365
  // src/components/Stat/Stat.tsx
1342
- import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
1366
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
1343
1367
  function Stat({ label, value, children, className, ...rest }) {
1344
- return /* @__PURE__ */ jsxs20("div", { className: ["fds-stat", className].filter(Boolean).join(" "), ...rest, children: [
1345
- /* @__PURE__ */ jsx24("p", { className: "fds-stat__label", children: label }),
1346
- /* @__PURE__ */ jsx24("p", { className: "fds-stat__value", children: value }),
1347
- children != null && /* @__PURE__ */ jsx24("div", { className: "fds-stat__detail", children })
1368
+ return /* @__PURE__ */ jsxs21("div", { className: ["fds-stat", className].filter(Boolean).join(" "), ...rest, children: [
1369
+ /* @__PURE__ */ jsx25("p", { className: "fds-stat__label", children: label }),
1370
+ /* @__PURE__ */ jsx25("p", { className: "fds-stat__value", children: value }),
1371
+ children != null && /* @__PURE__ */ jsx25("div", { className: "fds-stat__detail", children })
1348
1372
  ] });
1349
1373
  }
1350
1374
 
1351
1375
  // src/components/Swatch/Swatch.tsx
1352
- import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
1376
+ import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
1353
1377
  function Swatch({ color, name, value, children, className, ...rest }) {
1354
- return /* @__PURE__ */ jsxs21("div", { className: ["fds-swatch", className].filter(Boolean).join(" "), ...rest, children: [
1355
- /* @__PURE__ */ jsx25("div", { className: "fds-swatch__color", style: { "--fds-swatch-color": color }, "aria-hidden": "true" }),
1356
- /* @__PURE__ */ jsxs21("div", { className: "fds-swatch__body", children: [
1357
- /* @__PURE__ */ jsx25("p", { className: "fds-swatch__name", children: name }),
1358
- value != null && /* @__PURE__ */ jsx25("p", { className: "fds-swatch__value", children: value }),
1359
- children != null && /* @__PURE__ */ jsx25("div", { className: "fds-swatch__detail", children })
1378
+ return /* @__PURE__ */ jsxs22("div", { className: ["fds-swatch", className].filter(Boolean).join(" "), ...rest, children: [
1379
+ /* @__PURE__ */ jsx26("div", { className: "fds-swatch__color", style: { "--fds-swatch-color": color }, "aria-hidden": "true" }),
1380
+ /* @__PURE__ */ jsxs22("div", { className: "fds-swatch__body", children: [
1381
+ /* @__PURE__ */ jsx26("p", { className: "fds-swatch__name", children: name }),
1382
+ value != null && /* @__PURE__ */ jsx26("p", { className: "fds-swatch__value", children: value }),
1383
+ children != null && /* @__PURE__ */ jsx26("div", { className: "fds-swatch__detail", children })
1360
1384
  ] })
1361
1385
  ] });
1362
1386
  }
@@ -1369,7 +1393,7 @@ import {
1369
1393
  useImperativeHandle as useImperativeHandle2,
1370
1394
  useRef as useRef6
1371
1395
  } from "react";
1372
- import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
1396
+ import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
1373
1397
  var Checkbox = forwardRef4(function Checkbox2({ label, description, indeterminate = false, className, id, disabled, ...rest }, ref) {
1374
1398
  const generatedId = useId7();
1375
1399
  const inputId = id ?? generatedId;
@@ -1378,13 +1402,13 @@ var Checkbox = forwardRef4(function Checkbox2({ label, description, indeterminat
1378
1402
  useEffect5(() => {
1379
1403
  if (inputRef.current) inputRef.current.indeterminate = indeterminate;
1380
1404
  }, [indeterminate]);
1381
- return /* @__PURE__ */ jsxs22(
1405
+ return /* @__PURE__ */ jsxs23(
1382
1406
  "div",
1383
1407
  {
1384
1408
  className: ["fds-checkbox", className].filter(Boolean).join(" "),
1385
1409
  "data-disabled": disabled ? "" : void 0,
1386
1410
  children: [
1387
- /* @__PURE__ */ jsx26(
1411
+ /* @__PURE__ */ jsx27(
1388
1412
  "input",
1389
1413
  {
1390
1414
  ...rest,
@@ -1395,14 +1419,14 @@ var Checkbox = forwardRef4(function Checkbox2({ label, description, indeterminat
1395
1419
  className: "fds-checkbox__input"
1396
1420
  }
1397
1421
  ),
1398
- /* @__PURE__ */ jsxs22("label", { htmlFor: inputId, className: "fds-checkbox__control", children: [
1399
- /* @__PURE__ */ jsxs22("span", { className: "fds-checkbox__box", "aria-hidden": "true", children: [
1400
- /* @__PURE__ */ jsx26("svg", { className: "fds-checkbox__tick", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx26("path", { d: "M10 3L4.5 8.5 2 6", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }),
1401
- /* @__PURE__ */ jsx26("svg", { className: "fds-checkbox__dash", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx26("path", { d: "M3 6h6", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) })
1422
+ /* @__PURE__ */ jsxs23("label", { htmlFor: inputId, className: "fds-checkbox__control", children: [
1423
+ /* @__PURE__ */ jsxs23("span", { className: "fds-checkbox__box", "aria-hidden": "true", children: [
1424
+ /* @__PURE__ */ jsx27("svg", { className: "fds-checkbox__tick", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx27("path", { d: "M10 3L4.5 8.5 2 6", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }),
1425
+ /* @__PURE__ */ jsx27("svg", { className: "fds-checkbox__dash", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx27("path", { d: "M3 6h6", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) })
1402
1426
  ] }),
1403
- (label != null || description != null) && /* @__PURE__ */ jsxs22("span", { className: "fds-checkbox__text", children: [
1404
- label != null && /* @__PURE__ */ jsx26("span", { className: "fds-checkbox__label", children: label }),
1405
- description != null && /* @__PURE__ */ jsx26("span", { className: "fds-checkbox__description", children: description })
1427
+ (label != null || description != null) && /* @__PURE__ */ jsxs23("span", { className: "fds-checkbox__text", children: [
1428
+ label != null && /* @__PURE__ */ jsx27("span", { className: "fds-checkbox__label", children: label }),
1429
+ description != null && /* @__PURE__ */ jsx27("span", { className: "fds-checkbox__description", children: description })
1406
1430
  ] })
1407
1431
  ] })
1408
1432
  ]
@@ -1412,17 +1436,17 @@ var Checkbox = forwardRef4(function Checkbox2({ label, description, indeterminat
1412
1436
 
1413
1437
  // src/components/Radio/Radio.tsx
1414
1438
  import { forwardRef as forwardRef5, useId as useId8 } from "react";
1415
- import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
1439
+ import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
1416
1440
  var Radio = forwardRef5(function Radio2({ label, description, className, id, disabled, ...rest }, ref) {
1417
1441
  const generatedId = useId8();
1418
1442
  const inputId = id ?? generatedId;
1419
- return /* @__PURE__ */ jsxs23("div", { className: ["fds-radio", className].filter(Boolean).join(" "), "data-disabled": disabled ? "" : void 0, children: [
1420
- /* @__PURE__ */ jsx27("input", { ...rest, id: inputId, ref, type: "radio", disabled, className: "fds-radio__input" }),
1421
- /* @__PURE__ */ jsxs23("label", { htmlFor: inputId, className: "fds-radio__control", children: [
1422
- /* @__PURE__ */ jsx27("span", { className: "fds-radio__circle", "aria-hidden": "true" }),
1423
- (label != null || description != null) && /* @__PURE__ */ jsxs23("span", { className: "fds-radio__text", children: [
1424
- label != null && /* @__PURE__ */ jsx27("span", { className: "fds-radio__label", children: label }),
1425
- description != null && /* @__PURE__ */ jsx27("span", { className: "fds-radio__description", children: description })
1443
+ return /* @__PURE__ */ jsxs24("div", { className: ["fds-radio", className].filter(Boolean).join(" "), "data-disabled": disabled ? "" : void 0, children: [
1444
+ /* @__PURE__ */ jsx28("input", { ...rest, id: inputId, ref, type: "radio", disabled, className: "fds-radio__input" }),
1445
+ /* @__PURE__ */ jsxs24("label", { htmlFor: inputId, className: "fds-radio__control", children: [
1446
+ /* @__PURE__ */ jsx28("span", { className: "fds-radio__circle", "aria-hidden": "true" }),
1447
+ (label != null || description != null) && /* @__PURE__ */ jsxs24("span", { className: "fds-radio__text", children: [
1448
+ label != null && /* @__PURE__ */ jsx28("span", { className: "fds-radio__label", children: label }),
1449
+ description != null && /* @__PURE__ */ jsx28("span", { className: "fds-radio__description", children: description })
1426
1450
  ] })
1427
1451
  ] })
1428
1452
  ] });
@@ -1430,13 +1454,13 @@ var Radio = forwardRef5(function Radio2({ label, description, className, id, dis
1430
1454
 
1431
1455
  // src/components/RadioCard/RadioCard.tsx
1432
1456
  import { forwardRef as forwardRef6, useId as useId9 } from "react";
1433
- import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
1457
+ import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
1434
1458
  var RadioCard = forwardRef6(function RadioCard2({ label, description, icon, meta, className, id, disabled, ...rest }, ref) {
1435
1459
  const generatedId = useId9();
1436
1460
  const inputId = id ?? generatedId;
1437
1461
  const descriptionId = description != null ? `${inputId}-description` : void 0;
1438
- return /* @__PURE__ */ jsxs24("div", { className: ["fds-radio-card", className].filter(Boolean).join(" "), "data-disabled": disabled ? "" : void 0, children: [
1439
- /* @__PURE__ */ jsx28(
1462
+ return /* @__PURE__ */ jsxs25("div", { className: ["fds-radio-card", className].filter(Boolean).join(" "), "data-disabled": disabled ? "" : void 0, children: [
1463
+ /* @__PURE__ */ jsx29(
1440
1464
  "input",
1441
1465
  {
1442
1466
  ...rest,
@@ -1448,21 +1472,21 @@ var RadioCard = forwardRef6(function RadioCard2({ label, description, icon, meta
1448
1472
  className: "fds-radio-card__input"
1449
1473
  }
1450
1474
  ),
1451
- /* @__PURE__ */ jsxs24("label", { htmlFor: inputId, className: "fds-radio-card__body", children: [
1452
- icon != null && /* @__PURE__ */ jsx28("span", { className: "fds-radio-card__icon", "aria-hidden": "true", children: icon }),
1453
- /* @__PURE__ */ jsxs24("span", { className: "fds-radio-card__text", children: [
1454
- /* @__PURE__ */ jsx28("span", { className: "fds-radio-card__label", children: label }),
1455
- description != null && /* @__PURE__ */ jsx28("span", { id: descriptionId, className: "fds-radio-card__description", children: description }),
1456
- meta != null && /* @__PURE__ */ jsx28("span", { className: "fds-radio-card__meta", children: meta })
1475
+ /* @__PURE__ */ jsxs25("label", { htmlFor: inputId, className: "fds-radio-card__body", children: [
1476
+ icon != null && /* @__PURE__ */ jsx29("span", { className: "fds-radio-card__icon", "aria-hidden": "true", children: icon }),
1477
+ /* @__PURE__ */ jsxs25("span", { className: "fds-radio-card__text", children: [
1478
+ /* @__PURE__ */ jsx29("span", { className: "fds-radio-card__label", children: label }),
1479
+ description != null && /* @__PURE__ */ jsx29("span", { id: descriptionId, className: "fds-radio-card__description", children: description }),
1480
+ meta != null && /* @__PURE__ */ jsx29("span", { className: "fds-radio-card__meta", children: meta })
1457
1481
  ] }),
1458
- /* @__PURE__ */ jsx28("span", { className: "fds-radio-card__circle", "aria-hidden": "true" })
1482
+ /* @__PURE__ */ jsx29("span", { className: "fds-radio-card__circle", "aria-hidden": "true" })
1459
1483
  ] })
1460
1484
  ] });
1461
1485
  });
1462
1486
 
1463
1487
  // src/components/Accordion/Accordion.tsx
1464
1488
  import { useId as useId10, useState as useState7 } from "react";
1465
- import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
1489
+ import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
1466
1490
  function Accordion({
1467
1491
  summary,
1468
1492
  actions,
@@ -1481,15 +1505,15 @@ function Accordion({
1481
1505
  if (openProp === void 0) setOpenState(next);
1482
1506
  onOpenChange?.(next);
1483
1507
  };
1484
- return /* @__PURE__ */ jsxs25(
1508
+ return /* @__PURE__ */ jsxs26(
1485
1509
  "div",
1486
1510
  {
1487
1511
  className: ["fds-accordion", className].filter(Boolean).join(" "),
1488
1512
  "data-open": open ? "" : void 0,
1489
1513
  ...rest,
1490
1514
  children: [
1491
- /* @__PURE__ */ jsxs25("div", { className: "fds-accordion__header", children: [
1492
- /* @__PURE__ */ jsx29(
1515
+ /* @__PURE__ */ jsxs26("div", { className: "fds-accordion__header", children: [
1516
+ /* @__PURE__ */ jsx30(
1493
1517
  "button",
1494
1518
  {
1495
1519
  type: "button",
@@ -1500,17 +1524,17 @@ function Accordion({
1500
1524
  children: summary
1501
1525
  }
1502
1526
  ),
1503
- actions != null && /* @__PURE__ */ jsx29("div", { className: "fds-accordion__actions", children: actions }),
1504
- /* @__PURE__ */ jsx29("span", { className: "fds-accordion__chevron", "aria-hidden": "true", onClick: toggle, children: /* @__PURE__ */ jsx29("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", children: /* @__PURE__ */ jsx29("path", { d: "M6 9l6 6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
1527
+ actions != null && /* @__PURE__ */ jsx30("div", { className: "fds-accordion__actions", children: actions }),
1528
+ /* @__PURE__ */ jsx30("span", { className: "fds-accordion__chevron", "aria-hidden": "true", onClick: toggle, children: /* @__PURE__ */ jsx30("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", children: /* @__PURE__ */ jsx30("path", { d: "M6 9l6 6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
1505
1529
  ] }),
1506
- /* @__PURE__ */ jsx29("div", { id: bodyId, className: "fds-accordion__body", hidden: !open, children })
1530
+ /* @__PURE__ */ jsx30("div", { id: bodyId, className: "fds-accordion__body", hidden: !open, children })
1507
1531
  ]
1508
1532
  }
1509
1533
  );
1510
1534
  }
1511
1535
 
1512
1536
  // src/components/StepList/StepList.tsx
1513
- import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
1537
+ import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
1514
1538
  var STATUS_TEXT = {
1515
1539
  done: "Done",
1516
1540
  active: "In progress",
@@ -1520,32 +1544,32 @@ var STATUS_TEXT = {
1520
1544
  function StepIcon({ status }) {
1521
1545
  const common = { viewBox: "0 0 24 24", width: 18, height: 18, fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" };
1522
1546
  if (status === "done") {
1523
- return /* @__PURE__ */ jsxs26("svg", { ...common, children: [
1524
- /* @__PURE__ */ jsx30("circle", { cx: "12", cy: "12", r: "9" }),
1525
- /* @__PURE__ */ jsx30("path", { d: "M8 12.5l2.5 2.5 5-5.5" })
1547
+ return /* @__PURE__ */ jsxs27("svg", { ...common, children: [
1548
+ /* @__PURE__ */ jsx31("circle", { cx: "12", cy: "12", r: "9" }),
1549
+ /* @__PURE__ */ jsx31("path", { d: "M8 12.5l2.5 2.5 5-5.5" })
1526
1550
  ] });
1527
1551
  }
1528
1552
  if (status === "active") {
1529
- return /* @__PURE__ */ jsx30("svg", { ...common, className: "fds-steps__spinner", children: /* @__PURE__ */ jsx30("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1" }) });
1553
+ return /* @__PURE__ */ jsx31("svg", { ...common, className: "fds-steps__spinner", children: /* @__PURE__ */ jsx31("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1" }) });
1530
1554
  }
1531
1555
  if (status === "failed") {
1532
- return /* @__PURE__ */ jsxs26("svg", { ...common, children: [
1533
- /* @__PURE__ */ jsx30("circle", { cx: "12", cy: "12", r: "9" }),
1534
- /* @__PURE__ */ jsx30("path", { d: "M12 7.5v5.5M12 16.5v.01" })
1556
+ return /* @__PURE__ */ jsxs27("svg", { ...common, children: [
1557
+ /* @__PURE__ */ jsx31("circle", { cx: "12", cy: "12", r: "9" }),
1558
+ /* @__PURE__ */ jsx31("path", { d: "M12 7.5v5.5M12 16.5v.01" })
1535
1559
  ] });
1536
1560
  }
1537
- return /* @__PURE__ */ jsx30("svg", { ...common, children: /* @__PURE__ */ jsx30("circle", { cx: "12", cy: "12", r: "9" }) });
1561
+ return /* @__PURE__ */ jsx31("svg", { ...common, children: /* @__PURE__ */ jsx31("circle", { cx: "12", cy: "12", r: "9" }) });
1538
1562
  }
1539
1563
  function StepList({ steps, className, ...rest }) {
1540
- return /* @__PURE__ */ jsx30("ol", { className: ["fds-steps", className].filter(Boolean).join(" "), ...rest, children: steps.map((step) => /* @__PURE__ */ jsxs26(
1564
+ return /* @__PURE__ */ jsx31("ol", { className: ["fds-steps", className].filter(Boolean).join(" "), ...rest, children: steps.map((step) => /* @__PURE__ */ jsxs27(
1541
1565
  "li",
1542
1566
  {
1543
1567
  className: `fds-steps__step fds-steps__step--${step.status}`,
1544
1568
  "aria-current": step.status === "active" ? "step" : void 0,
1545
1569
  children: [
1546
- /* @__PURE__ */ jsx30("span", { className: "fds-steps__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx30(StepIcon, { status: step.status }) }),
1547
- /* @__PURE__ */ jsx30("span", { className: "fds-steps__label", children: step.label }),
1548
- /* @__PURE__ */ jsxs26("span", { className: "fds-steps__sr", children: [
1570
+ /* @__PURE__ */ jsx31("span", { className: "fds-steps__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx31(StepIcon, { status: step.status }) }),
1571
+ /* @__PURE__ */ jsx31("span", { className: "fds-steps__label", children: step.label }),
1572
+ /* @__PURE__ */ jsxs27("span", { className: "fds-steps__sr", children: [
1549
1573
  ", ",
1550
1574
  STATUS_TEXT[step.status]
1551
1575
  ] })
@@ -1557,7 +1581,7 @@ function StepList({ steps, className, ...rest }) {
1557
1581
 
1558
1582
  // src/components/Input/Input.tsx
1559
1583
  import { forwardRef as forwardRef7, useId as useId11 } from "react";
1560
- import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
1584
+ import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
1561
1585
  var Input = forwardRef7(function Input2({ label, hint, error, leadingIcon, trailing, id, className, containerClassName, readOnly, disabled, ...rest }, ref) {
1562
1586
  const genId = useId11();
1563
1587
  const inputId = id ?? genId;
@@ -1568,11 +1592,11 @@ var Input = forwardRef7(function Input2({ label, hint, error, leadingIcon, trail
1568
1592
  error ? "fds-input__box--error" : "",
1569
1593
  readOnly || disabled ? "fds-input__box--locked" : ""
1570
1594
  ].filter(Boolean).join(" ");
1571
- return /* @__PURE__ */ jsxs27("div", { className: ["fds-input", containerClassName].filter(Boolean).join(" "), children: [
1572
- label != null && /* @__PURE__ */ jsx31("label", { htmlFor: inputId, className: "fds-input__label", children: label }),
1573
- /* @__PURE__ */ jsxs27("div", { className: boxClasses, children: [
1574
- leadingIcon != null && /* @__PURE__ */ jsx31("span", { className: "fds-input__icon", "aria-hidden": "true", children: leadingIcon }),
1575
- /* @__PURE__ */ jsx31(
1595
+ return /* @__PURE__ */ jsxs28("div", { className: ["fds-input", containerClassName].filter(Boolean).join(" "), children: [
1596
+ label != null && /* @__PURE__ */ jsx32("label", { htmlFor: inputId, className: "fds-input__label", children: label }),
1597
+ /* @__PURE__ */ jsxs28("div", { className: boxClasses, children: [
1598
+ leadingIcon != null && /* @__PURE__ */ jsx32("span", { className: "fds-input__icon", "aria-hidden": "true", children: leadingIcon }),
1599
+ /* @__PURE__ */ jsx32(
1576
1600
  "input",
1577
1601
  {
1578
1602
  ref,
@@ -1585,14 +1609,14 @@ var Input = forwardRef7(function Input2({ label, hint, error, leadingIcon, trail
1585
1609
  ...rest
1586
1610
  }
1587
1611
  ),
1588
- trailing != null && /* @__PURE__ */ jsx31("span", { className: "fds-input__trailing", children: trailing })
1612
+ trailing != null && /* @__PURE__ */ jsx32("span", { className: "fds-input__trailing", children: trailing })
1589
1613
  ] }),
1590
- message != null && /* @__PURE__ */ jsx31("p", { id: msgId, className: error ? "fds-input__error" : "fds-input__hint", children: message })
1614
+ message != null && /* @__PURE__ */ jsx32("p", { id: msgId, className: error ? "fds-input__error" : "fds-input__hint", children: message })
1591
1615
  ] });
1592
1616
  });
1593
1617
 
1594
1618
  // src/components/IconButton/IconButton.tsx
1595
- import { jsx as jsx32 } from "react/jsx-runtime";
1619
+ import { jsx as jsx33 } from "react/jsx-runtime";
1596
1620
  function IconButton({
1597
1621
  icon,
1598
1622
  variant = "outlined",
@@ -1602,7 +1626,7 @@ function IconButton({
1602
1626
  ...rest
1603
1627
  }) {
1604
1628
  const classes = ["fds-icon-button", `fds-icon-button--${variant}`, `fds-icon-button--${size}`, className].filter(Boolean).join(" ");
1605
- return /* @__PURE__ */ jsx32("button", { type, className: classes, ...rest, children: /* @__PURE__ */ jsx32("span", { className: "fds-icon-button__icon", "aria-hidden": "true", children: icon }) });
1629
+ return /* @__PURE__ */ jsx33("button", { type, className: classes, ...rest, children: /* @__PURE__ */ jsx33("span", { className: "fds-icon-button__icon", "aria-hidden": "true", children: icon }) });
1606
1630
  }
1607
1631
 
1608
1632
  // src/components/Menu/Menu.tsx
@@ -1613,21 +1637,66 @@ import {
1613
1637
  useRef as useRef7,
1614
1638
  useState as useState8
1615
1639
  } from "react";
1616
- import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
1617
- function Menu({ trigger, items, align = "end", className }) {
1640
+ import { Check, Search } from "lucide-react";
1641
+ import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
1642
+ var isItem = (e) => !("type" in e);
1643
+ function searchText(it) {
1644
+ if (it.keywords) return it.keywords;
1645
+ return typeof it.label === "string" ? it.label : "";
1646
+ }
1647
+ function visibleEntries(items, query) {
1648
+ const q = query.trim().toLowerCase();
1649
+ if (!q) return items.map((_, i) => i);
1650
+ const matches = (i) => {
1651
+ const e = items[i];
1652
+ return isItem(e) && searchText(e).toLowerCase().includes(q);
1653
+ };
1654
+ const out = [];
1655
+ items.forEach((e, i) => {
1656
+ if (isItem(e)) {
1657
+ if (matches(i)) out.push(i);
1658
+ } else if (e.type === "label") {
1659
+ for (let j = i + 1; j < items.length && isItem(items[j]); j++) {
1660
+ if (matches(j)) {
1661
+ out.push(i);
1662
+ break;
1663
+ }
1664
+ }
1665
+ }
1666
+ });
1667
+ return out;
1668
+ }
1669
+ function Menu({
1670
+ trigger,
1671
+ items,
1672
+ align = "end",
1673
+ placement = "bottom",
1674
+ search,
1675
+ width = "auto",
1676
+ block = false,
1677
+ className
1678
+ }) {
1618
1679
  const listId = useId12();
1619
1680
  const rootRef = useRef7(null);
1620
1681
  const listRef = useRef7(null);
1682
+ const searchRef = useRef7(null);
1621
1683
  const [open, setOpen] = useState8(false);
1622
- const [active, setActive] = useState8(0);
1623
- const enabled = items.map((it, i) => it.disabled ? -1 : i).filter((i) => i >= 0);
1684
+ const [query, setQuery] = useState8("");
1685
+ const [active, setActive] = useState8(-1);
1686
+ const shown = visibleEntries(items, query);
1687
+ const enabled = shown.filter((i) => {
1688
+ const e = items[i];
1689
+ return isItem(e) && !e.disabled;
1690
+ });
1624
1691
  useEffect6(() => {
1625
1692
  if (!open) return;
1626
1693
  const onDown = (e) => {
1627
1694
  if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
1628
1695
  };
1629
1696
  document.addEventListener("mousedown", onDown);
1630
- const raf = requestAnimationFrame(() => listRef.current?.focus());
1697
+ const raf = requestAnimationFrame(
1698
+ () => (searchRef.current && !searchRef.current.disabled ? searchRef.current : listRef.current)?.focus()
1699
+ );
1631
1700
  return () => {
1632
1701
  document.removeEventListener("mousedown", onDown);
1633
1702
  cancelAnimationFrame(raf);
@@ -1638,20 +1707,26 @@ function Menu({ trigger, items, align = "end", className }) {
1638
1707
  setOpen(false);
1639
1708
  triggerEl()?.focus();
1640
1709
  };
1641
- const openAt = (index) => {
1642
- setActive(index);
1710
+ const openAt = (which) => {
1711
+ setQuery("");
1712
+ const all = visibleEntries(items, "").filter((i) => {
1713
+ const e = items[i];
1714
+ return isItem(e) && !e.disabled;
1715
+ });
1716
+ setActive((which === "first" ? all[0] : all[all.length - 1]) ?? -1);
1643
1717
  setOpen(true);
1644
1718
  };
1645
1719
  const choose = (i) => {
1646
- const it = items[i];
1647
- if (!it || it.disabled) return;
1720
+ const e = items[i];
1721
+ if (!e || !isItem(e) || e.disabled) return;
1648
1722
  close();
1649
- it.onSelect();
1723
+ e.onSelect();
1650
1724
  };
1651
1725
  const step = (dir) => {
1652
1726
  if (enabled.length === 0) return;
1653
1727
  const at = enabled.indexOf(active);
1654
- setActive(enabled[(at + dir + enabled.length) % enabled.length]);
1728
+ const next = at === -1 ? dir === 1 ? 0 : enabled.length - 1 : (at + dir + enabled.length) % enabled.length;
1729
+ setActive(enabled[next]);
1655
1730
  };
1656
1731
  const onListKeyDown = (e) => {
1657
1732
  if (e.key === "ArrowDown") {
@@ -1660,13 +1735,13 @@ function Menu({ trigger, items, align = "end", className }) {
1660
1735
  } else if (e.key === "ArrowUp") {
1661
1736
  e.preventDefault();
1662
1737
  step(-1);
1663
- } else if (e.key === "Home") {
1738
+ } else if (e.key === "Home" && !search) {
1664
1739
  e.preventDefault();
1665
- setActive(enabled[0] ?? 0);
1666
- } else if (e.key === "End") {
1740
+ setActive(enabled[0] ?? -1);
1741
+ } else if (e.key === "End" && !search) {
1667
1742
  e.preventDefault();
1668
- setActive(enabled[enabled.length - 1] ?? 0);
1669
- } else if (e.key === "Enter" || e.key === " ") {
1743
+ setActive(enabled[enabled.length - 1] ?? -1);
1744
+ } else if (e.key === "Enter" || e.key === " " && !search) {
1670
1745
  e.preventDefault();
1671
1746
  choose(active);
1672
1747
  } else if (e.key === "Escape") {
@@ -1674,6 +1749,14 @@ function Menu({ trigger, items, align = "end", className }) {
1674
1749
  close();
1675
1750
  } else if (e.key === "Tab") setOpen(false);
1676
1751
  };
1752
+ const onQuery = (value) => {
1753
+ setQuery(value);
1754
+ const first = visibleEntries(items, value).find((i) => {
1755
+ const e = items[i];
1756
+ return isItem(e) && !e.disabled;
1757
+ });
1758
+ setActive(first ?? -1);
1759
+ };
1677
1760
  const own = trigger.props;
1678
1761
  const wired = cloneElement(trigger, {
1679
1762
  "aria-haspopup": "menu",
@@ -1682,63 +1765,110 @@ function Menu({ trigger, items, align = "end", className }) {
1682
1765
  onClick: (e) => {
1683
1766
  own.onClick?.(e);
1684
1767
  if (open) setOpen(false);
1685
- else openAt(enabled[0] ?? 0);
1768
+ else openAt("first");
1686
1769
  },
1687
1770
  onKeyDown: (e) => {
1688
1771
  own.onKeyDown?.(e);
1689
1772
  if (!open && (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ")) {
1690
1773
  e.preventDefault();
1691
- openAt(enabled[0] ?? 0);
1774
+ openAt("first");
1692
1775
  } else if (!open && e.key === "ArrowUp") {
1693
1776
  e.preventDefault();
1694
- openAt(enabled[enabled.length - 1] ?? 0);
1777
+ openAt("last");
1695
1778
  }
1696
1779
  }
1697
1780
  });
1698
- return /* @__PURE__ */ jsxs28("div", { ref: rootRef, className: ["fds-menu", className].filter(Boolean).join(" "), children: [
1699
- wired,
1700
- open && /* @__PURE__ */ jsx33(
1701
- "div",
1702
- {
1703
- ref: listRef,
1704
- id: listId,
1705
- role: "menu",
1706
- tabIndex: -1,
1707
- className: `fds-menu__list fds-menu__list--${align}`,
1708
- "aria-activedescendant": `${listId}-item-${active}`,
1709
- onKeyDown: onListKeyDown,
1710
- children: items.map((it, i) => /* @__PURE__ */ jsxs28(
1711
- "div",
1712
- {
1713
- id: `${listId}-item-${i}`,
1714
- role: "menuitem",
1715
- "aria-disabled": it.disabled || void 0,
1716
- className: [
1717
- "fds-menu__item",
1718
- it.tone === "danger" ? "fds-menu__item--danger" : "",
1719
- i === active ? "fds-menu__item--active" : "",
1720
- it.disabled ? "fds-menu__item--disabled" : ""
1721
- ].filter(Boolean).join(" "),
1722
- onMouseEnter: () => !it.disabled && setActive(i),
1723
- onMouseDown: (e) => e.preventDefault(),
1724
- onClick: () => choose(i),
1725
- children: [
1726
- it.icon != null && /* @__PURE__ */ jsx33("span", { className: "fds-menu__icon", "aria-hidden": "true", children: it.icon }),
1727
- it.label
1728
- ]
1729
- },
1730
- i
1731
- ))
1732
- }
1733
- )
1734
- ] });
1781
+ const listClasses = [
1782
+ "fds-menu__list",
1783
+ `fds-menu__list--${placement}`,
1784
+ placement === "right" ? "" : `fds-menu__list--${align}`,
1785
+ width === "wide" ? "fds-menu__list--wide" : ""
1786
+ ].filter(Boolean).join(" ");
1787
+ return /* @__PURE__ */ jsxs29(
1788
+ "div",
1789
+ {
1790
+ ref: rootRef,
1791
+ className: ["fds-menu", block ? "fds-menu--block" : "", className].filter(Boolean).join(" "),
1792
+ children: [
1793
+ wired,
1794
+ open && /* @__PURE__ */ jsxs29("div", { className: listClasses, onKeyDown: onListKeyDown, children: [
1795
+ search && /* @__PURE__ */ jsxs29("div", { className: "fds-menu__search", children: [
1796
+ /* @__PURE__ */ jsx34(Search, { "aria-hidden": "true" }),
1797
+ /* @__PURE__ */ jsx34(
1798
+ "input",
1799
+ {
1800
+ ref: searchRef,
1801
+ type: "text",
1802
+ value: query,
1803
+ placeholder: search.placeholder,
1804
+ disabled: search.disabled,
1805
+ "aria-label": search.placeholder,
1806
+ "aria-controls": listId,
1807
+ "aria-activedescendant": active >= 0 ? `${listId}-item-${active}` : void 0,
1808
+ onChange: (e) => onQuery(e.target.value)
1809
+ }
1810
+ )
1811
+ ] }),
1812
+ /* @__PURE__ */ jsxs29(
1813
+ "div",
1814
+ {
1815
+ ref: listRef,
1816
+ id: listId,
1817
+ role: "menu",
1818
+ tabIndex: -1,
1819
+ className: "fds-menu__items",
1820
+ "aria-activedescendant": (!search || search.disabled) && active >= 0 ? `${listId}-item-${active}` : void 0,
1821
+ children: [
1822
+ shown.length === 0 && search && /* @__PURE__ */ jsx34("div", { className: "fds-menu__empty", children: search.emptyLabel }),
1823
+ shown.map((i) => {
1824
+ const e = items[i];
1825
+ if (!isItem(e)) {
1826
+ return e.type === "label" ? /* @__PURE__ */ jsx34("div", { className: "fds-menu__label", role: "presentation", children: e.label }, i) : /* @__PURE__ */ jsx34("div", { className: "fds-menu__divider", role: "separator" }, i);
1827
+ }
1828
+ return /* @__PURE__ */ jsxs29(
1829
+ "div",
1830
+ {
1831
+ id: `${listId}-item-${i}`,
1832
+ role: "menuitem",
1833
+ "aria-disabled": e.disabled || void 0,
1834
+ "aria-current": e.selected || void 0,
1835
+ className: [
1836
+ "fds-menu__item",
1837
+ e.tone === "danger" ? "fds-menu__item--danger" : "",
1838
+ i === active ? "fds-menu__item--active" : "",
1839
+ e.disabled ? "fds-menu__item--disabled" : ""
1840
+ ].filter(Boolean).join(" "),
1841
+ onMouseEnter: () => !e.disabled && setActive(i),
1842
+ onMouseDown: (ev) => ev.preventDefault(),
1843
+ onClick: () => choose(i),
1844
+ children: [
1845
+ e.avatar != null && /* @__PURE__ */ jsx34("span", { className: "fds-menu__avatar", "aria-hidden": "true", children: e.avatar }),
1846
+ e.icon != null && /* @__PURE__ */ jsx34("span", { className: "fds-menu__icon", "aria-hidden": "true", children: e.icon }),
1847
+ /* @__PURE__ */ jsxs29("span", { className: "fds-menu__text", children: [
1848
+ /* @__PURE__ */ jsx34("span", { className: "fds-menu__title", children: e.label }),
1849
+ e.description != null && /* @__PURE__ */ jsx34("span", { className: "fds-menu__description", children: e.description })
1850
+ ] }),
1851
+ e.trailing != null && /* @__PURE__ */ jsx34("span", { className: "fds-menu__trailing", children: e.trailing }),
1852
+ e.selected && /* @__PURE__ */ jsx34(Check, { className: "fds-menu__check", "aria-hidden": "true" })
1853
+ ]
1854
+ },
1855
+ i
1856
+ );
1857
+ })
1858
+ ]
1859
+ }
1860
+ )
1861
+ ] })
1862
+ ]
1863
+ }
1864
+ );
1735
1865
  }
1736
1866
 
1737
1867
  // src/components/Table/Table.tsx
1738
- import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
1868
+ import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
1739
1869
  function Table({ columns, rows, rowKey, empty, className, "aria-label": ariaLabel, ...rest }) {
1740
- return /* @__PURE__ */ jsx34("div", { className: ["fds-table", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ jsxs29("table", { className: "fds-table__table", "aria-label": ariaLabel, children: [
1741
- /* @__PURE__ */ jsx34("thead", { children: /* @__PURE__ */ jsx34("tr", { children: columns.map((c) => /* @__PURE__ */ jsx34(
1870
+ return /* @__PURE__ */ jsx35("div", { className: ["fds-table", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ jsxs30("table", { className: "fds-table__table", "aria-label": ariaLabel, children: [
1871
+ /* @__PURE__ */ jsx35("thead", { children: /* @__PURE__ */ jsx35("tr", { children: columns.map((c) => /* @__PURE__ */ jsx35(
1742
1872
  "th",
1743
1873
  {
1744
1874
  scope: "col",
@@ -1748,17 +1878,17 @@ function Table({ columns, rows, rowKey, empty, className, "aria-label": ariaLabe
1748
1878
  },
1749
1879
  c.key
1750
1880
  )) }) }),
1751
- /* @__PURE__ */ jsxs29("tbody", { children: [
1752
- rows.map((row) => /* @__PURE__ */ jsx34("tr", { children: columns.map((c) => /* @__PURE__ */ jsx34("td", { className: c.align === "end" ? "fds-table__cell--end" : void 0, children: c.cell(row) }, c.key)) }, rowKey(row))),
1753
- rows.length === 0 && empty != null && /* @__PURE__ */ jsx34("tr", { children: /* @__PURE__ */ jsx34("td", { colSpan: columns.length, className: "fds-table__empty", children: empty }) })
1881
+ /* @__PURE__ */ jsxs30("tbody", { children: [
1882
+ rows.map((row) => /* @__PURE__ */ jsx35("tr", { children: columns.map((c) => /* @__PURE__ */ jsx35("td", { className: c.align === "end" ? "fds-table__cell--end" : void 0, children: c.cell(row) }, c.key)) }, rowKey(row))),
1883
+ rows.length === 0 && empty != null && /* @__PURE__ */ jsx35("tr", { children: /* @__PURE__ */ jsx35("td", { colSpan: columns.length, className: "fds-table__empty", children: empty }) })
1754
1884
  ] })
1755
1885
  ] }) });
1756
1886
  }
1757
1887
 
1758
1888
  // src/components/PricingCard/PricingCard.tsx
1759
- import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
1889
+ import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
1760
1890
  function CheckIcon3() {
1761
- return /* @__PURE__ */ jsx35("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx35("path", { d: "M3.5 8.5l3 3 6-7", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) });
1891
+ return /* @__PURE__ */ jsx36("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx36("path", { d: "M3.5 8.5l3 3 6-7", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) });
1762
1892
  }
1763
1893
  function PricingCard({
1764
1894
  eyebrow,
@@ -1776,35 +1906,426 @@ function PricingCard({
1776
1906
  ...rest
1777
1907
  }) {
1778
1908
  const classes = ["fds-pricing-card", highlighted ? "fds-pricing-card--highlighted" : "", className].filter(Boolean).join(" ");
1779
- return /* @__PURE__ */ jsxs30("article", { className: classes, ...rest, children: [
1780
- /* @__PURE__ */ jsxs30("div", { className: "fds-pricing-card__top", children: [
1781
- eyebrow != null && /* @__PURE__ */ jsx35("span", { className: "fds-pricing-card__eyebrow", children: eyebrow }),
1782
- /* @__PURE__ */ jsxs30("h3", { className: "fds-pricing-card__title", children: [
1909
+ return /* @__PURE__ */ jsxs31("article", { className: classes, ...rest, children: [
1910
+ /* @__PURE__ */ jsxs31("div", { className: "fds-pricing-card__top", children: [
1911
+ eyebrow != null && /* @__PURE__ */ jsx36("span", { className: "fds-pricing-card__eyebrow", children: eyebrow }),
1912
+ /* @__PURE__ */ jsxs31("h3", { className: "fds-pricing-card__title", children: [
1783
1913
  title,
1784
1914
  badge
1785
1915
  ] }),
1786
- /* @__PURE__ */ jsxs30("p", { className: "fds-pricing-card__price", children: [
1787
- /* @__PURE__ */ jsx35("span", { className: "fds-pricing-card__amount", children: price }),
1788
- period != null && /* @__PURE__ */ jsx35("span", { className: "fds-pricing-card__period", children: period })
1916
+ /* @__PURE__ */ jsxs31("p", { className: "fds-pricing-card__price", children: [
1917
+ /* @__PURE__ */ jsx36("span", { className: "fds-pricing-card__amount", children: price }),
1918
+ period != null && /* @__PURE__ */ jsx36("span", { className: "fds-pricing-card__period", children: period })
1789
1919
  ] }),
1790
- description != null && /* @__PURE__ */ jsx35("p", { className: "fds-pricing-card__description", children: description }),
1791
- action != null && /* @__PURE__ */ jsx35("div", { className: "fds-pricing-card__action", children: action })
1920
+ description != null && /* @__PURE__ */ jsx36("p", { className: "fds-pricing-card__description", children: description }),
1921
+ action != null && /* @__PURE__ */ jsx36("div", { className: "fds-pricing-card__action", children: action })
1792
1922
  ] }),
1793
- features.length > 0 && /* @__PURE__ */ jsxs30("div", { className: "fds-pricing-card__features", children: [
1794
- /* @__PURE__ */ jsx35("p", { className: "fds-pricing-card__featuresTitle", children: featuresTitle }),
1795
- featuresIntro != null && /* @__PURE__ */ jsx35("p", { className: "fds-pricing-card__intro", children: featuresIntro }),
1796
- /* @__PURE__ */ jsx35("ul", { className: "fds-pricing-card__list", children: features.map((f, i) => /* @__PURE__ */ jsxs30("li", { className: "fds-pricing-card__feature", children: [
1797
- /* @__PURE__ */ jsx35("span", { className: "fds-pricing-card__check", children: /* @__PURE__ */ jsx35(CheckIcon3, {}) }),
1923
+ features.length > 0 && /* @__PURE__ */ jsxs31("div", { className: "fds-pricing-card__features", children: [
1924
+ /* @__PURE__ */ jsx36("p", { className: "fds-pricing-card__featuresTitle", children: featuresTitle }),
1925
+ featuresIntro != null && /* @__PURE__ */ jsx36("p", { className: "fds-pricing-card__intro", children: featuresIntro }),
1926
+ /* @__PURE__ */ jsx36("ul", { className: "fds-pricing-card__list", children: features.map((f, i) => /* @__PURE__ */ jsxs31("li", { className: "fds-pricing-card__feature", children: [
1927
+ /* @__PURE__ */ jsx36("span", { className: "fds-pricing-card__check", children: /* @__PURE__ */ jsx36(CheckIcon3, {}) }),
1798
1928
  f
1799
1929
  ] }, i)) })
1800
1930
  ] })
1801
1931
  ] });
1802
1932
  }
1933
+
1934
+ // src/components/StatusDot/StatusDot.tsx
1935
+ import { jsx as jsx37 } from "react/jsx-runtime";
1936
+ function StatusDot({ status, label, className, ...rest }) {
1937
+ return /* @__PURE__ */ jsx37(
1938
+ "span",
1939
+ {
1940
+ className: ["fds-status-dot", `fds-status-dot--${status}`, className].filter(Boolean).join(" "),
1941
+ role: label ? "img" : void 0,
1942
+ "aria-label": label,
1943
+ "aria-hidden": label ? void 0 : true,
1944
+ ...rest
1945
+ }
1946
+ );
1947
+ }
1948
+
1949
+ // src/components/ListLabel/ListLabel.tsx
1950
+ import { jsx as jsx38 } from "react/jsx-runtime";
1951
+ function ListLabel({ className, children, ...rest }) {
1952
+ return /* @__PURE__ */ jsx38("div", { className: ["fds-list-label", className].filter(Boolean).join(" "), ...rest, children });
1953
+ }
1954
+
1955
+ // src/components/Divider/Divider.tsx
1956
+ import { jsx as jsx39 } from "react/jsx-runtime";
1957
+ function Divider({ orientation = "horizontal", className, ...rest }) {
1958
+ return /* @__PURE__ */ jsx39(
1959
+ "hr",
1960
+ {
1961
+ className: ["fds-divider", `fds-divider--${orientation}`, className].filter(Boolean).join(" "),
1962
+ "aria-orientation": orientation,
1963
+ ...rest
1964
+ }
1965
+ );
1966
+ }
1967
+
1968
+ // src/components/Tooltip/Tooltip.tsx
1969
+ import {
1970
+ cloneElement as cloneElement2,
1971
+ useEffect as useEffect7,
1972
+ useId as useId13,
1973
+ useRef as useRef8,
1974
+ useState as useState9
1975
+ } from "react";
1976
+ import { createPortal as createPortal2 } from "react-dom";
1977
+ import { Fragment as Fragment2, jsx as jsx40, jsxs as jsxs32 } from "react/jsx-runtime";
1978
+ var GAP = 8;
1979
+ function place(rect, side) {
1980
+ switch (side) {
1981
+ case "right":
1982
+ return { top: rect.top + rect.height / 2, left: rect.right + GAP };
1983
+ case "left":
1984
+ return { top: rect.top + rect.height / 2, left: rect.left - GAP };
1985
+ case "top":
1986
+ return { top: rect.top - GAP, left: rect.left + rect.width / 2 };
1987
+ case "bottom":
1988
+ return { top: rect.bottom + GAP, left: rect.left + rect.width / 2 };
1989
+ }
1990
+ }
1991
+ function Tooltip({ content, children, side = "right", delay = 400, disabled = false }) {
1992
+ const id = useId13();
1993
+ const timer = useRef8();
1994
+ const [pos, setPos] = useState9(null);
1995
+ useEffect7(() => () => window.clearTimeout(timer.current), []);
1996
+ useEffect7(() => {
1997
+ if (disabled) setPos(null);
1998
+ }, [disabled]);
1999
+ const show = (el, wait) => {
2000
+ window.clearTimeout(timer.current);
2001
+ timer.current = window.setTimeout(() => setPos(place(el.getBoundingClientRect(), side)), wait);
2002
+ };
2003
+ const hide = () => {
2004
+ window.clearTimeout(timer.current);
2005
+ setPos(null);
2006
+ };
2007
+ if (disabled) return children;
2008
+ const own = children.props;
2009
+ const trigger = cloneElement2(children, {
2010
+ "aria-describedby": pos ? id : own["aria-describedby"],
2011
+ onMouseEnter: (e) => {
2012
+ own.onMouseEnter?.(e);
2013
+ show(e.currentTarget, delay);
2014
+ },
2015
+ onMouseLeave: (e) => {
2016
+ own.onMouseLeave?.(e);
2017
+ hide();
2018
+ },
2019
+ onFocus: (e) => {
2020
+ own.onFocus?.(e);
2021
+ if (e.currentTarget.matches(":focus-visible")) show(e.currentTarget, 0);
2022
+ },
2023
+ onBlur: (e) => {
2024
+ own.onBlur?.(e);
2025
+ hide();
2026
+ }
2027
+ });
2028
+ return /* @__PURE__ */ jsxs32(Fragment2, { children: [
2029
+ trigger,
2030
+ pos && createPortal2(
2031
+ /* @__PURE__ */ jsx40(
2032
+ "div",
2033
+ {
2034
+ id,
2035
+ role: "tooltip",
2036
+ className: `fds-tooltip fds-tooltip--${side}`,
2037
+ style: { top: pos.top, left: pos.left },
2038
+ children: content
2039
+ }
2040
+ ),
2041
+ document.body
2042
+ )
2043
+ ] });
2044
+ }
2045
+
2046
+ // src/components/BrandButton/BrandButton.tsx
2047
+ import { PanelLeftOpen } from "lucide-react";
2048
+ import { jsx as jsx41, jsxs as jsxs33 } from "react/jsx-runtime";
2049
+ function BrandButton({ mark, hoverIcon, type = "button", className, ...rest }) {
2050
+ return /* @__PURE__ */ jsxs33("button", { type, className: ["fds-brand-button", className].filter(Boolean).join(" "), ...rest, children: [
2051
+ /* @__PURE__ */ jsx41("span", { className: "fds-brand-button__mark", "aria-hidden": "true", children: mark }),
2052
+ /* @__PURE__ */ jsx41("span", { className: "fds-brand-button__hover", "aria-hidden": "true", children: hoverIcon ?? /* @__PURE__ */ jsx41(PanelLeftOpen, {}) })
2053
+ ] });
2054
+ }
2055
+
2056
+ // src/components/Sidebar/SidebarContext.ts
2057
+ import { createContext, useContext } from "react";
2058
+ var SidebarContext = createContext(null);
2059
+ function useSidebar() {
2060
+ return useContext(SidebarContext);
2061
+ }
2062
+
2063
+ // src/components/SidebarItem/SidebarItem.tsx
2064
+ import { jsx as jsx42, jsxs as jsxs34 } from "react/jsx-runtime";
2065
+ function SidebarItem({
2066
+ as,
2067
+ icon,
2068
+ leading,
2069
+ active = false,
2070
+ iconOnly,
2071
+ className,
2072
+ children,
2073
+ ...rest
2074
+ }) {
2075
+ const sidebar = useSidebar();
2076
+ const compact = iconOnly ?? sidebar?.collapsed ?? false;
2077
+ const Component = as ?? "a";
2078
+ const classes = [
2079
+ "fds-sidebar-item",
2080
+ active ? "fds-sidebar-item--active" : "",
2081
+ compact ? "fds-sidebar-item--icon-only" : "",
2082
+ className
2083
+ ].filter(Boolean).join(" ");
2084
+ return /* @__PURE__ */ jsx42(Tooltip, { content: children, disabled: !compact, children: /* @__PURE__ */ jsxs34(Component, { className: classes, "aria-current": active ? "page" : void 0, ...rest, children: [
2085
+ (leading ?? icon) != null && /* @__PURE__ */ jsx42("span", { className: leading != null ? "fds-sidebar-item__leading" : "fds-sidebar-item__icon", "aria-hidden": "true", children: leading ?? icon }),
2086
+ /* @__PURE__ */ jsx42("span", { className: "fds-sidebar-item__label", children })
2087
+ ] }) });
2088
+ }
2089
+
2090
+ // src/components/Sidebar/Sidebar.tsx
2091
+ import {
2092
+ useCallback,
2093
+ useEffect as useEffect8,
2094
+ useMemo as useMemo2,
2095
+ useRef as useRef9,
2096
+ useState as useState10
2097
+ } from "react";
2098
+ import { PanelLeftClose } from "lucide-react";
2099
+ import { jsx as jsx43, jsxs as jsxs35 } from "react/jsx-runtime";
2100
+ function SidebarRoot({
2101
+ collapsed: controlled,
2102
+ defaultCollapsed = false,
2103
+ onCollapsedChange,
2104
+ shortcut = true,
2105
+ className,
2106
+ children,
2107
+ "aria-label": ariaLabel = "Main",
2108
+ ...rest
2109
+ }) {
2110
+ const [own, setOwn] = useState10(defaultCollapsed);
2111
+ const collapsed = controlled ?? own;
2112
+ const setCollapsed = useCallback(
2113
+ (next) => {
2114
+ if (controlled === void 0) setOwn(next);
2115
+ onCollapsedChange?.(next);
2116
+ },
2117
+ [controlled, onCollapsedChange]
2118
+ );
2119
+ const toggle = useCallback(() => setCollapsed(!collapsed), [collapsed, setCollapsed]);
2120
+ useEffect8(() => {
2121
+ if (!shortcut) return;
2122
+ const onKey = (e) => {
2123
+ if ((e.metaKey || e.ctrlKey) && e.key === "\\") {
2124
+ e.preventDefault();
2125
+ toggle();
2126
+ }
2127
+ };
2128
+ window.addEventListener("keydown", onKey);
2129
+ return () => window.removeEventListener("keydown", onKey);
2130
+ }, [shortcut, toggle]);
2131
+ const state = useMemo2(() => ({ collapsed, setCollapsed, toggle }), [collapsed, setCollapsed, toggle]);
2132
+ return /* @__PURE__ */ jsx43(SidebarContext.Provider, { value: state, children: /* @__PURE__ */ jsx43(
2133
+ "nav",
2134
+ {
2135
+ className: ["fds-sidebar", collapsed ? "fds-sidebar--collapsed" : "", className].filter(Boolean).join(" "),
2136
+ "aria-label": ariaLabel,
2137
+ "data-collapsed": collapsed || void 0,
2138
+ ...rest,
2139
+ children
2140
+ }
2141
+ ) });
2142
+ }
2143
+ function useInert(on) {
2144
+ const ref = useRef9(null);
2145
+ useEffect8(() => {
2146
+ if (ref.current) ref.current.inert = on;
2147
+ }, [on]);
2148
+ return ref;
2149
+ }
2150
+ function SidebarBrand({
2151
+ logo,
2152
+ mark,
2153
+ collapseLabel = "Collapse sidebar",
2154
+ expandLabel = "Expand sidebar"
2155
+ }) {
2156
+ const sidebar = useSidebar();
2157
+ const collapsed = sidebar?.collapsed ?? false;
2158
+ const collapseRef = useInert(collapsed);
2159
+ const expandRef = useInert(!collapsed);
2160
+ return /* @__PURE__ */ jsxs35("div", { className: "fds-sidebar__brand", children: [
2161
+ /* @__PURE__ */ jsx43("span", { className: "fds-sidebar__logo", "aria-hidden": collapsed || void 0, children: logo }),
2162
+ /* @__PURE__ */ jsx43("span", { ref: collapseRef, className: "fds-sidebar__collapse", children: /* @__PURE__ */ jsx43(Tooltip, { content: collapseLabel, side: "bottom", children: /* @__PURE__ */ jsx43(
2163
+ IconButton,
2164
+ {
2165
+ variant: "ghost",
2166
+ size: "small",
2167
+ icon: /* @__PURE__ */ jsx43(PanelLeftClose, {}),
2168
+ "aria-label": collapseLabel,
2169
+ "aria-keyshortcuts": "Meta+Backslash Control+Backslash",
2170
+ onClick: () => sidebar?.setCollapsed(true)
2171
+ }
2172
+ ) }) }),
2173
+ /* @__PURE__ */ jsx43("span", { ref: expandRef, className: "fds-sidebar__expand", children: /* @__PURE__ */ jsx43(Tooltip, { content: expandLabel, children: /* @__PURE__ */ jsx43(BrandButton, { mark, "aria-label": expandLabel, onClick: () => sidebar?.setCollapsed(false) }) }) })
2174
+ ] });
2175
+ }
2176
+ function SidebarAction({ icon, label, type = "button", className, ...rest }) {
2177
+ const sidebar = useSidebar();
2178
+ const collapsed = sidebar?.collapsed ?? false;
2179
+ return /* @__PURE__ */ jsx43(Tooltip, { content: label, disabled: !collapsed, children: /* @__PURE__ */ jsxs35(
2180
+ "button",
2181
+ {
2182
+ type,
2183
+ className: ["fds-sidebar__action", className].filter(Boolean).join(" "),
2184
+ "aria-label": collapsed ? label : void 0,
2185
+ ...rest,
2186
+ children: [
2187
+ /* @__PURE__ */ jsx43("span", { className: "fds-sidebar__action-icon", "aria-hidden": "true", children: icon }),
2188
+ /* @__PURE__ */ jsx43("span", { className: "fds-sidebar__action-label", children: label })
2189
+ ]
2190
+ }
2191
+ ) });
2192
+ }
2193
+ function SidebarSection({ hideWhenCollapsed = false, className, children, ...rest }) {
2194
+ const sidebar = useSidebar();
2195
+ const hidden = hideWhenCollapsed && (sidebar?.collapsed ?? false);
2196
+ const ref = useInert(hidden);
2197
+ return /* @__PURE__ */ jsx43(
2198
+ "div",
2199
+ {
2200
+ ref,
2201
+ className: ["fds-sidebar__section", hidden ? "fds-sidebar__section--hidden" : "", className].filter(Boolean).join(" "),
2202
+ "aria-hidden": hidden || void 0,
2203
+ ...rest,
2204
+ children
2205
+ }
2206
+ );
2207
+ }
2208
+ function SidebarHeader({ className, children, ...rest }) {
2209
+ return /* @__PURE__ */ jsx43("div", { className: ["fds-sidebar__header", className].filter(Boolean).join(" "), ...rest, children });
2210
+ }
2211
+ function SidebarFooter({ className, children, ...rest }) {
2212
+ return /* @__PURE__ */ jsx43("div", { className: ["fds-sidebar__footer", className].filter(Boolean).join(" "), ...rest, children });
2213
+ }
2214
+ var Sidebar = Object.assign(SidebarRoot, {
2215
+ Header: SidebarHeader,
2216
+ Brand: SidebarBrand,
2217
+ Action: SidebarAction,
2218
+ Section: SidebarSection,
2219
+ Item: SidebarItem,
2220
+ Footer: SidebarFooter
2221
+ });
2222
+
2223
+ // src/components/WorkspaceSwitcher/WorkspaceSwitcher.tsx
2224
+ import { forwardRef as forwardRef8 } from "react";
2225
+ import { ChevronDown } from "lucide-react";
2226
+ import { jsx as jsx44, jsxs as jsxs36 } from "react/jsx-runtime";
2227
+ function WorkspaceAvatar({ name }) {
2228
+ return /* @__PURE__ */ jsx44("span", { className: "fds-workspace-avatar", "aria-hidden": "true", children: name.trim().charAt(0).toUpperCase() || "?" });
2229
+ }
2230
+ var WorkspaceSwitcher = forwardRef8(function WorkspaceSwitcher2({ name, plan, avatar, compact, type = "button", className, ...rest }, ref) {
2231
+ const sidebar = useSidebar();
2232
+ const iconOnly = compact ?? sidebar?.collapsed ?? false;
2233
+ return /* @__PURE__ */ jsxs36(
2234
+ "button",
2235
+ {
2236
+ ref,
2237
+ type,
2238
+ className: ["fds-workspace-switcher", iconOnly ? "fds-workspace-switcher--compact" : "", className].filter(Boolean).join(" "),
2239
+ "aria-label": iconOnly ? `Workspace: ${name}` : void 0,
2240
+ ...rest,
2241
+ children: [
2242
+ avatar ?? /* @__PURE__ */ jsx44(WorkspaceAvatar, { name }),
2243
+ /* @__PURE__ */ jsxs36("span", { className: "fds-workspace-switcher__text", "aria-hidden": iconOnly || void 0, children: [
2244
+ /* @__PURE__ */ jsx44("span", { className: "fds-workspace-switcher__name", children: name }),
2245
+ plan && /* @__PURE__ */ jsx44("span", { className: "fds-workspace-switcher__plan", children: plan }),
2246
+ /* @__PURE__ */ jsx44(ChevronDown, { className: "fds-workspace-switcher__chevron", "aria-hidden": "true" })
2247
+ ] })
2248
+ ]
2249
+ }
2250
+ );
2251
+ });
2252
+
2253
+ // src/components/AvatarLabelGroup/AvatarLabelGroup.tsx
2254
+ import { forwardRef as forwardRef9 } from "react";
2255
+ import { jsx as jsx45, jsxs as jsxs37 } from "react/jsx-runtime";
2256
+ var AvatarLabelGroup = forwardRef9(function AvatarLabelGroup2({ name, detail, src, compact = false, type = "button", className, ...rest }, ref) {
2257
+ return /* @__PURE__ */ jsxs37(
2258
+ "button",
2259
+ {
2260
+ ref,
2261
+ type,
2262
+ className: ["fds-avatar-label-group", compact ? "fds-avatar-label-group--compact" : "", className].filter(Boolean).join(" "),
2263
+ "aria-label": compact ? name : void 0,
2264
+ ...rest,
2265
+ children: [
2266
+ /* @__PURE__ */ jsx45(Avatar, { name, src, size: "small" }),
2267
+ /* @__PURE__ */ jsxs37("span", { className: "fds-avatar-label-group__text", "aria-hidden": compact || void 0, children: [
2268
+ /* @__PURE__ */ jsx45("span", { className: "fds-avatar-label-group__name", children: name }),
2269
+ detail && /* @__PURE__ */ jsx45("span", { className: "fds-avatar-label-group__detail", children: detail })
2270
+ ] })
2271
+ ]
2272
+ }
2273
+ );
2274
+ });
2275
+
2276
+ // src/components/AppLayout/AppLayout.tsx
2277
+ import { jsx as jsx46 } from "react/jsx-runtime";
2278
+ function AppLayoutRoot({ className, children, ...rest }) {
2279
+ return /* @__PURE__ */ jsx46("div", { className: ["fds-app-layout", className].filter(Boolean).join(" "), ...rest, children });
2280
+ }
2281
+ function AppLayoutPanel({ className, children, ...rest }) {
2282
+ return /* @__PURE__ */ jsx46("main", { className: ["fds-app-layout__panel", className].filter(Boolean).join(" "), ...rest, children });
2283
+ }
2284
+ var AppLayout = Object.assign(AppLayoutRoot, { Panel: AppLayoutPanel });
2285
+
2286
+ // src/components/PageHeader/PageHeader.tsx
2287
+ import { jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
2288
+ function PageHeader({ title, description, breadcrumb, actions, className, children, ...rest }) {
2289
+ return /* @__PURE__ */ jsxs38("header", { className: ["fds-page-header", className].filter(Boolean).join(" "), ...rest, children: [
2290
+ /* @__PURE__ */ jsxs38("div", { className: "fds-page-header__row", children: [
2291
+ /* @__PURE__ */ jsxs38("div", { className: "fds-page-header__text", children: [
2292
+ breadcrumb != null && /* @__PURE__ */ jsx47("div", { className: "fds-page-header__breadcrumb", children: breadcrumb }),
2293
+ /* @__PURE__ */ jsx47("h1", { className: "fds-page-header__title", children: title }),
2294
+ description != null && /* @__PURE__ */ jsx47("p", { className: "fds-page-header__description", children: description })
2295
+ ] }),
2296
+ actions != null && /* @__PURE__ */ jsx47("div", { className: "fds-page-header__actions", children: actions })
2297
+ ] }),
2298
+ children
2299
+ ] });
2300
+ }
2301
+
2302
+ // src/components/Toast/Toast.tsx
2303
+ import { useEffect as useEffect9 } from "react";
2304
+ import { X } from "lucide-react";
2305
+ import { jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
2306
+ function ToastRegion({ className, children, ...rest }) {
2307
+ return /* @__PURE__ */ jsx48("div", { className: ["fds-toast-region", className].filter(Boolean).join(" "), "aria-live": "polite", ...rest, children });
2308
+ }
2309
+ function Toast({ children, action, onDismiss, duration, className, ...rest }) {
2310
+ useEffect9(() => {
2311
+ if (!duration || !onDismiss) return;
2312
+ const t = window.setTimeout(onDismiss, duration);
2313
+ return () => window.clearTimeout(t);
2314
+ }, [duration, onDismiss]);
2315
+ return /* @__PURE__ */ jsxs39("div", { role: "status", className: ["fds-toast", className].filter(Boolean).join(" "), ...rest, children: [
2316
+ /* @__PURE__ */ jsx48("span", { className: "fds-toast__message", children }),
2317
+ action && /* @__PURE__ */ jsx48("button", { type: "button", className: "fds-toast__action", onClick: action.onClick, children: action.label }),
2318
+ onDismiss && /* @__PURE__ */ jsx48("button", { type: "button", className: "fds-toast__close", "aria-label": "Dismiss", onClick: onDismiss, children: /* @__PURE__ */ jsx48(X, { "aria-hidden": "true" }) })
2319
+ ] });
2320
+ }
1803
2321
  export {
1804
2322
  Accordion,
2323
+ AppLayout,
1805
2324
  AppNav,
1806
2325
  Avatar,
2326
+ AvatarLabelGroup,
1807
2327
  Badge,
2328
+ BrandButton,
1808
2329
  Button,
1809
2330
  ButtonLink,
1810
2331
  Callout,
@@ -1812,13 +2333,16 @@ export {
1812
2333
  Checkbox,
1813
2334
  DiffPropertyList,
1814
2335
  DiffSection,
2336
+ Divider,
1815
2337
  EmptyState,
1816
2338
  IconButton,
1817
2339
  Input,
2340
+ ListLabel,
1818
2341
  Menu,
1819
2342
  MismatchCard,
1820
2343
  Modal,
1821
2344
  MultiSelect,
2345
+ PageHeader,
1822
2346
  Pagination,
1823
2347
  PricingCard,
1824
2348
  Radio,
@@ -1828,16 +2352,26 @@ export {
1828
2352
  SegmentedControl,
1829
2353
  Select,
1830
2354
  SettingsSection,
2355
+ Sidebar,
2356
+ SidebarItem,
1831
2357
  Skeleton,
1832
2358
  SkeletonGroup,
2359
+ Spinner,
1833
2360
  Split,
1834
2361
  StackedCardsIllustration,
1835
2362
  Stat,
2363
+ StatusDot,
1836
2364
  StepList,
1837
2365
  Swatch,
1838
2366
  TabNav,
1839
2367
  Table,
1840
2368
  Tag,
2369
+ Toast,
2370
+ ToastRegion,
1841
2371
  Toggle,
1842
- breakpoints
2372
+ Tooltip,
2373
+ WorkspaceAvatar,
2374
+ WorkspaceSwitcher,
2375
+ breakpoints,
2376
+ useSidebar
1843
2377
  };