najm-kit 2.1.15 → 2.1.17

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 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("px-2 py-3 lg:px-4 xl:px-5", className), children });
1998
+ return /* @__PURE__ */ jsx("div", { className: cn("py-3 lg:px-4 xl:px-4 2xl: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 px-2 lg:px-4 xl:px-5",
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-4 2xl:px-5",
2095
2108
  breakpointClasses.main,
2096
2109
  breakpointClasses.minH,
2097
2110
  headerClassName
@@ -5085,7 +5098,7 @@ function NCard({
5085
5098
  style: recipeStyle,
5086
5099
  className: cn(
5087
5100
  "flex flex-col",
5088
- !noPadding && "p-2 lg:p-4 xl:p-5 gap-3",
5101
+ !noPadding && "p-2 lg:p-4 xl:p-4 2xl:p-5 gap-3",
5089
5102
  surfaceBorderClasses(bordered),
5090
5103
  classNames?.root,
5091
5104
  className
@@ -5285,7 +5298,7 @@ function DefaultCard({
5285
5298
  onClick,
5286
5299
  bordered,
5287
5300
  className: cn(
5288
- "group p-4 transition-colors",
5301
+ "group p-2 lg:p-4 xl:p-4 2xl:p-5 transition-colors",
5289
5302
  onClick && "cursor-pointer hover:border-border/60 hover:bg-accent/40",
5290
5303
  className
5291
5304
  ),
@@ -5298,10 +5311,10 @@ function DefaultCard({
5298
5311
  "div",
5299
5312
  {
5300
5313
  className: cn(
5301
- "flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary transition-colors group-hover:bg-primary/20",
5314
+ "flex h-8 w-8 lg:h-9 lg:w-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary transition-colors group-hover:bg-primary/20",
5302
5315
  classNames?.icon
5303
5316
  ),
5304
- children: /* @__PURE__ */ jsx(NIcon, { icon, className: "w-7 h-7" })
5317
+ children: /* @__PURE__ */ jsx(NIcon, { icon, className: "w-4 h-4 lg:w-5 lg:h-5 2xl:w-6 2xl:h-6" })
5305
5318
  }
5306
5319
  ),
5307
5320
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
@@ -5321,7 +5334,7 @@ function DefaultCard({
5321
5334
  }
5322
5335
  )
5323
5336
  ] }),
5324
- /* @__PURE__ */ jsx("p", { className: cn("text-xl font-semibold leading-none text-foreground", classNames?.value), children: value }),
5337
+ /* @__PURE__ */ jsx("p", { className: cn("text-sm lg:text-base xl:text-base 2xl:text-xl font-semibold leading-none text-foreground", classNames?.value), children: value }),
5325
5338
  subtext && /* @__PURE__ */ jsx("p", { className: cn("text-[10px] text-muted-foreground", classNames?.description), children: subtext })
5326
5339
  ] })
5327
5340
  ]
@@ -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)";
@@ -11252,7 +11265,7 @@ function NSidebar({
11252
11265
  "data-collapsed": desktopCollapsed ? "true" : "false",
11253
11266
  "data-auto-collapsed": autoCollapsed ? "true" : void 0,
11254
11267
  className: cn(
11255
- "relative z-10 flex flex-col h-full bg-sidebar text-sidebar-foreground transition-all duration-200",
11268
+ "relative z-10 flex flex-col h-full bg-sidebar text-sidebar-foreground transition-all duration-200 shrink-0",
11256
11269
  desktopClass,
11257
11270
  sidebarBorderClasses(bordered, "right"),
11258
11271
  classNames?.sidebar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najm-kit",
3
- "version": "2.1.15",
3
+ "version": "2.1.17",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Reusable React UI component package for Najm framework",