@frontify/fondue-components 27.0.1 → 28.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components.js +55 -53
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +1 -1
- package/dist/fondue-components100.js +17 -6
- package/dist/fondue-components100.js.map +1 -1
- package/dist/fondue-components101.js +150 -11
- package/dist/fondue-components101.js.map +1 -1
- package/dist/fondue-components102.js +44 -70
- package/dist/fondue-components102.js.map +1 -1
- package/dist/fondue-components103.js +14 -15
- package/dist/fondue-components103.js.map +1 -1
- package/dist/fondue-components104.js +15 -7
- package/dist/fondue-components104.js.map +1 -1
- package/dist/fondue-components105.js +107 -85
- package/dist/fondue-components105.js.map +1 -1
- package/dist/fondue-components106.js +11 -79
- package/dist/fondue-components106.js.map +1 -1
- package/dist/fondue-components107.js +17 -31
- package/dist/fondue-components107.js.map +1 -1
- package/dist/fondue-components108.js +11 -19
- package/dist/fondue-components108.js.map +1 -1
- package/dist/fondue-components109.js +16 -39
- package/dist/fondue-components109.js.map +1 -1
- package/dist/fondue-components11.js +3 -3
- package/dist/fondue-components110.js +9 -0
- package/dist/fondue-components110.js.map +1 -0
- package/dist/fondue-components111.js +15 -0
- package/dist/fondue-components111.js.map +1 -0
- package/dist/fondue-components112.js +74 -0
- package/dist/fondue-components112.js.map +1 -0
- package/dist/fondue-components113.js +18 -0
- package/dist/fondue-components113.js.map +1 -0
- package/dist/fondue-components114.js +10 -0
- package/dist/fondue-components114.js.map +1 -0
- package/dist/fondue-components115.js +92 -0
- package/dist/fondue-components115.js.map +1 -0
- package/dist/fondue-components116.js +84 -0
- package/dist/fondue-components116.js.map +1 -0
- package/dist/fondue-components117.js +34 -0
- package/dist/fondue-components117.js.map +1 -0
- package/dist/fondue-components118.js +32 -0
- package/dist/fondue-components118.js.map +1 -0
- package/dist/fondue-components12.js +7 -37
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components120.js +44 -0
- package/dist/fondue-components120.js.map +1 -0
- package/dist/fondue-components121.js +22 -0
- package/dist/fondue-components121.js.map +1 -0
- package/dist/fondue-components122.js +24 -0
- package/dist/fondue-components122.js.map +1 -0
- package/dist/fondue-components123.js +43 -0
- package/dist/fondue-components123.js.map +1 -0
- package/dist/fondue-components124.js +71 -0
- package/dist/fondue-components124.js.map +1 -0
- package/dist/fondue-components125.js +34 -0
- package/dist/fondue-components125.js.map +1 -0
- package/dist/fondue-components126.js +12 -0
- package/dist/fondue-components126.js.map +1 -0
- package/dist/fondue-components127.js +156 -0
- package/dist/fondue-components127.js.map +1 -0
- package/dist/fondue-components128.js +111 -0
- package/dist/fondue-components128.js.map +1 -0
- package/dist/fondue-components129.js +19 -0
- package/dist/fondue-components129.js.map +1 -0
- package/dist/fondue-components13.js +36 -121
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components130.js +19 -0
- package/dist/fondue-components130.js.map +1 -0
- package/dist/fondue-components131.js +32 -0
- package/dist/fondue-components131.js.map +1 -0
- package/dist/fondue-components132.js +16 -0
- package/dist/fondue-components132.js.map +1 -0
- package/dist/fondue-components133.js +10 -0
- package/dist/fondue-components133.js.map +1 -0
- package/dist/fondue-components14.js +121 -36
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +30 -39
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +44 -41
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +42 -57
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +55 -41
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +39 -16
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +17 -43
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +42 -69
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +72 -16
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +18 -77
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +75 -34
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +34 -53
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +55 -23
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +23 -55
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +52 -97
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +98 -31
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +31 -194
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +184 -134
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +143 -130
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +131 -30
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +29 -78
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +67 -110
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +121 -34
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +36 -56
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +56 -20
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +20 -23
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +3 -3
- package/dist/fondue-components40.js +25 -7
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +7 -8
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +9 -41
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +41 -5
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +1 -1
- package/dist/fondue-components45.js +3 -11
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +13 -32
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +32 -54
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +48 -125
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +130 -20
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +21 -53
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +53 -8
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +8 -13
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +13 -17
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +16 -4
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +5 -18
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +18 -19
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +18 -4
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +43 -12
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +24 -4
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +1 -1
- package/dist/fondue-components60.js +22 -17
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +4 -10
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +11 -35
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +4 -6
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +17 -4
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +10 -12
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +35 -7
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +6 -12
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +1 -1
- package/dist/fondue-components69.js +12 -24
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +1 -1
- package/dist/fondue-components70.js +8 -16
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +13 -20
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +5 -20
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +24 -19
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +17 -20
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +20 -19
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +20 -8
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +20 -11
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +20 -11
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +19 -7
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components80.js +8 -13
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +10 -22
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +11 -34
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +6 -10
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +12 -67
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +22 -14
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +34 -25
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +8 -16
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +67 -24
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +14 -8
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +5 -5
- package/dist/fondue-components90.js +24 -25
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +18 -6
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +24 -4
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +8 -4
- package/dist/fondue-components93.js.map +1 -1
- package/dist/fondue-components94.js +30 -16
- package/dist/fondue-components94.js.map +1 -1
- package/dist/fondue-components95.js +6 -216
- package/dist/fondue-components95.js.map +1 -1
- package/dist/fondue-components96.js +4 -18
- package/dist/fondue-components96.js.map +1 -1
- package/dist/fondue-components97.js +4 -16
- package/dist/fondue-components97.js.map +1 -1
- package/dist/fondue-components98.js +188 -122
- package/dist/fondue-components98.js.map +1 -1
- package/dist/fondue-components99.js +18 -44
- package/dist/fondue-components99.js.map +1 -1
- package/dist/index.d.ts +101 -24
- package/dist/style.css +1 -1
- package/package.json +5 -3
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import { ComboboxBase as a } from "./fondue-components98.js";
|
|
4
|
+
import { useSingleSelect as b } from "./fondue-components100.js";
|
|
5
|
+
const p = ({ value: e, onSelect: o, defaultValue: t, ...m }, l) => {
|
|
6
|
+
const { selectedItemValues: r, selectItem: s, clear: n } = b(o, e, t);
|
|
7
|
+
return /* @__PURE__ */ c(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
ref: l,
|
|
11
|
+
multiple: !1,
|
|
12
|
+
selectedItemValues: r,
|
|
13
|
+
onItemSelect: s,
|
|
14
|
+
onClear: n,
|
|
15
|
+
...m
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}, f = i(p);
|
|
19
|
+
f.displayName = "Select.Combobox";
|
|
7
20
|
export {
|
|
8
|
-
|
|
9
|
-
t as SelectSlot
|
|
21
|
+
f as ComboboxSingle
|
|
10
22
|
};
|
|
11
23
|
//# sourceMappingURL=fondue-components76.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components76.js","sources":["../src/components/Select/
|
|
1
|
+
{"version":3,"file":"fondue-components76.js","sources":["../src/components/Select/ComboboxSingle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport { ComboboxBase, type ComboboxSharedProps } from './components/ComboboxBase';\nimport { useSingleSelect } from './hooks/useSingleSelect';\n\nexport type ComboboxSingleProps = ComboboxSharedProps & {\n /**\n * The active value in the combobox component. This is used to control the combobox externally\n */\n value?: string | null;\n /**\n * Callback function that is called when an item is selected\n */\n onSelect?: (selectedValue: string | null) => void;\n /**\n * The default value of the combobox component. Used for uncontrolled usages\n */\n defaultValue?: string;\n};\n\nconst ComboboxSingleInput = (\n { value, onSelect, defaultValue, ...rest }: ComboboxSingleProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { selectedItemValues, selectItem, clear } = useSingleSelect(onSelect, value, defaultValue);\n\n return (\n <ComboboxBase\n ref={ref}\n multiple={false}\n selectedItemValues={selectedItemValues}\n onItemSelect={selectItem}\n onClear={clear}\n {...rest}\n />\n );\n};\n\nexport const ComboboxSingle = forwardRef<HTMLDivElement, ComboboxSingleProps>(ComboboxSingleInput);\nComboboxSingle.displayName = 'Select.Combobox';\n"],"names":["ComboboxSingleInput","value","onSelect","defaultValue","rest","ref","selectedItemValues","selectItem","clear","useSingleSelect","jsx","ComboboxBase","ComboboxSingle","forwardRef"],"mappings":";;;;AAsBA,MAAMA,IAAsB,CACxB,EAAE,OAAAC,GAAO,UAAAC,GAAU,cAAAC,GAAc,GAAGC,EAAA,GACpCC,MACC;AACD,QAAM,EAAE,oBAAAC,GAAoB,YAAAC,GAAY,OAAAC,EAAA,IAAUC,EAAgBP,GAAUD,GAAOE,CAAY;AAE/F,SACI,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAN;AAAA,MACA,UAAU;AAAA,MACV,oBAAAC;AAAA,MACA,cAAcC;AAAA,MACd,SAASC;AAAA,MACR,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGhB,GAEaQ,IAAiBC,EAAgDb,CAAmB;AACjGY,EAAe,cAAc;"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
import { SelectBase as u } from "./fondue-components101.js";
|
|
4
|
+
import { useMultiselect as a } from "./fondue-components99.js";
|
|
5
|
+
const n = ({ value: e, onSelect: t, defaultValue: l, ...o }, r) => {
|
|
6
|
+
const { selectedItemValues: m, toggleSelectedItem: c, clear: i } = a(t, e, l);
|
|
7
|
+
return /* @__PURE__ */ p(
|
|
8
|
+
u,
|
|
9
|
+
{
|
|
10
|
+
ref: r,
|
|
11
|
+
multiple: !0,
|
|
12
|
+
selectedItemValues: m,
|
|
13
|
+
onItemSelect: c,
|
|
14
|
+
onClear: i,
|
|
15
|
+
...o
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}, f = s(n);
|
|
19
|
+
f.displayName = "Select.Multi";
|
|
7
20
|
export {
|
|
8
|
-
|
|
9
|
-
s as range,
|
|
10
|
-
t as root,
|
|
11
|
-
c as thumb,
|
|
12
|
-
o as track
|
|
21
|
+
f as SelectMultiple
|
|
13
22
|
};
|
|
14
23
|
//# sourceMappingURL=fondue-components77.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components77.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components77.js","sources":["../src/components/Select/SelectMultiple.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport { SelectBase, type SelectSharedProps } from './components/SelectBase';\nimport { useMultiselect } from './hooks/useMultiselect';\n\nexport type SelectMultipleProps = SelectSharedProps & {\n /**\n * The active value in the select component. This is used to control the select externally\n */\n value?: string[] | null;\n /**\n * Callback function that is called when items are selected\n */\n onSelect?: (selectedValues: string[] | null) => void;\n /**\n * The default value of the select component. Used for uncontrolled usages\n */\n defaultValue?: string[];\n};\n\nconst SelectMultipleInput = (\n { value, onSelect, defaultValue, ...rest }: SelectMultipleProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { selectedItemValues, toggleSelectedItem, clear } = useMultiselect(onSelect, value, defaultValue);\n\n return (\n <SelectBase\n ref={ref}\n multiple\n selectedItemValues={selectedItemValues}\n onItemSelect={toggleSelectedItem}\n onClear={clear}\n {...rest}\n />\n );\n};\n\nexport const SelectMultiple = forwardRef<HTMLDivElement, SelectMultipleProps>(SelectMultipleInput);\nSelectMultiple.displayName = 'Select.Multi';\n"],"names":["SelectMultipleInput","value","onSelect","defaultValue","rest","ref","selectedItemValues","toggleSelectedItem","clear","useMultiselect","jsx","SelectBase","SelectMultiple","forwardRef"],"mappings":";;;;AAsBA,MAAMA,IAAsB,CACxB,EAAE,OAAAC,GAAO,UAAAC,GAAU,cAAAC,GAAc,GAAGC,EAAA,GACpCC,MACC;AACD,QAAM,EAAE,oBAAAC,GAAoB,oBAAAC,GAAoB,OAAAC,EAAA,IAAUC,EAAeP,GAAUD,GAAOE,CAAY;AAEtG,SACI,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAN;AAAA,MACA,UAAQ;AAAA,MACR,oBAAAC;AAAA,MACA,cAAcC;AAAA,MACd,SAASC;AAAA,MACR,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGhB,GAEaQ,IAAiBC,EAAgDb,CAAmB;AACjGY,EAAe,cAAc;"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import { SelectBase as S } from "./fondue-components101.js";
|
|
4
|
+
import { useSingleSelect as a } from "./fondue-components100.js";
|
|
5
|
+
const p = ({ value: e, onSelect: t, defaultValue: l, ...o }, r) => {
|
|
6
|
+
const { selectedItemValues: m, selectItem: c, clear: s } = a(t, e, l);
|
|
7
|
+
return /* @__PURE__ */ n(
|
|
8
|
+
S,
|
|
9
|
+
{
|
|
10
|
+
ref: r,
|
|
11
|
+
multiple: !1,
|
|
12
|
+
selectedItemValues: m,
|
|
13
|
+
onItemSelect: c,
|
|
14
|
+
onClear: s,
|
|
15
|
+
...o
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}, f = i(p);
|
|
19
|
+
f.displayName = "Select";
|
|
7
20
|
export {
|
|
8
|
-
|
|
9
|
-
c as actionButton,
|
|
10
|
-
o as content,
|
|
11
|
-
_ as default,
|
|
12
|
-
t as root
|
|
21
|
+
f as SelectSingle
|
|
13
22
|
};
|
|
14
23
|
//# sourceMappingURL=fondue-components78.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components78.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components78.js","sources":["../src/components/Select/SelectSingle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport { SelectBase, type SelectSharedProps } from './components/SelectBase';\nimport { useSingleSelect } from './hooks/useSingleSelect';\n\nexport type SelectSingleProps = SelectSharedProps & {\n /**\n * The active value in the select component. This is used to control the select externally\n */\n value?: string | null;\n /**\n * Callback function that is called when an item is selected\n */\n onSelect?: (selectedValue: string | null) => void;\n /**\n * The default value of the select component. Used for uncontrolled usages\n */\n defaultValue?: string;\n};\n\nconst SelectSingleInput = (\n { value, onSelect, defaultValue, ...rest }: SelectSingleProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { selectedItemValues, selectItem, clear } = useSingleSelect(onSelect, value, defaultValue);\n\n return (\n <SelectBase\n ref={ref}\n multiple={false}\n selectedItemValues={selectedItemValues}\n onItemSelect={selectItem}\n onClear={clear}\n {...rest}\n />\n );\n};\n\nexport const SelectSingle = forwardRef<HTMLDivElement, SelectSingleProps>(SelectSingleInput);\nSelectSingle.displayName = 'Select';\n"],"names":["SelectSingleInput","value","onSelect","defaultValue","rest","ref","selectedItemValues","selectItem","clear","useSingleSelect","jsx","SelectBase","SelectSingle","forwardRef"],"mappings":";;;;AAsBA,MAAMA,IAAoB,CACtB,EAAE,OAAAC,GAAO,UAAAC,GAAU,cAAAC,GAAc,GAAGC,EAAA,GACpCC,MACC;AACD,QAAM,EAAE,oBAAAC,GAAoB,YAAAC,GAAY,OAAAC,EAAA,IAAUC,EAAgBP,GAAUD,GAAOE,CAAY;AAE/F,SACI,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAN;AAAA,MACA,UAAU;AAAA,MACV,oBAAAC;AAAA,MACA,cAAcC;AAAA,MACd,SAASC;AAAA,MACR,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGhB,GAEaQ,IAAeC,EAA8Cb,CAAiB;AAC3FY,EAAa,cAAc;"}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheckMark as n } from "@frontify/fondue-icons";
|
|
3
|
+
import { forwardRef as l } from "react";
|
|
4
|
+
import a from "./fondue-components102.js";
|
|
5
|
+
const o = ({ "data-test-id": c = "fondue-select-item", ...e }, t) => /* @__PURE__ */ d("li", { "data-test-id": c, ref: t, ...e, children: [
|
|
6
|
+
/* @__PURE__ */ r("div", { className: a.itemValue, children: e.children }),
|
|
7
|
+
/* @__PURE__ */ r(n, { className: a.checkmarkIcon })
|
|
8
|
+
] });
|
|
9
|
+
o.displayName = "Select.Item";
|
|
10
|
+
const I = l(o), s = ({ children: c, groupId: e, heading: t, "data-test-id": i = "fondue-select-item-group" }, m) => /* @__PURE__ */ d("div", { "data-test-id": i, className: a.group, ref: m, children: [
|
|
11
|
+
t ? /* @__PURE__ */ r("div", { className: a.groupHeading, children: /* @__PURE__ */ r("span", { children: t }) }) : null,
|
|
12
|
+
c
|
|
13
|
+
] }, e);
|
|
14
|
+
s.displayName = "Select.Group";
|
|
15
|
+
const N = l(s);
|
|
5
16
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
o as
|
|
17
|
+
I as ForwardedRefSelectItem,
|
|
18
|
+
N as ForwardedRefSelectItemGroup,
|
|
19
|
+
o as SelectItem,
|
|
20
|
+
s as SelectItemGroup
|
|
9
21
|
};
|
|
10
22
|
//# sourceMappingURL=fondue-components79.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components79.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
1
|
+
{"version":3,"file":"fondue-components79.js","sources":["../src/components/Select/components/SelectItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark } from '@frontify/fondue-icons';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from '../styles/select.module.scss';\n\nexport type SelectItemProps = {\n /**\n * The value of the select item.\n */\n value: string;\n /**\n * The data test id of the select item.\n */\n 'data-test-id'?: string;\n} & (\n | {\n /**\n * The label of the select item. Required when the child is not a string.\n */\n label: string;\n /**\n * The children of the select item. This can be a custom component or a string.\n */\n children?: ReactNode;\n }\n | {\n label?: string;\n children: string;\n }\n);\n\nexport const SelectItem = (\n { 'data-test-id': dataTestId = 'fondue-select-item', ...props }: SelectItemProps,\n forwardedRef?: ForwardedRef<HTMLLIElement>,\n) => {\n return (\n <li data-test-id={dataTestId} ref={forwardedRef} {...props}>\n <div className={styles.itemValue}>{props.children}</div>\n <IconCheckMark className={styles.checkmarkIcon} />\n </li>\n );\n};\nSelectItem.displayName = 'Select.Item';\n\nexport const ForwardedRefSelectItem = forwardRef<HTMLLIElement, SelectItemProps>(SelectItem);\n\nexport type SelectItemGroupProps = {\n /**\n * The children of the select item group. This can contain multiple `Select.Item` components.\n */\n children: ReactNode;\n /**\n * The internal group ID of the select item group.\n */\n groupId: string;\n /**\n * The groups heading\n */\n heading?: string;\n /**\n * The data test id of the select item group.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectItemGroup = (\n { children, groupId, heading, 'data-test-id': dataTestId = 'fondue-select-item-group' }: SelectItemGroupProps,\n forwardedRef?: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} className={styles.group} ref={forwardedRef} key={groupId}>\n {heading ? (\n <div className={styles.groupHeading}>\n <span>{heading}</span>\n </div>\n ) : null}\n {children}\n </div>\n );\n};\nSelectItemGroup.displayName = 'Select.Group';\n\nexport const ForwardedRefSelectItemGroup = forwardRef<HTMLDivElement, SelectItemGroupProps>(SelectItemGroup);\n"],"names":["SelectItem","dataTestId","props","forwardedRef","jsx","styles","IconCheckMark","ForwardedRefSelectItem","forwardRef","SelectItemGroup","children","groupId","heading","jsxs","ForwardedRefSelectItemGroup"],"mappings":";;;;AAiCO,MAAMA,IAAa,CACtB,EAAE,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAA,GACxDC,wBAGK,MAAA,EAAG,gBAAcF,GAAY,KAAKE,GAAe,GAAGD,GACjD,UAAA;AAAA,EAAA,gBAAAE,EAAC,OAAA,EAAI,WAAWC,EAAO,WAAY,YAAM,UAAS;AAAA,EAClD,gBAAAD,EAACE,GAAA,EAAc,WAAWD,EAAO,cAAA,CAAe;AAAA,GACpD;AAGRL,EAAW,cAAc;AAElB,MAAMO,IAAyBC,EAA2CR,CAAU,GAqB9ES,IAAkB,CAC3B,EAAE,UAAAC,GAAU,SAAAC,GAAS,SAAAC,GAAS,gBAAgBX,IAAa,2BAAA,GAC3DE,MAGI,gBAAAU,EAAC,SAAI,gBAAcZ,GAAY,WAAWI,EAAO,OAAO,KAAKF,GACxD,UAAA;AAAA,EAAAS,IACG,gBAAAR,EAAC,SAAI,WAAWC,EAAO,cACnB,UAAA,gBAAAD,EAAC,QAAA,EAAM,UAAAQ,EAAA,CAAQ,EAAA,CACnB,IACA;AAAA,EACHF;AAAA,EAAA,GAN2EC,CAOhF;AAGRF,EAAgB,cAAc;AAEvB,MAAMK,IAA8BN,EAAiDC,CAAe;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { Slot as P } from "@radix-ui/react-slot";
|
|
3
3
|
import { forwardRef as F, useState as y, useMemo as N, Children as I } from "react";
|
|
4
|
-
import { ForwardedRefColorGradientInput as w } from "./fondue-
|
|
5
|
-
import { ForwardedRefColorPickerInput as h } from "./fondue-
|
|
6
|
-
import { ForwardedRefColorValueInput as G } from "./fondue-
|
|
7
|
-
import V from "./fondue-
|
|
8
|
-
import { DEFAULT_FORMAT as g, DEFAULT_COLOR as A, getColorWithName as s } from "./fondue-
|
|
4
|
+
import { ForwardedRefColorGradientInput as w } from "./fondue-components47.js";
|
|
5
|
+
import { ForwardedRefColorPickerInput as h } from "./fondue-components48.js";
|
|
6
|
+
import { ForwardedRefColorValueInput as G } from "./fondue-components49.js";
|
|
7
|
+
import V from "./fondue-components50.js";
|
|
8
|
+
import { DEFAULT_FORMAT as g, DEFAULT_COLOR as A, getColorWithName as s } from "./fondue-components51.js";
|
|
9
9
|
const p = ({
|
|
10
10
|
children: t,
|
|
11
11
|
currentColor: r = A,
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const r = e.scrollWidth > e.clientWidth;
|
|
8
|
-
e.title = r && e.textContent || "";
|
|
9
|
-
});
|
|
10
|
-
return n.observe(e), () => n.disconnect();
|
|
11
|
-
}, [t]);
|
|
12
|
-
};
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import m from "./fondue-components102.js";
|
|
4
|
+
const t = ({ children: e, name: o, "data-test-id": r = "fondue-select-slot", ...a }, s) => /* @__PURE__ */ l("div", { "data-test-id": r, ref: s, className: m.slot, "data-name": o, ...a, children: e });
|
|
5
|
+
t.displayName = "Select.Slot";
|
|
6
|
+
const S = d(t);
|
|
13
7
|
export {
|
|
14
|
-
|
|
8
|
+
S as ForwardedRefSelectSlot,
|
|
9
|
+
t as SelectSlot
|
|
15
10
|
};
|
|
16
11
|
//# sourceMappingURL=fondue-components80.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components80.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components80.js","sources":["../src/components/Select/components/SelectSlot.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from '../styles/select.module.scss';\n\nexport type SelectSlotProps = {\n /**\n * The children of the select slot. This can be a custom component.\n */\n children?: ReactNode;\n /**\n * The slot name that is used to determine the placement.\n */\n name: 'menu' | 'left' | 'right' | 'clear';\n /**\n * The data test id of the select slot.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-select-slot', ...props }: SelectSlotProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={forwardedRef} className={styles.slot} data-name={name} {...props}>\n {children}\n </div>\n );\n};\nSelectSlot.displayName = 'Select.Slot';\n\nexport const ForwardedRefSelectSlot = forwardRef<HTMLDivElement, SelectSlotProps>(SelectSlot);\n"],"names":["SelectSlot","children","name","dataTestId","props","forwardedRef","jsx","styles","ForwardedRefSelectSlot","forwardRef"],"mappings":";;;AAqBO,MAAMA,IAAa,CACtB,EAAE,UAAAC,GAAU,MAAAC,GAAM,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAA,GACxEC,MAGI,gBAAAC,EAAC,OAAA,EAAI,gBAAcH,GAAY,KAAKE,GAAc,WAAWE,EAAO,MAAM,aAAWL,GAAO,GAAGE,GAC1F,UAAAH,GACL;AAGRD,EAAW,cAAc;AAElB,MAAMQ,IAAyBC,EAA4CT,CAAU;"}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
const t = "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
caption: s,
|
|
7
|
-
header: n,
|
|
8
|
-
cellContent: d,
|
|
9
|
-
sortIndicator: l,
|
|
10
|
-
body: c,
|
|
11
|
-
buttonText: r
|
|
1
|
+
const t = "_root_1x5sc_5", c = "_thumb_1x5sc_17", o = "_track_1x5sc_21", s = "_range_1x5sc_28", _ = {
|
|
2
|
+
root: t,
|
|
3
|
+
thumb: c,
|
|
4
|
+
track: o,
|
|
5
|
+
range: s
|
|
12
6
|
};
|
|
13
7
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
n as header,
|
|
20
|
-
o as headerCell,
|
|
21
|
-
_ as row,
|
|
22
|
-
e as rowCell,
|
|
23
|
-
l as sortIndicator,
|
|
24
|
-
t as table
|
|
8
|
+
_ as default,
|
|
9
|
+
s as range,
|
|
10
|
+
t as root,
|
|
11
|
+
c as thumb,
|
|
12
|
+
o as track
|
|
25
13
|
};
|
|
26
14
|
//# 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,37 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
function a(e) {
|
|
9
|
-
const n = e.target, r = n.closest("tr");
|
|
10
|
-
if (!r || n !== r || !["ArrowUp", "ArrowDown"].includes(e.key))
|
|
11
|
-
return;
|
|
12
|
-
const t = s(r, e.key);
|
|
13
|
-
t && (e.preventDefault(), t.focus());
|
|
14
|
-
}
|
|
15
|
-
const u = [HTMLButtonElement, HTMLAnchorElement], i = ["button", "link"];
|
|
16
|
-
function f(e) {
|
|
17
|
-
if (!e)
|
|
18
|
-
return !1;
|
|
19
|
-
const { target: n, currentTarget: r } = e;
|
|
20
|
-
let t = n instanceof Element ? n : null;
|
|
21
|
-
if (!r.contains(t))
|
|
22
|
-
return !0;
|
|
23
|
-
for (; t && !(t instanceof HTMLTableRowElement); ) {
|
|
24
|
-
if (u.some((c) => t instanceof c))
|
|
25
|
-
return !0;
|
|
26
|
-
const o = t.getAttribute("role");
|
|
27
|
-
if (o && i.includes(o))
|
|
28
|
-
return !0;
|
|
29
|
-
t = t.parentElement;
|
|
30
|
-
}
|
|
31
|
-
return !1;
|
|
32
|
-
}
|
|
1
|
+
const t = "_root_gywoe_3", o = "_content_gywoe_18", n = "_action_gywoe_22", c = "_actionButton_gywoe_200", _ = {
|
|
2
|
+
root: t,
|
|
3
|
+
content: o,
|
|
4
|
+
action: n,
|
|
5
|
+
actionButton: c
|
|
6
|
+
};
|
|
33
7
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
8
|
+
n as action,
|
|
9
|
+
c as actionButton,
|
|
10
|
+
o as content,
|
|
11
|
+
_ as default,
|
|
12
|
+
t as root
|
|
36
13
|
};
|
|
37
14
|
//# sourceMappingURL=fondue-components82.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components82.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components82.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
|
|
4
|
-
actionButton: o,
|
|
5
|
-
secondaryContent: a
|
|
1
|
+
const t = "_root_2ej9d_5", o = "_thumb_2ej9d_62", s = {
|
|
2
|
+
root: t,
|
|
3
|
+
thumb: o
|
|
6
4
|
};
|
|
7
5
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
n as root,
|
|
12
|
-
a as secondaryContent
|
|
6
|
+
s as default,
|
|
7
|
+
t as root,
|
|
8
|
+
o as thumb
|
|
13
9
|
};
|
|
14
10
|
//# sourceMappingURL=fondue-components83.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components83.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components83.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,71 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 = ({
|
|
25
|
-
activeTab: e
|
|
26
|
-
}) => {
|
|
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);
|
|
38
|
-
});
|
|
39
|
-
o.parentNode && d.observe(o.parentNode, { childList: !0 });
|
|
40
|
-
const h = new IntersectionObserver(
|
|
41
|
-
() => {
|
|
42
|
-
r(T(t, o)), a(o, f);
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
root: o,
|
|
46
|
-
threshold: 1
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
for (const v of t)
|
|
50
|
-
(i = v.ref) != null && i.current && h.observe(v.ref.current);
|
|
51
|
-
return () => {
|
|
52
|
-
h.disconnect(), d.disconnect();
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}, [t, s, f]), {
|
|
56
|
-
triggerListRef: s,
|
|
57
|
-
activeIndicatorRef: f,
|
|
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];
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
};
|
|
1
|
+
import { useEffect as c } from "react";
|
|
2
|
+
const s = (t) => {
|
|
3
|
+
c(() => {
|
|
4
|
+
if (!t.current)
|
|
5
|
+
return;
|
|
6
|
+
const e = t.current, n = new ResizeObserver(() => {
|
|
7
|
+
const r = e.scrollWidth > e.clientWidth;
|
|
8
|
+
e.title = r && e.textContent || "";
|
|
9
|
+
});
|
|
10
|
+
return n.observe(e), () => n.disconnect();
|
|
11
|
+
}, [t]);
|
|
67
12
|
};
|
|
68
13
|
export {
|
|
69
|
-
|
|
14
|
+
s as useTextTruncation
|
|
70
15
|
};
|
|
71
16
|
//# sourceMappingURL=fondue-components84.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components84.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":"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"}
|
|
1
|
+
{"version":3,"file":"fondue-components84.js","sources":["../src/hooks/useTextTruncation.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, type RefObject } from 'react';\n\n/**\n * A custom React hook that automatically manages text truncation and tooltips.\n * It observes the element's size and adds a title attribute with the full text\n * when the content is truncated.\n *\n * @param {RefObject<HTMLElement>} ref - Reference to the HTML element to observe for truncation.\n *\n * @example\n * ```tsx\n * const MyComponent = () => {\n * const textRef = useRef<HTMLDivElement>(null);\n * useTextTruncation(textRef);\n *\n * return <div ref={textRef} className=\"truncate\">Long text content...</div>;\n * });\n * ```\n */\nexport const useTextTruncation = (ref: RefObject<HTMLElement>) => {\n useEffect(() => {\n if (!ref.current) {\n return;\n }\n\n const element = ref.current;\n const observer = new ResizeObserver(() => {\n const isTruncated = element.scrollWidth > element.clientWidth;\n element.title = isTruncated ? element.textContent || '' : '';\n });\n\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref]);\n};\n"],"names":["useTextTruncation","ref","useEffect","element","observer","isTruncated"],"mappings":";AAqBO,MAAMA,IAAoB,CAACC,MAAgC;AAC9D,EAAAC,EAAU,MAAM;AACZ,QAAI,CAACD,EAAI;AACL;AAGJ,UAAME,IAAUF,EAAI,SACdG,IAAW,IAAI,eAAe,MAAM;AACtC,YAAMC,IAAcF,EAAQ,cAAcA,EAAQ;AAClD,MAAAA,EAAQ,QAAQE,KAAcF,EAAQ,eAAe;AAAA,IACzD,CAAC;AAED,WAAAC,EAAS,QAAQD,CAAO,GACjB,MAAMC,EAAS,WAAA;AAAA,EAC1B,GAAG,CAACH,CAAG,CAAC;AACZ;"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
const t = "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const t = "_table_1v3sd_4", o = "_headerCell_1v3sd_18", e = "_rowCell_1v3sd_19", _ = "_row_1v3sd_19", s = "_caption_1v3sd_76", n = "_header_1v3sd_18", d = "_cellContent_1v3sd_124", l = "_sortIndicator_1v3sd_152", c = "_body_1v3sd_162", r = "_buttonText_1v3sd_235", a = {
|
|
2
|
+
table: t,
|
|
3
|
+
headerCell: o,
|
|
4
|
+
rowCell: e,
|
|
5
|
+
row: _,
|
|
6
|
+
caption: s,
|
|
7
|
+
header: n,
|
|
8
|
+
cellContent: d,
|
|
9
|
+
sortIndicator: l,
|
|
10
|
+
body: c,
|
|
11
|
+
buttonText: r
|
|
8
12
|
};
|
|
9
13
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
c as body,
|
|
15
|
+
r as buttonText,
|
|
16
|
+
s as caption,
|
|
17
|
+
d as cellContent,
|
|
18
|
+
a as default,
|
|
19
|
+
n as header,
|
|
20
|
+
o as headerCell,
|
|
21
|
+
_ as row,
|
|
22
|
+
e as rowCell,
|
|
23
|
+
l as sortIndicator,
|
|
24
|
+
t as table
|
|
17
25
|
};
|
|
18
26
|
//# sourceMappingURL=fondue-components85.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components85.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components85.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
function s(e, n) {
|
|
2
|
+
const r = 'tr[tabindex="0"]', t = e.closest("table");
|
|
3
|
+
if (!t)
|
|
4
|
+
return null;
|
|
5
|
+
const o = Array.from(t.querySelectorAll(r)), l = o.indexOf(e) + (n === "ArrowUp" ? -1 : 1);
|
|
6
|
+
return l >= 0 && l < o.length ? o[l] : null;
|
|
7
|
+
}
|
|
8
|
+
function a(e) {
|
|
9
|
+
const n = e.target, r = n.closest("tr");
|
|
10
|
+
if (!r || n !== r || !["ArrowUp", "ArrowDown"].includes(e.key))
|
|
11
|
+
return;
|
|
12
|
+
const t = s(r, e.key);
|
|
13
|
+
t && (e.preventDefault(), t.focus());
|
|
14
|
+
}
|
|
15
|
+
const u = [HTMLButtonElement, HTMLAnchorElement], i = ["button", "link"];
|
|
16
|
+
function f(e) {
|
|
17
|
+
if (!e)
|
|
18
|
+
return !1;
|
|
19
|
+
const { target: n, currentTarget: r } = e;
|
|
20
|
+
let t = n instanceof Element ? n : null;
|
|
21
|
+
if (!r.contains(t))
|
|
22
|
+
return !0;
|
|
23
|
+
for (; t && !(t instanceof HTMLTableRowElement); ) {
|
|
24
|
+
if (u.some((c) => t instanceof c))
|
|
25
|
+
return !0;
|
|
26
|
+
const o = t.getAttribute("role");
|
|
27
|
+
if (o && i.includes(o))
|
|
28
|
+
return !0;
|
|
29
|
+
t = t.parentElement;
|
|
30
|
+
}
|
|
31
|
+
return !1;
|
|
32
|
+
}
|
|
24
33
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
a as handleKeyDown,
|
|
35
|
+
f as shouldIgnoreRowClick
|
|
27
36
|
};
|
|
28
37
|
//# 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/Table/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type KeyboardEvent, type MouseEvent } 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\nconst INTERACTIVE_ELEMENTS_LIST = [HTMLButtonElement, HTMLAnchorElement];\nconst INTERACTIVE_ROLES_LIST = ['button', 'link'];\n\nexport function shouldIgnoreRowClick(event?: MouseEvent): boolean {\n if (!event) {\n return false;\n }\n\n const { target, currentTarget } = event;\n\n let element = target instanceof Element ? target : null;\n\n if (!currentTarget.contains(element)) {\n return true;\n }\n\n while (element && !(element instanceof HTMLTableRowElement)) {\n if (INTERACTIVE_ELEMENTS_LIST.some((interactiveElement) => element instanceof interactiveElement)) {\n return true;\n }\n\n const role = element.getAttribute('role');\n if (role && INTERACTIVE_ROLES_LIST.includes(role)) {\n return true;\n }\n\n element = element.parentElement;\n }\n\n return false;\n}\n"],"names":["getAdjacentRow","currentRow","key","selector","table","rows","nextIndex","handleKeyDown","event","target","nextRow","INTERACTIVE_ELEMENTS_LIST","INTERACTIVE_ROLES_LIST","shouldIgnoreRowClick","currentTarget","element","interactiveElement","role"],"mappings":"AAIA,SAASA,EAAeC,GAAyBC,GAAkD;AAC/F,QAAMC,IAAW,oBACXC,IAAQH,EAAW,QAAQ,OAAO;AACxC,MAAI,CAACG;AACD,WAAO;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,eAAA,GACNE,EAAQ,MAAA;AAEhB;AAEA,MAAMC,IAA4B,CAAC,mBAAmB,iBAAiB,GACjEC,IAAyB,CAAC,UAAU,MAAM;AAEzC,SAASC,EAAqBL,GAA6B;AAC9D,MAAI,CAACA;AACD,WAAO;AAGX,QAAM,EAAE,QAAAC,GAAQ,eAAAK,EAAA,IAAkBN;AAElC,MAAIO,IAAUN,aAAkB,UAAUA,IAAS;AAEnD,MAAI,CAACK,EAAc,SAASC,CAAO;AAC/B,WAAO;AAGX,SAAOA,KAAW,EAAEA,aAAmB,wBAAsB;AACzD,QAAIJ,EAA0B,KAAK,CAACK,MAAuBD,aAAmBC,CAAkB;AAC5F,aAAO;AAGX,UAAMC,IAAOF,EAAQ,aAAa,MAAM;AACxC,QAAIE,KAAQL,EAAuB,SAASK,CAAI;AAC5C,aAAO;AAGX,IAAAF,IAAUA,EAAQ;AAAA,EACtB;AAEA,SAAO;AACX;"}
|