@frontify/fondue-components 25.0.0 → 26.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.
Files changed (59) hide show
  1. package/dist/fondue-components100.js +9 -0
  2. package/dist/fondue-components100.js.map +1 -0
  3. package/dist/fondue-components101.js +15 -0
  4. package/dist/fondue-components101.js.map +1 -0
  5. package/dist/fondue-components102.js +74 -0
  6. package/dist/fondue-components102.js.map +1 -0
  7. package/dist/fondue-components103.js +18 -0
  8. package/dist/fondue-components103.js.map +1 -0
  9. package/dist/fondue-components104.js +10 -0
  10. package/dist/fondue-components104.js.map +1 -0
  11. package/dist/fondue-components105.js +92 -0
  12. package/dist/fondue-components105.js.map +1 -0
  13. package/dist/fondue-components106.js +84 -0
  14. package/dist/fondue-components106.js.map +1 -0
  15. package/dist/fondue-components107.js +34 -0
  16. package/dist/fondue-components107.js.map +1 -0
  17. package/dist/fondue-components108.js +24 -0
  18. package/dist/fondue-components108.js.map +1 -0
  19. package/dist/fondue-components109.js +43 -0
  20. package/dist/fondue-components109.js.map +1 -0
  21. package/dist/fondue-components26.js +23 -143
  22. package/dist/fondue-components26.js.map +1 -1
  23. package/dist/fondue-components4.js.map +1 -1
  24. package/dist/fondue-components40.js +2 -2
  25. package/dist/fondue-components47.js +1 -1
  26. package/dist/fondue-components48.js.map +1 -1
  27. package/dist/fondue-components71.js +20 -154
  28. package/dist/fondue-components71.js.map +1 -1
  29. package/dist/fondue-components72.js +20 -19
  30. package/dist/fondue-components72.js.map +1 -1
  31. package/dist/fondue-components73.js +18 -79
  32. package/dist/fondue-components73.js.map +1 -1
  33. package/dist/fondue-components74.js +20 -8
  34. package/dist/fondue-components74.js.map +1 -1
  35. package/dist/fondue-components75.js +19 -37
  36. package/dist/fondue-components75.js.map +1 -1
  37. package/dist/fondue-components76.js +8 -71
  38. package/dist/fondue-components76.js.map +1 -1
  39. package/dist/fondue-components90.js +5 -0
  40. package/dist/fondue-components90.js.map +1 -1
  41. package/dist/fondue-components92.js +3 -15
  42. package/dist/fondue-components92.js.map +1 -1
  43. package/dist/fondue-components93.js +4 -4
  44. package/dist/fondue-components93.js.map +1 -1
  45. package/dist/fondue-components94.js +16 -4
  46. package/dist/fondue-components94.js.map +1 -1
  47. package/dist/fondue-components95.js +209 -38
  48. package/dist/fondue-components95.js.map +1 -1
  49. package/dist/fondue-components96.js +17 -19
  50. package/dist/fondue-components96.js.map +1 -1
  51. package/dist/fondue-components97.js +23 -0
  52. package/dist/fondue-components97.js.map +1 -0
  53. package/dist/fondue-components98.js +154 -0
  54. package/dist/fondue-components98.js.map +1 -0
  55. package/dist/fondue-components99.js +48 -0
  56. package/dist/fondue-components99.js.map +1 -0
  57. package/dist/index.d.ts +122 -136
  58. package/dist/style.css +1 -1
  59. package/package.json +5 -5
@@ -0,0 +1,9 @@
1
+ import { useMemo as t } from "react";
2
+ const m = (n, s) => t(() => n.map((r) => {
3
+ const o = s(r), p = (o == null ? void 0 : o.label) ?? r;
4
+ return { value: r, displayValue: p };
5
+ }), [n, s]);
6
+ export {
7
+ m as useBadgeItems
8
+ };
9
+ //# sourceMappingURL=fondue-components100.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components100.js","sources":["../src/components/Select/hooks/useBadgeItems.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useMemo } from 'react';\n\ntype SelectItemLike = {\n value: string;\n label: string;\n};\n\ntype BadgeItem = {\n value: string;\n displayValue: string;\n};\n\nexport const useBadgeItems = (\n selectedItemValues: string[],\n getItemByValue: (value?: string) => SelectItemLike | undefined,\n): BadgeItem[] => {\n return useMemo(() => {\n return selectedItemValues.map((value) => {\n const item = getItemByValue(value);\n const displayValue = item?.label ?? value;\n return { value, displayValue };\n });\n }, [selectedItemValues, getItemByValue]);\n};\n"],"names":["useBadgeItems","selectedItemValues","getItemByValue","useMemo","value","item","displayValue"],"mappings":";AAcO,MAAMA,IAAgB,CACzBC,GACAC,MAEOC,EAAQ,MACJF,EAAmB,IAAI,CAACG,MAAU;AACrC,QAAMC,IAAOH,EAAeE,CAAK,GAC3BE,KAAeD,KAAA,gBAAAA,EAAM,UAASD;AACpC,SAAO,EAAE,OAAAA,GAAO,cAAAE,EAAA;AACpB,CAAC,GACF,CAACL,GAAoBC,CAAc,CAAC;"}
@@ -0,0 +1,15 @@
1
+ import { useRef as u, useCallback as t } from "react";
2
+ const c = () => {
3
+ const s = u(!1), o = t((e) => {
4
+ s.current = !0, e.currentTarget.dataset.showFocusRing = "false";
5
+ }, []), r = t((e) => {
6
+ s.current || (e.target.dataset.showFocusRing = "true");
7
+ }, []), n = t((e) => {
8
+ e.target.dataset.showFocusRing = "false", s.current = !1;
9
+ }, []);
10
+ return { wasClickedRef: s, onMouseDown: o, onFocus: r, onBlur: n };
11
+ };
12
+ export {
13
+ c as useFocusRing
14
+ };
15
+ //# sourceMappingURL=fondue-components101.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components101.js","sources":["../src/components/Select/hooks/useFocusRing.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback, useRef, type FocusEvent, type MouseEvent, type MutableRefObject } from 'react';\n\ntype FocusRingHandlers = {\n /** Ref tracking whether the element was activated via mouse click. */\n wasClickedRef: MutableRefObject<boolean>;\n /** Handler for mousedown events — marks the interaction as click-based. */\n onMouseDown: (event: MouseEvent<HTMLElement>) => void;\n /** Handler for focus events — shows the focus ring only for keyboard navigation. */\n onFocus: (event: FocusEvent<HTMLElement>) => void;\n /** Handler for blur events — hides the focus ring and resets click tracking. */\n onBlur: (event: FocusEvent<HTMLElement>) => void;\n};\n\nexport const useFocusRing = (): FocusRingHandlers => {\n const wasClickedRef = useRef(false);\n\n const onMouseDown = useCallback((event: MouseEvent<HTMLElement>): void => {\n wasClickedRef.current = true;\n event.currentTarget.dataset.showFocusRing = 'false';\n }, []);\n\n const onFocus = useCallback((event: FocusEvent<HTMLElement>): void => {\n if (!wasClickedRef.current) {\n event.target.dataset.showFocusRing = 'true';\n }\n }, []);\n\n const onBlur = useCallback((event: FocusEvent<HTMLElement>): void => {\n event.target.dataset.showFocusRing = 'false';\n wasClickedRef.current = false;\n }, []);\n\n return { wasClickedRef, onMouseDown, onFocus, onBlur };\n};\n"],"names":["useFocusRing","wasClickedRef","useRef","onMouseDown","useCallback","event","onFocus","onBlur"],"mappings":";AAeO,MAAMA,IAAe,MAAyB;AACjD,QAAMC,IAAgBC,EAAO,EAAK,GAE5BC,IAAcC,EAAY,CAACC,MAAyC;AACtE,IAAAJ,EAAc,UAAU,IACxBI,EAAM,cAAc,QAAQ,gBAAgB;AAAA,EAChD,GAAG,CAAA,CAAE,GAECC,IAAUF,EAAY,CAACC,MAAyC;AAClE,IAAKJ,EAAc,YACfI,EAAM,OAAO,QAAQ,gBAAgB;AAAA,EAE7C,GAAG,CAAA,CAAE,GAECE,IAASH,EAAY,CAACC,MAAyC;AACjE,IAAAA,EAAM,OAAO,QAAQ,gBAAgB,SACrCJ,EAAc,UAAU;AAAA,EAC5B,GAAG,CAAA,CAAE;AAEL,SAAO,EAAE,eAAAA,GAAe,aAAAE,GAAa,SAAAG,GAAS,QAAAC,EAAA;AAClD;"}
@@ -0,0 +1,74 @@
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import { useState as S, useMemo as b, Children as V, isValidElement as C, cloneElement as w, useCallback as B, useEffect as x } from "react";
3
+ import { SelectClear as F } from "./fondue-components108.js";
4
+ import { ForwardedRefSelectItem as L } from "./fondue-components75.js";
5
+ import { ForwardedRefSelectSlot as y } from "./fondue-components76.js";
6
+ import { getSelectOptionValue as I } from "./fondue-components109.js";
7
+ const d = (n, s) => {
8
+ const [e, r] = S(!1), [m, i] = S(null), [l, f] = S({
9
+ menuComponents: [],
10
+ items: []
11
+ });
12
+ return x(() => {
13
+ i(null), s || f({
14
+ menuComponents: [],
15
+ items: []
16
+ }), s && (r(!0), s(n).then((u) => {
17
+ f({
18
+ menuComponents: u.map((o) => /* @__PURE__ */ E(L, { label: o.label, value: o.value, children: o.content ? o.content : o.label }, o.value)),
19
+ items: u.map((o) => ({ value: o.value, label: o.label, children: o.content }))
20
+ }), r(!1);
21
+ }).catch((u) => {
22
+ i(u), r(!1);
23
+ }));
24
+ }, [n, s]), { isLoading: e, error: m, menuComponents: l.menuComponents, items: l.items };
25
+ }, g = (n) => {
26
+ const s = [];
27
+ return V.forEach(n, (e) => {
28
+ if (C(e) && e.type === L)
29
+ s.push(I(e.props));
30
+ else if (C(e) && e.props.children) {
31
+ const r = g(e.props.children);
32
+ for (const m of r)
33
+ s.push(m);
34
+ }
35
+ }), s;
36
+ }, q = (n, s) => {
37
+ const [e, r] = S(""), { inputSlots: m, menuSlots: i, itemValues: l, clearButton: f } = b(() => {
38
+ const a = [], p = [];
39
+ let v;
40
+ V.toArray(n).some(
41
+ (t) => C(t) && t.type === y
42
+ ) ? V.forEach(n, (t) => {
43
+ C(t) && t.type === y && (t.props.name === "menu" ? p.push(t.props.children) : t.props.name === "left" || t.props.name === "right" ? a.push(t) : t.props.name === "clear" && (t.props.children ? v = t : v = w(t, { children: /* @__PURE__ */ E(F, {}) })));
44
+ }) : p.push(n);
45
+ const R = g(p);
46
+ return { inputSlots: a, menuSlots: p, itemValues: R, clearButton: v };
47
+ }, [n]), u = b(
48
+ () => l.filter(
49
+ (a) => e === "" || a.label.toLowerCase().includes(e.toLowerCase())
50
+ ),
51
+ [l, e]
52
+ ), o = B(
53
+ (a) => a !== void 0 ? l.find((p) => p.value === a) : void 0,
54
+ [l]
55
+ ), c = d(e, s);
56
+ return {
57
+ items: [...u, ...c.items],
58
+ menuSlots: [...i, ...c.menuComponents],
59
+ filterText: e,
60
+ inputSlots: m,
61
+ clearButton: f,
62
+ setFilterText: r,
63
+ getItemByValue: o,
64
+ asyncItemStatus: {
65
+ isLoading: c.isLoading,
66
+ error: c.error
67
+ }
68
+ };
69
+ };
70
+ export {
71
+ g as getRecursiveOptionValues,
72
+ q as useSelectData
73
+ };
74
+ //# sourceMappingURL=fondue-components102.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components102.js","sources":["../src/components/Select/hooks/useSelectData.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\n\nimport { SelectClear } from '../components/SelectClear';\nimport { ForwardedRefSelectItem, type SelectItemProps } from '../components/SelectItem';\nimport { ForwardedRefSelectSlot, type SelectSlotProps } from '../components/SelectSlot';\nimport { getSelectOptionValue } from '../utils';\n\nexport type SelectItemType = {\n value: string;\n label: string;\n};\n\nexport type AsyncItem = { label: string; value: string; content?: ReactNode };\n\nexport type AsyncItemsFetcher = (filterText: string) => Promise<AsyncItem[]>;\n\nconst useAsyncItems = (filterText: string, getAsyncItems?: AsyncItemsFetcher) => {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [asyncResult, setAsyncResult] = useState<{\n menuComponents: ReactNode[];\n items: { value: string; label: string; children?: ReactNode }[];\n }>({\n menuComponents: [],\n items: [],\n });\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setError(null);\n if (!getAsyncItems) {\n setAsyncResult({\n menuComponents: [],\n items: [],\n });\n }\n\n if (getAsyncItems) {\n setIsLoading(true);\n getAsyncItems(filterText)\n .then((items) => {\n setAsyncResult({\n menuComponents: items.map((item) => (\n <ForwardedRefSelectItem key={item.value} label={item.label} value={item.value}>\n {item.content ? item.content : item.label}\n </ForwardedRefSelectItem>\n )),\n items: items.map((item) => ({ value: item.value, label: item.label, children: item.content })),\n });\n setIsLoading(false);\n })\n .catch((error: Error) => {\n setError(error);\n setIsLoading(false);\n });\n }\n }, [filterText, getAsyncItems]);\n\n return { isLoading, error, menuComponents: asyncResult.menuComponents, items: asyncResult.items };\n};\n\n/**\n * Recursively extracts option values from children.\n * This function traverses through the React component tree and collects all SelectItem values.\n *\n * @param {ReactNode} children - The React children to extract values from.\n * @returns {SelectItemType[]} An array of SelectItemType objects.\n *\n * @example\n * const options = (\n * <SelectItem value=\"1\">Option 1</SelectItem>\n * <SelectItem value=\"2\">Option 2</SelectItem>\n * );\n * const values = getRecursiveOptionValues(options);\n * // Returns: [{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }]\n */\nexport const getRecursiveOptionValues = (\n children: ReactNode,\n): { value: string; label: string; children?: ReactNode }[] => {\n const values: { value: string; label: string }[] = [];\n Children.forEach(children, (child) => {\n if (isValidElement<SelectItemProps>(child) && child.type === ForwardedRefSelectItem) {\n values.push(getSelectOptionValue(child.props));\n } else if (isValidElement<{ children: ReactNode }>(child) && child.props.children) {\n const optionValues = getRecursiveOptionValues(child.props.children);\n for (const optionValue of optionValues) {\n values.push(optionValue);\n }\n }\n });\n return values;\n};\n\n/**\n * Custom hook for managing select data and filtering.\n *\n * @param {ReactNode} children - The React children to process, typically SelectItem components.\n * @param {AsyncItemsFetcher} [getAsyncItems] - Optional function to fetch items asynchronously based on filter text.\n * @returns {Object} An object containing the processed data.\n */\nexport const useSelectData = (children: ReactNode, getAsyncItems?: AsyncItemsFetcher) => {\n const [filterText, setFilterText] = useState('');\n // eslint-disable-next-line react-hooks/preserve-manual-memoization\n const { inputSlots, menuSlots, itemValues, clearButton } = useMemo(() => {\n const inputSlots: ReactNode[] = [];\n const menuSlots: ReactNode[] = [];\n let clearButton: ReactNode;\n\n const hasSlots = Children.toArray(children).some(\n (child) => isValidElement<SelectSlotProps>(child) && child.type === ForwardedRefSelectSlot,\n );\n\n if (hasSlots) {\n Children.forEach(children, (child) => {\n if (isValidElement<SelectSlotProps>(child) && child.type === ForwardedRefSelectSlot) {\n if (child.props.name === 'menu') {\n menuSlots.push(child.props.children);\n } else if (child.props.name === 'left' || child.props.name === 'right') {\n inputSlots.push(child);\n } else if (child.props.name === 'clear') {\n if (child.props.children) {\n clearButton = child;\n } else {\n clearButton = cloneElement(child, { children: <SelectClear /> });\n }\n }\n }\n });\n } else {\n menuSlots.push(children);\n }\n\n const itemValues = getRecursiveOptionValues(menuSlots);\n\n return { inputSlots, menuSlots, itemValues, clearButton };\n }, [children]);\n\n const items = useMemo(\n () =>\n itemValues.filter(\n (item) => filterText === '' || item.label.toLowerCase().includes(filterText.toLowerCase()),\n ),\n [itemValues, filterText],\n );\n\n const getItemByValue = useCallback(\n (value?: string | null) => (value !== undefined ? itemValues.find((item) => item.value === value) : undefined),\n [itemValues],\n );\n\n const asyncItems = useAsyncItems(filterText, getAsyncItems);\n\n return {\n items: [...items, ...asyncItems.items],\n menuSlots: [...menuSlots, ...asyncItems.menuComponents],\n filterText,\n inputSlots,\n clearButton,\n setFilterText,\n getItemByValue,\n asyncItemStatus: {\n isLoading: asyncItems.isLoading,\n error: asyncItems.error,\n },\n };\n};\n"],"names":["useAsyncItems","filterText","getAsyncItems","isLoading","setIsLoading","useState","error","setError","asyncResult","setAsyncResult","useEffect","items","item","jsx","ForwardedRefSelectItem","getRecursiveOptionValues","children","values","Children","child","isValidElement","getSelectOptionValue","optionValues","optionValue","useSelectData","setFilterText","inputSlots","menuSlots","itemValues","clearButton","useMemo","ForwardedRefSelectSlot","cloneElement","SelectClear","getItemByValue","useCallback","value","asyncItems"],"mappings":";;;;;;AA2BA,MAAMA,IAAgB,CAACC,GAAoBC,MAAsC;AAC7E,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAOC,CAAQ,IAAIF,EAAuB,IAAI,GAC/C,CAACG,GAAaC,CAAc,IAAIJ,EAGnC;AAAA,IACC,gBAAgB,CAAA;AAAA,IAChB,OAAO,CAAA;AAAA,EAAC,CACX;AAED,SAAAK,EAAU,MAAM;AAEZ,IAAAH,EAAS,IAAI,GACRL,KACDO,EAAe;AAAA,MACX,gBAAgB,CAAA;AAAA,MAChB,OAAO,CAAA;AAAA,IAAC,CACX,GAGDP,MACAE,EAAa,EAAI,GACj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G;AAAA,IACA,eAAAJ;AAAA,IACA,gBAAAS;AAAA,IACA,iBAAiB;AAAA,MACb,WAAWG,EAAW;AAAA,MACtB,OAAOA,EAAW;AAAA,IAAA;AAAA,EACtB;AAER;"}
@@ -0,0 +1,18 @@
1
+ import { useId as u, useMemo as f } from "react";
2
+ import { useTranslation as D } from "./fondue-components39.js";
3
+ const g = (t, n, r) => {
4
+ const { t: i } = D(), s = u(), e = f(() => {
5
+ if (!t || n.length === 0)
6
+ return "";
7
+ const p = n.map((c) => {
8
+ const o = r(c);
9
+ return (o == null ? void 0 : o.label) ?? c;
10
+ }).join(", ");
11
+ return i("Select_selectedCount", { count: n.length.toString(), items: p });
12
+ }, [t, n, r, i]);
13
+ return { selectionDescriptionId: s, selectionDescription: e };
14
+ };
15
+ export {
16
+ g as useSelectionDescription
17
+ };
18
+ //# sourceMappingURL=fondue-components103.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components103.js","sources":["../src/components/Select/hooks/useSelectionDescription.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useId, useMemo } from 'react';\n\nimport { useTranslation } from '#/hooks/useTranslation';\n\ntype SelectItemLike = {\n value: string;\n label: string;\n};\n\ntype SelectionDescription = {\n /** The unique ID for the SR description element. */\n selectionDescriptionId: string;\n /** The description text for screen readers (empty string when not applicable). */\n selectionDescription: string;\n};\n\nexport const useSelectionDescription = (\n isMultiple: boolean,\n selectedItemValues: string[],\n getItemByValue: (value?: string) => SelectItemLike | undefined,\n): SelectionDescription => {\n const { t } = useTranslation();\n const selectionDescriptionId = useId();\n\n const selectionDescription = useMemo((): string => {\n if (!isMultiple || selectedItemValues.length === 0) {\n return '';\n }\n const labels = selectedItemValues\n .map((value) => {\n const item = getItemByValue(value);\n return item?.label ?? value;\n })\n .join(', ');\n return t('Select_selectedCount', { count: selectedItemValues.length.toString(), items: labels });\n }, [isMultiple, selectedItemValues, getItemByValue, t]);\n\n return { selectionDescriptionId, selectionDescription };\n};\n"],"names":["useSelectionDescription","isMultiple","selectedItemValues","getItemByValue","t","useTranslation","selectionDescriptionId","useId","selectionDescription","useMemo","labels","value","item"],"mappings":";;AAkBO,MAAMA,IAA0B,CACnCC,GACAC,GACAC,MACuB;AACvB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAyBC,EAAA,GAEzBC,IAAuBC,EAAQ,MAAc;AAC/C,QAAI,CAACR,KAAcC,EAAmB,WAAW;AAC7C,aAAO;AAEX,UAAMQ,IAASR,EACV,IAAI,CAACS,MAAU;AACZ,YAAMC,IAAOT,EAAeQ,CAAK;AACjC,cAAOC,KAAA,gBAAAA,EAAM,UAASD;AAAA,IAC1B,CAAC,EACA,KAAK,IAAI;AACd,WAAOP,EAAE,wBAAwB,EAAE,OAAOF,EAAmB,OAAO,SAAA,GAAY,OAAOQ,GAAQ;AAAA,EACnG,GAAG,CAACT,GAAYC,GAAoBC,GAAgBC,CAAC,CAAC;AAEtD,SAAO,EAAE,wBAAAE,GAAwB,sBAAAE,EAAA;AACrC;"}
@@ -0,0 +1,10 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Slot as e } from "@radix-ui/react-slot";
3
+ import a from "./fondue-components99.js";
4
+ const m = ({ children: o, onClear: t }) => /* @__PURE__ */ r(e, { onClick: (l) => {
5
+ l.stopPropagation(), t();
6
+ }, className: a.clear, role: "button", "aria-label": "Clear selection", children: o });
7
+ export {
8
+ m as ClearButton
9
+ };
10
+ //# sourceMappingURL=fondue-components104.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components104.js","sources":["../src/components/Select/components/ClearButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type MouseEvent, type ReactNode } from 'react';\n\nimport styles from '../styles/select.module.scss';\n\ntype ClearButtonProps = {\n /** The clear button element to render inside the slot. */\n children: ReactNode;\n /** Callback fired when the clear button is clicked. */\n onClear: () => void;\n};\n\nexport const ClearButton = ({ children, onClear }: ClearButtonProps): ReactNode => {\n const handleClick = (event: MouseEvent): void => {\n event.stopPropagation();\n onClear();\n };\n\n return (\n <RadixSlot onClick={handleClick} className={styles.clear} role=\"button\" aria-label=\"Clear selection\">\n {children}\n </RadixSlot>\n );\n};\n"],"names":["ClearButton","children","onClear","jsx","RadixSlot","event","styles"],"mappings":";;;AAcO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,SAAAC,QAOhC,gBAAAC,EAACC,GAAA,EAAU,SANK,CAACC,MAA4B;AAC7C,EAAAA,EAAM,gBAAA,GACNH,EAAA;AACJ,GAGqC,WAAWI,EAAO,OAAO,MAAK,UAAS,cAAW,mBAC9E,UAAAL,EAAA,CACL;"}
@@ -0,0 +1,92 @@
1
+ import { jsxs as S, jsx as f } from "react/jsx-runtime";
2
+ import { useRef as m, useState as C, useEffect as _ } from "react";
3
+ import { Badge as w } from "./fondue-components4.js";
4
+ import { useTranslation as I } from "./fondue-components39.js";
5
+ import p from "./fondue-components99.js";
6
+ const W = 4, D = 40, E = 24, M = (r, h, u, o) => {
7
+ const g = r.offsetWidth;
8
+ let s = o ? E + W : 0, n = 0;
9
+ for (const d of u) {
10
+ const a = h.get(d.value);
11
+ if (!a)
12
+ continue;
13
+ const l = a.offsetWidth, i = n > 0 ? l + W : l, c = u.length - n - 1 > 0 ? D + W : 0;
14
+ if (s + i + c > g)
15
+ break;
16
+ s += i, n++;
17
+ }
18
+ return Math.max(1, n);
19
+ }, x = ({
20
+ items: r,
21
+ placeholder: h,
22
+ onDismiss: u,
23
+ children: o,
24
+ selectedCount: g = 0
25
+ }) => {
26
+ const { t: s } = I(), n = m(!1), d = m(null), a = m(/* @__PURE__ */ new Map()), [l, i] = C(r.length), b = o !== void 0;
27
+ if (_(() => {
28
+ const e = d.current;
29
+ if (!e)
30
+ return;
31
+ const v = () => {
32
+ if (r.length === 0) {
33
+ i(0);
34
+ return;
35
+ }
36
+ i(M(e, a.current, r, b));
37
+ }, t = new ResizeObserver(v);
38
+ return t.observe(e), () => {
39
+ t.disconnect();
40
+ };
41
+ }, [r, b]), r.length === 0 && !o)
42
+ return h;
43
+ const c = r.length - l, y = (e) => e === 1 ? s("Select_singleItemSelected") : e > 1 ? s("Select_multipleItemsSelected", { count: e.toString() }) : "";
44
+ return /* @__PURE__ */ S("div", { ref: d, className: p.badgesContainer, children: [
45
+ /* @__PURE__ */ f("span", { className: p.srOnly, "aria-live": "polite", "aria-atomic": "true", children: y(g) }),
46
+ o,
47
+ r.map((e, v) => /* @__PURE__ */ f(
48
+ "div",
49
+ {
50
+ ref: (t) => {
51
+ t ? a.current.set(e.value, t) : a.current.delete(e.value);
52
+ },
53
+ role: "presentation",
54
+ className: p.badgeWrapper,
55
+ "data-visible": v < l,
56
+ onKeyDown: (t) => {
57
+ (t.key === "Enter" || t.key === " ") && t.stopPropagation();
58
+ },
59
+ onMouseDown: () => {
60
+ n.current = !0;
61
+ },
62
+ children: /* @__PURE__ */ f(
63
+ w,
64
+ {
65
+ emphasis: "weak",
66
+ "aria-label": typeof e.displayValue == "string" ? e.displayValue : e.value,
67
+ onDismiss: (t) => {
68
+ t.stopPropagation(), u(e.value, n.current), n.current = !1;
69
+ },
70
+ children: e.displayValue
71
+ }
72
+ )
73
+ },
74
+ e.value
75
+ )),
76
+ c > 0 && /* @__PURE__ */ f(
77
+ "div",
78
+ {
79
+ className: p.badgeWrapper,
80
+ "aria-label": s("Select_additionalItemsSelected", { count: c.toString() }),
81
+ children: /* @__PURE__ */ S(w, { emphasis: "weak", "aria-hidden": "true", children: [
82
+ "+",
83
+ c
84
+ ] })
85
+ }
86
+ )
87
+ ] });
88
+ };
89
+ export {
90
+ x as CollapsibleBadges
91
+ };
92
+ //# sourceMappingURL=fondue-components105.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components105.js","sources":["../src/components/Select/components/CollapsibleBadges.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useRef, useState, type KeyboardEvent, type ReactNode } from 'react';\n\nimport { Badge } from '#/components/Badge/Badge';\nimport { useTranslation } from '#/hooks/useTranslation';\n\nimport styles from '../styles/select.module.scss';\n\nconst BADGE_GAP = 4;\nconst OVERFLOW_BADGE_MIN_WIDTH = 40;\nconst INPUT_MIN_WIDTH = 24;\n\ntype BadgeItem = {\n value: string;\n displayValue: ReactNode;\n};\n\ntype CollapsibleBadgesProps = {\n items: BadgeItem[];\n placeholder?: string;\n onDismiss: (value: string, preventFocusRing: boolean) => void;\n /** Optional children to render at the end (e.g., an input field). Space is reserved in the layout calculation. */\n children?: ReactNode;\n /** Total number of selected items (for screen reader announcements). */\n selectedCount?: number;\n};\n\nconst calculateVisibleCount = (\n container: HTMLDivElement,\n badgeElements: Map<string, HTMLDivElement>,\n items: BadgeItem[],\n hasInputSlot: boolean,\n): number => {\n const containerWidth = container.offsetWidth;\n let usedWidth = hasInputSlot ? INPUT_MIN_WIDTH + BADGE_GAP : 0;\n let count = 0;\n\n for (const item of items) {\n const badgeElement = badgeElements.get(item.value);\n if (!badgeElement) {\n continue;\n }\n\n const badgeWidth = badgeElement.offsetWidth;\n const widthWithGap = count > 0 ? badgeWidth + BADGE_GAP : badgeWidth;\n const hasMoreAfterThis = items.length - count - 1 > 0;\n const reservedWidth = hasMoreAfterThis ? OVERFLOW_BADGE_MIN_WIDTH + BADGE_GAP : 0;\n\n if (usedWidth + widthWithGap + reservedWidth > containerWidth) {\n break;\n }\n\n usedWidth += widthWithGap;\n count++;\n }\n\n return Math.max(1, count);\n};\n\nexport const CollapsibleBadges = ({\n items,\n placeholder,\n onDismiss,\n children,\n selectedCount = 0,\n}: CollapsibleBadgesProps): ReactNode => {\n const { t } = useTranslation();\n const wasClickedRef = useRef(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const badgeElementsRef = useRef<Map<string, HTMLDivElement>>(new Map());\n const [visibleCount, setVisibleCount] = useState(items.length);\n const hasChildren = children !== undefined;\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const recalculate = (): void => {\n if (items.length === 0) {\n setVisibleCount(0);\n return;\n }\n setVisibleCount(calculateVisibleCount(container, badgeElementsRef.current, items, hasChildren));\n };\n\n const observer = new ResizeObserver(recalculate);\n observer.observe(container);\n return (): void => {\n observer.disconnect();\n };\n }, [items, hasChildren]);\n\n if (items.length === 0 && !children) {\n return placeholder;\n }\n\n const overflowCount = items.length - visibleCount;\n\n const getSelectedCountText = (count: number): string => {\n if (count === 1) {\n return t('Select_singleItemSelected');\n }\n if (count > 1) {\n return t('Select_multipleItemsSelected', { count: count.toString() });\n }\n return '';\n };\n\n return (\n <div ref={containerRef} className={styles.badgesContainer}>\n <span className={styles.srOnly} aria-live=\"polite\" aria-atomic=\"true\">\n {getSelectedCountText(selectedCount)}\n </span>\n {children}\n {items.map((item, index) => (\n <div\n key={item.value}\n ref={(element): void => {\n if (element) {\n badgeElementsRef.current.set(item.value, element);\n } else {\n badgeElementsRef.current.delete(item.value);\n }\n }}\n role=\"presentation\"\n className={styles.badgeWrapper}\n data-visible={index < visibleCount}\n onKeyDown={(event: KeyboardEvent<HTMLDivElement>): void => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.stopPropagation();\n }\n }}\n onMouseDown={(): void => {\n wasClickedRef.current = true;\n }}\n >\n <Badge\n emphasis=\"weak\"\n aria-label={typeof item.displayValue === 'string' ? item.displayValue : item.value}\n onDismiss={(event) => {\n event.stopPropagation();\n onDismiss(item.value, wasClickedRef.current);\n wasClickedRef.current = false;\n }}\n >\n {item.displayValue}\n </Badge>\n </div>\n ))}\n {overflowCount > 0 && (\n <div\n className={styles.badgeWrapper}\n aria-label={t('Select_additionalItemsSelected', { count: overflowCount.toString() })}\n >\n <Badge emphasis=\"weak\" aria-hidden=\"true\">\n +{overflowCount}\n </Badge>\n </div>\n )}\n </div>\n );\n};\n"],"names":["BADGE_GAP","OVERFLOW_BADGE_MIN_WIDTH","INPUT_MIN_WIDTH","calculateVisibleCount","container","badgeElements","items","hasInputSlot","containerWidth","usedWidth","count","item","badgeElement","badgeWidth","widthWithGap","reservedWidth","CollapsibleBadges","placeholder","onDismiss","children","selectedCount","t","useTranslation","wasClickedRef","useRef","containerRef","badgeElementsRef","visibleCount","setVisibleCount","useState","hasChildren","useEffect","recalculate","observer","overflowCount","getSelectedCountText","styles","jsx","index","element","event","Badge","jsxs"],"mappings":";;;;;AASA,MAAMA,IAAY,GACZC,IAA2B,IAC3BC,IAAkB,IAiBlBC,IAAwB,CAC1BC,GACAC,GACAC,GACAC,MACS;AACT,QAAMC,IAAiBJ,EAAU;AACjC,MAAIK,IAAYF,IAAeL,IAAkBF,IAAY,GACzDU,IAAQ;AAEZ,aAAWC,KAAQL,GAAO;AACtB,UAAMM,IAAeP,EAAc,IAAIM,EAAK,KAAK;AACjD,QAAI,CAACC;AACD;AAGJ,UAAMC,IAAaD,EAAa,aAC1BE,IAAeJ,IAAQ,IAAIG,IAAab,IAAYa,GAEpDE,IADmBT,EAAM,SAASI,IAAQ,IAAI,IACXT,IAA2BD,IAAY;AAEhF,QAAIS,IAAYK,IAAeC,IAAgBP;AAC3C;AAGJ,IAAAC,KAAaK,GACbJ;AAAA,EACJ;AAEA,SAAO,KAAK,IAAI,GAAGA,CAAK;AAC5B,GAEaM,IAAoB,CAAC;AAAA,EAC9B,OAAAV;AAAA,EACA,aAAAW;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC,IAAgB;AACpB,MAAyC;AACrC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAgBC,EAAO,EAAK,GAC5BC,IAAeD,EAAuB,IAAI,GAC1CE,IAAmBF,EAAoC,oBAAI,KAAK,GAChE,CAACG,GAAcC,CAAe,IAAIC,EAASvB,EAAM,MAAM,GACvDwB,IAAcX,MAAa;AAuBjC,MArBAY,EAAU,MAAM;AACZ,UAAM3B,IAAYqB,EAAa;AAC/B,QAAI,CA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A,QAC5B;AAAA,QAEA,UAAA,gBAAAc;AAAA,UAACI;AAAA,UAAA;AAAA,YACG,UAAS;AAAA,YACT,cAAY,OAAO9B,EAAK,gBAAiB,WAAWA,EAAK,eAAeA,EAAK;AAAA,YAC7E,WAAW,CAAC6B,MAAU;AAClB,cAAAA,EAAM,gBAAA,GACNtB,EAAUP,EAAK,OAAOY,EAAc,OAAO,GAC3CA,EAAc,UAAU;AAAA,YAC5B;AAAA,YAEC,UAAAZ,EAAK;AAAA,UAAA;AAAA,QAAA;AAAA,MACV;AAAA,MA9BKA,EAAK;AAAA,IAAA,CAgCjB;AAAA,IACAuB,IAAgB,KACb,gBAAAG;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAWD,EAAO;AAAA,QAClB,cAAYf,EAAE,kCAAkC,EAAE,OAAOa,EAAc,SAAA,GAAY;AAAA,QAEnF,UAAA,gBAAAQ,EAACD,GAAA,EAAM,UAAS,QAAO,eAAY,QAAO,UAAA;AAAA,UAAA;AAAA,UACpCP;AAAA,QAAA,EAAA,CACN;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GAER;AAER;"}
@@ -0,0 +1,84 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import * as p from "@radix-ui/react-popover";
3
+ import { Slot as M } from "@radix-ui/react-slot";
4
+ import { isValidElement as T } from "react";
5
+ import { useFondueTheme as E, ThemeProvider as F } from "./fondue-components36.js";
6
+ import a from "./fondue-components99.js";
7
+ import { recursiveMap as R, getSelectOptionValue as _ } from "./fondue-components109.js";
8
+ const j = ({
9
+ highlightedIndex: l,
10
+ getMenuProps: u,
11
+ getItemProps: m,
12
+ children: f,
13
+ filterText: d,
14
+ align: h,
15
+ side: P,
16
+ selectedItemValues: o,
17
+ hasInteractedSinceOpening: S,
18
+ viewportCollisionPadding: g = "compact",
19
+ onEscapeKeyDown: v
20
+ }) => {
21
+ const O = (e) => {
22
+ e.preventDefault();
23
+ }, N = {
24
+ compact: 8,
25
+ spacious: 24
26
+ }, { theme: A, dir: n } = E(), C = (e) => n === "ltr" ? e : e === "left" ? "right" : e === "right" ? "left" : e;
27
+ return /* @__PURE__ */ r(p.Portal, { children: /* @__PURE__ */ r(F, { theme: A, dir: n, children: /* @__PURE__ */ r(
28
+ p.Content,
29
+ {
30
+ dir: n,
31
+ align: h,
32
+ side: C(P),
33
+ collisionPadding: N[g] + 8,
34
+ onOpenAutoFocus: O,
35
+ onEscapeKeyDown: v,
36
+ className: a.portal,
37
+ children: /* @__PURE__ */ r(
38
+ "ul",
39
+ {
40
+ className: a.menu,
41
+ ...u({}, { suppressRefError: !0 }),
42
+ "data-has-interacted": S ? "true" : "false",
43
+ "data-test-id": "fondue-select-menu",
44
+ children: R(
45
+ f,
46
+ (e, s) => {
47
+ if (((t) => (
48
+ // @ts-expect-error - We are explicitly checking for ref
49
+ T(t) && t.ref !== void 0
50
+ ))(e)) {
51
+ const t = _(e.props), i = m({
52
+ item: t,
53
+ index: s,
54
+ ...e.ref ? { ref: e.ref } : {}
55
+ }), c = o == null ? void 0 : o.includes(t.value);
56
+ return /* @__PURE__ */ r(
57
+ M,
58
+ {
59
+ className: a.item,
60
+ "data-highlighted": l === s,
61
+ "data-selected": c,
62
+ onTouchStart: (D) => {
63
+ i.onClick && i.onClick(D);
64
+ },
65
+ ...i,
66
+ "aria-selected": c,
67
+ children: e
68
+ },
69
+ e.props.value
70
+ );
71
+ }
72
+ },
73
+ d
74
+ ).parsedChildren
75
+ }
76
+ )
77
+ }
78
+ ) }) });
79
+ };
80
+ j.displayName = "Select.Menu";
81
+ export {
82
+ j as SelectMenu
83
+ };
84
+ //# sourceMappingURL=fondue-components106.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components106.js","sources":["../src/components/Select/components/SelectMenu.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type UseComboboxPropGetters, type UseSelectPropGetters } from 'downshift';\nimport { isValidElement, type ForwardedRef, type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '#/components/ThemeProvider/ThemeProvider';\n\nimport styles from '../styles/select.module.scss';\nimport { getSelectOptionValue, recursiveMap } from '../utils';\n\nimport { type SelectItemProps } from './SelectItem';\n\nexport type SelectMenuViewportCollisionPadding = 'compact' | 'spacious';\n\nexport type SelectMenuProps = {\n /**\n * @internal\n * The index of the highlighted item in the menu.\n */\n highlightedIndex: number;\n /**\n * @internal\n * Callback function to retrieve the props for a menu element.\n */\n getMenuProps: UseSelectPropGetters<unknown>['getMenuProps'] | UseComboboxPropGetters<unknown>['getMenuProps'];\n /**\n * @internal\n * Callback function to retrieve the props for a item element.\n */\n getItemProps: UseSelectPropGetters<unknown>['getItemProps'] | UseComboboxPropGetters<unknown>['getItemProps'];\n /**\n * @internal\n * The children of the menu component. This can contain multiple `Select.Item` or `Select.Group` components.\n */\n children: ReactNode;\n /**\n * @internal\n * The filter text shown in the combobox input element.\n */\n filterText?: string;\n /**\n * @internal\n * The alignment of the menu.\n */\n align: 'start' | 'center' | 'end';\n /**\n * @internal\n * Defines the preferred side of the select. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side: 'left' | 'right' | 'bottom' | 'top';\n /**\n * @internal\n * The type of the menu.\n */\n selectedItemValues?: string[];\n /**\n * @internal\n * A boolean to indicate if highlighted item was changed since opening the menu.\n * This is used to determine the style of the selected/highlighted item.\n */\n hasInteractedSinceOpening?: boolean;\n /**\n * Define the minimum distance between the select menu and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: SelectMenuViewportCollisionPadding;\n /**\n * @internal\n * Event handler called when the escape key is pressed.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n};\n\nexport const SelectMenu = ({\n highlightedIndex,\n getMenuProps,\n getItemProps,\n children,\n filterText,\n align,\n side,\n selectedItemValues,\n hasInteractedSinceOpening,\n viewportCollisionPadding = 'compact',\n onEscapeKeyDown,\n}: SelectMenuProps) => {\n const handleOnOpenAutoFocus = (event: Event) => {\n event.preventDefault();\n };\n\n const VIEWPORT_COLLISION_PADDING_MAP: Record<SelectMenuViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n };\n\n const { theme, dir } = useFondueTheme();\n\n const getAdjustedSide = (side: 'left' | 'right' | 'bottom' | 'top') => {\n if (dir === 'ltr') {\n return side;\n }\n\n if (side === 'left') {\n return 'right';\n }\n if (side === 'right') {\n return 'left';\n }\n\n return side;\n };\n\n return (\n <RadixPopover.Portal>\n <ThemeProvider theme={theme} dir={dir}>\n <RadixPopover.Content\n dir={dir}\n align={align}\n side={getAdjustedSide(side)}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding] + 8}\n onOpenAutoFocus={handleOnOpenAutoFocus}\n onEscapeKeyDown={onEscapeKeyDown}\n className={styles.portal}\n >\n <ul\n className={styles.menu}\n // TODO: fix this accessibility issue\n // We are mounting/unmounting the menu on open/close\n // We should instead toggle its visibility for accessibility reasons\n // https://github.com/downshift-js/downshift?tab=readme-ov-file#getmenuprops\n {...getMenuProps({}, { suppressRefError: true })}\n data-has-interacted={hasInteractedSinceOpening ? 'true' : 'false'}\n data-test-id=\"fondue-select-menu\"\n >\n {\n recursiveMap(\n children,\n (child, index) => {\n const isValid = <TProps,>(\n child: ReactNode,\n ): child is ReactElement<TProps> & { ref: ForwardedRef<HTMLElement> } =>\n // @ts-expect-error - We are explicitly checking for ref\n isValidElement<TProps>(child) && child.ref !== undefined;\n\n if (isValid<SelectItemProps>(child)) {\n const optionData = getSelectOptionValue(child.props);\n const itemProps = getItemProps({\n item: optionData,\n index,\n ...(child.ref ? { ref: child.ref } : {}),\n });\n\n const isSelected = selectedItemValues?.includes(optionData.value);\n\n return (\n <RadixSlot\n className={styles.item}\n data-highlighted={highlightedIndex === index}\n data-selected={isSelected}\n key={child.props.value}\n // Workaround for the issue where the onClick event is not fired on touch devices because of portal usage\n onTouchStart={(event) => {\n if (itemProps.onClick) {\n itemProps.onClick(event as unknown as MouseEvent<HTMLElement>);\n }\n }}\n {...itemProps}\n aria-selected={isSelected}\n >\n {child}\n </RadixSlot>\n );\n }\n },\n filterText,\n ).parsedChildren\n }\n </ul>\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nSelectMenu.displayName = 'Select.Menu';\n"],"names":["SelectMenu","highlightedIndex","getMenuProps","getItemProps","children","filterText","align","side","selectedItemValues","hasInteractedSinceOpening","viewportCollisionPadding","onEscapeKeyDown","handleOnOpenAutoFocus","event","VIEWPORT_COLLISION_PADDING_MAP","theme","dir","useFondueTheme","getAdjustedSide","RadixPopover","jsx","ThemeProvider","styles","recursiveMap","child","index","isValidElement","optionData","getSelectOptionValue","itemProps","isSelected","RadixSlot"],"mappings":";;;;;;;AA4EO,MAAMA,IAAa,CAAC;AAAA,EACvB,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,0BAAAC,IAA2B;AAAA,EAC3B,iBAAAC;AACJ,MAAuB;AACnB,QAAMC,IAAwB,CAACC,MAAiB;AAC5C,IAAAA,EAAM,eAAA;AAAA,EACV,GAEMC,IAAqF;AAAA,IACvF,SAAS;AAAA,IACT,UAAU;AAAA,EAAA,GAGR,EAAE,OAAAC,GAAO,KAAAC,EAAA,IAAQC,EAAA,GAEjBC,IAAkB,CAACX,MACjBS,MAAQ,QACDT,IAGPA,MAAS,SACF,UAEPA,MAAS,UACF,SAGJA;AAGX,2BACKY,EAAa,QAAb,EACG,UAAA,gBAAAC,EAACC,GAAA,EAAc,OAAAN,GAAc,KAAAC,GACzB,UAAA,gBAAAI;AAAA,IAACD,EAAa;AAAA,IAAb;AAAA,MACG,KAAAH;AAAA,MACA,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W,cAAc;"}
@@ -0,0 +1,34 @@
1
+ import { jsxs as c, Fragment as n, jsx as r } from "react/jsx-runtime";
2
+ import { IconCheckMark as i, IconExclamationMarkTriangle as l } from "@frontify/fondue-icons";
3
+ import { useTranslation as m } from "./fondue-components39.js";
4
+ import s from "./fondue-components99.js";
5
+ const f = ({ status: o, hasError: a, dataTestId: e }) => {
6
+ const { t } = m();
7
+ return /* @__PURE__ */ c(n, { children: [
8
+ o === "success" ? /* @__PURE__ */ r(
9
+ i,
10
+ {
11
+ size: 16,
12
+ className: s.iconSuccess,
13
+ "data-test-id": `${e}-success-icon`,
14
+ "aria-hidden": "true"
15
+ }
16
+ ) : null,
17
+ a ? /* @__PURE__ */ c(n, { children: [
18
+ /* @__PURE__ */ r(
19
+ l,
20
+ {
21
+ size: 16,
22
+ className: s.iconError,
23
+ "data-test-id": `${e}-error-icon`,
24
+ "aria-hidden": "true"
25
+ }
26
+ ),
27
+ /* @__PURE__ */ r("span", { className: s.srOnly, role: "alert", children: t("Select_error") })
28
+ ] }) : null
29
+ ] });
30
+ };
31
+ export {
32
+ f as StatusIcons
33
+ };
34
+ //# sourceMappingURL=fondue-components107.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components107.js","sources":["../src/components/Select/components/StatusIcons.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport { type ReactNode } from 'react';\n\nimport { useTranslation } from '#/hooks/useTranslation';\n\nimport styles from '../styles/select.module.scss';\n\ntype StatusIconsProps = {\n /** The current status of the component. */\n status: 'neutral' | 'success' | 'error';\n /** Whether the component is in an error state (may differ from status when validation is involved). */\n hasError: boolean;\n /** The data-test-id prefix for the icons. */\n dataTestId: string;\n};\n\nexport const StatusIcons = ({ status, hasError, dataTestId }: StatusIconsProps): ReactNode => {\n const { t } = useTranslation();\n return (\n <>\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n aria-hidden=\"true\"\n />\n ) : null}\n {hasError ? (\n <>\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n aria-hidden=\"true\"\n />\n <span className={styles.srOnly} role=\"alert\">\n {t('Select_error')}\n </span>\n </>\n ) : null}\n </>\n );\n};\n"],"names":["StatusIcons","status","hasError","dataTestId","useTranslation","jsxs","Fragment","jsx","IconCheckMark","styles","IconExclamationMarkTriangle"],"mappings":";;;;AAkBO,MAAMA,IAAc,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,YAAAC,QAA8C;AAC1F,QAAM,EAAE,EAAA,IAAMC,EAAA;AACd,SACI,gBAAAC,EAAAC,GAAA,EACK,UAAA;AAAA,IAAAL,MAAW,YACR,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,MAAM;AAAA,QACN,WAAWC,EAAO;AAAA,QAClB,gBAAc,GAAGN,CAAU;AAAA,QAC3B,eAAY;AAAA,MAAA;AAAA,IAAA,IAEhB;AAAA,IACHD,IACG,gBAAAG,EAAAC,GAAA,EACI,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACG;AAAA,QAAA;AAAA,UACG,MAAM;AAAA,UACN,WAAWD,EAAO;AAAA,UAClB,gBAAc,GAAGN,CAAU;AAAA,UAC3B,eAAY;AAAA,QAAA;AAAA,MAAA;AAAA,MAEhB,gBAAAI,EAAC,UAAK,WAAWE,EAAO,QAAQ,MAAK,SAChC,UAAA,EAAE,cAAc,EAAA,CACrB;AAAA,IAAA,EAAA,CACJ,IACA;AAAA,EAAA,GACR;AAER;"}
@@ -0,0 +1,24 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { IconCross as s } from "@frontify/fondue-icons";
3
+ import { Button as t } from "./fondue-components6.js";
4
+ import { useTranslation as a } from "./fondue-components39.js";
5
+ import l from "./fondue-components99.js";
6
+ const f = ({ onClear: r }) => {
7
+ const { t: o } = a();
8
+ return /* @__PURE__ */ e(
9
+ t,
10
+ {
11
+ "aria-label": o("Select_clear"),
12
+ type: "button",
13
+ size: "small",
14
+ emphasis: "weak",
15
+ aspect: "square",
16
+ onPress: r,
17
+ children: /* @__PURE__ */ e(s, { className: l.clearIcon, size: 16 })
18
+ }
19
+ );
20
+ };
21
+ export {
22
+ f as SelectClear
23
+ };
24
+ //# sourceMappingURL=fondue-components108.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components108.js","sources":["../src/components/Select/components/SelectClear.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\n\nimport { Button } from '#/components/Button/Button';\nimport { useTranslation } from '#/hooks/useTranslation';\n\nimport styles from '../styles/select.module.scss';\n\nexport const SelectClear = ({ onClear }: { onClear?: () => void }) => {\n const { t } = useTranslation();\n\n return (\n <Button\n aria-label={t('Select_clear')}\n type=\"button\"\n size=\"small\"\n emphasis=\"weak\"\n aspect=\"square\"\n onPress={onClear}\n >\n <IconCross className={styles.clearIcon} size={16} />\n </Button>\n );\n};\n"],"names":["SelectClear","onClear","t","useTranslation","jsx","Button","IconCross","styles"],"mappings":";;;;;AASO,MAAMA,IAAc,CAAC,EAAE,SAAAC,QAAwC;AAClE,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA;AAEd,SACI,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,cAAYH,EAAE,cAAc;AAAA,MAC5B,MAAK;AAAA,MACL,MAAK;AAAA,MACL,UAAS;AAAA,MACT,QAAO;AAAA,MACP,SAASD;AAAA,MAET,4BAACK,GAAA,EAAU,WAAWC,EAAO,WAAW,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAG9D;"}
@@ -0,0 +1,43 @@
1
+ import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
+ import { ForwardedRefSelectItem as E } from "./fondue-components75.js";
3
+ const g = ({
4
+ children: o,
5
+ value: r,
6
+ label: s
7
+ }) => o && typeof o == "string" ? {
8
+ value: r !== void 0 ? r : o,
9
+ label: s !== void 0 ? s : o
10
+ } : {
11
+ value: r ?? "",
12
+ label: s !== void 0 ? s : r ?? "",
13
+ ...o ? { children: o } : null
14
+ }, v = (o, r) => u(o) && o.type === r, w = (o, r, s, p = 0) => {
15
+ const n = [];
16
+ let t = 0;
17
+ return a.forEach(o, (e) => {
18
+ if (v(e, E) && u(e))
19
+ g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(r(e, p + t)), t++);
20
+ else if (u(e) && (e != null && e.props.children)) {
21
+ const { parsedChildren: m, subElementCount: C } = w(
22
+ e.props.children,
23
+ r,
24
+ "",
25
+ p + t
26
+ );
27
+ e = f(e, {
28
+ children: m,
29
+ key: `group-${p + t}`
30
+ }), n.push(e), t += C;
31
+ } else
32
+ n.push(e);
33
+ }), {
34
+ parsedChildren: n,
35
+ subElementCount: t
36
+ };
37
+ };
38
+ export {
39
+ g as getSelectOptionValue,
40
+ v as isReactLeaf,
41
+ w as recursiveMap
42
+ };
43
+ //# sourceMappingURL=fondue-components109.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components109.js","sources":["../src/components/Select/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n type JSXElementConstructor,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { ForwardedRefSelectItem, type SelectItemProps } from './components/SelectItem';\n\n/**\n * Extracts and returns an object containing `value` and `label` from a given SelectItemProps object.\n * It prioritizes explicit `value` and `label` properties but will fall back to using `children` as the value or label if necessary.\n *\n * @param {SelectItemProps} props - The properties of a select item, which include potential children, value, and label.\n * @returns {{ value: string; label: string, children?: ReactNode }} An object containing `value` and `label` as strings.\n *\n * @example\n * // Returns { value: 'option1', label: 'Option 1' }\n * getSelectOptionValue({ value: 'option1', label: 'Option 1' });\n *\n * @example\n * // Uses children as the value and label when they are not explicitly provided\n * // Returns { value: 'Default', label: 'Default' }\n * getSelectOptionValue({ children: 'Default' });\n */\nexport const getSelectOptionValue = ({\n children,\n value,\n label,\n}: SelectItemProps): {\n value: string;\n label: string;\n children?: ReactNode;\n} => {\n if (children && typeof children === 'string') {\n return {\n value: value !== undefined ? value : children,\n label: label !== undefined ? label : children,\n };\n }\n\n return {\n value: value ?? '',\n label: label !== undefined ? label : (value ?? ''),\n ...(children ? { children } : null),\n };\n};\n/**\n * Determines if the child is a leaf node of React, meaning it has one final child of a native type;\n *\n * @param {ReactNode} child - The React child node to check.\n * @param {JSXElementConstructor<never>} Component - The React component constructor used for comparison.\n * @returns {boolean} Returns true if the `child` is a valid React element of the specified `Component` type.\n *\n * @example\n * // Assuming ForwardedRefSelectItem is a component that renders an <input> element\n * // Returns true\n * isReactLeaf(<ForwardedRefSelectItem />, ForwardedRefSelectItem);\n *\n * @example\n * // Returns false for non-matching types or non-leaf components\n * isReactLeaf(<div><ForwardedRefSelectItem /></div>, ForwardedRefSelectItem);\n */\nexport const isReactLeaf = (child: ReactNode, Component: JSXElementConstructor<never>): child is ReactElement =>\n isValidElement(child) && child.type === Component;\n\n/**\n * Recursively maps through React children, applying a callback to each child that meets the specified conditions.\n * This function is useful for deeply nested structures where modifications or checks are needed at multiple levels.\n *\n * @param {ReactNode} children - The children to be recursively processed.\n * @param {function(ReactNode, number): ReactNode} callback - A function that is called for each child that meets the condition. It receives the child and its index, and returns a React node.\n * @param {string} [filterText=''] - Optional text used to filter children based on their properties.\n * @param {number} [nextIndex=0] - The starting index for numbering children, defaults to 0.\n * @returns {{ parsedChildren: ReactNode[], subElementCount: number }} An object containing the transformed children array and the count of all processed sub-elements.\n *\n * @example\n * // Example usage in a select component where only items containing a certain text are modified\n * recursiveMap(children, (child, index) => React.cloneElement(child, { extraProp: 'value' }), 'specific text');\n *\n * @example\n * // Nested structure transformation, adding class names based on index\n * recursiveMap(children, (child, index) => React.cloneElement(child, { className: `item-${index}` }));\n */\nexport const recursiveMap = (\n children: ReactNode,\n callback: (child: ReactNode, nextIndex: number) => ReactNode,\n filterText?: string,\n nextIndex: number = 0,\n): {\n parsedChildren: ReactNode[];\n subElementCount: number;\n} => {\n const resultingChildren: ReactNode[] = [];\n let itemCounter = 0;\n Children.forEach(children, (child) => {\n if (isReactLeaf(child, ForwardedRefSelectItem) && isValidElement<SelectItemProps>(child)) {\n if (\n getSelectOptionValue(child.props)\n .label.toLowerCase()\n .includes(filterText?.toLowerCase() || '')\n ) {\n resultingChildren.push(callback(child, nextIndex + itemCounter));\n itemCounter++;\n }\n } else if (isValidElement<{ children: ReactNode }>(child) && child?.props.children) {\n const { parsedChildren, subElementCount } = recursiveMap(\n child.props.children,\n callback,\n '',\n nextIndex + itemCounter,\n );\n child = cloneElement(child, {\n children: parsedChildren,\n key: `group-${nextIndex + itemCounter}`,\n });\n resultingChildren.push(child);\n itemCounter += subElementCount;\n } else {\n resultingChildren.push(child);\n }\n });\n return {\n parsedChildren: resultingChildren,\n subElementCount: itemCounter,\n };\n};\n"],"names":["getSelectOptionValue","children","value","label","isReactLeaf","child","Component","isValidElement","recursiveMap","callback","filterText","nextIndex","resultingChildren","itemCounter","Children","ForwardedRefSelectItem","parsedChildren","subElementCount","cloneElement"],"mappings":";;AA6BO,MAAMA,IAAuB,CAAC;AAAA,EACjC,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AACJ,MAKQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,MAAU,SAAYA,IAAQD;AAAA,EACrC,OAAOE,MAAU,SAAYA,IAAQF;AAAA,IAItC;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,MAAU,SAAYA,IAASD,KAAS;AAAA,EAC/C,GAAID,IAAW,EAAE,UAAAA,MAAa;AAAA,GAmBzBG,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CAC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