cekat-ui 1.2.6 → 1.2.7

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.
@@ -4,6 +4,8 @@ export interface AvatarGroupItem {
4
4
  src?: string;
5
5
  alt?: string;
6
6
  initials?: React.ReactNode;
7
+ /** Tooltip content shown on hover. */
8
+ label?: React.ReactNode;
7
9
  }
8
10
  export interface AvatarGroupProps {
9
11
  avatars: AvatarGroupItem[];
@@ -1,6 +1,13 @@
1
1
  import { TabProps } from './tab.types';
2
+ /**
3
+ * Renders on react-aria-components' `<Tab>`, so it only works inside a `TabList` (which
4
+ * supplies the `<Tabs>` context). `active`/`onClick` stay the public API — `TabList` reads
5
+ * `active` off each child to derive RAC's `selectedKey`, and reaches back into `onClick` when
6
+ * a press or arrow-key navigation changes the selection — so callers keep driving state
7
+ * exactly as before and get roving-tabindex keyboard nav for free.
8
+ */
2
9
  declare const Tab: {
3
- ({ children, variant, size, active, fullWidth, count, disabled, onClick, className, }: TabProps): import("react/jsx-runtime").JSX.Element;
10
+ ({ children, variant, size, fullWidth, count, iconLeft, iconRight, disabled, onClick, className, id, active: _active, }: TabProps): import("react/jsx-runtime").JSX.Element;
4
11
  displayName: string;
5
12
  };
6
13
  export default Tab;
@@ -1,6 +1,14 @@
1
1
  import { TabListProps } from './tab.types';
2
+ /**
3
+ * Backed by react-aria-components' `<Tabs>` for roving-tabindex arrow-key navigation and
4
+ * focus management. Selection still lives with the caller: each `Tab` child's own
5
+ * `active`/`onClick` stay the source of truth — this derives RAC's `selectedKey` from
6
+ * whichever child is `active`, and reaches back into that child's `onClick` when RAC changes
7
+ * the selection (arrow keys, click, or press), so the caller's state — and therefore
8
+ * `selectedKey` on the next render — stays in sync.
9
+ */
2
10
  declare const TabList: {
3
- ({ children, variant, orientation, boxed, className, }: TabListProps): import("react/jsx-runtime").JSX.Element;
11
+ ({ children, variant, orientation, boxed, "aria-label": ariaLabel, keyboardActivation, disabledKeys, className, }: TabListProps): import("react/jsx-runtime").JSX.Element;
4
12
  displayName: string;
5
13
  };
6
14
  export default TabList;
@@ -1,24 +1,46 @@
1
+ import { Key } from 'react-aria-components';
1
2
  import * as React from 'react';
2
3
  export type TabVariant = 'button-gray' | 'button-white' | 'button-primary' | 'underline' | 'underline-filled' | 'line';
3
4
  export type TabSize = 'sm' | 'md';
4
5
  export interface TabProps {
6
+ /** Tab label content. */
5
7
  children: React.ReactNode;
8
+ /** Visual style; should match the parent TabList's variant. */
6
9
  variant?: TabVariant;
7
10
  size?: TabSize;
11
+ /** Whether this tab is the current selection. */
8
12
  active?: boolean;
13
+ /** Stretches the tab to fill available row width. */
9
14
  fullWidth?: boolean;
15
+ /** Count badge rendered after the label. */
10
16
  count?: number | string;
17
+ /** Icon rendered before the label. */
18
+ iconLeft?: React.ReactNode;
19
+ /** Icon rendered after the badge, e.g. a chevron. */
20
+ iconRight?: React.ReactNode;
21
+ /** Removes the tab from RAC's keyboard/selection order. */
11
22
  disabled?: boolean;
23
+ /** Fires on select, including via keyboard navigation. */
12
24
  onClick?: () => void;
13
25
  className?: string;
26
+ /** Set internally by `TabList` to key the tab for RAC's roving-tabindex selection. */
27
+ id?: string;
14
28
  }
15
29
  export type TabListOrientation = 'horizontal' | 'vertical';
16
30
  export interface TabListProps {
31
+ /** `Tab` elements to render; selection is read from each child's `active` prop. */
17
32
  children: React.ReactNode;
18
33
  /** Controls the default gap and whether a bottom hairline is drawn under the row. */
19
34
  variant?: TabVariant;
35
+ /** Arrow-key axis: horizontal moves with Left/Right, vertical with Up/Down. */
20
36
  orientation?: TabListOrientation;
21
37
  /** Wraps the tabs in a padded gray card (used by the "boxed" button-tab treatments). */
22
38
  boxed?: boolean;
39
+ /** Accessible name for the tab row, read by screen readers. */
40
+ 'aria-label'?: string;
41
+ /** Whether arrow-key focus also selects ("automatic", RAC's default) or only Enter/Space does ("manual"). */
42
+ keyboardActivation?: 'automatic' | 'manual';
43
+ /** Keys of `Tab` children (their index as a string) to remove from selection and keyboard navigation. */
44
+ disabledKeys?: Iterable<Key>;
23
45
  className?: string;
24
46
  }