@frontify/fondue-components 4.0.0 → 4.0.2
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-components.js +32 -30
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +2 -2
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +41 -37
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +1 -1
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +1 -1
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +1 -1
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +2 -2
- package/dist/fondue-components17.js +2 -2
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +6 -6
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +2 -2
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +116 -65
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +64 -41
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +43 -32
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +32 -5
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +5 -12
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +10 -153
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +59 -22
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +17 -17
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +112 -15
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +2 -2
- package/dist/fondue-components30.js +19 -30
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +32 -28
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +23 -125
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +129 -20
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +21 -45
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +45 -28
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +28 -15
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +15 -60
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +60 -15
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +15 -19
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +4 -4
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +18 -4
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +3 -11
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +11 -3
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +5 -35
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +35 -13
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +12 -4
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +4 -24
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +24 -16
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +16 -139
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +140 -16
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components50.js +16 -72
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +72 -8
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +8 -33
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +32 -48
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +48 -10
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +8 -10
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +12 -17
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +52 -6
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +15 -2
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +17 -10
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +5 -5
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components60.js +6 -38
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +5 -0
- package/dist/fondue-components61.js.map +1 -0
- package/dist/fondue-components62.js +14 -0
- package/dist/fondue-components62.js.map +1 -0
- package/dist/fondue-components63.js +42 -0
- package/dist/fondue-components63.js.map +1 -0
- package/dist/fondue-components7.js +2 -2
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components8.js +2 -2
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components9.js +85 -69
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +71 -2
- package/dist/style.css +1 -1
- package/package.json +49 -48
|
@@ -1,143 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { useSelectData as X } from "./fondue-components53.js";
|
|
10
|
-
const w = ({
|
|
11
|
-
children: S,
|
|
12
|
-
onSelect: d,
|
|
13
|
-
value: N,
|
|
14
|
-
defaultValue: O,
|
|
15
|
-
placeholder: R = "",
|
|
16
|
-
status: n = "neutral",
|
|
17
|
-
disabled: m,
|
|
18
|
-
"aria-label": B,
|
|
19
|
-
"data-test-id": s = "fondue-select-combobox",
|
|
20
|
-
alignMenu: M = "start"
|
|
21
|
-
}, F) => {
|
|
22
|
-
const { inputSlots: L, menuSlots: P, items: l, filterText: k, clearButton: g, getItemByValue: p, setFilterText: v } = X(S), [y, f] = K(!1), {
|
|
23
|
-
getInputProps: c,
|
|
24
|
-
getToggleButtonProps: D,
|
|
25
|
-
getMenuProps: H,
|
|
26
|
-
getItemProps: T,
|
|
27
|
-
reset: h,
|
|
28
|
-
selectedItem: r,
|
|
29
|
-
isOpen: V,
|
|
30
|
-
highlightedIndex: z,
|
|
31
|
-
inputValue: i
|
|
32
|
-
} = G({
|
|
33
|
-
items: l,
|
|
34
|
-
selectedItem: p(N),
|
|
35
|
-
defaultSelectedItem: p(O),
|
|
36
|
-
defaultHighlightedIndex: 0,
|
|
37
|
-
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
38
|
-
d && d(e.value);
|
|
39
|
-
},
|
|
40
|
-
onInputValueChange: ({ inputValue: e }) => {
|
|
41
|
-
v(e);
|
|
42
|
-
},
|
|
43
|
-
onIsOpenChange: () => {
|
|
44
|
-
f(!1);
|
|
45
|
-
},
|
|
46
|
-
onHighlightedIndexChange: () => {
|
|
47
|
-
f(!0);
|
|
48
|
-
},
|
|
49
|
-
itemToString: (e) => e ? e.label : ""
|
|
50
|
-
}), a = Q(!1), b = U(
|
|
51
|
-
() => !l.find((e) => e.label.toLowerCase().includes(i.toLowerCase())),
|
|
52
|
-
[i, l]
|
|
53
|
-
), j = (e) => {
|
|
54
|
-
var C, I;
|
|
55
|
-
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));
|
|
56
|
-
};
|
|
57
|
-
return /* @__PURE__ */ u(x.Root, { open: V, children: [
|
|
58
|
-
/* @__PURE__ */ t(x.Anchor, { asChild: !0, children: /* @__PURE__ */ u("div", { ref: F, className: o.root, "data-status": b ? "error" : n, children: [
|
|
59
|
-
/* @__PURE__ */ t(
|
|
60
|
-
"input",
|
|
61
|
-
{
|
|
62
|
-
...c({
|
|
63
|
-
"aria-label": B
|
|
64
|
-
}),
|
|
65
|
-
"data-test-id": s,
|
|
66
|
-
placeholder: R,
|
|
67
|
-
className: o.input,
|
|
68
|
-
disabled: m,
|
|
69
|
-
onMouseDown: (e) => {
|
|
70
|
-
a.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
71
|
-
},
|
|
72
|
-
onFocus: (e) => {
|
|
73
|
-
a.current || (e.target.dataset.showFocusRing = "true");
|
|
74
|
-
},
|
|
75
|
-
onBlur: j
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
L,
|
|
79
|
-
g && /* @__PURE__ */ t(
|
|
80
|
-
q,
|
|
81
|
-
{
|
|
82
|
-
onClick: (e) => {
|
|
83
|
-
e.stopPropagation(), h();
|
|
84
|
-
},
|
|
85
|
-
className: o.clear,
|
|
86
|
-
role: "button",
|
|
87
|
-
children: g
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ u("div", { className: o.icons, children: [
|
|
91
|
-
/* @__PURE__ */ t(
|
|
92
|
-
"button",
|
|
93
|
-
{
|
|
94
|
-
...D(),
|
|
95
|
-
type: "button",
|
|
96
|
-
"aria-label": "toggle menu",
|
|
97
|
-
disabled: m,
|
|
98
|
-
onMouseDown: () => {
|
|
99
|
-
a.current = !0;
|
|
100
|
-
},
|
|
101
|
-
children: /* @__PURE__ */ t($, { size: 16, className: o.caret })
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
n === "success" ? /* @__PURE__ */ t(
|
|
105
|
-
A,
|
|
106
|
-
{
|
|
107
|
-
size: 16,
|
|
108
|
-
className: o.iconSuccess,
|
|
109
|
-
"data-test-id": `${s}-success-icon`
|
|
110
|
-
}
|
|
111
|
-
) : null,
|
|
112
|
-
b || n === "error" ? /* @__PURE__ */ t(
|
|
113
|
-
E,
|
|
114
|
-
{
|
|
115
|
-
size: 16,
|
|
116
|
-
className: o.iconError,
|
|
117
|
-
"data-test-id": `${s}-error-icon`
|
|
118
|
-
}
|
|
119
|
-
) : null
|
|
120
|
-
] })
|
|
121
|
-
] }) }),
|
|
122
|
-
/* @__PURE__ */ t(
|
|
123
|
-
W,
|
|
124
|
-
{
|
|
125
|
-
align: M,
|
|
126
|
-
highlightedIndex: z,
|
|
127
|
-
filterText: k,
|
|
128
|
-
getMenuProps: H,
|
|
129
|
-
getItemProps: T,
|
|
130
|
-
selectedItem: r,
|
|
131
|
-
hasInteractedSinceOpening: y,
|
|
132
|
-
children: P
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
] });
|
|
1
|
+
const t = "_root_2wdi8_5", e = "_item_2wdi8_26", i = "_itemLabel_2wdi8_46", a = "_itemLabelActive_2wdi8_65", o = "_itemLabelInactive_2wdi8_94", _ = "_activeIndicator_2wdi8_124", c = "_separator_2wdi8_221", n = {
|
|
2
|
+
root: t,
|
|
3
|
+
item: e,
|
|
4
|
+
itemLabel: i,
|
|
5
|
+
itemLabelActive: a,
|
|
6
|
+
itemLabelInactive: o,
|
|
7
|
+
activeIndicator: _,
|
|
8
|
+
separator: c
|
|
136
9
|
};
|
|
137
|
-
w.displayName = "Select.Combobox";
|
|
138
|
-
const se = J(w);
|
|
139
10
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
11
|
+
_ as activeIndicator,
|
|
12
|
+
n as default,
|
|
13
|
+
e as item,
|
|
14
|
+
i as itemLabel,
|
|
15
|
+
a as itemLabelActive,
|
|
16
|
+
o as itemLabelInactive,
|
|
17
|
+
t as root,
|
|
18
|
+
c as separator
|
|
142
19
|
};
|
|
143
20
|
//# sourceMappingURL=fondue-components48.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components48.js","sources":["../src/components/Select/Combobox.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 { useCombobox } from 'downshift';\nimport { forwardRef, useMemo, useRef, useState, type FocusEvent, type ForwardedRef, type ReactNode } from 'react';\n\nimport { SelectMenu } from './SelectMenu';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type ComboboxProps = {\n /**\n * Children of the Combobox 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 combobox component. This is used to control the combobox externally.\n */\n value?: string;\n /**\n * The default value of the combobox component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the combobox 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 combobox component.\n */\n disabled?: boolean;\n /**\n * The alignment of the menu.\n * @default \"start\"\n */\n alignMenu?: 'start' | 'center' | 'end';\n /**\n * The aria label of the combobox 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 SelectCombobox = (\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-combobox',\n alignMenu = 'start',\n }: ComboboxProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, filterText, clearButton, getItemByValue, setFilterText } =\n useSelectData(children);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const {\n getInputProps,\n getToggleButtonProps,\n getMenuProps,\n getItemProps,\n reset,\n selectedItem,\n isOpen,\n highlightedIndex,\n inputValue,\n } = useCombobox({\n items,\n selectedItem: getItemByValue(value),\n defaultSelectedItem: getItemByValue(defaultValue),\n defaultHighlightedIndex: 0,\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n onInputValueChange: ({ inputValue }) => {\n setFilterText(inputValue);\n },\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n const wasClicked = useRef(false);\n\n const valueInvalid = useMemo(\n () => !items.find((item) => item.label.toLowerCase().includes(inputValue.toLowerCase())),\n [inputValue, items],\n );\n\n const onBlurHandler = (blurEvent: FocusEvent<HTMLInputElement, Element>) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n\n const selectedItemNullOrOutdated = selectedItem?.label.toLocaleLowerCase() !== inputValue.toLocaleLowerCase();\n\n if (selectedItemNullOrOutdated) {\n // if there is no selection or\n // the existing selected value is not the same as the input value (old),\n // reset the input\n reset();\n }\n\n if (getInputProps().onBlur) {\n getInputProps().onBlur?.(blurEvent);\n }\n };\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor asChild>\n <div ref={forwardedRef} className={styles.root} data-status={valueInvalid ? 'error' : status}>\n <input\n {...getInputProps({\n 'aria-label': ariaLabel,\n })}\n data-test-id={dataTestId}\n placeholder={placeholder}\n className={styles.input}\n disabled={disabled}\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={onBlurHandler}\n />\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n role=\"button\"\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <button\n {...getToggleButtonProps()}\n type=\"button\"\n aria-label=\"toggle menu\"\n disabled={disabled}\n onMouseDown={() => {\n wasClicked.current = true;\n }}\n >\n <IconCaretDown size={16} className={styles.caret} />\n </button>\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {valueInvalid || 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 align={alignMenu}\n highlightedIndex={highlightedIndex}\n filterText={filterText}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectCombobox.displayName = 'Select.Combobox';\n\nexport const ForwardedRefCombobox = forwardRef<HTMLDivElement, ComboboxProps>(SelectCombobox);\n"],"names":["SelectCombobox","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","alignMenu","forwardedRef","inputSlots","menuSlots","items","filterText","clearButton","getItemByValue","setFilterText","useSelectData","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getInputProps","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","inputValue","useCombobox","item","wasClicked","useRef","valueInvalid","useMemo","onBlurHandler","blurEvent","_b","_a","jsxs","RadixPopover","jsx","styles","mouseEvent","focusEvent","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefCombobox","forwardRef"],"mappings":";;;;;;;;;AAyDO,MAAMA,IAAiB,CAC1B;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AAAA,EAC7B,WAAAC,IAAY;AAChB,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WA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O;AAAA,UAAA;AAAA,QACtD;AAAA,QACCvC,MAAW,YACR,gBAAAsC;AAAA,UAACO;AAAA,UAAA;AAAA,YACG,MAAM;AAAA,YACN,WAAWN,EAAO;AAAA,YAClB,gBAAc,GAAGpC,CAAU;AAAA,UAAA;AAAA,QAAA,IAE/B;AAAA,QACH2B,KAAgB9B,MAAW,UACxB,gBAAAsC;AAAA,UAACQ;AAAA,UAAA;AAAA,YACG,MAAM;AAAA,YACN,WAAWP,EAAO;AAAA,YAClB,gBAAc,GAAGpC,CAAU;AAAA,UAAA;AAAA,QAAA,IAE/B;AAAA,MAAA,GACR;AAAA,IAAA,EAAA,CACJ,EACJ,CAAA;AAAA,IAEA,gBAAAmC;AAAA,MAACS;AAAA,MAAA;AAAA,QACG,OAAO3C;AAAA,QACP,kBAAAoB;AAAA,QACA,YAAAf;AAAA,QACA,cAAAU;AAAA,QACA,cAAAC;AAAA,QACA,cAAAE;AAAA,QACA,2BAAAR;AAAA,QAEC,UAAAP;AAAA,MAAA;AAAA,IACL;AAAA,EACJ,EAAA,CAAA;AAER;AACAb,EAAe,cAAc;AAEhB,MAAAsD,KAAuBC,EAA0CvD,CAAc;"}
|
|
1
|
+
{"version":3,"file":"fondue-components48.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,19 +1,143 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { IconCheckMark as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretDown as $, IconCheckMark as A, IconExclamationMarkTriangle as E } from "@frontify/fondue-icons";
|
|
3
|
+
import * as x from "@radix-ui/react-popover";
|
|
4
|
+
import { Slot as q } from "@radix-ui/react-slot";
|
|
5
|
+
import { useCombobox as G } from "downshift";
|
|
6
|
+
import { forwardRef as J, useState as K, useRef as Q, useMemo as U } from "react";
|
|
7
|
+
import { SelectMenu as W } from "./fondue-components51.js";
|
|
8
|
+
import o from "./fondue-components53.js";
|
|
9
|
+
import { useSelectData as X } from "./fondue-components54.js";
|
|
10
|
+
const w = ({
|
|
11
|
+
children: S,
|
|
12
|
+
onSelect: d,
|
|
13
|
+
value: N,
|
|
14
|
+
defaultValue: O,
|
|
15
|
+
placeholder: R = "",
|
|
16
|
+
status: n = "neutral",
|
|
17
|
+
disabled: m,
|
|
18
|
+
"aria-label": B,
|
|
19
|
+
"data-test-id": s = "fondue-select-combobox",
|
|
20
|
+
alignMenu: M = "start"
|
|
21
|
+
}, F) => {
|
|
22
|
+
const { inputSlots: L, menuSlots: P, items: l, filterText: k, clearButton: g, getItemByValue: p, setFilterText: v } = X(S), [y, f] = K(!1), {
|
|
23
|
+
getInputProps: c,
|
|
24
|
+
getToggleButtonProps: D,
|
|
25
|
+
getMenuProps: H,
|
|
26
|
+
getItemProps: T,
|
|
27
|
+
reset: h,
|
|
28
|
+
selectedItem: r,
|
|
29
|
+
isOpen: V,
|
|
30
|
+
highlightedIndex: z,
|
|
31
|
+
inputValue: i
|
|
32
|
+
} = G({
|
|
33
|
+
items: l,
|
|
34
|
+
selectedItem: p(N),
|
|
35
|
+
defaultSelectedItem: p(O),
|
|
36
|
+
defaultHighlightedIndex: 0,
|
|
37
|
+
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
38
|
+
d && d(e.value);
|
|
39
|
+
},
|
|
40
|
+
onInputValueChange: ({ inputValue: e }) => {
|
|
41
|
+
v(e);
|
|
42
|
+
},
|
|
43
|
+
onIsOpenChange: () => {
|
|
44
|
+
f(!1);
|
|
45
|
+
},
|
|
46
|
+
onHighlightedIndexChange: () => {
|
|
47
|
+
f(!0);
|
|
48
|
+
},
|
|
49
|
+
itemToString: (e) => e ? e.label : ""
|
|
50
|
+
}), a = Q(!1), b = U(
|
|
51
|
+
() => !l.find((e) => e.label.toLowerCase().includes(i.toLowerCase())),
|
|
52
|
+
[i, l]
|
|
53
|
+
), j = (e) => {
|
|
54
|
+
var C, I;
|
|
55
|
+
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));
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ u(x.Root, { open: V, children: [
|
|
58
|
+
/* @__PURE__ */ t(x.Anchor, { asChild: !0, children: /* @__PURE__ */ u("div", { ref: F, className: o.root, "data-status": b ? "error" : n, children: [
|
|
59
|
+
/* @__PURE__ */ t(
|
|
60
|
+
"input",
|
|
61
|
+
{
|
|
62
|
+
...c({
|
|
63
|
+
"aria-label": B
|
|
64
|
+
}),
|
|
65
|
+
"data-test-id": s,
|
|
66
|
+
placeholder: R,
|
|
67
|
+
className: o.input,
|
|
68
|
+
disabled: m,
|
|
69
|
+
onMouseDown: (e) => {
|
|
70
|
+
a.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
71
|
+
},
|
|
72
|
+
onFocus: (e) => {
|
|
73
|
+
a.current || (e.target.dataset.showFocusRing = "true");
|
|
74
|
+
},
|
|
75
|
+
onBlur: j
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
L,
|
|
79
|
+
g && /* @__PURE__ */ t(
|
|
80
|
+
q,
|
|
81
|
+
{
|
|
82
|
+
onClick: (e) => {
|
|
83
|
+
e.stopPropagation(), h();
|
|
84
|
+
},
|
|
85
|
+
className: o.clear,
|
|
86
|
+
role: "button",
|
|
87
|
+
children: g
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ u("div", { className: o.icons, children: [
|
|
91
|
+
/* @__PURE__ */ t(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
...D(),
|
|
95
|
+
type: "button",
|
|
96
|
+
"aria-label": "toggle menu",
|
|
97
|
+
disabled: m,
|
|
98
|
+
onMouseDown: () => {
|
|
99
|
+
a.current = !0;
|
|
100
|
+
},
|
|
101
|
+
children: /* @__PURE__ */ t($, { size: 16, className: o.caret })
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
n === "success" ? /* @__PURE__ */ t(
|
|
105
|
+
A,
|
|
106
|
+
{
|
|
107
|
+
size: 16,
|
|
108
|
+
className: o.iconSuccess,
|
|
109
|
+
"data-test-id": `${s}-success-icon`
|
|
110
|
+
}
|
|
111
|
+
) : null,
|
|
112
|
+
b || n === "error" ? /* @__PURE__ */ t(
|
|
113
|
+
E,
|
|
114
|
+
{
|
|
115
|
+
size: 16,
|
|
116
|
+
className: o.iconError,
|
|
117
|
+
"data-test-id": `${s}-error-icon`
|
|
118
|
+
}
|
|
119
|
+
) : null
|
|
120
|
+
] })
|
|
121
|
+
] }) }),
|
|
122
|
+
/* @__PURE__ */ t(
|
|
123
|
+
W,
|
|
124
|
+
{
|
|
125
|
+
align: M,
|
|
126
|
+
highlightedIndex: z,
|
|
127
|
+
filterText: k,
|
|
128
|
+
getMenuProps: H,
|
|
129
|
+
getItemProps: T,
|
|
130
|
+
selectedItem: r,
|
|
131
|
+
hasInteractedSinceOpening: y,
|
|
132
|
+
children: P
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] });
|
|
136
|
+
};
|
|
137
|
+
w.displayName = "Select.Combobox";
|
|
138
|
+
const se = J(w);
|
|
13
139
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
d as SelectItem,
|
|
17
|
-
m as SelectItemGroup
|
|
140
|
+
se as ForwardedRefCombobox,
|
|
141
|
+
w as SelectCombobox
|
|
18
142
|
};
|
|
19
143
|
//# sourceMappingURL=fondue-components49.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components49.js","sources":["../src/components/Select/SelectItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark } from '@frontify/fondue-icons';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectItemProps = {\n /**\n * The value of the select item.\n */\n value: string;\n /**\n * The data test id of the select item.\n */\n 'data-test-id'?: string;\n} & (\n | {\n /**\n * The label of the select item. Required when the child is not a string.\n */\n label: string;\n /**\n * The children of the select item. This can be a custom component or a string.\n */\n children?: ReactNode;\n }\n | {\n label?: string;\n children: string;\n }\n);\n\nexport const SelectItem = (\n { 'data-test-id': dataTestId = 'fondue-select-item', ...props }: SelectItemProps,\n forwardedRef?: ForwardedRef<HTMLLIElement>,\n) => {\n return (\n <li data-test-id={dataTestId} ref={forwardedRef} {...props}>\n <div className={styles.itemValue}>{props.children}</div>\n <IconCheckMark className={styles.checkmarkIcon} />\n </li>\n );\n};\nSelectItem.displayName = 'Select.Item';\n\nexport const ForwardedRefSelectItem = forwardRef<HTMLLIElement, SelectItemProps>(SelectItem);\n\nexport type SelectItemGroupProps = {\n /**\n * The children of the select item group. This can contain multiple `Select.Item` components.\n */\n children: ReactNode;\n /**\n * The internal group ID of the select item group.\n */\n groupId: string;\n /**\n * The data test id of the select item group.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectItemGroup = (\n { children, groupId, 'data-test-id': dataTestId = 'fondue-select-item-group' }: SelectItemGroupProps,\n forwardedRef?: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} className={styles.group} ref={forwardedRef} key={groupId}>\n {children}\n </div>\n );\n};\nSelectItemGroup.displayName = 'Select.Group';\n\nexport const ForwardedRefSelectItemGroup = forwardRef<HTMLDivElement, SelectItemGroupProps>(SelectItemGroup);\n"],"names":["SelectItem","dataTestId","props","forwardedRef","jsx","styles","IconCheckMark","ForwardedRefSelectItem","forwardRef","SelectItemGroup","children","groupId","ForwardedRefSelectItemGroup"],"mappings":";;;;AAiCa,MAAAA,IAAa,CACtB,EAAE,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GAC9DC,wBAGK,MAAG,EAAA,gBAAcF,GAAY,KAAKE,GAAe,GAAGD,GACjD,UAAA;AAAA,EAAA,gBAAAE,EAAC,OAAI,EAAA,WAAWC,EAAO,WAAY,YAAM,UAAS;AAAA,EACjD,gBAAAD,EAAAE,GAAA,EAAc,WAAWD,EAAO,cAAe,CAAA;AACpD,EAAA,CAAA;AAGRL,EAAW,cAAc;AAEZ,MAAAO,IAAyBC,EAA2CR,CAAU,GAiB9ES,IAAkB,CAC3B,EAAE,UAAAC,GAAU,SAAAC,GAAS,gBAAgBV,IAAa,2BAA2B,GAC7EE,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcH,GAAY,WAAWI,EAAO,OAAO,KAAKF,GACxD,UAAAO,EAAA,GAD2EC,CAEhF;AAGRF,EAAgB,cAAc;AAEjB,MAAAG,IAA8BJ,EAAiDC,CAAe;"}
|
|
1
|
+
{"version":3,"file":"fondue-components49.js","sources":["../src/components/Select/Combobox.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 { useCombobox } from 'downshift';\nimport { forwardRef, useMemo, useRef, useState, type FocusEvent, type ForwardedRef, type ReactNode } from 'react';\n\nimport { SelectMenu } from './SelectMenu';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type ComboboxProps = {\n /**\n * Children of the Combobox 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 combobox component. This is used to control the combobox externally.\n */\n value?: string;\n /**\n * The default value of the combobox component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the combobox 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 combobox component.\n */\n disabled?: boolean;\n /**\n * The alignment of the menu.\n * @default \"start\"\n */\n alignMenu?: 'start' | 'center' | 'end';\n /**\n * The aria label of the combobox 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 SelectCombobox = (\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-combobox',\n alignMenu = 'start',\n }: ComboboxProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, filterText, clearButton, getItemByValue, setFilterText } =\n useSelectData(children);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const {\n getInputProps,\n getToggleButtonProps,\n getMenuProps,\n getItemProps,\n reset,\n selectedItem,\n isOpen,\n highlightedIndex,\n inputValue,\n } = useCombobox({\n items,\n selectedItem: getItemByValue(value),\n defaultSelectedItem: getItemByValue(defaultValue),\n defaultHighlightedIndex: 0,\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n onInputValueChange: ({ inputValue }) => {\n setFilterText(inputValue);\n },\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n const wasClicked = useRef(false);\n\n const valueInvalid = useMemo(\n () => !items.find((item) => item.label.toLowerCase().includes(inputValue.toLowerCase())),\n [inputValue, items],\n );\n\n const onBlurHandler = (blurEvent: FocusEvent<HTMLInputElement, Element>) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n\n const selectedItemNullOrOutdated = selectedItem?.label.toLocaleLowerCase() !== inputValue.toLocaleLowerCase();\n\n if (selectedItemNullOrOutdated) {\n // if there is no selection or\n // the existing selected value is not the same as the input value (old),\n // reset the input\n reset();\n }\n\n if (getInputProps().onBlur) {\n getInputProps().onBlur?.(blurEvent);\n }\n };\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor asChild>\n <div ref={forwardedRef} className={styles.root} data-status={valueInvalid ? 'error' : status}>\n <input\n {...getInputProps({\n 'aria-label': ariaLabel,\n })}\n data-test-id={dataTestId}\n placeholder={placeholder}\n className={styles.input}\n disabled={disabled}\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={onBlurHandler}\n />\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n role=\"button\"\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <button\n {...getToggleButtonProps()}\n type=\"button\"\n aria-label=\"toggle menu\"\n disabled={disabled}\n onMouseDown={() => {\n wasClicked.current = true;\n }}\n >\n <IconCaretDown size={16} className={styles.caret} />\n </button>\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {valueInvalid || 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 align={alignMenu}\n highlightedIndex={highlightedIndex}\n filterText={filterText}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectCombobox.displayName = 'Select.Combobox';\n\nexport const ForwardedRefCombobox = forwardRef<HTMLDivElement, ComboboxProps>(SelectCombobox);\n"],"names":["SelectCombobox","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","alignMenu","forwardedRef","inputSlots","menuSlots","items","filterText","clearButton","getItemByValue","setFilterText","useSelectData","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getInputProps","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","inputValue","useCombobox","item","wasClicked","useRef","valueInvalid","useMemo","onBlurHandler","blurEvent","_b","_a","jsxs","RadixPopover","jsx","styles","mouseEvent","focusEvent","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefCombobox","forwardRef"],"mappings":";;;;;;;;;AAyDO,MAAMA,IAAiB,CAC1B;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AAAA,EAC7B,WAAAC,IAAY;AAChB,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GAAO,YAAAC,GAAY,aAAAC,GAAa,gBAAAC,GAAgB,eAAAC,EAAA,IAC3EC,EAAclB,CAAQ,GAEpB,CAACmB,GAA2BC,CAA4B,IAAIC,EAAS,EAAK,GAE1E;AAAA,IACF,eAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,MACAC,EAAY;AAAA,IACZ,OAAAlB;AAAA,IACA,cAAcG,EAAed,CAAK;AAAA,IAClC,qBAAqBc,EAAeb,CAAY;AAAA,IAChD,yBAAyB;AAAA,IACzB,sBAAsB,CAAC,EAAE,cAAAwB,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AAA,MAAA;AAAA,QACG,OAAO3C;AAAA,QACP,kBAAAoB;AAAA,QACA,YAAAf;AAAA,QACA,cAAAU;AAAA,QACA,cAAAC;AAAA,QACA,cAAAE;AAAA,QACA,2BAAAR;AAAA,QAEC,UAAAP;AAAA,MAAA;AAAA,IAAA;AAAA,EACL,GACJ;AAER;AACAb,EAAe,cAAc;AAEhB,MAAAsD,KAAuBC,EAA0CvD,CAAc;"}
|
|
@@ -2,8 +2,8 @@ import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconMinus as m, IconCheckMark as h } from "@frontify/fondue-icons";
|
|
3
3
|
import * as o from "@radix-ui/react-checkbox";
|
|
4
4
|
import { forwardRef as k } from "react";
|
|
5
|
-
import { cn as p } from "./fondue-
|
|
6
|
-
import { checkboxStyles as l, checkboxIndicatorStyles as w } from "./fondue-
|
|
5
|
+
import { cn as p } from "./fondue-components26.js";
|
|
6
|
+
import { checkboxStyles as l, checkboxIndicatorStyles as w } from "./fondue-components30.js";
|
|
7
7
|
const f = ({
|
|
8
8
|
className: a,
|
|
9
9
|
value: c,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components5.js","sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark, IconMinus } from '@frontify/fondue-icons';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { forwardRef, type FormEvent, type ForwardedRef } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { checkboxIndicatorStyles, checkboxStyles } from './styles/checkboxStyles';\n\nexport type CheckboxProps = {\n id?: string;\n name?: string;\n /**\n * The default value of the checkbox\n * Used for uncontrolled components\n * @default false\n */\n defaultValue?: boolean | 'indeterminate';\n /**\n * The controlled value of the checkbox\n * @default false\n */\n value?: boolean | 'indeterminate';\n /**\n * The size of the checkbox\n * @default \"default\"\n */\n size?: 'default' | 'large';\n /**\n * The emphasis of the checkbox\n * @default \"default\"\n */\n emphasis?: 'default' | 'weak';\n /**\n * Disable the checkbox\n * @default false\n */\n disabled?: boolean;\n /**\n * Make the checkbox required in form\n * @default false\n */\n required?: boolean;\n /**\n * Make the checkbox read-only\n * @default false\n */\n readOnly?: boolean;\n className?: string;\n /**\n * Event handler called when the checkbox value changes\n */\n onChange?: (event: FormEvent<HTMLButtonElement>) => void;\n /**\n * Event handler called when the checkbox is blurred\n */\n onBlur?: (event: FormEvent<HTMLButtonElement>) => void;\n /**\n * Event handler called when the checkbox is focused\n */\n onFocus?: (event: FormEvent<HTMLButtonElement>) => void;\n 'data-test-id'?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n};\n\nexport const CheckboxComponent = (\n {\n className,\n value,\n onChange,\n defaultValue,\n 'data-test-id': dataTestId = 'fondue-checkbox',\n ...props\n }: CheckboxProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={value}\n defaultChecked={defaultValue}\n className={cn(checkboxStyles(props), className)}\n onClick={onChange}\n data-test-id={dataTestId}\n {...props}\n >\n <CheckboxPrimitive.Indicator className={checkboxIndicatorStyles}>\n <IconMinus\n size={16}\n className='tw-hidden tw-opacity-0 group-data-[state=\"indeterminate\"]:tw-block group-data-[state=\"indeterminate\"]:tw-opacity-100 tw-transition-opacity'\n data-test-id=\"icon-indeterminate\"\n />\n\n <IconCheckMark\n size={16}\n className='tw-hidden tw-opacity-0 group-data-[state=\"checked\"]:tw-block group-data-[state=\"checked\"]:tw-opacity-100 tw-transition-opacity'\n data-test-id=\"icon-checked\"\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n};\n\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(CheckboxComponent);\nCheckbox.displayName = 'Checkbox';\n"],"names":["CheckboxComponent","className","value","onChange","defaultValue","dataTestId","props","ref","jsx","CheckboxPrimitive","cn","checkboxStyles","jsxs","checkboxIndicatorStyles","IconMinus","IconCheckMark","Checkbox","forwardRef"],"mappings":";;;;;;AAoEO,MAAMA,IAAoB,CAC7B;AAAA,EACI,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MAGI,gBAAAC;AAAA,EAACC,EAAkB;AAAA,EAAlB;AAAA,IACG,KAAAF;AAAA,IACA,SAASL;AAAA,IACT,gBAAgBE;AAAA,IAChB,WAAWM,EAAGC,EAAeL,CAAK,GAAGL,CAAS;AAAA,IAC9C,SAASE;AAAA,IACT,gBAAcE;AAAA,IACb,GAAGC;AAAA,IAEJ,UAAC,gBAAAM,EAAAH,EAAkB,WAAlB,EAA4B,WAAWI,GACpC,UAAA;AAAA,MAAA,gBAAAL;AAAA,QAACM;AAAA,QAAA;AAAA,UACG,MAAM;AAAA,UACN,WAAU;AAAA,UACV,gBAAa;AAAA,QAAA;AAAA,MACjB;AAAA,MAEA,gBAAAN;AAAA,QAACO;AAAA,QAAA;AAAA,UACG,MAAM;AAAA,UACN,WAAU;AAAA,UACV,gBAAa;AAAA,QAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components5.js","sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark, IconMinus } from '@frontify/fondue-icons';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { forwardRef, type FormEvent, type ForwardedRef } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { checkboxIndicatorStyles, checkboxStyles } from './styles/checkboxStyles';\n\nexport type CheckboxProps = {\n id?: string;\n name?: string;\n /**\n * The default value of the checkbox\n * Used for uncontrolled components\n * @default false\n */\n defaultValue?: boolean | 'indeterminate';\n /**\n * The controlled value of the checkbox\n * @default false\n */\n value?: boolean | 'indeterminate';\n /**\n * The size of the checkbox\n * @default \"default\"\n */\n size?: 'default' | 'large';\n /**\n * The emphasis of the checkbox\n * @default \"default\"\n */\n emphasis?: 'default' | 'weak';\n /**\n * Disable the checkbox\n * @default false\n */\n disabled?: boolean;\n /**\n * Make the checkbox required in form\n * @default false\n */\n required?: boolean;\n /**\n * Make the checkbox read-only\n * @default false\n */\n readOnly?: boolean;\n className?: string;\n /**\n * Event handler called when the checkbox value changes\n */\n onChange?: (event: FormEvent<HTMLButtonElement>) => void;\n /**\n * Event handler called when the checkbox is blurred\n */\n onBlur?: (event: FormEvent<HTMLButtonElement>) => void;\n /**\n * Event handler called when the checkbox is focused\n */\n onFocus?: (event: FormEvent<HTMLButtonElement>) => void;\n 'data-test-id'?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n};\n\nexport const CheckboxComponent = (\n {\n className,\n value,\n onChange,\n defaultValue,\n 'data-test-id': dataTestId = 'fondue-checkbox',\n ...props\n }: CheckboxProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={value}\n defaultChecked={defaultValue}\n className={cn(checkboxStyles(props), className)}\n onClick={onChange}\n data-test-id={dataTestId}\n {...props}\n >\n <CheckboxPrimitive.Indicator className={checkboxIndicatorStyles}>\n <IconMinus\n size={16}\n className='tw-hidden tw-opacity-0 group-data-[state=\"indeterminate\"]:tw-block group-data-[state=\"indeterminate\"]:tw-opacity-100 tw-transition-opacity'\n data-test-id=\"icon-indeterminate\"\n />\n\n <IconCheckMark\n size={16}\n className='tw-hidden tw-opacity-0 group-data-[state=\"checked\"]:tw-block group-data-[state=\"checked\"]:tw-opacity-100 tw-transition-opacity'\n data-test-id=\"icon-checked\"\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n};\n\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(CheckboxComponent);\nCheckbox.displayName = 'Checkbox';\n"],"names":["CheckboxComponent","className","value","onChange","defaultValue","dataTestId","props","ref","jsx","CheckboxPrimitive","cn","checkboxStyles","jsxs","checkboxIndicatorStyles","IconMinus","IconCheckMark","Checkbox","forwardRef"],"mappings":";;;;;;AAoEO,MAAMA,IAAoB,CAC7B;AAAA,EACI,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MAGI,gBAAAC;AAAA,EAACC,EAAkB;AAAA,EAAlB;AAAA,IACG,KAAAF;AAAA,IACA,SAASL;AAAA,IACT,gBAAgBE;AAAA,IAChB,WAAWM,EAAGC,EAAeL,CAAK,GAAGL,CAAS;AAAA,IAC9C,SAASE;AAAA,IACT,gBAAcE;AAAA,IACb,GAAGC;AAAA,IAEJ,UAAC,gBAAAM,EAAAH,EAAkB,WAAlB,EAA4B,WAAWI,GACpC,UAAA;AAAA,MAAA,gBAAAL;AAAA,QAACM;AAAA,QAAA;AAAA,UACG,MAAM;AAAA,UACN,WAAU;AAAA,UACV,gBAAa;AAAA,QAAA;AAAA,MACjB;AAAA,MAEA,gBAAAN;AAAA,QAACO;AAAA,QAAA;AAAA,UACG,MAAM;AAAA,UACN,WAAU;AAAA,UACV,gBAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IACjB,EACJ,CAAA;AAAA,EAAA;AACJ,GAIKC,IAAWC,EAA6CjB,CAAiB;AACtFgB,EAAS,cAAc;"}
|
|
@@ -1,75 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
filterText: c,
|
|
14
|
-
align: d,
|
|
15
|
-
selectedItem: r,
|
|
16
|
-
hasInteractedSinceOpening: v
|
|
17
|
-
}) => {
|
|
18
|
-
const s = S(null), { setMaxHeight: h } = M(s), g = (e) => {
|
|
19
|
-
e.preventDefault(), h();
|
|
20
|
-
};
|
|
21
|
-
return /* @__PURE__ */ t(l.Portal, { children: /* @__PURE__ */ t(
|
|
22
|
-
l.Content,
|
|
23
|
-
{
|
|
24
|
-
align: d,
|
|
25
|
-
collisionPadding: 16,
|
|
26
|
-
onOpenAutoFocus: g,
|
|
27
|
-
className: n.portal,
|
|
28
|
-
children: /* @__PURE__ */ t(
|
|
29
|
-
"ul",
|
|
30
|
-
{
|
|
31
|
-
className: n.menu,
|
|
32
|
-
...u(),
|
|
33
|
-
ref: s,
|
|
34
|
-
"data-has-interacted": v ? "true" : "false",
|
|
35
|
-
"data-test-id": "fondue-select-menu",
|
|
36
|
-
children: N(
|
|
37
|
-
f,
|
|
38
|
-
(e, i) => {
|
|
39
|
-
if (((o) => (
|
|
40
|
-
// @ts-expect-error - We are explicitly checking for ref
|
|
41
|
-
C(o) && o.ref !== void 0
|
|
42
|
-
))(e)) {
|
|
43
|
-
const o = V(e.props), a = m({
|
|
44
|
-
item: o,
|
|
45
|
-
index: i,
|
|
46
|
-
...e.ref ? { ref: e.ref } : {}
|
|
47
|
-
});
|
|
48
|
-
return /* @__PURE__ */ t(
|
|
49
|
-
P,
|
|
50
|
-
{
|
|
51
|
-
className: n.item,
|
|
52
|
-
"data-highlighted": p === i,
|
|
53
|
-
"data-selected": (r == null ? void 0 : r.value) === o.value,
|
|
54
|
-
onTouchStart: (O) => {
|
|
55
|
-
a.onClick && a.onClick(O);
|
|
56
|
-
},
|
|
57
|
-
...a,
|
|
58
|
-
children: e
|
|
59
|
-
},
|
|
60
|
-
e.props.value
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
c
|
|
65
|
-
).parsedChildren
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
) });
|
|
70
|
-
};
|
|
71
|
-
x.displayName = "Select.Menu";
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheckMark as l } from "@frontify/fondue-icons";
|
|
3
|
+
import { forwardRef as c } from "react";
|
|
4
|
+
import o from "./fondue-components53.js";
|
|
5
|
+
const d = ({ "data-test-id": t = "fondue-select-item", ...e }, r) => /* @__PURE__ */ i("li", { "data-test-id": t, ref: r, ...e, children: [
|
|
6
|
+
/* @__PURE__ */ a("div", { className: o.itemValue, children: e.children }),
|
|
7
|
+
/* @__PURE__ */ a(l, { className: o.checkmarkIcon })
|
|
8
|
+
] });
|
|
9
|
+
d.displayName = "Select.Item";
|
|
10
|
+
const I = c(d), m = ({ children: t, groupId: e, "data-test-id": r = "fondue-select-item-group" }, s) => /* @__PURE__ */ a("div", { "data-test-id": r, className: o.group, ref: s, children: t }, e);
|
|
11
|
+
m.displayName = "Select.Group";
|
|
12
|
+
const S = c(m);
|
|
72
13
|
export {
|
|
73
|
-
|
|
14
|
+
I as ForwardedRefSelectItem,
|
|
15
|
+
S as ForwardedRefSelectItemGroup,
|
|
16
|
+
d as SelectItem,
|
|
17
|
+
m as SelectItemGroup
|
|
74
18
|
};
|
|
75
19
|
//# sourceMappingURL=fondue-components50.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components50.js","sources":["../src/components/Select/
|
|
1
|
+
{"version":3,"file":"fondue-components50.js","sources":["../src/components/Select/SelectItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark } from '@frontify/fondue-icons';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectItemProps = {\n /**\n * The value of the select item.\n */\n value: string;\n /**\n * The data test id of the select item.\n */\n 'data-test-id'?: string;\n} & (\n | {\n /**\n * The label of the select item. Required when the child is not a string.\n */\n label: string;\n /**\n * The children of the select item. This can be a custom component or a string.\n */\n children?: ReactNode;\n }\n | {\n label?: string;\n children: string;\n }\n);\n\nexport const SelectItem = (\n { 'data-test-id': dataTestId = 'fondue-select-item', ...props }: SelectItemProps,\n forwardedRef?: ForwardedRef<HTMLLIElement>,\n) => {\n return (\n <li data-test-id={dataTestId} ref={forwardedRef} {...props}>\n <div className={styles.itemValue}>{props.children}</div>\n <IconCheckMark className={styles.checkmarkIcon} />\n </li>\n );\n};\nSelectItem.displayName = 'Select.Item';\n\nexport const ForwardedRefSelectItem = forwardRef<HTMLLIElement, SelectItemProps>(SelectItem);\n\nexport type SelectItemGroupProps = {\n /**\n * The children of the select item group. This can contain multiple `Select.Item` components.\n */\n children: ReactNode;\n /**\n * The internal group ID of the select item group.\n */\n groupId: string;\n /**\n * The data test id of the select item group.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectItemGroup = (\n { children, groupId, 'data-test-id': dataTestId = 'fondue-select-item-group' }: SelectItemGroupProps,\n forwardedRef?: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} className={styles.group} ref={forwardedRef} key={groupId}>\n {children}\n </div>\n );\n};\nSelectItemGroup.displayName = 'Select.Group';\n\nexport const ForwardedRefSelectItemGroup = forwardRef<HTMLDivElement, SelectItemGroupProps>(SelectItemGroup);\n"],"names":["SelectItem","dataTestId","props","forwardedRef","jsx","styles","IconCheckMark","ForwardedRefSelectItem","forwardRef","SelectItemGroup","children","groupId","ForwardedRefSelectItemGroup"],"mappings":";;;;AAiCa,MAAAA,IAAa,CACtB,EAAE,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GAC9DC,wBAGK,MAAG,EAAA,gBAAcF,GAAY,KAAKE,GAAe,GAAGD,GACjD,UAAA;AAAA,EAAA,gBAAAE,EAAC,OAAI,EAAA,WAAWC,EAAO,WAAY,YAAM,UAAS;AAAA,EACjD,gBAAAD,EAAAE,GAAA,EAAc,WAAWD,EAAO,cAAe,CAAA;AAAA,GACpD;AAGRL,EAAW,cAAc;AAEZ,MAAAO,IAAyBC,EAA2CR,CAAU,GAiB9ES,IAAkB,CAC3B,EAAE,UAAAC,GAAU,SAAAC,GAAS,gBAAgBV,IAAa,2BAA2B,GAC7EE,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcH,GAAY,WAAWI,EAAO,OAAO,KAAKF,GACxD,UAAAO,EAAA,GAD2EC,CAEhF;AAGRF,EAAgB,cAAc;AAEjB,MAAAG,IAA8BJ,EAAiDC,CAAe;"}
|
|
@@ -1,11 +1,75 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "@radix-ui/react-popover";
|
|
3
|
+
import { Slot as P } from "@radix-ui/react-slot";
|
|
4
|
+
import { useRef as S, isValidElement as C } from "react";
|
|
5
|
+
import { usePreventDropdownOverflow as M } from "./fondue-components39.js";
|
|
6
|
+
import n from "./fondue-components53.js";
|
|
7
|
+
import { recursiveMap as N, getSelectOptionValue as V } from "./fondue-components63.js";
|
|
8
|
+
const x = ({
|
|
9
|
+
highlightedIndex: p,
|
|
10
|
+
getMenuProps: u,
|
|
11
|
+
getItemProps: m,
|
|
12
|
+
children: f,
|
|
13
|
+
filterText: c,
|
|
14
|
+
align: d,
|
|
15
|
+
selectedItem: r,
|
|
16
|
+
hasInteractedSinceOpening: v
|
|
17
|
+
}) => {
|
|
18
|
+
const s = S(null), { setMaxHeight: h } = M(s), g = (e) => {
|
|
19
|
+
e.preventDefault(), h();
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ t(l.Portal, { children: /* @__PURE__ */ t(
|
|
22
|
+
l.Content,
|
|
23
|
+
{
|
|
24
|
+
align: d,
|
|
25
|
+
collisionPadding: 16,
|
|
26
|
+
onOpenAutoFocus: g,
|
|
27
|
+
className: n.portal,
|
|
28
|
+
children: /* @__PURE__ */ t(
|
|
29
|
+
"ul",
|
|
30
|
+
{
|
|
31
|
+
className: n.menu,
|
|
32
|
+
...u(),
|
|
33
|
+
ref: s,
|
|
34
|
+
"data-has-interacted": v ? "true" : "false",
|
|
35
|
+
"data-test-id": "fondue-select-menu",
|
|
36
|
+
children: N(
|
|
37
|
+
f,
|
|
38
|
+
(e, i) => {
|
|
39
|
+
if (((o) => (
|
|
40
|
+
// @ts-expect-error - We are explicitly checking for ref
|
|
41
|
+
C(o) && o.ref !== void 0
|
|
42
|
+
))(e)) {
|
|
43
|
+
const o = V(e.props), a = m({
|
|
44
|
+
item: o,
|
|
45
|
+
index: i,
|
|
46
|
+
...e.ref ? { ref: e.ref } : {}
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ t(
|
|
49
|
+
P,
|
|
50
|
+
{
|
|
51
|
+
className: n.item,
|
|
52
|
+
"data-highlighted": p === i,
|
|
53
|
+
"data-selected": (r == null ? void 0 : r.value) === o.value,
|
|
54
|
+
onTouchStart: (O) => {
|
|
55
|
+
a.onClick && a.onClick(O);
|
|
56
|
+
},
|
|
57
|
+
...a,
|
|
58
|
+
children: e
|
|
59
|
+
},
|
|
60
|
+
e.props.value
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
c
|
|
65
|
+
).parsedChildren
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
) });
|
|
70
|
+
};
|
|
71
|
+
x.displayName = "Select.Menu";
|
|
7
72
|
export {
|
|
8
|
-
|
|
9
|
-
t as SelectSlot
|
|
73
|
+
x as SelectMenu
|
|
10
74
|
};
|
|
11
75
|
//# sourceMappingURL=fondue-components51.js.map
|