@warmio/ui 1.4.0 → 2.0.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/LICENSES/fluid-functionalism.txt +24 -0
- package/README.md +23 -14
- package/dist/badge.js +2 -2
- package/dist/button.js +4 -1
- package/dist/chunks/chunk-A2PN77YE.js +42 -0
- package/dist/chunks/chunk-DHV2A22F.js +240 -0
- package/dist/chunks/chunk-DOOSH3V6.js +72 -0
- package/dist/chunks/chunk-EIEA5RJJ.js +97 -0
- package/dist/chunks/chunk-FKGHMPVW.js +875 -0
- package/dist/chunks/chunk-K36HD5J5.js +133 -0
- package/dist/chunks/chunk-L6L3GVGM.js +130 -0
- package/dist/chunks/chunk-MGX6ZL6Q.js +224 -0
- package/dist/chunks/chunk-MVUHHKBL.js +492 -0
- package/dist/chunks/chunk-PJUNSOJK.js +116 -0
- package/dist/chunks/chunk-RVVHR7RY.js +0 -0
- package/dist/chunks/chunk-U7D32UN3.js +0 -0
- package/dist/chunks/chunk-W24JGQWM.js +65 -0
- package/dist/dropdown-menu.js +4 -3
- package/dist/entries/badge.css +178 -0
- package/dist/entries/button.css +422 -0
- package/dist/entries/dropdown-menu.css +167 -0
- package/dist/entries/index.css +2789 -0
- package/dist/entries/logo.css +147 -0
- package/dist/entries/product-header.css +88 -0
- package/dist/entries/sheet.css +666 -0
- package/dist/entries/sidebar.css +2108 -0
- package/dist/entries/text.css +97 -0
- package/dist/index.js +17 -13
- package/dist/logo.js +2 -2
- package/dist/product-header.js +2 -2
- package/dist/product-header.types.d.ts +3 -2
- package/dist/sheet.js +5 -3
- package/dist/sidebar.css +129 -0
- package/dist/sidebar.js +7 -3
- package/dist/text.css +121 -0
- package/dist/text.js +2 -2
- package/package.json +15 -5
- package/types/badge.d.ts +10 -2
- package/types/button.d.ts +65 -9
- package/types/sidebar.d.ts +10 -2
- package/types/text.d.ts +10 -2
- package/dist/chunks/chunk-4RQCHKAW.js +0 -105
- package/dist/chunks/chunk-FW2EHGRK.js +0 -748
- package/dist/chunks/chunk-GKEYV2XW.js +0 -10
- package/dist/chunks/chunk-HDCV4ACN.js +0 -469
- package/dist/chunks/chunk-ICC7GQXS.js +0 -74
- package/dist/chunks/chunk-KN6WVLCR.js +0 -261
- package/dist/chunks/chunk-MIMC4M6W.js +0 -86
- package/dist/chunks/chunk-PBWF6BDE.js +0 -88
- package/dist/chunks/chunk-VIB7OX7D.js +0 -10
- package/dist/chunks/chunk-YTDMREDR.js +0 -201
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Fluid Functionalism
|
|
2
|
+
https://github.com/mickadesign/fluid-functionalism
|
|
3
|
+
|
|
4
|
+
MIT License
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2026 Micka Touillaud
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
# `@warmio/ui`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`@warmio/design@
|
|
5
|
-
the
|
|
3
|
+
The next package version is `@warmio/ui@2.0.0` with the exact
|
|
4
|
+
`@warmio/design@2.0.0` CSS/primitive contract. Import `@warmio/design/globals.css` once.
|
|
5
|
+
If you use the responsive Sidebar, also import `@warmio/ui/sidebar.css` once.
|
|
6
|
+
Component entrypoints import their compiled CSS. Existing consumers can still import
|
|
7
|
+
`@warmio/ui/text.css` for the shared Text and StackedDisplay recipes; that explicit import
|
|
8
|
+
is optional when your bundler handles CSS imports from JavaScript.
|
|
9
|
+
`Text` allows `size="large"` on `variant="body"` for the approved 18px body size; heading
|
|
10
|
+
text may use the existing 24px display size. Other text roles use their recipe size.
|
|
11
|
+
Add the package's compiled files to Tailwind's source detection:
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
@import '@warmio/design/globals.css';
|
|
15
|
+
@import '@warmio/ui/sidebar.css';
|
|
16
|
+
@import '@warmio/ui/text.css';
|
|
17
|
+
@source '../node_modules/@warmio/ui/dist';
|
|
18
|
+
```
|
|
6
19
|
|
|
7
20
|
## Why these files are separate
|
|
8
21
|
|
|
@@ -10,22 +23,18 @@ Independently deployed Warm products cannot import runtime code from the private
|
|
|
10
23
|
workspace, so `libraries/public-ui/` must be a standalone public package rather than another private
|
|
11
24
|
workspace entry point. `tools/tasks/check-ui-package.mjs` is a dedicated package-boundary check
|
|
12
25
|
because the existing application checks do not build, pack, and inspect a public npm tarball.
|
|
13
|
-
`.github/workflows/publish-ui.yml` is separate from application deployment workflows so npm trusted
|
|
14
|
-
publishing can bind credentials to one reviewable package-release boundary without granting an app
|
|
15
|
-
deployment permission to publish packages.
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
@import '@warmio/design/globals.css';
|
|
19
|
-
@source '../node_modules/@warmio/ui/dist';
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The `1.4.0` public UI surface contains the Warm badge, Text and `StackedDisplay`, DropdownMenu,
|
|
27
|
+
The `2.0.0` public UI surface keeps the Warm badge, Text and `StackedDisplay`, DropdownMenu,
|
|
23
28
|
Sheet, the complete responsive Sidebar family, and the `ProductHeader` composition. `Button`,
|
|
24
|
-
`ButtonLink`, `Logo`, and `WarmLogoIcon` are directly owned by `@warmio/design@
|
|
29
|
+
`ButtonLink`, `Logo`, and `WarmLogoIcon` are directly owned by `@warmio/design@2.0.0` and are
|
|
25
30
|
re-exported through UI where applicable. `ProductHeader` owns the responsive frame,
|
|
26
31
|
breadcrumb/title semantics, leading slot, action slot, and optional portal targets used by Warm
|
|
27
32
|
product shells. Styling is sealed: use documented semantic properties and layout wrappers, never
|
|
28
33
|
`className` or `style` overrides. DropdownMenu interaction feedback requires the exact public peer
|
|
29
|
-
`cuelume@0.1.0`.
|
|
34
|
+
`cuelume@0.1.0`. Fluid-derived menu, sidebar, and sheet interactions require `motion@^12.42.2`.
|
|
35
|
+
|
|
36
|
+
The closed props and Warm styling remain unchanged. Motion respects live reduced-motion
|
|
37
|
+
preferences. Adapted Fluid source is covered by `LICENSES/fluid-functionalism.txt`.
|
|
38
|
+
These versions require publication before independently deployed consumers can install them.
|
|
30
39
|
|
|
31
40
|
The published artifact is standalone and never imports private `warm-app` workspace packages.
|
package/dist/badge.js
CHANGED
package/dist/button.js
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// ../ui/src/warmio/badge/badge.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function Badge({
|
|
4
|
+
tone,
|
|
5
|
+
size = "default",
|
|
6
|
+
textSize = "caption",
|
|
7
|
+
shape = "pill",
|
|
8
|
+
surface = "default",
|
|
9
|
+
placement = "inline",
|
|
10
|
+
emphasis = "subtle",
|
|
11
|
+
width = "auto",
|
|
12
|
+
truncate = false,
|
|
13
|
+
numeric = false,
|
|
14
|
+
children,
|
|
15
|
+
id,
|
|
16
|
+
"aria-label": ariaLabel
|
|
17
|
+
}) {
|
|
18
|
+
const resolvedTone = tone ?? "default";
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"span",
|
|
21
|
+
{
|
|
22
|
+
"data-slot": "badge",
|
|
23
|
+
"data-tone": resolvedTone,
|
|
24
|
+
"data-shape": shape,
|
|
25
|
+
"data-surface": surface,
|
|
26
|
+
"data-placement": placement,
|
|
27
|
+
"data-size": size,
|
|
28
|
+
"data-text-size": textSize,
|
|
29
|
+
"data-emphasis": emphasis,
|
|
30
|
+
"data-width": width,
|
|
31
|
+
"data-truncate": truncate ? "true" : void 0,
|
|
32
|
+
"data-numeric": numeric ? "true" : void 0,
|
|
33
|
+
id,
|
|
34
|
+
"aria-label": ariaLabel,
|
|
35
|
+
children: truncate ? /* @__PURE__ */ jsx("span", { "data-slot": "badge-label", children }) : children
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
Badge
|
|
42
|
+
};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FLUID_SPRING,
|
|
3
|
+
useReducedMotion
|
|
4
|
+
} from "./chunk-K36HD5J5.js";
|
|
5
|
+
|
|
6
|
+
// ../ui/src/lib/fluid-menu-highlight.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { motion } from "motion/react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var itemSelectors = {
|
|
11
|
+
menu: '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]',
|
|
12
|
+
select: '[role="option"]',
|
|
13
|
+
sidebar: '[data-sidebar="menu-button"], [data-sidebar="menu-sub-button"]'
|
|
14
|
+
};
|
|
15
|
+
var SIDEBAR_HOVER_DEBOUNCE_MS = 0;
|
|
16
|
+
function sameHighlights(previous, next) {
|
|
17
|
+
return previous.length === next.length && previous.every((item, index) => {
|
|
18
|
+
const other = next[index];
|
|
19
|
+
return other && item.key === other.key && item.element === other.element && item.left === other.left && item.top === other.top && item.width === other.width && item.height === other.height && item.selected === other.selected && item.destructive === other.destructive;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function ancestorScale(visualSize, layoutSize) {
|
|
23
|
+
return visualSize > 0 && layoutSize > 0 ? visualSize / layoutSize : 1;
|
|
24
|
+
}
|
|
25
|
+
function MenuHighlight({ target, kind }) {
|
|
26
|
+
const reduceMotion = useReducedMotion();
|
|
27
|
+
const previousElement = React.useRef(target.element);
|
|
28
|
+
const movedToItem = previousElement.current !== target.element;
|
|
29
|
+
React.useLayoutEffect(() => {
|
|
30
|
+
previousElement.current = target.element;
|
|
31
|
+
}, [target.element]);
|
|
32
|
+
const Element2 = kind === "sidebar" ? motion.li : motion.div;
|
|
33
|
+
const geometry = { x: target.left, y: target.top, width: target.width, height: target.height };
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
Element2,
|
|
36
|
+
{
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
role: "presentation",
|
|
39
|
+
"data-slot": "fluid-menu-highlight",
|
|
40
|
+
"data-kind": kind,
|
|
41
|
+
"data-selected": target.selected ? "true" : void 0,
|
|
42
|
+
"data-destructive": target.destructive ? "true" : void 0,
|
|
43
|
+
initial: false,
|
|
44
|
+
style: reduceMotion ? {
|
|
45
|
+
left: target.left,
|
|
46
|
+
top: target.top,
|
|
47
|
+
width: target.width,
|
|
48
|
+
height: target.height
|
|
49
|
+
} : {},
|
|
50
|
+
animate: reduceMotion ? { opacity: target.selected ? 1 : kind === "sidebar" ? 0.5 : 1 } : {
|
|
51
|
+
...geometry,
|
|
52
|
+
opacity: target.selected ? 1 : kind === "sidebar" ? 0.5 : 1
|
|
53
|
+
},
|
|
54
|
+
transition: reduceMotion || !movedToItem ? { duration: 0 } : kind === "sidebar" ? FLUID_SPRING.moderate : FLUID_SPRING.fast
|
|
55
|
+
},
|
|
56
|
+
reduceMotion ? "still" : "moving"
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function FluidMenuHighlights({ kind }) {
|
|
60
|
+
const anchorRef = React.useRef(null);
|
|
61
|
+
const [highlights, setHighlights] = React.useState([]);
|
|
62
|
+
const Anchor = kind === "sidebar" ? "li" : "span";
|
|
63
|
+
React.useLayoutEffect(() => {
|
|
64
|
+
const container = anchorRef.current?.parentElement;
|
|
65
|
+
if (!container) return;
|
|
66
|
+
const selector = itemSelectors[kind];
|
|
67
|
+
let items = [];
|
|
68
|
+
let hovered = null;
|
|
69
|
+
let focused = null;
|
|
70
|
+
let hoverTimer;
|
|
71
|
+
let frame;
|
|
72
|
+
let nextId = 0;
|
|
73
|
+
const ids = /* @__PURE__ */ new WeakMap();
|
|
74
|
+
const idFor = (element) => {
|
|
75
|
+
let id = ids.get(element);
|
|
76
|
+
if (id === void 0) {
|
|
77
|
+
id = nextId++;
|
|
78
|
+
ids.set(element, id);
|
|
79
|
+
}
|
|
80
|
+
return id;
|
|
81
|
+
};
|
|
82
|
+
const enabled = (item) => !item.matches(
|
|
83
|
+
':disabled, [disabled], [aria-disabled="true"], [data-disabled], [data-fluid-menu-disabled]'
|
|
84
|
+
) && item.getClientRects().length > 0 && item.offsetWidth > 0 && item.offsetHeight > 0;
|
|
85
|
+
const measure = () => {
|
|
86
|
+
frame = void 0;
|
|
87
|
+
const visibleItems = items.filter(enabled);
|
|
88
|
+
const selected = visibleItems.filter(
|
|
89
|
+
(item) => item.matches(
|
|
90
|
+
'[aria-selected="true"], [aria-checked="true"], [data-active], [data-popup-open], [data-open]'
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
const active = kind === "sidebar" ? hovered && visibleItems.includes(hovered) ? hovered : focused && visibleItems.includes(focused) ? focused : null : visibleItems.find((item) => item.hasAttribute("data-highlighted"));
|
|
94
|
+
const targets = [];
|
|
95
|
+
const add = (element, key, isSelected) => {
|
|
96
|
+
const containerRect = container.getBoundingClientRect();
|
|
97
|
+
const elementRect = element.getBoundingClientRect();
|
|
98
|
+
const scaleX = ancestorScale(containerRect.width, container.offsetWidth);
|
|
99
|
+
const scaleY = ancestorScale(containerRect.height, container.offsetHeight);
|
|
100
|
+
targets.push({
|
|
101
|
+
key,
|
|
102
|
+
element,
|
|
103
|
+
left: (elementRect.left - containerRect.left) / scaleX + container.scrollLeft,
|
|
104
|
+
top: (elementRect.top - containerRect.top) / scaleY + container.scrollTop,
|
|
105
|
+
width: elementRect.width / scaleX,
|
|
106
|
+
height: elementRect.height / scaleY,
|
|
107
|
+
selected: isSelected,
|
|
108
|
+
destructive: element.dataset["variant"] === "destructive"
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
if (kind === "sidebar") {
|
|
112
|
+
const selectedItem = selected[0];
|
|
113
|
+
const hoverItem = active ?? selectedItem;
|
|
114
|
+
if (hoverItem && hoverItem !== selectedItem) add(hoverItem, "hover", false);
|
|
115
|
+
if (selectedItem) add(selectedItem, "sidebar", true);
|
|
116
|
+
} else {
|
|
117
|
+
const occurrences = /* @__PURE__ */ new Map();
|
|
118
|
+
selected.forEach((item) => {
|
|
119
|
+
const group = item.closest('[role="group"], [data-sidebar="menu-sub"]') ?? container;
|
|
120
|
+
const occurrence = occurrences.get(group) ?? 0;
|
|
121
|
+
occurrences.set(group, occurrence + 1);
|
|
122
|
+
const key = item.getAttribute("role") === "menuitemcheckbox" || kind === "select" && selected.length > 1 ? `selection-item-${idFor(item)}` : `selection-${idFor(group)}-${occurrence}`;
|
|
123
|
+
add(item, key, true);
|
|
124
|
+
});
|
|
125
|
+
if (active) add(active, "hover", false);
|
|
126
|
+
}
|
|
127
|
+
setHighlights((previous) => sameHighlights(previous, targets) ? previous : targets);
|
|
128
|
+
};
|
|
129
|
+
const schedule = () => {
|
|
130
|
+
if (frame === void 0) frame = requestAnimationFrame(measure);
|
|
131
|
+
};
|
|
132
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(schedule);
|
|
133
|
+
const register = () => {
|
|
134
|
+
resizeObserver?.disconnect();
|
|
135
|
+
items.forEach((item) => item.removeAttribute("data-fluid-menu-item"));
|
|
136
|
+
items = Array.from(container.querySelectorAll(selector)).filter(
|
|
137
|
+
(item) => item.closest("[data-fluid-menu]") === container
|
|
138
|
+
);
|
|
139
|
+
items.forEach((item) => {
|
|
140
|
+
item.setAttribute("data-fluid-menu-item", "");
|
|
141
|
+
resizeObserver?.observe(item);
|
|
142
|
+
});
|
|
143
|
+
resizeObserver?.observe(container);
|
|
144
|
+
};
|
|
145
|
+
const observer = new MutationObserver((records) => {
|
|
146
|
+
if (records.some(
|
|
147
|
+
(record) => record.type === "childList" && [...record.addedNodes, ...record.removedNodes].some(
|
|
148
|
+
(node) => node instanceof Element && !node.matches('[data-slot="fluid-menu-highlight"]')
|
|
149
|
+
)
|
|
150
|
+
))
|
|
151
|
+
register();
|
|
152
|
+
schedule();
|
|
153
|
+
});
|
|
154
|
+
register();
|
|
155
|
+
observer.observe(container, {
|
|
156
|
+
subtree: true,
|
|
157
|
+
childList: true,
|
|
158
|
+
attributes: true,
|
|
159
|
+
attributeFilter: [
|
|
160
|
+
"data-highlighted",
|
|
161
|
+
"aria-selected",
|
|
162
|
+
"aria-checked",
|
|
163
|
+
"data-active",
|
|
164
|
+
"data-popup-open",
|
|
165
|
+
"data-open",
|
|
166
|
+
"disabled",
|
|
167
|
+
"aria-disabled",
|
|
168
|
+
"data-disabled",
|
|
169
|
+
"data-fluid-menu-disabled",
|
|
170
|
+
"hidden",
|
|
171
|
+
"data-state"
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
const pointerMove = (event) => {
|
|
175
|
+
if (event.pointerType === "touch") return;
|
|
176
|
+
const nextHovered = event.target instanceof Element ? event.target.closest(selector) : null;
|
|
177
|
+
clearTimeout(hoverTimer);
|
|
178
|
+
hoverTimer = window.setTimeout(() => {
|
|
179
|
+
hovered = nextHovered;
|
|
180
|
+
hoverTimer = void 0;
|
|
181
|
+
schedule();
|
|
182
|
+
}, SIDEBAR_HOVER_DEBOUNCE_MS);
|
|
183
|
+
};
|
|
184
|
+
const pointerLeave = () => {
|
|
185
|
+
clearTimeout(hoverTimer);
|
|
186
|
+
hoverTimer = void 0;
|
|
187
|
+
hovered = null;
|
|
188
|
+
schedule();
|
|
189
|
+
};
|
|
190
|
+
const focusIn = (event) => {
|
|
191
|
+
clearTimeout(hoverTimer);
|
|
192
|
+
hoverTimer = void 0;
|
|
193
|
+
const item = event.target instanceof Element ? event.target.closest(selector) : null;
|
|
194
|
+
focused = item?.matches(":focus-visible") ? item : null;
|
|
195
|
+
if (focused) hovered = null;
|
|
196
|
+
schedule();
|
|
197
|
+
};
|
|
198
|
+
const focusOut = () => {
|
|
199
|
+
focused = null;
|
|
200
|
+
schedule();
|
|
201
|
+
};
|
|
202
|
+
if (kind === "sidebar") {
|
|
203
|
+
container.addEventListener("pointermove", pointerMove);
|
|
204
|
+
container.addEventListener("pointerleave", pointerLeave);
|
|
205
|
+
container.addEventListener("focusin", focusIn);
|
|
206
|
+
container.addEventListener("focusout", focusOut);
|
|
207
|
+
}
|
|
208
|
+
container.addEventListener("scroll", schedule, true);
|
|
209
|
+
measure();
|
|
210
|
+
return () => {
|
|
211
|
+
observer.disconnect();
|
|
212
|
+
resizeObserver?.disconnect();
|
|
213
|
+
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
214
|
+
clearTimeout(hoverTimer);
|
|
215
|
+
items.forEach((item) => item.removeAttribute("data-fluid-menu-item"));
|
|
216
|
+
container.removeEventListener("pointermove", pointerMove);
|
|
217
|
+
container.removeEventListener("pointerleave", pointerLeave);
|
|
218
|
+
container.removeEventListener("focusin", focusIn);
|
|
219
|
+
container.removeEventListener("focusout", focusOut);
|
|
220
|
+
container.removeEventListener("scroll", schedule, true);
|
|
221
|
+
};
|
|
222
|
+
}, [kind]);
|
|
223
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
224
|
+
/* @__PURE__ */ jsx(
|
|
225
|
+
Anchor,
|
|
226
|
+
{
|
|
227
|
+
ref: (node) => {
|
|
228
|
+
anchorRef.current = node;
|
|
229
|
+
},
|
|
230
|
+
hidden: true,
|
|
231
|
+
"aria-hidden": "true"
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
highlights.map((target) => /* @__PURE__ */ jsx(MenuHighlight, { target, kind }, target.key))
|
|
235
|
+
] });
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export {
|
|
239
|
+
FluidMenuHighlights
|
|
240
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// ../ui/src/warmio/product-header/product-header.tsx
|
|
2
|
+
import { Fragment, memo } from "react";
|
|
3
|
+
import { ChevronRight } from "lucide-react";
|
|
4
|
+
import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
function getTitleSegments(pageTitle, productName) {
|
|
6
|
+
return pageTitle?.split(">").reduce((segments, rawSegment) => {
|
|
7
|
+
const segment = rawSegment.trim();
|
|
8
|
+
if (!segment || segments.length === 0 && segment === productName) return segments;
|
|
9
|
+
segments.push(segment);
|
|
10
|
+
return segments;
|
|
11
|
+
}, []);
|
|
12
|
+
}
|
|
13
|
+
function ProductHeaderBreadcrumb({
|
|
14
|
+
pageTitle,
|
|
15
|
+
productName = "Warm",
|
|
16
|
+
homeHref
|
|
17
|
+
}) {
|
|
18
|
+
const titleSegments = getTitleSegments(pageTitle, productName);
|
|
19
|
+
const productNameNode = homeHref ? /* @__PURE__ */ jsx("a", { "data-slot": "product-header-title", href: homeHref, children: productName }) : /* @__PURE__ */ jsx("span", { "data-slot": "product-header-title", children: productName });
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
21
|
+
productNameNode,
|
|
22
|
+
titleSegments?.map((segment, index) => {
|
|
23
|
+
const isLast = index === titleSegments.length - 1;
|
|
24
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(ChevronRight, { "data-slot": "product-header-separator" }),
|
|
26
|
+
isLast ? /* @__PURE__ */ jsx("h1", { "data-slot": "product-header-title", "aria-current": "page", children: segment }) : /* @__PURE__ */ jsx("span", { "data-slot": "product-header-title", children: segment })
|
|
27
|
+
] }, `${segment}-${index}`);
|
|
28
|
+
})
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
var ProductHeader = memo(function ProductHeader2({
|
|
32
|
+
actions,
|
|
33
|
+
actionsTargetRef,
|
|
34
|
+
desktopShell = false,
|
|
35
|
+
hideBreadcrumb = false,
|
|
36
|
+
homeHref,
|
|
37
|
+
leading,
|
|
38
|
+
pageTitle,
|
|
39
|
+
productName,
|
|
40
|
+
titleTargetRef,
|
|
41
|
+
visibility = "desktop"
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"header",
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "product-header",
|
|
47
|
+
"data-visibility": visibility,
|
|
48
|
+
"data-desktop-shell": desktopShell ? "" : void 0,
|
|
49
|
+
"data-tauri-drag-region": desktopShell ? "deep" : void 0,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { ref: titleTargetRef, "data-slot": "product-header-titles", children: [
|
|
52
|
+
leading,
|
|
53
|
+
hideBreadcrumb ? null : /* @__PURE__ */ jsx("div", { "data-page-chrome-fallback": true, "data-slot": "product-header-fallback", children: /* @__PURE__ */ jsx(
|
|
54
|
+
ProductHeaderBreadcrumb,
|
|
55
|
+
{
|
|
56
|
+
...pageTitle !== void 0 ? { pageTitle } : {},
|
|
57
|
+
...productName !== void 0 ? { productName } : {},
|
|
58
|
+
...homeHref !== void 0 ? { homeHref } : {}
|
|
59
|
+
}
|
|
60
|
+
) })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ jsx("div", { ref: actionsTargetRef, "data-slot": "product-header-actions", children: actions ? /* @__PURE__ */ jsx("div", { "data-page-chrome-fallback": true, "data-slot": "product-header-fallback", children: actions }) : null })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
ProductHeader.displayName = "ProductHeader";
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
ProductHeaderBreadcrumb,
|
|
71
|
+
ProductHeader
|
|
72
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FluidOverlay
|
|
3
|
+
} from "./chunk-K36HD5J5.js";
|
|
4
|
+
|
|
5
|
+
// ../ui/src/components/sheet.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var SheetCloseSlotContext = React.createContext(null);
|
|
10
|
+
function Sheet(props) {
|
|
11
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Root, { ...props });
|
|
12
|
+
}
|
|
13
|
+
function SheetTrigger({ asChild = false, children, render, ...props }) {
|
|
14
|
+
const resolvedRender = render ?? (asChild && React.isValidElement(children) ? children : void 0);
|
|
15
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", render: resolvedRender, ...props, children: resolvedRender ? void 0 : children });
|
|
16
|
+
}
|
|
17
|
+
function SheetClose({ asChild = false, children, render, ...props }) {
|
|
18
|
+
const resolvedRender = render ?? (asChild && React.isValidElement(children) ? children : void 0);
|
|
19
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", render: resolvedRender, ...props, children: resolvedRender ? void 0 : children });
|
|
20
|
+
}
|
|
21
|
+
function SheetPortal({ ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
23
|
+
}
|
|
24
|
+
function SheetOverlay({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
SheetPrimitive.Backdrop,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "sheet-overlay",
|
|
29
|
+
className,
|
|
30
|
+
...props,
|
|
31
|
+
render: (props2, state) => /* @__PURE__ */ jsx(FluidOverlay, { props: props2, state, motion: "backdrop", tier: "moderate" })
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function SheetContent({
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
side = "responsive",
|
|
39
|
+
showCloseButton = true,
|
|
40
|
+
closeButton,
|
|
41
|
+
overlayClassName,
|
|
42
|
+
render,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const closeSlot = showCloseButton && closeButton ? /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", render: closeButton }) : null;
|
|
46
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(SheetOverlay, { className: overlayClassName }),
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
SheetPrimitive.Popup,
|
|
50
|
+
{
|
|
51
|
+
"data-slot": "sheet-content",
|
|
52
|
+
"data-side": side,
|
|
53
|
+
className,
|
|
54
|
+
...props,
|
|
55
|
+
render: (props2, state) => /* @__PURE__ */ jsx(
|
|
56
|
+
FluidOverlay,
|
|
57
|
+
{
|
|
58
|
+
props: props2,
|
|
59
|
+
state,
|
|
60
|
+
render,
|
|
61
|
+
motion: "sheet",
|
|
62
|
+
side,
|
|
63
|
+
tier: "moderate"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
children: /* @__PURE__ */ jsx(SheetCloseSlotContext.Provider, { value: closeSlot, children })
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
function SheetHeader({ className, children, ...props }) {
|
|
72
|
+
const closeButton = React.useContext(SheetCloseSlotContext);
|
|
73
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "sheet-header", className, ...props, children: [
|
|
74
|
+
children,
|
|
75
|
+
closeButton
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
function SheetFooter({ className, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "sheet-footer", className, ...props });
|
|
80
|
+
}
|
|
81
|
+
function SheetTitle({ className, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className, ...props });
|
|
83
|
+
}
|
|
84
|
+
function SheetDescription({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className, ...props });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
Sheet,
|
|
90
|
+
SheetTrigger,
|
|
91
|
+
SheetClose,
|
|
92
|
+
SheetContent,
|
|
93
|
+
SheetHeader,
|
|
94
|
+
SheetFooter,
|
|
95
|
+
SheetTitle,
|
|
96
|
+
SheetDescription
|
|
97
|
+
};
|