cekat-ui 1.3.8 → 1.3.10

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.d.mts CHANGED
@@ -4,14 +4,21 @@ import { CellProps as CellProps_2 } from 'react-aria-components';
4
4
  import { ClassValue } from 'clsx';
5
5
  import { ColumnProps as ColumnProps_2 } from 'react-aria-components';
6
6
  import { ColumnResizerProps as ColumnResizerProps_2 } from 'react-aria-components';
7
+ import { ComboBoxProps as ComboBoxProps_2 } from 'react-aria-components';
7
8
  import { default as default_2 } from 'react';
9
+ import { DialogProps } from 'react-aria-components';
10
+ import { GroupProps } from 'react-aria-components';
11
+ import { InputProps as InputProps_2 } from 'react-aria-components';
8
12
  import { JSX as JSX_2 } from 'react/jsx-runtime';
9
13
  import { Key } from 'react-aria-components';
14
+ import { LinkProps as LinkProps_2 } from 'react-aria-components';
15
+ import { LinkRenderProps } from 'react-aria-components';
10
16
  import { ListBoxItemProps as ListBoxItemProps_2 } from 'react-aria-components';
11
17
  import { ListBoxProps as ListBoxProps_2 } from 'react-aria-components';
12
18
  import { MenuItemProps as MenuItemProps_2 } from 'react-aria-components';
13
19
  import { MenuProps as MenuProps_2 } from 'react-aria-components';
14
20
  import { MenuTrigger } from 'react-aria-components';
21
+ import { ModalOverlayProps } from 'react-aria-components';
15
22
  import { PopoverProps as PopoverProps_2 } from 'react-aria-components';
16
23
  import { PressEvent } from 'react-aria-components';
17
24
  import * as React_2 from 'react';
@@ -235,6 +242,71 @@ export declare type BadgeSize = 'sm' | 'md' | 'lg';
235
242
 
236
243
  export declare type BadgeVariant = 'solid' | 'outline';
237
244
 
245
+ /**
246
+ * Wraps RAC's `<Breadcrumb>` (an `<li>`). RAC computes `isCurrent` from the item's position
247
+ * in the collection — the last item gets it — so the trailing separator is suppressed
248
+ * automatically instead of the caller having to know which crumb is last.
249
+ */
250
+ export declare const Breadcrumb: {
251
+ ({ className, children }: BreadcrumbProps): JSX_2.Element;
252
+ displayName: string;
253
+ };
254
+
255
+ /**
256
+ * Composes `Link`. `variant`/`size` fall back to the parent `Breadcrumbs`' values via
257
+ * context so callers don't repeat them on every crumb, but either can still be overridden
258
+ * per item. `href` should be omitted on the current (last) crumb — RAC's `Breadcrumb`
259
+ * already forces it non-interactive via context, but leaving `href` off keeps the rendered
260
+ * element a `<span>` rather than a disabled `<a>`.
261
+ */
262
+ export declare const BreadcrumbLink: {
263
+ ({ variant, size, icon, children, ...props }: BreadcrumbLinkProps): JSX_2.Element;
264
+ displayName: string;
265
+ };
266
+
267
+ export declare interface BreadcrumbLinkProps extends Omit<LinkProps, 'children'> {
268
+ icon?: React_2.ReactNode;
269
+ children?: React_2.ReactNode;
270
+ }
271
+
272
+ export declare interface BreadcrumbProps {
273
+ className?: string;
274
+ children: React_2.ReactNode;
275
+ }
276
+
277
+ /**
278
+ * RAC's `<Breadcrumbs>` renders only the `<ol>` — no `<nav>` landmark, so no accessible
279
+ * name without this wrapper. `variant`/`size`/`separator` cascade to every `Breadcrumb`
280
+ * child through context rather than being repeated per item.
281
+ */
282
+ export declare const Breadcrumbs: {
283
+ ({ "aria-label": ariaLabel, separator, variant, size, isDisabled, className, children, }: BreadcrumbsProps): JSX_2.Element;
284
+ displayName: string;
285
+ };
286
+
287
+ /** Decorative only — `aria-hidden` keeps it out of the accessible name and tab order. */
288
+ export declare const BreadcrumbSeparator: {
289
+ ({ type, className }: BreadcrumbSeparatorProps): JSX_2.Element;
290
+ displayName: string;
291
+ };
292
+
293
+ export declare interface BreadcrumbSeparatorProps {
294
+ type?: BreadcrumbSeparatorType;
295
+ className?: string;
296
+ }
297
+
298
+ export declare type BreadcrumbSeparatorType = 'chevron' | 'slash';
299
+
300
+ export declare interface BreadcrumbsProps {
301
+ 'aria-label'?: string;
302
+ separator?: BreadcrumbSeparatorType;
303
+ variant?: LinkVariant;
304
+ size?: LinkSize;
305
+ isDisabled?: boolean;
306
+ className?: string;
307
+ children: React_2.ReactNode;
308
+ }
309
+
238
310
  export declare const Button: ButtonCompound;
239
311
 
240
312
  /** `ForwardRefExoticComponent` rather than `FC`: the base forwards a ref to its `<button>`. */
@@ -352,6 +424,92 @@ export declare const ColumnResizer: React_2.ForwardRefExoticComponent<ColumnResi
352
424
  export declare interface ColumnResizerProps extends ColumnResizerProps_2 {
353
425
  }
354
426
 
427
+ export declare const ComboBox: <T extends object, M extends ComboBoxSelectionMode = "single">(props: ComboBoxProps<T, M> & {
428
+ ref?: React_2.Ref<HTMLDivElement>;
429
+ }) => React_2.ReactElement;
430
+
431
+ export declare const ComboBoxInput: React_2.ForwardRefExoticComponent<ComboBoxInputProps & React_2.RefAttributes<HTMLInputElement>>;
432
+
433
+ export declare interface ComboBoxInputProps extends Omit<InputProps_2, 'className' | 'style'> {
434
+ className?: ClassValue;
435
+ style?: React_2.CSSProperties;
436
+ }
437
+
438
+ /**
439
+ * `ListBoxItem` with the same provisional selected-row treatment as `Select`'s `SelectItem` —
440
+ * see `selectItemSelectedStyles` for why it's provisional. Reused directly rather than
441
+ * re-declared, same as `Menu` does for its own items.
442
+ */
443
+ export declare function ComboBoxItem<T extends object>({ className, ...props }: ListBoxItemProps<T>): JSX_2.Element;
444
+
445
+ export declare interface ComboBoxProps<T extends object, M extends ComboBoxSelectionMode = 'single'> extends Omit<ComboBoxProps_2<T, M>, 'className' | 'style' | 'children'> {
446
+ children: ComboBoxProps_2<T, M>['children'];
447
+ className?: ClassValue;
448
+ style?: React_2.CSSProperties;
449
+ }
450
+
451
+ /**
452
+ * `'single' | 'multiple'` — unlike `Select` (single-value by construction), `ComboBox`
453
+ * genuinely supports both: multi-selection with removable tags is this component's job,
454
+ * not `Select`'s.
455
+ */
456
+ export declare type ComboBoxSelectionMode = 'single' | 'multiple';
457
+
458
+ export declare type ComboBoxSize = 'xs' | 'sm' | 'md';
459
+
460
+ /**
461
+ * Renders one chip per selected item, via a render-prop rather than owning `Tag` rendering
462
+ * itself — reuses the existing `Tag` component rather than re-declaring chip styling, and
463
+ * `Tag`'s own color/size/icon surface is a styling decision that belongs to the consumer, not
464
+ * this component. Reads
465
+ * `ComboBoxStateContext` directly (same context `ComboBoxValue` uses internally) rather than
466
+ * threading `selectedItems` through props.
467
+ *
468
+ * Wrapped in `comboBoxTagsRowStyles` (single row, horizontal scroll, no visible scrollbar) so
469
+ * every consumer gets Figma's fixed-height, non-wrapping `Tags` layout by construction, rather
470
+ * than each call site having to remember to wrap it correctly.
471
+ */
472
+ export declare const ComboBoxTags: ({ children }: ComboBoxTagsProps) => JSX_2.Element | null;
473
+
474
+ export declare interface ComboBoxTagsProps {
475
+ /** Rendered per selected item; must call the given `onRemove` from a close affordance. */
476
+ children: (item: {
477
+ key: React_2.Key;
478
+ textValue: string;
479
+ onRemove: () => void;
480
+ }) => React_2.ReactNode;
481
+ }
482
+
483
+ /**
484
+ * Wraps RAC's `Group`, not a `Button` — the trigger holds the leading icon, the text input, and
485
+ * any tag chips (`ComboBoxTags`) as siblings.
486
+ *
487
+ * No trailing chevron/toggle button — Figma's `Type=Search`/`Type=Tags` nodes (81:15162,
488
+ * 81:15174) never render one; the leading search icon alone signals the field is searchable.
489
+ * `icon` stays optional at the type level (not required) even though omitting it removes the
490
+ * only visual affordance a trigger has once the chevron is gone — that's a deliberate usage
491
+ * note, not something enforced here. Consumers rendering `ComboBoxTrigger` without an `icon`
492
+ * get a field that looks like a plain text input; pass one.
493
+ *
494
+ * Clicking anywhere in the field — the icon, the padding, blank space next to the tags —
495
+ * focuses the input, the same way clicking anywhere in a native bordered text field does.
496
+ * `Group` gets no such behavior for free (it's a plain `<div role="group">`; only the `<input>`
497
+ * itself is focusable), so this was a real gap, not a style-only wrapper: without it, everything
498
+ * outside the input's own hit area is dead space that looks clickable and isn't. Only clicks
499
+ * that don't already land on a real control (the input, a tag's remove button) redirect focus —
500
+ * `closest('button, input')` is the check — so this never steals a click already meant for one
501
+ * of those.
502
+ */
503
+ export declare const ComboBoxTrigger: React_2.ForwardRefExoticComponent<ComboBoxTriggerProps & React_2.RefAttributes<HTMLDivElement>>;
504
+
505
+ export declare interface ComboBoxTriggerProps extends Omit<GroupProps, 'className' | 'style' | 'children' | 'role'> {
506
+ size?: ComboBoxSize;
507
+ /** Leading ornament slot — same as `Select`'s: icon, `Avatar`, or a status dot. */
508
+ icon?: React_2.ReactNode;
509
+ children: React_2.ReactNode;
510
+ className?: ClassValue;
511
+ }
512
+
355
513
  /**
356
514
  * Standalone, not table-scoped — search results and filtered lists need it
357
515
  * too. Structure follows the shipped "No Data Found" design (Figma
@@ -502,6 +660,29 @@ declare interface InputTrailingButtonSlot {
502
660
  disabled?: boolean;
503
661
  }
504
662
 
663
+ /**
664
+ * Built on react-aria-components' `<Link>`. Renders `<a href>` when `href` is passed and
665
+ * `<span>` otherwise — RAC's own fallback, not something this wrapper decides — so a
666
+ * `Link` used for the current page of a breadcrumb trail stays out of tab order without an
667
+ * `isDisabled` prop.
668
+ */
669
+ export declare const Link: React_2.ForwardRefExoticComponent<LinkProps & React_2.RefAttributes<HTMLAnchorElement>>;
670
+
671
+ export declare interface LinkProps extends Omit<LinkProps_2, 'className'> {
672
+ variant?: LinkVariant;
673
+ size?: LinkSize;
674
+ underline?: LinkUnderline;
675
+ className?: string;
676
+ }
677
+
678
+ export { LinkRenderProps }
679
+
680
+ export declare type LinkSize = 'xs' | 'sm' | 'md';
681
+
682
+ export declare type LinkUnderline = 'none' | 'hover' | 'always';
683
+
684
+ export declare type LinkVariant = 'text' | 'ghost' | 'ghost-primary';
685
+
505
686
  export declare const ListBox: <T extends object>(props: ListBoxProps<T> & {
506
687
  ref?: React_2.Ref<HTMLDivElement>;
507
688
  }) => React_2.ReactElement;
@@ -539,6 +720,21 @@ export declare interface ListBoxSeparatorProps {
539
720
  className?: string;
540
721
  }
541
722
 
723
+ /**
724
+ * Built on react-aria-components' `<ProgressBar>` (`isIndeterminate`) for the accessible
725
+ * progress-widget semantics (`role="progressbar"`, `aria-valuetext`, label wiring via
726
+ * `useProgressBar`). Visual variants stay Cekat's (`size` / `style` / `supportingText`).
727
+ *
728
+ * `role="progressbar"` is a widget role, not a live region — unlike the plain
729
+ * `role="status"` div this replaced, it does not auto-announce to screen readers on mount by
730
+ * itself. An outer `aria-live="polite"` / `aria-atomic="true"` wrapper restores that
731
+ * announce-on-mount behavior. It has to be a *separate* wrapping element, not props spread
732
+ * onto `<ProgressBar>` directly: react-aria's `useProgressBar` runs every prop through
733
+ * `filterDOMProps({ labelable: true })` internally, which only allow-lists
734
+ * `aria-label`/`aria-labelledby`/`aria-describedby`/`aria-details` — `aria-live` and
735
+ * `aria-atomic` are silently stripped before they reach the DOM if passed directly (confirmed
736
+ * via a failing interaction test before this wrapper was added; see Loading.stories.tsx).
737
+ */
542
738
  export declare const Loading: {
543
739
  ({ size, style, supportingText, label, className, }: LoadingProps): JSX_2.Element;
544
740
  displayName: string;
@@ -611,32 +807,148 @@ export declare interface MenuSeparatorProps {
611
807
 
612
808
  export { MenuTrigger }
613
809
 
614
- export declare function MultiSelectInput({ size, label, required, hint, error, disabled, placeholder, rightIcon, className, wrapperClassName, options, value, onChange, }: MultiSelectInputProps): JSX_2.Element;
810
+ export declare const Modal: ModalCompound;
615
811
 
616
- declare interface MultiSelectInputProps {
617
- size?: 'sm' | 'md';
618
- label?: string;
619
- required?: boolean;
620
- hint?: string;
621
- error?: boolean;
622
- disabled?: boolean;
623
- placeholder?: string;
624
- rightIcon?: default_2.ReactNode;
812
+ export declare interface ModalBodyProps {
813
+ children?: React_2.ReactNode;
625
814
  className?: ClassValue;
626
- wrapperClassName?: ClassValue;
627
- options: MultiSelectOption[];
628
- value?: MultiSelectOption[];
629
- onChange?: (value: MultiSelectOption[]) => void;
630
815
  }
631
816
 
632
- declare interface MultiSelectOption {
633
- id: string;
634
- label: string;
635
- avatar?: string;
817
+ /** `ForwardRefExoticComponent` rather than `FC`: the base forwards a ref to RAC's `Modal`. */
818
+ export declare type ModalCompound = React_2.ForwardRefExoticComponent<ModalProps & React_2.RefAttributes<HTMLDivElement>> & {
819
+ Header: React_2.FC<ModalHeaderProps>;
820
+ Body: React_2.FC<ModalBodyProps>;
821
+ ImagePanel: React_2.FC<ModalImagePanelProps>;
822
+ Footer: React_2.FC<ModalFooterProps>;
823
+ };
824
+
825
+ export declare type ModalFooterLayout = 'horizontal-fill' | 'horizontal' | 'vertical-fill' | 'right-aligned' | 'right-aligned-checkbox' | 'wizard-navigation' | 'single-cta';
826
+
827
+ export declare interface ModalFooterProps {
828
+ /** Default `horizontal-fill`, matching Figma's documented default. */
829
+ layout?: ModalFooterLayout;
830
+ /** Reddens the primary action (Confirm/Delete/Next) for irreversible operations. Default `false`. */
831
+ destructive?: boolean;
832
+ /** Disables every button in the footer — matches the single `busy` flag every current dashboard confirm dialog already uses for its Cancel+Confirm pair. Default `false`. */
833
+ isPending?: boolean;
834
+ /** Not used by `single-cta`. */
835
+ cancelLabel?: string;
836
+ onCancel?: () => void;
837
+ /** The primary action's label — "Next" for `wizard-navigation`, "Confirm"/"Delete" elsewhere. Every layout has one. */
838
+ confirmLabel: string;
839
+ onConfirm: () => void;
840
+ isConfirmDisabled?: boolean;
841
+ /** `wizard-navigation` only. Default `'Back'`. */
842
+ backLabel?: string;
843
+ /** `wizard-navigation` only. */
844
+ onBack?: () => void;
845
+ /** `right-aligned-checkbox` only — consumer-supplied, e.g. cekat-ui's own `Checkbox` alongside its own label markup (`Checkbox` itself has no built-in label). */
846
+ checkbox?: React_2.ReactNode;
847
+ className?: ClassValue;
848
+ }
849
+
850
+ export declare interface ModalHeaderProps {
851
+ title: React_2.ReactNode;
852
+ subtitle?: React_2.ReactNode;
853
+ icon?: React_2.ReactNode;
854
+ className?: ClassValue;
855
+ }
856
+
857
+ export declare interface ModalImagePanelProps {
858
+ children?: React_2.ReactNode;
859
+ className?: ClassValue;
860
+ }
861
+
862
+ export declare interface ModalProps extends Omit<ModalOverlayProps, 'className' | 'style' | 'children'> {
863
+ children?: DialogProps['children'];
864
+ /** Content-area width. Figma foundation: sm 500px · md 640px · lg 800px. Default `sm`. */
865
+ size?: ModalSize;
866
+ /**
867
+ * The standalone top-right dismiss button Figma's foundation `Modal Shell` renders on the
868
+ * card itself, regardless of whether a `Modal.Header` is present. Default `true`.
869
+ */
870
+ showCloseButton?: boolean;
871
+ /**
872
+ * Optional left-side image area — pass a `Modal.ImagePanel`. Widens the card beyond `size`'s
873
+ * content-area width, matching Figma's `Show Image Panel` toggle (the three per-size
874
+ * `Image Placeholder` slots in the design file are a Figma-variant artifact of the same single
875
+ * slot, not three independent props — collapsed here into one).
876
+ */
877
+ imagePanel?: React_2.ReactNode;
878
+ 'aria-label'?: string;
879
+ 'aria-labelledby'?: string;
880
+ /**
881
+ * Applied to the content area — the whole card when `imagePanel` isn't used, otherwise just
882
+ * the left column beside it. Overrides `size`'s default width.
883
+ */
884
+ className?: ClassValue;
885
+ style?: React_2.CSSProperties;
636
886
  }
637
887
 
888
+ export declare type ModalSize = 'sm' | 'md' | 'lg';
889
+
638
890
  declare type NativeButtonProps = Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'className' | 'style'>;
639
891
 
892
+ /**
893
+ * Notification-card toast — Figma `ToastV2` (`node-id=1652-1892`). Presentation-only, same
894
+ * as the pill `Toast`: render it through whatever engine owns positioning/stacking/dismissal
895
+ * (`sonner`'s `toast.custom()` in this codebase). Not built on React Aria — no matching RAC
896
+ * primitive, `sonner` already owns the interaction/timing behavior this would otherwise need
897
+ * RAC for (same reasoning as `Toast` and `Alert`).
898
+ *
899
+ * `type` collapses Figma's 18 desktop/mobile permutations into 9 — no `breakpoint` prop. See
900
+ * `~/Desktop/cekat-ds-audit/RFC-alert-toast-component.md` §8 for why.
901
+ */
902
+ export declare const NotificationToast: {
903
+ ({ type, title, supportingText, primaryAction, secondaryAction, onClose, closeLabel, icon, avatarSrc, avatarAlt, timestamp, imageSrc, imageAlt, progressValue, progressLabel, className, }: NotificationToastProps): JSX_2.Element;
904
+ displayName: string;
905
+ };
906
+
907
+ export declare interface NotificationToastAction {
908
+ label: React_2.ReactNode;
909
+ onClick?: () => void;
910
+ }
911
+
912
+ export declare interface NotificationToastProps {
913
+ type: NotificationToastType;
914
+ title: React_2.ReactNode;
915
+ /** Supporting text under the title. Presence-implies-render, same as `Alert`'s `description`. */
916
+ supportingText?: React_2.ReactNode;
917
+ /** Emphasised action, e.g. "View changes" / "Upload another". Rendered as a text link. */
918
+ primaryAction?: NotificationToastAction;
919
+ /** Low-emphasis action, e.g. "Dismiss" / "Cancel". Rendered as a text link. */
920
+ secondaryAction?: NotificationToastAction;
921
+ /** Renders the close (X) button when provided. */
922
+ onClose?: () => void;
923
+ closeLabel?: string;
924
+ /** `type: "gray-icon"` requires a caller-supplied icon — Figma's example glyph
925
+ * (`brand-codesandbox`) is an arbitrary product icon, not a fixed semantic default. */
926
+ icon?: React_2.ReactNode;
927
+ /** `type: "avatar"` only. */
928
+ avatarSrc?: string;
929
+ avatarAlt?: string;
930
+ /** e.g. "2 mins ago". */
931
+ timestamp?: React_2.ReactNode;
932
+ /** `type: "image"` only. */
933
+ imageSrc?: string;
934
+ imageAlt?: string;
935
+ /** `type: "progress"` only. */
936
+ progressValue?: number;
937
+ /** e.g. "60% uploaded...". */
938
+ progressLabel?: React_2.ReactNode;
939
+ className?: string;
940
+ }
941
+
942
+ /**
943
+ * Figma `ToastV2` component set (`node-id=1652-1892`) collapsed from 18 desktop/mobile
944
+ * permutations down to 9 — no `breakpoint` prop. 8 of 9 types are a pure CSS reflow between
945
+ * breakpoints (icon/badge + title + supporting text + actions, same tree, narrower width);
946
+ * `image` has the largest delta (strip on the left vs. on top) but is still handled with
947
+ * `sm:` responsive classes, not a second variant. See
948
+ * `~/Desktop/cekat-ds-audit/RFC-alert-toast-component.md` §8 for the full reasoning.
949
+ */
950
+ export declare type NotificationToastType = 'primary-icon' | 'gray-icon' | 'progress' | 'avatar' | 'image' | 'success' | 'warning' | 'error' | 'no-icon';
951
+
640
952
  export declare function PhoneInput({ size, label, required, hint, error, disabled, placeholder, rightIcon, value, onChange, className, wrapperClassName, }: PhoneInputProps): JSX_2.Element;
641
953
 
642
954
  declare interface PhoneInputProps {
@@ -1095,6 +1407,33 @@ export declare interface TextareaProps extends Omit<React_2.TextareaHTMLAttribut
1095
1407
  wrapperClassName?: ClassValue;
1096
1408
  }
1097
1409
 
1410
+ /**
1411
+ * Presentation-only pill toast, matching Figma's `ToastV1` anatomy (icon badge + bold
1412
+ * lead-in + message, optional close). Not a toast engine — render it through whatever
1413
+ * toast library owns positioning/stacking/auto-dismiss (`sonner`'s `toast.custom()` in
1414
+ * this codebase, the same way `cekat-dashboard`'s `CekatToast` is used today via
1415
+ * `utils/showMessage.ts`). See `docs`/`RFC-alert-toast-component.md` in the audit folder
1416
+ * for why the richer 9-type `ToastV2` notification-card family is out of scope here.
1417
+ */
1418
+ export declare const Toast: {
1419
+ ({ variant, message, title, onClose, closeLabel, className, }: ToastProps): JSX_2.Element;
1420
+ displayName: string;
1421
+ };
1422
+
1423
+ export declare interface ToastProps {
1424
+ variant: ToastVariant;
1425
+ /** Message text after the bold lead-in. */
1426
+ message: React_2.ReactNode;
1427
+ /** Overrides the variant's default bold lead-in (e.g. "Success!"). */
1428
+ title?: React_2.ReactNode;
1429
+ /** Renders the small circular close badge when provided. */
1430
+ onClose?: () => void;
1431
+ closeLabel?: string;
1432
+ className?: string;
1433
+ }
1434
+
1435
+ export declare type ToastVariant = 'success' | 'error' | 'warning' | 'info';
1436
+
1098
1437
  export declare const Toggle: React_2.ForwardRefExoticComponent<ToggleProps & React_2.RefAttributes<HTMLButtonElement>>;
1099
1438
 
1100
1439
  export declare interface ToggleProps extends Omit<React_2.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {