@nsaa/core 0.1.0-alpha.1 → 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.
- package/dist/accordion/accordion.d.ts +7 -0
- package/dist/accordion/accordion.js +54 -0
- package/dist/accordion/index.d.ts +3 -0
- package/dist/alert/alert.d.ts +18 -0
- package/dist/alert/alert.js +53 -0
- package/dist/alert/index.d.ts +3 -0
- package/dist/alert-dialog/alert-dialog.d.ts +19 -0
- package/dist/alert-dialog/alert-dialog.js +100 -0
- package/dist/alert-dialog/index.d.ts +3 -0
- package/dist/avatar/avatar.d.ts +12 -0
- package/dist/avatar/avatar.js +50 -0
- package/dist/avatar/index.d.ts +3 -0
- package/dist/badge/badge.d.ts +8 -0
- package/dist/badge/badge.js +29 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/button/button.d.ts +25 -0
- package/dist/button/button.js +136 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/calendar/calendar.d.ts +11 -0
- package/dist/calendar/calendar.js +131 -0
- package/dist/calendar/index.d.ts +3 -0
- package/dist/card/card.d.ts +12 -0
- package/dist/card/card.js +55 -0
- package/dist/card/index.d.ts +3 -0
- package/dist/checkbox/checkbox.d.ts +4 -0
- package/dist/checkbox/checkbox.js +35 -0
- package/dist/checkbox/index.d.ts +3 -0
- package/dist/collapsible/collapsible.d.ts +6 -0
- package/dist/collapsible/collapsible.js +24 -0
- package/dist/collapsible/index.d.ts +3 -0
- package/dist/combobox/combobox.d.ts +27 -0
- package/dist/combobox/combobox.js +226 -0
- package/dist/combobox/index.d.ts +3 -0
- package/dist/command/command.d.ts +20 -0
- package/dist/command/command.js +116 -0
- package/dist/command/index.d.ts +3 -0
- package/dist/context-menu/context-menu.d.ts +30 -0
- package/dist/context-menu/context-menu.js +173 -0
- package/dist/context-menu/index.d.ts +3 -0
- package/dist/dialog/dialog.d.ts +18 -0
- package/dist/dialog/dialog.js +106 -0
- package/dist/dialog/index.d.ts +3 -0
- package/dist/direction.d.ts +3 -0
- package/dist/direction.js +2 -0
- package/dist/drawer/drawer.d.ts +17 -0
- package/dist/drawer/drawer.js +136 -0
- package/dist/drawer/index.d.ts +3 -0
- package/dist/dropdown-menu/dropdown-menu.d.ts +30 -0
- package/dist/dropdown-menu/dropdown-menu.js +177 -0
- package/dist/dropdown-menu/index.d.ts +3 -0
- package/dist/empty/empty.d.ts +35 -0
- package/dist/empty/empty.js +93 -0
- package/dist/empty/index.d.ts +3 -0
- package/dist/field/field.d.ts +26 -0
- package/dist/field/field.js +109 -0
- package/dist/field/index.d.ts +3 -0
- package/dist/index.d.ts +89 -674
- package/dist/index.js +48 -3876
- package/dist/input/index.d.ts +3 -0
- package/dist/input/input.d.ts +4 -0
- package/dist/input/input.js +14 -0
- package/dist/input-group/index.d.ts +3 -0
- package/dist/input-group/input-group.d.ts +19 -0
- package/dist/input-group/input-group.js +78 -0
- package/dist/input-otp/index.d.ts +3 -0
- package/dist/input-otp/input-otp.d.ts +12 -0
- package/dist/input-otp/input-otp.js +73 -0
- package/dist/kbd/index.d.ts +3 -0
- package/dist/kbd/kbd.d.ts +5 -0
- package/dist/kbd/kbd.js +19 -0
- package/dist/label/index.d.ts +3 -0
- package/dist/label/label.d.ts +4 -0
- package/dist/label/label.js +13 -0
- package/dist/legacy/icon-button/icon-swap.js +58 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/{cn-DxFBFdwT.js → lib/cn.js} +1 -1
- package/dist/lib/control-defaults.js +8 -0
- package/dist/lib/icon-swap.d.ts +15 -0
- package/dist/lib/icon-swap.js +26 -0
- package/dist/lib/input-modality.js +39 -0
- package/dist/lib/merge-refs.js +21 -0
- package/dist/lib/shortcut.js +50 -0
- package/dist/lib/track-input-modality.d.ts +2 -0
- package/dist/lib/track-input-modality.js +4 -0
- package/dist/lib/tv.js +7 -0
- package/dist/lib/use-press.js +48 -0
- package/dist/lib/user-action.js +13 -0
- package/dist/loaders/arc.d.ts +6 -0
- package/dist/loaders/arc.js +31 -0
- package/dist/loaders/atom.d.ts +5 -0
- package/dist/loaders/atom.js +70 -0
- package/dist/loaders/blocks.d.ts +8 -0
- package/dist/loaders/blocks.js +74 -0
- package/dist/loaders/bouncing-dots.d.ts +3 -0
- package/dist/loaders/bouncing-dots.js +45 -0
- package/dist/loaders/cap.d.ts +6 -0
- package/dist/loaders/cap.js +7 -0
- package/dist/loaders/cascade.d.ts +5 -0
- package/dist/loaders/cascade.js +50 -0
- package/dist/loaders/circular-dots.d.ts +3 -0
- package/dist/loaders/circular-dots.js +40 -0
- package/dist/loaders/classic-v2.d.ts +3 -0
- package/dist/loaders/classic-v2.js +41 -0
- package/dist/loaders/classic.d.ts +3 -0
- package/dist/loaders/classic.js +48 -0
- package/dist/loaders/clock.d.ts +5 -0
- package/dist/loaders/clock.js +31 -0
- package/dist/loaders/comet.d.ts +5 -0
- package/dist/loaders/comet.js +52 -0
- package/dist/loaders/compass.d.ts +3 -0
- package/dist/loaders/compass.js +39 -0
- package/dist/loaders/dual.d.ts +6 -0
- package/dist/loaders/dual.js +47 -0
- package/dist/loaders/easing.d.ts +6 -0
- package/dist/loaders/easing.js +34 -0
- package/dist/loaders/eclipse.d.ts +3 -0
- package/dist/loaders/eclipse.js +69 -0
- package/dist/loaders/fade.js +28 -0
- package/dist/loaders/flip.d.ts +3 -0
- package/dist/loaders/flip.js +41 -0
- package/dist/{frame-CK9IBOZB.js → loaders/frame.js} +2 -50
- package/dist/loaders/gather.d.ts +3 -0
- package/dist/loaders/gather.js +85 -0
- package/dist/loaders/leap.d.ts +3 -0
- package/dist/loaders/leap.js +67 -0
- package/dist/loaders/linear-dots.d.ts +3 -0
- package/dist/loaders/linear-dots.js +54 -0
- package/dist/loaders/loading.d.ts +3 -0
- package/dist/loaders/loading.js +64 -0
- package/dist/loaders/morph.d.ts +3 -0
- package/dist/loaders/morph.js +40 -0
- package/dist/loaders/motion.d.ts +35 -0
- package/dist/loaders/motion.js +51 -0
- package/dist/loaders/orbit.d.ts +5 -0
- package/dist/loaders/orbit.js +44 -0
- package/dist/loaders/pulse.d.ts +3 -0
- package/dist/loaders/pulse.js +52 -0
- package/dist/loaders/radar.d.ts +5 -0
- package/dist/loaders/radar.js +64 -0
- package/dist/loaders/ring.d.ts +6 -0
- package/dist/loaders/ring.js +38 -0
- package/dist/loaders/ripple.d.ts +8 -0
- package/dist/loaders/ripple.js +57 -0
- package/dist/loaders/slide.d.ts +3 -0
- package/dist/loaders/slide.js +74 -0
- package/dist/loaders/snake.d.ts +6 -0
- package/dist/loaders/snake.js +59 -0
- package/dist/loaders/spinners.d.ts +61 -0
- package/dist/loaders/spinners.js +63 -0
- package/dist/loaders/swirl.d.ts +3 -0
- package/dist/loaders/swirl.js +50 -0
- package/dist/loaders/text/shared.js +25 -0
- package/dist/loaders/text/text-loaders.d.ts +48 -0
- package/dist/loaders/text/text-loaders.js +723 -0
- package/dist/loaders/trace.d.ts +6 -0
- package/dist/loaders/trace.js +46 -0
- package/dist/loaders/types.d.ts +10 -0
- package/dist/loaders/wave.d.ts +8 -0
- package/dist/loaders/wave.js +59 -0
- package/dist/loaders-text.d.ts +2 -47
- package/dist/loaders-text.js +1 -743
- package/dist/loaders.d.ts +36 -132
- package/dist/loaders.js +35 -1096
- package/dist/native-select/index.d.ts +3 -0
- package/dist/native-select/native-select.d.ts +9 -0
- package/dist/native-select/native-select.js +44 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/pagination.d.ts +18 -0
- package/dist/pagination/pagination.js +134 -0
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/popover.d.ts +10 -0
- package/dist/popover/popover.js +54 -0
- package/dist/radio-group/index.d.ts +3 -0
- package/dist/radio-group/radio-group.d.ts +6 -0
- package/dist/radio-group/radio-group.js +33 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/select.d.ts +16 -0
- package/dist/select/select.js +148 -0
- package/dist/separator/index.d.ts +3 -0
- package/dist/separator/separator.d.ts +4 -0
- package/dist/separator/separator.js +15 -0
- package/dist/skeleton/index.d.ts +3 -0
- package/dist/skeleton/skeleton.d.ts +10 -0
- package/dist/skeleton/skeleton.js +24 -0
- package/dist/slider/index.d.ts +3 -0
- package/dist/slider/slider.d.ts +4 -0
- package/dist/slider/slider.js +39 -0
- package/dist/sound/sound-map.d.ts +70 -0
- package/dist/sound/sound-map.js +72 -0
- package/dist/sound/sound.d.ts +38 -0
- package/dist/sound/sound.js +136 -0
- package/dist/sound/uisfx.d.ts +37 -0
- package/dist/sound/uisfx.js +59 -0
- package/dist/sound-uisfx.d.ts +2 -37
- package/dist/sound-uisfx.js +1 -58
- package/dist/spinner/index.d.ts +5 -0
- package/dist/spinner/loader-provider.d.ts +16 -0
- package/dist/spinner/loader-provider.js +28 -0
- package/dist/spinner/registry.d.ts +9 -0
- package/dist/spinner/registry.js +15 -0
- package/dist/spinner/spinner.d.ts +26 -0
- package/dist/spinner/spinner.js +143 -0
- package/dist/switch/index.d.ts +3 -0
- package/dist/switch/switch.d.ts +6 -0
- package/dist/switch/switch.js +25 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/table.d.ts +17 -0
- package/dist/table/table.js +66 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/tabs.d.ts +11 -0
- package/dist/tabs/tabs.js +46 -0
- package/dist/textarea/index.d.ts +3 -0
- package/dist/textarea/textarea.d.ts +4 -0
- package/dist/textarea/textarea.js +12 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/toast.d.ts +17 -0
- package/dist/toast/toast.js +211 -0
- package/dist/toggle-group/index.d.ts +3 -0
- package/dist/toggle-group/toggle-group.d.ts +64 -0
- package/dist/toggle-group/toggle-group.js +95 -0
- package/dist/tokens/dist/motion.d.ts +24 -0
- package/dist/{motion-NQq2BA78.js → tokens/dist/motion.js} +1 -1
- package/dist/toolbar/index.d.ts +3 -0
- package/dist/toolbar/overflow.d.ts +4 -0
- package/dist/toolbar/overflow.js +242 -0
- package/dist/toolbar/toolbar-item.d.ts +29 -0
- package/dist/toolbar/toolbar-item.js +71 -0
- package/dist/toolbar/toolbar.d.ts +73 -0
- package/dist/toolbar/toolbar.js +250 -0
- package/dist/tooltip/index.d.ts +3 -0
- package/dist/tooltip/tooltip.d.ts +7 -0
- package/dist/tooltip/tooltip.js +41 -0
- package/package.json +4 -3
- package/dist/registry-2PyPW9Xw.js +0 -390
- package/dist/registry-DjfWNw3R.d.ts +0 -18
- package/dist/sound-DiYNAnR_.d.ts +0 -61
|
@@ -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,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,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,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 };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface TextLoaderBase extends Omit<React.ComponentProps<"span">, "children"> {
|
|
4
|
+
/** One cycle, ms. Default: the loader's token (an ancestor's speed cascades). */
|
|
5
|
+
duration?: number | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface ShimmerTextProps extends TextLoaderBase {
|
|
8
|
+
children: string;
|
|
9
|
+
/** Announced instead of the text, if different. */
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** "Thinking…", "Processing payment…": a light band sweeps across the words. Static text under reduced motion. */
|
|
13
|
+
export declare function ShimmerText({ children, label, duration, className, style, ...props }: ShimmerTextProps): React.JSX.Element;
|
|
14
|
+
export interface ShimmerWaveProps extends TextLoaderBase {
|
|
15
|
+
children: string;
|
|
16
|
+
label?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** Longer AI status lines: each letter lifts and brightens in turn. Static text under reduced motion. */
|
|
19
|
+
export declare function ShimmerWave({ children, label, duration, className, style, ...props }: ShimmerWaveProps): React.JSX.Element;
|
|
20
|
+
export interface TextDotsProps extends TextLoaderBase {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
dots?: number | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** "Loading…" with dots that step in. A static "…" under reduced motion. */
|
|
25
|
+
export declare function TextDots({ children, dots, duration, className, style, ...props }: TextDotsProps): React.JSX.Element;
|
|
26
|
+
export interface TypingProps extends TextLoaderBase {
|
|
27
|
+
dots?: number | undefined;
|
|
28
|
+
/** Announced, e.g. "Ama is typing". Default "Typing". */
|
|
29
|
+
label?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/** A chat "is typing" bubble: three dots bob in turn. Three static dots under reduced motion. */
|
|
32
|
+
export declare function Typing({ dots, label, duration, className, style, ...props }: TypingProps): React.JSX.Element;
|
|
33
|
+
export interface AnalyzingImageProps extends TextLoaderBase {
|
|
34
|
+
/** Default "Analyzing image". */
|
|
35
|
+
label?: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** An image upload or scan: the picture dissolves into pixels behind a scan line. A static picture under reduced motion. */
|
|
38
|
+
export declare function AnalyzingImage({ label, duration, className, style, ...props }: AnalyzingImageProps): React.JSX.Element;
|
|
39
|
+
export interface TerminalProps extends TextLoaderBase {
|
|
40
|
+
prompt?: string | undefined;
|
|
41
|
+
/** The last line of output, shown after the prompt. */
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
/** Announced. Default "Loading". */
|
|
44
|
+
label?: string | undefined;
|
|
45
|
+
}
|
|
46
|
+
/** CLI or log-style progress: a prompt, the last line and a blinking cursor. Static under reduced motion. */
|
|
47
|
+
export declare function Terminal({ prompt, children, label, duration, className, style, ...props }: TerminalProps): React.JSX.Element;
|
|
48
|
+
export {};
|