@frontify/fondue-components 29.1.0 → 29.2.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 +72 -70
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +176 -33
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components100.js +8 -23
- package/dist/fondue-components100.js.map +1 -1
- package/dist/fondue-components101.js +11 -34
- package/dist/fondue-components101.js.map +1 -1
- package/dist/fondue-components102.js +10 -10
- package/dist/fondue-components103.js +6 -67
- package/dist/fondue-components103.js.map +1 -1
- package/dist/fondue-components104.js +12 -14
- package/dist/fondue-components104.js.map +1 -1
- package/dist/fondue-components105.js +22 -25
- package/dist/fondue-components105.js.map +1 -1
- package/dist/fondue-components106.js +34 -19
- package/dist/fondue-components106.js.map +1 -1
- package/dist/fondue-components107.js +10 -24
- package/dist/fondue-components107.js.map +1 -1
- package/dist/fondue-components108.js +67 -8
- package/dist/fondue-components108.js.map +1 -1
- package/dist/fondue-components109.js +14 -30
- package/dist/fondue-components109.js.map +1 -1
- package/dist/fondue-components11.js +35 -185
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components110.js +23 -4
- package/dist/fondue-components110.js.map +1 -1
- package/dist/fondue-components111.js +18 -4
- package/dist/fondue-components111.js.map +1 -1
- package/dist/fondue-components112.js +24 -4
- package/dist/fondue-components112.js.map +1 -1
- package/dist/fondue-components113.js +9 -14
- package/dist/fondue-components113.js.map +1 -1
- package/dist/fondue-components114.js +32 -16
- package/dist/fondue-components114.js.map +1 -1
- package/dist/fondue-components115.js +7 -111
- package/dist/fondue-components115.js.map +1 -1
- package/dist/fondue-components116.js +4 -12
- package/dist/fondue-components116.js.map +1 -1
- package/dist/fondue-components117.js +5 -17
- package/dist/fondue-components117.js.map +1 -1
- package/dist/fondue-components118.js +16 -12
- package/dist/fondue-components118.js.map +1 -1
- package/dist/fondue-components119.js +14 -17
- package/dist/fondue-components119.js.map +1 -1
- package/dist/fondue-components12.js +185 -7
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components120.js +17 -127
- package/dist/fondue-components120.js.map +1 -1
- package/dist/fondue-components121.js +110 -10
- package/dist/fondue-components121.js.map +1 -1
- package/dist/fondue-components122.js +12 -35
- package/dist/fondue-components122.js.map +1 -1
- package/dist/fondue-components123.js +15 -215
- package/dist/fondue-components123.js.map +1 -1
- package/dist/fondue-components124.js +10 -16
- package/dist/fondue-components124.js.map +1 -1
- package/dist/fondue-components125.js +32 -16
- package/dist/fondue-components125.js.map +1 -1
- package/dist/fondue-components126.js +6 -151
- package/dist/fondue-components126.js.map +1 -1
- package/dist/fondue-components127.js +127 -45
- package/dist/fondue-components127.js.map +1 -1
- package/dist/fondue-components128.js +11 -42
- package/dist/fondue-components128.js.map +1 -1
- package/dist/fondue-components129.js +39 -0
- package/dist/fondue-components129.js.map +1 -0
- package/dist/fondue-components13.js +8 -63
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components130.js +216 -40
- package/dist/fondue-components130.js.map +1 -1
- package/dist/fondue-components131.js +14 -165
- package/dist/fondue-components131.js.map +1 -1
- package/dist/fondue-components132.js +17 -60
- package/dist/fondue-components132.js.map +1 -1
- package/dist/fondue-components133.js +151 -9
- package/dist/fondue-components133.js.map +1 -1
- package/dist/fondue-components134.js +44 -255
- package/dist/fondue-components134.js.map +1 -1
- package/dist/fondue-components135.js +170 -6
- package/dist/fondue-components135.js.map +1 -1
- package/dist/fondue-components136.js +60 -12
- package/dist/fondue-components136.js.map +1 -1
- package/dist/fondue-components137.js +9 -71
- package/dist/fondue-components137.js.map +1 -1
- package/dist/fondue-components138.js +255 -14
- package/dist/fondue-components138.js.map +1 -1
- package/dist/fondue-components14.js +61 -35
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components140.js +40 -87
- package/dist/fondue-components140.js.map +1 -1
- package/dist/fondue-components141.js +40 -80
- package/dist/fondue-components141.js.map +1 -1
- package/dist/fondue-components142.js +6 -31
- package/dist/fondue-components142.js.map +1 -1
- package/dist/fondue-components143.js +11 -18
- package/dist/fondue-components143.js.map +1 -1
- package/dist/fondue-components144.js +68 -67
- package/dist/fondue-components144.js.map +1 -1
- package/dist/fondue-components145.js +14 -1351
- package/dist/fondue-components145.js.map +1 -1
- package/dist/fondue-components146.js +7 -941
- package/dist/fondue-components146.js.map +1 -1
- package/dist/fondue-components147.js +87 -196
- package/dist/fondue-components147.js.map +1 -1
- package/dist/fondue-components148.js +78 -18
- package/dist/fondue-components148.js.map +1 -1
- package/dist/fondue-components149.js +30 -39
- package/dist/fondue-components149.js.map +1 -1
- package/dist/fondue-components15.js +36 -121
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components150.js +17 -66
- package/dist/fondue-components150.js.map +1 -1
- package/dist/fondue-components151.js +69 -30
- package/dist/fondue-components151.js.map +1 -1
- package/dist/fondue-components152.js +1352 -9
- package/dist/fondue-components152.js.map +1 -1
- package/dist/fondue-components153.js +939 -151
- package/dist/fondue-components153.js.map +1 -1
- package/dist/fondue-components154.js +197 -107
- package/dist/fondue-components154.js.map +1 -1
- package/dist/fondue-components155.js +22 -17
- package/dist/fondue-components155.js.map +1 -1
- package/dist/fondue-components156.js +39 -15
- package/dist/fondue-components156.js.map +1 -1
- package/dist/fondue-components157.js +68 -29
- package/dist/fondue-components157.js.map +1 -1
- package/dist/fondue-components158.js +31 -13
- package/dist/fondue-components158.js.map +1 -1
- package/dist/fondue-components159.js +9 -7
- package/dist/fondue-components159.js.map +1 -1
- package/dist/fondue-components16.js +121 -36
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components160.js +156 -0
- package/dist/fondue-components160.js.map +1 -0
- package/dist/fondue-components161.js +111 -0
- package/dist/fondue-components161.js.map +1 -0
- package/dist/fondue-components162.js +19 -0
- package/dist/fondue-components162.js.map +1 -0
- package/dist/fondue-components163.js +32 -0
- package/dist/fondue-components163.js.map +1 -0
- package/dist/fondue-components164.js +16 -0
- package/dist/fondue-components164.js.map +1 -0
- package/dist/fondue-components165.js +10 -0
- package/dist/fondue-components165.js.map +1 -0
- package/dist/fondue-components166.js +19 -0
- package/dist/fondue-components166.js.map +1 -0
- package/dist/fondue-components17.js +30 -39
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +44 -41
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +42 -57
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +55 -41
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +39 -16
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +17 -43
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +46 -68
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +67 -71
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +72 -16
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +18 -77
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +75 -34
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +34 -53
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +55 -23
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +23 -55
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +52 -97
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +98 -31
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +31 -194
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +184 -134
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +143 -130
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +131 -30
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +29 -79
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +68 -110
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +121 -34
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +21 -19
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +36 -56
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +56 -20
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +20 -25
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +25 -7
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +7 -8
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +9 -41
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +41 -5
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +1 -1
- package/dist/fondue-components48.js +3 -11
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +25 -29
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +33 -54
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +20 -130
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +85 -20
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +13 -53
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +32 -8
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +54 -13
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +130 -16
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +20 -4
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +52 -17
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +7 -18
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +1 -1
- package/dist/fondue-components60.js +13 -44
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +16 -24
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +4 -22
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +18 -7
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +18 -4
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +43 -12
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +24 -4
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +22 -17
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +4 -8
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +4 -36
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +32 -65
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components70.js +12 -6
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +1 -1
- package/dist/fondue-components72.js +17 -12
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +10 -51
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +37 -44
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +7 -6
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +5 -6
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +13 -13
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +51 -27
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +42 -11
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +65 -51
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components80.js +6 -5
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +6 -13
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +13 -48
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +27 -22
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +13 -629
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +4 -8
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +12 -12
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +47 -4
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +22 -24
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +628 -16
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +46 -173
- package/dist/fondue-components9.js.map +1 -1
- package/dist/fondue-components90.js +9 -20
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +13 -20
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +5 -20
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +24 -19
- package/dist/fondue-components93.js.map +1 -1
- package/dist/fondue-components94.js +17 -19
- package/dist/fondue-components94.js.map +1 -1
- package/dist/fondue-components95.js +20 -8
- package/dist/fondue-components95.js.map +1 -1
- package/dist/fondue-components96.js +20 -11
- package/dist/fondue-components96.js.map +1 -1
- package/dist/fondue-components97.js +20 -11
- package/dist/fondue-components97.js.map +1 -1
- package/dist/fondue-components98.js +20 -7
- package/dist/fondue-components98.js.map +1 -1
- package/dist/fondue-components99.js +19 -13
- package/dist/fondue-components99.js.map +1 -1
- package/dist/index.d.ts +180 -14
- package/dist/style.css +1 -1
- package/package.json +8 -4
- package/dist/fondue-components139.js +0 -10
- package/dist/fondue-components139.js.map +0 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p, Fragment as
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as h } from "react/jsx-runtime";
|
|
2
2
|
import { IconCross as y } from "@frontify/fondue-icons";
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { BadgeStatus as
|
|
5
|
-
import l from "./fondue-
|
|
6
|
-
const
|
|
3
|
+
import { useTranslation as N } from "./fondue-components43.js";
|
|
4
|
+
import { BadgeStatus as v } from "./fondue-components44.js";
|
|
5
|
+
import l from "./fondue-components45.js";
|
|
6
|
+
const x = ({
|
|
7
7
|
"aria-label": a,
|
|
8
8
|
"data-test-id": e = "badge",
|
|
9
9
|
children: d,
|
|
10
10
|
disabled: r = !1,
|
|
11
11
|
emphasis: b = "strong",
|
|
12
12
|
onClick: o,
|
|
13
|
-
onDismiss:
|
|
13
|
+
onDismiss: s,
|
|
14
14
|
size: f = "default",
|
|
15
15
|
status: i,
|
|
16
|
-
title:
|
|
16
|
+
title: n,
|
|
17
17
|
variant: g = "default"
|
|
18
18
|
}) => {
|
|
19
|
-
const { t:
|
|
20
|
-
"aria-label": a ||
|
|
19
|
+
const { t: B } = N(), m = {
|
|
20
|
+
"aria-label": a || n,
|
|
21
21
|
"data-component": "badge",
|
|
22
22
|
"data-disabled": r,
|
|
23
|
-
"data-dismissable": !!
|
|
23
|
+
"data-dismissable": !!s,
|
|
24
24
|
"data-emphasis": b,
|
|
25
25
|
"data-size": f,
|
|
26
26
|
"data-test-id": e,
|
|
27
27
|
"data-variant": g,
|
|
28
28
|
className: l.root,
|
|
29
|
-
title:
|
|
30
|
-
}, u =
|
|
29
|
+
title: n
|
|
30
|
+
}, u = s ? /* @__PURE__ */ t(
|
|
31
31
|
"button",
|
|
32
32
|
{
|
|
33
33
|
type: "button",
|
|
34
|
-
"aria-label":
|
|
34
|
+
"aria-label": B("Badge_dismiss", { label: a || n || "" }),
|
|
35
35
|
className: l.dismiss,
|
|
36
36
|
"data-test-id": `${e}-dismiss`,
|
|
37
37
|
disabled: r,
|
|
38
|
-
onClick:
|
|
38
|
+
onClick: s,
|
|
39
39
|
children: /* @__PURE__ */ t(y, { size: "12" })
|
|
40
40
|
}
|
|
41
41
|
) : null;
|
|
42
|
-
return o &&
|
|
42
|
+
return o && s ? /* @__PURE__ */ p("div", { ...m, children: [
|
|
43
43
|
/* @__PURE__ */ t(
|
|
44
44
|
"button",
|
|
45
45
|
{
|
|
46
46
|
type: "button",
|
|
47
|
-
"aria-label": a ||
|
|
47
|
+
"aria-label": a || n,
|
|
48
48
|
className: l.inner,
|
|
49
49
|
disabled: r,
|
|
50
50
|
onClick: o,
|
|
@@ -56,11 +56,13 @@ const S = ({
|
|
|
56
56
|
/* @__PURE__ */ t(c, { status: i, children: d }),
|
|
57
57
|
u
|
|
58
58
|
] });
|
|
59
|
-
}
|
|
60
|
-
|
|
59
|
+
};
|
|
60
|
+
x.displayName = "Badge";
|
|
61
|
+
const c = ({ children: a, status: e }) => /* @__PURE__ */ p(h, { children: [
|
|
62
|
+
e && /* @__PURE__ */ t(v, { status: e }),
|
|
61
63
|
a
|
|
62
64
|
] });
|
|
63
65
|
export {
|
|
64
|
-
|
|
66
|
+
x as Badge
|
|
65
67
|
};
|
|
66
68
|
//# sourceMappingURL=fondue-components4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components4.js","sources":["../src/components/Badge/Badge.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport { type MouseEvent, type ReactNode } from 'react';\n\nimport { useTranslation } from '#/hooks/useTranslation';\n\nimport { BadgeStatus, type BadgeStatusProps } from './BadgeStatus';\nimport styles from './styles/badge.module.scss';\n\ntype BadgeStyle = 'default' | 'positive' | 'highlight' | 'warning' | 'negative';\n\ntype BadgeEmphasis = 'strong' | 'weak';\n\ntype BadgeSize = 'default' | 'small';\n\ntype BadgeProps = {\n /**\n * @default 'strong'\n */\n emphasis?: BadgeEmphasis;\n /**\n * @default 'default'\n */\n variant?: BadgeStyle;\n /**\n * @default 'default'\n */\n size?: BadgeSize;\n /**\n * @default false\n */\n disabled?: boolean;\n /**\n * Click handler\n */\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Click handler on dismiss - providing this will show the dismiss button\n */\n onDismiss?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * The color of the status dot\n */\n status?: BadgeStatusProps['status'];\n title?: string;\n 'aria-label'?: string;\n 'data-test-id'?: string;\n children: ReactNode;\n};\n\nexport const Badge = ({\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'badge',\n children,\n disabled = false,\n emphasis = 'strong',\n onClick,\n onDismiss,\n size = 'default',\n status,\n title,\n variant = 'default',\n}: BadgeProps) => {\n const { t } = useTranslation();\n\n const commonProps = {\n 'aria-label': ariaLabel || title,\n 'data-component': 'badge',\n 'data-disabled': disabled,\n 'data-dismissable': !!onDismiss,\n 'data-emphasis': emphasis,\n 'data-size': size,\n 'data-test-id': dataTestId,\n 'data-variant': variant,\n className: styles.root,\n title,\n };\n\n const dismissButton = onDismiss ? (\n <button\n type=\"button\"\n aria-label={t('Badge_dismiss', { label: ariaLabel || title || '' })}\n className={styles.dismiss}\n data-test-id={`${dataTestId}-dismiss`}\n disabled={disabled}\n onClick={onDismiss}\n >\n <IconCross size=\"12\" />\n </button>\n ) : null;\n\n // When both onClick and onDismiss are provided, render as siblings inside a\n // wrapper div to avoid nesting interactive elements (invalid HTML / a11y issue).\n if (onClick && onDismiss) {\n return (\n <div {...commonProps}>\n <button\n type=\"button\"\n aria-label={ariaLabel || title}\n className={styles.inner}\n disabled={disabled}\n onClick={onClick}\n >\n <BadgeContent status={status}>{children}</BadgeContent>\n </button>\n {dismissButton}\n </div>\n );\n }\n\n if (onClick) {\n return (\n <button type=\"button\" disabled={disabled} {...commonProps} onClick={onClick}>\n <BadgeContent status={status}>{children}</BadgeContent>\n </button>\n );\n }\n\n return (\n <div {...commonProps}>\n <BadgeContent status={status}>{children}</BadgeContent>\n {dismissButton}\n </div>\n );\n};\n\nconst BadgeContent = ({ children, status }: { children: ReactNode; status?: BadgeStatusProps['status'] }) => (\n <>\n {status && <BadgeStatus status={status} />}\n {children}\n </>\n);\n"],"names":["Badge","ariaLabel","dataTestId","children","disabled","emphasis","onClick","onDismiss","size","status","title","variant","t","useTranslation","commonProps","styles","dismissButton","jsx","IconCross","jsxs","BadgeContent","Fragment","BadgeStatus"],"mappings":";;;;;AAmDO,MAAMA,IAAQ,CAAC;AAAA,EAClB,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AAAA,EAC7B,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC,IAAU;AACd,MAAkB;AACd,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GAERC,IAAc;AAAA,IAChB,cAAcb,KAAaS;AAAA,IAC3B,kBAAkB;AAAA,IAClB,iBAAiBN;AAAA,IACjB,oBAAoB,CAAC,CAACG;AAAA,IACtB,iBAAiBF;AAAA,IACjB,aAAaG;AAAA,IACb,gBAAgBN;AAAA,IAChB,gBAAgBS;AAAA,IAChB,WAAWI,EAAO;AAAA,IAClB,OAAAL;AAAA,EAAA,GAGEM,IAAgBT,IAClB,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAK;AAAA,MACL,cAAYL,EAAE,iBAAiB,EAAE,OAAOX,KAAaS,KAAS,IAAI;AAAA,MAClE,WAAWK,EAAO;AAAA,MAClB,gBAAc,GAAGb,CAAU;AAAA,MAC3B,UAAAE;AAAA,MACA,SAASG;AAAA,MAET,UAAA,gBAAAU,EAACC,GAAA,EAAU,MAAK,KAAA,CAAK;AAAA,IAAA;AAAA,EAAA,IAEzB;AAIJ,SAAIZ,KAAWC,IAEP,gBAAAY,EAAC,OAAA,EAAK,GAAGL,GACL,UAAA;AAAA,IAAA,gBAAAG;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,cAAYhB,KAAaS;AAAA,QACzB,WAAWK,EAAO;AAAA,QAClB,UAAAX;AAAA,QACA,SAAAE;AAAA,QAEA,UAAA,gBAAAW,EAACG,GAAA,EAAa,QAAAX,GAAiB,UAAAN,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,IAE3Ca;AAAA,EAAA,GACL,IAIJV,IAEI,gBAAAW,EAAC,UAAA,EAAO,MAAK,UAAS,UAAAb,GAAqB,GAAGU,GAAa,SAAAR,GACvD,UAAA,gBAAAW,EAACG,GAAA,EAAa,QAAAX,GAAiB,UAAAN,EAAA,CAAS,GAC5C,IAKJ,gBAAAgB,EAAC,OAAA,EAAK,GAAGL,GACL,UAAA;AAAA,IAAA,gBAAAG,EAACG,GAAA,EAAa,QAAAX,GAAiB,UAAAN,EAAA,CAAS;AAAA,IACvCa;AAAA,EAAA,GACL;AAER,
|
|
1
|
+
{"version":3,"file":"fondue-components4.js","sources":["../src/components/Badge/Badge.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport { type MouseEvent, type ReactNode } from 'react';\n\nimport { useTranslation } from '#/hooks/useTranslation';\n\nimport { BadgeStatus, type BadgeStatusProps } from './BadgeStatus';\nimport styles from './styles/badge.module.scss';\n\ntype BadgeStyle = 'default' | 'positive' | 'highlight' | 'warning' | 'negative';\n\ntype BadgeEmphasis = 'strong' | 'weak';\n\ntype BadgeSize = 'default' | 'small';\n\ntype BadgeProps = {\n /**\n * @default 'strong'\n */\n emphasis?: BadgeEmphasis;\n /**\n * @default 'default'\n */\n variant?: BadgeStyle;\n /**\n * @default 'default'\n */\n size?: BadgeSize;\n /**\n * @default false\n */\n disabled?: boolean;\n /**\n * Click handler\n */\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Click handler on dismiss - providing this will show the dismiss button\n */\n onDismiss?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * The color of the status dot\n */\n status?: BadgeStatusProps['status'];\n title?: string;\n 'aria-label'?: string;\n 'data-test-id'?: string;\n children: ReactNode;\n};\n\nexport const Badge = ({\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'badge',\n children,\n disabled = false,\n emphasis = 'strong',\n onClick,\n onDismiss,\n size = 'default',\n status,\n title,\n variant = 'default',\n}: BadgeProps) => {\n const { t } = useTranslation();\n\n const commonProps = {\n 'aria-label': ariaLabel || title,\n 'data-component': 'badge',\n 'data-disabled': disabled,\n 'data-dismissable': !!onDismiss,\n 'data-emphasis': emphasis,\n 'data-size': size,\n 'data-test-id': dataTestId,\n 'data-variant': variant,\n className: styles.root,\n title,\n };\n\n const dismissButton = onDismiss ? (\n <button\n type=\"button\"\n aria-label={t('Badge_dismiss', { label: ariaLabel || title || '' })}\n className={styles.dismiss}\n data-test-id={`${dataTestId}-dismiss`}\n disabled={disabled}\n onClick={onDismiss}\n >\n <IconCross size=\"12\" />\n </button>\n ) : null;\n\n // When both onClick and onDismiss are provided, render as siblings inside a\n // wrapper div to avoid nesting interactive elements (invalid HTML / a11y issue).\n if (onClick && onDismiss) {\n return (\n <div {...commonProps}>\n <button\n type=\"button\"\n aria-label={ariaLabel || title}\n className={styles.inner}\n disabled={disabled}\n onClick={onClick}\n >\n <BadgeContent status={status}>{children}</BadgeContent>\n </button>\n {dismissButton}\n </div>\n );\n }\n\n if (onClick) {\n return (\n <button type=\"button\" disabled={disabled} {...commonProps} onClick={onClick}>\n <BadgeContent status={status}>{children}</BadgeContent>\n </button>\n );\n }\n\n return (\n <div {...commonProps}>\n <BadgeContent status={status}>{children}</BadgeContent>\n {dismissButton}\n </div>\n );\n};\n\nBadge.displayName = 'Badge';\n\nconst BadgeContent = ({ children, status }: { children: ReactNode; status?: BadgeStatusProps['status'] }) => (\n <>\n {status && <BadgeStatus status={status} />}\n {children}\n </>\n);\n"],"names":["Badge","ariaLabel","dataTestId","children","disabled","emphasis","onClick","onDismiss","size","status","title","variant","t","useTranslation","commonProps","styles","dismissButton","jsx","IconCross","jsxs","BadgeContent","Fragment","BadgeStatus"],"mappings":";;;;;AAmDO,MAAMA,IAAQ,CAAC;AAAA,EAClB,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AAAA,EAC7B,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC,IAAU;AACd,MAAkB;AACd,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GAERC,IAAc;AAAA,IAChB,cAAcb,KAAaS;AAAA,IAC3B,kBAAkB;AAAA,IAClB,iBAAiBN;AAAA,IACjB,oBAAoB,CAAC,CAACG;AAAA,IACtB,iBAAiBF;AAAA,IACjB,aAAaG;AAAA,IACb,gBAAgBN;AAAA,IAChB,gBAAgBS;AAAA,IAChB,WAAWI,EAAO;AAAA,IAClB,OAAAL;AAAA,EAAA,GAGEM,IAAgBT,IAClB,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAK;AAAA,MACL,cAAYL,EAAE,iBAAiB,EAAE,OAAOX,KAAaS,KAAS,IAAI;AAAA,MAClE,WAAWK,EAAO;AAAA,MAClB,gBAAc,GAAGb,CAAU;AAAA,MAC3B,UAAAE;AAAA,MACA,SAASG;AAAA,MAET,UAAA,gBAAAU,EAACC,GAAA,EAAU,MAAK,KAAA,CAAK;AAAA,IAAA;AAAA,EAAA,IAEzB;AAIJ,SAAIZ,KAAWC,IAEP,gBAAAY,EAAC,OAAA,EAAK,GAAGL,GACL,UAAA;AAAA,IAAA,gBAAAG;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,cAAYhB,KAAaS;AAAA,QACzB,WAAWK,EAAO;AAAA,QAClB,UAAAX;AAAA,QACA,SAAAE;AAAA,QAEA,UAAA,gBAAAW,EAACG,GAAA,EAAa,QAAAX,GAAiB,UAAAN,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,IAE3Ca;AAAA,EAAA,GACL,IAIJV,IAEI,gBAAAW,EAAC,UAAA,EAAO,MAAK,UAAS,UAAAb,GAAqB,GAAGU,GAAa,SAAAR,GACvD,UAAA,gBAAAW,EAACG,GAAA,EAAa,QAAAX,GAAiB,UAAAN,EAAA,CAAS,GAC5C,IAKJ,gBAAAgB,EAAC,OAAA,EAAK,GAAGL,GACL,UAAA;AAAA,IAAA,gBAAAG,EAACG,GAAA,EAAa,QAAAX,GAAiB,UAAAN,EAAA,CAAS;AAAA,IACvCa;AAAA,EAAA,GACL;AAER;AAEAhB,EAAM,cAAc;AAEpB,MAAMoB,IAAe,CAAC,EAAE,UAAAjB,GAAU,QAAAM,EAAA,MAC9B,gBAAAU,EAAAE,GAAA,EACK,UAAA;AAAA,EAAAZ,KAAU,gBAAAQ,EAACK,KAAY,QAAAb,EAAA,CAAgB;AAAA,EACvCN;AAAA,GACL;"}
|
|
@@ -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-components113.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-components114.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-components40.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components40.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components40.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-components40.js";
|
|
5
|
+
import s from "./fondue-components115.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-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/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,29 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
};
|
|
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
|
|
25
11
|
};
|
|
26
12
|
export {
|
|
27
|
-
|
|
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
|
|
28
23
|
};
|
|
29
24
|
//# 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,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-components40.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-components43.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components43.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components43.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-components116.js";
|
|
3
|
+
import { colorToCss as e } from "./fondue-components117.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-components44.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components44.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components44.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-components45.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components45.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components45.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-components46.js.map
|