@karakuri-ui/react 0.2.3 → 0.3.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 (244) hide show
  1. package/README.md +0 -1
  2. package/dist/components/ui/accordion.d.mts +40 -0
  3. package/dist/components/ui/accordion.d.ts +40 -0
  4. package/dist/components/ui/accordion.js +215 -0
  5. package/dist/components/ui/accordion.js.map +1 -0
  6. package/dist/components/ui/accordion.mjs +176 -0
  7. package/dist/components/ui/accordion.mjs.map +1 -0
  8. package/dist/components/ui/alert.d.mts +38 -0
  9. package/dist/components/ui/alert.d.ts +38 -0
  10. package/dist/components/ui/alert.js +217 -0
  11. package/dist/components/ui/alert.js.map +1 -0
  12. package/dist/components/ui/alert.mjs +180 -0
  13. package/dist/components/ui/alert.mjs.map +1 -0
  14. package/dist/components/ui/avatar.d.mts +223 -0
  15. package/dist/components/ui/avatar.d.ts +223 -0
  16. package/dist/components/ui/avatar.js +245 -0
  17. package/dist/components/ui/avatar.js.map +1 -0
  18. package/dist/components/ui/avatar.mjs +204 -0
  19. package/dist/components/ui/avatar.mjs.map +1 -0
  20. package/dist/components/ui/badge.d.mts +31 -0
  21. package/dist/components/ui/badge.d.ts +31 -0
  22. package/dist/components/ui/badge.js +205 -0
  23. package/dist/components/ui/badge.js.map +1 -0
  24. package/dist/components/ui/badge.mjs +170 -0
  25. package/dist/components/ui/badge.mjs.map +1 -0
  26. package/dist/components/ui/breadcrumb.d.mts +46 -0
  27. package/dist/components/ui/breadcrumb.d.ts +46 -0
  28. package/dist/components/ui/breadcrumb.js +201 -0
  29. package/dist/components/ui/breadcrumb.js.map +1 -0
  30. package/dist/components/ui/breadcrumb.mjs +160 -0
  31. package/dist/components/ui/breadcrumb.mjs.map +1 -0
  32. package/dist/components/ui/button-group.d.mts +22 -0
  33. package/dist/components/ui/button-group.d.ts +22 -0
  34. package/dist/components/ui/button-group.js +107 -0
  35. package/dist/components/ui/button-group.js.map +1 -0
  36. package/dist/components/ui/button-group.mjs +72 -0
  37. package/dist/components/ui/button-group.mjs.map +1 -0
  38. package/dist/components/ui/button.d.mts +31 -0
  39. package/dist/components/ui/button.d.ts +31 -0
  40. package/dist/components/ui/button.js +176 -0
  41. package/dist/components/ui/button.js.map +1 -0
  42. package/dist/components/ui/button.mjs +141 -0
  43. package/dist/components/ui/button.mjs.map +1 -0
  44. package/dist/components/ui/card.d.mts +60 -0
  45. package/dist/components/ui/card.d.ts +60 -0
  46. package/dist/components/ui/card.js +361 -0
  47. package/dist/components/ui/card.js.map +1 -0
  48. package/dist/components/ui/card.mjs +319 -0
  49. package/dist/components/ui/card.mjs.map +1 -0
  50. package/dist/{chart.d.mts → components/ui/chart.d.mts} +2 -18
  51. package/dist/{chart.d.ts → components/ui/chart.d.ts} +2 -18
  52. package/dist/{chart.js → components/ui/chart.js} +30 -55
  53. package/dist/components/ui/chart.js.map +1 -0
  54. package/dist/{chart.mjs → components/ui/chart.mjs} +22 -46
  55. package/dist/components/ui/chart.mjs.map +1 -0
  56. package/dist/components/ui/checkbox.d.mts +24 -0
  57. package/dist/components/ui/checkbox.d.ts +24 -0
  58. package/dist/components/ui/checkbox.js +173 -0
  59. package/dist/components/ui/checkbox.js.map +1 -0
  60. package/dist/components/ui/checkbox.mjs +138 -0
  61. package/dist/components/ui/checkbox.mjs.map +1 -0
  62. package/dist/components/ui/divider.d.mts +27 -0
  63. package/dist/components/ui/divider.d.ts +27 -0
  64. package/dist/components/ui/divider.js +147 -0
  65. package/dist/components/ui/divider.js.map +1 -0
  66. package/dist/components/ui/divider.mjs +112 -0
  67. package/dist/components/ui/divider.mjs.map +1 -0
  68. package/dist/components/ui/drawer.d.mts +36 -0
  69. package/dist/components/ui/drawer.d.ts +36 -0
  70. package/dist/components/ui/drawer.js +211 -0
  71. package/dist/components/ui/drawer.js.map +1 -0
  72. package/dist/components/ui/drawer.mjs +165 -0
  73. package/dist/components/ui/drawer.mjs.map +1 -0
  74. package/dist/components/ui/dropdown.d.mts +34 -0
  75. package/dist/components/ui/dropdown.d.ts +34 -0
  76. package/dist/components/ui/dropdown.js +295 -0
  77. package/dist/components/ui/dropdown.js.map +1 -0
  78. package/dist/components/ui/dropdown.mjs +248 -0
  79. package/dist/components/ui/dropdown.mjs.map +1 -0
  80. package/dist/components/ui/field.d.mts +26 -0
  81. package/dist/components/ui/field.d.ts +26 -0
  82. package/dist/components/ui/field.js +141 -0
  83. package/dist/components/ui/field.js.map +1 -0
  84. package/dist/components/ui/field.mjs +103 -0
  85. package/dist/components/ui/field.mjs.map +1 -0
  86. package/dist/components/ui/icon-button.d.mts +20 -0
  87. package/dist/components/ui/icon-button.d.ts +20 -0
  88. package/dist/components/ui/icon-button.js +147 -0
  89. package/dist/components/ui/icon-button.js.map +1 -0
  90. package/dist/components/ui/icon-button.mjs +112 -0
  91. package/dist/components/ui/icon-button.mjs.map +1 -0
  92. package/dist/components/ui/index.d.mts +55 -0
  93. package/dist/components/ui/index.d.ts +55 -0
  94. package/dist/components/ui/index.js +468 -0
  95. package/dist/components/ui/index.js.map +1 -0
  96. package/dist/components/ui/index.mjs +242 -0
  97. package/dist/components/ui/index.mjs.map +1 -0
  98. package/dist/components/ui/input.d.mts +20 -0
  99. package/dist/components/ui/input.d.ts +20 -0
  100. package/dist/components/ui/input.js +250 -0
  101. package/dist/components/ui/input.js.map +1 -0
  102. package/dist/components/ui/input.mjs +215 -0
  103. package/dist/components/ui/input.mjs.map +1 -0
  104. package/dist/components/ui/metric-card.d.mts +38 -0
  105. package/dist/components/ui/metric-card.d.ts +38 -0
  106. package/dist/components/ui/metric-card.js +250 -0
  107. package/dist/components/ui/metric-card.js.map +1 -0
  108. package/dist/components/ui/metric-card.mjs +209 -0
  109. package/dist/components/ui/metric-card.mjs.map +1 -0
  110. package/dist/components/ui/modal.d.mts +47 -0
  111. package/dist/components/ui/modal.d.ts +47 -0
  112. package/dist/components/ui/modal.js +371 -0
  113. package/dist/components/ui/modal.js.map +1 -0
  114. package/dist/components/ui/modal.mjs +313 -0
  115. package/dist/components/ui/modal.mjs.map +1 -0
  116. package/dist/components/ui/navigation-menu.d.mts +120 -0
  117. package/dist/components/ui/navigation-menu.d.ts +120 -0
  118. package/dist/components/ui/navigation-menu.js +521 -0
  119. package/dist/components/ui/navigation-menu.js.map +1 -0
  120. package/dist/components/ui/navigation-menu.mjs +478 -0
  121. package/dist/components/ui/navigation-menu.mjs.map +1 -0
  122. package/dist/components/ui/pagination.d.mts +113 -0
  123. package/dist/components/ui/pagination.d.ts +113 -0
  124. package/dist/components/ui/pagination.js +484 -0
  125. package/dist/components/ui/pagination.js.map +1 -0
  126. package/dist/components/ui/pagination.mjs +438 -0
  127. package/dist/components/ui/pagination.mjs.map +1 -0
  128. package/dist/components/ui/popover.d.mts +29 -0
  129. package/dist/components/ui/popover.d.ts +29 -0
  130. package/dist/components/ui/popover.js +165 -0
  131. package/dist/components/ui/popover.js.map +1 -0
  132. package/dist/components/ui/popover.mjs +124 -0
  133. package/dist/components/ui/popover.mjs.map +1 -0
  134. package/dist/components/ui/progress.d.mts +35 -0
  135. package/dist/components/ui/progress.d.ts +35 -0
  136. package/dist/components/ui/progress.js +194 -0
  137. package/dist/components/ui/progress.js.map +1 -0
  138. package/dist/components/ui/progress.mjs +159 -0
  139. package/dist/components/ui/progress.mjs.map +1 -0
  140. package/dist/components/ui/radio-group.d.mts +35 -0
  141. package/dist/components/ui/radio-group.d.ts +35 -0
  142. package/dist/components/ui/radio-group.js +174 -0
  143. package/dist/components/ui/radio-group.js.map +1 -0
  144. package/dist/components/ui/radio-group.mjs +137 -0
  145. package/dist/components/ui/radio-group.mjs.map +1 -0
  146. package/dist/components/ui/segmented.d.mts +25 -0
  147. package/dist/components/ui/segmented.d.ts +25 -0
  148. package/dist/components/ui/segmented.js +238 -0
  149. package/dist/components/ui/segmented.js.map +1 -0
  150. package/dist/components/ui/segmented.mjs +201 -0
  151. package/dist/components/ui/segmented.mjs.map +1 -0
  152. package/dist/components/ui/select.d.mts +20 -0
  153. package/dist/components/ui/select.d.ts +20 -0
  154. package/dist/components/ui/select.js +308 -0
  155. package/dist/components/ui/select.js.map +1 -0
  156. package/dist/components/ui/select.mjs +267 -0
  157. package/dist/components/ui/select.mjs.map +1 -0
  158. package/dist/components/ui/skeleton.d.mts +26 -0
  159. package/dist/components/ui/skeleton.d.ts +26 -0
  160. package/dist/components/ui/skeleton.js +144 -0
  161. package/dist/components/ui/skeleton.js.map +1 -0
  162. package/dist/components/ui/skeleton.mjs +109 -0
  163. package/dist/components/ui/skeleton.mjs.map +1 -0
  164. package/dist/components/ui/slider.d.mts +38 -0
  165. package/dist/components/ui/slider.d.ts +38 -0
  166. package/dist/components/ui/slider.js +180 -0
  167. package/dist/components/ui/slider.js.map +1 -0
  168. package/dist/components/ui/slider.mjs +145 -0
  169. package/dist/components/ui/slider.mjs.map +1 -0
  170. package/dist/components/ui/spinner.d.mts +23 -0
  171. package/dist/components/ui/spinner.d.ts +23 -0
  172. package/dist/components/ui/spinner.js +471 -0
  173. package/dist/components/ui/spinner.js.map +1 -0
  174. package/dist/components/ui/spinner.mjs +436 -0
  175. package/dist/components/ui/spinner.mjs.map +1 -0
  176. package/dist/components/ui/switch.d.mts +22 -0
  177. package/dist/components/ui/switch.d.ts +22 -0
  178. package/dist/components/ui/switch.js +173 -0
  179. package/dist/components/ui/switch.js.map +1 -0
  180. package/dist/components/ui/switch.mjs +138 -0
  181. package/dist/components/ui/switch.mjs.map +1 -0
  182. package/dist/components/ui/table.d.mts +60 -0
  183. package/dist/components/ui/table.d.ts +60 -0
  184. package/dist/components/ui/table.js +231 -0
  185. package/dist/components/ui/table.js.map +1 -0
  186. package/dist/components/ui/table.mjs +190 -0
  187. package/dist/components/ui/table.mjs.map +1 -0
  188. package/dist/components/ui/tabs.d.mts +31 -0
  189. package/dist/components/ui/tabs.d.ts +31 -0
  190. package/dist/components/ui/tabs.js +233 -0
  191. package/dist/components/ui/tabs.js.map +1 -0
  192. package/dist/components/ui/tabs.mjs +194 -0
  193. package/dist/components/ui/tabs.mjs.map +1 -0
  194. package/dist/components/ui/textarea.d.mts +19 -0
  195. package/dist/components/ui/textarea.d.ts +19 -0
  196. package/dist/components/ui/textarea.js +181 -0
  197. package/dist/components/ui/textarea.js.map +1 -0
  198. package/dist/components/ui/textarea.mjs +146 -0
  199. package/dist/components/ui/textarea.mjs.map +1 -0
  200. package/dist/components/ui/toast.d.mts +93 -0
  201. package/dist/components/ui/toast.d.ts +93 -0
  202. package/dist/components/ui/toast.js +429 -0
  203. package/dist/components/ui/toast.js.map +1 -0
  204. package/dist/components/ui/toast.mjs +393 -0
  205. package/dist/components/ui/toast.mjs.map +1 -0
  206. package/dist/components/ui/toggle-group.d.mts +42 -0
  207. package/dist/components/ui/toggle-group.d.ts +42 -0
  208. package/dist/components/ui/toggle-group.js +183 -0
  209. package/dist/components/ui/toggle-group.js.map +1 -0
  210. package/dist/components/ui/toggle-group.mjs +146 -0
  211. package/dist/components/ui/toggle-group.mjs.map +1 -0
  212. package/dist/components/ui/toggle.d.mts +19 -0
  213. package/dist/components/ui/toggle.d.ts +19 -0
  214. package/dist/components/ui/toggle.js +194 -0
  215. package/dist/components/ui/toggle.js.map +1 -0
  216. package/dist/components/ui/toggle.mjs +159 -0
  217. package/dist/components/ui/toggle.mjs.map +1 -0
  218. package/dist/components/ui/tooltip.d.mts +26 -0
  219. package/dist/components/ui/tooltip.d.ts +26 -0
  220. package/dist/components/ui/tooltip.js +128 -0
  221. package/dist/components/ui/tooltip.js.map +1 -0
  222. package/dist/components/ui/tooltip.mjs +88 -0
  223. package/dist/components/ui/tooltip.mjs.map +1 -0
  224. package/dist/lib/code-generator.d.mts +60 -0
  225. package/dist/lib/code-generator.d.ts +60 -0
  226. package/dist/lib/code-generator.js +224 -0
  227. package/dist/lib/code-generator.js.map +1 -0
  228. package/dist/lib/code-generator.mjs +159 -0
  229. package/dist/lib/code-generator.mjs.map +1 -0
  230. package/dist/lib/utils.d.mts +10 -0
  231. package/dist/lib/utils.d.ts +10 -0
  232. package/dist/lib/utils.js +33 -0
  233. package/dist/lib/utils.js.map +1 -0
  234. package/dist/lib/utils.mjs +9 -0
  235. package/dist/lib/utils.mjs.map +1 -0
  236. package/package.json +11 -11
  237. package/dist/chart.js.map +0 -1
  238. package/dist/chart.mjs.map +0 -1
  239. package/dist/index.d.mts +0 -1636
  240. package/dist/index.d.ts +0 -1636
  241. package/dist/index.js +0 -7291
  242. package/dist/index.js.map +0 -1
  243. package/dist/index.mjs +0 -7048
  244. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,145 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import * as SliderPrimitive from "@radix-ui/react-slider";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "../../lib/utils";
6
+ const sliderVariants = cva(
7
+ "relative flex touch-none select-none",
8
+ {
9
+ variants: {
10
+ size: {
11
+ sm: "",
12
+ default: "",
13
+ lg: ""
14
+ }
15
+ },
16
+ defaultVariants: {
17
+ size: "default"
18
+ }
19
+ }
20
+ );
21
+ const trackSizes = {
22
+ sm: "h-1 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1",
23
+ default: "h-1.5 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1.5",
24
+ lg: "h-2 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-2"
25
+ };
26
+ const thumbSizes = {
27
+ sm: "w-[var(--component-slider-thumb-sm)] h-[var(--component-slider-thumb-sm)]",
28
+ default: "w-[var(--component-slider-thumb-default)] h-[var(--component-slider-thumb-default)]",
29
+ lg: "w-[var(--component-slider-thumb-lg)] h-[var(--component-slider-thumb-lg)]"
30
+ };
31
+ const contentSizes = {
32
+ sm: "text-xs",
33
+ default: "text-sm",
34
+ lg: "text-base"
35
+ };
36
+ const sliderColorMap = {
37
+ default: {
38
+ range: "bg-foreground",
39
+ thumb: "bg-background border-foreground",
40
+ thumbHover: "hover:shadow-[0_0_0_4px_color-mix(in_srgb,var(--color-text)_16%,transparent)] hover:border-foreground",
41
+ thumbActive: "active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-text)_16%,transparent)]"
42
+ },
43
+ primary: {
44
+ range: "bg-primary",
45
+ thumb: "bg-primary-foreground border-primary",
46
+ thumbHover: "hover:shadow-primary-glow hover:border-primary-hover",
47
+ thumbActive: "active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_16%,transparent)]"
48
+ }
49
+ };
50
+ const Slider = React.forwardRef(({ className, size, color = "default", value, defaultValue, onValueChange, showTooltip = "never", formatLabel, startContent, endContent, orientation, ...props }, ref) => {
51
+ const resolvedSize = size || "default";
52
+ const thumbCount = value?.length ?? defaultValue?.length ?? 1;
53
+ const hasTooltip = showTooltip !== "never";
54
+ const hasWrapper = !!(startContent || endContent);
55
+ const isVertical = orientation === "vertical";
56
+ const [internalValue, setInternalValue] = React.useState(
57
+ () => value ?? defaultValue ?? Array(thumbCount).fill(props.min ?? 0)
58
+ );
59
+ const displayValues = value ?? internalValue;
60
+ const handleValueChange = React.useCallback((newValue) => {
61
+ setInternalValue(newValue);
62
+ onValueChange?.(newValue);
63
+ }, [onValueChange]);
64
+ const sliderRoot = /* @__PURE__ */ React.createElement(
65
+ SliderPrimitive.Root,
66
+ {
67
+ ref,
68
+ className: cn(
69
+ sliderVariants({ size }),
70
+ isVertical ? "h-full w-auto flex-col items-center" : "w-full items-center",
71
+ hasWrapper && (isVertical ? "flex-1 min-h-0" : "flex-1 min-w-0"),
72
+ !hasWrapper && className
73
+ ),
74
+ value,
75
+ defaultValue,
76
+ onValueChange: hasTooltip ? handleValueChange : onValueChange,
77
+ orientation,
78
+ ...props
79
+ },
80
+ /* @__PURE__ */ React.createElement(
81
+ SliderPrimitive.Track,
82
+ {
83
+ className: cn(
84
+ "relative grow overflow-hidden rounded-full bg-border",
85
+ isVertical ? "h-full" : "w-full",
86
+ trackSizes[resolvedSize]
87
+ )
88
+ },
89
+ /* @__PURE__ */ React.createElement(
90
+ SliderPrimitive.Range,
91
+ {
92
+ className: cn(
93
+ "absolute rounded-full",
94
+ sliderColorMap[color].range,
95
+ isVertical ? "w-full transition-[top,bottom] duration-fast ease-out" : "h-full transition-[left,right] duration-fast ease-out"
96
+ )
97
+ }
98
+ )
99
+ ),
100
+ Array.from({ length: thumbCount }).map((_, i) => /* @__PURE__ */ React.createElement(
101
+ SliderPrimitive.Thumb,
102
+ {
103
+ key: i,
104
+ className: cn(
105
+ "group/thumb block rounded-full border-2 shadow-sm",
106
+ sliderColorMap[color].thumb,
107
+ isVertical ? "transition-[top,box-shadow,border-color] duration-fast ease-out" : "transition-[left,box-shadow,border-color] duration-fast ease-out",
108
+ sliderColorMap[color].thumbHover,
109
+ sliderColorMap[color].thumbActive,
110
+ "focus-visible:focus-ring",
111
+ "disabled:pointer-events-none disabled:opacity-50",
112
+ thumbSizes[resolvedSize]
113
+ )
114
+ },
115
+ hasTooltip && /* @__PURE__ */ React.createElement(
116
+ "div",
117
+ {
118
+ className: cn(
119
+ "absolute pointer-events-none",
120
+ "transition-all duration-fast ease-out",
121
+ isVertical ? "right-full top-1/2 -translate-y-1/2 mr-2 origin-right" : "bottom-full left-1/2 -translate-x-1/2 mb-2 origin-bottom",
122
+ showTooltip === "always" ? "opacity-100 scale-100" : [
123
+ "opacity-0 scale-95",
124
+ "group-hover/thumb:opacity-100 group-hover/thumb:scale-100",
125
+ "group-active/thumb:opacity-100 group-active/thumb:scale-100",
126
+ "group-focus-visible/thumb:opacity-100 group-focus-visible/thumb:scale-100"
127
+ ]
128
+ )
129
+ },
130
+ /* @__PURE__ */ React.createElement("div", { className: "relative bg-foreground text-background text-xs font-semibold font-mono tabular-nums px-2.5 py-1 rounded-md shadow-lg whitespace-nowrap" }, formatLabel ? formatLabel(displayValues[i]) : displayValues[i], isVertical ? /* @__PURE__ */ React.createElement("div", { className: "absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-foreground" }) : /* @__PURE__ */ React.createElement("div", { className: "absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-foreground" }))
131
+ )
132
+ ))
133
+ );
134
+ if (!hasWrapper) return sliderRoot;
135
+ return /* @__PURE__ */ React.createElement("div", { className: cn(
136
+ isVertical ? "inline-flex flex-col items-center gap-2 h-full" : "flex items-center gap-3",
137
+ className
138
+ ) }, startContent && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0 text-text-muted select-none", contentSizes[resolvedSize], props.disabled && "opacity-50") }, startContent), sliderRoot, endContent && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0 text-text-muted select-none", contentSizes[resolvedSize], props.disabled && "opacity-50") }, endContent));
139
+ });
140
+ Slider.displayName = "Slider";
141
+ export {
142
+ Slider,
143
+ sliderVariants
144
+ };
145
+ //# sourceMappingURL=slider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/slider.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as SliderPrimitive from '@radix-ui/react-slider'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\n\n// Slider root variants\nconst sliderVariants = cva(\n 'relative flex touch-none select-none',\n {\n variants: {\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\n// Track sizes per orientation\nconst trackSizes = {\n sm: 'h-1 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1',\n default: 'h-1.5 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1.5',\n lg: 'h-2 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-2',\n}\n\n// Thumb sizes\nconst thumbSizes = {\n sm: 'w-[var(--component-slider-thumb-sm)] h-[var(--component-slider-thumb-sm)]',\n default: 'w-[var(--component-slider-thumb-default)] h-[var(--component-slider-thumb-default)]',\n lg: 'w-[var(--component-slider-thumb-lg)] h-[var(--component-slider-thumb-lg)]',\n}\n\n// Content font sizes (for startContent / endContent)\nconst contentSizes = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n}\n\n// Color maps for range and thumb\nconst sliderColorMap = {\n default: {\n range: 'bg-foreground',\n thumb: 'bg-background border-foreground',\n thumbHover: 'hover:shadow-[0_0_0_4px_color-mix(in_srgb,var(--color-text)_16%,transparent)] hover:border-foreground',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-text)_16%,transparent)]',\n },\n primary: {\n range: 'bg-primary',\n thumb: 'bg-primary-foreground border-primary',\n thumbHover: 'hover:shadow-primary-glow hover:border-primary-hover',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_16%,transparent)]',\n },\n} as const\n\nexport type SliderColor = keyof typeof sliderColorMap\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n VariantProps<typeof sliderVariants> {\n /** Track and thumb color */\n color?: SliderColor\n /** Tooltip display mode: auto (hover/drag), always, never */\n showTooltip?: 'auto' | 'always' | 'never'\n /** Custom formatter for tooltip value */\n formatLabel?: (value: number) => string\n /** Content to display before the slider (icon, label, etc.) */\n startContent?: React.ReactNode\n /** Content to display after the slider */\n endContent?: React.ReactNode\n}\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size, color = 'default', value, defaultValue, onValueChange, showTooltip = 'never', formatLabel, startContent, endContent, orientation, ...props }, ref) => {\n const resolvedSize = size || 'default'\n const thumbCount = value?.length ?? defaultValue?.length ?? 1\n const hasTooltip = showTooltip !== 'never'\n const hasWrapper = !!(startContent || endContent)\n const isVertical = orientation === 'vertical'\n\n // Track value internally for tooltip display\n const [internalValue, setInternalValue] = React.useState(\n () => value ?? defaultValue ?? Array(thumbCount).fill(props.min ?? 0)\n )\n const displayValues = value ?? internalValue\n\n const handleValueChange = React.useCallback((newValue: number[]) => {\n setInternalValue(newValue)\n onValueChange?.(newValue)\n }, [onValueChange])\n\n const sliderRoot = (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n sliderVariants({ size }),\n isVertical\n ? 'h-full w-auto flex-col items-center'\n : 'w-full items-center',\n hasWrapper && (isVertical ? 'flex-1 min-h-0' : 'flex-1 min-w-0'),\n !hasWrapper && className\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={hasTooltip ? handleValueChange : onValueChange}\n orientation={orientation}\n {...props}\n >\n <SliderPrimitive.Track\n className={cn(\n 'relative grow overflow-hidden rounded-full bg-border',\n isVertical ? 'h-full' : 'w-full',\n trackSizes[resolvedSize]\n )}\n >\n <SliderPrimitive.Range\n className={cn(\n 'absolute rounded-full', sliderColorMap[color].range,\n isVertical\n ? 'w-full transition-[top,bottom] duration-fast ease-out'\n : 'h-full transition-[left,right] duration-fast ease-out'\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }).map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(\n 'group/thumb block rounded-full border-2 shadow-sm', sliderColorMap[color].thumb,\n isVertical\n ? 'transition-[top,box-shadow,border-color] duration-fast ease-out'\n : 'transition-[left,box-shadow,border-color] duration-fast ease-out',\n sliderColorMap[color].thumbHover,\n sliderColorMap[color].thumbActive,\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n thumbSizes[resolvedSize]\n )}\n >\n {hasTooltip && (\n <div\n className={cn(\n 'absolute pointer-events-none',\n 'transition-all duration-fast ease-out',\n isVertical\n ? 'right-full top-1/2 -translate-y-1/2 mr-2 origin-right'\n : 'bottom-full left-1/2 -translate-x-1/2 mb-2 origin-bottom',\n showTooltip === 'always'\n ? 'opacity-100 scale-100'\n : [\n 'opacity-0 scale-95',\n 'group-hover/thumb:opacity-100 group-hover/thumb:scale-100',\n 'group-active/thumb:opacity-100 group-active/thumb:scale-100',\n 'group-focus-visible/thumb:opacity-100 group-focus-visible/thumb:scale-100',\n ]\n )}\n >\n <div className=\"relative bg-foreground text-background text-xs font-semibold font-mono tabular-nums px-2.5 py-1 rounded-md shadow-lg whitespace-nowrap\">\n {formatLabel ? formatLabel(displayValues[i]) : displayValues[i]}\n {/* Arrow */}\n {isVertical ? (\n <div className=\"absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-foreground\" />\n ) : (\n <div className=\"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-foreground\" />\n )}\n </div>\n </div>\n )}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n )\n\n if (!hasWrapper) return sliderRoot\n\n return (\n <div className={cn(\n isVertical ? 'inline-flex flex-col items-center gap-2 h-full' : 'flex items-center gap-3',\n className\n )}>\n {startContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {startContent}\n </span>\n )}\n {sliderRoot}\n {endContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {endContent}\n </span>\n )}\n </div>\n )\n})\nSlider.displayName = 'Slider'\n\nexport { Slider, sliderVariants }\n"],"mappings":"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","names":[]}
@@ -0,0 +1,23 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const spinnerVariants: (props?: ({
6
+ size?: "default" | "sm" | "lg" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ type OrbitStyle = 'ring' | 'dots' | 'cube' | 'flip' | 'morph';
9
+ interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof spinnerVariants> {
10
+ /** Visual variant */
11
+ variant?: 'ring' | 'dots' | 'bars' | 'orbit';
12
+ /** Orbit sub-style (only when variant="orbit") */
13
+ orbitStyle?: OrbitStyle;
14
+ /** Spinner color */
15
+ color?: 'default' | 'primary' | 'current';
16
+ /** Animation speed */
17
+ speed?: 'slow' | 'default' | 'fast';
18
+ /** Accessibility label */
19
+ label?: string;
20
+ }
21
+ declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLDivElement>>;
22
+
23
+ export { type OrbitStyle, Spinner, type SpinnerProps, spinnerVariants };
@@ -0,0 +1,23 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const spinnerVariants: (props?: ({
6
+ size?: "default" | "sm" | "lg" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ type OrbitStyle = 'ring' | 'dots' | 'cube' | 'flip' | 'morph';
9
+ interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof spinnerVariants> {
10
+ /** Visual variant */
11
+ variant?: 'ring' | 'dots' | 'bars' | 'orbit';
12
+ /** Orbit sub-style (only when variant="orbit") */
13
+ orbitStyle?: OrbitStyle;
14
+ /** Spinner color */
15
+ color?: 'default' | 'primary' | 'current';
16
+ /** Animation speed */
17
+ speed?: 'slow' | 'default' | 'fast';
18
+ /** Accessibility label */
19
+ label?: string;
20
+ }
21
+ declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLDivElement>>;
22
+
23
+ export { type OrbitStyle, Spinner, type SpinnerProps, spinnerVariants };
@@ -0,0 +1,471 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var spinner_exports = {};
31
+ __export(spinner_exports, {
32
+ Spinner: () => Spinner,
33
+ spinnerVariants: () => spinnerVariants
34
+ });
35
+ module.exports = __toCommonJS(spinner_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_class_variance_authority = require("class-variance-authority");
38
+ var import_utils = require("../../lib/utils");
39
+ const RING_SIZES = {
40
+ sm: 16,
41
+ default: 24,
42
+ lg: 32
43
+ };
44
+ const RING_STROKE = {
45
+ sm: 2,
46
+ default: 2.5,
47
+ lg: 3
48
+ };
49
+ const DOT_SIZES = {
50
+ sm: 4,
51
+ default: 6,
52
+ lg: 8
53
+ };
54
+ const DOT_GAP = {
55
+ sm: 3,
56
+ default: 4,
57
+ lg: 5
58
+ };
59
+ const BAR_WIDTHS = {
60
+ sm: 2,
61
+ default: 3,
62
+ lg: 4
63
+ };
64
+ const BAR_HEIGHTS = {
65
+ sm: 12,
66
+ default: 16,
67
+ lg: 24
68
+ };
69
+ const BAR_GAP = {
70
+ sm: 2,
71
+ default: 3,
72
+ lg: 4
73
+ };
74
+ const ORBIT_SIZES = {
75
+ sm: 22,
76
+ default: 32,
77
+ lg: 44
78
+ };
79
+ const ORBIT_STROKE = {
80
+ sm: 2.5,
81
+ default: 3,
82
+ lg: 3.5
83
+ };
84
+ const DOT_COUNT = 3;
85
+ const BAR_COUNT = 4;
86
+ const RING_VIEWBOX = 24;
87
+ const RING_CENTER = 12;
88
+ const strokeColorMap = {
89
+ default: "stroke-foreground",
90
+ primary: "stroke-primary",
91
+ current: "stroke-current"
92
+ };
93
+ const bgColorMap = {
94
+ default: "bg-foreground",
95
+ primary: "bg-primary",
96
+ current: "bg-current"
97
+ };
98
+ const SPEED_MS = { slow: 1500, default: 1e3, fast: 750 };
99
+ const ORBIT_SPEED_MS = { slow: 2e3, default: 1500, fast: 1e3 };
100
+ const spinnerVariants = (0, import_class_variance_authority.cva)(
101
+ "inline-flex items-center justify-center shrink-0",
102
+ {
103
+ variants: {
104
+ size: {
105
+ sm: "",
106
+ default: "",
107
+ lg: ""
108
+ }
109
+ },
110
+ defaultVariants: {
111
+ size: "default"
112
+ }
113
+ }
114
+ );
115
+ const Spinner = React.forwardRef(
116
+ ({
117
+ className,
118
+ variant = "ring",
119
+ orbitStyle = "ring",
120
+ size,
121
+ color = "default",
122
+ speed = "default",
123
+ label,
124
+ ...props
125
+ }, ref) => {
126
+ const resolvedSize = size || "default";
127
+ const orbitMap = {
128
+ ring: OrbitSpinner,
129
+ dots: OrbitDotsSpinner,
130
+ cube: OrbitCubeSpinner,
131
+ flip: OrbitFlipSpinner,
132
+ morph: OrbitMorphSpinner
133
+ };
134
+ return /* @__PURE__ */ React.createElement(
135
+ "div",
136
+ {
137
+ ref,
138
+ role: "status",
139
+ "aria-label": label || "Loading",
140
+ className: (0, import_utils.cn)(spinnerVariants({ size }), className),
141
+ ...props
142
+ },
143
+ variant === "ring" && /* @__PURE__ */ React.createElement(RingSpinner, { size: resolvedSize, color, speed }),
144
+ variant === "dots" && /* @__PURE__ */ React.createElement(DotsSpinner, { size: resolvedSize, color, speed }),
145
+ variant === "bars" && /* @__PURE__ */ React.createElement(BarsSpinner, { size: resolvedSize, color, speed }),
146
+ variant === "orbit" && (() => {
147
+ const OrbitComponent = orbitMap[orbitStyle];
148
+ return /* @__PURE__ */ React.createElement(OrbitComponent, { size: resolvedSize, color, speed });
149
+ })()
150
+ );
151
+ }
152
+ );
153
+ Spinner.displayName = "Spinner";
154
+ function RingSpinner({ size, color, speed }) {
155
+ const diameter = RING_SIZES[size];
156
+ const stroke = RING_STROKE[size];
157
+ const r = (RING_VIEWBOX - stroke) / 2;
158
+ const circumference = 2 * Math.PI * r;
159
+ return /* @__PURE__ */ React.createElement(
160
+ "svg",
161
+ {
162
+ viewBox: `0 0 ${RING_VIEWBOX} ${RING_VIEWBOX}`,
163
+ width: diameter,
164
+ height: diameter,
165
+ fill: "none",
166
+ className: "animate-spin",
167
+ style: { animationDuration: `${SPEED_MS[speed]}ms` }
168
+ },
169
+ /* @__PURE__ */ React.createElement(
170
+ "circle",
171
+ {
172
+ cx: RING_CENTER,
173
+ cy: RING_CENTER,
174
+ r,
175
+ className: "stroke-border",
176
+ strokeWidth: stroke
177
+ }
178
+ ),
179
+ /* @__PURE__ */ React.createElement(
180
+ "circle",
181
+ {
182
+ cx: RING_CENTER,
183
+ cy: RING_CENTER,
184
+ r,
185
+ className: strokeColorMap[color],
186
+ strokeWidth: stroke,
187
+ strokeDasharray: circumference,
188
+ strokeDashoffset: circumference * 0.75,
189
+ strokeLinecap: "round"
190
+ }
191
+ )
192
+ );
193
+ }
194
+ function DotsSpinner({ size, color, speed }) {
195
+ const dotSize = DOT_SIZES[size];
196
+ const gap = DOT_GAP[size];
197
+ return /* @__PURE__ */ React.createElement("div", { className: "inline-flex items-center", style: { gap } }, Array.from({ length: DOT_COUNT }, (_, i) => /* @__PURE__ */ React.createElement(
198
+ "div",
199
+ {
200
+ key: i,
201
+ className: (0, import_utils.cn)(
202
+ "rounded-full animate-spinner-dot",
203
+ bgColorMap[color]
204
+ ),
205
+ style: {
206
+ width: dotSize,
207
+ height: dotSize,
208
+ animationDuration: `${SPEED_MS[speed]}ms`,
209
+ animationDelay: `${i * (SPEED_MS[speed] / DOT_COUNT / 1.5)}ms`
210
+ }
211
+ }
212
+ )));
213
+ }
214
+ function BarsSpinner({ size, color, speed }) {
215
+ const barWidth = BAR_WIDTHS[size];
216
+ const barHeight = BAR_HEIGHTS[size];
217
+ const gap = BAR_GAP[size];
218
+ return /* @__PURE__ */ React.createElement("div", { className: "inline-flex items-center", style: { gap, height: barHeight } }, Array.from({ length: BAR_COUNT }, (_, i) => /* @__PURE__ */ React.createElement(
219
+ "div",
220
+ {
221
+ key: i,
222
+ className: (0, import_utils.cn)(
223
+ "rounded-full animate-spinner-bar origin-center",
224
+ bgColorMap[color]
225
+ ),
226
+ style: {
227
+ width: barWidth,
228
+ height: barHeight,
229
+ animationDuration: `${SPEED_MS[speed]}ms`,
230
+ animationDelay: `${i * (SPEED_MS[speed] / BAR_COUNT / 1.5)}ms`
231
+ }
232
+ }
233
+ )));
234
+ }
235
+ const orbitTextColorMap = {
236
+ default: "text-foreground",
237
+ primary: "text-primary",
238
+ current: ""
239
+ };
240
+ function OrbitSpinner({ size, color, speed }) {
241
+ const diameter = ORBIT_SIZES[size];
242
+ const stroke = ORBIT_STROKE[size];
243
+ const r = (RING_VIEWBOX - stroke * 2) / 2;
244
+ const circumference = 2 * Math.PI * r;
245
+ return /* @__PURE__ */ React.createElement(
246
+ "div",
247
+ {
248
+ className: (0, import_utils.cn)(orbitTextColorMap[color]),
249
+ style: {
250
+ width: diameter,
251
+ height: diameter,
252
+ perspective: diameter * 3,
253
+ position: "relative"
254
+ }
255
+ },
256
+ /* @__PURE__ */ React.createElement(
257
+ "svg",
258
+ {
259
+ viewBox: `0 0 ${RING_VIEWBOX} ${RING_VIEWBOX}`,
260
+ width: diameter,
261
+ height: diameter,
262
+ fill: "none",
263
+ className: "absolute inset-0 animate-spinner-orbit",
264
+ style: { animationDuration: `${ORBIT_SPEED_MS[speed]}ms` }
265
+ },
266
+ /* @__PURE__ */ React.createElement(
267
+ "circle",
268
+ {
269
+ cx: RING_CENTER,
270
+ cy: RING_CENTER,
271
+ r,
272
+ stroke: "currentColor",
273
+ strokeWidth: stroke
274
+ }
275
+ )
276
+ ),
277
+ /* @__PURE__ */ React.createElement(
278
+ "svg",
279
+ {
280
+ viewBox: `0 0 ${RING_VIEWBOX} ${RING_VIEWBOX}`,
281
+ width: diameter,
282
+ height: diameter,
283
+ fill: "none",
284
+ className: "absolute inset-0 animate-spinner-orbit",
285
+ style: {
286
+ animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
287
+ transform: "rotateZ(90deg)",
288
+ animationDirection: "reverse",
289
+ animationDelay: "-0.4s",
290
+ opacity: 0.35
291
+ }
292
+ },
293
+ /* @__PURE__ */ React.createElement(
294
+ "circle",
295
+ {
296
+ cx: RING_CENTER,
297
+ cy: RING_CENTER,
298
+ r,
299
+ stroke: "currentColor",
300
+ strokeWidth: stroke
301
+ }
302
+ )
303
+ )
304
+ );
305
+ }
306
+ const ORBIT_DOT_SIZE = { sm: 3, default: 4, lg: 6 };
307
+ function OrbitDotsSpinner({ size, color, speed }) {
308
+ const diameter = ORBIT_SIZES[size];
309
+ const dotSize = ORBIT_DOT_SIZE[size];
310
+ const orbitRadius = (diameter - dotSize) / 2;
311
+ return /* @__PURE__ */ React.createElement(
312
+ "div",
313
+ {
314
+ className: (0, import_utils.cn)(orbitTextColorMap[color]),
315
+ style: {
316
+ width: diameter,
317
+ height: diameter,
318
+ perspective: diameter * 3,
319
+ position: "relative"
320
+ }
321
+ },
322
+ /* @__PURE__ */ React.createElement(
323
+ "div",
324
+ {
325
+ className: "animate-spinner-orbit",
326
+ style: {
327
+ animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
328
+ width: "100%",
329
+ height: "100%",
330
+ position: "relative",
331
+ transformStyle: "preserve-3d"
332
+ }
333
+ },
334
+ [0, 120, 240].map((angle) => /* @__PURE__ */ React.createElement(
335
+ "div",
336
+ {
337
+ key: angle,
338
+ className: "absolute rounded-full",
339
+ style: {
340
+ width: dotSize,
341
+ height: dotSize,
342
+ backgroundColor: "currentColor",
343
+ left: "50%",
344
+ top: "50%",
345
+ transform: `translate(-50%, -50%) rotate(${angle}deg) translateX(${orbitRadius}px)`
346
+ }
347
+ }
348
+ ))
349
+ )
350
+ );
351
+ }
352
+ const CUBE_SIZES = { sm: 12, default: 18, lg: 26 };
353
+ function OrbitCubeSpinner({ size, color, speed }) {
354
+ const cubeSize = CUBE_SIZES[size];
355
+ const half = cubeSize / 2;
356
+ const radius = Math.round(cubeSize * 0.15);
357
+ const overlap = 1;
358
+ const faceBase = {
359
+ position: "absolute",
360
+ width: cubeSize + overlap * 2,
361
+ height: cubeSize + overlap * 2,
362
+ backgroundColor: "currentColor",
363
+ borderRadius: radius,
364
+ top: -overlap,
365
+ left: -overlap
366
+ };
367
+ return /* @__PURE__ */ React.createElement(
368
+ "div",
369
+ {
370
+ className: (0, import_utils.cn)(orbitTextColorMap[color]),
371
+ style: {
372
+ width: cubeSize,
373
+ height: cubeSize,
374
+ perspective: cubeSize * 6
375
+ }
376
+ },
377
+ /* @__PURE__ */ React.createElement(
378
+ "div",
379
+ {
380
+ style: {
381
+ width: cubeSize,
382
+ height: cubeSize,
383
+ transform: "rotateX(-25deg) rotateZ(15deg)",
384
+ transformStyle: "preserve-3d"
385
+ }
386
+ },
387
+ /* @__PURE__ */ React.createElement(
388
+ "div",
389
+ {
390
+ className: "animate-spinner-orbit",
391
+ style: {
392
+ animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
393
+ width: cubeSize,
394
+ height: cubeSize,
395
+ position: "relative",
396
+ transformStyle: "preserve-3d"
397
+ }
398
+ },
399
+ /* @__PURE__ */ React.createElement("div", { style: { ...faceBase, transform: `translateZ(${half}px)`, opacity: 0.25 } }),
400
+ /* @__PURE__ */ React.createElement("div", { style: { ...faceBase, transform: `translateZ(${-half}px)`, opacity: 0.1 } }),
401
+ /* @__PURE__ */ React.createElement("div", { style: { ...faceBase, transform: `rotateY(-90deg) translateZ(${half}px)`, opacity: 0.2 } }),
402
+ /* @__PURE__ */ React.createElement("div", { style: { ...faceBase, transform: `rotateY(90deg) translateZ(${half}px)`, opacity: 0.2 } }),
403
+ /* @__PURE__ */ React.createElement("div", { style: { ...faceBase, transform: `rotateX(90deg) translateZ(${half}px)`, opacity: 0.15 } }),
404
+ /* @__PURE__ */ React.createElement("div", { style: { ...faceBase, transform: `rotateX(-90deg) translateZ(${half}px)`, opacity: 0.08 } })
405
+ )
406
+ )
407
+ );
408
+ }
409
+ const FLIP_SIZES = { sm: 14, default: 20, lg: 28 };
410
+ function OrbitFlipSpinner({ size, color, speed }) {
411
+ const sqSize = FLIP_SIZES[size];
412
+ return /* @__PURE__ */ React.createElement(
413
+ "div",
414
+ {
415
+ className: (0, import_utils.cn)(orbitTextColorMap[color]),
416
+ style: {
417
+ width: sqSize,
418
+ height: sqSize,
419
+ perspective: sqSize * 4
420
+ }
421
+ },
422
+ /* @__PURE__ */ React.createElement("div", { style: { transform: "rotateX(25deg)", transformStyle: "preserve-3d", width: "100%", height: "100%" } }, /* @__PURE__ */ React.createElement(
423
+ "div",
424
+ {
425
+ className: "animate-spinner-orbit",
426
+ style: {
427
+ animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
428
+ width: "100%",
429
+ height: "100%",
430
+ borderRadius: "25%",
431
+ backgroundColor: "currentColor",
432
+ opacity: 0.85
433
+ }
434
+ }
435
+ ))
436
+ );
437
+ }
438
+ const MORPH_SIZES = { sm: 16, default: 24, lg: 34 };
439
+ function OrbitMorphSpinner({ size, color, speed }) {
440
+ const morphSize = MORPH_SIZES[size];
441
+ return /* @__PURE__ */ React.createElement(
442
+ "div",
443
+ {
444
+ className: (0, import_utils.cn)(orbitTextColorMap[color]),
445
+ style: {
446
+ width: morphSize,
447
+ height: morphSize,
448
+ perspective: morphSize * 3
449
+ }
450
+ },
451
+ /* @__PURE__ */ React.createElement(
452
+ "div",
453
+ {
454
+ className: "animate-spinner-morph",
455
+ style: {
456
+ animationDuration: `${ORBIT_SPEED_MS[speed]}ms`,
457
+ width: "100%",
458
+ height: "100%",
459
+ backgroundColor: "currentColor",
460
+ opacity: 0.85
461
+ }
462
+ }
463
+ )
464
+ );
465
+ }
466
+ // Annotate the CommonJS export names for ESM import in node:
467
+ 0 && (module.exports = {
468
+ Spinner,
469
+ spinnerVariants
470
+ });
471
+ //# sourceMappingURL=spinner.js.map