@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,60 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import s from "./fondue-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"data-tooltip-spacing": g,
|
|
35
|
-
className: [s.root, e].filter(Boolean).join(" "),
|
|
36
|
-
style: { maxWidth: i },
|
|
37
|
-
collisionPadding: 16,
|
|
38
|
-
sideOffset: 8,
|
|
39
|
-
ref: c,
|
|
40
|
-
side: h(u),
|
|
41
|
-
children: [
|
|
42
|
-
t,
|
|
43
|
-
/* @__PURE__ */ o(r.Arrow, { "aria-hidden": "true", className: s.arrow })
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
) }) });
|
|
47
|
-
};
|
|
48
|
-
m.displayName = "Tooltip.Content";
|
|
49
|
-
const w = {
|
|
50
|
-
Root: p,
|
|
51
|
-
Trigger: d(f),
|
|
52
|
-
Content: d(m)
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import d from "./fondue-components93.js";
|
|
3
|
+
import { Slot as p } from "@radix-ui/react-slot";
|
|
4
|
+
import { createContext as u, useContext as a, useMemo as x } from "react";
|
|
5
|
+
import { enUS as s } from "./fondue-components94.js";
|
|
6
|
+
const r = u({
|
|
7
|
+
theme: "light",
|
|
8
|
+
dir: "ltr",
|
|
9
|
+
translations: s
|
|
10
|
+
});
|
|
11
|
+
r.displayName = "ThemeContext";
|
|
12
|
+
const g = () => {
|
|
13
|
+
const e = a(r);
|
|
14
|
+
return {
|
|
15
|
+
...e,
|
|
16
|
+
dir: e.dir || "ltr"
|
|
17
|
+
};
|
|
18
|
+
}, y = ({
|
|
19
|
+
children: e,
|
|
20
|
+
theme: t = "light",
|
|
21
|
+
dir: o = "ltr",
|
|
22
|
+
translations: m = s,
|
|
23
|
+
asChild: i = !1
|
|
24
|
+
}) => {
|
|
25
|
+
const l = i ? p : "div", c = x(
|
|
26
|
+
() => ({
|
|
27
|
+
theme: t,
|
|
28
|
+
dir: o,
|
|
29
|
+
translations: m
|
|
30
|
+
}),
|
|
31
|
+
[o, t, m]
|
|
32
|
+
);
|
|
33
|
+
return /* @__PURE__ */ n(r.Provider, { value: c, children: /* @__PURE__ */ n(l, { dir: o, className: `${d[t]} fondue-theme-provider`, children: e }) });
|
|
53
34
|
};
|
|
54
35
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
f as TooltipTrigger
|
|
36
|
+
r as ThemeContext,
|
|
37
|
+
y as ThemeProvider,
|
|
38
|
+
g as useFondueTheme
|
|
59
39
|
};
|
|
60
40
|
//# sourceMappingURL=fondue-components37.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components37.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components37.js","sources":["../src/components/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport styles from '@frontify/fondue-tokens/themes';\nimport { Slot } from '@radix-ui/react-slot';\nimport { createContext, useContext, useMemo, type ReactNode } from 'react';\n\nimport { enUS, type Translations } from '../../locales';\n\ntype AvailableTheme = keyof typeof styles;\n\ntype ThemeProviderProps = {\n children: ReactNode;\n /**\n * The theme to apply\n * @default \"light\"\n * */\n theme?: AvailableTheme;\n /**\n * Direction to apply to the theme\n * @default \"ltr\"\n */\n dir?: 'ltr' | 'rtl';\n /**\n * Translations object to use for component strings.\n * Import from '@frontify/fondue/components/locales' or provide your own.\n * Must be a complete Translations object.\n * @default \"enUS\"\n * @example\n * ```tsx\n * import { deDE } from '@frontify/fondue/components/locales';\n * <ThemeProvider translations={deDE}>...</ThemeProvider>\n * ```\n */\n translations?: Translations;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n};\n\ntype ThemeContextValue = {\n theme: AvailableTheme;\n dir: 'ltr' | 'rtl';\n translations: Translations;\n};\n\nexport const ThemeContext = createContext<ThemeContextValue>({\n theme: 'light',\n dir: 'ltr',\n translations: enUS,\n});\nThemeContext.displayName = 'ThemeContext';\n\nexport const useFondueTheme = () => {\n const context = useContext(ThemeContext);\n // Ensure we always have a valid direction, defaulting to 'ltr' if not provided\n return {\n ...context,\n dir: context.dir || 'ltr',\n };\n};\n\nexport const ThemeProvider = ({\n children,\n theme = 'light',\n dir = 'ltr',\n translations = enUS,\n asChild = false,\n}: ThemeProviderProps) => {\n const Comp = asChild ? Slot : 'div';\n\n const contextValue = useMemo(\n () => ({\n theme,\n dir,\n translations,\n }),\n [dir, theme, translations],\n );\n\n return (\n <ThemeContext.Provider value={contextValue}>\n <Comp dir={dir} className={`${styles[theme]} fondue-theme-provider`}>\n {children}\n </Comp>\n </ThemeContext.Provider>\n );\n};\n"],"names":["ThemeContext","createContext","enUS","useFondueTheme","context","useContext","ThemeProvider","children","theme","dir","translations","asChild","Comp","Slot","contextValue","useMemo","jsx","styles"],"mappings":";;;;;AA+CO,MAAMA,IAAeC,EAAiC;AAAA,EACzD,OAAO;AAAA,EACP,KAAK;AAAA,EACL,cAAcC;AAClB,CAAC;AACDF,EAAa,cAAc;AAEpB,MAAMG,IAAiB,MAAM;AAChC,QAAMC,IAAUC,EAAWL,CAAY;AAEvC,SAAO;AAAA,IACH,GAAGI;AAAA,IACH,KAAKA,EAAQ,OAAO;AAAA,EAAA;AAE5B,GAEaE,IAAgB,CAAC;AAAA,EAC1B,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,KAAAC,IAAM;AAAA,EACN,cAAAC,IAAeR;AAAA,EACf,SAAAS,IAAU;AACd,MAA0B;AACtB,QAAMC,IAAOD,IAAUE,IAAO,OAExBC,IAAeC;AAAA,IACjB,OAAO;AAAA,MACH,OAAAP;AAAA,MACA,KAAAC;AAAA,MACA,cAAAC;AAAA,IAAA;AAAA,IAEJ,CAACD,GAAKD,GAAOE,CAAY;AAAA,EAAA;AAG7B,2BACKV,EAAa,UAAb,EAAsB,OAAOc,GAC1B,UAAA,gBAAAE,EAACJ,GAAA,EAAK,KAAAH,GAAU,WAAW,GAAGQ,EAAOT,CAAK,CAAC,0BACtC,UAAAD,GACL,GACJ;AAER;"}
|
|
@@ -1,24 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "@radix-ui/react-tooltip";
|
|
3
|
+
import { forwardRef as d } from "react";
|
|
4
|
+
import { useFondueTheme as R, ThemeProvider as N } from "./fondue-components37.js";
|
|
5
|
+
import s from "./fondue-components95.js";
|
|
6
|
+
const p = ({ children: t, enterDelay: e = 700, open: i, onOpenChange: n }) => /* @__PURE__ */ o(r.Provider, { children: /* @__PURE__ */ o(r.Root, { delayDuration: e, open: i, onOpenChange: n, children: t }) });
|
|
7
|
+
p.displayName = "Tooltip.Root";
|
|
8
|
+
const f = ({ asChild: t = !1, children: e, "data-test-id": i = "fondue-tooltip-trigger" }, n) => /* @__PURE__ */ o(
|
|
9
|
+
r.Trigger,
|
|
10
|
+
{
|
|
11
|
+
"data-tooltip-trigger": !0,
|
|
12
|
+
"data-test-id": i,
|
|
13
|
+
type: t ? void 0 : "button",
|
|
14
|
+
asChild: t,
|
|
15
|
+
ref: n,
|
|
16
|
+
children: e
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
f.displayName = "Tooltip.Trigger";
|
|
20
|
+
const m = ({
|
|
21
|
+
children: t,
|
|
22
|
+
className: e,
|
|
23
|
+
maxWidth: i,
|
|
24
|
+
"data-test-id": n = "fondue-tooltip-content",
|
|
25
|
+
padding: g = "spacious",
|
|
26
|
+
side: u
|
|
27
|
+
}, c) => {
|
|
28
|
+
const { theme: T, dir: l } = R(), h = (a) => !a || l === "ltr" ? a : a === "left" ? "right" : a === "right" ? "left" : a;
|
|
29
|
+
return /* @__PURE__ */ o(r.Portal, { children: /* @__PURE__ */ o(N, { theme: T, dir: l, children: /* @__PURE__ */ y(
|
|
30
|
+
r.Content,
|
|
31
|
+
{
|
|
32
|
+
dir: l,
|
|
33
|
+
"data-test-id": n,
|
|
34
|
+
"data-tooltip-spacing": g,
|
|
35
|
+
className: [s.root, e].filter(Boolean).join(" "),
|
|
36
|
+
style: { maxWidth: i },
|
|
37
|
+
collisionPadding: 16,
|
|
38
|
+
sideOffset: 8,
|
|
39
|
+
ref: c,
|
|
40
|
+
side: h(u),
|
|
41
|
+
children: [
|
|
42
|
+
t,
|
|
43
|
+
/* @__PURE__ */ o(r.Arrow, { "aria-hidden": "true", className: s.arrow })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
) }) });
|
|
47
|
+
};
|
|
48
|
+
m.displayName = "Tooltip.Content";
|
|
49
|
+
const w = {
|
|
50
|
+
Root: p,
|
|
51
|
+
Trigger: d(f),
|
|
52
|
+
Content: d(m)
|
|
11
53
|
};
|
|
12
54
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
c as accordionItem,
|
|
18
|
-
t as accordionSlot,
|
|
19
|
-
n as accordionTrigger,
|
|
20
|
-
a as accordionTriggerContent,
|
|
21
|
-
_ as default,
|
|
22
|
-
o as root
|
|
55
|
+
w as Tooltip,
|
|
56
|
+
m as TooltipContent,
|
|
57
|
+
p as TooltipRoot,
|
|
58
|
+
f as TooltipTrigger
|
|
23
59
|
};
|
|
24
60
|
//# sourceMappingURL=fondue-components38.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components38.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components38.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\n\nexport const TooltipRoot = ({ children, enterDelay = 700, open, onOpenChange }: TooltipRootProps) => {\n return (\n <RadixTooltip.Provider>\n <RadixTooltip.Root delayDuration={enterDelay} open={open} onOpenChange={onOpenChange}>\n {children}\n </RadixTooltip.Root>\n </RadixTooltip.Provider>\n );\n};\nTooltipRoot.displayName = 'Tooltip.Root';\n\nexport type TooltipTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipTrigger = (\n { asChild = false, children, 'data-test-id': dataTestId = 'fondue-tooltip-trigger' }: TooltipTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixTooltip.Trigger\n data-tooltip-trigger\n data-test-id={dataTestId}\n type={!asChild ? 'button' : undefined}\n asChild={asChild}\n ref={ref}\n >\n {children}\n </RadixTooltip.Trigger>\n );\n};\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nexport type TooltipContentProps = {\n /**\n * @default \"spacious\"\n */\n padding?: 'spacious' | 'compact';\n /**\n * Defines the preferred side of the tooltip. It will not be respected if there are collisions with the viewport.\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n maxWidth?: string;\n className?: string;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipContent = (\n {\n children,\n className,\n maxWidth,\n 'data-test-id': dataTestId = 'fondue-tooltip-content',\n padding = 'spacious',\n side,\n }: TooltipContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { theme, dir } = useFondueTheme();\n\n const getAdjustedSide = (side?: 'top' | 'right' | 'bottom' | 'left') => {\n if (!side || dir === 'ltr') {\n return side;\n }\n\n if (side === 'left') {\n return 'right';\n }\n if (side === 'right') {\n return 'left';\n }\n\n return side;\n };\n\n return (\n <RadixTooltip.Portal>\n <ThemeProvider theme={theme} dir={dir}>\n <RadixTooltip.Content\n dir={dir}\n data-test-id={dataTestId}\n data-tooltip-spacing={padding}\n className={[styles.root, className].filter(Boolean).join(' ')}\n style={{ maxWidth }}\n collisionPadding={16}\n sideOffset={8}\n ref={ref}\n side={getAdjustedSide(side)}\n >\n {children}\n <RadixTooltip.Arrow aria-hidden=\"true\" className={styles.arrow} />\n </RadixTooltip.Content>\n </ThemeProvider>\n </RadixTooltip.Portal>\n );\n};\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: forwardRef<HTMLButtonElement, TooltipTriggerProps>(TooltipTrigger),\n Content: forwardRef<HTMLDivElement, TooltipContentProps>(TooltipContent),\n};\n"],"names":["TooltipRoot","children","enterDelay","open","onOpenChange","jsx","RadixTooltip","TooltipTrigger","asChild","dataTestId","ref","TooltipContent","className","maxWidth","padding","side","theme","dir","useFondueTheme","getAdjustedSide","ThemeProvider","jsxs","styles","Tooltip","forwardRef"],"mappings":";;;;;AA0BO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAK,MAAAC,GAAM,cAAAC,QAExD,gBAAAC,EAACC,EAAa,UAAb,EACG,UAAA,gBAAAD,EAACC,EAAa,MAAb,EAAkB,eAAeJ,GAAY,MAAAC,GAAY,cAAAC,GACrD,UAAAH,GACL,GACJ;AAGRD,EAAY,cAAc;AAYnB,MAAMO,IAAiB,CAC1B,EAAE,SAAAC,IAAU,IAAO,UAAAP,GAAU,gBAAgBQ,IAAa,yBAAA,GAC1DC,MAGI,gBAAAL;AAAA,EAACC,EAAa;AAAA,EAAb;AAAA,IACG,wBAAoB;AAAA,IACpB,gBAAcG;AAAA,IACd,MAAOD,IAAqB,SAAX;AAAA,IACjB,SAAAA;AAAA,IACA,KAAAE;AAAA,IAEC,UAAAT;AAAA,EAAA;AAAA;AAIbM,EAAe,cAAc;AAiBtB,MAAMI,IAAiB,CAC1B;AAAA,EACI,UAAAV;AAAA,EACA,WAAAW;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBJ,IAAa;AAAA,EAC7B,SAAAK,IAAU;AAAA,EACV,MAAAC;AACJ,GACAL,MACC;AACD,QAAM,EAAE,OAAAM,GAAO,KAAAC,EAAA,IAAQC,EAAA,GAEjBC,IAAkB,CAACJ,MACjB,CAACA,KAAQE,MAAQ,QACVF,IAGPA,MAAS,SACF,UAEPA,MAAS,UACF,SAGJA;AAGX,2BACKT,EAAa,QAAb,EACG,UAAA,gBAAAD,EAACe,GAAA,EAAc,OAAAJ,GAAc,KAAAC,GACzB,UAAA,gBAAAI;AAAA,IAACf,EAAa;AAAA,IAAb;AAAA,MACG,KAAAW;AAAA,MACA,gBAAcR;AAAA,MACd,wBAAsBK;AAAA,MACtB,WAAW,CAACQ,EAAO,MAAMV,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MAC5D,OAAO,EAAE,UAAAC,EAAA;AAAA,MACT,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,KAAAH;AAAA,MACA,MAAMS,EAAgBJ,CAAI;AAAA,MAEzB,UAAA;AAAA,QAAAd;AAAA,QACD,gBAAAI,EAACC,EAAa,OAAb,EAAmB,eAAY,QAAO,WAAWgB,EAAO,MAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAExE,EAAA,CACJ;AAER;AACAX,EAAe,cAAc;AAEtB,MAAMY,IAAU;AAAA,EACnB,MAAMvB;AAAA,EACN,SAASwB,EAAmDjB,CAAc;AAAA,EAC1E,SAASiB,EAAgDb,CAAc;AAC3E;"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return process.env.NODE_ENV !== "production" && console.warn(`[Fondue] Translation key "${o}" not found`), o;
|
|
12
|
-
if (typeof n != "string")
|
|
13
|
-
return process.env.NODE_ENV !== "production" && console.warn(`[Fondue] Translation value for key "${o}" is not a string`), o;
|
|
14
|
-
let t = n;
|
|
15
|
-
if (e)
|
|
16
|
-
for (const [s, a] of Object.entries(e))
|
|
17
|
-
t = t.replaceAll(`\${${s}}`, a);
|
|
18
|
-
return t;
|
|
19
|
-
},
|
|
20
|
-
[r]
|
|
21
|
-
)
|
|
22
|
-
};
|
|
1
|
+
const o = "_root_vsckf_2", c = "_accordionItem_vsckf_23", n = "_accordionTrigger_vsckf_29", r = "_accordionHeader_vsckf_34", t = "_accordionSlot_vsckf_42", e = "_accordionCaret_vsckf_70", a = "_accordionTriggerContent_vsckf_78", i = "_accordionContent_vsckf_83", d = "_accordionContentText_vsckf_112", _ = {
|
|
2
|
+
root: o,
|
|
3
|
+
accordionItem: c,
|
|
4
|
+
accordionTrigger: n,
|
|
5
|
+
accordionHeader: r,
|
|
6
|
+
accordionSlot: t,
|
|
7
|
+
accordionCaret: e,
|
|
8
|
+
accordionTriggerContent: a,
|
|
9
|
+
accordionContent: i,
|
|
10
|
+
accordionContentText: d
|
|
23
11
|
};
|
|
24
12
|
export {
|
|
25
|
-
|
|
13
|
+
e as accordionCaret,
|
|
14
|
+
i as accordionContent,
|
|
15
|
+
d as accordionContentText,
|
|
16
|
+
r as accordionHeader,
|
|
17
|
+
c as accordionItem,
|
|
18
|
+
t as accordionSlot,
|
|
19
|
+
n as accordionTrigger,
|
|
20
|
+
a as accordionTriggerContent,
|
|
21
|
+
_ as default,
|
|
22
|
+
o as root
|
|
26
23
|
};
|
|
27
24
|
//# sourceMappingURL=fondue-components39.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components39.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components39.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as t, jsxs as p, Fragment as B } from "react/jsx-runtime";
|
|
2
2
|
import { IconCross as y } from "@frontify/fondue-icons";
|
|
3
|
-
import { useTranslation as v } from "./fondue-
|
|
4
|
-
import { BadgeStatus as x } from "./fondue-
|
|
5
|
-
import l from "./fondue-
|
|
3
|
+
import { useTranslation as v } from "./fondue-components40.js";
|
|
4
|
+
import { BadgeStatus as x } from "./fondue-components41.js";
|
|
5
|
+
import l from "./fondue-components42.js";
|
|
6
6
|
const S = ({
|
|
7
7
|
"aria-label": a,
|
|
8
8
|
"data-test-id": e = "badge",
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useContext as i, useCallback as l } from "react";
|
|
2
|
+
import { ThemeContext as u } from "./fondue-components37.js";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const {
|
|
5
|
+
translations: { translationStrings: r }
|
|
6
|
+
} = i(u);
|
|
7
|
+
return {
|
|
8
|
+
/** Translation function */
|
|
9
|
+
t: l(
|
|
10
|
+
(n, e) => {
|
|
11
|
+
const t = r[n];
|
|
12
|
+
if (t === void 0)
|
|
13
|
+
return process.env.NODE_ENV !== "production" && console.warn(`[Fondue] Translation key "${n}" not found`), n;
|
|
14
|
+
if (typeof t != "string")
|
|
15
|
+
return process.env.NODE_ENV !== "production" && console.warn(`[Fondue] Translation value for key "${n}" is not a string`), n;
|
|
16
|
+
let o = t;
|
|
17
|
+
if (e)
|
|
18
|
+
for (const [s, a] of Object.entries(e))
|
|
19
|
+
o = o.replaceAll(`\${${s}}`, a);
|
|
20
|
+
return o;
|
|
21
|
+
},
|
|
22
|
+
[r]
|
|
23
|
+
)
|
|
24
|
+
};
|
|
7
25
|
};
|
|
8
26
|
export {
|
|
9
|
-
|
|
27
|
+
d as useTranslation
|
|
10
28
|
};
|
|
11
29
|
//# sourceMappingURL=fondue-components40.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components40.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components40.js","sources":["../src/hooks/useTranslation.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback, useContext } from 'react';\n\nimport { ThemeContext } from '../components/ThemeProvider/ThemeProvider';\n\n/**\n * Hook to access translation functionality.\n *\n * @returns Object containing translation function\n *\n * @example\n * ```tsx\n * const { t } = useTranslation();\n *\n * // Simple translation\n * const label = t('ColorPicker_selectColor');\n *\n * // Translation with variables\n * const sortLabel = t('Table_sortByAscending', { column: 'Name' });\n * ```\n */\nexport const useTranslation = () => {\n const {\n translations: { translationStrings: translations },\n } = useContext(ThemeContext);\n\n /**\n * Translates a key to its localized string value.\n * Keys follow the format ComponentName_localLabelName[_moreLocalLabelName]\n * and support variable interpolation using ${variable} syntax.\n *\n * @param key - The translation key (e.g., 'ColorPicker_selectColor')\n * @param variables - Optional variables to interpolate into the translation\n * @returns The translated string, or the key itself if translation is not found\n */\n const t = useCallback(\n (key: keyof typeof translations, variables?: Record<string, string>): string => {\n // Direct lookup for flat keys\n const value = translations[key];\n\n if (value === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`[Fondue] Translation key \"${key}\" not found`);\n }\n return key;\n }\n\n if (typeof value !== 'string') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`[Fondue] Translation value for key \"${key}\" is not a string`);\n }\n return key;\n }\n\n let text = value;\n\n // Variable interpolation: replace ${variable} with actual values\n if (variables) {\n for (const [varKey, varValue] of Object.entries(variables)) {\n text = text.replaceAll(`\\${${varKey}}`, varValue);\n }\n }\n\n return text;\n },\n [translations],\n );\n\n return {\n /** Translation function */\n t,\n };\n};\n"],"names":["useTranslation","translations","useContext","ThemeContext","useCallback","key","variables","value","text","varKey","varValue"],"mappings":";;AAsBO,MAAMA,IAAiB,MAAM;AAChC,QAAM;AAAA,IACF,cAAc,EAAE,oBAAoBC,EAAA;AAAA,EAAa,IACjDC,EAAWC,CAAY;AA4C3B,SAAO;AAAA;AAAA,IAEH,GAnCMC;AAAA,MACN,CAACC,GAAgCC,MAA+C;AAE5E,cAAMC,IAAQN,EAAaI,CAAG;AAE9B,YAAIE,MAAU;AACV,iBAAI,QAAQ,IAAI,aAAa,gBACzB,QAAQ,KAAK,6BAA6BF,CAAG,aAAa,GAEvDA;AAGX,YAAI,OAAOE,KAAU;AACjB,iBAAI,QAAQ,IAAI,aAAa,gBACzB,QAAQ,KAAK,uCAAuCF,CAAG,mBAAmB,GAEvEA;AAGX,YAAIG,IAAOD;AAGX,YAAID;AACA,qBAAW,CAACG,GAAQC,CAAQ,KAAK,OAAO,QAAQJ,CAAS;AACrD,YAAAE,IAAOA,EAAK,WAAW,MAAMC,CAAM,KAAKC,CAAQ;AAIxD,eAAOF;AAAA,MACX;AAAA,MACA,CAACP,CAAY;AAAA,IAAA;AAAA,EAKb;AAER;"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import s from "./fondue-components96.js";
|
|
3
|
+
import { colorToCss as e } from "./fondue-components97.js";
|
|
4
|
+
const a = ["default", "positive", "highlight", "warning", "negative"], i = (t) => typeof t == "string" && a.includes(t), p = ({ status: t }) => {
|
|
5
|
+
const o = i(t) ? { "data-status": t } : { style: { backgroundColor: typeof t == "string" ? t : e(t) || "transparent" } };
|
|
6
|
+
return /* @__PURE__ */ r("div", { "data-test-id": "badge-status", className: s.root, ...o });
|
|
5
7
|
};
|
|
6
8
|
export {
|
|
7
|
-
|
|
8
|
-
o as dismiss,
|
|
9
|
-
t as inner,
|
|
10
|
-
s as root
|
|
9
|
+
p as BadgeStatus
|
|
11
10
|
};
|
|
12
11
|
//# sourceMappingURL=fondue-components41.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components41.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components41.js","sources":["../src/components/Badge/BadgeStatus.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport styles from './styles/badgestatus.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss } from './utils';\n\ntype BadgeStatusType = 'default' | 'positive' | 'highlight' | 'warning' | 'negative';\n\nconst badgeStatusMap = ['default', 'positive', 'highlight', 'warning', 'negative'];\n\nexport type BadgeStatusProps = { status: BadgeStatusType } | { status: RgbaColor | string };\n\nconst isBadgeStatusType = (value: RgbaColor | string): value is BadgeStatusType =>\n typeof value === 'string' && badgeStatusMap.includes(value);\n\nexport const BadgeStatus = ({ status }: BadgeStatusProps) => {\n const colorProps = isBadgeStatusType(status)\n ? { 'data-status': status }\n : { style: { backgroundColor: typeof status === 'string' ? status : colorToCss(status) || 'transparent' } };\n\n return <div data-test-id=\"badge-status\" className={styles.root} {...colorProps}></div>;\n};\n"],"names":["badgeStatusMap","isBadgeStatusType","value","BadgeStatus","status","colorProps","colorToCss","jsx","styles"],"mappings":";;;AAQA,MAAMA,IAAiB,CAAC,WAAW,YAAY,aAAa,WAAW,UAAU,GAI3EC,IAAoB,CAACC,MACvB,OAAOA,KAAU,YAAYF,EAAe,SAASE,CAAK,GAEjDC,IAAc,CAAC,EAAE,QAAAC,QAA+B;AACzD,QAAMC,IAAaJ,EAAkBG,CAAM,IACrC,EAAE,eAAeA,EAAA,IACjB,EAAE,OAAO,EAAE,iBAAiB,OAAOA,KAAW,WAAWA,IAASE,EAAWF,CAAM,KAAK,gBAAc;AAE5G,SAAO,gBAAAG,EAAC,SAAI,gBAAa,gBAAe,WAAWC,EAAO,MAAO,GAAGH,GAAY;AACpF;"}
|
|
@@ -1,44 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
mr: "margin-right",
|
|
7
|
-
mb: "margin-bottom",
|
|
8
|
-
ml: "margin-left",
|
|
9
|
-
p: "padding",
|
|
10
|
-
px: "padding-x",
|
|
11
|
-
py: "padding-y",
|
|
12
|
-
pt: "padding-top",
|
|
13
|
-
pr: "padding-right",
|
|
14
|
-
pb: "padding-bottom",
|
|
15
|
-
pl: "padding-left",
|
|
16
|
-
direction: "flex-direction",
|
|
17
|
-
align: "align-items",
|
|
18
|
-
wrap: "flex-wrap",
|
|
19
|
-
columns: "grid-template-columns",
|
|
20
|
-
rows: "grid-template-rows"
|
|
21
|
-
}, d = {
|
|
22
|
-
overflow: ["overflow-x", "overflow-y"]
|
|
23
|
-
}, a = (o, t) => o === "columns" || o === "rows" ? typeof t == "number" ? `repeat(${t}, 1fr)` : t : typeof t == "number" ? `${t * 0.25}rem` : t, l = (o, t = {}) => Object.entries(o).reduce((n, [r, i]) => {
|
|
24
|
-
if (!(r in d))
|
|
25
|
-
return [...n, [r, i]];
|
|
26
|
-
n.push([r, i]);
|
|
27
|
-
for (const e of d[r] ?? [])
|
|
28
|
-
n.push([e, i]);
|
|
29
|
-
return n;
|
|
30
|
-
}, []).reduce((n, [r, i]) => {
|
|
31
|
-
if (g(r))
|
|
32
|
-
return n;
|
|
33
|
-
const e = r in t ? t[r] : r in m ? m[r] : r, p = e == null ? void 0 : e.replaceAll(/([\da-z]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
34
|
-
if (typeof i == "object")
|
|
35
|
-
for (const [f, s] of Object.entries(i))
|
|
36
|
-
s !== void 0 && (n[`--${f}-${p}`] = a(r, s));
|
|
37
|
-
else
|
|
38
|
-
n[`--${p}`] = a(r, i);
|
|
39
|
-
return n;
|
|
40
|
-
}, {});
|
|
1
|
+
const s = "_root_xdptq_3", t = "_inner_xdptq_30", o = "_dismiss_xdptq_175", n = {
|
|
2
|
+
root: s,
|
|
3
|
+
inner: t,
|
|
4
|
+
dismiss: o
|
|
5
|
+
};
|
|
41
6
|
export {
|
|
42
|
-
|
|
7
|
+
n as default,
|
|
8
|
+
o as dismiss,
|
|
9
|
+
t as inner,
|
|
10
|
+
s as root
|
|
43
11
|
};
|
|
44
12
|
//# sourceMappingURL=fondue-components42.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components42.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components42.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,8 +1,44 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const g = (o) => o.startsWith("aria-") || o === "role", m = {
|
|
2
|
+
m: "margin",
|
|
3
|
+
mx: "margin-x",
|
|
4
|
+
my: "margin-y",
|
|
5
|
+
mt: "margin-top",
|
|
6
|
+
mr: "margin-right",
|
|
7
|
+
mb: "margin-bottom",
|
|
8
|
+
ml: "margin-left",
|
|
9
|
+
p: "padding",
|
|
10
|
+
px: "padding-x",
|
|
11
|
+
py: "padding-y",
|
|
12
|
+
pt: "padding-top",
|
|
13
|
+
pr: "padding-right",
|
|
14
|
+
pb: "padding-bottom",
|
|
15
|
+
pl: "padding-left",
|
|
16
|
+
direction: "flex-direction",
|
|
17
|
+
align: "align-items",
|
|
18
|
+
wrap: "flex-wrap",
|
|
19
|
+
columns: "grid-template-columns",
|
|
20
|
+
rows: "grid-template-rows"
|
|
21
|
+
}, d = {
|
|
22
|
+
overflow: ["overflow-x", "overflow-y"]
|
|
23
|
+
}, a = (o, t) => o === "columns" || o === "rows" ? typeof t == "number" ? `repeat(${t}, 1fr)` : t : typeof t == "number" ? `${t * 0.25}rem` : t, l = (o, t = {}) => Object.entries(o).reduce((n, [r, i]) => {
|
|
24
|
+
if (!(r in d))
|
|
25
|
+
return [...n, [r, i]];
|
|
26
|
+
n.push([r, i]);
|
|
27
|
+
for (const e of d[r] ?? [])
|
|
28
|
+
n.push([e, i]);
|
|
29
|
+
return n;
|
|
30
|
+
}, []).reduce((n, [r, i]) => {
|
|
31
|
+
if (g(r))
|
|
32
|
+
return n;
|
|
33
|
+
const e = r in t ? t[r] : r in m ? m[r] : r, p = e == null ? void 0 : e.replaceAll(/([\da-z]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
34
|
+
if (typeof i == "object")
|
|
35
|
+
for (const [f, s] of Object.entries(i))
|
|
36
|
+
s !== void 0 && (n[`--${f}-${p}`] = a(r, s));
|
|
37
|
+
else
|
|
38
|
+
n[`--${p}`] = a(r, i);
|
|
39
|
+
return n;
|
|
40
|
+
}, {});
|
|
4
41
|
export {
|
|
5
|
-
|
|
6
|
-
o as root
|
|
42
|
+
l as propsToCssVariables
|
|
7
43
|
};
|
|
8
44
|
//# sourceMappingURL=fondue-components43.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components43.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components43.js","sources":["../src/helpers/propsToCssVariables.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type CSSProperties } from 'react';\n\nimport { type Breakpoint } from './layout';\n\nconst isAriaProp = (key: string): boolean => {\n return key.startsWith('aria-') || key === 'role';\n};\n\nconst abbreviationToCssProperty: Record<string, string> = {\n m: 'margin',\n mx: 'margin-x',\n my: 'margin-y',\n mt: 'margin-top',\n mr: 'margin-right',\n mb: 'margin-bottom',\n ml: 'margin-left',\n p: 'padding',\n px: 'padding-x',\n py: 'padding-y',\n pt: 'padding-top',\n pr: 'padding-right',\n pb: 'padding-bottom',\n pl: 'padding-left',\n direction: 'flex-direction',\n align: 'align-items',\n wrap: 'flex-wrap',\n columns: 'grid-template-columns',\n rows: 'grid-template-rows',\n};\n\nconst explodeProps: Record<string, string[]> = {\n overflow: ['overflow-x', 'overflow-y'],\n};\n\nconst transformValueBasedOnKey = (key: string, value: string | number): string | number => {\n if (key === 'columns' || key === 'rows') {\n if (typeof value === 'number') {\n return `repeat(${value}, 1fr)`;\n }\n return value;\n }\n\n // Spacing tokens\n if (typeof value === 'number') {\n return `${value * 0.25}rem`;\n }\n\n return value;\n};\n\nexport const propsToCssVariables = (\n props: Record<string, string | number | boolean | { [key in Breakpoint]?: string | number | boolean }>,\n extraAbbreviationToCssProperty: Record<string, string> = {},\n): CSSProperties => {\n return Object.entries(props)\n .reduce<[keyof typeof props, (typeof props)[keyof typeof props]][]>((acc, [key, value]) => {\n if (!(key in explodeProps)) {\n return [...acc, [key, value]];\n }\n\n acc.push([key, value]);\n for (const newKey of explodeProps[key] ?? []) {\n acc.push([newKey, value]);\n }\n\n return acc;\n }, [])\n .reduce<CSSProperties>((acc, [key, value]) => {\n if (isAriaProp(key)) {\n return acc;\n }\n\n const cssProperty =\n key in extraAbbreviationToCssProperty\n ? extraAbbreviationToCssProperty[key]\n : key in abbreviationToCssProperty\n ? abbreviationToCssProperty[key]\n : key;\n // The lookahead is necessary to split camelCase boundaries; disabling false-positive lint warning\n const cssPropertyKebabCase = cssProperty?.replaceAll(/([\\da-z]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();\n\n if (typeof value === 'object') {\n for (const [breakpoint, breakpointValue] of Object.entries(value)) {\n if (breakpointValue !== undefined) {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${breakpoint}-${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, breakpointValue);\n }\n }\n } else {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, value);\n }\n return acc;\n }, {});\n};\n"],"names":["isAriaProp","key","abbreviationToCssProperty","explodeProps","transformValueBasedOnKey","value","propsToCssVariables","props","extraAbbreviationToCssProperty","acc","newKey","cssProperty","cssPropertyKebabCase","breakpoint","breakpointValue"],"mappings":"AAMA,MAAMA,IAAa,CAACC,MACTA,EAAI,WAAW,OAAO,KAAKA,MAAQ,QAGxCC,IAAoD;AAAA,EACtD,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AACV,GAEMC,IAAyC;AAAA,EAC3C,UAAU,CAAC,cAAc,YAAY;AACzC,GAEMC,IAA2B,CAACH,GAAaI,MACvCJ,MAAQ,aAAaA,MAAQ,SACzB,OAAOI,KAAU,WACV,UAAUA,CAAK,WAEnBA,IAIP,OAAOA,KAAU,WACV,GAAGA,IAAQ,IAAI,QAGnBA,GAGEC,IAAsB,CAC/BC,GACAC,IAAyD,OAElD,OAAO,QAAQD,CAAK,EACtB,OAAmE,CAACE,GAAK,CAACR,GAAKI,CAAK,MAAM;AACvF,MAAI,EAAEJ,KAAOE;AACT,WAAO,CAAC,GAAGM,GAAK,CAACR,GAAKI,CAAK,CAAC;AAGhC,EAAAI,EAAI,KAAK,CAACR,GAAKI,CAAK,CAAC;AACrB,aAAWK,KAAUP,EAAaF,CAAG,KAAK,CAAA;AACtC,IAAAQ,EAAI,KAAK,CAACC,GAAQL,CAAK,CAAC;AAG5B,SAAOI;AACX,GAAG,CAAA,CAAE,EACJ,OAAsB,CAACA,GAAK,CAACR,GAAKI,CAAK,MAAM;AAC1C,MAAIL,EAAWC,CAAG;AACd,WAAOQ;AAGX,QAAME,IACFV,KAAOO,IACDA,EAA+BP,CAAG,IAClCA,KAAOC,IACLA,EAA0BD,CAAG,IAC7BA,GAENW,IAAuBD,KAAA,gBAAAA,EAAa,WAAW,+BAA+B,SAAS;AAE7F,MAAI,OAAON,KAAU;AACjB,eAAW,CAACQ,GAAYC,CAAe,KAAK,OAAO,QAAQT,CAAK;AAC5D,MAAIS,MAAoB,WAEpBL,EAAI,KAAKI,CAAU,IAAID,CAAoB,EAAE,IAAIR,EAAyBH,GAAKa,CAAe;AAAA;AAKtG,IAAAL,EAAI,KAAKG,CAAoB,EAAE,IAAIR,EAAyBH,GAAKI,CAAK;AAE1E,SAAOI;AACX,GAAG,CAAA,CAAE;"}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
const o = "
|
|
2
|
-
root: o
|
|
3
|
-
indicator: n,
|
|
4
|
-
icon: e,
|
|
5
|
-
iconIndeterminate: c,
|
|
6
|
-
iconChecked: t
|
|
1
|
+
const o = "_root_ebauq_5", t = {
|
|
2
|
+
root: o
|
|
7
3
|
};
|
|
8
4
|
export {
|
|
9
|
-
|
|
10
|
-
e as icon,
|
|
11
|
-
t as iconChecked,
|
|
12
|
-
c as iconIndeterminate,
|
|
13
|
-
n as indicator,
|
|
5
|
+
t as default,
|
|
14
6
|
o as root
|
|
15
7
|
};
|
|
16
8
|
//# sourceMappingURL=fondue-components45.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components45.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components45.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,35 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
onColorChange: d = () => {
|
|
9
|
-
},
|
|
10
|
-
"data-test-id": o = "color-picker-input"
|
|
11
|
-
}, p) => /* @__PURE__ */ r("div", { className: t.gradientInput, "data-test-id": o, ref: p, children: /* @__PURE__ */ r(
|
|
12
|
-
n,
|
|
13
|
-
{
|
|
14
|
-
className: t.reactColorful,
|
|
15
|
-
color: {
|
|
16
|
-
r: a.red,
|
|
17
|
-
g: a.green,
|
|
18
|
-
b: a.blue,
|
|
19
|
-
a: a.alpha === void 0 ? 1 : a.alpha
|
|
20
|
-
},
|
|
21
|
-
onChange: (e) => d({
|
|
22
|
-
red: e.r,
|
|
23
|
-
green: e.g,
|
|
24
|
-
blue: e.b,
|
|
25
|
-
alpha: e.a
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
) });
|
|
29
|
-
i.displayName = "ColorPicker.Gradient";
|
|
30
|
-
const c = m(i);
|
|
1
|
+
const o = "_root_1fezf_5", n = "_indicator_1fezf_88", e = "_icon_1fezf_113", c = "_iconIndeterminate_1fezf_129", t = "_iconChecked_1fezf_133", i = {
|
|
2
|
+
root: o,
|
|
3
|
+
indicator: n,
|
|
4
|
+
icon: e,
|
|
5
|
+
iconIndeterminate: c,
|
|
6
|
+
iconChecked: t
|
|
7
|
+
};
|
|
31
8
|
export {
|
|
32
|
-
i as
|
|
33
|
-
|
|
9
|
+
i as default,
|
|
10
|
+
e as icon,
|
|
11
|
+
t as iconChecked,
|
|
12
|
+
c as iconIndeterminate,
|
|
13
|
+
n as indicator,
|
|
14
|
+
o as root
|
|
34
15
|
};
|
|
35
16
|
//# sourceMappingURL=fondue-components46.js.map
|