@eifi1/ui-kit 0.8.1 → 0.10.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/README.md +25 -11
- package/dist/components/alert-banner.d.ts +32 -5
- package/dist/components/alert-banner.js +57 -14
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +6 -0
- package/dist/components/breadcrumbs.d.ts +60 -0
- package/dist/components/breadcrumbs.js +88 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/bulk-action-bar.d.ts +66 -0
- package/dist/components/bulk-action-bar.js +149 -0
- package/dist/components/bulk-action-bar.js.map +1 -0
- package/dist/components/calculator.d.ts +6 -0
- package/dist/components/chip.d.ts +58 -10
- package/dist/components/chip.js +91 -7
- package/dist/components/chip.js.map +1 -1
- package/dist/components/copy-button.d.ts +13 -4
- package/dist/components/copy-button.js +17 -4
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +122 -91
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.d.ts +89 -3
- package/dist/components/date-picker.js +163 -68
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/description-list.d.ts +43 -6
- package/dist/components/description-list.js +91 -11
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +7 -0
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/disclosure.d.ts +68 -4
- package/dist/components/disclosure.js +33 -15
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/file-dropzone.d.ts +3 -4
- package/dist/components/file-dropzone.js +2 -1
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/floating-panel.d.ts +29 -2
- package/dist/components/floating-panel.js +16 -2
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/full-bleed-dialog.d.ts +23 -4
- package/dist/components/full-bleed-dialog.js +11 -2
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/list.d.ts +174 -0
- package/dist/components/list.js +215 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/menu-item.d.ts +99 -0
- package/dist/components/menu-item.js +83 -0
- package/dist/components/menu-item.js.map +1 -0
- package/dist/components/modal.d.ts +23 -1
- package/dist/components/modal.js +36 -10
- package/dist/components/modal.js.map +1 -1
- package/dist/components/number-field.d.ts +6 -0
- package/dist/components/number-input.d.ts +6 -0
- package/dist/components/numpad-sheet.d.ts +6 -0
- package/dist/components/page-contents.js +1 -2
- package/dist/components/page-contents.js.map +1 -1
- package/dist/components/page-header.d.ts +37 -0
- package/dist/components/page-header.js +36 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/progress-bar.d.ts +16 -2
- package/dist/components/progress-bar.js +4 -2
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/series-chart-labels.d.ts +3 -0
- package/dist/components/series-chart-labels.js +2 -1
- package/dist/components/series-chart-labels.js.map +1 -1
- package/dist/components/series-chart.d.ts +16 -0
- package/dist/components/series-chart.js +137 -3
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/status-dot.d.ts +49 -0
- package/dist/components/status-dot.js +52 -0
- package/dist/components/status-dot.js.map +1 -0
- package/dist/components/table.d.ts +39 -6
- package/dist/components/table.js +43 -4
- package/dist/components/table.js.map +1 -1
- package/dist/components/text.d.ts +63 -0
- package/dist/components/text.js +23 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/toast.d.ts +167 -0
- package/dist/components/toast.js +226 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toggle-group.d.ts +29 -1
- package/dist/components/toggle-group.js +52 -3
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/tooltip.d.ts +38 -15
- package/dist/components/tooltip.js +85 -47
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/ui.d.ts +139 -16
- package/dist/components/ui.js +136 -26
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +1 -1
- package/dist/{data-table-filters-CF1PXqjQ.d.ts → data-table-filters-Dh9uF_S-.d.ts} +33 -2
- package/dist/data-table.d.ts +1 -1
- package/dist/hooks/use-close-transition.d.ts +7 -1
- package/dist/hooks/use-close-transition.js +5 -2
- package/dist/hooks/use-close-transition.js.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -1
- package/dist/hooks/use-overlay-history.js +84 -4
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/i18n/defaults.d.ts +6 -0
- package/dist/i18n/defaults.js +11 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +11 -0
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/de-CH-informal.d.ts +6 -0
- package/dist/i18n/locales/de-CH.d.ts +6 -0
- package/dist/i18n/locales/de-informal.d.ts +6 -0
- package/dist/i18n/locales/de.d.ts +6 -0
- package/dist/i18n/locales/de.js +31 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +6 -0
- package/dist/i18n/locales/es.js +31 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +6 -0
- package/dist/i18n/locales/fr.js +31 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +6 -0
- package/dist/i18n/locales/hu.js +31 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +6 -0
- package/dist/i18n/locales/it.js +31 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +6 -0
- package/dist/i18n/locales/zh.js +31 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/clipping.d.ts +9 -0
- package/dist/lib/clipping.js +14 -0
- package/dist/lib/clipping.js.map +1 -0
- package/dist/search/command-palette.d.ts +67 -2
- package/dist/search/command-palette.js +147 -33
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search/global-search.d.ts +166 -0
- package/dist/search/global-search.js +293 -0
- package/dist/search/global-search.js.map +1 -0
- package/dist/search/search-index.d.ts +105 -0
- package/dist/search/search-index.js +142 -0
- package/dist/search/search-index.js.map +1 -0
- package/dist/search.d.ts +3 -1
- package/dist/search.js +2 -0
- package/dist/search.js.map +1 -1
- package/dist/wizard/stepper-nav.d.ts +10 -1
- package/dist/wizard/stepper-nav.js +3 -2
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.d.ts +2 -2
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.js +1 -1
- package/dist/wizard/use-wizard.js.map +1 -1
- package/dist/wizard/wizard-summary.js +3 -3
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/package.json +25 -12
- package/src/components/alert-banner.tsx +117 -18
- package/src/components/breadcrumbs.tsx +168 -0
- package/src/components/bulk-action-bar.tsx +256 -0
- package/src/components/chip.tsx +164 -13
- package/src/components/copy-button.tsx +29 -7
- package/src/components/data-table.tsx +81 -5
- package/src/components/date-picker.tsx +377 -118
- package/src/components/description-list.tsx +168 -15
- package/src/components/dialog-frame.tsx +7 -0
- package/src/components/disclosure.tsx +116 -28
- package/src/components/file-dropzone.tsx +9 -10
- package/src/components/floating-panel.tsx +46 -2
- package/src/components/full-bleed-dialog.tsx +42 -5
- package/src/components/list.tsx +417 -0
- package/src/components/menu-item.tsx +214 -0
- package/src/components/modal.tsx +80 -17
- package/src/components/page-contents.tsx +4 -4
- package/src/components/page-header.tsx +68 -0
- package/src/components/progress-bar.tsx +27 -3
- package/src/components/series-chart-labels.ts +4 -0
- package/src/components/series-chart.tsx +253 -3
- package/src/components/status-dot.tsx +99 -0
- package/src/components/table.tsx +91 -6
- package/src/components/text.tsx +89 -0
- package/src/components/toast.tsx +441 -0
- package/src/components/toggle-group.tsx +82 -3
- package/src/components/tooltip.tsx +186 -100
- package/src/components/ui.tsx +321 -41
- package/src/hooks/use-close-transition.ts +14 -5
- package/src/hooks/use-copy-to-clipboard.ts +1 -1
- package/src/hooks/use-overlay-history.ts +181 -4
- package/src/i18n/defaults.ts +10 -0
- package/src/i18n/kit-labels.tsx +10 -0
- package/src/i18n/locales/de.ts +30 -0
- package/src/i18n/locales/es.ts +30 -0
- package/src/i18n/locales/fr.ts +30 -0
- package/src/i18n/locales/hu.ts +30 -0
- package/src/i18n/locales/it.ts +30 -0
- package/src/i18n/locales/zh.ts +30 -0
- package/src/index.ts +30 -0
- package/src/lib/clipping.ts +16 -0
- package/src/search/command-palette.tsx +241 -31
- package/src/search/global-search.tsx +525 -0
- package/src/search/search-index.ts +295 -0
- package/src/search.ts +2 -0
- package/src/wizard/stepper-nav.tsx +13 -2
- package/src/wizard/types.ts +2 -2
- package/src/wizard/use-wizard.ts +3 -3
- package/src/wizard/wizard-summary.tsx +14 -10
- package/tokens.css +97 -0
package/dist/components/ui.js
CHANGED
|
@@ -27,15 +27,48 @@ const buttonVariantClasses = {
|
|
|
27
27
|
// ring hugging the word instead of drawing a pill round it.
|
|
28
28
|
link: "rounded-sm p-0 bg-transparent text-[var(--brand)] underline-offset-4 hover:underline focus:ring-[var(--brand)]"
|
|
29
29
|
};
|
|
30
|
+
const BUTTON_TONES = {
|
|
31
|
+
muted: "text-[var(--text-secondary)] hover:text-[var(--text-primary)] disabled:hover:text-[var(--text-secondary)]",
|
|
32
|
+
danger: "text-[var(--text-secondary)] hover:text-[var(--danger)] focus:ring-[var(--danger-border)] disabled:hover:text-[var(--text-secondary)]"
|
|
33
|
+
};
|
|
34
|
+
const TONED_VARIANTS = /* @__PURE__ */ new Set(["link", "ghost"]);
|
|
35
|
+
const BUTTON_LINK_PRESSED = "font-medium text-[var(--brand)] hover:text-[var(--brand)] disabled:hover:text-[var(--brand)]";
|
|
30
36
|
function buttonClasses(variant = "primary", classNameOrOptions) {
|
|
31
37
|
const { size = "md", className } = typeof classNameOrOptions === "object" ? classNameOrOptions : { className: classNameOrOptions };
|
|
32
38
|
return cn(BUTTON_BASE, BUTTON_SIZES[size], buttonVariantClasses[variant], className);
|
|
33
39
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
40
|
+
function hasContent(node) {
|
|
41
|
+
return node !== void 0 && node !== null && node !== false && node !== "";
|
|
42
|
+
}
|
|
43
|
+
function Button({
|
|
44
|
+
variant = "primary",
|
|
45
|
+
size = "md",
|
|
46
|
+
stretch,
|
|
47
|
+
tone = "default",
|
|
48
|
+
pressed,
|
|
49
|
+
disabledReason,
|
|
50
|
+
className,
|
|
51
|
+
onClick,
|
|
52
|
+
...rest
|
|
53
|
+
}) {
|
|
54
|
+
const reasonId = useId();
|
|
55
|
+
const locked = hasContent(disabledReason);
|
|
56
|
+
const ownDescribedBy = rest["aria-describedby"];
|
|
57
|
+
const button = /* @__PURE__ */ jsx(
|
|
36
58
|
"button",
|
|
37
59
|
{
|
|
38
60
|
...rest,
|
|
61
|
+
disabled: locked ? void 0 : rest.disabled,
|
|
62
|
+
"aria-disabled": locked || rest["aria-disabled"],
|
|
63
|
+
"aria-describedby": locked ? ownDescribedBy ? `${ownDescribedBy} ${reasonId}` : reasonId : ownDescribedBy,
|
|
64
|
+
"aria-pressed": pressed ?? rest["aria-pressed"],
|
|
65
|
+
onClick: (e) => {
|
|
66
|
+
if (locked) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
onClick?.(e);
|
|
71
|
+
},
|
|
39
72
|
className: cn(
|
|
40
73
|
BUTTON_BASE,
|
|
41
74
|
BUTTON_SIZES[size],
|
|
@@ -44,10 +77,25 @@ function Button({ variant = "primary", size = "md", stretch, className, ...rest
|
|
|
44
77
|
// align-items). No effect outside a flex row / when it's already the tallest.
|
|
45
78
|
stretch && "self-stretch",
|
|
46
79
|
buttonVariantClasses[variant],
|
|
80
|
+
tone !== "default" && TONED_VARIANTS.has(variant) && BUTTON_TONES[tone],
|
|
81
|
+
pressed && (variant === "link" ? BUTTON_LINK_PRESSED : ICON_BUTTON_PRESSED),
|
|
82
|
+
// The disabled look for the focusable kind of disabled.
|
|
83
|
+
locked && "cursor-not-allowed opacity-50",
|
|
47
84
|
className
|
|
48
85
|
)
|
|
49
86
|
}
|
|
50
87
|
);
|
|
88
|
+
if (!locked) return button;
|
|
89
|
+
return (
|
|
90
|
+
// The button in a FRAGMENT so Tooltip does not clone its bubble into the
|
|
91
|
+
// description as well — the hidden copy below already describes it, and the same
|
|
92
|
+
// sentence twice would be read on every focus. `stretch` moves to the wrapper,
|
|
93
|
+
// which is now the flex item.
|
|
94
|
+
/* @__PURE__ */ jsx(Tooltip, { label: disabledReason, className: stretch ? "self-stretch" : void 0, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
|
+
button,
|
|
96
|
+
/* @__PURE__ */ jsx("span", { id: reasonId, hidden: true, children: disabledReason })
|
|
97
|
+
] }) })
|
|
98
|
+
);
|
|
51
99
|
}
|
|
52
100
|
const ICON_BUTTON_BASE = "inline-flex items-center justify-center rounded-md transition-colors focus:outline-none focus:ring-2 disabled:opacity-50 disabled:cursor-not-allowed";
|
|
53
101
|
const ICON_BUTTON_SIZES = {
|
|
@@ -60,19 +108,28 @@ const ICON_BUTTON_SIZES = {
|
|
|
60
108
|
"2xs": "size-6 rounded [&_svg]:size-3.5"
|
|
61
109
|
};
|
|
62
110
|
const ICON_BUTTON_TONES = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
111
|
+
danger: {
|
|
112
|
+
quiet: "text-[var(--text-placeholder)] hover:bg-[var(--danger-bg)] hover:text-[var(--danger)] focus:ring-[var(--danger-border)]",
|
|
113
|
+
toned: "text-[var(--danger)] hover:bg-[var(--danger-bg)] focus:ring-[var(--danger-border)]"
|
|
114
|
+
},
|
|
115
|
+
warning: {
|
|
116
|
+
quiet: "text-[var(--text-placeholder)] hover:bg-[var(--warning-bg)] hover:text-[var(--warning)] focus:ring-[var(--warning-border)]",
|
|
117
|
+
toned: "text-[var(--warning)] hover:bg-[var(--warning-bg)] focus:ring-[var(--warning-border)]"
|
|
118
|
+
},
|
|
119
|
+
info: {
|
|
120
|
+
quiet: "text-[var(--text-placeholder)] hover:bg-[var(--info-bg)] hover:text-[var(--info)] focus:ring-[var(--info-border)]",
|
|
121
|
+
toned: "text-[var(--info)] hover:bg-[var(--info-bg)] focus:ring-[var(--info-border)]"
|
|
122
|
+
}
|
|
75
123
|
};
|
|
124
|
+
const ICON_BUTTON_MUTED = "text-[var(--text-placeholder)] hover:bg-[var(--bg-surface-2)] hover:text-[var(--text-primary)]";
|
|
125
|
+
const QUIET_BY_DEFAULT = { danger: true, warning: false, info: false };
|
|
126
|
+
function iconButtonToneClass(tone, quiet) {
|
|
127
|
+
if (tone === "default") return "";
|
|
128
|
+
if (tone === "muted") return cn(ICON_BUTTON_MUTED, ICON_BUTTON_QUIET_DISABLED_REST);
|
|
129
|
+
const isQuiet = quiet ?? QUIET_BY_DEFAULT[tone];
|
|
130
|
+
const look = ICON_BUTTON_TONES[tone];
|
|
131
|
+
return isQuiet ? cn(look.quiet, ICON_BUTTON_QUIET_DISABLED_REST) : look.toned;
|
|
132
|
+
}
|
|
76
133
|
const ICON_BUTTON_DISABLED_REST = {
|
|
77
134
|
primary: "disabled:hover:bg-[var(--bg-surface-2)]",
|
|
78
135
|
secondary: "disabled:hover:bg-transparent",
|
|
@@ -82,18 +139,31 @@ const ICON_BUTTON_DISABLED_REST = {
|
|
|
82
139
|
link: "disabled:hover:bg-transparent disabled:hover:no-underline",
|
|
83
140
|
overlay: "disabled:hover:bg-[color-mix(in_srgb,var(--bg-inverse)_60%,transparent)]"
|
|
84
141
|
};
|
|
85
|
-
const
|
|
86
|
-
muted: "disabled:hover:text-[var(--text-placeholder)]",
|
|
87
|
-
danger: "disabled:hover:text-[var(--text-placeholder)]"
|
|
88
|
-
};
|
|
142
|
+
const ICON_BUTTON_QUIET_DISABLED_REST = "disabled:hover:text-[var(--text-placeholder)]";
|
|
89
143
|
const ICON_BUTTON_PRESSED = "bg-[var(--brand-bg)] text-[var(--brand)] hover:bg-[var(--brand-bg-hover)] hover:text-[var(--brand)] disabled:hover:bg-[var(--brand-bg)] disabled:hover:text-[var(--brand)]";
|
|
90
144
|
const ICON_BUTTON_OVERLAY = "rounded-full bg-[color-mix(in_srgb,var(--bg-inverse)_60%,transparent)] text-[var(--text-inverse)] backdrop-blur-sm hover:bg-[color-mix(in_srgb,var(--bg-inverse)_75%,transparent)] focus:ring-[var(--text-inverse)]";
|
|
91
|
-
const IconButton = forwardRef(function IconButton2({
|
|
92
|
-
|
|
145
|
+
const IconButton = forwardRef(function IconButton2({
|
|
146
|
+
variant = "ghost",
|
|
147
|
+
size = "md",
|
|
148
|
+
tone = "default",
|
|
149
|
+
quiet,
|
|
150
|
+
pressed,
|
|
151
|
+
stopPropagation,
|
|
152
|
+
label,
|
|
153
|
+
tooltip = true,
|
|
154
|
+
tooltipSide,
|
|
155
|
+
tooltipPortal,
|
|
156
|
+
className,
|
|
157
|
+
onClick,
|
|
158
|
+
onKeyDown,
|
|
159
|
+
...rest
|
|
160
|
+
}, ref) {
|
|
161
|
+
const button = /* @__PURE__ */ jsx(
|
|
93
162
|
"button",
|
|
94
163
|
{
|
|
95
164
|
ref,
|
|
96
165
|
...rest,
|
|
166
|
+
"aria-label": rest["aria-label"] ?? label,
|
|
97
167
|
"aria-pressed": pressed ?? rest["aria-pressed"],
|
|
98
168
|
onClick: (e) => {
|
|
99
169
|
if (stopPropagation) e.stopPropagation();
|
|
@@ -109,13 +179,18 @@ const IconButton = forwardRef(function IconButton2({ variant = "ghost", size = "
|
|
|
109
179
|
// After the size, so the overlay's `rounded-full` beats the small sizes' `rounded`.
|
|
110
180
|
variant === "overlay" ? ICON_BUTTON_OVERLAY : buttonVariantClasses[variant],
|
|
111
181
|
ICON_BUTTON_DISABLED_REST[variant],
|
|
112
|
-
|
|
113
|
-
ICON_BUTTON_TONES_DISABLED_REST[tone],
|
|
182
|
+
iconButtonToneClass(tone, quiet),
|
|
114
183
|
pressed && ICON_BUTTON_PRESSED,
|
|
115
184
|
className
|
|
116
185
|
)
|
|
117
186
|
}
|
|
118
187
|
);
|
|
188
|
+
if (!tooltip || label === void 0 || label === "") return button;
|
|
189
|
+
return (
|
|
190
|
+
// A fragment, so Tooltip leaves the button's description alone: the bubble says
|
|
191
|
+
// exactly what `aria-label` already does.
|
|
192
|
+
/* @__PURE__ */ jsx(Tooltip, { label, side: tooltipSide, portal: tooltipPortal, children: /* @__PURE__ */ jsx(Fragment, { children: button }) })
|
|
193
|
+
);
|
|
119
194
|
});
|
|
120
195
|
IconButton.displayName = "IconButton";
|
|
121
196
|
const FIELD_BASE = "block w-full rounded-md border border-[var(--border)] bg-[var(--bg-surface)] px-3 py-2 text-sm text-[var(--text-primary)] shadow-sm placeholder:text-[var(--text-placeholder)] focus:border-[var(--brand)] focus:ring-[var(--brand)] disabled:cursor-default disabled:bg-[var(--bg-surface-2)] disabled:text-[var(--text-muted)] [&[readonly]]:bg-[var(--bg-surface-2)] [&[readonly]]:text-[var(--text-muted)]";
|
|
@@ -576,7 +651,42 @@ function Spinner({ className, label, ...rest }) {
|
|
|
576
651
|
" "
|
|
577
652
|
] }) });
|
|
578
653
|
}
|
|
579
|
-
|
|
654
|
+
const EMPTY_STATE_TONE = {
|
|
655
|
+
danger: "text-[var(--danger)]",
|
|
656
|
+
success: "text-[var(--success)]"
|
|
657
|
+
};
|
|
658
|
+
function EmptyState({
|
|
659
|
+
title,
|
|
660
|
+
hint,
|
|
661
|
+
icon,
|
|
662
|
+
action,
|
|
663
|
+
headingAs,
|
|
664
|
+
variant = "box",
|
|
665
|
+
tone,
|
|
666
|
+
className,
|
|
667
|
+
...rest
|
|
668
|
+
}) {
|
|
669
|
+
const Title = headingAs ?? "div";
|
|
670
|
+
const toneClass = tone ? EMPTY_STATE_TONE[tone] : void 0;
|
|
671
|
+
const hasHint = hint != null && hint !== false && hint !== "";
|
|
672
|
+
if (variant === "inline") {
|
|
673
|
+
return /* @__PURE__ */ jsxs(
|
|
674
|
+
"div",
|
|
675
|
+
{
|
|
676
|
+
...rest,
|
|
677
|
+
className: cn(
|
|
678
|
+
"flex flex-wrap items-center justify-center gap-x-2 gap-y-1 py-4 text-center text-sm text-[var(--text-muted)]",
|
|
679
|
+
className
|
|
680
|
+
),
|
|
681
|
+
children: [
|
|
682
|
+
icon != null && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("flex text-[var(--text-placeholder)] [&_svg]:size-4", toneClass), children: icon }),
|
|
683
|
+
/* @__PURE__ */ jsx(Title, { className: cn("text-sm", toneClass), children: title }),
|
|
684
|
+
hasHint && /* @__PURE__ */ jsx("span", { className: "text-xs", children: hint }),
|
|
685
|
+
action != null && /* @__PURE__ */ jsx("span", { className: "flex flex-wrap items-center gap-2", children: action })
|
|
686
|
+
]
|
|
687
|
+
}
|
|
688
|
+
);
|
|
689
|
+
}
|
|
580
690
|
return /* @__PURE__ */ jsxs(
|
|
581
691
|
"div",
|
|
582
692
|
{
|
|
@@ -586,9 +696,9 @@ function EmptyState({ title, hint, icon, action, className, ...rest }) {
|
|
|
586
696
|
className
|
|
587
697
|
),
|
|
588
698
|
children: [
|
|
589
|
-
icon != null && /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "mb-3 text-[var(--text-placeholder)] [&_svg]:size-8", children: icon }),
|
|
590
|
-
/* @__PURE__ */ jsx(
|
|
591
|
-
|
|
699
|
+
icon != null && /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: cn("mb-3 text-[var(--text-placeholder)] [&_svg]:size-8", toneClass), children: icon }),
|
|
700
|
+
/* @__PURE__ */ jsx(Title, { className: cn("text-sm font-medium text-[var(--text-secondary)]", toneClass), children: title }),
|
|
701
|
+
hasHint && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs", children: hint }),
|
|
592
702
|
action != null && /* @__PURE__ */ jsx("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: action })
|
|
593
703
|
]
|
|
594
704
|
}
|