@warmio/ui 1.1.0 → 1.2.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/README.md +6 -5
- package/dist/chunks/chunk-4UZNCKKG.js +81 -0
- package/dist/chunks/{chunk-PBTUB66J.js → chunk-UB25BRXT.js} +2 -7
- package/dist/index.js +11 -5
- package/dist/product-header.js +9 -0
- package/dist/product-header.types.d.ts +17 -0
- package/dist/sidebar.js +1 -1
- package/package.json +6 -1
- package/types/index.d.ts +1 -0
- package/types/product-header.d.ts +14 -0
package/README.md
CHANGED
|
@@ -19,10 +19,11 @@ deployment permission to publish packages.
|
|
|
19
19
|
@source '../node_modules/@warmio/ui/dist';
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
The `1.
|
|
23
|
-
DropdownMenu, Sheet,
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
The `1.2.0` public surface contains the Warm badge, logo, Button, Text and `StackedDisplay`,
|
|
23
|
+
DropdownMenu, Sheet, the complete responsive Sidebar family, and the `ProductHeader` composition.
|
|
24
|
+
`ProductHeader` owns the responsive frame, breadcrumb/title semantics, leading slot, action slot,
|
|
25
|
+
and optional portal targets used by Warm product shells. Styling is sealed: use documented semantic
|
|
26
|
+
properties and layout wrappers, never `className` or `style` overrides. DropdownMenu interaction
|
|
27
|
+
feedback requires the exact public peer `cuelume@0.1.0`.
|
|
27
28
|
|
|
28
29
|
The published artifact is standalone and never imports private `warm-app` workspace packages.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-VIB7OX7D.js";
|
|
4
|
+
|
|
5
|
+
// ../ui/src/warmio/product-header.tsx
|
|
6
|
+
import { Fragment, memo } from "react";
|
|
7
|
+
import { ChevronRight } from "lucide-react";
|
|
8
|
+
import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function getTitleSegments(pageTitle, productName) {
|
|
10
|
+
return pageTitle?.split(">").reduce((segments, rawSegment) => {
|
|
11
|
+
const segment = rawSegment.trim();
|
|
12
|
+
if (!segment || segments.length === 0 && segment === productName) return segments;
|
|
13
|
+
segments.push(segment);
|
|
14
|
+
return segments;
|
|
15
|
+
}, []);
|
|
16
|
+
}
|
|
17
|
+
function ProductHeaderBreadcrumb({
|
|
18
|
+
pageTitle,
|
|
19
|
+
productName = "Warm"
|
|
20
|
+
}) {
|
|
21
|
+
const titleSegments = getTitleSegments(pageTitle, productName);
|
|
22
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: productName }),
|
|
24
|
+
titleSegments?.map((segment, index) => {
|
|
25
|
+
const isLast = index === titleSegments.length - 1;
|
|
26
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "size-4 text-muted-foreground" }),
|
|
28
|
+
isLast ? /* @__PURE__ */ jsx("h1", { "aria-current": "page", children: segment }) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: segment })
|
|
29
|
+
] }, `${segment}-${index}`);
|
|
30
|
+
})
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
var ProductHeader = memo(function ProductHeader2({
|
|
34
|
+
actions,
|
|
35
|
+
actionsTargetRef,
|
|
36
|
+
desktopShell = false,
|
|
37
|
+
leading,
|
|
38
|
+
pageTitle,
|
|
39
|
+
productName,
|
|
40
|
+
titleTargetRef,
|
|
41
|
+
visibility = "desktop"
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"header",
|
|
45
|
+
{
|
|
46
|
+
className: cn(
|
|
47
|
+
"sticky top-0 z-20 h-[var(--header-height)] shrink-0 items-center border-b border-border bg-sidebar",
|
|
48
|
+
visibility === "always" ? "flex" : visibility === "container" ? "hidden @3xl/main:flex" : "hidden md:flex",
|
|
49
|
+
desktopShell && "select-none bg-sidebar/95 supports-[backdrop-filter]:bg-sidebar/85 supports-[backdrop-filter]:backdrop-blur"
|
|
50
|
+
),
|
|
51
|
+
"data-tauri-drag-region": desktopShell ? "deep" : void 0,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
ref: titleTargetRef,
|
|
57
|
+
className: "flex min-w-0 items-center gap-2 px-4 [&_h1]:text-sm [&_h1]:text-foreground [&:has(>[data-page-chrome-content])>[data-page-chrome-fallback]]:hidden",
|
|
58
|
+
children: [
|
|
59
|
+
leading,
|
|
60
|
+
/* @__PURE__ */ jsx("div", { "data-page-chrome-fallback": true, className: "contents", children: /* @__PURE__ */ jsx(ProductHeaderBreadcrumb, { pageTitle, productName }) })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
ref: actionsTargetRef,
|
|
68
|
+
className: "ml-auto flex items-center gap-2 px-4 [&:has(>[data-page-chrome-content])>[data-page-chrome-fallback]]:hidden",
|
|
69
|
+
children: actions ? /* @__PURE__ */ jsx("div", { "data-page-chrome-fallback": true, className: "contents", children: actions }) : null
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
ProductHeader.displayName = "ProductHeader";
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
ProductHeaderBreadcrumb,
|
|
80
|
+
ProductHeader
|
|
81
|
+
};
|
|
@@ -598,13 +598,8 @@ function SidebarFooter2({
|
|
|
598
598
|
style: _style,
|
|
599
599
|
...props
|
|
600
600
|
}) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
{
|
|
604
|
-
...props,
|
|
605
|
-
className: presentation === "product" ? "border-t border-border p-2" : void 0
|
|
606
|
-
}
|
|
607
|
-
);
|
|
601
|
+
const className = presentation === "product" ? "border-t border-border p-2" : presentation === "collapsedUtilities" ? "hidden border-t border-border p-2 group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:items-center" : void 0;
|
|
602
|
+
return /* @__PURE__ */ jsx4(SidebarFooter, { ...props, className });
|
|
608
603
|
}
|
|
609
604
|
function SidebarGroup2({
|
|
610
605
|
className: _className,
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StackedDisplay,
|
|
3
|
+
Text
|
|
4
|
+
} from "./chunks/chunk-D25QMXJR.js";
|
|
1
5
|
import {
|
|
2
6
|
Badge
|
|
3
7
|
} from "./chunks/chunk-ICC7GQXS.js";
|
|
@@ -22,6 +26,10 @@ import {
|
|
|
22
26
|
Logo,
|
|
23
27
|
WarmLogoIcon
|
|
24
28
|
} from "./chunks/chunk-VNQVIATP.js";
|
|
29
|
+
import {
|
|
30
|
+
ProductHeader,
|
|
31
|
+
ProductHeaderBreadcrumb
|
|
32
|
+
} from "./chunks/chunk-4UZNCKKG.js";
|
|
25
33
|
import {
|
|
26
34
|
SheetClose,
|
|
27
35
|
SheetContent,
|
|
@@ -48,15 +56,11 @@ import {
|
|
|
48
56
|
SidebarMenuItem,
|
|
49
57
|
SidebarProvider,
|
|
50
58
|
useSidebar
|
|
51
|
-
} from "./chunks/chunk-
|
|
59
|
+
} from "./chunks/chunk-UB25BRXT.js";
|
|
52
60
|
import {
|
|
53
61
|
Sheet
|
|
54
62
|
} from "./chunks/chunk-OWDC2VC6.js";
|
|
55
63
|
import "./chunks/chunk-T2TXMN3G.js";
|
|
56
|
-
import {
|
|
57
|
-
StackedDisplay,
|
|
58
|
-
Text
|
|
59
|
-
} from "./chunks/chunk-D25QMXJR.js";
|
|
60
64
|
import "./chunks/chunk-VIB7OX7D.js";
|
|
61
65
|
export {
|
|
62
66
|
Badge,
|
|
@@ -74,6 +78,8 @@ export {
|
|
|
74
78
|
DropdownMenuSeparator,
|
|
75
79
|
DropdownMenuTrigger,
|
|
76
80
|
Logo,
|
|
81
|
+
ProductHeader,
|
|
82
|
+
ProductHeaderBreadcrumb,
|
|
77
83
|
Sheet,
|
|
78
84
|
SheetClose,
|
|
79
85
|
SheetContent,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ProductHeaderVisibility = 'always' | 'container' | 'desktop';
|
|
4
|
+
|
|
5
|
+
export interface ProductHeaderBreadcrumbProps {
|
|
6
|
+
pageTitle?: string;
|
|
7
|
+
productName?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ProductHeaderProps extends ProductHeaderBreadcrumbProps {
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
actionsTargetRef?: Ref<HTMLDivElement>;
|
|
13
|
+
desktopShell?: boolean;
|
|
14
|
+
leading?: ReactNode;
|
|
15
|
+
titleTargetRef?: Ref<HTMLDivElement>;
|
|
16
|
+
visibility?: ProductHeaderVisibility;
|
|
17
|
+
}
|
package/dist/sidebar.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
SidebarMenuItem,
|
|
16
16
|
SidebarProvider,
|
|
17
17
|
useSidebar
|
|
18
|
-
} from "./chunks/chunk-
|
|
18
|
+
} from "./chunks/chunk-UB25BRXT.js";
|
|
19
19
|
import "./chunks/chunk-OWDC2VC6.js";
|
|
20
20
|
import "./chunks/chunk-T2TXMN3G.js";
|
|
21
21
|
import "./chunks/chunk-VIB7OX7D.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warmio/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Portable, sealed React components for Warm products.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
"import": "./dist/logo.js",
|
|
46
46
|
"default": "./dist/logo.js"
|
|
47
47
|
},
|
|
48
|
+
"./product-header": {
|
|
49
|
+
"types": "./types/product-header.d.ts",
|
|
50
|
+
"import": "./dist/product-header.js",
|
|
51
|
+
"default": "./dist/product-header.js"
|
|
52
|
+
},
|
|
48
53
|
"./sidebar": {
|
|
49
54
|
"types": "./types/sidebar.d.ts",
|
|
50
55
|
"import": "./dist/sidebar.js",
|
package/types/index.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
ProductHeaderBreadcrumbProps,
|
|
4
|
+
ProductHeaderProps,
|
|
5
|
+
} from '../dist/product-header.types.js';
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
ProductHeaderBreadcrumbProps,
|
|
9
|
+
ProductHeaderProps,
|
|
10
|
+
ProductHeaderVisibility,
|
|
11
|
+
} from '../dist/product-header.types.js';
|
|
12
|
+
|
|
13
|
+
export declare function ProductHeaderBreadcrumb(props: ProductHeaderBreadcrumbProps): ReactNode;
|
|
14
|
+
export declare const ProductHeader: (props: ProductHeaderProps) => ReactNode;
|