@frontify/fondue-components 1.3.0 → 1.3.2
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 +16 -14
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +44 -47
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +47 -43
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +46 -8
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +8 -12
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +10 -152
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +57 -21
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +18 -18
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +112 -14
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +14 -54
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +22 -9
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +51 -26
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +16 -24
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +35 -8
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +25 -5
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +8 -15
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +5 -2360
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +14 -142
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +2358 -27
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +146 -0
- package/dist/fondue-components28.js.map +1 -0
- package/dist/fondue-components29.js +32 -0
- package/dist/fondue-components29.js.map +1 -0
- package/dist/fondue-components3.js +5 -5
- package/dist/fondue-components4.js +2 -2
- package/dist/fondue-components5.js +78 -23
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components6.js +21 -56
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components7.js +56 -22
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components8.js +24 -39
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components9.js +36 -44
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +117 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,26 +1,81 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const r = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as T } from "@frontify/fondue-icons";
|
|
3
|
+
import * as i from "@radix-ui/react-dialog";
|
|
4
|
+
import { forwardRef as d } from "react";
|
|
5
|
+
import { dialogUnderlayStyles as v, dialogContentStyles as R, dialogHeaderStyles as w, dialogFooterStyles as B, dialogBodyStyles as F, dialogSideContentStyles as H } from "./fondue-components19.js";
|
|
6
|
+
const r = ({ children: t, ...o }) => /* @__PURE__ */ a(i.Root, { ...o, children: t });
|
|
7
|
+
r.displayName = "Dialog.Root";
|
|
8
|
+
const n = ({ children: t, "data-test-id": o = "fondue-dialog-trigger" }, e) => /* @__PURE__ */ a(i.Trigger, { "data-test-id": o, asChild: !0, ref: e, children: t });
|
|
9
|
+
n.displayName = "Dialog.Trigger";
|
|
10
|
+
const g = ({
|
|
11
|
+
maxWidth: t = "800px",
|
|
12
|
+
minWidth: o = "400px",
|
|
13
|
+
minHeight: e = "200px",
|
|
14
|
+
padding: N = "compact",
|
|
15
|
+
"data-test-id": f = "fondue-dialog-content",
|
|
16
|
+
showUnderlay: h = !1,
|
|
17
|
+
children: S,
|
|
18
|
+
...l
|
|
19
|
+
}, x) => /* @__PURE__ */ s(i.Portal, { children: [
|
|
20
|
+
/* @__PURE__ */ a(i.Overlay, { className: v({ showUnderlay: h }) }),
|
|
21
|
+
/* @__PURE__ */ a(
|
|
22
|
+
i.Content,
|
|
23
|
+
{
|
|
24
|
+
style: {
|
|
25
|
+
"--dialog-max-width": t,
|
|
26
|
+
"--dialog-min-width": o,
|
|
27
|
+
"--dialog-min-height": e
|
|
28
|
+
},
|
|
29
|
+
ref: x,
|
|
30
|
+
className: R({ ...l }),
|
|
31
|
+
"data-dialog-spacing": N,
|
|
32
|
+
"data-test-id": f,
|
|
33
|
+
...l,
|
|
34
|
+
children: S
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] });
|
|
38
|
+
g.displayName = "Dialog.Content";
|
|
39
|
+
const c = ({ children: t, "data-test-id": o = "fondue-dialog-header" }, e) => /* @__PURE__ */ s("div", { "data-test-id": o, ref: e, className: w, "data-dialog-layout-component": !0, children: [
|
|
40
|
+
/* @__PURE__ */ a("div", { children: t }),
|
|
41
|
+
/* @__PURE__ */ a(i.Close, { role: "button", "data-test-id": `${o}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ a(T, { size: 20 }) })
|
|
42
|
+
] });
|
|
43
|
+
c.displayName = "Dialog.Header";
|
|
44
|
+
const m = ({ children: t, "data-test-id": o = "fondue-dialog-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: B, "data-dialog-layout-component": !0, children: t });
|
|
45
|
+
m.displayName = "Dialog.Footer";
|
|
46
|
+
const p = ({ children: t, "data-test-id": o = "fondue-dialog-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: F, "data-dialog-layout-component": !0, children: t });
|
|
47
|
+
p.displayName = "Dialog.Body";
|
|
48
|
+
const u = ({ children: t, "data-test-id": o = "fondue-dialog-side-content" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: H, "data-dialog-layout-component": !0, children: t });
|
|
49
|
+
u.displayName = "Dialog.SideContent";
|
|
50
|
+
const y = ({ children: t }) => /* @__PURE__ */ a(i.Close, { asChild: !0, children: t });
|
|
51
|
+
y.displayName = "Dialog.Close";
|
|
52
|
+
const D = ({ children: t, asChild: o }) => /* @__PURE__ */ a(i.Title, { asChild: o, children: t });
|
|
53
|
+
D.displayName = "Dialog.Title";
|
|
54
|
+
const C = ({ children: t, asChild: o }) => /* @__PURE__ */ a(i.Description, { asChild: o, children: t });
|
|
55
|
+
C.displayName = "Dialog.Description";
|
|
56
|
+
const P = {
|
|
57
|
+
Root: r,
|
|
58
|
+
Title: D,
|
|
59
|
+
Description: C,
|
|
60
|
+
Close: y,
|
|
61
|
+
Trigger: d(n),
|
|
62
|
+
Content: d(g),
|
|
63
|
+
Header: d(c),
|
|
64
|
+
Footer: d(m),
|
|
65
|
+
Body: d(p),
|
|
66
|
+
SideContent: d(u)
|
|
67
|
+
};
|
|
22
68
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
69
|
+
P as Dialog,
|
|
70
|
+
p as DialogBody,
|
|
71
|
+
y as DialogClose,
|
|
72
|
+
g as DialogContent,
|
|
73
|
+
C as DialogDescription,
|
|
74
|
+
m as DialogFooter,
|
|
75
|
+
c as DialogHeader,
|
|
76
|
+
r as DialogRoot,
|
|
77
|
+
u as DialogSideContent,
|
|
78
|
+
D as DialogTitle,
|
|
79
|
+
n as DialogTrigger
|
|
25
80
|
};
|
|
26
81
|
//# sourceMappingURL=fondue-components5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components5.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n style?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const DividerComponent = (\n { 'data-test-id': dataTestId = 'fondue-divider', direction = 'horizontal', className, ...props }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n): ReactElement => {\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n ...props,\n }),\n className,\n )}\n data-test-id={dataTestId}\n />\n );\n};\n\nDividerComponent.displayName = 'Divider';\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(DividerComponent);\n"],"names":["DividerComponent","dataTestId","direction","className","props","ref","jsx","Separator","cn","dividerStyles","Divider","forwardRef"],"mappings":";;;;;AAuCO,MAAMA,IAAmB,CAC5B,EAAE,gBAAgBC,IAAa,kBAAkB,WAAAC,IAAY,cAAc,WAAAC,GAAW,GAAGC,EAAM,GAC/FC,MAGI,gBAAAC;AAAA,EAACC,EAAU;AAAA,EAAV;AAAA,IACG,KAAAF;AAAA,IACA,WAAWG;AAAA,MACPC,EAAc;AAAA,QACV,WAAAP;AAAA,QACA,GAAGE;AAAA,MAAA,CACN;AAAA,MACDD;AAAA,IACJ;AAAA,IACA,gBAAcF;AAAA,EAAA;AAAA;AAK1BD,EAAiB,cAAc;AAElB,MAAAU,IAAUC,EAAyCX,CAAgB;"}
|
|
1
|
+
{"version":3,"file":"fondue-components5.js","sources":["../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport {\n dialogBodyStyles,\n dialogContentStyles,\n dialogFooterStyles,\n dialogHeaderStyles,\n dialogSideContentStyles,\n dialogUnderlayStyles,\n} from './styles/dialogStyles';\n\nexport type DialogRootProps = {\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 dialog\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 type DialogContentProps = {\n /**\n * Add rounded corners to the dialog\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'compact' | 'comfortable' | 'spacious';\n /**\n * Define a maximum width for the dialog\n * @default \"800px\"\n */\n maxWidth?: string;\n /**\n * Define a minimum width for the dialog\n * @default \"400px\"\n */\n minWidth?: string;\n /**\n * Define a maximum height for the dialog\n * @default \"200px\"\n */\n minHeight?: string;\n /**\n * Show a dark underlay behind the dialog\n * @default false\n */\n showUnderlay?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogHeaderProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogSideContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogCloseProps = { children?: ReactNode };\n\nexport type DialogAnnouncementProps = { children?: ReactNode; asChild?: boolean };\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return <RadixDialog.Root {...props}>{children}</RadixDialog.Root>;\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-trigger' }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.Trigger data-test-id={dataTestId} asChild ref={ref}>\n {children}\n </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n children,\n ...props\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDialog.Portal>\n <RadixDialog.Overlay className={dialogUnderlayStyles({ showUnderlay })} />\n <RadixDialog.Content\n style={\n {\n '--dialog-max-width': maxWidth,\n '--dialog-min-width': minWidth,\n '--dialog-min-height': minHeight,\n } as CSSProperties\n }\n ref={ref}\n className={dialogContentStyles({ ...props })}\n data-dialog-spacing={padding}\n data-test-id={dataTestId}\n {...props}\n >\n {children}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-header' }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogHeaderStyles} data-dialog-layout-component>\n <div>{children}</div>\n <RadixDialog.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\n <IconCross size={20} />\n </RadixDialog.Close>\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogFooterStyles} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogBodyStyles} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogBody.displayName = 'Dialog.Body';\n\nexport const DialogSideContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-side-content' }: DialogSideContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogSideContentStyles} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogSideContent.displayName = 'Dialog.SideContent';\n\nexport const DialogClose = ({ children }: DialogCloseProps) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>;\n};\nDialogClose.displayName = 'Dialog.Close';\n\nexport const DialogTitle = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Title asChild={asChild}>{children}</RadixDialog.Title>;\n};\nDialogTitle.displayName = 'Dialog.Title';\n\nexport const DialogDescription = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Description asChild={asChild}>{children}</RadixDialog.Description>;\n};\nDialogDescription.displayName = 'Dialog.Description';\n\nexport const Dialog = {\n Root: DialogRoot,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Trigger: forwardRef<HTMLButtonElement, DialogTriggerProps>(DialogTrigger),\n Content: forwardRef<HTMLDivElement, DialogContentProps>(DialogContent),\n Header: forwardRef<HTMLDivElement, DialogHeaderProps>(DialogHeader),\n Footer: forwardRef<HTMLDivElement, DialogFooterProps>(DialogFooter),\n Body: forwardRef<HTMLDivElement, DialogBodyProps>(DialogBody),\n SideContent: forwardRef<HTMLDivElement, DialogSideContentProps>(DialogSideContent),\n};\n"],"names":["DialogRoot","children","props","RadixDialog","DialogTrigger","dataTestId","ref","jsx","DialogContent","maxWidth","minWidth","minHeight","padding","showUnderlay","jsxs","dialogUnderlayStyles","dialogContentStyles","DialogHeader","dialogHeaderStyles","IconCross","DialogFooter","dialogFooterStyles","DialogBody","dialogBodyStyles","DialogSideContent","dialogSideContentStyles","DialogClose","DialogTitle","asChild","DialogDescription","Dialog","forwardRef"],"mappings":"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"}
|
|
@@ -1,61 +1,26 @@
|
|
|
1
|
-
import { jsx as a
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const y = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(r.Trigger, { "data-test-id": o, asChild: !0, ref: e, children: t });
|
|
9
|
-
y.displayName = "Flyout.Trigger";
|
|
10
|
-
const n = ({
|
|
11
|
-
align: t = "start",
|
|
12
|
-
maxWidth: o = "360px",
|
|
13
|
-
padding: e = "compact",
|
|
14
|
-
"data-test-id": s = "fondue-flyout-content",
|
|
15
|
-
children: m,
|
|
16
|
-
...l
|
|
17
|
-
}, p) => /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
|
|
18
|
-
r.Content,
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "@radix-ui/react-separator";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { cn as p } from "./fondue-components14.js";
|
|
5
|
+
import { dividerStyles as f } from "./fondue-components20.js";
|
|
6
|
+
const r = ({ "data-test-id": o = "fondue-divider", direction: t = "horizontal", className: i, ...e }, d) => /* @__PURE__ */ a(
|
|
7
|
+
m.Root,
|
|
19
8
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"data-
|
|
29
|
-
"data-test-id": s,
|
|
30
|
-
...l,
|
|
31
|
-
children: m
|
|
9
|
+
ref: d,
|
|
10
|
+
className: p(
|
|
11
|
+
f({
|
|
12
|
+
direction: t,
|
|
13
|
+
...e
|
|
14
|
+
}),
|
|
15
|
+
i
|
|
16
|
+
),
|
|
17
|
+
"data-test-id": o
|
|
32
18
|
}
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
/* @__PURE__ */ a("div", { children: o }),
|
|
37
|
-
t && /* @__PURE__ */ a(r.Close, { role: "button", "data-test-id": `${e}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ a(g, { size: 20 }) })
|
|
38
|
-
] });
|
|
39
|
-
u.displayName = "Flyout.Header";
|
|
40
|
-
const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: h, children: t });
|
|
41
|
-
f.displayName = "Flyout.Footer";
|
|
42
|
-
const c = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: x, children: t });
|
|
43
|
-
c.displayName = "Flyout.Body";
|
|
44
|
-
const S = {
|
|
45
|
-
Root: i,
|
|
46
|
-
Trigger: d(y),
|
|
47
|
-
Content: d(n),
|
|
48
|
-
Header: d(u),
|
|
49
|
-
Footer: d(f),
|
|
50
|
-
Body: d(c)
|
|
51
|
-
};
|
|
19
|
+
);
|
|
20
|
+
r.displayName = "Divider";
|
|
21
|
+
const D = s(r);
|
|
52
22
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
n as FlyoutContent,
|
|
56
|
-
f as FlyoutFooter,
|
|
57
|
-
u as FlyoutHeader,
|
|
58
|
-
i as FlyoutRoot,
|
|
59
|
-
y as FlyoutTrigger
|
|
23
|
+
D as Divider,
|
|
24
|
+
r as DividerComponent
|
|
60
25
|
};
|
|
61
26
|
//# sourceMappingURL=fondue-components6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components6.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components6.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n style?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const DividerComponent = (\n { 'data-test-id': dataTestId = 'fondue-divider', direction = 'horizontal', className, ...props }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n): ReactElement => {\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n ...props,\n }),\n className,\n )}\n data-test-id={dataTestId}\n />\n );\n};\n\nDividerComponent.displayName = 'Divider';\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(DividerComponent);\n"],"names":["DividerComponent","dataTestId","direction","className","props","ref","jsx","Separator","cn","dividerStyles","Divider","forwardRef"],"mappings":";;;;;AAuCO,MAAMA,IAAmB,CAC5B,EAAE,gBAAgBC,IAAa,kBAAkB,WAAAC,IAAY,cAAc,WAAAC,GAAW,GAAGC,EAAM,GAC/FC,MAGI,gBAAAC;AAAA,EAACC,EAAU;AAAA,EAAV;AAAA,IACG,KAAAF;AAAA,IACA,WAAWG;AAAA,MACPC,EAAc;AAAA,QACV,WAAAP;AAAA,QACA,GAAGE;AAAA,MAAA,CACN;AAAA,MACDD;AAAA,IACJ;AAAA,IACA,gBAAcF;AAAA,EAAA;AAAA;AAK1BD,EAAiB,cAAc;AAElB,MAAAU,IAAUC,EAAyCX,CAAgB;"}
|
|
@@ -1,27 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as a, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as g } from "@frontify/fondue-icons";
|
|
3
|
+
import * as r from "@radix-ui/react-popover";
|
|
4
|
+
import { forwardRef as d } from "react";
|
|
5
|
+
import { flyoutContentStyles as N, flyoutHeaderStyles as C, flyoutFooterStyles as h, flyoutBodyStyles as x } from "./fondue-components21.js";
|
|
6
|
+
const i = ({ children: t, ...o }) => /* @__PURE__ */ a(r.Root, { ...o, children: t });
|
|
7
|
+
i.displayName = "Flyout.Root";
|
|
8
|
+
const y = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(r.Trigger, { "data-test-id": o, asChild: !0, ref: e, children: t });
|
|
9
|
+
y.displayName = "Flyout.Trigger";
|
|
10
|
+
const n = ({
|
|
11
|
+
align: t = "start",
|
|
12
|
+
maxWidth: o = "360px",
|
|
13
|
+
padding: e = "compact",
|
|
14
|
+
"data-test-id": s = "fondue-flyout-content",
|
|
15
|
+
children: m,
|
|
16
|
+
...l
|
|
17
|
+
}, p) => /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
|
|
18
|
+
r.Content,
|
|
7
19
|
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
style: {
|
|
21
|
+
"--flyout-max-width": o
|
|
22
|
+
},
|
|
23
|
+
ref: p,
|
|
24
|
+
align: t,
|
|
25
|
+
collisionPadding: 8,
|
|
26
|
+
sideOffset: 8,
|
|
27
|
+
className: N({ ...l }),
|
|
28
|
+
"data-flyout-spacing": e,
|
|
29
|
+
"data-test-id": s,
|
|
30
|
+
...l,
|
|
31
|
+
children: m
|
|
20
32
|
}
|
|
21
|
-
)
|
|
22
|
-
|
|
33
|
+
) });
|
|
34
|
+
n.displayName = "Flyout.Content";
|
|
35
|
+
const u = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, s) => /* @__PURE__ */ F("div", { "data-test-id": e, ref: s, className: C, children: [
|
|
36
|
+
/* @__PURE__ */ a("div", { children: o }),
|
|
37
|
+
t && /* @__PURE__ */ a(r.Close, { role: "button", "data-test-id": `${e}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ a(g, { size: 20 }) })
|
|
38
|
+
] });
|
|
39
|
+
u.displayName = "Flyout.Header";
|
|
40
|
+
const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: h, children: t });
|
|
41
|
+
f.displayName = "Flyout.Footer";
|
|
42
|
+
const c = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: x, children: t });
|
|
43
|
+
c.displayName = "Flyout.Body";
|
|
44
|
+
const S = {
|
|
45
|
+
Root: i,
|
|
46
|
+
Trigger: d(y),
|
|
47
|
+
Content: d(n),
|
|
48
|
+
Header: d(u),
|
|
49
|
+
Footer: d(f),
|
|
50
|
+
Body: d(c)
|
|
51
|
+
};
|
|
23
52
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
53
|
+
S as Flyout,
|
|
54
|
+
c as FlyoutBody,
|
|
55
|
+
n as FlyoutContent,
|
|
56
|
+
f as FlyoutFooter,
|
|
57
|
+
u as FlyoutHeader,
|
|
58
|
+
i as FlyoutRoot,
|
|
59
|
+
y as FlyoutTrigger
|
|
26
60
|
};
|
|
27
61
|
//# sourceMappingURL=fondue-components7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components7.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components7.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 { flyoutBodyStyles, flyoutContentStyles, flyoutFooterStyles, flyoutHeaderStyles } from './styles/flyoutStyles';\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 type FlyoutContentProps = {\n /**\n * Add rounded corners to the flyout\n * @default true\n */\n rounded?: boolean;\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?: 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type FlyoutTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\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};\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type FlyoutBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport const FlyoutTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-trigger' }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger data-test-id={dataTestId} asChild ref={ref}>\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={8}\n sideOffset={8}\n className={flyoutContentStyles({ ...props })}\n data-flyout-spacing={padding}\n data-test-id={dataTestId}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header' }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={flyoutHeaderStyles}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\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={flyoutFooterStyles}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body' }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} data-flyout-spacing=\"compact\" className={flyoutBodyStyles}>\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","dataTestId","ref","jsx","FlyoutContent","align","maxWidth","padding","flyoutContentStyles","FlyoutHeader","showCloseButton","flyoutHeaderStyles","IconCross","FlyoutFooter","flyoutFooterStyles","FlyoutBody","flyoutBodyStyles","Flyout","forwardRef"],"mappings":";;;;;AAwEO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAEnDD,EAAW,cAAc;AAEZ,MAAAI,IAAgB,CACzB,EAAE,UAAAH,GAAU,gBAAgBI,IAAa,2BACzCC,MAGI,gBAAAC,EAACJ,EAAa,SAAb,EAAqB,gBAAcE,GAAY,SAAO,IAAC,KAAAC,GACnD,UAAAL,EACL,CAAA;AAGRG,EAAc,cAAc;AAErB,MAAMI,IAAgB,CACzB;AAAA,EACI,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,gBAAgBN,IAAa;AAAA,EAC7B,UAAAJ;AAAA,EACA,GAAGC;AACP,GACAI,MAGI,gBAAAC,EAACJ,EAAa,QAAb,EACG,UAAA,gBAAAI;AAAA,EAACJ,EAAa;AAAA,EAAb;AAAA,IACG,OACI;AAAA,MACI,sBAAsBO;AAAA,IAC1B;AAAA,IAEJ,KAAAJ;AAAA,IACA,OAAAG;AAAA,IACA,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,WAAWG,EAAoB,EAAE,GAAGV,GAAO;AAAA,IAC3C,uBAAqBS;AAAA,IACrB,gBAAcN;AAAA,IACb,GAAGH;AAAA,IAEH,UAAAD;AAAA,EAAA;AAET,EAAA,CAAA;AAGRO,EAAc,cAAc;AAEf,MAAAK,IAAe,CACxB,EAAE,iBAAAC,GAAiB,UAAAb,GAAU,gBAAgBI,IAAa,uBAAuB,GACjFC,wBAGK,OAAI,EAAA,gBAAcD,GAAY,KAAAC,GAAU,WAAWS,GAChD,UAAA;AAAA,EAAA,gBAAAR,EAAC,SAAK,UAAAN,GAAS;AAAA,EACda,KACI,gBAAAP,EAAAJ,EAAa,OAAb,EAAmB,MAAK,UAAS,gBAAc,GAAGE,CAAU,UAAU,WAAU,qBAC7E,4BAACW,GAAU,EAAA,MAAM,GAAI,CAAA,GACzB;AAER,EAAA,CAAA;AAGRH,EAAa,cAAc;AAEd,MAAAI,IAAe,CACxB,EAAE,UAAAhB,GAAU,gBAAgBI,IAAa,0BACzCC,wBAGK,OAAI,EAAA,gBAAcD,GAAY,KAAAC,GAAU,WAAWY,GAC/C,UAAAjB,EACL,CAAA;AAGRgB,EAAa,cAAc;AAEd,MAAAE,IAAa,CACtB,EAAE,UAAAlB,GAAU,gBAAgBI,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWc,GAC7E,UAAAnB,EACL,CAAA;AAGRkB,EAAW,cAAc;AAElB,MAAME,IAAS;AAAA,EAClB,MAAMrB;AAAA,EACN,SAASsB,EAAkDlB,CAAa;AAAA,EACxE,SAASkB,EAA+Cd,CAAa;AAAA,EACrE,QAAQc,EAA8CT,CAAY;AAAA,EAClE,QAAQS,EAA8CL,CAAY;AAAA,EAClE,MAAMK,EAA4CH,CAAU;AAChE;"}
|
|
@@ -1,42 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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({ style: o, indeterminateState: a === null })
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
);
|
|
38
|
-
p.displayName = "LoadingBar";
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "@radix-ui/react-label";
|
|
3
|
+
import { forwardRef as i } from "react";
|
|
4
|
+
import { cn as n } from "./fondue-components14.js";
|
|
5
|
+
const s = ({ className: e, "data-test-id": a = "fondue-label", ...t }, r) => /* @__PURE__ */ o(
|
|
6
|
+
d.Root,
|
|
7
|
+
{
|
|
8
|
+
ref: r,
|
|
9
|
+
"data-required": t.required,
|
|
10
|
+
className: n(
|
|
11
|
+
'tw-group tw-flex tw-gap-1 tw-font-sans tw-font-normal peer-data-[state="checked"]:tw-font-medium peer-data-[state="indeterminate"]:tw-font-medium tw-text-body-medium tw-text-text-weak peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text tw-transition-colors',
|
|
12
|
+
// Disabled state if siblings has disabled state
|
|
13
|
+
"has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed",
|
|
14
|
+
// Required asterisk
|
|
15
|
+
'after:tw-hidden data-[required="true"]:after:tw-flex after:tw-content-["*"] after:-tw-ml-1 after:tw-font-sans after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',
|
|
16
|
+
e
|
|
17
|
+
),
|
|
18
|
+
"data-test-id": a,
|
|
19
|
+
...t
|
|
20
|
+
}
|
|
21
|
+
), w = i(s);
|
|
22
|
+
w.displayName = "Label";
|
|
39
23
|
export {
|
|
40
|
-
|
|
24
|
+
w as Label,
|
|
25
|
+
s as LabelComponent
|
|
41
26
|
};
|
|
42
27
|
//# sourceMappingURL=fondue-components8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components8.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components8.js","sources":["../src/components/Label/Label.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { type ForwardedRef, forwardRef, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nexport type LabelProps = {\n id?: string;\n children: ReactNode;\n /**\n * The id of the input element the label is associated with\n */\n htmlFor: string;\n /**\n * Add an asterisk to the label to indicate it is required\n * @default false\n */\n required?: boolean;\n className?: string;\n 'data-test-id'?: string;\n};\n\nexport const LabelComponent = (\n { className, 'data-test-id': dataTestId = 'fondue-label', ...props }: LabelProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) => {\n return (\n <LabelPrimitive.Root\n ref={ref}\n data-required={props.required}\n className={cn(\n 'tw-group tw-flex tw-gap-1 tw-font-sans tw-font-normal peer-data-[state=\"checked\"]:tw-font-medium peer-data-[state=\"indeterminate\"]:tw-font-medium tw-text-body-medium tw-text-text-weak peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text tw-transition-colors',\n // Disabled state if siblings has disabled state\n 'has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed',\n // Required asterisk\n 'after:tw-hidden data-[required=\"true\"]:after:tw-flex after:tw-content-[\"*\"] after:-tw-ml-1 after:tw-font-sans after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',\n className,\n )}\n data-test-id={dataTestId}\n {...props}\n />\n );\n};\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(LabelComponent);\nLabel.displayName = 'Label';\n"],"names":["LabelComponent","className","dataTestId","props","ref","jsx","LabelPrimitive","cn","Label","forwardRef"],"mappings":";;;;AAuBa,MAAAA,IAAiB,CAC1B,EAAE,WAAAC,GAAW,gBAAgBC,IAAa,gBAAgB,GAAGC,EAAM,GACnEC,MAGI,gBAAAC;AAAA,EAACC,EAAe;AAAA,EAAf;AAAA,IACG,KAAAF;AAAA,IACA,iBAAeD,EAAM;AAAA,IACrB,WAAWI;AAAA,MACP;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA,MACAN;AAAA,IACJ;AAAA,IACA,gBAAcC;AAAA,IACb,GAAGC;AAAA,EAAA;AAAA,GAKHK,IAAQC,EAAyCT,CAAc;AAC5EQ,EAAM,cAAc;"}
|
|
@@ -1,50 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-progress";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components22.js";
|
|
5
|
+
const p = s(
|
|
6
|
+
({
|
|
7
|
+
value: a,
|
|
8
|
+
max: r = 100,
|
|
9
|
+
rounded: d = !0,
|
|
10
|
+
style: o = "default",
|
|
11
|
+
size: e = "medium",
|
|
12
|
+
"data-test-id": n = "fondue-loading-bar",
|
|
13
|
+
...l
|
|
14
|
+
}, m) => /* @__PURE__ */ i(
|
|
15
|
+
t.Root,
|
|
14
16
|
{
|
|
15
|
-
ref:
|
|
16
|
-
|
|
17
|
-
className:
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
ref: m,
|
|
18
|
+
"data-test-id": n,
|
|
19
|
+
className: g({ rounded: d, size: e, style: 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))"
|
|
20
27
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]
|
|
28
|
+
...l,
|
|
29
|
+
children: /* @__PURE__ */ i(
|
|
30
|
+
t.Indicator,
|
|
31
|
+
{
|
|
32
|
+
className: f({ style: o, indeterminateState: a === null })
|
|
33
|
+
}
|
|
34
|
+
)
|
|
29
35
|
}
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const i = ({ children: e, ...o }, s) => /* @__PURE__ */ l(r.Item, { ref: s, ...o, className: y, asChild: !1, children: [
|
|
34
|
-
/* @__PURE__ */ t("span", { className: N }),
|
|
35
|
-
/* @__PURE__ */ l("span", { className: u, children: [
|
|
36
|
-
/* @__PURE__ */ t("span", { className: b, children: e }),
|
|
37
|
-
/* @__PURE__ */ t("span", { className: h, children: e })
|
|
38
|
-
] })
|
|
39
|
-
] });
|
|
40
|
-
i.displayName = "SegmentedControl.Item";
|
|
41
|
-
const j = {
|
|
42
|
-
Root: m(d),
|
|
43
|
-
Item: m(i)
|
|
44
|
-
};
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
p.displayName = "LoadingBar";
|
|
45
39
|
export {
|
|
46
|
-
|
|
47
|
-
i as SegmentedControlItem,
|
|
48
|
-
d as SegmentedControlRoot
|
|
40
|
+
p as LoadingBar
|
|
49
41
|
};
|
|
50
42
|
//# sourceMappingURL=fondue-components9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components9.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components9.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 style?: '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 style = '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, style })}\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({ style, indeterminateState: value === null })}\n />\n </ProgressRadixPrimitive.Root>\n );\n },\n);\nLoadingBar.displayName = 'LoadingBar';\n"],"names":["LoadingBar","forwardRef","value","max","rounded","style","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,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,IAC7B,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACC,EAAuB;AAAA,IAAvB;AAAA,MACG,KAAAF;AAAA,MACA,gBAAcF;AAAA,MACd,WAAWK,EAA0B,EAAE,SAAAR,GAAS,MAAAE,GAAM,OAAAD,GAAO;AAAA,MAC7D,aAAWH,MAAUC;AAAA,MACrB,OAAAD;AAAA,MACA,KAAAC;AAAA,MACA,OACI;AAAA,QACI,uBAAuBD;AAAA,QACvB,qBAAqBC;AAAA,QACrB,4BAA4B;AAAA,MAChC;AAAA,MAEH,GAAGK;AAAA,MAEJ,UAAA,gBAAAE;AAAA,QAACC,EAAuB;AAAA,QAAvB;AAAA,UACG,WAAWE,EAAiB,EAAE,OAAAR,GAAO,oBAAoBH,MAAU,MAAM;AAAA,QAAA;AAAA,MAC7E;AAAA,IAAA;AAAA,EAAA;AAIhB;AACAF,EAAW,cAAc;"}
|