cetec-design-system 4.4.0-0 → 4.6.0-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
@@ -974,7 +974,7 @@ const spinnerVariantKeys = [
974
974
  "inverse",
975
975
  "centered"
976
976
  ];
977
- const getVariantProps$x = (variants) => ({ ...spinnerDefaultVariants, ...compact(variants) });
977
+ const getVariantProps$y = (variants) => ({ ...spinnerDefaultVariants, ...compact(variants) });
978
978
  const spinner = /* @__PURE__ */ Object.assign(spinnerFn, {
979
979
  __recipe__: false,
980
980
  __name__: "spinner",
@@ -999,7 +999,7 @@ const spinner = /* @__PURE__ */ Object.assign(spinnerFn, {
999
999
  splitVariantProps(props) {
1000
1000
  return splitProps$1(props, spinnerVariantKeys);
1001
1001
  },
1002
- getVariantProps: getVariantProps$x
1002
+ getVariantProps: getVariantProps$y
1003
1003
  });
1004
1004
  const tagFn = /* @__PURE__ */ createRecipe("tag", {
1005
1005
  "variant": "default",
@@ -1667,7 +1667,7 @@ const toggleFn = memo((props = {}) => {
1667
1667
  return Object.fromEntries(toggleSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
1668
1668
  });
1669
1669
  const toggleVariantKeys = [];
1670
- const getVariantProps$w = (variants) => ({ ...toggleDefaultVariants, ...compact(variants) });
1670
+ const getVariantProps$x = (variants) => ({ ...toggleDefaultVariants, ...compact(variants) });
1671
1671
  const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
1672
1672
  __recipe__: false,
1673
1673
  __name__: "toggle",
@@ -1678,7 +1678,7 @@ const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
1678
1678
  splitVariantProps(props) {
1679
1679
  return splitProps$1(props, toggleVariantKeys);
1680
1680
  },
1681
- getVariantProps: getVariantProps$w
1681
+ getVariantProps: getVariantProps$x
1682
1682
  });
1683
1683
  const alertDefaultVariants = {
1684
1684
  "tone": "info"
@@ -1721,7 +1721,7 @@ const alertFn = memo((props = {}) => {
1721
1721
  const alertVariantKeys = [
1722
1722
  "tone"
1723
1723
  ];
1724
- const getVariantProps$v = (variants) => ({ ...alertDefaultVariants, ...compact(variants) });
1724
+ const getVariantProps$w = (variants) => ({ ...alertDefaultVariants, ...compact(variants) });
1725
1725
  const alert = /* @__PURE__ */ Object.assign(alertFn, {
1726
1726
  __recipe__: false,
1727
1727
  __name__: "alert",
@@ -1740,7 +1740,7 @@ const alert = /* @__PURE__ */ Object.assign(alertFn, {
1740
1740
  splitVariantProps(props) {
1741
1741
  return splitProps$1(props, alertVariantKeys);
1742
1742
  },
1743
- getVariantProps: getVariantProps$v
1743
+ getVariantProps: getVariantProps$w
1744
1744
  });
1745
1745
  const autocompleteDefaultVariants = {
1746
1746
  "size": "md",
@@ -1797,7 +1797,7 @@ const autocompleteVariantKeys = [
1797
1797
  "layer",
1798
1798
  "size"
1799
1799
  ];
1800
- const getVariantProps$u = (variants) => ({ ...autocompleteDefaultVariants, ...compact(variants) });
1800
+ const getVariantProps$v = (variants) => ({ ...autocompleteDefaultVariants, ...compact(variants) });
1801
1801
  const autocomplete = /* @__PURE__ */ Object.assign(autocompleteFn, {
1802
1802
  __recipe__: false,
1803
1803
  __name__: "autocomplete",
@@ -1819,7 +1819,7 @@ const autocomplete = /* @__PURE__ */ Object.assign(autocompleteFn, {
1819
1819
  splitVariantProps(props) {
1820
1820
  return splitProps$1(props, autocompleteVariantKeys);
1821
1821
  },
1822
- getVariantProps: getVariantProps$u
1822
+ getVariantProps: getVariantProps$v
1823
1823
  });
1824
1824
  const avatarDefaultVariants = {
1825
1825
  "size": "md",
@@ -1856,7 +1856,7 @@ const avatarVariantKeys = [
1856
1856
  "size",
1857
1857
  "shape"
1858
1858
  ];
1859
- const getVariantProps$t = (variants) => ({ ...avatarDefaultVariants, ...compact(variants) });
1859
+ const getVariantProps$u = (variants) => ({ ...avatarDefaultVariants, ...compact(variants) });
1860
1860
  const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
1861
1861
  __recipe__: false,
1862
1862
  __name__: "avatar",
@@ -1881,7 +1881,7 @@ const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
1881
1881
  splitVariantProps(props) {
1882
1882
  return splitProps$1(props, avatarVariantKeys);
1883
1883
  },
1884
- getVariantProps: getVariantProps$t
1884
+ getVariantProps: getVariantProps$u
1885
1885
  });
1886
1886
  const badgeDefaultVariants = {
1887
1887
  "size": "md",
@@ -1908,7 +1908,7 @@ const badgeVariantKeys = [
1908
1908
  "dot",
1909
1909
  "variant"
1910
1910
  ];
1911
- const getVariantProps$s = (variants) => ({ ...badgeDefaultVariants, ...compact(variants) });
1911
+ const getVariantProps$t = (variants) => ({ ...badgeDefaultVariants, ...compact(variants) });
1912
1912
  const badge = /* @__PURE__ */ Object.assign(badgeFn, {
1913
1913
  __recipe__: false,
1914
1914
  __name__: "badge",
@@ -1944,7 +1944,7 @@ const badge = /* @__PURE__ */ Object.assign(badgeFn, {
1944
1944
  splitVariantProps(props) {
1945
1945
  return splitProps$1(props, badgeVariantKeys);
1946
1946
  },
1947
- getVariantProps: getVariantProps$s
1947
+ getVariantProps: getVariantProps$t
1948
1948
  });
1949
1949
  const breadcrumbsDefaultVariants = {};
1950
1950
  const breadcrumbsCompoundVariants = [];
@@ -1971,7 +1971,7 @@ const breadcrumbsFn = memo((props = {}) => {
1971
1971
  return Object.fromEntries(breadcrumbsSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
1972
1972
  });
1973
1973
  const breadcrumbsVariantKeys = [];
1974
- const getVariantProps$r = (variants) => ({ ...breadcrumbsDefaultVariants, ...compact(variants) });
1974
+ const getVariantProps$s = (variants) => ({ ...breadcrumbsDefaultVariants, ...compact(variants) });
1975
1975
  const breadcrumbs = /* @__PURE__ */ Object.assign(breadcrumbsFn, {
1976
1976
  __recipe__: false,
1977
1977
  __name__: "breadcrumbs",
@@ -1982,7 +1982,7 @@ const breadcrumbs = /* @__PURE__ */ Object.assign(breadcrumbsFn, {
1982
1982
  splitVariantProps(props) {
1983
1983
  return splitProps$1(props, breadcrumbsVariantKeys);
1984
1984
  },
1985
- getVariantProps: getVariantProps$r
1985
+ getVariantProps: getVariantProps$s
1986
1986
  });
1987
1987
  const buttonDefaultVariants = {
1988
1988
  "variant": "standard",
@@ -2013,7 +2013,7 @@ const buttonVariantKeys = [
2013
2013
  "before",
2014
2014
  "after"
2015
2015
  ];
2016
- const getVariantProps$q = (variants) => ({ ...buttonDefaultVariants, ...compact(variants) });
2016
+ const getVariantProps$r = (variants) => ({ ...buttonDefaultVariants, ...compact(variants) });
2017
2017
  const button = /* @__PURE__ */ Object.assign(buttonFn, {
2018
2018
  __recipe__: false,
2019
2019
  __name__: "button",
@@ -2047,7 +2047,7 @@ const button = /* @__PURE__ */ Object.assign(buttonFn, {
2047
2047
  splitVariantProps(props) {
2048
2048
  return splitProps$1(props, buttonVariantKeys);
2049
2049
  },
2050
- getVariantProps: getVariantProps$q
2050
+ getVariantProps: getVariantProps$r
2051
2051
  });
2052
2052
  const calendarDefaultVariants = {
2053
2053
  "type": "days"
@@ -2086,7 +2086,7 @@ const calendarFn = memo((props = {}) => {
2086
2086
  const calendarVariantKeys = [
2087
2087
  "type"
2088
2088
  ];
2089
- const getVariantProps$p = (variants) => ({ ...calendarDefaultVariants, ...compact(variants) });
2089
+ const getVariantProps$q = (variants) => ({ ...calendarDefaultVariants, ...compact(variants) });
2090
2090
  const calendar = /* @__PURE__ */ Object.assign(calendarFn, {
2091
2091
  __recipe__: false,
2092
2092
  __name__: "calendar",
@@ -2103,7 +2103,7 @@ const calendar = /* @__PURE__ */ Object.assign(calendarFn, {
2103
2103
  splitVariantProps(props) {
2104
2104
  return splitProps$1(props, calendarVariantKeys);
2105
2105
  },
2106
- getVariantProps: getVariantProps$p
2106
+ getVariantProps: getVariantProps$q
2107
2107
  });
2108
2108
  const checkboxDefaultVariants = {};
2109
2109
  const checkboxCompoundVariants = [];
@@ -2130,7 +2130,7 @@ const checkboxFn = memo((props = {}) => {
2130
2130
  return Object.fromEntries(checkboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
2131
2131
  });
2132
2132
  const checkboxVariantKeys = [];
2133
- const getVariantProps$o = (variants) => ({ ...checkboxDefaultVariants, ...compact(variants) });
2133
+ const getVariantProps$p = (variants) => ({ ...checkboxDefaultVariants, ...compact(variants) });
2134
2134
  const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
2135
2135
  __recipe__: false,
2136
2136
  __name__: "checkbox",
@@ -2141,7 +2141,7 @@ const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
2141
2141
  splitVariantProps(props) {
2142
2142
  return splitProps$1(props, checkboxVariantKeys);
2143
2143
  },
2144
- getVariantProps: getVariantProps$o
2144
+ getVariantProps: getVariantProps$p
2145
2145
  });
2146
2146
  const chipDefaultVariants = {
2147
2147
  "size": "md"
@@ -2179,7 +2179,7 @@ const chipVariantKeys = [
2179
2179
  "after",
2180
2180
  "dismissable"
2181
2181
  ];
2182
- const getVariantProps$n = (variants) => ({ ...chipDefaultVariants, ...compact(variants) });
2182
+ const getVariantProps$o = (variants) => ({ ...chipDefaultVariants, ...compact(variants) });
2183
2183
  const chip = /* @__PURE__ */ Object.assign(chipFn, {
2184
2184
  __recipe__: false,
2185
2185
  __name__: "chip",
@@ -2206,7 +2206,7 @@ const chip = /* @__PURE__ */ Object.assign(chipFn, {
2206
2206
  splitVariantProps(props) {
2207
2207
  return splitProps$1(props, chipVariantKeys);
2208
2208
  },
2209
- getVariantProps: getVariantProps$n
2209
+ getVariantProps: getVariantProps$o
2210
2210
  });
2211
2211
  const codeBlockDefaultVariants = {
2212
2212
  "tone": "default",
@@ -2275,7 +2275,7 @@ const codeBlockVariantKeys = [
2275
2275
  "collapsed",
2276
2276
  "actionGutter"
2277
2277
  ];
2278
- const getVariantProps$m = (variants) => ({ ...codeBlockDefaultVariants, ...compact(variants) });
2278
+ const getVariantProps$n = (variants) => ({ ...codeBlockDefaultVariants, ...compact(variants) });
2279
2279
  const codeBlock = /* @__PURE__ */ Object.assign(codeBlockFn, {
2280
2280
  __recipe__: false,
2281
2281
  __name__: "codeBlock",
@@ -2311,7 +2311,7 @@ const codeBlock = /* @__PURE__ */ Object.assign(codeBlockFn, {
2311
2311
  splitVariantProps(props) {
2312
2312
  return splitProps$1(props, codeBlockVariantKeys);
2313
2313
  },
2314
- getVariantProps: getVariantProps$m
2314
+ getVariantProps: getVariantProps$n
2315
2315
  });
2316
2316
  const dateMenusDefaultVariants = {};
2317
2317
  const dateMenusCompoundVariants = [];
@@ -2334,7 +2334,7 @@ const dateMenusFn = memo((props = {}) => {
2334
2334
  return Object.fromEntries(dateMenusSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
2335
2335
  });
2336
2336
  const dateMenusVariantKeys = [];
2337
- const getVariantProps$l = (variants) => ({ ...dateMenusDefaultVariants, ...compact(variants) });
2337
+ const getVariantProps$m = (variants) => ({ ...dateMenusDefaultVariants, ...compact(variants) });
2338
2338
  const dateMenus = /* @__PURE__ */ Object.assign(dateMenusFn, {
2339
2339
  __recipe__: false,
2340
2340
  __name__: "dateMenus",
@@ -2345,7 +2345,7 @@ const dateMenus = /* @__PURE__ */ Object.assign(dateMenusFn, {
2345
2345
  splitVariantProps(props) {
2346
2346
  return splitProps$1(props, dateMenusVariantKeys);
2347
2347
  },
2348
- getVariantProps: getVariantProps$l
2348
+ getVariantProps: getVariantProps$m
2349
2349
  });
2350
2350
  const dateTimeMenusDefaultVariants = {};
2351
2351
  const dateTimeMenusCompoundVariants = [];
@@ -2368,7 +2368,7 @@ const dateTimeMenusFn = memo((props = {}) => {
2368
2368
  return Object.fromEntries(dateTimeMenusSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
2369
2369
  });
2370
2370
  const dateTimeMenusVariantKeys = [];
2371
- const getVariantProps$k = (variants) => ({ ...dateTimeMenusDefaultVariants, ...compact(variants) });
2371
+ const getVariantProps$l = (variants) => ({ ...dateTimeMenusDefaultVariants, ...compact(variants) });
2372
2372
  const dateTimeMenus = /* @__PURE__ */ Object.assign(dateTimeMenusFn, {
2373
2373
  __recipe__: false,
2374
2374
  __name__: "dateTimeMenus",
@@ -2379,7 +2379,7 @@ const dateTimeMenus = /* @__PURE__ */ Object.assign(dateTimeMenusFn, {
2379
2379
  splitVariantProps(props) {
2380
2380
  return splitProps$1(props, dateTimeMenusVariantKeys);
2381
2381
  },
2382
- getVariantProps: getVariantProps$k
2382
+ getVariantProps: getVariantProps$l
2383
2383
  });
2384
2384
  const drawerDefaultVariants = {
2385
2385
  "side": "right",
@@ -2426,7 +2426,7 @@ const drawerVariantKeys = [
2426
2426
  "size",
2427
2427
  "scrollable"
2428
2428
  ];
2429
- const getVariantProps$j = (variants) => ({ ...drawerDefaultVariants, ...compact(variants) });
2429
+ const getVariantProps$k = (variants) => ({ ...drawerDefaultVariants, ...compact(variants) });
2430
2430
  const drawer = /* @__PURE__ */ Object.assign(drawerFn, {
2431
2431
  __recipe__: false,
2432
2432
  __name__: "drawer",
@@ -2453,6 +2453,61 @@ const drawer = /* @__PURE__ */ Object.assign(drawerFn, {
2453
2453
  splitVariantProps(props) {
2454
2454
  return splitProps$1(props, drawerVariantKeys);
2455
2455
  },
2456
+ getVariantProps: getVariantProps$k
2457
+ });
2458
+ const filterMenuDefaultVariants = {
2459
+ "layer": "elevated"
2460
+ };
2461
+ const filterMenuCompoundVariants = [];
2462
+ const filterMenuSlotNames = [
2463
+ [
2464
+ "root",
2465
+ "filterMenu__root"
2466
+ ],
2467
+ [
2468
+ "listbox",
2469
+ "filterMenu__listbox"
2470
+ ],
2471
+ [
2472
+ "checkbox",
2473
+ "filterMenu__checkbox"
2474
+ ],
2475
+ [
2476
+ "before",
2477
+ "filterMenu__before"
2478
+ ],
2479
+ [
2480
+ "empty",
2481
+ "filterMenu__empty"
2482
+ ],
2483
+ [
2484
+ "footer",
2485
+ "filterMenu__footer"
2486
+ ]
2487
+ ];
2488
+ const filterMenuSlotFns = /* @__PURE__ */ filterMenuSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, filterMenuDefaultVariants, getSlotCompoundVariant(filterMenuCompoundVariants, slotName))]);
2489
+ const filterMenuFn = memo((props = {}) => {
2490
+ return Object.fromEntries(filterMenuSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
2491
+ });
2492
+ const filterMenuVariantKeys = [
2493
+ "layer"
2494
+ ];
2495
+ const getVariantProps$j = (variants) => ({ ...filterMenuDefaultVariants, ...compact(variants) });
2496
+ const filterMenu = /* @__PURE__ */ Object.assign(filterMenuFn, {
2497
+ __recipe__: false,
2498
+ __name__: "filterMenu",
2499
+ raw: (props) => props,
2500
+ classNameMap: {},
2501
+ variantKeys: filterMenuVariantKeys,
2502
+ variantMap: {
2503
+ "layer": [
2504
+ "elevated",
2505
+ "modalFloating"
2506
+ ]
2507
+ },
2508
+ splitVariantProps(props) {
2509
+ return splitProps$1(props, filterMenuVariantKeys);
2510
+ },
2456
2511
  getVariantProps: getVariantProps$j
2457
2512
  });
2458
2513
  const filterTokenDefaultVariants = {};
@@ -2776,6 +2831,10 @@ const listItemSlotNames = [
2776
2831
  "afterSlot",
2777
2832
  "listItem__afterSlot"
2778
2833
  ],
2834
+ [
2835
+ "afterContent",
2836
+ "listItem__afterContent"
2837
+ ],
2779
2838
  [
2780
2839
  "itemMain",
2781
2840
  "listItem__itemMain"
@@ -15519,6 +15578,7 @@ const defaultLocaleLabels = {
15519
15578
  apply: "Apply",
15520
15579
  dismiss: "Dismiss",
15521
15580
  closeDialog: "Close dialog",
15581
+ closeDrawer: "Close drawer",
15522
15582
  removeItem: (item) => `Remove ${item}`,
15523
15583
  removeFilter: (filter) => `Remove filter: ${filter}`,
15524
15584
  switchToTheme: (nextTheme) => `Switch to ${nextTheme} theme`,
@@ -15532,6 +15592,12 @@ const defaultLocaleLabels = {
15532
15592
  optionCreated: (value) => `${value} created and selected.`,
15533
15593
  optionRemoved: (label2) => `${label2} removed.`,
15534
15594
  moreSelected: (count2) => `${count2} more selected`,
15595
+ copyCode: "Copy code",
15596
+ copied: "Copied",
15597
+ copyFailed: "Copy failed",
15598
+ showAllLines: (count2) => `Show all ${count2} lines`,
15599
+ showLess: "Show less",
15600
+ moreTabs: "More tabs",
15535
15601
  chooseDate: "Choose date",
15536
15602
  previousMonth: "Previous month",
15537
15603
  nextMonth: "Next month",
@@ -17634,13 +17700,14 @@ const scrollbarHeight = (element) => {
17634
17700
  );
17635
17701
  };
17636
17702
  const CodeBlock = (props) => {
17703
+ const { labels } = useLocale();
17637
17704
  const {
17638
17705
  code: codeProp,
17639
17706
  children,
17640
17707
  language,
17641
17708
  title,
17642
17709
  copyable = true,
17643
- copyLabel = "Copy code",
17710
+ copyLabel = labels.copyCode,
17644
17711
  maxLines,
17645
17712
  expanded: expandedProp,
17646
17713
  defaultExpanded = false,
@@ -17719,7 +17786,7 @@ const CodeBlock = (props) => {
17719
17786
  {
17720
17787
  ...dsPart("copy"),
17721
17788
  iconName: copied ? "check" : "copy",
17722
- altText: copied ? "Copied" : copyLabel,
17789
+ altText: copied ? labels.copied : copyLabel,
17723
17790
  variant: tone === "inverse" ? "primary" : "ghost",
17724
17791
  size: "sm",
17725
17792
  onClick: () => {
@@ -17802,11 +17869,11 @@ const CodeBlock = (props) => {
17802
17869
  "aria-hidden": "true"
17803
17870
  }
17804
17871
  ),
17805
- expanded ? "Show less" : `Show all ${lineCount} lines`
17872
+ expanded ? labels.showLess : labels.showAllLines(lineCount)
17806
17873
  ]
17807
17874
  }
17808
17875
  ),
17809
- /* @__PURE__ */ jsx(Box, { as: "span", role: "status", "aria-live": "polite", srOnly: true, children: copied ? "Copied" : failed ? "Copy failed" : "" })
17876
+ /* @__PURE__ */ jsx(Box, { as: "span", role: "status", "aria-live": "polite", srOnly: true, children: copied ? labels.copied : failed ? labels.copyFailed : "" })
17810
17877
  ]
17811
17878
  }
17812
17879
  );
@@ -21092,6 +21159,7 @@ const ListItem = (props) => {
21092
21159
  density,
21093
21160
  variant = "default",
21094
21161
  before,
21162
+ after,
21095
21163
  label: label2,
21096
21164
  description,
21097
21165
  query,
@@ -21208,6 +21276,7 @@ const ListItem = (props) => {
21208
21276
  }
21209
21277
  ) })
21210
21278
  ] }),
21279
+ after && /* @__PURE__ */ jsx(Box, { className: classes.afterContent, children: after }),
21211
21280
  iconAfter && /* @__PURE__ */ jsx(
21212
21281
  Icon,
21213
21282
  {
@@ -22592,6 +22661,7 @@ const DrawerHeader = (props) => {
22592
22661
  const classes = drawer();
22593
22662
  const { onClose } = useDrawerContext();
22594
22663
  const isSm = useMediaQuery("sm");
22664
+ const { labels } = useLocale();
22595
22665
  return /* @__PURE__ */ jsx(Box, { className: cx(classes.header, className), ...otherProps, children: children ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
22596
22666
  title && /* @__PURE__ */ jsx(
22597
22667
  Heading,
@@ -22609,8 +22679,8 @@ const DrawerHeader = (props) => {
22609
22679
  variant: "ghost",
22610
22680
  size: isSm ? "md" : "lg",
22611
22681
  onClick: onClose,
22612
- altText: "Close drawer",
22613
- "aria-label": "Close drawer",
22682
+ altText: labels.closeDrawer,
22683
+ "aria-label": labels.closeDrawer,
22614
22684
  className: classes.closeButton,
22615
22685
  iconName: "x"
22616
22686
  }
@@ -22629,6 +22699,213 @@ const DrawerFooter = (props) => {
22629
22699
  const classes = drawer();
22630
22700
  return /* @__PURE__ */ jsx(Box, { className: cx(classes.footer, className), ...otherProps, children });
22631
22701
  };
22702
+ const getFilterMenuOptionId = (menuId, key) => `${menuId}-option-${encodeURIComponent(key)}`;
22703
+ const isPickable = (row) => row.type === "item" && !row.disabled;
22704
+ const useFilterMenu = (options) => {
22705
+ var _a;
22706
+ const { rows, open, onSelect, onClose, spaceSelects = false, id } = options;
22707
+ const generatedId = useId$1();
22708
+ const menuId = id ?? `filter-menu-${generatedId.replace(/:/g, "")}`;
22709
+ const [storedKey, setStoredKey] = useState(null);
22710
+ const pickable = rows.filter(isPickable);
22711
+ const activeKey = pickable.some((row) => row.key === storedKey) ? storedKey : ((_a = pickable[0]) == null ? void 0 : _a.key) ?? null;
22712
+ const move = (delta) => {
22713
+ if (pickable.length === 0) return;
22714
+ const index2 = pickable.findIndex((row) => row.key === activeKey);
22715
+ const next = (index2 + delta + pickable.length) % pickable.length;
22716
+ setStoredKey(pickable[next].key);
22717
+ };
22718
+ const onKeyDown = (event) => {
22719
+ if (!open) return;
22720
+ if (event.nativeEvent.isComposing || event.keyCode === 229) return;
22721
+ switch (event.key) {
22722
+ case "ArrowDown":
22723
+ event.preventDefault();
22724
+ move(1);
22725
+ break;
22726
+ case "ArrowUp":
22727
+ event.preventDefault();
22728
+ move(-1);
22729
+ break;
22730
+ case "Enter":
22731
+ if (activeKey === null) return;
22732
+ event.preventDefault();
22733
+ onSelect(activeKey);
22734
+ break;
22735
+ case " ":
22736
+ if (!spaceSelects || activeKey === null) return;
22737
+ event.preventDefault();
22738
+ onSelect(activeKey);
22739
+ break;
22740
+ case "Escape":
22741
+ event.preventDefault();
22742
+ onClose();
22743
+ break;
22744
+ }
22745
+ };
22746
+ return {
22747
+ activeKey,
22748
+ setActiveKey: setStoredKey,
22749
+ inputProps: {
22750
+ role: "combobox",
22751
+ "aria-expanded": open,
22752
+ "aria-controls": open ? menuId : void 0,
22753
+ "aria-autocomplete": "list",
22754
+ "aria-activedescendant": open && activeKey !== null ? getFilterMenuOptionId(menuId, activeKey) : void 0,
22755
+ onKeyDown
22756
+ },
22757
+ menuProps: {
22758
+ id: menuId,
22759
+ open,
22760
+ rows,
22761
+ activeKey,
22762
+ onActiveKeyChange: setStoredKey,
22763
+ onSelect
22764
+ }
22765
+ };
22766
+ };
22767
+ const toSections = (rows) => {
22768
+ const sections = [{ rows: [] }];
22769
+ for (const row of rows) {
22770
+ if (row.type === "group") sections.push({ label: row.label, rows: [] });
22771
+ else sections[sections.length - 1].rows.push(row);
22772
+ }
22773
+ return sections.filter((s) => s.label !== void 0 || s.rows.length > 0);
22774
+ };
22775
+ const FilterMenu = (props) => {
22776
+ const {
22777
+ open,
22778
+ anchor,
22779
+ rows,
22780
+ id,
22781
+ "aria-label": ariaLabel,
22782
+ activeKey,
22783
+ onActiveKeyChange,
22784
+ onSelect,
22785
+ query,
22786
+ footer,
22787
+ ...rest
22788
+ } = props;
22789
+ const [className, otherProps] = splitProps(rest);
22790
+ const layer = useFloatingLayer();
22791
+ const classes = filterMenu({ layer });
22792
+ const listRef = useRef(null);
22793
+ const floating = useOverlayFloating({
22794
+ open,
22795
+ // The input's owner controls `open`. Floating UI requests are ignored.
22796
+ onOpenChange: () => void 0,
22797
+ middleware: createOverlayMiddleware({
22798
+ extras: [availableHeightMiddleware()]
22799
+ })
22800
+ });
22801
+ useLayoutEffect(() => {
22802
+ floating.refs.setReference(anchor);
22803
+ }, [anchor, floating.refs]);
22804
+ useEffect(() => {
22805
+ var _a, _b;
22806
+ if (!open || activeKey == null) return;
22807
+ const node = (_a = listRef.current) == null ? void 0 : _a.querySelector(
22808
+ `#${CSS.escape(getFilterMenuOptionId(id, activeKey))}`
22809
+ );
22810
+ (_b = node == null ? void 0 : node.scrollIntoView) == null ? void 0 : _b.call(node, { block: "nearest" });
22811
+ }, [open, activeKey, id]);
22812
+ if (!open || !anchor) return null;
22813
+ const renderBefore = (row) => {
22814
+ const checkbox2 = row.checked !== void 0 && /* @__PURE__ */ jsx(
22815
+ Icon,
22816
+ {
22817
+ name: row.checked ? "checkbox-checked" : "checkbox",
22818
+ fill: row.checked ? "icon" : "icon.subtlest",
22819
+ className: classes.checkbox,
22820
+ "aria-hidden": true
22821
+ }
22822
+ );
22823
+ if (!checkbox2) return row.before;
22824
+ if (row.before === void 0) return checkbox2;
22825
+ return /* @__PURE__ */ jsxs(Box, { as: "span", className: classes.before, children: [
22826
+ checkbox2,
22827
+ row.before
22828
+ ] });
22829
+ };
22830
+ const renderItem = (row) => /* @__PURE__ */ jsx(
22831
+ ListItem,
22832
+ {
22833
+ id: getFilterMenuOptionId(id, row.key),
22834
+ label: row.label,
22835
+ description: row.description,
22836
+ before: renderBefore(row),
22837
+ after: row.detail,
22838
+ selected: row.checked ?? row.selected ?? false,
22839
+ disabled: row.disabled,
22840
+ tabIndex: -1,
22841
+ bg: row.key === activeKey ? "bg.neutral.hovered" : void 0,
22842
+ "data-active": row.key === activeKey || void 0,
22843
+ onMouseDown: (event) => event.preventDefault(),
22844
+ onMouseMove: () => {
22845
+ if (!row.disabled && row.key !== activeKey)
22846
+ onActiveKeyChange == null ? void 0 : onActiveKeyChange(row.key);
22847
+ },
22848
+ onClick: () => {
22849
+ if (!row.disabled) onSelect(row.key);
22850
+ }
22851
+ },
22852
+ row.key
22853
+ );
22854
+ const renderRows = (sectionRows) => sectionRows.map(
22855
+ (row, index2) => row.type === "item" ? renderItem(row) : /* @__PURE__ */ jsx(Box, { role: "status", className: classes.empty, children: row.label }, `empty-${index2}`)
22856
+ );
22857
+ return /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { reference: floating.elements.domReference, children: /* @__PURE__ */ jsx(
22858
+ FloatingFocusManager,
22859
+ {
22860
+ context: floating.context,
22861
+ modal: false,
22862
+ initialFocus: -1,
22863
+ returnFocus: false,
22864
+ children: /* @__PURE__ */ jsxs(
22865
+ Box,
22866
+ {
22867
+ ...dsComponent("FilterMenu"),
22868
+ ref: floating.refs.setFloating,
22869
+ style: floating.floatingStyles,
22870
+ className: cx(classes.root, className),
22871
+ onMouseDown: (event) => event.preventDefault(),
22872
+ ...otherProps,
22873
+ children: [
22874
+ /* @__PURE__ */ jsx(
22875
+ List,
22876
+ {
22877
+ ref: listRef,
22878
+ id,
22879
+ role: "listbox",
22880
+ "aria-label": ariaLabel,
22881
+ "aria-multiselectable": rows.some(
22882
+ (r) => r.type === "item" && r.checked !== void 0
22883
+ ) || void 0,
22884
+ density: "compact",
22885
+ query,
22886
+ highlightMatches: Boolean(query),
22887
+ className: classes.listbox,
22888
+ children: toSections(rows).map(
22889
+ (section, index2) => section.label === void 0 ? renderRows(section.rows) : /* @__PURE__ */ jsx(
22890
+ ListItemGroup,
22891
+ {
22892
+ label: section.label,
22893
+ role: "group",
22894
+ "aria-label": section.label,
22895
+ children: renderRows(section.rows)
22896
+ },
22897
+ `${section.label}-${index2}`
22898
+ )
22899
+ )
22900
+ }
22901
+ ),
22902
+ footer && /* @__PURE__ */ jsx(Box, { className: classes.footer, children: footer })
22903
+ ]
22904
+ }
22905
+ )
22906
+ }
22907
+ ) }) });
22908
+ };
22632
22909
  const MAX_VISIBLE_VALUES = 2;
22633
22910
  const FilterToken = (props) => {
22634
22911
  const {
@@ -23897,6 +24174,7 @@ const TabsOverflowMenu = ({
23897
24174
  selectedValue
23898
24175
  }) => {
23899
24176
  const [isOpen, setIsOpen] = useState(false);
24177
+ const { labels } = useLocale();
23900
24178
  return /* @__PURE__ */ jsx(
23901
24179
  Menu,
23902
24180
  {
@@ -23910,7 +24188,7 @@ const TabsOverflowMenu = ({
23910
24188
  variant: "ghost",
23911
24189
  size: "md",
23912
24190
  iconName: isOpen ? "caret-up" : "caret-down",
23913
- altText: "More tabs",
24191
+ altText: labels.moreTabs,
23914
24192
  "aria-haspopup": "menu"
23915
24193
  }
23916
24194
  ),
@@ -23938,6 +24216,7 @@ const TabsOverflowMenu = ({
23938
24216
  );
23939
24217
  };
23940
24218
  const Tabs = (props) => {
24219
+ const { labels } = useLocale();
23941
24220
  const {
23942
24221
  children,
23943
24222
  value,
@@ -24051,7 +24330,7 @@ const Tabs = (props) => {
24051
24330
  variant: "ghost",
24052
24331
  size: "md",
24053
24332
  iconName: "caret-down",
24054
- altText: "More tabs",
24333
+ altText: labels.moreTabs,
24055
24334
  disabled: true,
24056
24335
  tabIndex: -1
24057
24336
  }
@@ -26214,6 +26493,7 @@ export {
26214
26493
  DrawerFooter,
26215
26494
  DrawerHeader,
26216
26495
  DsChainScope,
26496
+ FilterMenu,
26217
26497
  FilterToken,
26218
26498
  FormField,
26219
26499
  Heading,
@@ -26275,6 +26555,7 @@ export {
26275
26555
  defaultLocaleLabels,
26276
26556
  deriveItemTextValue,
26277
26557
  getComponentType,
26558
+ getFilterMenuOptionId,
26278
26559
  getHighlightedTextParts,
26279
26560
  hasMatchingItems,
26280
26561
  isItemMatch,
@@ -26283,6 +26564,7 @@ export {
26283
26564
  useClipboard,
26284
26565
  useContainerQuery,
26285
26566
  useDrawerContext,
26567
+ useFilterMenu,
26286
26568
  useForm2 as useForm,
26287
26569
  useIconConfig,
26288
26570
  useListContext,