tfy-web-components 0.0.41 → 0.0.43
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/{Button-CHzl5RaT.js → Button-CPJYHldw.js} +3 -2
- package/dist/{Button-CHzl5RaT.js.map → Button-CPJYHldw.js.map} +1 -1
- package/dist/{CompositeItem-BGwD51jI.js → CompositeItem-DJWNsIwE.js} +2 -2
- package/dist/{CompositeItem-BGwD51jI.js.map → CompositeItem-DJWNsIwE.js.map} +1 -1
- package/dist/{CompositeRoot-BxrPc7F6.js → CompositeRoot-BlljDWkR.js} +5 -5
- package/dist/{CompositeRoot-BxrPc7F6.js.map → CompositeRoot-BlljDWkR.js.map} +1 -1
- package/dist/{Input-WdhMjVoF.js → Input-Dcxu6SVO.js} +3 -3
- package/dist/{Input-WdhMjVoF.js.map → Input-Dcxu6SVO.js.map} +1 -1
- package/dist/{Modal-MUzR0rK2.js → Modal-BUWlwJcN.js} +18 -18
- package/dist/{Modal-MUzR0rK2.js.map → Modal-BUWlwJcN.js.map} +1 -1
- package/dist/{Popover-B3yBTSQa.js → Popover-BqqXJnK1.js} +10 -10
- package/dist/{Popover-B3yBTSQa.js.map → Popover-BqqXJnK1.js.map} +1 -1
- package/dist/{Tooltip-D5E-qGtP.js → Tooltip-uQIVdskf.js} +29 -132
- package/dist/{Tooltip-D5E-qGtP.js.map → Tooltip-uQIVdskf.js.map} +1 -1
- package/dist/components/atoms/Accordion.d.ts +20 -4
- package/dist/components/atoms/Accordion.es.js +74 -26
- package/dist/components/atoms/Accordion.es.js.map +1 -1
- package/dist/components/atoms/Button.d.ts +1 -0
- package/dist/components/atoms/Button.es.js +2 -2
- package/dist/components/atoms/ButtonGroup.d.ts +10 -5
- package/dist/components/atoms/ButtonGroup.es.js +95 -39
- package/dist/components/atoms/ButtonGroup.es.js.map +1 -1
- package/dist/components/atoms/IconButton.es.js +2 -2
- package/dist/components/atoms/Modal.es.js +6 -6
- package/dist/components/atoms/OverflowButton.es.js +2 -2
- package/dist/components/atoms/Switch.es.js +5 -5
- package/dist/components/atoms/Switch.es.js.map +1 -1
- package/dist/components/atoms/TabButton.es.js +6 -6
- package/dist/components/atoms/Tooltip.d.ts +3 -15
- package/dist/components/atoms/Tooltip.es.js +9 -10
- package/dist/components/molecules/Alert.es.js +3 -3
- package/dist/components/molecules/CopyField.es.js +2 -2
- package/dist/components/molecules/CustomDrawer.es.js +1 -1
- package/dist/components/molecules/Dialog.es.js +1 -1
- package/dist/components/molecules/ImagesPreview.es.js +2 -2
- package/dist/components/molecules/Input.es.js +2 -2
- package/dist/components/molecules/Markdown.es.js +2 -2
- package/dist/components/molecules/Markdown.es.js.map +1 -1
- package/dist/components/molecules/SimpleCodeEditor.es.js +2 -2
- package/dist/components/molecules/ToggleButton.es.js +2 -2
- package/dist/components/molecules/agent-chat.es.js +2 -2
- package/dist/{composite-DCpXNxz9.js → composite-BL4bbAWg.js} +2 -2
- package/dist/{composite-DCpXNxz9.js.map → composite-BL4bbAWg.js.map} +1 -1
- package/dist/{composite-CrCQWAKA.js → composite-C22yiNy1.js} +2 -2
- package/dist/{composite-CrCQWAKA.js.map → composite-C22yiNy1.js.map} +1 -1
- package/dist/{index-B806bfA-.js → index-C-2yrwZl.js} +3 -3
- package/dist/{index-B806bfA-.js.map → index-C-2yrwZl.js.map} +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +23 -12
- package/dist/index.es.js.map +1 -1
- package/dist/new-components/atoms/Alert.d.ts +31 -0
- package/dist/new-components/atoms/Alert.es.js +158 -0
- package/dist/new-components/atoms/Alert.es.js.map +1 -0
- package/dist/new-components/atoms/Checkbox.es.js +4 -4
- package/dist/new-components/atoms/EmptyState.d.ts +44 -0
- package/dist/new-components/atoms/EmptyState.es.js +234 -0
- package/dist/new-components/atoms/EmptyState.es.js.map +1 -0
- package/dist/new-components/atoms/Popover.es.js +2 -2
- package/dist/new-components/atoms/Radio.es.js +8 -8
- package/dist/new-components/atoms/SegmentedControl.es.js +4 -4
- package/dist/new-components/atoms/Slider.es.js +5 -5
- package/dist/new-components/atoms/Toast.d.ts +79 -0
- package/dist/new-components/atoms/Toast.es.js +449 -0
- package/dist/new-components/atoms/Toast.es.js.map +1 -0
- package/dist/new-components/atoms/Toggletip.es.js +3 -3
- package/dist/new-components/atoms/Toggletip.es.js.map +1 -1
- package/dist/{shadowDom-Bq4g0Qeu.js → shadowDom-BfewIqRj.js} +2 -2
- package/dist/{shadowDom-Bq4g0Qeu.js.map → shadowDom-BfewIqRj.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/tokens.css +16 -5
- package/dist/{useAriaLabelledBy-B6n92QBS.js → useAriaLabelledBy-Lyj6n_TU.js} +2 -2
- package/dist/{useAriaLabelledBy-B6n92QBS.js.map → useAriaLabelledBy-Lyj6n_TU.js.map} +1 -1
- package/dist/{useBaseUiId-Ch7ujXpo.js → useBaseUiId-CmLtG9DS.js} +4 -4
- package/dist/{useBaseUiId-Ch7ujXpo.js.map → useBaseUiId-CmLtG9DS.js.map} +1 -1
- package/dist/{useButton-PUBhT4Vo.js → useButton-D2BMuSfC.js} +2 -2
- package/dist/{useButton-PUBhT4Vo.js.map → useButton-D2BMuSfC.js.map} +1 -1
- package/dist/{useLabelableId-DCLzrdD-.js → useLabelableId-CcIE3RU0.js} +2 -2
- package/dist/{useLabelableId-DCLzrdD-.js.map → useLabelableId-CcIE3RU0.js.map} +1 -1
- package/dist/{useOpenInteractionType-DGWLoAqp.js → useOpenInteractionType-CDFYOw2d.js} +9 -9
- package/dist/{useOpenInteractionType-DGWLoAqp.js.map → useOpenInteractionType-CDFYOw2d.js.map} +1 -1
- package/dist/{usePopupHandleStore-BdS-xYID.js → usePopupHandleStore-CkW2IoED.js} +32 -32
- package/dist/{usePopupHandleStore-BdS-xYID.js.map → usePopupHandleStore-CkW2IoED.js.map} +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { c as cva } from "../../index-DSVg79g-.js";
|
|
4
|
+
import { faBox } from "@fortawesome/free-solid-svg-icons";
|
|
5
|
+
import { Avatar, AvatarFallback, AvatarGroup } from "../../components/atoms/Avatar.es.js";
|
|
6
|
+
import { B as Button, C as ControlButton } from "../../Button-CPJYHldw.js";
|
|
7
|
+
import IconProvider from "../../components/atoms/IconProvider.es.js";
|
|
8
|
+
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
9
|
+
const emptyStateVariants = cva(
|
|
10
|
+
"relative flex max-w-full flex-col items-center justify-center overflow-hidden text-center text-text-primary",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
sm: "w-64 gap-space-12 p-space-16",
|
|
15
|
+
md: "w-80 gap-space-16 p-space-24",
|
|
16
|
+
lg: "w-96 gap-space-16 p-space-32"
|
|
17
|
+
},
|
|
18
|
+
surface: {
|
|
19
|
+
none: "",
|
|
20
|
+
outline: "rounded-container border border-dashed border-border-default",
|
|
21
|
+
filled: "rounded-container bg-background-striped",
|
|
22
|
+
grid: ""
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
size: "md",
|
|
27
|
+
surface: "none"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
const TEXT_CLASS = {
|
|
32
|
+
sm: "gap-space-4",
|
|
33
|
+
md: "gap-space-4",
|
|
34
|
+
lg: "gap-space-8"
|
|
35
|
+
};
|
|
36
|
+
const TITLE_CLASS = {
|
|
37
|
+
sm: "text-label-md",
|
|
38
|
+
md: "text-heading-sm",
|
|
39
|
+
lg: "text-heading-md"
|
|
40
|
+
};
|
|
41
|
+
const DESCRIPTION_CLASS = {
|
|
42
|
+
sm: "text-body-sm",
|
|
43
|
+
md: "text-body-sm",
|
|
44
|
+
lg: "text-body-md"
|
|
45
|
+
};
|
|
46
|
+
const BUTTON_SIZE = {
|
|
47
|
+
sm: "small",
|
|
48
|
+
md: "large",
|
|
49
|
+
lg: "large"
|
|
50
|
+
};
|
|
51
|
+
const ICON_TILE_CLASS = {
|
|
52
|
+
sm: "size-8",
|
|
53
|
+
md: "size-10",
|
|
54
|
+
lg: "size-12"
|
|
55
|
+
};
|
|
56
|
+
const ICON_TILE_GLYPH = {
|
|
57
|
+
sm: 1,
|
|
58
|
+
md: 1.5,
|
|
59
|
+
lg: 1.5
|
|
60
|
+
};
|
|
61
|
+
const ILLUSTRATION_CLASS = {
|
|
62
|
+
sm: "size-16",
|
|
63
|
+
md: "size-20",
|
|
64
|
+
lg: "size-24"
|
|
65
|
+
};
|
|
66
|
+
const ILLUSTRATION_GLYPH = {
|
|
67
|
+
sm: 2,
|
|
68
|
+
md: 2.5,
|
|
69
|
+
lg: 3
|
|
70
|
+
};
|
|
71
|
+
const AVATAR_SIZE = {
|
|
72
|
+
sm: "default",
|
|
73
|
+
md: "lg",
|
|
74
|
+
lg: "xl"
|
|
75
|
+
};
|
|
76
|
+
const AVATAR_GROUP_SIZE = {
|
|
77
|
+
sm: "default",
|
|
78
|
+
md: "lg",
|
|
79
|
+
lg: "lg"
|
|
80
|
+
};
|
|
81
|
+
function IconTile({ icon, size }) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "empty-state-icon-tile",
|
|
86
|
+
className: classNames(
|
|
87
|
+
"flex shrink-0 items-center justify-center rounded-container border border-border-brand bg-background-brand text-background-brand-bold-selected",
|
|
88
|
+
ICON_TILE_CLASS[size]
|
|
89
|
+
),
|
|
90
|
+
children: /* @__PURE__ */ jsx(IconProvider, { icon, size: ICON_TILE_GLYPH[size] })
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function IllustrationStandIn({ size }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
"span",
|
|
97
|
+
{
|
|
98
|
+
"data-slot": "empty-state-illustration-stand-in",
|
|
99
|
+
className: classNames(
|
|
100
|
+
"flex shrink-0 items-center justify-center rounded-container bg-background-sunken text-icon-primary",
|
|
101
|
+
ILLUSTRATION_CLASS[size]
|
|
102
|
+
),
|
|
103
|
+
children: /* @__PURE__ */ jsx(IconProvider, { icon: faBox, size: ILLUSTRATION_GLYPH[size] })
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
function EmptyStateMedia({
|
|
108
|
+
media,
|
|
109
|
+
size,
|
|
110
|
+
icon,
|
|
111
|
+
illustration,
|
|
112
|
+
avatar,
|
|
113
|
+
avatars
|
|
114
|
+
}) {
|
|
115
|
+
if (media === "none") return null;
|
|
116
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "empty-state-media", "aria-hidden": "true", inert: true, className: "relative shrink-0", children: [
|
|
117
|
+
media === "icon" ? /* @__PURE__ */ jsx(IconTile, { icon: icon ?? faBox, size }) : null,
|
|
118
|
+
media === "illustration" ? illustration ?? /* @__PURE__ */ jsx(IllustrationStandIn, { size }) : null,
|
|
119
|
+
media === "avatar" ? /* @__PURE__ */ jsx(Avatar, { size: AVATAR_SIZE[size], children: avatar ?? /* @__PURE__ */ jsx(AvatarFallback, {}) }) : null,
|
|
120
|
+
media === "avatar-group" ? /* @__PURE__ */ jsx(AvatarGroup, { size: AVATAR_GROUP_SIZE[size], layout: "stack", children: avatars ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
121
|
+
/* @__PURE__ */ jsx(Avatar, { children: /* @__PURE__ */ jsx(AvatarFallback, { identity: "initials", children: "A" }) }),
|
|
122
|
+
/* @__PURE__ */ jsx(Avatar, { children: /* @__PURE__ */ jsx(AvatarFallback, { identity: "initials", children: "R" }) }),
|
|
123
|
+
/* @__PURE__ */ jsx(Avatar, { children: /* @__PURE__ */ jsx(AvatarFallback, { identity: "initials", children: "S" }) })
|
|
124
|
+
] }) }) : null
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
function EmptyState({
|
|
128
|
+
ref,
|
|
129
|
+
size = "md",
|
|
130
|
+
surface = "none",
|
|
131
|
+
media = "none",
|
|
132
|
+
icon,
|
|
133
|
+
illustration,
|
|
134
|
+
avatar,
|
|
135
|
+
avatars,
|
|
136
|
+
title,
|
|
137
|
+
titleAs: Title = "h3",
|
|
138
|
+
description,
|
|
139
|
+
action,
|
|
140
|
+
secondaryAction,
|
|
141
|
+
link,
|
|
142
|
+
live = false,
|
|
143
|
+
className,
|
|
144
|
+
"aria-labelledby": ariaLabelledBy,
|
|
145
|
+
...props
|
|
146
|
+
}) {
|
|
147
|
+
const generatedTitleId = React.useId();
|
|
148
|
+
const titleId = ariaLabelledBy ? void 0 : generatedTitleId;
|
|
149
|
+
return /* @__PURE__ */ jsxs(
|
|
150
|
+
"section",
|
|
151
|
+
{
|
|
152
|
+
ref,
|
|
153
|
+
"data-slot": "empty-state",
|
|
154
|
+
"data-size": size,
|
|
155
|
+
"data-surface": surface,
|
|
156
|
+
"data-media": media,
|
|
157
|
+
"aria-labelledby": ariaLabelledBy ?? generatedTitleId,
|
|
158
|
+
"aria-live": live ? "polite" : void 0,
|
|
159
|
+
...props,
|
|
160
|
+
className: classNames(emptyStateVariants({ size, surface }), className),
|
|
161
|
+
children: [
|
|
162
|
+
surface === "grid" ? /* @__PURE__ */ jsx(
|
|
163
|
+
"span",
|
|
164
|
+
{
|
|
165
|
+
"aria-hidden": "true",
|
|
166
|
+
"data-slot": "empty-state-backdrop",
|
|
167
|
+
className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle,var(--border-subtle)_0.0625rem,transparent_0.0625rem)] [background-size:1rem_1rem]"
|
|
168
|
+
}
|
|
169
|
+
) : null,
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
EmptyStateMedia,
|
|
172
|
+
{
|
|
173
|
+
media,
|
|
174
|
+
size,
|
|
175
|
+
icon,
|
|
176
|
+
illustration,
|
|
177
|
+
avatar,
|
|
178
|
+
avatars
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ jsxs(
|
|
182
|
+
"div",
|
|
183
|
+
{
|
|
184
|
+
"data-slot": "empty-state-text",
|
|
185
|
+
className: classNames("relative flex w-full flex-col items-center break-words", TEXT_CLASS[size]),
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ jsx(Title, { id: titleId, "data-slot": "empty-state-title", className: classNames("w-full", TITLE_CLASS[size]), children: title }),
|
|
188
|
+
description != null ? /* @__PURE__ */ jsx(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
"data-slot": "empty-state-description",
|
|
192
|
+
className: classNames("w-full text-text-secondary", DESCRIPTION_CLASS[size]),
|
|
193
|
+
children: description
|
|
194
|
+
}
|
|
195
|
+
) : null
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
action ? /* @__PURE__ */ jsxs("div", { "data-slot": "empty-state-actions", className: "relative flex items-center justify-center gap-space-8", children: [
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
Button,
|
|
202
|
+
{
|
|
203
|
+
variant: action.variant ?? "primary",
|
|
204
|
+
size: BUTTON_SIZE[size],
|
|
205
|
+
type: "button",
|
|
206
|
+
text: action.label,
|
|
207
|
+
onClick: action.onClick,
|
|
208
|
+
disabled: action.disabled,
|
|
209
|
+
loading: action.loading
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
secondaryAction ? /* @__PURE__ */ jsx(
|
|
213
|
+
Button,
|
|
214
|
+
{
|
|
215
|
+
variant: "secondary",
|
|
216
|
+
size: BUTTON_SIZE[size],
|
|
217
|
+
type: "button",
|
|
218
|
+
text: secondaryAction.label,
|
|
219
|
+
onClick: secondaryAction.onClick,
|
|
220
|
+
disabled: secondaryAction.disabled,
|
|
221
|
+
loading: secondaryAction.loading
|
|
222
|
+
}
|
|
223
|
+
) : null
|
|
224
|
+
] }) : null,
|
|
225
|
+
link ? /* @__PURE__ */ jsx(ControlButton, { "data-slot": "empty-state-link", asChild: true, variant: "link", size: "sm", className: "relative", children: /* @__PURE__ */ jsx("a", { href: link.href, target: link.target, rel: link.rel, onClick: link.onClick, children: link.label }) }) : null
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
export {
|
|
231
|
+
EmptyState as default,
|
|
232
|
+
emptyStateVariants
|
|
233
|
+
};
|
|
234
|
+
//# sourceMappingURL=EmptyState.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.es.js","sources":["../../../src/new-components/atoms/EmptyState.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { faBox } from '@fortawesome/free-solid-svg-icons'\n\nimport { Avatar, AvatarFallback, AvatarGroup, type AvatarSize } from '@/components/atoms/Avatar'\nimport Button, { type ButtonSize, ControlButton } from '@/components/atoms/Button'\nimport IconProvider, { type IconProp } from '@/components/atoms/IconProvider'\nimport { cn } from '@/lib/utils'\n\nconst emptyStateVariants = cva(\n 'relative flex max-w-full flex-col items-center justify-center overflow-hidden text-center text-text-primary',\n {\n variants: {\n size: {\n sm: 'w-64 gap-space-12 p-space-16',\n md: 'w-80 gap-space-16 p-space-24',\n lg: 'w-96 gap-space-16 p-space-32',\n },\n surface: {\n none: '',\n outline: 'rounded-container border border-dashed border-border-default',\n filled: 'rounded-container bg-background-striped',\n grid: '',\n },\n },\n defaultVariants: {\n size: 'md',\n surface: 'none',\n },\n },\n)\n\ntype EmptyStateSize = NonNullable<VariantProps<typeof emptyStateVariants>['size']>\ntype EmptyStateSurface = NonNullable<VariantProps<typeof emptyStateVariants>['surface']>\ntype EmptyStateMediaType = 'none' | 'icon' | 'illustration' | 'avatar' | 'avatar-group'\ntype EmptyStateTitleElement = 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\nexport type EmptyStateAction = {\n label: React.ReactNode\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n disabled?: boolean\n loading?: boolean\n variant?: 'primary' | 'secondary'\n}\n\nexport type EmptyStateLink = {\n label: React.ReactNode\n href: string\n target?: React.HTMLAttributeAnchorTarget\n rel?: string\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n}\n\nexport type EmptyStateProps = Omit<React.ComponentProps<'section'>, 'children' | 'title'> & {\n size?: EmptyStateSize\n surface?: EmptyStateSurface\n media?: EmptyStateMediaType\n icon?: IconProp\n illustration?: React.ReactNode\n avatar?: React.ReactNode\n avatars?: React.ReactNode\n title: React.ReactNode\n titleAs?: EmptyStateTitleElement\n description?: React.ReactNode\n action?: EmptyStateAction\n secondaryAction?: Omit<EmptyStateAction, 'variant'>\n link?: EmptyStateLink\n live?: boolean\n}\n\nconst TEXT_CLASS: Record<EmptyStateSize, string> = {\n sm: 'gap-space-4',\n md: 'gap-space-4',\n lg: 'gap-space-8',\n}\n\nconst TITLE_CLASS: Record<EmptyStateSize, string> = {\n sm: 'text-label-md',\n md: 'text-heading-sm',\n lg: 'text-heading-md',\n}\n\nconst DESCRIPTION_CLASS: Record<EmptyStateSize, string> = {\n sm: 'text-body-sm',\n md: 'text-body-sm',\n lg: 'text-body-md',\n}\n\nconst BUTTON_SIZE: Record<EmptyStateSize, ButtonSize> = {\n sm: 'small',\n md: 'large',\n lg: 'large',\n}\n\nconst ICON_TILE_CLASS: Record<EmptyStateSize, string> = {\n sm: 'size-8',\n md: 'size-10',\n lg: 'size-12',\n}\n\nconst ICON_TILE_GLYPH: Record<EmptyStateSize, number> = {\n sm: 1,\n md: 1.5,\n lg: 1.5,\n}\n\nconst ILLUSTRATION_CLASS: Record<EmptyStateSize, string> = {\n sm: 'size-16',\n md: 'size-20',\n lg: 'size-24',\n}\n\nconst ILLUSTRATION_GLYPH: Record<EmptyStateSize, number> = {\n sm: 2,\n md: 2.5,\n lg: 3,\n}\n\nconst AVATAR_SIZE: Record<EmptyStateSize, AvatarSize> = {\n sm: 'default',\n md: 'lg',\n lg: 'xl',\n}\n\nconst AVATAR_GROUP_SIZE = {\n sm: 'default',\n md: 'lg',\n lg: 'lg',\n} as const\n\nfunction IconTile({ icon, size }: { icon: IconProp; size: EmptyStateSize }) {\n return (\n <span\n data-slot=\"empty-state-icon-tile\"\n className={cn(\n 'flex shrink-0 items-center justify-center rounded-container border border-border-brand bg-background-brand text-background-brand-bold-selected',\n ICON_TILE_CLASS[size],\n )}\n >\n <IconProvider icon={icon} size={ICON_TILE_GLYPH[size]} />\n </span>\n )\n}\n\nfunction IllustrationStandIn({ size }: { size: EmptyStateSize }) {\n return (\n <span\n data-slot=\"empty-state-illustration-stand-in\"\n className={cn(\n 'flex shrink-0 items-center justify-center rounded-container bg-background-sunken text-icon-primary',\n ILLUSTRATION_CLASS[size],\n )}\n >\n <IconProvider icon={faBox} size={ILLUSTRATION_GLYPH[size]} />\n </span>\n )\n}\n\nfunction EmptyStateMedia({\n media,\n size,\n icon,\n illustration,\n avatar,\n avatars,\n}: Pick<EmptyStateProps, 'media' | 'icon' | 'illustration' | 'avatar' | 'avatars'> & {\n size: EmptyStateSize\n}) {\n if (media === 'none') return null\n\n return (\n <div data-slot=\"empty-state-media\" aria-hidden=\"true\" inert className=\"relative shrink-0\">\n {media === 'icon' ? <IconTile icon={icon ?? faBox} size={size} /> : null}\n {media === 'illustration' ? illustration ?? <IllustrationStandIn size={size} /> : null}\n {media === 'avatar' ? <Avatar size={AVATAR_SIZE[size]}>{avatar ?? <AvatarFallback />}</Avatar> : null}\n {media === 'avatar-group' ? (\n <AvatarGroup size={AVATAR_GROUP_SIZE[size]} layout=\"stack\">\n {avatars ?? (\n <>\n <Avatar>\n <AvatarFallback identity=\"initials\">A</AvatarFallback>\n </Avatar>\n <Avatar>\n <AvatarFallback identity=\"initials\">R</AvatarFallback>\n </Avatar>\n <Avatar>\n <AvatarFallback identity=\"initials\">S</AvatarFallback>\n </Avatar>\n </>\n )}\n </AvatarGroup>\n ) : null}\n </div>\n )\n}\n\nfunction EmptyState({\n ref,\n size = 'md',\n surface = 'none',\n media = 'none',\n icon,\n illustration,\n avatar,\n avatars,\n title,\n titleAs: Title = 'h3',\n description,\n action,\n secondaryAction,\n link,\n live = false,\n className,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n}: EmptyStateProps) {\n const generatedTitleId = React.useId()\n const titleId = ariaLabelledBy ? undefined : generatedTitleId\n\n return (\n <section\n ref={ref}\n data-slot=\"empty-state\"\n data-size={size}\n data-surface={surface}\n data-media={media}\n aria-labelledby={ariaLabelledBy ?? generatedTitleId}\n aria-live={live ? 'polite' : undefined}\n {...props}\n className={cn(emptyStateVariants({ size, surface }), className)}\n >\n {surface === 'grid' ? (\n <span\n aria-hidden=\"true\"\n data-slot=\"empty-state-backdrop\"\n className=\"pointer-events-none absolute inset-0 bg-[radial-gradient(circle,var(--border-subtle)_0.0625rem,transparent_0.0625rem)] [background-size:1rem_1rem]\"\n />\n ) : null}\n\n <EmptyStateMedia\n media={media}\n size={size}\n icon={icon}\n illustration={illustration}\n avatar={avatar}\n avatars={avatars}\n />\n\n <div\n data-slot=\"empty-state-text\"\n className={cn('relative flex w-full flex-col items-center break-words', TEXT_CLASS[size])}\n >\n <Title id={titleId} data-slot=\"empty-state-title\" className={cn('w-full', TITLE_CLASS[size])}>\n {title}\n </Title>\n {description != null ? (\n <div\n data-slot=\"empty-state-description\"\n className={cn('w-full text-text-secondary', DESCRIPTION_CLASS[size])}\n >\n {description}\n </div>\n ) : null}\n </div>\n\n {action ? (\n <div data-slot=\"empty-state-actions\" className=\"relative flex items-center justify-center gap-space-8\">\n <Button\n variant={action.variant ?? 'primary'}\n size={BUTTON_SIZE[size]}\n type=\"button\"\n text={action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n loading={action.loading}\n />\n {secondaryAction ? (\n <Button\n variant=\"secondary\"\n size={BUTTON_SIZE[size]}\n type=\"button\"\n text={secondaryAction.label}\n onClick={secondaryAction.onClick}\n disabled={secondaryAction.disabled}\n loading={secondaryAction.loading}\n />\n ) : null}\n </div>\n ) : null}\n\n {link ? (\n <ControlButton data-slot=\"empty-state-link\" asChild variant=\"link\" size=\"sm\" className=\"relative\">\n <a href={link.href} target={link.target} rel={link.rel} onClick={link.onClick}>\n {link.label}\n </a>\n </ControlButton>\n ) : null}\n </section>\n )\n}\n\nexport { emptyStateVariants }\nexport default EmptyState\n"],"names":["cn"],"mappings":";;;;;;;;AASA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,SAAS;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAwCA,MAAM,aAA6C;AAAA,EACjD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,cAA8C;AAAA,EAClD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,oBAAoD;AAAA,EACxD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,cAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,kBAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,kBAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,qBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,qBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,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AA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../index-DSVg79g-.js";
|
|
4
|
-
import "../../Button-
|
|
4
|
+
import "../../Button-CPJYHldw.js";
|
|
5
5
|
import "../../components/atoms/IconProvider.es.js";
|
|
6
6
|
import "../../classNames-B1XpQHle.js";
|
|
7
|
-
import { P, a, b, c, d, e, f, g, h, i, j } from "../../Popover-
|
|
7
|
+
import { P, a, b, c, d, e, f, g, h, i, j } from "../../Popover-BqqXJnK1.js";
|
|
8
8
|
export {
|
|
9
9
|
P as Popover,
|
|
10
10
|
a as PopoverArrow,
|
|
@@ -3,17 +3,17 @@ import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { u as useControlled } from "../../useControlled-BSyYkg5C.js";
|
|
5
5
|
import { f as formatErrorMessage, c as useMergedRefs, u as useIsoLayoutEffect, N as NOOP, d as EMPTY_OBJECT, b as useRenderElement, a as useStableCallback } from "../../useIsoLayoutEffect-e9VA-ICd.js";
|
|
6
|
-
import { u as useBaseUiId, c as createChangeEventDetails, n as none } from "../../useBaseUiId-
|
|
7
|
-
import { S as SHIFT } from "../../composite-
|
|
8
|
-
import { A as ACTIVE_COMPOSITE_ITEM, C as CompositeRoot } from "../../CompositeRoot-
|
|
9
|
-
import { f as fieldValidityMapping, a as useFieldRootContext, b as useLabelableContext, c as useSetFieldFocused, d as useLabelableId, u as useFormContext, e as useRegisterFieldControl, g as useValueChanged } from "../../useLabelableId-
|
|
10
|
-
import { c as contains } from "../../shadowDom-
|
|
6
|
+
import { u as useBaseUiId, c as createChangeEventDetails, n as none } from "../../useBaseUiId-CmLtG9DS.js";
|
|
7
|
+
import { S as SHIFT } from "../../composite-C22yiNy1.js";
|
|
8
|
+
import { A as ACTIVE_COMPOSITE_ITEM, C as CompositeRoot } from "../../CompositeRoot-BlljDWkR.js";
|
|
9
|
+
import { f as fieldValidityMapping, a as useFieldRootContext, b as useLabelableContext, c as useSetFieldFocused, d as useLabelableId, u as useFormContext, e as useRegisterFieldControl, g as useValueChanged } from "../../useLabelableId-CcIE3RU0.js";
|
|
10
|
+
import { c as contains } from "../../shadowDom-BfewIqRj.js";
|
|
11
11
|
import { v as visuallyHiddenInput, a as visuallyHidden } from "../../visuallyHidden-B6H2X3_Y.js";
|
|
12
12
|
import { t as transitionStatusMapping, u as useTransitionStatus, a as useOpenChangeComplete } from "../../useTransitionStatus-C9gg_XJ-.js";
|
|
13
|
-
import { a as useButton, d as dispatchClickWithModifiers } from "../../useButton-
|
|
14
|
-
import { C as CompositeItem } from "../../CompositeItem-
|
|
13
|
+
import { a as useButton, d as dispatchClickWithModifiers } from "../../useButton-D2BMuSfC.js";
|
|
14
|
+
import { C as CompositeItem } from "../../CompositeItem-DJWNsIwE.js";
|
|
15
15
|
import { u as useFieldItemContext } from "../../FieldItemContext-DRVgx-D1.js";
|
|
16
|
-
import { u as useAriaLabelledBy } from "../../useAriaLabelledBy-
|
|
16
|
+
import { u as useAriaLabelledBy } from "../../useAriaLabelledBy-Lyj6n_TU.js";
|
|
17
17
|
const checked = "data-checked";
|
|
18
18
|
const unchecked = "data-unchecked";
|
|
19
19
|
const stateAttributesMapping = {
|
|
@@ -4,13 +4,13 @@ import { c as cva } from "../../index-DSVg79g-.js";
|
|
|
4
4
|
import IconProvider from "../../components/atoms/IconProvider.es.js";
|
|
5
5
|
import { b as useRenderElement, a as useStableCallback, E as EMPTY_ARRAY } from "../../useIsoLayoutEffect-e9VA-ICd.js";
|
|
6
6
|
import { u as useControlled } from "../../useControlled-BSyYkg5C.js";
|
|
7
|
-
import { C as CompositeRoot } from "../../CompositeRoot-
|
|
7
|
+
import { C as CompositeRoot } from "../../CompositeRoot-BlljDWkR.js";
|
|
8
8
|
import { u as useToolbarRootContext } from "../../ToolbarRootContext-B_HxjkNI.js";
|
|
9
9
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
10
10
|
import { e as error } from "../../error-FX4R42W-.js";
|
|
11
|
-
import { u as useBaseUiId, c as createChangeEventDetails, n as none } from "../../useBaseUiId-
|
|
12
|
-
import { a as useButton } from "../../useButton-
|
|
13
|
-
import { C as CompositeItem } from "../../CompositeItem-
|
|
11
|
+
import { u as useBaseUiId, c as createChangeEventDetails, n as none } from "../../useBaseUiId-CmLtG9DS.js";
|
|
12
|
+
import { a as useButton } from "../../useButton-D2BMuSfC.js";
|
|
13
|
+
import { C as CompositeItem } from "../../CompositeItem-DJWNsIwE.js";
|
|
14
14
|
const ToggleGroupContext = /* @__PURE__ */ React.createContext(void 0);
|
|
15
15
|
if (process.env.NODE_ENV !== "production") ToggleGroupContext.displayName = "ToggleGroupContext";
|
|
16
16
|
function useToggleGroupContext() {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { o as ownerDocument, s as shimExports, m as matchesFocusVisible } from "../../index-
|
|
4
|
+
import { o as ownerDocument, s as shimExports, m as matchesFocusVisible } from "../../index-C-2yrwZl.js";
|
|
5
5
|
import { u as useControlled } from "../../useControlled-BSyYkg5C.js";
|
|
6
6
|
import { f as formatErrorMessage, a as useStableCallback, w as warn, u as useIsoLayoutEffect, b as useRenderElement, i as isReactVersionAtLeast, m as mergeProps, c as useMergedRefs } from "../../useIsoLayoutEffect-e9VA-ICd.js";
|
|
7
|
-
import { u as useBaseUiId, n as none, c as createChangeEventDetails, k as createGenericEventDetails, l as keyboard, o as inputChange, g as getWindow, p as isElement, q as drag, r as trackPress } from "../../useBaseUiId-
|
|
8
|
-
import { f as fieldValidityMapping, u as useFormContext, a as useFieldRootContext, b as useLabelableContext, e as useRegisterFieldControl, g as useValueChanged, c as useSetFieldFocused, d as useLabelableId } from "../../useLabelableId-
|
|
7
|
+
import { u as useBaseUiId, n as none, c as createChangeEventDetails, k as createGenericEventDetails, l as keyboard, o as inputChange, g as getWindow, p as isElement, q as drag, r as trackPress } from "../../useBaseUiId-CmLtG9DS.js";
|
|
8
|
+
import { f as fieldValidityMapping, u as useFormContext, a as useFieldRootContext, b as useLabelableContext, e as useRegisterFieldControl, g as useValueChanged, c as useSetFieldFocused, d as useLabelableId } from "../../useLabelableId-CcIE3RU0.js";
|
|
9
9
|
import { C as CompositeList, u as useCompositeListItem } from "../../CompositeList-D4xmSZ5V.js";
|
|
10
|
-
import { c as contains, a as activeElement, g as getTarget } from "../../shadowDom-
|
|
10
|
+
import { c as contains, a as activeElement, g as getTarget } from "../../shadowDom-BfewIqRj.js";
|
|
11
11
|
import { u as useValueAsRef, a as addEventListener } from "../../useValueAsRef-BfFRcMg6.js";
|
|
12
12
|
import { u as useAnimationFrame } from "../../useAnimationFrame-DwhymJoW.js";
|
|
13
13
|
import { u as useDirection } from "../../DirectionContext-Pb9yafF5.js";
|
|
14
14
|
import { a as visuallyHidden } from "../../visuallyHidden-B6H2X3_Y.js";
|
|
15
|
-
import { C as COMPOSITE_KEYS, H as HOME, E as END, P as PAGE_DOWN, a as PAGE_UP, A as ARROW_LEFT, b as ARROW_DOWN, c as ARROW_RIGHT, d as ARROW_UP } from "../../composite-
|
|
15
|
+
import { C as COMPOSITE_KEYS, H as HOME, E as END, P as PAGE_DOWN, a as PAGE_UP, A as ARROW_LEFT, b as ARROW_DOWN, c as ARROW_RIGHT, d as ARROW_UP } from "../../composite-C22yiNy1.js";
|
|
16
16
|
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
17
17
|
return Math.max(min, Math.min(val, max));
|
|
18
18
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { type IconProp } from '../../components/atoms/IconProvider';
|
|
4
|
+
import { type AlertAction } from './Alert';
|
|
5
|
+
export type ToastTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
6
|
+
export type ToastAppearance = 'surface' | 'tinted' | 'inverse';
|
|
7
|
+
export type ToastLayout = 'standard' | 'compact';
|
|
8
|
+
declare const toastVariants: (props?: ({
|
|
9
|
+
appearance?: "inverse" | "surface" | "tinted" | null | undefined;
|
|
10
|
+
tone?: "info" | "warning" | "neutral" | "success" | "error" | null | undefined;
|
|
11
|
+
layout?: "compact" | "standard" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
declare const remainingClasses: {
|
|
14
|
+
readonly 0: "w-0";
|
|
15
|
+
readonly 0.25: "w-1/4";
|
|
16
|
+
readonly 0.5: "w-1/2";
|
|
17
|
+
readonly 0.75: "w-3/4";
|
|
18
|
+
readonly 1: "w-full";
|
|
19
|
+
};
|
|
20
|
+
export type ToastTimerProps = React.ComponentProps<'div'> & {
|
|
21
|
+
tone?: ToastTone;
|
|
22
|
+
appearance?: ToastAppearance;
|
|
23
|
+
duration?: number;
|
|
24
|
+
paused?: boolean;
|
|
25
|
+
remaining?: keyof typeof remainingClasses;
|
|
26
|
+
};
|
|
27
|
+
declare function ToastTimer({ ref, tone, appearance, duration, paused, remaining, className, ...props }: ToastTimerProps): React.JSX.Element;
|
|
28
|
+
export type ToastRawError = {
|
|
29
|
+
label?: React.ReactNode;
|
|
30
|
+
hideLabel?: React.ReactNode;
|
|
31
|
+
expanded?: boolean;
|
|
32
|
+
defaultExpanded?: boolean;
|
|
33
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
34
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
35
|
+
};
|
|
36
|
+
export type ToastPager = {
|
|
37
|
+
index: number;
|
|
38
|
+
total: number;
|
|
39
|
+
onPrevious?: () => void;
|
|
40
|
+
onNext?: () => void;
|
|
41
|
+
};
|
|
42
|
+
export type ToastProps = Omit<React.ComponentProps<'div'>, 'title'> & VariantProps<typeof toastVariants> & {
|
|
43
|
+
appearance?: ToastAppearance;
|
|
44
|
+
tone?: ToastTone;
|
|
45
|
+
layout?: ToastLayout;
|
|
46
|
+
title?: React.ReactNode;
|
|
47
|
+
description?: React.ReactNode;
|
|
48
|
+
icon?: IconProp | false;
|
|
49
|
+
iconSize?: 16 | 24;
|
|
50
|
+
action?: AlertAction;
|
|
51
|
+
secondaryAction?: AlertAction;
|
|
52
|
+
timer?: boolean;
|
|
53
|
+
duration?: number;
|
|
54
|
+
paused?: boolean;
|
|
55
|
+
onDismiss?: () => void;
|
|
56
|
+
dismissLabel?: string;
|
|
57
|
+
onCopy?: () => void;
|
|
58
|
+
copyLabel?: string;
|
|
59
|
+
copiedLabel?: string;
|
|
60
|
+
rawError?: ToastRawError;
|
|
61
|
+
code?: string;
|
|
62
|
+
codeLanguage?: string;
|
|
63
|
+
pager?: ToastPager;
|
|
64
|
+
live?: boolean;
|
|
65
|
+
open?: boolean;
|
|
66
|
+
onExitComplete?: () => void;
|
|
67
|
+
dataTestPrefix?: string;
|
|
68
|
+
};
|
|
69
|
+
declare function Toast({ ref, appearance, tone, layout, title, description, icon, iconSize, action, secondaryAction, timer, duration, paused, onDismiss, dismissLabel, onCopy, copyLabel, copiedLabel, rawError, code, codeLanguage, pager, live, open, onExitComplete, dataTestPrefix, role, className, ...props }: ToastProps): React.JSX.Element;
|
|
70
|
+
export type ToastStackProps = Omit<ToastProps, 'pager'> & {
|
|
71
|
+
placement?: 'side' | 'footer';
|
|
72
|
+
index: number;
|
|
73
|
+
total: number;
|
|
74
|
+
onPrevious?: () => void;
|
|
75
|
+
onNext?: () => void;
|
|
76
|
+
};
|
|
77
|
+
declare function ToastStack({ placement, index, total, onPrevious, onNext, className, ...toastProps }: ToastStackProps): React.JSX.Element;
|
|
78
|
+
export { ToastStack, ToastTimer, toastVariants };
|
|
79
|
+
export default Toast;
|