ux4g-components-web 1.4.0 → 1.5.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 (124) hide show
  1. package/README.md +76 -0
  2. package/dist/__tests__/css-bundle.integration.test.d.ts +11 -0
  3. package/dist/__tests__/css-bundle.integration.test.js +1102 -0
  4. package/dist/__tests__/css-bundle.phase10.property.test.d.ts +9 -0
  5. package/dist/__tests__/css-bundle.phase10.property.test.js +64 -0
  6. package/dist/__tests__/css-bundle.phase5.property.test.d.ts +9 -0
  7. package/dist/__tests__/css-bundle.phase5.property.test.js +126 -0
  8. package/dist/__tests__/css-bundle.phase6.property.test.d.ts +9 -0
  9. package/dist/__tests__/css-bundle.phase6.property.test.js +73 -0
  10. package/dist/__tests__/css-bundle.phase7.property.test.d.ts +9 -0
  11. package/dist/__tests__/css-bundle.phase7.property.test.js +76 -0
  12. package/dist/__tests__/css-bundle.phase8.property.test.d.ts +9 -0
  13. package/dist/__tests__/css-bundle.phase8.property.test.js +67 -0
  14. package/dist/__tests__/css-bundle.phase9.property.test.d.ts +9 -0
  15. package/dist/__tests__/css-bundle.phase9.property.test.js +93 -0
  16. package/dist/__tests__/css-bundle.property.test.d.ts +14 -0
  17. package/dist/__tests__/css-bundle.property.test.js +393 -0
  18. package/dist/__tests__/dom-generators.determinism.property.test.d.ts +1 -0
  19. package/dist/__tests__/dom-generators.determinism.property.test.js +71 -0
  20. package/dist/__tests__/dom-generators.id.property.test.d.ts +1 -0
  21. package/dist/__tests__/dom-generators.id.property.test.js +99 -0
  22. package/dist/__tests__/dom-generators.otp.property.test.d.ts +1 -0
  23. package/dist/__tests__/dom-generators.property.test.d.ts +1 -0
  24. package/dist/__tests__/dom-generators.property.test.js +205 -0
  25. package/dist/__tests__/dom-generators.states.property.test.d.ts +1 -0
  26. package/dist/__tests__/dom-generators.table.property.test.d.ts +1 -0
  27. package/dist/__tests__/dom-generators.tier1.property.test.d.ts +1 -0
  28. package/dist/__tests__/dom-generators.tier1.property.test.js +403 -0
  29. package/dist/__tests__/dom-generators.validation.property.test.d.ts +1 -0
  30. package/dist/__tests__/dom-generators.validation.property.test.js +327 -0
  31. package/dist/__tests__/megamenu.classbuilder.property.test.d.ts +1 -0
  32. package/dist/__tests__/megamenu.classbuilder.property.test.js +88 -0
  33. package/dist/__tests__/smoke.test.d.ts +1 -0
  34. package/dist/__tests__/smoke.test.js +65 -0
  35. package/dist/__tests__/types.phase10.property.test.d.ts +1 -0
  36. package/dist/__tests__/types.phase10.property.test.js +166 -0
  37. package/dist/__tests__/types.phase10.test.d.ts +1 -0
  38. package/dist/__tests__/types.phase10.test.js +76 -0
  39. package/dist/__tests__/types.phase3.property.test.d.ts +1 -0
  40. package/dist/__tests__/types.phase3.property.test.js +83 -0
  41. package/dist/__tests__/types.phase3.test.d.ts +1 -0
  42. package/dist/__tests__/types.phase3.test.js +76 -0
  43. package/dist/__tests__/types.phase4.property.test.d.ts +1 -0
  44. package/dist/__tests__/types.phase4.property.test.js +119 -0
  45. package/dist/__tests__/types.phase4.test.d.ts +1 -0
  46. package/dist/__tests__/types.phase4.test.js +70 -0
  47. package/dist/__tests__/types.phase5.property.test.d.ts +1 -0
  48. package/dist/__tests__/types.phase5.property.test.js +120 -0
  49. package/dist/__tests__/types.phase5.test.d.ts +1 -0
  50. package/dist/__tests__/types.phase5.test.js +64 -0
  51. package/dist/__tests__/types.phase6.property.test.d.ts +1 -0
  52. package/dist/__tests__/types.phase6.property.test.js +189 -0
  53. package/dist/__tests__/types.phase6.test.d.ts +1 -0
  54. package/dist/__tests__/types.phase6.test.js +121 -0
  55. package/dist/__tests__/types.phase7.property.test.d.ts +1 -0
  56. package/dist/__tests__/types.phase7.property.test.js +217 -0
  57. package/dist/__tests__/types.phase7.test.d.ts +1 -0
  58. package/dist/__tests__/types.phase7.test.js +106 -0
  59. package/dist/__tests__/types.phase8.property.test.d.ts +1 -0
  60. package/dist/__tests__/types.phase8.property.test.js +224 -0
  61. package/dist/__tests__/types.phase8.test.d.ts +1 -0
  62. package/dist/__tests__/types.phase8.test.js +114 -0
  63. package/dist/__tests__/types.phase9.property.test.d.ts +1 -0
  64. package/dist/__tests__/types.phase9.property.test.js +347 -0
  65. package/dist/__tests__/types.phase9.test.d.ts +1 -0
  66. package/dist/__tests__/types.phase9.test.js +226 -0
  67. package/dist/__tests__/types.restructure.property.test.d.ts +1 -0
  68. package/dist/__tests__/types.restructure.property.test.js +76 -0
  69. package/dist/__tests__/types.test.d.ts +1 -0
  70. package/dist/__tests__/types.test.js +175 -0
  71. package/dist/dom-generators/accordion.d.ts +23 -0
  72. package/dist/dom-generators/avatar.d.ts +19 -0
  73. package/dist/dom-generators/carousel.d.ts +20 -0
  74. package/dist/dom-generators/chip.d.ts +18 -0
  75. package/dist/dom-generators/combobox.d.ts +28 -0
  76. package/dist/dom-generators/date-picker.d.ts +19 -0
  77. package/dist/dom-generators/dom-generators/accordion.d.ts +21 -0
  78. package/dist/dom-generators/dom-generators/avatar.d.ts +17 -0
  79. package/dist/dom-generators/dom-generators/carousel.d.ts +19 -0
  80. package/dist/dom-generators/dom-generators/chip.d.ts +16 -0
  81. package/dist/dom-generators/dom-generators/combobox.d.ts +26 -0
  82. package/dist/dom-generators/dom-generators/date-picker.d.ts +18 -0
  83. package/dist/dom-generators/dom-generators/drawer.d.ts +17 -0
  84. package/dist/dom-generators/dom-generators/dropdown.d.ts +26 -0
  85. package/dist/dom-generators/dom-generators/file-upload.d.ts +20 -0
  86. package/dist/dom-generators/dom-generators/id-generator.d.ts +9 -0
  87. package/dist/dom-generators/dom-generators/index.d.ts +27 -0
  88. package/dist/dom-generators/dom-generators/modal.d.ts +19 -0
  89. package/dist/dom-generators/dom-generators/otp.d.ts +16 -0
  90. package/dist/dom-generators/dom-generators/popover.d.ts +17 -0
  91. package/dist/dom-generators/dom-generators/progress.d.ts +16 -0
  92. package/dist/dom-generators/dom-generators/search.d.ts +20 -0
  93. package/dist/dom-generators/dom-generators/stepper.d.ts +21 -0
  94. package/dist/dom-generators/dom-generators/table.d.ts +23 -0
  95. package/dist/dom-generators/dom-generators/tabs.d.ts +21 -0
  96. package/dist/dom-generators/dom-generators/time-picker.d.ts +18 -0
  97. package/dist/dom-generators/dom-generators/tooltip.d.ts +17 -0
  98. package/dist/dom-generators/dom-generators/types.d.ts +27 -0
  99. package/dist/dom-generators/dom-generators/validate.d.ts +20 -0
  100. package/dist/dom-generators/drawer.d.ts +19 -0
  101. package/dist/dom-generators/dropdown.d.ts +28 -0
  102. package/dist/dom-generators/file-upload.d.ts +22 -0
  103. package/dist/dom-generators/id-generator.d.ts +9 -0
  104. package/dist/dom-generators/index.bundled.d.ts +654 -0
  105. package/dist/dom-generators/index.cjs +2029 -0
  106. package/dist/dom-generators/index.d.ts +27 -0
  107. package/dist/dom-generators/index.mjs +2001 -0
  108. package/dist/dom-generators/modal.d.ts +21 -0
  109. package/dist/dom-generators/otp.d.ts +18 -0
  110. package/dist/dom-generators/popover.d.ts +19 -0
  111. package/dist/dom-generators/progress.d.ts +18 -0
  112. package/dist/dom-generators/search.d.ts +22 -0
  113. package/dist/dom-generators/stepper.d.ts +23 -0
  114. package/dist/dom-generators/table.d.ts +25 -0
  115. package/dist/dom-generators/tabs.d.ts +23 -0
  116. package/dist/dom-generators/time-picker.d.ts +19 -0
  117. package/dist/dom-generators/tooltip.d.ts +19 -0
  118. package/dist/dom-generators/types.d.ts +155 -0
  119. package/dist/dom-generators/validate.d.ts +20 -0
  120. package/dist/runtime/bootstrap.js +59 -0
  121. package/dist/runtime/index.js +55 -0
  122. package/dist/types.d.ts +155 -0
  123. package/dist/types.js +552 -0
  124. package/package.json +12 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,175 @@
1
+ import { buildButtonClasses, VARIANT_CLASS_MAP, SIZE_CLASS_MAP, } from '../../src/types';
2
+ describe('buildButtonClasses', () => {
3
+ const variants = [
4
+ 'primary',
5
+ 'outline-primary',
6
+ 'text-primary',
7
+ 'tonal-primary',
8
+ 'danger',
9
+ 'outline-danger',
10
+ 'text-danger',
11
+ 'tonal-danger',
12
+ ];
13
+ const sizes = ['xl', 'lg', 'md', 'sm', 'xs'];
14
+ describe('variant class mapping', () => {
15
+ variants.forEach((variant) => {
16
+ it(`variant "${variant}" produces class "${VARIANT_CLASS_MAP[variant]}"`, () => {
17
+ const result = buildButtonClasses(variant, 'md', false, false);
18
+ expect(result).toContain(VARIANT_CLASS_MAP[variant]);
19
+ });
20
+ });
21
+ });
22
+ describe('size class mapping', () => {
23
+ sizes.forEach((size) => {
24
+ if (size === 'md') {
25
+ it('size "md" produces no size class', () => {
26
+ const result = buildButtonClasses('primary', 'md', false, false);
27
+ expect(result).not.toMatch(/ux4g-btn-(xl|lg|sm|xs)/);
28
+ });
29
+ }
30
+ else {
31
+ it(`size "${size}" produces class "${SIZE_CLASS_MAP[size]}"`, () => {
32
+ const result = buildButtonClasses('primary', size, false, false);
33
+ expect(result).toContain(SIZE_CLASS_MAP[size]);
34
+ });
35
+ }
36
+ });
37
+ });
38
+ describe('disabled state', () => {
39
+ it('disabled=true adds ux4g-btn-disabled', () => {
40
+ const result = buildButtonClasses('primary', 'md', true, false);
41
+ expect(result).toContain('ux4g-btn-disabled');
42
+ });
43
+ it('disabled=false does not add ux4g-btn-disabled', () => {
44
+ const result = buildButtonClasses('primary', 'md', false, false);
45
+ expect(result).not.toContain('ux4g-btn-disabled');
46
+ });
47
+ });
48
+ describe('loading state', () => {
49
+ it('loading=true adds ux4g-btn-loading', () => {
50
+ const result = buildButtonClasses('primary', 'md', false, true);
51
+ expect(result).toContain('ux4g-btn-loading');
52
+ });
53
+ it('loading=false does not add ux4g-btn-loading', () => {
54
+ const result = buildButtonClasses('primary', 'md', false, false);
55
+ expect(result).not.toContain('ux4g-btn-loading');
56
+ });
57
+ });
58
+ describe('combined disabled + loading state', () => {
59
+ it('disabled=true and loading=true adds both classes', () => {
60
+ const result = buildButtonClasses('primary', 'md', true, true);
61
+ expect(result).toContain('ux4g-btn-disabled');
62
+ expect(result).toContain('ux4g-btn-loading');
63
+ });
64
+ });
65
+ describe('extra class', () => {
66
+ it('appends extra class when provided', () => {
67
+ const result = buildButtonClasses('primary', 'md', false, false, 'rectangle', 'my-custom-class');
68
+ expect(result).toContain('my-custom-class');
69
+ });
70
+ it('does not append extra class when undefined', () => {
71
+ const result = buildButtonClasses('primary', 'md', false, false);
72
+ const classes = result.split(' ');
73
+ expect(classes).toHaveLength(2); // variant class + md size class (Rule 10: md always emits a class)
74
+ });
75
+ });
76
+ describe('class ordering', () => {
77
+ it('variant class is always first', () => {
78
+ const result = buildButtonClasses('danger', 'xl', true, true);
79
+ const classes = result.split(' ');
80
+ expect(classes[0]).toBe('ux4g-btn-danger');
81
+ });
82
+ it('returns space-separated string', () => {
83
+ const result = buildButtonClasses('primary', 'lg', false, false);
84
+ expect(result).toBe('ux4g-btn-primary ux4g-btn-lg');
85
+ });
86
+ });
87
+ describe('shape', () => {
88
+ it('pill shape adds ux4g-btn-pill', () => {
89
+ const result = buildButtonClasses('primary', 'md', false, false, 'pill');
90
+ expect(result).toContain('ux4g-btn-pill');
91
+ });
92
+ it('rectangle shape does not add ux4g-btn-pill', () => {
93
+ const result = buildButtonClasses('primary', 'md', false, false, 'rectangle');
94
+ expect(result).not.toContain('ux4g-btn-pill');
95
+ });
96
+ it('undefined shape does not add ux4g-btn-pill', () => {
97
+ const result = buildButtonClasses('primary', 'md', false, false);
98
+ expect(result).not.toContain('ux4g-btn-pill');
99
+ });
100
+ });
101
+ });
102
+ import { buildSpinnerClasses, } from '../../src/types';
103
+ describe('buildSpinnerClasses', () => {
104
+ const variants = ['primary', 'inverse', 'danger'];
105
+ const sizes = ['xl', 'lg', 'md', 'sm', 'xs'];
106
+ const types = ['full', 'split', 'partial'];
107
+ describe('all 45 combinations produce correct class pattern', () => {
108
+ variants.forEach((variant) => {
109
+ sizes.forEach((size) => {
110
+ types.forEach((type) => {
111
+ const base = `ux4g-spinner-${variant}-${type}`;
112
+ const expected = size !== 'md' ? `${base} ux4g-spinner-${size}` : base;
113
+ it(`buildSpinnerClasses('${variant}', '${size}', '${type}') → '${expected}'`, () => {
114
+ expect(buildSpinnerClasses(variant, size, type)).toBe(expected);
115
+ });
116
+ });
117
+ });
118
+ });
119
+ });
120
+ describe('default combination', () => {
121
+ it("buildSpinnerClasses('primary', 'md', 'full') → 'ux4g-spinner-primary-full' (no size class for md)", () => {
122
+ expect(buildSpinnerClasses('primary', 'md', 'full')).toBe('ux4g-spinner-primary-full');
123
+ });
124
+ });
125
+ describe('non-md sizes add a separate size class', () => {
126
+ it("buildSpinnerClasses('primary', 'xl', 'full') → 'ux4g-spinner-primary-full ux4g-spinner-xl'", () => {
127
+ expect(buildSpinnerClasses('primary', 'xl', 'full')).toBe('ux4g-spinner-primary-full ux4g-spinner-xl');
128
+ });
129
+ it("buildSpinnerClasses('danger', 'sm', 'split') → 'ux4g-spinner-danger-split ux4g-spinner-sm'", () => {
130
+ expect(buildSpinnerClasses('danger', 'sm', 'split')).toBe('ux4g-spinner-danger-split ux4g-spinner-sm');
131
+ });
132
+ });
133
+ describe('extra class parameter', () => {
134
+ it('appends extra class when provided (md — no size class)', () => {
135
+ const result = buildSpinnerClasses('primary', 'md', 'full', 'my-extra');
136
+ expect(result).toBe('ux4g-spinner-primary-full my-extra');
137
+ });
138
+ it('appends extra class when provided (non-md — size class present)', () => {
139
+ const result = buildSpinnerClasses('primary', 'xl', 'full', 'my-extra');
140
+ expect(result).toBe('ux4g-spinner-primary-full ux4g-spinner-xl my-extra');
141
+ });
142
+ it('does not append extra class when not provided', () => {
143
+ const result = buildSpinnerClasses('primary', 'md', 'full');
144
+ expect(result).toBe('ux4g-spinner-primary-full');
145
+ expect(result).not.toMatch(/ $/); // no trailing space
146
+ });
147
+ it('does not append extra class when undefined', () => {
148
+ const result = buildSpinnerClasses('danger', 'xs', 'partial', undefined);
149
+ expect(result).toBe('ux4g-spinner-danger-partial ux4g-spinner-xs');
150
+ });
151
+ });
152
+ });
153
+ import * as fc from 'fast-check';
154
+ /**
155
+ * Property 1: Spinner class string matches correct pattern
156
+ * Validates: Requirements 2a.5, 3.5
157
+ * Tag: Feature: ux4g-spinner-focus-ring, Property 1
158
+ */
159
+ describe('Property 1: Spinner class string matches compound pattern', () => {
160
+ it('buildSpinnerClasses(variant, size, type) returns ux4g-spinner-${variant}-${type} with optional ux4g-spinner-${size} for non-md', () => {
161
+ const variantArb = fc.constantFrom('primary', 'inverse', 'danger');
162
+ const sizeArb = fc.constantFrom('xl', 'lg', 'md', 'sm', 'xs');
163
+ const typeArb = fc.constantFrom('full', 'split', 'partial');
164
+ fc.assert(fc.property(variantArb, sizeArb, typeArb, (variant, size, type) => {
165
+ const result = buildSpinnerClasses(variant, size, type);
166
+ const base = `ux4g-spinner-${variant}-${type}`;
167
+ if (size === 'md') {
168
+ return result === base;
169
+ }
170
+ else {
171
+ return result === `${base} ux4g-spinner-${size}`;
172
+ }
173
+ }), { numRuns: 20 });
174
+ });
175
+ });
@@ -0,0 +1,23 @@
1
+ import { NodeDescriptor } from './types';
2
+ import { AccordionArrowPosition, AccordionVariant } from '../types.js';
3
+ export interface AccordionGeneratorProps {
4
+ items: Array<{
5
+ header: string;
6
+ content: string;
7
+ expanded?: boolean;
8
+ disabled?: boolean;
9
+ }>;
10
+ arrowPosition?: AccordionArrowPosition;
11
+ variant?: AccordionVariant;
12
+ multiExpand?: boolean;
13
+ }
14
+ /**
15
+ * Generates a complete Accordion DOM descriptor tree.
16
+ *
17
+ * Produces headers with `data-ux4g-accordion-toggle` for Runtime_JS,
18
+ * panels with unique IDs, aria-expanded on toggles, aria-controls
19
+ * referencing panel IDs, and role="region" on panels.
20
+ */
21
+ export declare function generateAccordionDOM(props: AccordionGeneratorProps): NodeDescriptor;
22
+
23
+
@@ -0,0 +1,19 @@
1
+ import { NodeDescriptor } from './types';
2
+ import { AvatarSize } from '../types.js';
3
+ export interface AvatarNativeGeneratorProps {
4
+ src?: string;
5
+ alt?: string;
6
+ size?: AvatarSize;
7
+ status?: 'online' | 'offline' | 'busy' | 'away';
8
+ fallbackInitials?: string;
9
+ }
10
+ /**
11
+ * Generates a complete Avatar DOM descriptor tree.
12
+ *
13
+ * Produces a container with avatar classes from buildAvatarClasses(),
14
+ * an img element with alt text (or fallback initials span),
15
+ * and an optional status indicator element.
16
+ */
17
+ export declare function generateAvatarDOM(props: AvatarNativeGeneratorProps): NodeDescriptor;
18
+
19
+
@@ -0,0 +1,20 @@
1
+ import { NodeDescriptor } from './types';
2
+ export interface CarouselGeneratorProps {
3
+ slides: Array<{
4
+ content: string;
5
+ label?: string;
6
+ }>;
7
+ activeIndex?: number;
8
+ showIndicators?: boolean;
9
+ showNavigation?: boolean;
10
+ }
11
+ /**
12
+ * Generates a complete Carousel DOM descriptor tree.
13
+ *
14
+ * Produces a root element with `aria-roledescription="carousel"`, slide items with
15
+ * `role="group"` and `aria-roledescription="slide"`, navigation buttons with
16
+ * `data-ux4g-carousel-prev` and `data-ux4g-carousel-next` for Runtime_JS, and
17
+ * indicator dots for slide navigation.
18
+ */
19
+ export declare function generateCarouselDOM(props: CarouselGeneratorProps): NodeDescriptor;
20
+
@@ -0,0 +1,18 @@
1
+ import { NodeDescriptor } from './types';
2
+ import { ChipType, ChipSize } from '../types.js';
3
+ export interface ChipNativeGeneratorProps {
4
+ label: string;
5
+ type?: ChipType;
6
+ size?: ChipSize;
7
+ active?: boolean;
8
+ dismissible?: boolean;
9
+ }
10
+ /**
11
+ * Generates a complete Chip DOM descriptor tree.
12
+ *
13
+ * Produces a chip container with CSS classes from `buildChipClasses()`,
14
+ * a label span, and an optional dismiss button with `aria-label="Remove {label}"`.
15
+ */
16
+ export declare function generateChipDOM(props: ChipNativeGeneratorProps): NodeDescriptor;
17
+
18
+
@@ -0,0 +1,28 @@
1
+ import { NodeDescriptor } from './types';
2
+ import { ComboboxSize, ComboboxState } from '../types.js';
3
+ export interface ComboboxGeneratorProps {
4
+ options: Array<{
5
+ label: string;
6
+ value: string;
7
+ disabled?: boolean;
8
+ }>;
9
+ value?: string | string[];
10
+ inputValue?: string;
11
+ placeholder?: string;
12
+ multiple?: boolean;
13
+ disabled?: boolean;
14
+ size?: ComboboxSize;
15
+ state?: ComboboxState;
16
+ open?: boolean;
17
+ }
18
+ /**
19
+ * Generates a complete Combobox DOM descriptor tree.
20
+ *
21
+ * Produces an input with `role="combobox"` and `aria-autocomplete="list"`,
22
+ * a listbox with `role="listbox"`, and option items with `role="option"`.
23
+ * Supports `aria-activedescendant` pointing to the first selected option.
24
+ * Compatible with Runtime_JS MutationObserver-based initialization.
25
+ */
26
+ export declare function generateComboboxDOM(props: ComboboxGeneratorProps): NodeDescriptor;
27
+
28
+
@@ -0,0 +1,19 @@
1
+ import { NodeDescriptor } from './types';
2
+ export interface DatePickerGeneratorProps {
3
+ value?: string;
4
+ min?: string;
5
+ max?: string;
6
+ locale?: string;
7
+ displayMonth?: number;
8
+ displayYear?: number;
9
+ }
10
+ /**
11
+ * Generates a complete DatePicker DOM descriptor tree.
12
+ *
13
+ * Produces a calendar grid with `role="grid"`, day cells with `role="gridcell"`,
14
+ * month/year navigation buttons, weekday column headers with `role="columnheader"`,
15
+ * and full accessibility attributes including `aria-label` on each day cell and
16
+ * `aria-selected`/`aria-disabled` states.
17
+ */
18
+ export declare function generateDatePickerDOM(props: DatePickerGeneratorProps): NodeDescriptor;
19
+
@@ -0,0 +1,21 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { AccordionArrowPosition, AccordionVariant } from '../types.js';
3
+ export interface AccordionGeneratorProps {
4
+ items: Array<{
5
+ header: string;
6
+ content: string;
7
+ expanded?: boolean;
8
+ disabled?: boolean;
9
+ }>;
10
+ arrowPosition?: AccordionArrowPosition;
11
+ variant?: AccordionVariant;
12
+ multiExpand?: boolean;
13
+ }
14
+ /**
15
+ * Generates a complete Accordion DOM descriptor tree.
16
+ *
17
+ * Produces headers with `data-ux4g-accordion-toggle` for Runtime_JS,
18
+ * panels with unique IDs, aria-expanded on toggles, aria-controls
19
+ * referencing panel IDs, and role="region" on panels.
20
+ */
21
+ export declare function generateAccordionDOM(props: AccordionGeneratorProps): NodeDescriptor;
@@ -0,0 +1,17 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { AvatarSize } from '../types.js';
3
+ export interface AvatarNativeGeneratorProps {
4
+ src?: string;
5
+ alt?: string;
6
+ size?: AvatarSize;
7
+ status?: 'online' | 'offline' | 'busy' | 'away';
8
+ fallbackInitials?: string;
9
+ }
10
+ /**
11
+ * Generates a complete Avatar DOM descriptor tree.
12
+ *
13
+ * Produces a container with avatar classes from buildAvatarClasses(),
14
+ * an img element with alt text (or fallback initials span),
15
+ * and an optional status indicator element.
16
+ */
17
+ export declare function generateAvatarDOM(props: AvatarNativeGeneratorProps): NodeDescriptor;
@@ -0,0 +1,19 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ export interface CarouselGeneratorProps {
3
+ slides: Array<{
4
+ content: string;
5
+ label?: string;
6
+ }>;
7
+ activeIndex?: number;
8
+ showIndicators?: boolean;
9
+ showNavigation?: boolean;
10
+ }
11
+ /**
12
+ * Generates a complete Carousel DOM descriptor tree.
13
+ *
14
+ * Produces a root element with `aria-roledescription="carousel"`, slide items with
15
+ * `role="group"` and `aria-roledescription="slide"`, navigation buttons with
16
+ * `data-ux4g-carousel-prev` and `data-ux4g-carousel-next` for Runtime_JS, and
17
+ * indicator dots for slide navigation.
18
+ */
19
+ export declare function generateCarouselDOM(props: CarouselGeneratorProps): NodeDescriptor;
@@ -0,0 +1,16 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { ChipType, ChipSize } from '../types.js';
3
+ export interface ChipNativeGeneratorProps {
4
+ label: string;
5
+ type?: ChipType;
6
+ size?: ChipSize;
7
+ active?: boolean;
8
+ dismissible?: boolean;
9
+ }
10
+ /**
11
+ * Generates a complete Chip DOM descriptor tree.
12
+ *
13
+ * Produces a chip container with CSS classes from `buildChipClasses()`,
14
+ * a label span, and an optional dismiss button with `aria-label="Remove {label}"`.
15
+ */
16
+ export declare function generateChipDOM(props: ChipNativeGeneratorProps): NodeDescriptor;
@@ -0,0 +1,26 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { ComboboxSize, ComboboxState } from '../types.js';
3
+ export interface ComboboxGeneratorProps {
4
+ options: Array<{
5
+ label: string;
6
+ value: string;
7
+ disabled?: boolean;
8
+ }>;
9
+ value?: string | string[];
10
+ inputValue?: string;
11
+ placeholder?: string;
12
+ multiple?: boolean;
13
+ disabled?: boolean;
14
+ size?: ComboboxSize;
15
+ state?: ComboboxState;
16
+ open?: boolean;
17
+ }
18
+ /**
19
+ * Generates a complete Combobox DOM descriptor tree.
20
+ *
21
+ * Produces an input with `role="combobox"` and `aria-autocomplete="list"`,
22
+ * a listbox with `role="listbox"`, and option items with `role="option"`.
23
+ * Supports `aria-activedescendant` pointing to the first selected option.
24
+ * Compatible with Runtime_JS MutationObserver-based initialization.
25
+ */
26
+ export declare function generateComboboxDOM(props: ComboboxGeneratorProps): NodeDescriptor;
@@ -0,0 +1,18 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ export interface DatePickerGeneratorProps {
3
+ value?: string;
4
+ min?: string;
5
+ max?: string;
6
+ locale?: string;
7
+ displayMonth?: number;
8
+ displayYear?: number;
9
+ }
10
+ /**
11
+ * Generates a complete DatePicker DOM descriptor tree.
12
+ *
13
+ * Produces a calendar grid with `role="grid"`, day cells with `role="gridcell"`,
14
+ * month/year navigation buttons, weekday column headers with `role="columnheader"`,
15
+ * and full accessibility attributes including `aria-label` on each day cell and
16
+ * `aria-selected`/`aria-disabled` states.
17
+ */
18
+ export declare function generateDatePickerDOM(props: DatePickerGeneratorProps): NodeDescriptor;
@@ -0,0 +1,17 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { DrawerPlacement } from '../types.js';
3
+ export interface DrawerGeneratorProps {
4
+ open?: boolean;
5
+ placement?: DrawerPlacement;
6
+ title?: string;
7
+ closable?: boolean;
8
+ }
9
+ /**
10
+ * Generates a complete Drawer DOM descriptor tree.
11
+ *
12
+ * Produces a backdrop element and a drawer panel with `role="dialog"`,
13
+ * `aria-modal="true"`, an optional close button with `data-ux4g-drawer-close`,
14
+ * and an optional title heading. Compatible with Runtime_JS
15
+ * MutationObserver-based initialization.
16
+ */
17
+ export declare function generateDrawerDOM(props: DrawerGeneratorProps): NodeDescriptor;
@@ -0,0 +1,26 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { DropdownSize, DropdownState } from '../types.js';
3
+ export interface DropdownGeneratorProps {
4
+ options: Array<{
5
+ label: string;
6
+ value: string;
7
+ disabled?: boolean;
8
+ group?: string;
9
+ }>;
10
+ value?: string | string[];
11
+ placeholder?: string;
12
+ searchable?: boolean;
13
+ multiple?: boolean;
14
+ disabled?: boolean;
15
+ size?: DropdownSize;
16
+ state?: DropdownState;
17
+ open?: boolean;
18
+ }
19
+ /**
20
+ * Generates a complete Dropdown DOM descriptor tree.
21
+ *
22
+ * Produces a trigger button with `data-ux4g-dropdown-toggle`, a menu container
23
+ * with `role="listbox"`, and option items with `role="option"` and `aria-selected`.
24
+ * Compatible with Runtime_JS MutationObserver-based initialization.
25
+ */
26
+ export declare function generateDropdownDOM(props: DropdownGeneratorProps): NodeDescriptor;
@@ -0,0 +1,20 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { FileUploadState } from '../types.js';
3
+ export interface FileUploadGeneratorProps {
4
+ files?: Array<{
5
+ name: string;
6
+ size: number;
7
+ }>;
8
+ accept?: string;
9
+ maxSizeBytes?: number;
10
+ multiple?: boolean;
11
+ state?: FileUploadState;
12
+ }
13
+ /**
14
+ * Generates a complete FileUpload DOM descriptor tree.
15
+ *
16
+ * Produces a drop zone with `role="button"`, a visually hidden file input,
17
+ * and a file list displaying name and size of each selected file.
18
+ * Compatible with Runtime_JS MutationObserver-based initialization.
19
+ */
20
+ export declare function generateFileUploadDOM(props: FileUploadGeneratorProps): NodeDescriptor;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generates a unique ID by combining the given prefix with an incrementing counter.
3
+ * Produces IDs like `ux4g-dropdown-1`, `ux4g-tab-panel-2`, etc.
4
+ */
5
+ export declare function generateId(prefix: string): string;
6
+ /**
7
+ * Resets the ID counter to zero. Useful for testing to ensure deterministic output.
8
+ */
9
+ export declare function resetIdCounter(): void;
@@ -0,0 +1,27 @@
1
+ export { NodeDescriptor, DOMGeneratorValidationError } from './types.js';
2
+ export { generateId, resetIdCounter } from './id-generator.js';
3
+ export { validateRequired, validateType, validateEnum, validateRange, validateArray, } from './validate.js';
4
+ export { generateModalDOM } from './modal.js';
5
+ export type { ModalGeneratorProps } from './modal.js';
6
+ export { generateCarouselDOM, CarouselGeneratorProps } from './carousel.js';
7
+ export { generateDropdownDOM, DropdownGeneratorProps } from './dropdown.js';
8
+ export { generateTabsDOM, TabsGeneratorProps } from './tabs.js';
9
+ export { generateAccordionDOM, AccordionGeneratorProps } from './accordion.js';
10
+ export { generateTimePickerDOM, TimePickerGeneratorProps } from './time-picker.js';
11
+ export { generateSearchDOM, SearchGeneratorProps } from './search.js';
12
+ export { generateDrawerDOM, DrawerGeneratorProps } from './drawer.js';
13
+ export { generateComboboxDOM, ComboboxGeneratorProps } from './combobox.js';
14
+ export { generateDatePickerDOM, DatePickerGeneratorProps } from './date-picker.js';
15
+ export { generateStepperDOM, StepperGeneratorProps } from './stepper.js';
16
+ export { generateFileUploadDOM } from './file-upload.js';
17
+ export type { FileUploadGeneratorProps } from './file-upload.js';
18
+ export { generateProgressDOM, ProgressGeneratorProps } from './progress.js';
19
+ export { generateTableDOM, TableGeneratorProps } from './table.js';
20
+ export { generateOtpDOM, OtpGeneratorProps } from './otp.js';
21
+ export { generateAvatarDOM } from './avatar.js';
22
+ export type { AvatarNativeGeneratorProps } from './avatar.js';
23
+ export { generateTooltipDOM } from './tooltip.js';
24
+ export type { TooltipGeneratorProps } from './tooltip.js';
25
+ export { generateChipDOM } from './chip.js';
26
+ export type { ChipNativeGeneratorProps } from './chip.js';
27
+ export { generatePopoverDOM, PopoverGeneratorProps } from './popover.js';
@@ -0,0 +1,19 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { ModalSize, ModalOpacity } from '../types.js';
3
+ export interface ModalGeneratorProps {
4
+ open?: boolean;
5
+ size?: ModalSize;
6
+ title?: string;
7
+ closable?: boolean;
8
+ backdropOpacity?: ModalOpacity;
9
+ backdropBlur?: boolean;
10
+ }
11
+ /**
12
+ * Generates a complete Modal DOM descriptor tree.
13
+ *
14
+ * Produces a backdrop element and a modal dialog box with `role="dialog"`,
15
+ * `aria-modal="true"`, an optional close button with `data-ux4g-modal-close`,
16
+ * and an optional title heading. Compatible with Runtime_JS
17
+ * MutationObserver-based initialization.
18
+ */
19
+ export declare function generateModalDOM(props: ModalGeneratorProps): NodeDescriptor;
@@ -0,0 +1,16 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { OtpInputState } from '../types.js';
3
+ export interface OtpGeneratorProps {
4
+ length: number;
5
+ values?: string[];
6
+ state?: OtpInputState;
7
+ disabled?: boolean;
8
+ }
9
+ /**
10
+ * Generates a complete OTP Input DOM descriptor tree.
11
+ *
12
+ * Produces individual `<input>` cells each accepting a single character,
13
+ * with maxLength=1. The root container gets CSS classes from `buildOtpInputClasses(state)`.
14
+ * When disabled, each cell receives `aria-disabled="true"` and `disabled=true`.
15
+ */
16
+ export declare function generateOtpDOM(props: OtpGeneratorProps): NodeDescriptor;
@@ -0,0 +1,17 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { PopoverPlacement } from '../types.js';
3
+ export interface PopoverGeneratorProps {
4
+ placement?: PopoverPlacement;
5
+ show?: boolean;
6
+ triggerId?: string;
7
+ }
8
+ /**
9
+ * Generates a complete Popover DOM descriptor tree.
10
+ *
11
+ * Produces a trigger wrapper element with `data-ux4g-popover` and
12
+ * `aria-describedby` referencing the popover content container.
13
+ * The popover container uses CSS classes from `buildPopoverClasses()`
14
+ * for placement and visibility. Compatible with Runtime_JS
15
+ * MutationObserver-based initialization.
16
+ */
17
+ export declare function generatePopoverDOM(props: PopoverGeneratorProps): NodeDescriptor;
@@ -0,0 +1,16 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { ProgressIndicatorType, ProgressIndicatorSize } from '../types.js';
3
+ export interface ProgressGeneratorProps {
4
+ value: number;
5
+ type?: ProgressIndicatorType;
6
+ size?: ProgressIndicatorSize;
7
+ label?: string;
8
+ }
9
+ /**
10
+ * Generates a complete Progress Indicator DOM descriptor tree.
11
+ *
12
+ * Produces a progress element with `role="progressbar"`,
13
+ * `aria-valuenow`, `aria-valuemin`, and `aria-valuemax`.
14
+ * Supports both 'bar' and 'circle' visualization types.
15
+ */
16
+ export declare function generateProgressDOM(props: ProgressGeneratorProps): NodeDescriptor;
@@ -0,0 +1,20 @@
1
+ import { NodeDescriptor } from './types.js';
2
+ import { SearchSize } from '../types.js';
3
+ export interface SearchGeneratorProps {
4
+ value?: string;
5
+ placeholder?: string;
6
+ suggestions?: Array<{
7
+ label: string;
8
+ value: string;
9
+ }>;
10
+ showSuggestions?: boolean;
11
+ size?: SearchSize;
12
+ }
13
+ /**
14
+ * Generates a complete Search DOM descriptor tree.
15
+ *
16
+ * Produces a search input with `role="searchbox"`, a clear button visible when
17
+ * there is a value, and a suggestions listbox with `role="listbox"`.
18
+ * Compatible with Runtime_JS MutationObserver-based initialization.
19
+ */
20
+ export declare function generateSearchDOM(props: SearchGeneratorProps): NodeDescriptor;