@nordmanai/nif 0.2.16 → 0.2.18
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/index.js +232 -225
- package/dist/styles.css +1 -1
- package/dist/ui/components/nm-sidebar/nm-sidebar.d.ts +2 -0
- package/package.json +1 -1
- package/registry/index.json +1 -1
- package/registry/ui/components/nm-sidebar/nm-sidebar.css +26 -5
- package/registry/ui/components/nm-sidebar/nm-sidebar.tsx +4 -0
|
@@ -129,6 +129,8 @@ export declare function NmSidebarMenuActions({ className, showOnHover, ...props
|
|
|
129
129
|
}): ReactNode;
|
|
130
130
|
/** A row of controls in the header or footer, such as a primary button and an icon button, spaced apart. */
|
|
131
131
|
export declare function NmSidebarBar({ className, ...props }: ComponentProps<'div'>): ReactNode;
|
|
132
|
+
/** The product name at the top of the sidebar. Static: it has a row's geometry so it lines up with the rows below, but no hover or press. */
|
|
133
|
+
export declare function NmSidebarBrand({ className, ...props }: ComponentProps<'div'>): ReactNode;
|
|
132
134
|
/** A count or a short word at the end of a row. The NIF Chip, small. */
|
|
133
135
|
export declare function NmSidebarMenuBadge({ className, ...props }: ComponentProps<typeof NmChip>): ReactNode;
|
|
134
136
|
/** Two lines in a row, such as a name and a plan in the footer. For a large menu button. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordmanai/nif",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"description": "Nordman Interface Framework: the one UI and UX system for every Nordman product. Base UI, in the shadcn composition, styled by NIF tokens.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
package/registry/index.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
.nm-sidebar-provider {
|
|
3
3
|
--nm-sidebar-width: var(--nm-width-sidebar);
|
|
4
4
|
--nm-sidebar-width-icon: var(--nm-width-sidebar-icon);
|
|
5
|
+
/* The sidebar shares the page's background; only its divider separates it. Floating and inset variants keep their raised card. */
|
|
6
|
+
--nm-sidebar-bg: var(--nm-canvas);
|
|
5
7
|
position: relative;
|
|
6
8
|
box-sizing: border-box;
|
|
7
9
|
display: flex;
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
min-height: 0;
|
|
40
42
|
overflow: hidden;
|
|
41
43
|
color: var(--nm-fg);
|
|
42
|
-
background: var(--nm-
|
|
44
|
+
background: var(--nm-sidebar-bg);
|
|
43
45
|
transition:
|
|
44
46
|
width var(--reveal) var(--ease),
|
|
45
47
|
padding var(--reveal) var(--ease);
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
inset-inline-start: 0;
|
|
98
100
|
width: var(--nm-sidebar-width);
|
|
99
101
|
border-inline-end: var(--nm-rule) solid var(--nm-border-strong);
|
|
100
|
-
background: var(--nm-
|
|
102
|
+
background: var(--nm-sidebar-bg);
|
|
101
103
|
}
|
|
102
104
|
.nm-sidebar[data-side='right'][data-peek] .nm-sidebar__inner {
|
|
103
105
|
inset-inline-start: auto;
|
|
@@ -175,18 +177,37 @@
|
|
|
175
177
|
.nm-sidebar-provider > .nm-sidebar__trigger--anchored {
|
|
176
178
|
position: absolute;
|
|
177
179
|
top: var(--nm-space-12);
|
|
178
|
-
|
|
180
|
+
/* Its icon sits where a row's icon sits: the group padding, the row border, then the row's icon padding. */
|
|
181
|
+
inset-inline-start: calc(var(--nm-space-8) + var(--nm-rule));
|
|
179
182
|
z-index: calc(var(--nm-rail-z) + 1);
|
|
180
183
|
}
|
|
181
184
|
/* The header leaves the anchored toggle's room and lines its first row up with it. */
|
|
182
185
|
.nm-sidebar-provider:has(> .nm-sidebar__trigger--anchored) .nm-sidebar__header {
|
|
183
186
|
padding-block-start: var(--nm-space-12);
|
|
184
|
-
|
|
187
|
+
/* The first row's text starts where a row's text starts: after the icon column. */
|
|
188
|
+
padding-inline-start: calc(var(--nm-space-8) + var(--nm-icon-button) + var(--nm-space-8));
|
|
185
189
|
min-height: calc(var(--nm-space-12) + var(--nm-icon-control) + var(--nm-space-8));
|
|
186
190
|
}
|
|
187
|
-
.nm-sidebar-provider:has(> .nm-sidebar__trigger--anchored) .nm-sidebar__header > .nm-sidebar__menu > .nm-sidebar__menu-item:first-child > .nm-sidebar__menu-button
|
|
191
|
+
.nm-sidebar-provider:has(> .nm-sidebar__trigger--anchored) .nm-sidebar__header > .nm-sidebar__menu > .nm-sidebar__menu-item:first-child > .nm-sidebar__menu-button,
|
|
192
|
+
.nm-sidebar-provider:has(> .nm-sidebar__trigger--anchored) .nm-sidebar__header > .nm-sidebar__brand {
|
|
188
193
|
min-height: var(--nm-icon-control);
|
|
189
194
|
}
|
|
195
|
+
/* The product name: a row's geometry and type, semibold, with nothing to hover or press. */
|
|
196
|
+
.nm-sidebar__brand {
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
gap: var(--nm-space-8);
|
|
200
|
+
box-sizing: border-box;
|
|
201
|
+
width: 100%;
|
|
202
|
+
height: var(--control-h);
|
|
203
|
+
padding: 0 var(--nm-icon-pad);
|
|
204
|
+
border: var(--nm-rule) solid transparent;
|
|
205
|
+
color: var(--nm-fg);
|
|
206
|
+
font: inherit;
|
|
207
|
+
font-size: var(--nm-type-ui);
|
|
208
|
+
font-weight: var(--nm-weight-semibold);
|
|
209
|
+
white-space: nowrap;
|
|
210
|
+
}
|
|
190
211
|
/* Holds the anchored toggle's place in a bar while the sidebar is closed. */
|
|
191
212
|
.nm-sidebar__trigger-space {
|
|
192
213
|
display: inline-block;
|
|
@@ -503,6 +503,10 @@ export function NmSidebarMenuActions({ className, showOnHover = false, ...props
|
|
|
503
503
|
export function NmSidebarBar({ className, ...props }: ComponentProps<'div'>): ReactNode {
|
|
504
504
|
return <div data-slot="sidebar-bar" className={nmClass('nm-sidebar__bar', className)} {...props} />;
|
|
505
505
|
}
|
|
506
|
+
/** The product name at the top of the sidebar. Static: it has a row's geometry so it lines up with the rows below, but no hover or press. */
|
|
507
|
+
export function NmSidebarBrand({ className, ...props }: ComponentProps<'div'>): ReactNode {
|
|
508
|
+
return <div data-slot="sidebar-brand" className={nmClass('nm-sidebar__brand', className)} {...props} />;
|
|
509
|
+
}
|
|
506
510
|
/** A count or a short word at the end of a row. The NIF Chip, small. */
|
|
507
511
|
export function NmSidebarMenuBadge({ className, ...props }: ComponentProps<typeof NmChip>): ReactNode {
|
|
508
512
|
return <NmChip data-slot="sidebar-menu-badge" size="sm" className={nmClass('nm-sidebar__menu-badge', className)} {...props} />;
|