@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
@@ -1,84 +1,23 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import * as u from "@radix-ui/react-popover";
3
- import { Slot as D } from "@radix-ui/react-slot";
4
- import { isValidElement as M } from "react";
5
- import { useFondueTheme as T, ThemeProvider as E } from "./fondue-components36.js";
6
- import i from "./fondue-components75.js";
7
- import { recursiveMap as F, getSelectOptionValue as R } from "./fondue-components95.js";
8
- const _ = ({
9
- highlightedIndex: p,
10
- getMenuProps: c,
11
- getItemProps: m,
12
- children: f,
13
- filterText: d,
14
- align: h,
15
- side: v,
16
- selectedItem: o,
17
- hasInteractedSinceOpening: P,
18
- viewportCollisionPadding: S = "compact",
19
- onEscapeKeyDown: g
20
- }) => {
21
- const O = (e) => {
22
- e.preventDefault();
23
- }, N = {
24
- compact: 8,
25
- spacious: 24
26
- }, { theme: A, dir: a } = T(), C = (e) => a === "ltr" ? e : e === "left" ? "right" : e === "right" ? "left" : e;
27
- return /* @__PURE__ */ r(u.Portal, { children: /* @__PURE__ */ r(E, { theme: A, dir: a, children: /* @__PURE__ */ r(
28
- u.Content,
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { forwardRef as s } from "react";
3
+ import { SelectBase as u } from "./fondue-components98.js";
4
+ import { useMultiselect as a } from "./fondue-components96.js";
5
+ const n = ({ value: e, onSelect: t, defaultValue: l, ...o }, r) => {
6
+ const { selectedItemValues: m, toggleSelectedItem: c, clear: i } = a(t, e, l);
7
+ return /* @__PURE__ */ p(
8
+ u,
29
9
  {
30
- dir: a,
31
- align: h,
32
- side: C(v),
33
- collisionPadding: N[S] + 8,
34
- onOpenAutoFocus: O,
35
- onEscapeKeyDown: g,
36
- className: i.portal,
37
- children: /* @__PURE__ */ r(
38
- "ul",
39
- {
40
- className: i.menu,
41
- ...c({}, { suppressRefError: !0 }),
42
- "data-has-interacted": P ? "true" : "false",
43
- "data-test-id": "fondue-select-menu",
44
- children: F(
45
- f,
46
- (e, s) => {
47
- if (((t) => (
48
- // @ts-expect-error - We are explicitly checking for ref
49
- M(t) && t.ref !== void 0
50
- ))(e)) {
51
- const t = R(e.props), n = m({
52
- item: t,
53
- index: s,
54
- ...e.ref ? { ref: e.ref } : {}
55
- }), l = (o == null ? void 0 : o.value) === t.value;
56
- return /* @__PURE__ */ r(
57
- D,
58
- {
59
- className: i.item,
60
- "data-highlighted": p === s,
61
- "data-selected": l,
62
- onTouchStart: (V) => {
63
- n.onClick && n.onClick(V);
64
- },
65
- ...n,
66
- "aria-selected": l,
67
- children: e
68
- },
69
- e.props.value
70
- );
71
- }
72
- },
73
- d
74
- ).parsedChildren
75
- }
76
- )
10
+ ref: r,
11
+ multiple: !0,
12
+ selectedItemValues: m,
13
+ onItemSelect: c,
14
+ onClear: i,
15
+ ...o
77
16
  }
78
- ) }) });
79
- };
80
- _.displayName = "Select.Menu";
17
+ );
18
+ }, f = s(n);
19
+ f.displayName = "Select.Multi";
81
20
  export {
82
- _ as SelectMenu
21
+ f as SelectMultiple
83
22
  };
84
23
  //# sourceMappingURL=fondue-components73.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components73.js","sources":["../src/components/Select/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 '../ThemeProvider/ThemeProvider';\n\nimport { type SelectItemProps } from './SelectItem';\nimport styles from './styles/select.module.scss';\nimport { getSelectOptionValue, recursiveMap } from './utils';\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 selectedItem?: {\n value: string;\n } | null;\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 selectedItem,\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 = selectedItem?.value === 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","selectedItem","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":";;;;;;;AA6EO,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,cAAAC;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,OA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;AAAA,UAAA,EACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAEV;AAAA,EAAA,GAER,EAAA,CACJ;AAER;AACAL,EAAW,cAAc;"}
1
+ {"version":3,"file":"fondue-components73.js","sources":["../src/components/Select/SelectMultiple.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport { SelectBase, type SelectSharedProps } from './components/SelectBase';\nimport { useMultiselect } from './hooks/useMultiselect';\n\nexport type SelectMultipleProps = SelectSharedProps & {\n /**\n * The active value in the select component. This is used to control the select externally\n */\n value?: string[] | null;\n /**\n * Callback function that is called when items are selected\n */\n onSelect?: (selectedValues: string[] | null) => void;\n /**\n * The default value of the select component. Used for uncontrolled usages\n */\n defaultValue?: string[];\n};\n\nconst SelectMultipleInput = (\n { value, onSelect, defaultValue, ...rest }: SelectMultipleProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { selectedItemValues, toggleSelectedItem, clear } = useMultiselect(onSelect, value, defaultValue);\n\n return (\n <SelectBase\n ref={ref}\n multiple\n selectedItemValues={selectedItemValues}\n onItemSelect={toggleSelectedItem}\n onClear={clear}\n {...rest}\n />\n );\n};\n\nexport const SelectMultiple = forwardRef<HTMLDivElement, SelectMultipleProps>(SelectMultipleInput);\nSelectMultiple.displayName = 'Select.Multi';\n"],"names":["SelectMultipleInput","value","onSelect","defaultValue","rest","ref","selectedItemValues","toggleSelectedItem","clear","useMultiselect","jsx","SelectBase","SelectMultiple","forwardRef"],"mappings":";;;;AAsBA,MAAMA,IAAsB,CACxB,EAAE,OAAAC,GAAO,UAAAC,GAAU,cAAAC,GAAc,GAAGC,EAAA,GACpCC,MACC;AACD,QAAM,EAAE,oBAAAC,GAAoB,oBAAAC,GAAoB,OAAAC,EAAA,IAAUC,EAAeP,GAAUD,GAAOE,CAAY;AAEtG,SACI,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAN;AAAA,MACA,UAAQ;AAAA,MACR,oBAAAC;AAAA,MACA,cAAcC;AAAA,MACd,SAASC;AAAA,MACR,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGhB,GAEaQ,IAAiBC,EAAgDb,CAAmB;AACjGY,EAAe,cAAc;"}
@@ -1,11 +1,23 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as d } from "react";
3
- import m from "./fondue-components75.js";
4
- const t = ({ children: e, name: o, "data-test-id": r = "fondue-select-slot", ...a }, s) => /* @__PURE__ */ l("div", { "data-test-id": r, ref: s, className: m.slot, "data-name": o, ...a, children: e });
5
- t.displayName = "Select.Slot";
6
- const S = d(t);
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as i } from "react";
3
+ import { SelectBase as S } from "./fondue-components98.js";
4
+ import { useSingleSelect as a } from "./fondue-components97.js";
5
+ const p = ({ value: e, onSelect: t, defaultValue: l, ...o }, r) => {
6
+ const { selectedItemValues: m, selectItem: c, clear: s } = a(t, e, l);
7
+ return /* @__PURE__ */ n(
8
+ S,
9
+ {
10
+ ref: r,
11
+ multiple: !1,
12
+ selectedItemValues: m,
13
+ onItemSelect: c,
14
+ onClear: s,
15
+ ...o
16
+ }
17
+ );
18
+ }, f = i(p);
19
+ f.displayName = "Select";
7
20
  export {
8
- S as ForwardedRefSelectSlot,
9
- t as SelectSlot
21
+ f as SelectSingle
10
22
  };
11
23
  //# sourceMappingURL=fondue-components74.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components74.js","sources":["../src/components/Select/SelectSlot.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectSlotProps = {\n /**\n * The children of the select slot. This can be a custom component.\n */\n children?: ReactNode;\n /**\n * The slot name that is used to determine the placement.\n */\n name: 'menu' | 'left' | 'right' | 'clear';\n /**\n * The data test id of the select slot.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-select-slot', ...props }: SelectSlotProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={forwardedRef} className={styles.slot} data-name={name} {...props}>\n {children}\n </div>\n );\n};\nSelectSlot.displayName = 'Select.Slot';\n\nexport const ForwardedRefSelectSlot = forwardRef<HTMLDivElement, SelectSlotProps>(SelectSlot);\n"],"names":["SelectSlot","children","name","dataTestId","props","forwardedRef","jsx","styles","ForwardedRefSelectSlot","forwardRef"],"mappings":";;;AAqBO,MAAMA,IAAa,CACtB,EAAE,UAAAC,GAAU,MAAAC,GAAM,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAA,GACxEC,MAGI,gBAAAC,EAAC,OAAA,EAAI,gBAAcH,GAAY,KAAKE,GAAc,WAAWE,EAAO,MAAM,aAAWL,GAAO,GAAGE,GAC1F,UAAAH,GACL;AAGRD,EAAW,cAAc;AAElB,MAAMQ,IAAyBC,EAA4CT,CAAU;"}
1
+ {"version":3,"file":"fondue-components74.js","sources":["../src/components/Select/SelectSingle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport { SelectBase, type SelectSharedProps } from './components/SelectBase';\nimport { useSingleSelect } from './hooks/useSingleSelect';\n\nexport type SelectSingleProps = SelectSharedProps & {\n /**\n * The active value in the select component. This is used to control the select externally\n */\n value?: string | null;\n /**\n * Callback function that is called when an item is selected\n */\n onSelect?: (selectedValue: string | null) => void;\n /**\n * The default value of the select component. Used for uncontrolled usages\n */\n defaultValue?: string;\n};\n\nconst SelectSingleInput = (\n { value, onSelect, defaultValue, ...rest }: SelectSingleProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { selectedItemValues, selectItem, clear } = useSingleSelect(onSelect, value, defaultValue);\n\n return (\n <SelectBase\n ref={ref}\n multiple={false}\n selectedItemValues={selectedItemValues}\n onItemSelect={selectItem}\n onClear={clear}\n {...rest}\n />\n );\n};\n\nexport const SelectSingle = forwardRef<HTMLDivElement, SelectSingleProps>(SelectSingleInput);\nSelectSingle.displayName = 'Select';\n"],"names":["SelectSingleInput","value","onSelect","defaultValue","rest","ref","selectedItemValues","selectItem","clear","useSingleSelect","jsx","SelectBase","SelectSingle","forwardRef"],"mappings":";;;;AAsBA,MAAMA,IAAoB,CACtB,EAAE,OAAAC,GAAO,UAAAC,GAAU,cAAAC,GAAc,GAAGC,EAAA,GACpCC,MACC;AACD,QAAM,EAAE,oBAAAC,GAAoB,YAAAC,GAAY,OAAAC,EAAA,IAAUC,EAAgBP,GAAUD,GAAOE,CAAY;AAE/F,SACI,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAN;AAAA,MACA,UAAU;AAAA,MACV,oBAAAC;AAAA,MACA,cAAcC;AAAA,MACd,SAASC;AAAA,MACR,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGhB,GAEaQ,IAAeC,EAA8Cb,CAAiB;AAC3FY,EAAa,cAAc;"}
@@ -1,40 +1,22 @@
1
- const c = "_root_1huhp_7", o = "_selectedValue_1huhp_57", _ = "_input_1huhp_74", e = "_slot_1huhp_100", t = "_clear_1huhp_150", n = "_clearIcon_1huhp_157", u = "_icons_1huhp_161", h = "_caret_1huhp_167", s = "_iconSuccess_1huhp_195", r = "_iconError_1huhp_201", p = "_menu_1huhp_207", a = "_portal_1huhp_230", l = "_item_1huhp_246", i = "_checkmarkIcon_1huhp_275", m = "_itemValue_1huhp_281", g = "_group_1huhp_295", d = "_groupHeading_1huhp_306", k = {
2
- root: c,
3
- selectedValue: o,
4
- input: _,
5
- slot: e,
6
- clear: t,
7
- clearIcon: n,
8
- icons: u,
9
- caret: h,
10
- iconSuccess: s,
11
- iconError: r,
12
- menu: p,
13
- portal: a,
14
- item: l,
15
- checkmarkIcon: i,
16
- itemValue: m,
17
- group: g,
18
- groupHeading: d
19
- };
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
+ import { IconCheckMark as n } from "@frontify/fondue-icons";
3
+ import { forwardRef as l } from "react";
4
+ import a from "./fondue-components99.js";
5
+ const o = ({ "data-test-id": c = "fondue-select-item", ...e }, t) => /* @__PURE__ */ d("li", { "data-test-id": c, ref: t, ...e, children: [
6
+ /* @__PURE__ */ r("div", { className: a.itemValue, children: e.children }),
7
+ /* @__PURE__ */ r(n, { className: a.checkmarkIcon })
8
+ ] });
9
+ o.displayName = "Select.Item";
10
+ const I = l(o), s = ({ children: c, groupId: e, heading: t, "data-test-id": i = "fondue-select-item-group" }, m) => /* @__PURE__ */ d("div", { "data-test-id": i, className: a.group, ref: m, children: [
11
+ t ? /* @__PURE__ */ r("div", { className: a.groupHeading, children: /* @__PURE__ */ r("span", { children: t }) }) : null,
12
+ c
13
+ ] }, e);
14
+ s.displayName = "Select.Group";
15
+ const N = l(s);
20
16
  export {
21
- h as caret,
22
- i as checkmarkIcon,
23
- t as clear,
24
- n as clearIcon,
25
- k as default,
26
- g as group,
27
- d as groupHeading,
28
- r as iconError,
29
- s as iconSuccess,
30
- u as icons,
31
- _ as input,
32
- l as item,
33
- m as itemValue,
34
- p as menu,
35
- a as portal,
36
- c as root,
37
- o as selectedValue,
38
- e as slot
17
+ I as ForwardedRefSelectItem,
18
+ N as ForwardedRefSelectItemGroup,
19
+ o as SelectItem,
20
+ s as SelectItemGroup
39
21
  };
40
22
  //# sourceMappingURL=fondue-components75.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components75.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components75.js","sources":["../src/components/Select/components/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 groups heading\n */\n heading?: 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, heading, '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 {heading ? (\n <div className={styles.groupHeading}>\n <span>{heading}</span>\n </div>\n ) : null}\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","heading","jsxs","ForwardedRefSelectItemGroup"],"mappings":";;;;AAiCO,MAAMA,IAAa,CACtB,EAAE,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAA,GACxDC,wBAGK,MAAA,EAAG,gBAAcF,GAAY,KAAKE,GAAe,GAAGD,GACjD,UAAA;AAAA,EAAA,gBAAAE,EAAC,OAAA,EAAI,WAAWC,EAAO,WAAY,YAAM,UAAS;AAAA,EAClD,gBAAAD,EAACE,GAAA,EAAc,WAAWD,EAAO,cAAA,CAAe;AAAA,GACpD;AAGRL,EAAW,cAAc;AAElB,MAAMO,IAAyBC,EAA2CR,CAAU,GAqB9ES,IAAkB,CAC3B,EAAE,UAAAC,GAAU,SAAAC,GAAS,SAAAC,GAAS,gBAAgBX,IAAa,2BAAA,GAC3DE,MAGI,gBAAAU,EAAC,SAAI,gBAAcZ,GAAY,WAAWI,EAAO,OAAO,KAAKF,GACxD,UAAA;AAAA,EAAAS,IACG,gBAAAR,EAAC,SAAI,WAAWC,EAAO,cACnB,UAAA,gBAAAD,EAAC,QAAA,EAAM,UAAAQ,EAAA,CAAQ,EAAA,CACnB,IACA;AAAA,EACHF;AAAA,EAAA,GAN2EC,CAOhF;AAGRF,EAAgB,cAAc;AAEvB,MAAMK,IAA8BN,EAAiDC,CAAe;"}
@@ -1,74 +1,11 @@
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-components96.js";
4
- import { ForwardedRefSelectItem as L } from "./fondue-components72.js";
5
- import { ForwardedRefSelectSlot as y } from "./fondue-components74.js";
6
- import { getSelectOptionValue as I } from "./fondue-components95.js";
7
- const O = (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 ? l.find((p) => p.value === a) : void 0,
54
- [l]
55
- ), c = O(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
- };
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as d } from "react";
3
+ import m from "./fondue-components99.js";
4
+ const t = ({ children: e, name: o, "data-test-id": r = "fondue-select-slot", ...a }, s) => /* @__PURE__ */ l("div", { "data-test-id": r, ref: s, className: m.slot, "data-name": o, ...a, children: e });
5
+ t.displayName = "Select.Slot";
6
+ const S = d(t);
70
7
  export {
71
- g as getRecursiveOptionValues,
72
- q as useSelectData
8
+ S as ForwardedRefSelectSlot,
9
+ t as SelectSlot
73
10
  };
74
11
  //# sourceMappingURL=fondue-components76.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components76.js","sources":["../src/components/Select/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 './SelectClear';\nimport { ForwardedRefSelectItem, type SelectItemProps } from './SelectItem';\nimport { ForwardedRefSelectSlot, type SelectSlotProps } from './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 ? 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,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AAW,GAAGU,EAAW,cAAc;AAAA,IACtD,YAAApC;AAAA,IACA,YAAAyB;AAAA,IACA,aAAAG;AAAA,IACA,eAAAJ;AAAA,IACA,gBAAAS;AAAA,IACA,iBAAiB;AAAA,MACb,WAAWG,EAAW;AAAA,MACtB,OAAOA,EAAW;AAAA,IAAA;AAAA,EACtB;AAER;"}
1
+ {"version":3,"file":"fondue-components76.js","sources":["../src/components/Select/components/SelectSlot.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from '../styles/select.module.scss';\n\nexport type SelectSlotProps = {\n /**\n * The children of the select slot. This can be a custom component.\n */\n children?: ReactNode;\n /**\n * The slot name that is used to determine the placement.\n */\n name: 'menu' | 'left' | 'right' | 'clear';\n /**\n * The data test id of the select slot.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-select-slot', ...props }: SelectSlotProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={forwardedRef} className={styles.slot} data-name={name} {...props}>\n {children}\n </div>\n );\n};\nSelectSlot.displayName = 'Select.Slot';\n\nexport const ForwardedRefSelectSlot = forwardRef<HTMLDivElement, SelectSlotProps>(SelectSlot);\n"],"names":["SelectSlot","children","name","dataTestId","props","forwardedRef","jsx","styles","ForwardedRefSelectSlot","forwardRef"],"mappings":";;;AAqBO,MAAMA,IAAa,CACtB,EAAE,UAAAC,GAAU,MAAAC,GAAM,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAA,GACxEC,MAGI,gBAAAC,EAAC,OAAA,EAAI,gBAAcH,GAAY,KAAKE,GAAc,WAAWE,EAAO,MAAM,aAAWL,GAAO,GAAGE,GAC1F,UAAAH,GACL;AAGRD,EAAW,cAAc;AAElB,MAAMQ,IAAyBC,EAA4CT,CAAU;"}
@@ -10,6 +10,11 @@ const e = {
10
10
  Flyout_close: "Close",
11
11
  Select_clear: "clear input",
12
12
  Select_toggleMenu: "toggle menu",
13
+ Select_error: "Error",
14
+ Select_selectedCount: "${count} selected: ${items}",
15
+ Select_singleItemSelected: "1 item selected",
16
+ Select_multipleItemsSelected: "${count} items selected",
17
+ Select_additionalItemsSelected: "${count} additional items selected",
13
18
  Switch_defaultLabel: "Switch",
14
19
  Table_sortByDescending: "Sort by ${column} descending",
15
20
  Table_sortByAscending: "Sort by ${column} ascending",
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components90.js","sources":["../src/locales/en-US.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const enUS = {\n ColorPicker_selectColor: 'Select Color',\n ColorPicker_selectFormat: 'Select a color format',\n ColorPicker_hexValue: 'Hex color value',\n ColorPicker_redChannel: 'Red Color Channel',\n ColorPicker_greenChannel: 'Green Color Channel',\n ColorPicker_blueChannel: 'Blue Color Channel',\n ColorPicker_opacity: 'Color Opacity',\n Dialog_close: 'Close',\n Flyout_close: 'Close',\n Select_clear: 'clear input',\n Select_toggleMenu: 'toggle menu',\n Switch_defaultLabel: 'Switch',\n Table_sortByDescending: 'Sort by ${column} descending',\n Table_sortByAscending: 'Sort by ${column} ascending',\n Table_sortDescending: 'Sort descending',\n Table_sortAscending: 'Sort ascending',\n Badge_dismiss: 'Dismiss ${label}',\n Notice_dismiss: 'Dismiss notice',\n};\n"],"names":["enUS"],"mappings":"AAEO,MAAMA,IAAO;AAAA,EAChB,yBAAyB;AAAA,EACzB,0BAA0B;AAAA,EAC1B,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,eAAe;AAAA,EACf,gBAAgB;AACpB;"}
1
+ {"version":3,"file":"fondue-components90.js","sources":["../src/locales/en-US.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const enUS = {\n ColorPicker_selectColor: 'Select Color',\n ColorPicker_selectFormat: 'Select a color format',\n ColorPicker_hexValue: 'Hex color value',\n ColorPicker_redChannel: 'Red Color Channel',\n ColorPicker_greenChannel: 'Green Color Channel',\n ColorPicker_blueChannel: 'Blue Color Channel',\n ColorPicker_opacity: 'Color Opacity',\n Dialog_close: 'Close',\n Flyout_close: 'Close',\n Select_clear: 'clear input',\n Select_toggleMenu: 'toggle menu',\n Select_error: 'Error',\n Select_selectedCount: '${count} selected: ${items}',\n Select_singleItemSelected: '1 item selected',\n Select_multipleItemsSelected: '${count} items selected',\n Select_additionalItemsSelected: '${count} additional items selected',\n Switch_defaultLabel: 'Switch',\n Table_sortByDescending: 'Sort by ${column} descending',\n Table_sortByAscending: 'Sort by ${column} ascending',\n Table_sortDescending: 'Sort descending',\n Table_sortAscending: 'Sort ascending',\n Badge_dismiss: 'Dismiss ${label}',\n Notice_dismiss: 'Dismiss notice',\n};\n"],"names":["enUS"],"mappings":"AAEO,MAAMA,IAAO;AAAA,EAChB,yBAAyB;AAAA,EACzB,0BAA0B;AAAA,EAC1B,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAC3B,8BAA8B;AAAA,EAC9B,gCAAgC;AAAA,EAChC,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,eAAe;AAAA,EACf,gBAAgB;AACpB;"}
@@ -1,20 +1,8 @@
1
- const o = "_root_18649_5", c = "_caret_18649_43", t = "_colorName_18649_58", _ = "_colorIndicator_18649_61", n = "_button_18649_82", r = "_actions_18649_113", a = "_clearIcon_18649_122", s = {
2
- root: o,
3
- caret: c,
4
- colorName: t,
5
- colorIndicator: _,
6
- button: n,
7
- actions: r,
8
- clearIcon: a
1
+ const o = "_root_1y4f3_2", t = {
2
+ root: o
9
3
  };
10
4
  export {
11
- r as actions,
12
- n as button,
13
- c as caret,
14
- a as clearIcon,
15
- _ as colorIndicator,
16
- t as colorName,
17
- s as default,
5
+ t as default,
18
6
  o as root
19
7
  };
20
8
  //# sourceMappingURL=fondue-components92.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components92.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components92.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,8 +1,8 @@
1
- const o = "_root_1y4f3_2", t = {
2
- root: o
1
+ const r = (e) => {
2
+ if (e)
3
+ return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
3
4
  };
4
5
  export {
5
- t as default,
6
- o as root
6
+ r as colorToCss
7
7
  };
8
8
  //# sourceMappingURL=fondue-components93.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components93.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"fondue-components93.js","sources":["../src/components/Badge/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n"],"names":["colorToCss","color"],"mappings":"AAiBO,MAAMA,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF;"}
@@ -1,8 +1,20 @@
1
- const r = (e) => {
2
- if (e)
3
- return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
1
+ const o = "_root_18649_5", c = "_caret_18649_43", t = "_colorName_18649_58", _ = "_colorIndicator_18649_61", n = "_button_18649_82", r = "_actions_18649_113", a = "_clearIcon_18649_122", s = {
2
+ root: o,
3
+ caret: c,
4
+ colorName: t,
5
+ colorIndicator: _,
6
+ button: n,
7
+ actions: r,
8
+ clearIcon: a
4
9
  };
5
10
  export {
6
- r as colorToCss
11
+ r as actions,
12
+ n as button,
13
+ c as caret,
14
+ a as clearIcon,
15
+ _ as colorIndicator,
16
+ t as colorName,
17
+ s as default,
18
+ o as root
7
19
  };
8
20
  //# sourceMappingURL=fondue-components94.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components94.js","sources":["../src/components/Badge/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n"],"names":["colorToCss","color"],"mappings":"AAiBO,MAAMA,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF;"}
1
+ {"version":3,"file":"fondue-components94.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}