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