@admin-layout/tailwind-ui 10.1.1-alpha.9 → 12.0.16-alpha.14

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 (263) hide show
  1. package/lib/components/Button/Button.d.ts +13 -0
  2. package/lib/components/Button/Button.d.ts.map +1 -0
  3. package/lib/components/Button/Button.js +50 -0
  4. package/lib/components/Button/Button.js.map +1 -0
  5. package/lib/components/DatePicker/DatePicker.d.ts +5 -0
  6. package/lib/components/DatePicker/DatePicker.d.ts.map +1 -0
  7. package/lib/components/DatePicker/DatePicker.js +218 -0
  8. package/lib/components/DatePicker/DatePicker.js.map +1 -0
  9. package/lib/components/DatePicker/index.d.ts +3 -0
  10. package/lib/components/DatePicker/index.d.ts.map +1 -0
  11. package/lib/components/DatePicker/machine.d.ts +3 -0
  12. package/lib/components/DatePicker/machine.d.ts.map +1 -0
  13. package/lib/components/DatePicker/machine.js +95 -0
  14. package/lib/components/DatePicker/machine.js.map +1 -0
  15. package/lib/components/DatePicker/types.d.ts +34 -0
  16. package/lib/components/DatePicker/types.d.ts.map +1 -0
  17. package/lib/components/DatePicker/utils.d.ts +25 -0
  18. package/lib/components/DatePicker/utils.d.ts.map +1 -0
  19. package/lib/components/DatePicker/utils.js +28 -0
  20. package/lib/components/DatePicker/utils.js.map +1 -0
  21. package/lib/components/ReactTable/Table.d.ts.map +1 -1
  22. package/lib/components/ThemeProvider/ThemeProvider.d.ts +14 -0
  23. package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -0
  24. package/lib/components/ThemeProvider/ThemeProvider.js +96 -0
  25. package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -0
  26. package/lib/components/ThemeProvider/ThemeToggle.d.ts +7 -0
  27. package/lib/components/ThemeProvider/ThemeToggle.d.ts.map +1 -0
  28. package/lib/components/ThemeProvider/ThemeToggle.js +50 -0
  29. package/lib/components/ThemeProvider/ThemeToggle.js.map +1 -0
  30. package/lib/components/ThemeProvider/index.d.ts +4 -0
  31. package/lib/components/ThemeProvider/index.d.ts.map +1 -0
  32. package/lib/components/ThemeProvider/types.d.ts +25 -0
  33. package/lib/components/ThemeProvider/types.d.ts.map +1 -0
  34. package/lib/components/index.d.ts +3 -0
  35. package/lib/components/index.d.ts.map +1 -1
  36. package/lib/hooks/index.d.ts +4 -0
  37. package/lib/hooks/index.d.ts.map +1 -0
  38. package/lib/hooks/useTheme.d.ts +2 -0
  39. package/lib/hooks/useTheme.d.ts.map +1 -0
  40. package/lib/hooks/useTheme.js +7 -0
  41. package/lib/hooks/useTheme.js.map +1 -0
  42. package/lib/hooks/useWindowSize.d.ts +5 -0
  43. package/lib/hooks/useWindowSize.d.ts.map +1 -0
  44. package/lib/hooks/useWindowSize.js +20 -0
  45. package/lib/hooks/useWindowSize.js.map +1 -0
  46. package/lib/index.d.ts +1 -1
  47. package/lib/index.d.ts.map +1 -1
  48. package/lib/index.js +1 -1
  49. package/lib/shardui/accordion.d.ts +8 -0
  50. package/lib/shardui/accordion.d.ts.map +1 -0
  51. package/lib/shardui/accordion.js +40 -0
  52. package/lib/shardui/accordion.js.map +1 -0
  53. package/lib/shardui/alert-dialog.d.ts +21 -0
  54. package/lib/shardui/alert-dialog.d.ts.map +1 -0
  55. package/lib/shardui/alert-dialog.js +77 -0
  56. package/lib/shardui/alert-dialog.js.map +1 -0
  57. package/lib/shardui/alert.d.ts +9 -0
  58. package/lib/shardui/alert.d.ts.map +1 -0
  59. package/lib/shardui/alert.js +42 -0
  60. package/lib/shardui/alert.js.map +1 -0
  61. package/lib/shardui/aspect-ratio.d.ts +4 -0
  62. package/lib/shardui/aspect-ratio.d.ts.map +1 -0
  63. package/lib/shardui/aspect-ratio.js +1 -0
  64. package/lib/shardui/aspect-ratio.js.map +1 -0
  65. package/lib/shardui/avatar.d.ts +7 -0
  66. package/lib/shardui/avatar.d.ts.map +1 -0
  67. package/lib/shardui/avatar.js +27 -0
  68. package/lib/shardui/avatar.js.map +1 -0
  69. package/lib/shardui/badge.d.ts +10 -0
  70. package/lib/shardui/badge.d.ts.map +1 -0
  71. package/lib/shardui/badge.js +25 -0
  72. package/lib/shardui/badge.js.map +1 -0
  73. package/lib/shardui/breadcrumb.d.ts +20 -0
  74. package/lib/shardui/breadcrumb.d.ts.map +1 -0
  75. package/lib/shardui/breadcrumb.js +79 -0
  76. package/lib/shardui/breadcrumb.js.map +1 -0
  77. package/lib/shardui/button.d.ts +12 -0
  78. package/lib/shardui/button.d.ts.map +1 -0
  79. package/lib/shardui/button.js +41 -0
  80. package/lib/shardui/button.js.map +1 -0
  81. package/lib/shardui/calendar.d.ts +9 -0
  82. package/lib/shardui/calendar.d.ts.map +1 -0
  83. package/lib/shardui/calendar.js +53 -0
  84. package/lib/shardui/calendar.js.map +1 -0
  85. package/lib/shardui/card.d.ts +9 -0
  86. package/lib/shardui/card.d.ts.map +1 -0
  87. package/lib/shardui/card.js +54 -0
  88. package/lib/shardui/card.js.map +1 -0
  89. package/lib/shardui/carousel.d.ts +19 -0
  90. package/lib/shardui/carousel.d.ts.map +1 -0
  91. package/lib/shardui/carousel.js +176 -0
  92. package/lib/shardui/carousel.js.map +1 -0
  93. package/lib/shardui/chart.d.ts +63 -0
  94. package/lib/shardui/chart.d.ts.map +1 -0
  95. package/lib/shardui/chart.js +197 -0
  96. package/lib/shardui/chart.js.map +1 -0
  97. package/lib/shardui/checkbox.d.ts +5 -0
  98. package/lib/shardui/checkbox.d.ts.map +1 -0
  99. package/lib/shardui/checkbox.js +15 -0
  100. package/lib/shardui/checkbox.js.map +1 -0
  101. package/lib/shardui/collapsible.d.ts +6 -0
  102. package/lib/shardui/collapsible.d.ts.map +1 -0
  103. package/lib/shardui/collapsible.js +3 -0
  104. package/lib/shardui/collapsible.js.map +1 -0
  105. package/lib/shardui/command.d.ts +83 -0
  106. package/lib/shardui/command.d.ts.map +1 -0
  107. package/lib/shardui/command.js +91 -0
  108. package/lib/shardui/command.js.map +1 -0
  109. package/lib/shardui/context-menu.d.ts +28 -0
  110. package/lib/shardui/context-menu.d.ts.map +1 -0
  111. package/lib/shardui/context-menu.js +117 -0
  112. package/lib/shardui/context-menu.js.map +1 -0
  113. package/lib/shardui/dialog.d.ts +20 -0
  114. package/lib/shardui/dialog.d.ts.map +1 -0
  115. package/lib/shardui/dialog.js +67 -0
  116. package/lib/shardui/dialog.js.map +1 -0
  117. package/lib/shardui/drawer.d.ts +23 -0
  118. package/lib/shardui/drawer.d.ts.map +1 -0
  119. package/lib/shardui/drawer.js +69 -0
  120. package/lib/shardui/drawer.js.map +1 -0
  121. package/lib/shardui/dropdown-menu.d.ts +28 -0
  122. package/lib/shardui/dropdown-menu.d.ts.map +1 -0
  123. package/lib/shardui/dropdown-menu.js +119 -0
  124. package/lib/shardui/dropdown-menu.js.map +1 -0
  125. package/lib/shardui/form.d.ts +24 -0
  126. package/lib/shardui/form.d.ts.map +1 -0
  127. package/lib/shardui/form.js +126 -0
  128. package/lib/shardui/form.js.map +1 -0
  129. package/lib/shardui/hover-card.d.ts +7 -0
  130. package/lib/shardui/hover-card.d.ts.map +1 -0
  131. package/lib/shardui/hover-card.js +15 -0
  132. package/lib/shardui/hover-card.js.map +1 -0
  133. package/lib/shardui/index.d.ts +50 -0
  134. package/lib/shardui/index.d.ts.map +1 -0
  135. package/lib/shardui/index.js +1 -0
  136. package/lib/shardui/index.js.map +1 -0
  137. package/lib/shardui/input-otp.d.ts +35 -0
  138. package/lib/shardui/input-otp.d.ts.map +1 -0
  139. package/lib/shardui/input-otp.js +53 -0
  140. package/lib/shardui/input-otp.js.map +1 -0
  141. package/lib/shardui/input.d.ts +4 -0
  142. package/lib/shardui/input.d.ts.map +1 -0
  143. package/lib/shardui/input.js +13 -0
  144. package/lib/shardui/input.js.map +1 -0
  145. package/lib/shardui/label.d.ts +6 -0
  146. package/lib/shardui/label.d.ts.map +1 -0
  147. package/lib/shardui/label.js +10 -0
  148. package/lib/shardui/label.js.map +1 -0
  149. package/lib/shardui/menubar.d.ts +34 -0
  150. package/lib/shardui/menubar.d.ts.map +1 -0
  151. package/lib/shardui/menubar.js +140 -0
  152. package/lib/shardui/menubar.js.map +1 -0
  153. package/lib/shardui/navigation-menu.d.ts +13 -0
  154. package/lib/shardui/navigation-menu.d.ts.map +1 -0
  155. package/lib/shardui/navigation-menu.js +70 -0
  156. package/lib/shardui/navigation-menu.js.map +1 -0
  157. package/lib/shardui/pagination.d.ts +29 -0
  158. package/lib/shardui/pagination.d.ts.map +1 -0
  159. package/lib/shardui/pagination.js +87 -0
  160. package/lib/shardui/pagination.js.map +1 -0
  161. package/lib/shardui/popover.d.ts +7 -0
  162. package/lib/shardui/popover.d.ts.map +1 -0
  163. package/lib/shardui/popover.js +17 -0
  164. package/lib/shardui/popover.js.map +1 -0
  165. package/lib/shardui/progress.d.ts +5 -0
  166. package/lib/shardui/progress.d.ts.map +1 -0
  167. package/lib/shardui/progress.js +16 -0
  168. package/lib/shardui/progress.js.map +1 -0
  169. package/lib/shardui/radio-group.d.ts +6 -0
  170. package/lib/shardui/radio-group.d.ts.map +1 -0
  171. package/lib/shardui/radio-group.js +28 -0
  172. package/lib/shardui/radio-group.js.map +1 -0
  173. package/lib/shardui/resizable.d.ts +24 -0
  174. package/lib/shardui/resizable.d.ts.map +1 -0
  175. package/lib/shardui/resizable.js +22 -0
  176. package/lib/shardui/resizable.js.map +1 -0
  177. package/lib/shardui/scroll-area.d.ts +6 -0
  178. package/lib/shardui/scroll-area.d.ts.map +1 -0
  179. package/lib/shardui/scroll-area.js +28 -0
  180. package/lib/shardui/scroll-area.js.map +1 -0
  181. package/lib/shardui/select.d.ts +14 -0
  182. package/lib/shardui/select.d.ts.map +1 -0
  183. package/lib/shardui/select.js +99 -0
  184. package/lib/shardui/select.js.map +1 -0
  185. package/lib/shardui/separator.d.ts +5 -0
  186. package/lib/shardui/separator.d.ts.map +1 -0
  187. package/lib/shardui/separator.js +13 -0
  188. package/lib/shardui/separator.js.map +1 -0
  189. package/lib/shardui/sheet.d.ts +26 -0
  190. package/lib/shardui/sheet.d.ts.map +1 -0
  191. package/lib/shardui/sheet.js +84 -0
  192. package/lib/shardui/sheet.js.map +1 -0
  193. package/lib/shardui/sidebar.d.ts +67 -0
  194. package/lib/shardui/sidebar.d.ts.map +1 -0
  195. package/lib/shardui/sidebar.js +490 -0
  196. package/lib/shardui/sidebar.js.map +1 -0
  197. package/lib/shardui/skeleton.d.ts +3 -0
  198. package/lib/shardui/skeleton.d.ts.map +1 -0
  199. package/lib/shardui/skeleton.js +9 -0
  200. package/lib/shardui/skeleton.js.map +1 -0
  201. package/lib/shardui/slider.d.ts +5 -0
  202. package/lib/shardui/slider.d.ts.map +1 -0
  203. package/lib/shardui/slider.js +17 -0
  204. package/lib/shardui/slider.js.map +1 -0
  205. package/lib/shardui/sonner.d.ts +5 -0
  206. package/lib/shardui/sonner.d.ts.map +1 -0
  207. package/lib/shardui/sonner.js +20 -0
  208. package/lib/shardui/sonner.js.map +1 -0
  209. package/lib/shardui/switch.d.ts +5 -0
  210. package/lib/shardui/switch.d.ts.map +1 -0
  211. package/lib/shardui/switch.js +12 -0
  212. package/lib/shardui/switch.js.map +1 -0
  213. package/lib/shardui/table.d.ts +11 -0
  214. package/lib/shardui/table.d.ts.map +1 -0
  215. package/lib/shardui/table.js +75 -0
  216. package/lib/shardui/table.js.map +1 -0
  217. package/lib/shardui/tabs.d.ts +8 -0
  218. package/lib/shardui/tabs.d.ts.map +1 -0
  219. package/lib/shardui/tabs.js +28 -0
  220. package/lib/shardui/tabs.js.map +1 -0
  221. package/lib/shardui/textarea.d.ts +6 -0
  222. package/lib/shardui/textarea.d.ts.map +1 -0
  223. package/lib/shardui/textarea.js +11 -0
  224. package/lib/shardui/textarea.js.map +1 -0
  225. package/lib/shardui/toast.d.ts +16 -0
  226. package/lib/shardui/toast.d.ts.map +1 -0
  227. package/lib/shardui/toast.js +75 -0
  228. package/lib/shardui/toast.js.map +1 -0
  229. package/lib/shardui/toaster.d.ts +2 -0
  230. package/lib/shardui/toaster.d.ts.map +1 -0
  231. package/lib/shardui/toaster.js +26 -0
  232. package/lib/shardui/toaster.js.map +1 -0
  233. package/lib/shardui/toggle-group.d.ts +13 -0
  234. package/lib/shardui/toggle-group.d.ts.map +1 -0
  235. package/lib/shardui/toggle-group.js +42 -0
  236. package/lib/shardui/toggle-group.js.map +1 -0
  237. package/lib/shardui/toggle.d.ts +13 -0
  238. package/lib/shardui/toggle.d.ts.map +1 -0
  239. package/lib/shardui/toggle.js +32 -0
  240. package/lib/shardui/toggle.js.map +1 -0
  241. package/lib/shardui/tooltip.d.ts +8 -0
  242. package/lib/shardui/tooltip.d.ts.map +1 -0
  243. package/lib/shardui/tooltip.js +14 -0
  244. package/lib/shardui/tooltip.js.map +1 -0
  245. package/lib/shardui/use-toast.d.ts +3 -0
  246. package/lib/shardui/use-toast.d.ts.map +1 -0
  247. package/lib/utils/hooks/use-mobile.d.ts +2 -0
  248. package/lib/utils/hooks/use-mobile.d.ts.map +1 -0
  249. package/lib/utils/hooks/use-mobile.js +14 -0
  250. package/lib/utils/hooks/use-mobile.js.map +1 -0
  251. package/lib/utils/hooks/use-toast.d.ts +45 -0
  252. package/lib/utils/hooks/use-toast.d.ts.map +1 -0
  253. package/lib/utils/hooks/use-toast.js +133 -0
  254. package/lib/utils/hooks/use-toast.js.map +1 -0
  255. package/lib/utils/index.d.ts +7 -1
  256. package/lib/utils/index.d.ts.map +1 -1
  257. package/lib/utils/isBrowser/index.js +1 -0
  258. package/lib/utils/isBrowser/index.js.map +1 -0
  259. package/lib/utils/util.d.ts +3 -0
  260. package/lib/utils/util.d.ts.map +1 -0
  261. package/lib/utils/util.js +3 -0
  262. package/lib/utils/util.js.map +1 -0
  263. package/package.json +50 -3
@@ -0,0 +1,197 @@
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as React from'react';import*as RechartsPrimitive from'recharts';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'fast-deep-equal/react.js';// Format: { THEME_NAME: CSS_SELECTOR }
2
+ const THEMES = {
3
+ light: '',
4
+ dark: '.dark'
5
+ };
6
+ const ChartContext = React.createContext(null);
7
+ function useChart() {
8
+ const context = React.useContext(ChartContext);
9
+ if (!context) {
10
+ throw new Error('useChart must be used within a <ChartContainer />');
11
+ }
12
+ return context;
13
+ }
14
+ const ChartContainer = React.forwardRef(({
15
+ id,
16
+ className,
17
+ children,
18
+ config,
19
+ ...props
20
+ }, ref) => {
21
+ const uniqueId = React.useId();
22
+ const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
23
+ return jsx(ChartContext.Provider, {
24
+ value: {
25
+ config
26
+ },
27
+ children: jsxs("div", {
28
+ "data-chart": chartId,
29
+ ref: ref,
30
+ className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none", className),
31
+ ...props,
32
+ children: [jsx(ChartStyle, {
33
+ id: chartId,
34
+ config: config
35
+ }), jsx(RechartsPrimitive.ResponsiveContainer, {
36
+ children: children
37
+ })]
38
+ })
39
+ });
40
+ });
41
+ ChartContainer.displayName = 'Chart';
42
+ const ChartStyle = ({
43
+ id,
44
+ config
45
+ }) => {
46
+ const colorConfig = Object.entries(config).filter(([_, config]) => config.theme || config.color);
47
+ if (!colorConfig.length) {
48
+ return null;
49
+ }
50
+ return jsx("style", {
51
+ dangerouslySetInnerHTML: {
52
+ __html: Object.entries(THEMES).map(([theme, prefix]) => `
53
+ ${prefix} [data-chart=${id}] {
54
+ ${colorConfig.map(([key, itemConfig]) => {
55
+ const color = itemConfig.theme?.[theme] || itemConfig.color;
56
+ return color ? ` --color-${key}: ${color};` : null;
57
+ }).join('\n')}
58
+ }
59
+ `).join('\n')
60
+ }
61
+ });
62
+ };
63
+ const ChartTooltip = RechartsPrimitive.Tooltip;
64
+ const ChartTooltipContent = React.forwardRef(({
65
+ active,
66
+ payload,
67
+ className,
68
+ indicator = 'dot',
69
+ hideLabel = false,
70
+ hideIndicator = false,
71
+ label,
72
+ labelFormatter,
73
+ labelClassName,
74
+ formatter,
75
+ color,
76
+ nameKey,
77
+ labelKey
78
+ }, ref) => {
79
+ const {
80
+ config
81
+ } = useChart();
82
+ const tooltipLabel = React.useMemo(() => {
83
+ if (hideLabel || !payload?.length) {
84
+ return null;
85
+ }
86
+ const [item] = payload;
87
+ const key = `${labelKey || item.dataKey || item.name || 'value'}`;
88
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
89
+ const value = !labelKey && typeof label === 'string' ? config[label]?.label || label : itemConfig?.label;
90
+ if (labelFormatter) {
91
+ return jsx("div", {
92
+ className: cn('font-medium', labelClassName),
93
+ children: labelFormatter(value, payload)
94
+ });
95
+ }
96
+ if (!value) {
97
+ return null;
98
+ }
99
+ return jsx("div", {
100
+ className: cn('font-medium', labelClassName),
101
+ children: value
102
+ });
103
+ }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
104
+ if (!active || !payload?.length) {
105
+ return null;
106
+ }
107
+ const nestLabel = payload.length === 1 && indicator !== 'dot';
108
+ return jsxs("div", {
109
+ ref: ref,
110
+ className: cn('grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl', className),
111
+ children: [!nestLabel ? tooltipLabel : null, jsx("div", {
112
+ className: "grid gap-1.5",
113
+ children: payload.map((item, index) => {
114
+ const key = `${nameKey || item.name || item.dataKey || 'value'}`;
115
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
116
+ const indicatorColor = color || item.payload.fill || item.color;
117
+ return jsx("div", {
118
+ className: cn('flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground', indicator === 'dot' && 'items-center'),
119
+ children: formatter && item?.value !== undefined && item.name ? formatter(item.value, item.name, item, index, item.payload) : jsxs(Fragment, {
120
+ children: [itemConfig?.icon ? jsx(itemConfig.icon, {}) : !hideIndicator && jsx("div", {
121
+ className: cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {
122
+ 'h-2.5 w-2.5': indicator === 'dot',
123
+ 'w-1': indicator === 'line',
124
+ 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
125
+ 'my-0.5': nestLabel && indicator === 'dashed'
126
+ }),
127
+ style: {
128
+ '--color-bg': indicatorColor,
129
+ '--color-border': indicatorColor
130
+ }
131
+ }), jsxs("div", {
132
+ className: cn('flex flex-1 justify-between leading-none', nestLabel ? 'items-end' : 'items-center'),
133
+ children: [jsxs("div", {
134
+ className: "grid gap-1.5",
135
+ children: [nestLabel ? tooltipLabel : null, jsx("span", {
136
+ className: "text-muted-foreground",
137
+ children: itemConfig?.label || item.name
138
+ })]
139
+ }), item.value && jsx("span", {
140
+ className: "font-mono font-medium tabular-nums text-foreground",
141
+ children: item.value.toLocaleString()
142
+ })]
143
+ })]
144
+ })
145
+ }, item.dataKey);
146
+ })
147
+ })]
148
+ });
149
+ });
150
+ ChartTooltipContent.displayName = 'ChartTooltip';
151
+ const ChartLegend = RechartsPrimitive.Legend;
152
+ const ChartLegendContent = React.forwardRef(({
153
+ className,
154
+ hideIcon = false,
155
+ payload,
156
+ verticalAlign = 'bottom',
157
+ nameKey
158
+ }, ref) => {
159
+ const {
160
+ config
161
+ } = useChart();
162
+ if (!payload?.length) {
163
+ return null;
164
+ }
165
+ return jsx("div", {
166
+ ref: ref,
167
+ className: cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className),
168
+ children: payload.map(item => {
169
+ const key = `${nameKey || item.dataKey || 'value'}`;
170
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
171
+ return jsxs("div", {
172
+ className: cn('flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground'),
173
+ children: [itemConfig?.icon && !hideIcon ? jsx(itemConfig.icon, {}) : jsx("div", {
174
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
175
+ style: {
176
+ backgroundColor: item.color
177
+ }
178
+ }), itemConfig?.label]
179
+ }, item.value);
180
+ })
181
+ });
182
+ });
183
+ ChartLegendContent.displayName = 'ChartLegend';
184
+ // Helper to extract item config from a payload.
185
+ function getPayloadConfigFromPayload(config, payload, key) {
186
+ if (typeof payload !== 'object' || payload === null) {
187
+ return undefined;
188
+ }
189
+ const payloadPayload = 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null ? payload.payload : undefined;
190
+ let configLabelKey = key;
191
+ if (key in payload && typeof payload[key] === 'string') {
192
+ configLabelKey = payload[key];
193
+ } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === 'string') {
194
+ configLabelKey = payloadPayload[key];
195
+ }
196
+ return configLabelKey in config ? config[configLabelKey] : config[key];
197
+ }export{ChartContainer,ChartLegend,ChartLegendContent,ChartStyle,ChartTooltip,ChartTooltipContent};//# sourceMappingURL=chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart.js","sources":["../../src/shardui/chart.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";MAMqD,MAAA,GAAA;AAErD,EAAM,KAAA,EAAA,EAAA;MACA,EAAA;AACE,CAAA;AACA,MAAA,YAAY,GAAC,mBAAc,CAAA,IAAA,CAAA;AAC9B,SAAI,QAAA,GAAA;QAAE,OAAQ,GAAA,KAAO,CAAA,UAAA,CAAA,YAAA,CAAA;cAAO,EAAE;UAAU,IAAA,KAAA,CAAA,mDAAA,CAAA;;SAAsB;;AACjE,MAAA,cAAA,GAAA,KAAA,CAAA,UAAA,CAAA,CAAA;AAkBF,EAAA,EAAA;;;;AA6BA,EAAA,GAAA;MAAwC;QAAgB,gBAAa,CAAA,KAAA,EAAA;AAAE,EAAA,MAAA,OAAA,GAAA,CAAA,MAAA,EAAA,EAAA,IAAA,QAAA,CAAA,OA2BrE,CAAA,IAAA,EAAA,EAAA,CAAA,CAAA,CAAA;AAEF,EAAA,OAAAA,GAAA,CAAM,YAAY,CAAA,QAAA,EAAA;AAElB,IAAA;;;;;;;;;;;;;;;;;;;;;;;kBAI+B,CAAA,MAAA,EAAA;;;aAGT,OAAM,EAAA;2BACC,EAAA;gDAmI5B,EAAC,MAAA,CAAA,KAAA;AAGF,EAAA,MAAA,CAAA,aAAiB,EAAA,EAAA,CAAA;AAEjB,EAAA,YAAM,GAAkB,CAAA,CAAA,CAAA,GAAA,EAAA,UAAA,CAAA,KAAA;mBAIM,GAAA,UAAA,CAAA,KAAA,GAAA,KAAA,CAAA,IAAA,UAAA,CAAA,KAAA;eACF,KAAA,GAAA,CAAA,UAAA,EAAA,GAAA,CAAA,EAAA,EAAA,KAAA,CAAA,CAAA,CAAA,GAAA,IAAA;;AA0E5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
+ export { Checkbox };
5
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/shardui/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAK9D,QAAA,MAAM,QAAQ,iKAgBZ,CAAC;AAGH,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import {jsx}from'react/jsx-runtime';import*as React from'react';import*as CheckboxPrimitive from'@radix-ui/react-checkbox';import {Check}from'lucide-react';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'fast-deep-equal/react.js';const Checkbox = React.forwardRef(({
2
+ className,
3
+ ...props
4
+ }, ref) => jsx(CheckboxPrimitive.Root, {
5
+ ref: ref,
6
+ className: cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground', className),
7
+ ...props,
8
+ children: jsx(CheckboxPrimitive.Indicator, {
9
+ className: cn('flex items-center justify-center text-current'),
10
+ children: jsx(Check, {
11
+ className: "h-4 w-4"
12
+ })
13
+ })
14
+ }));
15
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;export{Checkbox};//# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -0,0 +1,6 @@
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
+ declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
+ declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
5
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
6
+ //# sourceMappingURL=collapsible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/shardui/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAEpE,QAAA,MAAM,WAAW,kIAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,4IAA0C,CAAC;AAEnE,QAAA,MAAM,kBAAkB,yIAA0C,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import*as CollapsiblePrimitive from'@radix-ui/react-collapsible';const Collapsible = CollapsiblePrimitive.Root;
2
+ const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
3
+ const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;export{Collapsible,CollapsibleContent,CollapsibleTrigger};//# sourceMappingURL=collapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapsible.js","sources":["../../src/shardui/collapsible.tsx"],"sourcesContent":[null],"names":[],"mappings":"iEAEA,MAAA,WAAiB,GAAA,oBAAA,CAAA;AAEjB,MAAA,kBAAwB,GAAA,oBAAA,CAAA;AAExB,MAAA,kBAAwB,GAAA,oBAAA,CAAA"}
@@ -0,0 +1,83 @@
1
+ import * as React from 'react';
2
+ import { type DialogProps } from '@radix-ui/react-dialog';
3
+ declare const Command: React.ForwardRefExoticComponent<Omit<{
4
+ children?: React.ReactNode;
5
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
6
+ ref?: React.Ref<HTMLDivElement>;
7
+ } & {
8
+ asChild?: boolean;
9
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
10
+ label?: string;
11
+ shouldFilter?: boolean;
12
+ filter?: (value: string, search: string, keywords?: string[]) => number;
13
+ defaultValue?: string;
14
+ value?: string;
15
+ onValueChange?: (value: string) => void;
16
+ loop?: boolean;
17
+ disablePointerSelection?: boolean;
18
+ vimBindings?: boolean;
19
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
+ interface CommandDialogProps extends DialogProps {
21
+ }
22
+ declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => import("react/jsx-runtime").JSX.Element;
23
+ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
24
+ ref?: React.Ref<HTMLInputElement>;
25
+ } & {
26
+ asChild?: boolean;
27
+ }, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "asChild">, "value" | "onChange" | "type"> & {
28
+ value?: string;
29
+ onValueChange?: (search: string) => void;
30
+ } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
31
+ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
32
+ children?: React.ReactNode;
33
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
34
+ ref?: React.Ref<HTMLDivElement>;
35
+ } & {
36
+ asChild?: boolean;
37
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
38
+ label?: string;
39
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
40
+ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
41
+ children?: React.ReactNode;
42
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
43
+ ref?: React.Ref<HTMLDivElement>;
44
+ } & {
45
+ asChild?: boolean;
46
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
47
+ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
48
+ children?: React.ReactNode;
49
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
50
+ ref?: React.Ref<HTMLDivElement>;
51
+ } & {
52
+ asChild?: boolean;
53
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
54
+ heading?: React.ReactNode;
55
+ value?: string;
56
+ forceMount?: boolean;
57
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
58
+ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
59
+ ref?: React.Ref<HTMLDivElement>;
60
+ } & {
61
+ asChild?: boolean;
62
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
63
+ alwaysRender?: boolean;
64
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
65
+ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
66
+ children?: React.ReactNode;
67
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
68
+ ref?: React.Ref<HTMLDivElement>;
69
+ } & {
70
+ asChild?: boolean;
71
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "disabled" | "onSelect"> & {
72
+ disabled?: boolean;
73
+ onSelect?: (value: string) => void;
74
+ value?: string;
75
+ keywords?: string[];
76
+ forceMount?: boolean;
77
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
78
+ declare const CommandShortcut: {
79
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
80
+ displayName: string;
81
+ };
82
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
83
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/shardui/command.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAO1D,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;sFAYX,CAAC;AAGH,UAAU,kBAAmB,SAAQ,WAAW;CAAG;AAEnD,QAAA,MAAM,aAAa,GAAI,wBAAwB,kBAAkB,4CAUhE,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;0FAehB,CAAC;AAIH,QAAA,MAAM,WAAW;;;;;;;;sFASf,CAAC;AAIH,QAAA,MAAM,YAAY;;;;;;uJAGqF,CAAC;AAIxG,QAAA,MAAM,YAAY;;;;;;;;;;sFAYhB,CAAC;AAIH,QAAA,MAAM,gBAAgB;;;;;;sFAKpB,CAAC;AAGH,QAAA,MAAM,WAAW;;;;;;;;;;;;sFAYf,CAAC;AAIH,QAAA,MAAM,eAAe;8BAA6B,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAEtF,CAAC;AAGF,OAAO,EACH,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACnB,CAAC"}
@@ -0,0 +1,91 @@
1
+ import {jsx,jsxs}from'react/jsx-runtime';import*as React from'react';import {Command as Command$1}from'cmdk';import {Search}from'lucide-react';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'fast-deep-equal/react.js';import {Dialog,DialogContent}from'./dialog.js';const Command = React.forwardRef(({
2
+ className,
3
+ ...props
4
+ }, ref) => jsx(Command$1, {
5
+ ref: ref,
6
+ className: cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', className),
7
+ ...props
8
+ }));
9
+ Command.displayName = Command$1.displayName;
10
+ const CommandDialog = ({
11
+ children,
12
+ ...props
13
+ }) => {
14
+ return jsx(Dialog, {
15
+ ...props,
16
+ children: jsx(DialogContent, {
17
+ className: "overflow-hidden p-0 shadow-lg",
18
+ children: jsx(Command, {
19
+ className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
20
+ children: children
21
+ })
22
+ })
23
+ });
24
+ };
25
+ const CommandInput = React.forwardRef(({
26
+ className,
27
+ ...props
28
+ }, ref) => jsxs("div", {
29
+ className: "flex items-center border-b px-3",
30
+ "cmdk-input-wrapper": "",
31
+ children: [jsx(Search, {
32
+ className: "mr-2 h-4 w-4 shrink-0 opacity-50"
33
+ }), jsx(Command$1.Input, {
34
+ ref: ref,
35
+ className: cn('flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', className),
36
+ ...props
37
+ })]
38
+ }));
39
+ CommandInput.displayName = Command$1.Input.displayName;
40
+ const CommandList = React.forwardRef(({
41
+ className,
42
+ ...props
43
+ }, ref) => jsx(Command$1.List, {
44
+ ref: ref,
45
+ className: cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className),
46
+ ...props
47
+ }));
48
+ CommandList.displayName = Command$1.List.displayName;
49
+ const CommandEmpty = React.forwardRef((props, ref) => jsx(Command$1.Empty, {
50
+ ref: ref,
51
+ className: "py-6 text-center text-sm",
52
+ ...props
53
+ }));
54
+ CommandEmpty.displayName = Command$1.Empty.displayName;
55
+ const CommandGroup = React.forwardRef(({
56
+ className,
57
+ ...props
58
+ }, ref) => jsx(Command$1.Group, {
59
+ ref: ref,
60
+ className: cn('overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground', className),
61
+ ...props
62
+ }));
63
+ CommandGroup.displayName = Command$1.Group.displayName;
64
+ const CommandSeparator = React.forwardRef(({
65
+ className,
66
+ ...props
67
+ }, ref) => jsx(Command$1.Separator, {
68
+ ref: ref,
69
+ className: cn('-mx-1 h-px bg-border', className),
70
+ ...props
71
+ }));
72
+ CommandSeparator.displayName = Command$1.Separator.displayName;
73
+ const CommandItem = React.forwardRef(({
74
+ className,
75
+ ...props
76
+ }, ref) => jsx(Command$1.Item, {
77
+ ref: ref,
78
+ className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50", className),
79
+ ...props
80
+ }));
81
+ CommandItem.displayName = Command$1.Item.displayName;
82
+ const CommandShortcut = ({
83
+ className,
84
+ ...props
85
+ }) => {
86
+ return jsx("span", {
87
+ className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className),
88
+ ...props
89
+ });
90
+ };
91
+ CommandShortcut.displayName = 'CommandShortcut';export{Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut};//# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sources":["../../src/shardui/command.tsx"],"sourcesContent":[null],"names":["_jsx","CommandPrimitive"],"mappings":";;;;;;;;;;;;;AAuBA,EAAU,OAAAA,GAAA,CAAA,MAAA,EAAA;AAAyC,IAAA,GAAA,KAAA;AAEnD,IAAA,UAAMA,GAAa,CAAA,aAA4B,EAAA;AAY/C,MAAA,SAAkB,EAAA,+BAAA;;;;;;;;AAmBlB,MAAA,YAAiB,GAAA,KAAA,CAAA,UAAA,CAAA,CAAA;;;;;;;;;AAajB,IAAA,GAAA;;;;;;;AAOA,EAAA;;;;;;;;;;;AAgBA,EAAA,GAAA;;;;;;;AAQA,EAAA,GAAA,EAAA;;;;;;;;;;;;;AAgBA,gBAAqB,CAAA,WAAA,GAAAC,SAAA,CAAA,SAAA,CAAA,WAAA;AAA6B,MAAA,WAAA,GAAA,KAAA,CAAA,UAAM,CAAA,CAAA;;EAEtD,GAAA;AAGF,CAAA,EAAA,GAAA,KACWD,GAAA,CAAAC,SAEP,CAAA,IAAA,EAAA;;;;;;;;;;;;;;;"}
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
3
+ declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
4
+ declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
5
+ declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
7
+ declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
8
+ declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
+ inset?: boolean;
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ inset?: boolean;
16
+ } & React.RefAttributes<HTMLDivElement>>;
17
+ declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
+ inset?: boolean;
21
+ } & React.RefAttributes<HTMLDivElement>>;
22
+ declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
+ declare const ContextMenuShortcut: {
24
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ };
27
+ export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
28
+ //# sourceMappingURL=context-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/shardui/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAKrE,QAAA,MAAM,WAAW,iDAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,sHAA+B,CAAC;AAExD,QAAA,MAAM,gBAAgB,mHAA6B,CAAC;AAEpD,QAAA,MAAM,iBAAiB,uDAA8B,CAAC;AAEtD,QAAA,MAAM,cAAc,oDAA2B,CAAC;AAEhD,QAAA,MAAM,qBAAqB,wHAAkC,CAAC;AAE9D,QAAA,MAAM,qBAAqB;YAGX,OAAO;wCAerB,CAAC;AAGH,QAAA,MAAM,qBAAqB,2KAYzB,CAAC;AAGH,QAAA,MAAM,kBAAkB,wKActB,CAAC;AAGH,QAAA,MAAM,eAAe;YAGL,OAAO;wCAYrB,CAAC;AAGH,QAAA,MAAM,uBAAuB,6KAoB3B,CAAC;AAGH,QAAA,MAAM,oBAAoB,0KAmBxB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGN,OAAO;wCAQrB,CAAC;AAGH,QAAA,MAAM,oBAAoB,0KAKxB,CAAC;AAGH,QAAA,MAAM,mBAAmB;8BAA6B,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAE1F,CAAC;AAGF,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACxB,CAAC"}
@@ -0,0 +1,117 @@
1
+ import {jsxs,jsx}from'react/jsx-runtime';import*as React from'react';import*as ContextMenuPrimitive from'@radix-ui/react-context-menu';import {ChevronRight,Check,Circle}from'lucide-react';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'fast-deep-equal/react.js';const ContextMenu = ContextMenuPrimitive.Root;
2
+ const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
3
+ const ContextMenuGroup = ContextMenuPrimitive.Group;
4
+ const ContextMenuPortal = ContextMenuPrimitive.Portal;
5
+ const ContextMenuSub = ContextMenuPrimitive.Sub;
6
+ const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
7
+ const ContextMenuSubTrigger = React.forwardRef(({
8
+ className,
9
+ inset,
10
+ children,
11
+ ...props
12
+ }, ref) => jsxs(ContextMenuPrimitive.SubTrigger, {
13
+ ref: ref,
14
+ className: cn('flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', inset && 'pl-8', className),
15
+ ...props,
16
+ children: [children, jsx(ChevronRight, {
17
+ className: "ml-auto h-4 w-4"
18
+ })]
19
+ }));
20
+ ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
21
+ const ContextMenuSubContent = React.forwardRef(({
22
+ className,
23
+ ...props
24
+ }, ref) => jsx(ContextMenuPrimitive.SubContent, {
25
+ ref: ref,
26
+ className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className),
27
+ ...props
28
+ }));
29
+ ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
30
+ const ContextMenuContent = React.forwardRef(({
31
+ className,
32
+ ...props
33
+ }, ref) => jsx(ContextMenuPrimitive.Portal, {
34
+ children: jsx(ContextMenuPrimitive.Content, {
35
+ ref: ref,
36
+ className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className),
37
+ ...props
38
+ })
39
+ }));
40
+ ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
41
+ const ContextMenuItem = React.forwardRef(({
42
+ className,
43
+ inset,
44
+ ...props
45
+ }, ref) => jsx(ContextMenuPrimitive.Item, {
46
+ ref: ref,
47
+ className: cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', inset && 'pl-8', className),
48
+ ...props
49
+ }));
50
+ ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
51
+ const ContextMenuCheckboxItem = React.forwardRef(({
52
+ className,
53
+ children,
54
+ checked,
55
+ ...props
56
+ }, ref) => jsxs(ContextMenuPrimitive.CheckboxItem, {
57
+ ref: ref,
58
+ className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className),
59
+ checked: checked,
60
+ ...props,
61
+ children: [jsx("span", {
62
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
63
+ children: jsx(ContextMenuPrimitive.ItemIndicator, {
64
+ children: jsx(Check, {
65
+ className: "h-4 w-4"
66
+ })
67
+ })
68
+ }), children]
69
+ }));
70
+ ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
71
+ const ContextMenuRadioItem = React.forwardRef(({
72
+ className,
73
+ children,
74
+ ...props
75
+ }, ref) => jsxs(ContextMenuPrimitive.RadioItem, {
76
+ ref: ref,
77
+ className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className),
78
+ ...props,
79
+ children: [jsx("span", {
80
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
81
+ children: jsx(ContextMenuPrimitive.ItemIndicator, {
82
+ children: jsx(Circle, {
83
+ className: "h-2 w-2 fill-current"
84
+ })
85
+ })
86
+ }), children]
87
+ }));
88
+ ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
89
+ const ContextMenuLabel = React.forwardRef(({
90
+ className,
91
+ inset,
92
+ ...props
93
+ }, ref) => jsx(ContextMenuPrimitive.Label, {
94
+ ref: ref,
95
+ className: cn('px-2 py-1.5 text-sm font-semibold text-foreground', inset && 'pl-8', className),
96
+ ...props
97
+ }));
98
+ ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
99
+ const ContextMenuSeparator = React.forwardRef(({
100
+ className,
101
+ ...props
102
+ }, ref) => jsx(ContextMenuPrimitive.Separator, {
103
+ ref: ref,
104
+ className: cn('-mx-1 my-1 h-px bg-border', className),
105
+ ...props
106
+ }));
107
+ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
108
+ const ContextMenuShortcut = ({
109
+ className,
110
+ ...props
111
+ }) => {
112
+ return jsx("span", {
113
+ className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className),
114
+ ...props
115
+ });
116
+ };
117
+ ContextMenuShortcut.displayName = 'ContextMenuShortcut';export{ContextMenu,ContextMenuCheckboxItem,ContextMenuContent,ContextMenuGroup,ContextMenuItem,ContextMenuLabel,ContextMenuPortal,ContextMenuRadioGroup,ContextMenuRadioItem,ContextMenuSeparator,ContextMenuShortcut,ContextMenuSub,ContextMenuSubContent,ContextMenuSubTrigger,ContextMenuTrigger};//# sourceMappingURL=context-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu.js","sources":["../../src/shardui/context-menu.tsx"],"sourcesContent":[null],"names":["_jsxs"],"mappings":"mSAYA,MAAA,WAAuB,GAAA,oBAAA,CAAA;AAEvB,MAAA,kBAAoB,GAAA,oBAAA,CAAA;AAEpB,MAAA,gBAA2B,GAAA,oBAAA,CAAA;AAE3B,MAAA,iBAA2B,GAAA,oBAAA,CAAA;oBAGJ,GAAA,oBAAA,CAAA;kDAepB,CAAA;AAGH,MAAA,qBAA2B,GAAA,KAAA,CAAA,UAAA,CAAA,CAAA;AAe3B,EAAA,SAAA;AAiBA,EAAA,KAAA;;;AAkBA,CAAA,EAAA,GAAA,KAAAA,IAA6B,CAAA,oBAAA,CAAA,UAAA,EAAA;AAuB7B,EAAA,GAAA,EAAA,GAAA;AAsBA,EAAA,aAAsB,CAAA,4MAAA,EAAA,KAAA,IAAA,MAAA,EAAA,SAAA,CAAA;;uCAWpB,EAAC;AAGH,IAAA,SAAA,EAA0B;AAQ1B,GAAA,CAAA;AAAsD,CAAA,CAAA;;AAEpD,MAAA,qBAAA,GAAA,KAAA,CAAA,UAAA,CAAA,CAAA;AAGF,EAAA,SACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DialogHeader: {
10
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ declare const DialogFooter: {
14
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
20
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/shardui/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,8JAYjB,CAAC;AAGH,QAAA,MAAM,aAAa,8JAqBjB,CAAC;AAGH,QAAA,MAAM,YAAY;8BAA6B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAElF,CAAC;AAGF,QAAA,MAAM,YAAY;8BAA6B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAElF,CAAC;AAGF,QAAA,MAAM,WAAW,oKASf,CAAC;AAGH,QAAA,MAAM,iBAAiB,8KAKrB,CAAC;AAGH,OAAO,EACH,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GACpB,CAAC"}