@frontify/fondue-components 22.2.0 → 23.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-components10.js +27 -24
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +2 -2
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +63 -59
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +2 -2
- package/dist/fondue-components15.js +2 -2
- package/dist/fondue-components16.js +2 -2
- package/dist/fondue-components17.js +1 -1
- package/dist/fondue-components18.js +1 -1
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components20.js +2 -2
- package/dist/fondue-components21.js +2 -2
- package/dist/fondue-components22.js +6 -6
- package/dist/fondue-components23.js +1 -1
- package/dist/fondue-components24.js +29 -25
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +142 -119
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +1 -1
- package/dist/fondue-components27.js +3 -3
- package/dist/fondue-components28.js +2 -2
- package/dist/fondue-components29.js +2 -2
- package/dist/fondue-components30.js +1 -1
- package/dist/fondue-components31.js +28 -10
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +2 -2
- package/dist/fondue-components33.js +1 -1
- package/dist/fondue-components34.js +23 -7
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +7 -6
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +7 -32
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +32 -5
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +5 -12
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +10 -153
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +35 -31
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +59 -22
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +17 -17
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +112 -15
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +19 -30
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +32 -53
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +48 -124
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +130 -20
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +21 -53
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +53 -8
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +8 -13
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +13 -15
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +14 -4
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +5 -60
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +59 -17
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +18 -19
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +18 -4
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +3 -13
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +13 -3
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +3 -17
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +18 -10
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +4 -4
- package/dist/fondue-components60.js +11 -35
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +35 -5
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +4 -12
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +12 -4
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +4 -24
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +24 -16
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +16 -150
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +152 -19
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +19 -78
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +78 -8
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +2 -2
- package/dist/fondue-components70.js +8 -37
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +36 -70
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +70 -10
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +10 -12
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +12 -12
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +12 -22
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +23 -34
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +34 -11
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +10 -67
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +67 -14
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components80.js +13 -24
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +24 -17
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +15 -19
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +22 -6
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +6 -6
- package/dist/fondue-components85.js +19 -4
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +6 -4
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +3 -15
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +5 -2
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +16 -39
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +91 -87
- package/dist/fondue-components9.js.map +1 -1
- package/dist/fondue-components90.js +2 -6
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +43 -0
- package/dist/fondue-components91.js.map +1 -0
- package/dist/fondue-components92.js +24 -0
- package/dist/fondue-components92.js.map +1 -0
- package/dist/index.d.ts +63 -5
- package/dist/style.css +1 -1
- package/package.json +8 -4
|
@@ -1,56 +1,24 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
green: 0,
|
|
13
|
-
blue: 0,
|
|
14
|
-
alpha: 0
|
|
15
|
-
};
|
|
16
|
-
const t = r[0];
|
|
17
|
-
return t.length === 3 ? {
|
|
18
|
-
red: parseInt(`${t[0]}${t[0]}`, 16),
|
|
19
|
-
green: parseInt(`${t[1]}${t[1]}`, 16),
|
|
20
|
-
blue: parseInt(`${t[2]}${t[2]}`, 16),
|
|
21
|
-
alpha: 1
|
|
22
|
-
} : {
|
|
23
|
-
red: parseInt(t.slice(0, 2), 16),
|
|
24
|
-
green: parseInt(t.slice(2, 4), 16),
|
|
25
|
-
blue: parseInt(t.slice(4, 6), 16),
|
|
26
|
-
alpha: 1
|
|
27
|
-
};
|
|
28
|
-
}, a = (e) => {
|
|
29
|
-
const { red: n, green: r, blue: t } = e;
|
|
30
|
-
return `${n.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}`;
|
|
31
|
-
}, s = (e) => {
|
|
32
|
-
const n = a(e), r = e.alpha ?? 1;
|
|
33
|
-
if (r < 1) {
|
|
34
|
-
const t = Math.round(r * 100);
|
|
35
|
-
return `#${n} ${t}%`;
|
|
36
|
-
}
|
|
37
|
-
return `#${n}`;
|
|
38
|
-
}, l = (e, n) => n === "HEX" ? {
|
|
39
|
-
...e,
|
|
40
|
-
name: s(e)
|
|
41
|
-
} : {
|
|
42
|
-
...e,
|
|
43
|
-
name: `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`
|
|
44
|
-
}, i = (e, n = 0, r = 255) => e.length === 0 || parseInt(e) < n ? n : parseInt(e) > r ? r : parseInt(e);
|
|
1
|
+
const o = "_root_riubn_4", n = "_inputs_riubn_12", t = "_colorFormatInput_riubn_23", r = "_colorAlphaInput_riubn_24", u = "_colorChannelInputGroup_riubn_28", p = "_inputDecorator_riubn_39", _ = "_gradientInput_riubn_43", l = "_reactColorful_riubn_46", c = "_valueInput_riubn_50", a = {
|
|
2
|
+
root: o,
|
|
3
|
+
inputs: n,
|
|
4
|
+
colorFormatInput: t,
|
|
5
|
+
colorAlphaInput: r,
|
|
6
|
+
colorChannelInputGroup: u,
|
|
7
|
+
inputDecorator: p,
|
|
8
|
+
gradientInput: _,
|
|
9
|
+
reactColorful: l,
|
|
10
|
+
valueInput: c
|
|
11
|
+
};
|
|
45
12
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
13
|
+
r as colorAlphaInput,
|
|
14
|
+
u as colorChannelInputGroup,
|
|
15
|
+
t as colorFormatInput,
|
|
16
|
+
a as default,
|
|
17
|
+
_ as gradientInput,
|
|
18
|
+
p as inputDecorator,
|
|
19
|
+
n as inputs,
|
|
20
|
+
l as reactColorful,
|
|
21
|
+
o as root,
|
|
22
|
+
c as valueInput
|
|
55
23
|
};
|
|
56
24
|
//# sourceMappingURL=fondue-components47.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components47.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components47.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,11 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
const g = { red: 255, green: 255, blue: 255, alpha: 1, name: "" }, p = "HEX", h = (e) => {
|
|
2
|
+
if (e)
|
|
3
|
+
return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
|
|
4
|
+
}, $ = (e) => {
|
|
5
|
+
const n = /^([\dA-Fa-f]{3}){1,2}$/;
|
|
6
|
+
return e.length > 2 && n.test(e);
|
|
7
|
+
}, u = (e) => {
|
|
8
|
+
const n = /^([\dA-Fa-f]{3}){1,2}$/, r = e.match(n);
|
|
9
|
+
if (!r)
|
|
10
|
+
return {
|
|
11
|
+
red: 0,
|
|
12
|
+
green: 0,
|
|
13
|
+
blue: 0,
|
|
14
|
+
alpha: 0
|
|
15
|
+
};
|
|
16
|
+
const t = r[0];
|
|
17
|
+
return t.length === 3 ? {
|
|
18
|
+
red: parseInt(`${t[0]}${t[0]}`, 16),
|
|
19
|
+
green: parseInt(`${t[1]}${t[1]}`, 16),
|
|
20
|
+
blue: parseInt(`${t[2]}${t[2]}`, 16),
|
|
21
|
+
alpha: 1
|
|
22
|
+
} : {
|
|
23
|
+
red: parseInt(t.slice(0, 2), 16),
|
|
24
|
+
green: parseInt(t.slice(2, 4), 16),
|
|
25
|
+
blue: parseInt(t.slice(4, 6), 16),
|
|
26
|
+
alpha: 1
|
|
27
|
+
};
|
|
28
|
+
}, a = (e) => {
|
|
29
|
+
const { red: n, green: r, blue: t } = e;
|
|
30
|
+
return `${n.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}`;
|
|
31
|
+
}, s = (e) => {
|
|
32
|
+
const n = a(e), r = e.alpha ?? 1;
|
|
33
|
+
if (r < 1) {
|
|
34
|
+
const t = Math.round(r * 100);
|
|
35
|
+
return `#${n} ${t}%`;
|
|
36
|
+
}
|
|
37
|
+
return `#${n}`;
|
|
38
|
+
}, l = (e, n) => n === "HEX" ? {
|
|
39
|
+
...e,
|
|
40
|
+
name: s(e)
|
|
41
|
+
} : {
|
|
42
|
+
...e,
|
|
43
|
+
name: `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`
|
|
44
|
+
}, i = (e, n = 0, r = 255) => e.length === 0 || parseInt(e) < n ? n : parseInt(e) > r ? r : parseInt(e);
|
|
8
45
|
export {
|
|
9
|
-
|
|
46
|
+
g as DEFAULT_COLOR,
|
|
47
|
+
p as DEFAULT_FORMAT,
|
|
48
|
+
h as colorToCss,
|
|
49
|
+
l as getColorWithName,
|
|
50
|
+
s as getHexDisplayName,
|
|
51
|
+
i as getLimitedColorChannelValue,
|
|
52
|
+
u as hexColorToRgba,
|
|
53
|
+
$ as isValidHexColor,
|
|
54
|
+
a as rgbColorToHex
|
|
10
55
|
};
|
|
11
56
|
//# sourceMappingURL=fondue-components48.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components48.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components48.js","sources":["../src/components/ColorPicker/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ColorFormat, type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\nexport const DEFAULT_FORMAT = 'HEX';\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n\n/**\n * Checks if a string is a valid hexadecimal color code. This function accepts\n * both three-digit and six-digit hex codes without the '#' symbol.\n * @param {string} color - The color code to be checked.\n * @returns {boolean}\n * @example\n * isValidHexColor('FFF'); // true\n * @example\n * isValidHexColor('FF5733'); // true\n * @example\n * isValidHexColor('XYZ'); // false\n */\nexport const isValidHexColor = (color: string): boolean => {\n const hexRegex = /^([\\dA-Fa-f]{3}){1,2}$/;\n return color.length > 2 && hexRegex.test(color);\n};\n\n/**\n * Converts a hexadecimal color code to an RGBA color object. This function accepts\n * both three-digit and six-digit hex codes without the '#' symbol.\n * @param {string} hex - The hex code, either 3 or 6 characters long. Characters should be from the set [0-9A-Fa-f].\n * @returns {RgbaColor}\n * @example\n * hexColorToRgba('FFF'); // { red: 255, green: 255, blue: 255, alpha: 1 }\n * @example\n * hexColorToRgba('FF5733'); // { red: 255, green: 87, blue: 51, alpha: 1 }\n * @example\n * hexColorToRgba('XYZ'); // { red: 0, green: 0, blue: 0, alpha: 0 }\n */\nexport const hexColorToRgba = (hex: string): RgbaColor => {\n const hexRegex = /^([\\dA-Fa-f]{3}){1,2}$/;\n const matches = hex.match(hexRegex);\n if (!matches) {\n return {\n red: 0,\n green: 0,\n blue: 0,\n alpha: 0,\n };\n }\n const hexColor = matches[0];\n if (hexColor.length === 3) {\n return {\n red: parseInt(`${hexColor[0]}${hexColor[0]}`, 16),\n green: parseInt(`${hexColor[1]}${hexColor[1]}`, 16),\n blue: parseInt(`${hexColor[2]}${hexColor[2]}`, 16),\n alpha: 1,\n };\n }\n return {\n red: parseInt(hexColor.slice(0, 2), 16),\n green: parseInt(hexColor.slice(2, 4), 16),\n blue: parseInt(hexColor.slice(4, 6), 16),\n alpha: 1,\n };\n};\n\n/**\n * Converts an RGBA color object to a hexadecimal color code. This function returns a\n * six-digit hex code without the '#' symbol.\n * @param {RgbaColor} rgb - The RGBA color object.\n * @returns {string}\n * @example\n * rgbColorToHex({ red: 255, green: 255, blue: 255, alpha: 1 }); // '#FFFFFF'\n * @example\n * rgbColorToHex({ red: 255, green: 87, blue: 51, alpha: 1 }); // '#FF5733'\n * @example\n * rgbColorToHex({ red: 0, green: 0, blue: 0, alpha: 0 }); // '#000000'\n */\nexport const rgbColorToHex = (rgb: Omit<RgbaColor, 'alpha'>): string => {\n const { red, green, blue } = rgb;\n return `${red.toString(16).padStart(2, '0')}${green.toString(16).padStart(2, '0')}${blue.toString(16).padStart(2, '0')}`;\n};\n\n/**\n * Returns a hex color display name with alpha percentage if alpha < 100%.\n * @param {RgbaColor} color - The RGBA color object.\n * @returns {string}\n * @example\n * getHexDisplayName({ red: 255, green: 255, blue: 255, alpha: 1 }); // '#FFFFFF'\n * @example\n * getHexDisplayName({ red: 255, green: 255, blue: 255, alpha: 0.9 }); // '#FFFFFF 90%'\n * @example\n * getHexDisplayName({ red: 255, green: 87, blue: 51, alpha: 0.84 }); // '#FF5733 84%'\n */\nexport const getHexDisplayName = (color: RgbaColor): string => {\n const hexValue = rgbColorToHex(color);\n const alpha = color.alpha ?? 1;\n\n if (alpha < 1) {\n const alphaPercentage = Math.round(alpha * 100);\n return `#${hexValue} ${alphaPercentage}%`;\n }\n\n return `#${hexValue}`;\n};\n\n/**\n * Returns a color object with a name property based on the provided color and format.\n * @param {RgbaColor} color - The RGBA color object.\n * @param {ColorFormat} currentFormat - The current format of the color.\n * @returns {RgbaColor}\n * @example\n * getColorWithName({ red: 255, green: 255, blue: 255, alpha: 1 }, 'HEX'); // { red: 255, green: 255, blue: 255, alpha: 1, name: '#FFFFFF' }\n * @example\n * getColorWithName({ red: 255, green: 255, blue: 255, alpha: 0.9 }, 'HEX'); // { red: 255, green: 255, blue: 255, alpha: 0.9, name: '#FFFFFF 90%' }\n * @example\n * getColorWithName({ red: 255, green: 255, blue: 255, alpha: 1 }, 'RGBA'); // { red: 255, green: 255, blue: 255, alpha: 1, name: 'rgba(255, 255, 255, 1)' }\n * @example\n * getColorWithName({ red: 255, green: 87, blue: 51, alpha: 1 }, 'RGBA'); // { red: 255, green: 87, blue: 51, alpha: 1, name: 'rgba(255, 87, 51, 1)' }\n */\nexport const getColorWithName = (color: RgbaColor, currentFormat: ColorFormat) => {\n if (currentFormat === 'HEX') {\n return {\n ...color,\n name: getHexDisplayName(color),\n };\n }\n return {\n ...color,\n name: `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`,\n };\n};\n\n/**\n * Returns a number between a minimum and maximum value, inclusive.\n * @param {string} value - The value to be limited.\n * @param {number} [min=0] - The minimum value (inclusive).\n * @param {number} [max=255] - The maximum value (inclusive).\n * @returns {number}\n * @example\n * getLimitedColorChannelValue('255'); // 255\n * @example\n * getLimitedColorChannelValue('100'); // 100\n * @example\n * getLimitedColorChannelValue('0'); // 0\n * @example\n * getLimitedColorChannelValue('500'); // 255\n * @example\n * getLimitedColorChannelValue('500', 0, 100); // 100\n */\nexport const getLimitedColorChannelValue = (value: string, min: number = 0, max: number = 255): number => {\n if (value.length === 0 || parseInt(value) < min) {\n return min;\n } else if (parseInt(value) > max) {\n return max;\n }\n return parseInt(value);\n};\n"],"names":["DEFAULT_COLOR","DEFAULT_FORMAT","colorToCss","color","isValidHexColor","hexRegex","hexColorToRgba","hex","matches","hexColor","rgbColorToHex","rgb","red","green","blue","getHexDisplayName","hexValue","alpha","alphaPercentage","getColorWithName","currentFormat","getLimitedColorChannelValue","value","min","max"],"mappings":"AAIO,MAAMA,IAAgB,EAAE,KAAK,KAAK,OAAO,KAAK,MAAM,KAAK,OAAO,GAAG,MAAM,GAAA,GACnEC,IAAiB,OAajBC,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF,GAcaC,IAAkB,CAACD,MAA2B;AACvD,QAAME,IAAW;AACjB,SAAOF,EAAM,SAAS,KAAKE,EAAS,KAAKF,CAAK;AAClD,GAcaG,IAAiB,CAACC,MAA2B;AACtD,QAAMF,IAAW,0BACXG,IAAUD,EAAI,MAAMF,CAAQ;AAClC,MAAI,CAACG;AACD,WAAO;AAAA,MACH,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAGf,QAAMC,IAAWD,EAAQ,CAAC;AAC1B,SAAIC,EAAS,WAAW,IACb;AAAA,IACH,KAAK,SAAS,GAAGA,EAAS,CAAC,CAAC,GAAGA,EAAS,CAAC,CAAC,IAAI,EAAE;AAAA,IAChD,OAAO,SAAS,GAAGA,EAAS,CAAC,CAAC,GAAGA,EAAS,CAAC,CAAC,IAAI,EAAE;AAAA,IAClD,MAAM,SAAS,GAAGA,EAAS,CAAC,CAAC,GAAGA,EAAS,CAAC,CAAC,IAAI,EAAE;AAAA,IACjD,OAAO;AAAA,EAAA,IAGR;AAAA,IACH,KAAK,SAASA,EAAS,MAAM,GAAG,CAAC,GAAG,EAAE;AAAA,IACtC,OAAO,SAASA,EAAS,MAAM,GAAG,CAAC,GAAG,EAAE;AAAA,IACxC,MAAM,SAASA,EAAS,MAAM,GAAG,CAAC,GAAG,EAAE;AAAA,IACvC,OAAO;AAAA,EAAA;AAEf,GAcaC,IAAgB,CAACC,MAA0C;AACpE,QAAM,EAAE,KAAAC,GAAK,OAAAC,GAAO,MAAAC,EAAA,IAASH;AAC7B,SAAO,GAAGC,EAAI,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,GAAGC,EAAM,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,GAAGC,EAAK,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC;AAC1H,GAaaC,IAAoB,CAACZ,MAA6B;AAC3D,QAAMa,IAAWN,EAAcP,CAAK,GAC9Bc,IAAQd,EAAM,SAAS;AAE7B,MAAIc,IAAQ,GAAG;AACX,UAAMC,IAAkB,KAAK,MAAMD,IAAQ,GAAG;AAC9C,WAAO,IAAID,CAAQ,IAAIE,CAAe;AAAA,EAC1C;AAEA,SAAO,IAAIF,CAAQ;AACvB,GAgBaG,IAAmB,CAAChB,GAAkBiB,MAC3CA,MAAkB,QACX;AAAA,EACH,GAAGjB;AAAA,EACH,MAAMY,EAAkBZ,CAAK;AAAA,IAG9B;AAAA,EACH,GAAGA;AAAA,EACH,MAAM,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAAA,GAqBtEkB,IAA8B,CAACC,GAAeC,IAAc,GAAGC,IAAc,QAClFF,EAAM,WAAW,KAAK,SAASA,CAAK,IAAIC,IACjCA,IACA,SAASD,CAAK,IAAIE,IAClBA,IAEJ,SAASF,CAAK;"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const t = u.relatedTarget;
|
|
9
|
-
t != null && t.dataset.autoFocusTrigger && (t.dataset.autoFocusVisible === "true" ? u.target.dataset.showFocusRing = "true" : u.target.dataset.showFocusRing = "false", t.dataset.autoFocusVisible = "true");
|
|
10
|
-
}
|
|
1
|
+
import { useEffect as f } from "react";
|
|
2
|
+
import { syncRefs as o } from "./fondue-components50.js";
|
|
3
|
+
const m = (s, e) => {
|
|
4
|
+
f(() => {
|
|
5
|
+
o(s, e);
|
|
6
|
+
}, [s]);
|
|
7
|
+
};
|
|
11
8
|
export {
|
|
12
|
-
|
|
13
|
-
a as addShowFocusRing,
|
|
14
|
-
s as syncRefs
|
|
9
|
+
m as useSyncRefs
|
|
15
10
|
};
|
|
16
11
|
//# sourceMappingURL=fondue-components49.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components49.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components49.js","sources":["../src/hooks/useSyncRefs.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ForwardedRef, useEffect, type RefObject } from 'react';\n\nimport { syncRefs } from '#/utilities/domUtilities';\n\n/**\n * A custom React hook that synchronizes a local ref with a forwarded ref.\n * This is useful when you need to maintain both an internal reference to a DOM element\n * and allow external access through a forwarded ref.\n *\n * @template TElement - The type of the DOM element being referenced. Defaults to HTMLElement.\n * @param {RefObject<TElement>} localRef - The local ref object used internally by the component.\n * @param {ForwardedRef<TElement>} forwardedRef - The ref forwarded from a parent component.\n *\n * @example\n * ```tsx\n * const MyComponent = forwardRef<HTMLDivElement>((props, ref) => {\n * const localRef = useRef<HTMLDivElement>(null);\n * useSyncRefs(localRef, ref);\n *\n * return <div ref={localRef}>Content</div>;\n * });\n * ```\n */\nexport const useSyncRefs = <TElement = HTMLElement>(\n localRef: RefObject<TElement>,\n forwardedRef: ForwardedRef<TElement>,\n) => {\n useEffect(() => {\n syncRefs<TElement>(localRef, forwardedRef);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [localRef]);\n};\n"],"names":["useSyncRefs","localRef","forwardedRef","useEffect","syncRefs"],"mappings":";;AAyBO,MAAMA,IAAc,CACvBC,GACAC,MACC;AACD,EAAAC,EAAU,MAAM;AACZ,IAAAC,EAAmBH,GAAUC,CAAY;AAAA,EAE7C,GAAG,CAACD,CAAQ,CAAC;AACjB;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import { propsToCssVariables as x } from "./fondue-
|
|
4
|
-
import y from "./fondue-
|
|
3
|
+
import { propsToCssVariables as x } from "./fondue-components37.js";
|
|
4
|
+
import y from "./fondue-components38.js";
|
|
5
5
|
const c = n(
|
|
6
6
|
({
|
|
7
7
|
as: a = "div",
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
function s(u, t) {
|
|
2
|
+
t && (typeof t == "function" ? t(u.current) : t && "current" in t && (t.current = u.current));
|
|
3
|
+
}
|
|
4
|
+
function i(u) {
|
|
5
|
+
u.currentTarget.dataset.autoFocusVisible = "false";
|
|
6
|
+
}
|
|
7
|
+
function a(u) {
|
|
8
|
+
const t = u.relatedTarget;
|
|
9
|
+
t != null && t.dataset.autoFocusTrigger && (t.dataset.autoFocusVisible === "true" ? u.target.dataset.showFocusRing = "true" : u.target.dataset.showFocusRing = "false", t.dataset.autoFocusVisible = "true");
|
|
10
|
+
}
|
|
9
11
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
s as
|
|
13
|
-
e as footer,
|
|
14
|
-
t as header,
|
|
15
|
-
_ as sideContent,
|
|
16
|
-
d as underlay
|
|
12
|
+
i as addAutoFocusAttribute,
|
|
13
|
+
a as addShowFocusRing,
|
|
14
|
+
s as syncRefs
|
|
17
15
|
};
|
|
18
16
|
//# sourceMappingURL=fondue-components50.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components50.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components50.js","sources":["../src/utilities/domUtilities.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type FocusEvent, type MouseEvent as ReactMouseEvent, type ForwardedRef, type RefObject } from 'react';\n\nexport const MAX_HEIGHT_MARGIN = 8;\n\n/**\n * Sets the maximum height for a dialog element based on its position on the viewport.\n * The function calculates the space below the dialog up to the bottom of the viewport window,\n * subtracting a default margin, and sets this value as the max-height style of the dialog.\n *\n * @param {HTMLElement} dialog - The dialog element whose maximum height is to be set.\n *\n * @example\n * // Suppose you have a dialog element with id 'my-dialog'.\n * const dialogElement = myDialogRef.current || document.getElementById('my-dialog');\n * // Setting its max height relative to its current position and the viewport's dimensions.\n * setMaxHeightToAvailableSpace(dialogElement);\n */\nexport function setMaxHeightToAvailableSpace(dialog: HTMLElement) {\n if (!window) {\n throw new Error('Window object not found, this method should be used in a browser environment');\n }\n\n dialog.style.maxHeight = '';\n\n const { top, bottom } = dialog.getBoundingClientRect();\n if (top - MAX_HEIGHT_MARGIN < 0) {\n // if the dialog is overflowing to the top\n dialog.style.maxHeight = `${bottom - MAX_HEIGHT_MARGIN}px`;\n } else if (bottom + MAX_HEIGHT_MARGIN > window.innerHeight) {\n // if the dialog is overflowing to the bottom\n dialog.style.maxHeight = `${window.innerHeight - top - MAX_HEIGHT_MARGIN}px`;\n }\n}\n\n/**\n * Checks if a specified HTML element is visible within the viewport.\n * Visibility is determined by several factors:\n * - The element must have non-zero dimensions.\n * - The element's computed style must not be `display: none`, `visibility: hidden`, or `opacity: 0`.\n * - The element must be within the bounds of the current viewport.\n *\n * @param {HTMLElement} element - The HTML element to check for visibility.\n * @returns {boolean} Returns true if the element is visible according to the criteria specified, otherwise returns false.\n */\nexport function isElementVisible(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n const hasSize = rect.width > 0 && rect.height > 0;\n\n const style = window.getComputedStyle(element);\n const isVisibleStyle = style.display !== 'none' && style.visibility !== 'hidden' && parseFloat(style.opacity) !== 0;\n\n // Check if the element is within the viewport\n const isInViewport =\n rect.top < window.innerHeight && rect.left < window.innerWidth && rect.bottom > 0 && rect.right > 0;\n\n return hasSize && isVisibleStyle && isInViewport;\n}\n\n/**\n * Assigns a local DOM ref to a forwarded ref.\n *\n * @param {RefObject<HTMLDivElement>} localRef - The local React reference to an HTMLDivElement.\n * @param {ForwardedRef<HTMLDivElement>} forwardedRef - The ref forwarded from a parent component.\n */\nexport function syncRefs<TElement = HTMLElement>(localRef: RefObject<TElement>, forwardedRef: ForwardedRef<TElement>) {\n if (!forwardedRef) {\n return;\n }\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(localRef.current);\n } else if (forwardedRef && 'current' in forwardedRef) {\n forwardedRef.current = localRef.current;\n }\n}\n\n/**\n * Sets the 'autoFocusVisible' data attribute to 'false' on the current target of a mouse event.\n * This function is typically used to indicate that an element has been interacted with via mouse,\n * which should prevent the focus ring from being displayed when the element receives focus.\n *\n * @param mouseEvent - The mouse event object.\n */\nexport function addAutoFocusAttribute(mouseEvent: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n mouseEvent.currentTarget.dataset.autoFocusVisible = 'false';\n}\n\n/**\n * Manages the focus ring visibility based on the previous focus state and the current focus event.\n * This function sets the 'showFocusRing' data attribute on the target element and updates the\n * 'autoFocusVisible' data attribute on the previously focused element.\n *\n * ! This function should be used in conjunction with the 'addAutoFocusAttribute' function and the autoFocusVisible data autoFocusTrigger.\n *\n * @param event - The focus event object.\n */\nexport function addShowFocusRing(event: FocusEvent<HTMLDivElement, HTMLElement>) {\n const triggerElement = event.relatedTarget;\n\n if (!triggerElement?.dataset.autoFocusTrigger) {\n return;\n }\n\n if (triggerElement.dataset.autoFocusVisible === 'true') {\n event.target.dataset.showFocusRing = 'true';\n } else {\n event.target.dataset.showFocusRing = 'false';\n }\n\n triggerElement.dataset.autoFocusVisible = 'true';\n}\n"],"names":["syncRefs","localRef","forwardedRef","addAutoFocusAttribute","mouseEvent","addShowFocusRing","event","triggerElement"],"mappings":"AAkEO,SAASA,EAAiCC,GAA+BC,GAAsC;AAClH,EAAKA,MAID,OAAOA,KAAiB,aACxBA,EAAaD,EAAS,OAAO,IACtBC,KAAgB,aAAaA,MACpCA,EAAa,UAAUD,EAAS;AAExC;AASO,SAASE,EAAsBC,GAA4D;AAC9F,EAAAA,EAAW,cAAc,QAAQ,mBAAmB;AACxD;AAWO,SAASC,EAAiBC,GAAgD;AAC7E,QAAMC,IAAiBD,EAAM;AAE7B,EAAKC,KAAA,QAAAA,EAAgB,QAAQ,qBAIzBA,EAAe,QAAQ,qBAAqB,SAC5CD,EAAM,OAAO,QAAQ,gBAAgB,SAErCA,EAAM,OAAO,QAAQ,gBAAgB,SAGzCC,EAAe,QAAQ,mBAAmB;AAC9C;"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
const o = "
|
|
2
|
-
|
|
1
|
+
const o = "_content_8ijo7_6", t = "_header_8ijo7_43", e = "_footer_8ijo7_44", n = "_body_8ijo7_45", _ = "_underlay_8ijo7_175", d = "_sideContent_8ijo7_185", s = {
|
|
2
|
+
content: o,
|
|
3
|
+
header: t,
|
|
4
|
+
footer: e,
|
|
5
|
+
body: n,
|
|
6
|
+
underlay: _,
|
|
7
|
+
sideContent: d
|
|
3
8
|
};
|
|
4
9
|
export {
|
|
5
|
-
|
|
6
|
-
o as
|
|
10
|
+
n as body,
|
|
11
|
+
o as content,
|
|
12
|
+
s as default,
|
|
13
|
+
e as footer,
|
|
14
|
+
t as header,
|
|
15
|
+
d as sideContent,
|
|
16
|
+
_ as underlay
|
|
7
17
|
};
|
|
8
18
|
//# sourceMappingURL=fondue-components51.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components51.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components51.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,63 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
variants: {
|
|
5
|
-
direction: {
|
|
6
|
-
horizontal: "tw-flex-col tw-h-0 tw-border-t tw-w-full",
|
|
7
|
-
vertical: "tw-flex-row tw-w-0 tw-border-e tw-h-full "
|
|
8
|
-
},
|
|
9
|
-
color: {
|
|
10
|
-
weak: "tw-border-line-weak",
|
|
11
|
-
default: "tw-border-line",
|
|
12
|
-
strong: "tw-border-line-strong",
|
|
13
|
-
"x-strong": "tw-border-x-line-strong"
|
|
14
|
-
},
|
|
15
|
-
variant: {
|
|
16
|
-
solid: "tw-border-solid",
|
|
17
|
-
dashed: "tw-border-dashed",
|
|
18
|
-
noline: "tw-border-none"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
compoundVariants: [
|
|
22
|
-
{
|
|
23
|
-
direction: "horizontal",
|
|
24
|
-
padding: "small",
|
|
25
|
-
class: "tw-my-4"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
direction: "horizontal",
|
|
29
|
-
padding: "medium",
|
|
30
|
-
class: "tw-my-7"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
direction: "horizontal",
|
|
34
|
-
padding: "large",
|
|
35
|
-
class: "tw-my-12"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
direction: "vertical",
|
|
39
|
-
padding: "small",
|
|
40
|
-
class: "tw-mx-4"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
direction: "vertical",
|
|
44
|
-
padding: "medium",
|
|
45
|
-
class: "tw-mx-7"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
direction: "vertical",
|
|
49
|
-
padding: "large",
|
|
50
|
-
class: "tw-mx-12"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
defaultVariants: {
|
|
54
|
-
padding: "medium",
|
|
55
|
-
direction: "horizontal",
|
|
56
|
-
color: "default",
|
|
57
|
-
variant: "solid"
|
|
58
|
-
}
|
|
59
|
-
});
|
|
1
|
+
const o = "_root_n4nm9_2", t = {
|
|
2
|
+
root: o
|
|
3
|
+
};
|
|
60
4
|
export {
|
|
61
|
-
|
|
5
|
+
t as default,
|
|
6
|
+
o as root
|
|
62
7
|
};
|
|
63
8
|
//# sourceMappingURL=fondue-components52.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components52.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components52.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,21 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { sv as t } from "./fondue-components39.js";
|
|
2
|
+
const i = t({
|
|
3
|
+
base: "tw-flex tw-self-stretch tw-justify-center ",
|
|
4
|
+
variants: {
|
|
5
|
+
direction: {
|
|
6
|
+
horizontal: "tw-flex-col tw-h-0 tw-border-t tw-w-full",
|
|
7
|
+
vertical: "tw-flex-row tw-w-0 tw-border-e tw-h-full "
|
|
8
|
+
},
|
|
9
|
+
color: {
|
|
10
|
+
weak: "tw-border-line-weak",
|
|
11
|
+
default: "tw-border-line",
|
|
12
|
+
strong: "tw-border-line-strong",
|
|
13
|
+
"x-strong": "tw-border-line-x-strong"
|
|
14
|
+
},
|
|
15
|
+
variant: {
|
|
16
|
+
solid: "tw-border-solid",
|
|
17
|
+
dashed: "tw-border-dashed",
|
|
18
|
+
noline: "tw-border-none"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
compoundVariants: [
|
|
22
|
+
{
|
|
23
|
+
direction: "horizontal",
|
|
24
|
+
padding: "small",
|
|
25
|
+
class: "tw-my-4"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
direction: "horizontal",
|
|
29
|
+
padding: "medium",
|
|
30
|
+
class: "tw-my-7"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
direction: "horizontal",
|
|
34
|
+
padding: "large",
|
|
35
|
+
class: "tw-my-12"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
direction: "vertical",
|
|
39
|
+
padding: "small",
|
|
40
|
+
class: "tw-mx-4"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
direction: "vertical",
|
|
44
|
+
padding: "medium",
|
|
45
|
+
class: "tw-mx-7"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
direction: "vertical",
|
|
49
|
+
padding: "large",
|
|
50
|
+
class: "tw-mx-12"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
padding: "medium",
|
|
55
|
+
direction: "horizontal",
|
|
56
|
+
color: "default",
|
|
57
|
+
variant: "solid"
|
|
15
58
|
}
|
|
16
|
-
|
|
17
|
-
}, [e]);
|
|
59
|
+
});
|
|
18
60
|
export {
|
|
19
|
-
|
|
61
|
+
i as dividerStyles
|
|
20
62
|
};
|
|
21
63
|
//# sourceMappingURL=fondue-components53.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components53.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components53.js","sources":["../src/components/Divider/styles/dividerStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const dividerStyles = sv({\n base: 'tw-flex tw-self-stretch tw-justify-center ',\n variants: {\n direction: {\n horizontal: 'tw-flex-col tw-h-0 tw-border-t tw-w-full',\n vertical: 'tw-flex-row tw-w-0 tw-border-e tw-h-full ',\n },\n color: {\n weak: 'tw-border-line-weak',\n default: 'tw-border-line',\n strong: 'tw-border-line-strong',\n 'x-strong': 'tw-border-line-x-strong',\n },\n variant: {\n solid: 'tw-border-solid',\n dashed: 'tw-border-dashed',\n noline: 'tw-border-none',\n },\n },\n compoundVariants: [\n {\n direction: 'horizontal',\n padding: 'small',\n class: 'tw-my-4',\n },\n {\n direction: 'horizontal',\n padding: 'medium',\n class: 'tw-my-7',\n },\n {\n direction: 'horizontal',\n padding: 'large',\n class: 'tw-my-12',\n },\n {\n direction: 'vertical',\n padding: 'small',\n class: 'tw-mx-4',\n },\n {\n direction: 'vertical',\n padding: 'medium',\n class: 'tw-mx-7',\n },\n {\n direction: 'vertical',\n padding: 'large',\n class: 'tw-mx-12',\n },\n ],\n defaultVariants: {\n padding: 'medium',\n direction: 'horizontal',\n color: 'default',\n variant: 'solid',\n },\n});\n"],"names":["dividerStyles","sv"],"mappings":";AAIO,MAAMA,IAAgBC,EAAG;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AAAA,IACN,WAAW;AAAA,MACP,YAAY;AAAA,MACZ,UAAU;AAAA,IAAA;AAAA,IAEd,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,YAAY;AAAA,IAAA;AAAA,IAEhB,SAAS;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,QAAQ;AAAA,IAAA;AAAA,EACZ;AAAA,EAEJ,kBAAkB;AAAA,IACd;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,EACX;AAAA,EAEJ,iBAAiB;AAAA,IACb,SAAS;AAAA,IACT,WAAW;AAAA,IACX,OAAO;AAAA,IACP,SAAS;AAAA,EAAA;AAEjB,CAAC;"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as c, isValidElement as r, cloneElement as i, Children as p } from "react";
|
|
3
|
+
const o = (e) => {
|
|
4
|
+
const t = [];
|
|
5
|
+
for (const n of p.toArray(e))
|
|
6
|
+
r(n) ? t.push(n) : t.push(/* @__PURE__ */ s("span", { children: n }));
|
|
7
|
+
return t.length === 1 ? t[0] : t;
|
|
8
|
+
}, u = (e) => c(() => {
|
|
9
|
+
const t = r(e) && e.type === "a";
|
|
10
|
+
if (t) {
|
|
11
|
+
const n = i(e, {
|
|
12
|
+
children: o(e.props.children)
|
|
13
|
+
});
|
|
14
|
+
return { isLink: t, content: n };
|
|
15
|
+
}
|
|
16
|
+
return { isLink: t, content: o(e) };
|
|
17
|
+
}, [e]);
|
|
11
18
|
export {
|
|
12
|
-
|
|
13
|
-
u as default,
|
|
14
|
-
g as group,
|
|
15
|
-
e as groupHeading,
|
|
16
|
-
o as item,
|
|
17
|
-
i as slot,
|
|
18
|
-
n as subContent,
|
|
19
|
-
_ as subMenuIndicator,
|
|
20
|
-
s as subTrigger
|
|
19
|
+
u as useProcessedChildren
|
|
21
20
|
};
|
|
22
21
|
//# sourceMappingURL=fondue-components54.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components54.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components54.js","sources":["../src/components/Dropdown/hooks/useProcessedChildren.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Children, cloneElement, isValidElement, type ReactNode, useMemo } from 'react';\n\nconst wrapFloatingText = (children: ReactNode) => {\n const content = [];\n for (const child of Children.toArray(children)) {\n if (isValidElement(child)) {\n content.push(child);\n } else {\n content.push(<span>{child}</span>);\n }\n }\n return content.length === 1 ? content[0] : content;\n};\n\nexport const useProcessedChildren = (children: ReactNode) => {\n return useMemo(() => {\n const isLink =\n isValidElement<{\n children: ReactNode;\n }>(children) && children.type === 'a';\n\n if (isLink) {\n const element = cloneElement(children, {\n children: wrapFloatingText(children.props.children),\n });\n return { isLink, content: element };\n }\n\n return { isLink, content: wrapFloatingText(children) };\n }, [children]);\n};\n"],"names":["wrapFloatingText","children","content","child","Children","isValidElement","jsx","useProcessedChildren","useMemo","isLink","element","cloneElement"],"mappings":";;AAIA,MAAMA,IAAmB,CAACC,MAAwB;AAC9C,QAAMC,IAAU,CAAA;AAChB,aAAWC,KAASC,EAAS,QAAQH,CAAQ;AACzC,IAAII,EAAeF,CAAK,IACpBD,EAAQ,KAAKC,CAAK,IAElBD,EAAQ,KAAK,gBAAAI,EAAC,QAAA,EAAM,UAAAH,EAAA,CAAM,CAAO;AAGzC,SAAOD,EAAQ,WAAW,IAAIA,EAAQ,CAAC,IAAIA;AAC/C,GAEaK,IAAuB,CAACN,MAC1BO,EAAQ,MAAM;AACjB,QAAMC,IACFJ,EAEGJ,CAAQ,KAAKA,EAAS,SAAS;AAEtC,MAAIQ,GAAQ;AACR,UAAMC,IAAUC,EAAaV,GAAU;AAAA,MACnC,UAAUD,EAAiBC,EAAS,MAAM,QAAQ;AAAA,IAAA,CACrD;AACD,WAAO,EAAE,QAAAQ,GAAQ,SAASC,EAAA;AAAA,EAC9B;AAEA,SAAO,EAAE,QAAAD,GAAQ,SAAST,EAAiBC,CAAQ,EAAA;AACvD,GAAG,CAACA,CAAQ,CAAC;"}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
const o = "
|
|
2
|
-
|
|
1
|
+
const t = "_content_gmjid_7", n = "_subContent_gmjid_8", o = "_item_gmjid_29", s = "_subTrigger_gmjid_30", _ = "_subMenuIndicator_gmjid_123", g = "_group_gmjid_133", e = "_groupHeading_gmjid_140", i = "_slot_gmjid_151", u = {
|
|
2
|
+
content: t,
|
|
3
|
+
subContent: n,
|
|
4
|
+
item: o,
|
|
5
|
+
subTrigger: s,
|
|
6
|
+
subMenuIndicator: _,
|
|
7
|
+
group: g,
|
|
8
|
+
groupHeading: e,
|
|
9
|
+
slot: i
|
|
3
10
|
};
|
|
4
11
|
export {
|
|
5
|
-
t as
|
|
6
|
-
|
|
12
|
+
t as content,
|
|
13
|
+
u as default,
|
|
14
|
+
g as group,
|
|
15
|
+
e as groupHeading,
|
|
16
|
+
o as item,
|
|
17
|
+
i as slot,
|
|
18
|
+
n as subContent,
|
|
19
|
+
_ as subMenuIndicator,
|
|
20
|
+
s as subTrigger
|
|
7
21
|
};
|
|
8
22
|
//# sourceMappingURL=fondue-components55.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components55.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components55.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|