@frontify/fondue-components 18.0.0 → 18.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 +56 -54
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +28 -142
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +141 -34
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +36 -103
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +103 -36
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +30 -40
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +47 -28
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +28 -39
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +34 -16
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +21 -71
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +71 -36
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +34 -53
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +54 -137
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +136 -53
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +54 -28
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +28 -153
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +151 -118
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +120 -31
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +32 -65
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +65 -10
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +10 -55
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +55 -14
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +15 -32
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +7 -4
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +7 -12
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +32 -155
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +5 -118
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +10 -116
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +147 -13
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +116 -30
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +118 -62
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +56 -34
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +20 -129
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +32 -21
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +62 -45
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +129 -7
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +21 -13
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +45 -15
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +8 -60
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +13 -18
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +12 -16
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +60 -5
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +32 -38
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components50.js +18 -15
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +18 -4
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +3 -17
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +15 -35
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +4 -4
- package/dist/fondue-components55.js +17 -11
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +35 -5
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +4 -24
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +12 -16
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +4 -146
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +42 -45
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components60.js +25 -16
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +16 -76
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +147 -8
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +16 -33
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +75 -47
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +8 -11
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +32 -12
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +48 -12
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +10 -20
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +13 -15
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +46 -51
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components70.js +12 -52
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +20 -14
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +15 -26
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +55 -14
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +14 -6
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +23 -4
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +15 -2
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +5 -15
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +6 -39
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +5 -0
- package/dist/fondue-components79.js.map +1 -0
- package/dist/fondue-components8.js +46 -144
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components80.js +8 -0
- package/dist/fondue-components80.js.map +1 -0
- package/dist/fondue-components81.js +8 -0
- package/dist/fondue-components81.js.map +1 -0
- package/dist/fondue-components82.js +20 -0
- package/dist/fondue-components82.js.map +1 -0
- package/dist/fondue-components83.js +43 -0
- package/dist/fondue-components83.js.map +1 -0
- package/dist/fondue-components9.js +146 -27
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +70 -7
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,33 +1,152 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as e, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as j } from "@frontify/fondue-icons";
|
|
3
|
+
import * as d from "@radix-ui/react-dialog";
|
|
4
|
+
import { createContext as q, forwardRef as l, useRef as B, useContext as z } from "react";
|
|
5
|
+
import { useSyncRefs as E } from "./fondue-components46.js";
|
|
6
|
+
import { addShowFocusRing as L, addAutoFocusAttribute as $ } from "./fondue-components47.js";
|
|
7
|
+
import { useFondueTheme as k, ThemeProvider as G } from "./fondue-components29.js";
|
|
8
|
+
import n from "./fondue-components48.js";
|
|
9
|
+
const p = q({ isModal: !1 }), f = ({ children: t, ...o }) => /* @__PURE__ */ e(p.Provider, { value: { isModal: o.modal ?? !1 }, children: /* @__PURE__ */ e(d.Root, { ...o, children: t }) });
|
|
10
|
+
f.displayName = "Dialog.Root";
|
|
11
|
+
const y = ({ asChild: t = !0, children: o, "data-test-id": a = "fondue-dialog-trigger", ...i }, r) => /* @__PURE__ */ e(
|
|
12
|
+
d.Trigger,
|
|
13
|
+
{
|
|
14
|
+
onMouseDown: $,
|
|
15
|
+
"data-auto-focus-visible": "true",
|
|
16
|
+
"data-auto-focus-trigger": !0,
|
|
17
|
+
"data-test-id": a,
|
|
18
|
+
asChild: t,
|
|
19
|
+
ref: r,
|
|
20
|
+
...i,
|
|
21
|
+
children: o
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
y.displayName = "Dialog.Trigger";
|
|
25
|
+
const I = ({ children: t, showUnderlay: o }) => {
|
|
26
|
+
const { isModal: a } = z(p);
|
|
27
|
+
return a ? /* @__PURE__ */ e(d.Overlay, { "data-visible": o, className: n.underlay, children: t }) : /* @__PURE__ */ e("div", { className: n.underlay, "data-visible": o, children: t });
|
|
28
|
+
}, D = ({
|
|
29
|
+
maxWidth: t = "800px",
|
|
30
|
+
minWidth: o = "400px",
|
|
31
|
+
minHeight: a = "200px",
|
|
32
|
+
padding: i = "compact",
|
|
33
|
+
verticalAlign: r = "center",
|
|
34
|
+
"data-test-id": s = "fondue-dialog-content",
|
|
35
|
+
showUnderlay: R = !1,
|
|
36
|
+
rounded: T = !0,
|
|
37
|
+
children: w,
|
|
38
|
+
...S
|
|
39
|
+
}, M) => {
|
|
40
|
+
const A = k(), c = B(null);
|
|
41
|
+
E(c, M);
|
|
42
|
+
const H = (O) => {
|
|
43
|
+
var m;
|
|
44
|
+
O.preventDefault();
|
|
45
|
+
const u = (m = c.current) == null ? void 0 : m.querySelector('[data-dialog-layout-component="body"]'), g = u == null ? void 0 : u.querySelector(
|
|
46
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
47
|
+
);
|
|
48
|
+
g instanceof HTMLElement && g.focus();
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ e(d.Portal, { children: /* @__PURE__ */ e(G, { theme: A, children: /* @__PURE__ */ e(I, { showUnderlay: R, children: /* @__PURE__ */ e(
|
|
51
|
+
d.Content,
|
|
15
52
|
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"data-
|
|
53
|
+
style: {
|
|
54
|
+
"--dialog-max-width": t,
|
|
55
|
+
"--dialog-min-width": o,
|
|
56
|
+
"--dialog-min-height": a
|
|
57
|
+
},
|
|
58
|
+
ref: c,
|
|
59
|
+
className: n.content,
|
|
60
|
+
onFocus: L,
|
|
61
|
+
onOpenAutoFocus: H,
|
|
62
|
+
"data-dialog-padding": i,
|
|
63
|
+
"data-dialog-rounded": T,
|
|
64
|
+
"data-test-id": s,
|
|
65
|
+
"data-dialog-vertical-align": r,
|
|
66
|
+
...S,
|
|
67
|
+
children: w
|
|
26
68
|
}
|
|
27
|
-
)
|
|
69
|
+
) }) }) });
|
|
70
|
+
};
|
|
71
|
+
D.displayName = "Dialog.Content";
|
|
72
|
+
const h = ({
|
|
73
|
+
padding: t,
|
|
74
|
+
showBorder: o = !0,
|
|
75
|
+
showCloseButton: a = !0,
|
|
76
|
+
children: i,
|
|
77
|
+
"data-test-id": r = "fondue-dialog-header"
|
|
78
|
+
}, s) => /* @__PURE__ */ P(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
"data-test-id": r,
|
|
82
|
+
ref: s,
|
|
83
|
+
className: n.header,
|
|
84
|
+
"data-dialog-header-padding": t,
|
|
85
|
+
"data-show-border": o,
|
|
86
|
+
"data-dialog-layout-component": "header",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ e("div", { children: i }),
|
|
89
|
+
a && /* @__PURE__ */ e(d.Close, { role: "button", "data-test-id": `${r}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ e(j, { size: 20 }) })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
h.displayName = "Dialog.Header";
|
|
94
|
+
const C = ({ padding: t, showBorder: o = !0, children: a, "data-test-id": i = "fondue-dialog-footer" }, r) => /* @__PURE__ */ e(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
"data-test-id": i,
|
|
98
|
+
ref: r,
|
|
99
|
+
className: n.footer,
|
|
100
|
+
"data-dialog-footer-padding": t,
|
|
101
|
+
"data-show-border": o,
|
|
102
|
+
"data-dialog-layout-component": "footer",
|
|
103
|
+
children: a
|
|
104
|
+
}
|
|
28
105
|
);
|
|
29
|
-
|
|
106
|
+
C.displayName = "Dialog.Footer";
|
|
107
|
+
const N = ({ padding: t, children: o, "data-test-id": a = "fondue-dialog-body" }, i) => /* @__PURE__ */ e(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
"data-test-id": a,
|
|
111
|
+
ref: i,
|
|
112
|
+
className: n.body,
|
|
113
|
+
"data-dialog-body-padding": t,
|
|
114
|
+
"data-dialog-layout-component": "body",
|
|
115
|
+
children: o
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
N.displayName = "Dialog.Body";
|
|
119
|
+
const b = ({ children: t, "data-test-id": o = "fondue-dialog-side-content" }, a) => /* @__PURE__ */ e("div", { "data-test-id": o, ref: a, className: n.sideContent, "data-dialog-layout-component": !0, children: t });
|
|
120
|
+
b.displayName = "Dialog.SideContent";
|
|
121
|
+
const v = ({ children: t }) => /* @__PURE__ */ e(d.Close, { asChild: !0, children: t });
|
|
122
|
+
v.displayName = "Dialog.Close";
|
|
123
|
+
const x = ({ children: t, asChild: o }) => /* @__PURE__ */ e(d.Title, { asChild: o, children: t });
|
|
124
|
+
x.displayName = "Dialog.Title";
|
|
125
|
+
const F = ({ children: t, asChild: o }) => /* @__PURE__ */ e(d.Description, { asChild: o, children: t });
|
|
126
|
+
F.displayName = "Dialog.Description";
|
|
127
|
+
const Y = {
|
|
128
|
+
Root: f,
|
|
129
|
+
Title: x,
|
|
130
|
+
Description: F,
|
|
131
|
+
Close: v,
|
|
132
|
+
Trigger: l(y),
|
|
133
|
+
Content: l(D),
|
|
134
|
+
Header: l(h),
|
|
135
|
+
Footer: l(C),
|
|
136
|
+
Body: l(N),
|
|
137
|
+
SideContent: l(b)
|
|
138
|
+
};
|
|
30
139
|
export {
|
|
31
|
-
|
|
140
|
+
Y as Dialog,
|
|
141
|
+
N as DialogBody,
|
|
142
|
+
v as DialogClose,
|
|
143
|
+
D as DialogContent,
|
|
144
|
+
F as DialogDescription,
|
|
145
|
+
C as DialogFooter,
|
|
146
|
+
h as DialogHeader,
|
|
147
|
+
f as DialogRoot,
|
|
148
|
+
b as DialogSideContent,
|
|
149
|
+
x as DialogTitle,
|
|
150
|
+
y as DialogTrigger
|
|
32
151
|
};
|
|
33
152
|
//# sourceMappingURL=fondue-components9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components9.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 variant?: 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 Divider = forwardRef<HTMLDivElement, DividerProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-divider',\n direction = 'horizontal',\n className,\n variant,\n ...props\n }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n ): ReactElement => {\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n variant,\n ...props,\n }),\n className,\n )}\n data-test-id={dataTestId}\n />\n );\n },\n);\n\nDivider.displayName = 'Divider';\n"],"names":["Divider","forwardRef","dataTestId","direction","className","variant","props","ref","jsx","Separator","cn","dividerStyles"],"mappings":";;;;;AAuCO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,gBAAgBC,IAAa;AAAA,IAC7B,WAAAC,IAAY;AAAA,IACZ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACC,EAAU;AAAA,IAAV;AAAA,MACG,KAAAF;AAAA,MACA,WAAWG;AAAA,QACPC,EAAc;AAAA,UACV,WAAAR;AAAA,UACA,SAAAE;AAAA,UACA,GAAGC;AAAA,QAAA,CACN;AAAA,QACDF;AAAA,MACJ;AAAA,MACA,gBAAcF;AAAA,IAAA;AAAA,EAClB;AAGZ;AAEAF,EAAQ,cAAc;"}
|
|
1
|
+
{"version":3,"file":"fondue-components9.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 {\n createContext,\n forwardRef,\n useContext,\n useRef,\n type CSSProperties,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\n\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/dialog.module.scss';\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?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * The vertical alignment of the divider\n * @default \"center\"\n */\n verticalAlign?: 'top' | 'center';\n\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 minimum 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 = {\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 type DialogHeaderProps = {\n /**\n * Define the padding for the dialog header\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the bottom of the header\n * @default true\n */\n showBorder?: boolean;\n /**\n * Show a close button in the header\n * @default true\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = {\n /**\n * Define the padding for the dialog footer\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the top of the footer\n * @default true\n */\n showBorder?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogBodyProps = {\n /**\n * Define the padding for the dialog body\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n children?: ReactNode;\n 'data-test-id'?: string;\n};\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\ntype DialogContextType = {\n isModal: boolean;\n};\n\nconst DialogContext = createContext<DialogContextType>({ isModal: false });\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return (\n <DialogContext.Provider value={{ isModal: props.modal ?? false }}>\n <RadixDialog.Root {...props}>{children}</RadixDialog.Root>\n </DialogContext.Provider>\n );\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-dialog-trigger', ...props }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.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 </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nconst DialogUnderlay = ({ children, showUnderlay }: { children: ReactNode; showUnderlay: boolean }) => {\n const { isModal } = useContext(DialogContext);\n if (isModal) {\n return (\n <RadixDialog.Overlay data-visible={showUnderlay} className={styles.underlay}>\n {children}\n </RadixDialog.Overlay>\n );\n }\n return (\n <div className={styles.underlay} data-visible={showUnderlay}>\n {children}\n </div>\n );\n};\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n verticalAlign = 'center',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n rounded = true,\n children,\n ...props\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n const contentRef = useRef<HTMLDivElement>(null);\n\n useSyncRefs<HTMLDivElement>(contentRef, ref);\n\n const handleOpenAutoFocus = (event: Event) => {\n event.preventDefault();\n\n const dialogBody = contentRef.current?.querySelector('[data-dialog-layout-component=\"body\"]');\n\n const firstFocusable = dialogBody?.querySelector(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (firstFocusable instanceof HTMLElement) {\n firstFocusable.focus();\n }\n };\n\n return (\n <RadixDialog.Portal>\n <ThemeProvider theme={theme}>\n <DialogUnderlay showUnderlay={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={contentRef}\n className={styles.content}\n onFocus={addShowFocusRing}\n onOpenAutoFocus={handleOpenAutoFocus}\n data-dialog-padding={padding}\n data-dialog-rounded={rounded}\n data-test-id={dataTestId}\n data-dialog-vertical-align={verticalAlign}\n {...props}\n >\n {children}\n </RadixDialog.Content>\n </DialogUnderlay>\n </ThemeProvider>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n {\n padding,\n showBorder = true,\n showCloseButton = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dialog-header',\n }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.header}\n data-dialog-header-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component=\"header\"\n >\n <div>{children}</div>\n {showCloseButton && (\n <RadixDialog.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\n <IconCross size={20} />\n </RadixDialog.Close>\n )}\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { padding, showBorder = true, children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.footer}\n data-dialog-footer-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component=\"footer\"\n >\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { padding, children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.body}\n data-dialog-body-padding={padding}\n data-dialog-layout-component=\"body\"\n >\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={styles.sideContent} 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":["DialogContext","createContext","DialogRoot","children","props","RadixDialog","DialogTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","DialogUnderlay","showUnderlay","isModal","useContext","styles","DialogContent","maxWidth","minWidth","minHeight","padding","verticalAlign","rounded","theme","useFondueTheme","contentRef","useRef","useSyncRefs","handleOpenAutoFocus","event","dialogBody","_a","firstFocusable","ThemeProvider","addShowFocusRing","DialogHeader","showBorder","showCloseButton","jsxs","IconCross","DialogFooter","DialogBody","DialogSideContent","DialogClose","DialogTitle","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;;;;AA8IA,MAAMA,IAAgBC,EAAiC,EAAE,SAAS,IAAO,GAE5DC,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAEjCJ,EAAc,UAAd,EAAuB,OAAO,EAAE,SAASI,EAAM,SAAS,GAAM,GAC3D,4BAACC,EAAY,MAAZ,EAAkB,GAAGD,GAAQ,UAAAD,EAAS,CAAA,GAC3C;AAGRD,EAAW,cAAc;AAElB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAY;AAAA,EAAZ;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AACL;AAGRG,EAAc,cAAc;AAE5B,MAAMM,IAAiB,CAAC,EAAE,UAAAT,GAAU,cAAAU,QAAmE;AACnG,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAWf,CAAa;AAC5C,SAAIc,IAEI,gBAAAJ,EAACL,EAAY,SAAZ,EAAoB,gBAAcQ,GAAc,WAAWG,EAAO,UAC9D,UAAAb,GACL,sBAIH,OAAI,EAAA,WAAWa,EA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BAAgBK,IAAa,gCACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,WAAWO,EAAO,aAAa,gCAA4B,IAC/F,UAAAb,EACL,CAAA;AAGRwC,EAAkB,cAAc;AAEzB,MAAMC,IAAc,CAAC,EAAE,UAAAzC,0BAClBE,EAAY,OAAZ,EAAkB,SAAO,IAAE,UAAAF,GAAS;AAEhDyC,EAAY,cAAc;AAEnB,MAAMC,IAAc,CAAC,EAAE,UAAA1C,GAAU,SAAAI,QAC5B,gBAAAG,EAAAL,EAAY,OAAZ,EAAkB,SAAAE,GAAmB,UAAAJ,EAAS,CAAA;AAE1D0C,EAAY,cAAc;AAEnB,MAAMC,IAAoB,CAAC,EAAE,UAAA3C,GAAU,SAAAI,QAClC,gBAAAG,EAAAL,EAAY,aAAZ,EAAwB,SAAAE,GAAmB,UAAAJ,EAAS,CAAA;AAEhE2C,EAAkB,cAAc;AAEzB,MAAMC,IAAS;AAAA,EAClB,MAAM7C;AAAA,EACN,OAAO2C;AAAA,EACP,aAAaC;AAAA,EACb,OAAOF;AAAA,EACP,SAASI,EAAkD1C,CAAa;AAAA,EACxE,SAAS0C,EAA+C/B,CAAa;AAAA,EACrE,QAAQ+B,EAA8CZ,CAAY;AAAA,EAClE,QAAQY,EAA8CP,CAAY;AAAA,EAClE,MAAMO,EAA4CN,CAAU;AAAA,EAC5D,aAAaM,EAAmDL,CAAiB;AACrF;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -142,6 +142,61 @@ declare type AtLeastOneAttr<T> = Partial<T> & {
|
|
|
142
142
|
|
|
143
143
|
declare type AvailableTheme = keyof typeof default_2;
|
|
144
144
|
|
|
145
|
+
export declare const Badge: ({ "aria-label": ariaLabel, "data-test-id": dataTestId, children, disabled, dismissable, emphasis, onClick, onDismiss, size, status, title, variant, }: BadgeProps) => JSX_2.Element;
|
|
146
|
+
|
|
147
|
+
declare type BadgeEmphasis = 'strong' | 'weak';
|
|
148
|
+
|
|
149
|
+
declare type BadgeProps = {
|
|
150
|
+
/**
|
|
151
|
+
* @default 'strong'
|
|
152
|
+
*/
|
|
153
|
+
emphasis?: BadgeEmphasis;
|
|
154
|
+
/**
|
|
155
|
+
* @default 'default'
|
|
156
|
+
*/
|
|
157
|
+
variant?: BadgeStyle;
|
|
158
|
+
/**
|
|
159
|
+
* @default 'default'
|
|
160
|
+
*/
|
|
161
|
+
size?: BadgeSize;
|
|
162
|
+
/**
|
|
163
|
+
* @default false
|
|
164
|
+
*/
|
|
165
|
+
disabled?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Click handler
|
|
168
|
+
*/
|
|
169
|
+
onClick?: (event?: MouseEvent_2<HTMLButtonElement>) => void;
|
|
170
|
+
/**
|
|
171
|
+
* @default false
|
|
172
|
+
*/
|
|
173
|
+
dismissable?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Click handler on dismiss
|
|
176
|
+
*/
|
|
177
|
+
onDismiss?: (event?: MouseEvent_2<HTMLButtonElement>) => void;
|
|
178
|
+
/**
|
|
179
|
+
* The color of the status dot
|
|
180
|
+
*/
|
|
181
|
+
status?: BadgeStatusProps['status'];
|
|
182
|
+
title?: string;
|
|
183
|
+
'aria-label'?: string;
|
|
184
|
+
'data-test-id'?: string;
|
|
185
|
+
children: ReactNode;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
declare type BadgeSize = 'default' | 'small';
|
|
189
|
+
|
|
190
|
+
declare type BadgeStatusProps = {
|
|
191
|
+
status: BadgeStatusType;
|
|
192
|
+
} | {
|
|
193
|
+
status: RgbaColor | string;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
declare type BadgeStatusType = 'default' | 'positive' | 'highlight' | 'warning' | 'negative';
|
|
197
|
+
|
|
198
|
+
declare type BadgeStyle = 'default' | 'positive' | 'highlight' | 'warning' | 'negative';
|
|
199
|
+
|
|
145
200
|
declare type BaseTableRowProps = {
|
|
146
201
|
/**
|
|
147
202
|
* Whether the row is in a selected state
|
|
@@ -318,20 +373,20 @@ declare type ColorFormat = 'HEX' | 'RGBA';
|
|
|
318
373
|
export declare const ColorPicker: {
|
|
319
374
|
Root: ForwardRefExoticComponent<ColorPickerProps & RefAttributes<HTMLDivElement>>;
|
|
320
375
|
Values: ForwardRefExoticComponent< {
|
|
321
|
-
currentColor?:
|
|
322
|
-
onColorChange?: (color:
|
|
376
|
+
currentColor?: RgbaColor_2;
|
|
377
|
+
onColorChange?: (color: RgbaColor_2) => void;
|
|
323
378
|
currentFormat?: "HEX" | "RGBA";
|
|
324
379
|
setCurrentFormat?: (format: "HEX" | "RGBA") => void;
|
|
325
380
|
'data-test-id'?: string;
|
|
326
381
|
} & RefAttributes<HTMLDivElement>>;
|
|
327
382
|
Gradient: ForwardRefExoticComponent< {
|
|
328
|
-
currentColor?:
|
|
329
|
-
onColorChange?: (color:
|
|
383
|
+
currentColor?: RgbaColor_2;
|
|
384
|
+
onColorChange?: (color: RgbaColor_2) => void;
|
|
330
385
|
'data-test-id'?: string;
|
|
331
386
|
} & RefAttributes<HTMLDivElement>>;
|
|
332
387
|
Input: ForwardRefExoticComponent<({
|
|
333
388
|
id?: string;
|
|
334
|
-
currentColor?:
|
|
389
|
+
currentColor?: RgbaColor_2;
|
|
335
390
|
isOpen?: boolean;
|
|
336
391
|
disabled?: boolean;
|
|
337
392
|
onClear?: () => void;
|
|
@@ -348,11 +403,11 @@ declare type ColorPickerProps = {
|
|
|
348
403
|
/**
|
|
349
404
|
* The active color in the color picker
|
|
350
405
|
*/
|
|
351
|
-
currentColor?:
|
|
406
|
+
currentColor?: RgbaColor_2;
|
|
352
407
|
/**
|
|
353
408
|
* Event handler called when the color changes
|
|
354
409
|
*/
|
|
355
|
-
onColorChange?: (color:
|
|
410
|
+
onColorChange?: (color: RgbaColor_2) => void;
|
|
356
411
|
/**
|
|
357
412
|
* The active color format in the color picker
|
|
358
413
|
*/
|
|
@@ -1252,6 +1307,14 @@ declare type RgbaColor = {
|
|
|
1252
1307
|
name?: string;
|
|
1253
1308
|
};
|
|
1254
1309
|
|
|
1310
|
+
declare type RgbaColor_2 = {
|
|
1311
|
+
red: number;
|
|
1312
|
+
green: number;
|
|
1313
|
+
blue: number;
|
|
1314
|
+
alpha?: number;
|
|
1315
|
+
name?: string;
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1255
1318
|
declare const screens: {
|
|
1256
1319
|
xs: string;
|
|
1257
1320
|
sm: string;
|