@frontify/fondue-components 23.0.0 → 24.0.0-rc.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 +50 -46
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +3 -3
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +104 -86
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +58 -57
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +2 -2
- package/dist/fondue-components15.js +2 -2
- package/dist/fondue-components16.js +2 -2
- package/dist/fondue-components17.js +56 -36
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +34 -16
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +18 -73
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +18 -36
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +71 -50
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +36 -138
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +50 -50
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +138 -33
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +52 -193
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +30 -134
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +191 -126
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +134 -30
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +130 -63
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +31 -101
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +64 -30
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +98 -52
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +30 -20
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +56 -23
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +20 -7
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +23 -6
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +8 -32
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +5 -3
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +32 -12
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +3 -3
- package/dist/fondue-components40.js +5 -155
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +18 -116
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +59 -22
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +111 -14
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +116 -30
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +21 -54
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +31 -130
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +53 -20
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +131 -53
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +20 -7
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +53 -13
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +7 -14
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +13 -5
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +15 -60
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +5 -18
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +60 -19
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +18 -5
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +18 -14
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +1 -1
- package/dist/fondue-components59.js +10 -16
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +4 -4
- package/dist/fondue-components60.js +4 -10
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +18 -35
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +10 -4
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +34 -10
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +35 -5
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +4 -24
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +12 -16
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +4 -151
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +25 -19
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +16 -77
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +2 -2
- package/dist/fondue-components70.js +152 -8
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +19 -37
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +76 -69
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +8 -11
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +36 -12
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +70 -12
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +10 -22
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +13 -34
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +12 -10
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +22 -67
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components80.js +34 -15
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +9 -24
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +67 -18
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +14 -22
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +24 -6
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +18 -19
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +21 -5
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +8 -4
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +19 -4
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +4 -14
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +5 -5
- package/dist/fondue-components90.js +5 -2
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +4 -39
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +2 -21
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +20 -0
- package/dist/fondue-components93.js.map +1 -0
- package/dist/fondue-components94.js +43 -0
- package/dist/fondue-components94.js.map +1 -0
- package/dist/fondue-components95.js +24 -0
- package/dist/fondue-components95.js.map +1 -0
- package/dist/index.d.ts +116 -3
- package/dist/style.css +1 -1
- package/package.json +6 -5
|
@@ -1,115 +1,116 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { IconCross as x } from "@frontify/fondue-icons";
|
|
3
|
-
import * as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useTranslation as I } from "./fondue-
|
|
6
|
-
import { addAutoFocusAttribute as _, addShowFocusRing as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
3
|
+
import * as l from "@radix-ui/react-popover";
|
|
4
|
+
import { forwardRef as i } from "react";
|
|
5
|
+
import { useTranslation as I } from "./fondue-components36.js";
|
|
6
|
+
import { addAutoFocusAttribute as _, addShowFocusRing as B } from "./fondue-components52.js";
|
|
7
|
+
import { Button as O } from "./fondue-components6.js";
|
|
8
|
+
import { useFondueTheme as S, ThemeProvider as j } from "./fondue-components33.js";
|
|
9
|
+
import u from "./fondue-components59.js";
|
|
10
|
+
const f = ({ children: t, ...o }) => /* @__PURE__ */ e(l.Root, { ...o, children: t });
|
|
10
11
|
f.displayName = "Flyout.Root";
|
|
11
|
-
const y = ({ asChild: t = !0, children: o, "data-test-id":
|
|
12
|
-
|
|
12
|
+
const y = ({ asChild: t = !0, children: o, "data-test-id": a = "fondue-flyout-trigger", ...r }, d) => /* @__PURE__ */ e(
|
|
13
|
+
l.Trigger,
|
|
13
14
|
{
|
|
14
15
|
onMouseDown: _,
|
|
15
16
|
"data-auto-focus-visible": "true",
|
|
16
17
|
"data-auto-focus-trigger": !0,
|
|
17
|
-
"data-test-id":
|
|
18
|
+
"data-test-id": a,
|
|
18
19
|
asChild: t,
|
|
19
|
-
ref:
|
|
20
|
+
ref: d,
|
|
20
21
|
...r,
|
|
21
22
|
children: o
|
|
22
23
|
}
|
|
23
24
|
);
|
|
24
25
|
y.displayName = "Flyout.Trigger";
|
|
25
|
-
const
|
|
26
|
+
const D = {
|
|
26
27
|
compact: 8,
|
|
27
28
|
comfortable: 12,
|
|
28
29
|
spacious: 16
|
|
29
|
-
},
|
|
30
|
+
}, H = {
|
|
30
31
|
compact: 8,
|
|
31
32
|
spacious: 24
|
|
32
33
|
}, p = ({
|
|
33
34
|
align: t = "start",
|
|
34
35
|
maxWidth: o = "360px",
|
|
35
|
-
padding:
|
|
36
|
+
padding: a = "compact",
|
|
36
37
|
rounded: r = "medium",
|
|
37
|
-
width:
|
|
38
|
+
width: d = "fit-content",
|
|
38
39
|
shadow: n = "medium",
|
|
39
40
|
side: N,
|
|
40
41
|
triggerOffset: v = "compact",
|
|
41
|
-
viewportCollisionPadding:
|
|
42
|
-
"data-test-id":
|
|
43
|
-
children:
|
|
44
|
-
...
|
|
45
|
-
},
|
|
46
|
-
const { theme:
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
42
|
+
viewportCollisionPadding: C = "compact",
|
|
43
|
+
"data-test-id": P = "fondue-flyout-content",
|
|
44
|
+
children: R,
|
|
45
|
+
...b
|
|
46
|
+
}, w) => {
|
|
47
|
+
const { theme: A, dir: c } = S(), T = (s) => !s || c === "ltr" ? s : s === "left" ? "right" : s === "right" ? "left" : s;
|
|
48
|
+
return /* @__PURE__ */ e(l.Portal, { children: /* @__PURE__ */ m(j, { theme: A, dir: c, children: [
|
|
49
|
+
/* @__PURE__ */ e("div", { "data-test-id": "fondue-flyout-overlay", className: u.overlay }),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
l.Content,
|
|
51
52
|
{
|
|
52
53
|
style: {
|
|
53
54
|
"--flyout-max-width": o,
|
|
54
|
-
"--flyout-width":
|
|
55
|
+
"--flyout-width": d
|
|
55
56
|
},
|
|
56
|
-
ref:
|
|
57
|
+
ref: w,
|
|
57
58
|
align: t,
|
|
58
|
-
collisionPadding:
|
|
59
|
-
sideOffset:
|
|
60
|
-
side:
|
|
61
|
-
className:
|
|
62
|
-
"data-flyout-spacing":
|
|
59
|
+
collisionPadding: H[C],
|
|
60
|
+
sideOffset: D[v],
|
|
61
|
+
side: T(N),
|
|
62
|
+
className: u.root,
|
|
63
|
+
"data-flyout-spacing": a,
|
|
63
64
|
"data-rounded": r,
|
|
64
65
|
"data-shadow": n,
|
|
65
|
-
"data-test-id":
|
|
66
|
-
onFocus:
|
|
67
|
-
...
|
|
68
|
-
children:
|
|
66
|
+
"data-test-id": P,
|
|
67
|
+
onFocus: B,
|
|
68
|
+
...b,
|
|
69
|
+
children: R
|
|
69
70
|
}
|
|
70
71
|
)
|
|
71
72
|
] }) });
|
|
72
73
|
};
|
|
73
74
|
p.displayName = "Flyout.Content";
|
|
74
|
-
const F = ({ showCloseButton: t, children: o, "data-test-id":
|
|
75
|
+
const F = ({ showCloseButton: t, children: o, "data-test-id": a = "fondue-flyout-header", closeProps: r }, d) => {
|
|
75
76
|
const { t: n } = I();
|
|
76
|
-
return /* @__PURE__ */ m("div", { "data-test-id":
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
t && /* @__PURE__ */
|
|
79
|
-
|
|
77
|
+
return /* @__PURE__ */ m("div", { "data-test-id": a, ref: d, className: u.header, children: [
|
|
78
|
+
/* @__PURE__ */ e("div", { children: o }),
|
|
79
|
+
t && /* @__PURE__ */ e(l.Close, { asChild: !0, ...r, children: /* @__PURE__ */ e(
|
|
80
|
+
O,
|
|
80
81
|
{
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
82
|
+
size: "small",
|
|
83
|
+
aspect: "square",
|
|
84
|
+
emphasis: "weak",
|
|
84
85
|
"aria-label": n("Flyout_close"),
|
|
85
|
-
|
|
86
|
-
children: /* @__PURE__ */
|
|
86
|
+
"data-test-id": `${a}-close`,
|
|
87
|
+
children: /* @__PURE__ */ e(x, { size: 20 })
|
|
87
88
|
}
|
|
88
|
-
)
|
|
89
|
+
) })
|
|
89
90
|
] });
|
|
90
91
|
};
|
|
91
92
|
F.displayName = "Flyout.Header";
|
|
92
|
-
const g = ({ children: t, "data-test-id": o = "fondue-flyout-footer" },
|
|
93
|
+
const g = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, a) => /* @__PURE__ */ e("div", { "data-test-id": o, ref: a, className: u.footer, children: t });
|
|
93
94
|
g.displayName = "Flyout.Footer";
|
|
94
|
-
const h = ({ children: t, "data-test-id": o = "fondue-flyout-body", scrollable:
|
|
95
|
+
const h = ({ children: t, "data-test-id": o = "fondue-flyout-body", scrollable: a = !1 }, r) => /* @__PURE__ */ e(
|
|
95
96
|
"div",
|
|
96
97
|
{
|
|
97
98
|
"data-test-id": o,
|
|
98
99
|
ref: r,
|
|
99
100
|
"data-flyout-spacing": "compact",
|
|
100
|
-
"data-scrollable":
|
|
101
|
-
className:
|
|
101
|
+
"data-scrollable": a,
|
|
102
|
+
className: u.body,
|
|
102
103
|
children: t
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
106
|
h.displayName = "Flyout.Body";
|
|
106
107
|
const W = {
|
|
107
108
|
Root: f,
|
|
108
|
-
Trigger:
|
|
109
|
-
Content:
|
|
110
|
-
Header:
|
|
111
|
-
Footer:
|
|
112
|
-
Body:
|
|
109
|
+
Trigger: i(y),
|
|
110
|
+
Content: i(p),
|
|
111
|
+
Header: i(F),
|
|
112
|
+
Footer: i(g),
|
|
113
|
+
Body: i(h)
|
|
113
114
|
};
|
|
114
115
|
export {
|
|
115
116
|
W as Flyout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components13.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { useTranslation } from '#/hooks/useTranslation';\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger', ...props }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\ntype FlyoutSpacing = 'compact' | 'comfortable' | 'spacious';\ntype FlyoutViewportCollisionPadding = 'compact' | 'spacious';\nexport type FlyoutContentProps = {\n /**\n * Add a shadow to the flyout\n * @default \"medium\"\n */\n shadow?: 'none' | 'medium' | 'large';\n /**\n * Add rounded corners to the flyout\n * @default \"medium\"\n */\n rounded?: 'none' | 'medium' | 'large';\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the fixed width of the flyout\n * @default \"fit-content\"\n */\n width?: string;\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: FlyoutSpacing;\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n /**\n * Define the minimum distance between the flyout and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: FlyoutViewportCollisionPadding;\n /**\n * Event handler called when auto-focusing on open\n */\n onOpenAutoFocus?: (event: Event) => void;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nconst SPACING_MAP: Record<FlyoutSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nconst VIEWPORT_COLLISION_PADDING_MAP: Record<FlyoutViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n rounded = 'medium',\n width = 'fit-content',\n shadow = 'medium',\n side,\n triggerOffset = 'compact',\n viewportCollisionPadding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\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 <RadixPopover.Portal>\n <ThemeProvider theme={theme} dir={dir}>\n <div data-test-id=\"fondue-flyout-overlay\" className={styles.overlay} />\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n '--flyout-width': width,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding]}\n sideOffset={SPACING_MAP[triggerOffset]}\n side={getAdjustedSide(side)}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n closeProps?: CommonAriaProps;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header', closeProps }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { t } = useTranslation();\n\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close\n role=\"button\"\n data-test-id={`${dataTestId}-close`}\n className={styles.close}\n aria-label={t('Flyout_close')}\n {...closeProps}\n >\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Allow the body to scroll if the max height of the flyout is reached\n * @default false\n */\n scrollable?: boolean;\n};\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body', scrollable = false }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n data-flyout-spacing=\"compact\"\n data-scrollable={scrollable}\n className={styles.body}\n >\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","SPACING_MAP","VIEWPORT_COLLISION_PADDING_MAP","FlyoutContent","align","maxWidth","padding","rounded","width","shadow","side","triggerOffset","viewportCollisionPadding","theme","dir","useFondueTheme","getAdjustedSide","jsxs","ThemeProvider","styles","addShowFocusRing","FlyoutHeader","showCloseButton","closeProps","t","useTranslation","IconCross","FlyoutFooter","FlyoutBody","scrollable","Flyout","forwardRef"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"fondue-components13.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { useTranslation } from '#/hooks/useTranslation';\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { Button } from '../Button/Button';\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger', ...props }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\ntype FlyoutSpacing = 'compact' | 'comfortable' | 'spacious';\ntype FlyoutViewportCollisionPadding = 'compact' | 'spacious';\nexport type FlyoutContentProps = {\n /**\n * Add a shadow to the flyout\n * @default \"medium\"\n */\n shadow?: 'none' | 'medium' | 'large';\n /**\n * Add rounded corners to the flyout\n * @default \"medium\"\n */\n rounded?: 'none' | 'medium' | 'large';\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the fixed width of the flyout\n * @default \"fit-content\"\n */\n width?: string;\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: FlyoutSpacing;\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n /**\n * Define the minimum distance between the flyout and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: FlyoutViewportCollisionPadding;\n /**\n * Event handler called when auto-focusing on open\n */\n onOpenAutoFocus?: (event: Event) => void;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nconst SPACING_MAP: Record<FlyoutSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nconst VIEWPORT_COLLISION_PADDING_MAP: Record<FlyoutViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n rounded = 'medium',\n width = 'fit-content',\n shadow = 'medium',\n side,\n triggerOffset = 'compact',\n viewportCollisionPadding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\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 <RadixPopover.Portal>\n <ThemeProvider theme={theme} dir={dir}>\n <div data-test-id=\"fondue-flyout-overlay\" className={styles.overlay} />\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n '--flyout-width': width,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding]}\n sideOffset={SPACING_MAP[triggerOffset]}\n side={getAdjustedSide(side)}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n closeProps?: CommonAriaProps;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header', closeProps }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { t } = useTranslation();\n\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close asChild {...closeProps}>\n <Button\n size=\"small\"\n aspect=\"square\"\n emphasis=\"weak\"\n aria-label={t('Flyout_close')}\n data-test-id={`${dataTestId}-close`}\n >\n <IconCross size={20} />\n </Button>\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Allow the body to scroll if the max height of the flyout is reached\n * @default false\n */\n scrollable?: boolean;\n};\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body', scrollable = false }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n data-flyout-spacing=\"compact\"\n data-scrollable={scrollable}\n className={styles.body}\n >\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","SPACING_MAP","VIEWPORT_COLLISION_PADDING_MAP","FlyoutContent","align","maxWidth","padding","rounded","width","shadow","side","triggerOffset","viewportCollisionPadding","theme","dir","useFondueTheme","getAdjustedSide","jsxs","ThemeProvider","styles","addShowFocusRing","FlyoutHeader","showCloseButton","closeProps","t","useTranslation","Button","IconCross","FlyoutFooter","FlyoutBody","scrollable","Flyout","forwardRef"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as y } from "react";
|
|
3
|
-
import { propsToCssVariables as n } from "./fondue-
|
|
4
|
-
import u from "./fondue-
|
|
3
|
+
import { propsToCssVariables as n } from "./fondue-components39.js";
|
|
4
|
+
import u from "./fondue-components60.js";
|
|
5
5
|
const c = y(
|
|
6
6
|
({
|
|
7
7
|
as: a = "div",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as y } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as g } from "react";
|
|
3
|
-
import { cn as x } from "./fondue-
|
|
4
|
-
import a from "./fondue-
|
|
3
|
+
import { cn as x } from "./fondue-components41.js";
|
|
4
|
+
import a from "./fondue-components61.js";
|
|
5
5
|
const $ = g(
|
|
6
6
|
({
|
|
7
7
|
as: e = "span",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as f from "@radix-ui/react-label";
|
|
3
3
|
import { forwardRef as b, useRef as p, useLayoutEffect as x } from "react";
|
|
4
|
-
import { cn as A } from "./fondue-
|
|
5
|
-
import r from "./fondue-
|
|
4
|
+
import { cn as A } from "./fondue-components41.js";
|
|
5
|
+
import r from "./fondue-components62.js";
|
|
6
6
|
const g = ({ className: l, "data-test-id": d = "fondue-label", children: o, variant: c = "default", ...i }, u) => {
|
|
7
7
|
const n = p(null);
|
|
8
8
|
return x(() => {
|
|
@@ -1,42 +1,62 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as D, useCallback as H } from "react";
|
|
3
|
+
import { cn as L } from "./fondue-components41.js";
|
|
4
|
+
import { useFondueRouter as N } from "./fondue-components20.js";
|
|
5
|
+
import o from "./fondue-components63.js";
|
|
6
|
+
const R = D(
|
|
6
7
|
({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
...l,
|
|
29
|
-
children: /* @__PURE__ */ i(
|
|
30
|
-
t.Indicator,
|
|
31
|
-
{
|
|
32
|
-
className: f({ variant: o, indeterminateState: a === null })
|
|
8
|
+
id: c,
|
|
9
|
+
className: l,
|
|
10
|
+
children: u,
|
|
11
|
+
size: n = "medium",
|
|
12
|
+
weight: f = "regular",
|
|
13
|
+
truncate: p = !1,
|
|
14
|
+
wrap: d = "nowrap",
|
|
15
|
+
underline: $ = "auto",
|
|
16
|
+
color: k = "primary",
|
|
17
|
+
href: t,
|
|
18
|
+
onContainer: i,
|
|
19
|
+
onPress: a,
|
|
20
|
+
disabled: r = !1,
|
|
21
|
+
...s
|
|
22
|
+
}, v) => {
|
|
23
|
+
const { navigate: m, useHref: w } = N(), g = w(t), x = H(
|
|
24
|
+
(e) => {
|
|
25
|
+
if (r) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
return;
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
a == null || a(e), t && (e.preventDefault(), m(t));
|
|
30
|
+
},
|
|
31
|
+
[t, m, a, r]
|
|
32
|
+
), y = r ? o.disabled : o[i ? `color-on-container-${i}` : `color-${k}`];
|
|
33
|
+
return /* @__PURE__ */ C(
|
|
34
|
+
"a",
|
|
35
|
+
{
|
|
36
|
+
id: c,
|
|
37
|
+
className: L([
|
|
38
|
+
o.root,
|
|
39
|
+
o[`size-${n}`],
|
|
40
|
+
o[`weight-${f}`],
|
|
41
|
+
o[`wrap-${d}`],
|
|
42
|
+
o[`underline-${$}`],
|
|
43
|
+
p && o.truncate,
|
|
44
|
+
y,
|
|
45
|
+
l
|
|
46
|
+
]),
|
|
47
|
+
ref: v,
|
|
48
|
+
href: r ? void 0 : g,
|
|
49
|
+
onClick: x,
|
|
50
|
+
"aria-disabled": r || void 0,
|
|
51
|
+
tabIndex: r ? -1 : void 0,
|
|
52
|
+
...s,
|
|
53
|
+
children: u
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
37
57
|
);
|
|
38
|
-
|
|
58
|
+
R.displayName = "Link";
|
|
39
59
|
export {
|
|
40
|
-
|
|
60
|
+
R as Link
|
|
41
61
|
};
|
|
42
62
|
//# sourceMappingURL=fondue-components17.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components17.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components17.js","sources":["../src/components/Link/Link.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode, type MouseEvent, useCallback } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { useFondueRouter } from '../RouterProvider/RouterProvider';\n\nimport styles from './styles/link.module.scss';\n\ntype LinkSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\ntype LinkWeight = 'regular' | 'medium' | 'bold';\ntype LinkColor = 'primary' | 'secondary' | 'error' | 'success' | 'warning' | 'highlight';\ntype LinkOnContainerColor = 'secondary' | 'disabled' | 'error' | 'success' | 'warning' | 'highlight';\ntype LinkWrap = 'wrap' | 'nowrap';\ntype LinkUnderline = 'auto' | 'always' | 'hover' | 'none';\n\nexport type LinkProps = {\n children?: ReactNode;\n /**\n * The link to navigate to when clicked\n */\n href: string;\n /**\n * Id of the element\n */\n id?: string;\n /**\n * Size of the text\n *\n * @default 'medium'\n */\n size?: LinkSize;\n /**\n * Weight of the font\n *\n * @default 'regular'\n */\n weight?: LinkWeight;\n /**\n * Color of the text\n *\n * @default 'primary'\n */\n color?: LinkColor;\n /**\n * The texts color when used within a container\n *\n * @description optional color prop that uses the inverse container color when accessibility contrast is needed\n **/\n onContainer?: LinkOnContainerColor;\n /**\n * Truncate the text if it overflows\n */\n truncate?: boolean;\n /**\n * Wrap the text if it overflows\n * @default 'nowrap'\n */\n wrap?: LinkWrap;\n /**\n * Underline behavior of the link\n * @default 'auto'\n */\n underline?: LinkUnderline;\n /**\n * The target attribute for the link\n * @default '_self'\n */\n target?: string;\n /**\n * The rel attribute for the link\n * @default 'noopener noreferrer'\n */\n rel?: string;\n className?: string;\n onPress?: (event: MouseEvent<HTMLAnchorElement>) => void;\n 'data-test-id'?: string;\n /**\n * Aria label for the component.\n */\n 'aria-label'?: string;\n /**\n * Aria labelled by for the component.\n */\n 'aria-labelledby'?: string;\n /**\n * Aria described by for the component.\n */\n 'aria-describedby'?: string;\n /**\n * Aria details for extend description of the component.\n */\n 'aria-details'?: string;\n /**\n * Disable the link\n *\n * @default false\n */\n disabled?: boolean;\n};\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n (\n {\n id,\n className,\n children,\n size = 'medium',\n weight = 'regular',\n truncate = false,\n wrap = 'nowrap',\n underline = 'auto',\n color = 'primary',\n href,\n onContainer,\n onPress,\n disabled = false,\n ...props\n },\n ref,\n ) => {\n const { navigate, useHref } = useFondueRouter();\n const resolvedHref = useHref(href);\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLAnchorElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onPress?.(event);\n\n if (href) {\n event.preventDefault();\n navigate(href);\n }\n },\n [href, navigate, onPress, disabled],\n );\n\n const computedColor = disabled\n ? styles.disabled\n : styles[onContainer ? `color-on-container-${onContainer}` : `color-${color}`];\n\n return (\n <a\n id={id}\n className={cn([\n styles.root,\n styles[`size-${size}`],\n styles[`weight-${weight}`],\n styles[`wrap-${wrap}`],\n styles[`underline-${underline}`],\n truncate && styles.truncate,\n computedColor,\n className,\n ])}\n ref={ref}\n href={disabled ? undefined : resolvedHref}\n onClick={handleClick}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n {...props}\n >\n {children}\n </a>\n );\n },\n);\nLink.displayName = 'Link';\n"],"names":["Link","forwardRef","id","className","children","size","weight","truncate","wrap","underline","color","href","onContainer","onPress","disabled","props","ref","navigate","useHref","useFondueRouter","resolvedHref","handleClick","useCallback","event","computedColor","styles","jsx","cn"],"mappings":";;;;;AAsGO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,OAAAC,IAAQ;AAAA,IACR,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,GAAGC;AAAA,EAAA,GAEPC,MACC;AACD,UAAM,EAAE,UAAAC,GAAU,SAAAC,EAAA,IAAYC,EAAA,GACxBC,IAAeF,EAAQP,CAAI,GAE3BU,IAAcC;AAAA,MAChB,CAACC,MAAyC;AACtC,YAAIT,GAAU;AACV,UAAAS,EAAM,eAAA;AACN;AAAA,QACJ;AACA,QAAAV,KAAA,QAAAA,EAAUU,IAENZ,MACAY,EAAM,eAAA,GACNN,EAASN,CAAI;AAAA,MAErB;AAAA,MACA,CAACA,GAAMM,GAAUJ,GAASC,CAAQ;AAAA,IAAA,GAGhCU,IAAgBV,IAChBW,EAAO,WACPA,EAAOb,IAAc,sBAAsBA,CAAW,KAAK,SAASF,CAAK,EAAE;AAEjF,WACI,gBAAAgB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,IAAAxB;AAAA,QACA,WAAWyB,EAAG;AAAA,UACVF,EAAO;AAAA,UACPA,EAAO,QAAQpB,CAAI,EAAE;AAAA,UACrBoB,EAAO,UAAUnB,CAAM,EAAE;AAAA,UACzBmB,EAAO,QAAQjB,CAAI,EAAE;AAAA,UACrBiB,EAAO,aAAahB,CAAS,EAAE;AAAA,UAC/BF,KAAYkB,EAAO;AAAA,UACnBD;AAAA,UACArB;AAAA,QAAA,CACH;AAAA,QACD,KAAAa;AAAA,QACA,MAAMF,IAAW,SAAYM;AAAA,QAC7B,SAASC;AAAA,QACT,iBAAeP,KAAY;AAAA,QAC3B,UAAUA,IAAW,KAAK;AAAA,QACzB,GAAGC;AAAA,QAEH,UAAAX;AAAA,MAAA;AAAA,IAAA;AAAA,EAGb;AACJ;AACAJ,EAAK,cAAc;"}
|
|
@@ -1,24 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-progress";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
|
+
import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components64.js";
|
|
5
|
+
const p = m(
|
|
5
6
|
({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
7
|
+
value: a,
|
|
8
|
+
max: r = 100,
|
|
9
|
+
rounded: d = !0,
|
|
10
|
+
variant: o = "default",
|
|
11
|
+
size: e = "medium",
|
|
12
|
+
"data-test-id": n = "fondue-loading-bar",
|
|
13
|
+
...l
|
|
14
|
+
}, s) => /* @__PURE__ */ i(
|
|
15
|
+
t.Root,
|
|
11
16
|
{
|
|
12
|
-
ref:
|
|
13
|
-
"data-test-id":
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
+
ref: s,
|
|
18
|
+
"data-test-id": n,
|
|
19
|
+
className: g({ rounded: d, size: e, variant: o }),
|
|
20
|
+
"aria-busy": a !== r,
|
|
21
|
+
value: a,
|
|
22
|
+
max: r,
|
|
23
|
+
style: {
|
|
24
|
+
"--loading-bar-value": a,
|
|
25
|
+
"--loading-bar-max": r,
|
|
26
|
+
"--loading-bar-proportion": "calc(var(--loading-bar-value) / var(--loading-bar-max))"
|
|
27
|
+
},
|
|
28
|
+
...l,
|
|
29
|
+
children: /* @__PURE__ */ i(
|
|
30
|
+
t.Indicator,
|
|
31
|
+
{
|
|
32
|
+
className: f({ variant: o, indeterminateState: a === null })
|
|
33
|
+
}
|
|
34
|
+
)
|
|
17
35
|
}
|
|
18
36
|
)
|
|
19
37
|
);
|
|
20
|
-
|
|
38
|
+
p.displayName = "LoadingBar";
|
|
21
39
|
export {
|
|
22
|
-
|
|
40
|
+
p as LoadingBar
|
|
23
41
|
};
|
|
24
42
|
//# sourceMappingURL=fondue-components18.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components18.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components18.js","sources":["../src/components/LoadingBar/LoadingBar.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ProgressRadixPrimitive from '@radix-ui/react-progress';\nimport { forwardRef, type CSSProperties, type ElementRef, type ForwardedRef } from 'react';\n\nimport { loadingBarContainerStyles, loadingBarStyles } from './styles/loadingBarStyles';\n\nexport type LoadingBarProps = {\n /**\n * The current value of the loading bar. If `null`, the loading bar will be in an indeterminate state.\n * @default null\n */\n value: number | null;\n /**\n * The maximum value of the loading bar\n * @default 100\n */\n max?: number;\n /**\n * @default 'fondue-loading-bar'\n */\n 'data-test-id'?: string;\n /**\n * Add rounded corners to the loading bar\n * @default true\n */\n rounded?: boolean;\n /**\n * The style of the loading bar\n * @default \"default\"\n */\n variant?: 'default' | 'positive' | 'negative';\n /**\n * The size of the loading bar\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large' | 'x-large';\n /**\n * The label of the loading bar for accessibility purposes\n */\n getValueLabel?: (value: number, max: number) => string;\n} & ({ 'aria-label': string } | { 'aria-labelledby': string });\n\nexport const LoadingBar = forwardRef<ElementRef<typeof ProgressRadixPrimitive.Root>, LoadingBarProps>(\n (\n {\n value,\n max = 100,\n rounded = true,\n variant = 'default',\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-loading-bar',\n ...props\n }: LoadingBarProps,\n ref: ForwardedRef<ElementRef<typeof ProgressRadixPrimitive.Root>>,\n ) => {\n return (\n <ProgressRadixPrimitive.Root\n ref={ref}\n data-test-id={dataTestId}\n className={loadingBarContainerStyles({ rounded, size, variant })}\n aria-busy={value !== max}\n value={value}\n max={max}\n style={\n {\n '--loading-bar-value': value,\n '--loading-bar-max': max,\n '--loading-bar-proportion': 'calc(var(--loading-bar-value) / var(--loading-bar-max))',\n } as CSSProperties\n }\n {...props}\n >\n <ProgressRadixPrimitive.Indicator\n className={loadingBarStyles({ variant, indeterminateState: value === null })}\n />\n </ProgressRadixPrimitive.Root>\n );\n },\n);\nLoadingBar.displayName = 'LoadingBar';\n"],"names":["LoadingBar","forwardRef","value","max","rounded","variant","size","dataTestId","props","ref","jsx","ProgressRadixPrimitive","loadingBarContainerStyles","loadingBarStyles"],"mappings":";;;;AA2CO,MAAMA,IAAaC;AAAA,EACtB,CACI;AAAA,IACI,OAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,IAC7B,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAACC,EAAuB;AAAA,IAAvB;AAAA,MACG,KAAAF;AAAA,MACA,gBAAcF;AAAA,MACd,WAAWK,EAA0B,EAAE,SAAAR,GAAS,MAAAE,GAAM,SAAAD,GAAS;AAAA,MAC/D,aAAWH,MAAUC;AAAA,MACrB,OAAAD;AAAA,MACA,KAAAC;AAAA,MACA,OACI;AAAA,QACI,uBAAuBD;AAAA,QACvB,qBAAqBC;AAAA,QACrB,4BAA4B;AAAA,MAAA;AAAA,MAGnC,GAAGK;AAAA,MAEJ,UAAA,gBAAAE;AAAA,QAACC,EAAuB;AAAA,QAAvB;AAAA,UACG,WAAWE,EAAiB,EAAE,SAAAR,GAAS,oBAAoBH,MAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/E;AAAA,EAAA;AAIhB;AACAF,EAAW,cAAc;"}
|
|
@@ -1,79 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
scrollbarGutter: i = "auto",
|
|
12
|
-
padding: m,
|
|
13
|
-
children: n,
|
|
14
|
-
"data-test-id": r = "fondue-scroll-area"
|
|
15
|
-
}, d) => {
|
|
16
|
-
const { dir: b } = u();
|
|
17
|
-
return /* @__PURE__ */ h(
|
|
18
|
-
a.Root,
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import d from "./fondue-components65.js";
|
|
4
|
+
const s = i(
|
|
5
|
+
({
|
|
6
|
+
variant: t = "progress",
|
|
7
|
+
size: a = "medium",
|
|
8
|
+
"data-test-id": r = "fondue-loading-circle-content"
|
|
9
|
+
}, o) => /* @__PURE__ */ e(
|
|
10
|
+
"div",
|
|
19
11
|
{
|
|
20
|
-
|
|
21
|
-
dir: b,
|
|
22
|
-
className: o.root,
|
|
23
|
-
style: { maxWidth: s },
|
|
12
|
+
ref: o,
|
|
24
13
|
"data-test-id": r,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
a.Viewport,
|
|
29
|
-
{
|
|
30
|
-
className: o.viewport,
|
|
31
|
-
style: { maxHeight: e },
|
|
32
|
-
"data-scroll-padding": m,
|
|
33
|
-
"data-show-shadow": c,
|
|
34
|
-
"data-scrollbar-type": t,
|
|
35
|
-
"data-scrollbar-gutter": i,
|
|
36
|
-
"data-test-id": `${r}-viewport`,
|
|
37
|
-
children: n
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ l(
|
|
41
|
-
a.Scrollbar,
|
|
42
|
-
{
|
|
43
|
-
className: o.scrollbar,
|
|
44
|
-
orientation: "vertical",
|
|
45
|
-
"data-test-id": `${r}-vertical-scrollbar`,
|
|
46
|
-
children: /* @__PURE__ */ l(
|
|
47
|
-
a.Thumb,
|
|
48
|
-
{
|
|
49
|
-
className: o.thumb,
|
|
50
|
-
"data-test-id": `${r}-vertical-scrollbar-thumb`
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
/* @__PURE__ */ l(
|
|
56
|
-
a.Scrollbar,
|
|
57
|
-
{
|
|
58
|
-
className: o.scrollbar,
|
|
59
|
-
orientation: "horizontal",
|
|
60
|
-
"data-test-id": `${r}-horizontal-scrollbar`,
|
|
61
|
-
children: /* @__PURE__ */ l(
|
|
62
|
-
a.Thumb,
|
|
63
|
-
{
|
|
64
|
-
className: o.thumb,
|
|
65
|
-
"data-test-id": `${r}-horizontal-scrollbar-thumb`
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ l(a.Corner, { className: o.corner, "data-test-id": `${r}-corner` })
|
|
71
|
-
]
|
|
14
|
+
"data-variant": t,
|
|
15
|
+
"data-size": a,
|
|
16
|
+
className: d.root
|
|
72
17
|
}
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
s.displayName = "LoadingCircle";
|
|
76
21
|
export {
|
|
77
|
-
|
|
22
|
+
s as LoadingCircle
|
|
78
23
|
};
|
|
79
24
|
//# sourceMappingURL=fondue-components19.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components19.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components19.js","sources":["../src/components/LoadingCircle/LoadingCircle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport styles from './styles/loadingCircleStyles.module.scss';\n\nexport type LoadingCircleProps = {\n /**\n * The variant of the loading circle.\n * @default 'progress'\n */\n variant?: 'progress' | 'success' | 'danger';\n /**\n * The size of the loading circle\n * @default \"medium\"\n */\n size?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n 'data-test-id'?: string;\n};\n\nexport const LoadingCircle = forwardRef<HTMLDivElement, LoadingCircleProps>(\n (\n {\n variant = 'progress',\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-loading-circle-content',\n }: LoadingCircleProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n data-variant={variant}\n data-size={size}\n className={styles.root}\n ></div>\n );\n },\n);\nLoadingCircle.displayName = 'LoadingCircle';\n"],"names":["LoadingCircle","forwardRef","variant","size","dataTestId","ref","jsx","styles"],"mappings":";;;AAoBO,MAAMA,IAAgBC;AAAA,EACzB,CACI;AAAA,IACI,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,EAAA,GAEjCC,MAGI,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAAD;AAAA,MACA,gBAAcD;AAAA,MACd,gBAAcF;AAAA,MACd,aAAWC;AAAA,MACX,WAAWI,EAAO;AAAA,IAAA;AAAA,EAAA;AAIlC;AACAP,EAAc,cAAc;"}
|