@bizapps/design-system-testing 1.0.10 → 1.6.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/main.d.ts CHANGED
@@ -2,18 +2,22 @@ import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, ComponentProps, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes } from 'react';
3
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
4
4
  import { VariantProps } from 'class-variance-authority';
5
- import { Avatar as Avatar$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Select as Select$1, Separator as Separator$1, Progress as Progress$1, Slider as Slider$1, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1, Popover as Popover$1, Dialog as Dialog$1, AlertDialog as AlertDialog$1, Accordion as Accordion$1, DropdownMenu as DropdownMenu$1, RadioGroup as RadioGroup$1, NavigationMenu as NavigationMenu$1, Checkbox as Checkbox$1 } from 'radix-ui';
6
- import { DayPicker, DayButton, Locale, DateRange } from 'react-day-picker';
7
- export { DateRange } from 'react-day-picker';
5
+ import { Avatar as Avatar$1, Label as Label$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Select as Select$1, Separator as Separator$1, Progress as Progress$1, Slider as Slider$1, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1, Popover as Popover$1, Dialog as Dialog$1, AlertDialog as AlertDialog$1, Accordion as Accordion$1, DropdownMenu as DropdownMenu$1, RadioGroup as RadioGroup$1, NavigationMenu as NavigationMenu$1, Checkbox as Checkbox$1 } from 'radix-ui';
8
6
  import useEmblaCarousel, { UseEmblaCarouselType } from 'embla-carousel-react';
7
+ import { PhoneFieldValidity } from './phone.js';
8
+ export { PhoneFieldProblem, validatePhone } from './phone.js';
9
9
  import { DropzoneOptions, FileRejection, DropEvent } from 'react-dropzone';
10
10
  import Color from 'color';
11
+ import { DateRange } from 'react-day-picker';
12
+ export { DateRange } from 'react-day-picker';
11
13
  import * as react_hook_form from 'react-hook-form';
12
14
  import { UseFormProps, FieldValues } from 'react-hook-form';
13
15
  export { Controller, useFieldArray } from 'react-hook-form';
14
16
  import { ZodType, z } from 'zod';
15
17
  import { ColumnDef, SortingState, ColumnFiltersState, Row, RowSelectionState, Table as Table$1, VisibilityState, ColumnSizingState, Header, Updater, Column } from '@tanstack/react-table';
16
18
  export { Column, ColumnDef, ColumnFiltersState, Row, SortingState, Table as TanStackTableType, createColumnHelper } from '@tanstack/react-table';
19
+ import { P as Permission } from './policy-DPpMNLiO.js';
20
+ export { K as KNOWN_PERMISSIONS, a as KnownPermission, m as matchPermission } from './policy-DPpMNLiO.js';
17
21
 
18
22
  declare const alertVariants: (props?: ({
19
23
  variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
@@ -117,15 +121,6 @@ declare function Button$1({ className, variant, size, asChild, isLoading, childr
117
121
  isLoading?: boolean;
118
122
  }): react.JSX.Element;
119
123
 
120
- declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, fromYear, toYear, ...props }: ComponentProps<typeof DayPicker> & {
121
- buttonVariant?: ComponentProps<typeof Button$1>['variant'];
122
- fromYear?: number;
123
- toYear?: number;
124
- }): react.JSX.Element;
125
- declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: ComponentProps<typeof DayButton> & {
126
- locale?: Partial<Locale>;
127
- }): react.JSX.Element;
128
-
129
124
  type MiniCalendarProps = HTMLAttributes<HTMLDivElement> & {
130
125
  value?: Date;
131
126
  defaultValue?: Date;
@@ -214,6 +209,8 @@ declare function FieldGroup({ className, ...props }: ComponentProps<'div'>): rea
214
209
 
215
210
  declare function Input({ className, type, ...props }: ComponentProps<'input'>): react.JSX.Element;
216
211
 
212
+ declare function Label({ className, ...props }: ComponentProps<typeof Label$1.Root>): react.JSX.Element;
213
+
217
214
  declare const linkVariants: (props?: ({
218
215
  variant?: "underlined" | "plain" | null | undefined;
219
216
  size?: "sm" | "md" | "lg" | "xs" | null | undefined;
@@ -225,6 +222,55 @@ declare function Link({ className, variant, size, asChild, disabled, target, rel
225
222
  onClick?: MouseEventHandler<HTMLElement>;
226
223
  }): react.JSX.Element;
227
224
 
225
+ interface PhoneFieldCountry {
226
+ /** ISO 3166-1 alpha-2 code, e.g. "CO". */
227
+ code: string;
228
+ /** Country name, e.g. "Colombia". */
229
+ name: string;
230
+ /** International dial code, e.g. "+57". */
231
+ dialCode: string;
232
+ /** Optional override for the flag. When omitted the flag is derived from `code` via country-flag-icons. */
233
+ flagUrl?: string;
234
+ }
235
+ interface PhoneFieldProps extends Omit<ComponentProps<'input'>, 'value' | 'defaultValue' | 'onChange' | 'type' | 'disabled' | 'placeholder' | 'className'> {
236
+ /** Country list. Data-agnostic — the source of truth is the consumer's backend. */
237
+ countries: PhoneFieldCountry[];
238
+ /**
239
+ * Controlled E.164 value, e.g. "+573001234567" or "". Omit `value` to run
240
+ * uncontrolled — the field manages its own value and `onValueChange` still
241
+ * fires on every change.
242
+ */
243
+ value?: string;
244
+ /** Emits the E.164 form whenever the national number changes; emits "" when empty. */
245
+ onValueChange?: (value: string) => void;
246
+ /**
247
+ * Emits whether the current value is a valid number, and why it is not when
248
+ * it fails. Fires on mount and on every change of the verdict — including
249
+ * changes caused by picking another country, which do not always change the
250
+ * value. It emits STATE, never copy: the message belongs to the consumer's
251
+ * i18n catalog. For the same rule outside React (Zod schema, route handler)
252
+ * import `validatePhone` from `@bizapps/design-system-testing/phone`.
253
+ */
254
+ onValidityChange?: (validity: PhoneFieldValidity) => void;
255
+ /** ISO code preselected when `value` is empty, e.g. "CO". Falls back to the first country. */
256
+ defaultCountry?: string;
257
+ /** Placeholder for the number input. */
258
+ placeholder?: string;
259
+ disabled?: boolean;
260
+ className?: string;
261
+ /** Portal target for the dropdown. Pass the Dialog content node when used inside a modal Dialog. */
262
+ container?: HTMLElement | null;
263
+ /**
264
+ * Form field name for native form submits. The visible input shows the
265
+ * FORMATTED national number (e.g. "300 123 4567"); when `name` is set, a
266
+ * hidden input carries the canonical E.164 value so the browser submits
267
+ * the machine-readable form. For react-hook-form, drive the field via
268
+ * `value`/`onValueChange` (controlled component) instead of `name`.
269
+ */
270
+ name?: string;
271
+ }
272
+ declare function PhoneField({ countries, value, onValueChange, onValidityChange, defaultCountry, placeholder, disabled, className, container, name, ...inputProps }: PhoneFieldProps): react.JSX.Element;
273
+
228
274
  interface PinInputProps {
229
275
  length?: number;
230
276
  value?: string;
@@ -265,7 +311,16 @@ declare function SegmentedControlItem({ className, children, value, ...props }:
265
311
 
266
312
  declare function Select({ ...props }: ComponentProps<typeof Select$1.Root>): react.JSX.Element;
267
313
  declare function SelectTrigger$1({ className, children, ...props }: ComponentProps<typeof Select$1.Trigger>): react.JSX.Element;
268
- declare function SelectContent({ className, children, position, ...props }: ComponentProps<typeof Select$1.Content>): react.JSX.Element;
314
+ type SelectContentProps = ComponentProps<typeof Select$1.Content> & {
315
+ /**
316
+ * Maximum height of the dropdown panel. Accepts any CSS length
317
+ * (e.g. `240px`, `15rem`) or a number interpreted as pixels.
318
+ * The panel is always additionally capped by the space available
319
+ * on screen, and its list scrolls once the content exceeds it.
320
+ */
321
+ maxHeight?: number | string;
322
+ };
323
+ declare function SelectContent({ className, children, position, maxHeight, style, ...props }: SelectContentProps): react.JSX.Element;
269
324
  declare function SelectItem({ className, children, ...props }: ComponentProps<typeof Select$1.Item>): react.JSX.Element;
270
325
  declare function SelectLabel({ className, ...props }: ComponentProps<typeof Select$1.Label>): react.JSX.Element;
271
326
  declare function SelectSeparator({ className, ...props }: ComponentProps<typeof Select$1.Separator>): react.JSX.Element;
@@ -277,11 +332,11 @@ declare function SelectGroup({ ...props }: ComponentProps<typeof Select$1.Group>
277
332
  declare function Separator({ className, orientation, decorative, ...props }: ComponentProps<typeof Separator$1.Root>): react.JSX.Element;
278
333
 
279
334
  declare const progressVariants: (props?: ({
280
- variant?: "default" | "success" | "warning" | "danger" | "orange" | null | undefined;
335
+ variant?: "default" | "success" | "warning" | "orange" | "danger" | null | undefined;
281
336
  size?: "sm" | "md" | "lg" | null | undefined;
282
337
  } & class_variance_authority_types.ClassProp) | undefined) => string;
283
338
  declare const progressIndicatorVariants: (props?: ({
284
- variant?: "default" | "success" | "warning" | "danger" | "orange" | null | undefined;
339
+ variant?: "default" | "success" | "warning" | "orange" | "danger" | null | undefined;
285
340
  } & class_variance_authority_types.ClassProp) | undefined) => string;
286
341
  interface ProgressProps extends ComponentProps<typeof Progress$1.Root>, VariantProps<typeof progressVariants> {
287
342
  }
@@ -360,7 +415,14 @@ declare function TooltipContent({ className, sideOffset, variant, size, children
360
415
 
361
416
  declare function Popover({ ...props }: ComponentProps<typeof Popover$1.Root>): react.JSX.Element;
362
417
  declare function PopoverTrigger({ ...props }: ComponentProps<typeof Popover$1.Trigger>): react.JSX.Element;
363
- declare function PopoverContent({ className, align, sideOffset, ...props }: ComponentProps<typeof Popover$1.Content>): react.JSX.Element;
418
+ declare function PopoverContent({ className, align, sideOffset, container, ...props }: ComponentProps<typeof Popover$1.Content> & {
419
+ /**
420
+ * Portal target for the popover content. Pass the Dialog content node when
421
+ * the popover lives inside a modal Dialog so the content stays within the
422
+ * Dialog's scroll-lock shard — otherwise wheel/touch scrolling is blocked.
423
+ */
424
+ container?: ComponentProps<typeof Popover$1.Portal>['container'];
425
+ }): react.JSX.Element;
364
426
  declare function PopoverAnchor({ ...props }: ComponentProps<typeof Popover$1.Anchor>): react.JSX.Element;
365
427
  declare function PopoverHeader({ className, ...props }: ComponentProps<'div'>): react.JSX.Element;
366
428
  declare function PopoverTitle({ className, ...props }: ComponentProps<'h2'>): react.JSX.Element;
@@ -430,6 +492,15 @@ interface ComboboxOption {
430
492
  label: string;
431
493
  disabled?: boolean;
432
494
  }
495
+ /**
496
+ * Search matching strategy:
497
+ * - `fuzzy` — cmdk's default subsequence scoring (typo-tolerant; `205` also
498
+ * matches `2005`, `1205`, etc.).
499
+ * - `substring` — option matches when its value or label contains the query.
500
+ * - `prefix` — option matches when its value/label, or any word within them,
501
+ * starts with the query. Best for numeric/alphanumeric codes.
502
+ */
503
+ type ComboboxMatchMode = 'fuzzy' | 'substring' | 'prefix';
433
504
  interface ComboboxProps {
434
505
  options: ComboboxOption[];
435
506
  value?: string;
@@ -439,8 +510,20 @@ interface ComboboxProps {
439
510
  emptyMessage?: string;
440
511
  disabled?: boolean;
441
512
  className?: string;
513
+ /**
514
+ * Portal target for the dropdown. Pass the Dialog content node when the
515
+ * Combobox is rendered inside a modal Dialog so the list stays within the
516
+ * Dialog's scroll-lock shard — otherwise wheel/touch scrolling is blocked.
517
+ */
518
+ container?: HTMLElement | null;
519
+ /**
520
+ * Search matching strategy. Defaults to `fuzzy` (cmdk's built-in behavior).
521
+ * Use `prefix` or `substring` for numeric/alphanumeric codes where fuzzy
522
+ * subsequence matching surfaces unexpected results.
523
+ */
524
+ matchMode?: ComboboxMatchMode;
442
525
  }
443
- declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, className, }: ComboboxProps): react.JSX.Element;
526
+ declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, className, container, matchMode, }: ComboboxProps): react.JSX.Element;
444
527
 
445
528
  declare function DropdownMenu({ ...props }: ComponentProps<typeof DropdownMenu$1.Root>): react.JSX.Element;
446
529
  declare function DropdownMenuPortal({ ...props }: ComponentProps<typeof DropdownMenu$1.Portal>): react.JSX.Element;
@@ -595,37 +678,35 @@ declare const ColorPickerPresets: {
595
678
  displayName: string;
596
679
  };
597
680
 
598
- interface DatePickerSingleProps {
599
- mode?: 'single';
600
- selected?: Date;
601
- onSelect?: (date: Date | undefined) => void;
681
+ /** Options that mean the same thing whichever selection mode is active. */
682
+ interface DatePickerBaseProps {
602
683
  placeholder?: string;
603
684
  disabled?: boolean;
604
685
  className?: string;
686
+ /** Earliest selectable date. Earlier days are disabled and unreachable. */
605
687
  fromDate?: Date;
688
+ /** Latest selectable date. Later days are disabled and unreachable. */
606
689
  toDate?: Date;
690
+ /** Months rendered side by side. Defaults to 1. */
691
+ numberOfMonths?: number;
692
+ }
693
+ interface DatePickerSingleProps extends DatePickerBaseProps {
694
+ mode?: 'single';
695
+ selected?: Date;
696
+ onSelect?: (date: Date | undefined) => void;
607
697
  }
608
- interface DatePickerRangeProps {
698
+ interface DatePickerRangeProps extends DatePickerBaseProps {
609
699
  mode: 'range';
610
700
  selected?: DateRange;
611
701
  onSelect?: (range: DateRange | undefined) => void;
612
- placeholder?: string;
613
- disabled?: boolean;
614
- className?: string;
615
- fromDate?: Date;
616
- toDate?: Date;
617
- }
618
- interface DatePickerProps {
619
- mode?: 'single' | 'range';
620
- selected?: Date | DateRange;
621
- onSelect?: ((date: Date | undefined) => void) | ((range: DateRange | undefined) => void);
622
- placeholder?: string;
623
- disabled?: boolean;
624
- className?: string;
625
- fromDate?: Date;
626
- toDate?: Date;
627
702
  }
628
- declare function DatePicker({ mode, selected, onSelect, placeholder, disabled, className, fromDate, toDate, }: DatePickerProps): react.JSX.Element;
703
+ /**
704
+ * Discriminated on `mode`, so `selected` and `onSelect` are always the pair that
705
+ * belongs to it. A flat union would accept `mode='range'` with a single `Date`,
706
+ * which only fails at runtime once the popover is opened.
707
+ */
708
+ type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
709
+ declare function DatePicker(props: DatePickerProps): react.JSX.Element;
629
710
 
630
711
  interface NavbarDropdownItem {
631
712
  href: string;
@@ -660,6 +741,7 @@ interface NavbarProps extends HTMLAttributes<HTMLElement> {
660
741
  notifications?: NavbarNotification[];
661
742
  avatarSrc?: string;
662
743
  avatarFallback?: string;
744
+ showUtilityBar?: boolean;
663
745
  onNavLinkClick?: (href: string) => void;
664
746
  onSearchClick?: () => void;
665
747
  onHelpClick?: () => void;
@@ -764,6 +846,7 @@ interface AppShellProps {
764
846
  onItemClick?: (label: string) => void;
765
847
  brandName?: string;
766
848
  showHeader?: boolean;
849
+ header?: ReactNode;
767
850
  open?: boolean;
768
851
  onOpenChange?: (open: boolean) => void;
769
852
  defaultOpen?: boolean;
@@ -779,7 +862,7 @@ interface AppShellProps {
779
862
  * regardless of the parent's height. The inner `<main>` handles its own scroll.
780
863
  * Use `mainClassName` to customise padding, background, or scroll behaviour.
781
864
  */
782
- declare function AppShell({ items, activeItem, onItemClick, brandName, showHeader, open, onOpenChange, defaultOpen, className, mainClassName, children, }: AppShellProps): react.JSX.Element;
865
+ declare function AppShell({ items, activeItem, onItemClick, brandName, showHeader, header, open, onOpenChange, defaultOpen, className, mainClassName, children, }: AppShellProps): react.JSX.Element;
783
866
 
784
867
  declare function Textarea({ className, ...props }: ComponentProps<'textarea'>): react.JSX.Element;
785
868
 
@@ -839,6 +922,7 @@ declare const ease: {
839
922
  readonly enter: readonly [0, 0, 0.2, 1];
840
923
  readonly exit: readonly [0.4, 0, 1, 1];
841
924
  readonly linear: readonly [0, 0, 1, 1];
925
+ readonly drawer: readonly [0.22, 1, 0.36, 1];
842
926
  };
843
927
  declare const spring: {
844
928
  readonly gentle: {
@@ -887,6 +971,14 @@ declare const transition: {
887
971
  readonly duration: 0.15;
888
972
  readonly ease: readonly [0.4, 0, 0.2, 1];
889
973
  };
974
+ readonly drawer: {
975
+ readonly duration: 0.3;
976
+ readonly ease: readonly [0.22, 1, 0.36, 1];
977
+ };
978
+ readonly drawerExit: {
979
+ readonly duration: 0.2;
980
+ readonly ease: readonly [0.4, 0, 1, 1];
981
+ };
890
982
  };
891
983
  declare const fadeIn: {
892
984
  readonly hidden: {
@@ -1011,6 +1103,7 @@ declare const animation: {
1011
1103
  readonly enter: readonly [0, 0, 0.2, 1];
1012
1104
  readonly exit: readonly [0.4, 0, 1, 1];
1013
1105
  readonly linear: readonly [0, 0, 1, 1];
1106
+ readonly drawer: readonly [0.22, 1, 0.36, 1];
1014
1107
  };
1015
1108
  readonly spring: {
1016
1109
  readonly gentle: {
@@ -1059,6 +1152,14 @@ declare const animation: {
1059
1152
  readonly duration: 0.15;
1060
1153
  readonly ease: readonly [0.4, 0, 0.2, 1];
1061
1154
  };
1155
+ readonly drawer: {
1156
+ readonly duration: 0.3;
1157
+ readonly ease: readonly [0.22, 1, 0.36, 1];
1158
+ };
1159
+ readonly drawerExit: {
1160
+ readonly duration: 0.2;
1161
+ readonly ease: readonly [0.4, 0, 1, 1];
1162
+ };
1062
1163
  };
1063
1164
  readonly variants: {
1064
1165
  readonly fadeIn: {
@@ -1983,43 +2084,107 @@ interface UseTableSizingReturn {
1983
2084
  */
1984
2085
  declare function useTableSizing({ columnSizing: controlledSizing, defaultColumnSizing, onColumnSizingChange, }: UseTableSizingProps): UseTableSizingReturn;
1985
2086
 
2087
+ /** `'loading'` while the grant set is unresolved, `'ready'` once it is known. */
2088
+ type AbilityStatus = 'loading' | 'ready';
2089
+ interface AbilityContextValue {
2090
+ can: (permissions: Permission | Permission[], mode?: 'any' | 'all') => boolean;
2091
+ setAbilities: (permissions: string[]) => void;
2092
+ clearAbilities: () => void;
2093
+ /**
2094
+ * `'loading'` while the grant set is genuinely unresolved, `'ready'` once it
2095
+ * is known — including when it is known to be empty. This is what makes
2096
+ * "still loading" distinguishable from "loaded, zero grants": both produce
2097
+ * an empty set, so without this flag a consumer cannot tell them apart.
2098
+ */
2099
+ status: AbilityStatus;
2100
+ }
2101
+ interface AbilityProviderProps {
2102
+ children: ReactNode;
2103
+ permissions?: string[];
2104
+ }
2105
+ declare function AbilityProvider({ children, permissions }: AbilityProviderProps): react.JSX.Element;
2106
+ declare function useAbility(): AbilityContextValue;
2107
+ declare function useCan(permissions: Permission | Permission[], mode?: 'any' | 'all'): boolean;
2108
+ /** Returns whether the grant set is resolved yet. Useful for skeletons without a `Can` wrapper. */
2109
+ declare function useAbilityStatus(): AbilityStatus;
2110
+
2111
+ interface CanState {
2112
+ /**
2113
+ * Whether the permission check passed, after `negate` is applied. While
2114
+ * `status` is `'loading'`, the underlying check is always `false` — so
2115
+ * `allowed` is `false` for `Can` (fail-closed) but `true` for `CanNot`
2116
+ * (fail-open: negating an unresolved `false` flips it to `true`).
2117
+ */
2118
+ allowed: boolean;
2119
+ /** Whether the grant set has resolved yet. */
2120
+ status: AbilityStatus;
2121
+ }
1986
2122
  interface CanProps {
1987
- permission: string | string[];
2123
+ permission: Permission | Permission[];
1988
2124
  mode?: 'any' | 'all';
1989
2125
  negate?: boolean;
2126
+ /**
2127
+ * `'hide'` (default) removes the subtree and renders `fallback` instead.
2128
+ * `'disable'` keeps the subtree visible but non-interactive, with `reason`
2129
+ * surfaced in a tooltip. Use `'disable'` when the user should know the
2130
+ * action exists and why it is unavailable.
2131
+ */
2132
+ behavior?: 'hide' | 'disable';
2133
+ /**
2134
+ * Explanation shown in a tooltip when `behavior='disable'` denies. Accepts a
2135
+ * node so callers can pass translated content without the library taking an
2136
+ * i18n dependency. No tooltip is rendered when omitted.
2137
+ */
2138
+ reason?: ReactNode;
1990
2139
  fallback?: ReactNode;
1991
- children: ReactNode | ((allowed: boolean) => ReactNode);
2140
+ /**
2141
+ * Rendered while the grant set is unresolved. Unlike `reason` and `fallback`, `null` and
2142
+ * "omitted" are deliberately NOT the same value here: a node renders that node;
2143
+ * `loading={null}` renders nothing; omitting `loading` entirely falls through to
2144
+ * `fallback` (or, for `CanNot`, lets the fail-open children render). The distinction
2145
+ * exists because for `loading` — and only for `loading` — "render nothing" and "fall
2146
+ * through" are genuinely different outcomes: `CanNot` is fail-open during loading, so
2147
+ * without an explicit `loading={null}` its children render immediately and then
2148
+ * disappear once the grant set resolves. Pass `loading={null}` to suppress that flash.
2149
+ */
2150
+ loading?: ReactNode;
2151
+ children: ReactNode | ((state: CanState) => ReactNode);
1992
2152
  }
1993
2153
  type CanNotProps = Omit<CanProps, 'negate'>;
1994
- /** Renders children when the user has the required permission(s). Requires `AbilityProvider` in the tree. */
1995
- declare function Can({ permission, mode, negate, fallback, children }: CanProps): react.JSX.Element;
2154
+ /**
2155
+ * Renders its children when the user has the required permission(s). Requires an
2156
+ * `AbilityProvider` in the tree.
2157
+ *
2158
+ * Render precedence: a render-prop `children` always wins and receives the full
2159
+ * `CanState`; otherwise `loading` renders while the grant set is unresolved; then
2160
+ * `children` when allowed; then `fallback` when denied.
2161
+ *
2162
+ * When `children` is a function it OWNS EVERY STATE, and `behavior`, `reason`, `fallback`
2163
+ * and `loading` are all ignored — the render prop returns before any of them is consulted.
2164
+ * So `<Can behavior='disable' reason='…'>{({ allowed }) => …}</Can>` produces no tooltip
2165
+ * and no disabled treatment; the function has to read `allowed` and `status` and render
2166
+ * the disabled, loading and denied cases itself. Passing any of those four alongside a
2167
+ * function logs a development-only warning, since nothing else about the code looks wrong.
2168
+ *
2169
+ * Fail-closed by default: while `status === 'loading'`, the underlying check
2170
+ * is always `false` and nothing renders optimistically. Passing `negate`
2171
+ * flips this to fail-open — the unresolved `false` becomes `true` — so
2172
+ * children render immediately during loading unless `loading` is explicitly
2173
+ * passed. `CanNot` is `<Can negate />`, so it always exhibits the fail-open
2174
+ * case; pass `loading={null}` to suppress that flash and render nothing
2175
+ * instead — a node passed to `loading` renders that node, while omitting
2176
+ * `loading` falls through to the fail-open children.
2177
+ */
2178
+ declare function Can({ permission, mode, negate, behavior, reason, fallback, loading, children, }: CanProps): react.JSX.Element;
1996
2179
  declare namespace Can {
1997
2180
  var displayName: string;
1998
2181
  }
1999
- /** Renders children when the user does NOT have the required permission(s). Alias for `<Can negate />`. Requires `AbilityProvider` in the tree. */
2000
- declare function CanNot({ permission, mode, fallback, children }: CanNotProps): react.JSX.Element;
2182
+ /** Renders its children when the user does NOT have the required permission(s). Alias for `<Can negate />`. Requires an `AbilityProvider` in the tree. */
2183
+ declare function CanNot({ permission, mode, behavior, reason, fallback, loading, children, }: CanNotProps): react.JSX.Element;
2001
2184
  declare namespace CanNot {
2002
2185
  var displayName: string;
2003
2186
  }
2004
2187
 
2005
- interface AbilityContextValue {
2006
- can: (permissions: string | string[], mode?: 'any' | 'all') => boolean;
2007
- setAbilities: (permissions: string[]) => void;
2008
- clearAbilities: () => void;
2009
- }
2010
- interface AbilityProviderProps {
2011
- children: ReactNode;
2012
- permissions?: string[];
2013
- }
2014
- /**
2015
- * @param pattern - an entry from the user's grant set (may contain `*` as a segment wildcard)
2016
- * @param permission - the permission being requested (from `Can.perform`)
2017
- */
2018
- declare function matchPermission(pattern: string, permission: string): boolean;
2019
- declare function AbilityProvider({ children, permissions }: AbilityProviderProps): react.JSX.Element;
2020
- declare function useAbility(): AbilityContextValue;
2021
- declare function useCan(permissions: string | string[], mode?: 'any' | 'all'): boolean;
2022
-
2023
2188
  declare function Sheet({ ...props }: react.ComponentProps<typeof Dialog$1.Root>): react.JSX.Element;
2024
2189
  declare function SheetTrigger({ ...props }: react.ComponentProps<typeof Dialog$1.Trigger>): react.JSX.Element;
2025
2190
  declare function SheetClose({ ...props }: react.ComponentProps<typeof Dialog$1.Close>): react.JSX.Element;
@@ -2032,6 +2197,60 @@ declare function SheetFooter({ className, ...props }: react.ComponentProps<'div'
2032
2197
  declare function SheetTitle({ className, ...props }: react.ComponentProps<typeof Dialog$1.Title>): react.JSX.Element;
2033
2198
  declare function SheetDescription({ className, ...props }: react.ComponentProps<typeof Dialog$1.Description>): react.JSX.Element;
2034
2199
 
2200
+ type BottomNavItem = {
2201
+ label: string;
2202
+ href: string;
2203
+ icon: React.ReactNode;
2204
+ isActive?: boolean;
2205
+ onClick?: React.MouseEventHandler<HTMLAnchorElement>;
2206
+ };
2207
+ type BottomNavProps = {
2208
+ items: BottomNavItem[];
2209
+ className?: string;
2210
+ };
2211
+ declare function BottomNav({ items, className }: BottomNavProps): react.JSX.Element;
2212
+
2213
+ type BottomNavTabsProps = ComponentProps<typeof Tabs$1.Root>;
2214
+ declare function BottomNavTabs({ defaultValue, value: controlledValue, onValueChange, ...props }: BottomNavTabsProps): react.JSX.Element;
2215
+ declare function BottomNavTabsContent({ className, ...props }: ComponentProps<typeof TabsContent>): react.JSX.Element;
2216
+ type BottomNavTabsItem = {
2217
+ value: string;
2218
+ label: string;
2219
+ icon: React.ReactNode;
2220
+ activeIcon?: React.ReactNode;
2221
+ };
2222
+ type BottomNavTabsListProps = {
2223
+ items: BottomNavTabsItem[];
2224
+ className?: string;
2225
+ };
2226
+ declare function BottomNavTabsList({ items, className }: BottomNavTabsListProps): react.JSX.Element;
2227
+
2228
+ declare function Drawer({ children, open, onOpenChange, modal, ...props }: ComponentProps<typeof Dialog$1.Root>): react.JSX.Element;
2229
+ declare function DrawerTrigger({ ...props }: ComponentProps<typeof Dialog$1.Trigger>): react.JSX.Element;
2230
+ declare function DrawerClose({ ...props }: ComponentProps<typeof Dialog$1.Close>): react.JSX.Element;
2231
+ declare function DrawerPortal({ children, ...props }: ComponentProps<typeof Dialog$1.Portal>): react.JSX.Element;
2232
+ declare function DrawerOverlay({ className, ...props }: ComponentProps<typeof Dialog$1.Overlay>): react.JSX.Element;
2233
+ declare const sizeClasses: {
2234
+ readonly sm: "w-64";
2235
+ readonly md: "w-80";
2236
+ readonly lg: "w-96";
2237
+ readonly xl: "w-[30rem]";
2238
+ readonly full: "w-screen";
2239
+ };
2240
+ type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
2241
+ type DrawerSize = keyof typeof sizeClasses;
2242
+ declare function DrawerContent({ className, children, side, size, showCloseButton, resizable, ...props }: ComponentProps<typeof Dialog$1.Content> & {
2243
+ side?: DrawerSide;
2244
+ size?: DrawerSize;
2245
+ showCloseButton?: boolean;
2246
+ resizable?: boolean;
2247
+ }): react.JSX.Element;
2248
+ declare function DrawerHeader({ className, ...props }: ComponentProps<'div'>): react.JSX.Element;
2249
+ declare function DrawerBody({ className, ...props }: ComponentProps<'div'>): react.JSX.Element;
2250
+ declare function DrawerFooter({ className, ...props }: ComponentProps<'div'>): react.JSX.Element;
2251
+ declare function DrawerTitle({ className, ...props }: ComponentProps<typeof Dialog$1.Title>): react.JSX.Element;
2252
+ declare function DrawerDescription({ className, ...props }: ComponentProps<typeof Dialog$1.Description>): react.JSX.Element;
2253
+
2035
2254
  interface TCCEProviderProps {
2036
2255
  children: ReactNode;
2037
2256
  permissions?: string[];
@@ -2040,4 +2259,4 @@ interface TCCEProviderProps {
2040
2259
  }
2041
2260
  declare function TCCEProvider({ children, permissions, toasterPosition, tooltipDelayDuration, }: TCCEProviderProps): react.JSX.Element;
2042
2261
 
2043
- export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, Calendar, CalendarDayButton, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, matchPermission, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
2262
+ export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, type AbilityStatus, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BottomNav, type BottomNavItem, BottomNavTabs, BottomNavTabsContent, type BottomNavTabsItem, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, type CanState, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxMatchMode, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerSide, type DrawerSize, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Permission, PhoneField, type PhoneFieldCountry, type PhoneFieldProps, PhoneFieldValidity, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAbilityStatus, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };