najm-kit 2.11.11 → 2.11.13
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 +26 -16
- package/README.md +34 -1
- package/dist/{NNotFoundState-D1CLLLxc.d.ts → NNotFoundState-CgU76llk.d.ts} +8 -8
- package/dist/NTableJson-BHXwRVvL.d.ts +5 -0
- package/dist/{NajmUIProvider-cNCb8Tpn.d.ts → NajmUIProvider-DTyRrukg.d.ts} +110 -8
- package/dist/adapters/app.d.ts +17 -6
- package/dist/adapters/app.mjs +8 -4
- package/dist/adapters/next.d.ts +3 -4
- package/dist/adapters/next.mjs +2 -2
- package/dist/{chunk-W2HMBUZ4.mjs → chunk-26EASWUY.mjs} +1 -1
- package/dist/{chunk-6UDJNTJ6.mjs → chunk-BDQK6ECA.mjs} +157 -94
- package/dist/{chunk-T6RL7TSQ.mjs → chunk-DKHIQFXX.mjs} +1 -1
- package/dist/index.d.ts +269 -252
- package/dist/index.mjs +58 -33
- package/dist/json.d.ts +3 -4
- package/dist/theme.css +5 -5
- package/package.json +3 -2
- package/dist/NTableJson-tXqgfZI1.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 2.11.
|
|
4
|
-
|
|
5
|
-
- Fixed the
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.11.13 - 2026-09-04
|
|
4
|
+
|
|
5
|
+
- Fixed the documented `common.feedback.<field>` convention so all shared
|
|
6
|
+
loading, empty, error, forbidden, and not-found states resolve localized
|
|
7
|
+
labels without an application-owned `feedbackDefaults` key map. Missing
|
|
8
|
+
convention keys still fall back to the packaged English labels.
|
|
9
|
+
- Forwarded Najm i18n's missing-key fallback and language-direction resolver
|
|
10
|
+
through `NajmAppProvider`, keeping language changes reactive for partial
|
|
11
|
+
catalogs and non-Arabic RTL languages.
|
|
12
|
+
|
|
13
|
+
## 2.11.10 - 2026-09-03
|
|
14
|
+
|
|
15
|
+
- Fixed the selected numbered `NTable` pagination button inheriting the regular
|
|
16
|
+
foreground colour over its filled primary style. The active page now keeps
|
|
17
|
+
the primary button foreground token, which is white in the light theme.
|
|
18
|
+
- Fixed focused invalid inputs combining a destructive border with the normal
|
|
19
|
+
theme focus colour. `BaseInput` now keeps the visible keyboard-focus ring but
|
|
20
|
+
colours it from the destructive token for both directly focused composite
|
|
21
|
+
controls and wrappers whose child has `:focus-visible`.
|
|
22
|
+
- Made the desktop and mobile sidebar use logical inline edges, spacing, border
|
|
23
|
+
utilities, chevrons, and drag direction so the complete rail behaves
|
|
24
|
+
correctly in both LTR and RTL layouts.
|
|
25
|
+
|
|
26
|
+
## 2.11.9 - 2026-08-30
|
|
17
27
|
|
|
18
28
|
- Fixed card grids that paginate client-side rendering their entire dataset on
|
|
19
29
|
one page. `useTable` pinned an uncontrolled paged card list to `data.length`,
|
package/README.md
CHANGED
|
@@ -352,7 +352,40 @@ Resolution order, most specific first:
|
|
|
352
352
|
2. A literal in `feedbackDefaults.labels`.
|
|
353
353
|
3. A translated `feedbackDefaults.labelKeys` value resolved through the
|
|
354
354
|
provider's existing structural `t` function.
|
|
355
|
-
4.
|
|
355
|
+
4. `` `<prefix>.<field>` `` resolved through the same `t`, where `prefix`
|
|
356
|
+
defaults to `common.feedback`.
|
|
357
|
+
5. The current packaged English fallback, when that field has one.
|
|
358
|
+
|
|
359
|
+
#### The prefix convention
|
|
360
|
+
|
|
361
|
+
Step 4 is the reason most applications need no `feedbackDefaults` at all. Name
|
|
362
|
+
the nine catalog entries after the fields — `common.feedback.emptyTitle`,
|
|
363
|
+
`common.feedback.retryLabel`, and so on — and a provider that already has a
|
|
364
|
+
translator resolves every feedback state with no mapping object to write or
|
|
365
|
+
memoize:
|
|
366
|
+
|
|
367
|
+
```tsx
|
|
368
|
+
<NajmAppProvider translations={translations} initialLanguage="fr">
|
|
369
|
+
<App />
|
|
370
|
+
</NajmAppProvider>
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
Use `prefix` to point at a different branch, and `FeedbackKey<Prefix>` to type
|
|
374
|
+
a translator against exactly those nine keys:
|
|
375
|
+
|
|
376
|
+
```tsx
|
|
377
|
+
import type { FeedbackKey } from 'najm-kit';
|
|
378
|
+
|
|
379
|
+
<NajmAppProvider feedbackDefaults={{ prefix: 'app.states' }}>
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Unlike `buildToolbarLabels` and `buildPaginationLabels`, a translator result
|
|
383
|
+
equal to the key it was handed is treated as *missing* here rather than
|
|
384
|
+
rendered. The prefix is a convention an application may never have adopted, so
|
|
385
|
+
an unanswered key falls through to packaged English instead of painting
|
|
386
|
+
`common.feedback.emptyTitle` across an empty state. The same rule applies to an
|
|
387
|
+
explicit `labelKeys` entry, which makes a typo in the mapping degrade to English
|
|
388
|
+
rather than to visible key text.
|
|
356
389
|
|
|
357
390
|
Generic `NErrorState.message` and `NEmptyState.description` deliberately have
|
|
358
391
|
no packaged fallback — the no-provider render must look the same as it did
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
3
|
import { ZodTypeAny, TypeOf } from 'zod';
|
|
4
4
|
import { LucideIcon } from 'lucide-react';
|
|
@@ -49,7 +49,7 @@ declare function useNBranding(): NBrandingValue | null;
|
|
|
49
49
|
*/
|
|
50
50
|
declare function NBrandingProvider({ children, appName, logoExpanded, logoCollapsed, logoFallback, logoHref, }: Readonly<NBrandingValue & {
|
|
51
51
|
children: ReactNode;
|
|
52
|
-
}>):
|
|
52
|
+
}>): React.JSX.Element;
|
|
53
53
|
interface NBrandingEditorValue {
|
|
54
54
|
branding: NBrandingValue;
|
|
55
55
|
/**
|
|
@@ -79,7 +79,7 @@ interface NBrandingStateProviderProps {
|
|
|
79
79
|
initialBranding?: NBrandingInput;
|
|
80
80
|
}
|
|
81
81
|
/** `NBrandingProvider` with the marks held as state an editor can write. */
|
|
82
|
-
declare function NBrandingStateProvider({ children, branding, initialBranding, }: Readonly<NBrandingStateProviderProps>):
|
|
82
|
+
declare function NBrandingStateProvider({ children, branding, initialBranding, }: Readonly<NBrandingStateProviderProps>): React.JSX.Element;
|
|
83
83
|
|
|
84
84
|
type FormFillOverride = unknown | readonly unknown[] | ((fieldName: string) => unknown);
|
|
85
85
|
type FormFillOverrides = Record<string, FormFillOverride>;
|
|
@@ -122,7 +122,7 @@ interface NLoadingStateProps {
|
|
|
122
122
|
*/
|
|
123
123
|
surface?: NFeedbackSurface;
|
|
124
124
|
}
|
|
125
|
-
declare function NLoadingState({ label, className, fullScreen, spinnerVariant, spinnerSize, surface, }: NLoadingStateProps):
|
|
125
|
+
declare function NLoadingState({ label, className, fullScreen, spinnerVariant, spinnerSize, surface, }: NLoadingStateProps): React__default.JSX.Element;
|
|
126
126
|
|
|
127
127
|
interface NErrorStateProps {
|
|
128
128
|
title?: string;
|
|
@@ -134,7 +134,7 @@ interface NErrorStateProps {
|
|
|
134
134
|
/** Layout surface. See `NLoadingStateProps.surface`. */
|
|
135
135
|
surface?: NFeedbackSurface;
|
|
136
136
|
}
|
|
137
|
-
declare function NErrorState({ title, message, onRetry, retryLabel, className, icon, surface, }: NErrorStateProps):
|
|
137
|
+
declare function NErrorState({ title, message, onRetry, retryLabel, className, icon, surface, }: NErrorStateProps): React__default.JSX.Element;
|
|
138
138
|
|
|
139
139
|
interface NEmptyStateProps {
|
|
140
140
|
title?: string;
|
|
@@ -145,7 +145,7 @@ interface NEmptyStateProps {
|
|
|
145
145
|
/** Layout surface. See `NLoadingStateProps.surface`. */
|
|
146
146
|
surface?: NFeedbackSurface;
|
|
147
147
|
}
|
|
148
|
-
declare function NEmptyState({ title, description, icon, action, className, surface, }: NEmptyStateProps):
|
|
148
|
+
declare function NEmptyState({ title, description, icon, action, className, surface, }: NEmptyStateProps): React__default.JSX.Element;
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
* First-class "access denied" state.
|
|
@@ -160,7 +160,7 @@ interface NForbiddenStateProps extends NEmptyStateProps {
|
|
|
160
160
|
title?: string;
|
|
161
161
|
description?: string;
|
|
162
162
|
}
|
|
163
|
-
declare function NForbiddenState(props: NForbiddenStateProps):
|
|
163
|
+
declare function NForbiddenState(props: NForbiddenStateProps): React__default.JSX.Element;
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
166
|
* First-class "page not found" state.
|
|
@@ -174,6 +174,6 @@ interface NNotFoundStateProps extends NEmptyStateProps {
|
|
|
174
174
|
title?: string;
|
|
175
175
|
description?: string;
|
|
176
176
|
}
|
|
177
|
-
declare function NNotFoundState(props: NNotFoundStateProps):
|
|
177
|
+
declare function NNotFoundState(props: NNotFoundStateProps): React__default.JSX.Element;
|
|
178
178
|
|
|
179
179
|
export { type FormDevToolsOptions as F, type NBrandingInput as N, NEmptyState as a, type NEmptyStateProps as b, NErrorState as c, type NErrorStateProps as d, type NFeedbackSurface as e, NForbiddenState as f, type NForbiddenStateProps as g, NLoadingState as h, type NLoadingStateProps as i, NNotFoundState as j, type NNotFoundStateProps as k, type FormDevTools as l, type FormDevToolsConfig as m, type FormFillOverride as n, type FormFillOverrides as o, type NBrandingEditorValue as p, type NBrandingPayload as q, NBrandingProvider as r, NBrandingStateProvider as s, type NBrandingStateProviderProps as t, type NBrandingValue as u, buildFormFill as v, normalizeBranding as w, useNBranding as x, useNBrandingEditor as y };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import React__default from 'react';
|
|
4
3
|
import { e as NajmMode, a as NajmDesignConfig } from './design-types-Rkpt8Pg1.js';
|
|
@@ -6,6 +5,48 @@ import { b as NTablePaginationLabels, N as NajmTranslate } from './paginationLab
|
|
|
6
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
7
6
|
import { VariantProps } from 'class-variance-authority';
|
|
8
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Accessible names and visible copy for the toolbar above the rows.
|
|
10
|
+
*
|
|
11
|
+
* Every field is optional and falls back to English, matching
|
|
12
|
+
* `NTablePaginationLabels`. The settings menu is the motivating case: its
|
|
13
|
+
* headings and view-mode options are the only chrome in a localized table that
|
|
14
|
+
* a catalog could not previously reach, because they are built inside the kit
|
|
15
|
+
* rather than supplied per column.
|
|
16
|
+
*/
|
|
17
|
+
interface NTableToolbarLabels {
|
|
18
|
+
/** Accessible name of the settings trigger. Defaults to `"Table settings"`. */
|
|
19
|
+
settings?: string;
|
|
20
|
+
/** Heading above the view-mode group. Defaults to `"View"`. */
|
|
21
|
+
view?: string;
|
|
22
|
+
/** Heading above the column-visibility list. Defaults to `"Columns"`. */
|
|
23
|
+
columns?: string;
|
|
24
|
+
/** Visible name of the table view mode. Defaults to `"Table"`. */
|
|
25
|
+
modeTable?: string;
|
|
26
|
+
/** Visible name of the cards view mode. Defaults to `"Cards"`. */
|
|
27
|
+
modeCards?: string;
|
|
28
|
+
/** Visible name of the JSON view mode. Defaults to `"JSON"`. */
|
|
29
|
+
modeJson?: string;
|
|
30
|
+
/** Visible name of the files view mode. Defaults to `"Files"`. */
|
|
31
|
+
modeFiles?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Accessible name of one view-mode option, given its visible name. Defaults
|
|
34
|
+
* to `` `${mode} view` ``.
|
|
35
|
+
*
|
|
36
|
+
* It must contain the visible name — voice control matches on what is on
|
|
37
|
+
* screen — so a translation reorders around the mode rather than replacing it.
|
|
38
|
+
*/
|
|
39
|
+
modeOption?: (mode: string) => string;
|
|
40
|
+
/** Accessible name and tooltip of the mobile filters trigger. Defaults to `"Filters"`. */
|
|
41
|
+
filters?: string;
|
|
42
|
+
/** Accessible name of the filter row. Defaults to `"Table filters"`. */
|
|
43
|
+
filterRegion?: string;
|
|
44
|
+
/** The option that clears a select filter. Defaults to `"All"`. */
|
|
45
|
+
allOption?: string;
|
|
46
|
+
/** Accessible name of the add control when `addButtonText` is empty. Defaults to `"Create"`. */
|
|
47
|
+
create?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
9
50
|
/**
|
|
10
51
|
* Defaults every `NTable` beneath the provider inherits.
|
|
11
52
|
*
|
|
@@ -15,6 +56,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
15
56
|
*/
|
|
16
57
|
interface NTableDefaults {
|
|
17
58
|
paginationLabels?: NTablePaginationLabels;
|
|
59
|
+
toolbarLabels?: NTableToolbarLabels;
|
|
18
60
|
}
|
|
19
61
|
/**
|
|
20
62
|
* Supply table defaults to everything below.
|
|
@@ -27,8 +69,13 @@ interface NTableDefaults {
|
|
|
27
69
|
declare function NTableDefaultsProvider({ children, value, }: {
|
|
28
70
|
children: React__default.ReactNode;
|
|
29
71
|
value: NTableDefaults;
|
|
30
|
-
}):
|
|
72
|
+
}): React__default.JSX.Element;
|
|
31
73
|
declare function useNTableDefaults(): NTableDefaults;
|
|
74
|
+
/**
|
|
75
|
+
* Per-key merge for the toolbar copy, on the same terms as
|
|
76
|
+
* `useResolvedPaginationLabels`.
|
|
77
|
+
*/
|
|
78
|
+
declare function useResolvedToolbarLabels(own: NTableToolbarLabels | undefined): NTableToolbarLabels;
|
|
32
79
|
|
|
33
80
|
type NIconSource = React__default.ReactElement | React__default.ComponentType<any> | React__default.ExoticComponent<any> | string | {
|
|
34
81
|
src: string;
|
|
@@ -81,7 +128,7 @@ type BadgeProps = React.ComponentProps<"span"> & {
|
|
|
81
128
|
iconMap?: Record<string, BadgeIcon>;
|
|
82
129
|
iconPosition?: "left" | "right";
|
|
83
130
|
};
|
|
84
|
-
declare function Badge({ className, variant, status, statusMap, label, showIcon, color, look, size, shape, icon, iconMap, iconPosition, asChild, children, style, ...props }: BadgeProps):
|
|
131
|
+
declare function Badge({ className, variant, status, statusMap, label, showIcon, color, look, size, shape, icon, iconMap, iconPosition, asChild, children, style, ...props }: BadgeProps): React.JSX.Element;
|
|
85
132
|
declare const NBadge: typeof Badge;
|
|
86
133
|
type NBadgeLook = BadgeDisplayLook;
|
|
87
134
|
type NBadgeProps = BadgeProps;
|
|
@@ -170,11 +217,24 @@ interface NFeedbackDefaults {
|
|
|
170
217
|
*/
|
|
171
218
|
labelKeys?: NFeedbackLabelKeys;
|
|
172
219
|
/**
|
|
173
|
-
* Catalog prefix for translated keys
|
|
174
|
-
* Defaults to
|
|
220
|
+
* Catalog prefix for translated keys, read as `<prefix>.<field>` for every
|
|
221
|
+
* field `labelKeys` does not name explicitly. Defaults to
|
|
222
|
+
* `"common.feedback"`, so an application whose catalog follows the
|
|
223
|
+
* convention supplies no `feedbackDefaults` at all.
|
|
224
|
+
*
|
|
225
|
+
* A prefix key the catalog does not answer falls through to packaged
|
|
226
|
+
* English rather than rendering the key.
|
|
175
227
|
*/
|
|
176
228
|
prefix?: string;
|
|
177
229
|
}
|
|
230
|
+
declare const DEFAULT_FEEDBACK_KEY_PREFIX = "common.feedback";
|
|
231
|
+
type DefaultFeedbackPrefix = typeof DEFAULT_FEEDBACK_KEY_PREFIX;
|
|
232
|
+
/**
|
|
233
|
+
* The nine catalog keys the feedback states read under `Prefix`, matching the
|
|
234
|
+
* `ToolbarKey` and `CardPaginationKey` conventions — same prefix, same
|
|
235
|
+
* key-per-field naming.
|
|
236
|
+
*/
|
|
237
|
+
type FeedbackKey<Prefix extends string = DefaultFeedbackPrefix> = `${Prefix}.loadingLabel` | `${Prefix}.emptyTitle` | `${Prefix}.errorTitle` | `${Prefix}.errorMessage` | `${Prefix}.retryLabel` | `${Prefix}.forbiddenTitle` | `${Prefix}.forbiddenDescription` | `${Prefix}.notFoundTitle` | `${Prefix}.notFoundDescription`;
|
|
178
238
|
|
|
179
239
|
/**
|
|
180
240
|
* Theme and time zone, the two preferences that outlive a render.
|
|
@@ -223,7 +283,7 @@ interface NajmPreferencesProviderProps {
|
|
|
223
283
|
* config and therefore has to sit above the provider consuming it. Hoisting
|
|
224
284
|
* preferences out is then a reorder rather than a fork.
|
|
225
285
|
*/
|
|
226
|
-
declare function NajmPreferencesProvider({ children, initialTheme, initialTimeZone, onThemeChange, onTimeZoneChange, normalizeTimeZone, }: NajmPreferencesProviderProps):
|
|
286
|
+
declare function NajmPreferencesProvider({ children, initialTheme, initialTimeZone, onThemeChange, onTimeZoneChange, normalizeTimeZone, }: NajmPreferencesProviderProps): React.JSX.Element;
|
|
227
287
|
/**
|
|
228
288
|
* Returns the context when one is mounted, or `null`.
|
|
229
289
|
*
|
|
@@ -237,6 +297,28 @@ declare function useNajmTheme(): Pick<NajmPreferencesContextValue, "theme" | "se
|
|
|
237
297
|
/** The live time zone and a setter that persists through `onTimeZoneChange`. */
|
|
238
298
|
declare function useNajmTimeZone(): Pick<NajmPreferencesContextValue, "timeZone" | "setTimeZone">;
|
|
239
299
|
|
|
300
|
+
type NajmDirection = "ltr" | "rtl";
|
|
301
|
+
/**
|
|
302
|
+
* The document's writing direction, kept in sync with the `dir` attribute.
|
|
303
|
+
*
|
|
304
|
+
* Radix reads direction from its own `DirectionProvider` and defaults to
|
|
305
|
+
* `"ltr"`. It never consults the DOM, and it stamps that default onto every
|
|
306
|
+
* portaled `Content` element — so in an application that sets
|
|
307
|
+
* `<html dir="rtl">`, a dropdown or select popup renders LTR inside an
|
|
308
|
+
* otherwise RTL page, and the logical padding and inset utilities on its items
|
|
309
|
+
* resolve against the wrong side. Nothing bridged the two until this hook and
|
|
310
|
+
* the `DirectionProvider` above it.
|
|
311
|
+
*
|
|
312
|
+
* Reading the attribute rather than a language preference is deliberate: `dir`
|
|
313
|
+
* is what the browser itself lays out against, applications already set it, and
|
|
314
|
+
* a kit that inferred direction from a locale list would disagree with the page
|
|
315
|
+
* the moment an application supported a language the kit had not heard of.
|
|
316
|
+
*
|
|
317
|
+
* Server renders return `"ltr"` and the first client effect corrects it. That
|
|
318
|
+
* is not a hydration risk for the popups, which mount only on open.
|
|
319
|
+
*/
|
|
320
|
+
declare function useDocumentDirection(override?: NajmDirection): NajmDirection;
|
|
321
|
+
|
|
240
322
|
interface NajmUIProviderProps extends Omit<NajmPreferencesProviderProps, "children"> {
|
|
241
323
|
children: React.ReactNode;
|
|
242
324
|
/**
|
|
@@ -279,6 +361,26 @@ interface NajmUIProviderProps extends Omit<NajmPreferencesProviderProps, "childr
|
|
|
279
361
|
t?: NajmTranslate;
|
|
280
362
|
/** Catalog prefix for the labels. Defaults to `"common.pagination"`. */
|
|
281
363
|
paginationKeyPrefix?: string;
|
|
364
|
+
/**
|
|
365
|
+
* Catalog prefix for the table toolbar and settings menu. Defaults to
|
|
366
|
+
* `"common.table"`.
|
|
367
|
+
*
|
|
368
|
+
* These labels are built inside the kit rather than supplied per column, so
|
|
369
|
+
* this prefix is the only way a catalog reaches the view-mode options, the
|
|
370
|
+
* column-visibility heading, and the filter controls' accessible names.
|
|
371
|
+
*/
|
|
372
|
+
toolbarKeyPrefix?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Writing direction for the Radix popups beneath — menus, selects, and the
|
|
375
|
+
* rest of the portaled content.
|
|
376
|
+
*
|
|
377
|
+
* Omit it and the direction follows `<html dir>`, which is what an
|
|
378
|
+
* application already sets and what the browser lays the page out against.
|
|
379
|
+
* Radix defaults its own context to `"ltr"` and stamps that on every portaled
|
|
380
|
+
* element, so without this bridge an RTL page gets LTR popups. Pass a value
|
|
381
|
+
* only to pin one region against the document.
|
|
382
|
+
*/
|
|
383
|
+
dir?: NajmDirection;
|
|
282
384
|
/**
|
|
283
385
|
* Per-key overrides layered over the translated labels. Memoize it, for the
|
|
284
386
|
* same reason as `t`.
|
|
@@ -322,6 +424,6 @@ interface NajmUIProviderProps extends Omit<NajmPreferencesProviderProps, "childr
|
|
|
322
424
|
* an application with a runtime theme editor hoist preferences above its
|
|
323
425
|
* design context without forking this component.
|
|
324
426
|
*/
|
|
325
|
-
declare function NajmUIProvider({ children, design, initialDesign, className, t, paginationKeyPrefix, tableDefaults, badgeDefaults, feedbackDefaults, initialTheme, initialTimeZone, onThemeChange, onTimeZoneChange, normalizeTimeZone, }: NajmUIProviderProps):
|
|
427
|
+
declare function NajmUIProvider({ children, design, initialDesign, className, t, paginationKeyPrefix, toolbarKeyPrefix, dir, tableDefaults, badgeDefaults, feedbackDefaults, initialTheme, initialTimeZone, onThemeChange, onTimeZoneChange, normalizeTimeZone, }: NajmUIProviderProps): React.JSX.Element;
|
|
326
428
|
|
|
327
|
-
export {
|
|
429
|
+
export { badgeVariants as A, type BadgeColor as B, useDocumentDirection as C, DEFAULT_FEEDBACK_KEY_PREFIX as D, useNTableDefaults as E, type FeedbackKey as F, useNajmPreferencesContext as G, useNajmTheme as H, useNajmTimeZone as I, useResolvedToolbarLabels as J, type NFeedbackDefaults as N, type NFeedbackLabelKeys as a, type NFeedbackLabels as b, type NajmUIProviderProps as c, type NTableToolbarLabels as d, type NIconSource as e, type BadgeShape as f, Badge as g, type BadgeIcon as h, type BadgeLook as i, type BadgeProps as j, type BadgeSize as k, type BadgeVariant as l, DEFAULT_TIME_ZONE as m, NBadge as n, type NBadgeDefaults as o, type NBadgeLook as p, type NBadgeProps as q, NIcon as r, type NIconProps as s, type NTableDefaults as t, NTableDefaultsProvider as u, type NajmPreferencesContextValue as v, NajmPreferencesProvider as w, type NajmPreferencesProviderProps as x, NajmUIProvider as y, badgeColorVariants as z };
|
package/dist/adapters/app.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { Translations } from 'najm-i18n';
|
|
3
|
-
import { F as FormDevToolsOptions, N as NBrandingInput } from '../NNotFoundState-
|
|
4
|
-
export { a as NEmptyState, b as NEmptyStateProps, c as NErrorState, d as NErrorStateProps, e as NFeedbackSurface, f as NForbiddenState, g as NForbiddenStateProps, h as NLoadingState, i as NLoadingStateProps, j as NNotFoundState, k as NNotFoundStateProps } from '../NNotFoundState-
|
|
3
|
+
import { F as FormDevToolsOptions, N as NBrandingInput } from '../NNotFoundState-CgU76llk.js';
|
|
4
|
+
export { a as NEmptyState, b as NEmptyStateProps, c as NErrorState, d as NErrorStateProps, e as NFeedbackSurface, f as NForbiddenState, g as NForbiddenStateProps, h as NLoadingState, i as NLoadingStateProps, j as NNotFoundState, k as NNotFoundStateProps } from '../NNotFoundState-CgU76llk.js';
|
|
5
5
|
import { NajmNextUIProviderProps } from './next.js';
|
|
6
|
-
export { N as NFeedbackDefaults, a as NFeedbackLabelKeys, b as NFeedbackLabels } from '../NajmUIProvider-
|
|
7
|
-
import 'react';
|
|
6
|
+
export { D as DEFAULT_FEEDBACK_KEY_PREFIX, F as FeedbackKey, N as NFeedbackDefaults, a as NFeedbackLabelKeys, b as NFeedbackLabels } from '../NajmUIProvider-DTyRrukg.js';
|
|
8
7
|
import 'zod';
|
|
9
8
|
import 'lucide-react';
|
|
10
9
|
import 'next/image';
|
|
@@ -34,6 +33,18 @@ interface NajmAppProviderProps extends Omit<NajmNextUIProviderProps, 't'> {
|
|
|
34
33
|
translations?: Translations;
|
|
35
34
|
initialLanguage?: string;
|
|
36
35
|
defaultLanguage?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Resolves a key missing from the active language against `defaultLanguage`
|
|
38
|
+
* instead of echoing the key. Forwarded to `najm-i18n`'s `I18nProvider`; see
|
|
39
|
+
* that package's "Missing-key fallback" for the full matrix.
|
|
40
|
+
*
|
|
41
|
+
* Off by default, matching the package. An application shipping an
|
|
42
|
+
* incomplete locale beside a complete one turns it on here rather than
|
|
43
|
+
* pre-merging its catalogs.
|
|
44
|
+
*/
|
|
45
|
+
fallbackToDefaultLanguage?: boolean;
|
|
46
|
+
/** Maps a language to the writing direction applied to `<html>`. */
|
|
47
|
+
getLanguageDirection?: (language: string) => 'ltr' | 'rtl';
|
|
37
48
|
/**
|
|
38
49
|
* Where the chosen language is POSTed, as `{ language }`. Defaults to
|
|
39
50
|
* `/api/ui-language`.
|
|
@@ -111,6 +122,6 @@ interface NajmAppProviderProps extends Omit<NajmNextUIProviderProps, 't'> {
|
|
|
111
122
|
* state machine of its own above this provider. The controlled `design` and
|
|
112
123
|
* `branding` props still work for applications that already do.
|
|
113
124
|
*/
|
|
114
|
-
declare function NajmAppProvider({ translations, initialLanguage, defaultLanguage, languageEndpoint, appName, initialBranding, formDevTools, ...props }: NajmAppProviderProps):
|
|
125
|
+
declare function NajmAppProvider({ translations, initialLanguage, defaultLanguage, fallbackToDefaultLanguage, getLanguageDirection, languageEndpoint, appName, initialBranding, formDevTools, ...props }: NajmAppProviderProps): React.JSX.Element;
|
|
115
126
|
|
|
116
127
|
export { type NajmAppBranding, NajmAppProvider, type NajmAppProviderProps };
|
package/dist/adapters/app.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { FormDevToolsProvider, NBrandingStateProvider, NajmFormatProvider } from '../chunk-
|
|
3
|
-
export { NEmptyState, NErrorState, NForbiddenState, NLoadingState, NNotFoundState } from '../chunk-
|
|
4
|
-
import { NajmNextUIProvider } from '../chunk-
|
|
5
|
-
|
|
2
|
+
import { FormDevToolsProvider, NBrandingStateProvider, NajmFormatProvider } from '../chunk-26EASWUY.mjs';
|
|
3
|
+
export { NEmptyState, NErrorState, NForbiddenState, NLoadingState, NNotFoundState } from '../chunk-26EASWUY.mjs';
|
|
4
|
+
import { NajmNextUIProvider } from '../chunk-DKHIQFXX.mjs';
|
|
5
|
+
export { DEFAULT_FEEDBACK_KEY_PREFIX } from '../chunk-BDQK6ECA.mjs';
|
|
6
6
|
import '../chunk-M5VGBZ7R.mjs';
|
|
7
7
|
import '../chunk-LK3SMYUP.mjs';
|
|
8
8
|
import '../chunk-JABLSOQN.mjs';
|
|
@@ -72,6 +72,8 @@ function NajmAppProvider({
|
|
|
72
72
|
translations,
|
|
73
73
|
initialLanguage,
|
|
74
74
|
defaultLanguage,
|
|
75
|
+
fallbackToDefaultLanguage,
|
|
76
|
+
getLanguageDirection,
|
|
75
77
|
languageEndpoint = DEFAULT_LANGUAGE_ENDPOINT,
|
|
76
78
|
appName,
|
|
77
79
|
initialBranding,
|
|
@@ -104,6 +106,8 @@ function NajmAppProvider({
|
|
|
104
106
|
translations,
|
|
105
107
|
initialLanguage: initialLanguage ?? defaultLanguage ?? "en",
|
|
106
108
|
defaultLanguage,
|
|
109
|
+
fallbackToDefaultLanguage,
|
|
110
|
+
getLanguageDirection,
|
|
107
111
|
onLanguageChange: persistLanguage,
|
|
108
112
|
children: /* @__PURE__ */ jsx(NajmAppUI, { ...props, initialBranding: seeded })
|
|
109
113
|
}
|
package/dist/adapters/next.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import React__default from 'react';
|
|
3
2
|
import { ImageProps } from 'next/image';
|
|
4
|
-
import { c as NajmUIProviderProps } from '../NajmUIProvider-
|
|
3
|
+
import { c as NajmUIProviderProps } from '../NajmUIProvider-DTyRrukg.js';
|
|
5
4
|
import '../design-types-Rkpt8Pg1.js';
|
|
6
5
|
import '../paginationLabels-dZLSNxfo.js';
|
|
7
6
|
import 'class-variance-authority/types';
|
|
@@ -44,7 +43,7 @@ interface NNextImageProps extends Omit<ImageProps, 'src' | 'onError'> {
|
|
|
44
43
|
* validation, permissions, and what bytes come back remain entirely the
|
|
45
44
|
* backend's.
|
|
46
45
|
*/
|
|
47
|
-
declare function NNextImage({ src, fallbackSrc, loading, priority, onError, ...props }: NNextImageProps):
|
|
46
|
+
declare function NNextImage({ src, fallbackSrc, loading, priority, onError, ...props }: NNextImageProps): React__default.JSX.Element;
|
|
48
47
|
/** Where `NajmNextUIProvider` POSTs each preference. */
|
|
49
48
|
interface NajmNextUIEndpoints {
|
|
50
49
|
/** Defaults to `/api/ui-theme`. Receives `{ theme }`. */
|
|
@@ -73,6 +72,6 @@ interface NajmNextUIProviderProps extends Omit<NajmUIProviderProps, 'onThemeChan
|
|
|
73
72
|
* `next` is an *optional* peer dependency: consumers of the root entry never
|
|
74
73
|
* reach this file.
|
|
75
74
|
*/
|
|
76
|
-
declare function NajmNextUIProvider({ endpoints, refreshOnChange, ...props }: NajmNextUIProviderProps):
|
|
75
|
+
declare function NajmNextUIProvider({ endpoints, refreshOnChange, ...props }: NajmNextUIProviderProps): React__default.JSX.Element;
|
|
77
76
|
|
|
78
77
|
export { NNextImage, type NNextImageProps, type NajmNextUIEndpoints, NajmNextUIProvider, type NajmNextUIProviderProps, NextLinkAdapter, type NextLinkAdapterProps, useNextNavigationAdapter };
|
package/dist/adapters/next.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { NNextImage, NajmNextUIProvider, NextLinkAdapter, useNextNavigationAdapter } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { NNextImage, NajmNextUIProvider, NextLinkAdapter, useNextNavigationAdapter } from '../chunk-DKHIQFXX.mjs';
|
|
2
|
+
import '../chunk-BDQK6ECA.mjs';
|
|
3
3
|
import '../chunk-LK3SMYUP.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useResolvedFeedbackLabels, useNajmPreferencesContext } from './chunk-
|
|
1
|
+
import { useResolvedFeedbackLabels, useNajmPreferencesContext } from './chunk-BDQK6ECA.mjs';
|
|
2
2
|
import { Button } from './chunk-M5VGBZ7R.mjs';
|
|
3
3
|
import { useNajmDesign, cn } from './chunk-LK3SMYUP.mjs';
|
|
4
4
|
import { humanizeToken, DEFAULT_PLACEHOLDER, formatRelativeTime, formatTime, formatDateTime, formatDate, formatPercent, formatNumber, formatCurrency } from './chunk-JABLSOQN.mjs';
|