@economic/taco 1.11.1 → 1.12.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 (48) hide show
  1. package/dist/components/AlertDialog/AlertDialog.d.ts +29 -0
  2. package/dist/components/AlertDialog/AlertDialog.stories.d.ts +25 -0
  3. package/dist/components/AlertDialog/Context.d.ts +11 -0
  4. package/dist/components/AlertDialog/components/Content.d.ts +13 -0
  5. package/dist/components/AlertDialog/components/Footer.d.ts +7 -0
  6. package/dist/components/AlertDialog/components/Trigger.d.ts +3 -0
  7. package/dist/components/Badge/Badge.stories.d.ts +1 -1
  8. package/dist/components/Button/Button.stories.d.ts +4 -0
  9. package/dist/components/Table/util/sortTypes.d.ts +1 -1
  10. package/dist/esm/components/AlertDialog/AlertDialog.js +42 -0
  11. package/dist/esm/components/AlertDialog/AlertDialog.js.map +1 -0
  12. package/dist/esm/components/AlertDialog/Context.js +16 -0
  13. package/dist/esm/components/AlertDialog/Context.js.map +1 -0
  14. package/dist/esm/components/AlertDialog/components/Content.js +46 -0
  15. package/dist/esm/components/AlertDialog/components/Content.js.map +1 -0
  16. package/dist/esm/components/AlertDialog/components/Footer.js +26 -0
  17. package/dist/esm/components/AlertDialog/components/Footer.js.map +1 -0
  18. package/dist/esm/components/AlertDialog/components/Trigger.js +15 -0
  19. package/dist/esm/components/AlertDialog/components/Trigger.js.map +1 -0
  20. package/dist/esm/components/Card/Card.js +4 -3
  21. package/dist/esm/components/Card/Card.js.map +1 -1
  22. package/dist/esm/components/Combobox/useCombobox.js +1 -1
  23. package/dist/esm/components/Datepicker/useDatepicker.js +1 -1
  24. package/dist/esm/components/Dialog/components/Content.js +2 -2
  25. package/dist/esm/components/Hanger/Hanger.js +1 -1
  26. package/dist/esm/components/Input/Input.js +1 -1
  27. package/dist/esm/components/Listbox/ScrollableList.js +1 -1
  28. package/dist/esm/components/Listbox/useListbox.js +1 -1
  29. package/dist/esm/components/Listbox/useMultiListbox.js +1 -1
  30. package/dist/esm/components/Navigation/Navigation.js +1 -1
  31. package/dist/esm/components/Popover/Popover.js +1 -1
  32. package/dist/esm/components/SearchInput/SearchInput.js +4 -3
  33. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  34. package/dist/esm/components/Select/useSelect.js +1 -1
  35. package/dist/esm/components/Table/components/WindowedTable.js +1 -1
  36. package/dist/esm/components/Table/hooks/useTable.js +3 -2
  37. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  38. package/dist/esm/components/Table/util/sortTypes.js +46 -25
  39. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  40. package/dist/esm/index.js +4 -3
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/index.d.ts +1 -0
  43. package/dist/taco.cjs.development.js +267 -133
  44. package/dist/taco.cjs.development.js.map +1 -1
  45. package/dist/taco.cjs.production.min.js +1 -1
  46. package/dist/taco.cjs.production.min.js.map +1 -1
  47. package/package.json +4 -3
  48. package/types.json +339 -180
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import { AlertDialogTriggerProps } from './components/Trigger';
3
+ import { AlertDialogCancelProps, AlertDialogActionProps, AlertDialogFooterProps } from './components/Footer';
4
+ import { AlertDialogContentProps, AlertDialogTitleProps } from './components/Content';
5
+ import { DialogSize } from '../Dialog/types';
6
+ export declare type AlertDialogProps = {
7
+ children: React.ReactNode | React.ReactNode[];
8
+ /** Set whether the alert dialog is open by default or not, use when not providing a trigger */
9
+ defaultOpen?: boolean;
10
+ /** Allows dragging the alert dialog around the screen (window constrained) */
11
+ draggable?: boolean;
12
+ /** Called when the alert dialog opens or closes, must be used in conjunction with open */
13
+ onChange?: (open: boolean) => void;
14
+ /** Control the open state of the dialog from outside the component */
15
+ open?: boolean;
16
+ /** Size of the alert dialog. This is the recommended way to set a size for alert dialog component. */
17
+ size?: DialogSize;
18
+ /** A trigger to be used for the alert dialog, should not be set if `children` already contains a trigger */
19
+ trigger?: JSX.Element;
20
+ };
21
+ export declare type ForwardedAlertDialogWithStatics = React.ForwardRefExoticComponent<AlertDialogProps & React.RefAttributes<HTMLElement>> & {
22
+ Trigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
23
+ Content: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
24
+ Title: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
25
+ Footer: React.ForwardRefExoticComponent<AlertDialogFooterProps & React.RefAttributes<HTMLDivElement>>;
26
+ Action: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
27
+ Cancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
28
+ };
29
+ export declare const AlertDialog: ForwardedAlertDialogWithStatics;
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ import { AlertDialogProps } from './AlertDialog';
3
+ import { DialogProps } from '../../index';
4
+ declare const _default: {
5
+ title: string;
6
+ component: import("./AlertDialog").ForwardedAlertDialogWithStatics;
7
+ argTypes: {
8
+ trigger: {
9
+ control: boolean;
10
+ };
11
+ };
12
+ };
13
+ export default _default;
14
+ export declare const Basic: (args: AlertDialogProps) => JSX.Element;
15
+ export declare const Draggable: {
16
+ (args: DialogProps): JSX.Element;
17
+ args: {
18
+ draggable: boolean;
19
+ size: string;
20
+ };
21
+ };
22
+ export declare const OpenByDefault: {
23
+ (args: DialogProps): JSX.Element;
24
+ storyName: string;
25
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { DialogSize } from '../Dialog/types';
3
+ export declare type AlertDialogContext = {
4
+ draggable: boolean;
5
+ onClose?: () => void;
6
+ props: {};
7
+ ref: React.Ref<HTMLElement>;
8
+ size: DialogSize;
9
+ };
10
+ export declare const AlertDialogContext: React.Context<AlertDialogContext>;
11
+ export declare const useCurrentAlertDialog: () => AlertDialogContext;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export declare type AlertDialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
3
+ export declare const Title: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
4
+ export declare type AlertDialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
5
+ /** An accessible label to be announced when the dialog is opened */
6
+ 'aria-label': string;
7
+ children: React.ReactNode;
8
+ };
9
+ 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"> & {
10
+ /** An accessible label to be announced when the dialog is opened */
11
+ 'aria-label': string;
12
+ children: React.ReactNode;
13
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export declare type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Footer: React.ForwardRefExoticComponent<AlertDialogFooterProps & React.RefAttributes<HTMLDivElement>>;
4
+ export declare type AlertDialogCancelProps = React.HTMLAttributes<HTMLButtonElement>;
5
+ export declare const Cancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
6
+ export declare type AlertDialogActionProps = React.HTMLAttributes<HTMLButtonElement>;
7
+ export declare const Action: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ export declare type AlertDialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;
3
+ export declare const Trigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -5,7 +5,7 @@ declare const _default: {
5
5
  children: React.ReactNode;
6
6
  compact?: boolean | undefined;
7
7
  outline?: boolean | undefined;
8
- state?: "warning" | "information" | "default" | "success" | "error" | undefined;
8
+ state?: "warning" | "default" | "information" | "success" | "error" | undefined;
9
9
  } & React.RefAttributes<HTMLSpanElement>>;
10
10
  };
11
11
  export default _default;
@@ -58,6 +58,10 @@ export declare const WithDialog: {
58
58
  (args: ButtonProps): JSX.Element;
59
59
  storyName: string;
60
60
  };
61
+ export declare const WithAlertDialog: {
62
+ (args: ButtonProps): JSX.Element;
63
+ storyName: string;
64
+ };
61
65
  export declare const WithPopover: {
62
66
  (args: ButtonProps): JSX.Element;
63
67
  storyName: string;
@@ -1,4 +1,4 @@
1
1
  import { SortTypes, TableRow } from '../types';
2
2
  declare type SortHandler<T> = (rowA: TableRow<T>, rowB: TableRow<T>, columnId: string) => 0 | 1 | -1;
3
- export declare const sortTypes: Record<SortTypes, SortHandler<any>>;
3
+ export declare const sortTypes: (locale: string) => Record<SortTypes, SortHandler<any>>;
4
4
  export {};
@@ -0,0 +1,42 @@
1
+ import { forwardRef, useMemo, createElement } from 'react';
2
+ import { Root } from '@radix-ui/react-alert-dialog';
3
+ import { AlertDialogContext } from './Context.js';
4
+ import { Trigger } from './components/Trigger.js';
5
+ import { Cancel, Action, Footer } from './components/Footer.js';
6
+ import { Content, Title } from './components/Content.js';
7
+
8
+ const AlertDialog = /*#__PURE__*/forwardRef(function AlertDialog(props, ref) {
9
+ const {
10
+ children: initialChildren,
11
+ defaultOpen,
12
+ draggable = false,
13
+ size = 'dialog',
14
+ onChange,
15
+ open,
16
+ trigger,
17
+ ...otherProps
18
+ } = props;
19
+ const context = useMemo(() => ({
20
+ ref,
21
+ draggable,
22
+ props: otherProps,
23
+ size,
24
+ trigger
25
+ }), [draggable, open, otherProps]);
26
+ return /*#__PURE__*/createElement(AlertDialogContext.Provider, {
27
+ value: context
28
+ }, /*#__PURE__*/createElement(Root, Object.assign({}, props, {
29
+ defaultOpen: defaultOpen,
30
+ open: open,
31
+ onOpenChange: onChange
32
+ }), trigger && /*#__PURE__*/createElement(Trigger, null, trigger), props.children));
33
+ });
34
+ AlertDialog.Trigger = Trigger;
35
+ AlertDialog.Content = Content;
36
+ AlertDialog.Title = Title;
37
+ AlertDialog.Cancel = Cancel;
38
+ AlertDialog.Action = Action;
39
+ AlertDialog.Footer = Footer;
40
+
41
+ export { AlertDialog };
42
+ //# sourceMappingURL=AlertDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertDialog.js","sources":["../../../../src/components/AlertDialog/AlertDialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport { AlertDialogContext } from './Context';\nimport { Trigger, AlertDialogTriggerProps } from './components/Trigger';\nimport {\n Cancel,\n Action,\n Footer,\n AlertDialogCancelProps,\n AlertDialogActionProps,\n AlertDialogFooterProps,\n} from './components/Footer';\nimport { Title, Content, AlertDialogContentProps, AlertDialogTitleProps } from './components/Content';\nimport { DialogSize } from '../Dialog/types';\n\nexport type AlertDialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** Set whether the alert dialog is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Allows dragging the alert dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Called when the alert dialog opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the dialog from outside the component */\n open?: boolean;\n /** Size of the alert dialog. This is the recommended way to set a size for alert dialog component. */\n size?: DialogSize;\n /** A trigger to be used for the alert dialog, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n};\n\nexport type ForwardedAlertDialogWithStatics = React.ForwardRefExoticComponent<\n AlertDialogProps & React.RefAttributes<HTMLElement>\n> & {\n Trigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<AlertDialogFooterProps & React.RefAttributes<HTMLDivElement>>;\n Action: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;\n Cancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;\n};\n\nexport const AlertDialog = React.forwardRef(function AlertDialog(props: AlertDialogProps, ref: React.Ref<HTMLElement>) {\n const {\n children: initialChildren,\n defaultOpen,\n draggable = false,\n size = 'dialog',\n onChange,\n open,\n trigger,\n ...otherProps\n } = props;\n\n const context = React.useMemo(\n () => ({\n ref,\n draggable,\n props: otherProps,\n size,\n trigger,\n }),\n [draggable, open, otherProps]\n );\n\n return (\n <AlertDialogContext.Provider value={context}>\n <AlertDialogPrimitive.Root {...props} defaultOpen={defaultOpen} open={open} onOpenChange={onChange}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {props.children}\n </AlertDialogPrimitive.Root>\n </AlertDialogContext.Provider>\n );\n}) as ForwardedAlertDialogWithStatics;\n\nAlertDialog.Trigger = Trigger;\nAlertDialog.Content = Content;\nAlertDialog.Title = Title;\nAlertDialog.Cancel = Cancel;\nAlertDialog.Action = Action;\nAlertDialog.Footer = Footer;\n"],"names":["AlertDialog","React","props","ref","children","initialChildren","defaultOpen","draggable","size","onChange","open","trigger","otherProps","context","AlertDialogContext","Provider","value","AlertDialogPrimitive","onOpenChange","Trigger","Content","Title","Cancel","Action","Footer"],"mappings":";;;;;;;MA0CaA,WAAW,gBAAGC,UAAA,CAAiB,SAASD,WAAT,CAAqBE,KAArB,EAA8CC,GAA9C;EACxC,MAAM;IACFC,QAAQ,EAAEC,eADR;IAEFC,WAFE;IAGFC,SAAS,GAAG,KAHV;IAIFC,IAAI,GAAG,QAJL;IAKFC,QALE;IAMFC,IANE;IAOFC,OAPE;IAQF,GAAGC;MACHV,KATJ;EAWA,MAAMW,OAAO,GAAGZ,OAAA,CACZ,OAAO;IACHE,GADG;IAEHI,SAFG;IAGHL,KAAK,EAAEU,UAHJ;IAIHJ,IAJG;IAKHG;GALJ,CADY,EAQZ,CAACJ,SAAD,EAAYG,IAAZ,EAAkBE,UAAlB,CARY,CAAhB;EAWA,oBACIX,aAAA,CAACa,kBAAkB,CAACC,QAApB;IAA6BC,KAAK,EAAEH;GAApC,eACIZ,aAAA,CAACgB,IAAD,oBAA+Bf;IAAOI,WAAW,EAAEA;IAAaI,IAAI,EAAEA;IAAMQ,YAAY,EAAET;IAA1F,EACKE,OAAO,iBAAIV,aAAA,CAACkB,OAAD,MAAA,EAAUR,OAAV,CADhB,EAEKT,KAAK,CAACE,QAFX,CADJ,CADJ;AAQH,CA/B0B;AAiC3BJ,WAAW,CAACmB,OAAZ,GAAsBA,OAAtB;AACAnB,WAAW,CAACoB,OAAZ,GAAsBA,OAAtB;AACApB,WAAW,CAACqB,KAAZ,GAAoBA,KAApB;AACArB,WAAW,CAACsB,MAAZ,GAAqBA,MAArB;AACAtB,WAAW,CAACuB,MAAZ,GAAqBA,MAArB;AACAvB,WAAW,CAACwB,MAAZ,GAAqBA,MAArB;;;;"}
@@ -0,0 +1,16 @@
1
+ import React__default from 'react';
2
+
3
+ /* eslint-disable @typescript-eslint/no-empty-function */
4
+ const AlertDialogContext = /*#__PURE__*/React__default.createContext({
5
+ draggable: false,
6
+ onClose: () => {},
7
+ props: {},
8
+ ref: null,
9
+ size: 'dialog'
10
+ });
11
+ const useCurrentAlertDialog = () => {
12
+ return React__default.useContext(AlertDialogContext);
13
+ };
14
+
15
+ export { AlertDialogContext, useCurrentAlertDialog };
16
+ //# sourceMappingURL=Context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.js","sources":["../../../../src/components/AlertDialog/Context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport React from 'react';\nimport { DialogSize } from '../Dialog/types';\n\nexport type AlertDialogContext = {\n draggable: boolean;\n onClose?: () => void;\n props: {};\n ref: React.Ref<HTMLElement>;\n size: DialogSize;\n};\n\nexport const AlertDialogContext = React.createContext<AlertDialogContext>({\n draggable: false,\n onClose: () => {},\n props: {},\n ref: null,\n size: 'dialog',\n});\n\nexport const useCurrentAlertDialog = () => {\n return React.useContext(AlertDialogContext);\n};\n"],"names":["AlertDialogContext","React","createContext","draggable","onClose","props","ref","size","useCurrentAlertDialog","useContext"],"mappings":";;AAAA;MAYaA,kBAAkB,gBAAGC,cAAK,CAACC,aAAN,CAAwC;EACtEC,SAAS,EAAE,KAD2D;EAEtEC,OAAO,EAAE,QAF6D;EAGtEC,KAAK,EAAE,EAH+D;EAItEC,GAAG,EAAE,IAJiE;EAKtEC,IAAI,EAAE;AALgE,CAAxC;MAQrBC,qBAAqB,GAAG;EACjC,OAAOP,cAAK,CAACQ,UAAN,CAAiBT,kBAAjB,CAAP;AACH;;;;"}
@@ -0,0 +1,46 @@
1
+ import { forwardRef, createElement } from 'react';
2
+ import { Title as Title$1, Portal, Overlay, Content as Content$1 } from '@radix-ui/react-alert-dialog';
3
+ import { useCurrentAlertDialog } from '../Context.js';
4
+ import cn from 'classnames';
5
+ import { Backdrop } from '../../Backdrop/Backdrop.js';
6
+ import { useDraggable } from '../../../utils/hooks/useDraggable.js';
7
+ import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
8
+
9
+ const Title = /*#__PURE__*/forwardRef(function AlertDialogTitle(props, ref) {
10
+ const className = cn('text-center', props.className);
11
+ return /*#__PURE__*/createElement(Title$1, Object.assign({}, props, {
12
+ className: className,
13
+ ref: ref
14
+ }));
15
+ });
16
+ const Content = /*#__PURE__*/forwardRef(function AlertDialogContent(props, ref) {
17
+ const dialog = useCurrentAlertDialog();
18
+ const internalRef = useProxiedRef(ref);
19
+ const {
20
+ position,
21
+ handleProps: dragHandleProps
22
+ } = useDraggable(internalRef);
23
+ const className = cn('bg-white rounded relative p-6 mt-16 mx-auto origin-center rounded animate-[fade-in_150ms] z-[997] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]', {
24
+ 'w-128 justify-center': dialog.size === 'dialog',
25
+ 'w-xs': dialog.size === 'xs',
26
+ 'w-sm': dialog.size === 'sm',
27
+ 'w-md': dialog.size === 'md',
28
+ 'w-lg': dialog.size === 'lg'
29
+ });
30
+ return /*#__PURE__*/createElement(Portal, null, /*#__PURE__*/createElement(Overlay, {
31
+ asChild: true
32
+ }, /*#__PURE__*/createElement(Backdrop, null, /*#__PURE__*/createElement(Content$1, Object.assign({}, props, {
33
+ ref: ref,
34
+ className: className,
35
+ style: { ...props.style,
36
+ left: dialog.draggable ? `${position.x}px` : undefined,
37
+ top: dialog.draggable ? `${position.y}px` : undefined
38
+ }
39
+ }), dialog.draggable && /*#__PURE__*/createElement("div", Object.assign({}, dragHandleProps, {
40
+ "aria-label": 'alert-dialog-drag',
41
+ className: "yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center"
42
+ })), props.children))));
43
+ });
44
+
45
+ export { Content, Title };
46
+ //# sourceMappingURL=Content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Content.js","sources":["../../../../../src/components/AlertDialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport cn from 'classnames';\nimport { useCurrentAlertDialog } from '../Context';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\n\nexport type AlertDialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function AlertDialogTitle(\n props: AlertDialogTitleProps,\n ref: React.Ref<HTMLHeadingElement>\n) {\n const className = cn('text-center', props.className);\n return <AlertDialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type AlertDialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: React.ReactNode;\n};\nexport const Content = React.forwardRef(function AlertDialogContent(\n props: AlertDialogContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const dialog = useCurrentAlertDialog();\n const internalRef = useProxiedRef<HTMLDivElement>(ref);\n const { position, handleProps: dragHandleProps } = useDraggable(internalRef);\n const className = cn(\n 'bg-white rounded relative p-6 mt-16 mx-auto origin-center rounded animate-[fade-in_150ms] z-[997] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]',\n {\n 'w-128 justify-center': dialog.size === 'dialog',\n 'w-xs': dialog.size === 'xs',\n 'w-sm': dialog.size === 'sm',\n 'w-md': dialog.size === 'md',\n 'w-lg': dialog.size === 'lg',\n }\n );\n\n return (\n <AlertDialogPrimitive.Portal>\n <AlertDialogPrimitive.Overlay asChild>\n <Backdrop>\n <AlertDialogPrimitive.Content\n {...props}\n ref={ref}\n className={className}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${position.y}px` : undefined,\n }}>\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n aria-label={'alert-dialog-drag'}\n className=\"yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center\"\n />\n )}\n {props.children}\n </AlertDialogPrimitive.Content>\n </Backdrop>\n </AlertDialogPrimitive.Overlay>\n </AlertDialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","AlertDialogTitle","props","ref","className","cn","AlertDialogPrimitive","Content","AlertDialogContent","dialog","useCurrentAlertDialog","internalRef","useProxiedRef","position","handleProps","dragHandleProps","useDraggable","size","asChild","Backdrop","style","left","draggable","x","undefined","top","y","children"],"mappings":";;;;;;;;MASaA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,gBAAT,CAClCC,KADkC,EAElCC,GAFkC;EAIlC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAD,EAAgBH,KAAK,CAACE,SAAtB,CAApB;EACA,oBAAOJ,aAAA,CAACM,OAAD,oBAAgCJ;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAAlE,CAAP;AACH,CANoB;MAaRI,OAAO,gBAAGP,UAAA,CAAiB,SAASQ,kBAAT,CACpCN,KADoC,EAEpCC,GAFoC;EAIpC,MAAMM,MAAM,GAAGC,qBAAqB,EAApC;EACA,MAAMC,WAAW,GAAGC,aAAa,CAAiBT,GAAjB,CAAjC;EACA,MAAM;IAAEU,QAAF;IAAYC,WAAW,EAAEC;MAAoBC,YAAY,CAACL,WAAD,CAA/D;EACA,MAAMP,SAAS,GAAGC,EAAE,CAChB,wKADgB,EAEhB;IACI,wBAAwBI,MAAM,CAACQ,IAAP,KAAgB,QAD5C;IAEI,QAAQR,MAAM,CAACQ,IAAP,KAAgB,IAF5B;IAGI,QAAQR,MAAM,CAACQ,IAAP,KAAgB,IAH5B;IAII,QAAQR,MAAM,CAACQ,IAAP,KAAgB,IAJ5B;IAKI,QAAQR,MAAM,CAACQ,IAAP,KAAgB;GAPZ,CAApB;EAWA,oBACIjB,aAAA,CAACM,MAAD,MAAA,eACIN,aAAA,CAACM,OAAD;IAA8BY,OAAO;GAArC,eACIlB,aAAA,CAACmB,QAAD,MAAA,eACInB,aAAA,CAACM,SAAD,oBACQJ;IACJC,GAAG,EAAEA;IACLC,SAAS,EAAEA;IACXgB,KAAK,EAAE,EACH,GAAGlB,KAAK,CAACkB,KADN;MAEHC,IAAI,EAAEZ,MAAM,CAACa,SAAP,MAAsBT,QAAQ,CAACU,KAA/B,GAAuCC,SAF1C;MAGHC,GAAG,EAAEhB,MAAM,CAACa,SAAP,MAAsBT,QAAQ,CAACa,KAA/B,GAAuCF;;IAPpD,EASKf,MAAM,CAACa,SAAP,iBACGtB,aAAA,MAAA,oBACQe;kBACQ;IACZX,SAAS,EAAC;IAHd,CAVR,EAgBKF,KAAK,CAACyB,QAhBX,CADJ,CADJ,CADJ,CADJ;AA0BH,CA5CsB;;;;"}
@@ -0,0 +1,26 @@
1
+ import { forwardRef, createElement } from 'react';
2
+ import { Cancel as Cancel$1, Action as Action$1 } from '@radix-ui/react-alert-dialog';
3
+
4
+ const Footer = /*#__PURE__*/forwardRef(function AlertDialogFooter(props, ref) {
5
+ const className = 'flex justify-end gap-2';
6
+ return /*#__PURE__*/createElement("div", Object.assign({}, props, {
7
+ className: className,
8
+ ref: ref
9
+ }), props.children);
10
+ });
11
+ const Cancel = /*#__PURE__*/forwardRef(function AlertDialogCancel(props, ref) {
12
+ return /*#__PURE__*/createElement(Cancel$1, Object.assign({}, props, {
13
+ ref: ref,
14
+ asChild: true
15
+ }));
16
+ });
17
+ const Action = /*#__PURE__*/forwardRef(function AlertDialogAction(props, ref) {
18
+ return /*#__PURE__*/createElement(Action$1, Object.assign({}, props, {
19
+ className: props.className,
20
+ ref: ref,
21
+ asChild: true
22
+ }));
23
+ });
24
+
25
+ export { Action, Cancel, Footer };
26
+ //# sourceMappingURL=Footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Footer.js","sources":["../../../../../src/components/AlertDialog/components/Footer.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nexport type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function AlertDialogFooter(props: AlertDialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = 'flex justify-end gap-2';\n\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\n </div>\n );\n});\n\nexport type AlertDialogCancelProps = React.HTMLAttributes<HTMLButtonElement>;\nexport const Cancel = React.forwardRef(function AlertDialogCancel(\n props: AlertDialogCancelProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n return <AlertDialogPrimitive.Cancel {...props} ref={ref} asChild />;\n});\n\nexport type AlertDialogActionProps = React.HTMLAttributes<HTMLButtonElement>;\nexport const Action = React.forwardRef(function AlertDialogAction(\n props: AlertDialogActionProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n return <AlertDialogPrimitive.Action {...props} className={props.className} ref={ref} asChild />;\n});\n"],"names":["Footer","React","AlertDialogFooter","props","ref","className","children","Cancel","AlertDialogCancel","AlertDialogPrimitive","asChild","Action","AlertDialogAction"],"mappings":";;;MAIaA,MAAM,gBAAGC,UAAA,CAAiB,SAASC,iBAAT,CAA2BC,KAA3B,EAA0DC,GAA1D;EACnC,MAAMC,SAAS,GAAG,wBAAlB;EAEA,oBACIJ,aAAA,MAAA,oBAASE;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAA3C,EACKD,KAAK,CAACG,QADX,CADJ;AAKH,CARqB;MAWTC,MAAM,gBAAGN,UAAA,CAAiB,SAASO,iBAAT,CACnCL,KADmC,EAEnCC,GAFmC;EAInC,oBAAOH,aAAA,CAACQ,QAAD,oBAAiCN;IAAOC,GAAG,EAAEA;IAAKM,OAAO;IAAzD,CAAP;AACH,CALqB;MAQTC,MAAM,gBAAGV,UAAA,CAAiB,SAASW,iBAAT,CACnCT,KADmC,EAEnCC,GAFmC;EAInC,oBAAOH,aAAA,CAACQ,QAAD,oBAAiCN;IAAOE,SAAS,EAAEF,KAAK,CAACE;IAAWD,GAAG,EAAEA;IAAKM,OAAO;IAArF,CAAP;AACH,CALqB;;;;"}
@@ -0,0 +1,15 @@
1
+ import { forwardRef, createElement } from 'react';
2
+ import { Trigger as Trigger$1 } from '@radix-ui/react-alert-dialog';
3
+ import { useCurrentAlertDialog } from '../Context.js';
4
+ import { mergeRefs } from '../../../utils/mergeRefs.js';
5
+
6
+ const Trigger = /*#__PURE__*/forwardRef(function AlertDialogTrigger(props, ref) {
7
+ const dialog = useCurrentAlertDialog();
8
+ return /*#__PURE__*/createElement(Trigger$1, Object.assign({}, props, {
9
+ ref: mergeRefs([dialog.ref, ref]),
10
+ asChild: true
11
+ }));
12
+ });
13
+
14
+ export { Trigger };
15
+ //# sourceMappingURL=Trigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trigger.js","sources":["../../../../../src/components/AlertDialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport { useCurrentAlertDialog } from '../Context';\nimport { mergeRefs } from '../../../utils/mergeRefs';\n\nexport type AlertDialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\nexport const Trigger = React.forwardRef(function AlertDialogTrigger(\n props: AlertDialogTriggerProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n const dialog = useCurrentAlertDialog();\n return <AlertDialogPrimitive.Trigger {...props} ref={mergeRefs([dialog.ref, ref])} asChild />;\n});\n"],"names":["Trigger","React","AlertDialogTrigger","props","ref","dialog","useCurrentAlertDialog","AlertDialogPrimitive","mergeRefs","asChild"],"mappings":";;;;;MAMaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,kBAAT,CACpCC,KADoC,EAEpCC,GAFoC;EAIpC,MAAMC,MAAM,GAAGC,qBAAqB,EAApC;EACA,oBAAOL,aAAA,CAACM,SAAD,oBAAkCJ;IAAOC,GAAG,EAAEI,SAAS,CAAC,CAACH,MAAM,CAACD,GAAR,EAAaA,GAAb,CAAD;IAAqBK,OAAO;IAAnF,CAAP;AACH,CANsB;;;;"}
@@ -1,9 +1,12 @@
1
1
  import { forwardRef, createElement } from 'react';
2
+ import '../../utils/mergeRefs.js';
2
3
  import cn from 'classnames';
4
+ import '../Backdrop/Backdrop.js';
5
+ import '../../utils/hooks/useProxiedRef.js';
6
+ import '../AlertDialog/AlertDialog.js';
3
7
  import '../Icon/components/index.js';
4
8
  import '../Icon/Icon.js';
5
9
  import '../Accordion/Accordion.js';
6
- import '../Backdrop/Backdrop.js';
7
10
  import '../VisuallyHidden/VisuallyHidden.js';
8
11
  import '../Badge/Badge.js';
9
12
  import '../Tooltip/Tooltip.js';
@@ -15,14 +18,12 @@ import '../Toast/Toaster.js';
15
18
  import '../Provider/Provider.js';
16
19
  import '../Calendar/Calendar.js';
17
20
  import '../Checkbox/Checkbox.js';
18
- import '../../utils/hooks/useProxiedRef.js';
19
21
  import '../Input/Input.js';
20
22
  import '../../utils/hooks/useListKeyboardNavigation.js';
21
23
  import '../../utils/hooks/useListScrollTo.js';
22
24
  import '../../utils/hooks/useBoundingClientRectListener.js';
23
25
  import '../Combobox/Combobox.js';
24
26
  import '../../utils/date.js';
25
- import '../../utils/mergeRefs.js';
26
27
  import '../Popover/Popover.js';
27
28
  import '../Datepicker/Datepicker.js';
28
29
  import '../Dialog/Dialog.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport { MenuProps, IconButton } from '../..';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mt-4 mb-2 flex\">\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAMA,OAAO,gBAAGC,UAAA,CAAmD,SAASC,WAAT,CAAqBC,aAArB,EAAoCC,GAApC;EAC/D,MAAM;IAAEC,SAAF;IAAa,GAAGC;MAAUH,aAAhC;EACA,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBADgB,EAEhB;IACI,aAAa,CAACH;GAHF,EAKhBC,KAAK,CAACC,SALU,CAApB;EAOA,oBAAON,aAAA,MAAA,oBAASK;IAAOC,SAAS,EAAEA;IAAWH,GAAG,EAAEA;IAA3C,CAAP;AACH,CAVe,CAAhB;MAmBaK,IAAI,gBAAGR,UAAA,CAA4C,SAASQ,IAAT,CAAcH,KAAd,EAAqBF,GAArB;EAC5D,MAAM;IAAEM,KAAF;IAASC,IAAT;IAAeC;MAAaN,KAAlC;EACA,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGADgB,EAEhBF,KAAK,CAACC,SAFU,CAApB;EAKA,oBACIN,aAAA,MAAA;IAAKM,SAAS,EAAEA;iBAAqB;IAAOH,GAAG,EAAEA;GAAjD,eACIH,aAAA,MAAA;IAAKM,SAAS,EAAC;GAAf,EACKG,KAAK,iBAAIT,aAAA,KAAA;IAAIM,SAAS,EAAC;GAAd,EAA0CG,KAA1C,CADd,EAEKC,IAAI,gBAAGV,aAAA,CAACY,UAAD;IAAYC,IAAI,EAAC;IAAsBC,UAAU,EAAC;IAAWJ,IAAI,EAAEA;IAAMJ,SAAS,EAAC;GAAnF,CAAH,GAAuG,IAFhH,CADJ,EAKKK,QALL,CADJ;AASH,CAhBmB;AAmBpBH,IAAI,CAACT,OAAL,GAAeA,OAAf;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport { MenuProps, IconButton } from '../..';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mt-4 mb-2 flex\">\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAMA,OAAO,gBAAGC,UAAA,CAAmD,SAASC,WAAT,CAAqBC,aAArB,EAAoCC,GAApC;EAC/D,MAAM;IAAEC,SAAF;IAAa,GAAGC;MAAUH,aAAhC;EACA,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBADgB,EAEhB;IACI,aAAa,CAACH;GAHF,EAKhBC,KAAK,CAACC,SALU,CAApB;EAOA,oBAAON,aAAA,MAAA,oBAASK;IAAOC,SAAS,EAAEA;IAAWH,GAAG,EAAEA;IAA3C,CAAP;AACH,CAVe,CAAhB;MAmBaK,IAAI,gBAAGR,UAAA,CAA4C,SAASQ,IAAT,CAAcH,KAAd,EAAqBF,GAArB;EAC5D,MAAM;IAAEM,KAAF;IAASC,IAAT;IAAeC;MAAaN,KAAlC;EACA,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGADgB,EAEhBF,KAAK,CAACC,SAFU,CAApB;EAKA,oBACIN,aAAA,MAAA;IAAKM,SAAS,EAAEA;iBAAqB;IAAOH,GAAG,EAAEA;GAAjD,eACIH,aAAA,MAAA;IAAKM,SAAS,EAAC;GAAf,EACKG,KAAK,iBAAIT,aAAA,KAAA;IAAIM,SAAS,EAAC;GAAd,EAA0CG,KAA1C,CADd,EAEKC,IAAI,gBAAGV,aAAA,CAACY,UAAD;IAAYC,IAAI,EAAC;IAAsBC,UAAU,EAAC;IAAWJ,IAAI,EAAEA;IAAMJ,SAAS,EAAC;GAAnF,CAAH,GAAuG,IAFhH,CADJ,EAKKK,QALL,CADJ;AASH,CAhBmB;AAmBpBH,IAAI,CAACT,OAAL,GAAeA,OAAf;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { useRef, useState, useMemo, useEffect } from 'react';
2
- import { v4 } from 'uuid';
3
2
  import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
3
+ import { v4 } from 'uuid';
4
4
  import debounce from 'lodash-es/debounce';
5
5
  import { getId } from '../Listbox/ScrollableList.js';
6
6
  import { createCustomKeyboardEvent } from '../../utils/input.js';
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { useLocalization } from '../Provider/Provider.js';
3
2
  import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
3
+ import { useLocalization } from '../Provider/Provider.js';
4
4
  import { setInputValueByRef } from '../../utils/input.js';
5
5
  import { format, parseFromCustomString } from '../../utils/date.js';
6
6
 
@@ -1,12 +1,12 @@
1
1
  import { forwardRef, createElement } from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Backdrop } from '../../Backdrop/Backdrop.js';
4
+ import { useDraggable } from '../../../utils/hooks/useDraggable.js';
5
+ import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
4
6
  import { IconButton } from '../../IconButton/IconButton.js';
5
7
  import { useLocalization } from '../../Provider/Provider.js';
6
- import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
7
8
  import { Title as Title$1, Close as Close$1, Portal, Overlay, Content as Content$1 } from '@radix-ui/react-dialog';
8
9
  import { useCurrentDialog } from '../Context.js';
9
- import { useDraggable } from '../../../utils/hooks/useDraggable.js';
10
10
  import { useCurrentMenu } from '../../Menu/Context.js';
11
11
 
12
12
  const Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
@@ -1,10 +1,10 @@
1
1
  import { forwardRef, createElement, useMemo, useState, useEffect, createContext, useContext, isValidElement } from 'react';
2
+ import { mergeRefs } from '../../utils/mergeRefs.js';
2
3
  import cn from 'classnames';
3
4
  import { IconButton } from '../IconButton/IconButton.js';
4
5
  import { useLocalization } from '../Provider/Provider.js';
5
6
  import { Root, Anchor as Anchor$1, Close } from '@radix-ui/react-popover';
6
7
  import { UnstyledContent, UnstyledArrow } from '../Popover/Primitives.js';
7
- import { mergeRefs } from '../../utils/mergeRefs.js';
8
8
 
9
9
  const HangerContext = /*#__PURE__*/createContext({
10
10
  props: {},
@@ -1,7 +1,7 @@
1
1
  import { forwardRef, useEffect, createElement, cloneElement } from 'react';
2
2
  import cn from 'classnames';
3
- import { Icon } from '../Icon/Icon.js';
4
3
  import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
4
+ import { Icon } from '../Icon/Icon.js';
5
5
  import { getInputClasses, getButtonStateClasses } from './util.js';
6
6
 
7
7
  const Input = /*#__PURE__*/forwardRef(function Input(props, ref) {
@@ -1,9 +1,9 @@
1
1
  import { forwardRef, useMemo, createRef, useEffect, createElement } from 'react';
2
2
  import cn from 'classnames';
3
+ import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
3
4
  import { Spinner } from '../Spinner/Spinner.js';
4
5
  import { useLocalization } from '../Provider/Provider.js';
5
6
  import { Checkbox } from '../Checkbox/Checkbox.js';
6
- import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
7
7
  import { getInputClasses } from '../Input/util.js';
8
8
  import { getNextIndexFromKey } from '../../utils/hooks/useListKeyboardNavigation.js';
9
9
  import { useListScrollTo } from '../../utils/hooks/useListScrollTo.js';
@@ -1,6 +1,6 @@
1
1
  import { useMemo, useEffect } from 'react';
2
- import { v4 } from 'uuid';
3
2
  import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
3
+ import { v4 } from 'uuid';
4
4
  import { useFlattenedData, getIndexFromValue, getActiveDescendant, setInputValueByRef, findByValue, sanitizeItem } from './util.js';
5
5
  import { useTypeahead } from './useTypeahead.js';
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { useMemo, useState, useEffect } from 'react';
2
+ import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
2
3
  import { v4 } from 'uuid';
3
4
  import { useLocalization } from '../Provider/Provider.js';
4
- import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
5
5
  import { getIndexFromValue, getSelectedIndexesFromValue, setInputValueByRef, getActiveDescendant, findByValue } from './util.js';
6
6
  import { useTypeahead } from './useTypeahead.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import cn from 'classnames';
3
- import { Icon } from '../Icon/Icon.js';
4
3
  import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
4
+ import { Icon } from '../Icon/Icon.js';
5
5
  import { Treeview } from '../Treeview/Treeview.js';
6
6
  import { useDropTarget } from '../../utils/hooks/useDropTarget.js';
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { forwardRef, useMemo, createElement, createContext, useContext, isValidElement } from 'react';
2
+ import { mergeRefs } from '../../utils/mergeRefs.js';
2
3
  import cn from 'classnames';
3
4
  import { Root, Trigger as Trigger$1, Close as Close$1 } from '@radix-ui/react-popover';
4
5
  import { UnstyledContent, UnstyledArrow } from './Primitives.js';
5
- import { mergeRefs } from '../../utils/mergeRefs.js';
6
6
 
7
7
  const PopoverContext = /*#__PURE__*/createContext({
8
8
  props: {},
@@ -1,8 +1,11 @@
1
1
  import { forwardRef, createElement } from 'react';
2
+ import '../../utils/mergeRefs.js';
3
+ import '../Backdrop/Backdrop.js';
4
+ import '../../utils/hooks/useProxiedRef.js';
5
+ import '../AlertDialog/AlertDialog.js';
2
6
  import '../Icon/components/index.js';
3
7
  import '../Icon/Icon.js';
4
8
  import '../Accordion/Accordion.js';
5
- import '../Backdrop/Backdrop.js';
6
9
  import '../VisuallyHidden/VisuallyHidden.js';
7
10
  import '../Badge/Badge.js';
8
11
  import '../Tooltip/Tooltip.js';
@@ -15,14 +18,12 @@ import { useLocalization } from '../Provider/Provider.js';
15
18
  import '../Calendar/Calendar.js';
16
19
  import '../Card/Card.js';
17
20
  import '../Checkbox/Checkbox.js';
18
- import '../../utils/hooks/useProxiedRef.js';
19
21
  import { Input } from '../Input/Input.js';
20
22
  import '../../utils/hooks/useListKeyboardNavigation.js';
21
23
  import '../../utils/hooks/useListScrollTo.js';
22
24
  import '../../utils/hooks/useBoundingClientRectListener.js';
23
25
  import '../Combobox/Combobox.js';
24
26
  import '../../utils/date.js';
25
- import '../../utils/mergeRefs.js';
26
27
  import '../Popover/Popover.js';
27
28
  import '../Datepicker/Datepicker.js';
28
29
  import '../Dialog/Dialog.js';
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.js","sources":["../../../../src/components/SearchInput/SearchInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Input, InputProps, useLocalization, IconButton } from '../..';\n\nexport type SearchInputTexts = {\n /**\n * aria-label text for input\n */\n inputLabel: string;\n};\n\nexport type SearchInputProps = Omit<InputProps, 'icon'> & {\n /** Current input value will be passed to the method. In order to get the value, the component must be controlled otherwise value will always be undefined */\n onSearch?: (value: string | number | readonly string[] | undefined) => void;\n};\n\nexport const SearchInput = React.forwardRef(function SearchInput(\n { onSearch, ...props }: SearchInputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const { texts } = useLocalization();\n\n const handleClick = (): void => {\n if (!props.disabled) {\n onSearch?.(props.value);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n const isEnterKeyPressed = event.key === 'Enter';\n\n if (isEnterKeyPressed) {\n handleClick();\n }\n\n props.onKeyDown?.(event);\n };\n\n return (\n <Input\n aria-label={texts.searchInput.inputLabel}\n {...props}\n button={\n <IconButton\n icon=\"search\"\n className=\"!border-transparent !bg-transparent focus:!border-transparent peer-focus:!border-transparent peer-focus:peer-active:!border-transparent\"\n disabled={props.disabled}\n onClick={handleClick}\n />\n }\n onKeyDown={handleKeyDown}\n ref={ref}\n type=\"search\"\n />\n );\n});\n"],"names":["SearchInput","React","onSearch","props","ref","texts","useLocalization","handleClick","disabled","value","handleKeyDown","event","isEnterKeyPressed","key","onKeyDown","Input","searchInput","inputLabel","button","IconButton","icon","className","onClick","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeaA,WAAW,gBAAGC,UAAA,CAAiB,SAASD,WAAT,CACxC;EAAEE,QAAF;EAAY,GAAGC;AAAf,CADwC,EAExCC,GAFwC;EAIxC,MAAM;IAAEC;MAAUC,eAAe,EAAjC;;EAEA,MAAMC,WAAW,GAAG;IAChB,IAAI,CAACJ,KAAK,CAACK,QAAX,EAAqB;MACjBN,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAGC,KAAK,CAACM,KAAT,CAAR;;GAFR;;EAMA,MAAMC,aAAa,GAAIC,KAAD;;;IAClB,MAAMC,iBAAiB,GAAGD,KAAK,CAACE,GAAN,KAAc,OAAxC;;IAEA,IAAID,iBAAJ,EAAuB;MACnBL,WAAW;;;IAGf,oBAAAJ,KAAK,CAACW,SAAN,2EAAAX,KAAK,EAAaQ,KAAb,CAAL;GAPJ;;EAUA,oBACIV,aAAA,CAACc,KAAD;kBACgBV,KAAK,CAACW,WAAN,CAAkBC;KAC1Bd;IACJe,MAAM,eACFjB,aAAA,CAACkB,UAAD;MACIC,IAAI,EAAC;MACLC,SAAS,EAAC;MACVb,QAAQ,EAAEL,KAAK,CAACK;MAChBc,OAAO,EAAEf;KAJb;IAOJO,SAAS,EAAEJ;IACXN,GAAG,EAAEA;IACLmB,IAAI,EAAC;IAbT,CADJ;AAiBH,CAvC0B;;;;"}
1
+ {"version":3,"file":"SearchInput.js","sources":["../../../../src/components/SearchInput/SearchInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Input, InputProps, useLocalization, IconButton } from '../..';\n\nexport type SearchInputTexts = {\n /**\n * aria-label text for input\n */\n inputLabel: string;\n};\n\nexport type SearchInputProps = Omit<InputProps, 'icon'> & {\n /** Current input value will be passed to the method. In order to get the value, the component must be controlled otherwise value will always be undefined */\n onSearch?: (value: string | number | readonly string[] | undefined) => void;\n};\n\nexport const SearchInput = React.forwardRef(function SearchInput(\n { onSearch, ...props }: SearchInputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const { texts } = useLocalization();\n\n const handleClick = (): void => {\n if (!props.disabled) {\n onSearch?.(props.value);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n const isEnterKeyPressed = event.key === 'Enter';\n\n if (isEnterKeyPressed) {\n handleClick();\n }\n\n props.onKeyDown?.(event);\n };\n\n return (\n <Input\n aria-label={texts.searchInput.inputLabel}\n {...props}\n button={\n <IconButton\n icon=\"search\"\n className=\"!border-transparent !bg-transparent focus:!border-transparent peer-focus:!border-transparent peer-focus:peer-active:!border-transparent\"\n disabled={props.disabled}\n onClick={handleClick}\n />\n }\n onKeyDown={handleKeyDown}\n ref={ref}\n type=\"search\"\n />\n );\n});\n"],"names":["SearchInput","React","onSearch","props","ref","texts","useLocalization","handleClick","disabled","value","handleKeyDown","event","isEnterKeyPressed","key","onKeyDown","Input","searchInput","inputLabel","button","IconButton","icon","className","onClick","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeaA,WAAW,gBAAGC,UAAA,CAAiB,SAASD,WAAT,CACxC;EAAEE,QAAF;EAAY,GAAGC;AAAf,CADwC,EAExCC,GAFwC;EAIxC,MAAM;IAAEC;MAAUC,eAAe,EAAjC;;EAEA,MAAMC,WAAW,GAAG;IAChB,IAAI,CAACJ,KAAK,CAACK,QAAX,EAAqB;MACjBN,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAGC,KAAK,CAACM,KAAT,CAAR;;GAFR;;EAMA,MAAMC,aAAa,GAAIC,KAAD;;;IAClB,MAAMC,iBAAiB,GAAGD,KAAK,CAACE,GAAN,KAAc,OAAxC;;IAEA,IAAID,iBAAJ,EAAuB;MACnBL,WAAW;;;IAGf,oBAAAJ,KAAK,CAACW,SAAN,2EAAAX,KAAK,EAAaQ,KAAb,CAAL;GAPJ;;EAUA,oBACIV,aAAA,CAACc,KAAD;kBACgBV,KAAK,CAACW,WAAN,CAAkBC;KAC1Bd;IACJe,MAAM,eACFjB,aAAA,CAACkB,UAAD;MACIC,IAAI,EAAC;MACLC,SAAS,EAAC;MACVb,QAAQ,EAAEL,KAAK,CAACK;MAChBc,OAAO,EAAEf;KAJb;IAOJO,SAAS,EAAEJ;IACXN,GAAG,EAAEA;IACLmB,IAAI,EAAC;IAbT,CADJ;AAiBH,CAvC0B;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { useState, useMemo, useRef, useEffect, createElement, Fragment, cloneElement } from 'react';
2
2
  import cn from 'classnames';
3
+ import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
3
4
  import { v4 } from 'uuid';
4
5
  import { useLocalization } from '../Provider/Provider.js';
5
- import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
6
6
  import { createCustomEvent } from '../../utils/input.js';
7
7
  import { useFlattenedData, findByValue, setInputValueByRef, sanitizeItem } from '../Listbox/util.js';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import cn from 'classnames';
3
- import { useLocalization } from '../../Provider/Provider.js';
4
3
  import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
4
+ import { useLocalization } from '../../Provider/Provider.js';
5
5
  import { useBoundingClientRectListener } from '../../../utils/hooks/useBoundingClientRectListener.js';
6
6
  import { useTable } from '../hooks/useTable.js';
7
7
  import { Row } from '../util/renderRow.js';
@@ -120,7 +120,8 @@ const useTable = (props, ref) => {
120
120
  }
121
121
 
122
122
  const {
123
- texts
123
+ texts,
124
+ locale
124
125
  } = useLocalization();
125
126
  const {
126
127
  columns,
@@ -157,7 +158,7 @@ const useTable = (props, ref) => {
157
158
  autoResetSelectedRows: false,
158
159
  autoResetSortBy: false,
159
160
  autoResetPage: false,
160
- sortTypes: React__default.useMemo(() => sortTypes, []),
161
+ sortTypes: React__default.useMemo(() => sortTypes(locale), []),
161
162
  useControlledState: currentState => {
162
163
  return React__default.useMemo(() => ({ ...currentState,
163
164
  selectedRowIds: selectedRows || []