@botiverse/raft-ui 0.81.0 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/components/choice-list/choice-list.d.mts +8 -0
- package/dist/components/choice-list/choice-list.mjs +37 -16
- package/dist/components/choice-list/choice-list.recipe.mjs +1 -0
- package/dist/components/composer/composer-drop-overlay.d.mts +9 -4
- package/dist/components/composer/composer-drop-overlay.mjs +2 -5
- package/dist/components/list-row/index.d.mts +2 -2
- package/dist/components/list-row/list-row.d.mts +9 -0
- package/dist/components/list-row/list-row.mjs +20 -1
- package/dist/components/list-row/list-row.recipe.d.mts +3 -0
- package/dist/components/list-row/list-row.recipe.mjs +1 -0
- package/dist/components/message-action-card/index.d.mts +2 -2
- package/dist/components/message-action-card/message-action-card.d.mts +8 -0
- package/dist/components/message-action-card/message-action-card.mjs +16 -1
- package/dist/components/message-action-card/message-action-card.recipe.mjs +5 -0
- package/dist/components/resizable/resizable.recipe.mjs +4 -4
- package/dist/components/scroll-area/use-scrollbars.mjs +2 -1
- package/dist/components/steps/otter-animation-visibility.mjs +45 -0
- package/dist/components/steps/otter-indicator.css +131 -106
- package/dist/components/steps/otter-indicator.d.mts +5 -8
- package/dist/components/steps/otter-indicator.mjs +38 -314
- package/dist/components/steps/ottie-assets/error.webp +0 -0
- package/dist/components/steps/ottie-assets/finish.webp +0 -0
- package/dist/components/steps/ottie-assets/process.webp +0 -0
- package/dist/components/steps/ottie-assets/wait.webp +0 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
|
@@ -1,141 +1,166 @@
|
|
|
1
|
-
/*
|
|
2
|
-
OtterIndicator — an otter posed by a status (an agent's turn, a step). The
|
|
3
|
-
picture is fixed art; only the badges and the "z" take token colours.
|
|
4
|
-
───────────────────────────────────────────────────────────────────────── */
|
|
5
|
-
|
|
1
|
+
/* Fixed Ottie artwork in separate CSS assets; no image modules/base64 in JS. */
|
|
6
2
|
.r-otter-indicator {
|
|
7
|
-
overflow:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
.r-otter-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
}
|
|
6
|
+
.r-otter-indicator--wait {
|
|
7
|
+
--r-ottie-art: url("./ottie-assets/wait.webp");
|
|
8
|
+
}
|
|
9
|
+
.r-otter-indicator--process {
|
|
10
|
+
--r-ottie-art: url("./ottie-assets/process.webp");
|
|
11
|
+
}
|
|
12
|
+
.r-otter-indicator--error {
|
|
13
|
+
--r-ottie-art: url("./ottie-assets/error.webp");
|
|
14
|
+
}
|
|
15
|
+
.r-otter-indicator--finish {
|
|
16
|
+
--r-ottie-art: url("./ottie-assets/finish.webp");
|
|
17
|
+
}
|
|
18
|
+
.r-otter-indicator__viewport {
|
|
19
|
+
width: 100%;
|
|
20
|
+
aspect-ratio: 1;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
23
|
+
.r-otter-indicator__art {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
.r-otter-indicator__base,
|
|
29
|
+
.r-otter-indicator__frames,
|
|
30
|
+
.r-otter-indicator__rest {
|
|
31
|
+
position: absolute;
|
|
32
|
+
inset: 0;
|
|
33
|
+
background-image: var(--r-ottie-art);
|
|
34
|
+
background-size: 300% 200%;
|
|
35
|
+
background-repeat: no-repeat;
|
|
36
|
+
background-position: 0% 0%;
|
|
37
|
+
}
|
|
38
|
+
.r-otter-indicator__rest {
|
|
39
|
+
background-size: contain;
|
|
40
|
+
background-position: center;
|
|
41
|
+
transform-origin: 50% 80%;
|
|
42
|
+
}
|
|
43
|
+
.r-otter-indicator--process .r-otter-indicator__frames {
|
|
44
|
+
mask-image:
|
|
45
|
+
radial-gradient(ellipse 11% 9% at 40% 60%, oklch(0 0 0) 88%, transparent 100%),
|
|
46
|
+
radial-gradient(ellipse 11% 9% at 61% 60%, oklch(0 0 0) 88%, transparent 100%);
|
|
47
|
+
}
|
|
48
|
+
.r-otter-indicator--error .r-otter-indicator__frames {
|
|
49
|
+
mask-image: linear-gradient(oklch(0 0 0) 0 58%, transparent 64%);
|
|
50
|
+
}
|
|
51
|
+
.r-otter-indicator--error .r-otter-indicator__frames,
|
|
52
|
+
.r-otter-indicator--finish .r-otter-indicator__frames {
|
|
53
|
+
background-position: 100% 100%;
|
|
54
|
+
}
|
|
55
|
+
.r-otter-indicator__question {
|
|
56
|
+
fill: oklch(0.57 0.09 75);
|
|
57
|
+
font-family: ui-rounded, system-ui, sans-serif;
|
|
27
58
|
}
|
|
28
59
|
@media (prefers-reduced-motion: no-preference) {
|
|
29
|
-
.r-otter-
|
|
30
|
-
animation: r-
|
|
60
|
+
.r-otter-indicator__rest {
|
|
61
|
+
animation: r-ottie-breathe 6s ease-in-out infinite;
|
|
31
62
|
}
|
|
32
|
-
.r-otter-
|
|
33
|
-
animation
|
|
63
|
+
.r-otter-indicator--process .r-otter-indicator__frames {
|
|
64
|
+
animation: r-ottie-type 4.52s steps(1, end) infinite;
|
|
34
65
|
}
|
|
35
|
-
.r-otter-indicator--
|
|
36
|
-
animation: r-
|
|
66
|
+
.r-otter-indicator--error .r-otter-indicator__frames {
|
|
67
|
+
animation: r-ottie-tilt 1.55s steps(1, end) both;
|
|
37
68
|
}
|
|
38
|
-
.r-otter-indicator--
|
|
39
|
-
animation: r-
|
|
69
|
+
.r-otter-indicator--finish .r-otter-indicator__frames {
|
|
70
|
+
animation: r-ottie-finish 1.24s steps(1, end) both;
|
|
40
71
|
}
|
|
41
|
-
.r-otter-
|
|
42
|
-
animation: r-
|
|
72
|
+
.r-otter-indicator__question {
|
|
73
|
+
animation: r-ottie-question 1s linear both;
|
|
43
74
|
}
|
|
44
|
-
.r-otter-indicator
|
|
45
|
-
|
|
75
|
+
.r-otter-indicator .r-otter-indicator__rest,
|
|
76
|
+
.r-otter-indicator .r-otter-indicator__frames,
|
|
77
|
+
.r-otter-indicator .r-otter-indicator__question {
|
|
78
|
+
animation-play-state: paused;
|
|
46
79
|
}
|
|
47
|
-
.r-otter-indicator
|
|
48
|
-
|
|
80
|
+
.r-otter-indicator[data-animate="true"] .r-otter-indicator__rest,
|
|
81
|
+
.r-otter-indicator[data-animate="true"] .r-otter-indicator__frames,
|
|
82
|
+
.r-otter-indicator[data-animate="true"] .r-otter-indicator__question {
|
|
83
|
+
animation-play-state: running;
|
|
49
84
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
85
|
+
}
|
|
86
|
+
@keyframes r-ottie-breathe {
|
|
87
|
+
0%,
|
|
88
|
+
100% {
|
|
89
|
+
transform: scaleY(1);
|
|
55
90
|
}
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
50% {
|
|
92
|
+
transform: scaleY(1.006);
|
|
58
93
|
}
|
|
59
|
-
|
|
60
|
-
|
|
94
|
+
}
|
|
95
|
+
@keyframes r-ottie-type {
|
|
96
|
+
0%,
|
|
97
|
+
100% {
|
|
98
|
+
background-position: 0% 0%;
|
|
61
99
|
}
|
|
62
|
-
.
|
|
63
|
-
|
|
100
|
+
48.6726% {
|
|
101
|
+
background-position: 50% 0%;
|
|
64
102
|
}
|
|
65
|
-
.
|
|
66
|
-
|
|
103
|
+
52.6549% {
|
|
104
|
+
background-position: 100% 0%;
|
|
67
105
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.r-otter-indicator__z {
|
|
71
|
-
opacity: 1;
|
|
106
|
+
58.8496% {
|
|
107
|
+
background-position: 0% 100%;
|
|
72
108
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
from {
|
|
76
|
-
transform: translateY(-0.6px) rotate(-3deg);
|
|
109
|
+
62.8319% {
|
|
110
|
+
background-position: 50% 100%;
|
|
77
111
|
}
|
|
78
|
-
|
|
79
|
-
|
|
112
|
+
69.0265% {
|
|
113
|
+
background-position: 100% 100%;
|
|
80
114
|
}
|
|
81
115
|
}
|
|
82
|
-
@keyframes r-
|
|
83
|
-
|
|
84
|
-
|
|
116
|
+
@keyframes r-ottie-tilt {
|
|
117
|
+
0% {
|
|
118
|
+
background-position: 0% 0%;
|
|
85
119
|
}
|
|
86
|
-
|
|
87
|
-
|
|
120
|
+
8.3871% {
|
|
121
|
+
background-position: 50% 0%;
|
|
88
122
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
to {
|
|
92
|
-
transform: translateX(-12px);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
@keyframes r-otter-indicator-ripple {
|
|
96
|
-
from {
|
|
97
|
-
opacity: 0.8;
|
|
98
|
-
transform: scale(0.4);
|
|
123
|
+
16.7742% {
|
|
124
|
+
background-position: 100% 0%;
|
|
99
125
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
transform: scale(1.6);
|
|
126
|
+
25.1613% {
|
|
127
|
+
background-position: 0% 100%;
|
|
103
128
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
from {
|
|
107
|
-
transform: scale(1, 1);
|
|
129
|
+
33.5484% {
|
|
130
|
+
background-position: 50% 100%;
|
|
108
131
|
}
|
|
109
|
-
|
|
110
|
-
|
|
132
|
+
41.9355%,
|
|
133
|
+
100% {
|
|
134
|
+
background-position: 100% 100%;
|
|
111
135
|
}
|
|
112
136
|
}
|
|
113
|
-
@keyframes r-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
transform: translate(0, 0);
|
|
137
|
+
@keyframes r-ottie-finish {
|
|
138
|
+
0% {
|
|
139
|
+
background-position: 0% 0%;
|
|
117
140
|
}
|
|
118
|
-
|
|
119
|
-
|
|
141
|
+
13.7097% {
|
|
142
|
+
background-position: 50% 0%;
|
|
120
143
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
transform: translate(4px, -7px);
|
|
144
|
+
26.6129% {
|
|
145
|
+
background-position: 100% 0%;
|
|
124
146
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
from {
|
|
128
|
-
transform: translateX(-0.4px);
|
|
147
|
+
38.7097% {
|
|
148
|
+
background-position: 0% 100%;
|
|
129
149
|
}
|
|
130
|
-
|
|
131
|
-
|
|
150
|
+
51.6129% {
|
|
151
|
+
background-position: 50% 100%;
|
|
152
|
+
}
|
|
153
|
+
63.7097%,
|
|
154
|
+
100% {
|
|
155
|
+
background-position: 100% 100%;
|
|
132
156
|
}
|
|
133
157
|
}
|
|
134
|
-
@keyframes r-
|
|
135
|
-
|
|
136
|
-
|
|
158
|
+
@keyframes r-ottie-question {
|
|
159
|
+
0%,
|
|
160
|
+
72% {
|
|
161
|
+
opacity: 0;
|
|
137
162
|
}
|
|
138
|
-
|
|
139
|
-
|
|
163
|
+
100% {
|
|
164
|
+
opacity: 1;
|
|
140
165
|
}
|
|
141
166
|
}
|
|
@@ -5,13 +5,10 @@ export interface OtterIndicatorProps extends Omit<ComponentPropsWithRef<"svg">,
|
|
|
5
5
|
status: StepStatus;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* - `error`: shivering in the water; the parcel has slipped away.
|
|
13
|
-
*
|
|
14
|
-
* It fills its box; give it 48px or more so the poses read.
|
|
8
|
+
* Ottie resting, quietly typing, tilting its head or celebrating.
|
|
9
|
+
* Wait/process loop only while visible. Error/finish play once on entry.
|
|
10
|
+
* Reduced motion shows a still pose. Give it an explicit square box, 40px or larger.
|
|
11
|
+
* Decorative by default; the consumer supplies the nearby status text.
|
|
15
12
|
*/
|
|
16
|
-
export declare function OtterIndicator({ status, className, ...props }: OtterIndicatorProps): import("react").JSX.Element;
|
|
13
|
+
export declare function OtterIndicator({ status, className, ref, ...props }: OtterIndicatorProps): import("react").JSX.Element;
|
|
17
14
|
//#endregion
|
|
@@ -1,330 +1,54 @@
|
|
|
1
1
|
import { cn } from "../../cn.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { useMergedRef } from "../../lib/use-merged-ref.mjs";
|
|
3
|
+
import { observeOtterAnimation } from "./otter-animation-visibility.mjs";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
3
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
//#region src/components/steps/otter-indicator.tsx
|
|
5
|
-
const WAVE_PATH = "M-12 30q3-1.6 6 0t6 0t6 0t6 0t6 0t6 0t6 0t6 0t6 0t6 0t6 0t6 0V48H-12Z";
|
|
6
|
-
const FUR = "oklch(0.5 0.07 55)";
|
|
7
|
-
const FUR_DARK = "oklch(0.42 0.06 55)";
|
|
8
|
-
const INK = "oklch(0.22 0.03 45)";
|
|
9
|
-
const WHITE = "oklch(1 0 0)";
|
|
10
|
-
function Parcel({ x, y }) {
|
|
11
|
-
return /* @__PURE__ */ jsxs("g", {
|
|
12
|
-
transform: `translate(${x} ${y})`,
|
|
13
|
-
children: [/* @__PURE__ */ jsx("rect", {
|
|
14
|
-
width: "9",
|
|
15
|
-
height: "7",
|
|
16
|
-
rx: "0.8",
|
|
17
|
-
fill: "oklch(0.78 0.12 75)",
|
|
18
|
-
stroke: FUR_DARK,
|
|
19
|
-
strokeWidth: "0.8"
|
|
20
|
-
}), /* @__PURE__ */ jsx("path", {
|
|
21
|
-
d: "M4.5 0v7M0 3h9",
|
|
22
|
-
stroke: "oklch(0.63 0.11 65)",
|
|
23
|
-
strokeWidth: "0.8"
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
/** The face changes with the step: asleep, paddling, pleased or upset. */
|
|
28
|
-
function Face({ status }) {
|
|
29
|
-
const line = {
|
|
30
|
-
fill: "none",
|
|
31
|
-
stroke: INK,
|
|
32
|
-
strokeWidth: .8,
|
|
33
|
-
strokeLinecap: "round"
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
36
|
-
status === "process" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("circle", {
|
|
37
|
-
cx: "36.3",
|
|
38
|
-
cy: "20.6",
|
|
39
|
-
r: "1.1",
|
|
40
|
-
fill: INK
|
|
41
|
-
}), /* @__PURE__ */ jsx("circle", {
|
|
42
|
-
cx: "36.7",
|
|
43
|
-
cy: "20.2",
|
|
44
|
-
r: "0.35",
|
|
45
|
-
fill: WHITE
|
|
46
|
-
})] }),
|
|
47
|
-
status === "wait" && /* @__PURE__ */ jsx("path", {
|
|
48
|
-
d: "M35.2 20.6q1.1 0.9 2.2 0",
|
|
49
|
-
...line
|
|
50
|
-
}),
|
|
51
|
-
status === "finish" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", {
|
|
52
|
-
d: "M35.2 21.2q1.1-1.3 2.2 0",
|
|
53
|
-
...line
|
|
54
|
-
}), /* @__PURE__ */ jsx("ellipse", {
|
|
55
|
-
cx: "38.6",
|
|
56
|
-
cy: "22.4",
|
|
57
|
-
rx: "1.3",
|
|
58
|
-
ry: "0.8",
|
|
59
|
-
fill: "oklch(0.8 0.1 20)",
|
|
60
|
-
opacity: "0.8"
|
|
61
|
-
})] }),
|
|
62
|
-
status === "error" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
63
|
-
/* @__PURE__ */ jsx("circle", {
|
|
64
|
-
cx: "36.3",
|
|
65
|
-
cy: "20.8",
|
|
66
|
-
r: "1.2",
|
|
67
|
-
fill: WHITE,
|
|
68
|
-
stroke: INK,
|
|
69
|
-
strokeWidth: "0.5"
|
|
70
|
-
}),
|
|
71
|
-
/* @__PURE__ */ jsx("circle", {
|
|
72
|
-
cx: "36.5",
|
|
73
|
-
cy: "21",
|
|
74
|
-
r: "0.55",
|
|
75
|
-
fill: INK
|
|
76
|
-
}),
|
|
77
|
-
/* @__PURE__ */ jsx("path", {
|
|
78
|
-
d: "M34.6 18.2l2.8 0.8",
|
|
79
|
-
...line
|
|
80
|
-
})
|
|
81
|
-
] }),
|
|
82
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
83
|
-
cx: "42.6",
|
|
84
|
-
cy: "23.6",
|
|
85
|
-
rx: "1.4",
|
|
86
|
-
ry: "1.1",
|
|
87
|
-
fill: INK
|
|
88
|
-
}),
|
|
89
|
-
/* @__PURE__ */ jsx("path", {
|
|
90
|
-
d: status === "error" ? "M39.6 27.2q1-0.9 2.1 0" : "M39.6 26.6q1 0.9 2.1 0",
|
|
91
|
-
...line,
|
|
92
|
-
strokeWidth: .7
|
|
93
|
-
}),
|
|
94
|
-
/* @__PURE__ */ jsx("path", {
|
|
95
|
-
d: "M41 25.2l4.2-0.8M41 26l4.2 0.6",
|
|
96
|
-
stroke: FUR_DARK,
|
|
97
|
-
strokeWidth: "0.4",
|
|
98
|
-
strokeLinecap: "round"
|
|
99
|
-
})
|
|
100
|
-
] });
|
|
101
|
-
}
|
|
102
|
-
/** A small badge above the head: ✓ when done, ! when failed. */
|
|
103
|
-
function Badge({ status }) {
|
|
104
|
-
if (status !== "finish" && status !== "error") return null;
|
|
105
|
-
return /* @__PURE__ */ jsxs("g", {
|
|
106
|
-
transform: "translate(43 9)",
|
|
107
|
-
children: [/* @__PURE__ */ jsx("circle", {
|
|
108
|
-
r: "4.6",
|
|
109
|
-
fill: status === "finish" ? "var(--success)" : "var(--danger)",
|
|
110
|
-
stroke: WHITE,
|
|
111
|
-
strokeWidth: "1"
|
|
112
|
-
}), status === "finish" ? /* @__PURE__ */ jsx("path", {
|
|
113
|
-
d: "M-2 0l1.4 1.5L2.1-1.4",
|
|
114
|
-
fill: "none",
|
|
115
|
-
stroke: WHITE,
|
|
116
|
-
strokeWidth: "1.2",
|
|
117
|
-
strokeLinecap: "round",
|
|
118
|
-
strokeLinejoin: "round"
|
|
119
|
-
}) : /* @__PURE__ */ jsx("path", {
|
|
120
|
-
d: "M0-2.4v2.6M0 2.1v0.1",
|
|
121
|
-
stroke: WHITE,
|
|
122
|
-
strokeWidth: "1.3",
|
|
123
|
-
strokeLinecap: "round"
|
|
124
|
-
})]
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/** The otter on its back, posed by the step: paddling, at ease, upset or asleep. */
|
|
128
|
-
function OtterBody({ status }) {
|
|
129
|
-
return /* @__PURE__ */ jsxs("g", {
|
|
130
|
-
className: "r-otter-indicator__body",
|
|
131
|
-
children: [
|
|
132
|
-
/* @__PURE__ */ jsx("path", {
|
|
133
|
-
d: "M13 26.5Q6 26.5 1.5 30.5Q7 32 13 31Z",
|
|
134
|
-
fill: FUR_DARK
|
|
135
|
-
}),
|
|
136
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
137
|
-
cx: "11",
|
|
138
|
-
cy: "21.5",
|
|
139
|
-
rx: "1.9",
|
|
140
|
-
ry: "3",
|
|
141
|
-
fill: FUR_DARK,
|
|
142
|
-
transform: "rotate(-25 11 21.5)"
|
|
143
|
-
}),
|
|
144
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
145
|
-
cx: "14.5",
|
|
146
|
-
cy: "20.5",
|
|
147
|
-
rx: "1.9",
|
|
148
|
-
ry: "3",
|
|
149
|
-
fill: FUR_DARK,
|
|
150
|
-
transform: "rotate(-10 14.5 20.5)"
|
|
151
|
-
}),
|
|
152
|
-
/* @__PURE__ */ jsx("g", {
|
|
153
|
-
className: "r-otter-indicator__arm",
|
|
154
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
155
|
-
d: status === "process" ? "M29 27q4 3.5 2.5 8" : "M29 26q3 0.5 4-2",
|
|
156
|
-
fill: "none",
|
|
157
|
-
stroke: FUR_DARK,
|
|
158
|
-
strokeWidth: "2.8",
|
|
159
|
-
strokeLinecap: "round"
|
|
160
|
-
})
|
|
161
|
-
}),
|
|
162
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
163
|
-
cx: "22",
|
|
164
|
-
cy: "28",
|
|
165
|
-
rx: "12",
|
|
166
|
-
ry: "6.5",
|
|
167
|
-
fill: FUR
|
|
168
|
-
}),
|
|
169
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
170
|
-
cx: "22",
|
|
171
|
-
cy: "25",
|
|
172
|
-
rx: "9",
|
|
173
|
-
ry: "3.6",
|
|
174
|
-
fill: "oklch(0.8 0.06 70)"
|
|
175
|
-
}),
|
|
176
|
-
status !== "error" && /* @__PURE__ */ jsx(Parcel, {
|
|
177
|
-
x: 16.5,
|
|
178
|
-
y: 16.5
|
|
179
|
-
}),
|
|
180
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
181
|
-
cx: "26.5",
|
|
182
|
-
cy: "21",
|
|
183
|
-
rx: "1.7",
|
|
184
|
-
ry: "2.4",
|
|
185
|
-
fill: FUR_DARK,
|
|
186
|
-
transform: "rotate(30 26.5 21)"
|
|
187
|
-
}),
|
|
188
|
-
status === "finish" && /* @__PURE__ */ jsx("ellipse", {
|
|
189
|
-
cx: "16",
|
|
190
|
-
cy: "21.5",
|
|
191
|
-
rx: "1.6",
|
|
192
|
-
ry: "2.2",
|
|
193
|
-
fill: FUR_DARK,
|
|
194
|
-
transform: "rotate(-30 16 21.5)"
|
|
195
|
-
}),
|
|
196
|
-
/* @__PURE__ */ jsx("circle", {
|
|
197
|
-
cx: "31.5",
|
|
198
|
-
cy: "17.3",
|
|
199
|
-
r: "1.8",
|
|
200
|
-
fill: FUR_DARK
|
|
201
|
-
}),
|
|
202
|
-
/* @__PURE__ */ jsx("circle", {
|
|
203
|
-
cx: "35",
|
|
204
|
-
cy: "23",
|
|
205
|
-
r: "7",
|
|
206
|
-
fill: FUR
|
|
207
|
-
}),
|
|
208
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
209
|
-
cx: "39",
|
|
210
|
-
cy: "25",
|
|
211
|
-
rx: "4.2",
|
|
212
|
-
ry: "3.2",
|
|
213
|
-
fill: "oklch(0.87 0.05 75)"
|
|
214
|
-
}),
|
|
215
|
-
/* @__PURE__ */ jsx(Face, { status }),
|
|
216
|
-
status === "error" && /* @__PURE__ */ jsx("path", {
|
|
217
|
-
d: "M37.4 22.3q-0.8 1.4 0 1.9q0.8-0.5 0-1.9Z",
|
|
218
|
-
fill: "oklch(0.8 0.08 230)"
|
|
219
|
-
})
|
|
220
|
-
]
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
7
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* - `error`: shivering in the water; the parcel has slipped away.
|
|
229
|
-
*
|
|
230
|
-
* It fills its box; give it 48px or more so the poses read.
|
|
8
|
+
* Ottie resting, quietly typing, tilting its head or celebrating.
|
|
9
|
+
* Wait/process loop only while visible. Error/finish play once on entry.
|
|
10
|
+
* Reduced motion shows a still pose. Give it an explicit square box, 40px or larger.
|
|
11
|
+
* Decorative by default; the consumer supplies the nearby status text.
|
|
231
12
|
*/
|
|
232
|
-
function OtterIndicator({ status, className, ...props }) {
|
|
233
|
-
const
|
|
234
|
-
const
|
|
235
|
-
|
|
13
|
+
function OtterIndicator({ status, className, ref, ...props }) {
|
|
14
|
+
const node = useRef(null);
|
|
15
|
+
const [mergedRef] = useMergedRef(node, ref);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (node.current) return observeOtterAnimation(node.current);
|
|
18
|
+
}, []);
|
|
236
19
|
return /* @__PURE__ */ jsxs("svg", {
|
|
237
20
|
"aria-hidden": "true",
|
|
238
|
-
viewBox: "0 0 48 48",
|
|
239
21
|
width: "100%",
|
|
240
22
|
height: "100%",
|
|
241
23
|
"data-slot": "otter-indicator",
|
|
242
24
|
...props,
|
|
25
|
+
ref: mergedRef,
|
|
243
26
|
className: cn("r-otter-indicator", `r-otter-indicator--${status}`, className),
|
|
244
|
-
children: [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
27
|
+
children: [/* @__PURE__ */ jsx("foreignObject", {
|
|
28
|
+
width: "100%",
|
|
29
|
+
height: "100%",
|
|
30
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "r-otter-indicator__viewport",
|
|
32
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: "r-otter-indicator__art",
|
|
34
|
+
children: status === "wait" ? /* @__PURE__ */ jsx("div", { className: "r-otter-indicator__rest" }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [status !== "finish" && /* @__PURE__ */ jsx("div", { className: "r-otter-indicator__base" }), /* @__PURE__ */ jsx("div", { className: "r-otter-indicator__frames" })] })
|
|
252
35
|
})
|
|
253
|
-
})
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
rx: "22",
|
|
270
|
-
ry: "5.5",
|
|
271
|
-
fill: "oklch(0.9 0.06 85)"
|
|
272
|
-
}),
|
|
273
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
274
|
-
cx: "7",
|
|
275
|
-
cy: "34.5",
|
|
276
|
-
rx: "1.6",
|
|
277
|
-
ry: "1",
|
|
278
|
-
fill: "oklch(0.78 0.06 75)"
|
|
279
|
-
}),
|
|
280
|
-
/* @__PURE__ */ jsx("ellipse", {
|
|
281
|
-
cx: "41",
|
|
282
|
-
cy: "35.5",
|
|
283
|
-
rx: "1.2",
|
|
284
|
-
ry: "0.8",
|
|
285
|
-
fill: "oklch(0.78 0.06 75)"
|
|
286
|
-
})
|
|
287
|
-
] }),
|
|
288
|
-
status === "process" && ["", " r-otter-indicator__ripple--late"].map((late) => /* @__PURE__ */ jsx("ellipse", {
|
|
289
|
-
className: `r-otter-indicator__ripple${late}`,
|
|
290
|
-
cx: "6",
|
|
291
|
-
cy: "30.5",
|
|
292
|
-
rx: "5",
|
|
293
|
-
ry: "1.4",
|
|
294
|
-
fill: "none",
|
|
295
|
-
stroke: WHITE,
|
|
296
|
-
strokeWidth: "0.8"
|
|
297
|
-
}, late)),
|
|
298
|
-
status === "error" && /* @__PURE__ */ jsx("g", {
|
|
299
|
-
className: "r-otter-indicator__parcel--adrift",
|
|
300
|
-
children: /* @__PURE__ */ jsx(Parcel, {
|
|
301
|
-
x: 1.5,
|
|
302
|
-
y: 22
|
|
303
|
-
})
|
|
304
|
-
}),
|
|
305
|
-
/* @__PURE__ */ jsx(OtterBody, { status }),
|
|
306
|
-
wet && /* @__PURE__ */ jsx("g", {
|
|
307
|
-
clipPath: pond,
|
|
308
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
309
|
-
className: "r-otter-indicator__wave",
|
|
310
|
-
d: WAVE_PATH,
|
|
311
|
-
fill: "oklch(0.78 0.11 220)",
|
|
312
|
-
fillOpacity: "0.9"
|
|
313
|
-
})
|
|
314
|
-
}),
|
|
315
|
-
status === "wait" && ["", " r-otter-indicator__z--late"].map((late, i) => /* @__PURE__ */ jsx("text", {
|
|
316
|
-
className: `r-otter-indicator__z${late}`,
|
|
317
|
-
x: i === 0 ? 38 : 43,
|
|
318
|
-
y: i === 0 ? 15 : 9,
|
|
319
|
-
fontSize: i === 0 ? 9 : 7,
|
|
320
|
-
fontWeight: "700",
|
|
321
|
-
fill: "var(--foreground-muted, currentColor)",
|
|
322
|
-
children: "z"
|
|
323
|
-
}, late))
|
|
324
|
-
]
|
|
325
|
-
}),
|
|
326
|
-
/* @__PURE__ */ jsx(Badge, { status })
|
|
327
|
-
]
|
|
36
|
+
})
|
|
37
|
+
}, `art-${status}`), status === "error" && /* @__PURE__ */ jsx("svg", {
|
|
38
|
+
viewBox: "0 0 48 48",
|
|
39
|
+
width: "100%",
|
|
40
|
+
height: "100%",
|
|
41
|
+
overflow: "visible",
|
|
42
|
+
children: /* @__PURE__ */ jsx("text", {
|
|
43
|
+
className: "r-otter-indicator__question",
|
|
44
|
+
x: "40.3",
|
|
45
|
+
y: "11.4",
|
|
46
|
+
fontSize: "11.4",
|
|
47
|
+
fontWeight: "800",
|
|
48
|
+
transform: "rotate(10 40.3 11.4)",
|
|
49
|
+
children: "?"
|
|
50
|
+
}, `question-${status}`)
|
|
51
|
+
})]
|
|
328
52
|
});
|
|
329
53
|
}
|
|
330
54
|
//#endregion
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|