najm-kit 0.0.29 → 0.0.30

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
@@ -2139,6 +2139,7 @@ interface WizardClassNames {
2139
2139
  indicator?: string;
2140
2140
  progressBar?: string;
2141
2141
  }
2142
+ type WizardFooterDivider = boolean | "none" | "solid" | "dashed" | "dotted";
2142
2143
  interface WizardFormProps {
2143
2144
  steps: StepConfig[];
2144
2145
  schema: any;
@@ -2157,6 +2158,8 @@ interface WizardFormProps {
2157
2158
  className?: string;
2158
2159
  classNames?: WizardClassNames;
2159
2160
  footerSlot?: ReactNode;
2161
+ footerDivider?: WizardFooterDivider;
2162
+ footerDividerClassName?: string;
2160
2163
  children?: ReactNode;
2161
2164
  }
2162
2165
  interface StepMeta {
@@ -2165,7 +2168,7 @@ interface StepMeta {
2165
2168
  title: string;
2166
2169
  }
2167
2170
 
2168
- declare function WizardForm({ steps, schema, defaultValues, onSubmit, currentStep: controlledStep, onCurrentStepChange, onStepComplete, showHeader, showFooter, nextLabel, previousLabel, submitLabel, variant, bordered, className, classNames, footerSlot, }: WizardFormProps): react_jsx_runtime.JSX.Element;
2171
+ declare function WizardForm({ steps, schema, defaultValues, onSubmit, currentStep: controlledStep, onCurrentStepChange, onStepComplete, showHeader, showFooter, nextLabel, previousLabel, submitLabel, variant, bordered, className, classNames, footerSlot, footerDivider, footerDividerClassName, }: WizardFormProps): react_jsx_runtime.JSX.Element;
2169
2172
 
2170
2173
  interface StepIndicatorProps {
2171
2174
  stepNumber: number;
package/dist/index.mjs CHANGED
@@ -5787,16 +5787,35 @@ var PasswordInput = ({ value, onChange, placeholder = "", icon, showIcon = true,
5787
5787
  showPassword ? /* @__PURE__ */ jsx(Eye, { className: "absolute right-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground cursor-pointer", onClick: () => setShowPassword(false) }) : /* @__PURE__ */ jsx(EyeOff, { className: "absolute right-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground cursor-pointer", onClick: () => setShowPassword(true) })
5788
5788
  ] });
5789
5789
  };
5790
- var TextAreaInput = ({ value, onChange, placeholder = "", className = "", variant = "default", status = "default", bordered, borderColor, rows }) => /* @__PURE__ */ jsx(BaseInput, { variant, status, bordered, borderColor, className: cn("items-start", className), children: /* @__PURE__ */ jsx(
5791
- Textarea,
5792
- {
5793
- rows,
5794
- placeholder,
5795
- value,
5796
- onChange: (ev) => onChange(ev.target.value),
5797
- className: "h-full border-0 bg-transparent p-0 text-muted-foreground shadow-none focus-visible:border-transparent focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 dark:bg-transparent"
5798
- }
5799
- ) });
5790
+ var DEFAULT_ROWS = 3;
5791
+ var MIN_ROWS = 2;
5792
+ var REM_PER_ROW = 1.5;
5793
+ var VERTICAL_PADDING_REM = 1;
5794
+ var TextAreaInput = ({ value, onChange, placeholder = "", className = "", variant = "default", status = "default", bordered, borderColor, rows }) => {
5795
+ const visibleRows = Math.max(rows ?? DEFAULT_ROWS, MIN_ROWS);
5796
+ const minHeight = `${visibleRows * REM_PER_ROW + VERTICAL_PADDING_REM}rem`;
5797
+ return /* @__PURE__ */ jsx(
5798
+ BaseInput,
5799
+ {
5800
+ variant,
5801
+ status,
5802
+ bordered,
5803
+ borderColor,
5804
+ className: cn("h-auto items-start", className),
5805
+ style: { minHeight },
5806
+ children: /* @__PURE__ */ jsx(
5807
+ Textarea,
5808
+ {
5809
+ rows: visibleRows,
5810
+ placeholder,
5811
+ value,
5812
+ onChange: (ev) => onChange(ev.target.value),
5813
+ className: "h-full min-h-0 resize-y border-0 bg-transparent p-0 text-muted-foreground shadow-none focus-visible:border-transparent focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 dark:bg-transparent"
5814
+ }
5815
+ )
5816
+ }
5817
+ );
5818
+ };
5800
5819
  function renderItems(items) {
5801
5820
  return items.map((item) => {
5802
5821
  const value = typeof item === "string" ? item : item.value;
@@ -7744,6 +7763,12 @@ function issuePath(issue) {
7744
7763
  function matchesFieldPath(path, field) {
7745
7764
  return path === field || path.startsWith(`${field}.`) || field.startsWith(`${path}.`);
7746
7765
  }
7766
+ function footerDividerClass(divider = "none") {
7767
+ if (divider === false || divider === "none") return "border-t-0";
7768
+ if (divider === "dashed") return "border-t border-dashed border-border";
7769
+ if (divider === "dotted") return "border-t border-dotted border-border";
7770
+ return "border-t border-solid border-border";
7771
+ }
7747
7772
  function WizardForm({
7748
7773
  steps,
7749
7774
  schema,
@@ -7761,7 +7786,9 @@ function WizardForm({
7761
7786
  bordered,
7762
7787
  className,
7763
7788
  classNames,
7764
- footerSlot
7789
+ footerSlot,
7790
+ footerDivider = "none",
7791
+ footerDividerClassName
7765
7792
  }) {
7766
7793
  const nav = useStepNavigation({
7767
7794
  steps,
@@ -7876,13 +7903,25 @@ function WizardForm({
7876
7903
  ]
7877
7904
  }
7878
7905
  ) }) }),
7879
- showFooter && /* @__PURE__ */ jsxs("div", { className: cn("sticky bottom-0 z-10 mt-auto flex shrink-0 items-center justify-between border-t border-border bg-background/95 pt-3 backdrop-blur", classNames?.footer), children: [
7880
- /* @__PURE__ */ jsx("div", { children: !nav.isFirstStep && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: nav.handlePrevious, children: previousLabel }) }),
7881
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7882
- footerSlot,
7883
- nav.isLastStep ? /* @__PURE__ */ jsx(Button, { type: "submit", form: `step-${currentStepConfig.id}`, children: submitLabel }) : /* @__PURE__ */ jsx(Button, { type: "submit", form: `step-${currentStepConfig.id}`, children: nextLabel })
7884
- ] })
7885
- ] })
7906
+ showFooter && /* @__PURE__ */ jsxs(
7907
+ "div",
7908
+ {
7909
+ "data-najm-wizard-footer": "true",
7910
+ className: cn(
7911
+ "sticky bottom-0 z-10 mt-auto flex shrink-0 items-center justify-between bg-background/95 pt-3 backdrop-blur",
7912
+ footerDividerClass(footerDivider),
7913
+ footerDividerClassName,
7914
+ classNames?.footer
7915
+ ),
7916
+ children: [
7917
+ /* @__PURE__ */ jsx("div", { children: !nav.isFirstStep && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: nav.handlePrevious, children: previousLabel }) }),
7918
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7919
+ footerSlot,
7920
+ nav.isLastStep ? /* @__PURE__ */ jsx(Button, { type: "submit", form: `step-${currentStepConfig.id}`, children: submitLabel }) : /* @__PURE__ */ jsx(Button, { type: "submit", form: `step-${currentStepConfig.id}`, children: nextLabel })
7921
+ ] })
7922
+ ]
7923
+ }
7924
+ )
7886
7925
  ]
7887
7926
  }
7888
7927
  );
@@ -9338,7 +9377,7 @@ function NTableJson() {
9338
9377
  if (viewMode !== "json") return null;
9339
9378
  return /* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden", children: renderJson?.() ?? /* @__PURE__ */ jsx(NajmScroll, { axis: "both", className: "h-full min-h-0 rounded-md border border-border bg-muted/40", children: /* @__PURE__ */ jsx("pre", { className: "p-4 font-mono text-xs leading-relaxed text-foreground", children: formatJsonValue(jsonValue) }) }) });
9340
9379
  }
9341
- var DEFAULT_ROWS = 6;
9380
+ var DEFAULT_ROWS2 = 6;
9342
9381
  function NTableHeaderSkeleton() {
9343
9382
  const filters = useTableStore.use.filters();
9344
9383
  const showViewToggle = useTableStore.use.showViewToggle();
@@ -9363,7 +9402,7 @@ function NTableHeaderSkeleton() {
9363
9402
  ] })
9364
9403
  ] });
9365
9404
  }
9366
- function NTableLoadingSkeleton({ rows = DEFAULT_ROWS }) {
9405
+ function NTableLoadingSkeleton({ rows = DEFAULT_ROWS2 }) {
9367
9406
  const columns = useTableStore.use.columns();
9368
9407
  const showCheckbox = useTableStore.use.showCheckbox();
9369
9408
  const headerClassName = useTableStore.use.headerClassName();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najm-kit",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "type": "module",
5
5
  "description": "Reusable React UI component package for Najm framework",
6
6
  "main": "./dist/index.mjs",