@humain/ui 2.1.63 → 2.1.65
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/components/organisms/ai/AIToolCall/AIToolCall.d.ts +9 -3
- package/dist/components/organisms/ai/AIToolRun/index.d.ts +1 -1
- package/dist/components/organisms/ai/AIToolRun/validation.d.ts +24 -3
- package/dist/components/organisms/ai/_shared/format-ai-duration.d.ts +1 -0
- package/dist/components/organisms/ai/_shared/workflow-step-renderer.d.ts +1 -0
- package/dist/index.js +52 -52
- package/dist/index151.js +1 -1
- package/dist/index174.js +7 -339
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +310 -137
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +148 -174
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +186 -78
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +74 -124
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +133 -1
- package/dist/index179.js.map +1 -0
- package/dist/index180.js +2 -201
- package/dist/index181.js +201 -0
- package/dist/{index180.js.map → index181.js.map} +1 -1
- package/dist/index183.js +130 -166
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +195 -983
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +1069 -369
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +395 -197
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +198 -243
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +263 -3
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +3 -209
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +190 -777
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +771 -252
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +250 -65
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +72 -523
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +537 -144
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +139 -720
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +707 -167
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +175 -151
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +152 -487
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +472 -225
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +236 -260
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +265 -215
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +207 -307
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +302 -135
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +140 -271
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +263 -253
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +244 -137
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +100 -238
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +278 -74
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +56 -97
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +142 -47
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +38 -84
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +72 -252
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +274 -26
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +29 -94
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +98 -25
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +20 -565
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +564 -17
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +20 -23
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +20 -95
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +92 -88
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +97 -29
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +24 -470
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +446 -196
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +199 -729
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +750 -61
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +58 -181
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +175 -259
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +246 -172
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +195 -32
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +12 -40
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +23 -26
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +45 -22
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +27 -48
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +52 -26
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +40 -225
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +217 -39
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +50 -0
- package/dist/index237.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/wc/AIToolCall.js +218 -0
- package/dist/wc/AIToolCall.js.map +1 -0
- package/dist/wc/hf-ai-tool-call.js +34 -219
- package/dist/wc/hf-ai-tool-call.js.map +1 -1
- package/dist/wc/hf-ai-tool-run.js +673 -576
- package/dist/wc/hf-ai-tool-run.js.map +1 -1
- package/dist/wc/workflow-step-renderer.js +79 -78
- package/dist/wc/workflow-step-renderer.js.map +1 -1
- package/dist/wc-react/AIToolCall.js +218 -0
- package/dist/wc-react/AIToolCall.js.map +1 -0
- package/dist/wc-react/hf-ai-tool-call.js +32 -217
- package/dist/wc-react/hf-ai-tool-call.js.map +1 -1
- package/dist/wc-react/hf-ai-tool-run.js +698 -601
- package/dist/wc-react/hf-ai-tool-run.js.map +1 -1
- package/dist/wc-react/workflow-step-renderer.js +58 -57
- package/dist/wc-react/workflow-step-renderer.js.map +1 -1
- package/package.json +1 -1
- package/skills/humain-ui/SKILL.md +1 -1
- package/skills/humain-ui-wc/SKILL.md +1 -1
- package/skills/humain-ui-wc.skill +0 -0
- package/skills/humain-ui.skill +0 -0
- package/dist/index182.js +0 -143
- package/dist/index182.js.map +0 -1
- package/dist/wc/wrench.js +0 -10
- package/dist/wc/wrench.js.map +0 -1
- package/dist/wc-react/wrench.js +0 -10
- package/dist/wc-react/wrench.js.map +0 -1
package/dist/index194.js
CHANGED
|
@@ -1,153 +1,546 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { cn } from "./index2.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { Button } from "./index5.js";
|
|
3
|
+
import { FeaturedIcon } from "./index104.js";
|
|
4
|
+
import { FileTypeIcon } from "./index115.js";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { Heart, Search } from "lucide-react";
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
//#region src/components/organisms/content/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (maxLevels !== void 0 && grouping.length >= maxLevels) return;
|
|
39
|
-
const newGrouping = [...grouping, columnId];
|
|
40
|
-
table.setGrouping(newGrouping);
|
|
41
|
-
}
|
|
42
|
-
}, [
|
|
43
|
-
grouping,
|
|
44
|
-
table,
|
|
45
|
-
maxLevels
|
|
46
|
-
]);
|
|
47
|
-
const getSelectionOrder = (columnId) => {
|
|
48
|
-
const index = grouping.indexOf(columnId);
|
|
49
|
-
return index >= 0 ? index + 1 : null;
|
|
50
|
-
};
|
|
51
|
-
const availableColumns = React.useMemo(() => {
|
|
52
|
-
return allGroupableColumns.filter((col) => !grouping.includes(col.id));
|
|
53
|
-
}, [allGroupableColumns, grouping]);
|
|
54
|
-
const handleRemove = React.useCallback((columnId) => {
|
|
55
|
-
const newGrouping = grouping.filter((id) => id !== columnId);
|
|
56
|
-
table.setGrouping(newGrouping);
|
|
57
|
-
}, [grouping, table]);
|
|
58
|
-
const handleAddColumn = React.useCallback((columnId) => {
|
|
59
|
-
if (maxLevels !== void 0 && grouping.length >= maxLevels) return;
|
|
60
|
-
const newGrouping = [...grouping, columnId];
|
|
61
|
-
table.setGrouping(newGrouping);
|
|
62
|
-
setOpen(false);
|
|
63
|
-
}, [
|
|
64
|
-
grouping,
|
|
65
|
-
table,
|
|
66
|
-
maxLevels
|
|
67
|
-
]);
|
|
68
|
-
if (variant === "chips") {
|
|
69
|
-
const addColumnPopover = availableColumns.length > 0 && !isMaxLevelsReached ? /* @__PURE__ */ jsxs(Popover, {
|
|
70
|
-
open,
|
|
71
|
-
onOpenChange: setOpen,
|
|
72
|
-
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
73
|
-
className: cn("inline-flex items-center justify-center rounded-md", "border border-dashed border-input bg-background", "hover:bg-accent hover:border-solid", "transition-[background-color,border-color] duration-150 ease-out motion-reduce:transition-none", size === "sm" ? "h-6 px-2 text-xs" : "h-7 px-2 text-sm"),
|
|
74
|
-
"aria-label": "Add grouping",
|
|
75
|
-
children: /* @__PURE__ */ jsx(Plus, { className: cn("size-3.5 transition-transform duration-200 motion-reduce:transition-none", open && "rotate-45") })
|
|
76
|
-
}), /* @__PURE__ */ jsx(PopoverPopup, {
|
|
77
|
-
side: "bottom",
|
|
78
|
-
align: "start",
|
|
79
|
-
className: "min-w-[180px] w-max max-w-[280px] p-0",
|
|
80
|
-
children: /* @__PURE__ */ jsx(CommandNamespace, { children: /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No columns available" }), /* @__PURE__ */ jsx(CommandGroup, { children: availableColumns.map((column) => /* @__PURE__ */ jsx(CommandItem, {
|
|
81
|
-
value: column.id,
|
|
82
|
-
onSelect: () => handleAddColumn(column.id),
|
|
83
|
-
className: "cursor-pointer",
|
|
84
|
-
children: column.label
|
|
85
|
-
}, column.id)) })] }) })
|
|
86
|
-
})]
|
|
87
|
-
}) : null;
|
|
88
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
89
|
-
"data-slot": "grouping-controls",
|
|
90
|
-
role: "toolbar",
|
|
91
|
-
"aria-label": "Grouping controls",
|
|
92
|
-
className: cn("flex flex-wrap items-center gap-2", className),
|
|
93
|
-
children: [grouping.length === 0 ? /* @__PURE__ */ jsx("span", {
|
|
94
|
-
className: "text-sm text-muted-foreground",
|
|
95
|
-
children: placeholder
|
|
96
|
-
}) : grouping.map((columnId) => {
|
|
97
|
-
const column = allGroupableColumns.find((c) => c.id === columnId);
|
|
98
|
-
if (!column) return null;
|
|
99
|
-
return /* @__PURE__ */ jsx(Tag$1, {
|
|
100
|
-
size: size === "sm" ? "sm" : "md",
|
|
101
|
-
removable: true,
|
|
102
|
-
onRemove: () => handleRemove(columnId),
|
|
103
|
-
children: column.label
|
|
104
|
-
}, columnId);
|
|
105
|
-
}), addColumnPopover]
|
|
106
|
-
});
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/organisms/content/EmptyState/EmptyState.tsx
|
|
10
|
+
var patternSizeClass = {
|
|
11
|
+
sm: "size-[336px]",
|
|
12
|
+
md: "size-[480px]",
|
|
13
|
+
lg: "size-[768px]"
|
|
14
|
+
};
|
|
15
|
+
var patternGridSize = {
|
|
16
|
+
sm: "24px 24px",
|
|
17
|
+
md: "32px 32px",
|
|
18
|
+
lg: "48px 48px"
|
|
19
|
+
};
|
|
20
|
+
var illustrationSizeClass = {
|
|
21
|
+
sm: {
|
|
22
|
+
cloud: "h-[118px] w-[152px]",
|
|
23
|
+
box: "h-[124px] w-[152px]",
|
|
24
|
+
documents: "h-[118px] w-[152px]",
|
|
25
|
+
"credit-card": "h-[118px] w-[152px]"
|
|
26
|
+
},
|
|
27
|
+
md: {
|
|
28
|
+
cloud: "h-32 w-[172px]",
|
|
29
|
+
box: "h-[136px] w-[172px]",
|
|
30
|
+
documents: "h-32 w-[172px]",
|
|
31
|
+
"credit-card": "h-[134px] w-[172px]"
|
|
32
|
+
},
|
|
33
|
+
lg: {
|
|
34
|
+
cloud: "h-40 w-[220px]",
|
|
35
|
+
box: "h-[168px] w-[220px]",
|
|
36
|
+
documents: "h-40 w-[220px]",
|
|
37
|
+
"credit-card": "h-40 w-[220px]"
|
|
107
38
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
39
|
+
};
|
|
40
|
+
var illustrationIconSizeClass = {
|
|
41
|
+
sm: "p-2",
|
|
42
|
+
md: "p-2.5",
|
|
43
|
+
lg: "p-2.5"
|
|
44
|
+
};
|
|
45
|
+
var iconGlyphSizeClass = {
|
|
46
|
+
sm: "size-4",
|
|
47
|
+
md: "size-4",
|
|
48
|
+
lg: "size-5"
|
|
49
|
+
};
|
|
50
|
+
var illustrationIconCenterClass = {
|
|
51
|
+
cloud: "top-[58%]",
|
|
52
|
+
box: "top-[58%]",
|
|
53
|
+
documents: "top-[60%]",
|
|
54
|
+
"credit-card": "top-[60%]"
|
|
55
|
+
};
|
|
56
|
+
var illustrationCircleSizeClass = {
|
|
57
|
+
sm: "size-[104px]",
|
|
58
|
+
md: "size-32",
|
|
59
|
+
lg: "size-40"
|
|
60
|
+
};
|
|
61
|
+
var fileIconWrapSizeClass = {
|
|
62
|
+
sm: "size-20",
|
|
63
|
+
md: "size-24",
|
|
64
|
+
lg: "size-28"
|
|
65
|
+
};
|
|
66
|
+
var textGapClass = {
|
|
67
|
+
sm: "gap-1",
|
|
68
|
+
md: "gap-2",
|
|
69
|
+
lg: "gap-2"
|
|
70
|
+
};
|
|
71
|
+
var mediaGapClass = {
|
|
72
|
+
sm: "gap-4",
|
|
73
|
+
md: "gap-5",
|
|
74
|
+
lg: "gap-5"
|
|
75
|
+
};
|
|
76
|
+
var contentGapClass = {
|
|
77
|
+
sm: "gap-6",
|
|
78
|
+
md: "gap-8",
|
|
79
|
+
lg: "gap-8"
|
|
80
|
+
};
|
|
81
|
+
var featuredIconSize = {
|
|
82
|
+
sm: "sm",
|
|
83
|
+
md: "md",
|
|
84
|
+
lg: "lg"
|
|
85
|
+
};
|
|
86
|
+
var fileIconSize = {
|
|
87
|
+
sm: "md",
|
|
88
|
+
md: "md",
|
|
89
|
+
lg: "md"
|
|
90
|
+
};
|
|
91
|
+
var headingTag = {
|
|
92
|
+
2: "h2",
|
|
93
|
+
3: "h3",
|
|
94
|
+
4: "h4"
|
|
95
|
+
};
|
|
96
|
+
function EmptyStateIconGlyph({ icon, size }) {
|
|
97
|
+
return /* @__PURE__ */ jsx("span", {
|
|
98
|
+
"data-slot": "empty-state-icon-glyph",
|
|
99
|
+
"data-testid": "empty-state-icon-glyph",
|
|
100
|
+
"data-centered": "true",
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
className: cn("inline-flex shrink-0 items-center justify-center leading-none [line-height:0] [&>svg]:block [&>svg]:size-full [&>svg]:shrink-0", iconGlyphSizeClass[size]),
|
|
103
|
+
children: icon
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
var gridPatternStyle = (size, dot = false) => ({
|
|
107
|
+
backgroundImage: dot ? "radial-gradient(circle, color-mix(in oklch, var(--border) 70%, transparent) 1px, transparent 1px)" : ["linear-gradient(to right, color-mix(in oklch, var(--border) 54%, transparent) 1px, transparent 1px)", "linear-gradient(to bottom, color-mix(in oklch, var(--border) 54%, transparent) 1px, transparent 1px)"].join(", "),
|
|
108
|
+
backgroundSize: patternGridSize[size]
|
|
109
|
+
});
|
|
110
|
+
var squaresBySize = {
|
|
111
|
+
sm: [
|
|
112
|
+
96,
|
|
113
|
+
144,
|
|
114
|
+
192,
|
|
115
|
+
240,
|
|
116
|
+
288,
|
|
117
|
+
336
|
|
118
|
+
],
|
|
119
|
+
md: [
|
|
120
|
+
96,
|
|
121
|
+
160,
|
|
122
|
+
224,
|
|
123
|
+
288,
|
|
124
|
+
352,
|
|
125
|
+
416,
|
|
126
|
+
480
|
|
127
|
+
],
|
|
128
|
+
lg: [
|
|
129
|
+
96,
|
|
130
|
+
192,
|
|
131
|
+
288,
|
|
132
|
+
384,
|
|
133
|
+
480,
|
|
134
|
+
576,
|
|
135
|
+
672,
|
|
136
|
+
768
|
|
137
|
+
]
|
|
138
|
+
};
|
|
139
|
+
var EmptyStateBackgroundPattern = React.forwardRef(({ className, size = "sm", variant = "circles", style, ...props }, ref) => {
|
|
140
|
+
if (variant === "none") return null;
|
|
141
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
142
|
+
ref,
|
|
143
|
+
"data-slot": "empty-state-background-pattern",
|
|
144
|
+
"data-testid": "empty-state-pattern",
|
|
145
|
+
"data-size": size,
|
|
146
|
+
"data-variant": variant,
|
|
147
|
+
"aria-hidden": "true",
|
|
148
|
+
className: cn("pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-hidden opacity-75", patternSizeClass[size], className),
|
|
149
|
+
style,
|
|
150
|
+
...props,
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[radial-gradient(circle_at_center,var(--background)_0%,transparent_68%)]" }),
|
|
153
|
+
variant === "circles" && /* @__PURE__ */ jsx("div", {
|
|
154
|
+
className: "absolute inset-0",
|
|
155
|
+
children: Array.from({ length: 7 }, (_, index) => /* @__PURE__ */ jsx("span", {
|
|
156
|
+
className: "absolute left-1/2 top-1/2 rounded-full border border-border/60",
|
|
157
|
+
style: {
|
|
158
|
+
width: `${(index + 1) * 14}%`,
|
|
159
|
+
height: `${(index + 1) * 14}%`,
|
|
160
|
+
transform: "translate(-50%, -50%)"
|
|
161
|
+
}
|
|
162
|
+
}, index))
|
|
163
|
+
}),
|
|
164
|
+
(variant === "grid" || variant === "grid-dot") && /* @__PURE__ */ jsx("div", {
|
|
165
|
+
className: "absolute inset-0 opacity-70 [mask-image:radial-gradient(circle_at_center,black_0%,black_48%,transparent_76%)]",
|
|
166
|
+
style: gridPatternStyle(size, variant === "grid-dot")
|
|
167
|
+
}),
|
|
168
|
+
variant === "squares" && /* @__PURE__ */ jsx("div", {
|
|
169
|
+
className: "absolute inset-0",
|
|
170
|
+
children: squaresBySize[size].map((squareSize) => /* @__PURE__ */ jsx("span", {
|
|
171
|
+
className: "absolute left-1/2 top-1/2 rounded-xl border border-border/55",
|
|
172
|
+
style: {
|
|
173
|
+
width: squareSize,
|
|
174
|
+
height: squareSize,
|
|
175
|
+
transform: "translate(-50%, -50%) rotate(-12.5deg)"
|
|
176
|
+
}
|
|
177
|
+
}, squareSize))
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
EmptyStateBackgroundPattern.displayName = "EmptyStateBackgroundPattern";
|
|
183
|
+
function DecorativeDots({ tone }) {
|
|
184
|
+
const dotClassName = tone === "primary" ? "bg-primary/70" : "bg-muted-foreground/10";
|
|
185
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
186
|
+
/* @__PURE__ */ jsx("span", { className: cn("absolute left-[7%] top-[8%] size-2 rounded-full", dotClassName) }),
|
|
187
|
+
/* @__PURE__ */ jsx("span", { className: cn("absolute right-[6%] top-[18%] size-3 rounded-full", dotClassName) }),
|
|
188
|
+
/* @__PURE__ */ jsx("span", { className: cn("absolute bottom-[10%] left-[8%] size-3 rounded-full", dotClassName) }),
|
|
189
|
+
/* @__PURE__ */ jsx("span", { className: cn("absolute bottom-[18%] right-[13%] size-2 rounded-full", dotClassName) })
|
|
190
|
+
] });
|
|
191
|
+
}
|
|
192
|
+
function CloudShape({ accentId, shadeId, tone }) {
|
|
193
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
194
|
+
className: "drop-shadow-[0_8px_16px_var(--shadow-soft-3-color)]",
|
|
195
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
196
|
+
d: "M54 110c-21 0-38-14-38-32 0-16 14-30 33-32 8-19 27-31 49-31 27 0 50 19 55 43 17 3 30 16 30 32 0 19-18 34-40 34H55c-1 0-1-14-1-14Z",
|
|
197
|
+
fill: `url(#${shadeId})`
|
|
198
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
199
|
+
d: "M68 106c-18 0-32-12-32-27 0-13 11-24 27-26 7-16 23-26 42-26 23 0 42 16 46 36 15 3 26 14 26 28 0 16-15 29-34 29H68v-14Z",
|
|
200
|
+
fill: `url(#${accentId})`,
|
|
201
|
+
opacity: tone === "primary" ? .78 : .36
|
|
146
202
|
})]
|
|
147
203
|
});
|
|
148
204
|
}
|
|
149
|
-
|
|
205
|
+
function BoxShape({ accentId, shadeId }) {
|
|
206
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
207
|
+
className: "drop-shadow-[0_8px_16px_var(--shadow-soft-3-color)]",
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ jsx("path", {
|
|
210
|
+
d: "M72 42 132 20l55 31-62 24-53-33Z",
|
|
211
|
+
fill: `url(#${accentId})`
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsx("path", {
|
|
214
|
+
d: "M72 42v72l53 34V75L72 42Z",
|
|
215
|
+
fill: `url(#${shadeId})`
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ jsx("path", {
|
|
218
|
+
d: "M125 75v73l62-35V51l-62 24Z",
|
|
219
|
+
fill: "var(--card)"
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ jsx("path", {
|
|
222
|
+
d: "M132 20v33l24 14V34l-24-14Z",
|
|
223
|
+
fill: "currentColor",
|
|
224
|
+
opacity: "0.34"
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ jsx("path", {
|
|
227
|
+
d: "M72 42 132 20l55 31-62 24-53-33Z",
|
|
228
|
+
fill: "none",
|
|
229
|
+
stroke: "var(--border)"
|
|
230
|
+
})
|
|
231
|
+
]
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function DocumentsShape({ accentId, shadeId }) {
|
|
235
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
236
|
+
className: "drop-shadow-[0_8px_16px_var(--shadow-soft-3-color)]",
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ jsxs("g", {
|
|
239
|
+
transform: "translate(44 48) rotate(-18)",
|
|
240
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
241
|
+
width: "58",
|
|
242
|
+
height: "78",
|
|
243
|
+
rx: "7",
|
|
244
|
+
fill: `url(#${shadeId})`,
|
|
245
|
+
stroke: "var(--border)"
|
|
246
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
247
|
+
d: "M15 21h28M15 35h21M15 49h28",
|
|
248
|
+
stroke: "currentColor",
|
|
249
|
+
strokeOpacity: "0.28"
|
|
250
|
+
})]
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ jsxs("g", {
|
|
253
|
+
transform: "translate(83 32)",
|
|
254
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
255
|
+
width: "58",
|
|
256
|
+
height: "88",
|
|
257
|
+
rx: "7",
|
|
258
|
+
fill: "var(--card)",
|
|
259
|
+
stroke: "var(--border)"
|
|
260
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
261
|
+
d: "M16 26h28M16 41h22M16 56h28",
|
|
262
|
+
stroke: "currentColor",
|
|
263
|
+
strokeOpacity: "0.32"
|
|
264
|
+
})]
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ jsxs("g", {
|
|
267
|
+
transform: "translate(121 47) rotate(18)",
|
|
268
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
269
|
+
width: "58",
|
|
270
|
+
height: "78",
|
|
271
|
+
rx: "7",
|
|
272
|
+
fill: `url(#${accentId})`,
|
|
273
|
+
stroke: "var(--border)"
|
|
274
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
275
|
+
d: "M15 21h28M15 35h21M15 49h28",
|
|
276
|
+
stroke: "currentColor",
|
|
277
|
+
strokeOpacity: "0.32"
|
|
278
|
+
})]
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function CreditCardShape({ accentId, shadeId }) {
|
|
284
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
285
|
+
className: "drop-shadow-[0_8px_16px_var(--shadow-soft-3-color)]",
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ jsx("rect", {
|
|
288
|
+
x: "42",
|
|
289
|
+
y: "48",
|
|
290
|
+
width: "136",
|
|
291
|
+
height: "82",
|
|
292
|
+
rx: "12",
|
|
293
|
+
fill: `url(#${shadeId})`,
|
|
294
|
+
stroke: "var(--border)"
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ jsx("rect", {
|
|
297
|
+
x: "42",
|
|
298
|
+
y: "70",
|
|
299
|
+
width: "136",
|
|
300
|
+
height: "16",
|
|
301
|
+
fill: `url(#${accentId})`,
|
|
302
|
+
opacity: "0.72"
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ jsx("rect", {
|
|
305
|
+
x: "58",
|
|
306
|
+
y: "104",
|
|
307
|
+
width: "28",
|
|
308
|
+
height: "8",
|
|
309
|
+
rx: "2",
|
|
310
|
+
fill: "currentColor",
|
|
311
|
+
opacity: "0.28"
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ jsx("rect", {
|
|
314
|
+
x: "58",
|
|
315
|
+
y: "116",
|
|
316
|
+
width: "58",
|
|
317
|
+
height: "5",
|
|
318
|
+
rx: "2.5",
|
|
319
|
+
fill: "currentColor",
|
|
320
|
+
opacity: "0.18"
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ jsx("circle", {
|
|
323
|
+
cx: "146",
|
|
324
|
+
cy: "112",
|
|
325
|
+
r: "10",
|
|
326
|
+
fill: "currentColor",
|
|
327
|
+
opacity: "0.24"
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ jsx("circle", {
|
|
330
|
+
cx: "158",
|
|
331
|
+
cy: "112",
|
|
332
|
+
r: "10",
|
|
333
|
+
fill: "currentColor",
|
|
334
|
+
opacity: "0.38"
|
|
335
|
+
})
|
|
336
|
+
]
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
var EmptyStateIllustration = React.forwardRef(({ className, size = "sm", variant = "cloud", tone = "primary", icon = /* @__PURE__ */ jsx(Heart, { "aria-hidden": "true" }), ...props }, ref) => {
|
|
340
|
+
const accentId = React.useId();
|
|
341
|
+
const shadeId = React.useId();
|
|
342
|
+
const isPrimary = tone === "primary";
|
|
343
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
344
|
+
ref,
|
|
345
|
+
"data-slot": "empty-state-illustration",
|
|
346
|
+
"data-testid": "empty-state-illustration",
|
|
347
|
+
"data-size": size,
|
|
348
|
+
"data-variant": variant,
|
|
349
|
+
"data-tone": tone,
|
|
350
|
+
"aria-hidden": "true",
|
|
351
|
+
className: cn("relative shrink-0 text-primary", !isPrimary && "text-muted-foreground", illustrationSizeClass[size][variant], className),
|
|
352
|
+
...props,
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ jsx("div", {
|
|
355
|
+
"data-slot": "empty-state-illustration-background",
|
|
356
|
+
"data-testid": "empty-state-illustration-background",
|
|
357
|
+
"data-centered": "true",
|
|
358
|
+
className: cn("absolute left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full", isPrimary ? "bg-primary/20" : "bg-muted/80", illustrationCircleSizeClass[size], illustrationIconCenterClass[variant])
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ jsx(DecorativeDots, { tone }),
|
|
361
|
+
/* @__PURE__ */ jsxs("svg", {
|
|
362
|
+
viewBox: "0 0 220 168",
|
|
363
|
+
className: "absolute inset-0 size-full overflow-visible",
|
|
364
|
+
fill: "none",
|
|
365
|
+
"aria-hidden": "true",
|
|
366
|
+
children: [
|
|
367
|
+
/* @__PURE__ */ jsxs("defs", { children: [/* @__PURE__ */ jsxs("linearGradient", {
|
|
368
|
+
id: accentId,
|
|
369
|
+
x1: "25",
|
|
370
|
+
y1: "12",
|
|
371
|
+
x2: "190",
|
|
372
|
+
y2: "148",
|
|
373
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
374
|
+
stopColor: isPrimary ? "var(--primary)" : "var(--muted)",
|
|
375
|
+
stopOpacity: isPrimary ? .34 : .74
|
|
376
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
377
|
+
stopColor: "var(--card)",
|
|
378
|
+
stopOpacity: .95
|
|
379
|
+
})]
|
|
380
|
+
}), /* @__PURE__ */ jsxs("linearGradient", {
|
|
381
|
+
id: shadeId,
|
|
382
|
+
x1: "54",
|
|
383
|
+
y1: "18",
|
|
384
|
+
x2: "165",
|
|
385
|
+
y2: "140",
|
|
386
|
+
children: [/* @__PURE__ */ jsx("stop", { stopColor: "var(--card)" }), /* @__PURE__ */ jsx("stop", {
|
|
387
|
+
stopColor: isPrimary ? "var(--primary)" : "var(--muted-foreground)",
|
|
388
|
+
stopOpacity: isPrimary ? .18 : .14
|
|
389
|
+
})]
|
|
390
|
+
})] }),
|
|
391
|
+
variant === "cloud" && /* @__PURE__ */ jsx(CloudShape, {
|
|
392
|
+
accentId,
|
|
393
|
+
shadeId,
|
|
394
|
+
tone
|
|
395
|
+
}),
|
|
396
|
+
variant === "box" && /* @__PURE__ */ jsx(BoxShape, {
|
|
397
|
+
accentId,
|
|
398
|
+
shadeId
|
|
399
|
+
}),
|
|
400
|
+
variant === "documents" && /* @__PURE__ */ jsx(DocumentsShape, {
|
|
401
|
+
accentId,
|
|
402
|
+
shadeId
|
|
403
|
+
}),
|
|
404
|
+
variant === "credit-card" && /* @__PURE__ */ jsx(CreditCardShape, {
|
|
405
|
+
accentId,
|
|
406
|
+
shadeId
|
|
407
|
+
})
|
|
408
|
+
]
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ jsx("div", {
|
|
411
|
+
"data-slot": "empty-state-illustration-icon",
|
|
412
|
+
"data-testid": "empty-state-illustration-icon",
|
|
413
|
+
"data-centered": "true",
|
|
414
|
+
className: cn("absolute left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-xl bg-primary/10 text-primary shadow-xs backdrop-blur-md supports-backdrop-filter:backdrop-blur-md [&>svg]:shrink-0", !isPrimary && "bg-muted text-muted-foreground", illustrationIconSizeClass[size], illustrationIconCenterClass[variant]),
|
|
415
|
+
children: /* @__PURE__ */ jsx(EmptyStateIconGlyph, {
|
|
416
|
+
icon,
|
|
417
|
+
size
|
|
418
|
+
})
|
|
419
|
+
})
|
|
420
|
+
]
|
|
421
|
+
});
|
|
422
|
+
});
|
|
423
|
+
EmptyStateIllustration.displayName = "EmptyStateIllustration";
|
|
424
|
+
var emptyStateVariants = cva("relative isolate mx-auto flex w-full max-w-[512px] items-center justify-center overflow-visible py-8 text-center", {
|
|
425
|
+
variants: { size: {
|
|
426
|
+
sm: "min-h-[212px]",
|
|
427
|
+
md: "min-h-[280px]",
|
|
428
|
+
lg: "min-h-[360px]"
|
|
429
|
+
} },
|
|
430
|
+
defaultVariants: { size: "sm" }
|
|
431
|
+
});
|
|
432
|
+
function resolvePattern(pattern, media) {
|
|
433
|
+
if (!pattern || pattern === "auto") {
|
|
434
|
+
if (media === "illustration") return "grid";
|
|
435
|
+
if (media === "none") return "none";
|
|
436
|
+
return "circles";
|
|
437
|
+
}
|
|
438
|
+
return pattern;
|
|
439
|
+
}
|
|
440
|
+
function renderEmptyStateAction(action, intent) {
|
|
441
|
+
const { label, onClick, startIcon, disabled, loading, "aria-label": ariaLabel } = action;
|
|
442
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
443
|
+
appearance: intent === "primary" ? "solid" : "outline",
|
|
444
|
+
variant: intent === "primary" ? "primary" : "secondary",
|
|
445
|
+
size: "sm",
|
|
446
|
+
shape: "rounded",
|
|
447
|
+
onClick,
|
|
448
|
+
disabled,
|
|
449
|
+
loading,
|
|
450
|
+
startIcon,
|
|
451
|
+
"aria-label": ariaLabel,
|
|
452
|
+
type: "button",
|
|
453
|
+
children: label
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
var EmptyState = React.forwardRef(({ className, title, description, size = "sm", media = "featured-icon", pattern = "auto", icon, iconLabel, illustrationVariant = "cloud", illustrationTone = "gray", fileExtension, fileType = "document", primaryAction, secondaryAction, actions, headingLevel = 3, ...props }, ref) => {
|
|
457
|
+
const Heading = headingTag[headingLevel];
|
|
458
|
+
const resolvedPattern = resolvePattern(pattern, media);
|
|
459
|
+
const defaultIcon = icon ?? /* @__PURE__ */ jsx(Search, { "aria-hidden": "true" });
|
|
460
|
+
const hasActions = actions || primaryAction || secondaryAction;
|
|
461
|
+
return /* @__PURE__ */ jsx("section", {
|
|
462
|
+
ref,
|
|
463
|
+
"data-slot": "empty-state",
|
|
464
|
+
"aria-label": typeof title === "string" ? title : "Empty state",
|
|
465
|
+
className: cn(emptyStateVariants({ size }), className),
|
|
466
|
+
...props,
|
|
467
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
468
|
+
"data-slot": "empty-state-content",
|
|
469
|
+
className: cn("relative z-10 flex min-w-0 flex-1 flex-col items-center", contentGapClass[size]),
|
|
470
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
471
|
+
"data-slot": "empty-state-body",
|
|
472
|
+
className: cn("flex w-full flex-col items-center", mediaGapClass[size]),
|
|
473
|
+
children: [media !== "none" && /* @__PURE__ */ jsxs("div", {
|
|
474
|
+
"data-slot": "empty-state-media",
|
|
475
|
+
"data-testid": "empty-state-media",
|
|
476
|
+
"data-media": media,
|
|
477
|
+
"data-centered": "true",
|
|
478
|
+
className: "relative flex w-full min-w-0 justify-center",
|
|
479
|
+
children: [
|
|
480
|
+
/* @__PURE__ */ jsx(EmptyStateBackgroundPattern, {
|
|
481
|
+
size,
|
|
482
|
+
variant: resolvedPattern,
|
|
483
|
+
"data-centered": "true",
|
|
484
|
+
className: "z-0"
|
|
485
|
+
}),
|
|
486
|
+
media === "featured-icon" && /* @__PURE__ */ jsx(FeaturedIcon, {
|
|
487
|
+
"data-slot": "empty-state-featured-icon",
|
|
488
|
+
size: featuredIconSize[size],
|
|
489
|
+
shape: "rounded",
|
|
490
|
+
intent: "default",
|
|
491
|
+
icon: /* @__PURE__ */ jsx(EmptyStateIconGlyph, {
|
|
492
|
+
icon: defaultIcon,
|
|
493
|
+
size
|
|
494
|
+
}),
|
|
495
|
+
"aria-label": iconLabel,
|
|
496
|
+
className: "relative z-10 delight-stagger motion-reduce:animate-none"
|
|
497
|
+
}),
|
|
498
|
+
media === "illustration" && /* @__PURE__ */ jsx(EmptyStateIllustration, {
|
|
499
|
+
size,
|
|
500
|
+
variant: illustrationVariant,
|
|
501
|
+
tone: illustrationTone,
|
|
502
|
+
icon: defaultIcon,
|
|
503
|
+
className: "relative z-10 delight-stagger motion-reduce:animate-none"
|
|
504
|
+
}),
|
|
505
|
+
media === "file-type-icon" && /* @__PURE__ */ jsx("div", {
|
|
506
|
+
"data-slot": "empty-state-file-icon-wrap",
|
|
507
|
+
"data-testid": "empty-state-file-icon-wrap",
|
|
508
|
+
"data-centered": "true",
|
|
509
|
+
className: cn("relative z-10 flex items-center justify-center rounded-full bg-linear-[104deg,color-mix(in_oklch,var(--card)_60%,transparent),color-mix(in_oklch,var(--muted)_55%,transparent)] delight-stagger motion-reduce:animate-none", fileIconWrapSizeClass[size]),
|
|
510
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
511
|
+
"data-slot": "empty-state-file-icon-optical-center",
|
|
512
|
+
"data-testid": "empty-state-file-icon-optical-center",
|
|
513
|
+
"data-centered": "true",
|
|
514
|
+
children: /* @__PURE__ */ jsx(FileTypeIcon, {
|
|
515
|
+
extension: fileExtension,
|
|
516
|
+
fileType: fileExtension ? void 0 : fileType,
|
|
517
|
+
size: fileIconSize[size],
|
|
518
|
+
className: "drop-shadow-[0_1px_2px_var(--shadow-xs-1-color)]"
|
|
519
|
+
})
|
|
520
|
+
})
|
|
521
|
+
})
|
|
522
|
+
]
|
|
523
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
524
|
+
"data-slot": "empty-state-text",
|
|
525
|
+
className: cn("flex w-full max-w-[352px] flex-col items-center text-center", textGapClass[size]),
|
|
526
|
+
children: [/* @__PURE__ */ jsx(Heading, {
|
|
527
|
+
className: "w-full text-base font-semibold leading-6 text-foreground",
|
|
528
|
+
children: title
|
|
529
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
530
|
+
className: "w-full text-sm leading-5 text-secondary-foreground",
|
|
531
|
+
children: description
|
|
532
|
+
})]
|
|
533
|
+
})]
|
|
534
|
+
}), hasActions && /* @__PURE__ */ jsx("div", {
|
|
535
|
+
"data-slot": "empty-state-actions",
|
|
536
|
+
className: "flex flex-wrap items-center justify-center gap-3",
|
|
537
|
+
children: actions ?? /* @__PURE__ */ jsxs(Fragment, { children: [secondaryAction && renderEmptyStateAction(secondaryAction, "secondary"), primaryAction && renderEmptyStateAction(primaryAction, "primary")] })
|
|
538
|
+
})]
|
|
539
|
+
})
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
EmptyState.displayName = "EmptyState";
|
|
150
543
|
//#endregion
|
|
151
|
-
export {
|
|
544
|
+
export { EmptyState, EmptyStateBackgroundPattern, EmptyStateIllustration };
|
|
152
545
|
|
|
153
546
|
//# sourceMappingURL=index194.js.map
|