@nsaa/core 0.1.0-alpha.0 → 0.1.0-alpha.2

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 (238) hide show
  1. package/dist/accordion/accordion.d.ts +7 -0
  2. package/dist/accordion/accordion.js +54 -0
  3. package/dist/accordion/index.d.ts +3 -0
  4. package/dist/alert/alert.d.ts +18 -0
  5. package/dist/alert/alert.js +53 -0
  6. package/dist/alert/index.d.ts +3 -0
  7. package/dist/alert-dialog/alert-dialog.d.ts +19 -0
  8. package/dist/alert-dialog/alert-dialog.js +100 -0
  9. package/dist/alert-dialog/index.d.ts +3 -0
  10. package/dist/avatar/avatar.d.ts +12 -0
  11. package/dist/avatar/avatar.js +50 -0
  12. package/dist/avatar/index.d.ts +3 -0
  13. package/dist/badge/badge.d.ts +8 -0
  14. package/dist/badge/badge.js +29 -0
  15. package/dist/badge/index.d.ts +3 -0
  16. package/dist/button/button.d.ts +25 -0
  17. package/dist/button/button.js +136 -0
  18. package/dist/button/index.d.ts +3 -0
  19. package/dist/calendar/calendar.d.ts +11 -0
  20. package/dist/calendar/calendar.js +131 -0
  21. package/dist/calendar/index.d.ts +3 -0
  22. package/dist/card/card.d.ts +12 -0
  23. package/dist/card/card.js +55 -0
  24. package/dist/card/index.d.ts +3 -0
  25. package/dist/checkbox/checkbox.d.ts +4 -0
  26. package/dist/checkbox/checkbox.js +35 -0
  27. package/dist/checkbox/index.d.ts +3 -0
  28. package/dist/collapsible/collapsible.d.ts +6 -0
  29. package/dist/collapsible/collapsible.js +24 -0
  30. package/dist/collapsible/index.d.ts +3 -0
  31. package/dist/combobox/combobox.d.ts +27 -0
  32. package/dist/combobox/combobox.js +226 -0
  33. package/dist/combobox/index.d.ts +3 -0
  34. package/dist/command/command.d.ts +20 -0
  35. package/dist/command/command.js +116 -0
  36. package/dist/command/index.d.ts +3 -0
  37. package/dist/context-menu/context-menu.d.ts +30 -0
  38. package/dist/context-menu/context-menu.js +173 -0
  39. package/dist/context-menu/index.d.ts +3 -0
  40. package/dist/dialog/dialog.d.ts +18 -0
  41. package/dist/dialog/dialog.js +106 -0
  42. package/dist/dialog/index.d.ts +3 -0
  43. package/dist/direction.d.ts +3 -0
  44. package/dist/direction.js +2 -0
  45. package/dist/drawer/drawer.d.ts +17 -0
  46. package/dist/drawer/drawer.js +136 -0
  47. package/dist/drawer/index.d.ts +3 -0
  48. package/dist/dropdown-menu/dropdown-menu.d.ts +30 -0
  49. package/dist/dropdown-menu/dropdown-menu.js +177 -0
  50. package/dist/dropdown-menu/index.d.ts +3 -0
  51. package/dist/empty/empty.d.ts +35 -0
  52. package/dist/empty/empty.js +93 -0
  53. package/dist/empty/index.d.ts +3 -0
  54. package/dist/field/field.d.ts +26 -0
  55. package/dist/field/field.js +109 -0
  56. package/dist/field/index.d.ts +3 -0
  57. package/dist/index.d.ts +89 -631
  58. package/dist/index.js +49 -3527
  59. package/dist/input/index.d.ts +3 -0
  60. package/dist/input/input.d.ts +4 -0
  61. package/dist/input/input.js +14 -0
  62. package/dist/input-group/index.d.ts +3 -0
  63. package/dist/input-group/input-group.d.ts +19 -0
  64. package/dist/input-group/input-group.js +78 -0
  65. package/dist/input-otp/index.d.ts +3 -0
  66. package/dist/input-otp/input-otp.d.ts +12 -0
  67. package/dist/input-otp/input-otp.js +73 -0
  68. package/dist/kbd/index.d.ts +3 -0
  69. package/dist/kbd/kbd.d.ts +5 -0
  70. package/dist/kbd/kbd.js +19 -0
  71. package/dist/label/index.d.ts +3 -0
  72. package/dist/label/label.d.ts +4 -0
  73. package/dist/label/label.js +13 -0
  74. package/dist/legacy/icon-button/icon-swap.js +58 -0
  75. package/dist/lib/cn.d.ts +3 -0
  76. package/dist/{cn-DxFBFdwT.js → lib/cn.js} +1 -1
  77. package/dist/lib/control-defaults.js +8 -0
  78. package/dist/lib/icon-swap.d.ts +15 -0
  79. package/dist/lib/icon-swap.js +26 -0
  80. package/dist/lib/input-modality.js +39 -0
  81. package/dist/lib/merge-refs.js +21 -0
  82. package/dist/lib/shortcut.js +50 -0
  83. package/dist/lib/track-input-modality.d.ts +2 -0
  84. package/dist/lib/track-input-modality.js +4 -0
  85. package/dist/lib/tv.js +7 -0
  86. package/dist/lib/use-press.js +48 -0
  87. package/dist/lib/user-action.js +13 -0
  88. package/dist/loaders/arc.d.ts +6 -0
  89. package/dist/loaders/arc.js +31 -0
  90. package/dist/loaders/atom.d.ts +5 -0
  91. package/dist/loaders/atom.js +70 -0
  92. package/dist/loaders/blocks.d.ts +8 -0
  93. package/dist/loaders/blocks.js +74 -0
  94. package/dist/loaders/bouncing-dots.d.ts +3 -0
  95. package/dist/loaders/bouncing-dots.js +45 -0
  96. package/dist/loaders/cap.d.ts +6 -0
  97. package/dist/loaders/cap.js +7 -0
  98. package/dist/loaders/cascade.d.ts +5 -0
  99. package/dist/loaders/cascade.js +50 -0
  100. package/dist/loaders/circular-dots.d.ts +3 -0
  101. package/dist/loaders/circular-dots.js +40 -0
  102. package/dist/loaders/classic-v2.d.ts +3 -0
  103. package/dist/loaders/classic-v2.js +41 -0
  104. package/dist/loaders/classic.d.ts +3 -0
  105. package/dist/loaders/classic.js +48 -0
  106. package/dist/loaders/clock.d.ts +5 -0
  107. package/dist/loaders/clock.js +31 -0
  108. package/dist/loaders/comet.d.ts +5 -0
  109. package/dist/loaders/comet.js +52 -0
  110. package/dist/loaders/compass.d.ts +3 -0
  111. package/dist/loaders/compass.js +39 -0
  112. package/dist/loaders/dual.d.ts +6 -0
  113. package/dist/loaders/dual.js +47 -0
  114. package/dist/loaders/easing.d.ts +6 -0
  115. package/dist/loaders/easing.js +34 -0
  116. package/dist/loaders/eclipse.d.ts +3 -0
  117. package/dist/loaders/eclipse.js +69 -0
  118. package/dist/loaders/fade.js +28 -0
  119. package/dist/loaders/flip.d.ts +3 -0
  120. package/dist/loaders/flip.js +41 -0
  121. package/dist/{frame-CK9IBOZB.js → loaders/frame.js} +2 -50
  122. package/dist/loaders/gather.d.ts +3 -0
  123. package/dist/loaders/gather.js +85 -0
  124. package/dist/loaders/leap.d.ts +3 -0
  125. package/dist/loaders/leap.js +67 -0
  126. package/dist/loaders/linear-dots.d.ts +3 -0
  127. package/dist/loaders/linear-dots.js +54 -0
  128. package/dist/loaders/loading.d.ts +3 -0
  129. package/dist/loaders/loading.js +64 -0
  130. package/dist/loaders/morph.d.ts +3 -0
  131. package/dist/loaders/morph.js +40 -0
  132. package/dist/loaders/motion.d.ts +35 -0
  133. package/dist/loaders/motion.js +51 -0
  134. package/dist/loaders/orbit.d.ts +5 -0
  135. package/dist/loaders/orbit.js +44 -0
  136. package/dist/loaders/pulse.d.ts +3 -0
  137. package/dist/loaders/pulse.js +52 -0
  138. package/dist/loaders/radar.d.ts +5 -0
  139. package/dist/loaders/radar.js +64 -0
  140. package/dist/loaders/ring.d.ts +6 -0
  141. package/dist/loaders/ring.js +38 -0
  142. package/dist/loaders/ripple.d.ts +8 -0
  143. package/dist/loaders/ripple.js +57 -0
  144. package/dist/loaders/slide.d.ts +3 -0
  145. package/dist/loaders/slide.js +74 -0
  146. package/dist/loaders/snake.d.ts +6 -0
  147. package/dist/loaders/snake.js +59 -0
  148. package/dist/loaders/spinners.d.ts +61 -0
  149. package/dist/loaders/spinners.js +63 -0
  150. package/dist/loaders/swirl.d.ts +3 -0
  151. package/dist/loaders/swirl.js +50 -0
  152. package/dist/loaders/text/shared.js +25 -0
  153. package/dist/loaders/text/text-loaders.d.ts +48 -0
  154. package/dist/loaders/text/text-loaders.js +723 -0
  155. package/dist/loaders/trace.d.ts +6 -0
  156. package/dist/loaders/trace.js +46 -0
  157. package/dist/loaders/types.d.ts +10 -0
  158. package/dist/loaders/wave.d.ts +8 -0
  159. package/dist/loaders/wave.js +59 -0
  160. package/dist/loaders-text.d.ts +2 -47
  161. package/dist/loaders-text.js +1 -743
  162. package/dist/loaders.d.ts +36 -132
  163. package/dist/loaders.js +35 -1096
  164. package/dist/native-select/index.d.ts +3 -0
  165. package/dist/native-select/native-select.d.ts +9 -0
  166. package/dist/native-select/native-select.js +44 -0
  167. package/dist/pagination/index.d.ts +3 -0
  168. package/dist/pagination/pagination.d.ts +18 -0
  169. package/dist/pagination/pagination.js +134 -0
  170. package/dist/popover/index.d.ts +3 -0
  171. package/dist/popover/popover.d.ts +10 -0
  172. package/dist/popover/popover.js +54 -0
  173. package/dist/radio-group/index.d.ts +3 -0
  174. package/dist/radio-group/radio-group.d.ts +6 -0
  175. package/dist/radio-group/radio-group.js +33 -0
  176. package/dist/select/index.d.ts +3 -0
  177. package/dist/select/select.d.ts +16 -0
  178. package/dist/select/select.js +148 -0
  179. package/dist/separator/index.d.ts +3 -0
  180. package/dist/separator/separator.d.ts +4 -0
  181. package/dist/separator/separator.js +15 -0
  182. package/dist/skeleton/index.d.ts +3 -0
  183. package/dist/skeleton/skeleton.d.ts +10 -0
  184. package/dist/skeleton/skeleton.js +24 -0
  185. package/dist/slider/index.d.ts +3 -0
  186. package/dist/slider/slider.d.ts +4 -0
  187. package/dist/slider/slider.js +39 -0
  188. package/dist/sound/sound-map.d.ts +70 -0
  189. package/dist/sound/sound-map.js +72 -0
  190. package/dist/sound/sound.d.ts +38 -0
  191. package/dist/sound/sound.js +136 -0
  192. package/dist/sound/uisfx.d.ts +37 -0
  193. package/dist/sound/uisfx.js +59 -0
  194. package/dist/sound-uisfx.d.ts +2 -37
  195. package/dist/sound-uisfx.js +1 -58
  196. package/dist/spinner/index.d.ts +5 -0
  197. package/dist/spinner/loader-provider.d.ts +16 -0
  198. package/dist/spinner/loader-provider.js +28 -0
  199. package/dist/spinner/registry.d.ts +9 -0
  200. package/dist/spinner/registry.js +15 -0
  201. package/dist/spinner/spinner.d.ts +26 -0
  202. package/dist/spinner/spinner.js +143 -0
  203. package/dist/switch/index.d.ts +3 -0
  204. package/dist/switch/switch.d.ts +6 -0
  205. package/dist/switch/switch.js +25 -0
  206. package/dist/table/index.d.ts +3 -0
  207. package/dist/table/table.d.ts +17 -0
  208. package/dist/table/table.js +66 -0
  209. package/dist/tabs/index.d.ts +3 -0
  210. package/dist/tabs/tabs.d.ts +11 -0
  211. package/dist/tabs/tabs.js +46 -0
  212. package/dist/textarea/index.d.ts +3 -0
  213. package/dist/textarea/textarea.d.ts +4 -0
  214. package/dist/textarea/textarea.js +12 -0
  215. package/dist/toast/index.d.ts +3 -0
  216. package/dist/toast/toast.d.ts +17 -0
  217. package/dist/toast/toast.js +211 -0
  218. package/dist/toggle-group/index.d.ts +3 -0
  219. package/dist/toggle-group/toggle-group.d.ts +64 -0
  220. package/dist/toggle-group/toggle-group.js +95 -0
  221. package/dist/tokens/dist/motion.d.ts +24 -0
  222. package/dist/{motion-NQq2BA78.js → tokens/dist/motion.js} +1 -1
  223. package/dist/toolbar/index.d.ts +3 -0
  224. package/dist/toolbar/overflow.d.ts +4 -0
  225. package/dist/toolbar/overflow.js +242 -0
  226. package/dist/toolbar/toolbar-item.d.ts +29 -0
  227. package/dist/toolbar/toolbar-item.js +71 -0
  228. package/dist/toolbar/toolbar.d.ts +73 -0
  229. package/dist/toolbar/toolbar.js +250 -0
  230. package/dist/tooltip/index.d.ts +3 -0
  231. package/dist/tooltip/tooltip.d.ts +7 -0
  232. package/dist/tooltip/tooltip.js +41 -0
  233. package/package.json +5 -3
  234. package/src/feel.css +18 -6
  235. package/src/styles.css +19 -1
  236. package/dist/registry-2PyPW9Xw.js +0 -390
  237. package/dist/registry-DjfWNw3R.d.ts +0 -18
  238. package/dist/sound-DiYNAnR_.d.ts +0 -61
@@ -0,0 +1,70 @@
1
+ "use client";
2
+ import { SIZE, stagger } from "./motion.js";
3
+ import { rotationCss, spinClass } from "./easing.js";
4
+ import { SpinnerStyle, cssVars, reducedMotion, spinnerRoot, step } from "./frame.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/loaders/atom.tsx
7
+ const ORBITS = Array.from({ length: 3 }, (_, index) => index);
8
+ const TILT = 180 / ORBITS.length;
9
+ const css = `
10
+ .nsaa-loader-atom {
11
+ position: relative;
12
+ }
13
+
14
+ .nsaa-loader-atom-shell {
15
+ position: absolute;
16
+ inset: 0;
17
+ box-sizing: border-box;
18
+ border: ${`calc(${SIZE} * 0.055)`} solid currentColor;
19
+ border-radius: 9999px;
20
+ }
21
+
22
+ .nsaa-loader-atom-orbit {
23
+ position: absolute;
24
+ inset: 0;
25
+ transform-style: preserve-3d;
26
+ transform: rotate(var(--nsaa-loader-atom-tilt)) rotateX(90deg);
27
+ }
28
+
29
+ .nsaa-loader-atom-ring {
30
+ position: absolute;
31
+ inset: 0;
32
+ box-sizing: border-box;
33
+ border: ${`calc(${SIZE} * 0.045)`} solid currentColor;
34
+ border-radius: 9999px;
35
+ transform: rotateX(90deg);
36
+ }
37
+
38
+ ${rotationCss("atom")}
39
+
40
+ .nsaa-loader-atom-spin {
41
+ position: absolute;
42
+ inset: 0;
43
+ transform-style: preserve-3d;
44
+ animation-delay: ${stagger("atom", ORBITS.length)};
45
+ }
46
+
47
+ ${reducedMotion(`
48
+ .nsaa-loader-atom-spin {
49
+ transform: rotate(${TILT}deg);
50
+ }
51
+ `)}
52
+ `;
53
+ function Atom({ easing, ...rest }) {
54
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
55
+ name: "atom",
56
+ children: css
57
+ }), /* @__PURE__ */ jsxs("div", {
58
+ ...spinnerRoot("atom", rest),
59
+ children: [/* @__PURE__ */ jsx("div", { className: "nsaa-loader-atom-shell" }), ORBITS.map((index) => /* @__PURE__ */ jsx("div", {
60
+ className: "nsaa-loader-atom-orbit",
61
+ style: cssVars({ "--nsaa-loader-atom-tilt": `${index * TILT}deg` }),
62
+ children: /* @__PURE__ */ jsx("div", {
63
+ className: spinClass("atom", easing),
64
+ style: step(index),
65
+ children: /* @__PURE__ */ jsx("div", { className: "nsaa-loader-atom-ring" })
66
+ })
67
+ }, index))]
68
+ })] });
69
+ }
70
+ export { Atom };
@@ -0,0 +1,8 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export type BlocksSweep = "columns" | "diagonal" | "rows";
4
+ export declare const DEFAULT_BLOCKS_SWEEP: BlocksSweep;
5
+ export interface BlocksProps extends SpinnerProps {
6
+ sweep?: BlocksSweep;
7
+ }
8
+ export declare function Blocks({ sweep, ...rest }: BlocksProps): import("react").JSX.Element;
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { SIZE, 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/blocks.tsx
6
+ const DEFAULT_BLOCKS_SWEEP = "diagonal";
7
+ const SIDE = 3;
8
+ const CELLS = Array.from({ length: 9 }, (_, index) => ({
9
+ col: index % SIDE,
10
+ row: Math.floor(index / SIDE)
11
+ }));
12
+ const SWEEPS = {
13
+ columns: {
14
+ count: SIDE,
15
+ place: ({ col }) => col
16
+ },
17
+ diagonal: {
18
+ count: 5,
19
+ place: ({ col, row }) => row + col
20
+ },
21
+ rows: {
22
+ count: SIDE,
23
+ place: ({ row }) => row
24
+ }
25
+ };
26
+ const css = `
27
+ .nsaa-loader-blocks {
28
+ display: grid;
29
+ grid-template-columns: repeat(${SIDE}, 1fr);
30
+ grid-template-rows: repeat(${SIDE}, 1fr);
31
+ gap: calc(${SIZE} * 0.1);
32
+ }
33
+
34
+ .nsaa-loader-blocks-cell {
35
+ background: currentColor;
36
+ border-radius: calc(${SIZE} * 0.0625);
37
+ ${animation("blocks", "nsaa-loader-blocks-sweep", "ease-in-out")}
38
+ }
39
+ ${Object.entries(SWEEPS).map(([sweep, { count }]) => `
40
+ .nsaa-loader-blocks-cell-${sweep} {
41
+ animation-delay: ${stagger("blocks", count)};
42
+ }
43
+ `).join("")}
44
+ @keyframes nsaa-loader-blocks-sweep {
45
+ 0%,
46
+ 70%,
47
+ 100% {
48
+ transform: scale(1);
49
+ }
50
+ 35% {
51
+ transform: scale(0);
52
+ }
53
+ }
54
+
55
+ ${reducedMotion(`
56
+ .nsaa-loader-blocks-cell {
57
+ transform: scale(0.8);
58
+ }
59
+ `)}
60
+ `;
61
+ function Blocks({ sweep = DEFAULT_BLOCKS_SWEEP, ...rest }) {
62
+ const { place } = SWEEPS[sweep];
63
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
64
+ name: "blocks",
65
+ children: css
66
+ }), /* @__PURE__ */ jsx("div", {
67
+ ...spinnerRoot("blocks", rest),
68
+ children: CELLS.map((cell) => /* @__PURE__ */ jsx("div", {
69
+ className: `nsaa-loader-blocks-cell nsaa-loader-blocks-cell-${sweep}`,
70
+ style: step(place(cell))
71
+ }, `${cell.col}-${cell.row}`))
72
+ })] });
73
+ }
74
+ export { Blocks, DEFAULT_BLOCKS_SWEEP };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function BouncingDots(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { SIZE, animation, stagger } from "./motion.js";
3
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/loaders/bouncing-dots.tsx
6
+ const DOTS = Array.from({ length: 3 }, (_, index) => index);
7
+ const css = `
8
+ .nsaa-loader-bouncing-dots {
9
+ display: flex;
10
+ align-items: center;
11
+ gap: calc(${SIZE} * 0.2);
12
+ width: auto;
13
+ }
14
+
15
+ .nsaa-loader-bouncing-dots-dot {
16
+ width: calc(${SIZE} * 0.25);
17
+ height: calc(${SIZE} * 0.25);
18
+ background: currentColor;
19
+ border-radius: 9999px;
20
+ ${animation("bouncing-dots", "nsaa-loader-bouncing-dots-bounce", "ease-in-out alternate")}
21
+ animation-delay: ${stagger("bouncing-dots", DOTS.length)};
22
+ }
23
+
24
+ @keyframes nsaa-loader-bouncing-dots-bounce {
25
+ from {
26
+ transform: translateY(28%);
27
+ }
28
+ to {
29
+ transform: translateY(-72%);
30
+ }
31
+ }
32
+ `;
33
+ function BouncingDots(props) {
34
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
35
+ name: "bouncing-dots",
36
+ children: css
37
+ }), /* @__PURE__ */ jsx("div", {
38
+ ...spinnerRoot("bouncing-dots", props),
39
+ children: DOTS.map((dot) => /* @__PURE__ */ jsx("div", {
40
+ className: "nsaa-loader-bouncing-dots-dot",
41
+ style: step(dot)
42
+ }, dot))
43
+ })] });
44
+ }
45
+ export { BouncingDots };
@@ -0,0 +1,6 @@
1
+
2
+ export type Cap = "flat" | "round";
3
+ export declare const DEFAULT_CAP: Cap;
4
+ export interface CapProps {
5
+ cap?: Cap;
6
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ // src/loaders/cap.ts
3
+ const DEFAULT_CAP = "round";
4
+ function linecap(cap = DEFAULT_CAP) {
5
+ return cap === "flat" ? "butt" : "round";
6
+ }
7
+ export { DEFAULT_CAP, linecap };
@@ -0,0 +1,5 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ import { CapProps } from "./cap.js";
4
+ export interface CascadeProps extends SpinnerProps, CapProps {}
5
+ export declare function Cascade({ cap, ...rest }: CascadeProps): import("react").JSX.Element;
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { linecap } from "./cap.js";
3
+ import { animation, stagger } from "./motion.js";
4
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/loaders/cascade.tsx
7
+ const RADII = [
8
+ 10.5,
9
+ 7,
10
+ 3.5
11
+ ];
12
+ const css = `
13
+ .nsaa-loader-cascade-arc {
14
+ transform-origin: center;
15
+ ${animation("cascade", "nsaa-loader-cascade-turn", "cubic-bezier(0.68, -0.75, 0.265, 1.75)")}
16
+ animation-delay: ${stagger("cascade", 24)};
17
+ }
18
+
19
+ @keyframes nsaa-loader-cascade-turn {
20
+ to {
21
+ transform: rotate(360deg);
22
+ }
23
+ }
24
+ `;
25
+ function Cascade({ cap, ...rest }) {
26
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
27
+ name: "cascade",
28
+ children: css
29
+ }), /* @__PURE__ */ jsx("svg", {
30
+ ...spinnerRoot("cascade", rest),
31
+ fill: "none",
32
+ role: "presentation",
33
+ stroke: "currentColor",
34
+ strokeLinecap: linecap(cap),
35
+ strokeWidth: "2",
36
+ viewBox: "0 0 24 24",
37
+ children: RADII.map((r, index) => {
38
+ const circumference = 2 * Math.PI * r;
39
+ return /* @__PURE__ */ jsx("circle", {
40
+ className: "nsaa-loader-cascade-arc",
41
+ cx: "12",
42
+ cy: "12",
43
+ r,
44
+ strokeDasharray: `${circumference / 4} ${circumference * 3 / 4}`,
45
+ style: step(index)
46
+ }, r);
47
+ })
48
+ })] });
49
+ }
50
+ export { Cascade };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function CircularDots(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
3
+ import { fadeCss } from "./fade.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/loaders/circular-dots.tsx
6
+ const DOTS = [
7
+ [8, 1.5],
8
+ [12.5962, 3.4038],
9
+ [14.5, 8],
10
+ [12.5962, 12.5962],
11
+ [8, 14.5],
12
+ [3.4038, 12.5962],
13
+ [1.5, 8],
14
+ [3.4038, 3.4038]
15
+ ];
16
+ const css = `
17
+ ${fadeCss("circular-dots", "dot", DOTS.length, {
18
+ dim: .2,
19
+ rest: .6
20
+ })}
21
+ `;
22
+ function CircularDots(props) {
23
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
24
+ name: "circular-dots",
25
+ children: css
26
+ }), /* @__PURE__ */ jsx("svg", {
27
+ ...spinnerRoot("circular-dots", props),
28
+ fill: "currentColor",
29
+ role: "presentation",
30
+ viewBox: "0 0 16 16",
31
+ children: DOTS.map(([cx, cy], index) => /* @__PURE__ */ jsx("circle", {
32
+ className: "nsaa-loader-circular-dots-dot",
33
+ cx,
34
+ cy,
35
+ r: "1.5",
36
+ style: step(index)
37
+ }, `${cx}-${cy}`))
38
+ })] });
39
+ }
40
+ export { CircularDots };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function ClassicV2(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
3
+ import { fadeCss } from "./fade.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/loaders/classic-v2.tsx
6
+ const TICKS = [
7
+ "M7.33334 0.666667C7.33334 0.298477 7.63181 0 8 0C8.36819 0 8.66667 0.298477 8.66667 0.666667V3.33333C8.66667 3.70152 8.36819 4 8 4C7.63181 4 7.33334 3.70152 7.33334 3.33333V0.666667Z",
8
+ "M11.7712 5.17154C11.5109 5.43189 11.0888 5.43189 10.8284 5.17154C10.5681 4.91119 10.5681 4.48908 10.8284 4.22873L12.714 2.34311C12.9744 2.08276 13.3965 2.08276 13.6568 2.34311C13.9172 2.60346 13.9172 3.02557 13.6568 3.28592L11.7712 5.17154Z",
9
+ "M12.6667 8.66667C12.2985 8.66667 12 8.36819 12 8.00001C12 7.63182 12.2985 7.33334 12.6667 7.33334H15.3333C15.7015 7.33334 16 7.63182 16 8.00001C16 8.36819 15.7015 8.66667 15.3333 8.66667H12.6667Z",
10
+ "M10.8284 11.7713C10.5681 11.5109 10.5681 11.0888 10.8284 10.8284C11.0888 10.5681 11.5109 10.5681 11.7712 10.8284L13.6568 12.7141C13.9172 12.9744 13.9172 13.3965 13.6568 13.6569C13.3965 13.9172 12.9744 13.9172 12.714 13.6569L10.8284 11.7713Z",
11
+ "M7.33333 12.6667C7.33333 12.2985 7.63181 12 8 12C8.36819 12 8.66667 12.2985 8.66667 12.6667V15.3333C8.66667 15.7015 8.36819 16 8 16C7.63181 16 7.33333 15.7015 7.33333 15.3333V12.6667Z",
12
+ "M3.28594 13.6569C3.02559 13.9172 2.60348 13.9172 2.34313 13.6569C2.08278 13.3965 2.08278 12.9744 2.34313 12.714L4.22875 10.8284C4.4891 10.5681 4.91121 10.5681 5.17156 10.8284C5.43191 11.0888 5.43191 11.5109 5.17156 11.7712L3.28594 13.6569Z",
13
+ "M0.666667 8.66667C0.298477 8.66667 1.60941e-08 8.36819 0 8.00001C-1.60941e-08 7.63182 0.298477 7.33334 0.666667 7.33334H3.33333C3.70152 7.33334 4 7.63182 4 8.00001C4 8.36819 3.70152 8.66667 3.33333 8.66667H0.666667Z",
14
+ "M2.34315 3.28594C2.0828 3.02559 2.0828 2.60348 2.34315 2.34314C2.6035 2.08279 3.02561 2.08279 3.28596 2.34313L5.17158 4.22875C5.43193 4.4891 5.43193 4.91121 5.17158 5.17156C4.91123 5.43191 4.48912 5.43191 4.22877 5.17156L2.34315 3.28594Z"
15
+ ];
16
+ const css = `
17
+ ${fadeCss("classic-v2", "tick", TICKS.length, {
18
+ dim: .4,
19
+ rest: .5
20
+ })}
21
+ `;
22
+ function ClassicV2(props) {
23
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
24
+ name: "classic-v2",
25
+ children: css
26
+ }), /* @__PURE__ */ jsx("svg", {
27
+ ...spinnerRoot("classic-v2", props),
28
+ fill: "none",
29
+ role: "presentation",
30
+ viewBox: "0 0 16 16",
31
+ children: /* @__PURE__ */ jsx("g", {
32
+ fill: "currentColor",
33
+ children: TICKS.map((d, tick) => /* @__PURE__ */ jsx("path", {
34
+ className: "nsaa-loader-classic-v2-tick",
35
+ d,
36
+ style: step(tick)
37
+ }, d))
38
+ })
39
+ })] });
40
+ }
41
+ export { ClassicV2 };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function Classic(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { SIZE, STEP_VAR } 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/classic.tsx
7
+ const BARS = Array.from({ length: 12 }, (_, index) => index);
8
+ const css = `
9
+ .nsaa-loader-classic-inner {
10
+ position: relative;
11
+ top: 50%;
12
+ left: 50%;
13
+ width: ${SIZE};
14
+ height: ${SIZE};
15
+ }
16
+
17
+ .nsaa-loader-classic-bar {
18
+ position: absolute;
19
+ top: -3.9%;
20
+ left: -10%;
21
+ width: 24%;
22
+ height: 8%;
23
+ background: currentColor;
24
+ border-radius: 6px;
25
+ transform: rotate(calc(var(${STEP_VAR}) * 30deg)) translate(146%);
26
+ }
27
+
28
+ ${fadeCss("classic", "bar", BARS.length, {
29
+ dim: .15,
30
+ rest: .5
31
+ })}
32
+ `;
33
+ function Classic(props) {
34
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
35
+ name: "classic",
36
+ children: css
37
+ }), /* @__PURE__ */ jsx("div", {
38
+ ...spinnerRoot("classic", props),
39
+ children: /* @__PURE__ */ jsx("div", {
40
+ className: "nsaa-loader-classic-inner",
41
+ children: BARS.map((bar) => /* @__PURE__ */ jsx("div", {
42
+ className: "nsaa-loader-classic-bar",
43
+ style: step(bar)
44
+ }, bar))
45
+ })
46
+ })] });
47
+ }
48
+ export { Classic };
@@ -0,0 +1,5 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ import { EasingProps } from "./easing.js";
4
+ export interface ClockProps extends SpinnerProps, EasingProps {}
5
+ export declare function Clock({ easing, ...rest }: ClockProps): import("react").JSX.Element;
@@ -0,0 +1,31 @@
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
+ // src/loaders/clock.tsx
6
+ const css = `
7
+ ${rotationCss("clock")}
8
+ `;
9
+ function Clock({ easing, ...rest }) {
10
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
11
+ name: "clock",
12
+ children: css
13
+ }), /* @__PURE__ */ jsxs("svg", {
14
+ ...spinnerRoot("clock", rest),
15
+ fill: "none",
16
+ role: "presentation",
17
+ viewBox: "0 0 16 16",
18
+ children: [/* @__PURE__ */ jsx("circle", {
19
+ cx: "8",
20
+ cy: "8",
21
+ fill: "currentColor",
22
+ opacity: "0.1",
23
+ r: "8"
24
+ }), /* @__PURE__ */ jsx("path", {
25
+ className: spinClass("clock", easing),
26
+ d: "M11.1937 2.92061C10.5206 2.49739 9.77304 2.21397 8.9954 2.08314C8.45076 1.99151 8 2.44772 8 3V7.20324C8 7.49211 8.12492 7.76686 8.34259 7.95677L11.8999 11.0603C12.3287 11.4344 12.9913 11.378 13.2643 10.8787C13.6356 10.1998 13.8736 9.45248 13.9617 8.67713C14.0892 7.55433 13.8971 6.41834 13.4074 5.39993C12.9177 4.38152 12.1503 3.5221 11.1937 2.92061Z",
27
+ fill: "currentColor"
28
+ })]
29
+ })] });
30
+ }
31
+ export { Clock };
@@ -0,0 +1,5 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ import { EasingProps } from "./easing.js";
4
+ export interface CometProps extends SpinnerProps, EasingProps {}
5
+ export declare function Comet({ easing, ...rest }: CometProps): import("react").JSX.Element;
@@ -0,0 +1,52 @@
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/comet.tsx
7
+ const css = `
8
+ .nsaa-loader-comet {
9
+ --nsaa-loader-comet-stroke: calc(${SIZE} * 0.12);
10
+ position: relative;
11
+ }
12
+
13
+ .nsaa-loader-comet-spin {
14
+ position: absolute;
15
+ inset: 0;
16
+ }
17
+
18
+ .nsaa-loader-comet-tail {
19
+ position: absolute;
20
+ inset: 0;
21
+ border-radius: 9999px;
22
+ background: conic-gradient(from 0deg, transparent, currentColor);
23
+ -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--nsaa-loader-comet-stroke)), #000 0);
24
+ mask: radial-gradient(farthest-side, transparent calc(100% - var(--nsaa-loader-comet-stroke)), #000 0);
25
+ }
26
+
27
+ .nsaa-loader-comet-head {
28
+ position: absolute;
29
+ top: 0;
30
+ left: 50%;
31
+ width: var(--nsaa-loader-comet-stroke);
32
+ height: var(--nsaa-loader-comet-stroke);
33
+ background: currentColor;
34
+ border-radius: 9999px;
35
+ transform: translateX(-50%);
36
+ }
37
+
38
+ ${rotationCss("comet")}
39
+ `;
40
+ function Comet({ easing, ...rest }) {
41
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
42
+ name: "comet",
43
+ children: css
44
+ }), /* @__PURE__ */ jsx("div", {
45
+ ...spinnerRoot("comet", rest),
46
+ children: /* @__PURE__ */ jsxs("div", {
47
+ className: spinClass("comet", easing),
48
+ children: [/* @__PURE__ */ jsx("div", { className: "nsaa-loader-comet-tail" }), /* @__PURE__ */ jsx("div", { className: "nsaa-loader-comet-head" })]
49
+ })
50
+ })] });
51
+ }
52
+ export { Comet };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function Compass(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { animation } from "./motion.js";
3
+ import { SpinnerStyle, spinnerRoot } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/loaders/compass.tsx
6
+ const css = `
7
+ .nsaa-loader-compass-ticks {
8
+ transform-origin: center;
9
+ ${animation("compass", "nsaa-loader-compass-turn", "ease-in-out")}
10
+ }
11
+
12
+ @keyframes nsaa-loader-compass-turn {
13
+ to {
14
+ transform: rotate(90deg);
15
+ }
16
+ }
17
+ `;
18
+ function Compass(props) {
19
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
20
+ name: "compass",
21
+ children: css
22
+ }), /* @__PURE__ */ jsx("svg", {
23
+ ...spinnerRoot("compass", props),
24
+ fill: "none",
25
+ role: "presentation",
26
+ viewBox: "0 0 16 16",
27
+ children: /* @__PURE__ */ jsxs("g", {
28
+ className: "nsaa-loader-compass-ticks",
29
+ fill: "currentColor",
30
+ children: [
31
+ /* @__PURE__ */ jsx("path", { d: "M7.33334 0.666667C7.33334 0.298477 7.63181 0 8 0C8.36819 0 8.66667 0.298477 8.66667 0.666667V3.33333C8.66667 3.70152 8.36819 4 8 4C7.63181 4 7.33334 3.70152 7.33334 3.33333V0.666667Z" }),
32
+ /* @__PURE__ */ jsx("path", { d: "M12.6667 8.66667C12.2985 8.66667 12 8.3682 12 8.00001C12 7.63182 12.2985 7.33334 12.6667 7.33334H15.3333C15.7015 7.33334 16 7.63182 16 8.00001C16 8.3682 15.7015 8.66667 15.3333 8.66667H12.6667Z" }),
33
+ /* @__PURE__ */ jsx("path", { d: "M7.33333 12.6667C7.33333 12.2985 7.63181 12 8 12C8.36819 12 8.66667 12.2985 8.66667 12.6667V15.3333C8.66667 15.7015 8.36819 16 8 16C7.63181 16 7.33333 15.7015 7.33333 15.3333V12.6667Z" }),
34
+ /* @__PURE__ */ jsx("path", { d: "M0.666667 8.66667C0.298477 8.66667 1.60941e-08 8.3682 0 8.00001C-1.60941e-08 7.63182 0.298477 7.33334 0.666667 7.33334H3.33333C3.70152 7.33334 4 7.63182 4 8.00001C4 8.3682 3.70152 8.66667 3.33333 8.66667H0.666667Z" })
35
+ ]
36
+ })
37
+ })] });
38
+ }
39
+ export { Compass };
@@ -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 DualProps extends SpinnerProps, EasingProps, CapProps {}
6
+ export declare function Dual({ cap, easing, ...rest }: DualProps): import("react").JSX.Element;
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { linecap } from "./cap.js";
3
+ import { rotationCss, spinClass } from "./easing.js";
4
+ import { SpinnerStyle, reducedMotion, spinnerRoot } from "./frame.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/loaders/dual.tsx
7
+ const css = `
8
+ ${rotationCss("dual")}
9
+
10
+ .nsaa-loader-dual-inner {
11
+ animation-direction: reverse;
12
+ }
13
+
14
+ ${reducedMotion(`
15
+ .nsaa-loader-dual-inner {
16
+ transform: rotate(180deg);
17
+ }
18
+ `)}
19
+ `;
20
+ function Dual({ cap, easing, ...rest }) {
21
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
22
+ name: "dual",
23
+ children: css
24
+ }), /* @__PURE__ */ jsxs("svg", {
25
+ ...spinnerRoot("dual", rest),
26
+ fill: "none",
27
+ role: "presentation",
28
+ stroke: "currentColor",
29
+ strokeLinecap: linecap(cap),
30
+ strokeWidth: "2.5",
31
+ viewBox: "0 0 24 24",
32
+ children: [/* @__PURE__ */ jsx("circle", {
33
+ className: spinClass("dual", easing),
34
+ cx: "12",
35
+ cy: "12",
36
+ r: "10",
37
+ strokeDasharray: "18 44.8"
38
+ }), /* @__PURE__ */ jsx("circle", {
39
+ className: `nsaa-loader-dual-inner ${spinClass("dual", easing)}`,
40
+ cx: "12",
41
+ cy: "12",
42
+ r: "5.5",
43
+ strokeDasharray: "10 24.6"
44
+ })]
45
+ })] });
46
+ }
47
+ export { Dual };
@@ -0,0 +1,6 @@
1
+
2
+ export type Easing = "linear" | "ease-in-out" | "stacked";
3
+ export declare const DEFAULT_EASING: Easing;
4
+ export interface EasingProps {
5
+ easing?: Easing;
6
+ }
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { animation } from "./motion.js";
3
+ // src/loaders/easing.ts
4
+ const DEFAULT_EASING = "linear";
5
+ function spinClass(name, easing = DEFAULT_EASING) {
6
+ const base = `nsaa-loader-${name}-spin`;
7
+ return easing === "linear" ? base : `${base} ${base}-${easing}`;
8
+ }
9
+ const ROTATE = `to {
10
+ transform: rotate(360deg);
11
+ }`;
12
+ function rotationCss(name, turn = ROTATE) {
13
+ return `
14
+ .nsaa-loader-${name}-spin {
15
+ transform-origin: center;
16
+ ${animation(name, `nsaa-loader-${name}-rotate`, "linear")}
17
+ }
18
+
19
+ .nsaa-loader-${name}-spin-ease-in-out {
20
+ animation-timing-function: ease-in-out;
21
+ }
22
+
23
+ .nsaa-loader-${name}-spin-stacked {
24
+ animation-name: nsaa-loader-${name}-rotate, nsaa-loader-${name}-rotate;
25
+ animation-timing-function: linear, ease-in-out;
26
+ animation-composition: add;
27
+ }
28
+
29
+ @keyframes nsaa-loader-${name}-rotate {
30
+ ${turn}
31
+ }
32
+ `;
33
+ }
34
+ export { DEFAULT_EASING, rotationCss, spinClass };
@@ -0,0 +1,3 @@
1
+
2
+ import { SpinnerProps } from "./types.js";
3
+ export declare function Eclipse(props: SpinnerProps): import("react").JSX.Element;