@capra/core 1.6.0 → 1.8.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.cjs CHANGED
@@ -843,10 +843,9 @@ Switch.displayName = "Switch";
843
843
  //#endregion
844
844
  //#region src/components/Tag/Tag.module.css
845
845
  var Tag_module_default = {
846
- "base": "capra-Tag-module-OZG-Nq-base",
847
- "delete": "capra-Tag-module-OZG-Nq-delete",
848
- "dragHandle": "capra-Tag-module-OZG-Nq-dragHandle",
849
- "label": "capra-Tag-module-OZG-Nq-label"
846
+ "base": "capra-Tag-module-y2Yzjq-base",
847
+ "dragHandle": "capra-Tag-module-y2Yzjq-dragHandle",
848
+ "label": "capra-Tag-module-y2Yzjq-label"
850
849
  };
851
850
  //#endregion
852
851
  //#region src/components/Tag/Tag.tsx
@@ -889,7 +888,7 @@ const tagColors = [
889
888
  /**
890
889
  * A tag component for displaying a label and an optional icon.
891
890
  */
892
- function Tag({ draggable, color = "default", icon: Icon, children, onDelete, onDragStart, onDragEnd, onHandleKeydown, FORCE__className: classNameOverride, ...props }) {
891
+ function Tag({ draggable, color = "default", icon: Icon, children, size = "md", onDelete, onDragStart, onDragEnd, onHandleKeydown, FORCE__className: classNameOverride, ...props }) {
893
892
  const baseRef = react.useRef(null);
894
893
  const draggableDebounceRef = react.useRef(0);
895
894
  const toggleDraggable = (value) => {
@@ -911,6 +910,7 @@ function Tag({ draggable, color = "default", icon: Icon, children, onDelete, onD
911
910
  ref: baseRef,
912
911
  className: clsx(Tag_module_default.base, classNameOverride),
913
912
  "data-color": color,
913
+ "data-size": size,
914
914
  onDragStart,
915
915
  onDragEnd
916
916
  }, draggable ? /* @__PURE__ */ react.createElement("span", {
@@ -4196,7 +4196,7 @@ const MenuSection = ({ children, "aria-label": ariaLabel, "aria-labelledby": ari
4196
4196
  }, resolvedChildren));
4197
4197
  };
4198
4198
  MenuSection.displayName = "Menu.Section";
4199
- const MenuItem = ({ as, label, description, ariaLabel, href, disabled = false, active = false, variant = "default", icon, indent: indentProp, shortcut, parent = false, onClick, FORCE__className, children, ...rest }) => {
4199
+ 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 }) => {
4200
4200
  const indentFromSectionHeader = react.useContext(MenuSectionIndentContext);
4201
4201
  const indent = indentProp !== void 0 ? indentProp : indentFromSectionHeader ? true : false;
4202
4202
  const labelContent = children ?? label;
@@ -4210,59 +4210,27 @@ const MenuItem = ({ as, label, description, ariaLabel, href, disabled = false, a
4210
4210
  size: "xs",
4211
4211
  "aria-hidden": true
4212
4212
  }) : null])));
4213
- const itemClassName = clsx(Menu_module_default.menuItem, FORCE__className);
4214
- const menuItemDataAttributes = {
4215
- "data-variant": variant,
4216
- "data-active": active || void 0,
4217
- "data-indent": indent || void 0,
4218
- "data-has-description": showDescription || void 0
4219
- };
4220
- /** React Aria runs menu activation through `onAction` (pointer + Enter/Space), not only `onPress`. */
4221
- const handleAction = () => {
4222
- if (!disabled && onClick) onClick({});
4223
- };
4224
- if (as) {
4225
- const Component = as;
4226
- return /* @__PURE__ */ react.createElement(react_aria_components.MenuItem, {
4227
- isDisabled: disabled,
4228
- textValue,
4229
- "aria-label": ariaLabel,
4230
- "aria-current": active ? "page" : void 0,
4231
- className: itemClassName,
4232
- ...menuItemDataAttributes,
4233
- render: (domProps) => /* @__PURE__ */ react.createElement(Component, {
4234
- ...domProps,
4235
- ...rest
4236
- }),
4237
- onAction: handleAction
4238
- }, /* @__PURE__ */ react.createElement(ListItem, {
4239
- as: "div",
4240
- role: "presentation",
4241
- FORCE__className: Menu_module_default.menuItemListItemShell
4242
- }, listItemContent));
4243
- }
4244
- if (Boolean(href) && !disabled) return /* @__PURE__ */ react.createElement(react_aria_components.MenuItem, {
4245
- href,
4246
- isDisabled: disabled,
4247
- textValue,
4248
- "aria-label": ariaLabel,
4249
- "aria-current": active ? "page" : void 0,
4250
- className: itemClassName,
4251
- ...menuItemDataAttributes,
4252
- onAction: handleAction
4253
- }, /* @__PURE__ */ react.createElement(ListItem, {
4254
- as: "div",
4255
- role: "presentation",
4256
- FORCE__className: Menu_module_default.menuItemListItemShell
4257
- }, listItemContent));
4213
+ const render = Component ? (domProps) => {
4214
+ const Element = Component;
4215
+ return /* @__PURE__ */ react.createElement(Element, {
4216
+ ...domProps,
4217
+ ...rest
4218
+ });
4219
+ } : void 0;
4258
4220
  return /* @__PURE__ */ react.createElement(react_aria_components.MenuItem, {
4221
+ href,
4259
4222
  isDisabled: disabled,
4260
4223
  textValue,
4261
4224
  "aria-label": ariaLabel,
4262
4225
  "aria-current": active ? "page" : void 0,
4263
- className: itemClassName,
4264
- ...menuItemDataAttributes,
4265
- onAction: handleAction
4226
+ className: clsx(Menu_module_default.menuItem, FORCE__className),
4227
+ "data-variant": variant,
4228
+ "data-active": active || void 0,
4229
+ "data-indent": indent || void 0,
4230
+ "data-has-description": showDescription || void 0,
4231
+ render,
4232
+ onClick,
4233
+ onPress
4266
4234
  }, /* @__PURE__ */ react.createElement(ListItem, {
4267
4235
  as: "div",
4268
4236
  role: "presentation",
@@ -4294,10 +4262,9 @@ const MenuSubmenu = ({ label, children, itemHoverAppearance = "default", itemAct
4294
4262
  size: "xs",
4295
4263
  "aria-hidden": true
4296
4264
  }))));
4297
- const triggerClassName = clsx(Menu_module_default.menuItem, classNameOverride);
4298
4265
  return /* @__PURE__ */ react.createElement(react_aria_components.SubmenuTrigger, { delay }, /* @__PURE__ */ react.createElement(react_aria_components.MenuItem, {
4299
4266
  textValue,
4300
- className: triggerClassName
4267
+ className: clsx(Menu_module_default.menuItem, classNameOverride)
4301
4268
  }, /* @__PURE__ */ react.createElement(ListItem, {
4302
4269
  as: "div",
4303
4270
  role: "presentation",
@@ -4708,10 +4675,7 @@ const TabNav = ({ activeKey, onTabClick, items, tabPlacement = "horizontal", cen
4708
4675
  role: "navigation",
4709
4676
  "aria-label": ariaLabel,
4710
4677
  className: TabNav_module_default.tabBar
4711
- }, /* @__PURE__ */ react.createElement("div", {
4712
- className: TabNav_module_default.tabList,
4713
- "aria-orientation": tabPlacement === "horizontal" ? "horizontal" : "vertical"
4714
- }, items.map((item) => {
4678
+ }, /* @__PURE__ */ react.createElement("div", { className: TabNav_module_default.tabList }, items.map((item) => {
4715
4679
  const hasSubItems = Boolean(item.subItems?.length);
4716
4680
  const showDropdown = hasSubItems || item.variant === "dropdown";
4717
4681
  /** Accent “active” tab styling: current route only (not merely flyout open — open + non-route stays grey). */
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React$2 from "react";
2
2
  import React$1, { HTMLAttributeAnchorTarget, HTMLAttributeReferrerPolicy } from "react";
3
- import { BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, ButtonProps as ButtonProps$1, ComboBoxRenderProps, DatePickerProps, DateRangePickerProps, DateValue, DisclosureProps, Focusable, LinkProps as LinkProps$1, ListBoxItemProps, PopoverProps as PopoverProps$1, RouterProvider } from "react-aria-components";
3
+ import { BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, ButtonProps as ButtonProps$1, ComboBoxRenderProps, DatePickerProps, DateRangePickerProps, DateValue, DisclosureProps, Focusable, LinkProps as LinkProps$1, ListBoxItemProps, PopoverProps as PopoverProps$1, PressEvent, RouterProvider } from "react-aria-components";
4
4
  import { SvgIcon } from "@capra/icons";
5
5
  import { SvgLogo } from "@capra/icons/logos";
6
6
 
@@ -125,7 +125,7 @@ declare const TextInput: React$2.ForwardRefExoticComponent<{
125
125
  */
126
126
  size?: Size$3; /** Content after the input (e.g. icon or clear button). */
127
127
  trailingSlot?: React$2.ReactNode;
128
- } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "size" | "className"> & React$2.RefAttributes<HTMLInputElement>>;
128
+ } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$2.RefAttributes<HTMLInputElement>>;
129
129
  //#endregion
130
130
  //#region src/components/input-helpers/fieldLayout.d.ts
131
131
  type FieldLayoutProps = {
@@ -172,7 +172,7 @@ declare const AutocompleteField: ((props: {
172
172
  leadingSlot?: React$1.ReactNode;
173
173
  size?: Size$3;
174
174
  trailingSlot?: React$1.ReactNode;
175
- } & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "size" | "className"> & React$1.RefAttributes<HTMLInputElement>, "ref">, "value" | "onChange"> & React$1.RefAttributes<HTMLInputElement>) => React$1.ReactElement) & {
175
+ } & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$1.RefAttributes<HTMLInputElement>, "ref">, "onChange" | "value"> & React$1.RefAttributes<HTMLInputElement>) => React$1.ReactElement) & {
176
176
  Item: typeof AutocompleteItem;
177
177
  };
178
178
  //#endregion
@@ -429,7 +429,7 @@ type RadioGroupProps = RadioGroupContextValue & StylingOverrideProps & Omit<Reac
429
429
  /**
430
430
  * A control wrapper for a group of radio buttons.
431
431
  */
432
- declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "onChange" | "className"> & React$2.RefAttributes<HTMLFieldSetElement>) => React$2.ReactElement;
432
+ declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "className" | "onChange"> & React$2.RefAttributes<HTMLFieldSetElement>) => React$2.ReactElement;
433
433
  //#endregion
434
434
  //#region src/components/Radio/Radio.d.ts
435
435
  type ChildrenLabel = {
@@ -492,6 +492,8 @@ declare const Switch: React$2.ForwardRefExoticComponent<SwitchProps & React$2.Re
492
492
  //#region src/components/Tag/Tag.d.ts
493
493
  declare const tagColors: readonly ["default", "accent", "danger", "warning", "info", "success", "highlight", "brand", "amber", "blue", "bronze", "brown", "criblTeal", "crimson", "cyan", "gold", "grass", "green", "indigo", "iris", "jade", "lime", "mint", "orange", "pink", "plum", "purple", "red", "ruby", "sky", "teal", "tomato", "violet", "yellow"];
494
494
  type TagColor = (typeof tagColors)[number];
495
+ declare const tagSizes: readonly ["sm", "md"];
496
+ type TagSize = (typeof tagSizes)[number];
495
497
  type Draggable = {
496
498
  draggable: true;
497
499
  onDragStart: React$2.DragEventHandler<HTMLSpanElement>;
@@ -518,6 +520,10 @@ type TagProps = DraggableProps & {
518
520
  * The label text to display in the tag.
519
521
  */
520
522
  children: string;
523
+ /**
524
+ * The size of the tag. Defaults to `md`.
525
+ */
526
+ size?: TagSize;
521
527
  /**
522
528
  * The callback function for when the user clicks the delete button.
523
529
  */
@@ -531,6 +537,7 @@ declare function Tag({
531
537
  color,
532
538
  icon: Icon,
533
539
  children,
540
+ size,
534
541
  onDelete,
535
542
  onDragStart,
536
543
  onDragEnd,
@@ -562,7 +569,7 @@ declare const Checkbox: React$2.ForwardRefExoticComponent<{
562
569
  checked?: boolean; /** Default checked state for uncontrolled component. */
563
570
  defaultChecked?: boolean; /** The label for the checkbox. */
564
571
  children?: string | React$2.ReactNode;
565
- } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | "className"> & React$2.RefAttributes<HTMLInputElement>>;
572
+ } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "className" | "type"> & React$2.RefAttributes<HTMLInputElement>>;
566
573
  //#endregion
567
574
  //#region src/components/Collapse/Collapse.d.ts
568
575
  /** Props forwarded to React Aria `Disclosure`; see https://reactaria.adobe.com/Disclosure */
@@ -636,7 +643,7 @@ declare const TextField: React$2.ForwardRefExoticComponent<{
636
643
  /** Called with the new string value when the input changes. */onChange?: (value: string) => void; /** When true, shows a character count. */
637
644
  showCount?: boolean;
638
645
  value?: string | number | undefined;
639
- } & FieldLayoutProps & Omit<TextInputProps, "value" | "onChange"> & React$2.RefAttributes<HTMLInputElement>>;
646
+ } & FieldLayoutProps & Omit<TextInputProps, "onChange" | "value"> & React$2.RefAttributes<HTMLInputElement>>;
640
647
  //#endregion
641
648
  //#region src/components/PasswordField/PasswordField.d.ts
642
649
  type PasswordFieldProps = Omit<TextFieldProps, 'trailingSlot' | 'type'>;
@@ -660,7 +667,7 @@ type NumberFieldProps = Omit<TextInputProps, 'type' | 'onChange' | 'min' | 'max'
660
667
  /**
661
668
  * Number field built on React Aria `NumberField`, with custom increment/decrement controls (native spinners hidden).
662
669
  */
663
- declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "max" | "min" | "step" | "type" | "onChange"> & {
670
+ declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "onChange" | "max" | "min" | "type" | "step"> & {
664
671
  /** Called with the unformatted number value when the number changes. */onChange?: (value: number) => void; /** Locale-aware display and parsing for the displayed value (see https://react-aria.adobe.com/NumberField#format-options) */
665
672
  formatOptions?: Intl.NumberFormatOptions; /** Minimum value */
666
673
  min?: number; /** Maximum value */
@@ -682,7 +689,7 @@ type DatePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutProps &
682
689
  required?: boolean; /** Invalid value; `appearance="danger"` also forces an invalid state for display. */
683
690
  isInvalid?: boolean;
684
691
  };
685
- declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "value" | "onChange" | "defaultValue"> & {
692
+ declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "defaultValue" | "onChange" | "value"> & {
686
693
  /** Smallest date/time unit shown in the field. Only `day` and `second` are supported. */granularity?: "day" | "second";
687
694
  } & StylingOverrideProps & {
688
695
  /** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
@@ -710,7 +717,7 @@ type DateRangePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutPro
710
717
  };
711
718
  declare const DateRangePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "size" | "appearance" | "leadingSlot"> & {
712
719
  /** Placeholders for empty start and end, shown with a swap icon between them when the group is not focus-within. */placeholder?: DateRangePickerFieldPlaceholder;
713
- } & Pick<DateRangePickerProps<DateValue>, "value" | "onChange" | "defaultValue" | "shouldCloseOnSelect"> & {
720
+ } & Pick<DateRangePickerProps<DateValue>, "defaultValue" | "onChange" | "value" | "shouldCloseOnSelect"> & {
714
721
  /** Smallest date/time unit shown in the fields. Only `day` and `second` are supported. */granularity?: "day" | "second";
715
722
  } & StylingOverrideProps & {
716
723
  /** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
@@ -770,7 +777,7 @@ declare const TextArea: React$2.ForwardRefExoticComponent<{
770
777
  autoSize?: TextAreaAutoSize; /** When true, shows a character count. */
771
778
  showCount?: boolean; /** Called with the new string value when the input changes. */
772
779
  onChange?: (value: string) => void;
773
- } & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "size" | "onChange" | "className"> & React$2.RefAttributes<HTMLTextAreaElement>>;
780
+ } & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "className" | "onChange" | "size"> & React$2.RefAttributes<HTMLTextAreaElement>>;
774
781
  //#endregion
775
782
  //#region src/components/Modal/Modal.d.ts
776
783
  type ModalSize = 'sm' | 'md' | 'lg';
@@ -1763,8 +1770,13 @@ type MenuItemProps<As extends React$2.ElementType = 'a'> = Omit<React$2.Componen
1763
1770
  * Whether to show chevron (for submenu/parent items).
1764
1771
  */
1765
1772
  parent?: boolean;
1773
+ /**
1774
+ * Press handler.
1775
+ */
1776
+ onPress?: (e: PressEvent) => void;
1766
1777
  /**
1767
1778
  * Click handler.
1779
+ * @deprecated Use `onPress` instead.
1768
1780
  */
1769
1781
  onClick?: (e: React$2.MouseEvent) => void;
1770
1782
  /**
@@ -1906,7 +1918,7 @@ declare const Menu: {
1906
1918
  displayName: string;
1907
1919
  Item: {
1908
1920
  <As extends React$2.ElementType = "a">({
1909
- as,
1921
+ as: Component,
1910
1922
  label,
1911
1923
  description,
1912
1924
  ariaLabel,
@@ -1918,6 +1930,7 @@ declare const Menu: {
1918
1930
  indent: indentProp,
1919
1931
  shortcut,
1920
1932
  parent,
1933
+ onPress,
1921
1934
  onClick,
1922
1935
  FORCE__className,
1923
1936
  children,
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$2 from "react";
2
2
  import React$1, { HTMLAttributeAnchorTarget, HTMLAttributeReferrerPolicy } from "react";
3
3
  import { SvgIcon } from "@capra/icons";
4
- import { BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, ButtonProps as ButtonProps$1, ComboBoxRenderProps, DatePickerProps, DateRangePickerProps, DateValue, DisclosureProps, Focusable, LinkProps as LinkProps$1, ListBoxItemProps, PopoverProps as PopoverProps$1, RouterProvider } from "react-aria-components";
4
+ import { BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, ButtonProps as ButtonProps$1, ComboBoxRenderProps, DatePickerProps, DateRangePickerProps, DateValue, DisclosureProps, Focusable, LinkProps as LinkProps$1, ListBoxItemProps, PopoverProps as PopoverProps$1, PressEvent, RouterProvider } from "react-aria-components";
5
5
  import { SvgLogo } from "@capra/icons/logos";
6
6
 
7
7
  //#region src/utils/stylingOverride.d.ts
@@ -125,7 +125,7 @@ declare const TextInput: React$2.ForwardRefExoticComponent<{
125
125
  */
126
126
  size?: Size$3; /** Content after the input (e.g. icon or clear button). */
127
127
  trailingSlot?: React$2.ReactNode;
128
- } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "size" | "className"> & React$2.RefAttributes<HTMLInputElement>>;
128
+ } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$2.RefAttributes<HTMLInputElement>>;
129
129
  //#endregion
130
130
  //#region src/components/input-helpers/fieldLayout.d.ts
131
131
  type FieldLayoutProps = {
@@ -172,7 +172,7 @@ declare const AutocompleteField: ((props: {
172
172
  leadingSlot?: React$1.ReactNode;
173
173
  size?: Size$3;
174
174
  trailingSlot?: React$1.ReactNode;
175
- } & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "size" | "className"> & React$1.RefAttributes<HTMLInputElement>, "ref">, "value" | "onChange"> & React$1.RefAttributes<HTMLInputElement>) => React$1.ReactElement) & {
175
+ } & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$1.RefAttributes<HTMLInputElement>, "ref">, "onChange" | "value"> & React$1.RefAttributes<HTMLInputElement>) => React$1.ReactElement) & {
176
176
  Item: typeof AutocompleteItem;
177
177
  };
178
178
  //#endregion
@@ -429,7 +429,7 @@ type RadioGroupProps = RadioGroupContextValue & StylingOverrideProps & Omit<Reac
429
429
  /**
430
430
  * A control wrapper for a group of radio buttons.
431
431
  */
432
- declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "onChange" | "className"> & React$2.RefAttributes<HTMLFieldSetElement>) => React$2.ReactElement;
432
+ declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "className" | "onChange"> & React$2.RefAttributes<HTMLFieldSetElement>) => React$2.ReactElement;
433
433
  //#endregion
434
434
  //#region src/components/Radio/Radio.d.ts
435
435
  type ChildrenLabel = {
@@ -492,6 +492,8 @@ declare const Switch: React$2.ForwardRefExoticComponent<SwitchProps & React$2.Re
492
492
  //#region src/components/Tag/Tag.d.ts
493
493
  declare const tagColors: readonly ["default", "accent", "danger", "warning", "info", "success", "highlight", "brand", "amber", "blue", "bronze", "brown", "criblTeal", "crimson", "cyan", "gold", "grass", "green", "indigo", "iris", "jade", "lime", "mint", "orange", "pink", "plum", "purple", "red", "ruby", "sky", "teal", "tomato", "violet", "yellow"];
494
494
  type TagColor = (typeof tagColors)[number];
495
+ declare const tagSizes: readonly ["sm", "md"];
496
+ type TagSize = (typeof tagSizes)[number];
495
497
  type Draggable = {
496
498
  draggable: true;
497
499
  onDragStart: React$2.DragEventHandler<HTMLSpanElement>;
@@ -518,6 +520,10 @@ type TagProps = DraggableProps & {
518
520
  * The label text to display in the tag.
519
521
  */
520
522
  children: string;
523
+ /**
524
+ * The size of the tag. Defaults to `md`.
525
+ */
526
+ size?: TagSize;
521
527
  /**
522
528
  * The callback function for when the user clicks the delete button.
523
529
  */
@@ -531,6 +537,7 @@ declare function Tag({
531
537
  color,
532
538
  icon: Icon,
533
539
  children,
540
+ size,
534
541
  onDelete,
535
542
  onDragStart,
536
543
  onDragEnd,
@@ -562,7 +569,7 @@ declare const Checkbox: React$2.ForwardRefExoticComponent<{
562
569
  checked?: boolean; /** Default checked state for uncontrolled component. */
563
570
  defaultChecked?: boolean; /** The label for the checkbox. */
564
571
  children?: string | React$2.ReactNode;
565
- } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | "className"> & React$2.RefAttributes<HTMLInputElement>>;
572
+ } & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "className" | "type"> & React$2.RefAttributes<HTMLInputElement>>;
566
573
  //#endregion
567
574
  //#region src/components/Collapse/Collapse.d.ts
568
575
  /** Props forwarded to React Aria `Disclosure`; see https://reactaria.adobe.com/Disclosure */
@@ -636,7 +643,7 @@ declare const TextField: React$2.ForwardRefExoticComponent<{
636
643
  /** Called with the new string value when the input changes. */onChange?: (value: string) => void; /** When true, shows a character count. */
637
644
  showCount?: boolean;
638
645
  value?: string | number | undefined;
639
- } & FieldLayoutProps & Omit<TextInputProps, "value" | "onChange"> & React$2.RefAttributes<HTMLInputElement>>;
646
+ } & FieldLayoutProps & Omit<TextInputProps, "onChange" | "value"> & React$2.RefAttributes<HTMLInputElement>>;
640
647
  //#endregion
641
648
  //#region src/components/PasswordField/PasswordField.d.ts
642
649
  type PasswordFieldProps = Omit<TextFieldProps, 'trailingSlot' | 'type'>;
@@ -660,7 +667,7 @@ type NumberFieldProps = Omit<TextInputProps, 'type' | 'onChange' | 'min' | 'max'
660
667
  /**
661
668
  * Number field built on React Aria `NumberField`, with custom increment/decrement controls (native spinners hidden).
662
669
  */
663
- declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "max" | "min" | "step" | "type" | "onChange"> & {
670
+ declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "onChange" | "max" | "min" | "type" | "step"> & {
664
671
  /** Called with the unformatted number value when the number changes. */onChange?: (value: number) => void; /** Locale-aware display and parsing for the displayed value (see https://react-aria.adobe.com/NumberField#format-options) */
665
672
  formatOptions?: Intl.NumberFormatOptions; /** Minimum value */
666
673
  min?: number; /** Maximum value */
@@ -682,7 +689,7 @@ type DatePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutProps &
682
689
  required?: boolean; /** Invalid value; `appearance="danger"` also forces an invalid state for display. */
683
690
  isInvalid?: boolean;
684
691
  };
685
- declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "value" | "onChange" | "defaultValue"> & {
692
+ declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "defaultValue" | "onChange" | "value"> & {
686
693
  /** Smallest date/time unit shown in the field. Only `day` and `second` are supported. */granularity?: "day" | "second";
687
694
  } & StylingOverrideProps & {
688
695
  /** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
@@ -710,7 +717,7 @@ type DateRangePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutPro
710
717
  };
711
718
  declare const DateRangePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "size" | "appearance" | "leadingSlot"> & {
712
719
  /** Placeholders for empty start and end, shown with a swap icon between them when the group is not focus-within. */placeholder?: DateRangePickerFieldPlaceholder;
713
- } & Pick<DateRangePickerProps<DateValue>, "value" | "onChange" | "defaultValue" | "shouldCloseOnSelect"> & {
720
+ } & Pick<DateRangePickerProps<DateValue>, "defaultValue" | "onChange" | "value" | "shouldCloseOnSelect"> & {
714
721
  /** Smallest date/time unit shown in the fields. Only `day` and `second` are supported. */granularity?: "day" | "second";
715
722
  } & StylingOverrideProps & {
716
723
  /** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
@@ -770,7 +777,7 @@ declare const TextArea: React$2.ForwardRefExoticComponent<{
770
777
  autoSize?: TextAreaAutoSize; /** When true, shows a character count. */
771
778
  showCount?: boolean; /** Called with the new string value when the input changes. */
772
779
  onChange?: (value: string) => void;
773
- } & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "size" | "onChange" | "className"> & React$2.RefAttributes<HTMLTextAreaElement>>;
780
+ } & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "className" | "onChange" | "size"> & React$2.RefAttributes<HTMLTextAreaElement>>;
774
781
  //#endregion
775
782
  //#region src/components/Modal/Modal.d.ts
776
783
  type ModalSize = 'sm' | 'md' | 'lg';
@@ -1763,8 +1770,13 @@ type MenuItemProps<As extends React$2.ElementType = 'a'> = Omit<React$2.Componen
1763
1770
  * Whether to show chevron (for submenu/parent items).
1764
1771
  */
1765
1772
  parent?: boolean;
1773
+ /**
1774
+ * Press handler.
1775
+ */
1776
+ onPress?: (e: PressEvent) => void;
1766
1777
  /**
1767
1778
  * Click handler.
1779
+ * @deprecated Use `onPress` instead.
1768
1780
  */
1769
1781
  onClick?: (e: React$2.MouseEvent) => void;
1770
1782
  /**
@@ -1906,7 +1918,7 @@ declare const Menu: {
1906
1918
  displayName: string;
1907
1919
  Item: {
1908
1920
  <As extends React$2.ElementType = "a">({
1909
- as,
1921
+ as: Component,
1910
1922
  label,
1911
1923
  description,
1912
1924
  ariaLabel,
@@ -1918,6 +1930,7 @@ declare const Menu: {
1918
1930
  indent: indentProp,
1919
1931
  shortcut,
1920
1932
  parent,
1933
+ onPress,
1921
1934
  onClick,
1922
1935
  FORCE__className,
1923
1936
  children,
package/dist/index.mjs CHANGED
@@ -819,10 +819,9 @@ Switch.displayName = "Switch";
819
819
  //#endregion
820
820
  //#region src/components/Tag/Tag.module.css
821
821
  var Tag_module_default = {
822
- "base": "capra-Tag-module-OZG-Nq-base",
823
- "delete": "capra-Tag-module-OZG-Nq-delete",
824
- "dragHandle": "capra-Tag-module-OZG-Nq-dragHandle",
825
- "label": "capra-Tag-module-OZG-Nq-label"
822
+ "base": "capra-Tag-module-y2Yzjq-base",
823
+ "dragHandle": "capra-Tag-module-y2Yzjq-dragHandle",
824
+ "label": "capra-Tag-module-y2Yzjq-label"
826
825
  };
827
826
  //#endregion
828
827
  //#region src/components/Tag/Tag.tsx
@@ -865,7 +864,7 @@ const tagColors = [
865
864
  /**
866
865
  * A tag component for displaying a label and an optional icon.
867
866
  */
868
- function Tag({ draggable, color = "default", icon: Icon, children, onDelete, onDragStart, onDragEnd, onHandleKeydown, FORCE__className: classNameOverride, ...props }) {
867
+ function Tag({ draggable, color = "default", icon: Icon, children, size = "md", onDelete, onDragStart, onDragEnd, onHandleKeydown, FORCE__className: classNameOverride, ...props }) {
869
868
  const baseRef = React$1.useRef(null);
870
869
  const draggableDebounceRef = React$1.useRef(0);
871
870
  const toggleDraggable = (value) => {
@@ -887,6 +886,7 @@ function Tag({ draggable, color = "default", icon: Icon, children, onDelete, onD
887
886
  ref: baseRef,
888
887
  className: clsx(Tag_module_default.base, classNameOverride),
889
888
  "data-color": color,
889
+ "data-size": size,
890
890
  onDragStart,
891
891
  onDragEnd
892
892
  }, draggable ? /* @__PURE__ */ React$1.createElement("span", {
@@ -4172,7 +4172,7 @@ const MenuSection$1 = ({ children, "aria-label": ariaLabel, "aria-labelledby": a
4172
4172
  }, resolvedChildren));
4173
4173
  };
4174
4174
  MenuSection$1.displayName = "Menu.Section";
4175
- const MenuItem$1 = ({ as, label, description, ariaLabel, href, disabled = false, active = false, variant = "default", icon, indent: indentProp, shortcut, parent = false, onClick, FORCE__className, children, ...rest }) => {
4175
+ const MenuItem$1 = ({ as: Component, label, description, ariaLabel, href, disabled = false, active = false, variant = "default", icon, indent: indentProp, shortcut, parent = false, onPress, onClick, FORCE__className, children, ...rest }) => {
4176
4176
  const indentFromSectionHeader = React$1.useContext(MenuSectionIndentContext);
4177
4177
  const indent = indentProp !== void 0 ? indentProp : indentFromSectionHeader ? true : false;
4178
4178
  const labelContent = children ?? label;
@@ -4186,59 +4186,27 @@ const MenuItem$1 = ({ as, label, description, ariaLabel, href, disabled = false,
4186
4186
  size: "xs",
4187
4187
  "aria-hidden": true
4188
4188
  }) : null])));
4189
- const itemClassName = clsx(Menu_module_default.menuItem, FORCE__className);
4190
- const menuItemDataAttributes = {
4191
- "data-variant": variant,
4192
- "data-active": active || void 0,
4193
- "data-indent": indent || void 0,
4194
- "data-has-description": showDescription || void 0
4195
- };
4196
- /** React Aria runs menu activation through `onAction` (pointer + Enter/Space), not only `onPress`. */
4197
- const handleAction = () => {
4198
- if (!disabled && onClick) onClick({});
4199
- };
4200
- if (as) {
4201
- const Component = as;
4202
- return /* @__PURE__ */ React$1.createElement(MenuItem, {
4203
- isDisabled: disabled,
4204
- textValue,
4205
- "aria-label": ariaLabel,
4206
- "aria-current": active ? "page" : void 0,
4207
- className: itemClassName,
4208
- ...menuItemDataAttributes,
4209
- render: (domProps) => /* @__PURE__ */ React$1.createElement(Component, {
4210
- ...domProps,
4211
- ...rest
4212
- }),
4213
- onAction: handleAction
4214
- }, /* @__PURE__ */ React$1.createElement(ListItem, {
4215
- as: "div",
4216
- role: "presentation",
4217
- FORCE__className: Menu_module_default.menuItemListItemShell
4218
- }, listItemContent));
4219
- }
4220
- if (Boolean(href) && !disabled) return /* @__PURE__ */ React$1.createElement(MenuItem, {
4221
- href,
4222
- isDisabled: disabled,
4223
- textValue,
4224
- "aria-label": ariaLabel,
4225
- "aria-current": active ? "page" : void 0,
4226
- className: itemClassName,
4227
- ...menuItemDataAttributes,
4228
- onAction: handleAction
4229
- }, /* @__PURE__ */ React$1.createElement(ListItem, {
4230
- as: "div",
4231
- role: "presentation",
4232
- FORCE__className: Menu_module_default.menuItemListItemShell
4233
- }, listItemContent));
4189
+ const render = Component ? (domProps) => {
4190
+ const Element = Component;
4191
+ return /* @__PURE__ */ React$1.createElement(Element, {
4192
+ ...domProps,
4193
+ ...rest
4194
+ });
4195
+ } : void 0;
4234
4196
  return /* @__PURE__ */ React$1.createElement(MenuItem, {
4197
+ href,
4235
4198
  isDisabled: disabled,
4236
4199
  textValue,
4237
4200
  "aria-label": ariaLabel,
4238
4201
  "aria-current": active ? "page" : void 0,
4239
- className: itemClassName,
4240
- ...menuItemDataAttributes,
4241
- onAction: handleAction
4202
+ className: clsx(Menu_module_default.menuItem, FORCE__className),
4203
+ "data-variant": variant,
4204
+ "data-active": active || void 0,
4205
+ "data-indent": indent || void 0,
4206
+ "data-has-description": showDescription || void 0,
4207
+ render,
4208
+ onClick,
4209
+ onPress
4242
4210
  }, /* @__PURE__ */ React$1.createElement(ListItem, {
4243
4211
  as: "div",
4244
4212
  role: "presentation",
@@ -4270,10 +4238,9 @@ const MenuSubmenu = ({ label, children, itemHoverAppearance = "default", itemAct
4270
4238
  size: "xs",
4271
4239
  "aria-hidden": true
4272
4240
  }))));
4273
- const triggerClassName = clsx(Menu_module_default.menuItem, classNameOverride);
4274
4241
  return /* @__PURE__ */ React$1.createElement(SubmenuTrigger, { delay }, /* @__PURE__ */ React$1.createElement(MenuItem, {
4275
4242
  textValue,
4276
- className: triggerClassName
4243
+ className: clsx(Menu_module_default.menuItem, classNameOverride)
4277
4244
  }, /* @__PURE__ */ React$1.createElement(ListItem, {
4278
4245
  as: "div",
4279
4246
  role: "presentation",
@@ -4684,10 +4651,7 @@ const TabNav = ({ activeKey, onTabClick, items, tabPlacement = "horizontal", cen
4684
4651
  role: "navigation",
4685
4652
  "aria-label": ariaLabel,
4686
4653
  className: TabNav_module_default.tabBar
4687
- }, /* @__PURE__ */ React$1.createElement("div", {
4688
- className: TabNav_module_default.tabList,
4689
- "aria-orientation": tabPlacement === "horizontal" ? "horizontal" : "vertical"
4690
- }, items.map((item) => {
4654
+ }, /* @__PURE__ */ React$1.createElement("div", { className: TabNav_module_default.tabList }, items.map((item) => {
4691
4655
  const hasSubItems = Boolean(item.subItems?.length);
4692
4656
  const showDropdown = hasSubItems || item.variant === "dropdown";
4693
4657
  /** Accent “active” tab styling: current route only (not merely flyout open — open + non-route stays grey). */
package/dist/style.css CHANGED
@@ -1109,229 +1109,237 @@ input:disabled + .capra-Radio-module-ZI7rzq-inner:after {
1109
1109
  transition: none;
1110
1110
  }
1111
1111
  }
1112
- .capra-Tag-module-OZG-Nq-base {
1113
- padding: 0 var(--cds2-spacing-md);
1112
+ .capra-Tag-module-y2Yzjq-base {
1113
+ border-radius: var(--cds2-radius-md);
1114
+ border: var(--cds2-border-default);
1114
1115
  justify-content: space-between;
1115
1116
  align-items: center;
1116
1117
  gap: var(--cds2-spacing-sm);
1117
- height: var(--cds2-dimension-component-sm);
1118
- min-width: var(--cds2-dimension-component-sm);
1119
- border-radius: var(--cds2-radius-md);
1120
- border: var(--cds2-border-default);
1118
+ padding: 0 var(--cds2-spacing-md);
1121
1119
  display: inline-flex;
1122
- }
1123
1120
 
1124
- .capra-Tag-module-OZG-Nq-dragHandle {
1125
- cursor: move;
1126
- }
1121
+ &[data-size="md"] {
1122
+ height: var(--cds2-dimension-component-sm);
1123
+ min-width: var(--cds2-dimension-component-sm);
1127
1124
 
1128
- .capra-Tag-module-OZG-Nq-label {
1129
- font: var(--cds2-typography-body-sm-normal);
1125
+ & .capra-Tag-module-y2Yzjq-label {
1126
+ font: var(--cds2-typography-body-sm-normal);
1127
+ }
1128
+ }
1129
+
1130
+ &[data-size="sm"] {
1131
+ height: var(--cds2-dimension-component-xs);
1132
+ min-width: var(--cds2-dimension-component-xs);
1133
+
1134
+ & .capra-Tag-module-y2Yzjq-label {
1135
+ font: var(--cds2-typography-body-xs-normal);
1136
+ }
1137
+ }
1130
1138
  }
1131
1139
 
1132
- .capra-Tag-module-OZG-Nq-base .capra-Tag-module-OZG-Nq-delete {
1133
- background-color: #0000;
1140
+ .capra-Tag-module-y2Yzjq-dragHandle {
1141
+ cursor: move;
1134
1142
  }
1135
1143
 
1136
- .capra-Tag-module-OZG-Nq-base[data-color="default"] {
1144
+ .capra-Tag-module-y2Yzjq-base[data-color="default"] {
1137
1145
  background-color: var(--cds2-color-background-neutral-subtle);
1138
1146
  border-color: var(--cds2-color-border-neutral-subtle);
1139
1147
  color: var(--cds2-color-foreground-subtle);
1140
1148
  }
1141
1149
 
1142
- .capra-Tag-module-OZG-Nq-base[data-color="accent"] {
1150
+ .capra-Tag-module-y2Yzjq-base[data-color="accent"] {
1143
1151
  background-color: var(--cds2-color-background-accent-subtle);
1144
1152
  border-color: var(--cds2-color-border-accent-subtle);
1145
1153
  color: var(--cds2-color-foreground-accent-default);
1146
1154
  }
1147
1155
 
1148
- .capra-Tag-module-OZG-Nq-base[data-color="danger"] {
1156
+ .capra-Tag-module-y2Yzjq-base[data-color="danger"] {
1149
1157
  background-color: var(--cds2-color-background-danger-subtle);
1150
1158
  border-color: var(--cds2-color-border-danger-subtle);
1151
1159
  color: var(--cds2-color-foreground-danger-default);
1152
1160
  }
1153
1161
 
1154
- .capra-Tag-module-OZG-Nq-base[data-color="warning"] {
1162
+ .capra-Tag-module-y2Yzjq-base[data-color="warning"] {
1155
1163
  background-color: var(--cds2-color-background-warning-subtle);
1156
1164
  border-color: var(--cds2-color-border-warning-subtle);
1157
1165
  color: var(--cds2-color-foreground-warning-default);
1158
1166
  }
1159
1167
 
1160
- .capra-Tag-module-OZG-Nq-base[data-color="info"] {
1168
+ .capra-Tag-module-y2Yzjq-base[data-color="info"] {
1161
1169
  background-color: var(--cds2-color-background-info-subtle);
1162
1170
  border-color: var(--cds2-color-border-info-subtle);
1163
1171
  color: var(--cds2-color-foreground-info-default);
1164
1172
  }
1165
1173
 
1166
- .capra-Tag-module-OZG-Nq-base[data-color="success"] {
1174
+ .capra-Tag-module-y2Yzjq-base[data-color="success"] {
1167
1175
  background-color: var(--cds2-color-background-success-subtle);
1168
1176
  border-color: var(--cds2-color-border-success-subtle);
1169
1177
  color: var(--cds2-color-foreground-success-default);
1170
1178
  }
1171
1179
 
1172
- .capra-Tag-module-OZG-Nq-base[data-color="highlight"] {
1180
+ .capra-Tag-module-y2Yzjq-base[data-color="highlight"] {
1173
1181
  background-color: var(--cds2-color-background-highlight-subtle);
1174
1182
  border-color: var(--cds2-color-border-highlight-subtle);
1175
1183
  color: var(--cds2-color-foreground-highlight-default);
1176
1184
  }
1177
1185
 
1178
- .capra-Tag-module-OZG-Nq-base[data-color="brand"] {
1186
+ .capra-Tag-module-y2Yzjq-base[data-color="brand"] {
1179
1187
  background-color: var(--cds2-color-background-brand-subtle);
1180
1188
  border-color: var(--cds2-color-border-brand-subtle);
1181
1189
  color: var(--cds2-color-foreground-brand-default);
1182
1190
  }
1183
1191
 
1184
- .capra-Tag-module-OZG-Nq-base[data-color="amber"] {
1192
+ .capra-Tag-module-y2Yzjq-base[data-color="amber"] {
1185
1193
  background-color: var(--cds2-core-color-amber-a2);
1186
1194
  border-color: var(--cds2-core-color-amber-a6);
1187
1195
  color: var(--cds2-core-color-amber-a11);
1188
1196
  }
1189
1197
 
1190
- .capra-Tag-module-OZG-Nq-base[data-color="blue"] {
1198
+ .capra-Tag-module-y2Yzjq-base[data-color="blue"] {
1191
1199
  background-color: var(--cds2-core-color-blue-a2);
1192
1200
  border-color: var(--cds2-core-color-blue-a6);
1193
1201
  color: var(--cds2-core-color-blue-a11);
1194
1202
  }
1195
1203
 
1196
- .capra-Tag-module-OZG-Nq-base[data-color="bronze"] {
1204
+ .capra-Tag-module-y2Yzjq-base[data-color="bronze"] {
1197
1205
  background-color: var(--cds2-core-color-bronze-a2);
1198
1206
  border-color: var(--cds2-core-color-bronze-a6);
1199
1207
  color: var(--cds2-core-color-bronze-a11);
1200
1208
  }
1201
1209
 
1202
- .capra-Tag-module-OZG-Nq-base[data-color="brown"] {
1210
+ .capra-Tag-module-y2Yzjq-base[data-color="brown"] {
1203
1211
  background-color: var(--cds2-core-color-brown-a2);
1204
1212
  border-color: var(--cds2-core-color-brown-a6);
1205
1213
  color: var(--cds2-core-color-brown-a11);
1206
1214
  }
1207
1215
 
1208
- .capra-Tag-module-OZG-Nq-base[data-color="criblTeal"] {
1216
+ .capra-Tag-module-y2Yzjq-base[data-color="criblTeal"] {
1209
1217
  background-color: var(--cds2-core-color-cribl-teal-a2);
1210
1218
  border-color: var(--cds2-core-color-cribl-teal-a6);
1211
1219
  color: var(--cds2-core-color-cribl-teal-a11);
1212
1220
  }
1213
1221
 
1214
- .capra-Tag-module-OZG-Nq-base[data-color="crimson"] {
1222
+ .capra-Tag-module-y2Yzjq-base[data-color="crimson"] {
1215
1223
  background-color: var(--cds2-core-color-crimson-a2);
1216
1224
  border-color: var(--cds2-core-color-crimson-a6);
1217
1225
  color: var(--cds2-core-color-crimson-a11);
1218
1226
  }
1219
1227
 
1220
- .capra-Tag-module-OZG-Nq-base[data-color="cyan"] {
1228
+ .capra-Tag-module-y2Yzjq-base[data-color="cyan"] {
1221
1229
  background-color: var(--cds2-core-color-cyan-a2);
1222
1230
  border-color: var(--cds2-core-color-cyan-a6);
1223
1231
  color: var(--cds2-core-color-cyan-a11);
1224
1232
  }
1225
1233
 
1226
- .capra-Tag-module-OZG-Nq-base[data-color="gold"] {
1234
+ .capra-Tag-module-y2Yzjq-base[data-color="gold"] {
1227
1235
  background-color: var(--cds2-core-color-gold-a2);
1228
1236
  border-color: var(--cds2-core-color-gold-a6);
1229
1237
  color: var(--cds2-core-color-gold-a11);
1230
1238
  }
1231
1239
 
1232
- .capra-Tag-module-OZG-Nq-base[data-color="grass"] {
1240
+ .capra-Tag-module-y2Yzjq-base[data-color="grass"] {
1233
1241
  background-color: var(--cds2-core-color-grass-a2);
1234
1242
  border-color: var(--cds2-core-color-grass-a6);
1235
1243
  color: var(--cds2-core-color-grass-a11);
1236
1244
  }
1237
1245
 
1238
- .capra-Tag-module-OZG-Nq-base[data-color="green"] {
1246
+ .capra-Tag-module-y2Yzjq-base[data-color="green"] {
1239
1247
  background-color: var(--cds2-core-color-green-a2);
1240
1248
  border-color: var(--cds2-core-color-green-a6);
1241
1249
  color: var(--cds2-core-color-green-a11);
1242
1250
  }
1243
1251
 
1244
- .capra-Tag-module-OZG-Nq-base[data-color="indigo"] {
1252
+ .capra-Tag-module-y2Yzjq-base[data-color="indigo"] {
1245
1253
  background-color: var(--cds2-core-color-indigo-a2);
1246
1254
  border-color: var(--cds2-core-color-indigo-a6);
1247
1255
  color: var(--cds2-core-color-indigo-a11);
1248
1256
  }
1249
1257
 
1250
- .capra-Tag-module-OZG-Nq-base[data-color="iris"] {
1258
+ .capra-Tag-module-y2Yzjq-base[data-color="iris"] {
1251
1259
  background-color: var(--cds2-core-color-iris-a2);
1252
1260
  border-color: var(--cds2-core-color-iris-a6);
1253
1261
  color: var(--cds2-core-color-iris-a11);
1254
1262
  }
1255
1263
 
1256
- .capra-Tag-module-OZG-Nq-base[data-color="jade"] {
1264
+ .capra-Tag-module-y2Yzjq-base[data-color="jade"] {
1257
1265
  background-color: var(--cds2-core-color-jade-a2);
1258
1266
  border-color: var(--cds2-core-color-jade-a6);
1259
1267
  color: var(--cds2-core-color-jade-a11);
1260
1268
  }
1261
1269
 
1262
- .capra-Tag-module-OZG-Nq-base[data-color="lime"] {
1270
+ .capra-Tag-module-y2Yzjq-base[data-color="lime"] {
1263
1271
  background-color: var(--cds2-core-color-lime-a2);
1264
1272
  border-color: var(--cds2-core-color-lime-a6);
1265
1273
  color: var(--cds2-core-color-lime-a11);
1266
1274
  }
1267
1275
 
1268
- .capra-Tag-module-OZG-Nq-base[data-color="mint"] {
1276
+ .capra-Tag-module-y2Yzjq-base[data-color="mint"] {
1269
1277
  background-color: var(--cds2-core-color-mint-a2);
1270
1278
  border-color: var(--cds2-core-color-mint-a6);
1271
1279
  color: var(--cds2-core-color-mint-a11);
1272
1280
  }
1273
1281
 
1274
- .capra-Tag-module-OZG-Nq-base[data-color="orange"] {
1282
+ .capra-Tag-module-y2Yzjq-base[data-color="orange"] {
1275
1283
  background-color: var(--cds2-core-color-orange-a2);
1276
1284
  border-color: var(--cds2-core-color-orange-a6);
1277
1285
  color: var(--cds2-core-color-orange-a11);
1278
1286
  }
1279
1287
 
1280
- .capra-Tag-module-OZG-Nq-base[data-color="pink"] {
1288
+ .capra-Tag-module-y2Yzjq-base[data-color="pink"] {
1281
1289
  background-color: var(--cds2-core-color-pink-a2);
1282
1290
  border-color: var(--cds2-core-color-pink-a6);
1283
1291
  color: var(--cds2-core-color-pink-a11);
1284
1292
  }
1285
1293
 
1286
- .capra-Tag-module-OZG-Nq-base[data-color="plum"] {
1294
+ .capra-Tag-module-y2Yzjq-base[data-color="plum"] {
1287
1295
  background-color: var(--cds2-core-color-plum-a2);
1288
1296
  border-color: var(--cds2-core-color-plum-a6);
1289
1297
  color: var(--cds2-core-color-plum-a11);
1290
1298
  }
1291
1299
 
1292
- .capra-Tag-module-OZG-Nq-base[data-color="purple"] {
1300
+ .capra-Tag-module-y2Yzjq-base[data-color="purple"] {
1293
1301
  background-color: var(--cds2-core-color-purple-a2);
1294
1302
  border-color: var(--cds2-core-color-purple-a6);
1295
1303
  color: var(--cds2-core-color-purple-a11);
1296
1304
  }
1297
1305
 
1298
- .capra-Tag-module-OZG-Nq-base[data-color="red"] {
1306
+ .capra-Tag-module-y2Yzjq-base[data-color="red"] {
1299
1307
  background-color: var(--cds2-core-color-red-a2);
1300
1308
  border-color: var(--cds2-core-color-red-a6);
1301
1309
  color: var(--cds2-core-color-red-a11);
1302
1310
  }
1303
1311
 
1304
- .capra-Tag-module-OZG-Nq-base[data-color="ruby"] {
1312
+ .capra-Tag-module-y2Yzjq-base[data-color="ruby"] {
1305
1313
  background-color: var(--cds2-core-color-ruby-a2);
1306
1314
  border-color: var(--cds2-core-color-ruby-a6);
1307
1315
  color: var(--cds2-core-color-ruby-a11);
1308
1316
  }
1309
1317
 
1310
- .capra-Tag-module-OZG-Nq-base[data-color="sky"] {
1318
+ .capra-Tag-module-y2Yzjq-base[data-color="sky"] {
1311
1319
  background-color: var(--cds2-core-color-sky-a2);
1312
1320
  border-color: var(--cds2-core-color-sky-a6);
1313
1321
  color: var(--cds2-core-color-sky-a11);
1314
1322
  }
1315
1323
 
1316
- .capra-Tag-module-OZG-Nq-base[data-color="teal"] {
1324
+ .capra-Tag-module-y2Yzjq-base[data-color="teal"] {
1317
1325
  background-color: var(--cds2-core-color-teal-a2);
1318
1326
  border-color: var(--cds2-core-color-teal-a6);
1319
1327
  color: var(--cds2-core-color-teal-a11);
1320
1328
  }
1321
1329
 
1322
- .capra-Tag-module-OZG-Nq-base[data-color="tomato"] {
1330
+ .capra-Tag-module-y2Yzjq-base[data-color="tomato"] {
1323
1331
  background-color: var(--cds2-core-color-tomato-a2);
1324
1332
  border-color: var(--cds2-core-color-tomato-a6);
1325
1333
  color: var(--cds2-core-color-tomato-a11);
1326
1334
  }
1327
1335
 
1328
- .capra-Tag-module-OZG-Nq-base[data-color="violet"] {
1336
+ .capra-Tag-module-y2Yzjq-base[data-color="violet"] {
1329
1337
  background-color: var(--cds2-core-color-violet-a2);
1330
1338
  border-color: var(--cds2-core-color-violet-a6);
1331
1339
  color: var(--cds2-core-color-violet-a11);
1332
1340
  }
1333
1341
 
1334
- .capra-Tag-module-OZG-Nq-base[data-color="yellow"] {
1342
+ .capra-Tag-module-y2Yzjq-base[data-color="yellow"] {
1335
1343
  background-color: var(--cds2-core-color-yellow-a2);
1336
1344
  border-color: var(--cds2-core-color-yellow-a6);
1337
1345
  color: var(--cds2-core-color-yellow-a11);
@@ -56,12 +56,12 @@ Tab labels should be one or two words, using title case (Tab Label). Labels shou
56
56
 
57
57
  ### Keyboard interaction
58
58
 
59
- | Key | Function |
60
- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61
- | `Tab` / `Shift + Tab` | Moves focus into the tab list, putting focus onto the active tab. When the tab list has focus, moves focus to the next focusable element (generally within the tab panel). |
62
- | `Left Arrow` / `Up Arrow` | Moves focus to, and activate, the previous tab. If focus is on the first tab, move focus to the last tab. Up performs the same action when `aria-orientation="vertical"` is set. |
63
- | `Right Arrow` / `Down Arrow` | Moves focus to, and activate, the next tab. If focus is on the last tab, move focus to the first tab. Down performs the same action when `aria-orientation="vertical"` is set. |
64
- | `Shift+F10` | Opens the menu for tabs with a dropdown. |
59
+ | Key | Function |
60
+ | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61
+ | `Tab` / `Shift + Tab` | Moves focus into the tab list, putting focus onto the active tab. When the tab list has focus, moves focus to the next focusable element (generally within the tab panel). |
62
+ | `Left Arrow` / `Up Arrow` | Moves focus to, and activate, the previous tab. If focus is on the first tab, move focus to the last tab. Up performs the same action when `tabPlacement="vertical"`. |
63
+ | `Right Arrow` / `Down Arrow` | Moves focus to, and activate, the next tab. If focus is on the last tab, move focus to the first tab. Down performs the same action when `tabPlacement="vertical"`. |
64
+ | `Shift+F10` | Opens the menu for tabs with a dropdown. |
65
65
 
66
66
  ### ARIA considerations
67
67
 
@@ -74,4 +74,4 @@ TabNav uses link-based navigation. The following apply:
74
74
 
75
75
  ### Orientation
76
76
 
77
- Use `tabPlacement="horizontal"` (default) for a horizontal tab bar at the bottom, or `tabPlacement="vertical"` for a vertical tab bar on the left. Vertical tabs have `aria-orientation="vertical"` set.
77
+ Use `tabPlacement="horizontal"` (default) for a horizontal tab bar at the bottom, or `tabPlacement="vertical"` for a vertical tab bar on the left.
@@ -2,6 +2,13 @@
2
2
 
3
3
  A tag component for displaying a label and an optional icon.
4
4
 
5
+ ## Size
6
+
7
+ `Tag` supports two sizes:
8
+
9
+ * `md` is the default size and preserves the existing Tag density.
10
+ * `sm` is a more compact treatment for dense metadata layouts.
11
+
5
12
  ## Accessibility
6
13
 
7
14
  ### Keyboard interaction
@@ -13,6 +20,10 @@ A tag component for displaying a label and an optional icon.
13
20
 
14
21
  All buttons exist in the page's natural tab sequence, reachable via `Tab` and `Shift+Tab` keys. Pressing `Spacebar` or `Enter` activates the focused button.
15
22
 
23
+ ### Target size
24
+
25
+ The compact `sm` size reduces the visible chip height for dense layouts. When using interactive affordances such as delete or drag, verify the surrounding product layout still provides sufficient pointer spacing and focus visibility for the overall interaction.
26
+
16
27
  ### Draggability
17
28
 
18
29
  The tag can be made draggable by setting the `draggable` prop to `true`. When the tag is draggable, the user can drag the tag to a new position in the list.
@@ -7,5 +7,6 @@ A tag component for displaying a label and an optional icon.
7
7
  | `color` | `(typeof tagColors)[number]` | No | 'default' | The color of the tag. Defaults to `default`. |
8
8
  | `icon` | `SvgIcon \| SvgLogo` | No | `--` | The icon or logo to display in the tag. |
9
9
  | `children` | `string` | Yes | `--` | The label text to display in the tag. |
10
+ | `size` | `(typeof tagSizes)[number]` | No | 'md' | The size of the tag. Defaults to `md`. |
10
11
  | `onDelete` | `() => void` | No | `--` | The callback function for when the user clicks the delete button. |
11
12
  | `FORCE__className` | `string` | No | `--` | 🚨 This prop is meant to be an escape hatch. 🚨<br><br>If the desired style cannot be achieved using component props, use this as a last resort. The inner workings of Capra components are implementation details and this escape hatch gives one access to those implementation details. We cannot make any guarantees that styles will applied correctly across version updates. Please use it responsibly.<br><br>Add a CSS class to the component. |
@@ -1,5 +1,22 @@
1
1
  # History/Changelogs/@capra-core
2
2
 
3
+ ### 1.8.0
4
+
5
+ #### Minor Changes
6
+
7
+ * [c97320b](https://bitbucket.org/cribl/capra-ui/commits/c97320b): Add size support to `Tag`.
8
+
9
+ ### 1.7.0
10
+
11
+ #### Minor Changes
12
+
13
+ * [540b651](https://bitbucket.org/cribl/capra-ui/commits/540b651): Add `onPress` event handler to `Menu.Item` and deprecate `onClick`
14
+
15
+ #### Patch Changes
16
+
17
+ * [540b651](https://bitbucket.org/cribl/capra-ui/commits/540b651): Fix issue where event in `Menu.Item` `onClick` was not bubbling correctly
18
+ * [684cc26](https://bitbucket.org/cribl/capra-ui/commits/684cc26): Remove invalid `aria-orientation` attribute in TabNav component.
19
+
3
20
  ### 1.6.0
4
21
 
5
22
  #### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capra/core",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "description": "Core React components for the Capra design system",
@@ -44,11 +44,11 @@
44
44
  "antd": "4.24.16",
45
45
  "storybook": "^10.4.6",
46
46
  "tsdown": "^0.22.0",
47
+ "@private/building": "0.0.4",
47
48
  "@capra/theme": "1.3.0",
48
49
  "@private/linting": "0.0.0",
49
- "@private/building": "0.0.4",
50
- "@private/stories": "0.0.0",
51
- "@private/testing": "0.0.7"
50
+ "@private/testing": "0.0.7",
51
+ "@private/stories": "0.0.0"
52
52
  },
53
53
  "scripts": {
54
54
  "clean": "rm -rf ./dist",