@momoi-labs/kiso-react 0.27.0 → 0.28.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/dist/accent-selector.d.ts +1 -1
- package/dist/accent-selector.js +1 -0
- package/dist/app-shell.d.ts +1 -0
- package/dist/app-shell.js +4 -4
- package/dist/header.d.ts +3 -2
- package/dist/header.js +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const accents: readonly ["violet", "terracotta", "teal", "cobalt", "nocturne", "tangerine", "red", "gold", "lime", "plum", "stone", "steel"];
|
|
1
|
+
export declare const accents: readonly ["violet", "terracotta", "teal", "cobalt", "nocturne", "tangerine", "red", "gold", "lime", "plum", "stone", "steel", "snes"];
|
|
2
2
|
export type Accent = (typeof accents)[number];
|
|
3
3
|
export declare function AccentSelector({ accent, onChange, options, preview, }: {
|
|
4
4
|
accent: string;
|
package/dist/accent-selector.js
CHANGED
package/dist/app-shell.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ type ApplicationShellSharedProps = Omit<React.ComponentProps<typeof AppShell>, "
|
|
|
29
29
|
primaryAction?: React.ReactNode;
|
|
30
30
|
header?: React.ReactNode;
|
|
31
31
|
headerVariant?: React.ComponentProps<typeof Header>["variant"];
|
|
32
|
+
headerSize?: React.ComponentProps<typeof Header>["size"];
|
|
32
33
|
panel?: React.ReactNode;
|
|
33
34
|
children: React.ReactNode;
|
|
34
35
|
};
|
package/dist/app-shell.js
CHANGED
|
@@ -37,12 +37,12 @@ function ApplicationShellNavigation({ navigation, navigationLabel, collapsible =
|
|
|
37
37
|
}
|
|
38
38
|
function ApplicationShell(props) {
|
|
39
39
|
if (props.layout === "topbar") {
|
|
40
|
-
const { brand, primaryAction, header, headerVariant, panel, bottomNav, children, layout: _layout, ...shellProps } = props;
|
|
41
|
-
return (_jsxs(AppShell, { ...shellProps, "data-layout": "topbar", children: [_jsxs(AppShellMain, { children: [_jsxs(Header, { variant: headerVariant, children: [brand, primaryAction, header] }), children] }), panel, bottomNav] }));
|
|
40
|
+
const { brand, primaryAction, header, headerVariant, headerSize, panel, bottomNav, children, layout: _layout, ...shellProps } = props;
|
|
41
|
+
return (_jsxs(AppShell, { ...shellProps, "data-layout": "topbar", children: [_jsxs(AppShellMain, { children: [_jsxs(Header, { variant: headerVariant, size: headerSize, children: [brand, primaryAction, header] }), children] }), panel, bottomNav] }));
|
|
42
42
|
}
|
|
43
43
|
return _jsx(ApplicationShellSidebar, { ...props });
|
|
44
44
|
}
|
|
45
|
-
function ApplicationShellSidebar({ brand, primaryAction, navigation, navigationLabel = "Primary", footer, header, headerVariant, panel, children, layout: _layout, collapsible = false, togglePlacement = "sidebar", collapsed, defaultCollapsed = false, onCollapsedChange, drawerOpen: controlledDrawer, onDrawerOpenChange, phoneNavigation = "drawer", ...shellProps }) {
|
|
45
|
+
function ApplicationShellSidebar({ brand, primaryAction, navigation, navigationLabel = "Primary", footer, header, headerVariant, headerSize, panel, children, layout: _layout, collapsible = false, togglePlacement = "sidebar", collapsed, defaultCollapsed = false, onCollapsedChange, drawerOpen: controlledDrawer, onDrawerOpenChange, phoneNavigation = "drawer", ...shellProps }) {
|
|
46
46
|
const [internalCollapsed, setInternalCollapsed] = React.useState(defaultCollapsed);
|
|
47
47
|
// Below 1024px the sidebar is not in the page; the same brand, action,
|
|
48
48
|
// navigation and footer open in a drawer from the header instead.
|
|
@@ -73,7 +73,7 @@ function ApplicationShellSidebar({ brand, primaryAction, navigation, navigationL
|
|
|
73
73
|
}
|
|
74
74
|
const toggle = collapsible ? (_jsx(Button, { ref: toggleRef, variant: "ghost", size: "sm", className: "sidebar-toggle btn-icon", "aria-controls": sidebarId, "aria-expanded": !isCollapsed, "aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar", title: isCollapsed ? "Expand sidebar" : "Collapse sidebar", onClick: toggleSidebar, children: isCollapsed ? _jsx(PanelLeftOpen, { className: "icon", "aria-hidden": "true" }) : _jsx(PanelLeftClose, { className: "icon", "aria-hidden": "true" }) })) : null;
|
|
75
75
|
const menu = (_jsx(Button, { ref: menuRef, variant: "ghost", size: "sm", className: "app-shell-menu btn-icon", "aria-expanded": drawerOpen, "aria-label": "Open navigation", title: "Navigation", onClick: () => setDrawerOpen(true), children: _jsx(Menu, { className: "icon", "aria-hidden": "true" }) }));
|
|
76
|
-
return (_jsxs(AppShell, { ...shellProps, "data-phone-drawer": "true", "data-phone-navigation": phoneNavigation, children: [_jsxs(Sidebar, { ref: sidebarRef, id: sidebarId, collapsed: isCollapsed, children: [_jsx(SidebarHeader, { className: collapsible && togglePlacement === "sidebar" ? "sidebar-header-collapsible" : undefined, children: collapsible ? _jsxs(_Fragment, { children: [_jsxs("div", { className: "sidebar-expanded-content", children: [brand, primaryAction] }), togglePlacement === "sidebar" && toggle] }) : _jsxs(_Fragment, { children: [brand, primaryAction] }) }), _jsx(SidebarBody, { children: _jsx(ApplicationShellNavigation, { navigation: navigation, navigationLabel: navigationLabel, collapsible: collapsible }) }), footer && _jsx(SidebarFooter, { className: collapsible ? "sidebar-expanded-content" : undefined, children: footer })] }), _jsxs(AppShellMain, { children: [_jsxs(Header, { variant: headerVariant, "data-phone-only": header || (collapsible && togglePlacement === "header") ? undefined : "true", children: [menu, phoneNavigation === "bottom" && _jsx("div", { className: "app-shell-phone-brand", children: brand }), phoneNavigation === "bottom" && primaryAction && _jsx("div", { className: "app-shell-phone-action", children: primaryAction }), togglePlacement === "header" && toggle, header] }), children] }), panel, _jsx(Drawer, { open: drawerOpen, onOpenChange: setDrawerOpen, children: _jsxs(DrawerContent, { placement: "side", className: "app-shell-drawer", onCloseAutoFocus: (event) => {
|
|
76
|
+
return (_jsxs(AppShell, { ...shellProps, "data-phone-drawer": "true", "data-phone-navigation": phoneNavigation, children: [_jsxs(Sidebar, { ref: sidebarRef, id: sidebarId, collapsed: isCollapsed, children: [_jsx(SidebarHeader, { className: collapsible && togglePlacement === "sidebar" ? "sidebar-header-collapsible" : undefined, children: collapsible ? _jsxs(_Fragment, { children: [_jsxs("div", { className: "sidebar-expanded-content", children: [brand, primaryAction] }), togglePlacement === "sidebar" && toggle] }) : _jsxs(_Fragment, { children: [brand, primaryAction] }) }), _jsx(SidebarBody, { children: _jsx(ApplicationShellNavigation, { navigation: navigation, navigationLabel: navigationLabel, collapsible: collapsible }) }), footer && _jsx(SidebarFooter, { className: collapsible ? "sidebar-expanded-content" : undefined, children: footer })] }), _jsxs(AppShellMain, { children: [_jsxs(Header, { variant: headerVariant, size: headerSize, "data-phone-only": header || (collapsible && togglePlacement === "header") ? undefined : "true", children: [menu, phoneNavigation === "bottom" && _jsx("div", { className: "app-shell-phone-brand", children: brand }), phoneNavigation === "bottom" && primaryAction && _jsx("div", { className: "app-shell-phone-action", children: primaryAction }), togglePlacement === "header" && toggle, header] }), children] }), panel, _jsx(Drawer, { open: drawerOpen, onOpenChange: setDrawerOpen, children: _jsxs(DrawerContent, { placement: "side", className: "app-shell-drawer", onCloseAutoFocus: (event) => {
|
|
77
77
|
event.preventDefault();
|
|
78
78
|
menuRef.current?.focus();
|
|
79
79
|
}, children: [_jsxs(DrawerHeader, { children: [_jsx(VisuallyHidden.Root, { asChild: true, children: _jsx(DrawerTitle, { children: "Navigation" }) }), brand] }), _jsxs(DrawerBody, { onClick: (event) => {
|
package/dist/header.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare function Header({ className, variant, ...props }: React.ComponentProps<"header"> & {
|
|
3
|
-
variant?: "default" | "plain";
|
|
2
|
+
declare function Header({ className, variant, size, ...props }: React.ComponentProps<"header"> & {
|
|
3
|
+
variant?: "default" | "plain" | "floating";
|
|
4
|
+
size?: "compact" | "default" | "editorial";
|
|
4
5
|
}): React.JSX.Element;
|
|
5
6
|
export { Header };
|
package/dist/header.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { clsx as cn } from "clsx";
|
|
3
3
|
// Shared product chrome: brand, Navigation, and global status or actions.
|
|
4
4
|
// Location within the product is Breadcrumb, not Header.
|
|
5
|
-
function Header({ className, variant, ...props }) {
|
|
6
|
-
return (_jsx("header", { "data-slot": "header", "data-variant": variant, className: cn("topbar", className), ...props }));
|
|
5
|
+
function Header({ className, variant, size, ...props }) {
|
|
6
|
+
return (_jsx("header", { "data-slot": "header", "data-variant": variant, "data-size": size, className: cn("topbar", className), ...props }));
|
|
7
7
|
}
|
|
8
8
|
export { Header };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momoi-labs/kiso-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Kiso React components built with shadcn/ui and Radix",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prepack": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@momoi-labs/kiso": "^1.
|
|
35
|
+
"@momoi-labs/kiso": "^1.6.0",
|
|
36
36
|
"class-variance-authority": "0.7.1",
|
|
37
37
|
"clsx": "2.1.1",
|
|
38
38
|
"radix-ui": "1.6.7",
|