@nsaa/core 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (286) hide show
  1. package/README.md +30 -8
  2. package/dist/_virtual/_rolldown/runtime.js +13 -0
  3. package/dist/accordion/accordion.d.ts +7 -0
  4. package/dist/accordion/accordion.js +54 -0
  5. package/dist/accordion/index.d.ts +3 -0
  6. package/dist/alert/alert.d.ts +19 -0
  7. package/dist/alert/alert.js +58 -0
  8. package/dist/alert/index.d.ts +3 -0
  9. package/dist/alert-dialog/alert-dialog.d.ts +19 -0
  10. package/dist/alert-dialog/alert-dialog.js +106 -0
  11. package/dist/alert-dialog/index.d.ts +3 -0
  12. package/dist/avatar/avatar.d.ts +12 -0
  13. package/dist/avatar/avatar.js +50 -0
  14. package/dist/avatar/index.d.ts +3 -0
  15. package/dist/badge/badge.d.ts +8 -0
  16. package/dist/badge/badge.js +29 -0
  17. package/dist/badge/index.d.ts +3 -0
  18. package/dist/button/button.d.ts +25 -0
  19. package/dist/button/button.js +136 -0
  20. package/dist/button/index.d.ts +3 -0
  21. package/dist/calendar/calendar.d.ts +11 -0
  22. package/dist/calendar/calendar.js +131 -0
  23. package/dist/calendar/index.d.ts +3 -0
  24. package/dist/card/card.d.ts +12 -0
  25. package/dist/card/card.js +55 -0
  26. package/dist/card/index.d.ts +3 -0
  27. package/dist/checkbox/checkbox.d.ts +4 -0
  28. package/dist/checkbox/checkbox.js +35 -0
  29. package/dist/checkbox/index.d.ts +3 -0
  30. package/dist/collapsible/collapsible.d.ts +6 -0
  31. package/dist/collapsible/collapsible.js +24 -0
  32. package/dist/collapsible/index.d.ts +3 -0
  33. package/dist/combobox/combobox.d.ts +27 -0
  34. package/dist/combobox/combobox.js +226 -0
  35. package/dist/combobox/index.d.ts +3 -0
  36. package/dist/command/command.d.ts +20 -0
  37. package/dist/command/command.js +116 -0
  38. package/dist/command/index.d.ts +3 -0
  39. package/dist/context-menu/context-menu.d.ts +30 -0
  40. package/dist/context-menu/context-menu.js +173 -0
  41. package/dist/context-menu/index.d.ts +3 -0
  42. package/dist/dialog/dialog.d.ts +18 -0
  43. package/dist/dialog/dialog.js +112 -0
  44. package/dist/dialog/index.d.ts +3 -0
  45. package/dist/direction.d.ts +3 -0
  46. package/dist/direction.js +2 -0
  47. package/dist/drawer/drawer.d.ts +17 -0
  48. package/dist/drawer/drawer.js +136 -0
  49. package/dist/drawer/index.d.ts +3 -0
  50. package/dist/dropdown-menu/dropdown-menu.d.ts +30 -0
  51. package/dist/dropdown-menu/dropdown-menu.js +177 -0
  52. package/dist/dropdown-menu/index.d.ts +3 -0
  53. package/dist/empty/empty.d.ts +35 -0
  54. package/dist/empty/empty.js +93 -0
  55. package/dist/empty/index.d.ts +3 -0
  56. package/dist/field/field.d.ts +26 -0
  57. package/dist/field/field.js +109 -0
  58. package/dist/field/index.d.ts +3 -0
  59. package/dist/index.d.ts +90 -674
  60. package/dist/index.js +50 -3877
  61. package/dist/input/index.d.ts +3 -0
  62. package/dist/input/input.d.ts +4 -0
  63. package/dist/input/input.js +14 -0
  64. package/dist/input-group/index.d.ts +3 -0
  65. package/dist/input-group/input-group.d.ts +19 -0
  66. package/dist/input-group/input-group.js +78 -0
  67. package/dist/input-otp/index.d.ts +3 -0
  68. package/dist/input-otp/input-otp.d.ts +12 -0
  69. package/dist/input-otp/input-otp.js +73 -0
  70. package/dist/kbd/index.d.ts +3 -0
  71. package/dist/kbd/kbd.d.ts +5 -0
  72. package/dist/kbd/kbd.js +19 -0
  73. package/dist/label/index.d.ts +3 -0
  74. package/dist/label/label.d.ts +4 -0
  75. package/dist/label/label.js +13 -0
  76. package/dist/legacy/icon-button/icon-swap.js +58 -0
  77. package/dist/lib/cn.d.ts +3 -0
  78. package/dist/{cn-DxFBFdwT.js → lib/cn.js} +1 -1
  79. package/dist/lib/control-defaults.js +8 -0
  80. package/dist/lib/icon-swap.d.ts +15 -0
  81. package/dist/lib/icon-swap.js +26 -0
  82. package/dist/lib/input-modality.js +39 -0
  83. package/dist/lib/merge-refs.js +21 -0
  84. package/dist/lib/opener.js +29 -0
  85. package/dist/lib/shortcut.js +50 -0
  86. package/dist/lib/track-input-modality.d.ts +2 -0
  87. package/dist/lib/track-input-modality.js +4 -0
  88. package/dist/lib/tv.js +7 -0
  89. package/dist/lib/use-press.js +48 -0
  90. package/dist/lib/user-action.js +13 -0
  91. package/dist/loaders/arc.d.ts +6 -0
  92. package/dist/loaders/arc.js +31 -0
  93. package/dist/loaders/atom.d.ts +5 -0
  94. package/dist/loaders/atom.js +70 -0
  95. package/dist/loaders/blocks.d.ts +8 -0
  96. package/dist/loaders/blocks.js +74 -0
  97. package/dist/loaders/bouncing-dots.d.ts +3 -0
  98. package/dist/loaders/bouncing-dots.js +45 -0
  99. package/dist/loaders/cap.d.ts +6 -0
  100. package/dist/loaders/cap.js +7 -0
  101. package/dist/loaders/cascade.d.ts +5 -0
  102. package/dist/loaders/cascade.js +50 -0
  103. package/dist/loaders/circular-dots.d.ts +3 -0
  104. package/dist/loaders/circular-dots.js +40 -0
  105. package/dist/loaders/classic-v2.d.ts +3 -0
  106. package/dist/loaders/classic-v2.js +41 -0
  107. package/dist/loaders/classic.d.ts +3 -0
  108. package/dist/loaders/classic.js +48 -0
  109. package/dist/loaders/clock.d.ts +5 -0
  110. package/dist/loaders/clock.js +31 -0
  111. package/dist/loaders/comet.d.ts +5 -0
  112. package/dist/loaders/comet.js +52 -0
  113. package/dist/loaders/compass.d.ts +3 -0
  114. package/dist/loaders/compass.js +39 -0
  115. package/dist/loaders/dual.d.ts +6 -0
  116. package/dist/loaders/dual.js +47 -0
  117. package/dist/loaders/easing.d.ts +6 -0
  118. package/dist/loaders/easing.js +34 -0
  119. package/dist/loaders/eclipse.d.ts +3 -0
  120. package/dist/loaders/eclipse.js +69 -0
  121. package/dist/loaders/fade.js +28 -0
  122. package/dist/loaders/flip.d.ts +3 -0
  123. package/dist/loaders/flip.js +41 -0
  124. package/dist/{frame-CK9IBOZB.js → loaders/frame.js} +2 -50
  125. package/dist/loaders/gather.d.ts +3 -0
  126. package/dist/loaders/gather.js +85 -0
  127. package/dist/loaders/leap.d.ts +3 -0
  128. package/dist/loaders/leap.js +67 -0
  129. package/dist/loaders/linear-dots.d.ts +3 -0
  130. package/dist/loaders/linear-dots.js +54 -0
  131. package/dist/loaders/loading.d.ts +3 -0
  132. package/dist/loaders/loading.js +64 -0
  133. package/dist/loaders/morph.d.ts +3 -0
  134. package/dist/loaders/morph.js +40 -0
  135. package/dist/loaders/motion.d.ts +35 -0
  136. package/dist/loaders/motion.js +51 -0
  137. package/dist/loaders/orbit.d.ts +5 -0
  138. package/dist/loaders/orbit.js +44 -0
  139. package/dist/loaders/pulse.d.ts +3 -0
  140. package/dist/loaders/pulse.js +52 -0
  141. package/dist/loaders/radar.d.ts +5 -0
  142. package/dist/loaders/radar.js +64 -0
  143. package/dist/loaders/ring.d.ts +6 -0
  144. package/dist/loaders/ring.js +38 -0
  145. package/dist/loaders/ripple.d.ts +8 -0
  146. package/dist/loaders/ripple.js +57 -0
  147. package/dist/loaders/slide.d.ts +3 -0
  148. package/dist/loaders/slide.js +74 -0
  149. package/dist/loaders/snake.d.ts +6 -0
  150. package/dist/loaders/snake.js +59 -0
  151. package/dist/loaders/spinners.d.ts +61 -0
  152. package/dist/loaders/spinners.js +63 -0
  153. package/dist/loaders/swirl.d.ts +3 -0
  154. package/dist/loaders/swirl.js +50 -0
  155. package/dist/loaders/text/shared.js +25 -0
  156. package/dist/loaders/text/text-loaders.d.ts +48 -0
  157. package/dist/loaders/text/text-loaders.js +723 -0
  158. package/dist/loaders/trace.d.ts +6 -0
  159. package/dist/loaders/trace.js +46 -0
  160. package/dist/loaders/types.d.ts +10 -0
  161. package/dist/loaders/wave.d.ts +8 -0
  162. package/dist/loaders/wave.js +59 -0
  163. package/dist/loaders-text.d.ts +2 -47
  164. package/dist/loaders-text.js +1 -743
  165. package/dist/loaders.d.ts +36 -132
  166. package/dist/loaders.js +35 -1096
  167. package/dist/native-select/index.d.ts +3 -0
  168. package/dist/native-select/native-select.d.ts +9 -0
  169. package/dist/native-select/native-select.js +44 -0
  170. package/dist/pagination/index.d.ts +3 -0
  171. package/dist/pagination/pagination.d.ts +18 -0
  172. package/dist/pagination/pagination.js +134 -0
  173. package/dist/popover/index.d.ts +3 -0
  174. package/dist/popover/popover.d.ts +10 -0
  175. package/dist/popover/popover.js +54 -0
  176. package/dist/radio-group/index.d.ts +3 -0
  177. package/dist/radio-group/radio-group.d.ts +6 -0
  178. package/dist/radio-group/radio-group.js +33 -0
  179. package/dist/select/index.d.ts +3 -0
  180. package/dist/select/select.d.ts +16 -0
  181. package/dist/select/select.js +148 -0
  182. package/dist/separator/index.d.ts +3 -0
  183. package/dist/separator/separator.d.ts +4 -0
  184. package/dist/separator/separator.js +15 -0
  185. package/dist/skeleton/index.d.ts +3 -0
  186. package/dist/skeleton/skeleton.d.ts +10 -0
  187. package/dist/skeleton/skeleton.js +24 -0
  188. package/dist/slider/index.d.ts +3 -0
  189. package/dist/slider/slider.d.ts +4 -0
  190. package/dist/slider/slider.js +39 -0
  191. package/dist/sound/lazy-uisfx.d.ts +20 -0
  192. package/dist/sound/lazy-uisfx.js +68 -0
  193. package/dist/sound/sound-map.d.ts +72 -0
  194. package/dist/sound/sound-map.js +76 -0
  195. package/dist/sound/sound.d.ts +38 -0
  196. package/dist/sound/sound.js +136 -0
  197. package/dist/sound/uisfx.d.ts +41 -0
  198. package/dist/sound/uisfx.js +59 -0
  199. package/dist/sound-uisfx.d.ts +2 -37
  200. package/dist/sound-uisfx.js +1 -58
  201. package/dist/sources/accordion.css +3 -0
  202. package/dist/sources/alert-dialog.css +26 -0
  203. package/dist/sources/alert.css +8 -0
  204. package/dist/sources/avatar.css +3 -0
  205. package/dist/sources/badge.css +3 -0
  206. package/dist/sources/button.css +24 -0
  207. package/dist/sources/calendar.css +25 -0
  208. package/dist/sources/card.css +3 -0
  209. package/dist/sources/checkbox.css +6 -0
  210. package/dist/sources/collapsible.css +2 -0
  211. package/dist/sources/combobox.css +28 -0
  212. package/dist/sources/command.css +30 -0
  213. package/dist/sources/context-menu.css +6 -0
  214. package/dist/sources/dialog.css +26 -0
  215. package/dist/sources/drawer.css +6 -0
  216. package/dist/sources/dropdown-menu.css +6 -0
  217. package/dist/sources/empty.css +3 -0
  218. package/dist/sources/field.css +5 -0
  219. package/dist/sources/input-group.css +27 -0
  220. package/dist/sources/input-otp.css +8 -0
  221. package/dist/sources/input.css +3 -0
  222. package/dist/sources/kbd.css +3 -0
  223. package/dist/sources/label.css +3 -0
  224. package/dist/sources/loaders-text.css +8 -0
  225. package/dist/sources/loaders.css +40 -0
  226. package/dist/sources/native-select.css +3 -0
  227. package/dist/sources/pagination.css +25 -0
  228. package/dist/sources/popover.css +3 -0
  229. package/dist/sources/radio-group.css +6 -0
  230. package/dist/sources/select.css +6 -0
  231. package/dist/sources/separator.css +3 -0
  232. package/dist/sources/skeleton.css +3 -0
  233. package/dist/sources/slider.css +6 -0
  234. package/dist/sources/spinner.css +20 -0
  235. package/dist/sources/switch.css +6 -0
  236. package/dist/sources/table.css +3 -0
  237. package/dist/sources/tabs.css +3 -0
  238. package/dist/sources/textarea.css +3 -0
  239. package/dist/sources/toast.css +25 -0
  240. package/dist/sources/toggle-group.css +32 -0
  241. package/dist/sources/toolbar.css +34 -0
  242. package/dist/sources/tooltip.css +3 -0
  243. package/dist/spinner/index.d.ts +5 -0
  244. package/dist/spinner/loader-provider.d.ts +16 -0
  245. package/dist/spinner/loader-provider.js +28 -0
  246. package/dist/spinner/registry.d.ts +9 -0
  247. package/dist/spinner/registry.js +15 -0
  248. package/dist/spinner/spinner.d.ts +26 -0
  249. package/dist/spinner/spinner.js +143 -0
  250. package/dist/switch/index.d.ts +3 -0
  251. package/dist/switch/switch.d.ts +6 -0
  252. package/dist/switch/switch.js +25 -0
  253. package/dist/table/index.d.ts +3 -0
  254. package/dist/table/table.d.ts +17 -0
  255. package/dist/table/table.js +66 -0
  256. package/dist/tabs/index.d.ts +3 -0
  257. package/dist/tabs/tabs.d.ts +11 -0
  258. package/dist/tabs/tabs.js +46 -0
  259. package/dist/textarea/index.d.ts +3 -0
  260. package/dist/textarea/textarea.d.ts +4 -0
  261. package/dist/textarea/textarea.js +12 -0
  262. package/dist/toast/index.d.ts +3 -0
  263. package/dist/toast/toast.d.ts +17 -0
  264. package/dist/toast/toast.js +211 -0
  265. package/dist/toggle-group/index.d.ts +3 -0
  266. package/dist/toggle-group/toggle-group.d.ts +64 -0
  267. package/dist/toggle-group/toggle-group.js +95 -0
  268. package/dist/tokens/dist/motion.d.ts +24 -0
  269. package/dist/{motion-NQq2BA78.js → tokens/dist/motion.js} +1 -1
  270. package/dist/toolbar/index.d.ts +3 -0
  271. package/dist/toolbar/overflow.d.ts +4 -0
  272. package/dist/toolbar/overflow.js +242 -0
  273. package/dist/toolbar/toolbar-item.d.ts +29 -0
  274. package/dist/toolbar/toolbar-item.js +71 -0
  275. package/dist/toolbar/toolbar.d.ts +73 -0
  276. package/dist/toolbar/toolbar.js +250 -0
  277. package/dist/tooltip/index.d.ts +3 -0
  278. package/dist/tooltip/tooltip.d.ts +7 -0
  279. package/dist/tooltip/tooltip.js +41 -0
  280. package/package.json +9 -5
  281. package/src/feel.css +52 -0
  282. package/src/styles-base.css +142 -0
  283. package/src/styles.css +3 -133
  284. package/dist/registry-2PyPW9Xw.js +0 -390
  285. package/dist/registry-DjfWNw3R.d.ts +0 -18
  286. package/dist/sound-DiYNAnR_.d.ts +0 -61
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { SIZE } from "./motion.js";
3
+ import { rotationCss, spinClass } from "./easing.js";
4
+ import { SpinnerStyle, spinnerRoot } from "./frame.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/loaders/orbit.tsx
7
+ const css = `
8
+ .nsaa-loader-orbit {
9
+ --nsaa-loader-orbit-stroke: calc(${SIZE} * 0.0625);
10
+ position: relative;
11
+ }
12
+
13
+ .nsaa-loader-orbit-track {
14
+ position: absolute;
15
+ inset: 8%;
16
+ border-radius: 9999px;
17
+ background: conic-gradient(from 180deg, transparent 0deg, currentColor 180deg, transparent 180deg);
18
+ -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--nsaa-loader-orbit-stroke)), #000 0);
19
+ mask: radial-gradient(farthest-side, transparent calc(100% - var(--nsaa-loader-orbit-stroke)), #000 0);
20
+ }
21
+
22
+ .nsaa-loader-orbit-dot {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ width: 25%;
27
+ height: 25%;
28
+ background: currentColor;
29
+ border-radius: 9999px;
30
+ transform: translate(-50%, -50%);
31
+ }
32
+
33
+ ${rotationCss("orbit")}
34
+ `;
35
+ function Orbit({ easing, ...rest }) {
36
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
37
+ name: "orbit",
38
+ children: css
39
+ }), /* @__PURE__ */ jsxs("div", {
40
+ ...spinnerRoot("orbit", rest),
41
+ children: [/* @__PURE__ */ jsx("div", { className: "nsaa-loader-orbit-dot" }), /* @__PURE__ */ jsx("div", { className: `nsaa-loader-orbit-track ${spinClass("orbit", easing)}` })]
42
+ })] });
43
+ }
44
+ export { Orbit };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function Pulse(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { animation } from "./motion.js";
3
+ import { SpinnerStyle, reducedMotion, spinnerRoot } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/loaders/pulse.tsx
6
+ const css = `
7
+ .nsaa-loader-pulse-ring {
8
+ transform-origin: center;
9
+ ${animation("pulse", "nsaa-loader-pulse-ripple", "ease-out")}
10
+ }
11
+
12
+ @keyframes nsaa-loader-pulse-ripple {
13
+ from {
14
+ opacity: 0.4;
15
+ transform: scale(0.25);
16
+ }
17
+ to {
18
+ opacity: 0;
19
+ transform: scale(1);
20
+ }
21
+ }
22
+
23
+ ${reducedMotion(`
24
+ .nsaa-loader-pulse-ring {
25
+ opacity: 0.2;
26
+ }
27
+ `)}
28
+ `;
29
+ function Pulse(props) {
30
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
31
+ name: "pulse",
32
+ children: css
33
+ }), /* @__PURE__ */ jsxs("svg", {
34
+ ...spinnerRoot("pulse", props),
35
+ fill: "none",
36
+ role: "presentation",
37
+ viewBox: "0 0 16 16",
38
+ children: [/* @__PURE__ */ jsx("circle", {
39
+ className: "nsaa-loader-pulse-ring",
40
+ cx: "8",
41
+ cy: "8",
42
+ fill: "currentColor",
43
+ r: "8"
44
+ }), /* @__PURE__ */ jsx("circle", {
45
+ cx: "8",
46
+ cy: "8",
47
+ fill: "currentColor",
48
+ r: "2"
49
+ })]
50
+ })] });
51
+ }
52
+ export { Pulse };
@@ -0,0 +1,5 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ import { EasingProps } from "./easing.js";
4
+ export interface RadarProps extends SpinnerProps, EasingProps {}
5
+ export declare function Radar({ easing, ...rest }: RadarProps): import("react").JSX.Element;
@@ -0,0 +1,64 @@
1
+ "use client";
2
+ import { rotationCss, spinClass } from "./easing.js";
3
+ import { SpinnerStyle, spinnerRoot } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { useId } from "react";
6
+ // src/loaders/radar.tsx
7
+ const css = `
8
+ ${rotationCss("radar")}
9
+ `;
10
+ function Radar({ easing, ...rest }) {
11
+ const beamGradient = useId();
12
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
13
+ name: "radar",
14
+ children: css
15
+ }), /* @__PURE__ */ jsxs("svg", {
16
+ ...spinnerRoot("radar", rest),
17
+ fill: "none",
18
+ role: "presentation",
19
+ viewBox: "0 0 16 16",
20
+ children: [
21
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("radialGradient", {
22
+ cx: "8",
23
+ cy: "8",
24
+ gradientUnits: "userSpaceOnUse",
25
+ id: beamGradient,
26
+ r: "8",
27
+ children: [/* @__PURE__ */ jsx("stop", {
28
+ offset: "0.3334",
29
+ stopColor: "currentColor"
30
+ }), /* @__PURE__ */ jsx("stop", {
31
+ offset: "1",
32
+ stopColor: "currentColor",
33
+ stopOpacity: "0"
34
+ })]
35
+ }) }),
36
+ /* @__PURE__ */ jsx("circle", {
37
+ cx: "8",
38
+ cy: "8",
39
+ fill: "currentColor",
40
+ opacity: "0.2",
41
+ r: "8"
42
+ }),
43
+ /* @__PURE__ */ jsx("circle", {
44
+ cx: "8",
45
+ cy: "8",
46
+ opacity: "0.2",
47
+ r: "5.5",
48
+ stroke: "currentColor"
49
+ }),
50
+ /* @__PURE__ */ jsx("path", {
51
+ className: spinClass("radar", easing),
52
+ d: "M8 0C9.50657 0 10.9824 0.425672 12.2578 1.22754C13.5333 2.02953 14.557 3.17533 15.21 4.5332C15.8629 5.89107 16.1193 7.40626 15.9492 8.90332C15.7791 10.4001 15.1896 11.8184 14.249 12.9951L10.4707 9.69922C10.8037 9.21598 11 8.63123 11 8C11 6.34315 9.65685 5 8 5V0Z",
53
+ fill: `url(#${beamGradient})`
54
+ }),
55
+ /* @__PURE__ */ jsx("circle", {
56
+ cx: "8",
57
+ cy: "8",
58
+ fill: "currentColor",
59
+ r: "2"
60
+ })
61
+ ]
62
+ })] });
63
+ }
64
+ export { Radar };
@@ -0,0 +1,6 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ import { CapProps } from "./cap.js";
4
+ import { EasingProps } from "./easing.js";
5
+ export interface RingProps extends SpinnerProps, EasingProps, CapProps {}
6
+ export declare function Ring({ cap, easing, ...rest }: RingProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { linecap } from "./cap.js";
3
+ import { rotationCss, spinClass } from "./easing.js";
4
+ import { SpinnerStyle, spinnerRoot } from "./frame.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/loaders/ring.tsx
7
+ const css = `
8
+ ${rotationCss("ring")}
9
+ `;
10
+ function Ring({ cap, easing, ...rest }) {
11
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
12
+ name: "ring",
13
+ children: css
14
+ }), /* @__PURE__ */ jsxs("svg", {
15
+ ...spinnerRoot("ring", rest),
16
+ fill: "none",
17
+ role: "presentation",
18
+ viewBox: "0 0 24 24",
19
+ children: [/* @__PURE__ */ jsx("circle", {
20
+ cx: "12",
21
+ cy: "12",
22
+ opacity: "0.2",
23
+ r: "10",
24
+ stroke: "currentColor",
25
+ strokeWidth: "2.5"
26
+ }), /* @__PURE__ */ jsx("circle", {
27
+ className: spinClass("ring", easing),
28
+ cx: "12",
29
+ cy: "12",
30
+ r: "10",
31
+ stroke: "currentColor",
32
+ strokeDasharray: "16 46.8",
33
+ strokeLinecap: linecap(cap),
34
+ strokeWidth: "2.5"
35
+ })]
36
+ })] });
37
+ }
38
+ export { Ring };
@@ -0,0 +1,8 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export type RippleDirection = "in" | "out";
4
+ export declare const DEFAULT_RIPPLE_DIRECTION: RippleDirection;
5
+ export interface RippleProps extends SpinnerProps {
6
+ direction?: RippleDirection;
7
+ }
8
+ export declare function Ripple({ direction, ...rest }: RippleProps): import("react").JSX.Element;
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { SIZE, STEP_VAR, animation, stagger } from "./motion.js";
3
+ import { SpinnerStyle, reducedMotion, spinnerRoot, step } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/loaders/ripple.tsx
6
+ const DEFAULT_RIPPLE_DIRECTION = "out";
7
+ const RINGS = Array.from({ length: 3 }, (_, index) => index);
8
+ const css = `
9
+ .nsaa-loader-ripple {
10
+ position: relative;
11
+ }
12
+
13
+ .nsaa-loader-ripple-ring {
14
+ position: absolute;
15
+ inset: 0;
16
+ box-sizing: border-box;
17
+ border: calc(${SIZE} * 0.08) solid currentColor;
18
+ border-radius: 9999px;
19
+ ${animation("ripple", "nsaa-loader-ripple-spread", "ease-out")}
20
+ animation-delay: ${stagger("ripple", RINGS.length)};
21
+ }
22
+
23
+ .nsaa-loader-ripple-ring-in {
24
+ animation-direction: reverse;
25
+ }
26
+
27
+ @keyframes nsaa-loader-ripple-spread {
28
+ from {
29
+ opacity: 1;
30
+ transform: scale(0);
31
+ }
32
+ to {
33
+ opacity: 0;
34
+ transform: scale(1);
35
+ }
36
+ }
37
+
38
+ ${reducedMotion(`
39
+ .nsaa-loader-ripple-ring {
40
+ opacity: 0.4;
41
+ transform: scale(calc((var(${STEP_VAR}) + 1) / ${RINGS.length}));
42
+ }
43
+ `)}
44
+ `;
45
+ function Ripple({ direction = "out", ...rest }) {
46
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
47
+ name: "ripple",
48
+ children: css
49
+ }), /* @__PURE__ */ jsx("div", {
50
+ ...spinnerRoot("ripple", rest),
51
+ children: RINGS.map((index) => /* @__PURE__ */ jsx("div", {
52
+ className: `nsaa-loader-ripple-ring nsaa-loader-ripple-ring-${direction}`,
53
+ style: step(index)
54
+ }, index))
55
+ })] });
56
+ }
57
+ export { DEFAULT_RIPPLE_DIRECTION, Ripple };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function Slide(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { animation, stagger } from "./motion.js";
3
+ import { SpinnerStyle, cssVars, reducedMotion, spinnerRoot, step } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/loaders/slide.tsx
6
+ const DOT = 34;
7
+ const MARGIN = 6;
8
+ const FAR = `${(54 / DOT * 100).toFixed(1)}%`;
9
+ const RESTS = [
10
+ `translate(${FAR}, 0)`,
11
+ "translate(0, 0)",
12
+ `translate(0, ${FAR})`
13
+ ];
14
+ const css = `
15
+ .nsaa-loader-slide {
16
+ position: relative;
17
+ }
18
+
19
+ .nsaa-loader-slide-dot {
20
+ position: absolute;
21
+ top: ${MARGIN}%;
22
+ left: ${MARGIN}%;
23
+ width: ${DOT}%;
24
+ height: ${DOT}%;
25
+ background: currentColor;
26
+ border-radius: 50%;
27
+ ${animation("slide", "nsaa-loader-slide-walk", "ease-in-out")}
28
+ animation-delay: ${stagger("slide", RESTS.length)};
29
+ }
30
+
31
+ @keyframes nsaa-loader-slide-walk {
32
+ 0% {
33
+ transform: translate(${FAR}, 0);
34
+ }
35
+ 8.33%,
36
+ 25% {
37
+ transform: translate(${FAR}, ${FAR});
38
+ }
39
+ 33.33%,
40
+ 50% {
41
+ transform: translate(0, ${FAR});
42
+ }
43
+ 58.33%,
44
+ 75% {
45
+ transform: translate(0, 0);
46
+ }
47
+ 83.33%,
48
+ 100% {
49
+ transform: translate(${FAR}, 0);
50
+ }
51
+ }
52
+
53
+ ${reducedMotion(`
54
+ .nsaa-loader-slide-dot {
55
+ transform: var(--nsaa-loader-slide-rest);
56
+ }
57
+ `)}
58
+ `;
59
+ function Slide(props) {
60
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
61
+ name: "slide",
62
+ children: css
63
+ }), /* @__PURE__ */ jsx("div", {
64
+ ...spinnerRoot("slide", props),
65
+ children: RESTS.map((rest, index) => /* @__PURE__ */ jsx("div", {
66
+ className: "nsaa-loader-slide-dot",
67
+ style: cssVars({
68
+ ...step(index),
69
+ "--nsaa-loader-slide-rest": rest
70
+ })
71
+ }, rest))
72
+ })] });
73
+ }
74
+ export { Slide };
@@ -0,0 +1,6 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ import { CapProps } from "./cap.js";
4
+ import { EasingProps } from "./easing.js";
5
+ export interface SnakeProps extends SpinnerProps, EasingProps, CapProps {}
6
+ export declare function Snake({ cap, easing, ...rest }: SnakeProps): import("react").JSX.Element;
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { linecap } from "./cap.js";
3
+ import { animation } from "./motion.js";
4
+ import { rotationCss, spinClass } from "./easing.js";
5
+ import { SpinnerStyle, reducedMotion, spinnerRoot } from "./frame.js";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ // src/loaders/snake.tsx
8
+ const css = `
9
+ ${rotationCss("snake")}
10
+
11
+ .nsaa-loader-snake-dash {
12
+ ${animation("snake", "nsaa-loader-snake-stretch", "ease-in-out")}
13
+ }
14
+
15
+ @keyframes nsaa-loader-snake-stretch {
16
+ 0% {
17
+ stroke-dasharray: 1 100;
18
+ stroke-dashoffset: 0;
19
+ }
20
+ 50% {
21
+ stroke-dasharray: 45 100;
22
+ stroke-dashoffset: -17;
23
+ }
24
+ 100% {
25
+ stroke-dasharray: 45 100;
26
+ stroke-dashoffset: -62;
27
+ }
28
+ }
29
+
30
+ ${reducedMotion(`
31
+ .nsaa-loader-snake-dash {
32
+ stroke-dasharray: 18 100;
33
+ }
34
+ `)}
35
+ `;
36
+ function Snake({ cap, easing, ...rest }) {
37
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
38
+ name: "snake",
39
+ children: css
40
+ }), /* @__PURE__ */ jsx("svg", {
41
+ ...spinnerRoot("snake", rest),
42
+ fill: "none",
43
+ role: "presentation",
44
+ viewBox: "0 0 24 24",
45
+ children: /* @__PURE__ */ jsx("g", {
46
+ className: spinClass("snake", easing),
47
+ children: /* @__PURE__ */ jsx("circle", {
48
+ className: "nsaa-loader-snake-dash",
49
+ cx: "12",
50
+ cy: "12",
51
+ r: "10",
52
+ stroke: "currentColor",
53
+ strokeLinecap: linecap(cap),
54
+ strokeWidth: "2.5"
55
+ })
56
+ })
57
+ })] });
58
+ }
59
+ export { Snake };
@@ -0,0 +1,61 @@
1
+
2
+ import { Arc } from "./arc.js";
3
+ import { Atom } from "./atom.js";
4
+ import { Blocks } from "./blocks.js";
5
+ import { BouncingDots } from "./bouncing-dots.js";
6
+ import { Cascade } from "./cascade.js";
7
+ import { CircularDots } from "./circular-dots.js";
8
+ import { Classic } from "./classic.js";
9
+ import { ClassicV2 } from "./classic-v2.js";
10
+ import { Clock } from "./clock.js";
11
+ import { Comet } from "./comet.js";
12
+ import { Compass } from "./compass.js";
13
+ import { Dual } from "./dual.js";
14
+ import { Eclipse } from "./eclipse.js";
15
+ import { Flip } from "./flip.js";
16
+ import { Gather } from "./gather.js";
17
+ import { Leap } from "./leap.js";
18
+ import { LinearDots } from "./linear-dots.js";
19
+ import { Loading } from "./loading.js";
20
+ import { Morph } from "./morph.js";
21
+ import { Orbit } from "./orbit.js";
22
+ import { Pulse } from "./pulse.js";
23
+ import { Radar } from "./radar.js";
24
+ import { Ring } from "./ring.js";
25
+ import { Ripple } from "./ripple.js";
26
+ import { Slide } from "./slide.js";
27
+ import { Snake } from "./snake.js";
28
+ import { Swirl } from "./swirl.js";
29
+ import { Trace } from "./trace.js";
30
+ import { Wave } from "./wave.js";
31
+ export declare const SPINNERS: {
32
+ arc: typeof Arc;
33
+ atom: typeof Atom;
34
+ blocks: typeof Blocks;
35
+ "bouncing-dots": typeof BouncingDots;
36
+ cascade: typeof Cascade;
37
+ "circular-dots": typeof CircularDots;
38
+ classic: typeof Classic;
39
+ "classic-v2": typeof ClassicV2;
40
+ clock: typeof Clock;
41
+ comet: typeof Comet;
42
+ compass: typeof Compass;
43
+ dual: typeof Dual;
44
+ eclipse: typeof Eclipse;
45
+ flip: typeof Flip;
46
+ gather: typeof Gather;
47
+ leap: typeof Leap;
48
+ "linear-dots": typeof LinearDots;
49
+ loading: typeof Loading;
50
+ morph: typeof Morph;
51
+ orbit: typeof Orbit;
52
+ pulse: typeof Pulse;
53
+ radar: typeof Radar;
54
+ ring: typeof Ring;
55
+ ripple: typeof Ripple;
56
+ slide: typeof Slide;
57
+ snake: typeof Snake;
58
+ swirl: typeof Swirl;
59
+ trace: typeof Trace;
60
+ wave: typeof Wave;
61
+ };
@@ -0,0 +1,63 @@
1
+ "use client";
2
+ import { Arc } from "./arc.js";
3
+ import { BouncingDots } from "./bouncing-dots.js";
4
+ import { CircularDots } from "./circular-dots.js";
5
+ import { Classic } from "./classic.js";
6
+ import { Orbit } from "./orbit.js";
7
+ import { Pulse } from "./pulse.js";
8
+ import { Ring } from "./ring.js";
9
+ import { Wave } from "./wave.js";
10
+ import { Atom } from "./atom.js";
11
+ import { Blocks } from "./blocks.js";
12
+ import { Cascade } from "./cascade.js";
13
+ import { ClassicV2 } from "./classic-v2.js";
14
+ import { Clock } from "./clock.js";
15
+ import { Comet } from "./comet.js";
16
+ import { Compass } from "./compass.js";
17
+ import { Dual } from "./dual.js";
18
+ import { Eclipse } from "./eclipse.js";
19
+ import { Flip } from "./flip.js";
20
+ import { Gather } from "./gather.js";
21
+ import { Leap } from "./leap.js";
22
+ import { LinearDots } from "./linear-dots.js";
23
+ import { Loading } from "./loading.js";
24
+ import { Morph } from "./morph.js";
25
+ import { Radar } from "./radar.js";
26
+ import { Ripple } from "./ripple.js";
27
+ import { Slide } from "./slide.js";
28
+ import { Snake } from "./snake.js";
29
+ import { Swirl } from "./swirl.js";
30
+ import { Trace } from "./trace.js";
31
+ // src/loaders/spinners.ts
32
+ const SPINNERS = {
33
+ arc: Arc,
34
+ atom: Atom,
35
+ blocks: Blocks,
36
+ "bouncing-dots": BouncingDots,
37
+ cascade: Cascade,
38
+ "circular-dots": CircularDots,
39
+ classic: Classic,
40
+ "classic-v2": ClassicV2,
41
+ clock: Clock,
42
+ comet: Comet,
43
+ compass: Compass,
44
+ dual: Dual,
45
+ eclipse: Eclipse,
46
+ flip: Flip,
47
+ gather: Gather,
48
+ leap: Leap,
49
+ "linear-dots": LinearDots,
50
+ loading: Loading,
51
+ morph: Morph,
52
+ orbit: Orbit,
53
+ pulse: Pulse,
54
+ radar: Radar,
55
+ ring: Ring,
56
+ ripple: Ripple,
57
+ slide: Slide,
58
+ snake: Snake,
59
+ swirl: Swirl,
60
+ trace: Trace,
61
+ wave: Wave
62
+ };
63
+ export { SPINNERS };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function Swirl(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { SIZE } from "./motion.js";
3
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
4
+ import { fadeCss } from "./fade.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/loaders/swirl.tsx
7
+ const RING = [
8
+ 0,
9
+ 1,
10
+ 2,
11
+ 7,
12
+ null,
13
+ 3,
14
+ 6,
15
+ 5,
16
+ 4
17
+ ];
18
+ const PLACES = RING.filter((place) => place !== null).length;
19
+ const css = `
20
+ .nsaa-loader-swirl {
21
+ display: grid;
22
+ grid-template-columns: repeat(3, 1fr);
23
+ grid-template-rows: repeat(3, 1fr);
24
+ gap: calc(${SIZE} * 0.15625);
25
+ box-sizing: border-box;
26
+ padding: calc(${SIZE} * 0.0625);
27
+ }
28
+
29
+ .nsaa-loader-swirl-cell {
30
+ background: currentColor;
31
+ border-radius: calc(${SIZE} * 0.0625);
32
+ }
33
+ ${fadeCss("swirl", "cell", PLACES, {
34
+ dim: .2,
35
+ rest: .6
36
+ })}
37
+ `;
38
+ function Swirl(props) {
39
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
40
+ name: "swirl",
41
+ children: css
42
+ }), /* @__PURE__ */ jsx("div", {
43
+ ...spinnerRoot("swirl", props),
44
+ children: RING.map((place, index) => place === null ? /* @__PURE__ */ jsx("div", {}, index) : /* @__PURE__ */ jsx("div", {
45
+ className: "nsaa-loader-swirl-cell",
46
+ style: step(place)
47
+ }, index))
48
+ })] });
49
+ }
50
+ export { Swirl };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { PauseStyle, reducedMotion } from "../frame.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ // src/loaders/text/shared.tsx
5
+ /** A loader's turn: the prop, else an ancestor's `--nsaa-loader-duration`, else its token. */
6
+ function textDuration(name) {
7
+ return `var(--nsaa-loader-duration, var(--nsaa-loader-duration-${name}))`;
8
+ }
9
+ const PLAY_STATE = "var(--nsaa-loader-play-state, running)";
10
+ /** Scoped keyframes and rules, deduped by React 19 (`<style href precedence>`). */
11
+ function TextLoaderStyle({ name, css, reduced }) {
12
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PauseStyle, {}), /* @__PURE__ */ jsx("style", {
13
+ href: `nsaa-loader-${name}`,
14
+ precedence: "nsaa-loaders",
15
+ children: `${css}\n${reducedMotion(reduced)}`
16
+ })] });
17
+ }
18
+ /** The visually hidden words a status announces (the animated copy is aria-hidden). */
19
+ function StatusLabel({ children }) {
20
+ return /* @__PURE__ */ jsx("span", {
21
+ className: "sr-only",
22
+ children
23
+ });
24
+ }
25
+ export { PLAY_STATE, StatusLabel, TextLoaderStyle, textDuration };