@warmio/ui 1.4.0 → 1.5.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/LICENSES/fluid-functionalism.txt +24 -0
- package/README.md +9 -5
- package/dist/badge.js +1 -1
- package/dist/button.js +1 -1
- package/dist/chunks/{chunk-KN6WVLCR.js → chunk-2CO2BZLI.js} +20 -13
- package/dist/chunks/{chunk-ICC7GQXS.js → chunk-3AVFUXCV.js} +8 -6
- package/dist/chunks/{chunk-MIMC4M6W.js → chunk-6V6K5G72.js} +7 -13
- package/dist/chunks/{chunk-YTDMREDR.js → chunk-A2NLFM6R.js} +62 -36
- package/dist/chunks/chunk-B47G2BJV.js +534 -0
- package/dist/chunks/chunk-F74Y4WRX.js +239 -0
- package/dist/chunks/chunk-GY4XJ6EX.js +129 -0
- package/dist/chunks/chunk-HQTC542T.js +1079 -0
- package/dist/chunks/{chunk-PBWF6BDE.js → chunk-IK5RHPN3.js} +13 -8
- package/dist/chunks/chunk-JXSJTIX7.js +133 -0
- package/dist/chunks/{chunk-4RQCHKAW.js → chunk-OU7YQUU2.js} +12 -33
- package/dist/dropdown-menu.js +3 -1
- package/dist/index.js +11 -9
- package/dist/logo.js +1 -1
- package/dist/product-header.js +1 -1
- package/dist/product-header.types.d.ts +3 -2
- package/dist/sheet.js +3 -2
- package/dist/sidebar.js +4 -2
- package/dist/text.js +1 -1
- package/package.json +5 -3
- package/types/badge.d.ts +10 -2
- package/types/sidebar.d.ts +1 -0
- package/types/text.d.ts +2 -0
- package/dist/chunks/chunk-FW2EHGRK.js +0 -748
- package/dist/chunks/chunk-GKEYV2XW.js +0 -10
- package/dist/chunks/chunk-HDCV4ACN.js +0 -469
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-VIB7OX7D.js";
|
|
4
|
+
|
|
5
|
+
// ../ui/src/warmio/mascot.tsx
|
|
6
|
+
import { useEffect, useEffectEvent, useRef, useState } from "react";
|
|
7
|
+
|
|
8
|
+
// ../ui/src/warmio/mascot-pupils.ts
|
|
9
|
+
var MAX_LOOK = 1.35;
|
|
10
|
+
var MAX_WANDER = 0.55;
|
|
11
|
+
var FOLLOW = 0.045;
|
|
12
|
+
var pointer = { x: 0, y: 0 };
|
|
13
|
+
var pointerBound = false;
|
|
14
|
+
var pointerCount = 0;
|
|
15
|
+
function bindPointer() {
|
|
16
|
+
if (pointerBound) return;
|
|
17
|
+
pointerBound = true;
|
|
18
|
+
pointer = { x: window.innerWidth / 2, y: window.innerHeight / 2 };
|
|
19
|
+
window.addEventListener("pointermove", onPointerMove, { passive: true });
|
|
20
|
+
}
|
|
21
|
+
function unbindPointer() {
|
|
22
|
+
if (pointerCount > 0) return;
|
|
23
|
+
if (!pointerBound) return;
|
|
24
|
+
pointerBound = false;
|
|
25
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
26
|
+
}
|
|
27
|
+
function onPointerMove(event) {
|
|
28
|
+
pointer = { x: event.clientX, y: event.clientY };
|
|
29
|
+
}
|
|
30
|
+
function findSvgGroup(svg, id) {
|
|
31
|
+
for (const node of svg.getElementsByTagName("g")) {
|
|
32
|
+
if (node.id === id && node instanceof SVGGElement) return node;
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
function uniquifyClipIds(svg) {
|
|
37
|
+
const prefix = `m${Math.random().toString(36).slice(2, 8)}`;
|
|
38
|
+
for (const id of ["left_eye_clip", "right_eye_clip"]) {
|
|
39
|
+
let clip = null;
|
|
40
|
+
for (const node of svg.getElementsByTagName("clipPath")) {
|
|
41
|
+
if (node.id === id) {
|
|
42
|
+
clip = node;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!clip) continue;
|
|
47
|
+
const nextId = `${prefix}-${id}`;
|
|
48
|
+
clip.id = nextId;
|
|
49
|
+
for (const node of svg.querySelectorAll("[clip-path]")) {
|
|
50
|
+
if (node.getAttribute("clip-path") === `url(#${id})`) {
|
|
51
|
+
node.setAttribute("clip-path", `url(#${nextId})`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function lookTarget(svg) {
|
|
57
|
+
const box = svg.getBoundingClientRect();
|
|
58
|
+
if (box.width === 0 || box.height === 0) return { x: 0, y: 0 };
|
|
59
|
+
const cx = box.left + box.width / 2;
|
|
60
|
+
const cy = box.top + box.height * 0.62;
|
|
61
|
+
const nx = Math.max(-1, Math.min(1, (pointer.x - cx) / (box.width * 1.6)));
|
|
62
|
+
const ny = Math.max(-1, Math.min(1, (pointer.y - cy) / (box.height * 1.6)));
|
|
63
|
+
return { x: nx * MAX_LOOK, y: ny * MAX_LOOK * 0.85 };
|
|
64
|
+
}
|
|
65
|
+
function warmMascotSourceSupportsLivePupils(source) {
|
|
66
|
+
if (!source.endsWith(".svg")) return false;
|
|
67
|
+
const file = source.split("/").pop() ?? "";
|
|
68
|
+
return !file.toUpperCase().includes("CLOSED");
|
|
69
|
+
}
|
|
70
|
+
function startWarmMascotPupilDrift(host) {
|
|
71
|
+
const svg = host.querySelector("svg");
|
|
72
|
+
if (!(svg instanceof SVGSVGElement)) return () => {
|
|
73
|
+
};
|
|
74
|
+
const left = findSvgGroup(svg, "left_pupil");
|
|
75
|
+
const right = findSvgGroup(svg, "right_pupil");
|
|
76
|
+
if (!left || !right) {
|
|
77
|
+
return () => {
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
uniquifyClipIds(svg);
|
|
81
|
+
pointerCount += 1;
|
|
82
|
+
bindPointer();
|
|
83
|
+
const phase = Math.random() * Math.PI * 2;
|
|
84
|
+
let x = 0;
|
|
85
|
+
let y = 0;
|
|
86
|
+
let frame = 0;
|
|
87
|
+
const tick = (now) => {
|
|
88
|
+
const t = now / 1e3;
|
|
89
|
+
const wanderX = Math.sin(t * 0.32 + phase) * MAX_WANDER;
|
|
90
|
+
const wanderY = Math.cos(t * 0.24 + phase * 1.3) * MAX_WANDER * 0.7;
|
|
91
|
+
const look = lookTarget(svg);
|
|
92
|
+
const targetX = look.x + wanderX;
|
|
93
|
+
const targetY = look.y + wanderY;
|
|
94
|
+
x += (targetX - x) * FOLLOW;
|
|
95
|
+
y += (targetY - y) * FOLLOW;
|
|
96
|
+
const transform = `translate(${x.toFixed(3)} ${y.toFixed(3)})`;
|
|
97
|
+
left.setAttribute("transform", transform);
|
|
98
|
+
right.setAttribute("transform", transform);
|
|
99
|
+
frame = window.requestAnimationFrame(tick);
|
|
100
|
+
};
|
|
101
|
+
frame = window.requestAnimationFrame(tick);
|
|
102
|
+
return () => {
|
|
103
|
+
window.cancelAnimationFrame(frame);
|
|
104
|
+
pointerCount -= 1;
|
|
105
|
+
unbindPointer();
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ../ui/src/warmio/mascot-assets.ts
|
|
110
|
+
var WARM_MASCOT_IDS = ["NORMAL", "CLOSED", "SAD", "HYPE", "CONFUSED"];
|
|
111
|
+
var WARM_MASCOT_MOOD_TO_EXPRESSION = {
|
|
112
|
+
calm: "NORMAL",
|
|
113
|
+
happy: "HYPE",
|
|
114
|
+
focused: "NORMAL",
|
|
115
|
+
relieved: "NORMAL",
|
|
116
|
+
"password-retry": "NORMAL",
|
|
117
|
+
sad: "SAD"
|
|
118
|
+
};
|
|
119
|
+
function isWarmMascotMood(expression) {
|
|
120
|
+
return Object.hasOwn(WARM_MASCOT_MOOD_TO_EXPRESSION, expression);
|
|
121
|
+
}
|
|
122
|
+
function isWarmMascotId(expression) {
|
|
123
|
+
for (const id of WARM_MASCOT_IDS) {
|
|
124
|
+
if (id === expression) return true;
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
function getWarmMascotSrc(expression, _theme) {
|
|
129
|
+
return `/mascot/${expression}.svg`;
|
|
130
|
+
}
|
|
131
|
+
function getWarmMascotPeekSrc(eyes, _theme) {
|
|
132
|
+
if (eyes === "closed") {
|
|
133
|
+
return "/mascot/CLOSED.svg";
|
|
134
|
+
}
|
|
135
|
+
return "/mascot/NORMAL.svg";
|
|
136
|
+
}
|
|
137
|
+
function getWarmMascotStillSrc(expression, peekEyes) {
|
|
138
|
+
if (peekEyes === "closed") {
|
|
139
|
+
return "/mascot/CLOSED.svg";
|
|
140
|
+
}
|
|
141
|
+
if (peekEyes === "open") {
|
|
142
|
+
return "/mascot/NORMAL.svg";
|
|
143
|
+
}
|
|
144
|
+
return `/mascot/${expression}.svg`;
|
|
145
|
+
}
|
|
146
|
+
function getWarmMascotFallbackSrc(expression, peekEyes) {
|
|
147
|
+
if (peekEyes === "closed") {
|
|
148
|
+
return "/mascot/CLOSED.svg";
|
|
149
|
+
}
|
|
150
|
+
return `/mascot/${expression}.svg`;
|
|
151
|
+
}
|
|
152
|
+
function prefersReducedMascotMotion() {
|
|
153
|
+
return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
154
|
+
}
|
|
155
|
+
function resolveWarmMascotId(expression) {
|
|
156
|
+
if (!expression) return "NORMAL";
|
|
157
|
+
if (isWarmMascotMood(expression)) {
|
|
158
|
+
return WARM_MASCOT_MOOD_TO_EXPRESSION[expression];
|
|
159
|
+
}
|
|
160
|
+
if (isWarmMascotId(expression)) {
|
|
161
|
+
return expression;
|
|
162
|
+
}
|
|
163
|
+
return "NORMAL";
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ../ui/src/warmio/mascot.tsx
|
|
167
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
168
|
+
var HYPE_CTA_SELECTOR = "[data-auth-cta], [data-auth-guest], [data-waitlist-cta], [data-home-marketing-nav-login], [data-home-marketing-nav-signup]";
|
|
169
|
+
function isWarmMascotHypeCta(node) {
|
|
170
|
+
return node instanceof Element && node.closest(HYPE_CTA_SELECTOR) != null;
|
|
171
|
+
}
|
|
172
|
+
function useCtaHype(enabled) {
|
|
173
|
+
const [active, setActiveState] = useState(false);
|
|
174
|
+
const setActive = useEffectEvent((next) => {
|
|
175
|
+
if (next) {
|
|
176
|
+
setActiveState(true);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const focused = isWarmMascotHypeCta(document.activeElement);
|
|
180
|
+
const hovered = document.querySelector(":hover");
|
|
181
|
+
setActiveState(focused || isWarmMascotHypeCta(hovered));
|
|
182
|
+
});
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
if (!enabled) return;
|
|
185
|
+
const onEnter = (event) => {
|
|
186
|
+
if (isWarmMascotHypeCta(event.target)) setActive(true);
|
|
187
|
+
};
|
|
188
|
+
const onLeave = (event) => {
|
|
189
|
+
if (!isWarmMascotHypeCta(event.target)) return;
|
|
190
|
+
const next = "relatedTarget" in event ? event.relatedTarget : null;
|
|
191
|
+
if (isWarmMascotHypeCta(next)) return;
|
|
192
|
+
setActive(false);
|
|
193
|
+
};
|
|
194
|
+
document.addEventListener("pointerenter", onEnter, true);
|
|
195
|
+
document.addEventListener("pointerleave", onLeave, true);
|
|
196
|
+
document.addEventListener("focusin", onEnter);
|
|
197
|
+
document.addEventListener("focusout", onLeave);
|
|
198
|
+
return () => {
|
|
199
|
+
document.removeEventListener("pointerenter", onEnter, true);
|
|
200
|
+
document.removeEventListener("pointerleave", onLeave, true);
|
|
201
|
+
document.removeEventListener("focusin", onEnter);
|
|
202
|
+
document.removeEventListener("focusout", onLeave);
|
|
203
|
+
};
|
|
204
|
+
}, [enabled]);
|
|
205
|
+
return enabled && active;
|
|
206
|
+
}
|
|
207
|
+
function markMascotFallback(target) {
|
|
208
|
+
if (!(target instanceof HTMLElement)) return;
|
|
209
|
+
const root = target.closest('[data-slot="warm-mascot"]');
|
|
210
|
+
if (root instanceof HTMLElement) root.dataset["mascotFallback"] = "";
|
|
211
|
+
}
|
|
212
|
+
function WarmMascotMedia({
|
|
213
|
+
source,
|
|
214
|
+
stillSrc,
|
|
215
|
+
fallbackSrc
|
|
216
|
+
}) {
|
|
217
|
+
const liveHostRef = useRef(null);
|
|
218
|
+
const [liveMarkup, setLiveMarkup] = useState(null);
|
|
219
|
+
const useLivePupils = warmMascotSourceSupportsLivePupils(source);
|
|
220
|
+
useEffect(() => {
|
|
221
|
+
if (!useLivePupils) {
|
|
222
|
+
setLiveMarkup(null);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (prefersReducedMascotMotion()) return;
|
|
226
|
+
let cancelled = false;
|
|
227
|
+
fetch(source).then((response) => response.text()).then((markup) => {
|
|
228
|
+
if (!cancelled) setLiveMarkup(markup);
|
|
229
|
+
}).catch(() => {
|
|
230
|
+
if (!cancelled) setLiveMarkup(null);
|
|
231
|
+
});
|
|
232
|
+
return () => {
|
|
233
|
+
cancelled = true;
|
|
234
|
+
};
|
|
235
|
+
}, [source, useLivePupils]);
|
|
236
|
+
useEffect(() => {
|
|
237
|
+
const host = liveHostRef.current;
|
|
238
|
+
if (!host || liveMarkup == null) return;
|
|
239
|
+
return startWarmMascotPupilDrift(host);
|
|
240
|
+
}, [liveMarkup]);
|
|
241
|
+
if (liveMarkup) {
|
|
242
|
+
return /* @__PURE__ */ jsx(
|
|
243
|
+
"div",
|
|
244
|
+
{
|
|
245
|
+
ref: liveHostRef,
|
|
246
|
+
className: "warm-mascot__frame",
|
|
247
|
+
dangerouslySetInnerHTML: { __html: liveMarkup }
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
return /* @__PURE__ */ jsxs("picture", { children: [
|
|
252
|
+
/* @__PURE__ */ jsx("source", { srcSet: stillSrc, media: "(prefers-reduced-motion: reduce)" }),
|
|
253
|
+
/* @__PURE__ */ jsx(
|
|
254
|
+
"img",
|
|
255
|
+
{
|
|
256
|
+
className: "warm-mascot__frame",
|
|
257
|
+
src: source,
|
|
258
|
+
alt: "",
|
|
259
|
+
draggable: false,
|
|
260
|
+
"aria-hidden": "true",
|
|
261
|
+
onError: (event) => {
|
|
262
|
+
const img = event.currentTarget;
|
|
263
|
+
if (img.dataset["fallbackApplied"] != null) return;
|
|
264
|
+
img.dataset["fallbackApplied"] = "";
|
|
265
|
+
img.src = fallbackSrc;
|
|
266
|
+
markMascotFallback(img);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
] });
|
|
271
|
+
}
|
|
272
|
+
function toggleWarmMascotOnKeyDown(event, onToggleHype) {
|
|
273
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
onToggleHype();
|
|
276
|
+
}
|
|
277
|
+
function WarmMascotFrame({
|
|
278
|
+
size,
|
|
279
|
+
expression,
|
|
280
|
+
peekEyes,
|
|
281
|
+
theme,
|
|
282
|
+
source,
|
|
283
|
+
stillSrc,
|
|
284
|
+
fallbackSrc,
|
|
285
|
+
label,
|
|
286
|
+
clickHype,
|
|
287
|
+
clickedHype,
|
|
288
|
+
onToggleHype
|
|
289
|
+
}) {
|
|
290
|
+
const className = cn(
|
|
291
|
+
"warm-mascot",
|
|
292
|
+
clickHype ? "pointer-events-auto cursor-pointer" : "pointer-events-none",
|
|
293
|
+
"inline-flex shrink-0 select-none"
|
|
294
|
+
);
|
|
295
|
+
const commonProps = {
|
|
296
|
+
className,
|
|
297
|
+
"data-slot": "warm-mascot",
|
|
298
|
+
"data-size": size,
|
|
299
|
+
"data-expression": expression,
|
|
300
|
+
"data-flame-peek-eyes": peekEyes,
|
|
301
|
+
"data-flame-theme": theme,
|
|
302
|
+
"data-flame-vector": source.endsWith(".svg") ? "" : void 0
|
|
303
|
+
};
|
|
304
|
+
const media = /* @__PURE__ */ jsx(WarmMascotMedia, { source, stillSrc, fallbackSrc });
|
|
305
|
+
if (clickHype) {
|
|
306
|
+
return /* @__PURE__ */ jsx(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
...commonProps,
|
|
310
|
+
role: "button",
|
|
311
|
+
tabIndex: 0,
|
|
312
|
+
"aria-label": "Make the Warm mascot poggers",
|
|
313
|
+
"aria-pressed": clickedHype,
|
|
314
|
+
onClick: onToggleHype,
|
|
315
|
+
onKeyDown: (event) => toggleWarmMascotOnKeyDown(event, onToggleHype),
|
|
316
|
+
children: media
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
return /* @__PURE__ */ jsx(
|
|
321
|
+
"div",
|
|
322
|
+
{
|
|
323
|
+
...commonProps,
|
|
324
|
+
role: label ? "img" : void 0,
|
|
325
|
+
"aria-label": label ?? void 0,
|
|
326
|
+
"aria-hidden": label ? void 0 : true,
|
|
327
|
+
children: media
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
function WarmMascot({
|
|
332
|
+
expression: expressionProp = "NORMAL",
|
|
333
|
+
size = "default",
|
|
334
|
+
label = null,
|
|
335
|
+
theme: themeProp,
|
|
336
|
+
peekEyes,
|
|
337
|
+
ctaHype = true,
|
|
338
|
+
clickHype = false
|
|
339
|
+
}) {
|
|
340
|
+
const [clickedHype, setClickedHype] = useState(false);
|
|
341
|
+
const activePeekEyes = clickHype && clickedHype ? void 0 : peekEyes;
|
|
342
|
+
const baseExpression = resolveWarmMascotId(expressionProp);
|
|
343
|
+
const hype = useCtaHype(ctaHype && activePeekEyes == null) || clickHype && clickedHype;
|
|
344
|
+
const expression = hype ? "HYPE" : baseExpression;
|
|
345
|
+
const theme = themeProp ?? "light";
|
|
346
|
+
const source = activePeekEyes ? getWarmMascotPeekSrc(activePeekEyes, theme) : getWarmMascotSrc(expression, theme);
|
|
347
|
+
return /* @__PURE__ */ jsx(
|
|
348
|
+
WarmMascotFrame,
|
|
349
|
+
{
|
|
350
|
+
size,
|
|
351
|
+
expression,
|
|
352
|
+
peekEyes: activePeekEyes,
|
|
353
|
+
theme,
|
|
354
|
+
source,
|
|
355
|
+
stillSrc: getWarmMascotStillSrc(expression, activePeekEyes),
|
|
356
|
+
fallbackSrc: getWarmMascotFallbackSrc(expression, activePeekEyes),
|
|
357
|
+
label,
|
|
358
|
+
clickHype,
|
|
359
|
+
clickedHype,
|
|
360
|
+
onToggleHype: () => setClickedHype((current) => !current)
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// ../design/src/logo.tsx
|
|
366
|
+
import * as React from "react";
|
|
367
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
368
|
+
var WShape = /* @__PURE__ */ jsxs2("g", { fill: "currentColor", transform: "translate(0 108)", children: [
|
|
369
|
+
/* @__PURE__ */ jsx2("path", { d: "M 33.500 40.660 C 20.206 42.744, 0 48.560, -0 50.302 C -0 51.759, 123.955 348.889, 127.738 356.500 C 142.182 385.561, 169.450 410.275, 198.946 421.040 C 218.922 428.330, 243.683 430.825, 264.526 427.648 C 277.151 425.724, 294.628 420.011, 294.194 417.952 C 293.790 416.040, 172.732 124.599, 168.522 115.405 C 161.779 100.679, 149.168 84.171, 135.093 71.646 C 119.358 57.644, 98.880 47.362, 77 42.478 C 69.645 40.836, 40.220 39.606, 33.500 40.660" }),
|
|
370
|
+
/* @__PURE__ */ jsx2("path", { d: "M 229.651 41.597 C 217.916 43.718, 202.443 49.144, 202.744 51.035 C 203.418 55.268, 329.689 356.584, 333.687 363.500 C 340.525 375.327, 345.293 381.483, 355.408 391.538 C 374.603 410.619, 398.878 423.014, 425.907 427.533 C 439.649 429.831, 463.594 429.132, 476 426.072 C 489.892 422.645, 497.188 419.815, 496.703 418.043 C 495.416 413.331, 371.058 116.094, 367.406 109 C 349.467 74.149, 313.008 47.875, 273.752 41.509 C 262.281 39.648, 240.195 39.693, 229.651 41.597" }),
|
|
371
|
+
/* @__PURE__ */ jsx2("path", { d: "M 463 40.593 C 451.670 42.545, 447.288 43.569, 439 46.203 C 433.775 47.864, 429.338 49.372, 429.140 49.555 C 428.942 49.737, 434.670 64.021, 441.868 81.297 C 455.574 114.190, 462.215 131.660, 468.447 151.208 C 475.360 172.892, 486.124 186.213, 503.834 194.997 C 530.956 208.450, 564.982 201.679, 583.654 179.112 C 604.399 154.041, 605.407 121.944, 586.291 95.155 C 567.827 69.280, 539.107 50.114, 508 42.907 C 500.680 41.212, 494.713 40.644, 482 40.434 C 472.925 40.284, 464.375 40.356, 463 40.593" })
|
|
372
|
+
] });
|
|
373
|
+
function WarmLogoIcon({
|
|
374
|
+
size = "default",
|
|
375
|
+
tone = "default",
|
|
376
|
+
decorative = false,
|
|
377
|
+
className: _className,
|
|
378
|
+
style: _style,
|
|
379
|
+
asChild: _asChild,
|
|
380
|
+
render: _render,
|
|
381
|
+
...props
|
|
382
|
+
}) {
|
|
383
|
+
const label = decorative ? void 0 : "Warm logo";
|
|
384
|
+
return /* @__PURE__ */ jsx2(
|
|
385
|
+
"svg",
|
|
386
|
+
{
|
|
387
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
388
|
+
viewBox: "0 0 600 600",
|
|
389
|
+
"data-warm-logo": true,
|
|
390
|
+
"data-size": size,
|
|
391
|
+
"data-tone": tone,
|
|
392
|
+
width: size === "hero" ? 56 : size === "feature" ? 32 : size === "default" ? 28 : 12,
|
|
393
|
+
height: size === "hero" ? 56 : size === "feature" ? 32 : size === "default" ? 28 : 12,
|
|
394
|
+
"aria-hidden": decorative ? true : void 0,
|
|
395
|
+
"aria-label": label,
|
|
396
|
+
...props,
|
|
397
|
+
children: WShape
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
var Logo = React.forwardRef(function Logo2({
|
|
402
|
+
size = "default",
|
|
403
|
+
tone = "default",
|
|
404
|
+
showText = true,
|
|
405
|
+
className: _className,
|
|
406
|
+
style: _style,
|
|
407
|
+
textClass: _textClass,
|
|
408
|
+
asChild: _asChild,
|
|
409
|
+
render: _render,
|
|
410
|
+
...props
|
|
411
|
+
}, ref) {
|
|
412
|
+
return /* @__PURE__ */ jsxs2("div", { ref, "data-warm-logo": true, "data-size": size, "data-tone": tone, ...props, children: [
|
|
413
|
+
/* @__PURE__ */ jsx2(WarmLogoIcon, { size, tone, decorative: showText }),
|
|
414
|
+
showText ? /* @__PURE__ */ jsx2("span", { children: "Warm" }) : null
|
|
415
|
+
] });
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// ../ui/src/warmio/logo.tsx
|
|
419
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
420
|
+
var brandedLogoShellClassNameBySize = {
|
|
421
|
+
sm: "size-8",
|
|
422
|
+
md: "size-10",
|
|
423
|
+
lg: "size-14"
|
|
424
|
+
};
|
|
425
|
+
var brandedLogoIconClassNameBySize = {
|
|
426
|
+
sm: "size-5",
|
|
427
|
+
md: "size-6",
|
|
428
|
+
lg: "size-8"
|
|
429
|
+
};
|
|
430
|
+
var _WarmLogoGlyph = /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
431
|
+
/* @__PURE__ */ jsx3(
|
|
432
|
+
"path",
|
|
433
|
+
{
|
|
434
|
+
d: "M 33.500 40.660 C 20.206 42.744, 0 48.560, -0 50.302 C -0 51.759, 123.955 348.889, 127.738 356.500 C 142.182 385.561, 169.450 410.275, 198.946 421.040 C 218.922 428.330, 243.683 430.825, 264.526 427.648 C 277.151 425.724, 294.628 420.011, 294.194 417.952 C 293.790 416.040, 172.732 124.599, 168.522 115.405 C 161.779 100.679, 149.168 84.171, 135.093 71.646 C 119.358 57.644, 98.880 47.362, 77 42.478 C 69.645 40.836, 40.220 39.606, 33.500 40.660",
|
|
435
|
+
fill: "currentColor"
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
/* @__PURE__ */ jsx3(
|
|
439
|
+
"path",
|
|
440
|
+
{
|
|
441
|
+
d: "M 229.651 41.597 C 217.916 43.718, 202.443 49.144, 202.744 51.035 C 203.418 55.268, 329.689 356.584, 333.687 363.500 C 340.525 375.327, 345.293 381.483, 355.408 391.538 C 374.603 410.619, 398.878 423.014, 425.907 427.533 C 439.649 429.831, 463.594 429.132, 476 426.072 C 489.892 422.645, 497.188 419.815, 496.703 418.043 C 495.416 413.331, 371.058 116.094, 367.406 109 C 349.467 74.149, 313.008 47.875, 273.752 41.509 C 262.281 39.648, 240.195 39.693, 229.651 41.597",
|
|
442
|
+
fill: "currentColor"
|
|
443
|
+
}
|
|
444
|
+
),
|
|
445
|
+
/* @__PURE__ */ jsx3(
|
|
446
|
+
"path",
|
|
447
|
+
{
|
|
448
|
+
d: "M 463 40.593 C 451.670 42.545, 447.288 43.569, 439 46.203 C 433.775 47.864, 429.338 49.372, 429.140 49.555 C 428.942 49.737, 434.670 64.021, 441.868 81.297 C 455.574 114.190, 462.215 131.660, 468.447 151.208 C 475.360 172.892, 486.124 186.213, 503.834 194.997 C 530.956 208.450, 564.982 201.679, 583.654 179.112 C 604.399 154.041, 605.407 121.944, 586.291 95.155 C 567.827 69.280, 539.107 50.114, 508 42.907 C 500.680 41.212, 494.713 40.644, 482 40.434 C 472.925 40.284, 464.375 40.356, 463 40.593",
|
|
449
|
+
fill: "currentColor"
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
] });
|
|
453
|
+
function WarmBrandedLogoMark({
|
|
454
|
+
size = "md",
|
|
455
|
+
className,
|
|
456
|
+
logoClassName
|
|
457
|
+
}) {
|
|
458
|
+
return /* @__PURE__ */ jsxs3(
|
|
459
|
+
"span",
|
|
460
|
+
{
|
|
461
|
+
className: cn(
|
|
462
|
+
"relative inline-flex shrink-0 items-center justify-center",
|
|
463
|
+
brandedLogoShellClassNameBySize[size],
|
|
464
|
+
className
|
|
465
|
+
),
|
|
466
|
+
"aria-hidden": "true",
|
|
467
|
+
children: [
|
|
468
|
+
/* @__PURE__ */ jsx3("span", { className: "pointer-events-none absolute inset-0 scale-[1.35] opacity-90", children: /* @__PURE__ */ jsx3(WarmMascot, { expression: "calm", label: null }) }),
|
|
469
|
+
/* @__PURE__ */ jsx3(
|
|
470
|
+
"svg",
|
|
471
|
+
{
|
|
472
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
473
|
+
viewBox: "0 0 600 600",
|
|
474
|
+
className: cn(
|
|
475
|
+
"relative z-10 drop-shadow-sm",
|
|
476
|
+
brandedLogoIconClassNameBySize[size],
|
|
477
|
+
logoClassName
|
|
478
|
+
),
|
|
479
|
+
"aria-hidden": "true",
|
|
480
|
+
children: /* @__PURE__ */ jsx3("g", { transform: "translate(0 108)", children: _WarmLogoGlyph })
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
function WarmBrandedLogoLink({
|
|
488
|
+
href,
|
|
489
|
+
ariaLabel = "Warm home",
|
|
490
|
+
size = "md",
|
|
491
|
+
className,
|
|
492
|
+
logoClassName
|
|
493
|
+
}) {
|
|
494
|
+
return /* @__PURE__ */ jsx3("a", { href, "aria-label": ariaLabel, className: "inline-flex shrink-0 items-center", children: /* @__PURE__ */ jsx3(
|
|
495
|
+
WarmBrandedLogoMark,
|
|
496
|
+
{
|
|
497
|
+
size,
|
|
498
|
+
...className !== void 0 ? { className } : {},
|
|
499
|
+
...logoClassName !== void 0 ? { logoClassName } : {}
|
|
500
|
+
}
|
|
501
|
+
) });
|
|
502
|
+
}
|
|
503
|
+
function WarmBrandedLogoMarkStatic({
|
|
504
|
+
className,
|
|
505
|
+
logoClassName
|
|
506
|
+
}) {
|
|
507
|
+
return /* @__PURE__ */ jsxs3("span", { className: cn("relative inline-flex size-8 items-center justify-center", className), children: [
|
|
508
|
+
/* @__PURE__ */ jsx3(
|
|
509
|
+
"span",
|
|
510
|
+
{
|
|
511
|
+
"aria-hidden": "true",
|
|
512
|
+
className: "absolute inset-0 rounded-full bg-gradient-to-br from-primary/90 via-warning/80 to-primary/70"
|
|
513
|
+
}
|
|
514
|
+
),
|
|
515
|
+
/* @__PURE__ */ jsx3(
|
|
516
|
+
"svg",
|
|
517
|
+
{
|
|
518
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
519
|
+
viewBox: "0 0 600 600",
|
|
520
|
+
className: cn("relative z-10 size-5 drop-shadow-sm", logoClassName),
|
|
521
|
+
"aria-hidden": "true",
|
|
522
|
+
children: /* @__PURE__ */ jsx3("g", { transform: "translate(0 108)", children: _WarmLogoGlyph })
|
|
523
|
+
}
|
|
524
|
+
)
|
|
525
|
+
] });
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
export {
|
|
529
|
+
WarmLogoIcon,
|
|
530
|
+
Logo,
|
|
531
|
+
WarmBrandedLogoMark,
|
|
532
|
+
WarmBrandedLogoLink,
|
|
533
|
+
WarmBrandedLogoMarkStatic
|
|
534
|
+
};
|