@capra/core 1.13.0 → 1.14.1

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.cjs CHANGED
@@ -269,12 +269,12 @@ Label.displayName = "Label";
269
269
  //#endregion
270
270
  //#region src/components/TextInput/TextInput.module.css
271
271
  var TextInput_module_default = {
272
- "errorIndicator": "capra-TextInput-module-pTHfnG-errorIndicator",
273
- "input": "capra-TextInput-module-pTHfnG-input",
274
- "leadingSlot": "capra-TextInput-module-pTHfnG-leadingSlot",
275
- "trailingSlot": "capra-TextInput-module-pTHfnG-trailingSlot",
276
- "warningIndicator": "capra-TextInput-module-pTHfnG-warningIndicator",
277
- "wrapper": "capra-TextInput-module-pTHfnG-wrapper"
272
+ "errorIndicator": "capra-TextInput-module--5NVeG-errorIndicator",
273
+ "input": "capra-TextInput-module--5NVeG-input",
274
+ "leadingSlot": "capra-TextInput-module--5NVeG-leadingSlot",
275
+ "trailingSlot": "capra-TextInput-module--5NVeG-trailingSlot",
276
+ "warningIndicator": "capra-TextInput-module--5NVeG-warningIndicator",
277
+ "wrapper": "capra-TextInput-module--5NVeG-wrapper"
278
278
  };
279
279
  //#endregion
280
280
  //#region src/components/TextInput/TextInput.tsx
@@ -589,18 +589,23 @@ var Badge_module_default = {
589
589
  /**
590
590
  * Badges display an indicator/counter on an associated component.
591
591
  */
592
- function Badge({ appearance = "danger", variant = "counter", size = "md", count = 0, showZero = false, overflowCount = 99, FORCE__className, style, ...props }) {
592
+ function Badge({ appearance = "danger", variant = "counter", size = "md", count = 0, showZero = false, overflowCount = 99, decorative, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, FORCE__className, style, ...props }) {
593
593
  if (variant === "counter" && !showZero && !count) return null;
594
594
  const getBadgeContent = () => {
595
595
  if (variant === "dot") return null;
596
596
  const value = Math.max(count, 0);
597
597
  return value > overflowCount ? `${overflowCount}+` : value;
598
598
  };
599
+ const role = decorative ? void 0 : variant === "dot" ? "img" : "status";
599
600
  return /* @__PURE__ */ react.createElement("span", {
601
+ "aria-hidden": decorative || void 0,
602
+ "aria-label": decorative ? void 0 : ariaLabel,
603
+ "aria-labelledby": decorative ? void 0 : ariaLabelledBy,
600
604
  className: clsx(Badge_module_default.badge, FORCE__className),
601
605
  "data-appearance": appearance,
602
606
  "data-size": size,
603
607
  "data-variant": variant,
608
+ role,
604
609
  style,
605
610
  ...props
606
611
  }, getBadgeContent());
@@ -948,9 +953,11 @@ function Tag({ draggable, color = "default", icon: Icon, children, size = "md",
948
953
  //#endregion
949
954
  //#region src/components/Checkbox/Checkbox.module.css
950
955
  var Checkbox_module_default = {
951
- "base": "capra-Checkbox-module-EcGsRq-base",
952
- "input": "capra-Checkbox-module-EcGsRq-input",
953
- "label": "capra-Checkbox-module-EcGsRq-label"
956
+ "base": "capra-Checkbox-module-IniPuq-base",
957
+ "inner": "capra-Checkbox-module-IniPuq-inner",
958
+ "input": "capra-Checkbox-module-IniPuq-input",
959
+ "label": "capra-Checkbox-module-IniPuq-label",
960
+ "text": "capra-Checkbox-module-IniPuq-text"
954
961
  };
955
962
  //#endregion
956
963
  //#region src/components/Checkbox/Checkbox.tsx
@@ -1018,6 +1025,27 @@ const Checkbox = react.forwardRef((props, ref) => {
1018
1025
  }, children));
1019
1026
  });
1020
1027
  Checkbox.displayName = "Checkbox";
1028
+ const RACCheckbox = react.forwardRef((props, ref) => {
1029
+ const { indeterminate, disabled, checked, defaultChecked, children, onChange, id, name, value, slot, FORCE__className: classNameOverride } = props;
1030
+ const hasLabel = Boolean(children);
1031
+ const inputRef = react.useRef(null);
1032
+ react.useImperativeHandle(ref, () => inputRef.current);
1033
+ return /* @__PURE__ */ react.createElement(react_aria_components.Checkbox, {
1034
+ id,
1035
+ name,
1036
+ value: value?.toString(),
1037
+ slot,
1038
+ className: clsx(Checkbox_module_default.base, classNameOverride),
1039
+ isSelected: checked,
1040
+ defaultSelected: defaultChecked,
1041
+ isIndeterminate: indeterminate,
1042
+ isDisabled: disabled,
1043
+ "data-has-label": hasLabel ? "true" : "false",
1044
+ onChange,
1045
+ inputRef
1046
+ }, ({ isIndeterminate, isSelected }) => /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement("div", { className: Checkbox_module_default.input }, /* @__PURE__ */ react.createElement("div", { className: Checkbox_module_default.inner }), isIndeterminate ? /* @__PURE__ */ react.createElement(IndeterminateIcon, null) : isSelected ? /* @__PURE__ */ react.createElement(CheckedIcon, null) : null), /* @__PURE__ */ react.createElement("div", { className: Checkbox_module_default.text }, children)));
1047
+ });
1048
+ RACCheckbox.displayName = "RACCheckbox";
1021
1049
  //#endregion
1022
1050
  //#region src/components/Collapse/Collapse.module.css
1023
1051
  var Collapse_module_default = {
@@ -1182,12 +1210,12 @@ PasswordField.displayName = "PasswordField";
1182
1210
  //#endregion
1183
1211
  //#region src/components/NumberField/NumberField.module.css
1184
1212
  var NumberField_module_default = {
1185
- "slotAlign": "capra-NumberField-module-crO5za-slotAlign",
1186
- "stepButton": "capra-NumberField-module-crO5za-stepButton",
1187
- "stepDivider": "capra-NumberField-module-crO5za-stepDivider",
1188
- "stepIcon": "capra-NumberField-module-crO5za-stepIcon",
1189
- "stepper": "capra-NumberField-module-crO5za-stepper",
1190
- "withStepper": "capra-NumberField-module-crO5za-withStepper"
1213
+ "slotAlign": "capra-NumberField-module-IscOzq-slotAlign",
1214
+ "stepButton": "capra-NumberField-module-IscOzq-stepButton",
1215
+ "stepDivider": "capra-NumberField-module-IscOzq-stepDivider",
1216
+ "stepIcon": "capra-NumberField-module-IscOzq-stepIcon",
1217
+ "stepper": "capra-NumberField-module-IscOzq-stepper",
1218
+ "withStepper": "capra-NumberField-module-IscOzq-withStepper"
1191
1219
  };
1192
1220
  //#endregion
1193
1221
  //#region src/components/NumberField/NumberField.tsx
@@ -2319,33 +2347,34 @@ const DatePickerField = DatePickerFieldWithRef;
2319
2347
  //#endregion
2320
2348
  //#region src/components/SelectField/SelectField.module.css
2321
2349
  var SelectField_module_default = {
2322
- "chevron": "capra-SelectField-module-1X4diq-chevron",
2323
- "dropdownPanel": "capra-SelectField-module-1X4diq-dropdownPanel",
2324
- "emptyState": "capra-SelectField-module-1X4diq-emptyState",
2325
- "errorIndicator": "capra-SelectField-module-1X4diq-errorIndicator",
2326
- "header": "capra-SelectField-module-1X4diq-header",
2327
- "item": "capra-SelectField-module-1X4diq-item",
2328
- "itemCheck": "capra-SelectField-module-1X4diq-itemCheck",
2329
- "itemContent": "capra-SelectField-module-1X4diq-itemContent",
2330
- "leadingSlot": "capra-SelectField-module-1X4diq-leadingSlot",
2331
- "listbox": "capra-SelectField-module-1X4diq-listbox",
2332
- "multipleOpenButton": "capra-SelectField-module-1X4diq-multipleOpenButton",
2333
- "multipleTrigger": "capra-SelectField-module-1X4diq-multipleTrigger",
2334
- "search": "capra-SelectField-module-1X4diq-search",
2335
- "section": "capra-SelectField-module-1X4diq-section",
2336
- "singleTrigger": "capra-SelectField-module-1X4diq-singleTrigger",
2337
- "tag": "capra-SelectField-module-1X4diq-tag",
2338
- "tagGroup": "capra-SelectField-module-1X4diq-tagGroup",
2339
- "tagIcon": "capra-SelectField-module-1X4diq-tagIcon",
2340
- "tagLabel": "capra-SelectField-module-1X4diq-tagLabel",
2341
- "tagList": "capra-SelectField-module-1X4diq-tagList",
2342
- "tagRemove": "capra-SelectField-module-1X4diq-tagRemove",
2343
- "trailingSlot": "capra-SelectField-module-1X4diq-trailingSlot",
2344
- "triggerShell": "capra-SelectField-module-1X4diq-triggerShell",
2345
- "value": "capra-SelectField-module-1X4diq-value",
2346
- "valueIcon": "capra-SelectField-module-1X4diq-valueIcon",
2347
- "valueText": "capra-SelectField-module-1X4diq-valueText",
2348
- "warningIndicator": "capra-SelectField-module-1X4diq-warningIndicator"
2350
+ "chevron": "capra-SelectField-module-0VcKhq-chevron",
2351
+ "dropdownPanel": "capra-SelectField-module-0VcKhq-dropdownPanel",
2352
+ "emptyState": "capra-SelectField-module-0VcKhq-emptyState",
2353
+ "errorIndicator": "capra-SelectField-module-0VcKhq-errorIndicator",
2354
+ "header": "capra-SelectField-module-0VcKhq-header",
2355
+ "item": "capra-SelectField-module-0VcKhq-item",
2356
+ "itemBody": "capra-SelectField-module-0VcKhq-itemBody",
2357
+ "itemCheck": "capra-SelectField-module-0VcKhq-itemCheck",
2358
+ "itemContent": "capra-SelectField-module-0VcKhq-itemContent",
2359
+ "leadingSlot": "capra-SelectField-module-0VcKhq-leadingSlot",
2360
+ "listbox": "capra-SelectField-module-0VcKhq-listbox",
2361
+ "multipleOpenButton": "capra-SelectField-module-0VcKhq-multipleOpenButton",
2362
+ "multipleTrigger": "capra-SelectField-module-0VcKhq-multipleTrigger",
2363
+ "search": "capra-SelectField-module-0VcKhq-search",
2364
+ "section": "capra-SelectField-module-0VcKhq-section",
2365
+ "singleTrigger": "capra-SelectField-module-0VcKhq-singleTrigger",
2366
+ "tag": "capra-SelectField-module-0VcKhq-tag",
2367
+ "tagGroup": "capra-SelectField-module-0VcKhq-tagGroup",
2368
+ "tagIcon": "capra-SelectField-module-0VcKhq-tagIcon",
2369
+ "tagLabel": "capra-SelectField-module-0VcKhq-tagLabel",
2370
+ "tagList": "capra-SelectField-module-0VcKhq-tagList",
2371
+ "tagRemove": "capra-SelectField-module-0VcKhq-tagRemove",
2372
+ "trailingSlot": "capra-SelectField-module-0VcKhq-trailingSlot",
2373
+ "triggerShell": "capra-SelectField-module-0VcKhq-triggerShell",
2374
+ "value": "capra-SelectField-module-0VcKhq-value",
2375
+ "valueIcon": "capra-SelectField-module-0VcKhq-valueIcon",
2376
+ "valueText": "capra-SelectField-module-0VcKhq-valueText",
2377
+ "warningIndicator": "capra-SelectField-module-0VcKhq-warningIndicator"
2349
2378
  };
2350
2379
  //#endregion
2351
2380
  //#region src/components/SelectField/SelectField.tsx
@@ -2501,11 +2530,11 @@ function SelectFieldItem(props) {
2501
2530
  isDisabled,
2502
2531
  className: SelectField_module_default.item,
2503
2532
  "data-indent": indent || void 0
2504
- }, ({ isSelected, selectionMode }) => /* @__PURE__ */ react.createElement("div", { className: SelectField_module_default.itemContent }, selectionMode === "multiple" ? /* @__PURE__ */ react.createElement("span", {
2533
+ }, ({ isSelected }) => /* @__PURE__ */ react.createElement("div", { className: SelectField_module_default.itemContent }, /* @__PURE__ */ react.createElement("span", {
2505
2534
  className: SelectField_module_default.itemCheck,
2506
2535
  "data-selected": isSelected || void 0,
2507
2536
  "aria-hidden": true
2508
- }, isSelected ? /* @__PURE__ */ react.createElement(_capra_icons.CheckOutlined, { size: "sm" }) : null) : null, typeof children === "string" ? /* @__PURE__ */ react.createElement(Text, { slot: "label" }, children) : children));
2537
+ }, isSelected ? /* @__PURE__ */ react.createElement(_capra_icons.CheckOutlined, { size: "sm" }) : null), /* @__PURE__ */ react.createElement("span", { className: SelectField_module_default.itemBody }, typeof children === "string" ? /* @__PURE__ */ react.createElement(Text, { slot: "label" }, children) : children)));
2509
2538
  }
2510
2539
  function SelectFieldHeader(props) {
2511
2540
  const { id, label = "Header", FORCE__className: classNameOverride, children } = props;
@@ -3374,20 +3403,20 @@ function createConfirmationModalOpener(appearance) {
3374
3403
  //#endregion
3375
3404
  //#region src/components/Drawer/Drawer.module.css
3376
3405
  var Drawer_module_default = {
3377
- "body": "capra-Drawer-module-H0eofa-body",
3378
- "description": "capra-Drawer-module-H0eofa-description",
3379
- "drawerInFromLeft": "capra-Drawer-module-H0eofa-drawerInFromLeft",
3380
- "drawerInFromRight": "capra-Drawer-module-H0eofa-drawerInFromRight",
3381
- "drawerOutToLeft": "capra-Drawer-module-H0eofa-drawerOutToLeft",
3382
- "drawerOutToRight": "capra-Drawer-module-H0eofa-drawerOutToRight",
3383
- "expandedTitleLayout": "capra-Drawer-module-H0eofa-expandedTitleLayout",
3384
- "footer": "capra-Drawer-module-H0eofa-footer",
3385
- "header": "capra-Drawer-module-H0eofa-header",
3386
- "headerMain": "capra-Drawer-module-H0eofa-headerMain",
3387
- "headerTrailing": "capra-Drawer-module-H0eofa-headerTrailing",
3388
- "overlay": "capra-Drawer-module-H0eofa-overlay",
3389
- "root": "capra-Drawer-module-H0eofa-root",
3390
- "sheet": "capra-Drawer-module-H0eofa-sheet"
3406
+ "body": "capra-Drawer-module-iRsXUG-body",
3407
+ "description": "capra-Drawer-module-iRsXUG-description",
3408
+ "drawerInFromLeft": "capra-Drawer-module-iRsXUG-drawerInFromLeft",
3409
+ "drawerInFromRight": "capra-Drawer-module-iRsXUG-drawerInFromRight",
3410
+ "drawerOutToLeft": "capra-Drawer-module-iRsXUG-drawerOutToLeft",
3411
+ "drawerOutToRight": "capra-Drawer-module-iRsXUG-drawerOutToRight",
3412
+ "expandedTitleLayout": "capra-Drawer-module-iRsXUG-expandedTitleLayout",
3413
+ "footer": "capra-Drawer-module-iRsXUG-footer",
3414
+ "header": "capra-Drawer-module-iRsXUG-header",
3415
+ "headerMain": "capra-Drawer-module-iRsXUG-headerMain",
3416
+ "headerTrailing": "capra-Drawer-module-iRsXUG-headerTrailing",
3417
+ "overlay": "capra-Drawer-module-iRsXUG-overlay",
3418
+ "root": "capra-Drawer-module-iRsXUG-root",
3419
+ "sheet": "capra-Drawer-module-iRsXUG-sheet"
3391
3420
  };
3392
3421
  //#endregion
3393
3422
  //#region src/components/Drawer/useDrawerExitAnimation.ts
@@ -3687,8 +3716,61 @@ function ButtonLinkWithoutRef({ appearance = "default", as: asComponent, block,
3687
3716
  */
3688
3717
  const ButtonLink = fixedForwardRef(ButtonLinkWithoutRef);
3689
3718
  //#endregion
3719
+ //#region src/components/ToggleButtonGroup/ToggleButtonGroup.module.css
3720
+ var ToggleButtonGroup_module_default = { "base": "capra-ToggleButtonGroup-module-cS5LeW-base" };
3721
+ //#endregion
3722
+ //#region src/components/ToggleButtonGroup/ToggleButtonGroup.tsx
3723
+ function isIconOnlyItem(item) {
3724
+ return !("text" in item);
3725
+ }
3726
+ function renderToggleButtonItem(item, size, groupDisabled) {
3727
+ const isDisabled = groupDisabled || item.disabled;
3728
+ if (isIconOnlyItem(item)) {
3729
+ const Icon = item.icon;
3730
+ return /* @__PURE__ */ react.createElement(react_aria_components.ToggleButton, {
3731
+ key: item.key,
3732
+ id: item.key,
3733
+ isDisabled,
3734
+ "aria-label": item["aria-label"],
3735
+ className: clsx(Button_module_default.base, Button_module_default.icon),
3736
+ "data-variant": "secondary",
3737
+ "data-appearance": "default",
3738
+ "data-size": size
3739
+ }, /* @__PURE__ */ react.createElement(Icon, { size: "sm" }));
3740
+ }
3741
+ const LeadingIcon = item.icon;
3742
+ return /* @__PURE__ */ react.createElement(react_aria_components.ToggleButton, {
3743
+ key: item.key,
3744
+ id: item.key,
3745
+ isDisabled,
3746
+ "aria-label": item["aria-label"],
3747
+ className: Button_module_default.base,
3748
+ "data-variant": "secondary",
3749
+ "data-appearance": "default",
3750
+ "data-size": size
3751
+ }, LeadingIcon ? /* @__PURE__ */ react.createElement("span", { className: Button_module_default.iconLayout }, /* @__PURE__ */ react.createElement(LeadingIcon, { size: "sm" })) : null, /* @__PURE__ */ react.createElement("span", { className: Button_module_default.textLayout }, /* @__PURE__ */ react.createElement(Text, {
3752
+ color: "inherit",
3753
+ variant: "body"
3754
+ }, item.text)));
3755
+ }
3756
+ /**
3757
+ * A group of toggle buttons for choosing one or more options from a set.
3758
+ */
3759
+ function ToggleButtonGroup({ items, size = "md", disabled = false, selectionMode = "single", selectedKeys, defaultSelectedKeys, onSelectionChange, disallowEmptySelection, FORCE__className: classNameOverride, ...props }) {
3760
+ return /* @__PURE__ */ react.createElement(react_aria_components.ToggleButtonGroup, {
3761
+ ...props,
3762
+ isDisabled: disabled,
3763
+ selectionMode,
3764
+ selectedKeys,
3765
+ defaultSelectedKeys,
3766
+ onSelectionChange,
3767
+ disallowEmptySelection,
3768
+ className: clsx(ToggleButtonGroup_module_default.base, classNameOverride)
3769
+ }, items.map((item) => renderToggleButtonItem(item, size, disabled)));
3770
+ }
3771
+ //#endregion
3690
3772
  //#region src/components/Link/Link.module.css
3691
- var Link_module_default = { "base": "capra-Link-module-7lYr7a-base" };
3773
+ var Link_module_default = { "base": "capra-Link-module-OvXy7G-base" };
3692
3774
  //#endregion
3693
3775
  //#region src/components/Link/Link.tsx
3694
3776
  function LinkWithoutRef({ as: asComponent, children, isExternal = false, FORCE__className: classNameOverride, ...rest }, ref) {
@@ -4548,21 +4630,21 @@ const Toast = {
4548
4630
  //#endregion
4549
4631
  //#region src/components/Menu/Menu.module.css
4550
4632
  var Menu_module_default = {
4551
- "divider": "capra-Menu-module-HIhAFW-divider",
4552
- "header": "capra-Menu-module-HIhAFW-header",
4553
- "list": "capra-Menu-module-HIhAFW-list",
4554
- "menu": "capra-Menu-module-HIhAFW-menu",
4555
- "menuItem": "capra-Menu-module-HIhAFW-menuItem",
4556
- "menuItemDescription": "capra-Menu-module-HIhAFW-menuItemDescription",
4557
- "menuItemLabel": "capra-Menu-module-HIhAFW-menuItemLabel",
4558
- "menuItemLeadingGutter": "capra-Menu-module-HIhAFW-menuItemLeadingGutter",
4559
- "menuItemListItemShell": "capra-Menu-module-HIhAFW-menuItemListItemShell",
4560
- "menuItemShortcut": "capra-Menu-module-HIhAFW-menuItemShortcut",
4561
- "menuItemTrailingGroup": "capra-Menu-module-HIhAFW-menuItemTrailingGroup",
4562
- "menuItemTrailingGutter": "capra-Menu-module-HIhAFW-menuItemTrailingGutter",
4563
- "menuTriggerSlot": "capra-Menu-module-HIhAFW-menuTriggerSlot",
4564
- "section": "capra-Menu-module-HIhAFW-section",
4565
- "slot": "capra-Menu-module-HIhAFW-slot"
4633
+ "divider": "capra-Menu-module-eTI_TG-divider",
4634
+ "header": "capra-Menu-module-eTI_TG-header",
4635
+ "list": "capra-Menu-module-eTI_TG-list",
4636
+ "menu": "capra-Menu-module-eTI_TG-menu",
4637
+ "menuItem": "capra-Menu-module-eTI_TG-menuItem",
4638
+ "menuItemDescription": "capra-Menu-module-eTI_TG-menuItemDescription",
4639
+ "menuItemLabel": "capra-Menu-module-eTI_TG-menuItemLabel",
4640
+ "menuItemLeadingGutter": "capra-Menu-module-eTI_TG-menuItemLeadingGutter",
4641
+ "menuItemListItemShell": "capra-Menu-module-eTI_TG-menuItemListItemShell",
4642
+ "menuItemShortcut": "capra-Menu-module-eTI_TG-menuItemShortcut",
4643
+ "menuItemTrailingGroup": "capra-Menu-module-eTI_TG-menuItemTrailingGroup",
4644
+ "menuItemTrailingGutter": "capra-Menu-module-eTI_TG-menuItemTrailingGutter",
4645
+ "menuTriggerSlot": "capra-Menu-module-eTI_TG-menuTriggerSlot",
4646
+ "section": "capra-Menu-module-eTI_TG-section",
4647
+ "slot": "capra-Menu-module-eTI_TG-slot"
4566
4648
  };
4567
4649
  //#endregion
4568
4650
  //#region src/components/Menu/Menu.tsx
@@ -4646,7 +4728,7 @@ const MenuSection = ({ children, "aria-label": ariaLabel, "aria-labelledby": ari
4646
4728
  }, resolvedChildren));
4647
4729
  };
4648
4730
  MenuSection.displayName = "Menu.Section";
4649
- const MenuItem = ({ as: Component, label, description, ariaLabel, href, disabled = false, active = false, variant = "default", icon, indent: indentProp, shortcut, parent = false, onPress, onClick, FORCE__className, children, ...rest }) => {
4731
+ const MenuItem = ({ as: Component, label, description, ariaLabel, href, disabled = false, active = false, variant = "default", icon, indent: indentProp, shortcut, parent = false, onPress, onClick, FORCE__className, children, allowItemLineWrap = false, ...rest }) => {
4650
4732
  const indentFromSectionHeader = react.useContext(MenuSectionIndentContext);
4651
4733
  const indent = indentProp !== void 0 ? indentProp : indentFromSectionHeader ? true : false;
4652
4734
  const labelContent = children ?? label;
@@ -4674,6 +4756,7 @@ const MenuItem = ({ as: Component, label, description, ariaLabel, href, disabled
4674
4756
  "aria-label": ariaLabel,
4675
4757
  "aria-current": active ? "page" : void 0,
4676
4758
  className: clsx(Menu_module_default.menuItem, FORCE__className),
4759
+ "data-allow-line-wrap": allowItemLineWrap,
4677
4760
  "data-variant": variant,
4678
4761
  "data-active": active || void 0,
4679
4762
  "data-indent": indent || void 0,
@@ -5386,6 +5469,199 @@ function ArrowSvg() {
5386
5469
  }));
5387
5470
  }
5388
5471
  //#endregion
5472
+ //#region src/components/FilterToolbar/FilterToolbar.module.css
5473
+ var FilterToolbar_module_default = { "toolbar": "capra-FilterToolbar-module-1TgfVW-toolbar" };
5474
+ //#endregion
5475
+ //#region src/components/FilterToolbar/FilterToolbar.tsx
5476
+ function FilterToolbar({ filterInputProps, renderActions, renderBulkEditText, renderBulkEditActions, selectedKeys }) {
5477
+ return selectedKeys === "all" || selectedKeys.size > 0 ? /* @__PURE__ */ react.createElement("div", {
5478
+ className: FilterToolbar_module_default.toolbar,
5479
+ "data-mode": "bulk-edit"
5480
+ }, /* @__PURE__ */ react.createElement("div", null, renderBulkEditText?.()), /* @__PURE__ */ react.createElement("div", null, renderBulkEditActions?.())) : /* @__PURE__ */ react.createElement("div", { className: FilterToolbar_module_default.toolbar }, /* @__PURE__ */ react.createElement("div", null, /* @__PURE__ */ react.createElement(TextField, {
5481
+ placeholder: "Filter value",
5482
+ ...filterInputProps,
5483
+ leadingSlot: /* @__PURE__ */ react.createElement(_capra_icons.FilterOutlined, {
5484
+ size: "sm",
5485
+ color: "var(--cds2-color-foreground-subtle)"
5486
+ }),
5487
+ size: "sm"
5488
+ })), /* @__PURE__ */ react.createElement("div", null, renderActions?.()));
5489
+ }
5490
+ //#endregion
5491
+ //#region src/components/Table/Table.module.css
5492
+ var Table_module_default = {
5493
+ "base": "capra-Table-module-YRCV0q-base",
5494
+ "cell": "capra-Table-module-YRCV0q-cell",
5495
+ "column": "capra-Table-module-YRCV0q-column",
5496
+ "columnDivider": "capra-Table-module-YRCV0q-columnDivider",
5497
+ "columnHeader": "capra-Table-module-YRCV0q-columnHeader",
5498
+ "columnName": "capra-Table-module-YRCV0q-columnName",
5499
+ "dropIndicator": "capra-Table-module-YRCV0q-dropIndicator",
5500
+ "header": "capra-Table-module-YRCV0q-header",
5501
+ "row": "capra-Table-module-YRCV0q-row",
5502
+ "sortIcons": "capra-Table-module-YRCV0q-sortIcons"
5503
+ };
5504
+ //#endregion
5505
+ //#region src/components/Table/Table.tsx
5506
+ const EMPTY_CELL_PLACEHOLDER = "--";
5507
+ function isEmptyValue(value) {
5508
+ return value === null || value === void 0 || value === "";
5509
+ }
5510
+ function defineColumns(columns) {
5511
+ return columns;
5512
+ }
5513
+ function TableWithoutRef({ FORCE__className: classNameOverride, items, columns, visibleColumns, sortDescriptor, density = "default", appearance = "zebra", onSortChange, selectedKeys, onSelectionChange, isLoading = false, enableDragAndDrop = false, renderActionColumn, ...props }, ref) {
5514
+ const columnsToRender = react.useMemo(() => {
5515
+ return visibleColumns.map((id) => columns.find((c) => c.id === id)).filter((c) => c != null);
5516
+ }, [columns, visibleColumns]);
5517
+ const [dndItems, setDndItems] = react.useState(items);
5518
+ react.useEffect(() => {
5519
+ setDndItems(items);
5520
+ }, [items]);
5521
+ const { dragAndDropHooks } = (0, react_aria_components.useDragAndDrop)({
5522
+ getItems(keys) {
5523
+ return [...keys].map((key) => ({ "text/plain": String(key) }));
5524
+ },
5525
+ onReorder(e) {
5526
+ setDndItems((prev) => {
5527
+ const movedItems = [...e.keys].map((key) => prev.find((item) => item.id === key));
5528
+ const filtered = prev.filter((item) => !e.keys.has(item.id));
5529
+ const targetIndex = filtered.findIndex((item) => item.id === e.target.key);
5530
+ if (e.target.dropPosition === "before") filtered.splice(targetIndex, 0, ...movedItems);
5531
+ else filtered.splice(targetIndex + 1, 0, ...movedItems);
5532
+ return filtered;
5533
+ });
5534
+ },
5535
+ renderDropIndicator(target) {
5536
+ return /* @__PURE__ */ react.createElement(react_aria_components.DropIndicator, {
5537
+ target,
5538
+ className: Table_module_default.dropIndicator
5539
+ });
5540
+ }
5541
+ });
5542
+ const skeletonItems = react.useMemo(() => Array.from({ length: 5 }, (_, i) => ({ id: `skeleton-${i}` })), []);
5543
+ return /* @__PURE__ */ react.createElement(react_aria_components.Table, {
5544
+ ...props,
5545
+ ref,
5546
+ sortDescriptor,
5547
+ selectedKeys,
5548
+ onSelectionChange,
5549
+ className: clsx(Table_module_default.base, classNameOverride),
5550
+ "data-density": density,
5551
+ "data-appearance": appearance,
5552
+ onSortChange,
5553
+ dragAndDropHooks: enableDragAndDrop ? dragAndDropHooks : void 0
5554
+ }, /* @__PURE__ */ react.createElement(TableHeader, {
5555
+ columns: columnsToRender,
5556
+ className: Table_module_default.header,
5557
+ shouldShowActionColumn: !!renderActionColumn
5558
+ }, (column) => {
5559
+ return /* @__PURE__ */ react.createElement(Column, {
5560
+ isRowHeader: true,
5561
+ key: column.id,
5562
+ id: column.id,
5563
+ allowsSorting: !enableDragAndDrop && column.allowsSorting,
5564
+ textValue: column.label
5565
+ }, column.label);
5566
+ }), /* @__PURE__ */ react.createElement(react_aria_components.TableBody, {
5567
+ items: isLoading ? skeletonItems : enableDragAndDrop ? dndItems : items,
5568
+ dependencies: [columnsToRender, isLoading],
5569
+ className: Table_module_default.body
5570
+ }, (_item) => {
5571
+ const item = _item;
5572
+ return /* @__PURE__ */ react.createElement(Row, {
5573
+ isDisabled: item.isDisabled === true ? true : false,
5574
+ key: item.id,
5575
+ id: item.id,
5576
+ columns: columnsToRender,
5577
+ className: Table_module_default.row,
5578
+ actionColumn: !isLoading && renderActionColumn ? renderActionColumn(item) : void 0
5579
+ }, (column) => {
5580
+ return /* @__PURE__ */ react.createElement(Cell, {
5581
+ key: column.id,
5582
+ id: `${item.id}__${column.id}`,
5583
+ className: Table_module_default.cell
5584
+ }, isLoading ? /* @__PURE__ */ react.createElement(Skeleton, {
5585
+ title: false,
5586
+ paragraph: { rows: 1 },
5587
+ active: true
5588
+ }) : isEmptyValue(item[column.id]) ? /* @__PURE__ */ react.createElement("span", null, "--") : column.render ? column.render(item[column.id], item) : /* @__PURE__ */ react.createElement("span", null, item[column.id]));
5589
+ });
5590
+ }));
5591
+ }
5592
+ /**
5593
+ * A component for rendering tabular data
5594
+ */
5595
+ const Table = fixedForwardRef(TableWithoutRef);
5596
+ function Column(props) {
5597
+ return /* @__PURE__ */ react.createElement(react_aria_components.Column, {
5598
+ ...props,
5599
+ className: Table_module_default.column
5600
+ }, ({ allowsSorting, sortDirection }) => {
5601
+ return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement("div", { className: Table_module_default.columnHeader }, /* @__PURE__ */ react.createElement(react_aria_components.Group, {
5602
+ role: "presentation",
5603
+ tabIndex: -1,
5604
+ className: Table_module_default.columnName
5605
+ }, props.children), allowsSorting && (sortDirection ? /* @__PURE__ */ react.createElement(SortedIcons, { sortDirection }) : /* @__PURE__ */ react.createElement(NonSortedIcons, null)), props.allowsResizing && /* @__PURE__ */ react.createElement(react_aria_components.ColumnResizer, null)), /* @__PURE__ */ react.createElement("div", { className: Table_module_default.columnDivider }));
5606
+ });
5607
+ }
5608
+ function TableHeader({ columns, children, shouldShowActionColumn, ...otherProps }) {
5609
+ const { selectionBehavior, selectionMode, allowsDragging } = (0, react_aria_components.useTableOptions)();
5610
+ return /* @__PURE__ */ react.createElement(react_aria_components.TableHeader, otherProps, allowsDragging && /* @__PURE__ */ react.createElement(react_aria_components.Column, {
5611
+ width: 20,
5612
+ minWidth: 20,
5613
+ style: { width: 20 },
5614
+ className: Table_module_default.column
5615
+ }, /* @__PURE__ */ react.createElement("div", { className: Table_module_default.columnDivider })), selectionBehavior === "toggle" && /* @__PURE__ */ react.createElement(react_aria_components.Column, {
5616
+ width: 32,
5617
+ minWidth: 32,
5618
+ style: { width: 32 },
5619
+ className: Table_module_default.column
5620
+ }, selectionMode === "multiple" && /* @__PURE__ */ react.createElement(RACCheckbox, { slot: "selection" }), /* @__PURE__ */ react.createElement("div", { className: Table_module_default.columnDivider })), /* @__PURE__ */ react.createElement(react_aria_components.Collection, { items: columns }, children), shouldShowActionColumn && /* @__PURE__ */ react.createElement(react_aria_components.Column, { className: Table_module_default.column }, "Actions"));
5621
+ }
5622
+ function Row({ id, columns, children, actionColumn, ...otherProps }) {
5623
+ const { selectionBehavior, allowsDragging } = (0, react_aria_components.useTableOptions)();
5624
+ return /* @__PURE__ */ react.createElement(react_aria_components.Row, {
5625
+ id,
5626
+ ...otherProps
5627
+ }, allowsDragging && /* @__PURE__ */ react.createElement(Cell, {
5628
+ className: Table_module_default.cell,
5629
+ "data-padding": "reduced"
5630
+ }, /* @__PURE__ */ react.createElement(IconButton, {
5631
+ slot: "drag",
5632
+ appearance: "neutral",
5633
+ variant: "tertiary",
5634
+ size: "xs",
5635
+ icon: _capra_icons.DragGrip,
5636
+ "aria-label": "Drag"
5637
+ })), selectionBehavior === "toggle" && /* @__PURE__ */ react.createElement(Cell, {
5638
+ className: Table_module_default.cell,
5639
+ "data-padding": "reduced"
5640
+ }, /* @__PURE__ */ react.createElement(RACCheckbox, { slot: "selection" })), /* @__PURE__ */ react.createElement(react_aria_components.Collection, { items: columns }, children), actionColumn && /* @__PURE__ */ react.createElement(Cell, { className: Table_module_default.cell }, actionColumn));
5641
+ }
5642
+ const INTERACTIVE_ELEMENT_SELECTOR = "a[href], button, input, select, textarea, [role=\"button\"], [role=\"checkbox\"], [role=\"combobox\"], [role=\"link\"], [role=\"slider\"], [role=\"spinbutton\"], [role=\"switch\"], [role=\"textbox\"]";
5643
+ function Cell(props) {
5644
+ return /* @__PURE__ */ react.createElement(react_aria_components.Cell, {
5645
+ ...props,
5646
+ onPointerDown: (e) => {
5647
+ if (e.target.closest(INTERACTIVE_ELEMENT_SELECTOR)) e.stopPropagation();
5648
+ }
5649
+ }, (0, react_aria_components.composeRenderProps)(props.children, (children, { hasChildItems, isTreeColumn }) => /* @__PURE__ */ react.createElement(react.Fragment, null, isTreeColumn && hasChildItems && /* @__PURE__ */ react.createElement(IconButton, {
5650
+ slot: "chevron",
5651
+ icon: _capra_icons.ChevronRight,
5652
+ "aria-label": "Chevron"
5653
+ }), children)));
5654
+ }
5655
+ function NonSortedIcons() {
5656
+ return /* @__PURE__ */ react.createElement("div", { className: Table_module_default.sortIcons }, /* @__PURE__ */ react.createElement(_capra_icons.CaretUp, { size: "sm" }), /* @__PURE__ */ react.createElement(_capra_icons.CaretDown, { size: "sm" }));
5657
+ }
5658
+ function SortedIcons(props) {
5659
+ return /* @__PURE__ */ react.createElement("div", {
5660
+ className: Table_module_default.sortIcons,
5661
+ "data-sort-direction": props.sortDirection
5662
+ }, /* @__PURE__ */ react.createElement(_capra_icons.CaretUp, { size: "sm" }), /* @__PURE__ */ react.createElement(_capra_icons.CaretDown, { size: "sm" }));
5663
+ }
5664
+ //#endregion
5389
5665
  //#region src/components/Tree/Tree.module.css
5390
5666
  var Tree_module_default = {
5391
5667
  "chevronButton": "capra-Tree-module--hXpBa-chevronButton",
@@ -5637,7 +5913,9 @@ exports.DatePickerField = DatePickerField;
5637
5913
  exports.DateRangePickerField = DateRangePickerField;
5638
5914
  exports.Divider = Divider;
5639
5915
  exports.Drawer = Drawer;
5916
+ exports.EMPTY_CELL_PLACEHOLDER = EMPTY_CELL_PLACEHOLDER;
5640
5917
  exports.EmptyState = EmptyState;
5918
+ exports.FilterToolbar = FilterToolbar;
5641
5919
  exports.IconButton = IconButton;
5642
5920
  exports.InputRow = InputRow;
5643
5921
  exports.Label = Label;
@@ -5668,15 +5946,18 @@ exports.SkeletonGroup = SkeletonGroup;
5668
5946
  exports.Spinner = Spinner;
5669
5947
  exports.Switch = Switch;
5670
5948
  exports.TabNav = TabNav;
5949
+ exports.Table = Table;
5671
5950
  exports.Tag = Tag;
5672
5951
  exports.Text = Text;
5673
5952
  exports.TextArea = TextArea;
5674
5953
  exports.TextField = TextField;
5675
5954
  exports.Toast = Toast;
5955
+ exports.ToggleButtonGroup = ToggleButtonGroup;
5676
5956
  exports.Tooltip = Tooltip;
5677
5957
  exports.TopNav = TopNav;
5678
5958
  exports.Tree = Tree;
5679
5959
  exports.VerticalNavigation = VerticalNavigation;
5680
5960
  exports.VisuallyHidden = VisuallyHidden;
5961
+ exports.defineColumns = defineColumns;
5681
5962
  exports.submenuPanelClassName = submenuPanelClassName;
5682
5963
  exports.tagColors = tagColors;