@luzmo/ngx-lucero 1.0.1-alpha.78

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 (136) hide show
  1. package/README.md +41 -0
  2. package/esm/components/accordion-item.d.ts +32 -0
  3. package/esm/components/accordion-item.js +89 -0
  4. package/esm/components/accordion.d.ts +38 -0
  5. package/esm/components/accordion.js +107 -0
  6. package/esm/components/action-bar.d.ts +32 -0
  7. package/esm/components/action-bar.js +83 -0
  8. package/esm/components/action-button.d.ts +59 -0
  9. package/esm/components/action-button.js +205 -0
  10. package/esm/components/action-group.d.ts +42 -0
  11. package/esm/components/action-group.js +155 -0
  12. package/esm/components/action-menu.d.ts +75 -0
  13. package/esm/components/action-menu.js +337 -0
  14. package/esm/components/avatar.d.ts +35 -0
  15. package/esm/components/avatar.js +94 -0
  16. package/esm/components/badge.d.ts +31 -0
  17. package/esm/components/badge.js +86 -0
  18. package/esm/components/button-group.d.ts +28 -0
  19. package/esm/components/button-group.js +71 -0
  20. package/esm/components/button.d.ts +40 -0
  21. package/esm/components/button.js +140 -0
  22. package/esm/components/calendar.d.ts +64 -0
  23. package/esm/components/calendar.js +218 -0
  24. package/esm/components/chat-message-group.d.ts +29 -0
  25. package/esm/components/chat-message-group.js +76 -0
  26. package/esm/components/chat-message.d.ts +50 -0
  27. package/esm/components/chat-message.js +156 -0
  28. package/esm/components/checkbox.d.ts +55 -0
  29. package/esm/components/checkbox.js +196 -0
  30. package/esm/components/clear-button.d.ts +32 -0
  31. package/esm/components/clear-button.js +88 -0
  32. package/esm/components/close-button.d.ts +33 -0
  33. package/esm/components/close-button.js +95 -0
  34. package/esm/components/color-area.d.ts +45 -0
  35. package/esm/components/color-area.js +167 -0
  36. package/esm/components/color-field.d.ts +91 -0
  37. package/esm/components/color-field.js +321 -0
  38. package/esm/components/color-handle.d.ts +31 -0
  39. package/esm/components/color-handle.js +90 -0
  40. package/esm/components/color-loupe.d.ts +29 -0
  41. package/esm/components/color-loupe.js +76 -0
  42. package/esm/components/color-menu.d.ts +36 -0
  43. package/esm/components/color-menu.js +97 -0
  44. package/esm/components/color-palette-group.d.ts +40 -0
  45. package/esm/components/color-palette-group.js +117 -0
  46. package/esm/components/color-palette.d.ts +43 -0
  47. package/esm/components/color-palette.js +126 -0
  48. package/esm/components/color-picker.d.ts +49 -0
  49. package/esm/components/color-picker.js +143 -0
  50. package/esm/components/color-slider.d.ts +53 -0
  51. package/esm/components/color-slider.js +215 -0
  52. package/esm/components/date-range-picker.d.ts +69 -0
  53. package/esm/components/date-range-picker.js +228 -0
  54. package/esm/components/date-time-picker.d.ts +71 -0
  55. package/esm/components/date-time-picker.js +249 -0
  56. package/esm/components/divider.d.ts +31 -0
  57. package/esm/components/divider.js +78 -0
  58. package/esm/components/field-group.d.ts +32 -0
  59. package/esm/components/field-group.js +101 -0
  60. package/esm/components/field-label.d.ts +37 -0
  61. package/esm/components/field-label.js +104 -0
  62. package/esm/components/help-text.d.ts +30 -0
  63. package/esm/components/help-text.js +77 -0
  64. package/esm/components/icon.d.ts +33 -0
  65. package/esm/components/icon.js +104 -0
  66. package/esm/components/infield-button.d.ts +35 -0
  67. package/esm/components/infield-button.js +103 -0
  68. package/esm/components/label.d.ts +29 -0
  69. package/esm/components/label.js +76 -0
  70. package/esm/components/menu.d.ts +53 -0
  71. package/esm/components/menu.js +218 -0
  72. package/esm/components/multi-language-field.d.ts +58 -0
  73. package/esm/components/multi-language-field.js +263 -0
  74. package/esm/components/number-field.d.ts +103 -0
  75. package/esm/components/number-field.js +372 -0
  76. package/esm/components/options.d.ts +58 -0
  77. package/esm/components/options.js +207 -0
  78. package/esm/components/overlay.d.ts +67 -0
  79. package/esm/components/overlay.js +212 -0
  80. package/esm/components/picker-button.d.ts +32 -0
  81. package/esm/components/picker-button.js +94 -0
  82. package/esm/components/picker.d.ts +79 -0
  83. package/esm/components/picker.js +340 -0
  84. package/esm/components/popover.d.ts +33 -0
  85. package/esm/components/popover.js +93 -0
  86. package/esm/components/progress-bar.d.ts +35 -0
  87. package/esm/components/progress-bar.js +121 -0
  88. package/esm/components/progress-circle.d.ts +35 -0
  89. package/esm/components/progress-circle.js +94 -0
  90. package/esm/components/progress-steps.d.ts +46 -0
  91. package/esm/components/progress-steps.js +127 -0
  92. package/esm/components/prompt-box.d.ts +88 -0
  93. package/esm/components/prompt-box.js +280 -0
  94. package/esm/components/radio-group.d.ts +39 -0
  95. package/esm/components/radio-group.js +136 -0
  96. package/esm/components/radio.d.ts +46 -0
  97. package/esm/components/radio.js +172 -0
  98. package/esm/components/search.d.ts +95 -0
  99. package/esm/components/search.js +351 -0
  100. package/esm/components/select.d.ts +82 -0
  101. package/esm/components/select.js +351 -0
  102. package/esm/components/slider.d.ts +47 -0
  103. package/esm/components/slider.js +185 -0
  104. package/esm/components/status-light.d.ts +30 -0
  105. package/esm/components/status-light.js +78 -0
  106. package/esm/components/swatch-group.d.ts +37 -0
  107. package/esm/components/swatch-group.js +126 -0
  108. package/esm/components/swatch.d.ts +49 -0
  109. package/esm/components/swatch.js +197 -0
  110. package/esm/components/switch.d.ts +48 -0
  111. package/esm/components/switch.js +160 -0
  112. package/esm/components/tab-panel.d.ts +29 -0
  113. package/esm/components/tab-panel.js +78 -0
  114. package/esm/components/tab.d.ts +32 -0
  115. package/esm/components/tab.js +100 -0
  116. package/esm/components/tabs-overflow.d.ts +33 -0
  117. package/esm/components/tabs-overflow.js +97 -0
  118. package/esm/components/tabs.d.ts +43 -0
  119. package/esm/components/tabs.js +150 -0
  120. package/esm/components/tag.d.ts +31 -0
  121. package/esm/components/tag.js +90 -0
  122. package/esm/components/tags.d.ts +30 -0
  123. package/esm/components/tags.js +81 -0
  124. package/esm/components/text-field.d.ts +87 -0
  125. package/esm/components/text-field.js +308 -0
  126. package/esm/components/toast.d.ts +30 -0
  127. package/esm/components/toast.js +68 -0
  128. package/esm/components/tooltip.d.ts +44 -0
  129. package/esm/components/tooltip.js +154 -0
  130. package/esm/components/top-nav-item.d.ts +35 -0
  131. package/esm/components/top-nav-item.js +120 -0
  132. package/esm/components/top-nav.d.ts +35 -0
  133. package/esm/components/top-nav.js +110 -0
  134. package/esm/index.d.ts +135 -0
  135. package/esm/index.js +269 -0
  136. package/package.json +40 -0
@@ -0,0 +1,94 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/progress-circle';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-progress-circle>
7
+ */
8
+ export class LuzmoProgressCircle {
9
+ elementRef = inject(ElementRef);
10
+ renderer = inject(Renderer2);
11
+ destroyRef = inject(DestroyRef);
12
+ host = this.elementRef.nativeElement;
13
+ listenerCleanup = [];
14
+ /** The underlying custom element instance. Use to call imperative methods. */
15
+ get nativeElement() {
16
+ return this.host;
17
+ }
18
+ /** The `indeterminate` attribute is used to indicate that the progress circle is in an indeterminate state */
19
+ indeterminate;
20
+ /** The aria-label of the progress circle */
21
+ label;
22
+ /** The `static-color` attribute is used to set the color of the progress circle to black or white. This is used when the progress circle is on a colored background. */
23
+ staticColor;
24
+ /** The progress in degrees of the progress circle */
25
+ progress;
26
+ constructor() {
27
+ this.bindEvents();
28
+ this.destroyRef.onDestroy(() => {
29
+ for (const cleanup of this.listenerCleanup) {
30
+ cleanup();
31
+ }
32
+ });
33
+ }
34
+ ngOnChanges(changes) {
35
+ for (const key of Object.keys(changes)) {
36
+ switch (key) {
37
+ case 'indeterminate':
38
+ this.setHostProperty('indeterminate', changes['indeterminate'].currentValue);
39
+ break;
40
+ case 'label':
41
+ this.setHostProperty('label', changes['label'].currentValue);
42
+ break;
43
+ case 'staticColor':
44
+ this.setHostProperty('staticColor', changes['staticColor'].currentValue);
45
+ break;
46
+ case 'progress':
47
+ this.setHostProperty('progress', changes['progress'].currentValue);
48
+ break;
49
+ default:
50
+ break;
51
+ }
52
+ }
53
+ }
54
+ /**
55
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
56
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
57
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
58
+ * undefined / null by clearing their bindings.
59
+ */
60
+ setHostProperty(key, value) {
61
+ this.renderer.setProperty(this.host, key, value);
62
+ }
63
+ bindEvents() {
64
+ // No custom events for this wrapper.
65
+ }
66
+ static ɵfac = function LuzmoProgressCircle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoProgressCircle)(); };
67
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoProgressCircle, selectors: [["luzmo-progress-circle"]], inputs: { indeterminate: "indeterminate", label: "label", staticColor: [0, "static-color", "staticColor"], progress: "progress" }, exportAs: ["luzmoProgressCircle"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoProgressCircle_Template(rf, ctx) { if (rf & 1) {
68
+ i0.ɵɵprojectionDef();
69
+ i0.ɵɵprojection(0);
70
+ } }, encapsulation: 2, changeDetection: 0 });
71
+ }
72
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoProgressCircle, [{
73
+ type: Component,
74
+ args: [{
75
+ selector: 'luzmo-progress-circle',
76
+ exportAs: 'luzmoProgressCircle',
77
+ standalone: true,
78
+ changeDetection: ChangeDetectionStrategy.OnPush,
79
+ template: '<ng-content />'
80
+ }]
81
+ }], () => [], { indeterminate: [{
82
+ type: Input,
83
+ args: [{ alias: 'indeterminate' }]
84
+ }], label: [{
85
+ type: Input,
86
+ args: [{ alias: 'label' }]
87
+ }], staticColor: [{
88
+ type: Input,
89
+ args: [{ alias: 'static-color' }]
90
+ }], progress: [{
91
+ type: Input,
92
+ args: [{ alias: 'progress' }]
93
+ }] }); })();
94
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoProgressCircle, { className: "LuzmoProgressCircle", filePath: "components/progress-circle.ts", lineNumber: 15 }); })();
@@ -0,0 +1,46 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/progress-steps';
3
+ import type { LuzmoProgressSteps as LuzmoProgressStepsHostElement, ProgressStepsLabels, ProgressTreeNode } from '@luzmo/lucero/progress-steps';
4
+ import * as i0 from "@angular/core";
5
+ export type { LocalizedString, ProgressStepsLabels, ProgressStepsStatuses, ProgressTreeNode, ProgressTreeNodeDescriptionMetadata } from '@luzmo/lucero/progress-steps';
6
+ export declare class LuzmoProgressSteps implements OnChanges {
7
+ private readonly elementRef;
8
+ private readonly renderer;
9
+ private readonly destroyRef;
10
+ private readonly host;
11
+ private readonly listenerCleanup;
12
+ /** The underlying custom element instance. Use to call imperative methods. */
13
+ get nativeElement(): LuzmoProgressStepsHostElement;
14
+ /** The progress tree from the backend. The root node's children are rendered as main steps. */
15
+ progress?: ProgressTreeNode | null;
16
+ /** Locale for resolving localized strings in description metadata. Defaults to 'en'. */
17
+ locale?: string;
18
+ /** When true, collapses all auto-expanded steps. Manually expanded steps remain open. */
19
+ collapsed?: boolean;
20
+ /** Display mode for the progress steps. - 'detailed' (default): Shows full descriptions and substeps with expand/collapse - 'compact': Shows only step names without substeps or expand/collapse */
21
+ displayMode?: ('detailed' | 'compact');
22
+ /** When true, hides all steps behind a single "{n} steps completed" toggle line. Clicking the toggle expands/collapses the full step list. */
23
+ condensed?: boolean;
24
+ /** Labels used for visible text and screen readers. The default values are in English and can be overridden to localize the content. Use `{{count}}` in `stepCompleted` / `stepsCompleted` as a placeholder for the step count. */
25
+ labels?: ProgressStepsLabels;
26
+ /** When true, disables all entry animations (stepFadeIn, substepFadeIn). */
27
+ noAnimate?: boolean;
28
+ /** Fired when a step is collapsed */
29
+ readonly luzmoStepCollapsedEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
30
+ /** Fired when a step is expanded */
31
+ readonly luzmoStepExpandedEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
32
+ constructor();
33
+ ngOnChanges(changes: SimpleChanges): void;
34
+ /**
35
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
36
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
37
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
38
+ * undefined / null by clearing their bindings.
39
+ */
40
+ private setHostProperty;
41
+ private bindEvents;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoProgressSteps, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoProgressSteps, "luzmo-progress-steps", ["luzmoProgressSteps"], { "progress": { "alias": "progress"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "collapsed": { "alias": "collapsed"; "required": false; }; "displayMode": { "alias": "display-mode"; "required": false; }; "condensed": { "alias": "condensed"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "noAnimate": { "alias": "no-animate"; "required": false; }; }, { "luzmoStepCollapsedEvent": "luzmo-step-collapsed"; "luzmoStepExpandedEvent": "luzmo-step-expanded"; }, never, ["*"], true, never>;
44
+ }
45
+ /** The underlying custom element type for LuzmoProgressSteps */
46
+ export type LuzmoProgressStepsElement = LuzmoProgressStepsHostElement;
@@ -0,0 +1,127 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/progress-steps';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-progress-steps>
7
+ */
8
+ export class LuzmoProgressSteps {
9
+ elementRef = inject(ElementRef);
10
+ renderer = inject(Renderer2);
11
+ destroyRef = inject(DestroyRef);
12
+ host = this.elementRef.nativeElement;
13
+ listenerCleanup = [];
14
+ /** The underlying custom element instance. Use to call imperative methods. */
15
+ get nativeElement() {
16
+ return this.host;
17
+ }
18
+ /** The progress tree from the backend. The root node's children are rendered as main steps. */
19
+ progress;
20
+ /** Locale for resolving localized strings in description metadata. Defaults to 'en'. */
21
+ locale;
22
+ /** When true, collapses all auto-expanded steps. Manually expanded steps remain open. */
23
+ collapsed;
24
+ /** Display mode for the progress steps. - 'detailed' (default): Shows full descriptions and substeps with expand/collapse - 'compact': Shows only step names without substeps or expand/collapse */
25
+ displayMode;
26
+ /** When true, hides all steps behind a single "{n} steps completed" toggle line. Clicking the toggle expands/collapses the full step list. */
27
+ condensed;
28
+ /** Labels used for visible text and screen readers. The default values are in English and can be overridden to localize the content. Use `{{count}}` in `stepCompleted` / `stepsCompleted` as a placeholder for the step count. */
29
+ labels;
30
+ /** When true, disables all entry animations (stepFadeIn, substepFadeIn). */
31
+ noAnimate;
32
+ /** Fired when a step is collapsed */
33
+ luzmoStepCollapsedEvent = output({ alias: 'luzmo-step-collapsed' });
34
+ /** Fired when a step is expanded */
35
+ luzmoStepExpandedEvent = output({ alias: 'luzmo-step-expanded' });
36
+ constructor() {
37
+ this.bindEvents();
38
+ this.destroyRef.onDestroy(() => {
39
+ for (const cleanup of this.listenerCleanup) {
40
+ cleanup();
41
+ }
42
+ });
43
+ }
44
+ ngOnChanges(changes) {
45
+ for (const key of Object.keys(changes)) {
46
+ switch (key) {
47
+ case 'progress':
48
+ this.setHostProperty('progress', changes['progress'].currentValue);
49
+ break;
50
+ case 'locale':
51
+ this.setHostProperty('locale', changes['locale'].currentValue);
52
+ break;
53
+ case 'collapsed':
54
+ this.setHostProperty('collapsed', changes['collapsed'].currentValue);
55
+ break;
56
+ case 'displayMode':
57
+ this.setHostProperty('displayMode', changes['displayMode'].currentValue);
58
+ break;
59
+ case 'condensed':
60
+ this.setHostProperty('condensed', changes['condensed'].currentValue);
61
+ break;
62
+ case 'labels':
63
+ this.setHostProperty('labels', changes['labels'].currentValue);
64
+ break;
65
+ case 'noAnimate':
66
+ this.setHostProperty('noAnimate', changes['noAnimate'].currentValue);
67
+ break;
68
+ default:
69
+ break;
70
+ }
71
+ }
72
+ }
73
+ /**
74
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
75
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
76
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
77
+ * undefined / null by clearing their bindings.
78
+ */
79
+ setHostProperty(key, value) {
80
+ this.renderer.setProperty(this.host, key, value);
81
+ }
82
+ bindEvents() {
83
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-step-collapsed', (event) => {
84
+ this.luzmoStepCollapsedEvent.emit(event);
85
+ }));
86
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-step-expanded', (event) => {
87
+ this.luzmoStepExpandedEvent.emit(event);
88
+ }));
89
+ }
90
+ static ɵfac = function LuzmoProgressSteps_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoProgressSteps)(); };
91
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoProgressSteps, selectors: [["luzmo-progress-steps"]], inputs: { progress: "progress", locale: "locale", collapsed: "collapsed", displayMode: [0, "display-mode", "displayMode"], condensed: "condensed", labels: "labels", noAnimate: [0, "no-animate", "noAnimate"] }, outputs: { luzmoStepCollapsedEvent: "luzmo-step-collapsed", luzmoStepExpandedEvent: "luzmo-step-expanded" }, exportAs: ["luzmoProgressSteps"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoProgressSteps_Template(rf, ctx) { if (rf & 1) {
92
+ i0.ɵɵprojectionDef();
93
+ i0.ɵɵprojection(0);
94
+ } }, encapsulation: 2, changeDetection: 0 });
95
+ }
96
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoProgressSteps, [{
97
+ type: Component,
98
+ args: [{
99
+ selector: 'luzmo-progress-steps',
100
+ exportAs: 'luzmoProgressSteps',
101
+ standalone: true,
102
+ changeDetection: ChangeDetectionStrategy.OnPush,
103
+ template: '<ng-content />'
104
+ }]
105
+ }], () => [], { progress: [{
106
+ type: Input,
107
+ args: [{ alias: 'progress' }]
108
+ }], locale: [{
109
+ type: Input,
110
+ args: [{ alias: 'locale' }]
111
+ }], collapsed: [{
112
+ type: Input,
113
+ args: [{ alias: 'collapsed' }]
114
+ }], displayMode: [{
115
+ type: Input,
116
+ args: [{ alias: 'display-mode' }]
117
+ }], condensed: [{
118
+ type: Input,
119
+ args: [{ alias: 'condensed' }]
120
+ }], labels: [{
121
+ type: Input,
122
+ args: [{ alias: 'labels' }]
123
+ }], noAnimate: [{
124
+ type: Input,
125
+ args: [{ alias: 'no-animate' }]
126
+ }], luzmoStepCollapsedEvent: [{ type: i0.Output, args: ["luzmo-step-collapsed"] }], luzmoStepExpandedEvent: [{ type: i0.Output, args: ["luzmo-step-expanded"] }] }); })();
127
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoProgressSteps, { className: "LuzmoProgressSteps", filePath: "components/progress-steps.ts", lineNumber: 16 }); })();
@@ -0,0 +1,88 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/prompt-box';
3
+ import type { LuzmoPromptBox as LuzmoPromptBoxHostElement, PromptBoxSegment, TriggerConfig } from '@luzmo/lucero/prompt-box';
4
+ import * as i0 from "@angular/core";
5
+ export type { ActionValue, PromptBoxAttachment, PromptBoxElement, PromptBoxElementInsertedDetail, PromptBoxElementRemovedDetail, PromptBoxRecordErrorDetail, PromptBoxRecordingCompleteDetail, PromptBoxSegment, PromptBoxSubmitDetail, TriggerConfig, TriggerMenuChangeDetail, TriggerMenuSelectDetail, TriggerOption } from '@luzmo/lucero/prompt-box';
6
+ export declare class LuzmoPromptBox implements OnChanges {
7
+ private readonly elementRef;
8
+ private readonly renderer;
9
+ private readonly destroyRef;
10
+ private readonly host;
11
+ private readonly listenerCleanup;
12
+ /** The underlying custom element instance. Use to call imperative methods. */
13
+ get nativeElement(): LuzmoPromptBoxHostElement;
14
+ /** The number of visible text rows for the textarea. */
15
+ rows?: number;
16
+ /** Whether the textarea should grow to accommodate content. */
17
+ grows?: boolean;
18
+ /** Maximum rows the textarea can grow to (`-1` = unlimited). Values less than 1 are disregarded. */
19
+ maxRows?: number;
20
+ /** Whether to show the record/voice button. */
21
+ recording?: boolean;
22
+ /** Whether the submit button is hidden. */
23
+ hideSubmit?: boolean;
24
+ /** Whether submit behavior is disabled while keeping the input interactive. */
25
+ disableSubmit?: boolean;
26
+ /** Whether to use single-line layout with actions, input, and submit in one row. */
27
+ singleLine?: boolean;
28
+ /** Placeholder text for the input. */
29
+ placeholder?: string;
30
+ /** The current value of the input. */
31
+ value?: string;
32
+ /** Whether the prompt box is disabled. */
33
+ disabled?: boolean;
34
+ /** Whether the input is readonly. */
35
+ readonly?: boolean;
36
+ /** Maximum number of characters allowed. */
37
+ maxlength?: number;
38
+ /** Whether the prompt box is in a pending/loading state. */
39
+ pending?: boolean;
40
+ /** Whether to allow image attachments. */
41
+ allowImages?: boolean;
42
+ /** Whether to allow file attachments. */
43
+ allowFiles?: boolean;
44
+ /** Accepted file types for attachments (MIME types or extensions). */
45
+ acceptedFileTypes?: string[];
46
+ /** Whether to enable rich input mode with inline element badges. When enabled, the textarea is replaced with a contenteditable div. */
47
+ allowElements?: boolean;
48
+ /** Optional filter for accepted element types during drag-and-drop. */
49
+ acceptedElementTypes?: string[];
50
+ /** Trigger key configurations. Each entry defines a key character that opens a popover when typed at a word boundary. ```ts promptBox.triggers = [ { key: '@', options: assetOptions, slotName: 'assets-menu' }, { key: '/', options: skillOptions, lazy: true } ]; ``` */
51
+ triggers?: TriggerConfig[];
52
+ segments?: PromptBoxSegment[];
53
+ /** Fired when the prompt is submitted. */
54
+ readonly luzmoSubmitEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
55
+ /** Fired when a trigger menu opens, closes, or the search string changes. */
56
+ readonly luzmoTriggerChangeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
57
+ /** Fired when an inline element badge is inserted. */
58
+ readonly luzmoElementInsertedEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
59
+ /** Fired when an inline element badge is removed. */
60
+ readonly luzmoElementRemovedEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
61
+ /** Fired when attachments change. */
62
+ readonly luzmoAttachmentsChangeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
63
+ /** Fired when recording state changes. */
64
+ readonly luzmoRecordEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
65
+ /** Fired when recording finishes. */
66
+ readonly luzmoRecordingCompleteEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
67
+ /** Fired when recording is cancelled. */
68
+ readonly luzmoRecordCancelEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
69
+ /** Fired when recording errors. */
70
+ readonly luzmoRecordErrorEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
71
+ constructor();
72
+ ngOnChanges(changes: SimpleChanges): void;
73
+ /**
74
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
75
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
76
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
77
+ * undefined / null by clearing their bindings.
78
+ */
79
+ private setHostProperty;
80
+ private bindEvents;
81
+ focus(): void;
82
+ clear(): void;
83
+ submit(): void;
84
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoPromptBox, never>;
85
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoPromptBox, "luzmo-prompt-box", ["luzmoPromptBox"], { "rows": { "alias": "rows"; "required": false; }; "grows": { "alias": "grows"; "required": false; }; "maxRows": { "alias": "max-rows"; "required": false; }; "recording": { "alias": "recording"; "required": false; }; "hideSubmit": { "alias": "hide-submit"; "required": false; }; "disableSubmit": { "alias": "disable-submit"; "required": false; }; "singleLine": { "alias": "single-line"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "pending": { "alias": "pending"; "required": false; }; "allowImages": { "alias": "allow-images"; "required": false; }; "allowFiles": { "alias": "allow-files"; "required": false; }; "acceptedFileTypes": { "alias": "accepted-file-types"; "required": false; }; "allowElements": { "alias": "allow-elements"; "required": false; }; "acceptedElementTypes": { "alias": "accepted-element-types"; "required": false; }; "triggers": { "alias": "triggers"; "required": false; }; "segments": { "alias": "segments"; "required": false; }; }, { "luzmoSubmitEvent": "luzmo-submit"; "luzmoTriggerChangeEvent": "luzmo-trigger-change"; "luzmoElementInsertedEvent": "luzmo-element-inserted"; "luzmoElementRemovedEvent": "luzmo-element-removed"; "luzmoAttachmentsChangeEvent": "luzmo-attachments-change"; "luzmoRecordEvent": "luzmo-record"; "luzmoRecordingCompleteEvent": "luzmo-recording-complete"; "luzmoRecordCancelEvent": "luzmo-record-cancel"; "luzmoRecordErrorEvent": "luzmo-record-error"; }, never, ["*"], true, never>;
86
+ }
87
+ /** The underlying custom element type for LuzmoPromptBox */
88
+ export type LuzmoPromptBoxElement = LuzmoPromptBoxHostElement;
@@ -0,0 +1,280 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/prompt-box';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * A prompt box component for chat/AI interfaces with text input and action slots.
7
+ *
8
+ * @slot (default) - Default slot for additional content
9
+ * @slot top-actions - Slot for action buttons displayed above the input
10
+ * @slot bottom-actions - Slot for action buttons displayed below the input
11
+ * @slot record-button - Slot for a custom record/voice button
12
+ * @slot submit-button - Slot for a custom submit button
13
+ */
14
+ export class LuzmoPromptBox {
15
+ elementRef = inject(ElementRef);
16
+ renderer = inject(Renderer2);
17
+ destroyRef = inject(DestroyRef);
18
+ host = this.elementRef.nativeElement;
19
+ listenerCleanup = [];
20
+ /** The underlying custom element instance. Use to call imperative methods. */
21
+ get nativeElement() {
22
+ return this.host;
23
+ }
24
+ /** The number of visible text rows for the textarea. */
25
+ rows;
26
+ /** Whether the textarea should grow to accommodate content. */
27
+ grows;
28
+ /** Maximum rows the textarea can grow to (`-1` = unlimited). Values less than 1 are disregarded. */
29
+ maxRows;
30
+ /** Whether to show the record/voice button. */
31
+ recording;
32
+ /** Whether the submit button is hidden. */
33
+ hideSubmit;
34
+ /** Whether submit behavior is disabled while keeping the input interactive. */
35
+ disableSubmit;
36
+ /** Whether to use single-line layout with actions, input, and submit in one row. */
37
+ singleLine;
38
+ /** Placeholder text for the input. */
39
+ placeholder;
40
+ /** The current value of the input. */
41
+ value;
42
+ /** Whether the prompt box is disabled. */
43
+ disabled;
44
+ /** Whether the input is readonly. */
45
+ readonly;
46
+ /** Maximum number of characters allowed. */
47
+ maxlength;
48
+ /** Whether the prompt box is in a pending/loading state. */
49
+ pending;
50
+ /** Whether to allow image attachments. */
51
+ allowImages;
52
+ /** Whether to allow file attachments. */
53
+ allowFiles;
54
+ /** Accepted file types for attachments (MIME types or extensions). */
55
+ acceptedFileTypes;
56
+ /** Whether to enable rich input mode with inline element badges. When enabled, the textarea is replaced with a contenteditable div. */
57
+ allowElements;
58
+ /** Optional filter for accepted element types during drag-and-drop. */
59
+ acceptedElementTypes;
60
+ /** Trigger key configurations. Each entry defines a key character that opens a popover when typed at a word boundary. ```ts promptBox.triggers = [ { key: '@', options: assetOptions, slotName: 'assets-menu' }, { key: '/', options: skillOptions, lazy: true } ]; ``` */
61
+ triggers;
62
+ segments;
63
+ /** Fired when the prompt is submitted. */
64
+ luzmoSubmitEvent = output({ alias: 'luzmo-submit' });
65
+ /** Fired when a trigger menu opens, closes, or the search string changes. */
66
+ luzmoTriggerChangeEvent = output({ alias: 'luzmo-trigger-change' });
67
+ /** Fired when an inline element badge is inserted. */
68
+ luzmoElementInsertedEvent = output({ alias: 'luzmo-element-inserted' });
69
+ /** Fired when an inline element badge is removed. */
70
+ luzmoElementRemovedEvent = output({ alias: 'luzmo-element-removed' });
71
+ /** Fired when attachments change. */
72
+ luzmoAttachmentsChangeEvent = output({ alias: 'luzmo-attachments-change' });
73
+ /** Fired when recording state changes. */
74
+ luzmoRecordEvent = output({ alias: 'luzmo-record' });
75
+ /** Fired when recording finishes. */
76
+ luzmoRecordingCompleteEvent = output({ alias: 'luzmo-recording-complete' });
77
+ /** Fired when recording is cancelled. */
78
+ luzmoRecordCancelEvent = output({ alias: 'luzmo-record-cancel' });
79
+ /** Fired when recording errors. */
80
+ luzmoRecordErrorEvent = output({ alias: 'luzmo-record-error' });
81
+ constructor() {
82
+ this.bindEvents();
83
+ this.destroyRef.onDestroy(() => {
84
+ for (const cleanup of this.listenerCleanup) {
85
+ cleanup();
86
+ }
87
+ });
88
+ }
89
+ ngOnChanges(changes) {
90
+ for (const key of Object.keys(changes)) {
91
+ switch (key) {
92
+ case 'rows':
93
+ this.setHostProperty('rows', changes['rows'].currentValue);
94
+ break;
95
+ case 'grows':
96
+ this.setHostProperty('grows', changes['grows'].currentValue);
97
+ break;
98
+ case 'maxRows':
99
+ this.setHostProperty('maxRows', changes['maxRows'].currentValue);
100
+ break;
101
+ case 'recording':
102
+ this.setHostProperty('recording', changes['recording'].currentValue);
103
+ break;
104
+ case 'hideSubmit':
105
+ this.setHostProperty('hideSubmit', changes['hideSubmit'].currentValue);
106
+ break;
107
+ case 'disableSubmit':
108
+ this.setHostProperty('disableSubmit', changes['disableSubmit'].currentValue);
109
+ break;
110
+ case 'singleLine':
111
+ this.setHostProperty('singleLine', changes['singleLine'].currentValue);
112
+ break;
113
+ case 'placeholder':
114
+ this.setHostProperty('placeholder', changes['placeholder'].currentValue);
115
+ break;
116
+ case 'value':
117
+ this.setHostProperty('value', changes['value'].currentValue);
118
+ break;
119
+ case 'disabled':
120
+ this.setHostProperty('disabled', changes['disabled'].currentValue);
121
+ break;
122
+ case 'readonly':
123
+ this.setHostProperty('readonly', changes['readonly'].currentValue);
124
+ break;
125
+ case 'maxlength':
126
+ this.setHostProperty('maxlength', changes['maxlength'].currentValue);
127
+ break;
128
+ case 'pending':
129
+ this.setHostProperty('pending', changes['pending'].currentValue);
130
+ break;
131
+ case 'allowImages':
132
+ this.setHostProperty('allowImages', changes['allowImages'].currentValue);
133
+ break;
134
+ case 'allowFiles':
135
+ this.setHostProperty('allowFiles', changes['allowFiles'].currentValue);
136
+ break;
137
+ case 'acceptedFileTypes':
138
+ this.setHostProperty('acceptedFileTypes', changes['acceptedFileTypes'].currentValue);
139
+ break;
140
+ case 'allowElements':
141
+ this.setHostProperty('allowElements', changes['allowElements'].currentValue);
142
+ break;
143
+ case 'acceptedElementTypes':
144
+ this.setHostProperty('acceptedElementTypes', changes['acceptedElementTypes'].currentValue);
145
+ break;
146
+ case 'triggers':
147
+ this.setHostProperty('triggers', changes['triggers'].currentValue);
148
+ break;
149
+ case 'segments':
150
+ this.setHostProperty('segments', changes['segments'].currentValue);
151
+ break;
152
+ default:
153
+ break;
154
+ }
155
+ }
156
+ }
157
+ /**
158
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
159
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
160
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
161
+ * undefined / null by clearing their bindings.
162
+ */
163
+ setHostProperty(key, value) {
164
+ this.renderer.setProperty(this.host, key, value);
165
+ }
166
+ bindEvents() {
167
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-submit', (event) => {
168
+ this.luzmoSubmitEvent.emit(event);
169
+ }));
170
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-trigger-change', (event) => {
171
+ this.luzmoTriggerChangeEvent.emit(event);
172
+ }));
173
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-element-inserted', (event) => {
174
+ this.luzmoElementInsertedEvent.emit(event);
175
+ }));
176
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-element-removed', (event) => {
177
+ this.luzmoElementRemovedEvent.emit(event);
178
+ }));
179
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-attachments-change', (event) => {
180
+ this.luzmoAttachmentsChangeEvent.emit(event);
181
+ }));
182
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-record', (event) => {
183
+ this.luzmoRecordEvent.emit(event);
184
+ }));
185
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-recording-complete', (event) => {
186
+ this.luzmoRecordingCompleteEvent.emit(event);
187
+ }));
188
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-record-cancel', (event) => {
189
+ this.luzmoRecordCancelEvent.emit(event);
190
+ }));
191
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-record-error', (event) => {
192
+ this.luzmoRecordErrorEvent.emit(event);
193
+ }));
194
+ }
195
+ focus() {
196
+ return this.host.focus();
197
+ }
198
+ clear() {
199
+ return this.host.clear();
200
+ }
201
+ submit() {
202
+ return this.host.submit();
203
+ }
204
+ static ɵfac = function LuzmoPromptBox_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoPromptBox)(); };
205
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoPromptBox, selectors: [["luzmo-prompt-box"]], inputs: { rows: "rows", grows: "grows", maxRows: [0, "max-rows", "maxRows"], recording: "recording", hideSubmit: [0, "hide-submit", "hideSubmit"], disableSubmit: [0, "disable-submit", "disableSubmit"], singleLine: [0, "single-line", "singleLine"], placeholder: "placeholder", value: "value", disabled: "disabled", readonly: "readonly", maxlength: "maxlength", pending: "pending", allowImages: [0, "allow-images", "allowImages"], allowFiles: [0, "allow-files", "allowFiles"], acceptedFileTypes: [0, "accepted-file-types", "acceptedFileTypes"], allowElements: [0, "allow-elements", "allowElements"], acceptedElementTypes: [0, "accepted-element-types", "acceptedElementTypes"], triggers: "triggers", segments: "segments" }, outputs: { luzmoSubmitEvent: "luzmo-submit", luzmoTriggerChangeEvent: "luzmo-trigger-change", luzmoElementInsertedEvent: "luzmo-element-inserted", luzmoElementRemovedEvent: "luzmo-element-removed", luzmoAttachmentsChangeEvent: "luzmo-attachments-change", luzmoRecordEvent: "luzmo-record", luzmoRecordingCompleteEvent: "luzmo-recording-complete", luzmoRecordCancelEvent: "luzmo-record-cancel", luzmoRecordErrorEvent: "luzmo-record-error" }, exportAs: ["luzmoPromptBox"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoPromptBox_Template(rf, ctx) { if (rf & 1) {
206
+ i0.ɵɵprojectionDef();
207
+ i0.ɵɵprojection(0);
208
+ } }, encapsulation: 2, changeDetection: 0 });
209
+ }
210
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoPromptBox, [{
211
+ type: Component,
212
+ args: [{
213
+ selector: 'luzmo-prompt-box',
214
+ exportAs: 'luzmoPromptBox',
215
+ standalone: true,
216
+ changeDetection: ChangeDetectionStrategy.OnPush,
217
+ template: '<ng-content />'
218
+ }]
219
+ }], () => [], { rows: [{
220
+ type: Input,
221
+ args: [{ alias: 'rows' }]
222
+ }], grows: [{
223
+ type: Input,
224
+ args: [{ alias: 'grows' }]
225
+ }], maxRows: [{
226
+ type: Input,
227
+ args: [{ alias: 'max-rows' }]
228
+ }], recording: [{
229
+ type: Input,
230
+ args: [{ alias: 'recording' }]
231
+ }], hideSubmit: [{
232
+ type: Input,
233
+ args: [{ alias: 'hide-submit' }]
234
+ }], disableSubmit: [{
235
+ type: Input,
236
+ args: [{ alias: 'disable-submit' }]
237
+ }], singleLine: [{
238
+ type: Input,
239
+ args: [{ alias: 'single-line' }]
240
+ }], placeholder: [{
241
+ type: Input,
242
+ args: [{ alias: 'placeholder' }]
243
+ }], value: [{
244
+ type: Input,
245
+ args: [{ alias: 'value' }]
246
+ }], disabled: [{
247
+ type: Input,
248
+ args: [{ alias: 'disabled' }]
249
+ }], readonly: [{
250
+ type: Input,
251
+ args: [{ alias: 'readonly' }]
252
+ }], maxlength: [{
253
+ type: Input,
254
+ args: [{ alias: 'maxlength' }]
255
+ }], pending: [{
256
+ type: Input,
257
+ args: [{ alias: 'pending' }]
258
+ }], allowImages: [{
259
+ type: Input,
260
+ args: [{ alias: 'allow-images' }]
261
+ }], allowFiles: [{
262
+ type: Input,
263
+ args: [{ alias: 'allow-files' }]
264
+ }], acceptedFileTypes: [{
265
+ type: Input,
266
+ args: [{ alias: 'accepted-file-types' }]
267
+ }], allowElements: [{
268
+ type: Input,
269
+ args: [{ alias: 'allow-elements' }]
270
+ }], acceptedElementTypes: [{
271
+ type: Input,
272
+ args: [{ alias: 'accepted-element-types' }]
273
+ }], triggers: [{
274
+ type: Input,
275
+ args: [{ alias: 'triggers' }]
276
+ }], segments: [{
277
+ type: Input,
278
+ args: [{ alias: 'segments' }]
279
+ }], luzmoSubmitEvent: [{ type: i0.Output, args: ["luzmo-submit"] }], luzmoTriggerChangeEvent: [{ type: i0.Output, args: ["luzmo-trigger-change"] }], luzmoElementInsertedEvent: [{ type: i0.Output, args: ["luzmo-element-inserted"] }], luzmoElementRemovedEvent: [{ type: i0.Output, args: ["luzmo-element-removed"] }], luzmoAttachmentsChangeEvent: [{ type: i0.Output, args: ["luzmo-attachments-change"] }], luzmoRecordEvent: [{ type: i0.Output, args: ["luzmo-record"] }], luzmoRecordingCompleteEvent: [{ type: i0.Output, args: ["luzmo-recording-complete"] }], luzmoRecordCancelEvent: [{ type: i0.Output, args: ["luzmo-record-cancel"] }], luzmoRecordErrorEvent: [{ type: i0.Output, args: ["luzmo-record-error"] }] }); })();
280
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoPromptBox, { className: "LuzmoPromptBox", filePath: "components/prompt-box.ts", lineNumber: 22 }); })();