najm-kit 2.1.15 → 2.1.16
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.d.ts +4 -0
- package/dist/index.mjs +17 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -167,6 +167,10 @@ interface NajmComponentStyleConfig {
|
|
|
167
167
|
showSectionLabels?: boolean;
|
|
168
168
|
/** Sidebar-only: render separator lines between nav item sections. */
|
|
169
169
|
showSectionSeparators?: boolean;
|
|
170
|
+
/** Sidebar-only: expanded width in px (default 240). */
|
|
171
|
+
expandedWidth?: number;
|
|
172
|
+
/** Sidebar-only: collapsed width in px (default 64). */
|
|
173
|
+
collapsedWidth?: number;
|
|
170
174
|
defaultVariant?: string;
|
|
171
175
|
defaultSize?: string;
|
|
172
176
|
density?: NajmDensity;
|
package/dist/index.mjs
CHANGED
|
@@ -608,6 +608,8 @@ var COMPONENT_KEYS = /* @__PURE__ */ new Set([
|
|
|
608
608
|
"card",
|
|
609
609
|
"showSectionLabels",
|
|
610
610
|
"showSectionSeparators",
|
|
611
|
+
"expandedWidth",
|
|
612
|
+
"collapsedWidth",
|
|
611
613
|
"defaultVariant",
|
|
612
614
|
"defaultSize",
|
|
613
615
|
"density",
|
|
@@ -645,6 +647,13 @@ function optionalBoolean(value, path) {
|
|
|
645
647
|
}
|
|
646
648
|
return value;
|
|
647
649
|
}
|
|
650
|
+
function optionalNumber(value, path) {
|
|
651
|
+
if (value === void 0) return void 0;
|
|
652
|
+
if (typeof value !== "number") {
|
|
653
|
+
throw new TypeError(`${path} must be a number`);
|
|
654
|
+
}
|
|
655
|
+
return value;
|
|
656
|
+
}
|
|
648
657
|
function optionalEnum2(value, values, path) {
|
|
649
658
|
if (value === void 0) return void 0;
|
|
650
659
|
if (typeof value !== "string" || !values.has(value)) {
|
|
@@ -705,6 +714,8 @@ function parseComponentStyle(value, path) {
|
|
|
705
714
|
const card = optionalBoolean(value.card, `${path}.card`);
|
|
706
715
|
const showSectionLabels = optionalBoolean(value.showSectionLabels, `${path}.showSectionLabels`);
|
|
707
716
|
const showSectionSeparators = optionalBoolean(value.showSectionSeparators, `${path}.showSectionSeparators`);
|
|
717
|
+
const expandedWidth = optionalNumber(value.expandedWidth, `${path}.expandedWidth`);
|
|
718
|
+
const collapsedWidth = optionalNumber(value.collapsedWidth, `${path}.collapsedWidth`);
|
|
708
719
|
const defaultVariant = optionalString2(value.defaultVariant, `${path}.defaultVariant`);
|
|
709
720
|
const defaultSize = optionalString2(value.defaultSize, `${path}.defaultSize`);
|
|
710
721
|
const density = optionalEnum2(value.density, DENSITIES, `${path}.density`);
|
|
@@ -716,6 +727,8 @@ function parseComponentStyle(value, path) {
|
|
|
716
727
|
if (card !== void 0) cfg.card = card;
|
|
717
728
|
if (showSectionLabels !== void 0) cfg.showSectionLabels = showSectionLabels;
|
|
718
729
|
if (showSectionSeparators !== void 0) cfg.showSectionSeparators = showSectionSeparators;
|
|
730
|
+
if (expandedWidth !== void 0) cfg.expandedWidth = expandedWidth;
|
|
731
|
+
if (collapsedWidth !== void 0) cfg.collapsedWidth = collapsedWidth;
|
|
719
732
|
if (defaultVariant !== void 0) cfg.defaultVariant = defaultVariant;
|
|
720
733
|
if (defaultSize !== void 0) cfg.defaultSize = defaultSize;
|
|
721
734
|
if (density !== void 0) cfg.density = density;
|
|
@@ -1982,7 +1995,7 @@ function NPageHeaderCompactActions({ children, className }) {
|
|
|
1982
1995
|
}
|
|
1983
1996
|
NPageHeaderCompactActions.displayName = "NPageHeaderCompactActions";
|
|
1984
1997
|
function NPageHeaderFilters({ children, className }) {
|
|
1985
|
-
return /* @__PURE__ */ jsx("div", { className: cn("
|
|
1998
|
+
return /* @__PURE__ */ jsx("div", { className: cn("py-3 lg:px-4 xl:px-5", className), children });
|
|
1986
1999
|
}
|
|
1987
2000
|
NPageHeaderFilters.displayName = "NPageHeaderFilters";
|
|
1988
2001
|
function NPageHeaderTop({ children, className }) {
|
|
@@ -2091,7 +2104,7 @@ function NPageHeader({
|
|
|
2091
2104
|
{
|
|
2092
2105
|
"data-slot": "page-header-main",
|
|
2093
2106
|
className: cn(
|
|
2094
|
-
"relative grid min-h-12 grid-cols-[minmax(2.75rem,1fr)_minmax(0,auto)_minmax(2.75rem,1fr)] items-center gap-2
|
|
2107
|
+
"relative grid min-h-12 grid-cols-[minmax(2.75rem,1fr)_minmax(0,auto)_minmax(2.75rem,1fr)] items-center gap-2 lg:px-4 xl:px-5",
|
|
2095
2108
|
breakpointClasses.main,
|
|
2096
2109
|
breakpointClasses.minH,
|
|
2097
2110
|
headerClassName
|
|
@@ -11177,8 +11190,8 @@ function NSidebar({
|
|
|
11177
11190
|
}, [onNavigate, closeOnNavigate]);
|
|
11178
11191
|
const groups = useMemo(() => buildGroups(navItems), [navItems]);
|
|
11179
11192
|
const desktopClass = mobileBreakpoint === "sm" ? "hidden sm:flex" : mobileBreakpoint === "lg" ? "hidden lg:flex" : "hidden md:flex";
|
|
11180
|
-
const expandedWidth = widths?.expanded ?? 240;
|
|
11181
|
-
const collapsedWidth = widths?.collapsed ?? 64;
|
|
11193
|
+
const expandedWidth = widths?.expanded ?? recipe?.expandedWidth ?? 240;
|
|
11194
|
+
const collapsedWidth = widths?.collapsed ?? recipe?.collapsedWidth ?? 64;
|
|
11182
11195
|
const mobileWidth = widths?.mobile ?? expandedWidth;
|
|
11183
11196
|
const railVar = typeof collapsedWidth === "number" ? `${collapsedWidth}px` : collapsedWidth;
|
|
11184
11197
|
const sidebarEdgeWidth = bordered === false ? "0px" : recipe?.borderWidth ?? "var(--border-width, 1px)";
|