@devalok/shilp-sutra 0.34.0 → 0.34.1
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/_chunks/badge-group.js +306 -246
- package/dist/_chunks/chat.js +513 -0
- package/dist/_chunks/date-picker.js +748 -0
- package/dist/_chunks/document-preview.js +109 -90
- package/dist/_chunks/file-preview.js +492 -504
- package/dist/_chunks/framer.js +5564 -5613
- package/dist/_chunks/image-preview.js +127 -88
- package/dist/_chunks/keybinding.js +12 -14
- package/dist/_chunks/link-context.js +19 -16
- package/dist/_chunks/mention-suggestion.js +353 -350
- package/dist/_chunks/motion-provider.js +26 -20
- package/dist/_chunks/popover.js +127 -0
- package/dist/_chunks/primitives.js +7584 -6425
- package/dist/_chunks/rich-chat-input.js +2070 -0
- package/dist/_chunks/rolldown-runtime.js +21 -0
- package/dist/_chunks/shared.js +126 -0
- package/dist/_chunks/sonner.js +605 -734
- package/dist/_chunks/stat-row.js +418 -440
- package/dist/_chunks/tiptap.js +15850 -19964
- package/dist/_chunks/tree-view.js +231 -290
- package/dist/_chunks/use-calendar.js +161 -208
- package/dist/_chunks/vendor-client.js +314 -2199
- package/dist/_chunks/vendor-utils.js +1721 -2978
- package/dist/ai/ai-command-provider.js +23 -17
- package/dist/ai/block-renderer.js +68 -51
- package/dist/ai/blocks/index.js +2 -12
- package/dist/ai/command-bar.js +470 -519
- package/dist/ai/conversation.js +241 -227
- package/dist/ai/index.js +181 -167
- package/dist/ai/types.js +0 -1
- package/dist/composed/activity-feed.js +232 -202
- package/dist/composed/avatar-group.js +164 -222
- package/dist/composed/bulk-action-bar.js +174 -165
- package/dist/composed/command-palette.js +290 -308
- package/dist/composed/confirm-dialog.js +28 -48
- package/dist/composed/content-card.js +69 -108
- package/dist/composed/date-picker/index.js +3 -13
- package/dist/composed/deadline-indicator.js +68 -74
- package/dist/composed/emoji-picker.js +83 -110
- package/dist/composed/empty-state.js +64 -103
- package/dist/composed/error-boundary.js +129 -127
- package/dist/composed/file-preview.js +2 -12
- package/dist/composed/filter-bar.js +98 -130
- package/dist/composed/form-section.js +61 -45
- package/dist/composed/global-loading.js +34 -47
- package/dist/composed/index.js +34 -92
- package/dist/composed/inline-edit.js +92 -107
- package/dist/composed/lib/string-utils.js +8 -8
- package/dist/composed/loading-skeleton.js +103 -171
- package/dist/composed/markdown-viewer.js +187 -139
- package/dist/composed/master-detail.js +147 -156
- package/dist/composed/member-picker.js +46 -49
- package/dist/composed/multi-select-popover.js +181 -179
- package/dist/composed/page-header.js +54 -76
- package/dist/composed/page-skeletons.js +143 -127
- package/dist/composed/priority-indicator.js +105 -111
- package/dist/composed/responsive-overlay.js +36 -41
- package/dist/composed/rich-chat-input.js +2 -1860
- package/dist/composed/rich-text-editor.js +561 -424
- package/dist/composed/schedule-view.js +134 -185
- package/dist/composed/simple-tooltip.js +21 -21
- package/dist/composed/status-badge.js +133 -137
- package/dist/hooks/index.js +7 -12
- package/dist/hooks/use-color-mode.js +28 -25
- package/dist/hooks/use-mobile.js +13 -13
- package/dist/hooks/use-toast.js +2 -4
- package/dist/hooks/use-touch-device.js +9 -11
- package/dist/hooks/use-viewport-height.js +14 -14
- package/dist/motion/index.js +3 -11
- package/dist/motion/primitives-index.js +226 -186
- package/dist/shell/app-command-palette.js +203 -234
- package/dist/shell/bottom-navbar.js +150 -190
- package/dist/shell/command-registry.js +13 -14
- package/dist/shell/index.js +10 -20
- package/dist/shell/link-context.js +2 -5
- package/dist/shell/notification-center.js +238 -259
- package/dist/shell/notification-preferences.js +241 -184
- package/dist/shell/sidebar.js +251 -281
- package/dist/shell/top-bar.js +203 -237
- package/dist/tailwind/index.cjs +426 -442
- package/dist/tailwind/index.js +2 -4
- package/dist/tailwind/preset.js +443 -459
- package/dist/ui/accordion.js +52 -60
- package/dist/ui/alert-dialog.js +111 -156
- package/dist/ui/alert.js +177 -99
- package/dist/ui/aspect-ratio.js +13 -16
- package/dist/ui/autocomplete.js +112 -148
- package/dist/ui/avatar.js +196 -169
- package/dist/ui/badge-group.js +2 -7
- package/dist/ui/badge-indicator.js +42 -51
- package/dist/ui/badge.js +2 -15
- package/dist/ui/banner.js +76 -68
- package/dist/ui/breadcrumb.js +65 -84
- package/dist/ui/button-group.js +109 -102
- package/dist/ui/button-processing.js +69 -73
- package/dist/ui/button.js +393 -279
- package/dist/ui/card.js +151 -157
- package/dist/ui/charts/index.js +1002 -1319
- package/dist/ui/chat/index.js +2 -11
- package/dist/ui/checkbox.js +77 -100
- package/dist/ui/code.js +18 -32
- package/dist/ui/collapsible.js +21 -29
- package/dist/ui/color-input.js +453 -372
- package/dist/ui/color-swatch.js +60 -90
- package/dist/ui/combobox.js +244 -293
- package/dist/ui/container.js +18 -24
- package/dist/ui/context-menu.js +154 -203
- package/dist/ui/data-table-body.js +116 -213
- package/dist/ui/data-table-bulk-actions.js +43 -59
- package/dist/ui/data-table-card.js +84 -71
- package/dist/ui/data-table-context.js +39 -42
- package/dist/ui/data-table-header.js +98 -139
- package/dist/ui/data-table-pagination.js +69 -82
- package/dist/ui/data-table-toolbar.js +104 -130
- package/dist/ui/data-table.js +278 -354
- package/dist/ui/devalok-grain.js +77 -66
- package/dist/ui/dialog.js +122 -151
- package/dist/ui/dropdown-menu.js +152 -203
- package/dist/ui/file-upload.js +242 -266
- package/dist/ui/form.js +60 -56
- package/dist/ui/hover-card.js +54 -54
- package/dist/ui/icon-button.js +21 -26
- package/dist/ui/icon-context.js +17 -17
- package/dist/ui/icon-group.js +22 -29
- package/dist/ui/icon.js +201 -121
- package/dist/ui/index.js +74 -350
- package/dist/ui/input-otp.js +44 -48
- package/dist/ui/input.js +92 -169
- package/dist/ui/label.js +17 -22
- package/dist/ui/lib/date-utils.js +14 -11
- package/dist/ui/lib/motion.js +77 -36
- package/dist/ui/lib/utils.js +39 -16
- package/dist/ui/link.js +13 -24
- package/dist/ui/menubar.js +132 -210
- package/dist/ui/navigation-menu.js +163 -193
- package/dist/ui/number-input.js +72 -95
- package/dist/ui/pagination.js +122 -159
- package/dist/ui/popover.js +2 -131
- package/dist/ui/progress-ring.js +133 -143
- package/dist/ui/progress.js +51 -95
- package/dist/ui/radio.js +41 -50
- package/dist/ui/search-input.js +51 -53
- package/dist/ui/segmented-control.js +93 -114
- package/dist/ui/select.js +131 -157
- package/dist/ui/separator.js +15 -25
- package/dist/ui/sheet.js +135 -163
- package/dist/ui/sidebar.js +357 -600
- package/dist/ui/skeleton.js +179 -231
- package/dist/ui/slider.js +24 -34
- package/dist/ui/spinner.js +226 -205
- package/dist/ui/split-button.js +227 -276
- package/dist/ui/stack.js +56 -70
- package/dist/ui/stat-card.js +259 -251
- package/dist/ui/status-dot.js +67 -63
- package/dist/ui/stepper.js +119 -168
- package/dist/ui/switch.js +51 -54
- package/dist/ui/table.js +57 -90
- package/dist/ui/tabs.js +139 -156
- package/dist/ui/text.js +52 -59
- package/dist/ui/textarea.js +40 -57
- package/dist/ui/toast-types.js +0 -1
- package/dist/ui/toast.js +554 -536
- package/dist/ui/toaster.js +23 -33
- package/dist/ui/toggle-group.js +37 -41
- package/dist/ui/toggle.js +36 -40
- package/dist/ui/tooltip.js +80 -65
- package/dist/ui/tree-view/index.js +2 -6
- package/dist/ui/visually-hidden.js +12 -10
- package/llms-full.txt +1 -1
- package/package.json +1 -1
- package/dist/_chunks/date-time-picker.js +0 -851
- package/dist/_chunks/typing-indicator.js +0 -565
package/dist/ui/split-button.js
CHANGED
|
@@ -1,282 +1,233 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
import { $t as e, Qt as t, en as n, in as r, rn as i } from "../_chunks/primitives.js";
|
|
3
|
+
import { a, c as o } from "../_chunks/framer.js";
|
|
4
|
+
import { cn as s } from "./lib/utils.js";
|
|
5
|
+
import * as c from "react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
//#region src/ui/split-button.tsx
|
|
8
|
+
var f = {
|
|
9
|
+
solid: {
|
|
10
|
+
accent: "bg-accent-11/20",
|
|
11
|
+
error: "bg-error-11/20",
|
|
12
|
+
success: "bg-success-11/20",
|
|
13
|
+
warning: "bg-warning-11/20",
|
|
14
|
+
neutral: "bg-neutral-8/30"
|
|
15
|
+
},
|
|
16
|
+
soft: {
|
|
17
|
+
accent: "bg-accent-6",
|
|
18
|
+
error: "bg-error-6",
|
|
19
|
+
success: "bg-success-6",
|
|
20
|
+
warning: "bg-warning-6",
|
|
21
|
+
neutral: "bg-surface-border"
|
|
22
|
+
},
|
|
23
|
+
outline: {
|
|
24
|
+
accent: "bg-accent-7",
|
|
25
|
+
error: "bg-error-7",
|
|
26
|
+
success: "bg-success-7",
|
|
27
|
+
warning: "bg-warning-7",
|
|
28
|
+
neutral: "bg-surface-border-strong"
|
|
29
|
+
}
|
|
30
|
+
}, p = {
|
|
31
|
+
xs: "h-ds-xs-plus",
|
|
32
|
+
sm: "h-ds-sm",
|
|
33
|
+
md: "h-ds-md",
|
|
34
|
+
"icon-xs": "h-ds-xs-plus",
|
|
35
|
+
"icon-sm": "h-ds-sm",
|
|
36
|
+
"icon-md": "h-ds-md"
|
|
37
|
+
}, m = {
|
|
38
|
+
xs: "text-ds-sm",
|
|
39
|
+
sm: "text-ds-sm",
|
|
40
|
+
md: "text-ds-md",
|
|
41
|
+
"icon-xs": "text-ds-sm",
|
|
42
|
+
"icon-sm": "text-ds-sm",
|
|
43
|
+
"icon-md": "text-ds-md"
|
|
44
|
+
}, h = {
|
|
45
|
+
xs: "px-ds-03 gap-1",
|
|
46
|
+
sm: "px-ds-04 gap-1.5",
|
|
47
|
+
md: "px-ds-05 gap-2",
|
|
48
|
+
"icon-xs": "px-ds-02",
|
|
49
|
+
"icon-sm": "px-ds-03",
|
|
50
|
+
"icon-md": "px-ds-04"
|
|
51
|
+
}, g = {
|
|
52
|
+
xs: "px-ds-02",
|
|
53
|
+
sm: "px-ds-02",
|
|
54
|
+
md: "px-ds-03",
|
|
55
|
+
"icon-xs": "px-ds-01",
|
|
56
|
+
"icon-sm": "px-ds-02",
|
|
57
|
+
"icon-md": "px-ds-02"
|
|
43
58
|
}, _ = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, I = {
|
|
51
|
-
xs: "px-ds-02",
|
|
52
|
-
sm: "px-ds-02",
|
|
53
|
-
md: "px-ds-03",
|
|
54
|
-
"icon-xs": "px-ds-01",
|
|
55
|
-
"icon-sm": "px-ds-02",
|
|
56
|
-
"icon-md": "px-ds-02"
|
|
57
|
-
}, W = {
|
|
58
|
-
xs: "rounded-ds-md",
|
|
59
|
-
sm: "rounded-ds-md",
|
|
60
|
-
md: "rounded-ds-lg",
|
|
61
|
-
"icon-xs": "rounded-ds-sm",
|
|
62
|
-
"icon-sm": "rounded-ds-md",
|
|
63
|
-
"icon-md": "rounded-ds-md"
|
|
59
|
+
xs: "rounded-ds-md",
|
|
60
|
+
sm: "rounded-ds-md",
|
|
61
|
+
md: "rounded-ds-lg",
|
|
62
|
+
"icon-xs": "rounded-ds-sm",
|
|
63
|
+
"icon-sm": "rounded-ds-md",
|
|
64
|
+
"icon-md": "rounded-ds-md"
|
|
64
65
|
};
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
66
|
+
function v(e, t) {
|
|
67
|
+
let n = {
|
|
68
|
+
solid: {
|
|
69
|
+
accent: "bg-accent-9 text-accent-fg hover:bg-accent-10 active:bg-accent-11",
|
|
70
|
+
error: "bg-error-9 text-error-fg hover:bg-error-10 active:bg-error-11",
|
|
71
|
+
success: "bg-success-9 text-success-fg hover:bg-success-10 active:bg-success-11",
|
|
72
|
+
warning: "bg-warning-9 text-warning-fg hover:bg-warning-10 active:bg-warning-11",
|
|
73
|
+
neutral: "bg-neutral-5 text-surface-fg hover:bg-neutral-7 active:bg-neutral-8"
|
|
74
|
+
},
|
|
75
|
+
soft: {
|
|
76
|
+
accent: "bg-accent-3 text-accent-11 hover:bg-accent-4 active:bg-accent-5",
|
|
77
|
+
error: "bg-error-3 text-error-11 hover:bg-error-4 active:bg-error-5",
|
|
78
|
+
success: "bg-success-3 text-success-11 hover:bg-success-4 active:bg-success-5",
|
|
79
|
+
warning: "bg-warning-3 text-warning-11 hover:bg-warning-4 active:bg-warning-5",
|
|
80
|
+
neutral: "bg-surface-raised-hover text-surface-fg-muted hover:bg-surface-raised-active active:bg-neutral-5"
|
|
81
|
+
},
|
|
82
|
+
outline: {
|
|
83
|
+
accent: "bg-transparent text-accent-11 hover:bg-accent-3 active:bg-accent-4",
|
|
84
|
+
error: "bg-transparent text-error-11 hover:bg-error-3 active:bg-error-4",
|
|
85
|
+
success: "bg-transparent text-success-11 hover:bg-success-3 active:bg-success-4",
|
|
86
|
+
warning: "bg-transparent text-warning-11 hover:bg-warning-3 active:bg-warning-4",
|
|
87
|
+
neutral: "bg-transparent text-surface-fg hover:bg-surface-raised-hover active:bg-surface-raised-active"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return n[e][t] ?? n[e].accent;
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
function y(e) {
|
|
93
|
+
let t = {
|
|
94
|
+
accent: "border-accent-7",
|
|
95
|
+
error: "border-error-7",
|
|
96
|
+
success: "border-success-7",
|
|
97
|
+
warning: "border-warning-7",
|
|
98
|
+
neutral: "border-surface-border-strong"
|
|
99
|
+
};
|
|
100
|
+
return t[e] ?? t.accent;
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
102
|
+
function b({ className: e }) {
|
|
103
|
+
return /* @__PURE__ */ u("svg", {
|
|
104
|
+
width: "12",
|
|
105
|
+
height: "12",
|
|
106
|
+
viewBox: "0 0 12 12",
|
|
107
|
+
fill: "none",
|
|
108
|
+
className: e,
|
|
109
|
+
"aria-hidden": "true",
|
|
110
|
+
children: /* @__PURE__ */ u("path", {
|
|
111
|
+
d: "M3 4.5L6 7.5L9 4.5",
|
|
112
|
+
stroke: "currentColor",
|
|
113
|
+
strokeWidth: "1.5",
|
|
114
|
+
strokeLinecap: "round",
|
|
115
|
+
strokeLinejoin: "round"
|
|
116
|
+
})
|
|
117
|
+
});
|
|
103
118
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
_[r]
|
|
220
|
-
),
|
|
221
|
-
children: i
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
O === "right" && /* @__PURE__ */ m(C, { children: [
|
|
225
|
-
/* @__PURE__ */ s("div", { className: o("w-px self-stretch", $) }),
|
|
226
|
-
/* @__PURE__ */ s(
|
|
227
|
-
"button",
|
|
228
|
-
{
|
|
229
|
-
type: "button",
|
|
230
|
-
onClick: () => d(!e),
|
|
231
|
-
disabled: x,
|
|
232
|
-
"aria-label": R,
|
|
233
|
-
"aria-haspopup": "menu",
|
|
234
|
-
"aria-expanded": e,
|
|
235
|
-
"aria-controls": e ? w : void 0,
|
|
236
|
-
className: o(
|
|
237
|
-
"inline-flex items-center justify-center select-none",
|
|
238
|
-
"transition-colors duration-fast-01 ease-productive-standard",
|
|
239
|
-
"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset",
|
|
240
|
-
"disabled:pointer-events-none disabled:opacity-action-disabled",
|
|
241
|
-
y,
|
|
242
|
-
N[r],
|
|
243
|
-
I[r]
|
|
244
|
-
),
|
|
245
|
-
style: P,
|
|
246
|
-
children: B ?? /* @__PURE__ */ s(M, {})
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
] })
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
)
|
|
253
|
-
}
|
|
254
|
-
),
|
|
255
|
-
/* @__PURE__ */ s(X, { children: e && E && /* @__PURE__ */ s(
|
|
256
|
-
"div",
|
|
257
|
-
{
|
|
258
|
-
ref: f,
|
|
259
|
-
id: w,
|
|
260
|
-
role: "menu",
|
|
261
|
-
className: "fixed z-popover",
|
|
262
|
-
style: { top: 0, left: 0 },
|
|
263
|
-
children: /* @__PURE__ */ s(
|
|
264
|
-
Y.div,
|
|
265
|
-
{
|
|
266
|
-
initial: { opacity: 0, scale: 0.95 },
|
|
267
|
-
animate: { opacity: 1, scale: 1 },
|
|
268
|
-
exit: { opacity: 0, scale: 0.95 },
|
|
269
|
-
transition: { duration: 0.15 },
|
|
270
|
-
className: "rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating",
|
|
271
|
-
children: E
|
|
272
|
-
}
|
|
273
|
-
)
|
|
274
|
-
}
|
|
275
|
-
) })
|
|
276
|
-
] });
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
se.displayName = "SplitButton";
|
|
280
|
-
export {
|
|
281
|
-
se as SplitButton
|
|
282
|
-
};
|
|
119
|
+
var x = c.forwardRef(function({ children: x, onClick: S, dropdownContent: C, open: w, onOpenChange: T, variant: E = "solid", color: D = "accent", size: O = "md", disabled: k = !1, "aria-label": A, dropdownLabel: j = "More options", dropdownIcon: M, triggerSide: N = "right", placement: P = "top-end", triggerWidth: F, className: I }, L) {
|
|
120
|
+
let [R, z] = c.useState(!1), B = w !== void 0, V = B ? w : R, H = c.useRef(null), U = c.useRef(null), W = c.useId(), G = c.useCallback((e) => {
|
|
121
|
+
T && T(e), B || z(e);
|
|
122
|
+
}, [T, B]);
|
|
123
|
+
c.useEffect(() => {
|
|
124
|
+
if (!V || !H.current || !U.current) return;
|
|
125
|
+
let a = H.current, o = U.current;
|
|
126
|
+
return t(a, o, () => {
|
|
127
|
+
e(a, o, {
|
|
128
|
+
placement: P,
|
|
129
|
+
middleware: [
|
|
130
|
+
i(8),
|
|
131
|
+
n({ fallbackPlacements: [
|
|
132
|
+
"bottom-end",
|
|
133
|
+
"top-start",
|
|
134
|
+
"bottom-start"
|
|
135
|
+
] }),
|
|
136
|
+
r({ padding: 8 })
|
|
137
|
+
]
|
|
138
|
+
}).then(({ x: e, y: t }) => {
|
|
139
|
+
Object.assign(o.style, {
|
|
140
|
+
left: `${e}px`,
|
|
141
|
+
top: `${t}px`
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
}, [V, P]), c.useEffect(() => {
|
|
146
|
+
if (!V) return;
|
|
147
|
+
let e = (e) => {
|
|
148
|
+
let t = e.target;
|
|
149
|
+
H.current?.contains(t) || U.current?.contains(t) || G(!1);
|
|
150
|
+
};
|
|
151
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
152
|
+
}, [V, G]), c.useEffect(() => {
|
|
153
|
+
if (!V) return;
|
|
154
|
+
let e = (e) => {
|
|
155
|
+
e.key === "Escape" && G(!1);
|
|
156
|
+
};
|
|
157
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
158
|
+
}, [V, G]);
|
|
159
|
+
let K = v(E, D), q = f[E][D] ?? f[E].accent, J = F == null ? void 0 : { width: typeof F == "number" ? `${F}px` : F };
|
|
160
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
161
|
+
ref: L,
|
|
162
|
+
role: "group",
|
|
163
|
+
"aria-label": A ?? void 0,
|
|
164
|
+
className: s("relative inline-flex", I),
|
|
165
|
+
children: /* @__PURE__ */ d("div", {
|
|
166
|
+
ref: H,
|
|
167
|
+
className: s("inline-flex items-stretch overflow-hidden", _[O], E === "solid" && "shadow-raised", E === "outline" && `border ${y(D)}`),
|
|
168
|
+
children: [
|
|
169
|
+
N === "left" && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("button", {
|
|
170
|
+
type: "button",
|
|
171
|
+
onClick: () => G(!V),
|
|
172
|
+
disabled: k,
|
|
173
|
+
"aria-label": j,
|
|
174
|
+
"aria-haspopup": "menu",
|
|
175
|
+
"aria-expanded": V,
|
|
176
|
+
"aria-controls": V ? W : void 0,
|
|
177
|
+
className: s("inline-flex items-center justify-center select-none", "transition-colors duration-fast-01 ease-productive-standard", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset", "disabled:pointer-events-none disabled:opacity-action-disabled", K, p[O], g[O]),
|
|
178
|
+
style: J,
|
|
179
|
+
children: M ?? /* @__PURE__ */ u(b, {})
|
|
180
|
+
}), /* @__PURE__ */ u("div", { className: s("w-px self-stretch", q) })] }),
|
|
181
|
+
/* @__PURE__ */ u("button", {
|
|
182
|
+
type: "button",
|
|
183
|
+
onClick: S,
|
|
184
|
+
disabled: k,
|
|
185
|
+
"aria-label": A,
|
|
186
|
+
className: s("inline-flex items-center justify-center font-semibold select-none whitespace-nowrap", "transition-colors duration-fast-01 ease-productive-standard", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset", "disabled:pointer-events-none disabled:opacity-action-disabled", K, p[O], m[O], h[O]),
|
|
187
|
+
children: x
|
|
188
|
+
}),
|
|
189
|
+
N === "right" && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { className: s("w-px self-stretch", q) }), /* @__PURE__ */ u("button", {
|
|
190
|
+
type: "button",
|
|
191
|
+
onClick: () => G(!V),
|
|
192
|
+
disabled: k,
|
|
193
|
+
"aria-label": j,
|
|
194
|
+
"aria-haspopup": "menu",
|
|
195
|
+
"aria-expanded": V,
|
|
196
|
+
"aria-controls": V ? W : void 0,
|
|
197
|
+
className: s("inline-flex items-center justify-center select-none", "transition-colors duration-fast-01 ease-productive-standard", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset", "disabled:pointer-events-none disabled:opacity-action-disabled", K, p[O], g[O]),
|
|
198
|
+
style: J,
|
|
199
|
+
children: M ?? /* @__PURE__ */ u(b, {})
|
|
200
|
+
})] })
|
|
201
|
+
]
|
|
202
|
+
})
|
|
203
|
+
}), /* @__PURE__ */ u(o, { children: V && C && /* @__PURE__ */ u("div", {
|
|
204
|
+
ref: U,
|
|
205
|
+
id: W,
|
|
206
|
+
role: "menu",
|
|
207
|
+
className: "fixed z-popover",
|
|
208
|
+
style: {
|
|
209
|
+
top: 0,
|
|
210
|
+
left: 0
|
|
211
|
+
},
|
|
212
|
+
children: /* @__PURE__ */ u(a.div, {
|
|
213
|
+
initial: {
|
|
214
|
+
opacity: 0,
|
|
215
|
+
scale: .95
|
|
216
|
+
},
|
|
217
|
+
animate: {
|
|
218
|
+
opacity: 1,
|
|
219
|
+
scale: 1
|
|
220
|
+
},
|
|
221
|
+
exit: {
|
|
222
|
+
opacity: 0,
|
|
223
|
+
scale: .95
|
|
224
|
+
},
|
|
225
|
+
transition: { duration: .15 },
|
|
226
|
+
className: "rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating",
|
|
227
|
+
children: C
|
|
228
|
+
})
|
|
229
|
+
}) })] });
|
|
230
|
+
});
|
|
231
|
+
x.displayName = "SplitButton";
|
|
232
|
+
//#endregion
|
|
233
|
+
export { x as SplitButton };
|
package/dist/ui/stack.js
CHANGED
|
@@ -1,71 +1,57 @@
|
|
|
1
|
+
import { cn as e } from "./lib/utils.js";
|
|
1
2
|
import * as t from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
d && f[d],
|
|
58
|
-
e && m[e],
|
|
59
|
-
g && "flex-wrap",
|
|
60
|
-
n
|
|
61
|
-
),
|
|
62
|
-
...c
|
|
63
|
-
},
|
|
64
|
-
r
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
y.displayName = "Stack";
|
|
69
|
-
export {
|
|
70
|
-
y as Stack
|
|
71
|
-
};
|
|
3
|
+
//#region src/ui/stack.tsx
|
|
4
|
+
var n = {
|
|
5
|
+
start: "items-start",
|
|
6
|
+
center: "items-center",
|
|
7
|
+
end: "items-end",
|
|
8
|
+
stretch: "items-stretch",
|
|
9
|
+
baseline: "items-baseline"
|
|
10
|
+
}, r = {
|
|
11
|
+
start: "justify-start",
|
|
12
|
+
center: "justify-center",
|
|
13
|
+
end: "justify-end",
|
|
14
|
+
between: "justify-between",
|
|
15
|
+
around: "justify-around",
|
|
16
|
+
evenly: "justify-evenly"
|
|
17
|
+
}, i = {
|
|
18
|
+
0: "gap-0",
|
|
19
|
+
1: "gap-ds-01",
|
|
20
|
+
2: "gap-ds-02",
|
|
21
|
+
3: "gap-ds-03",
|
|
22
|
+
4: "gap-ds-04",
|
|
23
|
+
5: "gap-ds-05",
|
|
24
|
+
6: "gap-ds-06",
|
|
25
|
+
7: "gap-ds-07",
|
|
26
|
+
8: "gap-ds-08",
|
|
27
|
+
9: "gap-ds-09",
|
|
28
|
+
10: "gap-ds-10",
|
|
29
|
+
11: "gap-ds-11",
|
|
30
|
+
12: "gap-ds-12",
|
|
31
|
+
13: "gap-ds-13",
|
|
32
|
+
"ds-01": "gap-ds-01",
|
|
33
|
+
"ds-02": "gap-ds-02",
|
|
34
|
+
"ds-02b": "gap-ds-02b",
|
|
35
|
+
"ds-03": "gap-ds-03",
|
|
36
|
+
"ds-04": "gap-ds-04",
|
|
37
|
+
"ds-05": "gap-ds-05",
|
|
38
|
+
"ds-05b": "gap-ds-05b",
|
|
39
|
+
"ds-06": "gap-ds-06",
|
|
40
|
+
"ds-07": "gap-ds-07",
|
|
41
|
+
"ds-08": "gap-ds-08",
|
|
42
|
+
"ds-09": "gap-ds-09",
|
|
43
|
+
"ds-10": "gap-ds-10",
|
|
44
|
+
"ds-11": "gap-ds-11",
|
|
45
|
+
"ds-12": "gap-ds-12",
|
|
46
|
+
"ds-13": "gap-ds-13"
|
|
47
|
+
}, a = t.forwardRef(({ as: a, direction: o = "vertical", gap: s, align: c, justify: l, wrap: u, className: d, children: f, ...p }, m) => {
|
|
48
|
+
let h = a || "div";
|
|
49
|
+
return t.createElement(h, {
|
|
50
|
+
ref: m,
|
|
51
|
+
className: e("flex", o === "vertical" || o === "column" ? "flex-col" : "flex-row", s != null && i[String(s)], c && n[c], l && r[l], u && "flex-wrap", d),
|
|
52
|
+
...p
|
|
53
|
+
}, f);
|
|
54
|
+
});
|
|
55
|
+
a.displayName = "Stack";
|
|
56
|
+
//#endregion
|
|
57
|
+
export { a as Stack };
|