@nan0web/ui 1.8.0 → 1.9.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 (82) hide show
  1. package/package.json +9 -10
  2. package/src/core/Intent.js +4 -3
  3. package/src/domain/FooterModel.js +57 -0
  4. package/src/domain/HeaderModel.js +50 -0
  5. package/src/domain/HeroModel.js +48 -0
  6. package/src/domain/Navigation.js +11 -10
  7. package/src/domain/SandboxModel.js +66 -115
  8. package/src/domain/ShowcaseAppModel.js +133 -50
  9. package/src/domain/components/AccordionModel.js +38 -0
  10. package/src/domain/components/AutocompleteModel.js +11 -21
  11. package/src/domain/components/BannerModel.js +37 -0
  12. package/src/domain/components/BreadcrumbModel.js +11 -9
  13. package/src/domain/components/ButtonModel.js +31 -58
  14. package/src/domain/components/CommentModel.js +44 -0
  15. package/src/domain/components/ConfirmModel.js +26 -33
  16. package/src/domain/components/EmptyStateModel.js +45 -0
  17. package/src/domain/components/FAQModel.js +32 -0
  18. package/src/domain/components/FooterConfigModel.js +26 -0
  19. package/src/domain/components/FooterVisibilityModel.js +48 -0
  20. package/src/domain/components/GalleryModel.js +36 -0
  21. package/src/domain/components/HeaderConfigModel.js +26 -0
  22. package/src/domain/components/HeaderVisibilityModel.js +54 -0
  23. package/src/domain/components/InputModel.js +21 -41
  24. package/src/domain/components/PriceModel.js +30 -0
  25. package/src/domain/components/PricingModel.js +39 -0
  26. package/src/domain/components/PricingSectionModel.js +32 -0
  27. package/src/domain/components/ProfileDropdownModel.js +45 -0
  28. package/src/domain/components/SelectModel.js +11 -21
  29. package/src/domain/components/SpinnerModel.js +11 -26
  30. package/src/domain/components/StatsItemModel.js +38 -0
  31. package/src/domain/components/StatsModel.js +32 -0
  32. package/src/domain/components/TableModel.js +11 -24
  33. package/src/domain/components/TabsModel.js +30 -0
  34. package/src/domain/components/TestimonialModel.js +24 -0
  35. package/src/domain/components/TimelineItemModel.js +38 -0
  36. package/src/domain/components/TimelineModel.js +32 -0
  37. package/src/domain/components/ToastModel.js +24 -51
  38. package/src/domain/components/TreeModel.js +10 -26
  39. package/src/domain/components/index.js +34 -0
  40. package/src/domain/index.js +24 -0
  41. package/src/index.js +2 -0
  42. package/types/domain/FooterModel.d.ts +52 -0
  43. package/types/domain/HeaderModel.d.ts +45 -0
  44. package/types/domain/HeroModel.d.ts +43 -0
  45. package/types/domain/Navigation.d.ts +10 -9
  46. package/types/domain/SandboxModel.d.ts +16 -40
  47. package/types/domain/ShowcaseAppModel.d.ts +26 -54
  48. package/types/domain/components/AccordionModel.d.ts +33 -0
  49. package/types/domain/components/AutocompleteModel.d.ts +10 -29
  50. package/types/domain/components/BannerModel.d.ts +32 -0
  51. package/types/domain/components/BreadcrumbModel.d.ts +13 -6
  52. package/types/domain/components/ButtonModel.d.ts +18 -54
  53. package/types/domain/components/CommentModel.d.ts +39 -0
  54. package/types/domain/components/ConfirmModel.d.ts +20 -35
  55. package/types/domain/components/EmptyStateModel.d.ts +40 -0
  56. package/types/domain/components/FAQModel.d.ts +27 -0
  57. package/types/domain/components/FooterConfigModel.d.ts +21 -0
  58. package/types/domain/components/FooterVisibilityModel.d.ts +43 -0
  59. package/types/domain/components/GalleryModel.d.ts +35 -0
  60. package/types/domain/components/HeaderConfigModel.d.ts +21 -0
  61. package/types/domain/components/HeaderVisibilityModel.d.ts +49 -0
  62. package/types/domain/components/HeroModel.d.ts +24 -0
  63. package/types/domain/components/InputModel.d.ts +19 -59
  64. package/types/domain/components/PriceModel.d.ts +25 -0
  65. package/types/domain/components/PricingModel.d.ts +34 -0
  66. package/types/domain/components/PricingSectionModel.d.ts +27 -0
  67. package/types/domain/components/ProfileDropdownModel.d.ts +40 -0
  68. package/types/domain/components/SelectModel.d.ts +13 -28
  69. package/types/domain/components/ShowcaseAppModel.d.ts +32 -0
  70. package/types/domain/components/SpinnerModel.d.ts +10 -27
  71. package/types/domain/components/StatsItemModel.d.ts +33 -0
  72. package/types/domain/components/StatsModel.d.ts +27 -0
  73. package/types/domain/components/TableModel.d.ts +10 -26
  74. package/types/domain/components/TabsModel.d.ts +28 -0
  75. package/types/domain/components/TestimonialModel.d.ts +18 -0
  76. package/types/domain/components/TimelineItemModel.d.ts +33 -0
  77. package/types/domain/components/TimelineModel.d.ts +27 -0
  78. package/types/domain/components/ToastModel.d.ts +16 -45
  79. package/types/domain/components/TreeModel.d.ts +13 -36
  80. package/types/domain/components/index.d.ts +20 -0
  81. package/types/domain/index.d.ts +4 -1
  82. package/types/index.d.ts +1 -0
@@ -0,0 +1,35 @@
1
+ /**
2
+ * GalleryModel — OLMUI Model-as-Schema
3
+ * Image gallery / media grid with optional captions.
4
+ */
5
+ export class GalleryModel 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
+ default: never[];
16
+ };
17
+ static columns: {
18
+ help: string;
19
+ default: number;
20
+ type: string;
21
+ };
22
+ /**
23
+ * @param {Partial<GalleryModel> | Record<string, any>} data Model input data.
24
+ * @param {object} [options] Extended options (db, etc.)
25
+ */
26
+ constructor(data?: Partial<GalleryModel> | Record<string, any>, options?: object);
27
+ /** @type {string} Gallery section title */ title: string;
28
+ /** @type {Array<{src: string, caption?: string, alt?: string}>} Gallery items */ items: Array<{
29
+ src: string;
30
+ caption?: string;
31
+ alt?: string;
32
+ }>;
33
+ /** @type {number} Number of columns in grid layout */ columns: number;
34
+ }
35
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * HeaderConfigModel — OLMUI Model-as-Schema
3
+ * Configuration container mapping UI variant keys to HeaderVisibilityModel instances.
4
+ */
5
+ export class HeaderConfigModel extends Model {
6
+ static $id: string;
7
+ static ui: {
8
+ help: string;
9
+ type: string;
10
+ hint: typeof HeaderVisibilityModel;
11
+ default: {};
12
+ };
13
+ /**
14
+ * @param {Partial<HeaderConfigModel> | Record<string, any>} data Model input data.
15
+ * @param {object} [options] Extended options (db, etc.)
16
+ */
17
+ constructor(data?: Partial<HeaderConfigModel> | Record<string, any>, options?: object);
18
+ /** @type {Record<string, HeaderVisibilityModel>} Map of UI variant name → HeaderVisibilityModel */ ui: Record<string, HeaderVisibilityModel>;
19
+ }
20
+ import { Model } from '@nan0web/types';
21
+ import { HeaderVisibilityModel } from './HeaderVisibilityModel.js';
@@ -0,0 +1,49 @@
1
+ /**
2
+ * HeaderVisibilityModel — OLMUI Model-as-Schema
3
+ * Boolean flags controlling which header elements are visible.
4
+ */
5
+ export class HeaderVisibilityModel extends Model {
6
+ static $id: string;
7
+ static logo: {
8
+ help: string;
9
+ default: boolean;
10
+ type: string;
11
+ };
12
+ static theme: {
13
+ help: string;
14
+ default: boolean;
15
+ type: string;
16
+ };
17
+ static search: {
18
+ help: string;
19
+ default: boolean;
20
+ type: string;
21
+ };
22
+ static share: {
23
+ help: string;
24
+ default: boolean;
25
+ type: string;
26
+ };
27
+ static nav: {
28
+ help: string;
29
+ default: boolean;
30
+ type: string;
31
+ };
32
+ static langs: {
33
+ help: string;
34
+ default: boolean;
35
+ type: string;
36
+ };
37
+ /**
38
+ * @param {Partial<HeaderVisibilityModel> | Record<string, any>} data Model input data.
39
+ * @param {object} [options] Extended options (db, etc.)
40
+ */
41
+ constructor(data?: Partial<HeaderVisibilityModel> | Record<string, any>, options?: object);
42
+ /** @type {boolean} Show logo */ logo: boolean;
43
+ /** @type {boolean} Show theme toggle (dark/light) */ theme: boolean;
44
+ /** @type {boolean} Show search input */ search: boolean;
45
+ /** @type {boolean} Show share button */ share: boolean;
46
+ /** @type {boolean} Show navigation links */ nav: boolean;
47
+ /** @type {boolean} Show language switcher */ langs: boolean;
48
+ }
49
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * HeroModel — OLMUI Model-as-Schema
3
+ * Main landing page banner with a big heading, description, and primary CTA.
4
+ */
5
+ export class HeroModel extends Model {
6
+ static $id: string;
7
+ static title: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ required: boolean;
12
+ };
13
+ static description: {
14
+ help: string;
15
+ placeholder: string;
16
+ default: string;
17
+ };
18
+ static actions: {
19
+ help: string;
20
+ type: string;
21
+ default: never[];
22
+ };
23
+ }
24
+ import { Model } from '@nan0web/core';
@@ -1,21 +1,5 @@
1
- /**
2
- * @typedef {'text'|'email'|'password'|'number'|'tel'|'url'|'date'} InputType
3
- * @typedef {Object} InputData
4
- * @property {InputType} [type]
5
- * @property {string} [label]
6
- * @property {string} [placeholder]
7
- * @property {boolean} [required]
8
- * @property {string} [pattern]
9
- * @property {string} [min]
10
- * @property {string} [max]
11
- * @property {string} [step]
12
- * @property {string} [hint]
13
- * @property {boolean} [disabled]
14
- * @property {string} [content]
15
- */
16
1
  /**
17
2
  * Model-as-Schema for Input component.
18
- * Used exclusively for schema definition, validation, and editor reflection.
19
3
  */
20
4
  export class InputModel extends Model {
21
5
  static type: {
@@ -74,48 +58,24 @@ export class InputModel extends Model {
74
58
  type: string;
75
59
  };
76
60
  /**
77
- * @param {InputData | any} [data]
61
+ * @param {Partial<InputModel> | Record<string, any>} data Model input data.
62
+ * @param {object} [options] Extended options (db, etc.)
78
63
  */
79
- constructor(data?: InputData | any);
80
- /** @type {InputType|undefined} */ type: InputType | undefined;
81
- /** @type {string|undefined} */ label: string | undefined;
82
- /** @type {string|undefined} */ placeholder: string | undefined;
83
- /** @type {boolean|undefined} */ required: boolean | undefined;
84
- /** @type {string|undefined} */ pattern: string | undefined;
85
- /** @type {string|undefined} */ min: string | undefined;
86
- /** @type {string|undefined} */ max: string | undefined;
87
- /** @type {string|undefined} */ step: string | undefined;
88
- /** @type {string|undefined} */ hint: string | undefined;
89
- /** @type {boolean|undefined} */ disabled: boolean | undefined;
90
- /** @type {string|undefined} */ content: string | undefined;
91
- run(): AsyncGenerator<{
92
- type: string;
93
- field: string;
94
- schema: {
95
- help: string;
96
- validate: (val: any) => true | "This field is required" | "Invalid format";
97
- };
98
- component: string;
99
- model: any;
100
- }, {
101
- type: string;
102
- data: {
103
- value: string | undefined;
104
- };
105
- }, unknown>;
64
+ constructor(data?: Partial<InputModel> | Record<string, any>, options?: object);
65
+ /** @type {string} HTML5 Input type attribute */ type: string;
66
+ /** @type {string} Label displayed above the input */ label: string;
67
+ /** @type {string} Placeholder text shown when empty */ placeholder: string;
68
+ /** @type {boolean} Whether the field must be filled out */ required: boolean;
69
+ /** @type {string} RegExp pattern for validation */ pattern: string;
70
+ /** @type {string} Minimum value */ min: string;
71
+ /** @type {string} Maximum value */ max: string;
72
+ /** @type {string} Step interval */ step: string;
73
+ /** @type {string} Helper text displayed below the input */ hint: string;
74
+ /** @type {boolean} Whether the input is disabled */ disabled: boolean;
75
+ /** @type {string} The actual value of the input */ content: string;
76
+ /**
77
+ * @returns {AsyncGenerator<any, any, any>}
78
+ */
79
+ run(): AsyncGenerator<any, any, any>;
106
80
  }
107
- export type InputType = "text" | "email" | "password" | "number" | "tel" | "url" | "date";
108
- export type InputData = {
109
- type?: InputType | undefined;
110
- label?: string | undefined;
111
- placeholder?: string | undefined;
112
- required?: boolean | undefined;
113
- pattern?: string | undefined;
114
- min?: string | undefined;
115
- max?: string | undefined;
116
- step?: string | undefined;
117
- hint?: string | undefined;
118
- disabled?: boolean | undefined;
119
- content?: string | undefined;
120
- };
121
- import { Model } from '@nan0web/core';
81
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * PriceModel — OLMUI Model-as-Schema
3
+ * Represents a monetary value with currency.
4
+ */
5
+ export class PriceModel extends Model {
6
+ static $id: string;
7
+ static value: {
8
+ help: string;
9
+ default: number;
10
+ type: string;
11
+ };
12
+ static currency: {
13
+ help: string;
14
+ placeholder: string;
15
+ default: string;
16
+ };
17
+ /**
18
+ * @param {Partial<PriceModel> | Record<string, any>} data Model input data.
19
+ * @param {object} [options] Extended options (db, etc.)
20
+ */
21
+ constructor(data?: Partial<PriceModel> | Record<string, any>, options?: object);
22
+ /** @type {number} Numeric price value */ value: number;
23
+ /** @type {string} Currency code (ISO 4217) */ currency: string;
24
+ }
25
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * PricingModel — OLMUI Model-as-Schema
3
+ * A pricing tier/plan with title, price, and feature list.
4
+ */
5
+ export class PricingModel extends Model {
6
+ static $id: string;
7
+ static title: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ required: boolean;
12
+ };
13
+ static price: {
14
+ help: string;
15
+ type: string;
16
+ hint: typeof PriceModel;
17
+ default: null;
18
+ };
19
+ static features: {
20
+ help: string;
21
+ type: string;
22
+ default: never[];
23
+ };
24
+ /**
25
+ * @param {Partial<PricingModel> | Record<string, any>} data Model input data.
26
+ * @param {object} [options] Extended options (db, etc.)
27
+ */
28
+ constructor(data?: Partial<PricingModel> | Record<string, any>, options?: object);
29
+ /** @type {string} Pricing plan name */ title: string;
30
+ /** @type {PriceModel|null} Price object (value + currency) */ price: PriceModel | null;
31
+ /** @type {string[]} List of features included in this plan */ features: string[];
32
+ }
33
+ import { Model } from '@nan0web/types';
34
+ import { PriceModel } from './PriceModel.js';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * PricingSectionModel — OLMUI Model-as-Schema
3
+ * A section containing a title and a collection of pricing tiers.
4
+ */
5
+ export class PricingSectionModel 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 PricingModel;
16
+ default: never[];
17
+ };
18
+ /**
19
+ * @param {Partial<PricingSectionModel> | Record<string, any>} data Model input data.
20
+ * @param {object} [options] Extended options (db, etc.)
21
+ */
22
+ constructor(data?: Partial<PricingSectionModel> | Record<string, any>, options?: object);
23
+ /** @type {string} Section title */ title: string;
24
+ /** @type {PricingModel[]} Array of pricing tiers */ items: PricingModel[];
25
+ }
26
+ import { Model } from '@nan0web/types';
27
+ import { PricingModel } from './PricingModel.js';
@@ -0,0 +1,40 @@
1
+ /**
2
+ * ProfileDropdownModel — OLMUI Model-as-Schema
3
+ * Account/profile dropdown in the header (user menu).
4
+ */
5
+ export class ProfileDropdownModel extends Model {
6
+ static $id: string;
7
+ static profileName: {
8
+ alias: string;
9
+ help: string;
10
+ placeholder: string;
11
+ default: string;
12
+ };
13
+ static email: {
14
+ help: string;
15
+ placeholder: string;
16
+ default: string;
17
+ };
18
+ static avatar: {
19
+ help: string;
20
+ placeholder: string;
21
+ default: string;
22
+ };
23
+ static actions: {
24
+ help: string;
25
+ type: string;
26
+ hint: typeof Navigation;
27
+ default: never[];
28
+ };
29
+ /**
30
+ * @param {Partial<ProfileDropdownModel> | Record<string, any>} data Model input data.
31
+ * @param {object} [options] Extended options (db, etc.)
32
+ */
33
+ constructor(data?: Partial<ProfileDropdownModel> | Record<string, any>, options?: object);
34
+ /** @type {string} Display name of the user */ profileName: string;
35
+ /** @type {string} User email address */ email: string;
36
+ /** @type {string} User avatar image URL */ avatar: string;
37
+ /** @type {Navigation[]} Dropdown menu items */ actions: Navigation[];
38
+ }
39
+ import { Model } from '@nan0web/types';
40
+ import Navigation from '../Navigation.js';
@@ -1,8 +1,3 @@
1
- /**
2
- * @typedef {Object} SelectData
3
- * @property {string} [content]
4
- * @property {string[]} [options]
5
- */
6
1
  /**
7
2
  * Model-as-Schema for Select component.
8
3
  * Represents a dropdown choice selection.
@@ -19,30 +14,20 @@ export class SelectModel extends Model {
19
14
  type: string;
20
15
  };
21
16
  /**
22
- * @param {SelectData | any} [data]
17
+ * @param {Partial<SelectModel> | Record<string, any>} data Model input data.
18
+ * @param {object} [options] Extended options (db, etc.)
23
19
  */
24
- constructor(data?: SelectData | 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
- validate: (val: any) => true | "Invalid option selected";
34
- };
35
- component: string;
36
- model: any;
37
- }, {
38
- type: string;
20
+ constructor(data?: Partial<SelectModel> | Record<string, any>, options?: object);
21
+ /** @type {string} Currently selected item or default placeholder */ content: string;
22
+ /** @type {string[]} List of available options for selection */ options: string[];
23
+ /**
24
+ * @returns {AsyncGenerator<any, { type: 'result', data: { selected: string } }, any>}
25
+ */
26
+ run(): AsyncGenerator<any, {
27
+ type: "result";
39
28
  data: {
40
- selected: string | undefined;
29
+ selected: string;
41
30
  };
42
- }, unknown>;
31
+ }, any>;
43
32
  }
44
- export type SelectData = {
45
- content?: string | undefined;
46
- options?: string[] | undefined;
47
- };
48
- import { Model } from '@nan0web/core';
33
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ShowcaseAppModel — OLMUI Model-as-Schema
3
+ * A container model representing the entire UI library showcase.
4
+ * @property {string} title - App title
5
+ * @property {any[]} sections - Collection of UI sections
6
+ */
7
+ export class ShowcaseAppModel extends Model {
8
+ static $id: string;
9
+ static title: {
10
+ help: string;
11
+ default: string;
12
+ };
13
+ static sections: {
14
+ help: string;
15
+ type: string;
16
+ default: never[];
17
+ };
18
+ /**
19
+ * OLMUI Generator — drives the showcase rendering.
20
+ */
21
+ run(): AsyncGenerator<{
22
+ type: string;
23
+ message: any;
24
+ component: string;
25
+ }, {
26
+ type: string;
27
+ data: {
28
+ success: boolean;
29
+ };
30
+ }, unknown>;
31
+ }
32
+ import { Model } from '@nan0web/core';
@@ -1,9 +1,3 @@
1
- /**
2
- * @typedef {'sm'|'md'|'lg'} SpinnerSize
3
- * @typedef {Object} SpinnerData
4
- * @property {SpinnerSize} [size]
5
- * @property {string} [color]
6
- */
7
1
  /**
8
2
  * Model-as-Schema for Spinner component.
9
3
  * Represents a loading or progress state without user interaction.
@@ -20,26 +14,15 @@ export class SpinnerModel extends Model {
20
14
  default: string;
21
15
  };
22
16
  /**
23
- * @param {SpinnerData | any} [data]
17
+ * @param {Partial<SpinnerModel> | Record<string, any>} data Model input data.
18
+ * @param {object} [options] Extended options (db, etc.)
24
19
  */
25
- constructor(data?: SpinnerData | any);
26
- /** @type {SpinnerSize|undefined} */ size: SpinnerSize | undefined;
27
- /** @type {string|undefined} */ color: string | undefined;
28
- run(): AsyncGenerator<{
29
- type: string;
30
- message: string;
31
- component: string;
32
- model: any;
33
- }, {
34
- type: string;
35
- data: {
36
- completed: boolean;
37
- };
38
- }, unknown>;
20
+ constructor(data?: Partial<SpinnerModel> | Record<string, any>, options?: object);
21
+ /** @type {'sm'|'md'|'lg'} Spinner diameter */ size: "sm" | "md" | "lg";
22
+ /** @type {string} Override for base color token */ color: string;
23
+ /**
24
+ * @returns {AsyncGenerator<any, any, any>}
25
+ */
26
+ run(): AsyncGenerator<any, any, any>;
39
27
  }
40
- export type SpinnerSize = "sm" | "md" | "lg";
41
- export type SpinnerData = {
42
- size?: SpinnerSize | undefined;
43
- color?: string | undefined;
44
- };
45
- import { Model } from '@nan0web/core';
28
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * StatsItemModel — OLMUI Model-as-Schema
3
+ * A single stat entry (e.g. "Users: 10,000 ↑12%").
4
+ */
5
+ export class StatsItemModel extends Model {
6
+ static $id: string;
7
+ static label: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ required: boolean;
12
+ };
13
+ static value: {
14
+ help: string;
15
+ placeholder: string;
16
+ default: string;
17
+ required: boolean;
18
+ };
19
+ static trend: {
20
+ help: string;
21
+ placeholder: string;
22
+ default: string;
23
+ };
24
+ /**
25
+ * @param {Partial<StatsItemModel> | Record<string, any>} data Model input data.
26
+ * @param {object} [options] Extended options (db, etc.)
27
+ */
28
+ constructor(data?: Partial<StatsItemModel> | Record<string, any>, options?: object);
29
+ /** @type {string} Stat label (e.g. "Active Users") */ label: string;
30
+ /** @type {string} Stat value (number or formatted string) */ value: string;
31
+ /** @type {string} Trend indicator (e.g. "+12%", "-3%", or empty) */ trend: string;
32
+ }
33
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * StatsModel — OLMUI Model-as-Schema
3
+ * A collection of stat items for dashboards and overview sections.
4
+ */
5
+ export class StatsModel 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 StatsItemModel;
16
+ default: never[];
17
+ };
18
+ /**
19
+ * @param {Partial<StatsModel> | Record<string, any>} data Model input data.
20
+ * @param {object} [options] Extended options (db, etc.)
21
+ */
22
+ constructor(data?: Partial<StatsModel> | Record<string, any>, options?: object);
23
+ /** @type {string} Stats section title */ title: string;
24
+ /** @type {StatsItemModel[]} Array of stat entries */ items: StatsItemModel[];
25
+ }
26
+ import { Model } from '@nan0web/types';
27
+ import { StatsItemModel } from './StatsItemModel.js';
@@ -1,8 +1,3 @@
1
- /**
2
- * @typedef {Object} TableData
3
- * @property {string[]} [columns]
4
- * @property {string[][]} [rows]
5
- */
6
1
  /**
7
2
  * Model-as-Schema for Table Data component.
8
3
  * Displays tabular string data in rows and columns.
@@ -19,26 +14,15 @@ export class TableModel extends Model {
19
14
  default: string[][];
20
15
  };
21
16
  /**
22
- * @param {TableData | any} [data]
17
+ * @param {Partial<TableModel> | Record<string, any>} data Model input data.
18
+ * @param {object} [options] Extended options (db, etc.)
23
19
  */
24
- constructor(data?: TableData | any);
25
- /** @type {string[]|undefined} */ columns: string[] | undefined;
26
- /** @type {string[][]|undefined} */ rows: string[][] | undefined;
27
- run(): AsyncGenerator<{
28
- type: string;
29
- level: string;
30
- message: string;
31
- component: string;
32
- model: any;
33
- }, {
34
- type: string;
35
- data: {
36
- rowsCount: number;
37
- };
38
- }, unknown>;
20
+ constructor(data?: Partial<TableModel> | Record<string, any>, options?: object);
21
+ /** @type {string[]} Array of column headers */ columns: string[];
22
+ /** @type {string[][]} 2D Array of table cells matching column length */ rows: string[][];
23
+ /**
24
+ * @returns {AsyncGenerator<any, any, any>}
25
+ */
26
+ run(): AsyncGenerator<any, any, any>;
39
27
  }
40
- export type TableData = {
41
- columns?: string[] | undefined;
42
- rows?: string[][] | undefined;
43
- };
44
- import { Model } from '@nan0web/core';
28
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * TabsModel — OLMUI Model-as-Schema
3
+ * Tab container with selectable panels.
4
+ */
5
+ export class TabsModel extends Model {
6
+ static $id: string;
7
+ static active: {
8
+ help: string;
9
+ default: number;
10
+ type: string;
11
+ };
12
+ static tabs: {
13
+ help: string;
14
+ type: string;
15
+ default: never[];
16
+ };
17
+ /**
18
+ * @param {Partial<TabsModel> | Record<string, any>} data Model input data.
19
+ * @param {object} [options] Extended options (db, etc.)
20
+ */
21
+ constructor(data?: Partial<TabsModel> | Record<string, any>, options?: object);
22
+ /** @type {number} Index of the currently active tab */ active: number;
23
+ /** @type {Array<{label: string, content: string}>} Tab definitions */ tabs: Array<{
24
+ label: string;
25
+ content: string;
26
+ }>;
27
+ }
28
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * TestimonialModel — OLMUI Model-as-Schema
3
+ * Extends CommentModel with a rating field for testimonials/reviews.
4
+ */
5
+ export class TestimonialModel extends CommentModel {
6
+ static rating: {
7
+ help: string;
8
+ default: number;
9
+ type: string;
10
+ };
11
+ /**
12
+ * @param {Partial<TestimonialModel> | Record<string, any>} data Model input data.
13
+ * @param {object} [options] Extended options (db, etc.)
14
+ */
15
+ constructor(data?: Partial<TestimonialModel> | Record<string, any>, options?: object);
16
+ /** @type {number} Rating from 1 to 5 stars */ rating: number;
17
+ }
18
+ import { CommentModel } from './CommentModel.js';