@economic/taco 0.0.1-alpha.1533 → 0.0.1-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Backdrop/Backdrop.d.ts +3 -0
- package/dist/components/Button/Button.d.ts +39 -1
- package/dist/components/Button/util.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Dialog/Context.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +14 -12
- package/dist/components/Hanger/Hanger.d.ts +4 -9
- package/dist/components/Icon/components/MatchEntries.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +38 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation/Navigation.d.ts +4 -4
- package/dist/components/Popover/Popover.d.ts +5 -9
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/components/Select/useSelect.d.ts +1 -1
- package/dist/components/Table/Table.storyexample.d.ts +1 -1
- package/dist/components/Table/components/PaginatedTable.d.ts +2 -2
- package/dist/components/Table/components/Table.d.ts +2 -2
- package/dist/components/Table/components/WindowedTable.d.ts +2 -2
- package/dist/components/Table/types.d.ts +2 -2
- package/dist/components/Tabs/Tabs.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.d.ts +11 -1
- package/dist/components/Treeview/Treeview.d.ts +2 -2
- package/dist/esm/index.css +96 -119
- package/dist/esm/src/components/Backdrop/Backdrop.js +12 -0
- package/dist/esm/src/components/Backdrop/Backdrop.js.map +1 -0
- package/dist/esm/src/components/Button/Button.js +6 -9
- package/dist/esm/src/components/Button/Button.js.map +1 -1
- package/dist/esm/src/components/Button/util.js +42 -1
- package/dist/esm/src/components/Button/util.js.map +1 -1
- package/dist/esm/src/components/Calendar/Calendar.js +1 -1
- package/dist/esm/src/components/Checkbox/Checkbox.js +9 -1
- package/dist/esm/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/src/components/Combobox/useCombobox.js +1 -1
- package/dist/esm/src/components/Datepicker/Datepicker.js +2 -2
- package/dist/esm/src/components/Dialog/Context.js +1 -0
- package/dist/esm/src/components/Dialog/Context.js.map +1 -1
- package/dist/esm/src/components/Dialog/Dialog.js +5 -4
- package/dist/esm/src/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/src/components/Dialog/components/Content.js +13 -13
- package/dist/esm/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/src/components/Dialog/components/Drawer.js +2 -1
- package/dist/esm/src/components/Dialog/components/Drawer.js.map +1 -1
- package/dist/esm/src/components/Dialog/components/Extra.js +2 -1
- package/dist/esm/src/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/src/components/Dialog/components/Trigger.js +2 -1
- package/dist/esm/src/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/src/components/Hanger/Hanger.js +12 -9
- package/dist/esm/src/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/src/components/Icon/components/MatchEntries.js +18 -0
- package/dist/esm/src/components/Icon/components/MatchEntries.js.map +1 -0
- package/dist/esm/src/components/Icon/components/index.js +2 -0
- package/dist/esm/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/src/components/IconButton/IconButton.js +9 -11
- package/dist/esm/src/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/src/components/Input/util.js +6 -6
- package/dist/esm/src/components/Input/util.js.map +1 -1
- package/dist/esm/src/components/Listbox/ScrollableList.js +1 -1
- package/dist/esm/src/components/Navigation/Navigation.js +5 -4
- package/dist/esm/src/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/src/components/Pagination/PageNumbers.js +1 -1
- package/dist/esm/src/components/Pagination/Pagination.js +2 -1
- package/dist/esm/src/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/src/components/Popover/Popover.js +9 -6
- package/dist/esm/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/src/components/SearchInput/SearchInput.js +8 -7
- package/dist/esm/src/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/src/components/Select/Select.js +2 -1
- package/dist/esm/src/components/Select/Select.js.map +1 -1
- package/dist/esm/src/components/Select/useSelect.js +12 -5
- package/dist/esm/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/src/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/src/components/Table/components/Table.js.map +1 -1
- package/dist/esm/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/src/components/Table/hooks/plugins/useRowActions.js +11 -5
- package/dist/esm/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/src/components/Table/hooks/plugins/useRowSelect.js +3 -3
- package/dist/esm/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/src/components/Table/util/renderColumn.js +4 -3
- package/dist/esm/src/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/src/components/Table/util/renderRow.js +4 -3
- package/dist/esm/src/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/src/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/src/components/Toast/Toast.js +1 -1
- package/dist/esm/src/components/Tooltip/Tooltip.js +11 -10
- package/dist/esm/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/src/components/Tour/Tour.js +2 -2
- package/dist/esm/src/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/src/index.js +8 -7
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/primitives/Button.js +2 -12
- package/dist/esm/src/primitives/Button.js.map +1 -1
- package/dist/esm/src/utils/mergeRefs.js +14 -0
- package/dist/esm/src/utils/mergeRefs.js.map +1 -0
- package/dist/index.css +96 -119
- package/dist/index.d.ts +1 -0
- package/dist/primitives/Button.d.ts +0 -4
- package/dist/taco.cjs.development.js +1660 -1570
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/mergeRefs.d.ts +2 -0
- package/dist/utils/tailwind.d.ts +1 -1
- package/package.json +5 -3
- package/plugins/tailwindcss-aria-attributes.js +73 -0
- package/types.json +7310 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
import { createElement } from 'react';
|
2
|
+
import cn from 'classnames';
|
3
|
+
|
4
|
+
var Backdrop = function Backdrop(props) {
|
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
|
+
return createElement("div", Object.assign({}, props, {
|
7
|
+
className: className
|
8
|
+
}));
|
9
|
+
};
|
10
|
+
|
11
|
+
export { Backdrop };
|
12
|
+
//# sourceMappingURL=Backdrop.js.map
|
@@ -0,0 +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,8 +1,7 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import { forwardRef
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
+
import { forwardRef } from 'react';
|
3
3
|
import cn from 'classnames';
|
4
|
-
import {
|
5
|
-
import { getButtonClasses, getAppearanceClasses } from './util.js';
|
4
|
+
import { getButtonClasses, getAppearanceClasses, createButton } from './util.js';
|
6
5
|
|
7
6
|
var _excluded = ["appearance", "fluid"];
|
8
7
|
var Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
|
@@ -15,11 +14,9 @@ var Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
|
|
15
14
|
'focus:yt-focus active:focus:yt-focus': !props.disabled,
|
16
15
|
'w-full': fluid
|
17
16
|
}, props.className);
|
18
|
-
return
|
19
|
-
|
20
|
-
|
21
|
-
ref: ref
|
22
|
-
}));
|
17
|
+
return createButton(_extends({}, otherProps, {
|
18
|
+
'data-taco': 'button'
|
19
|
+
}), className, ref);
|
23
20
|
});
|
24
21
|
|
25
22
|
export { Button };
|
@@ -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 './
|
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,3 +1,12 @@
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
+
import React__default from 'react';
|
3
|
+
import { Button } from '../../primitives/Button.js';
|
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
|
+
|
9
|
+
var _excluded = ["dialog", "hanger", "popover", "tooltip"];
|
1
10
|
var getButtonClasses = function getButtonClasses() {
|
2
11
|
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';
|
3
12
|
};
|
@@ -29,6 +38,38 @@ var getAppearanceClasses = function getAppearanceClasses(value, icon) {
|
|
29
38
|
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";
|
30
39
|
}
|
31
40
|
};
|
41
|
+
var createButton = function createButton(props, className, ref) {
|
42
|
+
var dialog = props.dialog,
|
43
|
+
hanger = props.hanger,
|
44
|
+
popover = props.popover,
|
45
|
+
tooltip = props.tooltip,
|
46
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
47
|
+
|
48
|
+
var button = React__default.createElement(Button, Object.assign({}, otherProps, {
|
49
|
+
className: className,
|
50
|
+
ref: ref
|
51
|
+
}));
|
52
|
+
|
53
|
+
if (hanger) {
|
54
|
+
button = React__default.createElement(Hanger, Object.assign({}, hanger.props), React__default.createElement(Hanger.Anchor, null, button), hanger.props.children);
|
55
|
+
}
|
56
|
+
|
57
|
+
if (dialog) {
|
58
|
+
button = React__default.createElement(Dialog, Object.assign({}, dialog.props), React__default.createElement(Dialog.Trigger, null, button), dialog.props.children);
|
59
|
+
}
|
60
|
+
|
61
|
+
if (popover) {
|
62
|
+
button = React__default.createElement(Popover, Object.assign({}, popover.props), React__default.createElement(Popover.Trigger, null, button), popover.props.children);
|
63
|
+
}
|
64
|
+
|
65
|
+
if (tooltip) {
|
66
|
+
button = React__default.createElement(Tooltip, {
|
67
|
+
title: tooltip
|
68
|
+
}, button);
|
69
|
+
}
|
70
|
+
|
71
|
+
return button;
|
72
|
+
};
|
32
73
|
|
33
|
-
export { getAppearanceClasses, getButtonClasses };
|
74
|
+
export { createButton, getAppearanceClasses, getButtonClasses };
|
34
75
|
//# sourceMappingURL=util.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../src/components/Button/util.
|
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,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,GAA4DH,KAA5D,CAAQG,MAAR;AAAA,MAAgBC,MAAhB,GAA4DJ,KAA5D,CAAgBI,MAAhB;AAAA,MAAwBC,OAAxB,GAA4DL,KAA5D,CAAwBK,OAAxB;AAAA,MAAiCC,OAAjC,GAA4DN,KAA5D,CAAiCM,OAAjC;AAAA,MAA6CC,UAA7C,iCAA4DP,KAA5D;;AAEA,MAAIQ,MAAM,GAAGC,4BAAA,CAACC,MAAD,oBAA4BH;AAAYN,IAAAA,SAAS,EAAEA;AAAWC,IAAAA,GAAG,EAAEA;IAAnE,CAAb;;AAEA,MAAIE,MAAJ,EAAY;AACRI,IAAAA,MAAM,GACFC,4BAAA,CAACE,MAAD,oBAAYP,MAAM,CAACJ,MAAnB,EACIS,4BAAA,CAACE,MAAM,CAACC,MAAR,MAAA,EAAgBJ,MAAhB,CADJ,EAEKJ,MAAM,CAACJ,KAAP,CAAaa,QAFlB,CADJ;AAMH;;AAED,MAAIV,MAAJ,EAAY;AACRK,IAAAA,MAAM,GACFC,4BAAA,CAACK,MAAD,oBAAYX,MAAM,CAACH,MAAnB,EACIS,4BAAA,CAACK,MAAM,CAACC,OAAR,MAAA,EAAiBP,MAAjB,CADJ,EAEKL,MAAM,CAACH,KAAP,CAAaa,QAFlB,CADJ;AAMH;;AAED,MAAIR,OAAJ,EAAa;AACTG,IAAAA,MAAM,GACFC,4BAAA,CAACO,OAAD,oBAAaX,OAAO,CAACL,MAArB,EACIS,4BAAA,CAACO,OAAO,CAACD,OAAT,MAAA,EAAkBP,MAAlB,CADJ,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,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';
|
4
5
|
import { IconButton } from '../IconButton/IconButton.js';
|
5
6
|
import ReactDayPicker from 'react-day-picker';
|
6
|
-
import { useLocalization } from '../Provider/Provider.js';
|
7
7
|
|
8
8
|
var _excluded = ["onChange", "value"];
|
9
9
|
|
@@ -21,11 +21,19 @@ var Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, ref) {
|
|
21
21
|
'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
|
22
22
|
'border-red text-red focus:border-red focus:yt-focus-red': invalid && !props.disabled
|
23
23
|
}, props.className);
|
24
|
+
var handleChange;
|
25
|
+
|
26
|
+
if (onChange) {
|
27
|
+
handleChange = function handleChange(checked) {
|
28
|
+
return onChange(checked === 'indeterminate' ? false : checked);
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
24
32
|
var element = createElement(Root, Object.assign({}, otherProps, {
|
25
33
|
"data-taco": "checkbox",
|
26
34
|
checked: indeterminate ? 'indeterminate' : checked,
|
27
35
|
className: className,
|
28
|
-
onCheckedChange:
|
36
|
+
onCheckedChange: handleChange,
|
29
37
|
ref: ref
|
30
38
|
}), createElement(Indicator, {
|
31
39
|
className: "flex h-full w-full"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Icon } from '../Icon/Icon';\n\ntype CheckboxBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /* Increases visual prominenance of the checkbox */\n highlighted?: boolean;\n /**\n * Indeterminate state should only be used with sub-checkboxes. The indeterminate state is shown if not all\n * sub-checkboxes are selected. This only affects the style, changing the icon in the checkbox.\n */\n indeterminate?: boolean;\n /* Whether the checkbox is in an invalid state */\n invalid?: boolean;\n /** Label for the checkbox */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledCheckboxProps extends CheckboxBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledCheckboxProps extends CheckboxBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Icon } from '../Icon/Icon';\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /* Increases visual prominenance of the checkbox */\n highlighted?: boolean;\n /**\n * Indeterminate state should only be used with sub-checkboxes. The indeterminate state is shown if not all\n * sub-checkboxes are selected. This only affects the style, changing the icon in the checkbox.\n */\n indeterminate?: boolean;\n /* Whether the checkbox is in an invalid state */\n invalid?: boolean;\n /** Label for the checkbox */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledCheckboxProps extends CheckboxBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledCheckboxProps extends CheckboxBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean) => void;\n}\n\nexport type CheckboxProps = UncontrolledCheckboxProps | ControlledCheckboxProps;\n\nexport const Checkbox = React.forwardRef(function Checkbox(props: CheckboxProps, ref: React.Ref<HTMLButtonElement>) {\n const { checked, highlighted, indeterminate, invalid, label, onChange, ...otherProps } = props;\n\n const className = cn(\n 'h-5 w-5 border rounded text-sm',\n {\n 'mr-2': !!label,\n 'border-grey-dark text-blue focus:border-blue focus:yt-focus': !props.disabled && !invalid,\n 'border-grey text-blue-light cursor-not-allowed': props.disabled,\n 'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,\n 'border-red text-red focus:border-red focus:yt-focus-red': invalid && !props.disabled,\n },\n props.className\n );\n\n let handleChange: ((checked: CheckedState) => void) | undefined;\n\n if (onChange) {\n handleChange = (checked: CheckedState) => onChange(checked === 'indeterminate' ? false : checked);\n }\n\n const element = (\n <CheckboxPrimitive.Root\n {...otherProps}\n data-taco=\"checkbox\"\n checked={indeterminate ? 'indeterminate' : checked}\n className={className}\n onCheckedChange={handleChange}\n ref={ref}\n >\n <CheckboxPrimitive.Indicator className=\"flex h-full w-full\">\n <Icon name={indeterminate ? 'line' : 'tick'} className=\"!h-full !w-full\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n if (label) {\n const labelClassName = cn('flex items-center cursor-pointer', {\n 'cursor-not-allowed text-grey-dark': props.disabled,\n });\n\n return (\n <label className={labelClassName}>\n {element}\n {label}\n </label>\n );\n }\n\n return element;\n});\n"],"names":["Checkbox","React","props","ref","checked","highlighted","indeterminate","invalid","label","onChange","otherProps","className","cn","disabled","handleChange","element","CheckboxPrimitive","onCheckedChange","Icon","name","labelClassName"],"mappings":";;;;;;;IAwCaA,QAAQ,gBAAGC,UAAA,CAAiB,SAASD,QAAT,CAAkBE,KAAlB,EAAwCC,GAAxC;AACrC,MAAQC,OAAR,GAAyFF,KAAzF,CAAQE,OAAR;AAAA,MAAiBC,WAAjB,GAAyFH,KAAzF,CAAiBG,WAAjB;AAAA,MAA8BC,aAA9B,GAAyFJ,KAAzF,CAA8BI,aAA9B;AAAA,MAA6CC,OAA7C,GAAyFL,KAAzF,CAA6CK,OAA7C;AAAA,MAAsDC,KAAtD,GAAyFN,KAAzF,CAAsDM,KAAtD;AAAA,MAA6DC,QAA7D,GAAyFP,KAAzF,CAA6DO,QAA7D;AAAA,MAA0EC,UAA1E,iCAAyFR,KAAzF;;AAEA,MAAMS,SAAS,GAAGC,EAAE,CAChB,gCADgB,EAEhB;AACI,YAAQ,CAAC,CAACJ,KADd;AAEI,mEAA+D,CAACN,KAAK,CAACW,QAAP,IAAmB,CAACN,OAFvF;AAGI,sDAAkDL,KAAK,CAACW,QAH5D;AAII,oEAAgER,WAJpE;AAKI,+DAA2DE,OAAO,IAAI,CAACL,KAAK,CAACW;AALjF,GAFgB,EAShBX,KAAK,CAACS,SATU,CAApB;AAYA,MAAIG,YAAJ;;AAEA,MAAIL,QAAJ,EAAc;AACVK,IAAAA,YAAY,GAAG,sBAACV,OAAD;AAAA,aAA2BK,QAAQ,CAACL,OAAO,KAAK,eAAZ,GAA8B,KAA9B,GAAsCA,OAAvC,CAAnC;AAAA,KAAf;AACH;;AAED,MAAMW,OAAO,GACTd,aAAA,CAACe,IAAD,oBACQN;iBACM;AACVN,IAAAA,OAAO,EAAEE,aAAa,GAAG,eAAH,GAAqBF;AAC3CO,IAAAA,SAAS,EAAEA;AACXM,IAAAA,eAAe,EAAEH;AACjBX,IAAAA,GAAG,EAAEA;IANT,EAQIF,aAAA,CAACe,SAAD;AAA6BL,IAAAA,SAAS,EAAC;GAAvC,EACIV,aAAA,CAACiB,IAAD;AAAMC,IAAAA,IAAI,EAAEb,aAAa,GAAG,MAAH,GAAY;AAAQK,IAAAA,SAAS,EAAC;GAAvD,CADJ,CARJ,CADJ;;AAeA,MAAIH,KAAJ,EAAW;AACP,QAAMY,cAAc,GAAGR,EAAE,CAAC,kCAAD,EAAqC;AAC1D,2CAAqCV,KAAK,CAACW;AADe,KAArC,CAAzB;AAIA,WACIZ,aAAA,QAAA;AAAOU,MAAAA,SAAS,EAAES;KAAlB,EACKL,OADL,EAEKP,KAFL,CADJ;AAMH;;AAED,SAAOO,OAAP;AACH,CAlDuB;;;;"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { extends as _extends, objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
2
|
import { useRef, useMemo, useState, useEffect } from 'react';
|
3
3
|
import { v4 } from 'uuid';
|
4
|
-
import { usePopoverState } from 'reakit/Popover';
|
5
4
|
import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
|
5
|
+
import { usePopoverState } from 'reakit/Popover';
|
6
6
|
import keycode from 'keycode';
|
7
7
|
import { getId } from '../Listbox/ScrollableList.js';
|
8
8
|
import { createCustomKeyboardEvent } from '../../utils/input.js';
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
2
|
import { forwardRef, createElement } from 'react';
|
3
3
|
import cn from 'classnames';
|
4
|
-
import { IconButton } from '../IconButton/IconButton.js';
|
5
4
|
import { useLocalization } from '../Provider/Provider.js';
|
5
|
+
import { Popover } from '../Popover/Popover.js';
|
6
|
+
import { IconButton } from '../IconButton/IconButton.js';
|
6
7
|
import { Calendar } from '../Calendar/Calendar.js';
|
7
8
|
import { Input } from '../Input/Input.js';
|
8
9
|
import { useDatepicker } from './useDatepicker.js';
|
9
|
-
import { Popover } from '../Popover/Popover.js';
|
10
10
|
|
11
11
|
var _excluded = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
12
12
|
var Datepicker = /*#__PURE__*/forwardRef(function Datepicker(props, ref) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../../src/components/Dialog/Context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport * as React from 'react';\nimport { DialogSize } from './types';\n\nexport type DialogContext = {\n draggable: boolean;\n drawer?: {\n open: boolean;\n toggle: () => void;\n };\n elements: {\n drawer?: React.ReactNode;\n extra?: React.ReactNode;\n };\n close: () => void;\n onClose?: () => void;\n props: {};\n size: DialogSize;\n};\n\nexport const DialogContext = React.createContext<DialogContext>({\n close: () => {},\n draggable: false,\n drawer: undefined,\n elements: {\n drawer: undefined,\n extra: undefined,\n },\n onClose: () => {},\n props: {},\n size: 'sm',\n});\n\nexport const useCurrentDialog = () => {\n return React.useContext(DialogContext);\n};\n"],"names":["DialogContext","React","close","draggable","drawer","undefined","elements","extra","onClose","props","size","useCurrentDialog"],"mappings":";;AAAA;
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../../src/components/Dialog/Context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport * as React from 'react';\nimport { DialogSize } from './types';\n\nexport type DialogContext = {\n draggable: boolean;\n drawer?: {\n open: boolean;\n toggle: () => void;\n };\n elements: {\n drawer?: React.ReactNode;\n extra?: React.ReactNode;\n };\n close: () => void;\n onClose?: () => void;\n props: {};\n ref: React.Ref<HTMLElement>;\n size: DialogSize;\n};\n\nexport const DialogContext = React.createContext<DialogContext>({\n close: () => {},\n draggable: false,\n drawer: undefined,\n elements: {\n drawer: undefined,\n extra: undefined,\n },\n onClose: () => {},\n props: {},\n ref: null,\n size: 'sm',\n});\n\nexport const useCurrentDialog = () => {\n return React.useContext(DialogContext);\n};\n"],"names":["DialogContext","React","close","draggable","drawer","undefined","elements","extra","onClose","props","ref","size","useCurrentDialog"],"mappings":";;AAAA;IAqBaA,aAAa,gBAAGC,aAAA,CAAmC;AAC5DC,EAAAA,KAAK,EAAE,mBADqD;AAE5DC,EAAAA,SAAS,EAAE,KAFiD;AAG5DC,EAAAA,MAAM,EAAEC,SAHoD;AAI5DC,EAAAA,QAAQ,EAAE;AACNF,IAAAA,MAAM,EAAEC,SADF;AAENE,IAAAA,KAAK,EAAEF;AAFD,GAJkD;AAQ5DG,EAAAA,OAAO,EAAE,qBARmD;AAS5DC,EAAAA,KAAK,EAAE,EATqD;AAU5DC,EAAAA,GAAG,EAAE,IAVuD;AAW5DC,EAAAA,IAAI,EAAE;AAXsD,CAAnC;IAchBC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAC5B,SAAOX,UAAA,CAAiBD,aAAjB,CAAP;AACH;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import { useMemo, Children, useState, createElement } from 'react';
|
2
|
+
import { forwardRef, useMemo, Children, useState, createElement } from 'react';
|
3
3
|
import { Root } from '@radix-ui/react-dialog';
|
4
4
|
import { DialogContext } from './Context.js';
|
5
5
|
import { Trigger } from './components/Trigger.js';
|
@@ -27,7 +27,7 @@ var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
|
27
27
|
}, [initialChildren]);
|
28
28
|
};
|
29
29
|
|
30
|
-
var Dialog = function
|
30
|
+
var Dialog = /*#__PURE__*/forwardRef(function (props, ref) {
|
31
31
|
var initialChildren = props.children,
|
32
32
|
_props$draggable = props.draggable,
|
33
33
|
draggable = _props$draggable === void 0 ? false : _props$draggable,
|
@@ -70,7 +70,8 @@ var Dialog = function Dialog(props) {
|
|
70
70
|
},
|
71
71
|
onClose: onClose,
|
72
72
|
props: otherProps,
|
73
|
-
size: size
|
73
|
+
size: size,
|
74
|
+
ref: ref
|
74
75
|
};
|
75
76
|
}, [open, drawerOpen, drawer, extra, otherProps]);
|
76
77
|
return createElement(DialogContext.Provider, {
|
@@ -80,7 +81,7 @@ var Dialog = function Dialog(props) {
|
|
80
81
|
open: open,
|
81
82
|
onOpenChange: setOpen
|
82
83
|
}));
|
83
|
-
};
|
84
|
+
});
|
84
85
|
Dialog.Trigger = Trigger;
|
85
86
|
Dialog.Content = Content;
|
86
87
|
Dialog.Title = Title;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport './Dialog.css';\nimport { Trigger } from './components/Trigger';\nimport {
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport './Dialog.css';\nimport { DialogTriggerProps, Trigger } from './components/Trigger';\nimport {\n Content,\n Title,\n Footer,\n Close,\n DialogContentProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n} from './components/Content';\nimport { DialogDrawerProps, Drawer } from './components/Drawer';\nimport { DialogExtraProps, Extra } from './components/Extra';\nimport { DialogContext } from './Context';\nimport { DialogSize } from './types';\n\nexport { DialogContentProps, DialogTitleProps, DialogFooterProps, DialogCloseProps };\n\nexport type DialogTexts = {\n /**\n * Aria-label for close icon button in dialog.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n close: string;\n drag: string;\n};\n\nexport type DialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** Allows dragging the dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Handler called when dialog closes by user interaction */\n onClose?: () => void;\n /** Set whether the dialog is open by default or not, use when not providing a trigger */\n open?: boolean;\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\n size?: DialogSize;\n};\n\nconst useSeparatedChildren = initialChildren => {\n return React.useMemo(() => {\n const children: any[] = [];\n let drawer;\n let extra;\n\n React.Children.forEach(initialChildren, (child: any) => {\n if (child.type.displayName === 'Drawer') {\n drawer = child;\n } else if (child.type.displayName === 'Extra') {\n extra = child;\n } else {\n children.push(child);\n }\n });\n\n return [children, drawer, extra];\n }, [initialChildren]);\n};\n\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps>;\n Content: React.ForwardRefExoticComponent<DialogContentProps>;\n Title: React.ForwardRefExoticComponent<DialogTitleProps>;\n Footer: React.ForwardRefExoticComponent<DialogFooterProps>;\n Extra: React.ForwardRefExoticComponent<DialogExtraProps>;\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps>;\n Close: React.ForwardRefExoticComponent<DialogCloseProps>;\n};\n\nexport const Dialog = React.forwardRef((props: DialogProps, ref: React.Ref<HTMLElement>): JSX.Element => {\n const { children: initialChildren, draggable = false, onClose, open: defaultOpen, size = 'sm', ...otherProps } = props;\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\n\n const [open, setOpen] = React.useState(defaultOpen);\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n\n const context = React.useMemo(\n () => ({\n close: () => setOpen(false),\n draggable,\n drawer: {\n open: drawerOpen,\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\n },\n elements: {\n drawer,\n extra,\n },\n onClose,\n props: otherProps,\n size,\n ref,\n }),\n [open, drawerOpen, drawer, extra, otherProps]\n );\n\n return (\n <DialogContext.Provider value={context}>\n <DialogPrimitive.Root children={children} open={open} onOpenChange={setOpen} />\n </DialogContext.Provider>\n );\n}) as ForwardedDialogWithStatics;\n\nDialog.Trigger = Trigger;\nDialog.Content = Content;\nDialog.Title = Title;\nDialog.Footer = Footer;\nDialog.Extra = Extra;\nDialog.Drawer = Drawer;\nDialog.Close = Close;\n"],"names":["useSeparatedChildren","initialChildren","React","children","drawer","extra","forEach","child","type","displayName","push","Dialog","props","ref","draggable","onClose","defaultOpen","open","size","otherProps","setOpen","drawerOpen","setDrawerOpen","context","close","toggle","isDrawerOpen","elements","DialogContext","Provider","value","DialogPrimitive","onOpenChange","Trigger","Content","Title","Footer","Extra","Drawer","Close"],"mappings":";;;;;;;;;;;AA0CA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAAC,eAAe;AACxC,SAAOC,OAAA,CAAc;AACjB,QAAMC,QAAQ,GAAU,EAAxB;AACA,QAAIC,MAAJ;AACA,QAAIC,KAAJ;AAEAH,IAAAA,QAAA,CAAeI,OAAf,CAAuBL,eAAvB,EAAwC,UAACM,KAAD;AACpC,UAAIA,KAAK,CAACC,IAAN,CAAWC,WAAX,KAA2B,QAA/B,EAAyC;AACrCL,QAAAA,MAAM,GAAGG,KAAT;AACH,OAFD,MAEO,IAAIA,KAAK,CAACC,IAAN,CAAWC,WAAX,KAA2B,OAA/B,EAAwC;AAC3CJ,QAAAA,KAAK,GAAGE,KAAR;AACH,OAFM,MAEA;AACHJ,QAAAA,QAAQ,CAACO,IAAT,CAAcH,KAAd;AACH;AACJ,KARD;AAUA,WAAO,CAACJ,QAAD,EAAWC,MAAX,EAAmBC,KAAnB,CAAP;AACH,GAhBM,EAgBJ,CAACJ,eAAD,CAhBI,CAAP;AAiBH,CAlBD;;IA8BaU,MAAM,gBAAGT,UAAA,CAAiB,UAACU,KAAD,EAAqBC,GAArB;AACnC,MAAkBZ,eAAlB,GAAiHW,KAAjH,CAAQT,QAAR;AAAA,yBAAiHS,KAAjH,CAAmCE,SAAnC;AAAA,MAAmCA,SAAnC,iCAA+C,KAA/C;AAAA,MAAsDC,OAAtD,GAAiHH,KAAjH,CAAsDG,OAAtD;AAAA,MAAqEC,WAArE,GAAiHJ,KAAjH,CAA+DK,IAA/D;AAAA,oBAAiHL,KAAjH,CAAkFM,IAAlF;AAAA,MAAkFA,IAAlF,4BAAyF,IAAzF;AAAA,MAAkGC,UAAlG,iCAAiHP,KAAjH;;AACA,8BAAkCZ,oBAAoB,CAACC,eAAD,CAAtD;AAAA,MAAOE,QAAP;AAAA,MAAiBC,MAAjB;AAAA,MAAyBC,KAAzB;;AAEA,wBAAwBH,QAAA,CAAec,WAAf,CAAxB;AAAA,MAAOC,IAAP;AAAA,MAAaG,OAAb;;AACA,yBAAoClB,QAAA,CAAe,KAAf,CAApC;AAAA,MAAOmB,UAAP;AAAA,MAAmBC,aAAnB;;AAEA,MAAMC,OAAO,GAAGrB,OAAA,CACZ;AAAA,WAAO;AACHsB,MAAAA,KAAK,EAAE;AAAA,eAAMJ,OAAO,CAAC,KAAD,CAAb;AAAA,OADJ;AAEHN,MAAAA,SAAS,EAATA,SAFG;AAGHV,MAAAA,MAAM,EAAE;AACJa,QAAAA,IAAI,EAAEI,UADF;AAEJI,QAAAA,MAAM,EAAE;AAAA,iBAAMH,aAAa,CAAC,UAAAI,YAAY;AAAA,mBAAI,CAACA,YAAL;AAAA,WAAb,CAAnB;AAAA;AAFJ,OAHL;AAOHC,MAAAA,QAAQ,EAAE;AACNvB,QAAAA,MAAM,EAANA,MADM;AAENC,QAAAA,KAAK,EAALA;AAFM,OAPP;AAWHU,MAAAA,OAAO,EAAPA,OAXG;AAYHH,MAAAA,KAAK,EAAEO,UAZJ;AAaHD,MAAAA,IAAI,EAAJA,IAbG;AAcHL,MAAAA,GAAG,EAAHA;AAdG,KAAP;AAAA,GADY,EAiBZ,CAACI,IAAD,EAAOI,UAAP,EAAmBjB,MAAnB,EAA2BC,KAA3B,EAAkCc,UAAlC,CAjBY,CAAhB;AAoBA,SACIjB,aAAA,CAAC0B,aAAa,CAACC,QAAf;AAAwBC,IAAAA,KAAK,EAAEP;GAA/B,EACIrB,aAAA,CAAC6B,IAAD;AAAsB5B,IAAAA,QAAQ,EAAEA;AAAUc,IAAAA,IAAI,EAAEA;AAAMe,IAAAA,YAAY,EAAEZ;GAApE,CADJ,CADJ;AAKH,CAhCqB;AAkCtBT,MAAM,CAACsB,OAAP,GAAiBA,OAAjB;AACAtB,MAAM,CAACuB,OAAP,GAAiBA,OAAjB;AACAvB,MAAM,CAACwB,KAAP,GAAeA,KAAf;AACAxB,MAAM,CAACyB,MAAP,GAAgBA,MAAhB;AACAzB,MAAM,CAAC0B,KAAP,GAAeA,KAAf;AACA1B,MAAM,CAAC2B,MAAP,GAAgBA,MAAhB;AACA3B,MAAM,CAAC4B,KAAP,GAAeA,KAAf;;;;"}
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
2
|
import { forwardRef, createElement } from 'react';
|
3
3
|
import cn from 'classnames';
|
4
|
-
import {
|
4
|
+
import { Backdrop } from '../../Backdrop/Backdrop.js';
|
5
5
|
import { useLocalization } from '../../Provider/Provider.js';
|
6
|
-
import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
|
7
6
|
import { Title as Title$1, Close as Close$1, Portal, Overlay, Content as Content$1 } from '@radix-ui/react-dialog';
|
8
7
|
import { useCurrentDialog } from '../Context.js';
|
8
|
+
import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
|
9
9
|
import { useDraggable } from '../../../utils/hooks/useDraggable.js';
|
10
10
|
import { useCurrentMenu } from '../../Menu/Context.js';
|
11
11
|
import { Group } from '../../Group/Group.js';
|
12
|
+
import { IconButton } from '../../IconButton/IconButton.js';
|
12
13
|
|
13
14
|
var Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
|
14
15
|
return createElement(Title$1, Object.assign({}, props, {
|
@@ -18,7 +19,7 @@ var Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
|
|
18
19
|
});
|
19
20
|
var Footer = /*#__PURE__*/forwardRef(function DialogFooter(props, ref) {
|
20
21
|
return createElement("div", Object.assign({}, props, {
|
21
|
-
className: "flex justify-end
|
22
|
+
className: "mt-8 flex justify-end",
|
22
23
|
ref: ref
|
23
24
|
}), createElement(Group, null, props.children));
|
24
25
|
});
|
@@ -53,17 +54,16 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
53
54
|
};
|
54
55
|
}
|
55
56
|
|
56
|
-
var className = cn('bg-white
|
57
|
+
var className = cn('bg-white rounded mt-16 mx-auto', {
|
57
58
|
'w-128 text-center justify-center': dialog.size === 'dialog',
|
58
59
|
'w-xs': dialog.size === 'xs',
|
59
60
|
'w-sm': dialog.size === 'sm',
|
60
61
|
'w-md': dialog.size === 'md',
|
61
62
|
'w-lg': dialog.size === 'lg'
|
62
63
|
});
|
63
|
-
var containerClassName = cn('
|
64
|
+
var containerClassName = cn('bg-white p-6 rounded relative z-[999]', 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]', {
|
64
65
|
'rounded-b-none': !!dialog.elements.extra
|
65
|
-
}, props.className);
|
66
|
-
var overlayClassName = cn('fixed inset-0 cursor-default overflow-y-auto bg-[rgba(50,46,62,0.8)] animate-[fade-in_150ms] aria-hidden:hidden'); // the chosen behaviour in taco is that outside clicks do not close the dialog
|
66
|
+
}, props.className); // the chosen behaviour in taco is that outside clicks do not close the dialog
|
67
67
|
|
68
68
|
var handleInteractOutside = function handleInteractOutside(event) {
|
69
69
|
return event.preventDefault();
|
@@ -81,10 +81,9 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
81
81
|
}
|
82
82
|
|
83
83
|
return createElement(Portal, null, createElement(Overlay, {
|
84
|
-
|
85
|
-
}, createElement(Content$1, Object.assign({}, props, {
|
84
|
+
asChild: true
|
85
|
+
}, createElement(Backdrop, null, createElement(Content$1, Object.assign({}, props, {
|
86
86
|
className: className,
|
87
|
-
"data-taco": "dialog",
|
88
87
|
onEscapeKeyDown: dialog.onClose,
|
89
88
|
onInteractOutside: handleInteractOutside,
|
90
89
|
onCloseAutoFocus: handleCloseAutoFocus,
|
@@ -94,10 +93,11 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
94
93
|
top: dialog.draggable ? "calc(50% + " + position.y + "px)" : undefined
|
95
94
|
})
|
96
95
|
}), createElement("div", {
|
97
|
-
className: containerClassName
|
96
|
+
className: containerClassName,
|
97
|
+
"data-taco": "dialog"
|
98
98
|
}, output, dialog.draggable && createElement("div", Object.assign({}, dragHandleProps, {
|
99
99
|
"aria-label": texts.dialog.drag,
|
100
|
-
className: "yt-dialog__drag absolute-center-x
|
100
|
+
className: "yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center"
|
101
101
|
})), createElement(Close$1, {
|
102
102
|
asChild: true,
|
103
103
|
onClick: dialog.onClose
|
@@ -106,7 +106,7 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
106
106
|
"aria-label": texts.dialog.close,
|
107
107
|
className: "absolute top-0 right-0 mt-2 mr-2",
|
108
108
|
icon: "close"
|
109
|
-
}))), dialog.elements.drawer, dialog.elements.extra)));
|
109
|
+
}))), dialog.elements.drawer, dialog.elements.extra))));
|
110
110
|
});
|
111
111
|
|
112
112
|
export { Close, Content, Footer, Title };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Content.js","sources":["../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Provider';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Group } from '../../Group/Group';\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: {\n open: boolean;\n toggle: () => void;\n };\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n return <DialogPrimitive.Title {...props} className=\"text-center\" ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n return (\n <div {...props} className=\"flex justify-end
|
1
|
+
{"version":3,"file":"Content.js","sources":["../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Provider';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Group } from '../../Group/Group';\nimport { Backdrop } from '../../Backdrop/Backdrop';\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: {\n open: boolean;\n toggle: () => void;\n };\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n return <DialogPrimitive.Title {...props} className=\"text-center\" ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n return (\n <div {...props} className=\"mt-8 flex justify-end\" ref={ref}>\n <Group>{props.children}</Group>\n </div>\n );\n});\n\nexport type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n\n return <DialogPrimitive.Close onClick={dialog.onClose} {...props} ref={ref} asChild />;\n});\n\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible description to be announced when the dialog is opened */\n 'aria-describedby': string;\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);\n};\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const internalRef = useProxiedRef<HTMLDivElement>(ref);\n const { position, handleProps: dragHandleProps } = useDraggable(internalRef);\n const { texts } = useLocalization();\n\n // if the dialog was opened by a menu, we need to close the menu when the dialog closes\n // the menu is still open (and mounted) because it is the trigger for the dialog\n const menu = useCurrentMenu();\n let handleCloseAutoFocus;\n\n if (menu) {\n handleCloseAutoFocus = () => menu.close();\n }\n\n const className = cn('bg-white rounded mt-16 mx-auto', {\n 'w-128 text-center 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 const containerClassName = cn(\n 'bg-white p-6 rounded relative z-[999]',\n 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]',\n {\n 'rounded-b-none': !!dialog.elements.extra,\n },\n props.className\n );\n\n // the chosen behaviour in taco is that outside clicks do not close the dialog\n const handleInteractOutside = event => event.preventDefault();\n\n let output;\n\n if (typeof props.children === 'function') {\n output = props.children({ drawer: dialog.drawer, close: dialog.close });\n } else {\n output = props.children;\n }\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay asChild>\n <Backdrop>\n <DialogPrimitive.Content\n {...props}\n className={className}\n onEscapeKeyDown={dialog.onClose}\n onInteractOutside={handleInteractOutside}\n onCloseAutoFocus={handleCloseAutoFocus}\n ref={ref}\n style={{\n ...props.style,\n left: dialog.draggable ? `calc(50% + ${position.x}px)` : undefined,\n top: dialog.draggable ? `calc(50% + ${position.y}px)` : undefined,\n }}\n >\n <div className={containerClassName} data-taco=\"dialog\">\n {output}\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n aria-label={texts.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 <DialogPrimitive.Close asChild onClick={dialog.onClose}>\n <IconButton\n appearance=\"discrete\"\n aria-label={texts.dialog.close}\n className=\"absolute top-0 right-0 mt-2 mr-2\"\n icon=\"close\"\n />\n </DialogPrimitive.Close>\n </div>\n {dialog.elements.drawer}\n {dialog.elements.extra}\n </DialogPrimitive.Content>\n </Backdrop>\n </DialogPrimitive.Overlay>\n </DialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","DialogTitle","props","ref","DialogPrimitive","className","Footer","DialogFooter","Group","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","Content","DialogContent","internalRef","useProxiedRef","useDraggable","position","dragHandleProps","handleProps","useLocalization","texts","menu","useCurrentMenu","handleCloseAutoFocus","close","cn","size","containerClassName","elements","extra","handleInteractOutside","event","preventDefault","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","onCloseAutoFocus","style","left","draggable","x","undefined","top","y","drag","IconButton","appearance","icon"],"mappings":"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"}
|
@@ -7,7 +7,8 @@ var Drawer = /*#__PURE__*/forwardRef(function DialogDrawer(props, ref) {
|
|
7
7
|
|
8
8
|
var dialog = useCurrentDialog();
|
9
9
|
return createElement(motion.div, Object.assign({}, props, {
|
10
|
-
className: "
|
10
|
+
className: "absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left",
|
11
|
+
"data-taco": "dialog-drawer",
|
11
12
|
"aria-hidden": !((_dialog$drawer = dialog.drawer) !== null && _dialog$drawer !== void 0 && _dialog$drawer.open),
|
12
13
|
variants: {
|
13
14
|
visible: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Drawer.js","sources":["../../../../../../src/components/Dialog/components/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { motion } from 'framer-motion';\nimport { useCurrentDialog } from '../Context';\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n>;\n\nexport const Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n\n return (\n <motion.div\n {...props}\n className=\"
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../../../../../src/components/Dialog/components/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { motion } from 'framer-motion';\nimport { useCurrentDialog } from '../Context';\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n>;\n\nexport const Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n\n return (\n <motion.div\n {...props}\n className=\"absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left\"\n data-taco=\"dialog-drawer\"\n aria-hidden={!dialog.drawer?.open}\n variants={{\n visible: {\n left: '100%',\n display: 'block',\n transition: { ease: 'easeOut', duration: 0.2 },\n },\n hidden: {\n left: '0%',\n transition: { ease: 'easeOut', duration: 0.2 },\n transitionEnd: {\n display: 'none',\n },\n },\n }}\n animate={dialog.drawer?.open ? 'visible' : 'hidden'}\n ref={ref}\n />\n );\n});\n"],"names":["Drawer","React","DialogDrawer","props","ref","dialog","useCurrentDialog","motion","div","className","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate"],"mappings":";;;;IASaA,MAAM,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAAsBC,KAAtB,EAAgDC,GAAhD;;;AACnC,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;AAEA,SACIL,aAAA,CAACM,MAAM,CAACC,GAAR,oBACQL;AACJM,IAAAA,SAAS,EAAC;iBACA;mBACG,oBAACJ,MAAM,CAACK,MAAR,2CAAC,eAAeC,IAAhB;AACbC,IAAAA,QAAQ,EAAE;AACNC,MAAAA,OAAO,EAAE;AACLC,QAAAA,IAAI,EAAE,MADD;AAELC,QAAAA,OAAO,EAAE,OAFJ;AAGLC,QAAAA,UAAU,EAAE;AAAEC,UAAAA,IAAI,EAAE,SAAR;AAAmBC,UAAAA,QAAQ,EAAE;AAA7B;AAHP,OADH;AAMNC,MAAAA,MAAM,EAAE;AACJL,QAAAA,IAAI,EAAE,IADF;AAEJE,QAAAA,UAAU,EAAE;AAAEC,UAAAA,IAAI,EAAE,SAAR;AAAmBC,UAAAA,QAAQ,EAAE;AAA7B,SAFR;AAGJE,QAAAA,aAAa,EAAE;AACXL,UAAAA,OAAO,EAAE;AADE;AAHX;AANF;AAcVM,IAAAA,OAAO,EAAE,mBAAAhB,MAAM,CAACK,MAAP,4DAAeC,IAAf,GAAsB,SAAtB,GAAkC;AAC3CP,IAAAA,GAAG,EAAEA;IApBT,CADJ;AAwBH,CA3BqB;;;;"}
|
@@ -2,7 +2,8 @@ import { forwardRef, createElement } from 'react';
|
|
2
2
|
|
3
3
|
var Extra = /*#__PURE__*/forwardRef(function (props, ref) {
|
4
4
|
return createElement("div", Object.assign({}, props, {
|
5
|
-
className: "bg-grey-light
|
5
|
+
className: "bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left",
|
6
|
+
"data-taco": "dialog-extra",
|
6
7
|
ref: ref
|
7
8
|
}));
|
8
9
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Extra.js","sources":["../../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Extra = React.forwardRef(function (props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\n return (\n <div\n {...props}\n className=\"bg-grey-light
|
1
|
+
{"version":3,"file":"Extra.js","sources":["../../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Extra = React.forwardRef(function (props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\n return (\n <div\n {...props}\n className=\"bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left\"\n data-taco=\"dialog-extra\"\n ref={ref}\n />\n );\n});\n"],"names":["Extra","React","props","ref","className"],"mappings":";;IAIaA,KAAK,gBAAGC,UAAA,CAAiB,UAAUC,KAAV,EAAmCC,GAAnC;AAClC,SACIF,aAAA,MAAA,oBACQC;AACJE,IAAAA,SAAS,EAAC;iBACA;AACVD,IAAAA,GAAG,EAAEA;IAJT,CADJ;AAQH,CAToB;;;;"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { forwardRef, createElement } from 'react';
|
2
|
+
import mergeRefs from '../../../utils/mergeRefs.js';
|
2
3
|
import { Trigger as Trigger$1 } from '@radix-ui/react-dialog';
|
3
4
|
import { useCurrentDialog } from '../Context.js';
|
4
5
|
|
5
6
|
var Trigger = /*#__PURE__*/forwardRef(function DialogTrigger(props, ref) {
|
6
7
|
var dialog = useCurrentDialog();
|
7
8
|
return createElement(Trigger$1, Object.assign({}, dialog.props, props, {
|
8
|
-
ref: ref,
|
9
|
+
ref: mergeRefs([dialog.ref, ref]),
|
9
10
|
asChild: true
|
10
11
|
}));
|
11
12
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Trigger.js","sources":["../../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useCurrentDialog } from '../Context';\n\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Trigger = React.forwardRef(function DialogTrigger(props: DialogTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n return <DialogPrimitive.Trigger {...dialog.props} {...props} ref={ref} asChild />;\n});\n"],"names":["Trigger","React","DialogTrigger","props","ref","dialog","useCurrentDialog","DialogPrimitive","asChild"],"mappings":"
|
1
|
+
{"version":3,"file":"Trigger.js","sources":["../../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useCurrentDialog } from '../Context';\nimport mergeRefs from '../../../utils/mergeRefs';\n\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Trigger = React.forwardRef(function DialogTrigger(props: DialogTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n return <DialogPrimitive.Trigger {...dialog.props} {...props} ref={mergeRefs([dialog.ref, ref])} asChild />;\n});\n"],"names":["Trigger","React","DialogTrigger","props","ref","dialog","useCurrentDialog","DialogPrimitive","mergeRefs","asChild"],"mappings":";;;;;IAOaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,aAAT,CAAuBC,KAAvB,EAAkDC,GAAlD;AACpC,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;AACA,SAAOL,aAAA,CAACM,SAAD,oBAA6BF,MAAM,CAACF,OAAWA;AAAOC,IAAAA,GAAG,EAAEI,SAAS,CAAC,CAACH,MAAM,CAACD,GAAR,EAAaA,GAAb,CAAD;AAAqBK,IAAAA,OAAO;IAAhG,CAAP;AACH,CAHsB;;;;"}
|
@@ -1,19 +1,21 @@
|
|
1
1
|
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import { useMemo, createElement, createContext,
|
2
|
+
import { forwardRef, useMemo, createElement, createContext, useContext } from 'react';
|
3
3
|
import cn from 'classnames';
|
4
|
-
import { IconButton } from '../IconButton/IconButton.js';
|
5
|
-
import { useLocalization } from '../Provider/Provider.js';
|
6
4
|
import { Root, Anchor as Anchor$1, Close } from '@radix-ui/react-popover';
|
7
5
|
import { UnstyledContent, UnstyledArrow } from '../Popover/Primitives.js';
|
6
|
+
import { useLocalization } from '../Provider/Provider.js';
|
7
|
+
import mergeRefs from '../../utils/mergeRefs.js';
|
8
|
+
import { IconButton } from '../IconButton/IconButton.js';
|
8
9
|
|
9
10
|
var _excluded = ["children"];
|
10
11
|
var HangerContext = /*#__PURE__*/createContext({
|
11
|
-
props: {}
|
12
|
+
props: {},
|
13
|
+
ref: null
|
12
14
|
});
|
13
15
|
var Anchor = /*#__PURE__*/forwardRef(function (props, ref) {
|
14
16
|
var context = useContext(HangerContext);
|
15
17
|
return createElement(Anchor$1, Object.assign({}, context.props, props, {
|
16
|
-
ref: ref,
|
18
|
+
ref: mergeRefs([context.ref, ref]),
|
17
19
|
asChild: true
|
18
20
|
}));
|
19
21
|
});
|
@@ -40,18 +42,19 @@ var Content = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
40
42
|
}, createElement(IconButton, {
|
41
43
|
appearance: "primary",
|
42
44
|
"aria-label": texts.hanger.close,
|
43
|
-
className: "
|
45
|
+
className: "absolute top-0 right-0 ml-2 mr-2 mt-2 text-white",
|
44
46
|
icon: "close",
|
45
47
|
onClick: props.onClose
|
46
48
|
})));
|
47
49
|
});
|
48
|
-
var Hanger = function
|
50
|
+
var Hanger = /*#__PURE__*/forwardRef(function (props, ref) {
|
49
51
|
var children = props.children,
|
50
52
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
51
53
|
|
52
54
|
var context = useMemo(function () {
|
53
55
|
return {
|
54
|
-
props: otherProps
|
56
|
+
props: otherProps,
|
57
|
+
ref: ref
|
55
58
|
};
|
56
59
|
}, [otherProps]);
|
57
60
|
return createElement(HangerContext.Provider, {
|
@@ -60,7 +63,7 @@ var Hanger = function Hanger(props) {
|
|
60
63
|
children: children,
|
61
64
|
defaultOpen: true
|
62
65
|
}));
|
63
|
-
};
|
66
|
+
});
|
64
67
|
Hanger.Anchor = Anchor;
|
65
68
|
Hanger.Content = Content;
|
66
69
|
|