juxscript 1.1.69 → 1.1.71

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.
@@ -16,7 +16,7 @@ export interface ModalOptions {
16
16
  icon?: EmojiIconType | undefined;
17
17
  close?: boolean;
18
18
  backdropClose?: boolean;
19
- position?: 'bottom' | 'center' | 'top' | 'fullscreen' | 'popover';
19
+ position?: 'bottom' | 'center' | 'top' | 'fullscreen' | 'popover' | 'popover-top' | 'popover-bottom' | 'popover-left' | 'popover-right';
20
20
  size?: 'small' | 'medium' | 'large';
21
21
  actions?: Array<{ label: string; variant?: string; click?: () => void } | Array<BaseComponent<any>>>;
22
22
  style?: string;
@@ -29,7 +29,7 @@ type ModalState = {
29
29
  icon: EmojiIconType | undefined;
30
30
  close: boolean;
31
31
  backdropClose: boolean;
32
- position?: 'bottom' | 'center' | 'top' | 'fullscreen' | 'popover';
32
+ position?: 'bottom' | 'center' | 'top' | 'fullscreen' | 'popover' | 'popover-top' | 'popover-bottom' | 'popover-left' | 'popover-right';
33
33
  size: string;
34
34
  open: boolean;
35
35
  actions: Array<{ label: string; variant?: string; click?: () => void } | Array<BaseComponent<any>>>;
@@ -102,6 +102,19 @@ export class Modal extends BaseComponent<ModalState> {
102
102
  modal.className = modal.className.replace(/jux-modal-(small|medium|large)/, `jux-modal-${value}`);
103
103
  break;
104
104
 
105
+ case 'position':
106
+ // Remove existing position classes
107
+ this._overlay.className = this._overlay.className
108
+ .split(' ')
109
+ .filter(c => !c.startsWith('jux-modal-position-'))
110
+ .join(' ');
111
+
112
+ // Add new position class
113
+ if (value) {
114
+ this._overlay.classList.add(`jux-modal-position-${value}`);
115
+ }
116
+ break;
117
+
105
118
  case 'actions':
106
119
  this._rebuildActions();
107
120
  break;
@@ -255,6 +268,11 @@ export class Modal extends BaseComponent<ModalState> {
255
268
  return this;
256
269
  }
257
270
 
271
+ position(value: 'bottom' | 'center' | 'top' | 'fullscreen' | 'popover' | 'popover-top' | 'popover-bottom' | 'popover-left' | 'popover-right'): this {
272
+ this.state.position = value;
273
+ return this;
274
+ }
275
+
258
276
  actions(value: Array<{ label: string; variant?: string; click?: () => void }>): this {
259
277
  this.state.actions = value;
260
278
  return this;
@@ -357,13 +375,19 @@ export class Modal extends BaseComponent<ModalState> {
357
375
  render(targetId?: string | HTMLElement | BaseComponent<any>): this {
358
376
  const container = this._setupContainer(targetId);
359
377
 
360
- const { open, title, content, icon, size, close, backdropClose, actions, style, class: className } = this.state;
378
+ const { open, title, content, icon, size, position, close, backdropClose, actions, style, class: className } = this.state;
361
379
  const hasOpenSync = this._syncBindings.some(b => b.property === 'open');
362
380
 
363
381
  const overlay = document.createElement('div');
364
382
  overlay.className = 'jux-modal-overlay';
365
383
  overlay.id = this._id;
366
384
  overlay.style.display = open ? 'flex' : 'none';
385
+
386
+ // Add position class
387
+ if (position) {
388
+ overlay.classList.add(`jux-modal-position-${position}`);
389
+ }
390
+
367
391
  if (className) overlay.className += ` ${className}`;
368
392
  if (style) overlay.setAttribute('style', style);
369
393
  this._overlay = overlay;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.69",
3
+ "version": "1.1.71",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",