@economic/taco 0.0.6-alpha.0 → 0.0.10-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.
Files changed (61) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +9 -9
  2. package/dist/components/Backdrop/Backdrop.d.ts +1 -1
  3. package/dist/components/Button/Button.d.ts +11 -10
  4. package/dist/components/Dialog/Context.d.ts +2 -1
  5. package/dist/components/Dialog/Dialog.d.ts +20 -10
  6. package/dist/components/Dialog/components/Content.d.ts +9 -8
  7. package/dist/components/Hanger/Hanger.d.ts +4 -1
  8. package/dist/components/IconButton/IconButton.d.ts +5 -1
  9. package/dist/components/Menu/Menu.d.ts +3 -1
  10. package/dist/components/Popover/Popover.d.ts +4 -1
  11. package/dist/components/Select/Select.d.ts +1 -1
  12. package/dist/esm/components/Accordion/Accordion.js +14 -9
  13. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  14. package/dist/esm/components/Backdrop/Backdrop.js +5 -4
  15. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  16. package/dist/esm/components/Button/Button.js.map +1 -1
  17. package/dist/esm/components/Button/util.js +20 -10
  18. package/dist/esm/components/Button/util.js.map +1 -1
  19. package/dist/esm/components/Calendar/Calendar.js +1 -1
  20. package/dist/esm/components/Combobox/Combobox.js +1 -1
  21. package/dist/esm/components/Datepicker/Datepicker.js +2 -2
  22. package/dist/esm/components/Dialog/Context.js +2 -1
  23. package/dist/esm/components/Dialog/Context.js.map +1 -1
  24. package/dist/esm/components/Dialog/Dialog.js +18 -16
  25. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  26. package/dist/esm/components/Dialog/components/Content.js +46 -19
  27. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  28. package/dist/esm/components/Dialog/components/Drawer.js +3 -1
  29. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  30. package/dist/esm/components/Dialog/components/Extra.js +3 -1
  31. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  32. package/dist/esm/components/Hanger/Hanger.js +6 -6
  33. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  34. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  35. package/dist/esm/components/Input/Input.js +1 -1
  36. package/dist/esm/components/Input/Input.js.map +1 -1
  37. package/dist/esm/components/Listbox/ScrollableList.js +1 -1
  38. package/dist/esm/components/Menu/Menu.js +8 -2
  39. package/dist/esm/components/Menu/Menu.js.map +1 -1
  40. package/dist/esm/components/Pagination/PageNumbers.js +1 -1
  41. package/dist/esm/components/Pagination/Pagination.js +1 -1
  42. package/dist/esm/components/Popover/Popover.js +3 -4
  43. package/dist/esm/components/Popover/Popover.js.map +1 -1
  44. package/dist/esm/components/SearchInput/SearchInput.js +7 -7
  45. package/dist/esm/components/Table/components/Table.js +1 -2
  46. package/dist/esm/components/Table/components/Table.js.map +1 -1
  47. package/dist/esm/components/Table/components/WindowedTable.js +0 -1
  48. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  49. package/dist/esm/components/Table/hooks/useTable.js +4 -1
  50. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  51. package/dist/esm/components/Toast/Toast.js +1 -1
  52. package/dist/esm/components/Tour/Tour.js +2 -2
  53. package/dist/esm/index.css +45 -45
  54. package/dist/esm/index.js +7 -7
  55. package/dist/index.css +45 -45
  56. package/dist/taco.cjs.development.js +1850 -1793
  57. package/dist/taco.cjs.development.js.map +1 -1
  58. package/dist/taco.cjs.production.min.js +1 -1
  59. package/dist/taco.cjs.production.min.js.map +1 -1
  60. package/package.json +2 -2
  61. package/types.json +1073 -542
@@ -1,4 +1,10 @@
1
1
  import React from 'react';
2
+ export declare type AccordionTriggerProps = React.HTMLAttributes<HTMLElement>;
3
+ export declare type AccordionContentProps = React.HTMLAttributes<HTMLElement>;
4
+ export declare type AccordionItemProps = React.HTMLAttributes<HTMLDivElement> & {
5
+ id: string;
6
+ disabled?: boolean;
7
+ };
2
8
  declare type AccordionBaseProps = {
3
9
  children: React.ReactNode[];
4
10
  /** Change what heading element accordion regions will render */
@@ -27,16 +33,10 @@ export interface AccordionSingleControlledProps extends AccordionBaseProps {
27
33
  defaultId?: never;
28
34
  }
29
35
  export declare type AccordionProps = AccordionUncontrolledProps | AccordionMultipleControlledProps | AccordionSingleControlledProps;
30
- declare type AccordionItem = React.HTMLAttributes<HTMLDivElement> & {
31
- id: string;
32
- disabled?: boolean;
33
- };
34
- declare type AccordionTrigger = React.HTMLAttributes<HTMLElement>;
35
- declare type AccordionContent = React.HTMLAttributes<HTMLElement>;
36
36
  export declare const Accordion: {
37
37
  (props: AccordionProps): JSX.Element;
38
- Item: React.FC<AccordionItem>;
39
- Trigger: React.ForwardRefExoticComponent<AccordionTrigger & React.RefAttributes<HTMLButtonElement>>;
40
- Content: React.ForwardRefExoticComponent<AccordionContent & React.RefAttributes<HTMLDivElement>>;
38
+ Item: (props: AccordionItemProps) => JSX.Element;
39
+ Trigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
40
+ Content: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
41
41
  };
42
42
  export {};
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  export declare type BackdropProps = React.HTMLAttributes<HTMLDivElement>;
3
- export declare const Backdrop: (props: BackdropProps) => JSX.Element;
3
+ export declare const Backdrop: React.ForwardRefExoticComponent<BackdropProps & React.RefAttributes<HTMLDivElement>>;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { Appearance } from '../../types';
3
3
  import * as ButtonPrimitive from '../../primitives/Button';
4
4
  import { HangerProps } from '../Hanger/Hanger';
5
+ import { MenuProps } from '../Menu/Menu';
5
6
  import { DialogProps } from '../Dialog/Dialog';
6
7
  import { PopoverProps } from '../Popover/Popover';
7
8
  import './Button.css';
@@ -13,17 +14,19 @@ export declare type ButtonProps = ButtonPrimitive.ButtonProps & {
13
14
  * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of
14
15
  * the button should be only to open the associated dialog when clicked.
15
16
  */
16
- dialog?: React.ReactElement<DialogProps>;
17
+ dialog?: (props: Partial<DialogProps>) => JSX.Element;
17
18
  /** If fluid, button expands to the width of it's container */
18
19
  fluid?: boolean;
19
20
  /** Hanger component associated with the button. */
20
- hanger?: React.ReactElement<HangerProps>;
21
+ hanger?: (props: Partial<HangerProps>) => JSX.Element;
22
+ /** Menu component associated with the button. */
23
+ menu?: (props: Partial<MenuProps>) => JSX.Element;
21
24
  /**
22
25
  * Popover component associated with the button, clicking the button will open the popover.
23
26
  * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of
24
27
  * the button should be only to open the associated popover when clicked.
25
28
  */
26
- popover?: React.ReactElement<PopoverProps>;
29
+ popover?: (props: Partial<PopoverProps>) => JSX.Element;
27
30
  /** A tooltip to show when hovering over the button */
28
31
  tooltip?: string;
29
32
  };
@@ -39,21 +42,19 @@ export declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAtt
39
42
  * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of
40
43
  * the button should be only to open the associated dialog when clicked.
41
44
  */
42
- dialog?: React.ReactElement<DialogProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
45
+ dialog?: ((props: Partial<DialogProps>) => JSX.Element) | undefined;
43
46
  /** If fluid, button expands to the width of it's container */
44
47
  fluid?: boolean | undefined;
45
48
  /** Hanger component associated with the button. */
46
- hanger?: React.ReactElement<{
47
- children?: React.ReactNode;
48
- }, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
49
+ hanger?: ((props: Partial<HangerProps>) => JSX.Element) | undefined;
50
+ /** Menu component associated with the button. */
51
+ menu?: ((props: Partial<MenuProps>) => JSX.Element) | undefined;
49
52
  /**
50
53
  * Popover component associated with the button, clicking the button will open the popover.
51
54
  * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of
52
55
  * the button should be only to open the associated popover when clicked.
53
56
  */
54
- popover?: React.ReactElement<{
55
- children?: React.ReactNode;
56
- }, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
57
+ popover?: ((props: Partial<PopoverProps>) => JSX.Element) | undefined;
57
58
  /** A tooltip to show when hovering over the button */
58
59
  tooltip?: string | undefined;
59
60
  } & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DialogSize } from './types';
3
3
  export declare type DialogContext = {
4
+ closeOnEscape: boolean;
4
5
  draggable: boolean;
5
6
  drawer?: {
6
7
  open: boolean;
@@ -10,10 +11,10 @@ export declare type DialogContext = {
10
11
  drawer?: React.ReactNode;
11
12
  extra?: React.ReactNode;
12
13
  };
13
- close: () => void;
14
14
  onClose?: () => void;
15
15
  props: {};
16
16
  ref: React.Ref<HTMLElement>;
17
+ showCloseButton: boolean;
17
18
  size: DialogSize;
18
19
  };
19
20
  export declare const DialogContext: React.Context<DialogContext>;
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import './Dialog.css';
3
3
  import { DialogTriggerProps } from './components/Trigger';
4
- import { DialogContentProps, DialogTitleProps, DialogFooterProps, DialogCloseProps } from './components/Content';
4
+ import { DialogContentProps, DialogContentRenderProps, DialogContentDrawerRenderProps, DialogTitleProps, DialogFooterProps, DialogCloseProps } from './components/Content';
5
5
  import { DialogDrawerProps } from './components/Drawer';
6
6
  import { DialogExtraProps } from './components/Extra';
7
7
  import { DialogSize } from './types';
8
- export { DialogContentProps, DialogTitleProps, DialogFooterProps, DialogCloseProps };
8
+ export { DialogContentProps, DialogContentRenderProps, DialogContentDrawerRenderProps, DialogTitleProps, DialogFooterProps, DialogCloseProps, DialogSize, };
9
9
  export declare type DialogTexts = {
10
10
  /**
11
11
  * Aria-label for close icon button in dialog.
@@ -16,22 +16,32 @@ export declare type DialogTexts = {
16
16
  };
17
17
  export declare type DialogProps = {
18
18
  children: React.ReactNode | React.ReactNode[];
19
+ /** When `true`, pressing escape will close the dialog */
20
+ closeOnEscape?: boolean;
21
+ /** Set whether the dialog is open by default or not, use when not providing a trigger */
22
+ defaultOpen?: boolean;
19
23
  /** Allows dragging the dialog around the screen (window constrained) */
20
24
  draggable?: boolean;
21
25
  /** Handler called when dialog closes by user interaction */
22
26
  onClose?: () => void;
23
- /** Set whether the dialog is open by default or not, use when not providing a trigger */
27
+ /** Called when the dialog opens or closes, must be used in conjunction with open */
28
+ onChange?: (open: boolean) => void;
29
+ /** Control the open state of the dialog from outside the component */
24
30
  open?: boolean;
31
+ /** Shows the close icon button of the dialog */
32
+ showCloseButton?: boolean;
25
33
  /** Size of the dialog. This is the recommended way to set a size for dialog component. */
26
34
  size?: DialogSize;
35
+ /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */
36
+ trigger?: JSX.Element;
27
37
  };
28
38
  export declare type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {
29
- Trigger: React.ForwardRefExoticComponent<DialogTriggerProps>;
30
- Content: React.ForwardRefExoticComponent<DialogContentProps>;
31
- Title: React.ForwardRefExoticComponent<DialogTitleProps>;
32
- Footer: React.ForwardRefExoticComponent<DialogFooterProps>;
33
- Extra: React.ForwardRefExoticComponent<DialogExtraProps>;
34
- Drawer: React.ForwardRefExoticComponent<DialogDrawerProps>;
35
- Close: React.ForwardRefExoticComponent<DialogCloseProps>;
39
+ Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
40
+ Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
41
+ Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
42
+ Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;
43
+ Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;
44
+ Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;
45
+ Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
36
46
  };
37
47
  export declare const Dialog: ForwardedDialogWithStatics;
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
+ export declare type DialogContentDrawerRenderProps = {
3
+ open: boolean;
4
+ toggle: () => void;
5
+ };
2
6
  export declare type DialogContentRenderProps = {
3
7
  close: () => void;
4
- drawer?: {
5
- open: boolean;
6
- toggle: () => void;
7
- };
8
+ drawer?: DialogContentDrawerRenderProps;
8
9
  };
9
10
  export declare type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
10
11
  export declare const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
@@ -13,12 +14,12 @@ export declare const Footer: React.ForwardRefExoticComponent<DialogFooterProps &
13
14
  export declare type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;
14
15
  export declare const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
15
16
  export declare type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
16
- /** An accessible description to be announced when the dialog is opened */
17
- 'aria-describedby': string;
17
+ /** An accessible label to be announced when the dialog is opened */
18
+ 'aria-label': string;
18
19
  children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);
19
20
  };
20
21
  export declare const Content: React.ForwardRefExoticComponent<Pick<React.HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
21
- /** An accessible description to be announced when the dialog is opened */
22
- 'aria-describedby': string;
22
+ /** An accessible label to be announced when the dialog is opened */
23
+ 'aria-label': string;
23
24
  children: Pick<React.ReactNode, never> | ((props: DialogContentRenderProps) => JSX.Element);
24
25
  } & React.RefAttributes<HTMLDivElement>>;
@@ -13,7 +13,10 @@ export declare type HangerContentProps = React.HTMLAttributes<HTMLDivElement> &
13
13
  /** Set the position of the Hanger relative to its achor. Default value is `bottom` */
14
14
  placement?: Placement;
15
15
  };
16
- export declare type HangerProps = React.PropsWithChildren<{}>;
16
+ export declare type HangerProps = React.PropsWithChildren<{
17
+ /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */
18
+ anchor?: JSX.Element;
19
+ }>;
17
20
  export declare type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {
18
21
  Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;
19
22
  Content: React.ForwardRefExoticComponent<HangerContentProps>;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import * as ButtonPrimitive from '../../primitives/Button';
3
3
  import { IconName } from '../Icon/Icon';
4
4
  import { Appearance } from '../../types';
5
- import { DialogProps, HangerProps, PopoverProps } from '../..';
5
+ import { DialogProps, HangerProps, MenuProps, PopoverProps } from '../..';
6
6
  export declare type IconButtonProps = Omit<ButtonPrimitive.ButtonProps, 'children'> & {
7
7
  /** Appearance will change the style of the button */
8
8
  appearance?: Appearance;
@@ -16,6 +16,8 @@ export declare type IconButtonProps = Omit<ButtonPrimitive.ButtonProps, 'childre
16
16
  icon: IconName;
17
17
  /** Hanger component associated with the button. */
18
18
  hanger?: React.ReactElement<HangerProps>;
19
+ /** Menu component associated with the button. */
20
+ menu?: React.ReactElement<MenuProps>;
19
21
  /**
20
22
  * Popover component associated with the button, clicking the button will open the popover.
21
23
  * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of
@@ -45,6 +47,8 @@ export declare const IconButton: React.ForwardRefExoticComponent<Pick<ButtonPrim
45
47
  hanger?: React.ReactElement<{
46
48
  children?: React.ReactNode;
47
49
  }, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
50
+ /** Menu component associated with the button. */
51
+ menu?: React.ReactElement<MenuProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
48
52
  /**
49
53
  * Popover component associated with the button, clicking the button will open the popover.
50
54
  * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of
@@ -3,9 +3,11 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
3
  export declare type MenuProps = {
4
4
  children: React.ReactNode;
5
5
  id?: string;
6
+ /** A trigger to be used for the menu, should not be set if `children` already contains a trigger */
7
+ trigger?: JSX.Element;
6
8
  };
7
9
  export declare const Menu: {
8
- (props: MenuProps): JSX.Element;
10
+ (externalProps: MenuProps): JSX.Element;
9
11
  Trigger: React.ForwardRefExoticComponent<Pick<React.HTMLAttributes<HTMLButtonElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
10
12
  children: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
11
13
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -10,7 +10,10 @@ export declare type PopoverContentProps = Omit<React.HTMLAttributes<HTMLDivEleme
10
10
  placement?: Placement;
11
11
  };
12
12
  export declare type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;
13
- export declare type PopoverProps = React.PropsWithChildren<{}>;
13
+ export declare type PopoverProps = React.PropsWithChildren<{
14
+ /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */
15
+ trigger?: JSX.Element;
16
+ }>;
14
17
  export declare type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {
15
18
  Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;
16
19
  Content: React.ForwardRefExoticComponent<PopoverContentProps>;
@@ -31,7 +31,7 @@ export declare const Select: React.ForwardRefExoticComponent<Pick<React.InputHTM
31
31
  loading?: boolean | undefined;
32
32
  state?: "default" | "success" | "error" | "warning" | "information" | undefined;
33
33
  value?: string | number | boolean | null | undefined;
34
- } & Pick<ComboboxProps, "onChange" | "onFocus" | "defaultValue" | "value" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "step" | "type" | "width" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "button" | "icon" | "highlighted" | "state" | "data" | "emptyValue" | "loading"> & {
34
+ } & Pick<ComboboxProps, "onChange" | "onFocus" | "defaultValue" | "value" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "step" | "type" | "width" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "button" | "icon" | "highlighted" | "state" | "data" | "emptyValue" | "loading" | "onSearch"> & {
35
35
  /**
36
36
  * Allows to select multiple values.
37
37
  * All the selected values will be combined in a comma-seperated string as the value of the input.
@@ -6,7 +6,9 @@ import { Icon } from '../Icon/Icon.js';
6
6
 
7
7
  var _excluded = ["id"],
8
8
  _excluded2 = ["id", "defaultId", "onChange", "as"];
9
- var AccordionContext = /*#__PURE__*/React__default.createContext({});
9
+ var AccordionContext = /*#__PURE__*/React__default.createContext({
10
+ as: 'h2'
11
+ });
10
12
  var StyledTrigger = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
11
13
  var isExpanded = !!props['aria-expanded'];
12
14
  var className = cn('w-full inline-flex justify-between items-center align-middle', 'focus:rounded-sm focus:border-blue focus:yt-focus', props.className);
@@ -21,8 +23,7 @@ var Trigger = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
21
23
  var children = props.children;
22
24
 
23
25
  var _React$useContext = React__default.useContext(AccordionContext),
24
- _React$useContext$as = _React$useContext.as,
25
- Heading = _React$useContext$as === void 0 ? 'h2' : _React$useContext$as;
26
+ Heading = _React$useContext.as;
26
27
 
27
28
  return React__default.createElement(Header, {
28
29
  asChild: true
@@ -52,9 +53,15 @@ var Accordion = function Accordion(props) {
52
53
  var id = props.id,
53
54
  defaultId = props.defaultId,
54
55
  onChange = props.onChange,
55
- as = props.as,
56
+ _props$as = props.as,
57
+ as = _props$as === void 0 ? 'h2' : _props$as,
56
58
  otherProps = _objectWithoutPropertiesLoose(props, _excluded2);
57
59
 
60
+ var context = React__default.useMemo(function () {
61
+ return {
62
+ as: as
63
+ };
64
+ }, [as]);
58
65
  var valueProps;
59
66
 
60
67
  if (defaultId) {
@@ -71,13 +78,11 @@ var Accordion = function Accordion(props) {
71
78
  var type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';
72
79
  var className = cn('divide-y divide-grey', props.className);
73
80
  return React__default.createElement(AccordionContext.Provider, {
74
- value: {
75
- as: as
76
- }
81
+ value: context
77
82
  }, React__default.createElement(Root, Object.assign({}, otherProps, valueProps, {
78
83
  "data-taco": "accordion",
79
- type: type,
80
- className: className
84
+ className: className,
85
+ type: type
81
86
  })));
82
87
  };
83
88
  Accordion.Item = Item;
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { Icon } from '../Icon/Icon';\n\ntype AccordionBaseProps = {\n children: React.ReactNode[];\n\n /** Change what heading element accordion regions will render */\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n /** Additional classes for Accordion root element */\n className?: string;\n};\n\nexport interface AccordionUncontrolledProps extends AccordionBaseProps {\n /** Default expanded accordion(s) */\n defaultId: string | string[];\n\n id?: never;\n onChange?: never;\n}\n\nexport interface AccordionMultipleControlledProps extends AccordionBaseProps {\n /** Expanded accordions */\n id: string[];\n\n /** onChange function to receive ids of expanded accordions */\n onChange: (id: string[]) => void;\n\n defaultId?: never;\n}\nexport interface AccordionSingleControlledProps extends AccordionBaseProps {\n /** Expanded accordion */\n id: string;\n\n /** onChange function to receive id of expanded accordion */\n onChange: (id: string) => void;\n\n defaultId?: never;\n}\n\nexport type AccordionProps = AccordionUncontrolledProps | AccordionMultipleControlledProps | AccordionSingleControlledProps;\n\ntype AccordionItem = React.HTMLAttributes<HTMLDivElement> & {\n id: string;\n disabled?: boolean;\n};\ntype AccordionTrigger = React.HTMLAttributes<HTMLElement>;\ntype AccordionContent = React.HTMLAttributes<HTMLElement>;\n\ntype AccordionContext = {\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n};\nconst AccordionContext = React.createContext<AccordionContext>({});\n\nconst StyledTrigger = React.forwardRef((props: AccordionPrimitive.AccordionTriggerProps, ref: React.Ref<HTMLButtonElement>) => {\n const isExpanded = !!props['aria-expanded'];\n\n const className = cn(\n 'w-full inline-flex justify-between items-center align-middle',\n 'focus:rounded-sm focus:border-blue focus:yt-focus',\n props.className\n );\n\n return (\n <button {...props} ref={ref} className={className}>\n {props.children}\n <Icon name={isExpanded ? 'chevron-up' : 'chevron-down'} />\n </button>\n );\n});\n\nconst Trigger = React.forwardRef((props: AccordionTrigger, ref: React.Ref<HTMLButtonElement>) => {\n const { children } = props;\n const { as: Heading = 'h2' } = React.useContext(AccordionContext);\n\n return (\n <AccordionPrimitive.Header asChild>\n <Heading className=\"my-3\">\n <AccordionPrimitive.Trigger ref={ref} asChild>\n <StyledTrigger>{children}</StyledTrigger>\n </AccordionPrimitive.Trigger>\n </Heading>\n </AccordionPrimitive.Header>\n );\n});\n\nconst Content = React.forwardRef((props: AccordionContent, ref: React.Ref<HTMLDivElement>) => (\n <AccordionPrimitive.Content {...props} ref={ref} />\n));\n\nconst Item: React.FC<AccordionItem> = props => {\n const { id, ...otherProps } = props;\n return <AccordionPrimitive.Item {...otherProps} value={id} />;\n};\n\nexport const Accordion = (props: AccordionProps) => {\n const { id, defaultId, onChange, as, ...otherProps } = props;\n\n let valueProps;\n\n if (defaultId) {\n valueProps = {\n defaultValue: defaultId || undefined,\n };\n } else {\n valueProps = {\n onValueChange: onChange,\n value: id || undefined,\n };\n }\n\n const type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';\n const className = cn('divide-y divide-grey', props.className);\n\n return (\n <AccordionContext.Provider value={{ as }}>\n <AccordionPrimitive.Root {...otherProps} {...valueProps} data-taco=\"accordion\" type={type} className={className} />\n </AccordionContext.Provider>\n );\n};\n\nAccordion.Item = Item;\nAccordion.Trigger = Trigger;\nAccordion.Content = Content;\n"],"names":["AccordionContext","React","createContext","StyledTrigger","forwardRef","props","ref","isExpanded","className","cn","children","Icon","name","Trigger","useContext","as","Heading","AccordionPrimitive","asChild","Content","Item","id","otherProps","value","Accordion","defaultId","onChange","valueProps","defaultValue","undefined","onValueChange","type","Array","isArray","Provider"],"mappings":";;;;;;;;AAsDA,IAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAN,CAAsC,EAAtC,CAAzB;AAEA,IAAMC,aAAa,gBAAGF,cAAK,CAACG,UAAN,CAAiB,UAACC,KAAD,EAAkDC,GAAlD;AACnC,MAAMC,UAAU,GAAG,CAAC,CAACF,KAAK,CAAC,eAAD,CAA1B;AAEA,MAAMG,SAAS,GAAGC,EAAE,CAChB,8DADgB,EAEhB,mDAFgB,EAGhBJ,KAAK,CAACG,SAHU,CAApB;AAMA,SACIP,4BAAA,SAAA,oBAAYI;AAAOC,IAAAA,GAAG,EAAEA;AAAKE,IAAAA,SAAS,EAAEA;IAAxC,EACKH,KAAK,CAACK,QADX,EAEIT,4BAAA,CAACU,IAAD;AAAMC,IAAAA,I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,KAAvD,CAAuBqB,QAAvB;AAAA,MAAiCX,EAAjC,GAAuDV,KAAvD,CAAiCU,EAAjC;AAAA,MAAwCO,UAAxC,iCAAuDjB,KAAvD;;AAEA,MAAIsB,UAAJ;;AAEA,MAAIF,SAAJ,EAAe;AACXE,IAAAA,UAAU,GAAG;AACTC,MAAAA,YAAY,EAAEH,SAAS,IAAII;AADlB,KAAb;AAGH,GAJD,MAIO;AACHF,IAAAA,UAAU,GAAG;AACTG,MAAAA,aAAa,EAAEJ,QADN;AAETH,MAAAA,KAAK,EAAEF,EAAE,IAAIQ;AAFJ,KAAb;AAIH;;AAED,MAAME,IAAI,GAAGC,KAAK,CAACC,OAAN,CAAcN,UAAU,CAACC,YAAzB,KAA0CI,KAAK,CAACC,OAAN,CAAcN,UAAU,CAACJ,KAAzB,CAA1C,GAA4E,UAA5E,GAAyF,QAAtG;AACA,MAAMf,SAAS,GAAGC,EAAE,CAAC,sBAAD,EAAyBJ,KAAK,CAACG,SAA/B,CAApB;AAEA,SACIP,4BAAA,CAACD,gBAAgB,CAACkC,QAAlB;AAA2BX,IAAAA,KAAK,EAAE;AAAER,MAAAA,EAAE,EAAFA;AAAF;GAAlC,EACId,4BAAA,CAACgB,IAAD,oBAA6BK,YAAgBK;iBAAsB;AAAYI,IAAAA,IAAI,EAAEA;AAAMvB,IAAAA,SAAS,EAAEA;IAAtG,CADJ,CADJ;AAKH;AAEDgB,SAAS,CAACJ,IAAV,GAAiBA,IAAjB;AACAI,SAAS,CAACX,OAAV,GAAoBA,OAApB;AACAW,SAAS,CAACL,OAAV,GAAoBA,OAApB;;;;"}
1
+ {"version":3,"file":"Accordion.js","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { Icon } from '../Icon/Icon';\n\ntype AccordionContext = {\n as: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n};\nconst AccordionContext = React.createContext<AccordionContext>({\n as: 'h2',\n});\n\nexport type AccordionTriggerProps = React.HTMLAttributes<HTMLElement>;\n\nconst StyledTrigger = React.forwardRef((props: AccordionPrimitive.AccordionTriggerProps, ref: React.Ref<HTMLButtonElement>) => {\n const isExpanded = !!props['aria-expanded'];\n\n const className = cn(\n 'w-full inline-flex justify-between items-center align-middle',\n 'focus:rounded-sm focus:border-blue focus:yt-focus',\n props.className\n );\n\n return (\n <button {...props} ref={ref} className={className}>\n {props.children}\n <Icon name={isExpanded ? 'chevron-up' : 'chevron-down'} />\n </button>\n );\n});\n\nconst Trigger = React.forwardRef((props: AccordionTriggerProps, ref: React.Ref<HTMLButtonElement>) => {\n const { children } = props;\n const { as: Heading } = React.useContext(AccordionContext);\n\n return (\n <AccordionPrimitive.Header asChild>\n <Heading className=\"my-3\">\n <AccordionPrimitive.Trigger ref={ref} asChild>\n <StyledTrigger>{children}</StyledTrigger>\n </AccordionPrimitive.Trigger>\n </Heading>\n </AccordionPrimitive.Header>\n );\n});\n\nexport type AccordionContentProps = React.HTMLAttributes<HTMLElement>;\nconst Content = React.forwardRef((props: AccordionContentProps, ref: React.Ref<HTMLDivElement>) => (\n <AccordionPrimitive.Content {...props} ref={ref} />\n));\n\nexport type AccordionItemProps = React.HTMLAttributes<HTMLDivElement> & {\n id: string;\n disabled?: boolean;\n};\nconst Item = (props: AccordionItemProps) => {\n const { id, ...otherProps } = props;\n return <AccordionPrimitive.Item {...otherProps} value={id} />;\n};\n\ntype AccordionBaseProps = {\n children: React.ReactNode[];\n\n /** Change what heading element accordion regions will render */\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n /** Additional classes for Accordion root element */\n className?: string;\n};\n\nexport interface AccordionUncontrolledProps extends AccordionBaseProps {\n /** Default expanded accordion(s) */\n defaultId: string | string[];\n\n id?: never;\n onChange?: never;\n}\n\nexport interface AccordionMultipleControlledProps extends AccordionBaseProps {\n /** Expanded accordions */\n id: string[];\n\n /** onChange function to receive ids of expanded accordions */\n onChange: (id: string[]) => void;\n\n defaultId?: never;\n}\nexport interface AccordionSingleControlledProps extends AccordionBaseProps {\n /** Expanded accordion */\n id: string;\n\n /** onChange function to receive id of expanded accordion */\n onChange: (id: string) => void;\n\n defaultId?: never;\n}\n\nexport type AccordionProps = AccordionUncontrolledProps | AccordionMultipleControlledProps | AccordionSingleControlledProps;\n\nexport const Accordion = (props: AccordionProps) => {\n const { id, defaultId, onChange, as = 'h2', ...otherProps } = props;\n const context = React.useMemo(() => ({ as }), [as]);\n\n let valueProps;\n\n if (defaultId) {\n valueProps = {\n defaultValue: defaultId || undefined,\n };\n } else {\n valueProps = {\n onValueChange: onChange,\n value: id || undefined,\n };\n }\n\n const type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';\n const className = cn('divide-y divide-grey', props.className);\n\n return (\n <AccordionContext.Provider value={context}>\n <AccordionPrimitive.Root {...otherProps} {...valueProps} data-taco=\"accordion\" className={className} type={type} />\n </AccordionContext.Provider>\n );\n};\n\nAccordion.Item = Item;\nAccordion.Trigger = Trigger;\nAccordion.Content = Content;\n"],"names":["AccordionContext","React","createContext","as","StyledTrigger","forwardRef","props","ref","isExpanded","className","cn","children","Icon","name","Trigger","useContext","Heading","AccordionPrimitive","asChild","Content","Item","id","otherProps","value","Accordion","defaultId","onChange","context","useMemo","valueProps","defaultValue","undefined","onValueChange","type","Array","isArray","Provider"],"mappings":";;;;;;;;AAQA,IAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAN,CAAsC;AAC3DC,EAAAA,EAAE,EAAE;AADuD,CAAtC,CAAzB;AAMA,IAAMC,aAAa,gBAAGH,cAAK,CAACI,UAAN,CAAiB,UAACC,KAAD,EAAkDC,GAAlD;AACnC,MAAMC,UAAU,GAAG,CAAC,CAACF,KAAK,CAAC,eAAD,CAA1B;AAEA,MAAMG,SAAS,GAAGC,EAAE,CAChB,8DADgB,EAEhB,mDAFgB,EAGhBJ,KAAK,CAACG,SAHU,CAApB;A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,SAAS,CAACL,OAAV,GAAoBA,OAApB;;;;"}
@@ -1,12 +1,13 @@
1
- import { createElement } from 'react';
1
+ import { forwardRef, createElement } from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- var Backdrop = function Backdrop(props) {
4
+ var Backdrop = /*#__PURE__*/forwardRef(function Backdrop(props, ref) {
5
5
  var className = cn('fixed inset-0 cursor-default overflow-y-auto bg-[rgba(50,46,62,0.8)] animate-[fade-in_150ms] aria-hidden:hidden', props.className);
6
6
  return createElement("div", Object.assign({}, props, {
7
- className: className
7
+ className: className,
8
+ ref: ref
8
9
  }));
9
- };
10
+ });
10
11
 
11
12
  export { Backdrop };
12
13
  //# sourceMappingURL=Backdrop.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Backdrop.js","sources":["../../../../src/components/Backdrop/Backdrop.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nexport type BackdropProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Backdrop = (props: BackdropProps) => {\n const className = cn(\n 'fixed inset-0 cursor-default overflow-y-auto bg-[rgba(50,46,62,0.8)] animate-[fade-in_150ms] aria-hidden:hidden',\n props.className\n );\n\n return <div {...props} className={className} />;\n};\n"],"names":["Backdrop","props","className","cn","React"],"mappings":";;;IAKaA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD;AACpB,MAAMC,SAAS,GAAGC,EAAE,CAChB,iHADgB,EAEhBF,KAAK,CAACC,SAFU,CAApB;AAKA,SAAOE,aAAA,MAAA,oBAASH;AAAOC,IAAAA,SAAS,EAAEA;IAA3B,CAAP;AACH;;;;"}
1
+ {"version":3,"file":"Backdrop.js","sources":["../../../../src/components/Backdrop/Backdrop.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nexport type BackdropProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Backdrop = React.forwardRef<HTMLDivElement, BackdropProps>(function Backdrop(props, ref) {\n const className = cn(\n 'fixed inset-0 cursor-default overflow-y-auto bg-[rgba(50,46,62,0.8)] animate-[fade-in_150ms] aria-hidden:hidden',\n props.className\n );\n\n return <div {...props} className={className} ref={ref} />;\n});\n"],"names":["Backdrop","React","props","ref","className","cn"],"mappings":";;;IAKaA,QAAQ,gBAAGC,UAAA,CAAgD,SAASD,QAAT,CAAkBE,KAAlB,EAAyBC,GAAzB;AACpE,MAAMC,SAAS,GAAGC,EAAE,CAChB,iHADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;AAKA,SAAOH,aAAA,MAAA,oBAASC;AAAOE,IAAAA,SAAS,EAAEA;AAAWD,IAAAA,GAAG,EAAEA;IAA3C,CAAP;AACH,CAPuB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { getAppearanceClasses, getButtonClasses, createButton } from './util';\nimport { HangerProps } from '../Hanger/Hanger';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { PopoverProps } from '../Popover/Popover';\nimport './Button.css';\n\nexport type ButtonProps = ButtonPrimitive.ButtonProps & {\n /** Appearance will change the style of the button */\n appearance?: Appearance;\n /**\n * Dialog component associated with the button, clicking the button will open the dialog.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated dialog when clicked.\n */\n dialog?: React.ReactElement<DialogProps>;\n /** If fluid, button expands to the width of it's container */\n fluid?: boolean;\n /** Hanger component associated with the button. */\n hanger?: React.ReactElement<HangerProps>;\n /**\n * Popover component associated with the button, clicking the button will open the popover.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated popover when clicked.\n */\n popover?: React.ReactElement<PopoverProps>;\n /** A tooltip to show when hovering over the button */\n tooltip?: string;\n};\n\nexport const Button = React.forwardRef(function Button(\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\n const { appearance, fluid, ...otherProps } = props;\n const className = cn(\n getButtonClasses(),\n getAppearanceClasses(appearance),\n 'rounded px-3',\n {\n 'cursor-not-allowed opacity-50': props.disabled,\n 'focus:yt-focus active:focus:yt-focus': !props.disabled,\n 'w-full': fluid,\n },\n props.className\n );\n\n return createButton({ ...otherProps, 'data-taco': 'button' }, className, ref);\n});\n"],"names":["Button","React","props","ref","appearance","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","disabled","createButton"],"mappings":";;;;;;IAiCaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CACnCE,KADmC,EAEnCC,GAFmC;AAInC,MAAQC,UAAR,GAA6CF,KAA7C,CAAQE,UAAR;AAAA,MAAoBC,KAApB,GAA6CH,KAA7C,CAAoBG,KAApB;AAAA,MAA8BC,UAA9B,iCAA6CJ,KAA7C;;AACA,MAAMK,SAAS,GAAGC,EAAE,CAChBC,gBAAgB,EADA,EAEhBC,oBAAoB,CAACN,UAAD,CAFJ,EAGhB,cAHgB,EAIhB;AACI,qCAAiCF,KAAK,CAACS,QAD3C;AAEI,4CAAwC,CAACT,KAAK,CAACS,QAFnD;AAGI,cAAUN;AAHd,GAJgB,EAShBH,KAAK,CAACK,SATU,CAApB;AAYA,SAAOK,YAAY,cAAMN,UAAN;AAAkB,iBAAa;AAA/B,MAA2CC,SAA3C,EAAsDJ,GAAtD,CAAnB;AACH,CAlBqB;;;;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { getAppearanceClasses, getButtonClasses, createButton } from './util';\nimport { HangerProps } from '../Hanger/Hanger';\nimport { MenuProps } from '../Menu/Menu';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { PopoverProps } from '../Popover/Popover';\nimport './Button.css';\n\nexport type ButtonProps = ButtonPrimitive.ButtonProps & {\n /** Appearance will change the style of the button */\n appearance?: Appearance;\n /**\n * Dialog component associated with the button, clicking the button will open the dialog.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated dialog when clicked.\n */\n dialog?: (props: Partial<DialogProps>) => JSX.Element;\n /** If fluid, button expands to the width of it's container */\n fluid?: boolean;\n /** Hanger component associated with the button. */\n hanger?: (props: Partial<HangerProps>) => JSX.Element;\n /** Menu component associated with the button. */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n /**\n * Popover component associated with the button, clicking the button will open the popover.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated popover when clicked.\n */\n popover?: (props: Partial<PopoverProps>) => JSX.Element;\n /** A tooltip to show when hovering over the button */\n tooltip?: string;\n};\n\nexport const Button = React.forwardRef(function Button(\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\n const { appearance, fluid, ...otherProps } = props;\n const className = cn(\n getButtonClasses(),\n getAppearanceClasses(appearance),\n 'rounded px-3',\n {\n 'cursor-not-allowed opacity-50': props.disabled,\n 'focus:yt-focus active:focus:yt-focus': !props.disabled,\n 'w-full': fluid,\n },\n props.className\n );\n\n return createButton({ ...otherProps, 'data-taco': 'button' }, className, ref);\n});\n"],"names":["Button","React","props","ref","appearance","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","disabled","createButton"],"mappings":";;;;;;IAoCaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CACnCE,KADmC,EAEnCC,GAFmC;AAInC,MAAQC,UAAR,GAA6CF,KAA7C,CAAQE,UAAR;AAAA,MAAoBC,KAApB,GAA6CH,KAA7C,CAAoBG,KAApB;AAAA,MAA8BC,UAA9B,iCAA6CJ,KAA7C;;AACA,MAAMK,SAAS,GAAGC,EAAE,CAChBC,gBAAgB,EADA,EAEhBC,oBAAoB,CAACN,UAAD,CAFJ,EAGhB,cAHgB,EAIhB;AACI,qCAAiCF,KAAK,CAACS,QAD3C;AAEI,4CAAwC,CAACT,KAAK,CAACS,QAFnD;AAGI,cAAUN;AAHd,GAJgB,EAShBH,KAAK,CAACK,SATU,CAApB;AAYA,SAAOK,YAAY,cAAMN,UAAN;AAAkB,iBAAa;AAA/B,MAA2CC,SAA3C,EAAsDJ,GAAtD,CAAnB;AACH,CAlBqB;;;;"}
@@ -2,11 +2,8 @@ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '.
2
2
  import React__default from 'react';
3
3
  import { Button } from '../../primitives/Button.js';
4
4
  import { Tooltip } from '../Tooltip/Tooltip.js';
5
- import { Hanger } from '../Hanger/Hanger.js';
6
- import { Dialog } from '../Dialog/Dialog.js';
7
- import { Popover } from '../Popover/Popover.js';
8
5
 
9
- var _excluded = ["dialog", "hanger", "popover", "tooltip"];
6
+ var _excluded = ["dialog", "hanger", "menu", "popover", "tooltip"];
10
7
  var getButtonClasses = function getButtonClasses() {
11
8
  return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] leading-6 inline-flex items-center justify-center transition-all delay-100 ease-in border';
12
9
  };
@@ -41,6 +38,7 @@ var getAppearanceClasses = function getAppearanceClasses(value, icon) {
41
38
  var createButton = function createButton(props, className, ref) {
42
39
  var dialog = props.dialog,
43
40
  hanger = props.hanger,
41
+ menu = props.menu,
44
42
  popover = props.popover,
45
43
  tooltip = props.tooltip,
46
44
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
@@ -50,16 +48,28 @@ var createButton = function createButton(props, className, ref) {
50
48
  ref: ref
51
49
  }));
52
50
 
53
- if (hanger) {
54
- button = React__default.createElement(Hanger, Object.assign({}, hanger.props), React__default.createElement(Hanger.Anchor, null, button), hanger.props.children);
51
+ if (typeof dialog === 'function') {
52
+ button = dialog({
53
+ trigger: button
54
+ });
55
55
  }
56
56
 
57
- if (dialog) {
58
- button = React__default.createElement(Dialog, Object.assign({}, dialog.props), React__default.createElement(Dialog.Trigger, null, button), dialog.props.children);
57
+ if (typeof hanger === 'function') {
58
+ button = hanger({
59
+ anchor: button
60
+ });
59
61
  }
60
62
 
61
- if (popover) {
62
- button = React__default.createElement(Popover, Object.assign({}, popover.props), React__default.createElement(Popover.Trigger, null, button), popover.props.children);
63
+ if (typeof menu === 'function') {
64
+ button = menu({
65
+ trigger: button
66
+ });
67
+ }
68
+
69
+ if (typeof popover === 'function') {
70
+ button = popover({
71
+ trigger: button
72
+ });
63
73
  }
64
74
 
65
75
  if (tooltip) {
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../../src/components/Button/util.tsx"],"sourcesContent":["import React from 'react';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { Tooltip } from '../Tooltip/Tooltip';\nimport { Hanger } from '../Hanger/Hanger';\nimport { Dialog } from '../Dialog/Dialog';\nimport { Popover } from '../Popover/Popover';\n\nexport const getButtonClasses = () => {\n return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] leading-6 inline-flex items-center justify-center transition-all delay-100 ease-in border';\n};\n\nexport const getAppearanceClasses = (value: Appearance | undefined, icon = false): string => {\n switch (value) {\n case 'primary':\n return `yt-blue-solid border-blue\n focus:bg-blue focus:text-white focus:yt-focus\n active:bg-blue-dark active:text-white \n hover:bg-blue-light hover:border-blue-light hover:text-white\n hover:focus:bg-blue-light hover:focus:border-blue-light hover:focus:text-white\n disabled:hover:yt-blue-solid`;\n\n case 'danger':\n return `yt-red-solid border-red\n focus:bg-red focus:text-white focus:yt-focus-red\n active:bg-red-dark active:text-white \n hover:bg-red-light hover:text-white\n hover:focus:bg-red-light hover:focus:text-white\n disabled:hover:yt-red-solid`;\n\n case 'ghost':\n return `yt-blue-inverted\n focus:bg-transparent focus:text-blue focus:yt-focus\n active:bg-blue-lightest active:border-blue active:text-blue-dark \n hover:bg-blue-lightest hover:border-blue-light hover:text-blue-light\n hover:focus:bg-blue-lightest hover:focus:border-blue-light hover:focus:text-blue-light\n disabled:hover:yt-blue-inverted`;\n\n case 'discrete': {\n if (icon) {\n return `bg-transparent text-black border-transparent\n focus:text-black focus:yt-focus\n active:text-black\n hover:text-grey-darkest\n hover:focus:text-grey-darkest\n disabled:hover:yt-transparent`;\n }\n\n return `yt-transparent border-transparent\n focus:text-blue focus:yt-focus\n active:text-blue-dark\n hover:text-blue-light\n hover:focus:text-blue-light\n disabled:hover:yt-transparent`;\n }\n\n default:\n return `yt-grey-solid border-grey\n focus:bg-grey focus:yt-focus\n active:bg-grey-dark active:text-black\n hover:bg-grey-light hover:text-grey-darkest\n hover:focus:bg-grey-light hover:focus:text-grey-darkest\n disabled:hover:yt-grey-solid`;\n }\n};\n\nexport const createButton = (\n props: any,\n className: string,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n): JSX.Element => {\n const { dialog, hanger, popover, tooltip, ...otherProps } = props;\n\n let button = <ButtonPrimitive.Button {...otherProps} className={className} ref={ref} />;\n\n if (hanger) {\n button = (\n <Hanger {...hanger.props}>\n <Hanger.Anchor>{button}</Hanger.Anchor>\n {hanger.props.children}\n </Hanger>\n );\n }\n\n if (dialog) {\n button = (\n <Dialog {...dialog.props}>\n <Dialog.Trigger>{button}</Dialog.Trigger>\n {dialog.props.children}\n </Dialog>\n );\n }\n\n if (popover) {\n button = (\n <Popover {...popover.props}>\n <Popover.Trigger>{button}</Popover.Trigger>\n {popover.props.children}\n </Popover>\n );\n }\n\n if (tooltip) {\n button = <Tooltip title={tooltip}>{button}</Tooltip>;\n }\n\n return button;\n};\n"],"names":["getButtonClasses","getAppearanceClasses","value","icon","createButton","props","className","ref","dialog","hanger","popover","tooltip","otherProps","button","React","ButtonPrimitive","Hanger","Anchor","children","Dialog","Trigger","Popover","Tooltip","title"],"mappings":";;;;;;;;;IAQaA,gBAAgB,GAAG,SAAnBA,gBAAmB;AAC5B,SAAO,6IAAP;AACH;IAEYC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,KAAD,EAAgCC,IAAhC;MAAgCA;AAAAA,IAAAA,OAAO;;;AACvE,UA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,EAEKH,OAAO,CAACL,KAAR,CAAca,QAFnB,CADJ;AAMH;;AAED,MAAIP,OAAJ,EAAa;AACTE,IAAAA,MAAM,GAAGC,4BAAA,CAACQ,OAAD;AAASC,MAAAA,KAAK,EAAEZ;KAAhB,EAA0BE,MAA1B,CAAT;AACH;;AAED,SAAOA,MAAP;AACH;;;;"}
1
+ {"version":3,"file":"util.js","sources":["../../../../src/components/Button/util.tsx"],"sourcesContent":["import React from 'react';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport const getButtonClasses = () => {\n return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] leading-6 inline-flex items-center justify-center transition-all delay-100 ease-in border';\n};\n\nexport const getAppearanceClasses = (value: Appearance | undefined, icon = false): string => {\n switch (value) {\n case 'primary':\n return `yt-blue-solid border-blue\n focus:bg-blue focus:text-white focus:yt-focus\n active:bg-blue-dark active:text-white \n hover:bg-blue-light hover:border-blue-light hover:text-white\n hover:focus:bg-blue-light hover:focus:border-blue-light hover:focus:text-white\n disabled:hover:yt-blue-solid`;\n\n case 'danger':\n return `yt-red-solid border-red\n focus:bg-red focus:text-white focus:yt-focus-red\n active:bg-red-dark active:text-white \n hover:bg-red-light hover:text-white\n hover:focus:bg-red-light hover:focus:text-white\n disabled:hover:yt-red-solid`;\n\n case 'ghost':\n return `yt-blue-inverted\n focus:bg-transparent focus:text-blue focus:yt-focus\n active:bg-blue-lightest active:border-blue active:text-blue-dark \n hover:bg-blue-lightest hover:border-blue-light hover:text-blue-light\n hover:focus:bg-blue-lightest hover:focus:border-blue-light hover:focus:text-blue-light\n disabled:hover:yt-blue-inverted`;\n\n case 'discrete': {\n if (icon) {\n return `bg-transparent text-black border-transparent\n focus:text-black focus:yt-focus\n active:text-black\n hover:text-grey-darkest\n hover:focus:text-grey-darkest\n disabled:hover:yt-transparent`;\n }\n\n return `yt-transparent border-transparent\n focus:text-blue focus:yt-focus\n active:text-blue-dark\n hover:text-blue-light\n hover:focus:text-blue-light\n disabled:hover:yt-transparent`;\n }\n\n default:\n return `yt-grey-solid border-grey\n focus:bg-grey focus:yt-focus\n active:bg-grey-dark active:text-black\n hover:bg-grey-light hover:text-grey-darkest\n hover:focus:bg-grey-light hover:focus:text-grey-darkest\n disabled:hover:yt-grey-solid`;\n }\n};\n\nexport const createButton = (\n props: any,\n className: string,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n): JSX.Element => {\n const { dialog, hanger, menu, popover, tooltip, ...otherProps } = props;\n\n let button = <ButtonPrimitive.Button {...otherProps} className={className} ref={ref} />;\n\n if (typeof dialog === 'function') {\n button = dialog({ trigger: button });\n }\n if (typeof hanger === 'function') {\n button = hanger({ anchor: button });\n }\n\n if (typeof menu === 'function') {\n button = menu({ trigger: button });\n }\n\n if (typeof popover === 'function') {\n button = popover({ trigger: button });\n }\n\n if (tooltip) {\n button = <Tooltip title={tooltip}>{button}</Tooltip>;\n }\n\n return button;\n};\n"],"names":["getButtonClasses","getAppearanceClasses","value","icon","createButton","props","className","ref","dialog","hanger","menu","popover","tooltip","otherProps","button","React","ButtonPrimitive","trigger","anchor","Tooltip","title"],"mappings":";;;;;;IAKaA,gBAAgB,GAAG,SAAnBA,gBAAmB;AAC5B,SAAO,6IAAP;AACH;IAEYC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,KAAD,EAAgCC,IAAhC;MAAgCA;AAAAA,IAAAA,OAAO;;;AACvE,UAAQD,KAAR;AACI,SAAK,SAAL;AACI;;AAOJ,SAAK,QAAL;AACI;;AAOJ,SAAK,OAAL;AACI;;AAOJ,SAAK,UAAL;AAAiB;AACb,YAAIC,IAAJ,EAAU;AACN;AAMH;;AAED;AAMH;;AAED;AACI;AA5CR;AAmDH;IAEYC,YAAY,GAAG,SAAfA,YAAe,CACxBC,KADwB,EAExBC,SAFwB,EAGxBC,GAHwB;AAKxB,MAAQC,MAAR,GAAkEH,KAAlE,CAAQG,MAAR;AAAA,MAAgBC,MAAhB,GAAkEJ,KAAlE,CAAgBI,MAAhB;AAAA,MAAwBC,IAAxB,GAAkEL,KAAlE,CAAwBK,IAAxB;AAAA,MAA8BC,OAA9B,GAAkEN,KAAlE,CAA8BM,OAA9B;AAAA,MAAuCC,OAAvC,GAAkEP,KAAlE,CAAuCO,OAAvC;AAAA,MAAmDC,UAAnD,iCAAkER,KAAlE;;AAEA,MAAIS,MAAM,GAAGC,4BAAA,CAACC,MAAD,oBAA4BH;AAAYP,IAAAA,SAAS,EAAEA;AAAWC,IAAAA,GAAG,EAAEA;IAAnE,CAAb;;AAEA,MAAI,OAAOC,MAAP,KAAkB,UAAtB,EAAkC;AAC9BM,IAAAA,MAAM,GAAGN,MAAM,CAAC;AAAES,MAAAA,OAAO,EAAEH;AAAX,KAAD,CAAf;AACH;;AACD,MAAI,OAAOL,MAAP,KAAkB,UAAtB,EAAkC;AAC9BK,IAAAA,MAAM,GAAGL,MAAM,CAAC;AAAES,MAAAA,MAAM,EAAEJ;AAAV,KAAD,CAAf;AACH;;AAED,MAAI,OAAOJ,IAAP,KAAgB,UAApB,EAAgC;AAC5BI,IAAAA,MAAM,GAAGJ,IAAI,CAAC;AAAEO,MAAAA,OAAO,EAAEH;AAAX,KAAD,CAAb;AACH;;AAED,MAAI,OAAOH,OAAP,KAAmB,UAAvB,EAAmC;AAC/BG,IAAAA,MAAM,GAAGH,OAAO,CAAC;AAAEM,MAAAA,OAAO,EAAEH;AAAX,KAAD,CAAhB;AACH;;AAED,MAAIF,OAAJ,EAAa;AACTE,IAAAA,MAAM,GAAGC,4BAAA,CAACI,OAAD;AAASC,MAAAA,KAAK,EAAER;KAAhB,EAA0BE,MAA1B,CAAT;AACH;;AAED,SAAOA,MAAP;AACH;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { forwardRef, useState, useEffect, createElement, memo } from 'react';
3
3
  import cn from 'classnames';
4
- import { useLocalization } from '../Provider/Provider.js';
5
4
  import { IconButton } from '../IconButton/IconButton.js';
6
5
  import ReactDayPicker from 'react-day-picker';
6
+ import { useLocalization } from '../Provider/Provider.js';
7
7
 
8
8
  var _excluded = ["onChange", "value"];
9
9
 
@@ -1,8 +1,8 @@
1
1
  import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { forwardRef, useRef, createElement } from 'react';
3
3
  import cn from 'classnames';
4
- import { Root, Anchor, Content } from '@radix-ui/react-popover';
5
4
  import { IconButton } from '../IconButton/IconButton.js';
5
+ import { Root, Anchor, Content } from '@radix-ui/react-popover';
6
6
  import { Input } from '../Input/Input.js';
7
7
  import { ScrollableList } from '../Listbox/ScrollableList.js';
8
8
  import { useCombobox } from './useCombobox.js';