@frontify/fondue-components 8.0.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/fondue-components10.js +1 -1
  2. package/dist/fondue-components11.js +65 -75
  3. package/dist/fondue-components11.js.map +1 -1
  4. package/dist/fondue-components12.js +1 -1
  5. package/dist/fondue-components14.js +1 -1
  6. package/dist/fondue-components15.js +1 -1
  7. package/dist/fondue-components16.js +1 -1
  8. package/dist/fondue-components17.js +2 -2
  9. package/dist/fondue-components18.js +6 -6
  10. package/dist/fondue-components19.js +1 -1
  11. package/dist/fondue-components20.js +1 -1
  12. package/dist/fondue-components21.js +46 -46
  13. package/dist/fondue-components21.js.map +1 -1
  14. package/dist/fondue-components22.js +3 -3
  15. package/dist/fondue-components23.js +1 -1
  16. package/dist/fondue-components24.js +1 -1
  17. package/dist/fondue-components28.js +2 -2
  18. package/dist/fondue-components28.js.map +1 -1
  19. package/dist/fondue-components31.js +1 -1
  20. package/dist/fondue-components33.js +15 -15
  21. package/dist/fondue-components33.js.map +1 -1
  22. package/dist/fondue-components37.js +10 -25
  23. package/dist/fondue-components37.js.map +1 -1
  24. package/dist/fondue-components4.js +20 -18
  25. package/dist/fondue-components4.js.map +1 -1
  26. package/dist/fondue-components40.js +17 -14
  27. package/dist/fondue-components40.js.map +1 -1
  28. package/dist/fondue-components41.js +17 -18
  29. package/dist/fondue-components41.js.map +1 -1
  30. package/dist/fondue-components42.js +4 -16
  31. package/dist/fondue-components42.js.map +1 -1
  32. package/dist/fondue-components43.js +13 -3
  33. package/dist/fondue-components43.js.map +1 -1
  34. package/dist/fondue-components44.js +3 -13
  35. package/dist/fondue-components44.js.map +1 -1
  36. package/dist/fondue-components45.js +35 -5
  37. package/dist/fondue-components45.js.map +1 -1
  38. package/dist/fondue-components46.js +13 -35
  39. package/dist/fondue-components46.js.map +1 -1
  40. package/dist/fondue-components47.js +4 -12
  41. package/dist/fondue-components47.js.map +1 -1
  42. package/dist/fondue-components48.js +24 -4
  43. package/dist/fondue-components48.js.map +1 -1
  44. package/dist/fondue-components49.js +16 -24
  45. package/dist/fondue-components49.js.map +1 -1
  46. package/dist/fondue-components50.js +139 -16
  47. package/dist/fondue-components50.js.map +1 -1
  48. package/dist/fondue-components51.js +16 -140
  49. package/dist/fondue-components51.js.map +1 -1
  50. package/dist/fondue-components52.js +70 -16
  51. package/dist/fondue-components52.js.map +1 -1
  52. package/dist/fondue-components53.js +8 -72
  53. package/dist/fondue-components53.js.map +1 -1
  54. package/dist/fondue-components54.js +33 -8
  55. package/dist/fondue-components54.js.map +1 -1
  56. package/dist/fondue-components55.js +48 -32
  57. package/dist/fondue-components55.js.map +1 -1
  58. package/dist/fondue-components56.js +10 -48
  59. package/dist/fondue-components56.js.map +1 -1
  60. package/dist/fondue-components57.js +10 -8
  61. package/dist/fondue-components57.js.map +1 -1
  62. package/dist/fondue-components58.js +7 -12
  63. package/dist/fondue-components58.js.map +1 -1
  64. package/dist/fondue-components59.js +12 -7
  65. package/dist/fondue-components59.js.map +1 -1
  66. package/dist/fondue-components60.js +20 -12
  67. package/dist/fondue-components60.js.map +1 -1
  68. package/dist/fondue-components61.js +15 -19
  69. package/dist/fondue-components61.js.map +1 -1
  70. package/dist/fondue-components62.js +52 -14
  71. package/dist/fondue-components62.js.map +1 -1
  72. package/dist/fondue-components63.js +14 -52
  73. package/dist/fondue-components63.js.map +1 -1
  74. package/dist/fondue-components64.js +17 -14
  75. package/dist/fondue-components64.js.map +1 -1
  76. package/dist/fondue-components65.js +6 -17
  77. package/dist/fondue-components65.js.map +1 -1
  78. package/dist/fondue-components66.js +2 -7
  79. package/dist/fondue-components66.js.map +1 -1
  80. package/dist/fondue-components67.js +15 -2
  81. package/dist/fondue-components67.js.map +1 -1
  82. package/dist/fondue-components68.js +38 -14
  83. package/dist/fondue-components68.js.map +1 -1
  84. package/dist/fondue-components9.js +91 -101
  85. package/dist/fondue-components9.js.map +1 -1
  86. package/dist/index.d.ts +1 -2
  87. package/dist/style.css +1 -1
  88. package/package.json +1 -1
  89. package/dist/fondue-components69.js +0 -42
  90. package/dist/fondue-components69.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components62.js","sources":["../src/components/Table/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type KeyboardEvent } from 'react';\n\nfunction getAdjacentRow(currentRow: HTMLElement, key: 'ArrowUp' | 'ArrowDown'): HTMLElement | null {\n const selector = 'tr[tabindex=\"0\"]';\n const table = currentRow.closest('table');\n if (!table) {\n return null;\n }\n\n const rows = Array.from(table.querySelectorAll(selector));\n const currentIndex = rows.indexOf(currentRow);\n const nextIndex = currentIndex + (key === 'ArrowUp' ? -1 : 1);\n\n return nextIndex >= 0 && nextIndex < rows.length ? (rows[nextIndex] as HTMLElement) : null;\n}\n\nexport function handleKeyDown(event: KeyboardEvent<HTMLTableElement>) {\n const target = event.target as HTMLElement;\n const currentRow = target.closest('tr');\n\n if (!currentRow || target !== currentRow || !['ArrowUp', 'ArrowDown'].includes(event.key)) {\n return;\n }\n\n const nextRow = getAdjacentRow(currentRow, event.key as 'ArrowUp' | 'ArrowDown');\n if (nextRow) {\n event.preventDefault();\n nextRow.focus();\n }\n}\n"],"names":["getAdjacentRow","currentRow","key","selector","table","rows","nextIndex","handleKeyDown","event","target","nextRow"],"mappings":"AAIA,SAASA,EAAeC,GAAyBC,GAAkD;AAC/F,QAAMC,IAAW,oBACXC,IAAQH,EAAW,QAAQ,OAAO;AACxC,MAAI,CAACG;AACM,WAAA;AAGX,QAAMC,IAAO,MAAM,KAAKD,EAAM,iBAAiBD,CAAQ,CAAC,GAElDG,IADeD,EAAK,QAAQJ,CAAU,KACVC,MAAQ,YAAY,KAAK;AAE3D,SAAOI,KAAa,KAAKA,IAAYD,EAAK,SAAUA,EAAKC,CAAS,IAAoB;AAC1F;AAEO,SAASC,EAAcC,GAAwC;AAClE,QAAMC,IAASD,EAAM,QACfP,IAAaQ,EAAO,QAAQ,IAAI;AAEtC,MAAI,CAACR,KAAcQ,MAAWR,KAAc,CAAC,CAAC,WAAW,WAAW,EAAE,SAASO,EAAM,GAAG;AACpF;AAGJ,QAAME,IAAUV,EAAeC,GAAYO,EAAM,GAA8B;AAC/E,EAAIE,MACAF,EAAM,eAAe,GACrBE,EAAQ,MAAM;AAEtB;"}
1
+ {"version":3,"file":"fondue-components62.js","sources":["../src/components/Tabs/hooks/useTabTriggers.tsx"],"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 return {\n triggerListRef,\n activeIndicatorRef,\n triggersOutOfView,\n triggers,\n addTrigger: (trigger) => {\n setTriggers((prev) => [...prev, trigger]);\n },\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"],"mappings":";AAMA,MAAMA,IAAyB,CAACC,GAAwBC,MAC7CD,EAAS,OAAO,CAACE,MAAY;;AAC1B,QAAAC,KAAiBC,IAAAF,EAAQ,QAAR,gBAAAE,EAAa;AACpC,SAAKD,IAIDA,EAAe,aAAaA,EAAe,eACvCF,KAAA,gBAAAA,EAAoB,cAAaA,EAAmB,eACxDE,EAAe,aAAaF,EAAmB,aAAa,IALrD;AAKqD,CAEnE,GAGCI,IAAsB,CAACJ,GAAoCK,MAAmD;AAChH,QAAMC,IAAyBD,EAAmB,SAC5CE,IAAuBP,KAAA,gBAAAA,EAAoB,cAAc;AAE/D,MACI,CAACA,KACD,EAAEO,aAAgC,sBAClC,E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3D,QAAAA,aAA8B,kBAAkBO,aAAgC,mBAAmB;AAEnG,MAAAH,EAAoBJ,GAAoBK,CAAkB;AAGpD,YAAAe,IAAmB,IAAI,iBAAiB,MAAM;AAC3B,QAAAb,EAAA,eAAe,EAAE,UAAU,WAAW,OAAO,WAAW,QAAQ,OAAO,GAC5FH,EAAoBJ,GAAoBK,CAAkB;AAAA,MAAA,CAC7D;AACD,MAAIL,EAAmB,cACnBoB,EAAiB,QAAQpB,EAAmB,YAAY,EAAE,WAAW,IAAM;AAI/E,YAAMqB,IAAuB,IAAI;AAAA,QAC7B,MAAM;AACmB,UAAAJ,EAAAnB,EAAuBC,GAAUC,CAAkB,CAAC,GACzEI,EAAoBJ,GAAoBK,CAAkB;AAAA,QAC9D;AAAA,QACA;AAAA,UACI,MAAML;AAAA,UACN,WAAW;AAAA,QAAA;AAAA,MAEnB;AACA,iBAAWC,KAAWF;AACd,SAAAI,IAAAF,EAAQ,QAAR,QAAAE,EAAa,WACQkB,EAAA,QAAQpB,EAAQ,IAAI,OAAO;AAIxD,aAAO,MAAM;AACT,QAAAoB,EAAqB,WAAW,GAChCD,EAAiB,WAAW;AAAA,MAChC;AAAA,IAAA;AAAA,EAEL,GAAA,CAACrB,GAAUa,GAAgBP,CAAkB,CAAC,GAE1C;AAAA,IACH,gBAAAO;AAAA,IACA,oBAAAP;AAAA,IACA,mBAAAW;AAAA,IACA,UAAAjB;AAAA,IACA,YAAY,CAACE,MAAY;AACrB,MAAAa,EAAY,CAACQ,MAAS,CAAC,GAAGA,GAAMrB,CAAO,CAAC;AAAA,IAAA;AAAA,EAEhD;AACJ;"}
@@ -1,56 +1,18 @@
1
- import { useRef as v, useState as w, useEffect as W, useLayoutEffect as p } from "react";
2
- const b = (e, s) => e.filter((f) => {
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
- }), a = (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))
9
- return;
10
- const c = (e == null ? void 0 : e.scrollLeft) > (o == null ? void 0 : o.offsetLeft), d = (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`) : d ? (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 = ({
13
- activeTab: e
14
- }) => {
15
- const s = v(null), f = v(null), [o, c] = w([]), [d, u] = 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 && (a(t, f), n.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "end" }));
19
- }, [e, f]), p(() => {
20
- var l;
21
- const t = s.current, n = t == null ? void 0 : t.querySelector('[data-state="active"]');
22
- if (t instanceof HTMLDivElement && n instanceof HTMLButtonElement) {
23
- a(t, f);
24
- const r = new MutationObserver(() => {
25
- n.scrollIntoView({ behavior: "instant", block: "nearest", inline: "end" }), a(t, f);
26
- });
27
- t.parentNode && r.observe(t.parentNode, { childList: !0 });
28
- const h = new IntersectionObserver(
29
- () => {
30
- u(b(o, t)), a(t, f);
31
- },
32
- {
33
- root: t,
34
- threshold: 1
35
- }
36
- );
37
- for (const i of o)
38
- (l = i.ref) != null && l.current && h.observe(i.ref.current);
39
- return () => {
40
- h.disconnect(), r.disconnect();
41
- };
42
- }
43
- }, [o, s, f]), {
44
- triggerListRef: s,
45
- activeIndicatorRef: f,
46
- triggersOutOfView: d,
47
- triggers: o,
48
- addTrigger: (t) => {
49
- c((n) => [...n, t]);
50
- }
51
- };
1
+ const t = "_root_ieias_5", i = "_triggerList_ieias_14", r = "_triggerListWrapper_ieias_28", e = "_trigger_ieias_14", s = "_content_ieias_78", o = "_activeIndicator_ieias_82", g = {
2
+ root: t,
3
+ triggerList: i,
4
+ triggerListWrapper: r,
5
+ trigger: e,
6
+ content: s,
7
+ activeIndicator: o
52
8
  };
53
9
  export {
54
- O as useTabTriggers
10
+ o as activeIndicator,
11
+ s as content,
12
+ g as default,
13
+ t as root,
14
+ e as trigger,
15
+ i as triggerList,
16
+ r as triggerListWrapper
55
17
  };
56
18
  //# sourceMappingURL=fondue-components63.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components63.js","sources":["../src/components/Tabs/hooks/useTabTriggers.tsx"],"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 return {\n triggerListRef,\n activeIndicatorRef,\n triggersOutOfView,\n triggers,\n addTrigger: (trigger) => {\n setTriggers((prev) => [...prev, trigger]);\n },\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"],"mappings":";AAMA,MAAMA,IAAyB,CAACC,GAAwBC,MAC7CD,EAAS,OAAO,CAACE,MAAY;;AAC1B,QAAAC,KAAiBC,IAAAF,EAAQ,QAAR,gBAAAE,EAAa;AACpC,SAAKD,IAIDA,EAAe,aAAaA,EAAe,eACvCF,KAAA,gBAAAA,EAAoB,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 {"version":3,"file":"fondue-components63.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,18 +1,21 @@
1
- const t = "_root_1s2mi_5", r = "_triggerList_1s2mi_14", i = "_triggerListWrapper_1s2mi_28", s = "_trigger_1s2mi_14", e = "_content_1s2mi_78", o = "_activeIndicator_1s2mi_82", g = {
2
- root: t,
3
- triggerList: r,
4
- triggerListWrapper: i,
5
- trigger: s,
6
- content: e,
7
- activeIndicator: o
1
+ const o = "_root_1w6r3_5", t = "_input_1w6r3_59", s = "_slot_1w6r3_82", _ = "_iconSuccess_1w6r3_132", n = "_iconError_1w6r3_140", r = "_loadingStatus_1w6r3_148", c = "_spin_1w6r3_1", i = {
2
+ root: o,
3
+ input: t,
4
+ slot: s,
5
+ iconSuccess: _,
6
+ iconError: n,
7
+ loadingStatus: r,
8
+ spin: c,
9
+ "tw-dark": "_tw-dark_1w6r3_180"
8
10
  };
9
11
  export {
10
- o as activeIndicator,
11
- e as content,
12
- g as default,
13
- t as root,
14
- s as trigger,
15
- r as triggerList,
16
- i as triggerListWrapper
12
+ i as default,
13
+ n as iconError,
14
+ _ as iconSuccess,
15
+ t as input,
16
+ r as loadingStatus,
17
+ o as root,
18
+ s as slot,
19
+ c as spin
17
20
  };
18
21
  //# sourceMappingURL=fondue-components64.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components64.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"fondue-components64.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,21 +1,10 @@
1
- const t = "_root_y2kt3_5", o = "_input_y2kt3_59", s = "_slot_y2kt3_78", _ = "_iconSuccess_y2kt3_128", n = "_iconError_y2kt3_136", c = "_loadingStatus_y2kt3_144", i = "_spin_y2kt3_1", r = {
2
- root: t,
3
- input: o,
4
- slot: s,
5
- iconSuccess: _,
6
- iconError: n,
7
- loadingStatus: c,
8
- spin: i,
9
- "tw-dark": "_tw-dark_y2kt3_176"
1
+ const o = "_root_18vgg_4", r = "_arrow_18vgg_22", t = {
2
+ root: o,
3
+ arrow: r
10
4
  };
11
5
  export {
12
- r as default,
13
- n as iconError,
14
- _ as iconSuccess,
15
- o as input,
16
- c as loadingStatus,
17
- t as root,
18
- s as slot,
19
- i as spin
6
+ r as arrow,
7
+ t as default,
8
+ o as root
20
9
  };
21
10
  //# sourceMappingURL=fondue-components65.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components65.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components65.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,10 +1,5 @@
1
- const o = "_root_18vgg_4", r = "_arrow_18vgg_22", t = {
2
- root: o,
3
- arrow: r
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 arrow,
7
- t as default,
8
- o as root
3
+ t as FOCUS_OUTLINE
9
4
  };
10
5
  //# sourceMappingURL=fondue-components66.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components66.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"fondue-components66.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,5 +1,18 @@
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_1nv86_5", t = "_button_1nv86_56", c = "_colorIndicator_1nv86_69", n = "_actions_1nv86_75", _ = "_clear_1nv86_85", r = "_caret_1nv86_98", a = {
2
+ root: o,
3
+ button: t,
4
+ colorIndicator: c,
5
+ actions: n,
6
+ clear: _,
7
+ caret: r
8
+ };
2
9
  export {
3
- t as FOCUS_OUTLINE
10
+ n as actions,
11
+ t as button,
12
+ r as caret,
13
+ _ as clear,
14
+ c as colorIndicator,
15
+ a as default,
16
+ o as root
4
17
  };
5
18
  //# sourceMappingURL=fondue-components67.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components67.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-components67.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,18 +1,42 @@
1
- const o = "_root_8a8rm_5", t = "_button_8a8rm_56", c = "_colorIndicator_8a8rm_69", r = "_actions_8a8rm_75", a = "_clear_8a8rm_85", _ = "_caret_8a8rm_98", n = {
2
- root: o,
3
- button: t,
4
- colorIndicator: c,
5
- actions: r,
6
- clear: a,
7
- caret: _
1
+ import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
+ import { ForwardedRefSelectItem as E } from "./fondue-components51.js";
3
+ const g = ({
4
+ children: r,
5
+ value: o,
6
+ label: s
7
+ }) => r && typeof r == "string" ? {
8
+ value: o || r,
9
+ label: s || r
10
+ } : {
11
+ value: o || "",
12
+ label: s || o || ""
13
+ }, w = (r, o) => u(r) && r.type === o, y = (r, o, s, p = 0) => {
14
+ const n = [];
15
+ let t = 0;
16
+ return a.forEach(r, (e) => {
17
+ if (w(e, E) && u(e))
18
+ g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(o(e, p + t)), t++);
19
+ else if (u(e) && (e != null && e.props.children)) {
20
+ const { parsedChildren: m, subElementCount: C } = y(
21
+ e.props.children,
22
+ o,
23
+ "",
24
+ p + t
25
+ );
26
+ e = f(e, {
27
+ children: m,
28
+ key: `group-${p + t}`
29
+ }), n.push(e), t += C;
30
+ } else
31
+ n.push(e);
32
+ }), {
33
+ parsedChildren: n,
34
+ subElementCount: t
35
+ };
8
36
  };
9
37
  export {
10
- r as actions,
11
- t as button,
12
- _ as caret,
13
- a as clear,
14
- c as colorIndicator,
15
- n as default,
16
- o as root
38
+ g as getSelectOptionValue,
39
+ w as isReactLeaf,
40
+ y as recursiveMap
17
41
  };
18
42
  //# sourceMappingURL=fondue-components68.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components68.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"fondue-components68.js","sources":["../src/components/Select/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n type JSXElementConstructor,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { ForwardedRefSelectItem, type SelectItemProps } from './SelectItem';\n\n/**\n * Extracts and returns an object containing `value` and `label` from a given SelectItemProps object.\n * It prioritizes explicit `value` and `label` properties but will fall back to using `children` as the value or label if necessary.\n *\n * @param {SelectItemProps} props - The properties of a select item, which include potential children, value, and label.\n * @returns {{ value: string; label: string }} An object containing `value` and `label` as strings.\n *\n * @example\n * // Returns { value: 'option1', label: 'Option 1' }\n * getSelectOptionValue({ value: 'option1', label: 'Option 1' });\n *\n * @example\n * // Uses children as the value and label when they are not explicitly provided\n * // Returns { value: 'Default', label: 'Default' }\n * getSelectOptionValue({ children: 'Default' });\n */\nexport const getSelectOptionValue = ({\n children,\n value,\n label,\n}: SelectItemProps): {\n value: string;\n label: string;\n} => {\n if (children && typeof children === 'string') {\n return {\n value: value ? value : children,\n label: label ? label : children,\n };\n }\n\n return {\n value: value || '',\n label: label ? label : value || '',\n };\n};\n/**\n * Determines if the child is a leaf node of React, meaning it has one final child of a native type;\n *\n * @param {ReactNode} child - The React child node to check.\n * @param {JSXElementConstructor<never>} Component - The React component constructor used for comparison.\n * @returns {boolean} Returns true if the `child` is a valid React element of the specified `Component` type.\n *\n * @example\n * // Assuming ForwardedRefSelectItem is a component that renders an <input> element\n * // Returns true\n * isReactLeaf(<ForwardedRefSelectItem />, ForwardedRefSelectItem);\n *\n * @example\n * // Returns false for non-matching types or non-leaf components\n * isReactLeaf(<div><ForwardedRefSelectItem /></div>, ForwardedRefSelectItem);\n */\nexport const isReactLeaf = (child: ReactNode, Component: JSXElementConstructor<never>): child is ReactElement =>\n isValidElement(child) && child.type === Component;\n\n/**\n * Recursively maps through React children, applying a callback to each child that meets the specified conditions.\n * This function is useful for deeply nested structures where modifications or checks are needed at multiple levels.\n *\n * @param {ReactNode} children - The children to be recursively processed.\n * @param {function(ReactNode, number): ReactNode} callback - A function that is called for each child that meets the condition. It receives the child and its index, and returns a React node.\n * @param {string} [filterText=''] - Optional text used to filter children based on their properties.\n * @param {number} [nextIndex=0] - The starting index for numbering children, defaults to 0.\n * @returns {{ parsedChildren: ReactNode[], subElementCount: number }} An object containing the transformed children array and the count of all processed sub-elements.\n *\n * @example\n * // Example usage in a select component where only items containing a certain text are modified\n * recursiveMap(children, (child, index) => React.cloneElement(child, { extraProp: 'value' }), 'specific text');\n *\n * @example\n * // Nested structure transformation, adding class names based on index\n * recursiveMap(children, (child, index) => React.cloneElement(child, { className: `item-${index}` }));\n */\nexport const recursiveMap = (\n children: ReactNode,\n callback: (child: ReactNode, nextIndex: number) => ReactNode,\n filterText?: string,\n nextIndex: number = 0,\n): {\n parsedChildren: ReactNode[];\n subElementCount: number;\n} => {\n const resultingChildren: ReactNode[] = [];\n let itemCounter = 0;\n Children.forEach(children, (child) => {\n if (isReactLeaf(child, ForwardedRefSelectItem) && isValidElement<SelectItemProps>(child)) {\n if (\n getSelectOptionValue(child.props)\n .label.toLowerCase()\n .includes(filterText?.toLowerCase() || '')\n ) {\n resultingChildren.push(callback(child, nextIndex + itemCounter));\n itemCounter++;\n }\n } else if (isValidElement<{ children: ReactNode }>(child) && child?.props.children) {\n const { parsedChildren, subElementCount } = recursiveMap(\n child.props.children,\n callback,\n '',\n nextIndex + itemCounter,\n );\n child = cloneElement(child, {\n children: parsedChildren,\n key: `group-${nextIndex + itemCounter}`,\n });\n resultingChildren.push(child);\n itemCounter += subElementCount;\n } else {\n resultingChildren.push(child);\n }\n });\n return {\n parsedChildren: resultingChildren,\n subElementCount: itemCounter,\n };\n};\n"],"names":["getSelectOptionValue","children","value","label","isReactLeaf","child","Component","isValidElement","recursiveMap","callback","filterText","nextIndex","resultingChildren","itemCounter","Children","ForwardedRefSelectItem","parsedChildren","subElementCount","cloneElement"],"mappings":";;AA6BO,MAAMA,IAAuB,CAAC;AAAA,EACjC,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AACJ,MAIQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAC3B,IAGG;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AACpC,GAkBSE,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAC;AACxC,MAAIC,IAAc;AACT,SAAAC,EAAA,QAAQb,GAAU,CAACI,MAAU;AAClC,QAAID,EAAYC,GAAOU,CAAsB,KAAKR,EAAgCF,CAAK;AACnF,MACIL,EAAqBK,EAAM,KAAK,EAC3B,MAAM,cACN,UAASK,KAAA,gBAAAA,EAAY,kBAAiB,EAAE,MAE7CE,EAAkB,KAAKH,EAASJ,GAAOM,IAAYE,CAAW,CAAC,GAC/DA;AAAA,aAEGN,EAAwCF,CAAK,MAAKA,KAAA,QAAAA,EAAO,MAAM,WAAU;AAC1E,YAAA,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAChB;AACA,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GACbQ,KAAAI;AAAA,IAAA;AAEf,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAChC,CACH,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EACrB;AACJ;"}
@@ -1,139 +1,129 @@
1
- import { jsx as d, jsxs as x } from "react/jsx-runtime";
2
- import { IconCaretRight as G } from "@frontify/fondue-icons";
1
+ import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
+ import { IconCaretRight as F } from "@frontify/fondue-icons";
3
3
  import * as n from "@radix-ui/react-dropdown-menu";
4
- import { Slot as M } from "@radix-ui/react-slot";
5
- import { forwardRef as s, useRef as f } from "react";
6
- import { usePreventDropdownOverflow as P } from "./fondue-components40.js";
7
- import { syncRefs as g } from "./fondue-components37.js";
8
- import { useProcessedChildren as D } from "./fondue-components41.js";
9
- import a from "./fondue-components42.js";
10
- const b = ({
4
+ import { Slot as I } from "@radix-ui/react-slot";
5
+ import { forwardRef as s } from "react";
6
+ import { useProcessedChildren as w } from "./fondue-components40.js";
7
+ import a from "./fondue-components41.js";
8
+ const m = ({
11
9
  children: o,
12
10
  open: t,
13
11
  onOpenChange: r,
14
- "data-test-id": e = "fondue-dropdown"
15
- }) => /* @__PURE__ */ d(n.Root, { open: t, onOpenChange: r, "data-test-id": e, children: o });
16
- b.displayName = "Dropdown.Root";
17
- const S = ({
12
+ "data-test-id": d = "fondue-dropdown"
13
+ }) => /* @__PURE__ */ e(n.Root, { open: t, onOpenChange: r, "data-test-id": d, children: o });
14
+ m.displayName = "Dropdown.Root";
15
+ const l = ({
18
16
  asChild: o = !0,
19
17
  children: t,
20
18
  "data-test-id": r = "fondue-dropdown-trigger",
21
- ...e
22
- }, p) => /* @__PURE__ */ d(n.Trigger, { asChild: o, "data-test-id": r, ref: p, ...e, children: t });
23
- S.displayName = "Dropdown.Trigger";
24
- const R = ({
25
- onOpen: o,
26
- onClose: t,
27
- side: r = "bottom",
28
- padding: e = "comfortable",
29
- align: p = "start",
30
- children: w,
31
- preventTriggerFocusOnClose: l,
32
- "data-test-id": m = "fondue-dropdown-content"
33
- }, c) => {
34
- const i = f(null), u = f(!1), { setMaxHeight: I } = P(i);
35
- return /* @__PURE__ */ d(n.Portal, { children: /* @__PURE__ */ d(
36
- n.Content,
37
- {
38
- align: p,
39
- collisionPadding: 8,
40
- sideOffset: 8,
41
- side: r,
42
- className: a.content,
43
- "data-padding": e,
44
- "data-test-id": m,
45
- ref: i,
46
- onCloseAutoFocus: (v) => {
47
- l && v.preventDefault(), g(i, c), t && t(), u.current = !1;
48
- },
49
- onFocus: () => {
50
- u.current || (I(), g(i, c), o && o(), u.current = !0);
51
- },
52
- children: w
53
- }
54
- ) });
55
- };
56
- R.displayName = "Dropdown.Content";
57
- const N = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ d(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
58
- N.displayName = "Dropdown.Group";
59
- const C = ({
19
+ ...d
20
+ }, i) => /* @__PURE__ */ e(n.Trigger, { asChild: o, "data-test-id": r, ref: i, ...d, children: t });
21
+ l.displayName = "Dropdown.Trigger";
22
+ const g = ({
23
+ side: o = "bottom",
24
+ padding: t = "comfortable",
25
+ align: r = "start",
26
+ children: d,
27
+ preventTriggerFocusOnClose: i,
28
+ "data-test-id": p = "fondue-dropdown-content"
29
+ }, u) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
30
+ n.Content,
31
+ {
32
+ align: r,
33
+ collisionPadding: 8,
34
+ sideOffset: 8,
35
+ side: o,
36
+ className: a.content,
37
+ "data-padding": t,
38
+ "data-test-id": p,
39
+ ref: u,
40
+ onCloseAutoFocus: (c) => {
41
+ i && c.preventDefault();
42
+ },
43
+ children: d
44
+ }
45
+ ) });
46
+ g.displayName = "Dropdown.Content";
47
+ const f = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ e(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
48
+ f.displayName = "Dropdown.Group";
49
+ const D = ({
60
50
  children: o,
61
51
  "data-test-id": t = "fondue-dropdown-submenu"
62
- }) => /* @__PURE__ */ d(n.Sub, { "data-test-id": t, children: o });
63
- C.displayName = "Dropdown.SubMenu";
64
- const y = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => {
65
- const { content: e } = D(o);
66
- return /* @__PURE__ */ x(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: r, children: [
67
- e,
68
- /* @__PURE__ */ d(G, { className: a.subMenuIndicator, size: 16 })
52
+ }) => /* @__PURE__ */ e(n.Sub, { "data-test-id": t, children: o });
53
+ D.displayName = "Dropdown.SubMenu";
54
+ const b = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => {
55
+ const { content: d } = w(o);
56
+ return /* @__PURE__ */ h(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: r, children: [
57
+ d,
58
+ /* @__PURE__ */ e(F, { className: a.subMenuIndicator, size: 16 })
69
59
  ] });
70
60
  };
71
- y.displayName = "Dropdown.SubTrigger";
72
- const T = ({
61
+ b.displayName = "Dropdown.SubTrigger";
62
+ const S = ({
73
63
  padding: o = "comfortable",
74
64
  children: t,
75
65
  "data-test-id": r = "fondue-dropdown-subcontent"
76
- }, e) => /* @__PURE__ */ d(n.Portal, { children: /* @__PURE__ */ d(
66
+ }, d) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
77
67
  n.SubContent,
78
68
  {
79
69
  className: a.subContent,
80
70
  "data-padding": o,
81
71
  "data-test-id": r,
82
- ref: e,
72
+ ref: d,
83
73
  children: t
84
74
  }
85
75
  ) });
86
- T.displayName = "Dropdown.SubContent";
87
- const h = ({
76
+ S.displayName = "Dropdown.SubContent";
77
+ const N = ({
88
78
  children: o,
89
79
  disabled: t,
90
80
  textValue: r,
91
- onSelect: e,
92
- emphasis: p = "default",
93
- "data-test-id": w = "fondue-dropdown-subtrigger",
94
- ...l
95
- }, m) => {
96
- const { content: c, isLink: i } = D(o), u = i ? M : "div";
97
- return /* @__PURE__ */ d(
81
+ onSelect: d,
82
+ emphasis: i = "default",
83
+ "data-test-id": p = "fondue-dropdown-subtrigger",
84
+ ...u
85
+ }, c) => {
86
+ const { content: R, isLink: T } = w(o), y = T ? I : "div";
87
+ return /* @__PURE__ */ e(
98
88
  n.Item,
99
89
  {
100
- onSelect: e,
90
+ onSelect: d,
101
91
  className: a.item,
102
92
  textValue: r,
103
- "data-test-id": w,
104
- "data-emphasis": p,
105
- ref: m,
93
+ "data-test-id": p,
94
+ "data-emphasis": i,
95
+ ref: c,
106
96
  disabled: t,
107
97
  asChild: !0,
108
- ...l,
109
- children: /* @__PURE__ */ d(u, { children: c })
98
+ ...u,
99
+ children: /* @__PURE__ */ e(y, { children: R })
110
100
  }
111
101
  );
112
102
  };
113
- h.displayName = "Dropdown.Item";
114
- const F = ({ children: o, name: t, "data-test-id": r = "fondue-dropdown-slot" }, e) => /* @__PURE__ */ d("div", { "data-name": t, className: a.slot, "data-test-id": r, ref: e, children: o });
115
- F.displayName = "Dropdown.Slot";
116
- const j = s(S), O = s(R), k = s(N), z = s(y), A = s(T), H = s(h), L = s(F), V = {
117
- Root: b,
118
- Trigger: j,
119
- Content: O,
120
- Group: k,
121
- SubMenu: C,
122
- SubTrigger: z,
123
- SubContent: A,
124
- Item: H,
125
- Slot: L
103
+ N.displayName = "Dropdown.Item";
104
+ const C = ({ children: o, name: t, "data-test-id": r = "fondue-dropdown-slot" }, d) => /* @__PURE__ */ e("div", { "data-name": t, className: a.slot, "data-test-id": r, ref: d, children: o });
105
+ C.displayName = "Dropdown.Slot";
106
+ const G = s(l), x = s(g), M = s(f), P = s(b), v = s(S), j = s(N), k = s(C), B = {
107
+ Root: m,
108
+ Trigger: G,
109
+ Content: x,
110
+ Group: M,
111
+ SubMenu: D,
112
+ SubTrigger: P,
113
+ SubContent: v,
114
+ Item: j,
115
+ Slot: k
126
116
  };
127
117
  export {
128
- V as Dropdown,
129
- R as DropdownContent,
130
- N as DropdownGroup,
131
- h as DropdownItem,
132
- b as DropdownRoot,
133
- F as DropdownSlot,
134
- T as DropdownSubContent,
135
- C as DropdownSubMenu,
136
- y as DropdownSubTrigger,
137
- S as DropdownTrigger
118
+ B as Dropdown,
119
+ g as DropdownContent,
120
+ f as DropdownGroup,
121
+ N as DropdownItem,
122
+ m as DropdownRoot,
123
+ C as DropdownSlot,
124
+ S as DropdownSubContent,
125
+ D as DropdownSubMenu,
126
+ b as DropdownSubTrigger,
127
+ l as DropdownTrigger
138
128
  };
139
129
  //# sourceMappingURL=fondue-components9.js.map