@nan0web/ui 1.8.0 → 1.10.0

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 (107) hide show
  1. package/README.md +29 -10
  2. package/package.json +18 -22
  3. package/src/Model/index.js +32 -3
  4. package/src/core/Form/Form.js +8 -7
  5. package/src/core/Form/Message.js +1 -1
  6. package/src/core/GeneratorRunner.js +10 -0
  7. package/src/core/Intent.js +21 -5
  8. package/src/core/IntentErrorModel.js +6 -1
  9. package/src/core/Stream.js +16 -5
  10. package/src/core/index.js +1 -1
  11. package/src/domain/FooterModel.js +57 -0
  12. package/src/domain/HeaderModel.js +50 -0
  13. package/src/domain/HeroModel.js +48 -0
  14. package/src/domain/Navigation.js +11 -10
  15. package/src/domain/SandboxModel.js +66 -115
  16. package/src/domain/ShowcaseAppModel.js +133 -50
  17. package/src/domain/components/AccordionModel.js +38 -0
  18. package/src/domain/components/AutocompleteModel.js +11 -21
  19. package/src/domain/components/BannerModel.js +37 -0
  20. package/src/domain/components/BreadcrumbModel.js +11 -9
  21. package/src/domain/components/ButtonModel.js +31 -58
  22. package/src/domain/components/CommentModel.js +44 -0
  23. package/src/domain/components/ConfirmModel.js +26 -33
  24. package/src/domain/components/EmptyStateModel.js +45 -0
  25. package/src/domain/components/FAQModel.js +32 -0
  26. package/src/domain/components/FooterConfigModel.js +26 -0
  27. package/src/domain/components/FooterVisibilityModel.js +48 -0
  28. package/src/domain/components/GalleryModel.js +36 -0
  29. package/src/domain/components/HeaderConfigModel.js +26 -0
  30. package/src/domain/components/HeaderVisibilityModel.js +54 -0
  31. package/src/domain/components/InputModel.js +21 -41
  32. package/src/domain/components/PriceModel.js +30 -0
  33. package/src/domain/components/PricingModel.js +39 -0
  34. package/src/domain/components/PricingSectionModel.js +32 -0
  35. package/src/domain/components/ProfileDropdownModel.js +45 -0
  36. package/src/domain/components/SelectModel.js +11 -21
  37. package/src/domain/components/SpinnerModel.js +11 -26
  38. package/src/domain/components/StatsItemModel.js +38 -0
  39. package/src/domain/components/StatsModel.js +32 -0
  40. package/src/domain/components/TableModel.js +11 -24
  41. package/src/domain/components/TabsModel.js +30 -0
  42. package/src/domain/components/TestimonialModel.js +24 -0
  43. package/src/domain/components/TimelineItemModel.js +38 -0
  44. package/src/domain/components/TimelineModel.js +32 -0
  45. package/src/domain/components/ToastModel.js +24 -51
  46. package/src/domain/components/TreeModel.js +10 -26
  47. package/src/domain/components/index.js +34 -0
  48. package/src/domain/index.js +24 -0
  49. package/src/index.js +2 -0
  50. package/src/testing/GalleryGenerator.js +85 -0
  51. package/src/testing/LogicInspector.js +55 -0
  52. package/src/testing/SnapshotInspector.js +84 -0
  53. package/src/testing/VisualAdapter.js +41 -0
  54. package/src/testing/index.js +3 -0
  55. package/types/Model/index.d.ts +62 -4
  56. package/types/core/Form/Form.d.ts +2 -2
  57. package/types/core/GeneratorRunner.d.ts +4 -0
  58. package/types/core/Intent.d.ts +31 -3
  59. package/types/core/IntentErrorModel.d.ts +4 -0
  60. package/types/core/index.d.ts +1 -1
  61. package/types/domain/FooterModel.d.ts +52 -0
  62. package/types/domain/HeaderModel.d.ts +45 -0
  63. package/types/domain/HeroModel.d.ts +43 -0
  64. package/types/domain/Navigation.d.ts +10 -9
  65. package/types/domain/SandboxModel.d.ts +16 -40
  66. package/types/domain/ShowcaseAppModel.d.ts +26 -54
  67. package/types/domain/components/AccordionModel.d.ts +33 -0
  68. package/types/domain/components/AutocompleteModel.d.ts +10 -29
  69. package/types/domain/components/BannerModel.d.ts +32 -0
  70. package/types/domain/components/BreadcrumbModel.d.ts +13 -6
  71. package/types/domain/components/ButtonModel.d.ts +18 -54
  72. package/types/domain/components/CommentModel.d.ts +39 -0
  73. package/types/domain/components/ConfirmModel.d.ts +20 -35
  74. package/types/domain/components/EmptyStateModel.d.ts +40 -0
  75. package/types/domain/components/FAQModel.d.ts +27 -0
  76. package/types/domain/components/FooterConfigModel.d.ts +21 -0
  77. package/types/domain/components/FooterVisibilityModel.d.ts +43 -0
  78. package/types/domain/components/GalleryModel.d.ts +35 -0
  79. package/types/domain/components/HeaderConfigModel.d.ts +21 -0
  80. package/types/domain/components/HeaderVisibilityModel.d.ts +49 -0
  81. package/types/domain/components/HeroModel.d.ts +24 -0
  82. package/types/domain/components/InputModel.d.ts +19 -59
  83. package/types/domain/components/PriceModel.d.ts +25 -0
  84. package/types/domain/components/PricingModel.d.ts +34 -0
  85. package/types/domain/components/PricingSectionModel.d.ts +27 -0
  86. package/types/domain/components/ProfileDropdownModel.d.ts +40 -0
  87. package/types/domain/components/SelectModel.d.ts +13 -28
  88. package/types/domain/components/ShowcaseAppModel.d.ts +32 -0
  89. package/types/domain/components/SpinnerModel.d.ts +10 -27
  90. package/types/domain/components/StatsItemModel.d.ts +33 -0
  91. package/types/domain/components/StatsModel.d.ts +27 -0
  92. package/types/domain/components/TableModel.d.ts +10 -26
  93. package/types/domain/components/TabsModel.d.ts +28 -0
  94. package/types/domain/components/TestimonialModel.d.ts +18 -0
  95. package/types/domain/components/TimelineItemModel.d.ts +33 -0
  96. package/types/domain/components/TimelineModel.d.ts +27 -0
  97. package/types/domain/components/ToastModel.d.ts +16 -45
  98. package/types/domain/components/TreeModel.d.ts +13 -36
  99. package/types/domain/components/index.d.ts +20 -0
  100. package/types/domain/index.d.ts +4 -1
  101. package/types/index.d.ts +1 -0
  102. package/types/testing/GalleryGenerator.d.ts +1 -0
  103. package/types/testing/LogicInspector.d.ts +22 -0
  104. package/types/testing/SnapshotInspector.d.ts +17 -0
  105. package/types/testing/VisualAdapter.d.ts +15 -0
  106. package/types/testing/index.d.ts +3 -0
  107. package/src/README.md.js +0 -436
@@ -0,0 +1,43 @@
1
+ /**
2
+ * HeroModel — OLMUI Model-as-Schema
3
+ * Universal hero/banner section for landing pages.
4
+ * Uses Navigation[] for actions instead of a single CTA.
5
+ */
6
+ export default class HeroModel extends Model {
7
+ static $id: string;
8
+ static title: {
9
+ help: string;
10
+ placeholder: string;
11
+ default: string;
12
+ required: boolean;
13
+ };
14
+ static description: {
15
+ help: string;
16
+ placeholder: string;
17
+ default: string;
18
+ };
19
+ static image: {
20
+ help: string;
21
+ placeholder: string;
22
+ hint: string;
23
+ upload: boolean;
24
+ default: string;
25
+ };
26
+ static actions: {
27
+ help: string;
28
+ type: string;
29
+ hint: typeof Navigation;
30
+ default: never[];
31
+ };
32
+ /**
33
+ * @param {Partial<HeroModel> | Record<string, any>} data Model input data.
34
+ * @param {object} [options] Extended options (db, etc.)
35
+ */
36
+ constructor(data?: Partial<HeroModel> | Record<string, any>, options?: object);
37
+ /** @type {string} Hero main headline */ title: string;
38
+ /** @type {string} Hero sub-headline or description text */ description: string;
39
+ /** @type {string} Hero background or feature image URL */ image: string;
40
+ /** @type {Navigation[]} Call-to-action buttons (multiple CTA support) */ actions: Navigation[];
41
+ }
42
+ import { Model } from '@nan0web/types';
43
+ import Navigation from './Navigation.js';
@@ -37,14 +37,15 @@ export default class Navigation extends Model {
37
37
  default: boolean;
38
38
  };
39
39
  /**
40
- * @param {Partial<Navigation>} data
40
+ * @param {Partial<Navigation> | Record<string, any>} data Model input data.
41
+ * @param {object} [options] Extended options (db, etc.)
41
42
  */
42
- constructor(data?: Partial<Navigation>);
43
- /** @type {string|undefined} */ title: string | undefined;
44
- /** @type {string|undefined} */ href: string | undefined;
45
- /** @type {string|undefined} */ icon: string | undefined;
46
- /** @type {string|undefined} */ image: string | undefined;
47
- /** @type {Navigation[]|undefined} */ children: Navigation[] | undefined;
48
- /** @type {boolean|undefined} */ hidden: boolean | undefined;
43
+ constructor(data?: Partial<Navigation> | Record<string, any>, options?: object);
44
+ /** @type {string} Label for the menu item */ title: string;
45
+ /** @type {string} URL or internal app route */ href: string;
46
+ /** @type {string} Icon name/ID */ icon: string;
47
+ /** @type {string} Display image or thumbnail */ image: string;
48
+ /** @type {Navigation[]} Nested sub-menu navigation */ children: Navigation[];
49
+ /** @type {boolean} Hide from lists/menus */ hidden: boolean;
49
50
  }
50
- import { Model } from '@nan0web/core';
51
+ import { Model } from '@nan0web/types';
@@ -1,25 +1,9 @@
1
1
  /**
2
- * @typedef {Object} SandboxData
3
- * @property {string[]} [components]
4
- * @property {string} [selectedComponent]
5
- * @property {string} [themeFormat]
6
- */
7
- /**
8
- * Model-as-Schema for the UI Sandbox environment.
9
- * Represents a tool wrapping standard OLMUI components, allowing
10
- * users to inspect their models, tweak variables interactively,
11
- * and export the configuration as themes for the Marketplace.
12
- *
13
- * Navigation uses BreadcrumbModel:
14
- * ESC = pop one level (if stack has no parent → exit app)
15
- * Ctrl+C = always exit (handled by prompts.js wrapper)
16
- *
17
- * URL mapping:
18
- * /sandbox → Select Component
19
- * /sandbox/button → Edit Button properties
20
- * /sandbox/button/export → Choose export format
2
+ * SandboxModel OLMUI Model-as-Schema
3
+ * Environment for testing and previewing UI components with dynamic property editing.
21
4
  */
22
5
  export class SandboxModel extends Model {
6
+ static $id: string;
23
7
  static components: {
24
8
  help: string;
25
9
  type: string;
@@ -27,7 +11,8 @@ export class SandboxModel extends Model {
27
11
  };
28
12
  static selectedComponent: {
29
13
  help: string;
30
- type: string;
14
+ placeholder: string;
15
+ default: string;
31
16
  };
32
17
  static themeFormat: {
33
18
  help: string;
@@ -35,25 +20,16 @@ export class SandboxModel extends Model {
35
20
  default: string;
36
21
  };
37
22
  /**
38
- * @param {SandboxData | any} [data]
23
+ * @param {Partial<SandboxModel> | Record<string, any>} data Model input data.
24
+ * @param {object} [options] Extended options (db, etc.)
39
25
  */
40
- constructor(data?: SandboxData | any);
41
- /** @type {string[]|undefined} */ components: string[] | undefined;
42
- /** @type {string|undefined} */ selectedComponent: string | undefined;
43
- /** @type {string|undefined} */ themeFormat: string | undefined;
44
- run(): AsyncGenerator<any, {
45
- type: string;
46
- data: {
47
- targetComponent: string | undefined;
48
- themeConfig: any;
49
- exportFormat: string | undefined;
50
- breadcrumb: string;
51
- };
52
- }, any>;
26
+ constructor(data?: Partial<SandboxModel> | Record<string, any>, options?: object);
27
+ /** @type {string[]} List of registered UI components available for inspection */ components: string[];
28
+ /** @type {string} The component currently being inspected in the sandbox */ selectedComponent: string;
29
+ /** @type {'yaml'|'css'|'json'} The file format chosen to export the custom theme configuration */ themeFormat: "yaml" | "css" | "json";
30
+ /**
31
+ * @returns {AsyncGenerator<any, any, any>}
32
+ */
33
+ run(): AsyncGenerator<any, any, any>;
53
34
  }
54
- export type SandboxData = {
55
- components?: string[] | undefined;
56
- selectedComponent?: string | undefined;
57
- themeFormat?: string | undefined;
58
- };
59
- import { Model } from '@nan0web/core';
35
+ import { Model } from '@nan0web/types';
@@ -1,64 +1,36 @@
1
1
  /**
2
2
  * Model-as-Schema for the entire UI Sandbox Showcase.
3
3
  * Represents a complete User Journey demonstrating all components.
4
- * Showcases OLMUI Scenario Testing capabilities.
5
4
  */
6
5
  export class ShowcaseAppModel extends Model {
7
- static appName: {
6
+ static $id: string;
7
+ static UI: {
8
+ appName: string;
9
+ startBtn: string;
10
+ generateConfirm: string;
11
+ aborted: string;
12
+ success: string;
13
+ cancelled: string;
14
+ tableProperty: string;
15
+ tableValue: string;
16
+ tableStatus: string;
17
+ tableStatusActive: string;
18
+ };
19
+ static appTitle: {
20
+ alias: string;
8
21
  help: string;
9
22
  default: string;
10
23
  type: string;
11
24
  };
12
- constructor(data?: {});
13
- /** @type {string|undefined} */ appName: string | undefined;
14
- run(): AsyncGenerator<{
15
- type: string;
16
- field: string;
17
- schema: {
18
- help: string;
19
- };
20
- component: string;
21
- model: any;
22
- } | {
23
- type: string;
24
- field: string;
25
- schema: {
26
- help: string | undefined;
27
- type: string;
28
- };
29
- component: string;
30
- model: any;
31
- } | {
32
- type: string;
33
- level: string;
34
- message: string | undefined;
35
- component: string;
36
- model: any;
37
- } | {
38
- type: string;
39
- message: string;
40
- component: string;
41
- model: any;
42
- }, {
43
- type: string;
44
- data: {
45
- success: boolean;
46
- reason: string;
47
- profile?: undefined;
48
- rowsDisplayed?: undefined;
49
- };
50
- } | {
51
- type: string;
52
- data: {
53
- success: boolean;
54
- profile: {
55
- userName: string;
56
- role: string;
57
- tool: string;
58
- };
59
- rowsDisplayed: number;
60
- reason?: undefined;
61
- };
62
- }, unknown>;
25
+ /**
26
+ * @param {Partial<ShowcaseAppModel> | Record<string, any>} data Model input data.
27
+ * @param {object} [options] Extended options (db, etc.)
28
+ */
29
+ constructor(data?: Partial<ShowcaseAppModel> | Record<string, any>, options?: object);
30
+ /** @type {string} App name help */ appTitle: string;
31
+ /**
32
+ * @returns {AsyncGenerator<any, any, any>}
33
+ */
34
+ run(): AsyncGenerator<any, any, any>;
63
35
  }
64
- import { Model } from '@nan0web/core';
36
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * AccordionModel — OLMUI Model-as-Schema
3
+ * Collapsible FAQ / accordion item with title + content.
4
+ */
5
+ export class AccordionModel extends Model {
6
+ static $id: string;
7
+ static title: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ required: boolean;
12
+ };
13
+ static content: {
14
+ help: string;
15
+ placeholder: string;
16
+ default: string;
17
+ required: boolean;
18
+ };
19
+ static open: {
20
+ help: string;
21
+ default: boolean;
22
+ type: string;
23
+ };
24
+ /**
25
+ * @param {Partial<AccordionModel> | Record<string, any>} data Model input data.
26
+ * @param {object} [options] Extended options (db, etc.)
27
+ */
28
+ constructor(data?: Partial<AccordionModel> | Record<string, any>, options?: object);
29
+ /** @type {string} Accordion item header / question */ title: string;
30
+ /** @type {string} Accordion item body / answer (supports markdown) */ content: string;
31
+ /** @type {boolean} Whether the item is expanded by default */ open: boolean;
32
+ }
33
+ import { Model } from '@nan0web/types';
@@ -1,8 +1,3 @@
1
- /**
2
- * @typedef {Object} AutocompleteData
3
- * @property {string} [content]
4
- * @property {string[]} [options]
5
- */
6
1
  /**
7
2
  * Model-as-Schema for Autocomplete component.
8
3
  * Represents a text input with search suggestions.
@@ -19,29 +14,15 @@ export class AutocompleteModel extends Model {
19
14
  type: string;
20
15
  };
21
16
  /**
22
- * @param {AutocompleteData | any} [data]
17
+ * @param {Partial<AutocompleteModel> | Record<string, any>} data Model input data.
18
+ * @param {object} [options] Extended options (db, etc.)
23
19
  */
24
- constructor(data?: AutocompleteData | any);
25
- /** @type {string|undefined} */ content: string | undefined;
26
- /** @type {string[]|undefined} */ options: string[] | undefined;
27
- run(): AsyncGenerator<{
28
- type: string;
29
- field: string;
30
- schema: {
31
- help: string;
32
- options: string[] | undefined;
33
- };
34
- component: string;
35
- model: any;
36
- }, {
37
- type: string;
38
- data: {
39
- selected: string | undefined;
40
- };
41
- }, unknown>;
20
+ constructor(data?: Partial<AutocompleteModel> | Record<string, any>, options?: object);
21
+ /** @type {string} Current search text */ content: string;
22
+ /** @type {string[]} List of suggestions based on input */ options: string[];
23
+ /**
24
+ * @returns {AsyncGenerator<any, any, any>}
25
+ */
26
+ run(): AsyncGenerator<any, any, any>;
42
27
  }
43
- export type AutocompleteData = {
44
- content?: string | undefined;
45
- options?: string[] | undefined;
46
- };
47
- import { Model } from '@nan0web/core';
28
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,32 @@
1
+ /**
2
+ * BannerModel — OLMUI Model-as-Schema
3
+ * Global notification bar (cookies, maintenance, announcements).
4
+ */
5
+ export class BannerModel extends Model {
6
+ static $id: string;
7
+ static text: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ required: boolean;
12
+ };
13
+ static href: {
14
+ help: string;
15
+ placeholder: string;
16
+ default: string;
17
+ };
18
+ static closable: {
19
+ help: string;
20
+ default: boolean;
21
+ type: string;
22
+ };
23
+ /**
24
+ * @param {Partial<BannerModel> | Record<string, any>} data Model input data.
25
+ * @param {object} [options] Extended options (db, etc.)
26
+ */
27
+ constructor(data?: Partial<BannerModel> | Record<string, any>, options?: object);
28
+ /** @type {string} Banner message text */ text: string;
29
+ /** @type {string} Optional link for "Learn more" or action URL */ href: string;
30
+ /** @type {boolean} Whether the user can dismiss the banner */ closable: boolean;
31
+ }
32
+ import { Model } from '@nan0web/types';
@@ -51,11 +51,12 @@ export class BreadcrumbModel extends Model {
51
51
  */
52
52
  static slugify(label: string): string;
53
53
  /**
54
- * @param {BreadcrumbData | any} [data]
54
+ * @param {BreadcrumbData | Record<string, any>} data Model input data.
55
+ * @param {object} [options] Extended options (db, etc.)
55
56
  */
56
- constructor(data?: BreadcrumbData | any);
57
- /** @type {BreadcrumbItem[]} */ items: BreadcrumbItem[];
58
- /** @type {string} */ separator: string;
57
+ constructor(data?: BreadcrumbData | Record<string, any>, options?: object);
58
+ /** @type {BreadcrumbItem[]} Navigation stack */ items: BreadcrumbItem[];
59
+ /** @type {string} Visual separator between breadcrumb segments */ separator: string;
59
60
  /**
60
61
  * Push a new level onto the navigation stack.
61
62
  *
@@ -138,7 +139,13 @@ export class BreadcrumbModel extends Model {
138
139
  * Yields a log intent with the current breadcrumb path.
139
140
  * This is a "display-only" run — it shows the navigation state.
140
141
  */
141
- run(): AsyncGenerator<any, {
142
+ run(): AsyncGenerator<{
143
+ type: string;
144
+ level: string;
145
+ message: string;
146
+ component: string;
147
+ model: BreadcrumbModel;
148
+ }, {
142
149
  type: string;
143
150
  data: {
144
151
  path: string;
@@ -161,4 +168,4 @@ export type BreadcrumbData = {
161
168
  items?: BreadcrumbItem[] | undefined;
162
169
  separator?: string | undefined;
163
170
  };
164
- import { Model } from '@nan0web/core';
171
+ import { Model } from '@nan0web/types';
@@ -1,38 +1,20 @@
1
- /**
2
- * @typedef {'primary'|'secondary'|'info'|'ok'|'warn'|'err'|'ghost'} ButtonVariant
3
- * @typedef {'sm'|'md'|'lg'} ButtonSize
4
- * @typedef {Object} ButtonData
5
- * @property {string} [content]
6
- * @property {ButtonVariant} [variant]
7
- * @property {ButtonSize} [size]
8
- * @property {boolean} [outline]
9
- * @property {boolean} [disabled]
10
- * @property {boolean} [loading]
11
- */
12
1
  /**
13
2
  * Model-as-Schema for Button component.
14
- * Represents the intention and state of a Button interaction.
15
- * Used exclusively for schema definition and editor validation.
16
3
  */
17
4
  export class ButtonModel extends Model {
18
- static content: {
19
- help: string;
20
- default: string;
21
- type: string;
22
- };
23
5
  static variant: {
24
6
  help: string;
25
7
  default: string;
26
8
  options: string[];
27
9
  };
28
- static size: {
10
+ static content: {
29
11
  help: string;
30
12
  default: string;
31
- options: string[];
13
+ type: string;
32
14
  };
33
- static outline: {
15
+ static href: {
34
16
  help: string;
35
- default: boolean;
17
+ default: string;
36
18
  type: string;
37
19
  };
38
20
  static disabled: {
@@ -40,42 +22,24 @@ export class ButtonModel extends Model {
40
22
  default: boolean;
41
23
  type: string;
42
24
  };
43
- static loading: {
25
+ static clicked: {
44
26
  help: string;
45
27
  default: boolean;
46
28
  type: string;
47
29
  };
48
30
  /**
49
- * @param {ButtonData | any} [data]
31
+ * @param {Partial<ButtonModel> | Record<string, any>} data Model input data.
32
+ * @param {object} [options] Extended options (db, etc.)
50
33
  */
51
- constructor(data?: ButtonData | any);
52
- /** @type {string|undefined} */ content: string | undefined;
53
- /** @type {ButtonVariant|undefined} */ variant: ButtonVariant | undefined;
54
- /** @type {ButtonSize|undefined} */ size: ButtonSize | undefined;
55
- /** @type {boolean|undefined} */ outline: boolean | undefined;
56
- /** @type {boolean|undefined} */ disabled: boolean | undefined;
57
- /** @type {boolean|undefined} */ loading: boolean | undefined;
58
- run(): AsyncGenerator<{
59
- type: string;
60
- field: string;
61
- schema: {
62
- help: string;
63
- };
64
- component: string;
65
- model: any;
66
- }, {
67
- type: string;
68
- data: any;
69
- }, unknown>;
34
+ constructor(data?: Partial<ButtonModel> | Record<string, any>, options?: object);
35
+ /** @type {'primary'|'secondary'|'danger'|'ghost'} Button visual style */ variant: "primary" | "secondary" | "danger" | "ghost";
36
+ /** @type {string} Text displayed inside the button */ content: string;
37
+ /** @type {string} Optional link URL */ href: string;
38
+ /** @type {boolean} Whether the button can be clicked */ disabled: boolean;
39
+ /** @type {boolean} Reactive flag set to true when user activates the button */ clicked: boolean;
40
+ /**
41
+ * @returns {AsyncGenerator<any, any, any>}
42
+ */
43
+ run(): AsyncGenerator<any, any, any>;
70
44
  }
71
- export type ButtonVariant = "primary" | "secondary" | "info" | "ok" | "warn" | "err" | "ghost";
72
- export type ButtonSize = "sm" | "md" | "lg";
73
- export type ButtonData = {
74
- content?: string | undefined;
75
- variant?: ButtonVariant | undefined;
76
- size?: ButtonSize | undefined;
77
- outline?: boolean | undefined;
78
- disabled?: boolean | undefined;
79
- loading?: boolean | undefined;
80
- };
81
- import { Model } from '@nan0web/core';
45
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * CommentModel — OLMUI Model-as-Schema
3
+ * Base model for user-generated comments / reviews.
4
+ */
5
+ export class CommentModel extends Model {
6
+ static $id: string;
7
+ static author: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ required: boolean;
12
+ };
13
+ static avatar: {
14
+ help: string;
15
+ placeholder: string;
16
+ default: string;
17
+ };
18
+ static text: {
19
+ help: string;
20
+ placeholder: string;
21
+ default: string;
22
+ required: boolean;
23
+ };
24
+ static date: {
25
+ help: string;
26
+ placeholder: string;
27
+ default: string;
28
+ };
29
+ /**
30
+ * @param {Partial<CommentModel> | Record<string, any>} data Model input data.
31
+ * @param {object} [options] Extended options (db, etc.)
32
+ */
33
+ constructor(data?: Partial<CommentModel> | Record<string, any>, options?: object);
34
+ /** @type {string} Author name */ author: string;
35
+ /** @type {string} Author avatar image URL */ avatar: string;
36
+ /** @type {string} Comment body text */ text: string;
37
+ /** @type {string} Comment date (ISO 8601) */ date: string;
38
+ }
39
+ import { Model } from '@nan0web/types';
@@ -1,54 +1,39 @@
1
1
  /**
2
- * @typedef {Object} ConfirmData
3
- * @property {string} [message]
4
- * @property {string} [confirmText]
5
- * @property {string} [cancelText]
6
- */
7
- /**
8
- * Model-as-Schema for Confirm component.
2
+ * Model-as-Schema for Confirmation dialog.
9
3
  */
10
4
  export class ConfirmModel extends Model {
5
+ static title: {
6
+ help: string;
7
+ default: string;
8
+ type: string;
9
+ };
11
10
  static message: {
12
11
  help: string;
13
12
  default: string;
14
13
  type: string;
15
14
  };
16
- static confirmText: {
15
+ static okLabel: {
17
16
  help: string;
18
17
  default: string;
19
18
  type: string;
20
19
  };
21
- static cancelText: {
20
+ static cancelLabel: {
22
21
  help: string;
23
22
  default: string;
24
23
  type: string;
25
24
  };
26
25
  /**
27
- * @param {ConfirmData | any} [data]
26
+ * @param {Partial<ConfirmModel> | Record<string, any>} data Model input data.
27
+ * @param {object} [options] Extended options (db, etc.)
28
28
  */
29
- constructor(data?: ConfirmData | any);
30
- /** @type {string|undefined} */ message: string | undefined;
31
- /** @type {string|undefined} */ confirmText: string | undefined;
32
- /** @type {string|undefined} */ cancelText: string | undefined;
33
- run(): AsyncGenerator<{
34
- type: string;
35
- field: string;
36
- schema: {
37
- help: string | undefined;
38
- type: string;
39
- };
40
- component: string;
41
- model: any;
42
- }, {
43
- type: string;
44
- data: {
45
- confirmed: boolean;
46
- };
47
- }, unknown>;
29
+ constructor(data?: Partial<ConfirmModel> | Record<string, any>, options?: object);
30
+ /** @type {string} Short title for the action */ title: string;
31
+ /** @type {string} The question asked to the user */ message: string;
32
+ /** @type {string} Text for the confirm button */ okLabel: string;
33
+ /** @type {string} Text for the cancel button */ cancelLabel: string;
34
+ /**
35
+ * @returns {AsyncGenerator<any, any, any>}
36
+ */
37
+ run(): AsyncGenerator<any, any, any>;
48
38
  }
49
- export type ConfirmData = {
50
- message?: string | undefined;
51
- confirmText?: string | undefined;
52
- cancelText?: string | undefined;
53
- };
54
- import { Model } from '@nan0web/core';
39
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,40 @@
1
+ /**
2
+ * EmptyStateModel — OLMUI Model-as-Schema
3
+ * Onboarding placeholder for empty tables, lists, or dashboards.
4
+ */
5
+ export class EmptyStateModel extends Model {
6
+ static $id: string;
7
+ static icon: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ };
12
+ static title: {
13
+ help: string;
14
+ placeholder: string;
15
+ default: string;
16
+ required: boolean;
17
+ };
18
+ static description: {
19
+ help: string;
20
+ placeholder: string;
21
+ default: string;
22
+ };
23
+ static action: {
24
+ help: string;
25
+ type: string;
26
+ hint: typeof Navigation;
27
+ default: null;
28
+ };
29
+ /**
30
+ * @param {Partial<EmptyStateModel> | Record<string, any>} data Model input data.
31
+ * @param {object} [options] Extended options (db, etc.)
32
+ */
33
+ constructor(data?: Partial<EmptyStateModel> | Record<string, any>, options?: object);
34
+ /** @type {string} Illustration or icon name for the empty state */ icon: string;
35
+ /** @type {string} Empty state headline */ title: string;
36
+ /** @type {string} Helpful description guiding the user */ description: string;
37
+ /** @type {Navigation|null} Primary CTA action (Navigation link or button) */ action: Navigation | null;
38
+ }
39
+ import { Model } from '@nan0web/types';
40
+ import Navigation from '../Navigation.js';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * FAQModel — OLMUI Model-as-Schema
3
+ * A section containing a title and a collection of FAQ (accordion) items.
4
+ */
5
+ export class FAQModel extends Model {
6
+ static $id: string;
7
+ static title: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ };
12
+ static items: {
13
+ help: string;
14
+ type: string;
15
+ hint: typeof AccordionModel;
16
+ default: never[];
17
+ };
18
+ /**
19
+ * @param {Partial<FAQModel> | Record<string, any>} data Model input data.
20
+ * @param {object} [options] Extended options (db, etc.)
21
+ */
22
+ constructor(data?: Partial<FAQModel> | Record<string, any>, options?: object);
23
+ /** @type {string} Section title */ title: string;
24
+ /** @type {AccordionModel[]} Array of FAQ items */ items: AccordionModel[];
25
+ }
26
+ import { Model } from '@nan0web/types';
27
+ import { AccordionModel } from './AccordionModel.js';