@devalok/shilp-sutra 0.8.4 → 0.9.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.
Files changed (217) hide show
  1. package/dist/_chunks/avatar.js +50 -0
  2. package/dist/_chunks/button.js +95 -0
  3. package/dist/_chunks/card.js +40 -0
  4. package/dist/_chunks/checkbox.js +14 -0
  5. package/dist/_chunks/form.js +27 -0
  6. package/dist/_chunks/primitives.js +6965 -0
  7. package/dist/_chunks/sidebar.js +592 -0
  8. package/dist/_chunks/spinner.js +34 -0
  9. package/dist/_chunks/tiptap.js +15254 -0
  10. package/dist/_chunks/tooltip.js +13 -0
  11. package/dist/_chunks/tree-view.js +304 -0
  12. package/dist/_chunks/use-calendar.js +990 -0
  13. package/dist/_chunks/utils.js +15 -0
  14. package/dist/_chunks/vendor.js +5823 -0
  15. package/dist/composed/avatar-group.js +20 -20
  16. package/dist/composed/command-palette.js +1 -1
  17. package/dist/composed/confirm-dialog.js +5 -5
  18. package/dist/composed/content-card.d.ts +1 -1
  19. package/dist/composed/content-card.js +6 -6
  20. package/dist/composed/date-picker/index.js +13 -0
  21. package/dist/composed/empty-state.js +10 -10
  22. package/dist/composed/error-boundary.js +2 -2
  23. package/dist/composed/global-loading.js +4 -4
  24. package/dist/composed/index.js +45 -53
  25. package/dist/composed/loading-skeleton.js +2 -2
  26. package/dist/composed/member-picker.js +5 -5
  27. package/dist/composed/page-header.js +4 -4
  28. package/dist/composed/page-skeletons.js +1 -1
  29. package/dist/composed/priority-indicator.js +6 -6
  30. package/dist/composed/rich-text-editor.js +422 -209
  31. package/dist/composed/schedule-view.js +1 -1
  32. package/dist/composed/simple-tooltip.js +6 -6
  33. package/dist/composed/status-badge.d.ts +1 -1
  34. package/dist/composed/status-badge.js +2 -2
  35. package/dist/shell/bottom-navbar.js +1 -1
  36. package/dist/shell/notification-center.js +2 -2
  37. package/dist/shell/notification-preferences.js +32 -33
  38. package/dist/shell/sidebar.js +24 -24
  39. package/dist/shell/top-bar.js +22 -22
  40. package/dist/ui/accordion.js +17 -17
  41. package/dist/ui/alert-dialog.js +29 -29
  42. package/dist/ui/alert.d.ts +2 -2
  43. package/dist/ui/alert.js +65 -44
  44. package/dist/ui/aspect-ratio.js +1 -1
  45. package/dist/ui/autocomplete.js +11 -11
  46. package/dist/ui/avatar.d.ts +1 -1
  47. package/dist/ui/avatar.js +67 -25
  48. package/dist/ui/badge.d.ts +2 -2
  49. package/dist/ui/badge.js +115 -91
  50. package/dist/ui/banner.d.ts +1 -1
  51. package/dist/ui/banner.js +5 -5
  52. package/dist/ui/breadcrumb.js +14 -14
  53. package/dist/ui/button-group.js +30 -15
  54. package/dist/ui/button.d.ts +2 -2
  55. package/dist/ui/button.js +114 -71
  56. package/dist/ui/card.js +66 -22
  57. package/dist/ui/charts/index.js +1221 -18
  58. package/dist/ui/checkbox.js +25 -5
  59. package/dist/ui/chip.d.ts +4 -4
  60. package/dist/ui/chip.js +2 -2
  61. package/dist/ui/code.js +1 -1
  62. package/dist/ui/collapsible.js +5 -5
  63. package/dist/ui/color-input.js +11 -11
  64. package/dist/ui/combobox.js +12 -12
  65. package/dist/ui/container.js +4 -4
  66. package/dist/ui/context-menu.js +37 -37
  67. package/dist/ui/data-table-toolbar.js +18 -18
  68. package/dist/ui/data-table.js +2 -2
  69. package/dist/ui/dialog.js +33 -33
  70. package/dist/ui/dropdown-menu.js +60 -60
  71. package/dist/ui/file-upload.js +1 -1
  72. package/dist/ui/form.js +36 -15
  73. package/dist/ui/hover-card.js +7 -7
  74. package/dist/ui/icon-button.js +9 -9
  75. package/dist/ui/index.js +523 -325
  76. package/dist/ui/input-otp.d.ts +2 -2
  77. package/dist/ui/input-otp.js +14 -14
  78. package/dist/ui/input.js +56 -28
  79. package/dist/ui/label.js +18 -4
  80. package/dist/ui/lib/utils.js +4 -5
  81. package/dist/ui/link.js +9 -9
  82. package/dist/ui/menubar.js +81 -81
  83. package/dist/ui/navigation-menu.js +42 -42
  84. package/dist/ui/number-input.js +13 -13
  85. package/dist/ui/pagination.js +5 -5
  86. package/dist/ui/popover.js +9 -9
  87. package/dist/ui/progress.d.ts +1 -1
  88. package/dist/ui/progress.js +15 -15
  89. package/dist/ui/radio.js +10 -10
  90. package/dist/ui/search-input.js +5 -5
  91. package/dist/ui/segmented-control.js +91 -83
  92. package/dist/ui/select.js +52 -52
  93. package/dist/ui/separator.js +20 -5
  94. package/dist/ui/sheet.js +28 -28
  95. package/dist/ui/sidebar.js +36 -560
  96. package/dist/ui/skeleton.d.ts +1 -1
  97. package/dist/ui/skeleton.js +9 -9
  98. package/dist/ui/slider.js +11 -11
  99. package/dist/ui/spinner.js +37 -2
  100. package/dist/ui/stack.js +1 -1
  101. package/dist/ui/stat-card.js +1 -1
  102. package/dist/ui/stepper.js +15 -15
  103. package/dist/ui/switch.js +22 -3
  104. package/dist/ui/table.js +1 -1
  105. package/dist/ui/tabs.js +59 -32
  106. package/dist/ui/text.js +2 -2
  107. package/dist/ui/textarea.js +7 -7
  108. package/dist/ui/toast.d.ts +1 -1
  109. package/dist/ui/toast.js +28 -28
  110. package/dist/ui/toggle-group.js +11 -11
  111. package/dist/ui/toggle.js +9 -9
  112. package/dist/ui/tooltip.js +17 -6
  113. package/dist/ui/transitions.js +68 -58
  114. package/dist/ui/tree-view/index.js +7 -0
  115. package/dist/ui/visually-hidden.js +3 -3
  116. package/llms-full.txt +1 -1
  117. package/llms.txt +7 -0
  118. package/package.json +656 -706
  119. package/dist/_virtual/client.js +0 -5
  120. package/dist/_virtual/index.js +0 -5
  121. package/dist/_virtual/react-dom-client.development.js +0 -5
  122. package/dist/_virtual/react-dom-client.production.js +0 -5
  123. package/dist/_virtual/scheduler.development.js +0 -5
  124. package/dist/_virtual/scheduler.production.js +0 -5
  125. package/dist/composed/date-picker/calendar-grid.js +0 -194
  126. package/dist/composed/date-picker/date-picker.js +0 -124
  127. package/dist/composed/date-picker/date-range-picker.js +0 -167
  128. package/dist/composed/date-picker/date-time-picker.js +0 -193
  129. package/dist/composed/date-picker/month-picker.js +0 -53
  130. package/dist/composed/date-picker/presets.js +0 -84
  131. package/dist/composed/date-picker/time-picker.js +0 -181
  132. package/dist/composed/date-picker/use-calendar.js +0 -17
  133. package/dist/composed/date-picker/year-picker.js +0 -45
  134. package/dist/composed/extensions/emoji-suggestion.js +0 -119
  135. package/dist/composed/extensions/file-attachment.js +0 -55
  136. package/dist/composed/extensions/mention-suggestion.js +0 -79
  137. package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +0 -40141
  138. package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +0 -17
  139. package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +0 -2958
  140. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +0 -17062
  141. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +0 -9790
  142. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +0 -20
  143. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +0 -237
  144. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +0 -234
  145. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +0 -11
  146. package/dist/primitives/_internal/number.js +0 -6
  147. package/dist/primitives/_internal/primitive.js +0 -9
  148. package/dist/primitives/_internal/react-arrow.js +0 -13
  149. package/dist/primitives/_internal/react-collection.js +0 -48
  150. package/dist/primitives/_internal/react-compose-refs.js +0 -29
  151. package/dist/primitives/_internal/react-context.js +0 -76
  152. package/dist/primitives/_internal/react-direction.js +0 -10
  153. package/dist/primitives/_internal/react-dismissable-layer.js +0 -103
  154. package/dist/primitives/_internal/react-focus-guards.js +0 -17
  155. package/dist/primitives/_internal/react-focus-scope.js +0 -137
  156. package/dist/primitives/_internal/react-id.js +0 -14
  157. package/dist/primitives/_internal/react-popper.js +0 -137
  158. package/dist/primitives/_internal/react-portal.js +0 -16
  159. package/dist/primitives/_internal/react-presence.js +0 -71
  160. package/dist/primitives/_internal/react-primitive.js +0 -36
  161. package/dist/primitives/_internal/react-use-callback-ref.js +0 -13
  162. package/dist/primitives/_internal/react-use-controllable-state.js +0 -44
  163. package/dist/primitives/_internal/react-use-escape-keydown.js +0 -14
  164. package/dist/primitives/_internal/react-use-is-hydrated.js +0 -15
  165. package/dist/primitives/_internal/react-use-layout-effect.js +0 -6
  166. package/dist/primitives/_internal/react-use-previous.js +0 -8
  167. package/dist/primitives/_internal/react-use-size.js +0 -27
  168. package/dist/primitives/react-accordion.js +0 -239
  169. package/dist/primitives/react-alert-dialog.js +0 -127
  170. package/dist/primitives/react-aspect-ratio.js +0 -43
  171. package/dist/primitives/react-avatar.js +0 -75
  172. package/dist/primitives/react-checkbox.js +0 -251
  173. package/dist/primitives/react-collapsible.js +0 -120
  174. package/dist/primitives/react-context-menu.js +0 -240
  175. package/dist/primitives/react-dialog.js +0 -262
  176. package/dist/primitives/react-dropdown-menu.js +0 -227
  177. package/dist/primitives/react-hover-card.js +0 -187
  178. package/dist/primitives/react-label.js +0 -20
  179. package/dist/primitives/react-menu.js +0 -652
  180. package/dist/primitives/react-menubar.js +0 -355
  181. package/dist/primitives/react-navigation-menu.js +0 -607
  182. package/dist/primitives/react-popover.js +0 -243
  183. package/dist/primitives/react-progress.js +0 -84
  184. package/dist/primitives/react-radio-group.js +0 -238
  185. package/dist/primitives/react-roving-focus.js +0 -183
  186. package/dist/primitives/react-select.js +0 -862
  187. package/dist/primitives/react-separator.js +0 -24
  188. package/dist/primitives/react-slider.js +0 -437
  189. package/dist/primitives/react-slot.js +0 -70
  190. package/dist/primitives/react-switch.js +0 -132
  191. package/dist/primitives/react-tabs.js +0 -163
  192. package/dist/primitives/react-toast.js +0 -446
  193. package/dist/primitives/react-toggle-group.js +0 -137
  194. package/dist/primitives/react-toggle.js +0 -33
  195. package/dist/primitives/react-tooltip.js +0 -338
  196. package/dist/primitives/react-visually-hidden.js +0 -32
  197. package/dist/ui/charts/_internal/animation.js +0 -18
  198. package/dist/ui/charts/_internal/axes.js +0 -42
  199. package/dist/ui/charts/_internal/colors.js +0 -21
  200. package/dist/ui/charts/_internal/grid-lines.js +0 -43
  201. package/dist/ui/charts/_internal/legend.js +0 -29
  202. package/dist/ui/charts/_internal/tooltip.js +0 -39
  203. package/dist/ui/charts/_internal/types.js +0 -10
  204. package/dist/ui/charts/area-chart.js +0 -245
  205. package/dist/ui/charts/bar-chart.js +0 -153
  206. package/dist/ui/charts/chart-container.js +0 -27
  207. package/dist/ui/charts/gauge-chart.js +0 -72
  208. package/dist/ui/charts/line-chart.js +0 -163
  209. package/dist/ui/charts/pie-chart.js +0 -132
  210. package/dist/ui/charts/radar-chart.js +0 -223
  211. package/dist/ui/charts/sparkline.js +0 -124
  212. package/dist/ui/lib/motion.js +0 -32
  213. package/dist/ui/lib/use-reduced-motion.js +0 -15
  214. package/dist/ui/lib/use-ripple.js +0 -14
  215. package/dist/ui/tree-view/tree-item.js +0 -139
  216. package/dist/ui/tree-view/tree-view.js +0 -140
  217. package/dist/ui/tree-view/use-tree.js +0 -38
@@ -1,251 +0,0 @@
1
- import * as s from "react";
2
- import { useComposedRefs as B } from "./_internal/react-compose-refs.js";
3
- import { createContextScope as L } from "./_internal/react-context.js";
4
- import { composeEventHandlers as S } from "./_internal/primitive.js";
5
- import { useControllableState as O } from "./_internal/react-use-controllable-state.js";
6
- import { usePrevious as j } from "./_internal/react-use-previous.js";
7
- import { useSize as H } from "./_internal/react-use-size.js";
8
- import { Presence as z } from "./_internal/react-presence.js";
9
- import { Primitive as P } from "./_internal/react-primitive.js";
10
- import { jsx as b, jsxs as G, Fragment as K } from "react/jsx-runtime";
11
- var g = "Checkbox", [U] = L(g), [X, E] = U(g);
12
- function J(t) {
13
- const {
14
- __scopeCheckbox: a,
15
- checked: c,
16
- children: u,
17
- defaultChecked: r,
18
- disabled: e,
19
- form: p,
20
- name: f,
21
- onCheckedChange: i,
22
- required: m,
23
- value: C = "on",
24
- // @ts-expect-error
25
- internal_do_not_use_render: d
26
- } = t, [l, v] = O({
27
- prop: c,
28
- defaultProp: r ?? !1,
29
- onChange: i,
30
- caller: g
31
- }), [k, x] = s.useState(null), [_, o] = s.useState(null), n = s.useRef(!1), I = k ? !!p || !!k.closest("form") : (
32
- // We set this to true by default so that events bubble to forms without JS (SSR)
33
- !0
34
- ), R = {
35
- checked: l,
36
- disabled: e,
37
- setChecked: v,
38
- control: k,
39
- setControl: x,
40
- name: f,
41
- form: p,
42
- value: C,
43
- hasConsumerStoppedPropagationRef: n,
44
- required: m,
45
- defaultChecked: h(r) ? !1 : r,
46
- isFormControl: I,
47
- bubbleInput: _,
48
- setBubbleInput: o
49
- };
50
- return /* @__PURE__ */ b(
51
- X,
52
- {
53
- scope: a,
54
- ...R,
55
- children: W(d) ? d(R) : u
56
- }
57
- );
58
- }
59
- var N = "CheckboxTrigger", w = s.forwardRef(
60
- ({ __scopeCheckbox: t, onKeyDown: a, onClick: c, ...u }, r) => {
61
- const {
62
- control: e,
63
- value: p,
64
- disabled: f,
65
- checked: i,
66
- required: m,
67
- setControl: C,
68
- setChecked: d,
69
- hasConsumerStoppedPropagationRef: l,
70
- isFormControl: v,
71
- bubbleInput: k
72
- } = E(N, t), x = B(r, C), _ = s.useRef(i);
73
- return s.useEffect(() => {
74
- const o = e == null ? void 0 : e.form;
75
- if (o) {
76
- const n = () => d(_.current);
77
- return o.addEventListener("reset", n), () => o.removeEventListener("reset", n);
78
- }
79
- }, [e, d]), /* @__PURE__ */ b(
80
- P.button,
81
- {
82
- type: "button",
83
- role: "checkbox",
84
- "aria-checked": h(i) ? "mixed" : i,
85
- "aria-required": m,
86
- "data-state": A(i),
87
- "data-disabled": f ? "" : void 0,
88
- disabled: f,
89
- value: p,
90
- ...u,
91
- ref: x,
92
- onKeyDown: S(a, (o) => {
93
- o.key === "Enter" && o.preventDefault();
94
- }),
95
- onClick: S(c, (o) => {
96
- d((n) => h(n) ? !0 : !n), k && v && (l.current = o.isPropagationStopped(), l.current || o.stopPropagation());
97
- })
98
- }
99
- );
100
- }
101
- );
102
- w.displayName = N;
103
- var Q = s.forwardRef(
104
- (t, a) => {
105
- const {
106
- __scopeCheckbox: c,
107
- name: u,
108
- checked: r,
109
- defaultChecked: e,
110
- required: p,
111
- disabled: f,
112
- value: i,
113
- onCheckedChange: m,
114
- form: C,
115
- ...d
116
- } = t;
117
- return /* @__PURE__ */ b(
118
- J,
119
- {
120
- __scopeCheckbox: c,
121
- checked: r,
122
- defaultChecked: e,
123
- disabled: f,
124
- required: p,
125
- onCheckedChange: m,
126
- name: u,
127
- form: C,
128
- value: i,
129
- internal_do_not_use_render: ({ isFormControl: l }) => /* @__PURE__ */ G(K, { children: [
130
- /* @__PURE__ */ b(
131
- w,
132
- {
133
- ...d,
134
- ref: a,
135
- __scopeCheckbox: c
136
- }
137
- ),
138
- l && /* @__PURE__ */ b(
139
- q,
140
- {
141
- __scopeCheckbox: c
142
- }
143
- )
144
- ] })
145
- }
146
- );
147
- }
148
- );
149
- Q.displayName = g;
150
- var T = "CheckboxIndicator", V = s.forwardRef(
151
- (t, a) => {
152
- const { __scopeCheckbox: c, forceMount: u, ...r } = t, e = E(T, c);
153
- return /* @__PURE__ */ b(
154
- z,
155
- {
156
- present: u || h(e.checked) || e.checked === !0,
157
- children: /* @__PURE__ */ b(
158
- P.span,
159
- {
160
- "data-state": A(e.checked),
161
- "data-disabled": e.disabled ? "" : void 0,
162
- ...r,
163
- ref: a,
164
- style: { pointerEvents: "none", ...t.style }
165
- }
166
- )
167
- }
168
- );
169
- }
170
- );
171
- V.displayName = T;
172
- var M = "CheckboxBubbleInput", q = s.forwardRef(
173
- ({ __scopeCheckbox: t, ...a }, c) => {
174
- const {
175
- control: u,
176
- hasConsumerStoppedPropagationRef: r,
177
- checked: e,
178
- defaultChecked: p,
179
- required: f,
180
- disabled: i,
181
- name: m,
182
- value: C,
183
- form: d,
184
- bubbleInput: l,
185
- setBubbleInput: v
186
- } = E(M, t), k = B(c, v), x = j(e), _ = H(u);
187
- s.useEffect(() => {
188
- const n = l;
189
- if (!n) return;
190
- const I = window.HTMLInputElement.prototype, y = Object.getOwnPropertyDescriptor(
191
- I,
192
- "checked"
193
- ).set, D = !r.current;
194
- if (x !== e && y) {
195
- const F = new Event("click", { bubbles: D });
196
- n.indeterminate = h(e), y.call(n, h(e) ? !1 : e), n.dispatchEvent(F);
197
- }
198
- }, [l, x, e, r]);
199
- const o = s.useRef(h(e) ? !1 : e);
200
- return /* @__PURE__ */ b(
201
- P.input,
202
- {
203
- type: "checkbox",
204
- "aria-hidden": !0,
205
- defaultChecked: p ?? o.current,
206
- required: f,
207
- disabled: i,
208
- name: m,
209
- value: C,
210
- form: d,
211
- ...a,
212
- tabIndex: -1,
213
- ref: k,
214
- style: {
215
- ...a.style,
216
- ..._,
217
- position: "absolute",
218
- pointerEvents: "none",
219
- opacity: 0,
220
- margin: 0,
221
- // We transform because the input is absolutely positioned but we have
222
- // rendered it **after** the button. This pulls it back to sit on top
223
- // of the button.
224
- transform: "translateX(-100%)"
225
- }
226
- }
227
- );
228
- }
229
- );
230
- q.displayName = M;
231
- function W(t) {
232
- return typeof t == "function";
233
- }
234
- function h(t) {
235
- return t === "indeterminate";
236
- }
237
- function A(t) {
238
- return h(t) ? "indeterminate" : t ? "checked" : "unchecked";
239
- }
240
- export {
241
- Q as Checkbox,
242
- V as CheckboxIndicator,
243
- V as Indicator,
244
- Q as Root,
245
- q as unstable_BubbleInput,
246
- q as unstable_CheckboxBubbleInput,
247
- J as unstable_CheckboxProvider,
248
- w as unstable_CheckboxTrigger,
249
- J as unstable_Provider,
250
- w as unstable_Trigger
251
- };
@@ -1,120 +0,0 @@
1
- import * as o from "react";
2
- import { composeEventHandlers as T } from "./_internal/primitive.js";
3
- import { createContextScope as S } from "./_internal/react-context.js";
4
- import { useControllableState as D } from "./_internal/react-use-controllable-state.js";
5
- import { useLayoutEffect as M } from "./_internal/react-use-layout-effect.js";
6
- import { useComposedRefs as L } from "./_internal/react-compose-refs.js";
7
- import { Primitive as v } from "./_internal/react-primitive.js";
8
- import { Presence as k } from "./_internal/react-presence.js";
9
- import { useId as F } from "./_internal/react-id.js";
10
- import { jsx as c } from "react/jsx-runtime";
11
- var u = "Collapsible", [B, W] = S(u), [G, g] = B(u), w = o.forwardRef(
12
- (e, a) => {
13
- const {
14
- __scopeCollapsible: i,
15
- open: r,
16
- defaultOpen: t,
17
- disabled: l,
18
- onOpenChange: s,
19
- ...m
20
- } = e, [d, p] = D({
21
- prop: r,
22
- defaultProp: t ?? !1,
23
- onChange: s,
24
- caller: u
25
- });
26
- return /* @__PURE__ */ c(
27
- G,
28
- {
29
- scope: i,
30
- disabled: l,
31
- contentId: F(),
32
- open: d,
33
- onOpenToggle: o.useCallback(() => p((C) => !C), [p]),
34
- children: /* @__PURE__ */ c(
35
- v.div,
36
- {
37
- "data-state": h(d),
38
- "data-disabled": l ? "" : void 0,
39
- ...m,
40
- ref: a
41
- }
42
- )
43
- }
44
- );
45
- }
46
- );
47
- w.displayName = u;
48
- var A = "CollapsibleTrigger", I = o.forwardRef(
49
- (e, a) => {
50
- const { __scopeCollapsible: i, ...r } = e, t = g(A, i);
51
- return /* @__PURE__ */ c(
52
- v.button,
53
- {
54
- type: "button",
55
- "aria-controls": t.contentId,
56
- "aria-expanded": t.open || !1,
57
- "data-state": h(t.open),
58
- "data-disabled": t.disabled ? "" : void 0,
59
- disabled: t.disabled,
60
- ...r,
61
- ref: a,
62
- onClick: T(e.onClick, t.onOpenToggle)
63
- }
64
- );
65
- }
66
- );
67
- I.displayName = A;
68
- var R = "CollapsibleContent", O = o.forwardRef(
69
- (e, a) => {
70
- const { forceMount: i, ...r } = e, t = g(R, e.__scopeCollapsible);
71
- return /* @__PURE__ */ c(k, { present: i || t.open, children: ({ present: l }) => /* @__PURE__ */ c($, { ...r, ref: a, present: l }) });
72
- }
73
- );
74
- O.displayName = R;
75
- var $ = o.forwardRef((e, a) => {
76
- const { __scopeCollapsible: i, present: r, children: t, ...l } = e, s = g(R, i), [m, d] = o.useState(r), p = o.useRef(null), C = L(a, p), y = o.useRef(0), x = y.current, N = o.useRef(0), P = N.current, b = s.open || m, _ = o.useRef(b), f = o.useRef(void 0);
77
- return o.useEffect(() => {
78
- const n = requestAnimationFrame(() => _.current = !1);
79
- return () => cancelAnimationFrame(n);
80
- }, []), M(() => {
81
- const n = p.current;
82
- if (n) {
83
- f.current = f.current || {
84
- transitionDuration: n.style.transitionDuration,
85
- animationName: n.style.animationName
86
- }, n.style.transitionDuration = "0s", n.style.animationName = "none";
87
- const E = n.getBoundingClientRect();
88
- y.current = E.height, N.current = E.width, _.current || (n.style.transitionDuration = f.current.transitionDuration, n.style.animationName = f.current.animationName), d(r);
89
- }
90
- }, [s.open, r]), /* @__PURE__ */ c(
91
- v.div,
92
- {
93
- "data-state": h(s.open),
94
- "data-disabled": s.disabled ? "" : void 0,
95
- id: s.contentId,
96
- hidden: !b,
97
- ...l,
98
- ref: C,
99
- style: {
100
- "--radix-collapsible-content-height": x ? `${x}px` : void 0,
101
- "--radix-collapsible-content-width": P ? `${P}px` : void 0,
102
- ...e.style
103
- },
104
- children: b && t
105
- }
106
- );
107
- });
108
- function h(e) {
109
- return e ? "open" : "closed";
110
- }
111
- var X = w, Y = I, Z = O;
112
- export {
113
- w as Collapsible,
114
- O as CollapsibleContent,
115
- I as CollapsibleTrigger,
116
- Z as Content,
117
- X as Root,
118
- Y as Trigger,
119
- W as createCollapsibleScope
120
- };
@@ -1,240 +0,0 @@
1
- import * as a from "react";
2
- import { composeEventHandlers as f } from "./_internal/primitive.js";
3
- import { createContextScope as B } from "./_internal/react-context.js";
4
- import { Primitive as F } from "./_internal/react-primitive.js";
5
- import { Root as X, Group as j, Portal as H, RadioGroup as W, Sub as $, Anchor as K, createMenuScope as h, CheckboxItem as Y, ItemIndicator as q, Content as z, Item as J, Label as Q, RadioItem as V, Separator as Z, SubContent as ee, SubTrigger as te, Arrow as ne } from "./react-menu.js";
6
- import { useCallbackRef as oe } from "./_internal/react-use-callback-ref.js";
7
- import { useControllableState as re } from "./_internal/react-use-controllable-state.js";
8
- import { jsx as u, jsxs as ae, Fragment as ue } from "react/jsx-runtime";
9
- var v = "ContextMenu", [ie] = B(v, [
10
- h
11
- ]), i = h(), [ce, g] = ie(v), R = (e) => {
12
- const { __scopeContextMenu: n, children: o, onOpenChange: t, dir: r, modal: l = !0 } = e, [p, c] = a.useState(!1), d = i(n), C = oe(t), s = a.useCallback(
13
- (m) => {
14
- c(m), C(m);
15
- },
16
- [C]
17
- );
18
- return /* @__PURE__ */ u(
19
- ce,
20
- {
21
- scope: n,
22
- open: p,
23
- onOpenChange: s,
24
- modal: l,
25
- children: /* @__PURE__ */ u(
26
- X,
27
- {
28
- ...d,
29
- dir: r,
30
- open: p,
31
- onOpenChange: s,
32
- modal: l,
33
- children: o
34
- }
35
- )
36
- }
37
- );
38
- };
39
- R.displayName = v;
40
- var _ = "ContextMenuTrigger", P = a.forwardRef(
41
- (e, n) => {
42
- const { __scopeContextMenu: o, disabled: t = !1, ...r } = e, l = g(_, o), p = i(o), c = a.useRef({ x: 0, y: 0 }), d = a.useRef({
43
- getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...c.current })
44
- }), C = a.useRef(0), s = a.useCallback(
45
- () => window.clearTimeout(C.current),
46
- []
47
- ), m = (x) => {
48
- c.current = { x: x.clientX, y: x.clientY }, l.onOpenChange(!0);
49
- };
50
- return a.useEffect(() => s, [s]), a.useEffect(() => void (t && s()), [t, s]), /* @__PURE__ */ ae(ue, { children: [
51
- /* @__PURE__ */ u(K, { ...p, virtualRef: d }),
52
- /* @__PURE__ */ u(
53
- F.span,
54
- {
55
- "data-state": l.open ? "open" : "closed",
56
- "data-disabled": t ? "" : void 0,
57
- ...r,
58
- ref: n,
59
- style: { WebkitTouchCallout: "none", ...e.style },
60
- onContextMenu: t ? e.onContextMenu : f(e.onContextMenu, (x) => {
61
- s(), m(x), x.preventDefault();
62
- }),
63
- onPointerDown: t ? e.onPointerDown : f(
64
- e.onPointerDown,
65
- M((x) => {
66
- s(), C.current = window.setTimeout(() => m(x), 700);
67
- })
68
- ),
69
- onPointerMove: t ? e.onPointerMove : f(e.onPointerMove, M(s)),
70
- onPointerCancel: t ? e.onPointerCancel : f(e.onPointerCancel, M(s)),
71
- onPointerUp: t ? e.onPointerUp : f(e.onPointerUp, M(s))
72
- }
73
- )
74
- ] });
75
- }
76
- );
77
- P.displayName = _;
78
- var se = "ContextMenuPortal", S = (e) => {
79
- const { __scopeContextMenu: n, ...o } = e, t = i(n);
80
- return /* @__PURE__ */ u(H, { ...t, ...o });
81
- };
82
- S.displayName = se;
83
- var b = "ContextMenuContent", I = a.forwardRef(
84
- (e, n) => {
85
- const { __scopeContextMenu: o, ...t } = e, r = g(b, o), l = i(o), p = a.useRef(!1);
86
- return /* @__PURE__ */ u(
87
- z,
88
- {
89
- ...l,
90
- ...t,
91
- ref: n,
92
- side: "right",
93
- sideOffset: 2,
94
- align: "start",
95
- onCloseAutoFocus: (c) => {
96
- var d;
97
- (d = e.onCloseAutoFocus) == null || d.call(e, c), !c.defaultPrevented && p.current && c.preventDefault(), p.current = !1;
98
- },
99
- onInteractOutside: (c) => {
100
- var d;
101
- (d = e.onInteractOutside) == null || d.call(e, c), !c.defaultPrevented && !r.modal && (p.current = !0);
102
- },
103
- style: {
104
- ...e.style,
105
- "--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
106
- "--radix-context-menu-content-available-width": "var(--radix-popper-available-width)",
107
- "--radix-context-menu-content-available-height": "var(--radix-popper-available-height)",
108
- "--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)",
109
- "--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)"
110
- }
111
- }
112
- );
113
- }
114
- );
115
- I.displayName = b;
116
- var de = "ContextMenuGroup", N = a.forwardRef(
117
- (e, n) => {
118
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
119
- return /* @__PURE__ */ u(j, { ...r, ...t, ref: n });
120
- }
121
- );
122
- N.displayName = de;
123
- var pe = "ContextMenuLabel", w = a.forwardRef(
124
- (e, n) => {
125
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
126
- return /* @__PURE__ */ u(Q, { ...r, ...t, ref: n });
127
- }
128
- );
129
- w.displayName = pe;
130
- var le = "ContextMenuItem", A = a.forwardRef(
131
- (e, n) => {
132
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
133
- return /* @__PURE__ */ u(J, { ...r, ...t, ref: n });
134
- }
135
- );
136
- A.displayName = le;
137
- var xe = "ContextMenuCheckboxItem", E = a.forwardRef((e, n) => {
138
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
139
- return /* @__PURE__ */ u(Y, { ...r, ...t, ref: n });
140
- });
141
- E.displayName = xe;
142
- var Ce = "ContextMenuRadioGroup", O = a.forwardRef((e, n) => {
143
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
144
- return /* @__PURE__ */ u(W, { ...r, ...t, ref: n });
145
- });
146
- O.displayName = Ce;
147
- var me = "ContextMenuRadioItem", T = a.forwardRef((e, n) => {
148
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
149
- return /* @__PURE__ */ u(V, { ...r, ...t, ref: n });
150
- });
151
- T.displayName = me;
152
- var fe = "ContextMenuItemIndicator", y = a.forwardRef((e, n) => {
153
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
154
- return /* @__PURE__ */ u(q, { ...r, ...t, ref: n });
155
- });
156
- y.displayName = fe;
157
- var Me = "ContextMenuSeparator", G = a.forwardRef((e, n) => {
158
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
159
- return /* @__PURE__ */ u(Z, { ...r, ...t, ref: n });
160
- });
161
- G.displayName = Me;
162
- var ve = "ContextMenuArrow", he = a.forwardRef(
163
- (e, n) => {
164
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
165
- return /* @__PURE__ */ u(ne, { ...r, ...t, ref: n });
166
- }
167
- );
168
- he.displayName = ve;
169
- var k = "ContextMenuSub", D = (e) => {
170
- const { __scopeContextMenu: n, children: o, onOpenChange: t, open: r, defaultOpen: l } = e, p = i(n), [c, d] = re({
171
- prop: r,
172
- defaultProp: l ?? !1,
173
- onChange: t,
174
- caller: k
175
- });
176
- return /* @__PURE__ */ u($, { ...p, open: c, onOpenChange: d, children: o });
177
- };
178
- D.displayName = k;
179
- var ge = "ContextMenuSubTrigger", L = a.forwardRef((e, n) => {
180
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
181
- return /* @__PURE__ */ u(te, { ...r, ...t, ref: n });
182
- });
183
- L.displayName = ge;
184
- var Re = "ContextMenuSubContent", U = a.forwardRef((e, n) => {
185
- const { __scopeContextMenu: o, ...t } = e, r = i(o);
186
- return /* @__PURE__ */ u(
187
- ee,
188
- {
189
- ...r,
190
- ...t,
191
- ref: n,
192
- style: {
193
- ...e.style,
194
- "--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
195
- "--radix-context-menu-content-available-width": "var(--radix-popper-available-width)",
196
- "--radix-context-menu-content-available-height": "var(--radix-popper-available-height)",
197
- "--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)",
198
- "--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)"
199
- }
200
- }
201
- );
202
- });
203
- U.displayName = Re;
204
- function M(e) {
205
- return (n) => n.pointerType !== "mouse" ? e(n) : void 0;
206
- }
207
- var Ae = R, Ee = P, Oe = S, Te = I, ye = N, Ge = w, ke = A, De = E, Le = O, Ue = T, Be = y, Fe = G, Xe = D, je = L, He = U;
208
- export {
209
- De as CheckboxItem,
210
- Te as Content,
211
- R as ContextMenu,
212
- he as ContextMenuArrow,
213
- E as ContextMenuCheckboxItem,
214
- I as ContextMenuContent,
215
- N as ContextMenuGroup,
216
- A as ContextMenuItem,
217
- y as ContextMenuItemIndicator,
218
- w as ContextMenuLabel,
219
- S as ContextMenuPortal,
220
- O as ContextMenuRadioGroup,
221
- T as ContextMenuRadioItem,
222
- G as ContextMenuSeparator,
223
- D as ContextMenuSub,
224
- U as ContextMenuSubContent,
225
- L as ContextMenuSubTrigger,
226
- P as ContextMenuTrigger,
227
- ye as Group,
228
- ke as Item,
229
- Be as ItemIndicator,
230
- Ge as Label,
231
- Oe as Portal,
232
- Le as RadioGroup,
233
- Ue as RadioItem,
234
- Ae as Root,
235
- Fe as Separator,
236
- Xe as Sub,
237
- He as SubContent,
238
- je as SubTrigger,
239
- Ee as Trigger
240
- };