najm-kit 2.7.3 → 2.8.1
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/CHANGELOG.md +29 -3
- package/README.md +124 -6
- package/dist/{NajmUIProvider-IFU3dFkn.d.ts → NajmUIProvider-BSbXaqak.d.ts} +1 -1
- package/dist/adapters/app.d.ts +10 -4
- package/dist/adapters/app.mjs +8 -5
- package/dist/adapters/next.d.ts +2 -2
- package/dist/{cardPagination-A6h8vXuk.d.ts → cardPagination-Bwf3tEeN.d.ts} +16 -4
- package/dist/chunk-GHMR45H3.mjs +333 -0
- package/dist/{chunk-GPHWBOSP.mjs → chunk-JABLSOQN.mjs} +11 -1
- package/dist/{chunk-XGDMPI5U.mjs → chunk-OUS7OYVA.mjs} +11 -9
- package/dist/{NBrandingContext-dkADu8JS.d.ts → formFill-BcH-m9Kf.d.ts} +16 -1
- package/dist/format.d.ts +34 -1
- package/dist/format.mjs +1 -1
- package/dist/index.d.ts +74 -13
- package/dist/index.mjs +138 -29
- package/dist/{paginationLabels-DgHutNWz.d.ts → paginationLabels-dZLSNxfo.d.ts} +8 -1
- package/dist/query.d.ts +3 -3
- package/dist/query.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-VKQIRB7F.mjs +0 -116
|
@@ -26,26 +26,28 @@ function useDesktopTableMode(breakpoint = DEFAULT_CARD_BREAKPOINT) {
|
|
|
26
26
|
|
|
27
27
|
// src/components/table/cardPagination.ts
|
|
28
28
|
var DEFAULT_CARD_PAGINATION_KEY_PREFIX = "common.pagination";
|
|
29
|
-
function buildCardPaginationLabels(t, prefix
|
|
29
|
+
function buildCardPaginationLabels(t, prefix) {
|
|
30
|
+
const scope = prefix ?? DEFAULT_CARD_PAGINATION_KEY_PREFIX;
|
|
30
31
|
return {
|
|
31
|
-
loadMoreError: t(`${
|
|
32
|
-
retryLabel: t(`${
|
|
33
|
-
itemsLoaded: (count) => t(`${
|
|
32
|
+
loadMoreError: t(`${scope}.loadMoreError`),
|
|
33
|
+
retryLabel: t(`${scope}.retryLoadMore`),
|
|
34
|
+
itemsLoaded: (count) => t(`${scope}.itemsLoaded`, { count })
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
function createCardPagination(state, labels = {}) {
|
|
37
|
+
function createCardPagination(state, labels = {}, prefix) {
|
|
37
38
|
const mode = state.mode ?? (state.cardViewport ? "infinite" : "paged");
|
|
38
39
|
if (mode === "paged") return { mode: "paged" };
|
|
39
40
|
if (mode === "all") return { mode: "all" };
|
|
41
|
+
const resolved = typeof labels === "function" ? buildCardPaginationLabels(labels, prefix) : labels;
|
|
40
42
|
return {
|
|
41
43
|
mode: "infinite",
|
|
42
44
|
hasNextPage: state.hasNextPage,
|
|
43
45
|
loadingMore: state.loadingMore,
|
|
44
|
-
loadMoreError: state.loadMoreError ?
|
|
46
|
+
loadMoreError: state.loadMoreError ? resolved.loadMoreError : void 0,
|
|
45
47
|
onLoadMore: state.onLoadMore,
|
|
46
|
-
retryLabel:
|
|
47
|
-
loadMoreErrorLabel:
|
|
48
|
-
itemsLoadedLabel:
|
|
48
|
+
retryLabel: resolved.retryLabel,
|
|
49
|
+
loadMoreErrorLabel: resolved.loadMoreError,
|
|
50
|
+
itemsLoadedLabel: resolved.itemsLoaded
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { ZodTypeAny, TypeOf } from 'zod';
|
|
3
4
|
|
|
4
5
|
interface NBrandingValue {
|
|
5
6
|
/** Used as the logo's `alt` when the logo does not set one. */
|
|
@@ -79,4 +80,18 @@ interface NBrandingStateProviderProps {
|
|
|
79
80
|
/** `NBrandingProvider` with the marks held as state an editor can write. */
|
|
80
81
|
declare function NBrandingStateProvider({ children, branding, initialBranding, }: Readonly<NBrandingStateProviderProps>): react_jsx_runtime.JSX.Element;
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
type FormFillOverride = unknown | readonly unknown[] | ((fieldName: string) => unknown);
|
|
84
|
+
type FormFillOverrides = Record<string, FormFillOverride>;
|
|
85
|
+
interface FormDevToolsOptions {
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
shortcut?: string;
|
|
88
|
+
}
|
|
89
|
+
interface FormDevToolsConfig<T extends ZodTypeAny = ZodTypeAny> extends FormDevToolsOptions {
|
|
90
|
+
fill?: () => Partial<TypeOf<T>>;
|
|
91
|
+
overrides?: FormFillOverrides;
|
|
92
|
+
}
|
|
93
|
+
type FormDevTools<T extends ZodTypeAny = ZodTypeAny> = boolean | FormDevToolsConfig<T>;
|
|
94
|
+
/** Build form-shaped test values from a Zod object schema. */
|
|
95
|
+
declare function buildFormFill<TSchema extends ZodTypeAny>(schema: TSchema, overrides?: FormFillOverrides): Partial<TypeOf<TSchema>>;
|
|
96
|
+
|
|
97
|
+
export { type FormDevToolsOptions as F, type NBrandingInput as N, type FormDevTools as a, type FormDevToolsConfig as b, type FormFillOverride as c, type FormFillOverrides as d, type NBrandingEditorValue as e, type NBrandingPayload as f, NBrandingProvider as g, NBrandingStateProvider as h, type NBrandingStateProviderProps as i, type NBrandingValue as j, buildFormFill as k, useNBrandingEditor as l, normalizeBranding as n, useNBranding as u };
|
package/dist/format.d.ts
CHANGED
|
@@ -49,5 +49,38 @@ declare function formatRelativeTime(value: Date | number | string | null | undef
|
|
|
49
49
|
* Anything user-visible and known in advance belongs in the translations.
|
|
50
50
|
*/
|
|
51
51
|
declare function humanizeToken(value: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Today as `YYYY-MM-DD` in the host's zone, for `<input type="date">`.
|
|
54
|
+
*
|
|
55
|
+
* Not `toISOString().slice(0, 10)`, which is the same line everyone writes and
|
|
56
|
+
* is wrong west of UTC for the first hours of the day: it converts to UTC
|
|
57
|
+
* first, so a date picker in Casablanca opens on tomorrow. The parts are read
|
|
58
|
+
* off the local calendar instead.
|
|
59
|
+
*
|
|
60
|
+
* Deliberately host-zone rather than preference-zone. This produces the value a
|
|
61
|
+
* date *input* round-trips, and that control is bound to the machine the user
|
|
62
|
+
* is typing on; `formatDate` is what renders a date for reading.
|
|
63
|
+
*/
|
|
64
|
+
declare function localDateInput(date?: Date): string;
|
|
65
|
+
interface SlugifyOptions {
|
|
66
|
+
/** Uppercases the result, for an identifier conventionally read in caps. */
|
|
67
|
+
upperCase?: boolean;
|
|
68
|
+
/** Longest slug produced, before the case change. Defaults to 160. */
|
|
69
|
+
maxLength?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Turns a label into a URL- and identifier-safe token: `Épicerie Fine` →
|
|
73
|
+
* `epicerie-fine`.
|
|
74
|
+
*
|
|
75
|
+
* Accents are folded rather than dropped. Stripping them outright is the usual
|
|
76
|
+
* one-liner and it silently eats letters — `Épicerie` becomes `picerie` — which
|
|
77
|
+
* is a poor slug in exactly the languages most likely to need one.
|
|
78
|
+
*
|
|
79
|
+
* A value with nothing to transliterate — Arabic or CJK, where folding has no
|
|
80
|
+
* ASCII to fall back to — yields a random token rather than an empty string.
|
|
81
|
+
* Empty is never a usable slug, and returning one pushes the failure to a
|
|
82
|
+
* uniqueness constraint far from the cause.
|
|
83
|
+
*/
|
|
84
|
+
declare function slugify(value: string, { upperCase, maxLength }?: SlugifyOptions): string;
|
|
52
85
|
|
|
53
|
-
export { DEFAULT_PLACEHOLDER, type NajmFormatConfig, formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTime, humanizeToken };
|
|
86
|
+
export { DEFAULT_PLACEHOLDER, type NajmFormatConfig, type SlugifyOptions, formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTime, humanizeToken, localDateInput, slugify };
|
package/dist/format.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import './chunk-F5KXJCCJ.mjs';
|
|
2
|
-
export { DEFAULT_PLACEHOLDER, formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTime, humanizeToken } from './chunk-
|
|
2
|
+
export { DEFAULT_PLACEHOLDER, formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTime, humanizeToken, localDateInput, slugify } from './chunk-JABLSOQN.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as NajmDesignConfig, b as NajmThemeProviderProps, c as NajmAppearance, d as NajmMode, e as NajmThemeConfig, f as NajmAccent, g as NajmThemeTokens, h as NajmPreset, i as NajmComponentName, j as NajmComponentStyleConfig, k as NajmComponentThemeConfig, l as NajmTypographyConfig, m as NajmLayoutConfig, n as NajmVariantStyle, o as NajmResponsiveBreakpoint, p as NajmResponsiveValue } from './NajmUIProvider-
|
|
3
|
-
export { D as DEFAULT_TIME_ZONE, q as NAJM_COMPONENT_NAMES, r as NTableDefaults, s as NTableDefaultsProvider, t as NajmComponentRadius, u as NajmDensity, v as NajmPreferencesContextValue, w as NajmPreferencesProvider, x as NajmPreferencesProviderProps, y as NajmSlotStyle, z as NajmUIProvider, N as NajmUIProviderProps, R as RADIUS_VALUE_MAP, A as resolveRadiusValue, B as useNTableDefaults, C as useNajmPreferencesContext, E as useNajmTheme, F as useNajmTimeZone } from './NajmUIProvider-
|
|
2
|
+
import { a as NajmDesignConfig, b as NajmThemeProviderProps, c as NajmAppearance, d as NajmMode, e as NajmThemeConfig, f as NajmAccent, g as NajmThemeTokens, h as NajmPreset, i as NajmComponentName, j as NajmComponentStyleConfig, k as NajmComponentThemeConfig, l as NajmTypographyConfig, m as NajmLayoutConfig, n as NajmVariantStyle, o as NajmResponsiveBreakpoint, p as NajmResponsiveValue } from './NajmUIProvider-BSbXaqak.js';
|
|
3
|
+
export { D as DEFAULT_TIME_ZONE, q as NAJM_COMPONENT_NAMES, r as NTableDefaults, s as NTableDefaultsProvider, t as NajmComponentRadius, u as NajmDensity, v as NajmPreferencesContextValue, w as NajmPreferencesProvider, x as NajmPreferencesProviderProps, y as NajmSlotStyle, z as NajmUIProvider, N as NajmUIProviderProps, R as RADIUS_VALUE_MAP, A as resolveRadiusValue, B as useNTableDefaults, C as useNajmPreferencesContext, E as useNajmTheme, F as useNajmTimeZone } from './NajmUIProvider-BSbXaqak.js';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
5
|
import React__default, { RefObject, ReactNode, ComponentType, InputHTMLAttributes, Ref, ImgHTMLAttributes, CSSProperties, MouseEvent, MouseEventHandler } from 'react';
|
|
6
|
-
import { c as NTablePaginationVariant, b as NTablePaginationLabels, a as NTableCardPagination } from './paginationLabels-
|
|
7
|
-
export { D as DEFAULT_PAGINATION_KEY_PREFIX, d as NTableInfinitePagination, e as NTableLoadMorePagination, N as NajmTranslate, f as buildPaginationLabels } from './paginationLabels-
|
|
6
|
+
import { c as NTablePaginationVariant, b as NTablePaginationLabels, a as NTableCardPagination } from './paginationLabels-dZLSNxfo.js';
|
|
7
|
+
export { D as DEFAULT_PAGINATION_KEY_PREFIX, d as NTableInfinitePagination, e as NTableLoadMorePagination, N as NajmTranslate, f as buildPaginationLabels } from './paginationLabels-dZLSNxfo.js';
|
|
8
8
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
9
9
|
import { VariantProps } from 'class-variance-authority';
|
|
10
10
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
@@ -22,7 +22,8 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
|
22
22
|
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
23
23
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
24
24
|
import { OverlayScrollbarsComponentProps } from 'overlayscrollbars-react';
|
|
25
|
-
|
|
25
|
+
import { a as FormDevTools, F as FormDevToolsOptions } from './formFill-BcH-m9Kf.js';
|
|
26
|
+
export { b as FormDevToolsConfig, c as FormFillOverride, d as FormFillOverrides, e as NBrandingEditorValue, N as NBrandingInput, f as NBrandingPayload, g as NBrandingProvider, h as NBrandingStateProvider, i as NBrandingStateProviderProps, j as NBrandingValue, k as buildFormFill, n as normalizeBranding, u as useNBranding, l as useNBrandingEditor } from './formFill-BcH-m9Kf.js';
|
|
26
27
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
27
28
|
import { Command as Command$1 } from 'cmdk';
|
|
28
29
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
@@ -39,11 +40,11 @@ import { ZodTypeAny, TypeOf } from 'zod';
|
|
|
39
40
|
import { SortingState, ExpandedState, ColumnDef, Row, ColumnFiltersState, VisibilityState, RowSelectionState } from '@tanstack/react-table';
|
|
40
41
|
export { N as NTableJson } from './NTableJson-tXqgfZI1.js';
|
|
41
42
|
import * as _tanstack_table_core from '@tanstack/table-core';
|
|
42
|
-
export { C as
|
|
43
|
+
export { C as CardPaginationKey, a as CardPaginationLabels, b as CardPaginationState, D as DEFAULT_CARD_PAGINATION_KEY_PREFIX, L as ListStrategy, R as ResolvedListMode, c as buildCardPaginationLabels, d as createCardPagination } from './cardPagination-Bwf3tEeN.js';
|
|
43
44
|
import { ClassValue } from 'clsx';
|
|
44
45
|
export { ApiPage, DEFAULT_MAX_PAGE_SIZE, DEFAULT_PAGE_SIZE, OffsetPage, OffsetPageFetcher, OffsetPageOptions, OffsetPagination, QueryValue, cleanQuery, createOffsetPagination, fetchOffsetPage, getPageIndex } from './pagination.js';
|
|
45
46
|
import { NajmFormatConfig } from './format.js';
|
|
46
|
-
export { DEFAULT_PLACEHOLDER, formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTime, humanizeToken } from './format.js';
|
|
47
|
+
export { DEFAULT_PLACEHOLDER, SlugifyOptions, formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTime, humanizeToken, localDateInput, slugify } from './format.js';
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* Shared so the identity is stable across renders — `NajmDesignProvider`
|
|
@@ -503,6 +504,47 @@ declare const NBadge: typeof Badge;
|
|
|
503
504
|
type NBadgeLook = BadgeDisplayLook;
|
|
504
505
|
type NBadgeProps = BadgeProps;
|
|
505
506
|
|
|
507
|
+
/**
|
|
508
|
+
* The status vocabulary every dashboard ends up retyping: lifecycle, review,
|
|
509
|
+
* fulfilment and money states mapped onto the semantic badge colors.
|
|
510
|
+
*
|
|
511
|
+
* Shipped as a default so `<NBadge status="approved" />` is already correct
|
|
512
|
+
* without a per-app table. A consumer's own `statusMap` is consulted first and
|
|
513
|
+
* merges rather than replaces, so overriding one key costs only that key.
|
|
514
|
+
*/
|
|
515
|
+
declare const NAJM_STATUS_COLORS: Record<string, BadgeColor>;
|
|
516
|
+
/**
|
|
517
|
+
* Text-only colors per badge color, for the `text`/`minimal` looks and for
|
|
518
|
+
* plain text that has to agree with a nearby badge — an amount rendered in the
|
|
519
|
+
* color of the payment it belongs to, say.
|
|
520
|
+
*
|
|
521
|
+
* `neutral` is `text-muted-foreground`, not `text-neutral-foreground`: the
|
|
522
|
+
* `-foreground` token is the contrast color *on* a solid neutral fill, so it
|
|
523
|
+
* reads as near-white in light mode and near-black in dark, and is unreadable
|
|
524
|
+
* anywhere else.
|
|
525
|
+
*/
|
|
526
|
+
declare const NAJM_COLOR_TEXT_CLASSES: Record<BadgeColor, string>;
|
|
527
|
+
/** The looked-up color, or `undefined` when nothing claims this status. */
|
|
528
|
+
declare function findStatusColor(status: string | undefined, statusMap?: Record<string, BadgeColor>): BadgeColor | undefined;
|
|
529
|
+
/**
|
|
530
|
+
* Resolves a status token to a badge color: the consumer's map first, then the
|
|
531
|
+
* built-in vocabulary, then `fallback`.
|
|
532
|
+
*
|
|
533
|
+
* The fallback is `neutral` rather than `primary` because an unrecognized
|
|
534
|
+
* status is exactly the thing that must not shout.
|
|
535
|
+
*/
|
|
536
|
+
declare function resolveStatusColor(status: string | undefined, statusMap?: Record<string, BadgeColor>, fallback?: BadgeColor): BadgeColor;
|
|
537
|
+
/** The text-only class for a badge color. */
|
|
538
|
+
declare function colorTextClass(color: BadgeColor): string;
|
|
539
|
+
/**
|
|
540
|
+
* The text-only class for a status token, for text that is *not* a badge — an
|
|
541
|
+
* amount that should carry the color of the payment beside it.
|
|
542
|
+
*
|
|
543
|
+
* An unmapped status returns `""` so the text keeps the surrounding color;
|
|
544
|
+
* pass `fallback` to color it anyway.
|
|
545
|
+
*/
|
|
546
|
+
declare function statusTextClass(status: string | undefined, statusMap?: Record<string, BadgeColor>, fallback?: BadgeColor): string;
|
|
547
|
+
|
|
506
548
|
type IndicatorVertical = "top" | "middle" | "bottom";
|
|
507
549
|
type IndicatorHorizontal = "start" | "center" | "end";
|
|
508
550
|
type IndicatorPosition = `${IndicatorVertical}-${IndicatorHorizontal}`;
|
|
@@ -2607,10 +2649,7 @@ type FormProps<T extends ZodTypeAny = ZodTypeAny> = {
|
|
|
2607
2649
|
as?: "form" | "div";
|
|
2608
2650
|
className?: string;
|
|
2609
2651
|
id?: string;
|
|
2610
|
-
devTools?:
|
|
2611
|
-
enabled?: boolean;
|
|
2612
|
-
fill?: () => Partial<TypeOf<T>>;
|
|
2613
|
-
};
|
|
2652
|
+
devTools?: FormDevTools<T>;
|
|
2614
2653
|
children: React.ReactNode;
|
|
2615
2654
|
};
|
|
2616
2655
|
|
|
@@ -2660,6 +2699,11 @@ interface UseNFormOptions<T extends ZodTypeAny> extends Omit<UseFormProps<TypeOf
|
|
|
2660
2699
|
}
|
|
2661
2700
|
declare function useNForm<T extends ZodTypeAny>(options: UseNFormOptions<T>): UseFormReturn<TypeOf<T>>;
|
|
2662
2701
|
|
|
2702
|
+
declare function FormDevToolsProvider({ children, value, }: {
|
|
2703
|
+
children: React__default.ReactNode;
|
|
2704
|
+
value?: boolean | FormDevToolsOptions;
|
|
2705
|
+
}): react_jsx_runtime.JSX.Element;
|
|
2706
|
+
|
|
2663
2707
|
interface StepConfig {
|
|
2664
2708
|
id: string;
|
|
2665
2709
|
title: string;
|
|
@@ -2700,6 +2744,7 @@ interface WizardFormProps {
|
|
|
2700
2744
|
footerSlot?: ReactNode;
|
|
2701
2745
|
footerDivider?: WizardFooterDivider;
|
|
2702
2746
|
footerDividerClassName?: string;
|
|
2747
|
+
devTools?: FormDevTools;
|
|
2703
2748
|
children?: ReactNode;
|
|
2704
2749
|
}
|
|
2705
2750
|
interface StepMeta {
|
|
@@ -2708,7 +2753,7 @@ interface StepMeta {
|
|
|
2708
2753
|
title: string;
|
|
2709
2754
|
}
|
|
2710
2755
|
|
|
2711
|
-
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;
|
|
2756
|
+
declare function WizardForm({ steps, schema, defaultValues, onSubmit, currentStep: controlledStep, onCurrentStepChange, onStepComplete, showHeader, showFooter, nextLabel, previousLabel, submitLabel, variant, bordered, className, classNames, footerSlot, footerDivider, footerDividerClassName, devTools, }: WizardFormProps): react_jsx_runtime.JSX.Element;
|
|
2712
2757
|
|
|
2713
2758
|
interface StepIndicatorProps {
|
|
2714
2759
|
stepNumber: number;
|
|
@@ -3731,6 +3776,22 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
3731
3776
|
|
|
3732
3777
|
declare function resolveSlot<T>(slot: T | ((ctx: any) => ReactNode), ctx?: any): ReactNode;
|
|
3733
3778
|
|
|
3779
|
+
/** True when `src` is absent, blank, or the seeded placeholder. */
|
|
3780
|
+
declare function isPlaceholderAvatar(src: string | null | undefined): boolean;
|
|
3781
|
+
/**
|
|
3782
|
+
* The image to render, or `fallback` when there is no real one.
|
|
3783
|
+
*
|
|
3784
|
+
* ```ts
|
|
3785
|
+
* resolveAvatarSrc(child.image, childPlaceholder(child.gender))
|
|
3786
|
+
* ```
|
|
3787
|
+
*
|
|
3788
|
+
* The fallback is a parameter rather than a package default because which stock
|
|
3789
|
+
* image belongs to a record is the application's to decide — a child, a family
|
|
3790
|
+
* and a sponsor do not share one. What is shared is the question of whether the
|
|
3791
|
+
* stored value counts as an image at all, which is all this answers.
|
|
3792
|
+
*/
|
|
3793
|
+
declare function resolveAvatarSrc<Fallback extends string | null | undefined>(src: string | null | undefined, fallback: Fallback): string | Fallback;
|
|
3794
|
+
|
|
3734
3795
|
interface NajmFormatContextValue extends Required<Pick<NajmFormatConfig, "locale" | "timeZone" | "placeholder">> {
|
|
3735
3796
|
currency?: string;
|
|
3736
3797
|
/** Formats an integer count of minor units as `currency`. */
|
|
@@ -4212,4 +4273,4 @@ interface NGridItemProps extends Omit<React$1.AllHTMLAttributes<HTMLDivElement>,
|
|
|
4212
4273
|
declare function NGrid({ as: Comp, children, cols, smCols, mdCols, lgCols, xlCols, gap, className, style, ...props }: NGridProps): react_jsx_runtime.JSX.Element;
|
|
4213
4274
|
declare function NGridItem({ children, span, smSpan, mdSpan, lgSpan, xlSpan, className, ...props }: NGridItemProps): react_jsx_runtime.JSX.Element;
|
|
4214
4275
|
|
|
4215
|
-
export { Alert, type AlertLook, type AlertOrientation, type AlertProps, type AlertSize, type AlertTone, type AlertVariant, NCard as AsyncCard, Avatar, AvatarFallback, AvatarFormInput, type AvatarFormInputProps, AvatarGroup, type AvatarGroupProps, AvatarImage, AvatarInput, type AvatarInputProps, type AvatarInputRadius, type AvatarProps$1 as AvatarProps, type AvatarShape$1 as AvatarShape, type AvatarSize, AvatarStatus, type AvatarStatusType, Badge, type BadgeColor, type BadgeIcon, type BadgeLook, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BaseInput, type BuildDefaultFileColumnsOptions, Button, type ButtonConfig, type ButtonIcon, type ButtonLoaderPosition, type ButtonProps, type ButtonRounded, type ButtonSize, type ButtonVariant, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, type CheckboxGroupInputProps, CheckboxInput, type CheckboxInputProps, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorArrayInput, type ColorArrayInputProps, type ColorFormat, ColorPickerInput, type ColorPickerInputProps, Combobox, ComboboxInput, type ComboboxInputProps, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ContextMenuItem, DEFAULT_CARD_BREAKPOINT, DEFAULT_THEME_FILE_NAME, DateInput, type DateInputProps, type DeleteDialogOptions, Dialog, type DialogActionMode, type DialogApi, DialogClose, type DialogConfig, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, type DialogHeight, DialogOverlay, type DialogPadding, DialogPortal, type DialogRenderContext, type DialogRenderer, type DialogSize, type DialogStore, DialogTitle, DialogTrigger, type DialogVariant, type DialogWidth, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray, type DynamicArrayProps, EMPTY_DESIGN, EmojiInput, type EmojiInputProps, type FileBrowserMode, FileImportButton, FileInput, type FileInputProps, type FileNode, Form, FormControl, FormDescription, FormField, FormInput, type FormInputBackground, type FormInputProps, FormItem, FormLabel, FormMessage, type FormProps, type FormSlotClassNames, type FormVariant, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, ImageInput, type ImageInputPreviewError, type ImageInputPreviewSource, type ImageInputProps, Indicator, type IndicatorHorizontal, type IndicatorOverlay, type IndicatorPosition, type IndicatorProps, type IndicatorResponsivePosition, type IndicatorSize, type IndicatorVertical, Input, type InputIcon, Label, LangInput, type LangInputProps, type LinkComponentType, MultiSelectInput, type MultiSelectInputProps, NAJM_SAVED_THEME_VALUE, NAlert, type NAppCommandItem, NAppShell, type NAppShellAction, type NAppShellClassNames, type NAppShellProps, type NAppShellUser, NCard as NAsyncCard, type CardClassNames as NAsyncCardClassNames, type CardProps as NAsyncCardProps, NAvatar, type NAvatarClassNames, type NAvatarProps, type AvatarShape as NAvatarShape, NBadge, type NBadgeLook, type NBadgeProps, NBarChart, type NBarChartProps, type NBulkAction, type NBulkActionButton, type NBulkActionSelect, NBulkActionsBar, type NBulkActionsBarProps, NButton, type NButtonProps, NCard, NCardAction, type CardClassNames as NCardClassNames, type NCardDensity, NCardFooter, NCardInfo, type NCardInfoProps, NCardMedia, type NCardMediaAspect, type NCardMediaPlacement, type NCardMediaProps, type NCardMediaSize, type NCardMediaVariant, type CardProps as NCardProps, NCardSection, type NCardSectionProps, type NCardSectionSurface, type NCartesianChartProps, type NChartCardProps, type NChartDatum, type NChartItem, type NChartSeries, type NChartSize, NChartSkeleton, type NChartSkeletonProps, type NChartSkeletonVariant, NCommandPalette, type NCommandPaletteProps, NConfirmDialog, type NConfirmDialogProps, NContextMenu, type NContextMenuItem, type NContextMenuProps, NDataCardShell, type NDataCardShellActions, type NDataCardShellProps, NDeleteDialog, NDeleteDialogContent, type NDeleteDialogContentProps, type NDeleteDialogProps, NDetailCard, type NDetailCardClassNames, type NDetailCardProps, NDetailItem, type NDetailItemProps, NDetailList, type NDetailListItem, type NDetailListProps, NDialog, type NDialogActionProps, NDialogDescription, type NDialogDescriptionProps, type NDialogDirectProps, NDialogHeader, type NDialogHeaderProps, NDialogPrimaryButton, type NDialogProps, NDialogSecondaryButton, NDonutCard, type NDonutCardClassNames, type NDonutCardItem, type NDonutCardLayout, type NDonutCardLegendMarker, type NDonutCardProps, type NDonutCardVariant, type NEditorTab, NEditorTabs, type NEditorTabsProps, NEmptyState, type NEmptyStateProps, NErrorBoundary, NErrorState, type NErrorStateProps, NFileBrowser, type NFileBrowserCardProps, type NFileBrowserProps, type NFileBrowserRenderThumbProps, NFileTypeIcon, type NFileTypeIconProps, NFilterBar, NFolderIcon, type NFolderIconProps, NForm, NFormSectionHeader, type NFormSectionHeaderProps, NGrid, type NGridCols, NGridItem, type NGridItemProps, type NGridProps, type NGridSpan, NIcon, type NIconProps, type NIconSource, NImage, type NImageProps, NIndicator, NInspectorSheet, NLineChart, type NLineChartProps, NLoadingState, type NLoadingStateProps, NMultiDialog, type NMultiDialogProps, NNavbar, NPageHeader, NPageHeaderActions, type NPageHeaderBreakpoint, NPageHeaderCompactActions, NPageHeaderFilters, type NPageHeaderProps, NPageHeaderTop, NPageLayout, type NPageLayoutProps, NPieChart, type NPieChartProps, NPortalScopeProvider, NProgress, type NProgressProps, NRowActions, NSection, NSectionHeader, type NSectionHeaderActionsProps, type NSectionHeaderContentProps, type NSectionHeaderProps, type NSectionHeaderSubtitleProps, type NSectionHeaderTitleProps, NSectionInfo, type NSectionInfoProps, type NSectionProps, NSectionWithInfo, type NSectionWithInfoItem, type NSectionWithInfoProps, NSheet, type NSheetClassNames, type NSheetProps, NSidebar, NSidebarBrand, type NSidebarBrandProps, NSidebarContent, type NSidebarContentProps, type NSidebarContextValue, NSidebarFooter, type NSidebarFooterProps, NSidebarHeader, type NSidebarHeaderProps, NSidebarItem, NSidebarMobile, type NSidebarMobileProps, NSidebarProvider, NSidebarSection, type NSidebarSectionProps, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, type NSliderProps, NSmartPasteDialog, type NSmartPasteDialogProps, NSpinner, type NSpinnerProps, NStatCard, type NStatCardClassNames, type NStatCardProps, NStatCardSkeleton, type NStatCardVariant, NStatusBreakdown, type NStatusBreakdownProps, Swap as NSwap, type NSwapProps, NTable, NTableCardPagination, NTableCardRoot, type NTableCardRootProps, NTableCards, type NTableClassNames, type NTableColumnBreakpoint, type NTableColumnDef, type NTableColumnMeta, NTableContent, NTableHeader, NTableLoadingSkeleton, type NTableMenu, type NTableMenuProp, type NTablePageItem, NTablePagination, NTablePaginationLabels, NTablePaginationVariant, type NTableProps, NTableRowSkeleton, NTableSkeleton, type NTableState, NTabs, type NTabsClassNames, type NTabsColor, type NTabsItem, type NTabsProps, type NTabsStyles, NThemeCustomizer, type NThemeCustomizerFontOption, type NThemeCustomizerLabels, type NThemeCustomizerProps, type NThemeCustomizerTab, type NThemePreset, NThemePresets, type NThemePresetsLabels, type NThemePresetsProps, type NThemePresetsStatus, NUploader, type NUploaderItem, type NUploaderItemStatus, type NUploaderProps, NViewBody, NViewToggle, NajmAccent, NajmAppearance, type NajmBorderSide, NajmComponentName, NajmComponentStyleConfig, NajmComponentThemeConfig, NajmDesignConfig, NajmDesignEditorProvider, type NajmDesignEditorProviderProps, type NajmDesignEditorValue, NajmDesignProvider, type NajmDesignProviderProps, NajmFormatConfig, type NajmFormatContextValue, NajmFormatProvider, type NajmFormatProviderProps, NajmLayoutConfig, NajmMode, NajmPreset, NajmResponsiveBreakpoint, NajmResponsiveValue, NajmScroll, type NajmScrollProps, NajmThemeConfig, NajmThemeProvider, NajmThemeProviderProps, NajmThemeTokens, NajmTypographyConfig, NajmVariantStyle, NativeSelect, type NativeSelectOption, type NativeSelectProps, type NavItem, type NavItemGroup, NumberInput, type NumberInputProps, OtpInput, type OtpInputProps, PasswordInput, type PasswordInputProps, PhoneInput, type PhoneInputProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, type ProgressColor, type ProgressLabelPosition, type ProgressProps, type ProgressSize, type PushDialogOptions, RadioGroup, RadioGroupInput, type RadioGroupInputProps, RadioGroupItem, type RenderSlot, RepeatingFields, type RepeatingFieldsProps, ScrollArea, type ScrollAreaProps, SearchField, SearchField as SearchInput, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectInput, type SelectInputProps, SelectItem, type SelectItemType$1 as SelectItemDataType, type SelectItemType, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type SidebarItemProps, type SidebarLogo, type SidebarLogoRender, type SidebarProps, type SidebarWidth, type SidebarWidths, SimpleTooltip, type SimpleTooltipProps, NSkeleton as Skeleton, Slider, SliderInput, type SliderInputProps, type SliderOrientation, type SliderProps, type SliderSize, type SliderVariant, type SmartPastePreview, type SpinnerVariant, StarRatingInput, type StarRatingInputProps, StatusPill, type StatusPillProps, type StatusPillTone, type StepConfig, StepIndicator, type StepMeta, StepsHeader, StepsProgress, type StorageMenuAction, type StorageSortOption, type StorageTarget, Swap, type SwapEffect, SwapIndeterminate, SwapOff, SwapOn, type SwapProps, type SwapSize, type SwapState, Switch, type SwitchColor, SwitchInput, type SwitchInputProps, type SwitchSize, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderColor, TableRow, type TableState, type TableStore, TableStoreContext, Tabs, TabsContent, TabsList, type TabsListProps, type TabsOrientation, type TabsProps, TabsTrigger, type TabsTriggerProps, type TabsVariant, TextAreaInput, type TextAreaInputProps, TextInput, type TextInputProps, Textarea, TimeInput, type TimeInputProps, TimeZoneInput, type TimeZoneInputProps, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseContextMenuResult, type UseNFormOptions, type UseStorageContextMenuOptions, type UseStorageContextMenuResult, type UserMenuAction, VariantProvider, type WizardClassNames, WizardForm, type WizardFormProps, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buildPageItems, buttonVariants, cn, composePreset, createDialogStore, createTableStore, defineNajmDesignConfig, defineNajmThemeConfig, detectFormat, dialogVariants, filterResponsiveColumns, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNChartColor, getNextEditorTabValue, hiddenBelowClasses, indicatorVariants, inputBorderClasses, normalizeThemeFileName, parseColor, parseNajmDesignConfig, parseNajmThemeConfig, parseThemeFile, resolveHiddenBelowClass, resolvePreset, resolveSlot, resolveVariantAlias, sidebarBorderClasses, sliderVariants, stringifyNajmDesignConfig, stringifyNajmThemeConfig, stringifyThemeFile, surfaceBorderClasses, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useCardViewport, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDesktopTableMode, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useMediaQuery, useNForm, useNPortalScope, useNSidebar, useNajmAppearance, useNajmComponentStyle, useNajmDesign, useNajmDesignEditor, useNajmFormat, useNajmFormatContext, useNajmThemeMode, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useTableStore, useVariant, useVariantPreset };
|
|
4276
|
+
export { Alert, type AlertLook, type AlertOrientation, type AlertProps, type AlertSize, type AlertTone, type AlertVariant, NCard as AsyncCard, Avatar, AvatarFallback, AvatarFormInput, type AvatarFormInputProps, AvatarGroup, type AvatarGroupProps, AvatarImage, AvatarInput, type AvatarInputProps, type AvatarInputRadius, type AvatarProps$1 as AvatarProps, type AvatarShape$1 as AvatarShape, type AvatarSize, AvatarStatus, type AvatarStatusType, Badge, type BadgeColor, type BadgeIcon, type BadgeLook, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BaseInput, type BuildDefaultFileColumnsOptions, Button, type ButtonConfig, type ButtonIcon, type ButtonLoaderPosition, type ButtonProps, type ButtonRounded, type ButtonSize, type ButtonVariant, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, type CheckboxGroupInputProps, CheckboxInput, type CheckboxInputProps, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorArrayInput, type ColorArrayInputProps, type ColorFormat, ColorPickerInput, type ColorPickerInputProps, Combobox, ComboboxInput, type ComboboxInputProps, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ContextMenuItem, DEFAULT_CARD_BREAKPOINT, DEFAULT_THEME_FILE_NAME, DateInput, type DateInputProps, type DeleteDialogOptions, Dialog, type DialogActionMode, type DialogApi, DialogClose, type DialogConfig, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, type DialogHeight, DialogOverlay, type DialogPadding, DialogPortal, type DialogRenderContext, type DialogRenderer, type DialogSize, type DialogStore, DialogTitle, DialogTrigger, type DialogVariant, type DialogWidth, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray, type DynamicArrayProps, EMPTY_DESIGN, EmojiInput, type EmojiInputProps, type FileBrowserMode, FileImportButton, FileInput, type FileInputProps, type FileNode, Form, FormControl, FormDescription, FormDevTools, FormDevToolsOptions, FormDevToolsProvider, FormField, FormInput, type FormInputBackground, type FormInputProps, FormItem, FormLabel, FormMessage, type FormProps, type FormSlotClassNames, type FormVariant, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, ImageInput, type ImageInputPreviewError, type ImageInputPreviewSource, type ImageInputProps, Indicator, type IndicatorHorizontal, type IndicatorOverlay, type IndicatorPosition, type IndicatorProps, type IndicatorResponsivePosition, type IndicatorSize, type IndicatorVertical, Input, type InputIcon, Label, LangInput, type LangInputProps, type LinkComponentType, MultiSelectInput, type MultiSelectInputProps, NAJM_COLOR_TEXT_CLASSES, NAJM_SAVED_THEME_VALUE, NAJM_STATUS_COLORS, NAlert, type NAppCommandItem, NAppShell, type NAppShellAction, type NAppShellClassNames, type NAppShellProps, type NAppShellUser, NCard as NAsyncCard, type CardClassNames as NAsyncCardClassNames, type CardProps as NAsyncCardProps, NAvatar, type NAvatarClassNames, type NAvatarProps, type AvatarShape as NAvatarShape, NBadge, type NBadgeLook, type NBadgeProps, NBarChart, type NBarChartProps, type NBulkAction, type NBulkActionButton, type NBulkActionSelect, NBulkActionsBar, type NBulkActionsBarProps, NButton, type NButtonProps, NCard, NCardAction, type CardClassNames as NCardClassNames, type NCardDensity, NCardFooter, NCardInfo, type NCardInfoProps, NCardMedia, type NCardMediaAspect, type NCardMediaPlacement, type NCardMediaProps, type NCardMediaSize, type NCardMediaVariant, type CardProps as NCardProps, NCardSection, type NCardSectionProps, type NCardSectionSurface, type NCartesianChartProps, type NChartCardProps, type NChartDatum, type NChartItem, type NChartSeries, type NChartSize, NChartSkeleton, type NChartSkeletonProps, type NChartSkeletonVariant, NCommandPalette, type NCommandPaletteProps, NConfirmDialog, type NConfirmDialogProps, NContextMenu, type NContextMenuItem, type NContextMenuProps, NDataCardShell, type NDataCardShellActions, type NDataCardShellProps, NDeleteDialog, NDeleteDialogContent, type NDeleteDialogContentProps, type NDeleteDialogProps, NDetailCard, type NDetailCardClassNames, type NDetailCardProps, NDetailItem, type NDetailItemProps, NDetailList, type NDetailListItem, type NDetailListProps, NDialog, type NDialogActionProps, NDialogDescription, type NDialogDescriptionProps, type NDialogDirectProps, NDialogHeader, type NDialogHeaderProps, NDialogPrimaryButton, type NDialogProps, NDialogSecondaryButton, NDonutCard, type NDonutCardClassNames, type NDonutCardItem, type NDonutCardLayout, type NDonutCardLegendMarker, type NDonutCardProps, type NDonutCardVariant, type NEditorTab, NEditorTabs, type NEditorTabsProps, NEmptyState, type NEmptyStateProps, NErrorBoundary, NErrorState, type NErrorStateProps, NFileBrowser, type NFileBrowserCardProps, type NFileBrowserProps, type NFileBrowserRenderThumbProps, NFileTypeIcon, type NFileTypeIconProps, NFilterBar, NFolderIcon, type NFolderIconProps, NForm, NFormSectionHeader, type NFormSectionHeaderProps, NGrid, type NGridCols, NGridItem, type NGridItemProps, type NGridProps, type NGridSpan, NIcon, type NIconProps, type NIconSource, NImage, type NImageProps, NIndicator, NInspectorSheet, NLineChart, type NLineChartProps, NLoadingState, type NLoadingStateProps, NMultiDialog, type NMultiDialogProps, NNavbar, NPageHeader, NPageHeaderActions, type NPageHeaderBreakpoint, NPageHeaderCompactActions, NPageHeaderFilters, type NPageHeaderProps, NPageHeaderTop, NPageLayout, type NPageLayoutProps, NPieChart, type NPieChartProps, NPortalScopeProvider, NProgress, type NProgressProps, NRowActions, NSection, NSectionHeader, type NSectionHeaderActionsProps, type NSectionHeaderContentProps, type NSectionHeaderProps, type NSectionHeaderSubtitleProps, type NSectionHeaderTitleProps, NSectionInfo, type NSectionInfoProps, type NSectionProps, NSectionWithInfo, type NSectionWithInfoItem, type NSectionWithInfoProps, NSheet, type NSheetClassNames, type NSheetProps, NSidebar, NSidebarBrand, type NSidebarBrandProps, NSidebarContent, type NSidebarContentProps, type NSidebarContextValue, NSidebarFooter, type NSidebarFooterProps, NSidebarHeader, type NSidebarHeaderProps, NSidebarItem, NSidebarMobile, type NSidebarMobileProps, NSidebarProvider, NSidebarSection, type NSidebarSectionProps, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, type NSliderProps, NSmartPasteDialog, type NSmartPasteDialogProps, NSpinner, type NSpinnerProps, NStatCard, type NStatCardClassNames, type NStatCardProps, NStatCardSkeleton, type NStatCardVariant, NStatusBreakdown, type NStatusBreakdownProps, Swap as NSwap, type NSwapProps, NTable, NTableCardPagination, NTableCardRoot, type NTableCardRootProps, NTableCards, type NTableClassNames, type NTableColumnBreakpoint, type NTableColumnDef, type NTableColumnMeta, NTableContent, NTableHeader, NTableLoadingSkeleton, type NTableMenu, type NTableMenuProp, type NTablePageItem, NTablePagination, NTablePaginationLabels, NTablePaginationVariant, type NTableProps, NTableRowSkeleton, NTableSkeleton, type NTableState, NTabs, type NTabsClassNames, type NTabsColor, type NTabsItem, type NTabsProps, type NTabsStyles, NThemeCustomizer, type NThemeCustomizerFontOption, type NThemeCustomizerLabels, type NThemeCustomizerProps, type NThemeCustomizerTab, type NThemePreset, NThemePresets, type NThemePresetsLabels, type NThemePresetsProps, type NThemePresetsStatus, NUploader, type NUploaderItem, type NUploaderItemStatus, type NUploaderProps, NViewBody, NViewToggle, NajmAccent, NajmAppearance, type NajmBorderSide, NajmComponentName, NajmComponentStyleConfig, NajmComponentThemeConfig, NajmDesignConfig, NajmDesignEditorProvider, type NajmDesignEditorProviderProps, type NajmDesignEditorValue, NajmDesignProvider, type NajmDesignProviderProps, NajmFormatConfig, type NajmFormatContextValue, NajmFormatProvider, type NajmFormatProviderProps, NajmLayoutConfig, NajmMode, NajmPreset, NajmResponsiveBreakpoint, NajmResponsiveValue, NajmScroll, type NajmScrollProps, NajmThemeConfig, NajmThemeProvider, NajmThemeProviderProps, NajmThemeTokens, NajmTypographyConfig, NajmVariantStyle, NativeSelect, type NativeSelectOption, type NativeSelectProps, type NavItem, type NavItemGroup, NumberInput, type NumberInputProps, OtpInput, type OtpInputProps, PasswordInput, type PasswordInputProps, PhoneInput, type PhoneInputProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, type ProgressColor, type ProgressLabelPosition, type ProgressProps, type ProgressSize, type PushDialogOptions, RadioGroup, RadioGroupInput, type RadioGroupInputProps, RadioGroupItem, type RenderSlot, RepeatingFields, type RepeatingFieldsProps, ScrollArea, type ScrollAreaProps, SearchField, SearchField as SearchInput, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectInput, type SelectInputProps, SelectItem, type SelectItemType$1 as SelectItemDataType, type SelectItemType, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type SidebarItemProps, type SidebarLogo, type SidebarLogoRender, type SidebarProps, type SidebarWidth, type SidebarWidths, SimpleTooltip, type SimpleTooltipProps, NSkeleton as Skeleton, Slider, SliderInput, type SliderInputProps, type SliderOrientation, type SliderProps, type SliderSize, type SliderVariant, type SmartPastePreview, type SpinnerVariant, StarRatingInput, type StarRatingInputProps, StatusPill, type StatusPillProps, type StatusPillTone, type StepConfig, StepIndicator, type StepMeta, StepsHeader, StepsProgress, type StorageMenuAction, type StorageSortOption, type StorageTarget, Swap, type SwapEffect, SwapIndeterminate, SwapOff, SwapOn, type SwapProps, type SwapSize, type SwapState, Switch, type SwitchColor, SwitchInput, type SwitchInputProps, type SwitchSize, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderColor, TableRow, type TableState, type TableStore, TableStoreContext, Tabs, TabsContent, TabsList, type TabsListProps, type TabsOrientation, type TabsProps, TabsTrigger, type TabsTriggerProps, type TabsVariant, TextAreaInput, type TextAreaInputProps, TextInput, type TextInputProps, Textarea, TimeInput, type TimeInputProps, TimeZoneInput, type TimeZoneInputProps, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseContextMenuResult, type UseNFormOptions, type UseStorageContextMenuOptions, type UseStorageContextMenuResult, type UserMenuAction, VariantProvider, type WizardClassNames, WizardForm, type WizardFormProps, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buildPageItems, buttonVariants, cn, colorTextClass, composePreset, createDialogStore, createTableStore, defineNajmDesignConfig, defineNajmThemeConfig, detectFormat, dialogVariants, filterResponsiveColumns, findStatusColor, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNChartColor, getNextEditorTabValue, hiddenBelowClasses, indicatorVariants, inputBorderClasses, isPlaceholderAvatar, normalizeThemeFileName, parseColor, parseNajmDesignConfig, parseNajmThemeConfig, parseThemeFile, resolveAvatarSrc, resolveHiddenBelowClass, resolvePreset, resolveSlot, resolveStatusColor, resolveVariantAlias, sidebarBorderClasses, sliderVariants, statusTextClass, stringifyNajmDesignConfig, stringifyNajmThemeConfig, stringifyThemeFile, surfaceBorderClasses, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useCardViewport, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDesktopTableMode, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useMediaQuery, useNForm, useNPortalScope, useNSidebar, useNajmAppearance, useNajmComponentStyle, useNajmDesign, useNajmDesignEditor, useNajmFormat, useNajmFormatContext, useNajmThemeMode, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useTableStore, useVariant, useVariantPreset };
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useNBranding } from './chunk-
|
|
2
|
-
export { NBrandingProvider, NBrandingStateProvider, NajmFormatProvider, normalizeBranding, useNBranding, useNBrandingEditor, useNajmFormat, useNajmFormatContext } from './chunk-
|
|
1
|
+
import { useResolvedFormDevTools, useNBranding } from './chunk-GHMR45H3.mjs';
|
|
2
|
+
export { FormDevToolsProvider, NBrandingProvider, NBrandingStateProvider, NajmFormatProvider, buildFormFill, normalizeBranding, useNBranding, useNBrandingEditor, useNajmFormat, useNajmFormatContext } from './chunk-GHMR45H3.mjs';
|
|
3
3
|
import { useResolvedPaginationLabels } from './chunk-USZUOJMK.mjs';
|
|
4
4
|
export { DEFAULT_PAGINATION_KEY_PREFIX, DEFAULT_TIME_ZONE, EMPTY_DESIGN, NTableDefaultsProvider, NajmDesignEditorProvider, NajmPreferencesProvider, NajmUIProvider, buildPaginationLabels, useNTableDefaults, useNajmDesignEditor, useNajmPreferencesContext, useNajmTheme, useNajmTimeZone } from './chunk-USZUOJMK.mjs';
|
|
5
5
|
import { resolveRadiusValue, inputBorderClasses, Button, NIcon, NajmScroll, surfaceBorderClasses, useNajmScrollViewport, resolveVariantAlias, buttonVariants, NButton, parseNajmDesignConfig, useTableStore, TableStoreContext, sidebarBorderClasses, NTableJson } from './chunk-6OOBAEH2.mjs';
|
|
6
6
|
export { Button, NAJM_COMPONENT_NAMES, NButton, NIcon, NTableJson, NajmScroll, RADIUS_VALUE_MAP, TableStoreContext, buttonVariants, defineNajmDesignConfig, defineNajmThemeConfig, inputBorderClasses, parseNajmDesignConfig, parseNajmThemeConfig, resolveRadiusValue, resolveVariantAlias, sidebarBorderClasses, stringifyNajmDesignConfig, stringifyNajmThemeConfig, surfaceBorderClasses, useTableStore } from './chunk-6OOBAEH2.mjs';
|
|
7
7
|
import { useNajmComponentStyle, cn, NajmThemeContainerCtx, useNajmThemeMode, useNajmDesign, composePreset } from './chunk-KVZACF4G.mjs';
|
|
8
8
|
export { NajmDesignProvider, NajmThemeProvider, cn, composePreset, resolvePreset, useNajmAppearance, useNajmComponentStyle, useNajmDesign, useNajmThemeMode } from './chunk-KVZACF4G.mjs';
|
|
9
|
-
export { DEFAULT_CARD_BREAKPOINT, DEFAULT_CARD_PAGINATION_KEY_PREFIX, buildCardPaginationLabels, createCardPagination, useCardViewport, useDesktopTableMode, useMediaQuery } from './chunk-
|
|
9
|
+
export { DEFAULT_CARD_BREAKPOINT, DEFAULT_CARD_PAGINATION_KEY_PREFIX, buildCardPaginationLabels, createCardPagination, useCardViewport, useDesktopTableMode, useMediaQuery } from './chunk-OUS7OYVA.mjs';
|
|
10
10
|
import './chunk-F5KXJCCJ.mjs';
|
|
11
|
-
|
|
11
|
+
import { humanizeToken } from './chunk-JABLSOQN.mjs';
|
|
12
|
+
export { DEFAULT_PLACEHOLDER, formatCurrency, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTime, humanizeToken, localDateInput, slugify } from './chunk-JABLSOQN.mjs';
|
|
12
13
|
export { DEFAULT_MAX_PAGE_SIZE, DEFAULT_PAGE_SIZE, cleanQuery, createOffsetPagination, fetchOffsetPage, getPageIndex } from './chunk-2NX2VKS2.mjs';
|
|
13
14
|
import * as React60 from 'react';
|
|
14
15
|
import React60__default, { createContext, useRef, useMemo, useState, useEffect, useContext, useCallback, useLayoutEffect, isValidElement } from 'react';
|
|
@@ -2403,6 +2404,77 @@ function Checkbox({ className, ...props }) {
|
|
|
2403
2404
|
}
|
|
2404
2405
|
);
|
|
2405
2406
|
}
|
|
2407
|
+
|
|
2408
|
+
// src/components/Badge/status.ts
|
|
2409
|
+
var NAJM_STATUS_COLORS = {
|
|
2410
|
+
active: "success",
|
|
2411
|
+
approved: "success",
|
|
2412
|
+
completed: "success",
|
|
2413
|
+
confirmed: "success",
|
|
2414
|
+
delivered: "success",
|
|
2415
|
+
paid: "success",
|
|
2416
|
+
published: "success",
|
|
2417
|
+
succeeded: "success",
|
|
2418
|
+
validated: "success",
|
|
2419
|
+
verified: "success",
|
|
2420
|
+
in_preparation: "warning",
|
|
2421
|
+
in_progress: "warning",
|
|
2422
|
+
out_for_delivery: "warning",
|
|
2423
|
+
pending: "warning",
|
|
2424
|
+
pending_email_verification: "warning",
|
|
2425
|
+
pending_review: "warning",
|
|
2426
|
+
processing: "warning",
|
|
2427
|
+
submitted: "warning",
|
|
2428
|
+
paused: "info",
|
|
2429
|
+
purchased: "info",
|
|
2430
|
+
scheduled: "info",
|
|
2431
|
+
archived: "neutral",
|
|
2432
|
+
cancelled: "neutral",
|
|
2433
|
+
canceled: "neutral",
|
|
2434
|
+
closed: "neutral",
|
|
2435
|
+
draft: "neutral",
|
|
2436
|
+
inactive: "neutral",
|
|
2437
|
+
stopped: "neutral",
|
|
2438
|
+
unknown: "neutral",
|
|
2439
|
+
blocked: "destructive",
|
|
2440
|
+
expired: "destructive",
|
|
2441
|
+
failed: "destructive",
|
|
2442
|
+
refunded: "destructive",
|
|
2443
|
+
rejected: "destructive",
|
|
2444
|
+
suspended: "destructive"
|
|
2445
|
+
};
|
|
2446
|
+
var NAJM_COLOR_TEXT_CLASSES = {
|
|
2447
|
+
primary: "text-primary",
|
|
2448
|
+
secondary: "text-secondary-foreground",
|
|
2449
|
+
accent: "text-accent-foreground",
|
|
2450
|
+
neutral: "text-muted-foreground",
|
|
2451
|
+
info: "text-info",
|
|
2452
|
+
success: "text-success",
|
|
2453
|
+
warning: "text-warning",
|
|
2454
|
+
destructive: "text-destructive"
|
|
2455
|
+
};
|
|
2456
|
+
function normalizeStatus(status) {
|
|
2457
|
+
return status.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
2458
|
+
}
|
|
2459
|
+
function lookup(map, status, normalized) {
|
|
2460
|
+
if (!map) return void 0;
|
|
2461
|
+
return map[status] ?? map[normalized];
|
|
2462
|
+
}
|
|
2463
|
+
function findStatusColor(status, statusMap) {
|
|
2464
|
+
if (!status) return void 0;
|
|
2465
|
+
const normalized = normalizeStatus(status);
|
|
2466
|
+
return lookup(statusMap, status, normalized) ?? lookup(NAJM_STATUS_COLORS, status, normalized);
|
|
2467
|
+
}
|
|
2468
|
+
function resolveStatusColor(status, statusMap, fallback = "neutral") {
|
|
2469
|
+
return findStatusColor(status, statusMap) ?? fallback;
|
|
2470
|
+
}
|
|
2471
|
+
function colorTextClass(color) {
|
|
2472
|
+
return NAJM_COLOR_TEXT_CLASSES[color] ?? "text-foreground";
|
|
2473
|
+
}
|
|
2474
|
+
function statusTextClass(status, statusMap, fallback) {
|
|
2475
|
+
const color = findStatusColor(status, statusMap) ?? fallback;
|
|
2476
|
+
return color ? colorTextClass(color) : "";
|
|
2477
|
+
}
|
|
2406
2478
|
var badgeVariants = cva(
|
|
2407
2479
|
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
2408
2480
|
{
|
|
@@ -2461,8 +2533,11 @@ var badgeColorVariants = cva(
|
|
|
2461
2533
|
{ color: "accent", look: "soft", class: "bg-accent/10 text-accent-foreground border-accent/30" },
|
|
2462
2534
|
{ color: "accent", look: ["outline", "dash"], class: "text-accent-foreground border-accent/40" },
|
|
2463
2535
|
{ color: "neutral", look: "solid", class: "bg-neutral text-neutral-foreground" },
|
|
2464
|
-
|
|
2465
|
-
|
|
2536
|
+
// Not `text-neutral-foreground`: that token is the contrast color on a
|
|
2537
|
+
// solid neutral fill, so on a tinted or transparent one it inverts with
|
|
2538
|
+
// the theme and disappears.
|
|
2539
|
+
{ color: "neutral", look: "soft", class: "bg-neutral/10 text-muted-foreground border-neutral/30" },
|
|
2540
|
+
{ color: "neutral", look: ["outline", "dash"], class: "text-muted-foreground border-neutral/40" },
|
|
2466
2541
|
{ color: "info", look: "solid", class: "bg-info text-info-foreground" },
|
|
2467
2542
|
{ color: "info", look: "soft", class: "bg-info/10 text-info border-info/20" },
|
|
2468
2543
|
{ color: "info", look: ["outline", "dash"], class: "text-info border-info/60" },
|
|
@@ -2479,14 +2554,6 @@ var badgeColorVariants = cva(
|
|
|
2479
2554
|
defaultVariants: { color: "primary", look: "solid", size: "md", shape: "default" }
|
|
2480
2555
|
}
|
|
2481
2556
|
);
|
|
2482
|
-
var COLOR_TEXT_MAP = {
|
|
2483
|
-
success: "text-success",
|
|
2484
|
-
warning: "text-warning",
|
|
2485
|
-
accent: "text-accent-foreground",
|
|
2486
|
-
info: "text-info",
|
|
2487
|
-
neutral: "text-neutral-foreground",
|
|
2488
|
-
destructive: "text-destructive"
|
|
2489
|
-
};
|
|
2490
2557
|
var SIZE_TEXT_MAP = {
|
|
2491
2558
|
sm: "text-xs",
|
|
2492
2559
|
md: "text-sm",
|
|
@@ -2524,14 +2591,14 @@ function Badge({
|
|
|
2524
2591
|
const effVariant = variant ?? aliased.variant ?? recipe?.defaultVariant;
|
|
2525
2592
|
const recipeRadius = shape === void 0 ? resolveRadiusValue(recipe?.radius) : void 0;
|
|
2526
2593
|
const recipeStyle = recipeRadius ? { borderRadius: recipeRadius, ...style } : style;
|
|
2527
|
-
const resolvedColor =
|
|
2528
|
-
const resolvedLabel = label ?? (typeof children === "string" ? children : void 0) ?? status;
|
|
2594
|
+
const resolvedColor = status ? resolveStatusColor(status, statusMap, color ?? "neutral") : color ?? "primary";
|
|
2595
|
+
const resolvedLabel = label ?? (typeof children === "string" ? children : void 0) ?? (status ? humanizeToken(status) : void 0);
|
|
2529
2596
|
const content = typeof children !== "string" && children ? children : resolvedLabel ?? children;
|
|
2530
2597
|
const resolvedIcon = icon ?? (resolvedColor ? iconMap?.[resolvedColor] : void 0);
|
|
2531
2598
|
const iconNode = renderIcon(showIcon ? resolvedIcon : icon);
|
|
2532
2599
|
const isMinimal = look === "minimal" || look === "text";
|
|
2533
2600
|
if (isMinimal) {
|
|
2534
|
-
const textColor =
|
|
2601
|
+
const textColor = colorTextClass(resolvedColor);
|
|
2535
2602
|
const sizeClass = SIZE_TEXT_MAP[size ?? "md"] ?? "text-sm";
|
|
2536
2603
|
return /* @__PURE__ */ jsxs(
|
|
2537
2604
|
Comp,
|
|
@@ -8281,6 +8348,17 @@ function NSkeletonWidget() {
|
|
|
8281
8348
|
function NSkeletonWidgets({ count = 5 }) {
|
|
8282
8349
|
return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-3", children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx(NSkeletonWidget, {}, i)) });
|
|
8283
8350
|
}
|
|
8351
|
+
|
|
8352
|
+
// src/lib/avatar.ts
|
|
8353
|
+
var PLACEHOLDER_AVATAR = /(^|\/)noavatar\.png(?:$|[?#])/i;
|
|
8354
|
+
function isPlaceholderAvatar(src) {
|
|
8355
|
+
const trimmed = src?.trim() ?? "";
|
|
8356
|
+
return !trimmed || PLACEHOLDER_AVATAR.test(trimmed);
|
|
8357
|
+
}
|
|
8358
|
+
function resolveAvatarSrc(src, fallback) {
|
|
8359
|
+
const trimmed = src?.trim() ?? "";
|
|
8360
|
+
return trimmed && !PLACEHOLDER_AVATAR.test(trimmed) ? trimmed : fallback;
|
|
8361
|
+
}
|
|
8284
8362
|
var AVATAR_COLORS = [
|
|
8285
8363
|
["#3b82f6", "#1d4ed8"],
|
|
8286
8364
|
["#8b5cf6", "#6d28d9"],
|
|
@@ -8322,9 +8400,6 @@ function nameToColor(name) {
|
|
|
8322
8400
|
function getInitials(name) {
|
|
8323
8401
|
return name.split(" ").map((part) => part.charAt(0)).join("").toUpperCase().slice(0, 2);
|
|
8324
8402
|
}
|
|
8325
|
-
function shouldUseSrc(src) {
|
|
8326
|
-
return Boolean(src && src !== "noavatar.png");
|
|
8327
|
-
}
|
|
8328
8403
|
function withVersion(src, version) {
|
|
8329
8404
|
if (!version || src.startsWith("data:") || src.startsWith("blob:")) return src;
|
|
8330
8405
|
const separator = src.includes("?") ? "&" : "?";
|
|
@@ -8347,7 +8422,8 @@ function NAvatar({
|
|
|
8347
8422
|
}) {
|
|
8348
8423
|
const label = title || fallback || "";
|
|
8349
8424
|
const imageVersion = srcVersion ?? version;
|
|
8350
|
-
const
|
|
8425
|
+
const resolvedSrc = resolveAvatarSrc(src, void 0);
|
|
8426
|
+
const imageSrc = resolvedSrc ? withVersion(resolvedSrc, imageVersion) : fallbackSrc;
|
|
8351
8427
|
const { bg, text } = nameToColor(label);
|
|
8352
8428
|
const hasText = Boolean(title || subtitle || meta);
|
|
8353
8429
|
const fallbackText = fallback && !title ? fallback : label ? getInitials(label) : "?";
|
|
@@ -10555,6 +10631,7 @@ var useVariant = () => useContext(VariantContext).variant;
|
|
|
10555
10631
|
var useBordered = () => useContext(VariantContext).bordered;
|
|
10556
10632
|
var useVariantPreset = () => VARIANT_PRESETS[useContext(VariantContext).variant];
|
|
10557
10633
|
function NFormInner({ schema, defaultValues, onSubmit, form: externalForm, variant = "default", bordered, as = "form", className = "", id, devTools, children }) {
|
|
10634
|
+
const resolvedDevTools = useResolvedFormDevTools(schema, devTools);
|
|
10558
10635
|
const resolver = useMemo(() => schema ? zodResolver(schema) : void 0, [schema]);
|
|
10559
10636
|
const internalForm = useForm({
|
|
10560
10637
|
resolver,
|
|
@@ -10562,21 +10639,21 @@ function NFormInner({ schema, defaultValues, onSubmit, form: externalForm, varia
|
|
|
10562
10639
|
});
|
|
10563
10640
|
const form = externalForm ?? internalForm;
|
|
10564
10641
|
const handleFill = useCallback(() => {
|
|
10565
|
-
if (
|
|
10566
|
-
form.reset(
|
|
10642
|
+
if (resolvedDevTools.fill) {
|
|
10643
|
+
form.reset(resolvedDevTools.fill());
|
|
10567
10644
|
}
|
|
10568
|
-
}, [
|
|
10645
|
+
}, [resolvedDevTools.fill, form]);
|
|
10569
10646
|
useEffect(() => {
|
|
10570
|
-
if (!
|
|
10647
|
+
if (!resolvedDevTools.enabled || !resolvedDevTools.fill) return;
|
|
10571
10648
|
const handler = (e) => {
|
|
10572
|
-
if (e.key ===
|
|
10649
|
+
if (e.key === resolvedDevTools.shortcut) {
|
|
10573
10650
|
e.preventDefault();
|
|
10574
10651
|
handleFill();
|
|
10575
10652
|
}
|
|
10576
10653
|
};
|
|
10577
10654
|
document.addEventListener("keydown", handler);
|
|
10578
10655
|
return () => document.removeEventListener("keydown", handler);
|
|
10579
|
-
}, [
|
|
10656
|
+
}, [resolvedDevTools.enabled, resolvedDevTools.fill, resolvedDevTools.shortcut, handleFill]);
|
|
10580
10657
|
useEffect(() => {
|
|
10581
10658
|
const proc = globalThis.process;
|
|
10582
10659
|
if (proc?.env?.NODE_ENV !== "development") return;
|
|
@@ -11054,8 +11131,10 @@ function WizardForm({
|
|
|
11054
11131
|
classNames,
|
|
11055
11132
|
footerSlot,
|
|
11056
11133
|
footerDivider = "none",
|
|
11057
|
-
footerDividerClassName
|
|
11134
|
+
footerDividerClassName,
|
|
11135
|
+
devTools
|
|
11058
11136
|
}) {
|
|
11137
|
+
const resolvedDevTools = useResolvedFormDevTools(schema, devTools);
|
|
11059
11138
|
const nav = useStepNavigation({
|
|
11060
11139
|
steps,
|
|
11061
11140
|
currentStep: controlledStep,
|
|
@@ -11095,6 +11174,36 @@ function WizardForm({
|
|
|
11095
11174
|
resolver: stepSchema ? zodResolver(stepSchema) : void 0,
|
|
11096
11175
|
defaultValues: stepDefaults
|
|
11097
11176
|
});
|
|
11177
|
+
const fillWizard = useCallback(() => {
|
|
11178
|
+
if (!resolvedDevTools.fill) return;
|
|
11179
|
+
const values = {
|
|
11180
|
+
...defaultValues ?? {},
|
|
11181
|
+
...resolvedDevTools.fill()
|
|
11182
|
+
};
|
|
11183
|
+
formDataRef.current = values;
|
|
11184
|
+
pendingIssuesRef.current = null;
|
|
11185
|
+
nav.reset();
|
|
11186
|
+
const firstStep = steps[0];
|
|
11187
|
+
const firstValues = firstStep?.fields ? Object.fromEntries(
|
|
11188
|
+
firstStep.fields.filter((field) => field in values).map((field) => [field, values[field]])
|
|
11189
|
+
) : values;
|
|
11190
|
+
form.reset(firstValues);
|
|
11191
|
+
}, [defaultValues, form, formDataRef, nav, resolvedDevTools.fill, steps]);
|
|
11192
|
+
useEffect(() => {
|
|
11193
|
+
if (!resolvedDevTools.enabled || !resolvedDevTools.fill) return;
|
|
11194
|
+
const handler = (event) => {
|
|
11195
|
+
if (event.key !== resolvedDevTools.shortcut) return;
|
|
11196
|
+
event.preventDefault();
|
|
11197
|
+
fillWizard();
|
|
11198
|
+
};
|
|
11199
|
+
document.addEventListener("keydown", handler);
|
|
11200
|
+
return () => document.removeEventListener("keydown", handler);
|
|
11201
|
+
}, [
|
|
11202
|
+
fillWizard,
|
|
11203
|
+
resolvedDevTools.enabled,
|
|
11204
|
+
resolvedDevTools.fill,
|
|
11205
|
+
resolvedDevTools.shortcut
|
|
11206
|
+
]);
|
|
11098
11207
|
useEffect(() => {
|
|
11099
11208
|
const newDefaults = getStepDefaultValues(currentStepConfig.id);
|
|
11100
11209
|
form.reset(newDefaults);
|
|
@@ -15173,4 +15282,4 @@ function NGridItem({
|
|
|
15173
15282
|
return /* @__PURE__ */ jsx("div", { className: itemClassName, ...props, children });
|
|
15174
15283
|
}
|
|
15175
15284
|
|
|
15176
|
-
export { Alert, NCard as AsyncCard, Avatar, AvatarFallback, AvatarFormInput, AvatarGroup, AvatarImage, AvatarInput, AvatarStatus, Badge, BaseInput, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, CheckboxInput, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorArrayInput, ColorPickerInput, Combobox, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_THEME_FILE_NAME, DateInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray_default as DynamicArray, EmojiInput, FileImportButton, FileInput, Form, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, IconButton, ImageInput, Indicator4 as Indicator, Input, Label2 as Label, LangInput, MultiSelectInput, NAJM_SAVED_THEME_VALUE, NAlert, NAppShell, NCard as NAsyncCard, NAvatar, NBadge, NBarChart, NBulkActionsBar, NCard, NCardAction, NCardFooter, NCardInfo, NCardMedia, NCardSection, NChartSkeleton, NCommandPalette, NConfirmDialog, NContextMenu, NDataCardShell, NDeleteDialog, NDeleteDialogContent, NDetailCard, NDetailItem, NDetailList, NDialog, NDialogDescription, NDialogHeader, NDialogPrimaryButton, NDialogSecondaryButton, NDonutCard, NEditorTabs, NEmptyState, NErrorBoundary, NErrorState, NFileBrowser, NFileTypeIcon, NFilterBar, NFolderIcon, NForm, NFormSectionHeader, NGrid, NGridItem, NImage, NIndicator, NInspectorSheet, NLineChart, NLoadingState, NMultiDialog, NNavbar, NPageHeader, NPageHeaderActions, NPageHeaderCompactActions, NPageHeaderFilters, NPageHeaderTop, NPageLayout, NPieChart, NPortalScopeProvider, NProgress, NRowActions, NSection, NSectionHeader, NSectionInfo, NSectionWithInfo, NSheet, NSidebar, NSidebarBrand, NSidebarContent, NSidebarFooter, NSidebarHeader, NSidebarItem, NSidebarMobile, NSidebarProvider, NSidebarSection, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, NSmartPasteDialog, NSpinner, NStatCard, NStatCardSkeleton, NStatusBreakdown, Swap as NSwap, NTable, NTableCardRoot, NTableCards, NTableContent, NTableHeader, NTableLoadingSkeleton, NTablePagination, NTableRowSkeleton, NTableSkeleton, NTabs, NThemeCustomizer, NThemePresets, NUploader, NViewBody, NViewToggle, NativeSelect, NumberInput, OtpInput, PasswordInput, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, RadioGroup, RadioGroupInput, RadioGroupItem, RepeatingFields, ScrollArea, SearchField, SearchField as SearchInput, SegmentedControl, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTooltip, NSkeleton as Skeleton, Slider, SliderInput, StarRatingInput, StatusPill, StepIndicator, StepsHeader, StepsProgress, Swap, SwapIndeterminate, SwapOff, SwapOn, Switch, SwitchInput, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TextAreaInput, TextInput, Textarea, TimeInput, TimeZoneInput, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VariantProvider, WizardForm, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buildPageItems, createDialogStore, createTableStore, detectFormat, dialogVariants, filterResponsiveColumns, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNChartColor, getNextEditorTabValue, hiddenBelowClasses, indicatorVariants, normalizeThemeFileName, parseColor, parseThemeFile, resolveHiddenBelowClass, resolveSlot, sliderVariants, stringifyThemeFile, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useNForm, useNPortalScope, useNSidebar, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useVariant, useVariantPreset };
|
|
15285
|
+
export { Alert, NCard as AsyncCard, Avatar, AvatarFallback, AvatarFormInput, AvatarGroup, AvatarImage, AvatarInput, AvatarStatus, Badge, BaseInput, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroupInput, CheckboxInput, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorArrayInput, ColorPickerInput, Combobox, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_THEME_FILE_NAME, DateInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicArray_default as DynamicArray, EmojiInput, FileImportButton, FileInput, Form, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, IconButton, ImageInput, Indicator4 as Indicator, Input, Label2 as Label, LangInput, MultiSelectInput, NAJM_COLOR_TEXT_CLASSES, NAJM_SAVED_THEME_VALUE, NAJM_STATUS_COLORS, NAlert, NAppShell, NCard as NAsyncCard, NAvatar, NBadge, NBarChart, NBulkActionsBar, NCard, NCardAction, NCardFooter, NCardInfo, NCardMedia, NCardSection, NChartSkeleton, NCommandPalette, NConfirmDialog, NContextMenu, NDataCardShell, NDeleteDialog, NDeleteDialogContent, NDetailCard, NDetailItem, NDetailList, NDialog, NDialogDescription, NDialogHeader, NDialogPrimaryButton, NDialogSecondaryButton, NDonutCard, NEditorTabs, NEmptyState, NErrorBoundary, NErrorState, NFileBrowser, NFileTypeIcon, NFilterBar, NFolderIcon, NForm, NFormSectionHeader, NGrid, NGridItem, NImage, NIndicator, NInspectorSheet, NLineChart, NLoadingState, NMultiDialog, NNavbar, NPageHeader, NPageHeaderActions, NPageHeaderCompactActions, NPageHeaderFilters, NPageHeaderTop, NPageLayout, NPieChart, NPortalScopeProvider, NProgress, NRowActions, NSection, NSectionHeader, NSectionInfo, NSectionWithInfo, NSheet, NSidebar, NSidebarBrand, NSidebarContent, NSidebarFooter, NSidebarHeader, NSidebarItem, NSidebarMobile, NSidebarProvider, NSidebarSection, NSkeleton, NSkeletonCalendar, NSkeletonChart, NSkeletonDonut, NSkeletonEventList, NSkeletonWidget, NSkeletonWidgets, NSlider, NSmartPasteDialog, NSpinner, NStatCard, NStatCardSkeleton, NStatusBreakdown, Swap as NSwap, NTable, NTableCardRoot, NTableCards, NTableContent, NTableHeader, NTableLoadingSkeleton, NTablePagination, NTableRowSkeleton, NTableSkeleton, NTabs, NThemeCustomizer, NThemePresets, NUploader, NViewBody, NViewToggle, NativeSelect, NumberInput, OtpInput, PasswordInput, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PrefixProvider, Progress, RadioGroup, RadioGroupInput, RadioGroupItem, RepeatingFields, ScrollArea, SearchField, SearchField as SearchInput, SegmentedControl, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTooltip, NSkeleton as Skeleton, Slider, SliderInput, StarRatingInput, StatusPill, StepIndicator, StepsHeader, StepsProgress, Swap, SwapIndeterminate, SwapOff, SwapOn, Switch, SwitchInput, TAB_COLORS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TextAreaInput, TextInput, Textarea, TimeInput, TimeZoneInput, Toaster, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VariantProvider, WizardForm, alertVariants, avatarVariants, badgeColorVariants, badgeVariants, buildDefaultFileColumns, buildPageItems, colorTextClass, createDialogStore, createTableStore, detectFormat, dialogVariants, filterResponsiveColumns, findStatusColor, formatColor, formatFileBytes, formatFileRelative, getIconColorProps, getNChartColor, getNextEditorTabValue, hiddenBelowClasses, indicatorVariants, isPlaceholderAvatar, normalizeThemeFileName, parseColor, parseThemeFile, resolveAvatarSrc, resolveHiddenBelowClass, resolveSlot, resolveStatusColor, sliderVariants, statusTextClass, stringifyThemeFile, swapVariants, toPickerHex, toggleVariants, tooltipContentVariants, truncateByCharacters, useClickOutside, useContextMenu, useDebouncedValue, useDelayedLoading, useDialog, useDialogStore, useDynamicPageSize, useFormField, useFormSubmission, useInfiniteScroll, useKeyboard, useLocalStorageState, useNForm, useNPortalScope, useNSidebar, usePrefix, useSelection, useStepNavigation, useStorageContextMenu, useStoreSync, useTable, useTableKeyboard, useVariant, useVariantPreset };
|
|
@@ -122,8 +122,15 @@ type NTableCardPagination = {
|
|
|
122
122
|
* depends on no `najm-*` package, and this signature is satisfied by every
|
|
123
123
|
* mainstream i18n library. The application keeps its catalog and its own
|
|
124
124
|
* language provider.
|
|
125
|
+
*
|
|
126
|
+
* `Key` narrows the accepted keys. It exists for the application that types its
|
|
127
|
+
* translator to a generated union of its catalog — such a `t` is *not*
|
|
128
|
+
* assignable to `NajmTranslate<string>`, since a parameter position accepting
|
|
129
|
+
* fewer values is the wrong way round. Builders below name the exact keys they
|
|
130
|
+
* pass, so a narrow translator satisfies them without a cast and the keys stay
|
|
131
|
+
* checked against the catalog.
|
|
125
132
|
*/
|
|
126
|
-
type NajmTranslate = (key:
|
|
133
|
+
type NajmTranslate<Key extends string = string> = (key: Key, params?: Record<string, string | number>) => string;
|
|
127
134
|
declare const DEFAULT_PAGINATION_KEY_PREFIX = "common.pagination";
|
|
128
135
|
/**
|
|
129
136
|
* Projects a translator onto the ten pagination labels.
|