@economic/taco 1.1.4 → 1.1.5-alpha.102
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/README.md +82 -82
- package/dist/components/Icon/components/LogOut.d.ts +3 -0
- package/dist/components/Icon/components/Menu.d.ts +3 -0
- package/dist/components/Icon/components/Numbers.d.ts +3 -0
- package/dist/components/Icon/components/Profile.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -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/Tour/Tour.d.ts +2 -0
- package/dist/esm/components/Banner/util.js +1 -1
- package/dist/esm/components/Banner/util.js.map +1 -1
- package/dist/esm/components/Button/util.js +18 -23
- package/dist/esm/components/Button/util.js.map +1 -1
- package/dist/esm/components/Card/Card.js +3 -0
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js +1 -0
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Combobox/useCombobox.js +67 -87
- package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/components/Datepicker/useDatepicker.js +27 -34
- package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Context.js +4 -4
- package/dist/esm/components/Dialog/Context.js.map +1 -1
- package/dist/esm/components/Dialog/components/Content.js +39 -44
- package/dist/esm/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/components/Dialog/components/Drawer.js +3 -3
- package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
- package/dist/esm/components/Dialog/components/Extra.js +2 -2
- package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js +3 -3
- package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js +1 -1
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/Icon/components/LogOut.js +20 -0
- package/dist/esm/components/Icon/components/LogOut.js.map +1 -0
- package/dist/esm/components/Icon/components/Menu.js +18 -0
- package/dist/esm/components/Icon/components/Menu.js.map +1 -0
- package/dist/esm/components/Icon/components/Numbers.js +18 -0
- package/dist/esm/components/Icon/components/Numbers.js.map +1 -0
- package/dist/esm/components/Icon/components/Profile.js +20 -0
- package/dist/esm/components/Icon/components/Profile.js.map +1 -0
- package/dist/esm/components/Icon/components/index.js +12 -4
- package/dist/esm/components/Icon/components/index.js.map +1 -1
- package/dist/esm/components/Input/util.js +2 -2
- package/dist/esm/components/Input/util.js.map +1 -1
- package/dist/esm/components/Listbox/ScrollableList.js +64 -83
- package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/components/Listbox/useListbox.js +51 -60
- package/dist/esm/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useMultiListbox.js +64 -91
- package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useTypeahead.js +10 -9
- package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
- package/dist/esm/components/Listbox/util.js +48 -85
- package/dist/esm/components/Listbox/util.js.map +1 -1
- package/dist/esm/components/Menu/Context.js +2 -2
- package/dist/esm/components/Menu/Context.js.map +1 -1
- package/dist/esm/components/Menu/components/Checkbox.js +9 -10
- package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/components/Menu/components/Content.js +9 -11
- package/dist/esm/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/components/Menu/components/Header.js +3 -3
- package/dist/esm/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/components/Menu/components/Item.js +30 -31
- package/dist/esm/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/components/Menu/components/Link.js +10 -11
- package/dist/esm/components/Menu/components/Link.js.map +1 -1
- package/dist/esm/components/Menu/components/RadioGroup.js +17 -19
- package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/Menu/components/Separator.js +1 -1
- package/dist/esm/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/components/Menu/components/Trigger.js +4 -4
- package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/components/Pagination/PageNumbers.js +23 -28
- package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/components/Pagination/usePagination.js +7 -21
- package/dist/esm/components/Pagination/usePagination.js.map +1 -1
- package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
- package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +1 -1
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Popover/Primitives.js +7 -8
- package/dist/esm/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +4 -1
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/useSelect.js +63 -81
- package/dist/esm/components/Select/useSelect.js.map +1 -1
- package/dist/esm/components/Table/components/BaseTable.js +23 -30
- package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/components/Table/components/PaginatedTable.js +3 -7
- package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/components/Table/components/Table.js +18 -25
- package/dist/esm/components/Table/components/Table.js.map +1 -1
- package/dist/esm/components/Table/components/WindowedTable.js +89 -109
- package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js +122 -146
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +57 -61
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +39 -36
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +79 -89
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowCreation.js +29 -64
- package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTable.js +119 -141
- package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +13 -16
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/components/Table/util/renderColumn.js +10 -10
- package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/components/Table/util/renderRow.js +37 -46
- package/dist/esm/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/components/Table/util/rowIndexPath.js +14 -16
- package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/components/Table/util/sortTypes.js +23 -31
- package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/components/Table/util.js +29 -41
- package/dist/esm/components/Table/util.js.map +1 -1
- package/dist/esm/components/Toast/Toast.js +21 -22
- package/dist/esm/components/Toast/Toast.js.map +1 -1
- package/dist/esm/components/Toast/util.js +2 -2
- package/dist/esm/components/Toast/util.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +3 -1
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/index.css +661 -661
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/primitives/Button.js +9 -13
- package/dist/esm/primitives/Button.js.map +1 -1
- package/dist/esm/utils/date.js.map +1 -1
- package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/utils/hooks/useDraggable.js +16 -17
- package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
- package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
- package/dist/esm/utils/hooks/useTimer.js +9 -17
- package/dist/esm/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/utils/input.js +7 -11
- package/dist/esm/utils/input.js.map +1 -1
- package/dist/esm/utils/mergeRefs.js +1 -1
- package/dist/esm/utils/mergeRefs.js.map +1 -1
- package/dist/esm/utils/taillwind.js +2 -2
- package/dist/esm/utils/taillwind.js.map +1 -1
- package/dist/index.css +661 -661
- package/dist/index.d.ts +4 -1
- package/dist/taco.cjs.development.js +1566 -1823
- 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 +1 -1
- package/package.json +6 -7
- package/plugins/tailwindcss-aria-attributes.js +73 -73
- package/tailwind.config.js +9 -0
- package/types.json +2612 -7006
@@ -1,31 +1,26 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import { useState, useEffect } from 'react';
|
3
2
|
import { useLocalization } from '../Provider/Provider.js';
|
4
3
|
import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
|
5
4
|
import { setInputValueByRef } from '../../utils/input.js';
|
6
5
|
import { format, parseFromCustomString } from '../../utils/date.js';
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
setInternalValue = _React$useState[1]; // update internal value if it changed 'externally'
|
24
|
-
|
25
|
-
|
26
|
-
useEffect(function () {
|
7
|
+
const useDatepicker = ({
|
8
|
+
defaultValue: _,
|
9
|
+
calendar,
|
10
|
+
onBlur,
|
11
|
+
onChange,
|
12
|
+
value,
|
13
|
+
...props
|
14
|
+
}, ref) => {
|
15
|
+
const inputRef = useProxiedRef(ref);
|
16
|
+
const {
|
17
|
+
formatting
|
18
|
+
} = useLocalization();
|
19
|
+
const [internalValue, setInternalValue] = useState(value ? format(value, formatting.date) : ''); // update internal value if it changed 'externally'
|
20
|
+
|
21
|
+
useEffect(() => {
|
27
22
|
if (value) {
|
28
|
-
|
23
|
+
const formattedValue = format(value, formatting.date);
|
29
24
|
|
30
25
|
if (formattedValue !== internalValue) {
|
31
26
|
setInternalValue(formattedValue);
|
@@ -35,10 +30,10 @@ var useDatepicker = function useDatepicker(_ref, ref) {
|
|
35
30
|
}
|
36
31
|
}, [value]); // event handlers
|
37
32
|
|
38
|
-
|
33
|
+
const handleInputBlur = event => {
|
39
34
|
event.persist();
|
40
|
-
|
41
|
-
|
35
|
+
const valueAsDate = parseFromCustomString(event.target.value);
|
36
|
+
const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
|
42
37
|
event.target.value = formattedValue;
|
43
38
|
|
44
39
|
if (onChange) {
|
@@ -54,15 +49,15 @@ var useDatepicker = function useDatepicker(_ref, ref) {
|
|
54
49
|
}
|
55
50
|
};
|
56
51
|
|
57
|
-
|
52
|
+
const handleInputChange = event => {
|
58
53
|
setInternalValue(event.target.value);
|
59
54
|
};
|
60
55
|
|
61
|
-
|
56
|
+
const handleChange = date => {
|
62
57
|
setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');
|
63
58
|
};
|
64
59
|
|
65
|
-
|
60
|
+
const handleKeyDown = event => {
|
66
61
|
if (event.key === 'Enter') {
|
67
62
|
event.target.dispatchEvent(new Event('focusout', {
|
68
63
|
bubbles: true
|
@@ -70,7 +65,7 @@ var useDatepicker = function useDatepicker(_ref, ref) {
|
|
70
65
|
}
|
71
66
|
};
|
72
67
|
|
73
|
-
|
68
|
+
const inputProps = { ...props,
|
74
69
|
autoComplete: 'off',
|
75
70
|
onBlur: handleInputBlur,
|
76
71
|
onChange: handleInputChange,
|
@@ -78,13 +73,11 @@ var useDatepicker = function useDatepicker(_ref, ref) {
|
|
78
73
|
ref: inputRef,
|
79
74
|
type: 'text',
|
80
75
|
value: internalValue
|
81
|
-
}
|
82
|
-
|
83
|
-
var calendarProps = _extends({}, calendar, {
|
76
|
+
};
|
77
|
+
const calendarProps = { ...calendar,
|
84
78
|
onChange: handleChange,
|
85
|
-
value
|
86
|
-
}
|
87
|
-
|
79
|
+
value
|
80
|
+
};
|
88
81
|
return {
|
89
82
|
input: inputProps,
|
90
83
|
calendar: calendarProps
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useDatepicker.js","sources":["../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { parseFromCustomString, format } from '../../utils/date';\nimport { useLocalization } from '../Provider/Provider';\nimport { setInputValueByRef } from '../../utils/input';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\nimport { DatepickerProps } from './Datepicker';\nimport { CalendarProps } from '../Calendar/Calendar';\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement> };\n\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\n calendar: CalendarProps;\n input: InputProps;\n};\n\nexport const useDatepicker = (\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\n ref: React.Ref<HTMLInputElement>\n): useDatepicker => {\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\n const { formatting } = useLocalization();\n const [internalValue, setInternalValue] = React.useState(value ? format(value, formatting.date) : '');\n\n // update internal value if it changed 'externally'\n React.useEffect(() => {\n if (value) {\n const formattedValue = format(value, formatting.date);\n\n if (formattedValue !== internalValue) {\n setInternalValue(formattedValue);\n }\n } else {\n setInternalValue('');\n }\n }, [value]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n const valueAsDate = parseFromCustomString(event.target.value);\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\n\n event.target.value = formattedValue;\n\n if (onChange) {\n (event as any).detail = valueAsDate;\n onChange(event);\n } else {\n // update the internal value to use the formatted date\n setInternalValue(formattedValue);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInternalValue(event.target.value);\n };\n\n const handleChange = date => {\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\n }\n };\n\n const inputProps: InputProps = {\n ...props,\n autoComplete: 'off',\n onBlur: handleInputBlur,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\n ref: inputRef,\n type: 'text',\n value: internalValue,\n };\n\n const calendarProps: CalendarProps = {\n ...calendar,\n onChange: handleChange,\n value,\n };\n\n return {\n input: inputProps,\n calendar: calendarProps,\n };\n};\n"],"names":["useDatepicker","
|
1
|
+
{"version":3,"file":"useDatepicker.js","sources":["../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { parseFromCustomString, format } from '../../utils/date';\nimport { useLocalization } from '../Provider/Provider';\nimport { setInputValueByRef } from '../../utils/input';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\nimport { DatepickerProps } from './Datepicker';\nimport { CalendarProps } from '../Calendar/Calendar';\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement> };\n\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\n calendar: CalendarProps;\n input: InputProps;\n};\n\nexport const useDatepicker = (\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\n ref: React.Ref<HTMLInputElement>\n): useDatepicker => {\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\n const { formatting } = useLocalization();\n const [internalValue, setInternalValue] = React.useState(value ? format(value, formatting.date) : '');\n\n // update internal value if it changed 'externally'\n React.useEffect(() => {\n if (value) {\n const formattedValue = format(value, formatting.date);\n\n if (formattedValue !== internalValue) {\n setInternalValue(formattedValue);\n }\n } else {\n setInternalValue('');\n }\n }, [value]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n const valueAsDate = parseFromCustomString(event.target.value);\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\n\n event.target.value = formattedValue;\n\n if (onChange) {\n (event as any).detail = valueAsDate;\n onChange(event);\n } else {\n // update the internal value to use the formatted date\n setInternalValue(formattedValue);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInternalValue(event.target.value);\n };\n\n const handleChange = date => {\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\n }\n };\n\n const inputProps: InputProps = {\n ...props,\n autoComplete: 'off',\n onBlur: handleInputBlur,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\n ref: inputRef,\n type: 'text',\n value: internalValue,\n };\n\n const calendarProps: CalendarProps = {\n ...calendar,\n onChange: handleChange,\n value,\n };\n\n return {\n input: inputProps,\n calendar: calendarProps,\n };\n};\n"],"names":["useDatepicker","defaultValue","_","calendar","onBlur","onChange","value","props","ref","inputRef","useProxiedRef","formatting","useLocalization","internalValue","setInternalValue","React","format","date","formattedValue","handleInputBlur","event","persist","valueAsDate","parseFromCustomString","target","detail","handleInputChange","handleChange","setInputValueByRef","current","handleKeyDown","key","dispatchEvent","Event","bubbles","inputProps","autoComplete","onKeyDown","type","calendarProps","input"],"mappings":";;;;;;MAeaA,aAAa,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,CAACI,MAAN,CAAalB,KAAd,CAAhB;GADJ;;EAIA,MAAMqB,YAAY,GAAGV,IAAI;IACrBW,kBAAkB,CAACnB,QAAQ,CAACoB,OAAV,EAAmBb,MAAM,CAACC,IAAD,EAAON,UAAU,CAACM,IAAlB,CAAzB,EAAkD,UAAlD,CAAlB;GADJ;;EAIA,MAAMa,aAAa,GAAIV,KAAD;IAClB,IAAIA,KAAK,CAACW,GAAN,KAAc,OAAlB,EAA2B;MACvBX,KAAK,CAACI,MAAN,CAAaQ,aAAb,CAA2B,IAAIC,KAAJ,CAAU,UAAV,EAAsB;QAAEC,OAAO,EAAE;OAAjC,CAA3B;;GAFR;;EAMA,MAAMC,UAAU,GAAe,EAC3B,GAAG5B,KADwB;IAE3B6B,YAAY,EAAE,KAFa;IAG3BhC,MAAM,EAAEe,eAHmB;IAI3Bd,QAAQ,EAAEqB,iBAJiB;IAK3BW,SAAS,EAAEP,aALgB;IAM3BtB,GAAG,EAAEC,QANsB;IAO3B6B,IAAI,EAAE,MAPqB;IAQ3BhC,KAAK,EAAEO;GARX;EAWA,MAAM0B,aAAa,GAAkB,EACjC,GAAGpC,QAD8B;IAEjCE,QAAQ,EAAEsB,YAFuB;IAGjCrB;GAHJ;EAMA,OAAO;IACHkC,KAAK,EAAEL,UADJ;IAEHhC,QAAQ,EAAEoC;GAFd;AAIH;;;;"}
|
@@ -1,24 +1,24 @@
|
|
1
1
|
import { createContext, useContext } from 'react';
|
2
2
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
4
|
-
|
4
|
+
const DialogContext = /*#__PURE__*/createContext({
|
5
5
|
closeOnEscape: true,
|
6
6
|
draggable: false,
|
7
7
|
drawer: {
|
8
8
|
open: false,
|
9
|
-
toggle:
|
9
|
+
toggle: () => {}
|
10
10
|
},
|
11
11
|
elements: {
|
12
12
|
drawer: undefined,
|
13
13
|
extra: undefined
|
14
14
|
},
|
15
|
-
onClose:
|
15
|
+
onClose: () => {},
|
16
16
|
props: {},
|
17
17
|
ref: null,
|
18
18
|
showCloseButton: true,
|
19
19
|
size: 'sm'
|
20
20
|
});
|
21
|
-
|
21
|
+
const useCurrentDialog = () => {
|
22
22
|
return useContext(DialogContext);
|
23
23
|
};
|
24
24
|
|
@@ -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 closeOnEscape: boolean;\n draggable: boolean;\n drawer: {\n open: boolean;\n toggle: () => void;\n };\n elements: {\n drawer?: React.ReactNode;\n extra?: React.ReactNode;\n };\n onClose?: () => void;\n props: {};\n ref: React.Ref<HTMLElement>;\n showCloseButton: boolean;\n size: DialogSize;\n};\n\nexport const DialogContext = React.createContext<DialogContext>({\n closeOnEscape: true,\n draggable: false,\n drawer: {\n open: false,\n toggle: () => {},\n },\n elements: {\n drawer: undefined,\n extra: undefined,\n },\n onClose: () => {},\n props: {},\n ref: null,\n showCloseButton: true,\n size: 'sm',\n});\n\nexport const useCurrentDialog = () => {\n return React.useContext(DialogContext);\n};\n"],"names":["DialogContext","React","closeOnEscape","draggable","drawer","open","toggle","elements","undefined","extra","onClose","props","ref","showCloseButton","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 closeOnEscape: boolean;\n draggable: boolean;\n drawer: {\n open: boolean;\n toggle: () => void;\n };\n elements: {\n drawer?: React.ReactNode;\n extra?: React.ReactNode;\n };\n onClose?: () => void;\n props: {};\n ref: React.Ref<HTMLElement>;\n showCloseButton: boolean;\n size: DialogSize;\n};\n\nexport const DialogContext = React.createContext<DialogContext>({\n closeOnEscape: true,\n draggable: false,\n drawer: {\n open: false,\n toggle: () => {},\n },\n elements: {\n drawer: undefined,\n extra: undefined,\n },\n onClose: () => {},\n props: {},\n ref: null,\n showCloseButton: true,\n size: 'sm',\n});\n\nexport const useCurrentDialog = () => {\n return React.useContext(DialogContext);\n};\n"],"names":["DialogContext","React","closeOnEscape","draggable","drawer","open","toggle","elements","undefined","extra","onClose","props","ref","showCloseButton","size","useCurrentDialog"],"mappings":";;AAAA;MAsBaA,aAAa,gBAAGC,aAAA,CAAmC;EAC5DC,aAAa,EAAE,IAD6C;EAE5DC,SAAS,EAAE,KAFiD;EAG5DC,MAAM,EAAE;IACJC,IAAI,EAAE,KADF;IAEJC,MAAM,EAAE;GALgD;EAO5DC,QAAQ,EAAE;IACNH,MAAM,EAAEI,SADF;IAENC,KAAK,EAAED;GATiD;EAW5DE,OAAO,EAAE,QAXmD;EAY5DC,KAAK,EAAE,EAZqD;EAa5DC,GAAG,EAAE,IAbuD;EAc5DC,eAAe,EAAE,IAd2C;EAe5DC,IAAI,EAAE;AAfsD,CAAnC;MAkBhBC,gBAAgB,GAAG;EAC5B,OAAOd,UAAA,CAAiBD,aAAjB,CAAP;AACH;;;;"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import { forwardRef, createElement } from 'react';
|
3
2
|
import cn from 'classnames';
|
4
3
|
import { Backdrop } from '../../Backdrop/Backdrop.js';
|
@@ -10,22 +9,22 @@ import { useCurrentDialog } from '../Context.js';
|
|
10
9
|
import { useDraggable } from '../../../utils/hooks/useDraggable.js';
|
11
10
|
import { useCurrentMenu } from '../../Menu/Context.js';
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
const Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
|
13
|
+
const className = cn('text-center', props.className);
|
15
14
|
return createElement(Title$1, Object.assign({}, props, {
|
16
15
|
className: className,
|
17
16
|
ref: ref
|
18
17
|
}));
|
19
18
|
});
|
20
|
-
|
21
|
-
|
19
|
+
const Footer = /*#__PURE__*/forwardRef(function DialogFooter(props, ref) {
|
20
|
+
const className = cn('mt-8 flex justify-end', props.className);
|
22
21
|
return createElement("div", Object.assign({}, props, {
|
23
22
|
className: className,
|
24
23
|
ref: ref
|
25
24
|
}), props.children);
|
26
25
|
});
|
27
|
-
|
28
|
-
|
26
|
+
const Close = /*#__PURE__*/forwardRef(function DialogClose(props, ref) {
|
27
|
+
const dialog = useCurrentDialog();
|
29
28
|
return createElement(Close$1, Object.assign({
|
30
29
|
onClick: dialog.onClose
|
31
30
|
}, props, {
|
@@ -33,54 +32,52 @@ var Close = /*#__PURE__*/forwardRef(function DialogClose(props, ref) {
|
|
33
32
|
asChild: true
|
34
33
|
}));
|
35
34
|
});
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
const RenderPropWrapper = /*#__PURE__*/forwardRef(function RenderPropWrapper({
|
36
|
+
children,
|
37
|
+
onClick,
|
38
|
+
renderProps
|
39
|
+
}, ref) {
|
40
|
+
const close = () => {
|
42
41
|
onClick(new CustomEvent('close'));
|
43
42
|
};
|
44
43
|
|
45
|
-
return children(
|
46
|
-
close
|
47
|
-
ref
|
48
|
-
|
44
|
+
return children({
|
45
|
+
close,
|
46
|
+
ref,
|
47
|
+
...renderProps
|
48
|
+
});
|
49
49
|
});
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
50
|
+
const Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
51
|
+
const dialog = useCurrentDialog();
|
52
|
+
const internalRef = useProxiedRef(ref);
|
53
|
+
const {
|
54
|
+
position,
|
55
|
+
handleProps: dragHandleProps
|
56
|
+
} = useDraggable(internalRef);
|
57
|
+
const {
|
58
|
+
texts
|
59
|
+
} = useLocalization(); // if the dialog was opened by a menu, we need to close the menu when the dialog closes
|
60
60
|
// the menu is still open (and mounted) because it is the trigger for the dialog
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
var handleCloseAutoFocus;
|
62
|
+
const menu = useCurrentMenu();
|
63
|
+
let handleCloseAutoFocus;
|
65
64
|
|
66
65
|
if (menu) {
|
67
|
-
handleCloseAutoFocus =
|
68
|
-
return menu.close();
|
69
|
-
};
|
66
|
+
handleCloseAutoFocus = () => menu.close();
|
70
67
|
}
|
71
68
|
|
72
|
-
|
69
|
+
const className = cn('bg-white rounded relative mt-16 mx-auto animate-[fade-in_150ms] z-[997]', {
|
73
70
|
'w-128 text-center justify-center': dialog.size === 'dialog',
|
74
71
|
'w-xs': dialog.size === 'xs',
|
75
72
|
'w-sm': dialog.size === 'sm',
|
76
73
|
'w-md': dialog.size === 'md',
|
77
74
|
'w-lg': dialog.size === 'lg'
|
78
75
|
});
|
79
|
-
|
76
|
+
const 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)]', {
|
80
77
|
'rounded-b-none': !!dialog.elements.extra
|
81
78
|
}, props.className);
|
82
79
|
|
83
|
-
|
80
|
+
const handleEscapeKeyDown = event => {
|
84
81
|
if (!dialog.closeOnEscape) {
|
85
82
|
event.preventDefault();
|
86
83
|
} else if (dialog.onClose) {
|
@@ -89,11 +86,9 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
89
86
|
}; // the chosen behaviour in taco is that outside clicks do not close the dialog
|
90
87
|
|
91
88
|
|
92
|
-
|
93
|
-
return event.preventDefault();
|
94
|
-
};
|
89
|
+
const handleInteractOutside = event => event.preventDefault();
|
95
90
|
|
96
|
-
|
91
|
+
let output;
|
97
92
|
|
98
93
|
if (typeof props.children === 'function') {
|
99
94
|
output = createElement(Close$1, {
|
@@ -115,10 +110,10 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
115
110
|
onInteractOutside: handleInteractOutside,
|
116
111
|
onCloseAutoFocus: handleCloseAutoFocus,
|
117
112
|
ref: ref,
|
118
|
-
style:
|
119
|
-
left: dialog.draggable ? position.x
|
120
|
-
top: dialog.draggable ? position.y
|
121
|
-
}
|
113
|
+
style: { ...props.style,
|
114
|
+
left: dialog.draggable ? `${position.x}px` : undefined,
|
115
|
+
top: dialog.draggable ? `${position.y}px` : undefined
|
116
|
+
}
|
122
117
|
}), createElement("div", {
|
123
118
|
className: containerClassName,
|
124
119
|
"data-taco": "dialog"
|
@@ -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 type { DialogContentProps as DialogPrimitiveContentProps } from '@radix-ui/react-dialog';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Provider';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\n\nexport type DialogContentDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: DialogContentDrawerRenderProps;\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('text-center', props.className);\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('mt-8 flex justify-end', props.className);\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\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\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': 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: DialogPrimitiveContentProps['onCloseAutoFocus'];\n\n if (menu) {\n handleCloseAutoFocus = () => menu.close();\n }\n\n const className = cn('bg-white rounded relative mt-16 mx-auto animate-[fade-in_150ms] z-[997]', {\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 const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (!dialog.closeOnEscape) {\n event.preventDefault();\n } else if (dialog.onClose) {\n dialog.onClose();\n }\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 = (\n <DialogPrimitive.Close asChild>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </DialogPrimitive.Close>\n );\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={handleEscapeKeyDown}\n onInteractOutside={handleInteractOutside}\n onCloseAutoFocus={handleCloseAutoFocus}\n ref={ref}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${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 {dialog.showCloseButton ? (\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\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 ) : null}\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","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","renderProps","close","CustomEvent","Content","DialogContent","internalRef","useProxiedRef","useDraggable","position","dragHandleProps","handleProps","useLocalization","texts","menu","useCurrentMenu","handleCloseAutoFocus","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","onCloseAutoFocus","style","left","draggable","x","undefined","top","y","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;;IAoBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;EAClC,IAAMC,SAAS,GAAGC,EAAE,CAAC,aAAD,EAAgBH,KAAK,CAACE,SAAtB,CAApB;EACA,OAAOJ,aAAA,CAACM,OAAD,oBAA2BJ;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAA7D,CAAP;AACH,CAHoB;IAMRI,MAAM,gBAAGP,UAAA,CAAiB,SAASQ,YAAT,CAAsBN,KAAtB,EAAgDC,GAAhD;EACnC,IAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAD,EAA0BH,KAAK,CAACE,SAAhC,CAApB;EACA,OACIJ,aAAA,MAAA,oBAASE;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAA3C,EACKD,KAAK,CAACO,QADX,CADJ;AAKH,CAPqB;IAWTC,KAAK,gBAAGV,UAAA,CAAiB,SAASW,WAAT,CAAqBT,KAArB,EAA8CC,GAA9C;EAClC,IAAMS,MAAM,GAAGC,gBAAgB,EAA/B;EAEA,OAAOb,aAAA,CAACM,OAAD;IAAuBQ,OAAO,EAAEF,MAAM,CAACG;KAAab;IAAOC,GAAG,EAAEA;IAAKa,OAAO;IAA5E,CAAP;AACH,CAJoB;AAMrB,IAAMC,iBAAiB,gBAAGjB,UAAA,CAAiB,SAASiB,iBAAT,OAAoEd,GAApE;MAA6BM,gBAAAA;MAAUK,eAAAA;MAASI,mBAAAA;;EACvF,IAAMC,KAAK,GAAG,SAARA,KAAQ;IACVL,OAAO,CAAC,IAAIM,WAAJ,CAAgB,OAAhB,CAAD,CAAP;GADJ;;EAIA,OAAOX,QAAQ;IAAGU,KAAK,EAALA,KAAH;IAAUhB,GAAG,EAAHA;KAAQe,WAAl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;kBACC7B,KAAK,CAAClB,MAAN,CAAaO;IACzBf,SAAS,EAAC;IACVwD,IAAI,EAAC;GAJT,CADJ,CADH,GASG,IAlBR,CAbJ,EAiCKhD,MAAM,CAACwB,QAAP,CAAgBQ,MAjCrB,EAkCKhC,MAAM,CAACwB,QAAP,CAAgBC,KAlCrB,CADJ,CADJ,CADJ,CADJ;AA4CH,CAnGsB;;;;"}
|
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 type { DialogContentProps as DialogPrimitiveContentProps } from '@radix-ui/react-dialog';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Provider';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\n\nexport type DialogContentDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: DialogContentDrawerRenderProps;\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('text-center', props.className);\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('mt-8 flex justify-end', props.className);\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\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\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': 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: DialogPrimitiveContentProps['onCloseAutoFocus'];\n\n if (menu) {\n handleCloseAutoFocus = () => menu.close();\n }\n\n const className = cn('bg-white rounded relative mt-16 mx-auto animate-[fade-in_150ms] z-[997]', {\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 const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (!dialog.closeOnEscape) {\n event.preventDefault();\n } else if (dialog.onClose) {\n dialog.onClose();\n }\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 = (\n <DialogPrimitive.Close asChild>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </DialogPrimitive.Close>\n );\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={handleEscapeKeyDown}\n onInteractOutside={handleInteractOutside}\n onCloseAutoFocus={handleCloseAutoFocus}\n ref={ref}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${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 {dialog.showCloseButton ? (\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\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 ) : null}\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","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","renderProps","close","CustomEvent","Content","DialogContent","internalRef","useProxiedRef","position","handleProps","dragHandleProps","useDraggable","texts","useLocalization","menu","useCurrentMenu","handleCloseAutoFocus","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","onCloseAutoFocus","style","left","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,QAAP,CAAgBC,KAlCrB,CADJ,CADJ,CADJ,CADJ;AA4CH,CAnGsB;;;;"}
|
@@ -3,11 +3,11 @@ import cn from 'classnames';
|
|
3
3
|
import { motion } from 'framer-motion';
|
4
4
|
import { useCurrentDialog } from '../Context.js';
|
5
5
|
|
6
|
-
|
6
|
+
const Drawer = /*#__PURE__*/forwardRef(function DialogDrawer(props, ref) {
|
7
7
|
var _dialog$drawer, _dialog$drawer2;
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
const dialog = useCurrentDialog();
|
10
|
+
const className = cn('absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left', props.className);
|
11
11
|
return createElement(motion.div, Object.assign({}, props, {
|
12
12
|
className: className,
|
13
13
|
"data-taco": "dialog-drawer",
|
@@ -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 cn from 'classnames';\nimport { DialogContext, useCurrentDialog } from '../Context';\n\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n> & {\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\n};\n\nconst Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const className = cn(\n 'absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\n props.className\n );\n\n return (\n <motion.div\n {...props}\n className={className}\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 {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\n </motion.div>\n );\n});\nDrawer.displayName = 'DialogDrawer';\n\nexport { Drawer };\n"],"names":["Drawer","React","DialogDrawer","props","ref","dialog","useCurrentDialog","className","cn","motion","div","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate","children","displayName"],"mappings":";;;;;
|
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 cn from 'classnames';\nimport { DialogContext, useCurrentDialog } from '../Context';\n\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n> & {\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\n};\n\nconst Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const className = cn(\n 'absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\n props.className\n );\n\n return (\n <motion.div\n {...props}\n className={className}\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 {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\n </motion.div>\n );\n});\nDrawer.displayName = 'DialogDrawer';\n\nexport { Drawer };\n"],"names":["Drawer","React","DialogDrawer","props","ref","dialog","useCurrentDialog","className","cn","motion","div","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate","children","displayName"],"mappings":";;;;;MAcMA,MAAM,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAAsBC,KAAtB,EAAgDC,GAAhD;;;EAC5B,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;EACA,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGADgB,EAEhBL,KAAK,CAACI,SAFU,CAApB;EAKA,OACIN,aAAA,CAACQ,MAAM,CAACC,GAAR,oBACQP;IACJI,SAAS,EAAEA;iBACD;mBACG,oBAACF,MAAM,CAACM,MAAR,2CAAC,eAAeC,IAAhB;IACbC,QAAQ,EAAE;MACNC,OAAO,EAAE;QACLC,IAAI,EAAE,MADD;QAELC,OAAO,EAAE,OAFJ;QAGLC,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAR;UAAmBC,QAAQ,EAAE;;OAJvC;MAMNC,MAAM,EAAE;QACJL,IAAI,EAAE,IADF;QAEJE,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAR;UAAmBC,QAAQ,EAAE;SAFrC;QAGJE,aAAa,EAAE;UACXL,OAAO,EAAE;;;;IAIrBM,OAAO,EAAE,mBAAAjB,MAAM,CAACM,MAAP,4DAAeC,IAAf,GAAsB,SAAtB,GAAkC;IAC3CR,GAAG,EAAEA;IApBT,EAsBK,OAAOD,KAAK,CAACoB,QAAb,KAA0B,UAA1B,GAAuCpB,KAAK,CAACoB,QAAN,CAAelB,MAAM,CAACM,MAAtB,CAAvC,GAAuER,KAAK,CAACoB,QAtBlF,CADJ;AA0BH,CAjCc;AAkCfvB,MAAM,CAACwB,WAAP,GAAqB,cAArB;;;;"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { forwardRef, createElement } from 'react';
|
2
2
|
import cn from 'classnames';
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
const Extra = /*#__PURE__*/forwardRef(function DialogExtra(props, ref) {
|
5
|
+
const className = cn('bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left', props.className);
|
6
6
|
return createElement("div", Object.assign({}, props, {
|
7
7
|
className: className,
|
8
8
|
"data-taco": "dialog-extra",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Extra.js","sources":["../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst Extra = React.forwardRef(function DialogExtra(props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn(\n '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 props.className\n );\n\n return <div {...props} className={className} data-taco=\"dialog-extra\" ref={ref} />;\n});\nExtra.displayName = 'DialogExtra';\n\nexport { Extra };\n"],"names":["Extra","React","DialogExtra","props","ref","className","cn","displayName"],"mappings":";;;
|
1
|
+
{"version":3,"file":"Extra.js","sources":["../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst Extra = React.forwardRef(function DialogExtra(props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn(\n '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 props.className\n );\n\n return <div {...props} className={className} data-taco=\"dialog-extra\" ref={ref} />;\n});\nExtra.displayName = 'DialogExtra';\n\nexport { Extra };\n"],"names":["Extra","React","DialogExtra","props","ref","className","cn","displayName"],"mappings":";;;MAKMA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;EAC3B,MAAMC,SAAS,GAAGC,EAAE,CAChB,6GADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;EAKA,OAAOJ,aAAA,MAAA,oBAASE;IAAOE,SAAS,EAAEA;iBAAqB;IAAeD,GAAG,EAAEA;IAApE,CAAP;AACH,CAPa;AAQdJ,KAAK,CAACO,WAAN,GAAoB,aAApB;;;;"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { forwardRef, createElement } from 'react';
|
2
|
-
import mergeRefs from '../../../utils/mergeRefs.js';
|
2
|
+
import { mergeRefs } from '../../../utils/mergeRefs.js';
|
3
3
|
import { Trigger as Trigger$1 } from '@radix-ui/react-dialog';
|
4
4
|
import { useCurrentDialog } from '../Context.js';
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
const Trigger = /*#__PURE__*/forwardRef(function DialogTrigger(props, ref) {
|
7
|
+
const dialog = useCurrentDialog();
|
8
8
|
return createElement(Trigger$1, Object.assign({}, dialog.props, props, {
|
9
9
|
ref: mergeRefs([dialog.ref, ref]),
|
10
10
|
asChild: true
|
@@ -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';\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":";;;;;
|
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":";;;;;MAOaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,aAAT,CAAuBC,KAAvB,EAAkDC,GAAlD;EACpC,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;EACA,OAAOL,aAAA,CAACM,SAAD,oBAA6BF,MAAM,CAACF,OAAWA;IAAOC,GAAG,EAAEI,SAAS,CAAC,CAACH,MAAM,CAACD,GAAR,EAAaA,GAAb,CAAD;IAAqBK,OAAO;IAAhG,CAAP;AACH,CAHsB;;;;"}
|
@@ -5,7 +5,7 @@ import { IconButton } from '../IconButton/IconButton.js';
|
|
5
5
|
import { useLocalization } from '../Provider/Provider.js';
|
6
6
|
import { Root, Anchor as Anchor$1, Close } from '@radix-ui/react-popover';
|
7
7
|
import { UnstyledContent, UnstyledArrow } from '../Popover/Primitives.js';
|
8
|
-
import mergeRefs from '../../utils/mergeRefs.js';
|
8
|
+
import { mergeRefs } from '../../utils/mergeRefs.js';
|
9
9
|
|
10
10
|
var _excluded = ["anchor", "children", "defaultOpen"];
|
11
11
|
var HangerContext = /*#__PURE__*/createContext({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Hanger.js","sources":["../../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Placement } from '../..';\nimport { UnstyledArrow, UnstyledContent } from '../Popover/Primitives';\nimport { useLocalization } from '../Provider/Provider';\nimport './Hanger.css';\nimport mergeRefs from '../../utils/mergeRefs';\n\ntype HangerContextValue = {\n props: any;\n ref: React.Ref<HTMLElement>;\n};\nconst HangerContext = React.createContext<HangerContextValue>({\n props: {},\n ref: null,\n});\n\nexport type HangerTexts = {\n /** Aria-label for the close icon button of hanger */\n close: string;\n};\n\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLDivElement>;\nconst Anchor = React.forwardRef(function HangerAnchor(props: HangerAnchorProps, ref: React.Ref<HTMLDivElement>) {\n const context = React.useContext(HangerContext);\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Anchor {...context.props} {...props} children={children} ref={mergeRefs([context.ref, ref])} asChild />\n );\n});\n\nexport type HangerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: HangerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('mb-1 text-base font-bold flex w-full', props.className);\n return <span {...props} className={className} ref={ref} />;\n});\n\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\n placement?: Placement;\n};\n\nconst Content = React.forwardRef(function HangerContent(props: HangerContentProps, ref: React.Ref<HTMLDivElement>) {\n const context = React.useContext(HangerContext);\n const { texts } = useLocalization();\n const className = cn(\n 'wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent max-w-sm',\n props.className\n );\n const handleInteractOutside = (event: CustomEvent): void => {\n event.preventDefault();\n };\n\n return (\n <UnstyledContent\n className={className}\n data-taco=\"hanger\"\n onInteractOutside={handleInteractOutside}\n placement={props.placement}\n ref={ref}\n >\n {props.children}\n <UnstyledArrow className=\"text-blue\" />\n <PopoverPrimitive.Close asChild>\n <IconButton\n appearance=\"primary\"\n aria-label={texts.hanger.close}\n className=\"absolute top-0 right-0 ml-2 mr-2 mt-2 text-white\"\n icon=\"close\"\n onClick={context.props.onClose}\n />\n </PopoverPrimitive.Close>\n </UnstyledContent>\n );\n});\n\nexport type HangerProps = React.PropsWithChildren<{\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\n anchor?: JSX.Element;\n /**\n * Shows or hides hanger depending on the value\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Handler called when user closes the hanger */\n onClose?: () => void;\n}>;\n\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\n Title: React.ForwardRefExoticComponent<HangerTitleProps>;\n};\n\nexport const Hanger = React.forwardRef(function Hanger(props: HangerProps, ref: React.Ref<HTMLElement>) {\n const { anchor, children, defaultOpen = true, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n if (defaultOpen) {\n setOpen(defaultOpen);\n }\n }, []);\n\n return (\n <HangerContext.Provider value={context}>\n <PopoverPrimitive.Root key={String(open)} defaultOpen={open}>\n {anchor && <Anchor>{anchor}</Anchor>}\n {children}\n </PopoverPrimitive.Root>\n </HangerContext.Provider>\n );\n}) as ForwardedHangerWithStatics;\nHanger.Anchor = Anchor;\nHanger.Content = Content;\nHanger.Title = Title;\n"],"names":["HangerContext","React","props","ref","Anchor","HangerAnchor","context","children","type","console","warn","name","PopoverPrimitive","mergeRefs","asChild","Title","DialogTitle","className","cn","Content","HangerContent","useLocalization","texts","handleInteractOutside","event","preventDefault","UnstyledContent","onInteractOutside","placement","UnstyledArrow","IconButton","appearance","hanger","close","icon","onClick","onClose","Hanger","anchor","defaultOpen","otherProps","open","setOpen","Provider","value","key","String"],"mappings":";;;;;;;;;;AAcA,IAAMA,aAAa,gBAAGC,aAAA,CAAwC;EAC1DC,KAAK,EAAE,EADmD;EAE1DC,GAAG,EAAE;AAFqD,CAAxC,CAAtB;AAWA,IAAMC,MAAM,gBAAGH,UAAA,CAAiB,SAASI,YAAT,CAAsBH,KAAtB,EAAgDC,GAAhD;;;EAC5B,IAAMG,OAAO,GAAGL,UAAA,CAAiBD,aAAjB,CAAhB;EACA,IAAIO,QAAQ,GAAGL,KAAK,CAACK,QAArB;;EAEA,IAAIN,cAAA,CAAqBC,KAAK,CAACK,QAA3B,KAAwC,2BAAOL,KAAK,CAACK,QAAb,oDAAO,gBAAgBC,IAAvB,MAAgC,UAA5E,EAAwF;IACpFC,OAAO,CAACC,IAAR,qHACsHR,KAAK,CAACK,QAAN,CAAeC,IAAf,CAAoBG,IAD1I,mDAC4LT,KAAK,CAACK,QAAN,CAAeC,IAAf,CAAoBG,IADhN;IAGAJ,QAAQ,GAAGN,aAAA,OAAA,MAAA,EAAOC,KAAK,CAACK,QAAb,CAAX;;;EAGJ,OACIN,aAAA,CAACW,QAAD,oBAA6BN,OAAO,CAACJ,OAAWA;IAAOK,QAAQ,EAAEA;IAAUJ,GAAG,EAAEU,SAAS,CAAC,CAACP,OAAO,CAACH,GAAT,EAAcA,GAAd,CAAD;IAAsBW,OAAO;IAAtH,CADJ;AAGH,CAdc,CAAf;IAiBaC,KAAK,gBAAGd,UAAA,CAAiB,SAASe,WAAT,CAAqBd,KAArB,EAA8CC,GAA9C;EAClC,IAAMc,SAAS,GAAGC,EAAE,CAAC,sCAAD,EAAyChB,KAAK,CAACe,SAA/C,CAApB;EACA,OAAOhB,aAAA,OAAA,oBAAUC;IAAOe,SAAS,EAAEA;IAAWd,GAAG,EAAEA;IAA5C,CAAP;A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AqBrC,GAAG,EAAHA;KAA5B;GAAd,EAAkD,CAACqC,UAAD,CAAlD,CAAhB;;EAGA,sBAAwBvC,QAAA,CAAe,KAAf,CAAxB;MAAOwC,IAAP;MAAaC,OAAb;;EACAzC,SAAA,CAAgB;IACZ,IAAIsC,WAAJ,EAAiB;MACbG,OAAO,CAACH,WAAD,CAAP;;GAFR,EAIG,EAJH;EAMA,OACItC,aAAA,CAACD,aAAa,CAAC2C,QAAf;IAAwBC,KAAK,EAAEtC;GAA/B,EACIL,aAAA,CAACW,IAAD;IAAuBiC,GAAG,EAAEC,MAAM,CAACL,IAAD;IAAQF,WAAW,EAAEE;GAAvD,EACKH,MAAM,IAAIrC,aAAA,CAACG,MAAD,MAAA,EAASkC,MAAT,CADf,EAEK/B,QAFL,CADJ,CADJ;AAQH,CApBqB;AAqBtB8B,MAAM,CAACjC,MAAP,GAAgBA,MAAhB;AACAiC,MAAM,CAAClB,OAAP,GAAiBA,OAAjB;AACAkB,MAAM,CAACtB,KAAP,GAAeA,KAAf;;;;"}
|
1
|
+
{"version":3,"file":"Hanger.js","sources":["../../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Placement } from '../..';\nimport { UnstyledArrow, UnstyledContent } from '../Popover/Primitives';\nimport { useLocalization } from '../Provider/Provider';\nimport './Hanger.css';\nimport { mergeRefs } from '../../utils/mergeRefs';\n\ntype HangerContextValue = {\n props: any;\n ref: React.Ref<HTMLElement>;\n};\nconst HangerContext = React.createContext<HangerContextValue>({\n props: {},\n ref: null,\n});\n\nexport type HangerTexts = {\n /** Aria-label for the close icon button of hanger */\n close: string;\n};\n\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLDivElement>;\nconst Anchor = React.forwardRef(function HangerAnchor(props: HangerAnchorProps, ref: React.Ref<HTMLDivElement>) {\n const context = React.useContext(HangerContext);\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Anchor {...context.props} {...props} children={children} ref={mergeRefs([context.ref, ref])} asChild />\n );\n});\n\nexport type HangerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: HangerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('mb-1 text-base font-bold flex w-full', props.className);\n return <span {...props} className={className} ref={ref} />;\n});\n\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\n placement?: Placement;\n};\n\nconst Content = React.forwardRef(function HangerContent(props: HangerContentProps, ref: React.Ref<HTMLDivElement>) {\n const context = React.useContext(HangerContext);\n const { texts } = useLocalization();\n const className = cn(\n 'wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent max-w-sm',\n props.className\n );\n const handleInteractOutside = (event: CustomEvent): void => {\n event.preventDefault();\n };\n\n return (\n <UnstyledContent\n className={className}\n data-taco=\"hanger\"\n onInteractOutside={handleInteractOutside}\n placement={props.placement}\n ref={ref}\n >\n {props.children}\n <UnstyledArrow className=\"text-blue\" />\n <PopoverPrimitive.Close asChild>\n <IconButton\n appearance=\"primary\"\n aria-label={texts.hanger.close}\n className=\"absolute top-0 right-0 ml-2 mr-2 mt-2 text-white\"\n icon=\"close\"\n onClick={context.props.onClose}\n />\n </PopoverPrimitive.Close>\n </UnstyledContent>\n );\n});\n\nexport type HangerProps = React.PropsWithChildren<{\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\n anchor?: JSX.Element;\n /**\n * Shows or hides hanger depending on the value\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Handler called when user closes the hanger */\n onClose?: () => void;\n}>;\n\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\n Title: React.ForwardRefExoticComponent<HangerTitleProps>;\n};\n\nexport const Hanger = React.forwardRef(function Hanger(props: HangerProps, ref: React.Ref<HTMLElement>) {\n const { anchor, children, defaultOpen = true, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n if (defaultOpen) {\n setOpen(defaultOpen);\n }\n }, []);\n\n return (\n <HangerContext.Provider value={context}>\n <PopoverPrimitive.Root key={String(open)} defaultOpen={open}>\n {anchor && <Anchor>{anchor}</Anchor>}\n {children}\n </PopoverPrimitive.Root>\n </HangerContext.Provider>\n );\n}) as ForwardedHangerWithStatics;\nHanger.Anchor = Anchor;\nHanger.Content = Content;\nHanger.Title = Title;\n"],"names":["HangerContext","React","props","ref","Anchor","HangerAnchor","context","children","type","console","warn","name","PopoverPrimitive","mergeRefs","asChild","Title","DialogTitle","className","cn","Content","HangerContent","useLocalization","texts","handleInteractOutside","event","preventDefault","UnstyledContent","onInteractOutside","placement","UnstyledArrow","IconButton","appearance","hanger","close","icon","onClick","onClose","Hanger","anchor","defaultOpen","otherProps","open","setOpen","Provider","value","key","String"],"mappings":";;;;;;;;;;AAcA,IAAMA,aAAa,gBAAGC,aAAA,CAAwC;EAC1DC,KAAK,EAAE,EADmD;EAE1DC,GAAG,EAAE;AAFqD,CAAxC,CAAtB;AAWA,IAAMC,MAAM,gBAAGH,UAAA,CAAiB,SAASI,YAAT,CAAsBH,KAAtB,EAAgDC,GAAhD;;;EAC5B,IAAMG,OAAO,GAAGL,UAAA,CAAiBD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AQF,WAAW,EAAEE;GAAvD,EACKH,MAAM,IAAIrC,aAAA,CAACG,MAAD,MAAA,EAASkC,MAAT,CADf,EAEK/B,QAFL,CADJ,CADJ;AAQH,CApBqB;AAqBtB8B,MAAM,CAACjC,MAAP,GAAgBA,MAAhB;AACAiC,MAAM,CAAClB,OAAP,GAAiBA,OAAjB;AACAkB,MAAM,CAACtB,KAAP,GAAeA,KAAf;;;;"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
2
|
+
|
3
|
+
function IconLogOut(props, svgRef) {
|
4
|
+
return createElement("svg", Object.assign({
|
5
|
+
fill: "none",
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
7
|
+
viewBox: "0 0 24 24",
|
8
|
+
ref: svgRef
|
9
|
+
}, props), createElement("path", {
|
10
|
+
fillRule: "evenodd",
|
11
|
+
clipRule: "evenodd",
|
12
|
+
d: "M13.25 4.5H6.5v15h6.75a1.25 1.25 0 110 2.5h-7A2.25 2.25 0 014 19.75V4.25A2.25 2.25 0 016.25 2h7a1.25 1.25 0 110 2.5zm6.384 2.616l-.102-.091a1.25 1.25 0 00-1.666 1.859l1.867 1.866H11.75l-.128.007a1.25 1.25 0 00.128 2.493h7.982l-1.866 1.866-.091.102a1.25 1.25 0 001.859 1.666l4-4 .08-.089.05-.063.068-.106.058-.112.049-.127.03-.108.016-.088.012-.112L24 12l-.004-.096-.016-.13-.03-.127-.03-.087-.046-.107-.046-.086-.065-.1a1.267 1.267 0 00-.13-.15l-4-4zm4.084 4.094l-.084-.094c.03.03.058.061.084.094z",
|
13
|
+
fill: "currentColor"
|
14
|
+
}));
|
15
|
+
}
|
16
|
+
|
17
|
+
var LogOut = /*#__PURE__*/forwardRef(IconLogOut);
|
18
|
+
|
19
|
+
export default LogOut;
|
20
|
+
//# sourceMappingURL=LogOut.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LogOut.js","sources":["../../../../../src/components/Icon/components/LogOut.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction IconLogOut(props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>): JSX.Element {\n return (\n <svg fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" ref={svgRef} {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13.25 4.5H6.5v15h6.75a1.25 1.25 0 110 2.5h-7A2.25 2.25 0 014 19.75V4.25A2.25 2.25 0 016.25 2h7a1.25 1.25 0 110 2.5zm6.384 2.616l-.102-.091a1.25 1.25 0 00-1.666 1.859l1.867 1.866H11.75l-.128.007a1.25 1.25 0 00.128 2.493h7.982l-1.866 1.866-.091.102a1.25 1.25 0 001.859 1.666l4-4 .08-.089.05-.063.068-.106.058-.112.049-.127.03-.108.016-.088.012-.112L24 12l-.004-.096-.016-.13-.03-.127-.03-.087-.046-.107-.046-.086-.065-.1a1.267 1.267 0 00-.13-.15l-4-4zm4.084 4.094l-.084-.094c.03.03.058.061.084.094z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport default React.forwardRef(IconLogOut);\n"],"names":["IconLogOut","props","svgRef","React","fill","xmlns","viewBox","ref","fillRule","clipRule","d"],"mappings":";;AAEA,SAASA,UAAT,CAAoBC,KAApB,EAA0DC,MAA1D;EACI,OACIC,aAAA,MAAA;IAAKC,IAAI,EAAC;IAAOC,KAAK,EAAC;IAA6BC,OAAO,EAAC;IAAYC,GAAG,EAAEL;KAAYD,MAAzF,EACIE,aAAA,OAAA;IACIK,QAAQ,EAAC;IACTC,QAAQ,EAAC;IACTC,CAAC,EAAC;IACFN,IAAI,EAAC;GAJT,CADJ,CADJ;AAUH;;AAED,0BAAeD,UAAA,CAAiBH,UAAjB,CAAf;;;;"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
2
|
+
|
3
|
+
function IconMenu(props, svgRef) {
|
4
|
+
return createElement("svg", Object.assign({
|
5
|
+
fill: "none",
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
7
|
+
viewBox: "0 0 24 24",
|
8
|
+
ref: svgRef
|
9
|
+
}, props), createElement("path", {
|
10
|
+
d: "M4 19h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-6h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zM3 6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z",
|
11
|
+
fill: "currentColor"
|
12
|
+
}));
|
13
|
+
}
|
14
|
+
|
15
|
+
var Menu = /*#__PURE__*/forwardRef(IconMenu);
|
16
|
+
|
17
|
+
export default Menu;
|
18
|
+
//# sourceMappingURL=Menu.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../../src/components/Icon/components/Menu.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction IconMenu(props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>): JSX.Element {\n return (\n <svg fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" ref={svgRef} {...props}>\n <path\n d=\"M4 19h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-6h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zM3 6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport default React.forwardRef(IconMenu);\n"],"names":["IconMenu","props","svgRef","React","fill","xmlns","viewBox","ref","d"],"mappings":";;AAEA,SAASA,QAAT,CAAkBC,KAAlB,EAAwDC,MAAxD;EACI,OACIC,aAAA,MAAA;IAAKC,IAAI,EAAC;IAAOC,KAAK,EAAC;IAA6BC,OAAO,EAAC;IAAYC,GAAG,EAAEL;KAAYD,MAAzF,EACIE,aAAA,OAAA;IACIK,CAAC,EAAC;IACFJ,IAAI,EAAC;GAFT,CADJ,CADJ;AAQH;;AAED,wBAAeD,UAAA,CAAiBH,QAAjB,CAAf;;;;"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
2
|
+
|
3
|
+
function IconNumbers(props, svgRef) {
|
4
|
+
return createElement("svg", Object.assign({
|
5
|
+
fill: "none",
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
7
|
+
viewBox: "0 0 24 24",
|
8
|
+
ref: svgRef
|
9
|
+
}, props), createElement("path", {
|
10
|
+
d: "M3.203 16.625c0 .602.328.96.875.96.555 0 .875-.35.875-.96V7.898c0-.671-.437-1.132-1.078-1.132-.375 0-.742.14-1.273.515L1.125 8.344c-.367.25-.54.508-.54.789 0 .367.282.656.65.656.195 0 .382-.07.663-.266l1.258-.898h.047v8zm4.149.031c0 .516.414.844 1.046.844h5.22c.53 0 .843-.281.843-.734 0-.461-.328-.743-.844-.743H9.648v-.101l2.665-2.953c1.367-1.492 1.812-2.313 1.812-3.36 0-1.742-1.43-2.984-3.422-2.984-2.086 0-3.492 1.375-3.492 2.742 0 .485.312.813.766.813.367 0 .617-.211.804-.657.266-.906.93-1.43 1.82-1.43 1.063 0 1.774.665 1.774 1.657 0 .688-.344 1.313-1.21 2.266l-3.071 3.406c-.563.601-.742.89-.742 1.234zm8.562-1.375c0 1.242 1.555 2.446 3.617 2.446 2.274 0 3.867-1.297 3.867-3.141 0-1.352-.992-2.484-2.296-2.617v-.11c1.078-.171 1.953-1.257 1.953-2.421 0-1.649-1.461-2.813-3.524-2.813-1.984 0-3.414 1.156-3.414 2.39 0 .454.305.766.742.766.344 0 .578-.164.782-.578.367-.742 1.007-1.156 1.851-1.156 1.086 0 1.828.648 1.828 1.61 0 .952-.758 1.64-1.804 1.64h-.813c-.43 0-.726.305-.726.71 0 .423.304.735.726.735h.86c1.25 0 2.085.719 2.085 1.79 0 1.077-.82 1.765-2.093 1.765-.961 0-1.711-.422-2.14-1.188-.25-.414-.47-.57-.782-.57-.422 0-.719.313-.719.742z",
|
11
|
+
fill: "currentColor"
|
12
|
+
}));
|
13
|
+
}
|
14
|
+
|
15
|
+
var Numbers = /*#__PURE__*/forwardRef(IconNumbers);
|
16
|
+
|
17
|
+
export default Numbers;
|
18
|
+
//# sourceMappingURL=Numbers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Numbers.js","sources":["../../../../../src/components/Icon/components/Numbers.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction IconNumbers(props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>): JSX.Element {\n return (\n <svg fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" ref={svgRef} {...props}>\n <path\n d=\"M3.203 16.625c0 .602.328.96.875.96.555 0 .875-.35.875-.96V7.898c0-.671-.437-1.132-1.078-1.132-.375 0-.742.14-1.273.515L1.125 8.344c-.367.25-.54.508-.54.789 0 .367.282.656.65.656.195 0 .382-.07.663-.266l1.258-.898h.047v8zm4.149.031c0 .516.414.844 1.046.844h5.22c.53 0 .843-.281.843-.734 0-.461-.328-.743-.844-.743H9.648v-.101l2.665-2.953c1.367-1.492 1.812-2.313 1.812-3.36 0-1.742-1.43-2.984-3.422-2.984-2.086 0-3.492 1.375-3.492 2.742 0 .485.312.813.766.813.367 0 .617-.211.804-.657.266-.906.93-1.43 1.82-1.43 1.063 0 1.774.665 1.774 1.657 0 .688-.344 1.313-1.21 2.266l-3.071 3.406c-.563.601-.742.89-.742 1.234zm8.562-1.375c0 1.242 1.555 2.446 3.617 2.446 2.274 0 3.867-1.297 3.867-3.141 0-1.352-.992-2.484-2.296-2.617v-.11c1.078-.171 1.953-1.257 1.953-2.421 0-1.649-1.461-2.813-3.524-2.813-1.984 0-3.414 1.156-3.414 2.39 0 .454.305.766.742.766.344 0 .578-.164.782-.578.367-.742 1.007-1.156 1.851-1.156 1.086 0 1.828.648 1.828 1.61 0 .952-.758 1.64-1.804 1.64h-.813c-.43 0-.726.305-.726.71 0 .423.304.735.726.735h.86c1.25 0 2.085.719 2.085 1.79 0 1.077-.82 1.765-2.093 1.765-.961 0-1.711-.422-2.14-1.188-.25-.414-.47-.57-.782-.57-.422 0-.719.313-.719.742z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport default React.forwardRef(IconNumbers);\n"],"names":["IconNumbers","props","svgRef","React","fill","xmlns","viewBox","ref","d"],"mappings":";;AAEA,SAASA,WAAT,CAAqBC,KAArB,EAA2DC,MAA3D;EACI,OACIC,aAAA,MAAA;IAAKC,IAAI,EAAC;IAAOC,KAAK,EAAC;IAA6BC,OAAO,EAAC;IAAYC,GAAG,EAAEL;KAAYD,MAAzF,EACIE,aAAA,OAAA;IACIK,CAAC,EAAC;IACFJ,IAAI,EAAC;GAFT,CADJ,CADJ;AAQH;;AAED,2BAAeD,UAAA,CAAiBH,WAAjB,CAAf;;;;"}
|