@frontify/fondue-components 3.2.1 → 3.3.0

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 (101) hide show
  1. package/dist/fondue-components.js +18 -16
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +2 -2
  4. package/dist/fondue-components11.js +42 -30
  5. package/dist/fondue-components11.js.map +1 -1
  6. package/dist/fondue-components12.js +2 -2
  7. package/dist/fondue-components13.js +1 -1
  8. package/dist/fondue-components14.js +1 -1
  9. package/dist/fondue-components15.js +64 -6
  10. package/dist/fondue-components15.js.map +1 -1
  11. package/dist/fondue-components16.js +6 -47
  12. package/dist/fondue-components16.js.map +1 -1
  13. package/dist/fondue-components17.js +42 -50
  14. package/dist/fondue-components17.js.map +1 -1
  15. package/dist/fondue-components18.js +112 -29
  16. package/dist/fondue-components18.js.map +1 -1
  17. package/dist/fondue-components19.js +53 -110
  18. package/dist/fondue-components19.js.map +1 -1
  19. package/dist/fondue-components20.js +27 -64
  20. package/dist/fondue-components20.js.map +1 -1
  21. package/dist/fondue-components21.js +64 -41
  22. package/dist/fondue-components21.js.map +1 -1
  23. package/dist/fondue-components22.js +43 -32
  24. package/dist/fondue-components22.js.map +1 -1
  25. package/dist/fondue-components23.js +32 -5
  26. package/dist/fondue-components23.js.map +1 -1
  27. package/dist/fondue-components24.js +5 -12
  28. package/dist/fondue-components24.js.map +1 -1
  29. package/dist/fondue-components25.js +10 -153
  30. package/dist/fondue-components25.js.map +1 -1
  31. package/dist/fondue-components26.js +59 -22
  32. package/dist/fondue-components26.js.map +1 -1
  33. package/dist/fondue-components27.js +17 -17
  34. package/dist/fondue-components27.js.map +1 -1
  35. package/dist/fondue-components28.js +112 -15
  36. package/dist/fondue-components28.js.map +1 -1
  37. package/dist/fondue-components29.js +19 -30
  38. package/dist/fondue-components29.js.map +1 -1
  39. package/dist/fondue-components3.js +2 -2
  40. package/dist/fondue-components30.js +32 -28
  41. package/dist/fondue-components30.js.map +1 -1
  42. package/dist/fondue-components31.js +23 -125
  43. package/dist/fondue-components31.js.map +1 -1
  44. package/dist/fondue-components32.js +129 -20
  45. package/dist/fondue-components32.js.map +1 -1
  46. package/dist/fondue-components33.js +21 -45
  47. package/dist/fondue-components33.js.map +1 -1
  48. package/dist/fondue-components34.js +45 -15
  49. package/dist/fondue-components34.js.map +1 -1
  50. package/dist/fondue-components35.js +28 -60
  51. package/dist/fondue-components35.js.map +1 -1
  52. package/dist/fondue-components36.js +15 -15
  53. package/dist/fondue-components36.js.map +1 -1
  54. package/dist/fondue-components37.js +60 -19
  55. package/dist/fondue-components37.js.map +1 -1
  56. package/dist/fondue-components38.js +15 -17
  57. package/dist/fondue-components38.js.map +1 -1
  58. package/dist/fondue-components39.js +16 -4
  59. package/dist/fondue-components39.js.map +1 -1
  60. package/dist/fondue-components4.js +4 -4
  61. package/dist/fondue-components40.js +3 -11
  62. package/dist/fondue-components40.js.map +1 -1
  63. package/dist/fondue-components41.js +11 -3
  64. package/dist/fondue-components41.js.map +1 -1
  65. package/dist/fondue-components42.js +5 -35
  66. package/dist/fondue-components42.js.map +1 -1
  67. package/dist/fondue-components43.js +35 -5
  68. package/dist/fondue-components43.js.map +1 -1
  69. package/dist/fondue-components44.js +12 -24
  70. package/dist/fondue-components44.js.map +1 -1
  71. package/dist/fondue-components45.js +4 -16
  72. package/dist/fondue-components45.js.map +1 -1
  73. package/dist/fondue-components46.js +24 -10
  74. package/dist/fondue-components46.js.map +1 -1
  75. package/dist/fondue-components47.js +14 -10
  76. package/dist/fondue-components47.js.map +1 -1
  77. package/dist/fondue-components5.js +2 -2
  78. package/dist/fondue-components50.js +2 -2
  79. package/dist/fondue-components53.js +1 -1
  80. package/dist/fondue-components54.js +9 -16
  81. package/dist/fondue-components54.js.map +1 -1
  82. package/dist/fondue-components55.js +12 -6
  83. package/dist/fondue-components55.js.map +1 -1
  84. package/dist/fondue-components56.js +18 -2
  85. package/dist/fondue-components56.js.map +1 -1
  86. package/dist/fondue-components57.js +4 -8
  87. package/dist/fondue-components57.js.map +1 -1
  88. package/dist/fondue-components58.js +2 -39
  89. package/dist/fondue-components58.js.map +1 -1
  90. package/dist/fondue-components59.js +14 -0
  91. package/dist/fondue-components59.js.map +1 -0
  92. package/dist/fondue-components6.js +5 -5
  93. package/dist/fondue-components60.js +42 -0
  94. package/dist/fondue-components60.js.map +1 -0
  95. package/dist/fondue-components7.js +78 -68
  96. package/dist/fondue-components7.js.map +1 -1
  97. package/dist/fondue-components8.js +2 -2
  98. package/dist/fondue-components9.js +3 -3
  99. package/dist/index.d.ts +27 -3
  100. package/dist/style.css +1 -1
  101. package/package.json +16 -15
@@ -1,8 +1,38 @@
1
- const o = "_root_yrjuz_5", t = {
2
- root: o
3
- };
1
+ import { sv as t } from "./fondue-components25.js";
2
+ const i = t({
3
+ base: "tw-relative tw-w-full tw-overflow-hidden",
4
+ variants: {
5
+ rounded: {
6
+ true: "tw-rounded"
7
+ },
8
+ size: {
9
+ small: "tw-h-1",
10
+ medium: "tw-h-2",
11
+ large: "tw-h-3",
12
+ "x-large": "tw-h-4"
13
+ },
14
+ variant: {
15
+ default: "tw-bg-box-selected",
16
+ positive: "tw-bg-box-positive",
17
+ negative: "tw-bg-box-negative"
18
+ }
19
+ }
20
+ }), a = t({
21
+ base: "tw-h-full tw-w-full",
22
+ variants: {
23
+ variant: {
24
+ default: "tw-bg-text-interactive",
25
+ positive: "tw-bg-text-positive",
26
+ negative: "tw-bg-text-negative"
27
+ },
28
+ indeterminateState: {
29
+ true: "tw-animate-loading-bar-infinite tw-origin-left-right",
30
+ false: "tw-transition-all tw-origin-left tw-scale-x-[--loading-bar-proportion]"
31
+ }
32
+ }
33
+ });
4
34
  export {
5
- t as default,
6
- o as root
35
+ i as loadingBarContainerStyles,
36
+ a as loadingBarStyles
7
37
  };
8
38
  //# sourceMappingURL=fondue-components43.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components43.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"fondue-components43.js","sources":["../src/components/LoadingBar/styles/loadingBarStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const loadingBarContainerStyles = sv({\n base: 'tw-relative tw-w-full tw-overflow-hidden',\n variants: {\n rounded: {\n true: 'tw-rounded',\n },\n size: {\n small: 'tw-h-1',\n medium: 'tw-h-2',\n large: 'tw-h-3',\n 'x-large': 'tw-h-4',\n },\n variant: {\n default: 'tw-bg-box-selected',\n positive: 'tw-bg-box-positive',\n negative: 'tw-bg-box-negative',\n },\n },\n});\n\nexport const loadingBarStyles = sv({\n base: 'tw-h-full tw-w-full',\n variants: {\n variant: {\n default: 'tw-bg-text-interactive',\n positive: 'tw-bg-text-positive',\n negative: 'tw-bg-text-negative',\n },\n indeterminateState: {\n true: 'tw-animate-loading-bar-infinite tw-origin-left-right',\n false: 'tw-transition-all tw-origin-left tw-scale-x-[--loading-bar-proportion]',\n },\n },\n});\n"],"names":["loadingBarContainerStyles","sv","loadingBarStyles"],"mappings":";AAIO,MAAMA,IAA4BC,EAAG;AAAA,EACxC,MAAM;AAAA,EACN,UAAU;AAAA,IACN,SAAS;AAAA,MACL,MAAM;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACF,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,WAAW;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IACd;AAAA,EACJ;AACJ,CAAC,GAEYC,IAAmBD,EAAG;AAAA,EAC/B,MAAM;AAAA,EACN,UAAU;AAAA,IACN,SAAS;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IACd;AAAA,IACA,oBAAoB;AAAA,MAChB,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,EACJ;AACJ,CAAC;"}
@@ -1,28 +1,16 @@
1
- import { useMemo as f, useCallback as d, useState as v, useRef as S, useEffect as m } from "react";
2
- const U = ({
3
- prop: e,
4
- defaultProp: n,
5
- onChange: s = () => {
6
- }
7
- }) => {
8
- const [o, c] = b({ defaultProp: n, onChange: s }), t = e !== void 0, i = t ? e : o, r = f(() => s, [s]), a = d(
9
- (l) => {
10
- if (t) {
11
- const u = typeof l == "function" ? l(e) : l;
12
- u !== e && r(u);
13
- } else
14
- c(l);
15
- },
16
- [t, e, c, r]
17
- );
18
- return [i, a];
19
- }, b = ({ defaultProp: e, onChange: n }) => {
20
- const s = v(e), [o] = s, c = S(o), t = f(() => n, [n]);
21
- return m(() => {
22
- c.current !== o && (t == null || t(o), c.current = o);
23
- }, [o, c, t]), s;
1
+ const o = "_root_xlbio_3", r = "_viewport_xlbio_10", t = "_scrollbar_xlbio_16", _ = "_thumb_xlbio_41", l = "_corner_xlbio_60", c = {
2
+ root: o,
3
+ viewport: r,
4
+ scrollbar: t,
5
+ thumb: _,
6
+ corner: l
24
7
  };
25
8
  export {
26
- U as useControllableState
9
+ l as corner,
10
+ c as default,
11
+ o as root,
12
+ t as scrollbar,
13
+ _ as thumb,
14
+ r as viewport
27
15
  };
28
16
  //# sourceMappingURL=fondue-components44.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components44.js","sources":["../src/hooks/useControllableState.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Dispatch, type SetStateAction, useCallback, useMemo, useState, useRef, useEffect } from 'react';\n\n// Radix UI handy hook for handling controlled and uncontrolled state\n// Source: https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx\n\ntype UseControllableStateParams<TValue> = {\n prop?: TValue;\n defaultProp?: TValue;\n onChange?: (state: TValue) => void;\n};\n\ntype SetStateFn<T> = (prevState?: T) => T;\n\nexport const useControllableState = <TValue>({\n prop,\n defaultProp,\n onChange = () => {},\n}: UseControllableStateParams<TValue>) => {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useMemo(() => onChange, [onChange]);\n\n const setValue: Dispatch<SetStateAction<TValue | undefined>> = useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue as SetStateFn<TValue>;\n const value = typeof nextValue === 'function' ? setter(prop) : nextValue;\n if (value !== prop) {\n handleChange(value as TValue);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange],\n );\n\n return [value, setValue] as const;\n};\n\nconst useUncontrolledState = <TValue>({ defaultProp, onChange }: Omit<UseControllableStateParams<TValue>, 'prop'>) => {\n const uncontrolledState = useState<TValue | undefined>(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = useRef(value);\n const handleChange = useMemo(() => onChange, [onChange]);\n\n useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange?.(value as TValue);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n\n return uncontrolledState;\n};\n"],"names":["useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","value","handleChange","useMemo","setValue","useCallback","nextValue","uncontrolledState","useState","prevValueRef","useRef","useEffect"],"mappings":";AAeO,MAAMA,IAAuB,CAAS;AAAA,EACzC,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAC;AACtB,MAA0C;AAChC,QAAA,CAACC,GAAkBC,CAAmB,IAAIC,EAAqB,EAAE,aAAAJ,GAAa,UAAAC,GAAU,GACxFI,IAAeN,MAAS,QACxBO,IAAQD,IAAeN,IAAOG,GAC9BK,IAAeC,EAAQ,MAAMP,GAAU,CAACA,CAAQ,CAAC,GAEjDQ,IAAyDC;AAAA,IAC3D,CAACC,MAAc;AACX,UAAIN,GAAc;AAEd,cAAMC,IAAQ,OAAOK,KAAc,aADpBA,EACwCZ,CAAI,IAAIY;AAC/D,QAAIL,MAAUP,KACVQ,EAAaD,CAAe;AAAA,MAChC;AAEA,QAAAH,EAAoBQ,CAAS;AAAA,IAErC;AAAA,IACA,CAACN,GAAcN,GAAMI,GAAqBI,CAAY;AAAA,EAAA;AAGnD,SAAA,CAACD,GAAOG,CAAQ;AAC3B,GAEML,IAAuB,CAAS,EAAE,aAAAJ,GAAa,UAAAC,QAAiE;AAC5G,QAAAW,IAAoBC,EAA6Bb,CAAW,GAC5D,CAACM,CAAK,IAAIM,GACVE,IAAeC,EAAOT,CAAK,GAC3BC,IAAeC,EAAQ,MAAMP,GAAU,CAACA,CAAQ,CAAC;AAEvD,SAAAe,EAAU,MAAM;AACR,IAAAF,EAAa,YAAYR,MACzBC,KAAA,QAAAA,EAAeD,IACfQ,EAAa,UAAUR;AAAA,EAE5B,GAAA,CAACA,GAAOQ,GAAcP,CAAY,CAAC,GAE/BK;AACX;"}
1
+ {"version":3,"file":"fondue-components44.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,20 +1,8 @@
1
- const t = "_root_1b6uw_5", e = "_item_1b6uw_25", a = "_itemLabel_1b6uw_45", i = "_itemLabelActive_1b6uw_64", o = "_itemLabelInactive_1b6uw_87", _ = "_activeIndicator_1b6uw_111", c = "_separator_1b6uw_202", b = {
2
- root: t,
3
- item: e,
4
- itemLabel: a,
5
- itemLabelActive: i,
6
- itemLabelInactive: o,
7
- activeIndicator: _,
8
- separator: c
1
+ const o = "_root_yrjuz_5", t = {
2
+ root: o
9
3
  };
10
4
  export {
11
- _ as activeIndicator,
12
- b as default,
13
- e as item,
14
- a as itemLabel,
15
- i as itemLabelActive,
16
- o as itemLabelInactive,
17
- t as root,
18
- c as separator
5
+ t as default,
6
+ o as root
19
7
  };
20
8
  //# sourceMappingURL=fondue-components45.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components45.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components45.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,14 +1,28 @@
1
- const t = "_root_cpzhx_5", c = "_thumb_cpzhx_16", o = "_track_cpzhx_20", _ = "_range_cpzhx_27", r = {
2
- root: t,
3
- thumb: c,
4
- track: o,
5
- range: _
1
+ import { useMemo as f, useCallback as d, useState as v, useRef as S, useEffect as m } from "react";
2
+ const U = ({
3
+ prop: e,
4
+ defaultProp: n,
5
+ onChange: s = () => {
6
+ }
7
+ }) => {
8
+ const [o, c] = b({ defaultProp: n, onChange: s }), t = e !== void 0, i = t ? e : o, r = f(() => s, [s]), a = d(
9
+ (l) => {
10
+ if (t) {
11
+ const u = typeof l == "function" ? l(e) : l;
12
+ u !== e && r(u);
13
+ } else
14
+ c(l);
15
+ },
16
+ [t, e, c, r]
17
+ );
18
+ return [i, a];
19
+ }, b = ({ defaultProp: e, onChange: n }) => {
20
+ const s = v(e), [o] = s, c = S(o), t = f(() => n, [n]);
21
+ return m(() => {
22
+ c.current !== o && (t == null || t(o), c.current = o);
23
+ }, [o, c, t]), s;
6
24
  };
7
25
  export {
8
- r as default,
9
- _ as range,
10
- t as root,
11
- c as thumb,
12
- o as track
26
+ U as useControllableState
13
27
  };
14
28
  //# sourceMappingURL=fondue-components46.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components46.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"fondue-components46.js","sources":["../src/hooks/useControllableState.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Dispatch, type SetStateAction, useCallback, useMemo, useState, useRef, useEffect } from 'react';\n\n// Radix UI handy hook for handling controlled and uncontrolled state\n// Source: https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx\n\ntype UseControllableStateParams<TValue> = {\n prop?: TValue;\n defaultProp?: TValue;\n onChange?: (state: TValue) => void;\n};\n\ntype SetStateFn<T> = (prevState?: T) => T;\n\nexport const useControllableState = <TValue>({\n prop,\n defaultProp,\n onChange = () => {},\n}: UseControllableStateParams<TValue>) => {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useMemo(() => onChange, [onChange]);\n\n const setValue: Dispatch<SetStateAction<TValue | undefined>> = useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue as SetStateFn<TValue>;\n const value = typeof nextValue === 'function' ? setter(prop) : nextValue;\n if (value !== prop) {\n handleChange(value as TValue);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange],\n );\n\n return [value, setValue] as const;\n};\n\nconst useUncontrolledState = <TValue>({ defaultProp, onChange }: Omit<UseControllableStateParams<TValue>, 'prop'>) => {\n const uncontrolledState = useState<TValue | undefined>(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = useRef(value);\n const handleChange = useMemo(() => onChange, [onChange]);\n\n useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange?.(value as TValue);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n\n return uncontrolledState;\n};\n"],"names":["useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","value","handleChange","useMemo","setValue","useCallback","nextValue","uncontrolledState","useState","prevValueRef","useRef","useEffect"],"mappings":";AAeO,MAAMA,IAAuB,CAAS;AAAA,EACzC,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAC;AACtB,MAA0C;AAChC,QAAA,CAACC,GAAkBC,CAAmB,IAAIC,EAAqB,EAAE,aAAAJ,GAAa,UAAAC,GAAU,GACxFI,IAAeN,MAAS,QACxBO,IAAQD,IAAeN,IAAOG,GAC9BK,IAAeC,EAAQ,MAAMP,GAAU,CAACA,CAAQ,CAAC,GAEjDQ,IAAyDC;AAAA,IAC3D,CAACC,MAAc;AACX,UAAIN,GAAc;AAEd,cAAMC,IAAQ,OAAOK,KAAc,aADpBA,EACwCZ,CAAI,IAAIY;AAC/D,QAAIL,MAAUP,KACVQ,EAAaD,CAAe;AAAA,MAChC;AAEA,QAAAH,EAAoBQ,CAAS;AAAA,IAErC;AAAA,IACA,CAACN,GAAcN,GAAMI,GAAqBI,CAAY;AAAA,EAAA;AAGnD,SAAA,CAACD,GAAOG,CAAQ;AAC3B,GAEML,IAAuB,CAAS,EAAE,aAAAJ,GAAa,UAAAC,QAAiE;AAC5G,QAAAW,IAAoBC,EAA6Bb,CAAW,GAC5D,CAACM,CAAK,IAAIM,GACVE,IAAeC,EAAOT,CAAK,GAC3BC,IAAeC,EAAQ,MAAMP,GAAU,CAACA,CAAQ,CAAC;AAEvD,SAAAe,EAAU,MAAM;AACR,IAAAF,EAAa,YAAYR,MACzBC,KAAA,QAAAA,EAAeD,IACfQ,EAAa,UAAUR;AAAA,EAE5B,GAAA,CAACA,GAAOQ,GAAcP,CAAY,CAAC,GAE/BK;AACX;"}
@@ -1,16 +1,20 @@
1
- const t = "_root_wthne_5", _ = "_small_wthne_28", e = "_medium_wthne_32", o = "_large_wthne_36", m = "_thumb_wthne_50", s = {
1
+ const t = "_root_1b6uw_5", e = "_item_1b6uw_25", a = "_itemLabel_1b6uw_45", i = "_itemLabelActive_1b6uw_64", o = "_itemLabelInactive_1b6uw_87", _ = "_activeIndicator_1b6uw_111", c = "_separator_1b6uw_202", b = {
2
2
  root: t,
3
- small: _,
4
- medium: e,
5
- large: o,
6
- thumb: m
3
+ item: e,
4
+ itemLabel: a,
5
+ itemLabelActive: i,
6
+ itemLabelInactive: o,
7
+ activeIndicator: _,
8
+ separator: c
7
9
  };
8
10
  export {
9
- s as default,
10
- o as large,
11
- e as medium,
11
+ _ as activeIndicator,
12
+ b as default,
13
+ e as item,
14
+ a as itemLabel,
15
+ i as itemLabelActive,
16
+ o as itemLabelInactive,
12
17
  t as root,
13
- _ as small,
14
- m as thumb
18
+ c as separator
15
19
  };
16
20
  //# sourceMappingURL=fondue-components47.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components47.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"fondue-components47.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -2,8 +2,8 @@ import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
2
  import { IconMinus as m, IconCheckMark as h } from "@frontify/fondue-icons";
3
3
  import * as o from "@radix-ui/react-checkbox";
4
4
  import { forwardRef as k } from "react";
5
- import { cn as p } from "./fondue-components24.js";
6
- import { checkboxStyles as l, checkboxIndicatorStyles as w } from "./fondue-components28.js";
5
+ import { cn as p } from "./fondue-components25.js";
6
+ import { checkboxStyles as l, checkboxIndicatorStyles as w } from "./fondue-components29.js";
7
7
  const f = ({
8
8
  className: a,
9
9
  value: c,
@@ -2,9 +2,9 @@ import { jsx as o } from "react/jsx-runtime";
2
2
  import * as a from "@radix-ui/react-popover";
3
3
  import { Slot as v } from "@radix-ui/react-slot";
4
4
  import { useRef as h, isValidElement as O } from "react";
5
- import { usePreventDropdownOverflow as S } from "./fondue-components36.js";
5
+ import { usePreventDropdownOverflow as S } from "./fondue-components38.js";
6
6
  import r from "./fondue-components52.js";
7
- import { recursiveMap as g, getSelectOptionValue as C } from "./fondue-components58.js";
7
+ import { recursiveMap as g, getSelectOptionValue as C } from "./fondue-components60.js";
8
8
  const M = ({ highlightedIndex: i, getMenuProps: l, getItemProps: m, children: p, filterText: u }) => {
9
9
  const n = h(null), { setMaxHeight: f } = S(n), c = (e) => {
10
10
  e.preventDefault(), f();
@@ -3,7 +3,7 @@ import { IconCross as x } from "@frontify/fondue-icons";
3
3
  import { useState as B, useMemo as i, Children as f, isValidElement as a, cloneElement as E, useCallback as v } from "react";
4
4
  import { ForwardedRefSelectItem as F } from "./fondue-components49.js";
5
5
  import { ForwardedRefSelectSlot as c } from "./fondue-components51.js";
6
- import { getSelectOptionValue as I } from "./fondue-components58.js";
6
+ import { getSelectOptionValue as I } from "./fondue-components60.js";
7
7
  const S = (r) => {
8
8
  const t = [];
9
9
  return f.forEach(r, (o) => {
@@ -1,21 +1,14 @@
1
- const s = "_root_zfs0q_5", o = "_input_zfs0q_52", t = "_slot_zfs0q_71", _ = "_iconSuccess_zfs0q_121", n = "_iconError_zfs0q_129", c = "_loadingStatus_zfs0q_137", i = "_spin_zfs0q_1", r = {
2
- root: s,
3
- input: o,
4
- slot: t,
5
- iconSuccess: _,
6
- iconError: n,
7
- loadingStatus: c,
8
- spin: i,
9
- "tw-dark": "_tw-dark_zfs0q_169"
1
+ const t = "_root_cpzhx_5", c = "_thumb_cpzhx_16", o = "_track_cpzhx_20", _ = "_range_cpzhx_27", r = {
2
+ root: t,
3
+ thumb: c,
4
+ track: o,
5
+ range: _
10
6
  };
11
7
  export {
12
8
  r as default,
13
- n as iconError,
14
- _ as iconSuccess,
15
- o as input,
16
- c as loadingStatus,
17
- s as root,
18
- t as slot,
19
- i as spin
9
+ _ as range,
10
+ t as root,
11
+ c as thumb,
12
+ o as track
20
13
  };
21
14
  //# sourceMappingURL=fondue-components54.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components54.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components54.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,10 +1,16 @@
1
- const o = "_root_3kc21_4", r = "_arrow_3kc21_20", t = {
2
- root: o,
3
- arrow: r
1
+ const t = "_root_wthne_5", _ = "_small_wthne_28", e = "_medium_wthne_32", o = "_large_wthne_36", m = "_thumb_wthne_50", s = {
2
+ root: t,
3
+ small: _,
4
+ medium: e,
5
+ large: o,
6
+ thumb: m
4
7
  };
5
8
  export {
6
- r as arrow,
7
- t as default,
8
- o as root
9
+ s as default,
10
+ o as large,
11
+ e as medium,
12
+ t as root,
13
+ _ as small,
14
+ m as thumb
9
15
  };
10
16
  //# sourceMappingURL=fondue-components55.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components55.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"fondue-components55.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,5 +1,21 @@
1
- const t = "focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue";
1
+ const s = "_root_zfs0q_5", o = "_input_zfs0q_52", t = "_slot_zfs0q_71", _ = "_iconSuccess_zfs0q_121", n = "_iconError_zfs0q_129", c = "_loadingStatus_zfs0q_137", i = "_spin_zfs0q_1", r = {
2
+ root: s,
3
+ input: o,
4
+ slot: t,
5
+ iconSuccess: _,
6
+ iconError: n,
7
+ loadingStatus: c,
8
+ spin: i,
9
+ "tw-dark": "_tw-dark_zfs0q_169"
10
+ };
2
11
  export {
3
- t as FOCUS_OUTLINE
12
+ r as default,
13
+ n as iconError,
14
+ _ as iconSuccess,
15
+ o as input,
16
+ c as loadingStatus,
17
+ s as root,
18
+ t as slot,
19
+ i as spin
4
20
  };
5
21
  //# sourceMappingURL=fondue-components56.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components56.js","sources":["../src/utilities/focusStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const FOCUS_OUTLINE =\n 'focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue'; // second declaration of tw-outline-blue is to assure that in firefox the outline isn't overriden by a global definition of :-moz-focusring which is coming from tailwinds normalization styling\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
1
+ {"version":3,"file":"fondue-components56.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,14 +1,10 @@
1
- const o = "_root_6hy5w_5", c = "_colorName_6hy5w_53", t = "_colorIndicator_6hy5w_57", r = "_caret_6hy5w_63", _ = {
1
+ const o = "_root_m0ok9_4", r = "_arrow_m0ok9_21", t = {
2
2
  root: o,
3
- colorName: c,
4
- colorIndicator: t,
5
- caret: r
3
+ arrow: r
6
4
  };
7
5
  export {
8
- r as caret,
9
- t as colorIndicator,
10
- c as colorName,
11
- _ as default,
6
+ r as arrow,
7
+ t as default,
12
8
  o as root
13
9
  };
14
10
  //# sourceMappingURL=fondue-components57.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components57.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"fondue-components57.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,42 +1,5 @@
1
- import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
- import { ForwardedRefSelectItem as E } from "./fondue-components49.js";
3
- const g = ({
4
- children: r,
5
- value: o,
6
- label: s
7
- }) => r && typeof r == "string" ? {
8
- value: o || r,
9
- label: s || r
10
- } : {
11
- value: o || "",
12
- label: s || o || ""
13
- }, w = (r, o) => u(r) && r.type === o, y = (r, o, s, p = 0) => {
14
- const n = [];
15
- let t = 0;
16
- return a.forEach(r, (e) => {
17
- if (w(e, E) && u(e))
18
- g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(o(e, p + t)), t++);
19
- else if (u(e) && (e != null && e.props.children)) {
20
- const { parsedChildren: m, subElementCount: C } = y(
21
- e.props.children,
22
- o,
23
- "",
24
- p + t
25
- );
26
- e = f(e, {
27
- children: m,
28
- key: `group-${p + t}`
29
- }), n.push(e), t += C;
30
- } else
31
- n.push(e);
32
- }), {
33
- parsedChildren: n,
34
- subElementCount: t
35
- };
36
- };
1
+ const t = "focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue";
37
2
  export {
38
- g as getSelectOptionValue,
39
- w as isReactLeaf,
40
- y as recursiveMap
3
+ t as FOCUS_OUTLINE
41
4
  };
42
5
  //# sourceMappingURL=fondue-components58.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components58.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 './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 }} 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} => {\n if (children && typeof children === 'string') {\n return {\n value: value ? value : children,\n label: label ? label : children,\n };\n }\n\n return {\n value: value || '',\n label: label ? label : value || '',\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,MAIQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAAA,IAIxB;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AAAA,GAmB3BE,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAAc;AACT,SAAAC,EAAA,QAAQb,GAAU,CAACI,MAAU;AAClC,QAAID,EAAYC,GAAOU,CAAsB,KAAKR,EAAgCF,CAAK;AACnF,MACIL,EAAqBK,EAAM,KAAK,EAC3B,MAAM,cACN,UAASK,KAAA,gBAAAA,EAAY,kBAAiB,EAAE,MAE7CE,EAAkB,KAAKH,EAASJ,GAAOM,IAAYE,CAAW,CAAC,GAC/DA;AAAA,aAEGN,EAAwCF,CAAK,MAAKA,KAAA,QAAAA,EAAO,MAAM,WAAU;AAC1E,YAAA,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAAA;AAEhB,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GACbQ,KAAAI;AAAA,IAAA;AAEf,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAChC,CACH,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EAAA;AAEzB;"}
1
+ {"version":3,"file":"fondue-components58.js","sources":["../src/utilities/focusStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const FOCUS_OUTLINE =\n 'focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue'; // second declaration of tw-outline-blue is to assure that in firefox the outline isn't overriden by a global definition of :-moz-focusring which is coming from tailwinds normalization styling\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
@@ -0,0 +1,14 @@
1
+ const o = "_root_6hy5w_5", c = "_colorName_6hy5w_53", t = "_colorIndicator_6hy5w_57", r = "_caret_6hy5w_63", _ = {
2
+ root: o,
3
+ colorName: c,
4
+ colorIndicator: t,
5
+ caret: r
6
+ };
7
+ export {
8
+ r as caret,
9
+ t as colorIndicator,
10
+ c as colorName,
11
+ _ as default,
12
+ o as root
13
+ };
14
+ //# sourceMappingURL=fondue-components59.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components59.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,11 +1,11 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { Slot as u } from "@radix-ui/react-slot";
3
3
  import { forwardRef as k, useState as R, Children as P } from "react";
4
- import { ForwardedRefColorGradientInput as F } from "./fondue-components29.js";
5
- import { ForwardedRefColorPickerInput as y } from "./fondue-components30.js";
6
- import { ForwardedRefColorValueInput as N } from "./fondue-components31.js";
7
- import I from "./fondue-components32.js";
8
- import { getColorWithName as d, DEFAULT_COLOR as w, DEFAULT_FORMAT as h } from "./fondue-components33.js";
4
+ import { ForwardedRefColorGradientInput as F } from "./fondue-components30.js";
5
+ import { ForwardedRefColorPickerInput as y } from "./fondue-components31.js";
6
+ import { ForwardedRefColorValueInput as N } from "./fondue-components32.js";
7
+ import I from "./fondue-components33.js";
8
+ import { getColorWithName as d, DEFAULT_COLOR as w, DEFAULT_FORMAT as h } from "./fondue-components34.js";
9
9
  const m = ({
10
10
  children: t,
11
11
  currentColor: o = w,
@@ -0,0 +1,42 @@
1
+ import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
+ import { ForwardedRefSelectItem as E } from "./fondue-components49.js";
3
+ const g = ({
4
+ children: r,
5
+ value: o,
6
+ label: s
7
+ }) => r && typeof r == "string" ? {
8
+ value: o || r,
9
+ label: s || r
10
+ } : {
11
+ value: o || "",
12
+ label: s || o || ""
13
+ }, w = (r, o) => u(r) && r.type === o, y = (r, o, s, p = 0) => {
14
+ const n = [];
15
+ let t = 0;
16
+ return a.forEach(r, (e) => {
17
+ if (w(e, E) && u(e))
18
+ g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(o(e, p + t)), t++);
19
+ else if (u(e) && (e != null && e.props.children)) {
20
+ const { parsedChildren: m, subElementCount: C } = y(
21
+ e.props.children,
22
+ o,
23
+ "",
24
+ p + t
25
+ );
26
+ e = f(e, {
27
+ children: m,
28
+ key: `group-${p + t}`
29
+ }), n.push(e), t += C;
30
+ } else
31
+ n.push(e);
32
+ }), {
33
+ parsedChildren: n,
34
+ subElementCount: t
35
+ };
36
+ };
37
+ export {
38
+ g as getSelectOptionValue,
39
+ w as isReactLeaf,
40
+ y as recursiveMap
41
+ };
42
+ //# sourceMappingURL=fondue-components60.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components60.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 './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 }} 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} => {\n if (children && typeof children === 'string') {\n return {\n value: value ? value : children,\n label: label ? label : children,\n };\n }\n\n return {\n value: value || '',\n label: label ? label : value || '',\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,MAIQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAAA,IAIxB;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AAAA,GAmB3BE,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAAc;AACT,SAAAC,EAAA,QAAQb,GAAU,CAACI,MAAU;AAClC,QAAID,EAAYC,GAAOU,CAAsB,KAAKR,EAAgCF,CAAK;AACnF,MACIL,EAAqBK,EAAM,KAAK,EAC3B,MAAM,cACN,UAASK,KAAA,gBAAAA,EAAY,kBAAiB,EAAE,MAE7CE,EAAkB,KAAKH,EAASJ,GAAOM,IAAYE,CAAW,CAAC,GAC/DA;AAAA,aAEGN,EAAwCF,CAAK,MAAKA,KAAA,QAAAA,EAAO,MAAM,WAAU;AAC1E,YAAA,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAAA;AAEhB,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GACbQ,KAAAI;AAAA,IAAA;AAEf,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAChC,CACH,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EAAA;AAEzB;"}