@frontify/fondue-components 12.0.0 → 13.0.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 (142) hide show
  1. package/dist/fondue-components.js +38 -32
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +2 -2
  4. package/dist/fondue-components11.js +3 -3
  5. package/dist/fondue-components12.js +2 -2
  6. package/dist/fondue-components13.js +47 -24
  7. package/dist/fondue-components13.js.map +1 -1
  8. package/dist/fondue-components14.js +24 -39
  9. package/dist/fondue-components14.js.map +1 -1
  10. package/dist/fondue-components15.js +37 -64
  11. package/dist/fondue-components15.js.map +1 -1
  12. package/dist/fondue-components16.js +16 -31
  13. package/dist/fondue-components16.js.map +1 -1
  14. package/dist/fondue-components17.js +66 -47
  15. package/dist/fondue-components17.js.map +1 -1
  16. package/dist/fondue-components18.js +36 -132
  17. package/dist/fondue-components18.js.map +1 -1
  18. package/dist/fondue-components19.js +42 -50
  19. package/dist/fondue-components19.js.map +1 -1
  20. package/dist/fondue-components20.js +132 -29
  21. package/dist/fondue-components20.js.map +1 -1
  22. package/dist/fondue-components21.js +51 -143
  23. package/dist/fondue-components21.js.map +1 -1
  24. package/dist/fondue-components22.js +28 -118
  25. package/dist/fondue-components22.js.map +1 -1
  26. package/dist/fondue-components23.js +148 -60
  27. package/dist/fondue-components23.js.map +1 -1
  28. package/dist/fondue-components24.js +112 -49
  29. package/dist/fondue-components24.js.map +1 -1
  30. package/dist/fondue-components25.js +33 -7
  31. package/dist/fondue-components25.js.map +1 -1
  32. package/dist/fondue-components26.js +66 -32
  33. package/dist/fondue-components26.js.map +1 -1
  34. package/dist/fondue-components27.js +7 -5
  35. package/dist/fondue-components27.js.map +1 -1
  36. package/dist/fondue-components28.js +55 -11
  37. package/dist/fondue-components28.js.map +1 -1
  38. package/dist/fondue-components29.js +32 -155
  39. package/dist/fondue-components29.js.map +1 -1
  40. package/dist/fondue-components3.js +2 -2
  41. package/dist/fondue-components30.js +5 -118
  42. package/dist/fondue-components30.js.map +1 -1
  43. package/dist/fondue-components31.js +10 -116
  44. package/dist/fondue-components31.js.map +1 -1
  45. package/dist/fondue-components32.js +147 -13
  46. package/dist/fondue-components32.js.map +1 -1
  47. package/dist/fondue-components33.js +116 -30
  48. package/dist/fondue-components33.js.map +1 -1
  49. package/dist/fondue-components34.js +118 -37
  50. package/dist/fondue-components34.js.map +1 -1
  51. package/dist/fondue-components35.js +20 -129
  52. package/dist/fondue-components35.js.map +1 -1
  53. package/dist/fondue-components36.js +32 -21
  54. package/dist/fondue-components36.js.map +1 -1
  55. package/dist/fondue-components37.js +37 -45
  56. package/dist/fondue-components37.js.map +1 -1
  57. package/dist/fondue-components38.js +130 -13
  58. package/dist/fondue-components38.js.map +1 -1
  59. package/dist/fondue-components39.js +20 -14
  60. package/dist/fondue-components39.js.map +1 -1
  61. package/dist/fondue-components4.js +4 -4
  62. package/dist/fondue-components40.js +45 -60
  63. package/dist/fondue-components40.js.map +1 -1
  64. package/dist/fondue-components41.js +13 -18
  65. package/dist/fondue-components41.js.map +1 -1
  66. package/dist/fondue-components42.js +12 -14
  67. package/dist/fondue-components42.js.map +1 -1
  68. package/dist/fondue-components43.js +60 -5
  69. package/dist/fondue-components43.js.map +1 -1
  70. package/dist/fondue-components44.js +18 -15
  71. package/dist/fondue-components44.js.map +1 -1
  72. package/dist/fondue-components45.js +18 -4
  73. package/dist/fondue-components45.js.map +1 -1
  74. package/dist/fondue-components46.js +5 -35
  75. package/dist/fondue-components46.js.map +1 -1
  76. package/dist/fondue-components47.js +13 -11
  77. package/dist/fondue-components47.js.map +1 -1
  78. package/dist/fondue-components48.js +1 -1
  79. package/dist/fondue-components49.js +18 -24
  80. package/dist/fondue-components49.js.map +1 -1
  81. package/dist/fondue-components5.js +2 -2
  82. package/dist/fondue-components50.js +35 -17
  83. package/dist/fondue-components50.js.map +1 -1
  84. package/dist/fondue-components51.js +6 -141
  85. package/dist/fondue-components51.js.map +1 -1
  86. package/dist/fondue-components52.js +13 -16
  87. package/dist/fondue-components52.js.map +1 -1
  88. package/dist/fondue-components53.js +4 -72
  89. package/dist/fondue-components53.js.map +1 -1
  90. package/dist/fondue-components54.js +25 -8
  91. package/dist/fondue-components54.js.map +1 -1
  92. package/dist/fondue-components55.js +16 -32
  93. package/dist/fondue-components55.js.map +1 -1
  94. package/dist/fondue-components56.js +140 -47
  95. package/dist/fondue-components56.js.map +1 -1
  96. package/dist/fondue-components57.js +16 -11
  97. package/dist/fondue-components57.js.map +1 -1
  98. package/dist/fondue-components58.js +72 -12
  99. package/dist/fondue-components58.js.map +1 -1
  100. package/dist/fondue-components59.js +8 -8
  101. package/dist/fondue-components59.js.map +1 -1
  102. package/dist/fondue-components6.js +5 -5
  103. package/dist/fondue-components60.js +32 -12
  104. package/dist/fondue-components60.js.map +1 -1
  105. package/dist/fondue-components61.js +48 -20
  106. package/dist/fondue-components61.js.map +1 -1
  107. package/dist/fondue-components62.js +11 -15
  108. package/dist/fondue-components62.js.map +1 -1
  109. package/dist/fondue-components63.js +12 -52
  110. package/dist/fondue-components63.js.map +1 -1
  111. package/dist/fondue-components64.js +7 -14
  112. package/dist/fondue-components64.js.map +1 -1
  113. package/dist/fondue-components65.js +12 -17
  114. package/dist/fondue-components65.js.map +1 -1
  115. package/dist/fondue-components66.js +20 -6
  116. package/dist/fondue-components66.js.map +1 -1
  117. package/dist/fondue-components67.js +15 -7
  118. package/dist/fondue-components67.js.map +1 -1
  119. package/dist/fondue-components68.js +53 -2
  120. package/dist/fondue-components68.js.map +1 -1
  121. package/dist/fondue-components69.js +14 -14
  122. package/dist/fondue-components7.js +3 -3
  123. package/dist/fondue-components70.js +25 -38
  124. package/dist/fondue-components70.js.map +1 -1
  125. package/dist/fondue-components71.js +21 -0
  126. package/dist/fondue-components71.js.map +1 -0
  127. package/dist/fondue-components72.js +10 -0
  128. package/dist/fondue-components72.js.map +1 -0
  129. package/dist/fondue-components73.js +10 -0
  130. package/dist/fondue-components73.js.map +1 -0
  131. package/dist/fondue-components74.js +5 -0
  132. package/dist/fondue-components74.js.map +1 -0
  133. package/dist/fondue-components75.js +18 -0
  134. package/dist/fondue-components75.js.map +1 -0
  135. package/dist/fondue-components76.js +42 -0
  136. package/dist/fondue-components76.js.map +1 -0
  137. package/dist/fondue-components8.js +2 -2
  138. package/dist/fondue-components9.js +85 -77
  139. package/dist/fondue-components9.js.map +1 -1
  140. package/dist/index.d.ts +159 -0
  141. package/dist/style.css +1 -1
  142. package/package.json +4 -4
@@ -1,21 +1,16 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { useMemo as c, isValidElement as r, cloneElement as i, Children as p } from "react";
3
- const o = (e) => {
4
- const t = [];
5
- for (const n of p.toArray(e))
6
- r(n) ? t.push(n) : t.push(/* @__PURE__ */ s("span", { children: n }));
7
- return t.length === 1 ? t[0] : t;
8
- }, u = (e) => c(() => {
9
- const t = r(e) && e.type === "a";
10
- if (t) {
11
- const n = i(e, {
12
- children: o(e.props.children)
13
- });
14
- return { isLink: t, content: n };
15
- }
16
- return { isLink: t, content: o(e) };
17
- }, [e]);
1
+ function s(u, t) {
2
+ t && (typeof t == "function" ? t(u.current) : t && "current" in t && (t.current = u.current));
3
+ }
4
+ function i(u) {
5
+ u.currentTarget.dataset.autoFocusVisible = "false";
6
+ }
7
+ function a(u) {
8
+ const t = u.relatedTarget;
9
+ t != null && t.dataset.autoFocusTrigger && (t.dataset.autoFocusVisible === "true" ? u.target.dataset.showFocusRing = "true" : u.target.dataset.showFocusRing = "false", t.dataset.autoFocusVisible = "true");
10
+ }
18
11
  export {
19
- u as useProcessedChildren
12
+ i as addAutoFocusAttribute,
13
+ a as addShowFocusRing,
14
+ s as syncRefs
20
15
  };
21
16
  //# sourceMappingURL=fondue-components41.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components41.js","sources":["../src/components/Dropdown/hooks/useProcessedChildren.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Children, cloneElement, isValidElement, type ReactNode, useMemo } from 'react';\n\nconst wrapFloatingText = (children: ReactNode) => {\n const content = [];\n for (const child of Children.toArray(children)) {\n if (isValidElement(child)) {\n content.push(child);\n } else {\n content.push(<span>{child}</span>);\n }\n }\n return content.length === 1 ? content[0] : content;\n};\n\nexport const useProcessedChildren = (children: ReactNode) => {\n return useMemo(() => {\n const isLink =\n isValidElement<{\n children: ReactNode;\n }>(children) && children.type === 'a';\n\n if (isLink) {\n const element = cloneElement(children, {\n children: wrapFloatingText(children.props.children),\n });\n return { isLink, content: element };\n }\n\n return { isLink, content: wrapFloatingText(children) };\n }, [children]);\n};\n"],"names":["wrapFloatingText","children","content","child","Children","isValidElement","jsx","useProcessedChildren","useMemo","isLink","element","cloneElement"],"mappings":";;AAIA,MAAMA,IAAmB,CAACC,MAAwB;AAC9C,QAAMC,IAAU,CAAC;AACjB,aAAWC,KAASC,EAAS,QAAQH,CAAQ;AACrC,IAAAI,EAAeF,CAAK,IACpBD,EAAQ,KAAKC,CAAK,IAElBD,EAAQ,KAAK,gBAAAI,EAAC,QAAM,EAAA,UAAAH,EAAA,CAAM,CAAO;AAGzC,SAAOD,EAAQ,WAAW,IAAIA,EAAQ,CAAC,IAAIA;AAC/C,GAEaK,IAAuB,CAACN,MAC1BO,EAAQ,MAAM;AACjB,QAAMC,IACFJ,EAEGJ,CAAQ,KAAKA,EAAS,SAAS;AAEtC,MAAIQ,GAAQ;AACF,UAAAC,IAAUC,EAAaV,GAAU;AAAA,MACnC,UAAUD,EAAiBC,EAAS,MAAM,QAAQ;AAAA,IAAA,CACrD;AACM,WAAA,EAAE,QAAAQ,GAAQ,SAASC,EAAQ;AAAA,EAAA;AAGtC,SAAO,EAAE,QAAAD,GAAQ,SAAST,EAAiBC,CAAQ,EAAE;AAAA,GACtD,CAACA,CAAQ,CAAC;"}
1
+ {"version":3,"file":"fondue-components41.js","sources":["../src/utilities/domUtilities.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type FocusEvent, type MouseEvent as ReactMouseEvent, type ForwardedRef, type RefObject } from 'react';\n\nexport const MAX_HEIGHT_MARGIN = 8;\n\n/**\n * Sets the maximum height for a dialog element based on its position on the viewport.\n * The function calculates the space below the dialog up to the bottom of the viewport window,\n * subtracting a default margin, and sets this value as the max-height style of the dialog.\n *\n * @param {HTMLElement} dialog - The dialog element whose maximum height is to be set.\n *\n * @example\n * // Suppose you have a dialog element with id 'my-dialog'.\n * const dialogElement = myDialogRef.current || document.getElementById('my-dialog');\n * // Setting its max height relative to its current position and the viewport's dimensions.\n * setMaxHeightToAvailableSpace(dialogElement);\n */\nexport function setMaxHeightToAvailableSpace(dialog: HTMLElement) {\n if (!window) {\n throw new Error('Window object not found, this method should be used in a browser environment');\n }\n\n dialog.style.maxHeight = '';\n\n const { top, bottom } = dialog.getBoundingClientRect();\n if (top - MAX_HEIGHT_MARGIN < 0) {\n // if the dialog is overflowing to the top\n dialog.style.maxHeight = `${bottom - MAX_HEIGHT_MARGIN}px`;\n } else if (bottom + MAX_HEIGHT_MARGIN > window.innerHeight) {\n // if the dialog is overflowing to the bottom\n dialog.style.maxHeight = `${window.innerHeight - top - MAX_HEIGHT_MARGIN}px`;\n }\n}\n\n/**\n * Checks if a specified HTML element is visible within the viewport.\n * Visibility is determined by several factors:\n * - The element must have non-zero dimensions.\n * - The element's computed style must not be `display: none`, `visibility: hidden`, or `opacity: 0`.\n * - The element must be within the bounds of the current viewport.\n *\n * @param {HTMLElement} element - The HTML element to check for visibility.\n * @returns {boolean} Returns true if the element is visible according to the criteria specified, otherwise returns false.\n */\nexport function isElementVisible(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n const hasSize = rect.width > 0 && rect.height > 0;\n\n const style = window.getComputedStyle(element);\n const isVisibleStyle = style.display !== 'none' && style.visibility !== 'hidden' && parseFloat(style.opacity) !== 0;\n\n // Check if the element is within the viewport\n const isInViewport =\n rect.top < window.innerHeight && rect.left < window.innerWidth && rect.bottom > 0 && rect.right > 0;\n\n return hasSize && isVisibleStyle && isInViewport;\n}\n\n/**\n * Assigns a local DOM ref to a forwarded ref.\n *\n * @param {RefObject<HTMLDivElement>} localRef - The local React reference to an HTMLDivElement.\n * @param {ForwardedRef<HTMLDivElement>} forwardedRef - The ref forwarded from a parent component.\n */\nexport function syncRefs<TElement = HTMLElement>(localRef: RefObject<TElement>, forwardedRef: ForwardedRef<TElement>) {\n if (!forwardedRef) {\n return;\n }\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(localRef.current);\n } else if (forwardedRef && 'current' in forwardedRef) {\n forwardedRef.current = localRef.current;\n }\n}\n\n/**\n * Sets the 'autoFocusVisible' data attribute to 'false' on the current target of a mouse event.\n * This function is typically used to indicate that an element has been interacted with via mouse,\n * which should prevent the focus ring from being displayed when the element receives focus.\n *\n * @param mouseEvent - The mouse event object.\n */\nexport function addAutoFocusAttribute(mouseEvent: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n mouseEvent.currentTarget.dataset.autoFocusVisible = 'false';\n}\n\n/**\n * Manages the focus ring visibility based on the previous focus state and the current focus event.\n * This function sets the 'showFocusRing' data attribute on the target element and updates the\n * 'autoFocusVisible' data attribute on the previously focused element.\n *\n * ! This function should be used in conjunction with the 'addAutoFocusAttribute' function and the autoFocusVisible data autoFocusTrigger.\n *\n * @param event - The focus event object.\n */\nexport function addShowFocusRing(event: FocusEvent<HTMLDivElement, HTMLElement>) {\n const triggerElement = event.relatedTarget;\n\n if (!triggerElement?.dataset.autoFocusTrigger) {\n return;\n }\n\n if (triggerElement.dataset.autoFocusVisible === 'true') {\n event.target.dataset.showFocusRing = 'true';\n } else {\n event.target.dataset.showFocusRing = 'false';\n }\n\n triggerElement.dataset.autoFocusVisible = 'true';\n}\n"],"names":["syncRefs","localRef","forwardedRef","addAutoFocusAttribute","mouseEvent","addShowFocusRing","event","triggerElement"],"mappings":"AAkEgB,SAAAA,EAAiCC,GAA+BC,GAAsC;AAClH,EAAKA,MAID,OAAOA,KAAiB,aACxBA,EAAaD,EAAS,OAAO,IACtBC,KAAgB,aAAaA,MACpCA,EAAa,UAAUD,EAAS;AAExC;AASO,SAASE,EAAsBC,GAA4D;AACnF,EAAAA,EAAA,cAAc,QAAQ,mBAAmB;AACxD;AAWO,SAASC,EAAiBC,GAAgD;AAC7E,QAAMC,IAAiBD,EAAM;AAEzB,EAACC,KAAA,QAAAA,EAAgB,QAAQ,qBAIzBA,EAAe,QAAQ,qBAAqB,SACtCD,EAAA,OAAO,QAAQ,gBAAgB,SAE/BA,EAAA,OAAO,QAAQ,gBAAgB,SAGzCC,EAAe,QAAQ,mBAAmB;AAC9C;"}
@@ -1,20 +1,18 @@
1
- const t = "_content_r37cj_6", n = "_subContent_r37cj_7", o = "_item_r37cj_24", s = "_subTrigger_r37cj_25", c = "_subMenuIndicator_r37cj_110", _ = "_group_r37cj_116", r = "_slot_r37cj_123", e = {
1
+ const t = "_content_2dhca_6", e = "_header_2dhca_51", o = "_footer_2dhca_52", n = "_body_2dhca_53", d = "_underlay_2dhca_177", _ = "_sideContent_2dhca_190", c = {
2
2
  content: t,
3
- subContent: n,
4
- item: o,
5
- subTrigger: s,
6
- subMenuIndicator: c,
7
- group: _,
8
- slot: r
3
+ header: e,
4
+ footer: o,
5
+ body: n,
6
+ underlay: d,
7
+ sideContent: _
9
8
  };
10
9
  export {
10
+ n as body,
11
11
  t as content,
12
- e as default,
13
- _ as group,
14
- o as item,
15
- r as slot,
16
- n as subContent,
17
- c as subMenuIndicator,
18
- s as subTrigger
12
+ c as default,
13
+ o as footer,
14
+ e as header,
15
+ _ as sideContent,
16
+ d as underlay
19
17
  };
20
18
  //# sourceMappingURL=fondue-components42.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components42.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components42.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,8 +1,63 @@
1
- const o = "_root_gh190_5", t = {
2
- root: o
3
- };
1
+ import { sv as t } from "./fondue-components31.js";
2
+ const i = t({
3
+ base: "tw-flex tw-self-stretch tw-justify-center ",
4
+ variants: {
5
+ direction: {
6
+ horizontal: "tw-flex-col tw-h-0 tw-border-t tw-w-full",
7
+ vertical: "tw-flex-row tw-w-0 tw-border-r tw-h-full "
8
+ },
9
+ color: {
10
+ weak: "tw-border-line-weak",
11
+ default: "tw-border-line",
12
+ strong: "tw-border-line-strong",
13
+ "x-strong": "tw-border-x-line-strong"
14
+ },
15
+ variant: {
16
+ solid: "tw-border-solid",
17
+ dashed: "tw-border-dashed",
18
+ noline: "tw-border-none"
19
+ }
20
+ },
21
+ compoundVariants: [
22
+ {
23
+ direction: "horizontal",
24
+ padding: "small",
25
+ class: "tw-my-4"
26
+ },
27
+ {
28
+ direction: "horizontal",
29
+ padding: "medium",
30
+ class: "tw-my-7"
31
+ },
32
+ {
33
+ direction: "horizontal",
34
+ padding: "large",
35
+ class: "tw-my-12"
36
+ },
37
+ {
38
+ direction: "vertical",
39
+ padding: "small",
40
+ class: "tw-mx-4"
41
+ },
42
+ {
43
+ direction: "vertical",
44
+ padding: "medium",
45
+ class: "tw-mx-7"
46
+ },
47
+ {
48
+ direction: "vertical",
49
+ padding: "large",
50
+ class: "tw-mx-12"
51
+ }
52
+ ],
53
+ defaultVariants: {
54
+ padding: "medium",
55
+ direction: "horizontal",
56
+ color: "default",
57
+ variant: "solid"
58
+ }
59
+ });
4
60
  export {
5
- t as default,
6
- o as root
61
+ i as dividerStyles
7
62
  };
8
63
  //# 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/Divider/styles/dividerStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const dividerStyles = sv({\n base: 'tw-flex tw-self-stretch tw-justify-center ',\n variants: {\n direction: {\n horizontal: 'tw-flex-col tw-h-0 tw-border-t tw-w-full',\n vertical: 'tw-flex-row tw-w-0 tw-border-r tw-h-full ',\n },\n color: {\n weak: 'tw-border-line-weak',\n default: 'tw-border-line',\n strong: 'tw-border-line-strong',\n 'x-strong': 'tw-border-x-line-strong',\n },\n variant: {\n solid: 'tw-border-solid',\n dashed: 'tw-border-dashed',\n noline: 'tw-border-none',\n },\n },\n compoundVariants: [\n {\n direction: 'horizontal',\n padding: 'small',\n class: 'tw-my-4',\n },\n {\n direction: 'horizontal',\n padding: 'medium',\n class: 'tw-my-7',\n },\n {\n direction: 'horizontal',\n padding: 'large',\n class: 'tw-my-12',\n },\n {\n direction: 'vertical',\n padding: 'small',\n class: 'tw-mx-4',\n },\n {\n direction: 'vertical',\n padding: 'medium',\n class: 'tw-mx-7',\n },\n {\n direction: 'vertical',\n padding: 'large',\n class: 'tw-mx-12',\n },\n ],\n defaultVariants: {\n padding: 'medium',\n direction: 'horizontal',\n color: 'default',\n variant: 'solid',\n },\n});\n"],"names":["dividerStyles","sv"],"mappings":";AAIO,MAAMA,IAAgBC,EAAG;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AAAA,IACN,WAAW;AAAA,MACP,YAAY;AAAA,MACZ,UAAU;AAAA,IACd;AAAA,IACA,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,YAAY;AAAA,IAChB;AAAA,IACA,SAAS;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,QAAQ;AAAA,IAAA;AAAA,EAEhB;AAAA,EACA,kBAAkB;AAAA,IACd;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,EAEf;AAAA,EACA,iBAAiB;AAAA,IACb,SAAS;AAAA,IACT,WAAW;AAAA,IACX,OAAO;AAAA,IACP,SAAS;AAAA,EAAA;AAEjB,CAAC;"}
@@ -1,18 +1,21 @@
1
- const o = "_root_4duv3_6", e = "_overlay_4duv3_50", _ = "_header_4duv3_67", t = "_body_4duv3_87", d = "_footer_4duv3_105", r = "_close_4duv3_125", s = {
2
- root: o,
3
- overlay: e,
4
- header: _,
5
- body: t,
6
- footer: d,
7
- close: r
8
- };
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as c, isValidElement as r, cloneElement as i, Children as p } from "react";
3
+ const o = (e) => {
4
+ const t = [];
5
+ for (const n of p.toArray(e))
6
+ r(n) ? t.push(n) : t.push(/* @__PURE__ */ s("span", { children: n }));
7
+ return t.length === 1 ? t[0] : t;
8
+ }, u = (e) => c(() => {
9
+ const t = r(e) && e.type === "a";
10
+ if (t) {
11
+ const n = i(e, {
12
+ children: o(e.props.children)
13
+ });
14
+ return { isLink: t, content: n };
15
+ }
16
+ return { isLink: t, content: o(e) };
17
+ }, [e]);
9
18
  export {
10
- t as body,
11
- r as close,
12
- s as default,
13
- d as footer,
14
- _ as header,
15
- e as overlay,
16
- o as root
19
+ u as useProcessedChildren
17
20
  };
18
21
  //# sourceMappingURL=fondue-components44.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components44.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"fondue-components44.js","sources":["../src/components/Dropdown/hooks/useProcessedChildren.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Children, cloneElement, isValidElement, type ReactNode, useMemo } from 'react';\n\nconst wrapFloatingText = (children: ReactNode) => {\n const content = [];\n for (const child of Children.toArray(children)) {\n if (isValidElement(child)) {\n content.push(child);\n } else {\n content.push(<span>{child}</span>);\n }\n }\n return content.length === 1 ? content[0] : content;\n};\n\nexport const useProcessedChildren = (children: ReactNode) => {\n return useMemo(() => {\n const isLink =\n isValidElement<{\n children: ReactNode;\n }>(children) && children.type === 'a';\n\n if (isLink) {\n const element = cloneElement(children, {\n children: wrapFloatingText(children.props.children),\n });\n return { isLink, content: element };\n }\n\n return { isLink, content: wrapFloatingText(children) };\n }, [children]);\n};\n"],"names":["wrapFloatingText","children","content","child","Children","isValidElement","jsx","useProcessedChildren","useMemo","isLink","element","cloneElement"],"mappings":";;AAIA,MAAMA,IAAmB,CAACC,MAAwB;AAC9C,QAAMC,IAAU,CAAC;AACjB,aAAWC,KAASC,EAAS,QAAQH,CAAQ;AACrC,IAAAI,EAAeF,CAAK,IACpBD,EAAQ,KAAKC,CAAK,IAElBD,EAAQ,KAAK,gBAAAI,EAAC,QAAM,EAAA,UAAAH,EAAA,CAAM,CAAO;AAGzC,SAAOD,EAAQ,WAAW,IAAIA,EAAQ,CAAC,IAAIA;AAC/C,GAEaK,IAAuB,CAACN,MAC1BO,EAAQ,MAAM;AACjB,QAAMC,IACFJ,EAEGJ,CAAQ,KAAKA,EAAS,SAAS;AAEtC,MAAIQ,GAAQ;AACF,UAAAC,IAAUC,EAAaV,GAAU;AAAA,MACnC,UAAUD,EAAiBC,EAAS,MAAM,QAAQ;AAAA,IAAA,CACrD;AACM,WAAA,EAAE,QAAAQ,GAAQ,SAASC,EAAQ;AAAA,EAAA;AAGtC,SAAO,EAAE,QAAAD,GAAQ,SAAST,EAAiBC,CAAQ,EAAE;AAAA,GACtD,CAACA,CAAQ,CAAC;"}
@@ -1,8 +1,22 @@
1
- const o = "_root_umks5_5", t = {
2
- root: o
1
+ const t = "_content_bx8nt_6", n = "_subContent_bx8nt_7", o = "_item_bx8nt_24", s = "_subTrigger_bx8nt_25", _ = "_subMenuIndicator_bx8nt_110", e = "_group_bx8nt_116", u = "_groupHeading_bx8nt_123", b = "_slot_bx8nt_133", r = {
2
+ content: t,
3
+ subContent: n,
4
+ item: o,
5
+ subTrigger: s,
6
+ subMenuIndicator: _,
7
+ group: e,
8
+ groupHeading: u,
9
+ slot: b
3
10
  };
4
11
  export {
5
- t as default,
6
- o as root
12
+ t as content,
13
+ r as default,
14
+ e as group,
15
+ u as groupHeading,
16
+ o as item,
17
+ b as slot,
18
+ n as subContent,
19
+ _ as subMenuIndicator,
20
+ s as subTrigger
7
21
  };
8
22
  //# 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,38 +1,8 @@
1
- import { sv as t } from "./fondue-components28.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
- });
1
+ const o = "_root_gh190_5", t = {
2
+ root: o
3
+ };
34
4
  export {
35
- i as loadingBarContainerStyles,
36
- a as loadingBarStyles
5
+ t as default,
6
+ o as root
37
7
  };
38
8
  //# sourceMappingURL=fondue-components46.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components46.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,IAAA;AAAA,EACd;AAER,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,IAAA;AAAA,EACX;AAER,CAAC;"}
1
+ {"version":3,"file":"fondue-components46.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,16 +1,18 @@
1
- const o = "_root_uxsne_3", r = "_viewport_uxsne_10", t = "_scrollbar_uxsne_19", s = "_thumb_uxsne_51", _ = "_corner_uxsne_69", e = {
1
+ const o = "_root_4duv3_6", e = "_overlay_4duv3_50", _ = "_header_4duv3_67", t = "_body_4duv3_87", d = "_footer_4duv3_105", r = "_close_4duv3_125", s = {
2
2
  root: o,
3
- viewport: r,
4
- scrollbar: t,
5
- thumb: s,
6
- corner: _
3
+ overlay: e,
4
+ header: _,
5
+ body: t,
6
+ footer: d,
7
+ close: r
7
8
  };
8
9
  export {
9
- _ as corner,
10
- e as default,
11
- o as root,
12
- t as scrollbar,
13
- s as thumb,
14
- r as viewport
10
+ t as body,
11
+ r as close,
12
+ s as default,
13
+ d as footer,
14
+ _ as header,
15
+ e as overlay,
16
+ o as root
15
17
  };
16
18
  //# 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":";;;;;;;;"}
@@ -1,4 +1,4 @@
1
- const o = "_root_yrjuz_5", t = {
1
+ const o = "_root_umks5_5", t = {
2
2
  root: o
3
3
  };
4
4
  export {
@@ -1,28 +1,22 @@
1
- import { useMemo as f, useCallback as a, 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, d = t ? e : o, r = f(() => s, [s]), i = a(
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 [d, i];
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_1brlo_2", r = {
2
+ root: o,
3
+ "size-medium": "_size-medium_1brlo_6",
4
+ "size-large": "_size-large_1brlo_11",
5
+ "size-x-large": "_size-x-large_1brlo_16",
6
+ "size-xx-large": "_size-xx-large_1brlo_21",
7
+ "weight-default": "_weight-default_1brlo_26",
8
+ "weight-strong": "_weight-strong_1brlo_30",
9
+ "color-default": "_color-default_1brlo_34",
10
+ "color-weak": "_color-weak_1brlo_38",
11
+ "color-x-weak": "_color-x-weak_1brlo_42",
12
+ "color-disabled": "_color-disabled_1brlo_46",
13
+ "color-negative": "_color-negative_1brlo_50",
14
+ "color-positive": "_color-positive_1brlo_54",
15
+ "color-warning": "_color-warning_1brlo_58",
16
+ "color-interactive": "_color-interactive_1brlo_62"
24
17
  };
25
18
  export {
26
- U as useControllableState
19
+ r as default,
20
+ o as root
27
21
  };
28
22
  //# sourceMappingURL=fondue-components49.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components49.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,EAAA;AACrB,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,EAC1D;AAEO,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-components49.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-components28.js";
6
- import { checkboxStyles as l, checkboxIndicatorStyles as w } from "./fondue-components32.js";
5
+ import { cn as p } from "./fondue-components31.js";
6
+ import { checkboxStyles as l, checkboxIndicatorStyles as w } from "./fondue-components35.js";
7
7
  const f = ({
8
8
  className: a,
9
9
  value: c,
@@ -1,20 +1,38 @@
1
- const t = "_root_1hloi_5", e = "_item_1hloi_26", i = "_itemLabel_1hloi_46", o = "_itemLabelActive_1hloi_66", a = "_itemLabelInactive_1hloi_96", _ = "_activeIndicator_1hloi_126", c = "_separator_1hloi_223", l = {
2
- root: t,
3
- item: e,
4
- itemLabel: i,
5
- itemLabelActive: o,
6
- itemLabelInactive: a,
7
- activeIndicator: _,
8
- separator: c
9
- };
1
+ import { sv as t } from "./fondue-components31.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
+ });
10
34
  export {
11
- _ as activeIndicator,
12
- l as default,
13
- e as item,
14
- i as itemLabel,
15
- o as itemLabelActive,
16
- a as itemLabelInactive,
17
- t as root,
18
- c as separator
35
+ i as loadingBarContainerStyles,
36
+ a as loadingBarStyles
19
37
  };
20
38
  //# sourceMappingURL=fondue-components50.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components50.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components50.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,IAAA;AAAA,EACd;AAER,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,IAAA;AAAA,EACX;AAER,CAAC;"}
@@ -1,145 +1,10 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import { IconCaretDown as A, IconCheckMark as E, IconExclamationMarkTriangle as q } from "@frontify/fondue-icons";
3
- import * as w from "@radix-ui/react-popover";
4
- import { Slot as G } from "@radix-ui/react-slot";
5
- import { useCombobox as J } from "downshift";
6
- import { forwardRef as K, useState as Q, useRef as U, useMemo as W } from "react";
7
- import { SelectMenu as X } from "./fondue-components53.js";
8
- import o from "./fondue-components55.js";
9
- import { useSelectData as Y } from "./fondue-components56.js";
10
- const I = ({
11
- children: N,
12
- onSelect: n,
13
- value: S,
14
- defaultValue: O,
15
- placeholder: R = "",
16
- status: s = "neutral",
17
- disabled: m,
18
- "aria-label": B,
19
- "data-test-id": l = "fondue-select-combobox",
20
- alignMenu: M = "start",
21
- side: F = "bottom"
22
- }, L) => {
23
- const { inputSlots: P, menuSlots: k, items: i, filterText: v, clearButton: g, getItemByValue: p, setFilterText: y } = Y(N), [D, f] = Q(!1), {
24
- getInputProps: c,
25
- getToggleButtonProps: H,
26
- getMenuProps: T,
27
- getItemProps: V,
28
- reset: h,
29
- selectedItem: r,
30
- isOpen: z,
31
- highlightedIndex: j,
32
- inputValue: u
33
- } = J({
34
- items: i,
35
- selectedItem: p(S),
36
- defaultSelectedItem: p(O),
37
- defaultHighlightedIndex: 0,
38
- onSelectedItemChange: ({ selectedItem: e }) => {
39
- n == null || n((e == null ? void 0 : e.value) ?? null);
40
- },
41
- onInputValueChange: ({ inputValue: e }) => {
42
- y(e);
43
- },
44
- onIsOpenChange: () => {
45
- f(!1);
46
- },
47
- onHighlightedIndexChange: () => {
48
- f(!0);
49
- },
50
- itemToString: (e) => e ? e.label : ""
51
- }), a = U(!1), b = W(
52
- () => !i.find((e) => e.label.toLowerCase().includes(u.toLowerCase())),
53
- [u, i]
54
- ), $ = (e) => {
55
- var C, x;
56
- e.target.dataset.showFocusRing = "false", a.current = !1, (r == null ? void 0 : r.label.toLocaleLowerCase()) !== u.toLocaleLowerCase() && h(), c().onBlur && ((x = (C = c()).onBlur) == null || x.call(C, e));
57
- };
58
- return /* @__PURE__ */ d(w.Root, { open: z, children: [
59
- /* @__PURE__ */ t(w.Anchor, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: L, className: o.root, "data-status": b ? "error" : s, children: [
60
- /* @__PURE__ */ t(
61
- "input",
62
- {
63
- ...c({
64
- "aria-label": B
65
- }),
66
- "data-test-id": l,
67
- placeholder: R,
68
- className: o.input,
69
- disabled: m,
70
- onMouseDown: (e) => {
71
- a.current = !0, e.currentTarget.dataset.showFocusRing = "false";
72
- },
73
- onFocus: (e) => {
74
- a.current || (e.target.dataset.showFocusRing = "true");
75
- },
76
- onBlur: $
77
- }
78
- ),
79
- P,
80
- g && /* @__PURE__ */ t(
81
- G,
82
- {
83
- onClick: (e) => {
84
- e.stopPropagation(), h();
85
- },
86
- className: o.clear,
87
- role: "button",
88
- children: g
89
- }
90
- ),
91
- /* @__PURE__ */ d("div", { className: o.icons, children: [
92
- /* @__PURE__ */ t(
93
- "button",
94
- {
95
- ...H(),
96
- type: "button",
97
- "aria-label": "toggle menu",
98
- disabled: m,
99
- onMouseDown: () => {
100
- a.current = !0;
101
- },
102
- children: /* @__PURE__ */ t(A, { size: 16, className: o.caret })
103
- }
104
- ),
105
- s === "success" ? /* @__PURE__ */ t(
106
- E,
107
- {
108
- size: 16,
109
- className: o.iconSuccess,
110
- "data-test-id": `${l}-success-icon`
111
- }
112
- ) : null,
113
- b || s === "error" ? /* @__PURE__ */ t(
114
- q,
115
- {
116
- size: 16,
117
- className: o.iconError,
118
- "data-test-id": `${l}-error-icon`
119
- }
120
- ) : null
121
- ] })
122
- ] }) }),
123
- /* @__PURE__ */ t(
124
- X,
125
- {
126
- align: M,
127
- side: F,
128
- highlightedIndex: j,
129
- filterText: v,
130
- getMenuProps: T,
131
- getItemProps: V,
132
- selectedItem: r,
133
- hasInteractedSinceOpening: D,
134
- children: k
135
- }
136
- )
137
- ] });
1
+ const o = "_root_vx7g5_8", s = "_spin_vx7g5_1", t = {
2
+ root: o,
3
+ spin: s
138
4
  };
139
- I.displayName = "Select.Combobox";
140
- const le = K(I);
141
5
  export {
142
- le as ForwardedRefCombobox,
143
- I as SelectCombobox
6
+ t as default,
7
+ o as root,
8
+ s as spin
144
9
  };
145
10
  //# sourceMappingURL=fondue-components51.js.map