@frontify/fondue-components 3.3.2 → 3.3.4
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/fondue-components18.js +79 -63
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components22.js +9 -9
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components26.js +1 -1
- package/dist/fondue-components29.js +1 -1
- package/dist/fondue-components31.js +1 -1
- package/dist/fondue-components36.js +14 -14
- package/dist/fondue-components39.js +12 -12
- package/dist/fondue-components48.js +66 -58
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +13 -9
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components50.js +60 -41
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components52.js +22 -20
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components56.js +14 -14
- package/dist/fondue-components58.js +11 -2
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +2 -11
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components7.js +66 -63
- package/dist/fondue-components7.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,90 +1,96 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { IconCaretDown as
|
|
3
|
-
import * as
|
|
4
|
-
import { Slot as
|
|
5
|
-
import { useSelect as
|
|
6
|
-
import { forwardRef as T, useRef as
|
|
7
|
-
import { ForwardedRefCombobox as
|
|
8
|
-
import { ForwardedRefSelectItem as
|
|
9
|
-
import { SelectMenu as
|
|
10
|
-
import { ForwardedRefSelectSlot as
|
|
11
|
-
import
|
|
12
|
-
import { useSelectData as
|
|
13
|
-
const
|
|
14
|
-
children:
|
|
15
|
-
onSelect:
|
|
16
|
-
value:
|
|
17
|
-
defaultValue:
|
|
18
|
-
placeholder:
|
|
19
|
-
status:
|
|
20
|
-
disabled:
|
|
21
|
-
"aria-label":
|
|
22
|
-
"data-test-id":
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretDown as z, IconCheckMark as D, IconExclamationMarkTriangle as j } from "@frontify/fondue-icons";
|
|
3
|
+
import * as S from "@radix-ui/react-popover";
|
|
4
|
+
import { Slot as E } from "@radix-ui/react-slot";
|
|
5
|
+
import { useSelect as H } from "downshift";
|
|
6
|
+
import { forwardRef as T, useRef as $, useState as A } from "react";
|
|
7
|
+
import { ForwardedRefCombobox as V } from "./fondue-components48.js";
|
|
8
|
+
import { ForwardedRefSelectItem as q, ForwardedRefSelectItemGroup as J } from "./fondue-components49.js";
|
|
9
|
+
import { SelectMenu as K } from "./fondue-components50.js";
|
|
10
|
+
import { ForwardedRefSelectSlot as L } from "./fondue-components51.js";
|
|
11
|
+
import a from "./fondue-components52.js";
|
|
12
|
+
import { useSelectData as Q } from "./fondue-components53.js";
|
|
13
|
+
const g = ({
|
|
14
|
+
children: h,
|
|
15
|
+
onSelect: i,
|
|
16
|
+
value: I,
|
|
17
|
+
defaultValue: N,
|
|
18
|
+
placeholder: b = "",
|
|
19
|
+
status: s = "neutral",
|
|
20
|
+
disabled: m,
|
|
21
|
+
"aria-label": C,
|
|
22
|
+
"data-test-id": l = "fondue-select"
|
|
23
23
|
}, d) => {
|
|
24
|
-
const { inputSlots: w, menuSlots:
|
|
25
|
-
items:
|
|
26
|
-
defaultSelectedItem:
|
|
27
|
-
selectedItem:
|
|
24
|
+
const { inputSlots: w, menuSlots: x, items: R, clearButton: u, getItemByValue: p } = Q(h), y = p(N), F = p(I), c = $(!1), [k, f] = A(!1), { getToggleButtonProps: v, getMenuProps: M, getItemProps: P, reset: B, selectedItem: r, isOpen: G, highlightedIndex: O } = H({
|
|
25
|
+
items: R,
|
|
26
|
+
defaultSelectedItem: y,
|
|
27
|
+
selectedItem: F,
|
|
28
|
+
onIsOpenChange: () => {
|
|
29
|
+
f(!1);
|
|
30
|
+
},
|
|
31
|
+
onHighlightedIndexChange: () => {
|
|
32
|
+
f(!0);
|
|
33
|
+
},
|
|
28
34
|
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
29
|
-
|
|
35
|
+
i && i(e.value);
|
|
30
36
|
},
|
|
31
37
|
itemToString: (e) => e ? e.label : ""
|
|
32
38
|
});
|
|
33
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ n(S.Root, { open: G, children: [
|
|
34
40
|
/* @__PURE__ */ o(
|
|
35
|
-
|
|
41
|
+
S.Anchor,
|
|
36
42
|
{
|
|
37
43
|
asChild: !0,
|
|
38
44
|
onMouseDown: (e) => {
|
|
39
|
-
|
|
45
|
+
c.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
40
46
|
},
|
|
41
47
|
onFocus: (e) => {
|
|
42
|
-
|
|
48
|
+
c.current || (e.target.dataset.showFocusRing = "true");
|
|
43
49
|
},
|
|
44
50
|
onBlur: (e) => {
|
|
45
|
-
e.target.dataset.showFocusRing = "false",
|
|
51
|
+
e.target.dataset.showFocusRing = "false", c.current = !1;
|
|
46
52
|
},
|
|
47
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ n(
|
|
48
54
|
"div",
|
|
49
55
|
{
|
|
50
|
-
className:
|
|
51
|
-
"data-status":
|
|
52
|
-
"data-disabled":
|
|
53
|
-
"data-empty": !
|
|
54
|
-
"data-test-id":
|
|
55
|
-
...
|
|
56
|
-
"aria-label":
|
|
56
|
+
className: a.root,
|
|
57
|
+
"data-status": s,
|
|
58
|
+
"data-disabled": m,
|
|
59
|
+
"data-empty": !r,
|
|
60
|
+
"data-test-id": l,
|
|
61
|
+
...m ? {} : v({
|
|
62
|
+
"aria-label": C,
|
|
57
63
|
...d ? { ref: d } : {}
|
|
58
64
|
}),
|
|
59
65
|
children: [
|
|
60
|
-
/* @__PURE__ */ o("span", { className:
|
|
66
|
+
/* @__PURE__ */ o("span", { className: a.input, children: r ? r.label : b }),
|
|
61
67
|
w,
|
|
62
68
|
u && /* @__PURE__ */ o(
|
|
63
|
-
|
|
69
|
+
E,
|
|
64
70
|
{
|
|
65
71
|
onClick: (e) => {
|
|
66
|
-
e.stopPropagation(),
|
|
72
|
+
e.stopPropagation(), B();
|
|
67
73
|
},
|
|
68
|
-
className:
|
|
74
|
+
className: a.clear,
|
|
69
75
|
children: u
|
|
70
76
|
}
|
|
71
77
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */ o(
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
/* @__PURE__ */ n("div", { className: a.icons, children: [
|
|
79
|
+
/* @__PURE__ */ o(z, { size: 16, className: a.caret }),
|
|
80
|
+
s === "success" ? /* @__PURE__ */ o(
|
|
81
|
+
D,
|
|
76
82
|
{
|
|
77
83
|
size: 16,
|
|
78
|
-
className:
|
|
79
|
-
"data-test-id": `${
|
|
84
|
+
className: a.iconSuccess,
|
|
85
|
+
"data-test-id": `${l}-success-icon`
|
|
80
86
|
}
|
|
81
87
|
) : null,
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
s === "error" ? /* @__PURE__ */ o(
|
|
89
|
+
j,
|
|
84
90
|
{
|
|
85
91
|
size: 16,
|
|
86
|
-
className:
|
|
87
|
-
"data-test-id": `${
|
|
92
|
+
className: a.iconError,
|
|
93
|
+
"data-test-id": `${l}-error-icon`
|
|
88
94
|
}
|
|
89
95
|
) : null
|
|
90
96
|
] })
|
|
@@ -93,23 +99,33 @@ const S = ({
|
|
|
93
99
|
)
|
|
94
100
|
}
|
|
95
101
|
),
|
|
96
|
-
/* @__PURE__ */ o(
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
|
+
K,
|
|
104
|
+
{
|
|
105
|
+
highlightedIndex: O,
|
|
106
|
+
getMenuProps: M,
|
|
107
|
+
getItemProps: P,
|
|
108
|
+
selectedItem: r,
|
|
109
|
+
hasInteractedSinceOpening: k,
|
|
110
|
+
children: x
|
|
111
|
+
}
|
|
112
|
+
)
|
|
97
113
|
] });
|
|
98
114
|
};
|
|
99
|
-
|
|
100
|
-
const
|
|
115
|
+
g.displayName = "Select";
|
|
116
|
+
const U = T(g), t = U;
|
|
101
117
|
t.displayName = "Select";
|
|
102
|
-
t.Combobox =
|
|
118
|
+
t.Combobox = V;
|
|
103
119
|
t.Combobox.displayName = "Select.Combobox";
|
|
104
|
-
t.Item =
|
|
120
|
+
t.Item = q;
|
|
105
121
|
t.Item.displayName = "Select.Item";
|
|
106
|
-
t.Group =
|
|
122
|
+
t.Group = J;
|
|
107
123
|
t.Group.displayName = "Select.Group";
|
|
108
|
-
t.Slot =
|
|
124
|
+
t.Slot = L;
|
|
109
125
|
t.Slot.displayName = "Select.Slot";
|
|
110
126
|
export {
|
|
111
|
-
|
|
127
|
+
U as ForwardedRefSelect,
|
|
112
128
|
t as Select,
|
|
113
|
-
|
|
129
|
+
g as SelectInput
|
|
114
130
|
};
|
|
115
131
|
//# sourceMappingURL=fondue-components18.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components18.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useSelect } from 'downshift';\nimport { forwardRef, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu } from './SelectMenu';\nimport { ForwardedRefSelectSlot } from './SelectSlot';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type SelectComponentProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string;\n /**\n * The default value of the select component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the select component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The aria label of the select component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select',\n }: SelectComponentProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n\n const defaultItem = getItemByValue(defaultValue);\n const activeItem = getItemByValue(value);\n\n const wasClicked = useRef(false);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor\n asChild\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n }}\n >\n <div\n className={styles.root}\n data-status={status}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': ariaLabel,\n ...(forwardedRef ? { ref: forwardedRef } : {}),\n }))}\n >\n <span className={styles.input}>{selectedItem ? selectedItem.label : placeholder}</span>\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu highlightedIndex={highlightedIndex} getMenuProps={getMenuProps} getItemProps={getItemProps}>\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectInput.displayName = 'Select';\n\nexport const ForwardedRefSelect = forwardRef<HTMLDivElement, SelectComponentProps>(SelectInput);\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectInput & {\n Combobox: typeof ForwardedRefCombobox;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = ForwardedRefSelect;\nSelect.displayName = 'Select';\nSelect.Combobox = ForwardedRefCombobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["SelectInput","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","wasClicked","useRef","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","jsxs","RadixPopover","jsx","mouseEvent","focusEvent","blurEvent","styles","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"fondue-components18.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useSelect } from 'downshift';\nimport { forwardRef, useRef, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu } from './SelectMenu';\nimport { ForwardedRefSelectSlot } from './SelectSlot';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type SelectComponentProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string;\n /**\n * The default value of the select component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the select component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The aria label of the select component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select',\n }: SelectComponentProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n\n const defaultItem = getItemByValue(defaultValue);\n const activeItem = getItemByValue(value);\n\n const wasClicked = useRef(false);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor\n asChild\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n }}\n >\n <div\n className={styles.root}\n data-status={status}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': ariaLabel,\n ...(forwardedRef ? { ref: forwardedRef } : {}),\n }))}\n >\n <span className={styles.input}>{selectedItem ? selectedItem.label : placeholder}</span>\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n highlightedIndex={highlightedIndex}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectInput.displayName = 'Select';\n\nexport const ForwardedRefSelect = forwardRef<HTMLDivElement, SelectComponentProps>(SelectInput);\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectInput & {\n Combobox: typeof ForwardedRefCombobox;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = ForwardedRefSelect;\nSelect.displayName = 'Select';\nSelect.Combobox = ForwardedRefCombobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["SelectInput","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","wasClicked","useRef","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","jsxs","RadixPopover","jsx","mouseEvent","focusEvent","blurEvent","styles","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":"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"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "@radix-ui/react-tooltip";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
4
|
import { cn as f } from "./fondue-components25.js";
|
|
5
|
-
import
|
|
5
|
+
import s from "./fondue-components57.js";
|
|
6
6
|
const d = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: a }) => /* @__PURE__ */ e(o.Provider, { children: /* @__PURE__ */ e(o.Root, { delayDuration: r, open: i, onOpenChange: a, children: t }) });
|
|
7
7
|
d.displayName = "Tooltip.Root";
|
|
8
|
-
const l = ({ children: t, "data-test-id": r = "fondue-tooltip-trigger" }, i) => /* @__PURE__ */ e(o.Trigger, { "data-test-id": r,
|
|
8
|
+
const l = ({ children: t, "data-test-id": r = "fondue-tooltip-trigger" }, i) => /* @__PURE__ */ e(o.Trigger, { "data-test-id": r, ref: i, children: t });
|
|
9
9
|
l.displayName = "Tooltip.Trigger";
|
|
10
10
|
const p = ({
|
|
11
11
|
children: t,
|
|
@@ -19,7 +19,7 @@ const p = ({
|
|
|
19
19
|
{
|
|
20
20
|
"data-test-id": a,
|
|
21
21
|
"data-tooltip-spacing": m,
|
|
22
|
-
className: f(
|
|
22
|
+
className: f(s.root, r),
|
|
23
23
|
style: { maxWidth: i },
|
|
24
24
|
collisionPadding: 16,
|
|
25
25
|
sideOffset: 8,
|
|
@@ -27,18 +27,18 @@ const p = ({
|
|
|
27
27
|
...c,
|
|
28
28
|
children: [
|
|
29
29
|
t,
|
|
30
|
-
/* @__PURE__ */ e(o.Arrow, { "aria-hidden": "true", className:
|
|
30
|
+
/* @__PURE__ */ e(o.Arrow, { "aria-hidden": "true", className: s.arrow })
|
|
31
31
|
]
|
|
32
32
|
}
|
|
33
33
|
) });
|
|
34
34
|
p.displayName = "Tooltip.Content";
|
|
35
|
-
const
|
|
35
|
+
const h = {
|
|
36
36
|
Root: d,
|
|
37
|
-
Trigger:
|
|
38
|
-
Content:
|
|
37
|
+
Trigger: n(l),
|
|
38
|
+
Content: n(p)
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
h as Tooltip,
|
|
42
42
|
p as TooltipContent,
|
|
43
43
|
d as TooltipRoot,
|
|
44
44
|
l as TooltipTrigger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components22.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\nexport type TooltipTriggerProps = {
|
|
1
|
+
{"version":3,"file":"fondue-components22.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\nexport type TooltipTriggerProps = {\n children: ReactNode;\n 'data-test-id'?: string;\n};\nexport type TooltipContentProps = {\n /**\n * @default \"spacious\"\n */\n padding?: 'spacious' | 'compact';\n /**\n * Defines the preferred side of the tooltip. It will not be respected if there are collisions with the viewport.\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n maxWidth?: string;\n className?: string;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipRoot = ({ children, enterDelay = 700, open, onOpenChange }: TooltipRootProps) => {\n return (\n <RadixTooltip.Provider>\n <RadixTooltip.Root delayDuration={enterDelay} open={open} onOpenChange={onOpenChange}>\n {children}\n </RadixTooltip.Root>\n </RadixTooltip.Provider>\n );\n};\nTooltipRoot.displayName = 'Tooltip.Root';\n\nexport const TooltipTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-tooltip-trigger' }: TooltipTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixTooltip.Trigger data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixTooltip.Trigger>\n );\n};\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nexport const TooltipContent = (\n {\n children,\n className,\n maxWidth,\n 'data-test-id': dataTestId = 'fondue-tooltip-content',\n padding = 'spacious',\n ...props\n }: TooltipContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixTooltip.Portal>\n <RadixTooltip.Content\n data-test-id={dataTestId}\n data-tooltip-spacing={padding}\n className={cn(styles.root, className)}\n style={{ maxWidth }}\n collisionPadding={16}\n sideOffset={8}\n ref={ref}\n {...props}\n >\n {children}\n <RadixTooltip.Arrow aria-hidden=\"true\" className={styles.arrow} />\n </RadixTooltip.Content>\n </RadixTooltip.Portal>\n );\n};\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: forwardRef<HTMLButtonElement, TooltipTriggerProps>(TooltipTrigger),\n Content: forwardRef<HTMLDivElement, TooltipContentProps>(TooltipContent),\n};\n"],"names":["TooltipRoot","children","enterDelay","open","onOpenChange","jsx","RadixTooltip","TooltipTrigger","dataTestId","ref","TooltipContent","className","maxWidth","padding","props","jsxs","cn","styles","Tooltip","forwardRef"],"mappings":";;;;;AA4Ca,MAAAA,IAAc,CAAC,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAK,MAAAC,GAAM,cAAAC,QAEvD,gBAAAC,EAAAC,EAAa,UAAb,EACG,UAAC,gBAAAD,EAAAC,EAAa,MAAb,EAAkB,eAAeJ,GAAY,MAAAC,GAAY,cAAAC,GACrD,UAAAH,GACL,EACJ,CAAA;AAGRD,EAAY,cAAc;AAEb,MAAAO,IAAiB,CAC1B,EAAE,UAAAN,GAAU,gBAAgBO,IAAa,4BACzCC,wBAGKH,EAAa,SAAb,EAAqB,gBAAcE,GAAY,KAAAC,GAC3C,UAAAR,EACL,CAAA;AAGRM,EAAe,cAAc;AAEtB,MAAMG,IAAiB,CAC1B;AAAA,EACI,UAAAT;AAAA,EACA,WAAAU;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBJ,IAAa;AAAA,EAC7B,SAAAK,IAAU;AAAA,EACV,GAAGC;AACP,GACAL,MAGI,gBAAAJ,EAACC,EAAa,QAAb,EACG,UAAA,gBAAAS;AAAA,EAACT,EAAa;AAAA,EAAb;AAAA,IACG,gBAAcE;AAAA,IACd,wBAAsBK;AAAA,IACtB,WAAWG,EAAGC,EAAO,MAAMN,CAAS;AAAA,IACpC,OAAO,EAAE,UAAAC,EAAS;AAAA,IAClB,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,KAAAH;AAAA,IACC,GAAGK;AAAA,IAEH,UAAA;AAAA,MAAAb;AAAA,MACD,gBAAAI,EAACC,EAAa,OAAb,EAAmB,eAAY,QAAO,WAAWW,EAAO,OAAO;AAAA,IAAA;AAAA,EAAA;AAExE,EAAA,CAAA;AAGRP,EAAe,cAAc;AAEtB,MAAMQ,IAAU;AAAA,EACnB,MAAMlB;AAAA,EACN,SAASmB,EAAmDZ,CAAc;AAAA,EAC1E,SAASY,EAAgDT,CAAc;AAC3E;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as t } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as t } from "./fondue-components59.js";
|
|
2
2
|
import { sv as e } from "./fondue-components25.js";
|
|
3
3
|
const o = e({
|
|
4
4
|
base: `tw-group tw-border tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium ${t}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as t } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as t } from "./fondue-components59.js";
|
|
2
2
|
import { sv as e } from "./fondue-components25.js";
|
|
3
3
|
const s = e({
|
|
4
4
|
base: `tw-peer tw-relative tw-inline-flex tw-bg-base tw-text-white tw-shrink-0 tw-rounded tw-border tw-border-line-x-strong group-hover:tw-border-line-xx-strong hover:tw-border-line-xx-strong tw-transition-colors data-[state="checked"]:tw-border-transparent data-[state="indeterminate"]:tw-border-transparent disabled:tw-border-line-strong disabled:tw-bg-base disabled:tw-cursor-not-allowed data-[state="checked"]:disabled:tw-bg-box-disabled-strong ${t}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as d, jsx as a, Fragment as m } from "react/jsx-runtime";
|
|
2
2
|
import { IconDroplet as n, IconTrashBin as p, IconCaretDown as f } from "@frontify/fondue-icons";
|
|
3
3
|
import { forwardRef as I, useId as N } from "react";
|
|
4
|
-
import i from "./fondue-
|
|
4
|
+
import i from "./fondue-components58.js";
|
|
5
5
|
import { colorToCss as h } from "./fondue-components34.js";
|
|
6
6
|
const c = ({ currentColor: e, onClear: s, "data-test-id": t = "color-picker-input", ...r }, l) => {
|
|
7
7
|
const o = N();
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const
|
|
2
|
-
content:
|
|
3
|
-
header:
|
|
4
|
-
footer:
|
|
5
|
-
body:
|
|
6
|
-
underlay:
|
|
7
|
-
sideContent:
|
|
1
|
+
const o = "_content_1nokb_6", n = "_header_1nokb_50", t = "_footer_1nokb_51", e = "_body_1nokb_52", _ = "_underlay_1nokb_77", d = "_sideContent_1nokb_90", s = {
|
|
2
|
+
content: o,
|
|
3
|
+
header: n,
|
|
4
|
+
footer: t,
|
|
5
|
+
body: e,
|
|
6
|
+
underlay: _,
|
|
7
|
+
sideContent: d
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
e as body,
|
|
11
|
+
o as content,
|
|
12
|
+
s as default,
|
|
13
|
+
t as footer,
|
|
14
|
+
n as header,
|
|
15
|
+
d as sideContent,
|
|
16
|
+
_ as underlay
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=fondue-components36.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
content:
|
|
1
|
+
const o = "_content_ojnoh_4", n = "_subContent_ojnoh_5", t = "_item_ojnoh_23", s = "_subTrigger_ojnoh_24", _ = "_subMenuIndicator_ojnoh_63", e = "_group_ojnoh_69", u = "_slot_ojnoh_76", c = {
|
|
2
|
+
content: o,
|
|
3
3
|
subContent: n,
|
|
4
|
-
item:
|
|
4
|
+
item: t,
|
|
5
5
|
subTrigger: s,
|
|
6
|
-
subMenuIndicator:
|
|
7
|
-
group:
|
|
8
|
-
slot:
|
|
6
|
+
subMenuIndicator: _,
|
|
7
|
+
group: e,
|
|
8
|
+
slot: u
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
o as content,
|
|
12
|
+
c as default,
|
|
13
|
+
e as group,
|
|
14
|
+
t as item,
|
|
15
|
+
u as slot,
|
|
16
16
|
n as subContent,
|
|
17
|
-
|
|
17
|
+
_ as subMenuIndicator,
|
|
18
18
|
s as subTrigger
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=fondue-components39.js.map
|
|
@@ -1,79 +1,85 @@
|
|
|
1
1
|
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { IconCaretDown as
|
|
2
|
+
import { IconCaretDown as j, IconCheckMark as $, IconExclamationMarkTriangle as A } from "@frontify/fondue-icons";
|
|
3
3
|
import * as x from "@radix-ui/react-popover";
|
|
4
|
-
import { Slot as
|
|
5
|
-
import { useCombobox as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { SelectMenu as
|
|
4
|
+
import { Slot as E } from "@radix-ui/react-slot";
|
|
5
|
+
import { useCombobox as q } from "downshift";
|
|
6
|
+
import { forwardRef as G, useState as J, useRef as K, useMemo as Q } from "react";
|
|
7
|
+
import { SelectMenu as U } from "./fondue-components50.js";
|
|
8
8
|
import o from "./fondue-components52.js";
|
|
9
|
-
import { useSelectData as
|
|
9
|
+
import { useSelectData as W } from "./fondue-components53.js";
|
|
10
10
|
const w = ({
|
|
11
|
-
children:
|
|
12
|
-
onSelect:
|
|
11
|
+
children: S,
|
|
12
|
+
onSelect: d,
|
|
13
13
|
value: N,
|
|
14
|
-
defaultValue:
|
|
14
|
+
defaultValue: O,
|
|
15
15
|
placeholder: R = "",
|
|
16
|
-
status:
|
|
17
|
-
disabled:
|
|
16
|
+
status: n = "neutral",
|
|
17
|
+
disabled: m,
|
|
18
18
|
"aria-label": B,
|
|
19
|
-
"data-test-id":
|
|
19
|
+
"data-test-id": s = "fondue-select-combobox"
|
|
20
20
|
}, M) => {
|
|
21
|
-
const { inputSlots: F, menuSlots: L, items:
|
|
22
|
-
getInputProps:
|
|
23
|
-
getToggleButtonProps:
|
|
24
|
-
getMenuProps:
|
|
25
|
-
getItemProps:
|
|
26
|
-
reset:
|
|
27
|
-
selectedItem:
|
|
28
|
-
isOpen:
|
|
29
|
-
highlightedIndex:
|
|
21
|
+
const { inputSlots: F, menuSlots: L, items: l, filterText: P, clearButton: p, getItemByValue: g, setFilterText: k } = W(S), [v, f] = J(!1), {
|
|
22
|
+
getInputProps: c,
|
|
23
|
+
getToggleButtonProps: y,
|
|
24
|
+
getMenuProps: D,
|
|
25
|
+
getItemProps: H,
|
|
26
|
+
reset: h,
|
|
27
|
+
selectedItem: r,
|
|
28
|
+
isOpen: T,
|
|
29
|
+
highlightedIndex: V,
|
|
30
30
|
inputValue: i
|
|
31
|
-
} =
|
|
32
|
-
items:
|
|
33
|
-
selectedItem:
|
|
34
|
-
defaultSelectedItem:
|
|
31
|
+
} = q({
|
|
32
|
+
items: l,
|
|
33
|
+
selectedItem: g(N),
|
|
34
|
+
defaultSelectedItem: g(O),
|
|
35
35
|
defaultHighlightedIndex: 0,
|
|
36
36
|
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
37
|
-
|
|
37
|
+
d && d(e.value);
|
|
38
38
|
},
|
|
39
39
|
onInputValueChange: ({ inputValue: e }) => {
|
|
40
40
|
k(e);
|
|
41
41
|
},
|
|
42
|
+
onIsOpenChange: () => {
|
|
43
|
+
f(!1);
|
|
44
|
+
},
|
|
45
|
+
onHighlightedIndexChange: () => {
|
|
46
|
+
f(!0);
|
|
47
|
+
},
|
|
42
48
|
itemToString: (e) => e ? e.label : ""
|
|
43
|
-
}),
|
|
44
|
-
() => !
|
|
45
|
-
[i,
|
|
46
|
-
),
|
|
47
|
-
var
|
|
48
|
-
e.target.dataset.showFocusRing = "false",
|
|
49
|
+
}), a = K(!1), b = Q(
|
|
50
|
+
() => !l.find((e) => e.label.toLowerCase().includes(i.toLowerCase())),
|
|
51
|
+
[i, l]
|
|
52
|
+
), z = (e) => {
|
|
53
|
+
var C, I;
|
|
54
|
+
e.target.dataset.showFocusRing = "false", a.current = !1, (r == null ? void 0 : r.label.toLocaleLowerCase()) !== i.toLocaleLowerCase() && h(), c().onBlur && ((I = (C = c()).onBlur) == null || I.call(C, e));
|
|
49
55
|
};
|
|
50
|
-
return /* @__PURE__ */ u(x.Root, { open:
|
|
51
|
-
/* @__PURE__ */ t(x.Anchor, { asChild: !0, children: /* @__PURE__ */ u("div", { ref: M, className: o.root, "data-status":
|
|
56
|
+
return /* @__PURE__ */ u(x.Root, { open: T, children: [
|
|
57
|
+
/* @__PURE__ */ t(x.Anchor, { asChild: !0, children: /* @__PURE__ */ u("div", { ref: M, className: o.root, "data-status": b ? "error" : n, children: [
|
|
52
58
|
/* @__PURE__ */ t(
|
|
53
59
|
"input",
|
|
54
60
|
{
|
|
55
|
-
...
|
|
61
|
+
...c({
|
|
56
62
|
"aria-label": B
|
|
57
63
|
}),
|
|
58
|
-
"data-test-id":
|
|
64
|
+
"data-test-id": s,
|
|
59
65
|
placeholder: R,
|
|
60
66
|
className: o.input,
|
|
61
|
-
disabled:
|
|
67
|
+
disabled: m,
|
|
62
68
|
onMouseDown: (e) => {
|
|
63
|
-
|
|
69
|
+
a.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
64
70
|
},
|
|
65
71
|
onFocus: (e) => {
|
|
66
|
-
|
|
72
|
+
a.current || (e.target.dataset.showFocusRing = "true");
|
|
67
73
|
},
|
|
68
|
-
onBlur:
|
|
74
|
+
onBlur: z
|
|
69
75
|
}
|
|
70
76
|
),
|
|
71
77
|
F,
|
|
72
78
|
p && /* @__PURE__ */ t(
|
|
73
|
-
|
|
79
|
+
E,
|
|
74
80
|
{
|
|
75
81
|
onClick: (e) => {
|
|
76
|
-
e.stopPropagation(),
|
|
82
|
+
e.stopPropagation(), h();
|
|
77
83
|
},
|
|
78
84
|
className: o.clear,
|
|
79
85
|
role: "button",
|
|
@@ -84,50 +90,52 @@ const w = ({
|
|
|
84
90
|
/* @__PURE__ */ t(
|
|
85
91
|
"button",
|
|
86
92
|
{
|
|
87
|
-
...
|
|
93
|
+
...y(),
|
|
88
94
|
type: "button",
|
|
89
95
|
"aria-label": "toggle menu",
|
|
90
|
-
disabled:
|
|
96
|
+
disabled: m,
|
|
91
97
|
onMouseDown: () => {
|
|
92
|
-
|
|
98
|
+
a.current = !0;
|
|
93
99
|
},
|
|
94
|
-
children: /* @__PURE__ */ t(
|
|
100
|
+
children: /* @__PURE__ */ t(j, { size: 16, className: o.caret })
|
|
95
101
|
}
|
|
96
102
|
),
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
n === "success" ? /* @__PURE__ */ t(
|
|
104
|
+
$,
|
|
99
105
|
{
|
|
100
106
|
size: 16,
|
|
101
107
|
className: o.iconSuccess,
|
|
102
|
-
"data-test-id": `${
|
|
108
|
+
"data-test-id": `${s}-success-icon`
|
|
103
109
|
}
|
|
104
110
|
) : null,
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
b || n === "error" ? /* @__PURE__ */ t(
|
|
112
|
+
A,
|
|
107
113
|
{
|
|
108
114
|
size: 16,
|
|
109
115
|
className: o.iconError,
|
|
110
|
-
"data-test-id": `${
|
|
116
|
+
"data-test-id": `${s}-error-icon`
|
|
111
117
|
}
|
|
112
118
|
) : null
|
|
113
119
|
] })
|
|
114
120
|
] }) }),
|
|
115
121
|
/* @__PURE__ */ t(
|
|
116
|
-
|
|
122
|
+
U,
|
|
117
123
|
{
|
|
118
|
-
highlightedIndex:
|
|
124
|
+
highlightedIndex: V,
|
|
119
125
|
filterText: P,
|
|
120
|
-
getMenuProps:
|
|
121
|
-
getItemProps:
|
|
126
|
+
getMenuProps: D,
|
|
127
|
+
getItemProps: H,
|
|
128
|
+
selectedItem: r,
|
|
129
|
+
hasInteractedSinceOpening: v,
|
|
122
130
|
children: L
|
|
123
131
|
}
|
|
124
132
|
)
|
|
125
133
|
] });
|
|
126
134
|
};
|
|
127
135
|
w.displayName = "Select.Combobox";
|
|
128
|
-
const
|
|
136
|
+
const ne = G(w);
|
|
129
137
|
export {
|
|
130
|
-
|
|
138
|
+
ne as ForwardedRefCombobox,
|
|
131
139
|
w as SelectCombobox
|
|
132
140
|
};
|
|
133
141
|
//# sourceMappingURL=fondue-components48.js.map
|