@frontify/fondue-components 21.0.1 → 22.1.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 (60) hide show
  1. package/dist/fondue-components11.js +62 -47
  2. package/dist/fondue-components11.js.map +1 -1
  3. package/dist/fondue-components13.js +71 -69
  4. package/dist/fondue-components13.js.map +1 -1
  5. package/dist/fondue-components19.js +66 -61
  6. package/dist/fondue-components19.js.map +1 -1
  7. package/dist/fondue-components25.js +111 -97
  8. package/dist/fondue-components25.js.map +1 -1
  9. package/dist/fondue-components27.js +20 -18
  10. package/dist/fondue-components27.js.map +1 -1
  11. package/dist/fondue-components29.js +56 -51
  12. package/dist/fondue-components29.js.map +1 -1
  13. package/dist/fondue-components31.js +12 -12
  14. package/dist/fondue-components31.js.map +1 -1
  15. package/dist/fondue-components32.js +37 -37
  16. package/dist/fondue-components32.js.map +1 -1
  17. package/dist/fondue-components33.js +1 -1
  18. package/dist/fondue-components34.js +2 -2
  19. package/dist/fondue-components35.js +1 -1
  20. package/dist/fondue-components37.js +1 -1
  21. package/dist/fondue-components39.js +1 -1
  22. package/dist/fondue-components4.js +1 -1
  23. package/dist/fondue-components4.js.map +1 -1
  24. package/dist/fondue-components42.js +1 -1
  25. package/dist/fondue-components50.js +4 -4
  26. package/dist/fondue-components52.js +1 -1
  27. package/dist/fondue-components52.js.map +1 -1
  28. package/dist/fondue-components54.js +14 -14
  29. package/dist/fondue-components55.js +1 -1
  30. package/dist/fondue-components56.js +12 -12
  31. package/dist/fondue-components57.js +1 -1
  32. package/dist/fondue-components59.js +5 -5
  33. package/dist/fondue-components62.js +4 -4
  34. package/dist/fondue-components63.js +1 -1
  35. package/dist/fondue-components65.js +14 -14
  36. package/dist/fondue-components68.js +42 -42
  37. package/dist/fondue-components68.js.map +1 -1
  38. package/dist/fondue-components70.js +34 -34
  39. package/dist/fondue-components73.js +8 -8
  40. package/dist/fondue-components75.js +18 -16
  41. package/dist/fondue-components75.js.map +1 -1
  42. package/dist/fondue-components77.js +8 -8
  43. package/dist/fondue-components78.js +47 -35
  44. package/dist/fondue-components78.js.map +1 -1
  45. package/dist/fondue-components79.js +10 -10
  46. package/dist/fondue-components81.js +16 -12
  47. package/dist/fondue-components81.js.map +1 -1
  48. package/dist/fondue-components84.js +1 -1
  49. package/dist/fondue-components85.js +5 -2
  50. package/dist/fondue-components85.js.map +1 -1
  51. package/dist/fondue-components86.js +4 -4
  52. package/dist/fondue-components86.js.map +1 -1
  53. package/dist/fondue-components87.js +2 -5
  54. package/dist/fondue-components87.js.map +1 -1
  55. package/dist/fondue-components88.js +10 -10
  56. package/dist/fondue-components9.js +71 -70
  57. package/dist/fondue-components9.js.map +1 -1
  58. package/dist/index.d.ts +30 -4
  59. package/dist/style.css +1 -1
  60. package/package.json +4 -4
@@ -1,59 +1,71 @@
1
- import { useRef as v, useState as w, useEffect as W, useLayoutEffect as p } from "react";
1
+ import { useRef as W, useState as p, useEffect as w, useLayoutEffect as I } from "react";
2
2
  const T = (e, s) => e.filter((f) => {
3
3
  var c;
4
- const o = (c = f.ref) == null ? void 0 : c.current;
5
- return o ? o.offsetLeft + o.offsetWidth > (s == null ? void 0 : s.scrollLeft) + s.offsetWidth || o.offsetLeft - s.scrollLeft < 0 : !1;
6
- }), u = (e, s) => {
7
- const f = s.current, o = e == null ? void 0 : e.querySelector('[data-state="active"]');
8
- if (!e || !(o instanceof HTMLButtonElement) || !(f instanceof HTMLSpanElement))
4
+ const t = (c = f.ref) == null ? void 0 : c.current;
5
+ return t ? t.offsetLeft + t.offsetWidth > (s == null ? void 0 : s.scrollLeft) + s.offsetWidth || t.offsetLeft - s.scrollLeft < 0 : !1;
6
+ }), a = (e, s) => {
7
+ const f = s.current, t = e == null ? void 0 : e.querySelector('[data-state="active"]');
8
+ if (!e || !(t instanceof HTMLButtonElement) || !(f instanceof HTMLSpanElement))
9
9
  return;
10
- const c = (e == null ? void 0 : e.scrollLeft) > (o == null ? void 0 : o.offsetLeft), l = (o == null ? void 0 : o.offsetLeft) + (o == null ? void 0 : o.offsetWidth) > (e == null ? void 0 : e.offsetWidth);
11
- c ? (e.offsetWidth > o.offsetWidth + o.offsetLeft ? f.style.left = `${o.offsetLeft}px` : f.style.left = `${e.offsetWidth - o.offsetWidth}px`, f.style.width = `${o == null ? void 0 : o.offsetWidth}px`) : l ? (f.style.left = `${e.clientWidth - o.offsetWidth}px`, f.style.width = `${o.offsetWidth}px`) : (f.style.left = `${o.offsetLeft}px`, f.style.width = `${o.offsetWidth}px`);
12
- }, O = ({
10
+ const u = getComputedStyle(e).direction === "rtl", r = (e == null ? void 0 : e.scrollLeft) > (t == null ? void 0 : t.offsetLeft), l = (t == null ? void 0 : t.offsetLeft) + (t == null ? void 0 : t.offsetWidth) > (e == null ? void 0 : e.offsetWidth), o = (n) => u ? e.offsetWidth - n - t.offsetWidth : n;
11
+ if (r) {
12
+ if (e.offsetWidth > t.offsetWidth + t.offsetLeft)
13
+ f.style.insetInlineStart = `${o(t.offsetLeft)}px`;
14
+ else {
15
+ const i = e.offsetWidth - t.offsetWidth;
16
+ f.style.insetInlineStart = `${o(i)}px`;
17
+ }
18
+ f.style.width = `${t == null ? void 0 : t.offsetWidth}px`;
19
+ } else if (l) {
20
+ const n = e.clientWidth - t.offsetWidth;
21
+ f.style.insetInlineStart = `${o(n)}px`, f.style.width = `${t.offsetWidth}px`;
22
+ } else
23
+ f.style.insetInlineStart = `${o(t.offsetLeft)}px`, f.style.width = `${t.offsetWidth}px`;
24
+ }, b = ({
13
25
  activeTab: e
14
26
  }) => {
15
- const s = v(null), f = v(null), [o, c] = w([]), [l, i] = w([]);
16
- return W(() => {
17
- const t = s.current, n = t == null ? void 0 : t.querySelector('[data-state="active"]');
18
- n instanceof HTMLButtonElement && t instanceof HTMLDivElement && (u(t, f), n.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "end" }));
19
- }, [e, f]), p(() => {
20
- var d;
21
- const t = s.current, n = t == null ? void 0 : t.querySelector('[data-state="active"]');
22
- if (t instanceof HTMLDivElement && n instanceof HTMLButtonElement) {
23
- u(t, f);
24
- const a = new MutationObserver(() => {
25
- n.scrollIntoView({ behavior: "instant", block: "nearest", inline: "end" }), u(t, f);
27
+ const s = W(null), f = W(null), [t, c] = p([]), [u, r] = p([]);
28
+ return w(() => {
29
+ const o = s.current, n = o == null ? void 0 : o.querySelector('[data-state="active"]');
30
+ n instanceof HTMLButtonElement && o instanceof HTMLDivElement && (a(o, f), n.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "end" }));
31
+ }, [e, f]), I(() => {
32
+ var i;
33
+ const o = s.current, n = o == null ? void 0 : o.querySelector('[data-state="active"]');
34
+ if (o instanceof HTMLDivElement && n instanceof HTMLButtonElement) {
35
+ a(o, f);
36
+ const d = new MutationObserver(() => {
37
+ n.scrollIntoView({ behavior: "instant", block: "nearest", inline: "end" }), a(o, f);
26
38
  });
27
- t.parentNode && a.observe(t.parentNode, { childList: !0 });
28
- const r = new IntersectionObserver(
39
+ o.parentNode && d.observe(o.parentNode, { childList: !0 });
40
+ const h = new IntersectionObserver(
29
41
  () => {
30
- i(T(o, t)), u(t, f);
42
+ r(T(t, o)), a(o, f);
31
43
  },
32
44
  {
33
- root: t,
45
+ root: o,
34
46
  threshold: 1
35
47
  }
36
48
  );
37
- for (const h of o)
38
- (d = h.ref) != null && d.current && r.observe(h.ref.current);
49
+ for (const v of t)
50
+ (i = v.ref) != null && i.current && h.observe(v.ref.current);
39
51
  return () => {
40
- r.disconnect(), a.disconnect();
52
+ h.disconnect(), d.disconnect();
41
53
  };
42
54
  }
43
- }, [o, s, f]), {
55
+ }, [t, s, f]), {
44
56
  triggerListRef: s,
45
57
  activeIndicatorRef: f,
46
- triggersOutOfView: l,
47
- triggers: o,
48
- addTrigger: (t) => {
49
- t.previousElement || c((n) => [...n, t]), c((n) => {
50
- const d = n.findIndex((a) => a.element === t.previousElement);
51
- return n[d] = t, [...n];
58
+ triggersOutOfView: u,
59
+ triggers: t,
60
+ addTrigger: (o) => {
61
+ o.previousElement || c((n) => [...n, o]), c((n) => {
62
+ const i = n.findIndex((d) => d.element === o.previousElement);
63
+ return n[i] = o, [...n];
52
64
  });
53
65
  }
54
66
  };
55
67
  };
56
68
  export {
57
- O as useTabTriggers
69
+ b as useTabTriggers
58
70
  };
59
71
  //# sourceMappingURL=fondue-components78.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components78.js","sources":["../src/components/Tabs/hooks/useTabTriggers.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RefObject, useEffect, useLayoutEffect, useRef, useState } from 'react';\n\nimport { type TabTrigger } from '../types';\n\nconst getOverflowingTriggers = (triggers: TabTrigger[], triggerListElement: HTMLDivElement) => {\n return triggers.filter((trigger) => {\n const triggerElement = trigger.ref?.current;\n if (!triggerElement) {\n return false;\n }\n return (\n triggerElement.offsetLeft + triggerElement.offsetWidth >\n triggerListElement?.scrollLeft + triggerListElement.offsetWidth ||\n triggerElement.offsetLeft - triggerListElement.scrollLeft < 0\n );\n });\n};\n\nconst moveActiveIndicator = (triggerListElement: HTMLDivElement, activeIndicatorRef: RefObject<HTMLSpanElement>) => {\n const activeIndicatorElement = activeIndicatorRef.current;\n const activeTriggerElement = triggerListElement?.querySelector('[data-state=\"active\"]');\n\n if (\n !triggerListElement ||\n !(activeTriggerElement instanceof HTMLButtonElement) ||\n !(activeIndicatorElement instanceof HTMLSpanElement)\n ) {\n return;\n }\n\n const isOverflowingLeft = triggerListElement?.scrollLeft > activeTriggerElement?.offsetLeft;\n const isOverflowingRight =\n activeTriggerElement?.offsetLeft + activeTriggerElement?.offsetWidth > triggerListElement?.offsetWidth;\n\n if (isOverflowingLeft) {\n const willFitAllItemsToTheLeft =\n triggerListElement.offsetWidth > activeTriggerElement.offsetWidth + activeTriggerElement.offsetLeft;\n if (willFitAllItemsToTheLeft) {\n activeIndicatorElement.style.left = `${activeTriggerElement.offsetLeft}px`;\n } else {\n activeIndicatorElement.style.left = `${triggerListElement.offsetWidth - activeTriggerElement.offsetWidth}px`;\n }\n activeIndicatorElement.style.width = `${activeTriggerElement?.offsetWidth}px`;\n } else if (isOverflowingRight) {\n activeIndicatorElement.style.left = `${triggerListElement.clientWidth - activeTriggerElement.offsetWidth}px`;\n activeIndicatorElement.style.width = `${activeTriggerElement.offsetWidth}px`;\n } else {\n activeIndicatorElement.style.left = `${activeTriggerElement.offsetLeft}px`;\n activeIndicatorElement.style.width = `${activeTriggerElement.offsetWidth}px`;\n }\n};\n\nexport const useTabTriggers = ({\n activeTab,\n}: {\n activeTab?: string;\n}): {\n triggerListRef: RefObject<HTMLDivElement>;\n activeIndicatorRef: RefObject<HTMLSpanElement>;\n triggers: TabTrigger[];\n triggersOutOfView: TabTrigger[];\n addTrigger: (trigger: TabTrigger) => void;\n} => {\n const triggerListRef = useRef<HTMLDivElement | null>(null);\n const activeIndicatorRef = useRef<HTMLSpanElement | null>(null);\n const [triggers, setTriggers] = useState<TabTrigger[]>([]);\n const [triggersOutOfView, setTriggersOutOfView] = useState<TabTrigger[]>([]);\n\n // move the active indicator and scroll to the correct position when the tab changes\n useEffect(() => {\n const triggerListElement = triggerListRef.current;\n const activeTriggerElement = triggerListElement?.querySelector('[data-state=\"active\"]');\n\n if (activeTriggerElement instanceof HTMLButtonElement && triggerListElement instanceof HTMLDivElement) {\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n activeTriggerElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'end' });\n }\n }, [activeTab, activeIndicatorRef]);\n\n useLayoutEffect(() => {\n const triggerListElement = triggerListRef.current;\n const activeTriggerElement = triggerListElement?.querySelector('[data-state=\"active\"]');\n\n if (triggerListElement instanceof HTMLDivElement && activeTriggerElement instanceof HTMLButtonElement) {\n // move the active indicator to the initial active tab\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n\n // observe addition of the dropdown trigger which reduces the available width\n const mutationObserver = new MutationObserver(() => {\n activeTriggerElement.scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'end' });\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n });\n if (triggerListElement.parentNode) {\n mutationObserver.observe(triggerListElement.parentNode, { childList: true });\n }\n\n // calculate the overflowing elements when item starts overflowing the parent\n const intersectionObserver = new IntersectionObserver(\n () => {\n setTriggersOutOfView(getOverflowingTriggers(triggers, triggerListElement));\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n },\n {\n root: triggerListElement,\n threshold: 1,\n },\n );\n for (const trigger of triggers) {\n if (trigger.ref?.current) {\n intersectionObserver.observe(trigger.ref.current);\n }\n }\n\n return () => {\n intersectionObserver.disconnect();\n mutationObserver.disconnect();\n };\n }\n }, [triggers, triggerListRef, activeIndicatorRef]);\n\n const addTrigger = (trigger: TabTrigger) => {\n if (!trigger.previousElement) {\n setTriggers((prev) => [...prev, trigger]);\n }\n\n setTriggers((prev) => {\n const index = prev.findIndex((element) => element.element === trigger.previousElement);\n prev[index] = trigger;\n return [...prev];\n });\n };\n\n return {\n triggerListRef,\n activeIndicatorRef,\n triggersOutOfView,\n triggers,\n addTrigger,\n };\n};\n"],"names":["getOverflowingTriggers","triggers","triggerListElement","trigger","triggerElement","_a","moveActiveIndicator","activeIndicatorRef","activeIndicatorElement","activeTriggerElement","isOverflowingLeft","isOverflowingRight","useTabTriggers","activeTab","triggerListRef","useRef","setTriggers","useState","triggersOutOfView","setTriggersOutOfView","useEffect","useLayoutEffect","mutationObserver","intersectionObserver","prev","index","element"],"mappings":";AAMA,MAAMA,IAAyB,CAACC,GAAwBC,MAC7CD,EAAS,OAAO,CAACE,MAAY;;AAChC,QAAMC,KAAiBC,IAAAF,EAAQ,QAAR,gBAAAE,EAAa;AACpC,SAAKD,IAIDA,EAAe,aAAaA,EAAe,eACvCF,KAAA,gBAAAA,EAAoB,cAAaA,EAAmB,eACxDE,EAAe,aAAaF,EAAmB,aAAa,IALrD;AAOf,CAAC,GAGCI,IAAsB,CAACJ,GAAoCK,MAAmD;AAChH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AK,IAAItB,GACP,CAAC,GAAGqB,CAAI;AAAA,MACnB,CAAC;AAAA,IACL;AAAA,EAOI;AAER;"}
1
+ {"version":3,"file":"fondue-components78.js","sources":["../src/components/Tabs/hooks/useTabTriggers.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RefObject, useEffect, useLayoutEffect, useRef, useState } from 'react';\n\nimport { type TabTrigger } from '../types';\n\nconst getOverflowingTriggers = (triggers: TabTrigger[], triggerListElement: HTMLDivElement) => {\n return triggers.filter((trigger) => {\n const triggerElement = trigger.ref?.current;\n if (!triggerElement) {\n return false;\n }\n return (\n triggerElement.offsetLeft + triggerElement.offsetWidth >\n triggerListElement?.scrollLeft + triggerListElement.offsetWidth ||\n triggerElement.offsetLeft - triggerListElement.scrollLeft < 0\n );\n });\n};\n\nconst moveActiveIndicator = (triggerListElement: HTMLDivElement, activeIndicatorRef: RefObject<HTMLSpanElement>) => {\n const activeIndicatorElement = activeIndicatorRef.current;\n const activeTriggerElement = triggerListElement?.querySelector('[data-state=\"active\"]');\n\n if (\n !triggerListElement ||\n !(activeTriggerElement instanceof HTMLButtonElement) ||\n !(activeIndicatorElement instanceof HTMLSpanElement)\n ) {\n return;\n }\n\n // Get the computed direction to handle RTL correctly\n const direction = getComputedStyle(triggerListElement).direction;\n const isRTL = direction === 'rtl';\n\n const isOverflowingLeft = triggerListElement?.scrollLeft > activeTriggerElement?.offsetLeft;\n const isOverflowingRight =\n activeTriggerElement?.offsetLeft + activeTriggerElement?.offsetWidth > triggerListElement?.offsetWidth;\n\n // Helper function to calculate position based on direction\n const getInlineStartPosition = (position: number) => {\n if (isRTL) {\n // In RTL, insetInlineStart maps to 'right', so we need to calculate from the right edge\n return triggerListElement.offsetWidth - position - activeTriggerElement.offsetWidth;\n }\n return position;\n };\n\n if (isOverflowingLeft) {\n const willFitAllItemsToTheLeft =\n triggerListElement.offsetWidth > activeTriggerElement.offsetWidth + activeTriggerElement.offsetLeft;\n if (willFitAllItemsToTheLeft) {\n activeIndicatorElement.style.insetInlineStart = `${getInlineStartPosition(activeTriggerElement.offsetLeft)}px`;\n } else {\n const position = triggerListElement.offsetWidth - activeTriggerElement.offsetWidth;\n activeIndicatorElement.style.insetInlineStart = `${getInlineStartPosition(position)}px`;\n }\n activeIndicatorElement.style.width = `${activeTriggerElement?.offsetWidth}px`;\n } else if (isOverflowingRight) {\n const position = triggerListElement.clientWidth - activeTriggerElement.offsetWidth;\n activeIndicatorElement.style.insetInlineStart = `${getInlineStartPosition(position)}px`;\n activeIndicatorElement.style.width = `${activeTriggerElement.offsetWidth}px`;\n } else {\n activeIndicatorElement.style.insetInlineStart = `${getInlineStartPosition(activeTriggerElement.offsetLeft)}px`;\n activeIndicatorElement.style.width = `${activeTriggerElement.offsetWidth}px`;\n }\n};\n\nexport const useTabTriggers = ({\n activeTab,\n}: {\n activeTab?: string;\n}): {\n triggerListRef: RefObject<HTMLDivElement>;\n activeIndicatorRef: RefObject<HTMLSpanElement>;\n triggers: TabTrigger[];\n triggersOutOfView: TabTrigger[];\n addTrigger: (trigger: TabTrigger) => void;\n} => {\n const triggerListRef = useRef<HTMLDivElement | null>(null);\n const activeIndicatorRef = useRef<HTMLSpanElement | null>(null);\n const [triggers, setTriggers] = useState<TabTrigger[]>([]);\n const [triggersOutOfView, setTriggersOutOfView] = useState<TabTrigger[]>([]);\n\n // move the active indicator and scroll to the correct position when the tab changes\n useEffect(() => {\n const triggerListElement = triggerListRef.current;\n const activeTriggerElement = triggerListElement?.querySelector('[data-state=\"active\"]');\n\n if (activeTriggerElement instanceof HTMLButtonElement && triggerListElement instanceof HTMLDivElement) {\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n activeTriggerElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'end' });\n }\n }, [activeTab, activeIndicatorRef]);\n\n useLayoutEffect(() => {\n const triggerListElement = triggerListRef.current;\n const activeTriggerElement = triggerListElement?.querySelector('[data-state=\"active\"]');\n\n if (triggerListElement instanceof HTMLDivElement && activeTriggerElement instanceof HTMLButtonElement) {\n // move the active indicator to the initial active tab\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n\n // observe addition of the dropdown trigger which reduces the available width\n const mutationObserver = new MutationObserver(() => {\n activeTriggerElement.scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'end' });\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n });\n if (triggerListElement.parentNode) {\n mutationObserver.observe(triggerListElement.parentNode, { childList: true });\n }\n\n // calculate the overflowing elements when item starts overflowing the parent\n const intersectionObserver = new IntersectionObserver(\n () => {\n setTriggersOutOfView(getOverflowingTriggers(triggers, triggerListElement));\n moveActiveIndicator(triggerListElement, activeIndicatorRef);\n },\n {\n root: triggerListElement,\n threshold: 1,\n },\n );\n for (const trigger of triggers) {\n if (trigger.ref?.current) {\n intersectionObserver.observe(trigger.ref.current);\n }\n }\n\n return () => {\n intersectionObserver.disconnect();\n mutationObserver.disconnect();\n };\n }\n }, [triggers, triggerListRef, activeIndicatorRef]);\n\n const addTrigger = (trigger: TabTrigger) => {\n if (!trigger.previousElement) {\n setTriggers((prev) => [...prev, trigger]);\n }\n\n setTriggers((prev) => {\n const index = prev.findIndex((element) => element.element === trigger.previousElement);\n prev[index] = trigger;\n return [...prev];\n });\n };\n\n return {\n triggerListRef,\n activeIndicatorRef,\n triggersOutOfView,\n triggers,\n addTrigger,\n };\n};\n"],"names":["getOverflowingTriggers","triggers","triggerListElement","trigger","triggerElement","_a","moveActiveIndicator","activeIndicatorRef","activeIndicatorElement","activeTriggerElement","isRTL","isOverflowingLeft","isOverflowingRight","getInlineStartPosition","position","useTabTriggers","activeTab","triggerListRef","useRef","setTriggers","useState","triggersOutOfView","setTriggersOutOfView","useEffect","useLayoutEffect","mutationObserver","intersectionObserver","prev","index","element"],"mappings":";AAMA,MAAMA,IAAyB,CAACC,GAAwBC,MAC7CD,EAAS,OAAO,CAACE,MAAY;;AAChC,QAAMC,KAAiBC,IAAAF,EAAQ,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Q,QAAR,QAAAE,EAAa,WACbqB,EAAqB,QAAQvB,EAAQ,IAAI,OAAO;AAIxD,aAAO,MAAM;AACT,QAAAuB,EAAqB,WAAA,GACrBD,EAAiB,WAAA;AAAA,MACrB;AAAA,IACJ;AAAA,EACJ,GAAG,CAACxB,GAAUgB,GAAgBV,CAAkB,CAAC,GAc1C;AAAA,IACH,gBAAAU;AAAA,IACA,oBAAAV;AAAA,IACA,mBAAAc;AAAA,IACA,UAAApB;AAAA,IACA,YAjBe,CAACE,MAAwB;AACxC,MAAKA,EAAQ,mBACTgB,EAAY,CAACQ,MAAS,CAAC,GAAGA,GAAMxB,CAAO,CAAC,GAG5CgB,EAAY,CAACQ,MAAS;AAClB,cAAMC,IAAQD,EAAK,UAAU,CAACE,MAAYA,EAAQ,YAAY1B,EAAQ,eAAe;AACrF,eAAAwB,EAAKC,CAAK,IAAIzB,GACP,CAAC,GAAGwB,CAAI;AAAA,MACnB,CAAC;AAAA,IACL;AAAA,EAOI;AAER;"}
@@ -1,18 +1,18 @@
1
- const t = "_root_pmkrp_5", r = "_triggerListWrapper_pmkrp_13", e = "_trigger_pmkrp_13", i = "_activeIndicator_pmkrp_61", o = "_triggerList_pmkrp_13", p = "_content_pmkrp_149", g = {
1
+ const t = "_root_1gr64_5", r = "_triggerListWrapper_1gr64_13", g = "_trigger_1gr64_13", e = "_activeIndicator_1gr64_61", i = "_triggerList_1gr64_13", o = "_content_1gr64_149", _ = {
2
2
  root: t,
3
3
  triggerListWrapper: r,
4
- trigger: e,
5
- activeIndicator: i,
6
- triggerList: o,
7
- content: p
4
+ trigger: g,
5
+ activeIndicator: e,
6
+ triggerList: i,
7
+ content: o
8
8
  };
9
9
  export {
10
- i as activeIndicator,
11
- p as content,
12
- g as default,
10
+ e as activeIndicator,
11
+ o as content,
12
+ _ as default,
13
13
  t as root,
14
- e as trigger,
15
- o as triggerList,
14
+ g as trigger,
15
+ i as triggerList,
16
16
  r as triggerListWrapper
17
17
  };
18
18
  //# sourceMappingURL=fondue-components79.js.map
@@ -1,18 +1,22 @@
1
- const o = "_root_kjbh5_5", t = "_input_kjbh5_59", s = "_slot_kjbh5_82", c = "_iconSuccess_kjbh5_132", n = "_iconError_kjbh5_141", _ = "_loadingStatus_kjbh5_155", r = {
1
+ const o = "_root_heghf_5", t = "_slot_heghf_64", c = "_input_heghf_64", n = "_placeholder_heghf_69", s = "_iconSuccess_heghf_139", _ = "_iconError_heghf_147", e = "_loadingStatus_heghf_160", r = "_inputWrapper_heghf_196", h = {
2
2
  root: o,
3
- input: t,
4
- slot: s,
5
- iconSuccess: c,
6
- iconError: n,
7
- loadingStatus: _
3
+ slot: t,
4
+ input: c,
5
+ placeholder: n,
6
+ iconSuccess: s,
7
+ iconError: _,
8
+ loadingStatus: e,
9
+ inputWrapper: r
8
10
  };
9
11
  export {
10
- r as default,
11
- n as iconError,
12
- c as iconSuccess,
13
- t as input,
14
- _ as loadingStatus,
12
+ h as default,
13
+ _ as iconError,
14
+ s as iconSuccess,
15
+ c as input,
16
+ r as inputWrapper,
17
+ e as loadingStatus,
18
+ n as placeholder,
15
19
  o as root,
16
- s as slot
20
+ t as slot
17
21
  };
18
22
  //# sourceMappingURL=fondue-components81.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components81.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"fondue-components81.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- const o = "_root_13m98_4", r = "_arrow_13m98_25", t = {
1
+ const o = "_root_17g9r_4", r = "_arrow_17g9r_27", t = {
2
2
  root: o,
3
3
  arrow: r
4
4
  };
@@ -1,5 +1,8 @@
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 o = "_root_b0bc4_2", t = {
2
+ root: o
3
+ };
2
4
  export {
3
- t as FOCUS_OUTLINE
5
+ t as default,
6
+ o as root
4
7
  };
5
8
  //# sourceMappingURL=fondue-components85.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components85.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-components85.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,8 +1,8 @@
1
- const o = "_root_e5fqt_2", t = {
2
- root: o
1
+ const r = (e) => {
2
+ if (e)
3
+ return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
3
4
  };
4
5
  export {
5
- t as default,
6
- o as root
6
+ r as colorToCss
7
7
  };
8
8
  //# sourceMappingURL=fondue-components86.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components86.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"fondue-components86.js","sources":["../src/components/Badge/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n"],"names":["colorToCss","color"],"mappings":"AAiBO,MAAMA,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF;"}
@@ -1,8 +1,5 @@
1
- const r = (e) => {
2
- if (e)
3
- return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
4
- };
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";
5
2
  export {
6
- r as colorToCss
3
+ t as FOCUS_OUTLINE
7
4
  };
8
5
  //# sourceMappingURL=fondue-components87.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components87.js","sources":["../src/components/Badge/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n"],"names":["colorToCss","color"],"mappings":"AAiBO,MAAMA,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF;"}
1
+ {"version":3,"file":"fondue-components87.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,20 +1,20 @@
1
- const o = "_root_x0mxj_5", c = "_clearIcon_x0mxj_35", t = "_caret_x0mxj_52", _ = "_colorName_x0mxj_70", n = "_button_x0mxj_91", r = "_colorIndicator_x0mxj_104", a = "_actions_x0mxj_123", x = {
1
+ const o = "_root_2prsn_5", c = "_clearIcon_2prsn_35", t = "_caret_2prsn_52", n = "_colorName_2prsn_70", r = "_button_2prsn_91", s = "_colorIndicator_2prsn_103", _ = "_actions_2prsn_122", a = {
2
2
  root: o,
3
3
  clearIcon: c,
4
4
  caret: t,
5
- colorName: _,
6
- button: n,
7
- colorIndicator: r,
8
- actions: a
5
+ colorName: n,
6
+ button: r,
7
+ colorIndicator: s,
8
+ actions: _
9
9
  };
10
10
  export {
11
- a as actions,
12
- n as button,
11
+ _ as actions,
12
+ r as button,
13
13
  t as caret,
14
14
  c as clearIcon,
15
- r as colorIndicator,
16
- _ as colorName,
17
- x as default,
15
+ s as colorIndicator,
16
+ n as colorName,
17
+ a as default,
18
18
  o as root
19
19
  };
20
20
  //# sourceMappingURL=fondue-components88.js.map
@@ -1,22 +1,22 @@
1
- import { jsx as o, jsxs as O } from "react/jsx-runtime";
2
- import { IconCross as P } from "@frontify/fondue-icons";
1
+ import { jsx as o, jsxs as P } from "react/jsx-runtime";
2
+ import { IconCross as j } from "@frontify/fondue-icons";
3
3
  import * as d from "@radix-ui/react-dialog";
4
- import { createContext as j, forwardRef as l, useRef as q, useContext as B, useMemo as z } from "react";
5
- import { useSyncRefs as E } from "./fondue-components48.js";
6
- import { addShowFocusRing as L, addAutoFocusAttribute as $ } from "./fondue-components49.js";
7
- import { useFondueTheme as k, ThemeProvider as G } from "./fondue-components31.js";
4
+ import { createContext as q, forwardRef as l, useRef as B, useContext as z, useMemo as E } from "react";
5
+ import { useSyncRefs as L } from "./fondue-components48.js";
6
+ import { addShowFocusRing as $, addAutoFocusAttribute as k } from "./fondue-components49.js";
7
+ import { useFondueTheme as G, ThemeProvider as I } from "./fondue-components31.js";
8
8
  import n from "./fondue-components50.js";
9
- const m = j({ isModal: !1 });
9
+ const m = q({ isModal: !1 });
10
10
  m.displayName = "DialogContext";
11
- const y = ({ children: t, modal: e, onOpenChange: a, open: i }) => {
12
- const r = z(() => ({ isModal: e ?? !1 }), [e]);
11
+ const D = ({ children: t, modal: e, onOpenChange: a, open: i }) => {
12
+ const r = E(() => ({ isModal: e ?? !1 }), [e]);
13
13
  return /* @__PURE__ */ o(m.Provider, { value: r, children: /* @__PURE__ */ o(d.Root, { open: i, onOpenChange: a, modal: e, children: t }) });
14
14
  };
15
- y.displayName = "Dialog.Root";
16
- const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-trigger" }, i) => /* @__PURE__ */ o(
15
+ D.displayName = "Dialog.Root";
16
+ const h = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-trigger" }, i) => /* @__PURE__ */ o(
17
17
  d.Trigger,
18
18
  {
19
- onMouseDown: $,
19
+ onMouseDown: k,
20
20
  "data-auto-focus-visible": "true",
21
21
  "data-auto-focus-trigger": !0,
22
22
  "data-test-id": a,
@@ -25,11 +25,11 @@ const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-tr
25
25
  children: e
26
26
  }
27
27
  );
28
- D.displayName = "Dialog.Trigger";
29
- const I = ({ children: t, showUnderlay: e }) => {
30
- const { isModal: a } = B(m);
28
+ h.displayName = "Dialog.Trigger";
29
+ const J = ({ children: t, showUnderlay: e }) => {
30
+ const { isModal: a } = z(m);
31
31
  return a ? /* @__PURE__ */ o(d.Overlay, { "data-visible": e, className: n.underlay, children: t }) : /* @__PURE__ */ o("div", { className: n.underlay, "data-visible": e, children: t });
32
- }, h = ({
32
+ }, C = ({
33
33
  maxWidth: t = "800px",
34
34
  minWidth: e = "400px",
35
35
  minHeight: a = "200px",
@@ -37,20 +37,20 @@ const I = ({ children: t, showUnderlay: e }) => {
37
37
  verticalAlign: r = "center",
38
38
  "data-test-id": s = "fondue-dialog-content",
39
39
  showUnderlay: c = !1,
40
- rounded: T = !0,
41
- children: w
42
- }, S) => {
43
- const M = k(), u = q(null);
44
- E(u, S);
45
- const A = (H) => {
46
- var f;
47
- H.preventDefault();
48
- const g = (f = u.current) == null ? void 0 : f.querySelector('[data-dialog-layout-component="body"]'), p = g == null ? void 0 : g.querySelector(
40
+ rounded: w = !0,
41
+ children: S
42
+ }, M) => {
43
+ const { theme: A, dir: p } = G(), u = B(null);
44
+ L(u, M);
45
+ const H = (O) => {
46
+ var y;
47
+ O.preventDefault();
48
+ const g = (y = u.current) == null ? void 0 : y.querySelector('[data-dialog-layout-component="body"]'), f = g == null ? void 0 : g.querySelector(
49
49
  'button:not([data-tooltip-trigger="true"]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
50
50
  );
51
- p instanceof HTMLElement && p.focus();
51
+ f instanceof HTMLElement && f.focus();
52
52
  };
53
- return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(G, { theme: M, children: /* @__PURE__ */ o(I, { showUnderlay: c, children: /* @__PURE__ */ o(
53
+ return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(I, { theme: A, dir: p, children: /* @__PURE__ */ o(J, { showUnderlay: c, children: /* @__PURE__ */ o(
54
54
  d.Content,
55
55
  {
56
56
  style: {
@@ -60,25 +60,26 @@ const I = ({ children: t, showUnderlay: e }) => {
60
60
  },
61
61
  ref: u,
62
62
  className: n.content,
63
- onFocus: L,
64
- onOpenAutoFocus: A,
63
+ onFocus: $,
64
+ onOpenAutoFocus: H,
65
65
  "data-dialog-padding": i,
66
- "data-dialog-rounded": T,
66
+ "data-dialog-rounded": w,
67
67
  "data-test-id": s,
68
68
  "data-dialog-vertical-align": r,
69
- children: w
69
+ dir: p,
70
+ children: S
70
71
  }
71
72
  ) }) }) });
72
73
  };
73
- h.displayName = "Dialog.Content";
74
- const C = ({
74
+ C.displayName = "Dialog.Content";
75
+ const N = ({
75
76
  padding: t,
76
77
  showBorder: e = !0,
77
78
  showCloseButton: a = !0,
78
79
  closeProps: i,
79
80
  children: r,
80
81
  "data-test-id": s = "fondue-dialog-header"
81
- }, c) => /* @__PURE__ */ O(
82
+ }, c) => /* @__PURE__ */ P(
82
83
  "div",
83
84
  {
84
85
  "data-test-id": s,
@@ -97,14 +98,14 @@ const C = ({
97
98
  className: "tw-cursor-pointer",
98
99
  "aria-label": "Close",
99
100
  ...i,
100
- children: /* @__PURE__ */ o(P, { size: 20 })
101
+ children: /* @__PURE__ */ o(j, { size: 20 })
101
102
  }
102
103
  )
103
104
  ]
104
105
  }
105
106
  );
106
- C.displayName = "Dialog.Header";
107
- const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" }, r) => /* @__PURE__ */ o(
107
+ N.displayName = "Dialog.Header";
108
+ const b = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" }, r) => /* @__PURE__ */ o(
108
109
  "div",
109
110
  {
110
111
  "data-test-id": i,
@@ -116,8 +117,8 @@ const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "f
116
117
  children: a
117
118
  }
118
119
  );
119
- N.displayName = "Dialog.Footer";
120
- const b = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }, i) => /* @__PURE__ */ o(
120
+ b.displayName = "Dialog.Footer";
121
+ const v = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }, i) => /* @__PURE__ */ o(
121
122
  "div",
122
123
  {
123
124
  "data-test-id": a,
@@ -128,38 +129,38 @@ const b = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }
128
129
  children: e
129
130
  }
130
131
  );
131
- b.displayName = "Dialog.Body";
132
- const v = ({ children: t, "data-test-id": e = "fondue-dialog-side-content" }, a) => /* @__PURE__ */ o("div", { "data-test-id": e, ref: a, className: n.sideContent, "data-dialog-layout-component": !0, children: t });
133
- v.displayName = "Dialog.SideContent";
134
- const x = ({ children: t }) => /* @__PURE__ */ o(d.Close, { asChild: !0, children: t });
135
- x.displayName = "Dialog.Close";
136
- const F = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Title, { asChild: e, children: t });
137
- F.displayName = "Dialog.Title";
138
- const R = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Description, { asChild: e, children: t });
139
- R.displayName = "Dialog.Description";
140
- const Y = {
141
- Root: y,
142
- Title: F,
143
- Description: R,
144
- Close: x,
145
- Trigger: l(D),
146
- Content: l(h),
147
- Header: l(C),
148
- Footer: l(N),
149
- Body: l(b),
150
- SideContent: l(v)
132
+ v.displayName = "Dialog.Body";
133
+ const x = ({ children: t, "data-test-id": e = "fondue-dialog-side-content" }, a) => /* @__PURE__ */ o("div", { "data-test-id": e, ref: a, className: n.sideContent, "data-dialog-layout-component": !0, children: t });
134
+ x.displayName = "Dialog.SideContent";
135
+ const F = ({ children: t }) => /* @__PURE__ */ o(d.Close, { asChild: !0, children: t });
136
+ F.displayName = "Dialog.Close";
137
+ const R = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Title, { asChild: e, children: t });
138
+ R.displayName = "Dialog.Title";
139
+ const T = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Description, { asChild: e, children: t });
140
+ T.displayName = "Dialog.Description";
141
+ const Z = {
142
+ Root: D,
143
+ Title: R,
144
+ Description: T,
145
+ Close: F,
146
+ Trigger: l(h),
147
+ Content: l(C),
148
+ Header: l(N),
149
+ Footer: l(b),
150
+ Body: l(v),
151
+ SideContent: l(x)
151
152
  };
152
153
  export {
153
- Y as Dialog,
154
- b as DialogBody,
155
- x as DialogClose,
156
- h as DialogContent,
157
- R as DialogDescription,
158
- N as DialogFooter,
159
- C as DialogHeader,
160
- y as DialogRoot,
161
- v as DialogSideContent,
162
- F as DialogTitle,
163
- D as DialogTrigger
154
+ Z as Dialog,
155
+ v as DialogBody,
156
+ F as DialogClose,
157
+ C as DialogContent,
158
+ T as DialogDescription,
159
+ b as DialogFooter,
160
+ N as DialogHeader,
161
+ D as DialogRoot,
162
+ x as DialogSideContent,
163
+ R as DialogTitle,
164
+ h as DialogTrigger
164
165
  };
165
166
  //# sourceMappingURL=fondue-components9.js.map