@nice2dev/ui 1.3.14 → 1.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/{NiceDataGrid-BTtrpB6P.cjs → NiceDataGrid-aNPAHsWy.cjs} +1 -1
  3. package/dist/NiceForm-BtRBLffD.cjs +1 -0
  4. package/dist/{NiceMention-CUl3myJg.cjs → NiceMention-CMqAGvO0.cjs} +1 -1
  5. package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +1 -0
  6. package/dist/{NicePagination-CKsAP38Q.cjs → NicePagination-D7XxeNFz.cjs} +1 -1
  7. package/dist/{NiceSavedQueryPanel-CpGjsyhc.cjs → NiceSavedQueryPanel-JHrSlHAV.cjs} +1 -1
  8. package/dist/{NiceScheduler-Dwym4RVa.cjs → NiceScheduler-2TwOZq-y.cjs} +1 -1
  9. package/dist/{core-lazy-Bwdr6Kcl.cjs → core-lazy-Cda-D35m.cjs} +1 -1
  10. package/dist/data.cjs +1 -1
  11. package/dist/display/NiceProgress.mjs +1 -1
  12. package/dist/editors/inputs/NiceNumberInput.mjs +27 -27
  13. package/dist/editors/inputs/NicePasswordInput.mjs +20 -19
  14. package/dist/editors.cjs +1 -1
  15. package/dist/index.cjs +53 -53
  16. package/dist/index.d.ts +50 -14
  17. package/dist/lazy.cjs +1 -1
  18. package/dist/navigation/NiceCard.mjs +66 -62
  19. package/dist/navigation/NiceFirstRunPreferences.mjs +55 -54
  20. package/dist/navigation/NiceNavShell.mjs +429 -429
  21. package/dist/navigation/NiceSetupWizard.mjs +333 -317
  22. package/dist/navigation/NiceSidebarNav.mjs +1111 -1039
  23. package/dist/navigation/menuBuilderModel.mjs +1 -1
  24. package/dist/navigation/sidebarColors.mjs +67 -39
  25. package/dist/navigation/sidebarNavTypes.mjs +16 -14
  26. package/dist/navigation/sidebarPrefs/NiceSidebarPrefsDisplay.mjs +120 -42
  27. package/dist/navigation.cjs +1 -1
  28. package/dist/navigation.d.ts +34 -6
  29. package/dist/{no-code-BQqK8mvU.cjs → no-code-B3BHeyG-.cjs} +1 -1
  30. package/dist/no-code.cjs +1 -1
  31. package/dist/style.css +2 -2
  32. package/package.json +5 -5
  33. package/dist/NiceForm-Cl5syDvY.cjs +0 -1
  34. package/dist/NiceModuleLifecyclePanel-DZHj2xTn.cjs +0 -1
package/dist/index.d.ts CHANGED
@@ -9186,6 +9186,8 @@ export declare interface NiceCardProps extends NiceBaseProps {
9186
9186
  children: default_2.ReactNode;
9187
9187
  /** Header title text. */
9188
9188
  title?: string;
9189
+ /** Icon before the title in the header (e.g. `<NtdDatabase />`), sized to the title's font. */
9190
+ icon?: default_2.ReactNode;
9189
9191
  /** Extra element rendered at the right side of the header (actions, badges, etc.). */
9190
9192
  headerExtra?: default_2.ReactNode;
9191
9193
  /** Footer content. */
@@ -13630,8 +13632,11 @@ export declare interface NiceFirstRunValues {
13630
13632
  language?: string;
13631
13633
  /** The menu folded to icons. */
13632
13634
  collapsed?: boolean;
13633
- /** How branch colours show: a bar by each item, or whole items filled. */
13634
- colorStyle?: 'bar' | 'fill';
13635
+ /**
13636
+ * How the menu shows colour: the theme's shades (`'theme'`, the default since 1.3.16), plus a bar
13637
+ * by each item in its branch colour, or whole items filled.
13638
+ */
13639
+ colorStyle?: SidebarNavColorStyle;
13635
13640
  }
13636
13641
 
13637
13642
  /**
@@ -17691,11 +17696,12 @@ export declare interface NiceNavShellProps {
17691
17696
  tabColors?: NiceNavShellTabColors;
17692
17697
  /**
17693
17698
  * How a tab shows its colour (1.3.3): `'bar'` — a line under the tab, `'fill'` — a tint with a
17694
- * bar along the top. Absent: the sidebar's `colorStyle` preference (Preferences → Display) of
17695
- * `sidebarUserId`, so the tabs follow the user's choice. Pass it when your own `sidebar` keeps
17696
- * its preferences elsewhere (e.g. on the server).
17699
+ * bar along the top, `'theme'` (1.3.16) — no colour, the theme's tabs. Absent: the sidebar's
17700
+ * `colorStyle` preference (Preferences → Display) of `sidebarUserId` (default `'theme'`), so the
17701
+ * tabs follow the user's choice. Pass it when your own `sidebar` keeps its preferences elsewhere
17702
+ * (e.g. on the server).
17697
17703
  */
17698
- colorStyle?: 'bar' | 'fill';
17704
+ colorStyle?: SidebarNavColorStyle;
17699
17705
  /** Extra props for the built-in NiceSidebarNav (rendered from `sidebarData`), e.g. `levelColors`. */
17700
17706
  sidebarProps?: Partial<NiceSidebarNavProps>;
17701
17707
  /**
@@ -28072,6 +28078,11 @@ export declare interface SetupWizardStep {
28072
28078
  * The step that completes the wizard (1.3.14). When any step is `final`, only such a step calls
28073
28079
  * `onComplete`; every other one — the last one in view included — goes on to its `nextStep`
28074
28080
  * (or the next one) with `labels.next`. Without any `final` step, the last step completes.
28081
+ *
28082
+ * `false` (1.3.16): this step never completes, even while it is the only one or the last one in
28083
+ * view — for steps the host adds after it (a first choice that decides every step after it). Its
28084
+ * main button reads `labels.next`; pressed before the next step exists (e.g. the host adds the
28085
+ * steps in `validate`), the wizard moves on as soon as that step arrives.
28075
28086
  */
28076
28087
  final?: boolean;
28077
28088
  }
@@ -28150,6 +28161,9 @@ export declare interface SidebarNavBranchColors {
28150
28161
  levelColors?: string[];
28151
28162
  }
28152
28163
 
28164
+ /** How the sidebar tree and NavShell's tabs show colour — see {@link SidebarNavUserPrefs.colorStyle}. */
28165
+ export declare type SidebarNavColorStyle = 'theme' | 'bar' | 'fill';
28166
+
28153
28167
  /**
28154
28168
  * Top-level data node: one data source with all its navigation children.
28155
28169
  * modules → used in 'all' mode (depth: source → module → view → …)
@@ -28241,8 +28255,12 @@ export declare interface SidebarNavHelpers {
28241
28255
  setLeftClickBehavior: (v: 'focus-existing' | 'open-new') => void;
28242
28256
  /** Replace the per-mode ordering of item ids. Pass `null` to clear (revert to data-defined order). */
28243
28257
  reorderItems: (mode: SidebarNavMode, orderedIds: string[] | null) => void;
28244
- /** How level / branch colours show: a bar by each row (default) or the whole row filled. */
28245
- setColorStyle: (v: 'bar' | 'fill') => void;
28258
+ /** How the tree shows colour: the theme's shades (default), plus branch bars, or filled rows. */
28259
+ setColorStyle: (v: SidebarNavColorStyle) => void;
28260
+ /** A step per level (default) or no indentation (1.3.16). */
28261
+ setIndent: (v: SidebarNavUserPrefs['indent']) => void;
28262
+ /** What stays in view while the tree scrolls (1.3.16). */
28263
+ setStickyHeaders: (v: SidebarNavUserPrefs['stickyHeaders']) => void;
28246
28264
  /** How NiceNavShell opens pages: automatically, one at a time or in tabs (1.3.4). */
28247
28265
  setPageMode: (v: NiceNavShellPageMode) => void;
28248
28266
  /**
@@ -28394,16 +28412,34 @@ export declare interface SidebarNavUserPrefs {
28394
28412
  */
28395
28413
  itemOrder: Partial<Record<SidebarNavMode, string[]>>;
28396
28414
  /**
28397
- * How a level / branch colour shows (1.3.3; `levelColors`, a branch's `color`):
28398
- * - `'bar'` (default): a bar in the colour left of each row's arrow, and NavShell's tabs
28399
- * underlined in it;
28400
- * - `'fill'`: the whole row filled with it (text picked for contrast), and the tabs tinted
28401
- * with a bar along the top — the look of 1.3.2.
28415
+ * How the tree is coloured (1.3.3; `'theme'` and the default since 1.3.16):
28416
+ * - `'theme'` (default): the theme's colours, shaded by level — the source header in the
28417
+ * primary, each level under it lighter, pages a faint tint of their level; a theme's
28418
+ * `nesting.sidebar` or the sidebar's `levelColors` replaces the shades. Branch colours (e.g.
28419
+ * databases) paint nothing, and NavShell's tabs stay uncoloured;
28420
+ * - `'bar'`: the same shades, plus a branch's colour as a bar on the left edge of its rows and
28421
+ * NavShell's tabs underlined in it;
28422
+ * - `'fill'`: rows filled with the level / branch colours (text picked for contrast), and the
28423
+ * tabs tinted with a bar along the top — the look of 1.3.2.
28402
28424
  *
28403
28425
  * Set from the Display page of the preferences; `preferences={{ colorStyle: 'fill' }}` makes
28404
28426
  * `'fill'` the default.
28405
28427
  */
28406
- colorStyle: 'bar' | 'fill';
28428
+ colorStyle: SidebarNavColorStyle;
28429
+ /**
28430
+ * Indentation of the tree (1.3.16): `'steps'` (default) — a step per level; `'none'` — every
28431
+ * level starts at the same place and the shades alone show the level.
28432
+ */
28433
+ indent: 'steps' | 'none';
28434
+ /**
28435
+ * What stays in view while the tree scrolls (1.3.16):
28436
+ * - `'path'` (default): the source header above the tree, outside its scroll area (the
28437
+ * scrollbar starts a level lower), and the headers above the first visible row stuck under it,
28438
+ * one per level;
28439
+ * - `'root'`: only the source header stays;
28440
+ * - `'none'`: everything scrolls — the most room on a short screen.
28441
+ */
28442
+ stickyHeaders: 'path' | 'root' | 'none';
28407
28443
  /**
28408
28444
  * How NiceNavShell opens pages when it offers tabs (`tabsMode="enabled"`, 1.3.4):
28409
28445
  * - `'auto'` (default): in tabs in an installed app (a window of its own, no browser tab strip),
package/dist/lazy.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),n=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitGraph$1).then(e=>({default:e.NiceGitGraph}))),o=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceBranchManager$1).then(e=>({default:e.NiceBranchManager}))),l=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitDiffViewer$1).then(e=>({default:e.NiceGitDiffViewer}))),s=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitBlame$1).then(e=>({default:e.NiceGitBlame}))),h=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitConflictResolver$1).then(e=>({default:e.NiceGitConflictResolver}))),c=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineEditor$1).then(e=>({default:e.NicePipelineEditor}))),y=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineMonitor$1).then(e=>({default:e.NicePipelineMonitor}))),u=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitHooks$1).then(e=>({default:e.NiceGitHooks}))),z=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceMergeRequestBuilder$1).then(e=>({default:e.NiceMergeRequestBuilder}))),d=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-BQqK8mvU.cjs")).then(e=>e.NiceAPIFlow$1).then(e=>({default:e.NiceAPIFlow}))),f=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-BQqK8mvU.cjs")).then(e=>e.NiceCodeTemplate$1).then(e=>({default:e.NiceCodeTemplate}))),N=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-BQqK8mvU.cjs")).then(e=>e.NiceDataMapper$1).then(e=>({default:e.NiceDataMapper}))),L=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-BQqK8mvU.cjs")).then(e=>e.NiceEventOrchestrator$1).then(e=>({default:e.NiceEventOrchestrator}))),p=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-BQqK8mvU.cjs")).then(e=>e.NiceStateDesigner$1).then(e=>({default:e.NiceStateDesigner}))),v=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-BQqK8mvU.cjs")).then(e=>e.NiceTestBuilder$1).then(e=>({default:e.NiceTestBuilder}))),D=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataBranchManager$1).then(e=>({default:e.NiceDataBranchManager}))),P=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataDiffViewer$1).then(e=>({default:e.NiceDataDiffViewer}))),m=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataBranchGraph$1).then(e=>({default:e.NiceDataBranchGraph}))),q=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataMergeBuilder$1).then(e=>({default:e.NiceDataMergeBuilder}))),B=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataConflictResolver$1).then(e=>({default:e.NiceDataConflictResolver}))),M=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataSnapshot$1).then(e=>({default:e.NiceDataSnapshot}))),G=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceChart$1).then(e=>({default:e.NiceChart}))),g=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceTreeMap$1).then(e=>({default:e.NiceTreeMap}))),$=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceSankey$1).then(e=>({default:e.NiceSankey}))),t=()=>{Promise.resolve().then(()=>require("./devops.cjs"))},r=()=>{Promise.resolve().then(()=>require("./no-code.cjs"))},i=()=>{Promise.resolve().then(()=>require("./data-branching.cjs"))},C=()=>{"requestIdleCallback"in window?requestIdleCallback(()=>{t(),r(),i()}):setTimeout(()=>{t(),r(),i()},2e3)};exports.LazyAPIFlow=d;exports.LazyBranchManager=o;exports.LazyChart=G;exports.LazyCodeTemplate=f;exports.LazyDataBranchGraph=m;exports.LazyDataBranchManager=D;exports.LazyDataConflictResolver=B;exports.LazyDataDiffViewer=P;exports.LazyDataMapper=N;exports.LazyDataMergeBuilder=q;exports.LazyDataSnapshot=M;exports.LazyEventOrchestrator=L;exports.LazyGitBlame=s;exports.LazyGitConflictResolver=h;exports.LazyGitDiffViewer=l;exports.LazyGitGraph=n;exports.LazyGitHooks=u;exports.LazyMergeRequestBuilder=z;exports.LazyPipelineEditor=c;exports.LazyPipelineMonitor=y;exports.LazySankey=$;exports.LazyStateDesigner=p;exports.LazyTestBuilder=v;exports.LazyTreemap=g;exports.preloadDataBranching=i;exports.preloadDevOps=t;exports.preloadHeavyModules=C;exports.preloadNoCode=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),n=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitGraph$1).then(e=>({default:e.NiceGitGraph}))),o=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceBranchManager$1).then(e=>({default:e.NiceBranchManager}))),l=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitDiffViewer$1).then(e=>({default:e.NiceGitDiffViewer}))),s=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitBlame$1).then(e=>({default:e.NiceGitBlame}))),h=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitConflictResolver$1).then(e=>({default:e.NiceGitConflictResolver}))),c=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineEditor$1).then(e=>({default:e.NicePipelineEditor}))),y=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineMonitor$1).then(e=>({default:e.NicePipelineMonitor}))),u=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitHooks$1).then(e=>({default:e.NiceGitHooks}))),z=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceMergeRequestBuilder$1).then(e=>({default:e.NiceMergeRequestBuilder}))),d=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceAPIFlow$1).then(e=>({default:e.NiceAPIFlow}))),f=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceCodeTemplate$1).then(e=>({default:e.NiceCodeTemplate}))),N=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceDataMapper$1).then(e=>({default:e.NiceDataMapper}))),L=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceEventOrchestrator$1).then(e=>({default:e.NiceEventOrchestrator}))),p=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceStateDesigner$1).then(e=>({default:e.NiceStateDesigner}))),v=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceTestBuilder$1).then(e=>({default:e.NiceTestBuilder}))),D=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataBranchManager$1).then(e=>({default:e.NiceDataBranchManager}))),P=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataDiffViewer$1).then(e=>({default:e.NiceDataDiffViewer}))),m=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataBranchGraph$1).then(e=>({default:e.NiceDataBranchGraph}))),q=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataMergeBuilder$1).then(e=>({default:e.NiceDataMergeBuilder}))),B=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataConflictResolver$1).then(e=>({default:e.NiceDataConflictResolver}))),M=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataSnapshot$1).then(e=>({default:e.NiceDataSnapshot}))),G=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceChart$1).then(e=>({default:e.NiceChart}))),g=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceTreeMap$1).then(e=>({default:e.NiceTreeMap}))),$=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceSankey$1).then(e=>({default:e.NiceSankey}))),t=()=>{Promise.resolve().then(()=>require("./devops.cjs"))},r=()=>{Promise.resolve().then(()=>require("./no-code.cjs"))},i=()=>{Promise.resolve().then(()=>require("./data-branching.cjs"))},C=()=>{"requestIdleCallback"in window?requestIdleCallback(()=>{t(),r(),i()}):setTimeout(()=>{t(),r(),i()},2e3)};exports.LazyAPIFlow=d;exports.LazyBranchManager=o;exports.LazyChart=G;exports.LazyCodeTemplate=f;exports.LazyDataBranchGraph=m;exports.LazyDataBranchManager=D;exports.LazyDataConflictResolver=B;exports.LazyDataDiffViewer=P;exports.LazyDataMapper=N;exports.LazyDataMergeBuilder=q;exports.LazyDataSnapshot=M;exports.LazyEventOrchestrator=L;exports.LazyGitBlame=s;exports.LazyGitConflictResolver=h;exports.LazyGitDiffViewer=l;exports.LazyGitGraph=n;exports.LazyGitHooks=u;exports.LazyMergeRequestBuilder=z;exports.LazyPipelineEditor=c;exports.LazyPipelineMonitor=y;exports.LazySankey=$;exports.LazyStateDesigner=p;exports.LazyTestBuilder=v;exports.LazyTreemap=g;exports.preloadDataBranching=i;exports.preloadDevOps=t;exports.preloadHeavyModules=C;exports.preloadNoCode=r;
@@ -1,83 +1,87 @@
1
- import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
- import { useComponentDisplayStyle as U, useComponentDisplayClass as V } from "@nice2dev/ui-core";
3
- import i from "react";
4
- const X = /* @__PURE__ */ i.createContext(null), Y = /* @__PURE__ */ i.createContext(null), ie = ({
1
+ import { jsxs as _, jsx as c } from "react/jsx-runtime";
2
+ import { useComponentDisplayStyle as V, useComponentDisplayClass as X } from "@nice2dev/ui-core";
3
+ import t from "react";
4
+ const Y = /* @__PURE__ */ t.createContext(null), Z = /* @__PURE__ */ t.createContext(null), re = ({
5
5
  children: y,
6
- title: m,
7
- headerExtra: _,
8
- footer: v,
9
- hoverable: g,
10
- bordered: w = !0,
11
- onClick: s,
12
- selectable: D,
6
+ title: s,
7
+ icon: d,
8
+ headerExtra: v,
9
+ footer: N,
10
+ hoverable: w,
11
+ bordered: D = !0,
12
+ onClick: o,
13
+ selectable: z,
13
14
  selected: C,
14
15
  value: e,
15
- onSelect: N,
16
- name: z,
17
- disabled: d,
16
+ onSelect: $,
17
+ name: R,
18
+ disabled: l,
18
19
  readOnly: p,
19
- loading: o,
20
- error: c,
21
- size: R,
22
- className: j,
23
- style: F,
24
- displayStyle: l,
25
- id: G,
26
- testId: I,
27
- "data-testid": K
20
+ loading: m,
21
+ error: a,
22
+ size: j,
23
+ className: F,
24
+ style: G,
25
+ displayStyle: u,
26
+ id: I,
27
+ testId: K,
28
+ "data-testid": B
28
29
  }) => {
29
- const f = U("card", l), B = V("card", l), u = i.useContext(X), E = i.useContext(Y), M = R ?? E ?? "md", W = i.useMemo(() => {
30
- if (l)
30
+ const f = V("card", u), E = X("card", u), h = t.useContext(Y), M = t.useContext(Z), W = j ?? M ?? "md", q = t.useMemo(() => {
31
+ if (u)
31
32
  return f;
32
33
  const {
33
- background: t,
34
- border: Z,
35
- boxShadow: O,
36
- backdropFilter: ee,
37
- WebkitBackdropFilter: ne,
38
- ...T
34
+ background: i,
35
+ border: O,
36
+ boxShadow: ee,
37
+ backdropFilter: ne,
38
+ WebkitBackdropFilter: ce,
39
+ ...U
39
40
  } = f;
40
- return T;
41
- }, [f, l]), r = u != null && e != null, n = D || r || N != null, q = z ?? (r ? u.name : void 0), $ = n && C === void 0 && !r, [A, H] = i.useState(!1), x = r ? u.value === e : $ ? A : !!C, J = () => {
42
- e != null && (N?.(e), r && u.onChange(e));
43
- }, S = d || o, k = () => {
44
- S || (n && !p && (J(), $ && H((t) => !t)), s?.());
45
- }, L = (t) => {
46
- !S && n && !p && (t.key === " " || t.key === "Enter") && (t.preventDefault(), k());
47
- }, b = n || s != null, P = n ? "radio" : s ? "button" : void 0, Q = typeof c == "string" ? c.length > 0 : !!c;
48
- return /* @__PURE__ */ h("div", { className: "nice-card-field", children: [
49
- /* @__PURE__ */ h(
41
+ return U;
42
+ }, [f, u]), r = h != null && e != null, n = z || r || $ != null, A = R ?? (r ? h.name : void 0), x = n && C === void 0 && !r, [H, J] = t.useState(!1), S = r ? h.value === e : x ? H : !!C, L = () => {
43
+ e != null && ($?.(e), r && h.onChange(e));
44
+ }, g = l || m, k = () => {
45
+ g || (n && !p && (L(), x && J((i) => !i)), o?.());
46
+ }, P = (i) => {
47
+ !g && n && !p && (i.key === " " || i.key === "Enter") && (i.preventDefault(), k());
48
+ }, b = n || o != null, Q = n ? "radio" : o ? "button" : void 0, T = typeof a == "string" ? a.length > 0 : !!a;
49
+ return /* @__PURE__ */ _("div", { className: "nice-card-field", children: [
50
+ /* @__PURE__ */ _(
50
51
  "div",
51
52
  {
52
- className: `nice-card nice-card--${M} nice-card--ds-${B} ${w ? "nice-card--bordered" : "nice-card--frameless"} ${g ? "nice-card--hoverable" : ""} ${s ? "nice-card--clickable" : ""} ${n ? "nice-card--selectable" : ""} ${x ? "nice-card--selected" : ""} ${d ? "nice-card--disabled" : ""} ${p ? "nice-card--readonly" : ""} ${o ? "nice-card--loading" : ""} ${Q ? "nice-card--error" : ""} ${j || ""}`,
53
- style: { ...W, ...F },
54
- id: G,
55
- "data-testid": K ?? I,
53
+ className: `nice-card nice-card--${W} nice-card--ds-${E} ${D ? "nice-card--bordered" : "nice-card--frameless"} ${w ? "nice-card--hoverable" : ""} ${o ? "nice-card--clickable" : ""} ${n ? "nice-card--selectable" : ""} ${S ? "nice-card--selected" : ""} ${l ? "nice-card--disabled" : ""} ${p ? "nice-card--readonly" : ""} ${m ? "nice-card--loading" : ""} ${T ? "nice-card--error" : ""} ${F || ""}`,
54
+ style: { ...q, ...G },
55
+ id: I,
56
+ "data-testid": B ?? K,
56
57
  onClick: b ? k : void 0,
57
- onKeyDown: b ? L : void 0,
58
- role: P,
59
- "aria-checked": n ? x : void 0,
60
- "aria-disabled": d || void 0,
61
- "aria-busy": o || void 0,
58
+ onKeyDown: b ? P : void 0,
59
+ role: Q,
60
+ "aria-checked": n ? S : void 0,
61
+ "aria-disabled": l || void 0,
62
+ "aria-busy": m || void 0,
62
63
  "data-value": e != null ? String(e) : void 0,
63
- "data-name": q,
64
- tabIndex: b && !d ? 0 : void 0,
64
+ "data-name": A,
65
+ tabIndex: b && !l ? 0 : void 0,
65
66
  children: [
66
- (m || _) && /* @__PURE__ */ h("div", { className: "nice-card__header", children: [
67
- m && /* @__PURE__ */ a("h3", { className: "nice-card__title", children: m }),
68
- _
67
+ (s || d || v) && /* @__PURE__ */ _("div", { className: "nice-card__header", children: [
68
+ (s || d) && /* @__PURE__ */ _("div", { className: "nice-card__heading", children: [
69
+ d && /* @__PURE__ */ c("span", { className: "nice-card__title-icon", "aria-hidden": "true", children: d }),
70
+ s && /* @__PURE__ */ c("h3", { className: "nice-card__title", children: s })
71
+ ] }),
72
+ v
69
73
  ] }),
70
- /* @__PURE__ */ a("div", { className: "nice-card__body", children: y }),
71
- v && /* @__PURE__ */ a("div", { className: "nice-card__footer", children: v }),
72
- o && /* @__PURE__ */ a("span", { className: "nice-card__spinner", "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: "nice-spinner nice-spinner--sm" }) })
74
+ /* @__PURE__ */ c("div", { className: "nice-card__body", children: y }),
75
+ N && /* @__PURE__ */ c("div", { className: "nice-card__footer", children: N }),
76
+ m && /* @__PURE__ */ c("span", { className: "nice-card__spinner", "aria-hidden": "true", children: /* @__PURE__ */ c("span", { className: "nice-spinner nice-spinner--sm" }) })
73
77
  ]
74
78
  }
75
79
  ),
76
- typeof c == "string" && c && /* @__PURE__ */ a("div", { className: "nice-card__error", role: "alert", children: c })
80
+ typeof a == "string" && a && /* @__PURE__ */ c("div", { className: "nice-card__error", role: "alert", children: a })
77
81
  ] });
78
82
  };
79
83
  export {
80
- ie as NiceCard,
81
- Y as NiceCardGroupSizeContext,
82
- X as NiceCardRadioContext
84
+ re as NiceCard,
85
+ Z as NiceCardGroupSizeContext,
86
+ Y as NiceCardRadioContext
83
87
  };
@@ -1,10 +1,10 @@
1
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
2
  import { useNiceTranslation as O } from "@nice2dev/ui-core";
3
- import { useState as N, useMemo as E } from "react";
3
+ import { useState as N, useMemo as T } from "react";
4
4
  import { NiceButton as R } from "../buttons/NiceButton.mjs";
5
5
  import { NiceSegmentedControl as d } from "../display/NiceSegmentedControl.mjs";
6
- import { NiceLanguagePicker as P } from "../editors/pickers/NiceLanguagePicker.mjs";
7
- import { NiceThemePicker as T } from "../editors/pickers/NiceThemePicker.mjs";
6
+ import { NiceLanguagePicker as E } from "../editors/pickers/NiceLanguagePicker.mjs";
7
+ import { NiceThemePicker as P } from "../editors/pickers/NiceThemePicker.mjs";
8
8
  import { NiceModal as A } from "../feedback/NiceModal.mjs";
9
9
  /* empty css */
10
10
  const D = ["single", "tabs"];
@@ -19,76 +19,76 @@ function F({
19
19
  languages: f,
20
20
  priorityLanguages: _,
21
21
  title: w,
22
- description: k,
23
- "data-testid": p = "nice-first-run-preferences"
22
+ description: S,
23
+ "data-testid": m = "nice-first-run-preferences"
24
24
  }) {
25
- const { t: n } = O(), [r, b] = N(h ?? {}), [C, S] = N(i);
26
- i !== C && (S(i), i && b(h ?? {}));
27
- const s = (a, e) => b((m) => ({ ...m, [a]: e })), x = E(
25
+ const { t: e } = O(), [r, b] = N(h ?? {}), [k, C] = N(i);
26
+ i !== k && (C(i), i && b(h ?? {}));
27
+ const s = (t, n) => b((p) => ({ ...p, [t]: n })), x = T(
28
28
  () => v ?? ["pages", "theme", "language", "menu"].filter(
29
- (a) => (a !== "theme" || (u?.length ?? 0) > 0) && (a !== "language" || (f?.length ?? 0) > 0)
29
+ (t) => (t !== "theme" || (u?.length ?? 0) > 0) && (t !== "language" || (f?.length ?? 0) > 0)
30
30
  ),
31
31
  [v, u, f]
32
32
  ), M = {
33
- auto: n("firstRun.pagesAuto", "Automatically"),
34
- single: n("firstRun.pagesSingle", "One at a time"),
35
- tabs: n("firstRun.pagesTabs", "In tabs")
36
- }, l = (a, e, m) => /* @__PURE__ */ o("section", { className: "nice-first-run__section", "aria-label": e, children: [
37
- /* @__PURE__ */ t("h3", { className: "nice-first-run__heading", children: e }),
38
- m
39
- ] }, a);
40
- return /* @__PURE__ */ t(
33
+ auto: e("firstRun.pagesAuto", "Automatically"),
34
+ single: e("firstRun.pagesSingle", "One at a time"),
35
+ tabs: e("firstRun.pagesTabs", "In tabs")
36
+ }, l = (t, n, p) => /* @__PURE__ */ o("section", { className: "nice-first-run__section", "aria-label": n, children: [
37
+ /* @__PURE__ */ a("h3", { className: "nice-first-run__heading", children: n }),
38
+ p
39
+ ] }, t);
40
+ return /* @__PURE__ */ a(
41
41
  A,
42
42
  {
43
43
  open: i,
44
44
  onClose: g,
45
45
  size: "md",
46
46
  closeOnOverlay: !1,
47
- title: w ?? n("firstRun.title", "Set up your workspace"),
48
- "data-testid": p,
47
+ title: w ?? e("firstRun.title", "Set up your workspace"),
48
+ "data-testid": m,
49
49
  footer: /* @__PURE__ */ o("div", { className: "nice-first-run__footer", children: [
50
- /* @__PURE__ */ t(R, { variant: "ghost", onClick: g, "data-testid": `${p}-skip`, children: n("firstRun.skip", "Skip") }),
51
- /* @__PURE__ */ t(
50
+ /* @__PURE__ */ a(R, { variant: "ghost", onClick: g, "data-testid": `${m}-skip`, children: e("firstRun.skip", "Skip") }),
51
+ /* @__PURE__ */ a(
52
52
  R,
53
53
  {
54
54
  variant: "primary",
55
55
  onClick: () => y(r),
56
- "data-testid": `${p}-save`,
57
- children: n("firstRun.save", "Save")
56
+ "data-testid": `${m}-save`,
57
+ children: e("firstRun.save", "Save")
58
58
  }
59
59
  )
60
60
  ] }),
61
61
  children: /* @__PURE__ */ o("div", { className: "nice-first-run", children: [
62
- /* @__PURE__ */ t("p", { className: "nice-first-run__intro", children: k ?? n(
62
+ /* @__PURE__ */ a("p", { className: "nice-first-run__intro", children: S ?? e(
63
63
  "firstRun.intro",
64
64
  "Choose how you want to work. You can change all of it later in the preferences."
65
65
  ) }),
66
- x.map((a) => {
67
- switch (a) {
66
+ x.map((t) => {
67
+ switch (t) {
68
68
  case "pages":
69
69
  return l(
70
- a,
71
- n("firstRun.pages", "Opening pages"),
72
- /* @__PURE__ */ t(
70
+ t,
71
+ e("firstRun.pages", "Opening pages"),
72
+ /* @__PURE__ */ a(
73
73
  d,
74
74
  {
75
75
  block: !0,
76
- options: c.map((e) => ({ value: e, label: M[e] })),
76
+ options: c.map((n) => ({ value: n, label: M[n] })),
77
77
  value: r.pageMode && c.includes(r.pageMode) ? r.pageMode : c[0],
78
- onChange: (e) => s("pageMode", e)
78
+ onChange: (n) => s("pageMode", n)
79
79
  }
80
80
  )
81
81
  );
82
82
  case "theme":
83
83
  return l(
84
- a,
85
- n("firstRun.theme", "Theme"),
86
- /* @__PURE__ */ t(
87
- T,
84
+ t,
85
+ e("firstRun.theme", "Theme"),
86
+ /* @__PURE__ */ a(
87
+ P,
88
88
  {
89
89
  themes: u,
90
90
  value: r.theme,
91
- onChange: (e) => s("theme", e?.id),
91
+ onChange: (n) => s("theme", n?.id),
92
92
  showPreviewInValue: !0,
93
93
  showPreviewInMenu: !0,
94
94
  showTextInValue: !0,
@@ -98,13 +98,13 @@ function F({
98
98
  );
99
99
  case "language":
100
100
  return l(
101
- a,
102
- n("firstRun.language", "Language"),
103
- /* @__PURE__ */ t(
104
- P,
101
+ t,
102
+ e("firstRun.language", "Language"),
103
+ /* @__PURE__ */ a(
104
+ E,
105
105
  {
106
106
  value: r.language,
107
- onChange: (e) => s("language", e?.code),
107
+ onChange: (n) => s("language", n?.code),
108
108
  allowedCodes: f,
109
109
  priorityCodes: _,
110
110
  displayName: "native"
@@ -113,32 +113,33 @@ function F({
113
113
  );
114
114
  case "menu":
115
115
  return l(
116
- a,
117
- n("firstRun.menu", "Menu"),
116
+ t,
117
+ e("firstRun.menu", "Menu"),
118
118
  /* @__PURE__ */ o("div", { className: "nice-first-run__stack", children: [
119
- /* @__PURE__ */ t(
119
+ /* @__PURE__ */ a(
120
120
  d,
121
121
  {
122
122
  block: !0,
123
123
  options: [
124
- { value: "expanded", label: n("firstRun.menuExpanded", "Expanded") },
125
- { value: "icons", label: n("firstRun.menuIcons", "Icons only") }
124
+ { value: "expanded", label: e("firstRun.menuExpanded", "Expanded") },
125
+ { value: "icons", label: e("firstRun.menuIcons", "Icons only") }
126
126
  ],
127
127
  value: r.collapsed ? "icons" : "expanded",
128
- onChange: (e) => s("collapsed", e === "icons")
128
+ onChange: (n) => s("collapsed", n === "icons")
129
129
  }
130
130
  ),
131
- /* @__PURE__ */ t("span", { className: "nice-first-run__label", children: n("firstRun.colorStyle", "Branch colours") }),
132
- /* @__PURE__ */ t(
131
+ /* @__PURE__ */ a("span", { className: "nice-first-run__label", children: e("firstRun.colorStyle", "Branch colours") }),
132
+ /* @__PURE__ */ a(
133
133
  d,
134
134
  {
135
135
  block: !0,
136
136
  options: [
137
- { value: "bar", label: n("firstRun.colorStyleBar", "A bar by each item") },
138
- { value: "fill", label: n("firstRun.colorStyleFill", "Whole items filled") }
137
+ { value: "theme", label: e("firstRun.colorStyleTheme", "Theme colours") },
138
+ { value: "bar", label: e("firstRun.colorStyleBar", "A bar by each item") },
139
+ { value: "fill", label: e("firstRun.colorStyleFill", "Whole items filled") }
139
140
  ],
140
- value: r.colorStyle === "fill" ? "fill" : "bar",
141
- onChange: (e) => s("colorStyle", e)
141
+ value: r.colorStyle ?? "theme",
142
+ onChange: (n) => s("colorStyle", n)
142
143
  }
143
144
  )
144
145
  ] })