@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,32 @@
1
+ import { Model } from '@nan0web/types'
2
+ import { StatsItemModel } from './StatsItemModel.js'
3
+
4
+ /**
5
+ * StatsModel — OLMUI Model-as-Schema
6
+ * A collection of stat items for dashboards and overview sections.
7
+ */
8
+ export class StatsModel extends Model {
9
+ static $id = '@nan0web/ui/StatsModel'
10
+
11
+ static title = {
12
+ help: 'Stats section title',
13
+ placeholder: 'Key Metrics',
14
+ default: '',
15
+ }
16
+ static items = {
17
+ help: 'Array of stat entries',
18
+ type: 'StatsItemModel[]',
19
+ hint: StatsItemModel,
20
+ default: [],
21
+ }
22
+
23
+ /**
24
+ * @param {Partial<StatsModel> | Record<string, any>} data Model input data.
25
+ * @param {object} [options] Extended options (db, etc.)
26
+ */
27
+ constructor(data = {}, options = {}) {
28
+ super(data, options)
29
+ /** @type {string} Stats section title */ this.title
30
+ /** @type {StatsItemModel[]} Array of stat entries */ this.items
31
+ }
32
+ }
@@ -1,20 +1,10 @@
1
- import { Model } from '@nan0web/core'
2
-
3
- /**
4
- * @typedef {Object} TableData
5
- * @property {string[]} [columns]
6
- * @property {string[][]} [rows]
7
- */
1
+ import { Model } from '@nan0web/types'
8
2
 
9
3
  /**
10
4
  * Model-as-Schema for Table Data component.
11
5
  * Displays tabular string data in rows and columns.
12
6
  */
13
7
  export class TableModel extends Model {
14
- // ==========================================
15
- // 1. MODEL AS SCHEMA (Static Definition)
16
- // ==========================================
17
-
18
8
  static columns = {
19
9
  help: 'Array of column headers',
20
10
  type: 'string[]',
@@ -31,28 +21,25 @@ export class TableModel extends Model {
31
21
  }
32
22
 
33
23
  /**
34
- * @param {TableData | any} [data]
24
+ * @param {Partial<TableModel> | Record<string, any>} data Model input data.
25
+ * @param {object} [options] Extended options (db, etc.)
35
26
  */
36
- constructor(data = {}) {
37
- super(data)
38
- /** @type {string[]|undefined} */ this.columns
39
- /** @type {string[][]|undefined} */ this.rows
27
+ constructor(data = {}, options = {}) {
28
+ super(data, options)
29
+ /** @type {string[]} Array of column headers */ this.columns
30
+ /** @type {string[][]} 2D Array of table cells matching column length */ this.rows
40
31
  }
41
32
 
42
- // ==========================================
43
- // 2. AGNOSTIC LOGIC (Async Generator)
44
- // ==========================================
45
-
33
+ /**
34
+ * @returns {AsyncGenerator<any, any, any>}
35
+ */
46
36
  async *run() {
47
- // Tables are naturally result or log displays.
48
- // For an interactive flow, we could ask the user to 'select' a row,
49
- // but by default a table simply presents data.
50
37
  yield {
51
38
  type: 'log',
52
39
  level: 'info',
53
40
  message: `Displaying table with ${this.rows?.length || 0} rows`,
54
41
  component: 'Table',
55
- model: /** @type {any} */ (this),
42
+ model: this,
56
43
  }
57
44
 
58
45
  return { type: 'result', data: { rowsCount: this.rows?.length || 0 } }
@@ -0,0 +1,30 @@
1
+ import { Model } from '@nan0web/types'
2
+
3
+ /**
4
+ * TabsModel — OLMUI Model-as-Schema
5
+ * Tab container with selectable panels.
6
+ */
7
+ export class TabsModel extends Model {
8
+ static $id = '@nan0web/ui/TabsModel'
9
+
10
+ static active = {
11
+ help: 'Index of the currently active tab',
12
+ default: 0,
13
+ type: 'number',
14
+ }
15
+ static tabs = {
16
+ help: 'Tab definitions (label + content pairs)',
17
+ type: 'object[]',
18
+ default: [],
19
+ }
20
+
21
+ /**
22
+ * @param {Partial<TabsModel> | Record<string, any>} data Model input data.
23
+ * @param {object} [options] Extended options (db, etc.)
24
+ */
25
+ constructor(data = {}, options = {}) {
26
+ super(data, options)
27
+ /** @type {number} Index of the currently active tab */ this.active
28
+ /** @type {Array<{label: string, content: string}>} Tab definitions */ this.tabs
29
+ }
30
+ }
@@ -0,0 +1,24 @@
1
+ import { CommentModel } from './CommentModel.js'
2
+
3
+ /**
4
+ * TestimonialModel — OLMUI Model-as-Schema
5
+ * Extends CommentModel with a rating field for testimonials/reviews.
6
+ */
7
+ export class TestimonialModel extends CommentModel {
8
+ static $id = '@nan0web/ui/TestimonialModel'
9
+
10
+ static rating = {
11
+ help: 'Rating from 1 to 5 stars',
12
+ default: 5,
13
+ type: 'number',
14
+ }
15
+
16
+ /**
17
+ * @param {Partial<TestimonialModel> | Record<string, any>} data Model input data.
18
+ * @param {object} [options] Extended options (db, etc.)
19
+ */
20
+ constructor(data = {}, options = {}) {
21
+ super(data, options)
22
+ /** @type {number} Rating from 1 to 5 stars */ this.rating
23
+ }
24
+ }
@@ -0,0 +1,38 @@
1
+ import { Model } from '@nan0web/types'
2
+
3
+ /**
4
+ * TimelineItemModel — OLMUI Model-as-Schema
5
+ * A single entry on a timeline (event, milestone, changelog).
6
+ */
7
+ export class TimelineItemModel extends Model {
8
+ static $id = '@nan0web/ui/TimelineItemModel'
9
+
10
+ static date = {
11
+ help: 'Date of the event (ISO 8601 or display string)',
12
+ placeholder: '2026-01-15',
13
+ default: '',
14
+ required: true,
15
+ }
16
+ static title = {
17
+ help: 'Event or milestone title',
18
+ placeholder: 'Product Launch',
19
+ default: '',
20
+ required: true,
21
+ }
22
+ static description = {
23
+ help: 'Detailed description of the event',
24
+ placeholder: 'We launched our new product...',
25
+ default: '',
26
+ }
27
+
28
+ /**
29
+ * @param {Partial<TimelineItemModel> | Record<string, any>} data Model input data.
30
+ * @param {object} [options] Extended options (db, etc.)
31
+ */
32
+ constructor(data = {}, options = {}) {
33
+ super(data, options)
34
+ /** @type {string} Date of the event */ this.date
35
+ /** @type {string} Event or milestone title */ this.title
36
+ /** @type {string} Detailed description of the event */ this.description
37
+ }
38
+ }
@@ -0,0 +1,32 @@
1
+ import { Model } from '@nan0web/types'
2
+ import { TimelineItemModel } from './TimelineItemModel.js'
3
+
4
+ /**
5
+ * TimelineModel — OLMUI Model-as-Schema
6
+ * A collection of timeline events (changelog, roadmap, history).
7
+ */
8
+ export class TimelineModel extends Model {
9
+ static $id = '@nan0web/ui/TimelineModel'
10
+
11
+ static title = {
12
+ help: 'Timeline section title',
13
+ placeholder: 'Our Journey',
14
+ default: '',
15
+ }
16
+ static items = {
17
+ help: 'Array of timeline events',
18
+ type: 'TimelineItemModel[]',
19
+ hint: TimelineItemModel,
20
+ default: [],
21
+ }
22
+
23
+ /**
24
+ * @param {Partial<TimelineModel> | Record<string, any>} data Model input data.
25
+ * @param {object} [options] Extended options (db, etc.)
26
+ */
27
+ constructor(data = {}, options = {}) {
28
+ super(data, options)
29
+ /** @type {string} Timeline section title */ this.title
30
+ /** @type {TimelineItemModel[]} Array of timeline events */ this.items
31
+ }
32
+ }
@@ -1,77 +1,50 @@
1
- import { Model } from '@nan0web/core'
1
+ import { Model } from '@nan0web/types'
2
2
 
3
3
  /**
4
- * @typedef {'success'|'error'|'info'|'warning'} ToastVariant
5
- * @typedef {Object} ToastData
6
- * @property {string} [message]
7
- * @property {ToastVariant} [variant]
8
- * @property {number} [duration]
9
- * @property {boolean} [open]
10
- */
11
-
12
- /**
13
- * Model-as-Schema for Toast notification component.
14
- * Represents a transient message displayed to the user.
4
+ * Model-as-Schema for Toast notification.
15
5
  */
16
6
  export class ToastModel extends Model {
17
- // ==========================================
18
- // 1. MODEL AS SCHEMA (Static Definition)
19
- // ==========================================
7
+ static variant = {
8
+ help: 'Notification color scheme',
9
+ default: 'info',
10
+ options: ['info', 'success', 'warn', 'error'],
11
+ }
20
12
 
21
13
  static message = {
22
- help: 'The message content of the toast',
23
- default: 'Saved successfully!',
14
+ help: 'Text content of the notification',
15
+ default: 'Notification message',
24
16
  type: 'string',
25
17
  }
26
18
 
27
- static variant = {
28
- help: 'Visual styling representing the message severity',
29
- default: 'success',
30
- options: ['success', 'error', 'info', 'warning'],
31
- }
32
-
33
19
  static duration = {
34
- help: 'Time in ms before auto-dismissal. 0 to keep open indefinitely.',
20
+ help: 'Auto-dismiss timeout (0 for manual only)',
35
21
  default: 3000,
36
22
  type: 'number',
37
23
  }
38
24
 
39
- static open = {
40
- help: 'Controls visibility state',
41
- default: true,
42
- type: 'boolean',
43
- }
44
-
45
25
  /**
46
- * @param {ToastData | any} [data]
26
+ * @param {Partial<ToastModel> | Record<string, any>} data Model input data.
27
+ * @param {object} [options] Extended options (db, etc.)
47
28
  */
48
- constructor(data = {}) {
49
- super(data)
50
- /** @type {string|undefined} */ this.message
51
- /** @type {ToastVariant|undefined} */ this.variant
52
- /** @type {number|undefined} */ this.duration
53
- /** @type {boolean|undefined} */ this.open
29
+ constructor(data = {}, options = {}) {
30
+ super(data, options)
31
+ /** @type {'info'|'success'|'warn'|'error'} Notification color scheme */ this.variant
32
+ /** @type {string} Text displayed in the toast */ this.message
33
+ /** @type {number} Auto-dismiss timeout in ms */ this.duration
54
34
  }
55
35
 
56
- // ==========================================
57
- // 2. AGNOSTIC LOGIC (Async Generator)
58
- // ==========================================
59
-
36
+ /**
37
+ * @returns {AsyncGenerator<any, any, any>}
38
+ */
60
39
  async *run() {
61
- // Maps naturally to the 'log' intent for OLMUI runners.
62
40
  yield {
63
41
  type: 'log',
64
- level: this.variant === 'error' ? 'error' : this.variant === 'warning' ? 'warn' : 'info',
42
+ level: this.variant === 'error' ? 'error' : 'info',
65
43
  message: this.message,
66
- component: 'Toast', // Hint for specific UI visual rendering
67
- model: /** @type {any} */ (this),
68
- }
69
-
70
- // Wait exactly 'duration' ms before completing (unless duration is 0)
71
- if (this.duration && this.duration > 0) {
72
- await new Promise((resolve) => setTimeout(resolve, this.duration))
44
+ component: 'Toast',
45
+ model: this,
73
46
  }
74
47
 
75
- return { type: 'result', data: { closed: true } }
48
+ return { type: 'result', data: { shown: true } }
76
49
  }
77
50
  }
@@ -1,26 +1,10 @@
1
- import { Model } from '@nan0web/core'
2
-
3
- /**
4
- * @typedef {Object} TreeNode
5
- * @property {string} label
6
- * @property {boolean} [expanded]
7
- * @property {TreeNode[]} [children]
8
- */
9
-
10
- /**
11
- * @typedef {Object} TreeData
12
- * @property {TreeNode[]} [data]
13
- */
1
+ import { Model } from '@nan0web/types'
14
2
 
15
3
  /**
16
4
  * Model-as-Schema for Tree component.
17
5
  * Represents a hierarchical selection or navigation structure.
18
6
  */
19
7
  export class TreeModel extends Model {
20
- // ==========================================
21
- // 1. MODEL AS SCHEMA (Static Definition)
22
- // ==========================================
23
-
24
8
  static data = {
25
9
  help: 'Tree nodes defining the hierarchy',
26
10
  type: 'TreeNode[]',
@@ -28,24 +12,24 @@ export class TreeModel extends Model {
28
12
  }
29
13
 
30
14
  /**
31
- * @param {TreeData | any} [data]
15
+ * @param {Partial<TreeModel> | Record<string, any>} data Model input data.
16
+ * @param {object} [options] Extended options (db, etc.)
32
17
  */
33
- constructor(data = {}) {
34
- super(data)
35
- /** @type {TreeNode[]|undefined} */ this.data
18
+ constructor(data = {}, options = {}) {
19
+ super(data, options)
20
+ /** @type {Array<{label: string, expanded?: boolean, children?: any[]}>} Tree nodes */ this.data
36
21
  }
37
22
 
38
- // ==========================================
39
- // 2. AGNOSTIC LOGIC (Async Generator)
40
- // ==========================================
41
-
23
+ /**
24
+ * @returns {AsyncGenerator<any, any, any>}
25
+ */
42
26
  async *run() {
43
27
  const response = yield {
44
28
  type: 'ask',
45
29
  field: 'selectedNode',
46
30
  schema: { help: 'Select a node from the tree' },
47
31
  component: 'Tree',
48
- model: /** @type {any} */ (this),
32
+ model: this,
49
33
  }
50
34
 
51
35
  return { type: 'result', data: { selected: response.value } }
@@ -1,4 +1,6 @@
1
1
  // Exports for Component Models
2
+
3
+ // Interactive Components
2
4
  export { BreadcrumbModel } from './BreadcrumbModel.js'
3
5
  export { ButtonModel } from './ButtonModel.js'
4
6
  export { ConfirmModel } from './ConfirmModel.js'
@@ -9,3 +11,35 @@ export { ToastModel } from './ToastModel.js'
9
11
  export { SelectModel } from './SelectModel.js'
10
12
  export { AutocompleteModel } from './AutocompleteModel.js'
11
13
  export { TreeModel } from './TreeModel.js'
14
+ export { TabsModel } from './TabsModel.js'
15
+ export { AccordionModel } from './AccordionModel.js'
16
+ export { FAQModel } from './FAQModel.js'
17
+ export { GalleryModel } from './GalleryModel.js'
18
+
19
+ // Pricing
20
+ export { PriceModel } from './PriceModel.js'
21
+ export { PricingModel } from './PricingModel.js'
22
+ export { PricingSectionModel } from './PricingSectionModel.js'
23
+
24
+ // Hero
25
+
26
+ // Social / Feedback
27
+ export { CommentModel } from './CommentModel.js'
28
+ export { TestimonialModel } from './TestimonialModel.js'
29
+
30
+ // Data Display
31
+ export { StatsItemModel } from './StatsItemModel.js'
32
+ export { StatsModel } from './StatsModel.js'
33
+ export { TimelineItemModel } from './TimelineItemModel.js'
34
+ export { TimelineModel } from './TimelineModel.js'
35
+
36
+ // Visibility Configs
37
+ export { HeaderVisibilityModel } from './HeaderVisibilityModel.js'
38
+ export { HeaderConfigModel } from './HeaderConfigModel.js'
39
+ export { FooterVisibilityModel } from './FooterVisibilityModel.js'
40
+ export { FooterConfigModel } from './FooterConfigModel.js'
41
+
42
+ // Business Critical
43
+ export { EmptyStateModel } from './EmptyStateModel.js'
44
+ export { BannerModel } from './BannerModel.js'
45
+ export { ProfileDropdownModel } from './ProfileDropdownModel.js'
@@ -2,6 +2,12 @@
2
2
  export { SandboxModel } from './SandboxModel.js'
3
3
  export { ShowcaseAppModel } from './ShowcaseAppModel.js'
4
4
  export { default as Navigation } from './Navigation.js'
5
+ export { Language } from '@nan0web/i18n/src/domain/Language.js'
6
+
7
+ // Layout Models (Phase 1)
8
+ export { default as HeaderModel } from './HeaderModel.js'
9
+ export { default as FooterModel } from './FooterModel.js'
10
+ export { default as HeroModel } from './HeroModel.js'
5
11
 
6
12
  // Component Models
7
13
  export {
@@ -14,4 +20,22 @@ export {
14
20
  SelectModel,
15
21
  AutocompleteModel,
16
22
  TreeModel,
23
+ TabsModel,
24
+ AccordionModel,
25
+ GalleryModel,
26
+ PriceModel,
27
+ PricingModel,
28
+ CommentModel,
29
+ TestimonialModel,
30
+ StatsItemModel,
31
+ StatsModel,
32
+ TimelineItemModel,
33
+ TimelineModel,
34
+ HeaderVisibilityModel,
35
+ HeaderConfigModel,
36
+ FooterVisibilityModel,
37
+ FooterConfigModel,
38
+ EmptyStateModel,
39
+ BannerModel,
40
+ ProfileDropdownModel,
17
41
  } from './components/index.js'
package/src/index.js CHANGED
@@ -11,6 +11,8 @@ import App from './App/index.js'
11
11
 
12
12
  export { Frame, FrameProps, Locale, StdIn, StdOut, View, RenderOptions, Model, Component, App }
13
13
  export { format } from './format.js'
14
+ export { default as Navigation } from './domain/Navigation.js'
15
+ export { Language } from '@nan0web/i18n/src/domain/Language.js'
14
16
 
15
17
  // export default App
16
18
  export { default as FormMessage } from './core/Form/Message.js'
@@ -0,0 +1,52 @@
1
+ /**
2
+ * FooterModel — OLMUI Model-as-Schema
3
+ * Universal footer structure: copyright, version, license, navigation, sharing, languages.
4
+ */
5
+ export default class FooterModel extends Model {
6
+ static $id: string;
7
+ static copyright: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ };
12
+ static version: {
13
+ help: string;
14
+ placeholder: string;
15
+ default: string;
16
+ };
17
+ static license: {
18
+ help: string;
19
+ placeholder: string;
20
+ default: string;
21
+ };
22
+ static nav: {
23
+ help: string;
24
+ type: string;
25
+ hint: typeof Navigation;
26
+ default: never[];
27
+ };
28
+ static share: {
29
+ help: string;
30
+ type: string;
31
+ hint: typeof Navigation;
32
+ default: never[];
33
+ };
34
+ static langs: {
35
+ help: string;
36
+ type: string;
37
+ default: never[];
38
+ };
39
+ /**
40
+ * @param {Partial<FooterModel> | Record<string, any>} data Model input data.
41
+ * @param {object} [options] Extended options (db, etc.)
42
+ */
43
+ constructor(data?: Partial<FooterModel> | Record<string, any>, options?: object);
44
+ /** @type {string} Copyright text */ copyright: string;
45
+ /** @type {string} Application version string */ version: string;
46
+ /** @type {string} License type */ license: string;
47
+ /** @type {Navigation[]} Footer navigation links */ nav: Navigation[];
48
+ /** @type {Navigation[]} Social sharing links */ share: Navigation[];
49
+ /** @type {any[]} Available languages for switcher */ langs: any[];
50
+ }
51
+ import { Model } from '@nan0web/types';
52
+ import Navigation from './Navigation.js';
@@ -0,0 +1,45 @@
1
+ /**
2
+ * HeaderModel — OLMUI Model-as-Schema
3
+ * Universal header structure: logo, navigation, language switcher, actions.
4
+ */
5
+ export default class HeaderModel extends Model {
6
+ static $id: string;
7
+ static title: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ };
12
+ static logo: {
13
+ help: string;
14
+ placeholder: string;
15
+ default: string;
16
+ };
17
+ static actions: {
18
+ help: string;
19
+ type: string;
20
+ hint: typeof Navigation;
21
+ default: never[];
22
+ };
23
+ static lang: {
24
+ help: string;
25
+ type: string;
26
+ default: null;
27
+ };
28
+ static langs: {
29
+ help: string;
30
+ type: string;
31
+ default: never[];
32
+ };
33
+ /**
34
+ * @param {Partial<HeaderModel> | Record<string, any>} data Model input data.
35
+ * @param {object} [options] Extended options (db, etc.)
36
+ */
37
+ constructor(data?: Partial<HeaderModel> | Record<string, any>, options?: object);
38
+ /** @type {string} Site or app title displayed in the header */ title: string;
39
+ /** @type {string} Logo image URL or icon name */ logo: string;
40
+ /** @type {Navigation[]} Header action links (CTA, Sign In, etc.) */ actions: Navigation[];
41
+ /** @type {any|null} Currently active language */ lang: any | null;
42
+ /** @type {any[]} Available languages for switcher */ langs: any[];
43
+ }
44
+ import { Model } from '@nan0web/types';
45
+ import Navigation from './Navigation.js';
@@ -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';