@frontify/fondue-components 19.5.0 → 19.6.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 (157) hide show
  1. package/dist/fondue-components.js +20 -18
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +3 -3
  4. package/dist/fondue-components11.js +3 -3
  5. package/dist/fondue-components12.js +2 -2
  6. package/dist/fondue-components13.js +3 -3
  7. package/dist/fondue-components14.js +2 -2
  8. package/dist/fondue-components15.js +2 -2
  9. package/dist/fondue-components16.js +19 -29
  10. package/dist/fondue-components16.js.map +1 -1
  11. package/dist/fondue-components17.js +1 -1
  12. package/dist/fondue-components18.js +1 -1
  13. package/dist/fondue-components19.js +1 -1
  14. package/dist/fondue-components20.js +2 -2
  15. package/dist/fondue-components21.js +2 -2
  16. package/dist/fondue-components22.js +6 -6
  17. package/dist/fondue-components23.js +1 -1
  18. package/dist/fondue-components24.js +2 -2
  19. package/dist/fondue-components25.js +4 -4
  20. package/dist/fondue-components26.js +135 -127
  21. package/dist/fondue-components26.js.map +1 -1
  22. package/dist/fondue-components27.js +127 -31
  23. package/dist/fondue-components27.js.map +1 -1
  24. package/dist/fondue-components28.js +33 -59
  25. package/dist/fondue-components28.js.map +1 -1
  26. package/dist/fondue-components29.js +58 -101
  27. package/dist/fondue-components29.js.map +1 -1
  28. package/dist/fondue-components3.js +1 -1
  29. package/dist/fondue-components30.js +101 -12
  30. package/dist/fondue-components30.js.map +1 -1
  31. package/dist/fondue-components31.js +12 -55
  32. package/dist/fondue-components31.js.map +1 -1
  33. package/dist/fondue-components32.js +55 -20
  34. package/dist/fondue-components32.js.map +1 -1
  35. package/dist/fondue-components33.js +20 -7
  36. package/dist/fondue-components33.js.map +1 -1
  37. package/dist/fondue-components34.js +7 -6
  38. package/dist/fondue-components34.js.map +1 -1
  39. package/dist/fondue-components35.js +7 -32
  40. package/dist/fondue-components35.js.map +1 -1
  41. package/dist/fondue-components36.js +32 -5
  42. package/dist/fondue-components36.js.map +1 -1
  43. package/dist/fondue-components37.js +5 -12
  44. package/dist/fondue-components37.js.map +1 -1
  45. package/dist/fondue-components38.js +10 -153
  46. package/dist/fondue-components38.js.map +1 -1
  47. package/dist/fondue-components39.js +59 -22
  48. package/dist/fondue-components39.js.map +1 -1
  49. package/dist/fondue-components4.js +29 -38
  50. package/dist/fondue-components4.js.map +1 -1
  51. package/dist/fondue-components40.js +17 -17
  52. package/dist/fondue-components40.js.map +1 -1
  53. package/dist/fondue-components41.js +112 -15
  54. package/dist/fondue-components41.js.map +1 -1
  55. package/dist/fondue-components42.js +19 -30
  56. package/dist/fondue-components42.js.map +1 -1
  57. package/dist/fondue-components43.js +32 -62
  58. package/dist/fondue-components43.js.map +1 -1
  59. package/dist/fondue-components44.js +53 -121
  60. package/dist/fondue-components44.js.map +1 -1
  61. package/dist/fondue-components45.js +129 -20
  62. package/dist/fondue-components45.js.map +1 -1
  63. package/dist/fondue-components46.js +21 -45
  64. package/dist/fondue-components46.js.map +1 -1
  65. package/dist/fondue-components47.js +53 -8
  66. package/dist/fondue-components47.js.map +1 -1
  67. package/dist/fondue-components48.js +8 -13
  68. package/dist/fondue-components48.js.map +1 -1
  69. package/dist/fondue-components49.js +13 -15
  70. package/dist/fondue-components49.js.map +1 -1
  71. package/dist/fondue-components5.js +2 -2
  72. package/dist/fondue-components50.js +14 -4
  73. package/dist/fondue-components50.js.map +1 -1
  74. package/dist/fondue-components51.js +5 -60
  75. package/dist/fondue-components51.js.map +1 -1
  76. package/dist/fondue-components52.js +59 -17
  77. package/dist/fondue-components52.js.map +1 -1
  78. package/dist/fondue-components53.js +18 -19
  79. package/dist/fondue-components53.js.map +1 -1
  80. package/dist/fondue-components54.js +18 -4
  81. package/dist/fondue-components54.js.map +1 -1
  82. package/dist/fondue-components55.js +3 -13
  83. package/dist/fondue-components55.js.map +1 -1
  84. package/dist/fondue-components56.js +13 -3
  85. package/dist/fondue-components56.js.map +1 -1
  86. package/dist/fondue-components57.js +3 -17
  87. package/dist/fondue-components57.js.map +1 -1
  88. package/dist/fondue-components58.js +19 -35
  89. package/dist/fondue-components58.js.map +1 -1
  90. package/dist/fondue-components59.js +8 -4
  91. package/dist/fondue-components59.js.map +1 -1
  92. package/dist/fondue-components6.js +4 -4
  93. package/dist/fondue-components60.js +35 -13
  94. package/dist/fondue-components60.js.map +1 -1
  95. package/dist/fondue-components61.js +1 -1
  96. package/dist/fondue-components62.js +12 -24
  97. package/dist/fondue-components62.js.map +1 -1
  98. package/dist/fondue-components63.js +4 -16
  99. package/dist/fondue-components63.js.map +1 -1
  100. package/dist/fondue-components64.js +23 -149
  101. package/dist/fondue-components64.js.map +1 -1
  102. package/dist/fondue-components65.js +17 -19
  103. package/dist/fondue-components65.js.map +1 -1
  104. package/dist/fondue-components66.js +148 -75
  105. package/dist/fondue-components66.js.map +1 -1
  106. package/dist/fondue-components67.js +19 -8
  107. package/dist/fondue-components67.js.map +1 -1
  108. package/dist/fondue-components68.js +77 -34
  109. package/dist/fondue-components68.js.map +1 -1
  110. package/dist/fondue-components69.js +8 -71
  111. package/dist/fondue-components69.js.map +1 -1
  112. package/dist/fondue-components7.js +2 -2
  113. package/dist/fondue-components70.js +34 -10
  114. package/dist/fondue-components70.js.map +1 -1
  115. package/dist/fondue-components71.js +70 -12
  116. package/dist/fondue-components71.js.map +1 -1
  117. package/dist/fondue-components72.js +10 -12
  118. package/dist/fondue-components72.js.map +1 -1
  119. package/dist/fondue-components73.js +12 -20
  120. package/dist/fondue-components73.js.map +1 -1
  121. package/dist/fondue-components74.js +13 -34
  122. package/dist/fondue-components74.js.map +1 -1
  123. package/dist/fondue-components75.js +20 -55
  124. package/dist/fondue-components75.js.map +1 -1
  125. package/dist/fondue-components76.js +34 -15
  126. package/dist/fondue-components76.js.map +1 -1
  127. package/dist/fondue-components77.js +9 -24
  128. package/dist/fondue-components77.js.map +1 -1
  129. package/dist/fondue-components78.js +55 -14
  130. package/dist/fondue-components78.js.map +1 -1
  131. package/dist/fondue-components79.js +14 -22
  132. package/dist/fondue-components79.js.map +1 -1
  133. package/dist/fondue-components8.js +5 -5
  134. package/dist/fondue-components80.js +25 -6
  135. package/dist/fondue-components80.js.map +1 -1
  136. package/dist/fondue-components81.js +13 -5
  137. package/dist/fondue-components81.js.map +1 -1
  138. package/dist/fondue-components82.js +23 -2
  139. package/dist/fondue-components82.js.map +1 -1
  140. package/dist/fondue-components83.js +5 -15
  141. package/dist/fondue-components83.js.map +1 -1
  142. package/dist/fondue-components84.js +4 -2
  143. package/dist/fondue-components84.js.map +1 -1
  144. package/dist/fondue-components85.js +4 -4
  145. package/dist/fondue-components85.js.map +1 -1
  146. package/dist/fondue-components86.js +4 -39
  147. package/dist/fondue-components86.js.map +1 -1
  148. package/dist/fondue-components87.js +5 -0
  149. package/dist/fondue-components87.js.map +1 -0
  150. package/dist/fondue-components88.js +20 -0
  151. package/dist/fondue-components88.js.map +1 -0
  152. package/dist/fondue-components89.js +43 -0
  153. package/dist/fondue-components89.js.map +1 -0
  154. package/dist/fondue-components9.js +4 -4
  155. package/dist/index.d.ts +74 -8
  156. package/dist/style.css +1 -1
  157. package/package.json +1 -1
@@ -2,9 +2,9 @@
2
2
  import { Accordion as t } from "./fondue-components3.js";
3
3
  import { Badge as m } from "./fondue-components4.js";
4
4
  import { Box as f } from "./fondue-components5.js";
5
- import { Button as l } from "./fondue-components6.js";
5
+ import { Button as a } from "./fondue-components6.js";
6
6
  import { Checkbox as d } from "./fondue-components7.js";
7
- import { ColorPicker as c } from "./fondue-components8.js";
7
+ import { ColorPicker as T } from "./fondue-components8.js";
8
8
  import { Dialog as g } from "./fondue-components9.js";
9
9
  import { Divider as h } from "./fondue-components10.js";
10
10
  import { Dropdown as C } from "./fondue-components11.js";
@@ -22,19 +22,20 @@ import { Select as M } from "./fondue-components22.js";
22
22
  import { Slider as O } from "./fondue-components23.js";
23
23
  import { Switch as R } from "./fondue-components24.js";
24
24
  import { Table as V } from "./fondue-components25.js";
25
- import { Tabs as X } from "./fondue-components26.js";
26
- import { Text as Z } from "./fondue-components27.js";
27
- import { TextInput as $ } from "./fondue-components28.js";
28
- import { Textarea as ro } from "./fondue-components29.js";
29
- import { ThemeContext as to, ThemeProvider as xo, useFondueTheme as mo } from "./fondue-components30.js";
30
- import { Tooltip as fo } from "./fondue-components31.js";
25
+ import { Tag as X } from "./fondue-components26.js";
26
+ import { Tabs as Z } from "./fondue-components27.js";
27
+ import { Text as $ } from "./fondue-components28.js";
28
+ import { TextInput as ro } from "./fondue-components29.js";
29
+ import { Textarea as to } from "./fondue-components30.js";
30
+ import { ThemeContext as mo, ThemeProvider as po, useFondueTheme as fo } from "./fondue-components31.js";
31
+ import { Tooltip as ao } from "./fondue-components32.js";
31
32
  export {
32
33
  t as Accordion,
33
34
  m as Badge,
34
35
  f as Box,
35
- l as Button,
36
+ a as Button,
36
37
  d as Checkbox,
37
- c as ColorPicker,
38
+ T as ColorPicker,
38
39
  g as Dialog,
39
40
  h as Divider,
40
41
  C as Dropdown,
@@ -52,13 +53,14 @@ export {
52
53
  O as Slider,
53
54
  R as Switch,
54
55
  V as Table,
55
- X as Tabs,
56
- Z as Text,
57
- $ as TextInput,
58
- ro as Textarea,
59
- to as ThemeContext,
60
- xo as ThemeProvider,
61
- fo as Tooltip,
62
- mo as useFondueTheme
56
+ Z as Tabs,
57
+ X as Tag,
58
+ $ as Text,
59
+ ro as TextInput,
60
+ to as Textarea,
61
+ mo as ThemeContext,
62
+ po as ThemeProvider,
63
+ ao as Tooltip,
64
+ fo as useFondueTheme
63
65
  };
64
66
  //# sourceMappingURL=fondue-components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import * as p from "@radix-ui/react-separator";
3
3
  import { forwardRef as f } from "react";
4
- import { cn as l } from "./fondue-components37.js";
5
- import v from "./fondue-components50.js";
6
- import { dividerStyles as c } from "./fondue-components51.js";
4
+ import { cn as l } from "./fondue-components38.js";
5
+ import v from "./fondue-components51.js";
6
+ import { dividerStyles as c } from "./fondue-components52.js";
7
7
  const h = f(
8
8
  ({
9
9
  "data-test-id": i = "fondue-divider",
@@ -2,9 +2,9 @@ import { jsx as n, jsxs as g } from "react/jsx-runtime";
2
2
  import { IconCaretRight as M } from "@frontify/fondue-icons";
3
3
  import * as d from "@radix-ui/react-dropdown-menu";
4
4
  import { forwardRef as i, useMemo as G, Children as A, useRef as v } from "react";
5
- import { useFondueTheme as D, ThemeProvider as b } from "./fondue-components30.js";
6
- import { useProcessedChildren as h } from "./fondue-components52.js";
7
- import s from "./fondue-components53.js";
5
+ import { useFondueTheme as D, ThemeProvider as b } from "./fondue-components31.js";
6
+ import { useProcessedChildren as h } from "./fondue-components53.js";
7
+ import s from "./fondue-components54.js";
8
8
  const N = ({
9
9
  children: o,
10
10
  open: t,
@@ -1,7 +1,7 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { forwardRef as n } from "react";
3
- import { propsToCssVariables as y } from "./fondue-components35.js";
4
- import x from "./fondue-components54.js";
3
+ import { propsToCssVariables as y } from "./fondue-components36.js";
4
+ import x from "./fondue-components55.js";
5
5
  const u = n(
6
6
  ({
7
7
  as: a = "div",
@@ -2,9 +2,9 @@ import { jsx as a, jsxs as u } from "react/jsx-runtime";
2
2
  import { IconCross as R } from "@frontify/fondue-icons";
3
3
  import * as l from "@radix-ui/react-popover";
4
4
  import { forwardRef as i } from "react";
5
- import { addAutoFocusAttribute as w, addShowFocusRing as x } from "./fondue-components48.js";
6
- import { useFondueTheme as A, ThemeProvider as T } from "./fondue-components30.js";
7
- import s from "./fondue-components55.js";
5
+ import { addAutoFocusAttribute as w, addShowFocusRing as x } from "./fondue-components49.js";
6
+ import { useFondueTheme as A, ThemeProvider as T } from "./fondue-components31.js";
7
+ import s from "./fondue-components56.js";
8
8
  const n = ({ children: t, ...o }) => /* @__PURE__ */ a(l.Root, { ...o, children: t });
9
9
  n.displayName = "Flyout.Root";
10
10
  const c = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger", ...d }, r) => /* @__PURE__ */ a(
@@ -1,7 +1,7 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
2
  import { forwardRef as y } from "react";
3
- import { propsToCssVariables as n } from "./fondue-components35.js";
4
- import u from "./fondue-components56.js";
3
+ import { propsToCssVariables as n } from "./fondue-components36.js";
4
+ import u from "./fondue-components57.js";
5
5
  const c = y(
6
6
  ({
7
7
  as: a = "div",
@@ -1,7 +1,7 @@
1
1
  import { jsx as y } from "react/jsx-runtime";
2
2
  import { forwardRef as g } from "react";
3
- import { cn as x } from "./fondue-components37.js";
4
- import a from "./fondue-components57.js";
3
+ import { cn as x } from "./fondue-components38.js";
4
+ import a from "./fondue-components58.js";
5
5
  const $ = g(
6
6
  ({
7
7
  as: e = "span",
@@ -1,39 +1,29 @@
1
- import { jsxs as l, jsx as d } from "react/jsx-runtime";
2
- import * as w from "@radix-ui/react-label";
3
- import { forwardRef as m } from "react";
4
- import { cn as f } from "./fondue-components37.js";
5
- const u = ({ className: i, "data-test-id": s = "fondue-label", children: a, ...o }, n) => /* @__PURE__ */ l(
6
- w.Root,
1
+ import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
+ import * as c from "@radix-ui/react-label";
3
+ import { forwardRef as f } from "react";
4
+ import { cn as p } from "./fondue-components38.js";
5
+ import o from "./fondue-components59.js";
6
+ const b = ({ className: l, "data-test-id": m = "fondue-label", children: a, ...r }, d) => /* @__PURE__ */ n(
7
+ c.Root,
7
8
  {
8
- ref: n,
9
- "data-required": o.required,
10
- className: f(
11
- "tw-group tw-relative tw-flex tw-gap-1 tw-font-body--stack tw-text-body-medium tw-text-text-weak tw-transition-colors",
12
- // Peer-based color changes (apply to parent, inherit to spans)
13
- "peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text has-[~_button:hover:not(:disabled)]:tw-text-text",
14
- // Use adjacent sibling selector when checkbox is checked
15
- '[*[data-state="checked"]+&]:tw-font-medium [*[data-state="indeterminate"]+&]:tw-font-medium',
16
- // Disabled state styling and cursor
17
- "has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed",
18
- // Required asterisk
19
- 'after:tw-hidden data-[required="true"]:after:tw-flex after:tw-content-["*"] after:-tw-ml-1 after:tw-font-body--stack after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',
20
- i
21
- ),
22
- "data-test-id": s,
9
+ ref: d,
10
+ "data-required": r.required,
11
+ className: p(o.root, l),
12
+ "data-test-id": m,
23
13
  onClick: (t) => {
24
- const r = t.target.getAttribute("for"), e = r ? document.getElementById(r) : null;
14
+ const i = t.target.getAttribute("for"), e = i ? document.getElementById(i) : null;
25
15
  e && e.getAttribute("role") === "combobox" && (t.preventDefault(), t.stopPropagation(), e.click());
26
16
  },
27
- ...o,
17
+ ...r,
28
18
  children: [
29
- /* @__PURE__ */ d("span", { className: "tw-font-medium tw-opacity-0 tw-pointer-events-none", "aria-hidden": "true", children: a }),
30
- /* @__PURE__ */ d("span", { className: "tw-absolute tw-inset-0", children: a })
19
+ /* @__PURE__ */ s("span", { className: o.hiddenText, "aria-hidden": "true", children: a }),
20
+ /* @__PURE__ */ s("span", { className: o.visibleText, children: a })
31
21
  ]
32
22
  }
33
- ), x = m(u);
34
- x.displayName = "Label";
23
+ ), u = f(b);
24
+ u.displayName = "Label";
35
25
  export {
36
- x as Label,
37
- u as LabelComponent
26
+ u as Label,
27
+ b as LabelComponent
38
28
  };
39
29
  //# sourceMappingURL=fondue-components16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components16.js","sources":["../src/components/Label/Label.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { type ForwardedRef, forwardRef, type MouseEventHandler, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nexport type LabelProps = {\n id?: string;\n children: ReactNode;\n /**\n * The id of the input element the label is associated with\n */\n htmlFor: string;\n /**\n * Add an asterisk to the label to indicate it is required\n * @default false\n */\n required?: boolean;\n className?: string;\n onClick?: MouseEventHandler<HTMLLabelElement>;\n 'data-test-id'?: string;\n};\n\nexport const LabelComponent = (\n { className, 'data-test-id': dataTestId = 'fondue-label', children, ...props }: LabelProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) => {\n return (\n <LabelPrimitive.Root\n ref={ref}\n data-required={props.required}\n className={cn(\n 'tw-group tw-relative tw-flex tw-gap-1 tw-font-body--stack tw-text-body-medium tw-text-text-weak tw-transition-colors',\n // Peer-based color changes (apply to parent, inherit to spans)\n 'peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text has-[~_button:hover:not(:disabled)]:tw-text-text',\n // Use adjacent sibling selector when checkbox is checked\n '[*[data-state=\"checked\"]+&]:tw-font-medium [*[data-state=\"indeterminate\"]+&]:tw-font-medium',\n // Disabled state styling and cursor\n 'has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed',\n // Required asterisk\n 'after:tw-hidden data-[required=\"true\"]:after:tw-flex after:tw-content-[\"*\"] after:-tw-ml-1 after:tw-font-body--stack after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',\n className,\n )}\n data-test-id={dataTestId}\n onClick={(event) => {\n // Add support of Select component, Radix only allows native `select`\n // but we use `div[role=combobox]` because of downshift\n // https://github.com/radix-ui/primitives/blob/6e75e117977c9e6ffa939e6951a707f16ba0f95e/packages/react/label/src/label.tsx#L22\n const targetId = (event.target as HTMLElement).getAttribute('for');\n const target = targetId ? document.getElementById(targetId) : null;\n\n if (target && target.getAttribute('role') === 'combobox') {\n event.preventDefault();\n event.stopPropagation();\n target.click();\n }\n }}\n {...props}\n >\n {/* Hidden version with medium font weight to reserve space */}\n <span className=\"tw-font-medium tw-opacity-0 tw-pointer-events-none\" aria-hidden=\"true\">\n {children}\n </span>\n {/* Visible version (inherits all styling from parent) */}\n <span className=\"tw-absolute tw-inset-0\">{children}</span>\n </LabelPrimitive.Root>\n );\n};\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(LabelComponent);\nLabel.displayName = 'Label';\n"],"names":["LabelComponent","className","dataTestId","children","props","ref","jsxs","LabelPrimitive","cn","event","targetId","target","jsx","Label","forwardRef"],"mappings":";;;;AAwBO,MAAMA,IAAiB,CAC1B,EAAE,WAAAC,GAAW,gBAAgBC,IAAa,gBAAgB,UAAAC,GAAU,GAAGC,EAAA,GACvEC,MAGI,gBAAAC;AAAA,EAACC,EAAe;AAAA,EAAf;AAAA,IACG,KAAAF;AAAA,IACA,iBAAeD,EAAM;AAAA,IACrB,WAAWI;AAAA,MACP;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA,MACAP;AAAA,IAAA;AAAA,IAEJ,gBAAcC;AAAA,IACd,SAAS,CAACO,MAAU;AAIhB,YAAMC,IAAYD,EAAM,OAAuB,aAAa,KAAK,GAC3DE,IAASD,IAAW,SAAS,eAAeA,CAAQ,IAAI;AAE9D,MAAIC,KAAUA,EAAO,aAAa,MAAM,MAAM,eAC1CF,EAAM,eAAA,GACNA,EAAM,gBAAA,GACNE,EAAO,MAAA;AAAA,IAEf;AAAA,IACC,GAAGP;AAAA,IAGJ,UAAA;AAAA,MAAA,gBAAAQ,EAAC,QAAA,EAAK,WAAU,sDAAqD,eAAY,QAC5E,UAAAT,GACL;AAAA,MAEA,gBAAAS,EAAC,QAAA,EAAK,WAAU,0BAA0B,UAAAT,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAAA,GAKlDU,IAAQC,EAAyCd,CAAc;AAC5Ea,EAAM,cAAc;"}
1
+ {"version":3,"file":"fondue-components16.js","sources":["../src/components/Label/Label.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { type ForwardedRef, forwardRef, type MouseEventHandler, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/label.module.scss';\n\nexport type LabelProps = {\n id?: string;\n children: ReactNode;\n /**\n * The id of the input element the label is associated with\n */\n htmlFor: string;\n /**\n * Add an asterisk to the label to indicate it is required\n * @default false\n */\n required?: boolean;\n className?: string;\n onClick?: MouseEventHandler<HTMLLabelElement>;\n 'data-test-id'?: string;\n};\n\nexport const LabelComponent = (\n { className, 'data-test-id': dataTestId = 'fondue-label', children, ...props }: LabelProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) => {\n return (\n <LabelPrimitive.Root\n ref={ref}\n data-required={props.required}\n className={cn(styles.root, className)}\n data-test-id={dataTestId}\n onClick={(event) => {\n // Add support of Select component, Radix only allows native `select`\n // but we use `div[role=combobox]` because of downshift\n // https://github.com/radix-ui/primitives/blob/6e75e117977c9e6ffa939e6951a707f16ba0f95e/packages/react/label/src/label.tsx#L22\n const targetId = (event.target as HTMLElement).getAttribute('for');\n const target = targetId ? document.getElementById(targetId) : null;\n\n if (target && target.getAttribute('role') === 'combobox') {\n event.preventDefault();\n event.stopPropagation();\n target.click();\n }\n }}\n {...props}\n >\n {/* Hidden version with medium font weight to reserve space */}\n <span className={styles.hiddenText} aria-hidden=\"true\">\n {children}\n </span>\n {/* Visible version (inherits all styling from parent) */}\n <span className={styles.visibleText}>{children}</span>\n </LabelPrimitive.Root>\n );\n};\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(LabelComponent);\nLabel.displayName = 'Label';\n"],"names":["LabelComponent","className","dataTestId","children","props","ref","jsxs","LabelPrimitive","cn","styles","event","targetId","target","jsx","Label","forwardRef"],"mappings":";;;;;AA0BO,MAAMA,IAAiB,CAC1B,EAAE,WAAAC,GAAW,gBAAgBC,IAAa,gBAAgB,UAAAC,GAAU,GAAGC,EAAA,GACvEC,MAGI,gBAAAC;AAAA,EAACC,EAAe;AAAA,EAAf;AAAA,IACG,KAAAF;AAAA,IACA,iBAAeD,EAAM;AAAA,IACrB,WAAWI,EAAGC,EAAO,MAAMR,CAAS;AAAA,IACpC,gBAAcC;AAAA,IACd,SAAS,CAACQ,MAAU;AAIhB,YAAMC,IAAYD,EAAM,OAAuB,aAAa,KAAK,GAC3DE,IAASD,IAAW,SAAS,eAAeA,CAAQ,IAAI;AAE9D,MAAIC,KAAUA,EAAO,aAAa,MAAM,MAAM,eAC1CF,EAAM,eAAA,GACNA,EAAM,gBAAA,GACNE,EAAO,MAAA;AAAA,IAEf;AAAA,IACC,GAAGR;AAAA,IAGJ,UAAA;AAAA,MAAA,gBAAAS,EAAC,UAAK,WAAWJ,EAAO,YAAY,eAAY,QAC3C,UAAAN,GACL;AAAA,MAEA,gBAAAU,EAAC,QAAA,EAAK,WAAWJ,EAAO,aAAc,UAAAN,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAAA,GAK9CW,IAAQC,EAAyCf,CAAc;AAC5Ec,EAAM,cAAc;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-progress";
3
3
  import { forwardRef as m } from "react";
4
- import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components58.js";
4
+ import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components60.js";
5
5
  const p = m(
6
6
  ({
7
7
  value: a,
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as i } from "react";
3
- import d from "./fondue-components59.js";
3
+ import d from "./fondue-components61.js";
4
4
  const s = i(
5
5
  ({
6
6
  variant: t = "progress",
@@ -1,7 +1,7 @@
1
1
  import { jsxs as b, jsx as l } from "react/jsx-runtime";
2
2
  import * as a from "@radix-ui/react-scroll-area";
3
3
  import { forwardRef as h } from "react";
4
- import o from "./fondue-components60.js";
4
+ import o from "./fondue-components62.js";
5
5
  const p = ({
6
6
  type: t = "hover",
7
7
  maxHeight: e = "100%",
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as m } from "react";
3
- import { propsToCssVariables as c } from "./fondue-components35.js";
4
- import f from "./fondue-components61.js";
3
+ import { propsToCssVariables as c } from "./fondue-components36.js";
4
+ import f from "./fondue-components63.js";
5
5
  const y = m(
6
6
  ({
7
7
  "data-test-id": a = "fondue-section",
@@ -1,8 +1,8 @@
1
1
  import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import * as n from "@radix-ui/react-toggle-group";
3
3
  import { forwardRef as i } from "react";
4
- import { useControllableState as N } from "./fondue-components62.js";
5
- import e from "./fondue-components63.js";
4
+ import { useControllableState as N } from "./fondue-components64.js";
5
+ import e from "./fondue-components65.js";
6
6
  const d = ({
7
7
  children: a,
8
8
  value: o,
@@ -4,12 +4,12 @@ import * as g from "@radix-ui/react-popover";
4
4
  import { Slot as q } from "@radix-ui/react-slot";
5
5
  import { useSelect as J } from "downshift";
6
6
  import { forwardRef as K, useRef as L, useState as Q } from "react";
7
- import { ForwardedRefCombobox as U } from "./fondue-components64.js";
8
- import { ForwardedRefSelectItem as W, ForwardedRefSelectItemGroup as X } from "./fondue-components65.js";
9
- import { SelectMenu as Y } from "./fondue-components66.js";
10
- import { ForwardedRefSelectSlot as Z } from "./fondue-components67.js";
11
- import o from "./fondue-components68.js";
12
- import { useSelectData as _ } from "./fondue-components69.js";
7
+ import { ForwardedRefCombobox as U } from "./fondue-components66.js";
8
+ import { ForwardedRefSelectItem as W, ForwardedRefSelectItemGroup as X } from "./fondue-components67.js";
9
+ import { SelectMenu as Y } from "./fondue-components68.js";
10
+ import { ForwardedRefSelectSlot as Z } from "./fondue-components69.js";
11
+ import o from "./fondue-components70.js";
12
+ import { useSelectData as _ } from "./fondue-components71.js";
13
13
  const S = ({
14
14
  children: h,
15
15
  onSelect: s,
@@ -1,7 +1,7 @@
1
1
  import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
2
  import * as e from "@radix-ui/react-slider";
3
3
  import { forwardRef as h, useRef as R } from "react";
4
- import r from "./fondue-components70.js";
4
+ import r from "./fondue-components72.js";
5
5
  const g = ({
6
6
  value: a,
7
7
  defaultValue: n = [0],
@@ -1,8 +1,8 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import * as o from "@radix-ui/react-switch";
3
3
  import { forwardRef as l } from "react";
4
- import { cn as f } from "./fondue-components37.js";
5
- import t from "./fondue-components71.js";
4
+ import { cn as f } from "./fondue-components38.js";
5
+ import t from "./fondue-components73.js";
6
6
  const n = ({
7
7
  value: a,
8
8
  defaultValue: i,
@@ -1,12 +1,12 @@
1
1
  import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
2
  import { IconArrowUp as A, IconArrowDown as K, IconArrowBidirectional as h } from "@frontify/fondue-icons";
3
3
  import { forwardRef as b, useRef as w, useMemo as j } from "react";
4
- import { useSyncRefs as g } from "./fondue-components47.js";
5
- import { useTextTruncation as N } from "./fondue-components72.js";
4
+ import { useSyncRefs as g } from "./fondue-components48.js";
5
+ import { useTextTruncation as N } from "./fondue-components74.js";
6
6
  import { Box as L } from "./fondue-components5.js";
7
7
  import { LoadingCircle as S } from "./fondue-components18.js";
8
- import i from "./fondue-components73.js";
9
- import { handleKeyDown as $, shouldIgnoreRowClick as D } from "./fondue-components74.js";
8
+ import i from "./fondue-components75.js";
9
+ import { handleKeyDown as $, shouldIgnoreRowClick as D } from "./fondue-components76.js";
10
10
  const R = b(
11
11
  ({ layout: a = "auto", fontSize: e = "medium", sticky: o, children: s, ...d }, l) => (
12
12
  // eslint-disable-next-line jsx-a11y-x/no-noninteractive-element-interactions
@@ -1,132 +1,140 @@
1
- import { jsx as a, jsxs as b } from "react/jsx-runtime";
2
- import { createContext as E, forwardRef as l, useContext as f, useRef as w, useEffect as O, useMemo as I, useCallback as q, createElement as z } from "react";
3
- import { IconDotsHorizontal as B } from "@frontify/fondue-icons";
4
- import * as c from "@radix-ui/react-tabs";
5
- import { useControllableState as H } from "./fondue-components62.js";
6
- import { Button as M } from "./fondue-components6.js";
7
- import { Dropdown as d } from "./fondue-components11.js";
8
- import { useTabTriggers as W } from "./fondue-components75.js";
9
- import n from "./fondue-components76.js";
10
- const m = E({
11
- value: "",
12
- disabled: !1
13
- });
14
- m.displayName = "TabConfigContext";
15
- const v = E({
16
- addTrigger: () => {
17
- }
18
- });
19
- v.displayName = "TabTriggerContext";
20
- const L = ({
21
- padding: t = "compact",
22
- activeTab: o,
23
- defaultActiveTab: s,
24
- size: r = "medium",
25
- onActiveTabChange: u,
26
- children: p,
27
- variant: T = "default",
28
- ...i
29
- }, S) => {
30
- var y;
31
- const [g, C] = H({
32
- prop: o,
33
- defaultProp: s,
34
- onChange: u
35
- }), x = q(
36
- (e) => {
37
- C(e);
38
- },
39
- [C]
40
- ), { triggerListRef: j, activeIndicatorRef: A, triggers: N, triggersOutOfView: h, addTrigger: R } = W({
41
- activeTab: g
42
- }), D = I(() => ({ addTrigger: R }), [R]);
43
- return /* @__PURE__ */ a(v.Provider, { value: D, children: /* @__PURE__ */ b(
44
- c.Root,
1
+ import { jsxs as g, jsx as t, Fragment as h } from "react/jsx-runtime";
2
+ import { IconPlus as z, IconCross as B } from "@frontify/fondue-icons";
3
+ import { useState as $, Children as T, isValidElement as x } from "react";
4
+ import s from "./fondue-components77.js";
5
+ const H = ({
6
+ "aria-label": e,
7
+ "data-test-id": n = "tag",
8
+ children: o,
9
+ disabled: a = !1,
10
+ emphasis: c = "strong",
11
+ onAddClick: m,
12
+ onClick: u,
13
+ onDismiss: i,
14
+ size: p = "default",
15
+ title: l,
16
+ variant: C
17
+ }) => {
18
+ const [v, d] = $(!1);
19
+ let r = null;
20
+ const f = T.map(o, (y) => x(y) && y.type === b ? (r = y.props.children, null) : y), S = {
21
+ "data-addable": !!m,
22
+ "data-component": "tag",
23
+ "data-disabled": a,
24
+ "data-dismissable": !!i,
25
+ "data-emphasis": c,
26
+ "data-size": p,
27
+ "data-variant": C,
28
+ className: s.root
29
+ };
30
+ return /* @__PURE__ */ g("div", { ...S, children: [
31
+ /* @__PURE__ */ t(
32
+ j,
33
+ {
34
+ "aria-label": e || l,
35
+ disabled: a,
36
+ hoverContent: r,
37
+ isHover: v,
38
+ onClick: u,
39
+ onMouseEnter: () => d(!0),
40
+ onMouseLeave: () => d(!1),
41
+ title: l,
42
+ "data-test-id": n,
43
+ children: f
44
+ }
45
+ ),
46
+ /* @__PURE__ */ t(
47
+ P,
48
+ {
49
+ "aria-label": e || l,
50
+ disabled: a,
51
+ onAddClick: m,
52
+ onDismiss: i
53
+ }
54
+ )
55
+ ] });
56
+ };
57
+ H.displayName = "Tag";
58
+ const j = ({
59
+ "aria-label": e,
60
+ "data-test-id": n,
61
+ children: o,
62
+ disabled: a = !1,
63
+ hoverContent: c,
64
+ isHover: m = !1,
65
+ onClick: u,
66
+ onMouseEnter: i,
67
+ onMouseLeave: p,
68
+ title: l
69
+ }) => {
70
+ let C = 0;
71
+ const v = T.map(o, (r) => {
72
+ if (x(r) && r.type === N) {
73
+ const f = C++;
74
+ return /* @__PURE__ */ t("div", { className: s.secondaryContent, children: r.props.children }, `secondary-${f}`);
75
+ }
76
+ return r;
77
+ }), d = c ? /* @__PURE__ */ g("div", { "data-hover": m, children: [
78
+ /* @__PURE__ */ t("div", { children: c }),
79
+ /* @__PURE__ */ t("div", { children: v })
80
+ ] }) : v;
81
+ return u ? /* @__PURE__ */ t(
82
+ "button",
45
83
  {
46
- ref: S,
47
- className: n.root,
48
- onValueChange: x,
49
- value: g ?? ((y = N[0]) == null ? void 0 : y.value),
50
- "data-tabs-content-padding": t,
51
- "data-tabs-variant": T,
52
- ...i,
53
- children: [
54
- /* @__PURE__ */ b("div", { className: n.triggerListWrapper, children: [
55
- /* @__PURE__ */ a(c.List, { ref: j, "data-size": r, className: n.triggerList, children: N.map((e) => /* @__PURE__ */ z(
56
- c.Trigger,
57
- {
58
- ...e.props,
59
- key: e.value,
60
- value: e.value,
61
- disabled: e.disabled,
62
- className: n.trigger,
63
- ref: e.ref
64
- },
65
- e.element
66
- )) }),
67
- /* @__PURE__ */ b(d.Root, { children: [
68
- h.length > 0 && /* @__PURE__ */ a(d.Trigger, { "data-test-id": "overflow-items-dropdown-trigger", children: /* @__PURE__ */ a(M, { emphasis: "default", aspect: "square", size: "small", children: /* @__PURE__ */ a(B, { size: 16 }) }) }),
69
- /* @__PURE__ */ a(d.Content, { align: "end", "data-test-id": "overflow-items-dropdown-content", children: h.map((e) => /* @__PURE__ */ z(
70
- d.Item,
71
- {
72
- ...e.props,
73
- disabled: e.disabled,
74
- onSelect: () => x(e.value),
75
- key: e.value
76
- },
77
- e.element
78
- )) })
79
- ] }),
80
- /* @__PURE__ */ a(
81
- "span",
82
- {
83
- "data-test-id": "active-tab-indicator",
84
- ref: A,
85
- className: n.activeIndicator
86
- }
87
- )
88
- ] }),
89
- p
90
- ]
84
+ type: "button",
85
+ "aria-label": e,
86
+ title: l,
87
+ className: s.mainContent,
88
+ onClick: a ? void 0 : u,
89
+ onMouseEnter: i,
90
+ onMouseLeave: p,
91
+ disabled: a,
92
+ "data-test-id": n,
93
+ children: d
91
94
  }
92
- ) });
93
- };
94
- L.displayName = "Tabs.Root";
95
- const V = ({ children: t, value: o, disabled: s }) => {
96
- const r = I(() => ({ value: o, disabled: s }), [o, s]);
97
- return /* @__PURE__ */ a(m.Provider, { value: r, children: t });
98
- };
99
- V.displayName = "Tabs.Tab";
100
- const k = ({ children: t, ...o }, s) => {
101
- const { value: r, disabled: u } = f(m), { addTrigger: p } = f(v), T = w(null), i = w();
102
- return O(() => {
103
- p({
104
- ref: T || s,
105
- value: r ?? "",
106
- disabled: u,
107
- props: o,
108
- element: t,
109
- previousElement: i.current
110
- }), i.current = t;
111
- }, [t]), null;
112
- };
113
- k.displayName = "Tabs.Trigger";
114
- const P = ({ children: t, ...o }, s) => {
115
- const { value: r } = f(m);
116
- return /* @__PURE__ */ a(c.Content, { ref: s, ...o, className: n.content, value: r ?? "", children: t });
117
- };
118
- P.displayName = "Tabs.Content";
119
- const Z = {
120
- Root: l(L),
121
- Tab: l(V),
122
- Trigger: l(k),
123
- Content: l(P)
124
- };
95
+ ) : /* @__PURE__ */ t(
96
+ "div",
97
+ {
98
+ className: s.mainContent,
99
+ onMouseEnter: i,
100
+ onMouseLeave: p,
101
+ "data-test-id": n,
102
+ children: d
103
+ }
104
+ );
105
+ }, P = ({ "aria-label": e, disabled: n, onAddClick: o, onDismiss: a }) => /* @__PURE__ */ g(h, { children: [
106
+ o && /* @__PURE__ */ t(
107
+ "button",
108
+ {
109
+ type: "button",
110
+ "aria-label": `Add ${e || ""}`,
111
+ className: s.actionButton,
112
+ disabled: n,
113
+ onClick: o,
114
+ children: /* @__PURE__ */ t(z, { size: "16" })
115
+ }
116
+ ),
117
+ a && /* @__PURE__ */ t(
118
+ "button",
119
+ {
120
+ type: "button",
121
+ "aria-label": `Dismiss ${e || ""}`,
122
+ className: s.actionButton,
123
+ disabled: n,
124
+ onClick: a,
125
+ children: /* @__PURE__ */ t(B, { size: "16" })
126
+ }
127
+ )
128
+ ] }), b = ({ children: e }) => /* @__PURE__ */ t(h, { children: e });
129
+ b.displayName = "Tag.HoverContent";
130
+ const N = ({ children: e }) => /* @__PURE__ */ t(h, { children: e });
131
+ N.displayName = "Tag.SecondaryContent";
132
+ const I = H;
133
+ I.HoverContent = b;
134
+ I.SecondaryContent = N;
125
135
  export {
126
- Z as Tabs,
127
- P as TabsContent,
128
- L as TabsRoot,
129
- V as TabsTab,
130
- k as TabsTrigger
136
+ I as Tag,
137
+ b as TagHoverContent,
138
+ N as TagSecondaryContent
131
139
  };
132
140
  //# sourceMappingURL=fondue-components26.js.map