@economic/taco 2.54.7 → 2.55.0-alpha.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/taco.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { BuiltInAggregationFn } from '@tanstack/react-table';
2
2
  import { BuiltInSortingFn } from '@tanstack/react-table';
3
+ import { CheckboxProps as CheckboxProps_2 } from 'react-aria-components';
3
4
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
4
5
  import { CollapsibleProps } from '@radix-ui/react-collapsible';
5
6
  import { ColumnFilter } from '@tanstack/react-table';
@@ -10,6 +11,9 @@ import { ColumnSizingState } from '@tanstack/react-table';
10
11
  import { ColumnSort } from '@tanstack/react-table';
11
12
  import { default as default_2 } from 'react';
12
13
  import * as DialogPrimitive from '@radix-ui/react-dialog';
14
+ import { DisclosureGroupProps } from 'react-aria-components';
15
+ import { DisclosurePanelProps } from 'react-aria-components';
16
+ import { DisclosureProps } from 'react-aria-components';
13
17
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
14
18
  import { IdType } from 'react-table';
15
19
  import { Matcher } from 'react-day-picker';
@@ -18,26 +22,26 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
18
22
  import * as React_2 from 'react';
19
23
  import { ScaleType } from 'recharts/types/util/types';
20
24
  import { SortingState } from '@tanstack/react-table';
25
+ import { SwitchProps as SwitchProps_2 } from 'react-aria-components';
21
26
  import { VisibilityState } from '@tanstack/react-table';
22
27
 
23
28
  export declare const Accordion: {
24
29
  (props: AccordionProps): default_2.JSX.Element;
25
- Item: (props: AccordionItemProps) => default_2.JSX.Element;
30
+ Item: ({ disabled, className, ...otherProps }: AccordionItemProps) => default_2.JSX.Element;
26
31
  Trigger: default_2.ForwardRefExoticComponent<AccordionTriggerProps & default_2.RefAttributes<HTMLButtonElement>>;
27
- Content: default_2.ForwardRefExoticComponent<AccordionContentProps & default_2.RefAttributes<HTMLDivElement>>;
32
+ Content: default_2.ForwardRefExoticComponent<DisclosurePanelProps & default_2.RefAttributes<HTMLDivElement>>;
28
33
  };
29
34
 
30
- declare type AccordionBaseProps = {
35
+ declare type AccordionBaseProps = Omit<DisclosureGroupProps, 'id' | 'allowsMultipleExpanded' | 'isDisabled' | 'expandedKeys' | 'defaultExpandedKeys' | 'onExpandedChange'> & {
31
36
  children: default_2.ReactNode[];
32
37
  /** Change what heading element accordion regions will render */
33
38
  as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
34
39
  /** Additional classes for Accordion root element */
35
40
  className?: string;
41
+ disabled?: boolean;
36
42
  };
37
43
 
38
- export declare type AccordionContentProps = default_2.HTMLAttributes<HTMLElement>;
39
-
40
- export declare type AccordionItemProps = default_2.HTMLAttributes<HTMLDivElement> & {
44
+ declare type AccordionItemProps = Omit<DisclosureProps, 'id' | 'isDisabled' | 'onExpandedChange' | 'defaultExpanded' | 'isExpanded'> & {
41
45
  id: string;
42
46
  disabled?: boolean;
43
47
  };
@@ -448,23 +452,20 @@ export declare type CardProps = React_2.HTMLAttributes<HTMLDivElement> & {
448
452
  menu?: (props: Partial<MenuProps>) => JSX.Element;
449
453
  };
450
454
 
451
- export declare const Checkbox: React_2.ForwardRefExoticComponent<CheckboxProps & React_2.RefAttributes<HTMLButtonElement>>;
455
+ export declare const Checkbox: React_2.ForwardRefExoticComponent<CheckboxProps & React_2.RefAttributes<HTMLInputElement>>;
452
456
 
453
- declare type CheckboxBaseProps = Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {
454
- /**
455
- * Indeterminate state should only be used with sub-checkboxes. The indeterminate state is shown if not all
456
- * sub-checkboxes are selected. This only affects the style, changing the icon in the checkbox.
457
- */
458
- indeterminate?: boolean;
459
- invalid?: boolean;
457
+ export declare type CheckboxProps = Omit<RemapReactAriaIsProperties<CheckboxProps_2>, 'defaultSelected' | 'onChange'> & {
460
458
  /** Label for the checkbox */
461
459
  label?: React_2.ReactNode;
462
460
  /** Displays loading state in checkbox */
463
461
  loading?: boolean;
464
- required?: boolean;
465
- };
466
-
467
- export declare type CheckboxProps = UncontrolledCheckboxProps | ControlledCheckboxProps;
462
+ onClick?: (event: React_2.MouseEvent<HTMLSpanElement>) => void;
463
+ } & Either<{
464
+ checked: boolean;
465
+ onChange: (checked: boolean) => void;
466
+ }, {
467
+ defaultChecked?: boolean;
468
+ }>;
468
469
 
469
470
  export declare namespace CollectionPrimitive {
470
471
  export {
@@ -586,18 +587,6 @@ declare const Content: default_2.ForwardRefExoticComponent<LayoutContentProps &
586
587
 
587
588
  declare const Content_2: default_2.ForwardRefExoticComponent<Navigation2ContentProps & default_2.RefAttributes<HTMLLIElement>>;
588
589
 
589
- export declare interface ControlledCheckboxProps extends CheckboxBaseProps {
590
- defaultChecked?: never;
591
- checked: boolean;
592
- onChange: (checked: boolean) => void;
593
- }
594
-
595
- declare interface ControlledModeSwitchProps extends ModeSwitchBaseProps {
596
- defaultChecked?: never;
597
- checked: boolean;
598
- onChange: (checked: boolean) => void;
599
- }
600
-
601
590
  declare interface ControlledRadioGroupProps extends RadioGroupBaseProps {
602
591
  defaultValue?: never;
603
592
  /** Handler called when the value changes */
@@ -606,12 +595,6 @@ declare interface ControlledRadioGroupProps extends RadioGroupBaseProps {
606
595
  value?: RadioGroupItemValue;
607
596
  }
608
597
 
609
- export declare interface ControlledSwitchProps extends SwitchBaseProps {
610
- defaultChecked?: never;
611
- checked: boolean;
612
- onChange: (checked: boolean) => void;
613
- }
614
-
615
598
  export declare const convertRowIndexPathToNumberArray: (rowIndexPath: RowIndexPath) => number[];
616
599
 
617
600
  declare const createListboxValueSetter: (multiple: boolean, setValue: default_2.Dispatch<default_2.SetStateAction<Listbox2Value | undefined>>) => (nextValue: Listbox2Value) => void;
@@ -1179,6 +1162,8 @@ declare type DrawerTriggerProps = React_2.HTMLAttributes<HTMLButtonElement>;
1179
1162
 
1180
1163
  declare type DrawerVariant = 'overlay' | 'embedded';
1181
1164
 
1165
+ export declare type Either<T, U> = Only<T, U> | Only<U, T>;
1166
+
1182
1167
  export declare const Field: React_2.ForwardRefExoticComponent<React_2.LabelHTMLAttributes<HTMLLabelElement> & {
1183
1168
  /** Content of the field */
1184
1169
  children: React_2.ReactNode;
@@ -1907,8 +1892,8 @@ export declare namespace List {
1907
1892
  children: JSX.Element | JSX.Element[];
1908
1893
  defaultOpen?: boolean;
1909
1894
  } & default_2.RefAttributes<HTMLDivElement>>;
1910
- var Switch: default_2.ForwardRefExoticComponent<ComposableListItemProps<"div"> & Omit<ControlledSwitchProps, "title"> & default_2.RefAttributes<HTMLDivElement>>;
1911
- var Checkbox: default_2.ForwardRefExoticComponent<ComposableListItemProps<"div"> & Omit<ControlledSwitchProps, "title"> & default_2.RefAttributes<HTMLDivElement>>;
1895
+ var Switch: default_2.ForwardRefExoticComponent<ComposableListItemProps<"div"> & Required<Pick<SwitchProps, "onChange" | "checked">> & default_2.RefAttributes<HTMLDivElement>>;
1896
+ var Checkbox: default_2.ForwardRefExoticComponent<ComposableListItemProps<"div"> & Required<Pick<SwitchProps, "onChange" | "checked">> & default_2.RefAttributes<HTMLDivElement>>;
1912
1897
  var Group: default_2.ForwardRefExoticComponent<Omit<default_2.HTMLAttributes<HTMLDivElement>, "children"> & {
1913
1898
  children: JSX.Element | JSX.Element[];
1914
1899
  } & default_2.RefAttributes<HTMLDivElement>>;
@@ -2039,7 +2024,7 @@ export declare type ListButtonProps = Omit<ComposableListItemProps<'button'>, 'o
2039
2024
  onClick: default_2.MouseEventHandler<HTMLButtonElement>;
2040
2025
  };
2041
2026
 
2042
- export declare type ListCheckboxProps = ComposableListItemProps<'div'> & ControlledCheckboxProps;
2027
+ export declare type ListCheckboxProps = ComposableListItemProps<'div'> & Required<Pick<CheckboxProps, 'checked' | 'onChange'>>;
2043
2028
 
2044
2029
  export declare type ListCollapsibleProps = Omit<ComposableListItemProps<typeof CollapsiblePrimitive.Root>, 'children'> & {
2045
2030
  children: JSX.Element | JSX.Element[];
@@ -2068,7 +2053,7 @@ export declare type ListProps = default_2.HTMLAttributes<HTMLDivElement> & {
2068
2053
  children: JSX.Element | (JSX.Element | boolean | null | undefined)[];
2069
2054
  };
2070
2055
 
2071
- export declare type ListSwitchProps = ComposableListItemProps<'div'> & Omit<ControlledSwitchProps, 'title'>;
2056
+ export declare type ListSwitchProps = ComposableListItemProps<'div'> & Required<Pick<SwitchProps, 'checked' | 'onChange'>>;
2072
2057
 
2073
2058
  declare type Locale_2 = 'en-GB' | 'da-DK' | 'sv-SE' | 'no-NO';
2074
2059
  export { Locale_2 as Locale }
@@ -2210,13 +2195,18 @@ export declare type MenuTriggerProps = Omit<React_2.HTMLAttributes<HTMLButtonEle
2210
2195
 
2211
2196
  export declare function mergeRefs<T = any>(refs: Array<default_2.MutableRefObject<T> | default_2.LegacyRef<T>>): default_2.RefCallback<T>;
2212
2197
 
2213
- export declare const ModeSwitch: React_2.ForwardRefExoticComponent<ModeSwitchProps & React_2.RefAttributes<HTMLButtonElement>>;
2198
+ export declare const ModeSwitch: React_2.ForwardRefExoticComponent<ModeSwitchProps & React_2.RefAttributes<HTMLInputElement>>;
2214
2199
 
2215
- declare type ModeSwitchBaseProps = Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {
2216
- required?: boolean;
2217
- };
2218
-
2219
- export declare type ModeSwitchProps = UncontrolledModeSwitchProps | ControlledModeSwitchProps;
2200
+ export declare type ModeSwitchProps = Omit<RemapReactAriaIsProperties<SwitchProps_2>, 'defaultSelected' | 'onChange'> & {
2201
+ /** Label for the checkbox */
2202
+ label?: React_2.ReactNode;
2203
+ onClick?: (event: React_2.MouseEvent<HTMLSpanElement>) => void;
2204
+ } & Either<{
2205
+ checked: boolean;
2206
+ onChange: (checked: boolean) => void;
2207
+ }, {
2208
+ defaultChecked?: boolean;
2209
+ }>;
2220
2210
 
2221
2211
  export declare const MultiListbox: React_2.ForwardRefExoticComponent<Pick<React_2.InputHTMLAttributes<HTMLInputElement>, "onFocus" | "onChange"> & Omit<React_2.InputHTMLAttributes<HTMLElement>, "onChange" | "defaultValue" | "value"> & {
2222
2212
  /** Data indicating the options in listbox */
@@ -2309,6 +2299,12 @@ export declare type NavigationPanelProps = default_2.HTMLAttributes<HTMLDivEleme
2309
2299
 
2310
2300
  export declare type NavigationProps = default_2.HTMLAttributes<HTMLDivElement>;
2311
2301
 
2302
+ declare type Only<T, U> = {
2303
+ [P in keyof T]: T[P];
2304
+ } & {
2305
+ [P in keyof U]?: never;
2306
+ };
2307
+
2312
2308
  declare const Option_2: default_2.ForwardRefExoticComponent<default_2.HTMLAttributes<HTMLDivElement> & {
2313
2309
  disabled?: boolean;
2314
2310
  value: Listbox2OptionValue;
@@ -2538,6 +2534,10 @@ export declare type RadioGroupItemValue = string | number | boolean | null;
2538
2534
 
2539
2535
  export declare type RadioGroupProps = UncontrolledRadioGroupProps | ControlledRadioGroupProps;
2540
2536
 
2537
+ export declare type RemapReactAriaIsProperties<T> = {
2538
+ [K in keyof T as K extends `is${infer Rest}` ? Uncapitalize<Rest> : K]: T[K];
2539
+ };
2540
+
2541
2541
  export declare const removeChildTableRow: <TRow extends {}>(data: Row<TRow>[], rowIndexPath: RowIndexPath) => Row<TRow>[];
2542
2542
 
2543
2543
  declare const Report_2: (<TType = unknown>(props: ReportProps<TType> & default_2.RefAttributes<ReportRef>) => JSX.Element) & {
@@ -2869,15 +2869,18 @@ declare interface SubtleBadgeProps extends BadgeBaseProps {
2869
2869
  status?: never;
2870
2870
  }
2871
2871
 
2872
- export declare const Switch: React_2.ForwardRefExoticComponent<SwitchProps & React_2.RefAttributes<HTMLButtonElement>>;
2872
+ export declare const Switch: React_2.ForwardRefExoticComponent<SwitchProps & React_2.RefAttributes<HTMLInputElement>>;
2873
2873
 
2874
- declare type SwitchBaseProps = Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {
2875
- /** Label for the switch */
2874
+ export declare type SwitchProps = Omit<RemapReactAriaIsProperties<SwitchProps_2>, 'defaultSelected' | 'onChange'> & {
2875
+ /** Label for the checkbox */
2876
2876
  label?: React_2.ReactNode;
2877
- required?: boolean;
2878
- };
2879
-
2880
- export declare type SwitchProps = UncontrolledSwitchProps | ControlledSwitchProps;
2877
+ onClick?: (event: React_2.MouseEvent<HTMLSpanElement>) => void;
2878
+ } & Either<{
2879
+ checked: boolean;
2880
+ onChange: (checked: boolean) => void;
2881
+ }, {
2882
+ defaultChecked?: boolean;
2883
+ }>;
2881
2884
 
2882
2885
  export declare type TabContentProps = React_2.HTMLAttributes<HTMLDivElement> & {
2883
2886
  /**
@@ -3005,7 +3008,7 @@ export declare interface Table3WithoutEditingWithServerProps<TType = unknown> ex
3005
3008
  onEditingSave?: never;
3006
3009
  }
3007
3010
 
3008
- export declare type TableChild = JSX.Element | boolean | null | undefined;
3011
+ export declare type TableChild = JSX.Element | JSX.Element[] | boolean | null | undefined;
3009
3012
 
3010
3013
  export declare interface TableClientProps<TType = unknown> extends TableCommonProps<TType> {
3011
3014
  length?: never;
@@ -3727,30 +3730,12 @@ export declare type TruncateProps = {
3727
3730
  tooltip: string;
3728
3731
  };
3729
3732
 
3730
- export declare interface UncontrolledCheckboxProps extends CheckboxBaseProps {
3731
- checked?: never;
3732
- onChange?: never;
3733
- defaultChecked?: boolean;
3734
- }
3735
-
3736
- declare interface UncontrolledModeSwitchProps extends ModeSwitchBaseProps {
3737
- checked?: never;
3738
- onChange?: never;
3739
- defaultChecked?: boolean;
3740
- }
3741
-
3742
3733
  declare interface UncontrolledRadioGroupProps extends RadioGroupBaseProps {
3743
3734
  defaultValue?: RadioGroupItemValue;
3744
3735
  onChange?: never;
3745
3736
  value?: never;
3746
3737
  }
3747
3738
 
3748
- export declare interface UncontrolledSwitchProps extends SwitchBaseProps {
3749
- checked?: never;
3750
- onChange?: never;
3751
- defaultChecked?: boolean;
3752
- }
3753
-
3754
3739
  export declare const useBoundaryOverflowDetection: (ref: default_2.RefObject<HTMLElement>, dependencies?: any[]) => number | null | undefined;
3755
3740
 
3756
3741
  export declare const useBoundingClientRectListener: (ref: React_2.RefObject<HTMLElement>, dependencies?: Array<any>) => DOMRectReadOnly | undefined;