juxscript 1.1.85 → 1.1.87

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "totalComponents": 63,
3
- "generatedAt": "2026-02-12T14:48:56.457Z",
3
+ "generatedAt": "2026-02-12T18:17:52.009Z",
4
4
  "components": [
5
5
  {
6
6
  "file": "alert.js",
package/index.d.ts CHANGED
@@ -46,6 +46,9 @@ import { registry } from './lib/components/registry.js';
46
46
  import { stateHistory } from './lib/components/history/StateHistory.js';
47
47
  import { watcher } from './lib/components/watcher.js';
48
48
  export { state, registry, stateHistory };
49
+ import { vstack } from './lib/components/stack/VStack.js';
50
+ import { hstack } from './lib/components/stack/HStack.js';
51
+ import { zstack } from './lib/components/stack/ZStack.js';
49
52
  export declare const jux: {
50
53
  alert: typeof alert;
51
54
  app: typeof app;
@@ -89,6 +92,9 @@ export declare const jux: {
89
92
  themeToggle: typeof themeToggle;
90
93
  tooltip: typeof tooltip;
91
94
  write: typeof write;
95
+ vstack: typeof vstack;
96
+ hstack: typeof hstack;
97
+ zstack: typeof zstack;
92
98
  fetch: typeof import("./lib/utils/fetch.js").juxFetch & {
93
99
  all: typeof import("./lib/utils/fetch.js").fetchAll;
94
100
  get: <T = any>(url: string, options?: Omit<import("./lib/utils/fetch.js").FetchOptions, "method">) => {
@@ -201,4 +207,5 @@ export declare const jux: {
201
207
  getOrCreateContainer: typeof getOrCreateContainer;
202
208
  watcher: typeof watcher;
203
209
  };
210
+ export { vstack, hstack, zstack };
204
211
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAA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ACxD,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAG1D,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDf,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
package/index.js CHANGED
@@ -48,6 +48,10 @@ import { registry } from './lib/components/registry.js'; // ✅ Import registry
48
48
  import { stateHistory } from './lib/components/history/StateHistory.js'; // ✅ Import history
49
49
  import { watcher } from './lib/components/watcher.js';
50
50
  export { state, registry, stateHistory }; // ✅ Export history
51
+ // ✅ Import Stack components
52
+ import { vstack } from './lib/components/stack/VStack.js';
53
+ import { hstack } from './lib/components/stack/HStack.js';
54
+ import { zstack } from './lib/components/stack/ZStack.js';
51
55
  // Utilities
52
56
  export const jux = {
53
57
  alert,
@@ -92,6 +96,10 @@ export const jux = {
92
96
  themeToggle,
93
97
  tooltip,
94
98
  write,
99
+ // ✅ Stack components
100
+ vstack,
101
+ hstack,
102
+ zstack,
95
103
  // Utilities
96
104
  fetch: fetchAPI,
97
105
  renderIcon,
@@ -99,3 +107,5 @@ export const jux = {
99
107
  getOrCreateContainer,
100
108
  watcher
101
109
  };
110
+ // ✅ Export Stack components directly
111
+ export { vstack, hstack, zstack };
@@ -0,0 +1,112 @@
1
+ import { BaseComponent, BaseState } from '../base/BaseComponent.js';
2
+ export interface StackOptions {
3
+ spacing?: 'none' | 'tight' | 'default' | 'loose';
4
+ align?: 'start' | 'center' | 'end' | 'stretch';
5
+ justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
6
+ divider?: boolean;
7
+ responsive?: boolean;
8
+ class?: string;
9
+ style?: string;
10
+ }
11
+ export interface ChildStyleFunction {
12
+ (index: number): string;
13
+ }
14
+ interface StackState extends BaseState {
15
+ spacing: string;
16
+ align?: string;
17
+ justify?: string;
18
+ divider: boolean;
19
+ responsive: boolean;
20
+ children: Array<any>;
21
+ childStyles?: ChildStyleFunction | string[];
22
+ }
23
+ /**
24
+ * BaseStack - Foundation for all stack layout components
25
+ * Provides common styling, child management, and progressive effects
26
+ */
27
+ export declare abstract class BaseStack extends BaseComponent<StackState> {
28
+ protected abstract baseClassName: string;
29
+ private _inlineStyles;
30
+ constructor(id: string, children: Record<string, any> | any[], options?: StackOptions);
31
+ protected getTriggerEvents(): readonly string[];
32
+ protected getCallbackEvents(): readonly string[];
33
+ spacing(value: 'none' | 'tight' | 'default' | 'loose'): this;
34
+ align(value: 'start' | 'center' | 'end' | 'stretch'): this;
35
+ justify(value: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'): this;
36
+ divider(value?: boolean): this;
37
+ responsive(value?: boolean): this;
38
+ /**
39
+ * Internal helper to add individual CSS properties
40
+ */
41
+ private _addStyle;
42
+ /**
43
+ * Build and apply the complete style attribute
44
+ */
45
+ private _updateStyleAttribute;
46
+ padding(value: string): this;
47
+ margin(value: string): this;
48
+ border(value: string): this;
49
+ borderRadius(value: string): this;
50
+ width(value: string): this;
51
+ height(value: string): this;
52
+ minWidth(value: string): this;
53
+ maxWidth(value: string): this;
54
+ minHeight(value: string): this;
55
+ maxHeight(value: string): this;
56
+ background(value: string): this;
57
+ backgroundColor(value: string): this;
58
+ boxShadow(value: string): this;
59
+ opacity(value: string | number): this;
60
+ position(value: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'): this;
61
+ top(value: string): this;
62
+ right(value: string): this;
63
+ bottom(value: string): this;
64
+ left(value: string): this;
65
+ zIndex(value: string | number): this;
66
+ overflow(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this;
67
+ overflowX(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this;
68
+ overflowY(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this;
69
+ display(value: string): this;
70
+ cursor(value: string): this;
71
+ transform(value: string): this;
72
+ transformOrigin(value: string): this;
73
+ transition(value: string): this;
74
+ animation(value: string): this;
75
+ /**
76
+ * Apply custom styles to each child progressively
77
+ */
78
+ childStyle(stylesOrFunction: string[] | ChildStyleFunction): this;
79
+ /**
80
+ * Cascade effect - offset children progressively
81
+ */
82
+ cascade(baseOffset?: number, axis?: 'x' | 'y' | 'both' | 'horizontal' | 'vertical' | 'xy'): this;
83
+ /**
84
+ * Fan effect - rotate children progressively
85
+ */
86
+ fan(angle?: number, origin?: string): this;
87
+ /**
88
+ * Scale progression - shrink/grow children
89
+ */
90
+ scaleProgressive(startScale?: number, step?: number, origin?: string): this;
91
+ /**
92
+ * Fade effect - progressive opacity
93
+ */
94
+ fade(startOpacity?: number, step?: number): this;
95
+ /**
96
+ * Blur effect - progressive blur
97
+ */
98
+ blur(startBlur?: number, step?: number): this;
99
+ /**
100
+ * Stagger animation delays
101
+ */
102
+ stagger(baseDelay?: number): this;
103
+ protected buildClasses(): string;
104
+ protected renderChild(child: any, index: number): string;
105
+ private wrapChildWithStyle;
106
+ private injectChildStyle;
107
+ private getChildStyle;
108
+ render(targetId?: string | HTMLElement | BaseComponent<any>): this;
109
+ update(prop: string, value: any): void;
110
+ }
111
+ export {};
112
+ //# sourceMappingURL=BaseStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseStack.d.ts","sourceRoot":"","sources":["BaseStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE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MAAM,GAAE,MAAiB,GAAG,IAAI;IAQ9F;;OAEG;IACH,IAAI,CAAC,YAAY,GAAE,MAAU,EAAE,IAAI,GAAE,MAAa,GAAG,IAAI;IAQzD;;OAEG;IACH,IAAI,CAAC,SAAS,GAAE,MAAU,EAAE,IAAI,GAAE,MAAU,GAAG,IAAI;IAQnD;;OAEG;IACH,OAAO,CAAC,SAAS,GAAE,MAAY,GAAG,IAAI;IAYtC,SAAS,CAAC,YAAY,IAAI,MAAM;IAsChC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAyCxD,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,aAAa;IAoBrB,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IA4BlE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAGzC"}
@@ -0,0 +1,373 @@
1
+ import { BaseComponent } from '../base/BaseComponent.js';
2
+ // Event definitions
3
+ const TRIGGER_EVENTS = [];
4
+ const CALLBACK_EVENTS = [];
5
+ /**
6
+ * BaseStack - Foundation for all stack layout components
7
+ * Provides common styling, child management, and progressive effects
8
+ */
9
+ export class BaseStack extends BaseComponent {
10
+ constructor(id, children, options = {}) {
11
+ // Convert children object to array, preserving order
12
+ const childArray = Array.isArray(children)
13
+ ? children
14
+ : Object.values(children);
15
+ super(id, {
16
+ visible: true,
17
+ disabled: false,
18
+ loading: false,
19
+ class: options.class ?? '',
20
+ style: options.style ?? '',
21
+ attributes: {},
22
+ spacing: options.spacing ?? 'default',
23
+ align: options.align,
24
+ justify: options.justify,
25
+ divider: options.divider ?? false,
26
+ responsive: options.responsive ?? false,
27
+ children: childArray,
28
+ childStyles: undefined
29
+ });
30
+ this._inlineStyles = new Map(); // ✅ Internal style storage
31
+ }
32
+ getTriggerEvents() {
33
+ return TRIGGER_EVENTS;
34
+ }
35
+ getCallbackEvents() {
36
+ return CALLBACK_EVENTS;
37
+ }
38
+ /* ═════════════════════════════════════════════════════════════════
39
+ * FLUENT LAYOUT API
40
+ * ═════════════════════════════════════════════════════════════════ */
41
+ spacing(value) {
42
+ this.state.spacing = value;
43
+ return this;
44
+ }
45
+ align(value) {
46
+ this.state.align = value;
47
+ return this;
48
+ }
49
+ justify(value) {
50
+ this.state.justify = value;
51
+ return this;
52
+ }
53
+ divider(value = true) {
54
+ this.state.divider = value;
55
+ return this;
56
+ }
57
+ responsive(value = true) {
58
+ this.state.responsive = value;
59
+ return this;
60
+ }
61
+ /* ═════════════════════════════════════════════════════════════════
62
+ * FLUENT STYLE API - Comprehensive CSS properties
63
+ * ═════════════════════════════════════════════════════════════════ */
64
+ /**
65
+ * Internal helper to add individual CSS properties
66
+ */
67
+ _addStyle(property, value) {
68
+ this._inlineStyles.set(property, value);
69
+ this._updateStyleAttribute();
70
+ return this;
71
+ }
72
+ /**
73
+ * Build and apply the complete style attribute
74
+ */
75
+ _updateStyleAttribute() {
76
+ const styleString = Array.from(this._inlineStyles.entries())
77
+ .map(([prop, val]) => `${prop}: ${val}`)
78
+ .join('; ');
79
+ this.state.style = styleString;
80
+ }
81
+ // Box Model
82
+ padding(value) {
83
+ return this._addStyle('padding', value);
84
+ }
85
+ margin(value) {
86
+ return this._addStyle('margin', value);
87
+ }
88
+ border(value) {
89
+ return this._addStyle('border', value);
90
+ }
91
+ borderRadius(value) {
92
+ return this._addStyle('border-radius', value);
93
+ }
94
+ // Sizing
95
+ width(value) {
96
+ return this._addStyle('width', value);
97
+ }
98
+ height(value) {
99
+ return this._addStyle('height', value);
100
+ }
101
+ minWidth(value) {
102
+ return this._addStyle('min-width', value);
103
+ }
104
+ maxWidth(value) {
105
+ return this._addStyle('max-width', value);
106
+ }
107
+ minHeight(value) {
108
+ return this._addStyle('min-height', value);
109
+ }
110
+ maxHeight(value) {
111
+ return this._addStyle('max-height', value);
112
+ }
113
+ // Visual
114
+ background(value) {
115
+ return this._addStyle('background', value);
116
+ }
117
+ backgroundColor(value) {
118
+ return this._addStyle('background-color', value);
119
+ }
120
+ boxShadow(value) {
121
+ return this._addStyle('box-shadow', value);
122
+ }
123
+ opacity(value) {
124
+ return this._addStyle('opacity', String(value));
125
+ }
126
+ // Positioning
127
+ position(value) {
128
+ return this._addStyle('position', value);
129
+ }
130
+ top(value) {
131
+ return this._addStyle('top', value);
132
+ }
133
+ right(value) {
134
+ return this._addStyle('right', value);
135
+ }
136
+ bottom(value) {
137
+ return this._addStyle('bottom', value);
138
+ }
139
+ left(value) {
140
+ return this._addStyle('left', value);
141
+ }
142
+ zIndex(value) {
143
+ return this._addStyle('z-index', String(value));
144
+ }
145
+ // Overflow
146
+ overflow(value) {
147
+ return this._addStyle('overflow', value);
148
+ }
149
+ overflowX(value) {
150
+ return this._addStyle('overflow-x', value);
151
+ }
152
+ overflowY(value) {
153
+ return this._addStyle('overflow-y', value);
154
+ }
155
+ // Display
156
+ display(value) {
157
+ return this._addStyle('display', value);
158
+ }
159
+ // Cursor
160
+ cursor(value) {
161
+ return this._addStyle('cursor', value);
162
+ }
163
+ // Transform
164
+ transform(value) {
165
+ return this._addStyle('transform', value);
166
+ }
167
+ transformOrigin(value) {
168
+ return this._addStyle('transform-origin', value);
169
+ }
170
+ // Transition & Animation
171
+ transition(value) {
172
+ return this._addStyle('transition', value);
173
+ }
174
+ animation(value) {
175
+ return this._addStyle('animation', value);
176
+ }
177
+ /* ═════════════════════════════════════════════════════════════════
178
+ * PROGRESSIVE CHILD STYLING
179
+ * ═════════════════════════════════════════════════════════════════ */
180
+ /**
181
+ * Apply custom styles to each child progressively
182
+ */
183
+ childStyle(stylesOrFunction) {
184
+ this.state.childStyles = stylesOrFunction;
185
+ return this;
186
+ }
187
+ /**
188
+ * Cascade effect - offset children progressively
189
+ */
190
+ cascade(baseOffset = 20, axis = 'both') {
191
+ this.state.childStyles = (index) => {
192
+ const offset = baseOffset * index;
193
+ if (axis === 'horizontal' || axis === 'x') {
194
+ return `margin-left: ${offset}px;`;
195
+ }
196
+ else if (axis === 'vertical' || axis === 'y') {
197
+ return `margin-top: ${offset}px;`;
198
+ }
199
+ else {
200
+ return `margin-left: ${offset}px; margin-top: ${offset}px;`;
201
+ }
202
+ };
203
+ return this;
204
+ }
205
+ /**
206
+ * Fan effect - rotate children progressively
207
+ */
208
+ fan(angle = 5, origin = 'bottom center') {
209
+ this.state.childStyles = (index) => {
210
+ const rotation = angle * index;
211
+ return `transform: rotate(${rotation}deg); transform-origin: ${origin};`;
212
+ };
213
+ return this;
214
+ }
215
+ /**
216
+ * Scale progression - shrink/grow children
217
+ */
218
+ scaleProgressive(startScale = 1, step = 0.05, origin = 'center') {
219
+ this.state.childStyles = (index) => {
220
+ const scale = startScale - (step * index);
221
+ return `transform: scale(${scale}); transform-origin: ${origin};`;
222
+ };
223
+ return this;
224
+ }
225
+ /**
226
+ * Fade effect - progressive opacity
227
+ */
228
+ fade(startOpacity = 1, step = 0.15) {
229
+ this.state.childStyles = (index) => {
230
+ const opacity = Math.max(0.1, startOpacity - (step * index));
231
+ return `opacity: ${opacity};`;
232
+ };
233
+ return this;
234
+ }
235
+ /**
236
+ * Blur effect - progressive blur
237
+ */
238
+ blur(startBlur = 0, step = 2) {
239
+ this.state.childStyles = (index) => {
240
+ const blur = startBlur + (step * index);
241
+ return `filter: blur(${blur}px);`;
242
+ };
243
+ return this;
244
+ }
245
+ /**
246
+ * Stagger animation delays
247
+ */
248
+ stagger(baseDelay = 100) {
249
+ this.state.childStyles = (index) => {
250
+ const delay = baseDelay * index;
251
+ return `animation-delay: ${delay}ms;`;
252
+ };
253
+ return this;
254
+ }
255
+ /* ═════════════════════════════════════════════════════════════════
256
+ * RENDER HELPERS
257
+ * ═════════════════════════════════════════════════════════════════ */
258
+ buildClasses() {
259
+ const { spacing, align, justify, divider, responsive } = this.state;
260
+ const classes = [this.baseClassName];
261
+ // Spacing modifier
262
+ if (spacing !== 'default') {
263
+ classes.push(`${this.baseClassName}-${spacing}`);
264
+ }
265
+ // Alignment
266
+ if (align) {
267
+ classes.push(`jux-stack-${align}`);
268
+ }
269
+ // Justification
270
+ if (justify) {
271
+ classes.push(`jux-stack-justify-${justify}`);
272
+ }
273
+ // Divider
274
+ if (divider) {
275
+ classes.push(`${this.baseClassName}-divider`);
276
+ }
277
+ // Responsive
278
+ if (responsive) {
279
+ classes.push(`${this.baseClassName}-responsive`);
280
+ }
281
+ // Custom classes
282
+ if (this.state.class) {
283
+ classes.push(this.state.class);
284
+ }
285
+ return classes.join(' ');
286
+ }
287
+ renderChild(child, index) {
288
+ // Already a string
289
+ if (typeof child === 'string') {
290
+ return this.wrapChildWithStyle(child, index);
291
+ }
292
+ // JUX component with render method
293
+ if (child && typeof child.render === 'function') {
294
+ // Create temporary container
295
+ const temp = document.createElement('div');
296
+ child.render(temp);
297
+ if (child.container) {
298
+ let html = child.container.outerHTML;
299
+ child.container = null; // Reset for reuse
300
+ return this.injectChildStyle(html, index);
301
+ }
302
+ }
303
+ // DOM element
304
+ if (child && child.outerHTML) {
305
+ return this.injectChildStyle(child.outerHTML, index);
306
+ }
307
+ // Object with render method that returns string/element
308
+ if (child && typeof child.render === 'function') {
309
+ const rendered = child.render();
310
+ if (typeof rendered === 'string') {
311
+ return this.wrapChildWithStyle(rendered, index);
312
+ }
313
+ if (rendered && rendered.outerHTML) {
314
+ return this.injectChildStyle(rendered.outerHTML, index);
315
+ }
316
+ }
317
+ // Fallback to string
318
+ return this.wrapChildWithStyle(String(child), index);
319
+ }
320
+ wrapChildWithStyle(html, index) {
321
+ const style = this.getChildStyle(index);
322
+ if (style) {
323
+ return `<div style="${style}">${html}</div>`;
324
+ }
325
+ return html;
326
+ }
327
+ injectChildStyle(html, index) {
328
+ const style = this.getChildStyle(index);
329
+ if (style) {
330
+ return html.replace(/^<(\w+)/, `<$1 style="${style}"`);
331
+ }
332
+ return html;
333
+ }
334
+ getChildStyle(index) {
335
+ const { childStyles } = this.state;
336
+ if (!childStyles)
337
+ return '';
338
+ if (typeof childStyles === 'function') {
339
+ return childStyles(index);
340
+ }
341
+ if (Array.isArray(childStyles)) {
342
+ return childStyles[index] || '';
343
+ }
344
+ return '';
345
+ }
346
+ /* ═════════════════════════════════════════════════════════════════
347
+ * RENDER
348
+ * ═════════════════════════════════════════════════════════════════ */
349
+ render(targetId) {
350
+ const container = this._setupContainer(targetId);
351
+ const wrapper = document.createElement('div');
352
+ wrapper.className = this.buildClasses();
353
+ wrapper.id = this._id;
354
+ if (this.state.style) {
355
+ wrapper.setAttribute('style', this.state.style);
356
+ }
357
+ // Render all children
358
+ this.state.children.forEach((child, index) => {
359
+ const childHtml = this.renderChild(child, index);
360
+ const tempDiv = document.createElement('div');
361
+ tempDiv.innerHTML = childHtml;
362
+ if (tempDiv.firstChild) {
363
+ wrapper.appendChild(tempDiv.firstChild);
364
+ }
365
+ });
366
+ this._wireStandardEvents(wrapper);
367
+ container.appendChild(wrapper);
368
+ return this;
369
+ }
370
+ update(prop, value) {
371
+ // Stack components are typically static
372
+ }
373
+ }
@@ -0,0 +1,483 @@
1
+ import { BaseComponent, BaseState } from '../base/BaseComponent.js';
2
+
3
+ // Event definitions
4
+ const TRIGGER_EVENTS = [] as const;
5
+ const CALLBACK_EVENTS = [] as const;
6
+
7
+ export interface StackOptions {
8
+ spacing?: 'none' | 'tight' | 'default' | 'loose';
9
+ align?: 'start' | 'center' | 'end' | 'stretch';
10
+ justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
11
+ divider?: boolean;
12
+ responsive?: boolean;
13
+ class?: string;
14
+ style?: string;
15
+ }
16
+
17
+ export interface ChildStyleFunction {
18
+ (index: number): string;
19
+ }
20
+
21
+ interface StackState extends BaseState {
22
+ spacing: string;
23
+ align?: string;
24
+ justify?: string;
25
+ divider: boolean;
26
+ responsive: boolean;
27
+ children: Array<any>;
28
+ childStyles?: ChildStyleFunction | string[];
29
+ }
30
+
31
+ /**
32
+ * BaseStack - Foundation for all stack layout components
33
+ * Provides common styling, child management, and progressive effects
34
+ */
35
+ export abstract class BaseStack extends BaseComponent<StackState> {
36
+ protected abstract baseClassName: string;
37
+ private _inlineStyles: Map<string, string> = new Map(); // ✅ Internal style storage
38
+
39
+ constructor(id: string, children: Record<string, any> | any[], options: StackOptions = {}) {
40
+ // Convert children object to array, preserving order
41
+ const childArray = Array.isArray(children)
42
+ ? children
43
+ : Object.values(children);
44
+
45
+ super(id, {
46
+ visible: true,
47
+ disabled: false,
48
+ loading: false,
49
+ class: options.class ?? '',
50
+ style: options.style ?? '',
51
+ attributes: {},
52
+ spacing: options.spacing ?? 'default',
53
+ align: options.align,
54
+ justify: options.justify,
55
+ divider: options.divider ?? false,
56
+ responsive: options.responsive ?? false,
57
+ children: childArray,
58
+ childStyles: undefined
59
+ });
60
+ }
61
+
62
+ protected getTriggerEvents(): readonly string[] {
63
+ return TRIGGER_EVENTS;
64
+ }
65
+
66
+ protected getCallbackEvents(): readonly string[] {
67
+ return CALLBACK_EVENTS;
68
+ }
69
+
70
+ /* ═════════════════════════════════════════════════════════════════
71
+ * FLUENT LAYOUT API
72
+ * ═════════════════════════════════════════════════════════════════ */
73
+
74
+ spacing(value: 'none' | 'tight' | 'default' | 'loose'): this {
75
+ this.state.spacing = value;
76
+ return this;
77
+ }
78
+
79
+ align(value: 'start' | 'center' | 'end' | 'stretch'): this {
80
+ this.state.align = value;
81
+ return this;
82
+ }
83
+
84
+ justify(value: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'): this {
85
+ this.state.justify = value;
86
+ return this;
87
+ }
88
+
89
+ divider(value: boolean = true): this {
90
+ this.state.divider = value;
91
+ return this;
92
+ }
93
+
94
+ responsive(value: boolean = true): this {
95
+ this.state.responsive = value;
96
+ return this;
97
+ }
98
+
99
+ /* ═════════════════════════════════════════════════════════════════
100
+ * FLUENT STYLE API - Comprehensive CSS properties
101
+ * ═════════════════════════════════════════════════════════════════ */
102
+
103
+ /**
104
+ * Internal helper to add individual CSS properties
105
+ */
106
+ private _addStyle(property: string, value: string): this {
107
+ this._inlineStyles.set(property, value);
108
+ this._updateStyleAttribute();
109
+ return this;
110
+ }
111
+
112
+ /**
113
+ * Build and apply the complete style attribute
114
+ */
115
+ private _updateStyleAttribute(): void {
116
+ const styleString = Array.from(this._inlineStyles.entries())
117
+ .map(([prop, val]) => `${prop}: ${val}`)
118
+ .join('; ');
119
+
120
+ this.state.style = styleString;
121
+ }
122
+
123
+ // Box Model
124
+ padding(value: string): this {
125
+ return this._addStyle('padding', value);
126
+ }
127
+
128
+ margin(value: string): this {
129
+ return this._addStyle('margin', value);
130
+ }
131
+
132
+ border(value: string): this {
133
+ return this._addStyle('border', value);
134
+ }
135
+
136
+ borderRadius(value: string): this {
137
+ return this._addStyle('border-radius', value);
138
+ }
139
+
140
+ // Sizing
141
+ width(value: string): this {
142
+ return this._addStyle('width', value);
143
+ }
144
+
145
+ height(value: string): this {
146
+ return this._addStyle('height', value);
147
+ }
148
+
149
+ minWidth(value: string): this {
150
+ return this._addStyle('min-width', value);
151
+ }
152
+
153
+ maxWidth(value: string): this {
154
+ return this._addStyle('max-width', value);
155
+ }
156
+
157
+ minHeight(value: string): this {
158
+ return this._addStyle('min-height', value);
159
+ }
160
+
161
+ maxHeight(value: string): this {
162
+ return this._addStyle('max-height', value);
163
+ }
164
+
165
+ // Visual
166
+ background(value: string): this {
167
+ return this._addStyle('background', value);
168
+ }
169
+
170
+ backgroundColor(value: string): this {
171
+ return this._addStyle('background-color', value);
172
+ }
173
+
174
+ boxShadow(value: string): this {
175
+ return this._addStyle('box-shadow', value);
176
+ }
177
+
178
+ opacity(value: string | number): this {
179
+ return this._addStyle('opacity', String(value));
180
+ }
181
+
182
+ // Positioning
183
+ position(value: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'): this {
184
+ return this._addStyle('position', value);
185
+ }
186
+
187
+ top(value: string): this {
188
+ return this._addStyle('top', value);
189
+ }
190
+
191
+ right(value: string): this {
192
+ return this._addStyle('right', value);
193
+ }
194
+
195
+ bottom(value: string): this {
196
+ return this._addStyle('bottom', value);
197
+ }
198
+
199
+ left(value: string): this {
200
+ return this._addStyle('left', value);
201
+ }
202
+
203
+ zIndex(value: string | number): this {
204
+ return this._addStyle('z-index', String(value));
205
+ }
206
+
207
+ // Overflow
208
+ overflow(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this {
209
+ return this._addStyle('overflow', value);
210
+ }
211
+
212
+ overflowX(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this {
213
+ return this._addStyle('overflow-x', value);
214
+ }
215
+
216
+ overflowY(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this {
217
+ return this._addStyle('overflow-y', value);
218
+ }
219
+
220
+ // Display
221
+ display(value: string): this {
222
+ return this._addStyle('display', value);
223
+ }
224
+
225
+ // Cursor
226
+ cursor(value: string): this {
227
+ return this._addStyle('cursor', value);
228
+ }
229
+
230
+ // Transform
231
+ transform(value: string): this {
232
+ return this._addStyle('transform', value);
233
+ }
234
+
235
+ transformOrigin(value: string): this {
236
+ return this._addStyle('transform-origin', value);
237
+ }
238
+
239
+ // Transition & Animation
240
+ transition(value: string): this {
241
+ return this._addStyle('transition', value);
242
+ }
243
+
244
+ animation(value: string): this {
245
+ return this._addStyle('animation', value);
246
+ }
247
+
248
+ /* ═════════════════════════════════════════════════════════════════
249
+ * PROGRESSIVE CHILD STYLING
250
+ * ═════════════════════════════════════════════════════════════════ */
251
+
252
+ /**
253
+ * Apply custom styles to each child progressively
254
+ */
255
+ childStyle(stylesOrFunction: string[] | ChildStyleFunction): this {
256
+ this.state.childStyles = stylesOrFunction;
257
+ return this;
258
+ }
259
+
260
+ /**
261
+ * Cascade effect - offset children progressively
262
+ */
263
+ cascade(baseOffset: number = 20, axis: 'x' | 'y' | 'both' | 'horizontal' | 'vertical' | 'xy' = 'both'): this {
264
+ this.state.childStyles = (index: number) => {
265
+ const offset = baseOffset * index;
266
+
267
+ if (axis === 'horizontal' || axis === 'x') {
268
+ return `margin-left: ${offset}px;`;
269
+ } else if (axis === 'vertical' || axis === 'y') {
270
+ return `margin-top: ${offset}px;`;
271
+ } else {
272
+ return `margin-left: ${offset}px; margin-top: ${offset}px;`;
273
+ }
274
+ };
275
+ return this;
276
+ }
277
+
278
+ /**
279
+ * Fan effect - rotate children progressively
280
+ */
281
+ fan(angle: number = 5, origin: string = 'bottom center'): this {
282
+ this.state.childStyles = (index: number) => {
283
+ const rotation = angle * index;
284
+ return `transform: rotate(${rotation}deg); transform-origin: ${origin};`;
285
+ };
286
+ return this;
287
+ }
288
+
289
+ /**
290
+ * Scale progression - shrink/grow children
291
+ */
292
+ scaleProgressive(startScale: number = 1, step: number = 0.05, origin: string = 'center'): this {
293
+ this.state.childStyles = (index: number) => {
294
+ const scale = startScale - (step * index);
295
+ return `transform: scale(${scale}); transform-origin: ${origin};`;
296
+ };
297
+ return this;
298
+ }
299
+
300
+ /**
301
+ * Fade effect - progressive opacity
302
+ */
303
+ fade(startOpacity: number = 1, step: number = 0.15): this {
304
+ this.state.childStyles = (index: number) => {
305
+ const opacity = Math.max(0.1, startOpacity - (step * index));
306
+ return `opacity: ${opacity};`;
307
+ };
308
+ return this;
309
+ }
310
+
311
+ /**
312
+ * Blur effect - progressive blur
313
+ */
314
+ blur(startBlur: number = 0, step: number = 2): this {
315
+ this.state.childStyles = (index: number) => {
316
+ const blur = startBlur + (step * index);
317
+ return `filter: blur(${blur}px);`;
318
+ };
319
+ return this;
320
+ }
321
+
322
+ /**
323
+ * Stagger animation delays
324
+ */
325
+ stagger(baseDelay: number = 100): this {
326
+ this.state.childStyles = (index: number) => {
327
+ const delay = baseDelay * index;
328
+ return `animation-delay: ${delay}ms;`;
329
+ };
330
+ return this;
331
+ }
332
+
333
+ /* ═════════════════════════════════════════════════════════════════
334
+ * RENDER HELPERS
335
+ * ═════════════════════════════════════════════════════════════════ */
336
+
337
+ protected buildClasses(): string {
338
+ const { spacing, align, justify, divider, responsive } = this.state;
339
+
340
+ const classes = [this.baseClassName];
341
+
342
+ // Spacing modifier
343
+ if (spacing !== 'default') {
344
+ classes.push(`${this.baseClassName}-${spacing}`);
345
+ }
346
+
347
+ // Alignment
348
+ if (align) {
349
+ classes.push(`jux-stack-${align}`);
350
+ }
351
+
352
+ // Justification
353
+ if (justify) {
354
+ classes.push(`jux-stack-justify-${justify}`);
355
+ }
356
+
357
+ // Divider
358
+ if (divider) {
359
+ classes.push(`${this.baseClassName}-divider`);
360
+ }
361
+
362
+ // Responsive
363
+ if (responsive) {
364
+ classes.push(`${this.baseClassName}-responsive`);
365
+ }
366
+
367
+ // Custom classes
368
+ if (this.state.class) {
369
+ classes.push(this.state.class);
370
+ }
371
+
372
+ return classes.join(' ');
373
+ }
374
+
375
+ protected renderChild(child: any, index: number): string {
376
+ // Already a string
377
+ if (typeof child === 'string') {
378
+ return this.wrapChildWithStyle(child, index);
379
+ }
380
+
381
+ // JUX component with render method
382
+ if (child && typeof child.render === 'function') {
383
+ // Create temporary container
384
+ const temp = document.createElement('div');
385
+ child.render(temp);
386
+
387
+ if (child.container) {
388
+ let html = child.container.outerHTML;
389
+ child.container = null; // Reset for reuse
390
+ return this.injectChildStyle(html, index);
391
+ }
392
+ }
393
+
394
+ // DOM element
395
+ if (child && child.outerHTML) {
396
+ return this.injectChildStyle(child.outerHTML, index);
397
+ }
398
+
399
+ // Object with render method that returns string/element
400
+ if (child && typeof child.render === 'function') {
401
+ const rendered = child.render();
402
+
403
+ if (typeof rendered === 'string') {
404
+ return this.wrapChildWithStyle(rendered, index);
405
+ }
406
+
407
+ if (rendered && rendered.outerHTML) {
408
+ return this.injectChildStyle(rendered.outerHTML, index);
409
+ }
410
+ }
411
+
412
+ // Fallback to string
413
+ return this.wrapChildWithStyle(String(child), index);
414
+ }
415
+
416
+ private wrapChildWithStyle(html: string, index: number): string {
417
+ const style = this.getChildStyle(index);
418
+ if (style) {
419
+ return `<div style="${style}">${html}</div>`;
420
+ }
421
+ return html;
422
+ }
423
+
424
+ private injectChildStyle(html: string, index: number): string {
425
+ const style = this.getChildStyle(index);
426
+ if (style) {
427
+ return html.replace(/^<(\w+)/, `<$1 style="${style}"`);
428
+ }
429
+ return html;
430
+ }
431
+
432
+ private getChildStyle(index: number): string {
433
+ const { childStyles } = this.state;
434
+
435
+ if (!childStyles) return '';
436
+
437
+ if (typeof childStyles === 'function') {
438
+ return childStyles(index);
439
+ }
440
+
441
+ if (Array.isArray(childStyles)) {
442
+ return childStyles[index] || '';
443
+ }
444
+
445
+ return '';
446
+ }
447
+
448
+ /* ═════════════════════════════════════════════════════════════════
449
+ * RENDER
450
+ * ═════════════════════════════════════════════════════════════════ */
451
+
452
+ render(targetId?: string | HTMLElement | BaseComponent<any>): this {
453
+ const container = this._setupContainer(targetId);
454
+
455
+ const wrapper = document.createElement('div');
456
+ wrapper.className = this.buildClasses();
457
+ wrapper.id = this._id;
458
+
459
+ if (this.state.style) {
460
+ wrapper.setAttribute('style', this.state.style);
461
+ }
462
+
463
+ // Render all children
464
+ this.state.children.forEach((child, index) => {
465
+ const childHtml = this.renderChild(child, index);
466
+ const tempDiv = document.createElement('div');
467
+ tempDiv.innerHTML = childHtml;
468
+
469
+ if (tempDiv.firstChild) {
470
+ wrapper.appendChild(tempDiv.firstChild);
471
+ }
472
+ });
473
+
474
+ this._wireStandardEvents(wrapper);
475
+ container.appendChild(wrapper);
476
+
477
+ return this;
478
+ }
479
+
480
+ update(prop: string, value: any): void {
481
+ // Stack components are typically static
482
+ }
483
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseStack, StackOptions } from './BaseStack.js';
2
+ /**
3
+ * HStack - Horizontal Stack Component
4
+ * Arranges children in a horizontal row
5
+ */
6
+ export declare class HStack extends BaseStack {
7
+ protected baseClassName: string;
8
+ constructor(id: string, children: Record<string, any> | any[], options?: StackOptions);
9
+ }
10
+ export declare function hstack(id: string, children: Record<string, any> | any[], options?: StackOptions): HStack;
11
+ //# sourceMappingURL=HStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["HStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAE3B,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB;CAG5F;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAE5G"}
@@ -0,0 +1,14 @@
1
+ import { BaseStack } from './BaseStack.js';
2
+ /**
3
+ * HStack - Horizontal Stack Component
4
+ * Arranges children in a horizontal row
5
+ */
6
+ export class HStack extends BaseStack {
7
+ constructor(id, children, options = {}) {
8
+ super(id, children, options);
9
+ this.baseClassName = 'jux-hstack';
10
+ }
11
+ }
12
+ export function hstack(id, children, options = {}) {
13
+ return new HStack(id, children, options);
14
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseStack, StackOptions } from './BaseStack.js';
2
+
3
+ /**
4
+ * HStack - Horizontal Stack Component
5
+ * Arranges children in a horizontal row
6
+ */
7
+ export class HStack extends BaseStack {
8
+ protected baseClassName = 'jux-hstack';
9
+
10
+ constructor(id: string, children: Record<string, any> | any[], options: StackOptions = {}) {
11
+ super(id, children, options);
12
+ }
13
+ }
14
+
15
+ export function hstack(id: string, children: Record<string, any> | any[], options: StackOptions = {}): HStack {
16
+ return new HStack(id, children, options);
17
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseStack, StackOptions } from './BaseStack.js';
2
+ /**
3
+ * VStack - Vertical Stack Component
4
+ * Arranges children in a vertical column
5
+ */
6
+ export declare class VStack extends BaseStack {
7
+ protected baseClassName: string;
8
+ constructor(id: string, children: Record<string, any> | any[], options?: StackOptions);
9
+ }
10
+ export declare function vstack(id: string, children: Record<string, any> | any[], options?: StackOptions): VStack;
11
+ //# sourceMappingURL=VStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["VStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAE3B,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB;CAG5F;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAE5G"}
@@ -0,0 +1,14 @@
1
+ import { BaseStack } from './BaseStack.js';
2
+ /**
3
+ * VStack - Vertical Stack Component
4
+ * Arranges children in a vertical column
5
+ */
6
+ export class VStack extends BaseStack {
7
+ constructor(id, children, options = {}) {
8
+ super(id, children, options);
9
+ this.baseClassName = 'jux-vstack';
10
+ }
11
+ }
12
+ export function vstack(id, children, options = {}) {
13
+ return new VStack(id, children, options);
14
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseStack, StackOptions } from './BaseStack.js';
2
+
3
+ /**
4
+ * VStack - Vertical Stack Component
5
+ * Arranges children in a vertical column
6
+ */
7
+ export class VStack extends BaseStack {
8
+ protected baseClassName = 'jux-vstack';
9
+
10
+ constructor(id: string, children: Record<string, any> | any[], options: StackOptions = {}) {
11
+ super(id, children, options);
12
+ }
13
+ }
14
+
15
+ export function vstack(id: string, children: Record<string, any> | any[], options: StackOptions = {}): VStack {
16
+ return new VStack(id, children, options);
17
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseStack, StackOptions } from './BaseStack.js';
2
+ /**
3
+ * ZStack - Layered/Overlapping Stack Component
4
+ * Stacks children on top of each other (z-axis)
5
+ */
6
+ export declare class ZStack extends BaseStack {
7
+ protected baseClassName: string;
8
+ constructor(id: string, children: Record<string, any> | any[], options?: StackOptions);
9
+ }
10
+ export declare function zstack(id: string, children: Record<string, any> | any[], options?: StackOptions): ZStack;
11
+ //# sourceMappingURL=ZStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZStack.d.ts","sourceRoot":"","sources":["ZStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAE3B,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB;CAG5F;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAE5G"}
@@ -0,0 +1,14 @@
1
+ import { BaseStack } from './BaseStack.js';
2
+ /**
3
+ * ZStack - Layered/Overlapping Stack Component
4
+ * Stacks children on top of each other (z-axis)
5
+ */
6
+ export class ZStack extends BaseStack {
7
+ constructor(id, children, options = {}) {
8
+ super(id, children, options);
9
+ this.baseClassName = 'jux-zstack';
10
+ }
11
+ }
12
+ export function zstack(id, children, options = {}) {
13
+ return new ZStack(id, children, options);
14
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseStack, StackOptions } from './BaseStack.js';
2
+
3
+ /**
4
+ * ZStack - Layered/Overlapping Stack Component
5
+ * Stacks children on top of each other (z-axis)
6
+ */
7
+ export class ZStack extends BaseStack {
8
+ protected baseClassName = 'jux-zstack';
9
+
10
+ constructor(id: string, children: Record<string, any> | any[], options: StackOptions = {}) {
11
+ super(id, children, options);
12
+ }
13
+ }
14
+
15
+ export function zstack(id: string, children: Record<string, any> | any[], options: StackOptions = {}): ZStack {
16
+ return new ZStack(id, children, options);
17
+ }
@@ -0,0 +1,133 @@
1
+ /* ═══════════════════════════════════════════════════════════════════
2
+ * STACK LAYOUT COMPONENTS
3
+ * ═══════════════════════════════════════════════════════════════════ */
4
+
5
+ /* Vertical Stack */
6
+ .jux-vstack {
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 1rem; /* Default spacing */
10
+ }
11
+
12
+ .jux-vstack-tight {
13
+ gap: 0.5rem; /* 8px */
14
+ }
15
+
16
+ .jux-vstack-loose {
17
+ gap: 1.5rem; /* 24px */
18
+ }
19
+
20
+ .jux-vstack-none {
21
+ gap: 0;
22
+ }
23
+
24
+ /* Horizontal Stack */
25
+ .jux-hstack {
26
+ display: flex;
27
+ flex-direction: row;
28
+ align-items: center;
29
+ gap: 1rem; /* Default spacing */
30
+ }
31
+
32
+ .jux-hstack-tight {
33
+ gap: 0.5rem;
34
+ }
35
+
36
+ .jux-hstack-loose {
37
+ gap: 1.5rem;
38
+ }
39
+
40
+ .jux-hstack-none {
41
+ gap: 0;
42
+ }
43
+
44
+ /* Z-Stack (Layered/Overlapping) */
45
+ .jux-zstack {
46
+ display: grid;
47
+ grid-template-columns: 1fr;
48
+ grid-template-rows: 1fr;
49
+ position: relative;
50
+ }
51
+
52
+ .jux-zstack > * {
53
+ grid-column: 1;
54
+ grid-row: 1;
55
+ }
56
+
57
+ .jux-zstack-tight > * {
58
+ margin: 0.25rem;
59
+ }
60
+
61
+ .jux-zstack-loose > * {
62
+ margin: 0.75rem;
63
+ }
64
+
65
+ .jux-zstack-none > * {
66
+ margin: 0;
67
+ }
68
+
69
+ /* Stack Alignment Options */
70
+ .jux-stack-start {
71
+ align-items: flex-start;
72
+ }
73
+
74
+ .jux-stack-center {
75
+ align-items: center;
76
+ }
77
+
78
+ .jux-stack-end {
79
+ align-items: flex-end;
80
+ }
81
+
82
+ .jux-stack-stretch {
83
+ align-items: stretch;
84
+ }
85
+
86
+ /* Stack Justification Options */
87
+ .jux-stack-justify-start {
88
+ justify-content: flex-start;
89
+ }
90
+
91
+ .jux-stack-justify-center {
92
+ justify-content: center;
93
+ }
94
+
95
+ .jux-stack-justify-end {
96
+ justify-content: flex-end;
97
+ }
98
+
99
+ .jux-stack-justify-between {
100
+ justify-content: space-between;
101
+ }
102
+
103
+ .jux-stack-justify-around {
104
+ justify-content: space-around;
105
+ }
106
+
107
+ .jux-stack-justify-evenly {
108
+ justify-content: space-evenly;
109
+ }
110
+
111
+ /* Responsive Stacks */
112
+ @media (max-width: 768px) {
113
+ .jux-hstack-responsive {
114
+ flex-direction: column;
115
+ }
116
+ }
117
+
118
+ /* Stack with Dividers */
119
+ .jux-vstack-divider > *:not(:last-child) {
120
+ padding-bottom: 1rem;
121
+ border-bottom: 1px solid #e4e4e7;
122
+ margin-bottom: 1rem;
123
+ }
124
+
125
+ .jux-hstack-divider > *:not(:last-child) {
126
+ padding-right: 1rem;
127
+ border-right: 1px solid #e4e4e7;
128
+ margin-right: 1rem;
129
+ }
130
+
131
+ .jux-zstack-divider > * {
132
+ border: 1px solid #e4e4e7;
133
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.85",
3
+ "version": "1.1.87",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",