@ecopages/radiant-ui 0.2.1 → 0.2.3

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 (50) hide show
  1. package/dist/components/ui/autocomplete/autocomplete.d.ts +2 -1
  2. package/dist/components/ui/button/button.d.ts +4 -2
  3. package/dist/components/ui/carousel/carousel.d.ts +3 -2
  4. package/dist/components/ui/carousel/carousel.script.d.ts +4 -4
  5. package/dist/components/ui/combobox/combobox.d.ts +4 -3
  6. package/dist/components/ui/combobox/combobox.script.d.ts +1 -1
  7. package/dist/components/ui/cycle-toggle/cycle-toggle.d.ts +2 -1
  8. package/dist/components/ui/date-field/date-field.d.ts +2 -1
  9. package/dist/components/ui/date-field/date-field.script.d.ts +1 -1
  10. package/dist/components/ui/date-range-picker/date-range-picker.d.ts +2 -1
  11. package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +1 -1
  12. package/dist/components/ui/dialog/dialog.d.ts +2 -1
  13. package/dist/components/ui/dialog/dialog.script.d.ts +3 -3
  14. package/dist/components/ui/dialog/index.js +1 -1
  15. package/dist/components/ui/dialog/index.js.map +2 -2
  16. package/dist/components/ui/disclosure/disclosure.d.ts +2 -1
  17. package/dist/components/ui/hover-card/hover-card.script.d.ts +1 -1
  18. package/dist/components/ui/input/input.d.ts +3 -2
  19. package/dist/components/ui/knob/index.js +1 -1
  20. package/dist/components/ui/knob/index.js.map +2 -2
  21. package/dist/components/ui/knob/knob.script.d.ts +7 -7
  22. package/dist/components/ui/label/index.js +1 -1
  23. package/dist/components/ui/label/index.js.map +2 -2
  24. package/dist/components/ui/label/label.d.ts +4 -0
  25. package/dist/components/ui/menu-button/menu-button.d.ts +2 -1
  26. package/dist/components/ui/menu-button/menu-button.script.d.ts +2 -2
  27. package/dist/components/ui/menubar/menubar.d.ts +2 -1
  28. package/dist/components/ui/number-field/number-field.d.ts +3 -2
  29. package/dist/components/ui/popover/popover.script.d.ts +3 -3
  30. package/dist/components/ui/select/select.d.ts +4 -3
  31. package/dist/components/ui/select/select.script.d.ts +1 -1
  32. package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +1 -1
  33. package/dist/components/ui/sidebar/sidebar.css +656 -654
  34. package/dist/components/ui/sidebar/sidebar.d.ts +3 -2
  35. package/dist/components/ui/sidebar/sidebar.script.d.ts +4 -4
  36. package/dist/components/ui/slider/slider.script.d.ts +8 -8
  37. package/dist/components/ui/tabs/tabs.d.ts +2 -1
  38. package/dist/components/ui/tag-group/tag-group.d.ts +2 -1
  39. package/dist/components/ui/textarea/textarea.d.ts +3 -2
  40. package/dist/components/ui/toast/toast.script.d.ts +1 -1
  41. package/dist/components/ui/toast/toaster.script.d.ts +1 -1
  42. package/dist/components/ui/tooltip/tooltip.script.d.ts +1 -1
  43. package/dist/components/ui/window-splitter/index.js +1 -1
  44. package/dist/components/ui/window-splitter/index.js.map +2 -2
  45. package/dist/components/ui/window-splitter/window-splitter.script.d.ts +2 -2
  46. package/dist/index.js +1 -1
  47. package/dist/index.js.map +2 -2
  48. package/dist/lib/native-element-props.d.ts +7 -0
  49. package/dist/styles/styles.css +582 -582
  50. package/package.json +10 -10
@@ -1,7 +1,8 @@
1
1
  import type { JsxCustomElementAttributes, JsxElementProps, JsxRenderable } from '@ecopages/jsx';
2
+ import type { NativeInputProps } from '@/lib/native-element-props';
2
3
  import type { RuiAutocomplete as RuiAutocompleteElement, RuiAutocompleteProps } from './autocomplete.script';
3
4
  import './autocomplete.script';
4
- export type RuiAutocompleteInputProps = JsxElementProps<HTMLInputElement> & {
5
+ export type RuiAutocompleteInputProps = NativeInputProps & {
5
6
  placeholder?: string;
6
7
  disabled?: boolean;
7
8
  };
@@ -1,4 +1,5 @@
1
1
  import type { JsxElementProps } from '@ecopages/jsx';
2
+ import type { NativeButtonProps } from '@/lib/native-element-props';
2
3
  export type RuiButtonVariant = 'filled' | 'outline' | 'destructive' | 'ghost' | 'link';
3
4
  export type RuiButtonSize = 'none' | 'sm' | 'md' | 'lg';
4
5
  type RuiButtonChrome = {
@@ -9,7 +10,7 @@ type RuiButtonChrome = {
9
10
  /** Makes a control-sized button square, for example for an icon-only action. */
10
11
  square?: boolean;
11
12
  };
12
- export type RuiButtonControlProps = JsxElementProps<HTMLButtonElement> & RuiButtonChrome & {
13
+ export type RuiButtonControlProps = NativeButtonProps & RuiButtonChrome & {
13
14
  /** Native button type. Default: `button`. */
14
15
  type?: 'button' | 'submit' | 'reset';
15
16
  /** Disabled state. */
@@ -34,7 +35,8 @@ export type RuiButtonProps = RuiButtonControlProps | RuiButtonLinkProps;
34
35
  * Presentational wrapper around a native `<button>` or button-styled `<a>`.
35
36
  *
36
37
  * No custom element and no controller — only CSS variants/sizes. The `href`
37
- * union branch preserves native link semantics for navigation.
38
+ * union branch preserves native link semantics for navigation. Native button
39
+ * attributes such as `name` and `value` type-check on the control branch.
38
40
  *
39
41
  * @remarks
40
42
  * Default/`md` height uses `--size-control-md`, the same token as `RuiInput`, so
@@ -1,4 +1,5 @@
1
1
  import { type JsxCustomElementAttributes, type JsxElementProps, type JsxRenderable } from '@ecopages/jsx';
2
+ import type { NativeButtonProps } from '@/lib/native-element-props';
2
3
  import { type RuiCarousel as RuiCarouselElement, type RuiCarouselProps } from './carousel.script';
3
4
  import './carousel.script';
4
5
  export type RuiCarouselSlideData = {
@@ -16,7 +17,7 @@ export type RuiCarouselSlideProps = Omit<JsxElementProps<HTMLDivElement>, 'id'>
16
17
  * @remarks Stamps `[data-slide]` with the slide `id`.
17
18
  */
18
19
  export declare function RuiCarouselSlide({ id, children, class: className, ...props }: RuiCarouselSlideProps): JsxRenderable;
19
- export type RuiCarouselControlProps = JsxElementProps<HTMLButtonElement> & {
20
+ export type RuiCarouselControlProps = NativeButtonProps & {
20
21
  disabled?: boolean;
21
22
  /** Match `controls-variant="overlay"` on the carousel for circular on-slide chrome. */
22
23
  overlay?: boolean;
@@ -31,7 +32,7 @@ export type RuiCarouselControlProps = JsxElementProps<HTMLButtonElement> & {
31
32
  export declare function RuiCarouselPrev({ children, class: className, disabled, overlay, aria, ...props }: RuiCarouselControlProps): JsxRenderable;
32
33
  /** Next carousel control. Stamps `[data-carousel-action="next"]` and `data-ref="next"`. */
33
34
  export declare function RuiCarouselNext({ children, class: className, disabled, overlay, aria, ...props }: RuiCarouselControlProps): JsxRenderable;
34
- export type RuiCarouselRotationProps = JsxElementProps<HTMLButtonElement> & {
35
+ export type RuiCarouselRotationProps = NativeButtonProps & {
35
36
  overlay?: boolean;
36
37
  };
37
38
  /** Play/pause rotation control. Stamps `[data-carousel-action="rotation"]` and `data-ref="rotation"`. */
@@ -124,10 +124,10 @@ export declare class RuiCarousel extends RadiantElement {
124
124
  slidesPerView: number;
125
125
  slidesPerGroup: number;
126
126
  slideCount: number;
127
- rootTarget: HTMLElement;
128
- trackTarget: HTMLElement;
129
- indicatorsTarget: HTMLElement;
130
- viewportTarget: HTMLElement;
127
+ rootTarget: HTMLElement | null;
128
+ trackTarget: HTMLElement | null;
129
+ indicatorsTarget: HTMLElement | null;
130
+ viewportTarget: HTMLElement | null;
131
131
  private paused;
132
132
  private readonly uid;
133
133
  /** User explicitly resumed rotation (e.g. via rotation control) despite reduced motion. */
@@ -1,4 +1,5 @@
1
1
  import type { JsxCustomElementAttributes, JsxElementProps, JsxRenderable } from '@ecopages/jsx';
2
+ import type { NativeButtonProps, NativeInputProps } from '@/lib/native-element-props';
2
3
  import { type RuiListboxOptionData } from '../listbox';
3
4
  import type { RuiCombobox as RuiComboboxElement, RuiComboboxProps } from './combobox.script';
4
5
  import './combobox.script';
@@ -8,7 +9,7 @@ export type RuiComboboxControlProps = JsxElementProps<HTMLDivElement>;
8
9
  * @cssclass rui-combobox__control - Bordered control-height row.
9
10
  */
10
11
  export declare function RuiComboboxControl({ children, class: className, ...props }: RuiComboboxControlProps): JsxRenderable;
11
- export type RuiComboboxInputProps = JsxElementProps<HTMLInputElement> & {
12
+ export type RuiComboboxInputProps = NativeInputProps & {
12
13
  placeholder?: string;
13
14
  disabled?: boolean;
14
15
  };
@@ -17,12 +18,12 @@ export type RuiComboboxInputProps = JsxElementProps<HTMLInputElement> & {
17
18
  * @cssclass rui-combobox__input - Combobox text input.
18
19
  */
19
20
  export declare function RuiComboboxInput({ placeholder, disabled, class: className, ...props }: RuiComboboxInputProps): JsxRenderable;
20
- export type RuiComboboxTriggerProps = JsxElementProps<HTMLButtonElement> & {
21
+ export type RuiComboboxTriggerProps = NativeButtonProps & {
21
22
  disabled?: boolean;
22
23
  };
23
24
  /** Toggle button for opening the listbox popup. Stamps `[data-combobox-trigger]`. Children replace the default chevron icon. */
24
25
  export declare function RuiComboboxTrigger({ children, class: className, aria, disabled, ...props }: RuiComboboxTriggerProps): JsxRenderable;
25
- export type RuiComboboxClearProps = JsxElementProps<HTMLButtonElement> & {
26
+ export type RuiComboboxClearProps = NativeButtonProps & {
26
27
  disabled?: boolean;
27
28
  };
28
29
  /** Clears the current selection. Stamps `[data-combobox-clear]`. Place next to `RuiComboboxTrigger`. Children replace the default close icon. */
@@ -95,7 +95,7 @@ export declare class RuiCombobox extends RadiantElement {
95
95
  private readonly uid;
96
96
  private readonly collection;
97
97
  private readonly listboxBehavior;
98
- rootTarget: HTMLElement;
98
+ rootTarget: HTMLElement | null;
99
99
  private get listboxId();
100
100
  private get inputId();
101
101
  private isMultiple;
@@ -1,4 +1,5 @@
1
1
  import type { JsxCustomElementAttributes, JsxElementProps } from '@ecopages/jsx';
2
+ import type { NativeButtonProps } from '@/lib/native-element-props';
2
3
  import type { RuiCycleToggle as RuiCycleToggleElement, RuiCycleToggleProps } from './cycle-toggle.script';
3
4
  import './cycle-toggle.script';
4
5
  export type RuiCycleToggleItemProps = Omit<JsxElementProps<HTMLSpanElement>, 'id'> & {
@@ -7,7 +8,7 @@ export type RuiCycleToggleItemProps = Omit<JsxElementProps<HTMLSpanElement>, 'id
7
8
  /** Whether this item is selected in the initial document. */
8
9
  selected?: boolean;
9
10
  };
10
- export type RuiCycleToggleButtonProps = JsxElementProps<HTMLButtonElement> & Pick<RuiCycleToggleProps, 'disabled' | 'label' | 'size' | 'variant'>;
11
+ export type RuiCycleToggleButtonProps = NativeButtonProps & Pick<RuiCycleToggleProps, 'disabled' | 'label' | 'size' | 'variant'>;
11
12
  /**
12
13
  * One cycle option inside the button. Stamps `[data-cycle-value]` from `id`.
13
14
  *
@@ -1,4 +1,5 @@
1
1
  import type { JsxCustomElementAttributes, JsxElementProps } from '@ecopages/jsx';
2
+ import type { NativeButtonProps } from '@/lib/native-element-props';
2
3
  import { type RuiCalendarElement, type RuiCalendarProps } from '../calendar';
3
4
  import { type RuiDateInputElement, type RuiDateInputProps } from '../date-input';
4
5
  import type { RuiDateField as RuiDateFieldElement, RuiDateFieldProps } from './date-field.script';
@@ -10,7 +11,7 @@ export declare function RuiDateFieldControl({ children, class: className, ...pro
10
11
  export type RuiDateFieldInputProps = JsxCustomElementAttributes<RuiDateInputElement, RuiDateInputProps>;
11
12
  /** Nested `rui-date-input`. Stamps `[data-date-field-input]`. */
12
13
  export declare function RuiDateFieldInput({ class: className, ...props }: RuiDateFieldInputProps): import("@ecopages/jsx").JsxRenderable;
13
- export type RuiDateFieldToggleProps = JsxElementProps<HTMLButtonElement>;
14
+ export type RuiDateFieldToggleProps = NativeButtonProps;
14
15
  /** Calendar toggle. Stamps `[data-date-field-trigger]` and `data-ref="trigger"`. */
15
16
  export declare function RuiDateFieldToggle({ children, class: className, aria, ...props }: RuiDateFieldToggleProps): import("@ecopages/jsx").JsxRenderable;
16
17
  export type RuiDateFieldPopoverProps = JsxElementProps<HTMLDivElement>;
@@ -75,7 +75,7 @@ export declare class RuiDateField extends RadiantElement {
75
75
  private readonly uid;
76
76
  private readonly calendarPopover;
77
77
  private disposeMobileLayoutListener;
78
- popoverTarget: HTMLElement;
78
+ popoverTarget: HTMLElement | null;
79
79
  private readonly onMediaChange;
80
80
  private get isoValue();
81
81
  private get inputId();
@@ -1,4 +1,5 @@
1
1
  import type { JsxCustomElementAttributes, JsxElementProps } from '@ecopages/jsx';
2
+ import type { NativeButtonProps } from '@/lib/native-element-props';
2
3
  import { type RuiCalendarElement, type RuiCalendarProps } from '../calendar';
3
4
  import { type RuiDateInputElement, type RuiDateInputProps } from '../date-input';
4
5
  import type { RuiDateRangePicker as RuiDateRangePickerElement, RuiDateRangePickerProps } from './date-range-picker.script';
@@ -19,7 +20,7 @@ export declare function RuiDateRangePickerEndInput({ class: className, ...props
19
20
  export type RuiDateRangePickerSeparatorProps = JsxElementProps<HTMLSpanElement>;
20
21
  /** Visual separator between the start and end inputs. */
21
22
  export declare function RuiDateRangePickerSeparator({ children, class: className, ...props }: RuiDateRangePickerSeparatorProps): import("@ecopages/jsx").JsxRenderable;
22
- export type RuiDateRangePickerToggleProps = JsxElementProps<HTMLButtonElement>;
23
+ export type RuiDateRangePickerToggleProps = NativeButtonProps;
23
24
  /** Calendar toggle. Stamps `[data-range-trigger]` and `data-ref="trigger"`. */
24
25
  export declare function RuiDateRangePickerToggle({ children, class: className, aria, ...props }: RuiDateRangePickerToggleProps): import("@ecopages/jsx").JsxRenderable;
25
26
  export type RuiDateRangePickerPopoverProps = JsxElementProps<HTMLDivElement>;
@@ -77,7 +77,7 @@ export declare class RuiDateRangePicker extends RadiantElement {
77
77
  open: boolean;
78
78
  private readonly calendarPopover;
79
79
  private disposeMobileLayoutListener;
80
- popoverTarget: HTMLElement;
80
+ popoverTarget: HTMLElement | null;
81
81
  private readonly onMediaChange;
82
82
  private get isoValue();
83
83
  private getStartInput;
@@ -1,4 +1,5 @@
1
1
  import { type JsxCustomElementAttributes, type JsxElementProps, type JsxRenderable } from '@ecopages/jsx';
2
+ import type { NativeButtonProps } from '@/lib/native-element-props';
2
3
  import type { RuiDialog as RuiDialogElement, RuiDialogProps } from './dialog.script';
3
4
  import './dialog.script';
4
5
  export type RuiDialogTitleProps = JsxElementProps<HTMLDivElement>;
@@ -26,7 +27,7 @@ export type RuiDialogActionsProps = JsxElementProps<HTMLDivElement>;
26
27
  * @cssclass rui-dialog__actions - Right-aligned action row.
27
28
  */
28
29
  export declare function RuiDialogActions({ children, class: className, ...props }: RuiDialogActionsProps): JsxRenderable;
29
- export type RuiDialogCloseProps = JsxElementProps<HTMLButtonElement>;
30
+ export type RuiDialogCloseProps = NativeButtonProps;
30
31
  /**
31
32
  * Close control for the dialog surface.
32
33
  *
@@ -67,9 +67,9 @@ export declare class RuiDialog extends RadiantElement {
67
67
  open: boolean;
68
68
  alert: boolean;
69
69
  label: string;
70
- dialogTarget: HTMLElement;
71
- titleTarget: HTMLElement;
72
- descriptionTarget: HTMLElement;
70
+ dialogTarget: HTMLElement | null;
71
+ titleTarget: HTMLElement | null;
72
+ descriptionTarget: HTMLElement | null;
73
73
  closeEvent: EventEmitter<RuiDialogCloseDetail>;
74
74
  private previouslyFocused;
75
75
  private readonly uid;
@@ -1,2 +1,2 @@
1
- import{RadiantElement as Kt,bindTo as ye,bound as Ee,customElement as De,event as Ie,onEvent as ot,onUpdated as Ae,prop as rt,query as nt}from"@ecopages/radiant";var fe="a[href], button, input, select, textarea, [tabindex]";function ge(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function xt(t){return Array.from(t.querySelectorAll(fe)).filter(ge)}var pe=/^[A-Za-z][A-Za-z0-9_-]*$/;function Tt(t){return pe.test(t)}function me(t){let e=t.trim();if(Tt(e))return e;let i=`rui-${e}`;return e&&Tt(i)?i:"rui"}function Ct(t){let e=typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,""):Array.from(crypto.getRandomValues(new Uint8Array(16)),i=>i.toString(16).padStart(2,"0")).join("");return`${me(t)}-${e}`}var Rt,wt,Lt,St,kt,Ot,Nt,Gt,Ut,jt,Vt,Bt,qt,Ft,$t,zt;function be(t,e,i,o,u,g){var D,l,Z,J,j,Q,S,dt=Symbol.metadata||Symbol.for("Symbol.metadata"),ft=Object.defineProperty,W=Object.create,gt=[W(null),W(null)],pt=e.length;function V(r,h,m){return function(n,a){h&&(a=n,n=t);for(var _=0;_<r.length;_++)a=r[_].apply(n,m?[a]:[]);return m?a:n}}function I(r,h,m,n){if(typeof r!="function"&&(n||r!==void 0))throw new TypeError(h+" must "+(m||"be")+" a function"+(n?"":" or undefined"));return r}function mt(r,h,m,n,a,_,T,b,v,y,ht){function Y(c){if(!ht(c))throw new TypeError("Attempted to access private element on non-instance")}var P=[].concat(h[0]),_t=h[3],tt=!T,k=a===1,vt=a===3,yt=a===4,B=a===2;function q(c,R,It){return function($,At){return R&&(At=$,$=r),It&&It($),s[c].call($,At)}}if(!tt){var s={},et=[],A=vt?"get":yt||k?"set":"value";if(v?(y||k?s={get:Ht(function(){return _t(this)},n,"get"),set:function(c){h[4](this,c)}}:s[A]=_t,y||Ht(s[A],n,B?"":A)):y||(s=Object.getOwnPropertyDescriptor(r,n)),!y&&!v){if((l=gt[+b][n])&&(l^a)!==7)throw Error("Decorating two elements with the same name ("+s[A].name+") is not supported yet");gt[+b][n]=a<3?1:a}}for(var p=r,F=P.length-1;F>=0;F-=m?2:1){var Et=I(P[F],"A decorator","be",!0),Dt=m?P[F-1]:void 0,it={},O={kind:["field","accessor","method","getter","setter","class"][a],name:n,metadata:D,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");I(R,"An initializer","be",!0),_.push(R)}.bind(null,it)};if(tt)l=Et.call(Dt,p,O),it.v=1,I(l,"class decorators","return")&&(p=l);else if(O.static=b,O.private=v,l=O.access={has:v?ht.bind():function(c){return n in c}},yt||(l.get=v?B?function(c){return Y(c),s.value}:q("get",0,Y):function(c){return c[n]}),B||vt||(l.set=v?q("set",0,Y):function(c,R){c[n]=R}),p=Et.call(Dt,k?{get:s.get,set:s.set}:s[A],O),it.v=1,k){if(typeof p=="object"&&p)(l=I(p.get,"accessor.get"))&&(s.get=l),(l=I(p.set,"accessor.set"))&&(s.set=l),(l=I(p.init,"accessor.init"))&&et.unshift(l);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else I(p,(y?"field":"method")+" decorators","return")&&(y?et.unshift(p):s[A]=p)}return a<2&&T.push(V(et,b,1),V(_,b,0)),y||tt||(v?k?T.splice(-1,0,q("get",b),q("set",b)):T.push(B?s[A]:I.call.bind(s[A])):ft(r,n,s)),p}function bt(r){return ft(r,dt,{configurable:!0,enumerable:!0,value:D})}return g!==void 0&&(D=g[dt]),D=W(D??null),j=[],Q=function(r){r&&j.push(V(r))},S=function(r,h){for(var m=0;m<i.length;m++){var n=i[m],a=n[1],_=7&a;if((8&a)==r&&!_==h){var T=n[2],b=!!n[3],v=16&a;mt(r?t:t.prototype,n,v,b?"#"+T:he(T),_,_<2?[]:r?J=J||[]:Z=Z||[],j,!!r,b,h,r&&b?function(y){return ve(y)===t}:u)}}},S(8,0),S(0,0),S(8,1),S(0,1),Q(Z),Q(J),l=j,pt||bt(t),{e:l,get c(){var r=[];return pt&&[bt(t=mt(t,[e],o,t.name,5,r)),V(r,1)]}}}function he(t){var e=_e(t,"string");return typeof e=="symbol"?e:e+""}function _e(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ht(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ve(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Mt,Xt=class extends Kt{static{({e:[Lt,St,kt,Ot,Nt,Gt,Ut,jt,Vt,Bt,qt,Ft,$t,zt,Rt],c:[Mt,wt]}=be(this,[De("rui-dialog")],[[[rt({type:Boolean,reflect:!0,defaultValue:!1}),ye({ref:"root",bool:"hidden",invert:!0})],0,"open"],[rt({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[rt({type:String,defaultValue:""}),0,"label"],[nt({ref:"dialog"}),0,"dialogTarget"],[nt({selector:"[data-dialog-title]"}),0,"titleTarget"],[nt({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[Ie({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Ee,Ae(["open","label"])],2,"syncOpenState"],[ot({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[ot({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[ot({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Kt))}open=(Rt(this),Lt(this));alert=(St(this),kt(this));label=(Ot(this),Nt(this));dialogTarget=(Gt(this),Ut(this));titleTarget=(jt(this),Vt(this));descriptionTarget=(Bt(this),qt(this));closeEvent=(Ft(this),$t(this));previouslyFocused=(zt(this),null);uid=Ct("rui-dialog");get titleId(){return`${this.uid}-title`}get descriptionId(){return`${this.uid}-desc`}onConnected(){this.syncOpenState()}syncOpenState(){this.dialogTarget&&(this.titleTarget?.textContent?.trim()?(this.titleTarget.id=this.titleId,this.dialogTarget.setAttribute("aria-labelledby",this.titleId),this.dialogTarget.removeAttribute("aria-label")):this.label&&(this.dialogTarget.setAttribute("aria-label",this.label),this.dialogTarget.removeAttribute("aria-labelledby")),this.descriptionTarget?(this.descriptionTarget.id=this.descriptionId,this.dialogTarget.setAttribute("aria-describedby",this.descriptionId)):this.dialogTarget.removeAttribute("aria-describedby"),this.open?(this.previouslyFocused=document.activeElement,queueMicrotask(()=>this.focusInitial())):(this.previouslyFocused?.focus?.(),this.previouslyFocused=null))}focusInitial(){(this.getFocusable()[0]??this.dialogTarget)?.focus()}getFocusable(){return this.dialogTarget?xt(this.dialogTarget):[]}dismiss(e){this.open&&(this.open=!1,this.closeEvent.emit({reason:e}))}onDocumentKeydown(e){if(!this.open)return;if(e.key==="Escape"){e.preventDefault(),this.dismiss("escape");return}if(e.key!=="Tab")return;let i=this.getFocusable();if(!i.length){e.preventDefault(),this.dialogTarget.focus();return}let o=i[0],u=i[i.length-1],g=document.activeElement;e.shiftKey&&g===o?(e.preventDefault(),u.focus()):!e.shiftKey&&g===u&&(e.preventDefault(),o.focus())}onBackdropClick(){this.dismiss("backdrop")}onCloseClick(){this.dismiss("dismiss")}static{wt()}};import{jsx as f,jsxs as Pt}from"@ecopages/jsx/jsx-runtime";function Zt(t,e){return e===void 0||t?.label!==void 0?t:{...t,label:e}}function C(...t){return t.filter(Boolean).join(" ")}import{jsx as Jt,jsxs as xe}from"@ecopages/jsx/jsx-runtime";var Qt="http://www.w3.org/2000/svg";function at({class:t,size:e="sm",...i}){return xe("svg",{...i,class:C("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[Jt("path",{d:"m18 6-12 12"}),Jt("path",{d:"m6 6 12 12"})]})}function Wt(){let t=document.createElementNS(Qt,"svg");t.setAttribute("class","rui-icon"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true");for(let e of["m18 6-12 12","m6 6 12 12"]){let i=document.createElementNS(Qt,"path");i.setAttribute("d",e),t.append(i)}return t}function te({children:t,class:e,...i}){return f("div",{...i,"data-dialog-title":!0,"data-ref":"title",class:C("rui-dialog__title",e),children:t})}function ee({children:t,class:e,...i}){return f("div",{...i,"data-dialog-body":!0,"data-ref":"description",class:C("rui-dialog__body",e),children:t})}function ie({children:t,class:e,...i}){return f("div",{...i,class:C("rui-dialog__actions",e),children:t})}function oe({children:t,class:e,aria:i,...o}){return f("button",{...o,aria:Zt(i,"Close"),type:"button","data-dialog-close":!0,"data-ref":"close",class:C("rui-dialog__close",e),children:t??f(at,{})})}function Yt({alert:t,children:e,open:i}){return Pt("div",{"data-ref":"root",class:"rui-dialog",hidden:i?void 0:!0,children:[f("div",{"data-ref":"backdrop",class:"rui-dialog__backdrop"}),f("div",{"data-ref":"dialog",class:"rui-dialog__surface",tabindex:-1,role:t?"alertdialog":"dialog","aria-modal":"true",children:e})]})}function Te({title:t,actions:e,children:i,open:o,alert:u,...g}){return t!=null||e!=null?f("rui-dialog",{...g,open:o,alert:u,children:Pt(Yt,{open:o,alert:u,children:[f(oe,{}),t!=null?f(te,{children:t}):null,i!=null?f(ee,{children:i}):null,e!=null?f(ie,{children:e}):null]})}):f("rui-dialog",{...g,open:o,alert:u,children:f(Yt,{open:o,alert:u,children:i})})}var E="__rui-dialog-host",z="rui-dialog-open",H="rui-dialog-close",K="rui-dialog-toggle",lt="rui-dialog-action";function re(t){return"id"in t&&t.id!=null&&t.id!==""}var N=!1,X=null,G=null,d=null;function ut(t){let e=t.trim();if(!e)return null;let i=document.getElementById(e);return i?.localName==="rui-dialog"?i:null}function Ce(){let t=document.createElement("button");return t.type="button",t.setAttribute("data-dialog-close",""),t.setAttribute("data-ref","close"),t.className="rui-dialog__close",t.setAttribute("aria-label","Close"),t.append(Wt()),t}function Re(t){let e=document.createElement("div");return e.setAttribute("data-dialog-title",""),e.setAttribute("data-ref","title"),e.className="rui-dialog__title",e.textContent=t,e}function we(t){let e=document.createElement("div");e.setAttribute("data-dialog-body",""),e.setAttribute("data-ref","description"),e.className="rui-dialog__body";let i=document.createElement("p");return i.textContent=t,e.append(i),e}function Le(t){let e=document.createElement("div");e.className="rui-dialog__actions";for(let i of t){let o=document.createElement("button");o.type="button",o.className=`rui-button rui-button--${i.variant??"filled"} rui-button--${i.size??"md"}`,o.setAttribute("data-dialog-action",i.value??""),i.closeOnClick===!1&&o.setAttribute("data-dialog-action-close","false"),o.textContent=i.label,e.append(o)}return e}function Se(t){let e=document.createElement("div");e.dataset.ref="root",e.className="rui-dialog";let i=document.createElement("div");i.setAttribute("data-ref","backdrop"),i.className="rui-dialog__backdrop";let o=document.createElement("div");return o.setAttribute("data-ref","dialog"),o.className="rui-dialog__surface",o.tabIndex=-1,o.setAttribute("role",t?"alertdialog":"dialog"),o.setAttribute("aria-modal","true"),e.append(i,o),e}function U(){G?.remove(),G=null}function ke(t){U();let e=document.createElement("rui-dialog");e.id=E,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=Se(e.alert),o=i.querySelector('[data-ref="dialog"]');if(!o)throw new Error("Failed to create the dialog surface.");return o.append(Ce()),t.title&&o.append(Re(t.title)),t.body&&o.append(we(t.body)),t.actions?.length&&o.append(Le(t.actions)),e.append(i),(X??document.body).appendChild(e),G=e,e}function ne(t){if(!(!d||d===t))if(d===E)U();else{let e=ut(d);e&&(e.open=!1)}}function w(t){x();let e=ut(t);e&&(ne(t),e.open=!0,d=t)}function Oe(t){x(),ne(E),ke(t),d=E}function M(t){if(typeof t=="string"){w(t);return}if(re(t)){w(t.id);return}Oe(t)}function L(t){x();let e=t??d;if(e){if(e===E)U();else{let i=ut(e);i&&(i.open=!1)}d===e&&(d=null)}}function ct(t){if(x(),d===t){L(t);return}w(t)}function ae(t){let e=t.detail;if(typeof e=="string"){M(e);return}e&&typeof e=="object"&&M(e)}function le(t){let e=t.detail;L(e?.id)}function se(t){let e=t.detail;e?.id&&ct(e.id)}function ue(t){let e=t.target;if(!e?.closest)return;let i=e.closest("[data-dialog-action]");if(i&&G?.contains(i)){t.preventDefault();let D={value:i.getAttribute("data-dialog-action")||void 0||void 0};G.dispatchEvent(new CustomEvent(lt,{detail:D,bubbles:!0,composed:!0})),i.getAttribute("data-dialog-action-close")!=="false"&&L(E);return}let o=e.closest("[data-dialog-open]");if(o){let g=o.getAttribute("data-dialog-open")?.trim();g&&(t.preventDefault(),w(g));return}let u=e.closest("[data-dialog-close]");if(u){if(u.closest("rui-dialog")?.hasAttribute("open"))return;t.preventDefault(),L()}}function ce(t){let e=t.target?.closest?.("rui-dialog");if(!e)return;let i=e.id||null;i&&d===i&&(i===E&&U(),d=null)}function de(t={}){return N?(t.mount&&(X=t.mount),st):(N=!0,X=t.mount??document.body,document.addEventListener(z,ae),document.addEventListener(H,le),document.addEventListener(K,se),document.addEventListener("click",ue),document.addEventListener("rui-close",ce),st)}function x(){N||de()}function st(){N&&(document.removeEventListener(z,ae),document.removeEventListener(H,le),document.removeEventListener(K,se),document.removeEventListener("click",ue),document.removeEventListener("rui-close",ce),U(),X=null,d=null,N=!1)}function Ne(){return d}function Ge(t){x(),M(t)}function Ue(t){x(),L(t)}function je(t){x(),ct(t)}function Ve(t){x();let e=t?.trim()||void 0;return{open:o=>{if(e){w(e);return}if(o!=null){if(typeof o=="string"){w(o);return}M(o)}},close:o=>{L(o??e)},toggle:o=>{let u=o??e;u&&ct(u)},get openId(){return d}}}export{lt as RUI_DIALOG_ACTION_EVENT,H as RUI_DIALOG_CLOSE_EVENT,E as RUI_DIALOG_HOST_ID,z as RUI_DIALOG_OPEN_EVENT,K as RUI_DIALOG_TOGGLE_EVENT,Te as RuiDialog,ie as RuiDialogActions,ee as RuiDialogBody,oe as RuiDialogClose,Mt as RuiDialogElement,te as RuiDialogTitle,Ue as closeDialog,Ve as createDialogHandle,Ne as getOpenDialogId,de as installDialogs,Ge as openDialog,je as toggleDialog,st as uninstallDialogs};
1
+ import{RadiantElement as Kt,bindTo as ye,bound as Ee,customElement as De,event as Ie,onEvent as ot,onUpdated as Ae,prop as rt,query as nt}from"@ecopages/radiant";var fe="a[href], button, input, select, textarea, [tabindex]";function ge(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function xt(t){return Array.from(t.querySelectorAll(fe)).filter(ge)}var pe=/^[A-Za-z][A-Za-z0-9_-]*$/;function Tt(t){return pe.test(t)}function me(t){let e=t.trim();if(Tt(e))return e;let i=`rui-${e}`;return e&&Tt(i)?i:"rui"}function Ct(t){let e=typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,""):Array.from(crypto.getRandomValues(new Uint8Array(16)),i=>i.toString(16).padStart(2,"0")).join("");return`${me(t)}-${e}`}var Rt,wt,Lt,St,kt,Ot,Nt,Gt,Ut,jt,Vt,Bt,qt,Ft,$t,zt;function be(t,e,i,o,u,g){var D,l,Z,J,j,Q,S,dt=Symbol.metadata||Symbol.for("Symbol.metadata"),ft=Object.defineProperty,W=Object.create,gt=[W(null),W(null)],pt=e.length;function V(r,h,m){return function(n,a){h&&(a=n,n=t);for(var _=0;_<r.length;_++)a=r[_].apply(n,m?[a]:[]);return m?a:n}}function I(r,h,m,n){if(typeof r!="function"&&(n||r!==void 0))throw new TypeError(h+" must "+(m||"be")+" a function"+(n?"":" or undefined"));return r}function mt(r,h,m,n,a,_,T,b,v,y,ht){function Y(c){if(!ht(c))throw new TypeError("Attempted to access private element on non-instance")}var P=[].concat(h[0]),_t=h[3],tt=!T,k=a===1,vt=a===3,yt=a===4,B=a===2;function q(c,R,It){return function($,At){return R&&(At=$,$=r),It&&It($),s[c].call($,At)}}if(!tt){var s={},et=[],A=vt?"get":yt||k?"set":"value";if(v?(y||k?s={get:Ht(function(){return _t(this)},n,"get"),set:function(c){h[4](this,c)}}:s[A]=_t,y||Ht(s[A],n,B?"":A)):y||(s=Object.getOwnPropertyDescriptor(r,n)),!y&&!v){if((l=gt[+b][n])&&(l^a)!==7)throw Error("Decorating two elements with the same name ("+s[A].name+") is not supported yet");gt[+b][n]=a<3?1:a}}for(var p=r,F=P.length-1;F>=0;F-=m?2:1){var Et=I(P[F],"A decorator","be",!0),Dt=m?P[F-1]:void 0,it={},O={kind:["field","accessor","method","getter","setter","class"][a],name:n,metadata:D,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");I(R,"An initializer","be",!0),_.push(R)}.bind(null,it)};if(tt)l=Et.call(Dt,p,O),it.v=1,I(l,"class decorators","return")&&(p=l);else if(O.static=b,O.private=v,l=O.access={has:v?ht.bind():function(c){return n in c}},yt||(l.get=v?B?function(c){return Y(c),s.value}:q("get",0,Y):function(c){return c[n]}),B||vt||(l.set=v?q("set",0,Y):function(c,R){c[n]=R}),p=Et.call(Dt,k?{get:s.get,set:s.set}:s[A],O),it.v=1,k){if(typeof p=="object"&&p)(l=I(p.get,"accessor.get"))&&(s.get=l),(l=I(p.set,"accessor.set"))&&(s.set=l),(l=I(p.init,"accessor.init"))&&et.unshift(l);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else I(p,(y?"field":"method")+" decorators","return")&&(y?et.unshift(p):s[A]=p)}return a<2&&T.push(V(et,b,1),V(_,b,0)),y||tt||(v?k?T.splice(-1,0,q("get",b),q("set",b)):T.push(B?s[A]:I.call.bind(s[A])):ft(r,n,s)),p}function bt(r){return ft(r,dt,{configurable:!0,enumerable:!0,value:D})}return g!==void 0&&(D=g[dt]),D=W(D??null),j=[],Q=function(r){r&&j.push(V(r))},S=function(r,h){for(var m=0;m<i.length;m++){var n=i[m],a=n[1],_=7&a;if((8&a)==r&&!_==h){var T=n[2],b=!!n[3],v=16&a;mt(r?t:t.prototype,n,v,b?"#"+T:he(T),_,_<2?[]:r?J=J||[]:Z=Z||[],j,!!r,b,h,r&&b?function(y){return ve(y)===t}:u)}}},S(8,0),S(0,0),S(8,1),S(0,1),Q(Z),Q(J),l=j,pt||bt(t),{e:l,get c(){var r=[];return pt&&[bt(t=mt(t,[e],o,t.name,5,r)),V(r,1)]}}}function he(t){var e=_e(t,"string");return typeof e=="symbol"?e:e+""}function _e(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ht(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ve(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Mt,Xt=class extends Kt{static{({e:[Lt,St,kt,Ot,Nt,Gt,Ut,jt,Vt,Bt,qt,Ft,$t,zt,Rt],c:[Mt,wt]}=be(this,[De("rui-dialog")],[[[rt({type:Boolean,reflect:!0,defaultValue:!1}),ye({ref:"root",bool:"hidden",invert:!0})],0,"open"],[rt({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[rt({type:String,defaultValue:""}),0,"label"],[nt({ref:"dialog"}),0,"dialogTarget"],[nt({selector:"[data-dialog-title]"}),0,"titleTarget"],[nt({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[Ie({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Ee,Ae(["open","label"])],2,"syncOpenState"],[ot({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[ot({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[ot({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Kt))}open=(Rt(this),Lt(this));alert=(St(this),kt(this));label=(Ot(this),Nt(this));dialogTarget=(Gt(this),Ut(this));titleTarget=(jt(this),Vt(this));descriptionTarget=(Bt(this),qt(this));closeEvent=(Ft(this),$t(this));previouslyFocused=(zt(this),null);uid=Ct("rui-dialog");get titleId(){return`${this.uid}-title`}get descriptionId(){return`${this.uid}-desc`}onConnected(){this.syncOpenState()}syncOpenState(){this.dialogTarget&&(this.titleTarget?.textContent?.trim()?(this.titleTarget.id=this.titleId,this.dialogTarget.setAttribute("aria-labelledby",this.titleId),this.dialogTarget.removeAttribute("aria-label")):this.label&&(this.dialogTarget.setAttribute("aria-label",this.label),this.dialogTarget.removeAttribute("aria-labelledby")),this.descriptionTarget?(this.descriptionTarget.id=this.descriptionId,this.dialogTarget.setAttribute("aria-describedby",this.descriptionId)):this.dialogTarget.removeAttribute("aria-describedby"),this.open?(this.previouslyFocused=document.activeElement,queueMicrotask(()=>this.focusInitial())):(this.previouslyFocused?.focus?.(),this.previouslyFocused=null))}focusInitial(){(this.getFocusable()[0]??this.dialogTarget)?.focus()}getFocusable(){return this.dialogTarget?xt(this.dialogTarget):[]}dismiss(e){this.open&&(this.open=!1,this.closeEvent.emit({reason:e}))}onDocumentKeydown(e){if(!this.open)return;if(e.key==="Escape"){e.preventDefault(),this.dismiss("escape");return}if(e.key!=="Tab")return;let i=this.getFocusable();if(!i.length){e.preventDefault(),this.dialogTarget?.focus();return}let o=i[0],u=i[i.length-1],g=document.activeElement;e.shiftKey&&g===o?(e.preventDefault(),u.focus()):!e.shiftKey&&g===u&&(e.preventDefault(),o.focus())}onBackdropClick(){this.dismiss("backdrop")}onCloseClick(){this.dismiss("dismiss")}static{wt()}};import{jsx as f,jsxs as Pt}from"@ecopages/jsx/jsx-runtime";function Zt(t,e){return e===void 0||t?.label!==void 0?t:{...t,label:e}}function C(...t){return t.filter(Boolean).join(" ")}import{jsx as Jt,jsxs as xe}from"@ecopages/jsx/jsx-runtime";var Qt="http://www.w3.org/2000/svg";function at({class:t,size:e="sm",...i}){return xe("svg",{...i,class:C("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[Jt("path",{d:"m18 6-12 12"}),Jt("path",{d:"m6 6 12 12"})]})}function Wt(){let t=document.createElementNS(Qt,"svg");t.setAttribute("class","rui-icon"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true");for(let e of["m18 6-12 12","m6 6 12 12"]){let i=document.createElementNS(Qt,"path");i.setAttribute("d",e),t.append(i)}return t}function te({children:t,class:e,...i}){return f("div",{...i,"data-dialog-title":!0,"data-ref":"title",class:C("rui-dialog__title",e),children:t})}function ee({children:t,class:e,...i}){return f("div",{...i,"data-dialog-body":!0,"data-ref":"description",class:C("rui-dialog__body",e),children:t})}function ie({children:t,class:e,...i}){return f("div",{...i,class:C("rui-dialog__actions",e),children:t})}function oe({children:t,class:e,aria:i,...o}){return f("button",{...o,aria:Zt(i,"Close"),type:"button","data-dialog-close":!0,"data-ref":"close",class:C("rui-dialog__close",e),children:t??f(at,{})})}function Yt({alert:t,children:e,open:i}){return Pt("div",{"data-ref":"root",class:"rui-dialog",hidden:i?void 0:!0,children:[f("div",{"data-ref":"backdrop",class:"rui-dialog__backdrop"}),f("div",{"data-ref":"dialog",class:"rui-dialog__surface",tabindex:-1,role:t?"alertdialog":"dialog","aria-modal":"true",children:e})]})}function Te({title:t,actions:e,children:i,open:o,alert:u,...g}){return t!=null||e!=null?f("rui-dialog",{...g,open:o,alert:u,children:Pt(Yt,{open:o,alert:u,children:[f(oe,{}),t!=null?f(te,{children:t}):null,i!=null?f(ee,{children:i}):null,e!=null?f(ie,{children:e}):null]})}):f("rui-dialog",{...g,open:o,alert:u,children:f(Yt,{open:o,alert:u,children:i})})}var E="__rui-dialog-host",z="rui-dialog-open",H="rui-dialog-close",K="rui-dialog-toggle",lt="rui-dialog-action";function re(t){return"id"in t&&t.id!=null&&t.id!==""}var N=!1,X=null,G=null,d=null;function ut(t){let e=t.trim();if(!e)return null;let i=document.getElementById(e);return i?.localName==="rui-dialog"?i:null}function Ce(){let t=document.createElement("button");return t.type="button",t.setAttribute("data-dialog-close",""),t.setAttribute("data-ref","close"),t.className="rui-dialog__close",t.setAttribute("aria-label","Close"),t.append(Wt()),t}function Re(t){let e=document.createElement("div");return e.setAttribute("data-dialog-title",""),e.setAttribute("data-ref","title"),e.className="rui-dialog__title",e.textContent=t,e}function we(t){let e=document.createElement("div");e.setAttribute("data-dialog-body",""),e.setAttribute("data-ref","description"),e.className="rui-dialog__body";let i=document.createElement("p");return i.textContent=t,e.append(i),e}function Le(t){let e=document.createElement("div");e.className="rui-dialog__actions";for(let i of t){let o=document.createElement("button");o.type="button",o.className=`rui-button rui-button--${i.variant??"filled"} rui-button--${i.size??"md"}`,o.setAttribute("data-dialog-action",i.value??""),i.closeOnClick===!1&&o.setAttribute("data-dialog-action-close","false"),o.textContent=i.label,e.append(o)}return e}function Se(t){let e=document.createElement("div");e.dataset.ref="root",e.className="rui-dialog";let i=document.createElement("div");i.setAttribute("data-ref","backdrop"),i.className="rui-dialog__backdrop";let o=document.createElement("div");return o.setAttribute("data-ref","dialog"),o.className="rui-dialog__surface",o.tabIndex=-1,o.setAttribute("role",t?"alertdialog":"dialog"),o.setAttribute("aria-modal","true"),e.append(i,o),e}function U(){G?.remove(),G=null}function ke(t){U();let e=document.createElement("rui-dialog");e.id=E,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=Se(e.alert),o=i.querySelector('[data-ref="dialog"]');if(!o)throw new Error("Failed to create the dialog surface.");return o.append(Ce()),t.title&&o.append(Re(t.title)),t.body&&o.append(we(t.body)),t.actions?.length&&o.append(Le(t.actions)),e.append(i),(X??document.body).appendChild(e),G=e,e}function ne(t){if(!(!d||d===t))if(d===E)U();else{let e=ut(d);e&&(e.open=!1)}}function w(t){x();let e=ut(t);e&&(ne(t),e.open=!0,d=t)}function Oe(t){x(),ne(E),ke(t),d=E}function M(t){if(typeof t=="string"){w(t);return}if(re(t)){w(t.id);return}Oe(t)}function L(t){x();let e=t??d;if(e){if(e===E)U();else{let i=ut(e);i&&(i.open=!1)}d===e&&(d=null)}}function ct(t){if(x(),d===t){L(t);return}w(t)}function ae(t){let e=t.detail;if(typeof e=="string"){M(e);return}e&&typeof e=="object"&&M(e)}function le(t){let e=t.detail;L(e?.id)}function se(t){let e=t.detail;e?.id&&ct(e.id)}function ue(t){let e=t.target;if(!e?.closest)return;let i=e.closest("[data-dialog-action]");if(i&&G?.contains(i)){t.preventDefault();let D={value:i.getAttribute("data-dialog-action")||void 0||void 0};G.dispatchEvent(new CustomEvent(lt,{detail:D,bubbles:!0,composed:!0})),i.getAttribute("data-dialog-action-close")!=="false"&&L(E);return}let o=e.closest("[data-dialog-open]");if(o){let g=o.getAttribute("data-dialog-open")?.trim();g&&(t.preventDefault(),w(g));return}let u=e.closest("[data-dialog-close]");if(u){if(u.closest("rui-dialog")?.hasAttribute("open"))return;t.preventDefault(),L()}}function ce(t){let e=t.target?.closest?.("rui-dialog");if(!e)return;let i=e.id||null;i&&d===i&&(i===E&&U(),d=null)}function de(t={}){return N?(t.mount&&(X=t.mount),st):(N=!0,X=t.mount??document.body,document.addEventListener(z,ae),document.addEventListener(H,le),document.addEventListener(K,se),document.addEventListener("click",ue),document.addEventListener("rui-close",ce),st)}function x(){N||de()}function st(){N&&(document.removeEventListener(z,ae),document.removeEventListener(H,le),document.removeEventListener(K,se),document.removeEventListener("click",ue),document.removeEventListener("rui-close",ce),U(),X=null,d=null,N=!1)}function Ne(){return d}function Ge(t){x(),M(t)}function Ue(t){x(),L(t)}function je(t){x(),ct(t)}function Ve(t){x();let e=t?.trim()||void 0;return{open:o=>{if(e){w(e);return}if(o!=null){if(typeof o=="string"){w(o);return}M(o)}},close:o=>{L(o??e)},toggle:o=>{let u=o??e;u&&ct(u)},get openId(){return d}}}export{lt as RUI_DIALOG_ACTION_EVENT,H as RUI_DIALOG_CLOSE_EVENT,E as RUI_DIALOG_HOST_ID,z as RUI_DIALOG_OPEN_EVENT,K as RUI_DIALOG_TOGGLE_EVENT,Te as RuiDialog,ie as RuiDialogActions,ee as RuiDialogBody,oe as RuiDialogClose,Mt as RuiDialogElement,te as RuiDialogTitle,Ue as closeDialog,Ve as createDialogHandle,Ne as getOpenDialogId,de as installDialogs,Ge as openDialog,je as toggleDialog,st as uninstallDialogs};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/ui/dialog/dialog.script.tsx", "../../../../src/lib/focusable-elements.ts", "../../../../src/lib/unique-id.ts", "../../../../src/components/ui/dialog/dialog.tsx", "../../../../src/aria.ts", "../../../../src/lib/cx.ts", "../../../../src/lib/icons/x.tsx", "../../../../src/components/ui/dialog/dialog-types.ts", "../../../../src/components/ui/dialog/dialog-registry.ts"],
4
- "sourcesContent": ["let _initProto, _initClass, _init_open, _init_extra_open, _init_alert, _init_extra_alert, _init_label, _init_extra_label, _init_dialogTarget, _init_extra_dialogTarget, _init_titleTarget, _init_extra_titleTarget, _init_descriptionTarget, _init_extra_descriptionTarget, _init_closeEvent, _init_extra_closeEvent;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { RadiantElement, bindTo, bound, customElement, event, onEvent, onUpdated, prop, query } from \"@ecopages/radiant\";\nimport { queryFocusableCandidates } from \"@/lib/focusable-elements\";\nimport { uniqueId } from \"@/lib/unique-id\";\nlet _RuiDialog;\nclass RuiDialog extends RadiantElement {\n static {\n ({\n e: [_init_open, _init_extra_open, _init_alert, _init_extra_alert, _init_label, _init_extra_label, _init_dialogTarget, _init_extra_dialogTarget, _init_titleTarget, _init_extra_titleTarget, _init_descriptionTarget, _init_extra_descriptionTarget, _init_closeEvent, _init_extra_closeEvent, _initProto],\n c: [_RuiDialog, _initClass]\n } = _applyDecs(this, [customElement(\"rui-dialog\")], [[[prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), bindTo({\n ref: \"root\",\n bool: \"hidden\",\n invert: true\n })], 0, \"open\"], [prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), 0, \"alert\"], [prop({\n type: String,\n defaultValue: \"\"\n }), 0, \"label\"], [query({\n ref: \"dialog\"\n }), 0, \"dialogTarget\"], [query({\n selector: \"[data-dialog-title]\"\n }), 0, \"titleTarget\"], [query({\n selector: \"[data-dialog-body]\"\n }), 0, \"descriptionTarget\"], [event({\n name: \"rui-close\",\n bubbles: true,\n composed: true\n }), 0, \"closeEvent\"], [[bound, onUpdated([\"open\", \"label\"])], 2, \"syncOpenState\"], [onEvent({\n document: true,\n type: \"keydown\"\n }), 2, \"onDocumentKeydown\"], [onEvent({\n ref: \"backdrop\",\n type: \"click\"\n }), 2, \"onBackdropClick\"], [onEvent({\n selector: \"[data-dialog-close]\",\n type: \"click\"\n }), 2, \"onCloseClick\"]], 0, void 0, RadiantElement));\n }\n open = (_initProto(this), _init_open(this));\n alert = (_init_extra_open(this), _init_alert(this));\n label = (_init_extra_alert(this), _init_label(this));\n dialogTarget = (_init_extra_label(this), _init_dialogTarget(this));\n titleTarget = (_init_extra_dialogTarget(this), _init_titleTarget(this));\n descriptionTarget = (_init_extra_titleTarget(this), _init_descriptionTarget(this));\n closeEvent = (_init_extra_descriptionTarget(this), _init_closeEvent(this));\n previouslyFocused = (_init_extra_closeEvent(this), null);\n uid = uniqueId(\"rui-dialog\");\n get titleId() {\n return `${this.uid}-title`;\n }\n get descriptionId() {\n return `${this.uid}-desc`;\n }\n onConnected() {\n this.syncOpenState();\n }\n syncOpenState() {\n if (!this.dialogTarget) {\n return;\n }\n if (this.titleTarget?.textContent?.trim()) {\n this.titleTarget.id = this.titleId;\n this.dialogTarget.setAttribute(\"aria-labelledby\", this.titleId);\n this.dialogTarget.removeAttribute(\"aria-label\");\n } else if (this.label) {\n this.dialogTarget.setAttribute(\"aria-label\", this.label);\n this.dialogTarget.removeAttribute(\"aria-labelledby\");\n }\n if (this.descriptionTarget) {\n this.descriptionTarget.id = this.descriptionId;\n this.dialogTarget.setAttribute(\"aria-describedby\", this.descriptionId);\n } else {\n this.dialogTarget.removeAttribute(\"aria-describedby\");\n }\n if (this.open) {\n this.previouslyFocused = document.activeElement;\n queueMicrotask(() => this.focusInitial());\n } else {\n this.previouslyFocused?.focus?.();\n this.previouslyFocused = null;\n }\n }\n focusInitial() {\n const focusable = this.getFocusable();\n (focusable[0] ?? this.dialogTarget)?.focus();\n }\n getFocusable() {\n return this.dialogTarget ? queryFocusableCandidates(this.dialogTarget) : [];\n }\n dismiss(reason) {\n if (!this.open) {\n return;\n }\n this.open = false;\n this.closeEvent.emit({\n reason\n });\n }\n onDocumentKeydown(event2) {\n if (!this.open) {\n return;\n }\n if (event2.key === \"Escape\") {\n event2.preventDefault();\n this.dismiss(\"escape\");\n return;\n }\n if (event2.key !== \"Tab\") {\n return;\n }\n const focusable = this.getFocusable();\n if (!focusable.length) {\n event2.preventDefault();\n this.dialogTarget.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement;\n if (event2.shiftKey && active === first) {\n event2.preventDefault();\n last.focus();\n } else if (!event2.shiftKey && active === last) {\n event2.preventDefault();\n first.focus();\n }\n }\n onBackdropClick() {\n this.dismiss(\"backdrop\");\n }\n onCloseClick() {\n this.dismiss(\"dismiss\");\n }\n static {\n _initClass();\n }\n}\nexport { _RuiDialog as RuiDialog };", "const FOCUSABLE_CANDIDATE_SELECTOR = \"a[href], button, input, select, textarea, [tabindex]\";\nfunction isFocusableCandidate(element) {\n return !element.hasAttribute(\"disabled\") && element.getAttribute(\"tabindex\") !== \"-1\";\n}\nexport function queryFocusableCandidates(root) {\n return Array.from(root.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR)).filter(isFocusableCandidate);\n}\nexport function queryRovingTabindexItems(root) {\n return Array.from(root.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR)).filter(element => !element.hasAttribute(\"disabled\"));\n}\nexport function findFirstFocusableCandidate(root) {\n return queryFocusableCandidates(root)[0];\n}\nfunction isVisible(element) {\n return element.getClientRects().length > 0 && !element.closest(\"[hidden]\");\n}\nexport function getFocusableElements(root) {\n return queryFocusableCandidates(root).filter(isVisible);\n}", "const CSS_SAFE_ID = /^[A-Za-z][A-Za-z0-9_-]*$/;\nexport function isCssSafeId(value) {\n return CSS_SAFE_ID.test(value);\n}\nfunction cssSafePrefix(prefix) {\n const trimmed = prefix.trim();\n if (isCssSafeId(trimmed)) {\n return trimmed;\n }\n const prefixed = `rui-${trimmed}`;\n if (trimmed && isCssSafeId(prefixed)) {\n return prefixed;\n }\n return \"rui\";\n}\nexport function uniqueId(prefix) {\n const token = typeof crypto.randomUUID === \"function\" ? crypto.randomUUID().replace(/-/g, \"\") : Array.from(crypto.getRandomValues(new Uint8Array(16)), byte => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return `${cssSafePrefix(prefix)}-${token}`;\n}", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { withDefaultAriaLabel } from \"@/aria\";\nimport { cx } from \"@/lib/cx\";\nimport { RuiIconX } from \"@/lib/icons\";\nimport \"./dialog.script\";\nexport function RuiDialogTitle({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n \"data-dialog-title\": true,\n \"data-ref\": \"title\",\n class: cx(\"rui-dialog__title\", className),\n children\n });\n}\nexport function RuiDialogBody({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n \"data-dialog-body\": true,\n \"data-ref\": \"description\",\n class: cx(\"rui-dialog__body\", className),\n children\n });\n}\nexport function RuiDialogActions({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n class: cx(\"rui-dialog__actions\", className),\n children\n });\n}\nexport function RuiDialogClose({\n children,\n class: className,\n aria,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"button\", {\n ...props,\n aria: withDefaultAriaLabel(aria, \"Close\"),\n type: \"button\",\n \"data-dialog-close\": true,\n \"data-ref\": \"close\",\n class: cx(\"rui-dialog__close\", className),\n children: children ?? /* @__PURE__ */jsx(RuiIconX, {})\n });\n}\nfunction DialogShell({\n alert,\n children,\n open\n}) {\n return /* @__PURE__ */jsxs(\"div\", {\n \"data-ref\": \"root\",\n class: \"rui-dialog\",\n hidden: open ? void 0 : true,\n children: [/* @__PURE__ */jsx(\"div\", {\n \"data-ref\": \"backdrop\",\n class: \"rui-dialog__backdrop\"\n }), /* @__PURE__ */jsx(\"div\", {\n \"data-ref\": \"dialog\",\n class: \"rui-dialog__surface\",\n tabindex: -1,\n role: alert ? \"alertdialog\" : \"dialog\",\n \"aria-modal\": \"true\",\n children\n })]\n });\n}\nexport function RuiDialog({\n title,\n actions,\n children,\n open,\n alert,\n ...props\n}) {\n if (title != null || actions != null) {\n return /* @__PURE__ */jsx(\"rui-dialog\", {\n ...props,\n open,\n alert,\n children: /* @__PURE__ */jsxs(DialogShell, {\n open,\n alert,\n children: [/* @__PURE__ */jsx(RuiDialogClose, {}), title != null ? /* @__PURE__ */jsx(RuiDialogTitle, {\n children: title\n }) : null, children != null ? /* @__PURE__ */jsx(RuiDialogBody, {\n children\n }) : null, actions != null ? /* @__PURE__ */jsx(RuiDialogActions, {\n children: actions\n }) : null]\n })\n });\n }\n return /* @__PURE__ */jsx(\"rui-dialog\", {\n ...props,\n open,\n alert,\n children: /* @__PURE__ */jsx(DialogShell, {\n open,\n alert,\n children\n })\n });\n}", "export function withDefaultAriaLabel(aria, fallback) {\n if (fallback === void 0 || aria?.label !== void 0) {\n return aria;\n }\n return {\n ...aria,\n label: fallback\n };\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nexport function RuiIconX({\n class: className,\n size = \"sm\",\n ...props\n}) {\n return /* @__PURE__ */jsxs(\"svg\", {\n ...props,\n class: cx(\"rui-icon\", size === \"md\" && \"rui-icon--md\", className),\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: [/* @__PURE__ */jsx(\"path\", {\n d: \"m18 6-12 12\"\n }), /* @__PURE__ */jsx(\"path\", {\n d: \"m6 6 12 12\"\n })]\n });\n}\nexport function createRuiIconX() {\n const icon = document.createElementNS(SVG_NAMESPACE, \"svg\");\n icon.setAttribute(\"class\", \"rui-icon\");\n icon.setAttribute(\"viewBox\", \"0 0 24 24\");\n icon.setAttribute(\"fill\", \"none\");\n icon.setAttribute(\"stroke\", \"currentColor\");\n icon.setAttribute(\"stroke-width\", \"2\");\n icon.setAttribute(\"stroke-linecap\", \"round\");\n icon.setAttribute(\"stroke-linejoin\", \"round\");\n icon.setAttribute(\"aria-hidden\", \"true\");\n for (const d of [\"m18 6-12 12\", \"m6 6 12 12\"]) {\n const path = document.createElementNS(SVG_NAMESPACE, \"path\");\n path.setAttribute(\"d\", d);\n icon.append(path);\n }\n return icon;\n}", "export const RUI_DIALOG_HOST_ID = \"__rui-dialog-host\";\nexport const RUI_DIALOG_OPEN_EVENT = \"rui-dialog-open\";\nexport const RUI_DIALOG_CLOSE_EVENT = \"rui-dialog-close\";\nexport const RUI_DIALOG_TOGGLE_EVENT = \"rui-dialog-toggle\";\nexport const RUI_DIALOG_ACTION_EVENT = \"rui-dialog-action\";\nexport function isNamedDialogOpen(detail) {\n return \"id\" in detail && detail.id != null && detail.id !== \"\";\n}", "import \"./dialog.script\";\nimport { createRuiIconX } from \"@/lib/icons/x\";\nimport { RUI_DIALOG_ACTION_EVENT, RUI_DIALOG_CLOSE_EVENT, RUI_DIALOG_HOST_ID, RUI_DIALOG_OPEN_EVENT, RUI_DIALOG_TOGGLE_EVENT, isNamedDialogOpen } from \"./dialog-types\";\nlet installed = false;\nlet mountParent = null;\nlet hostDialog = null;\nlet openId = null;\nfunction resolveDialog(id) {\n const trimmed = id.trim();\n if (!trimmed) {\n return null;\n }\n const byId = document.getElementById(trimmed);\n if (byId?.localName === \"rui-dialog\") {\n return byId;\n }\n return null;\n}\nfunction createCloseButton() {\n const close2 = document.createElement(\"button\");\n close2.type = \"button\";\n close2.setAttribute(\"data-dialog-close\", \"\");\n close2.setAttribute(\"data-ref\", \"close\");\n close2.className = \"rui-dialog__close\";\n close2.setAttribute(\"aria-label\", \"Close\");\n close2.append(createRuiIconX());\n return close2;\n}\nfunction createTitle(title) {\n const el = document.createElement(\"div\");\n el.setAttribute(\"data-dialog-title\", \"\");\n el.setAttribute(\"data-ref\", \"title\");\n el.className = \"rui-dialog__title\";\n el.textContent = title;\n return el;\n}\nfunction createBody(body) {\n const el = document.createElement(\"div\");\n el.setAttribute(\"data-dialog-body\", \"\");\n el.setAttribute(\"data-ref\", \"description\");\n el.className = \"rui-dialog__body\";\n const paragraph = document.createElement(\"p\");\n paragraph.textContent = body;\n el.append(paragraph);\n return el;\n}\nfunction createActions(actions) {\n const row = document.createElement(\"div\");\n row.className = \"rui-dialog__actions\";\n for (const action of actions) {\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className = `rui-button rui-button--${action.variant ?? \"filled\"} rui-button--${action.size ?? \"md\"}`;\n button.setAttribute(\"data-dialog-action\", action.value ?? \"\");\n if (action.closeOnClick === false) {\n button.setAttribute(\"data-dialog-action-close\", \"false\");\n }\n button.textContent = action.label;\n row.append(button);\n }\n return row;\n}\nfunction createDialogSurface(alert) {\n const root = document.createElement(\"div\");\n root.dataset.ref = \"root\";\n root.className = \"rui-dialog\";\n const backdrop = document.createElement(\"div\");\n backdrop.setAttribute(\"data-ref\", \"backdrop\");\n backdrop.className = \"rui-dialog__backdrop\";\n const surface = document.createElement(\"div\");\n surface.setAttribute(\"data-ref\", \"dialog\");\n surface.className = \"rui-dialog__surface\";\n surface.tabIndex = -1;\n surface.setAttribute(\"role\", alert ? \"alertdialog\" : \"dialog\");\n surface.setAttribute(\"aria-modal\", \"true\");\n root.append(backdrop, surface);\n return root;\n}\nfunction destroyHostDialog() {\n hostDialog?.remove();\n hostDialog = null;\n}\nfunction mountHostDialog(options) {\n destroyHostDialog();\n const dialog = document.createElement(\"rui-dialog\");\n dialog.id = RUI_DIALOG_HOST_ID;\n dialog.alert = Boolean(options.alert);\n dialog.label = options.label ?? \"\";\n dialog.open = true;\n const shell = createDialogSurface(dialog.alert);\n const surface = shell.querySelector('[data-ref=\"dialog\"]');\n if (!surface) {\n throw new Error(\"Failed to create the dialog surface.\");\n }\n surface.append(createCloseButton());\n if (options.title) {\n surface.append(createTitle(options.title));\n }\n if (options.body) {\n surface.append(createBody(options.body));\n }\n if (options.actions?.length) {\n surface.append(createActions(options.actions));\n }\n dialog.append(shell);\n (mountParent ?? document.body).appendChild(dialog);\n hostDialog = dialog;\n return dialog;\n}\nfunction closeCurrentExcept(nextId) {\n if (!openId || openId === nextId) {\n return;\n }\n if (openId === RUI_DIALOG_HOST_ID) {\n destroyHostDialog();\n } else {\n const dialog = resolveDialog(openId);\n if (dialog) {\n dialog.open = false;\n }\n }\n}\nfunction openNamed(id) {\n ensureInstalled();\n const dialog = resolveDialog(id);\n if (!dialog) {\n return;\n }\n closeCurrentExcept(id);\n dialog.open = true;\n openId = id;\n}\nfunction openHost(options) {\n ensureInstalled();\n closeCurrentExcept(RUI_DIALOG_HOST_ID);\n mountHostDialog(options);\n openId = RUI_DIALOG_HOST_ID;\n}\nfunction open(idOrOptions) {\n if (typeof idOrOptions === \"string\") {\n openNamed(idOrOptions);\n return;\n }\n if (isNamedDialogOpen(idOrOptions)) {\n openNamed(idOrOptions.id);\n return;\n }\n openHost(idOrOptions);\n}\nfunction close(id) {\n ensureInstalled();\n const targetId = id ?? openId;\n if (!targetId) {\n return;\n }\n if (targetId === RUI_DIALOG_HOST_ID) {\n destroyHostDialog();\n } else {\n const dialog = resolveDialog(targetId);\n if (dialog) {\n dialog.open = false;\n }\n }\n if (openId === targetId) {\n openId = null;\n }\n}\nfunction toggle(id) {\n ensureInstalled();\n if (openId === id) {\n close(id);\n return;\n }\n openNamed(id);\n}\nfunction onOpenEvent(event) {\n const detail = event.detail;\n if (typeof detail === \"string\") {\n open(detail);\n return;\n }\n if (detail && typeof detail === \"object\") {\n open(detail);\n }\n}\nfunction onCloseEvent(event) {\n const detail = event.detail;\n close(detail?.id);\n}\nfunction onToggleEvent(event) {\n const detail = event.detail;\n if (detail?.id) {\n toggle(detail.id);\n }\n}\nfunction onDocumentClick(event) {\n const target = event.target;\n if (!target?.closest) {\n return;\n }\n const action = target.closest(\"[data-dialog-action]\");\n if (action && hostDialog?.contains(action)) {\n event.preventDefault();\n const value = action.getAttribute(\"data-dialog-action\") || void 0;\n const detail = {\n value: value || void 0\n };\n hostDialog.dispatchEvent(new CustomEvent(RUI_DIALOG_ACTION_EVENT, {\n detail,\n bubbles: true,\n composed: true\n }));\n if (action.getAttribute(\"data-dialog-action-close\") !== \"false\") {\n close(RUI_DIALOG_HOST_ID);\n }\n return;\n }\n const openTrigger = target.closest(\"[data-dialog-open]\");\n if (openTrigger) {\n const id = openTrigger.getAttribute(\"data-dialog-open\")?.trim();\n if (id) {\n event.preventDefault();\n openNamed(id);\n }\n return;\n }\n const closeTrigger = target.closest(\"[data-dialog-close]\");\n if (closeTrigger) {\n const insideDialog = closeTrigger.closest(\"rui-dialog\");\n if (insideDialog?.hasAttribute(\"open\")) {\n return;\n }\n event.preventDefault();\n close();\n }\n}\nfunction onRuiClose(event) {\n const dialog = event.target?.closest?.(\"rui-dialog\");\n if (!dialog) {\n return;\n }\n const id = dialog.id || null;\n if (id && openId === id) {\n if (id === RUI_DIALOG_HOST_ID) {\n destroyHostDialog();\n }\n openId = null;\n }\n}\nexport function installDialogs(options = {}) {\n if (installed) {\n if (options.mount) {\n mountParent = options.mount;\n }\n return uninstallDialogs;\n }\n installed = true;\n mountParent = options.mount ?? document.body;\n document.addEventListener(RUI_DIALOG_OPEN_EVENT, onOpenEvent);\n document.addEventListener(RUI_DIALOG_CLOSE_EVENT, onCloseEvent);\n document.addEventListener(RUI_DIALOG_TOGGLE_EVENT, onToggleEvent);\n document.addEventListener(\"click\", onDocumentClick);\n document.addEventListener(\"rui-close\", onRuiClose);\n return uninstallDialogs;\n}\nfunction ensureInstalled() {\n if (!installed) {\n installDialogs();\n }\n}\nexport function uninstallDialogs() {\n if (!installed) {\n return;\n }\n document.removeEventListener(RUI_DIALOG_OPEN_EVENT, onOpenEvent);\n document.removeEventListener(RUI_DIALOG_CLOSE_EVENT, onCloseEvent);\n document.removeEventListener(RUI_DIALOG_TOGGLE_EVENT, onToggleEvent);\n document.removeEventListener(\"click\", onDocumentClick);\n document.removeEventListener(\"rui-close\", onRuiClose);\n destroyHostDialog();\n mountParent = null;\n openId = null;\n installed = false;\n}\nexport function getOpenDialogId() {\n return openId;\n}\nexport function openDialog(idOrOptions) {\n ensureInstalled();\n open(idOrOptions);\n}\nexport function closeDialog(id) {\n ensureInstalled();\n close(id);\n}\nexport function toggleDialog(id) {\n ensureInstalled();\n toggle(id);\n}\nexport function createDialogHandle(id) {\n ensureInstalled();\n const boundId = id?.trim() || void 0;\n const handleOpen = idOrOptions => {\n if (boundId) {\n openNamed(boundId);\n return;\n }\n if (idOrOptions == null) {\n return;\n }\n if (typeof idOrOptions === \"string\") {\n openNamed(idOrOptions);\n return;\n }\n open(idOrOptions);\n };\n return {\n open: handleOpen,\n close: closeId => {\n close(closeId ?? boundId);\n },\n toggle: toggleId => {\n const target = toggleId ?? boundId;\n if (target) {\n toggle(target);\n }\n },\n get openId() {\n return openId;\n }\n };\n}"],
5
- "mappings": "AAMA,OAAS,kBAAAA,GAAgB,UAAAC,GAAQ,SAAAC,GAAO,iBAAAC,GAAe,SAAAC,GAAO,WAAAC,GAAS,aAAAC,GAAW,QAAAC,GAAM,SAAAC,OAAa,oBCNrG,IAAMC,GAA+B,uDACrC,SAASC,GAAqBC,EAAS,CACrC,MAAO,CAACA,EAAQ,aAAa,UAAU,GAAKA,EAAQ,aAAa,UAAU,IAAM,IACnF,CACO,SAASC,GAAyBC,EAAM,CAC7C,OAAO,MAAM,KAAKA,EAAK,iBAAiBJ,EAA4B,CAAC,EAAE,OAAOC,EAAoB,CACpG,CCNA,IAAMI,GAAc,2BACb,SAASC,GAAYC,EAAO,CACjC,OAAOF,GAAY,KAAKE,CAAK,CAC/B,CACA,SAASC,GAAcC,EAAQ,CAC7B,IAAMC,EAAUD,EAAO,KAAK,EAC5B,GAAIH,GAAYI,CAAO,EACrB,OAAO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oBc,EAAwBX,EAAY,EACjE,SAAS,oBAAoBY,EAAyBX,EAAa,EACnE,SAAS,oBAAoB,QAASC,EAAe,EACrD,SAAS,oBAAoB,YAAaK,EAAU,EACpD3B,EAAkB,EAClB1B,EAAc,KACdE,EAAS,KACTH,EAAY,GACd,CACO,SAAS4D,IAAkB,CAChC,OAAOzD,CACT,CACO,SAAS0D,GAAWtB,EAAa,CACtCH,EAAgB,EAChBE,EAAKC,CAAW,CAClB,CACO,SAASuB,GAAYzD,EAAI,CAC9B+B,EAAgB,EAChBK,EAAMpC,CAAE,CACV,CACO,SAAS0D,GAAa1D,EAAI,CAC/B+B,EAAgB,EAChBO,GAAOtC,CAAE,CACX,CACO,SAAS2D,GAAmB3D,EAAI,CACrC+B,EAAgB,EAChB,IAAM6B,EAAU5D,GAAI,KAAK,GAAK,OAe9B,MAAO,CACL,KAfiBkC,GAAe,CAChC,GAAI0B,EAAS,CACX9B,EAAU8B,CAAO,EACjB,MACF,CACA,GAAI1B,GAAe,KAGnB,IAAI,OAAOA,GAAgB,SAAU,CACnCJ,EAAUI,CAAW,EACrB,MACF,CACAD,EAAKC,CAAW,EAClB,EAGE,MAAO2B,GAAW,CAChBzB,EAAMyB,GAAWD,CAAO,CAC1B,EACA,OAAQE,GAAY,CAClB,IAAMjB,EAASiB,GAAYF,EACvBf,GACFP,GAAOO,CAAM,CAEjB,EACA,IAAI,QAAS,CACX,OAAO/C,CACT,CACF,CACF",
4
+ "sourcesContent": ["let _initProto, _initClass, _init_open, _init_extra_open, _init_alert, _init_extra_alert, _init_label, _init_extra_label, _init_dialogTarget, _init_extra_dialogTarget, _init_titleTarget, _init_extra_titleTarget, _init_descriptionTarget, _init_extra_descriptionTarget, _init_closeEvent, _init_extra_closeEvent;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { RadiantElement, bindTo, bound, customElement, event, onEvent, onUpdated, prop, query } from \"@ecopages/radiant\";\nimport { queryFocusableCandidates } from \"@/lib/focusable-elements\";\nimport { uniqueId } from \"@/lib/unique-id\";\nlet _RuiDialog;\nclass RuiDialog extends RadiantElement {\n static {\n ({\n e: [_init_open, _init_extra_open, _init_alert, _init_extra_alert, _init_label, _init_extra_label, _init_dialogTarget, _init_extra_dialogTarget, _init_titleTarget, _init_extra_titleTarget, _init_descriptionTarget, _init_extra_descriptionTarget, _init_closeEvent, _init_extra_closeEvent, _initProto],\n c: [_RuiDialog, _initClass]\n } = _applyDecs(this, [customElement(\"rui-dialog\")], [[[prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), bindTo({\n ref: \"root\",\n bool: \"hidden\",\n invert: true\n })], 0, \"open\"], [prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), 0, \"alert\"], [prop({\n type: String,\n defaultValue: \"\"\n }), 0, \"label\"], [query({\n ref: \"dialog\"\n }), 0, \"dialogTarget\"], [query({\n selector: \"[data-dialog-title]\"\n }), 0, \"titleTarget\"], [query({\n selector: \"[data-dialog-body]\"\n }), 0, \"descriptionTarget\"], [event({\n name: \"rui-close\",\n bubbles: true,\n composed: true\n }), 0, \"closeEvent\"], [[bound, onUpdated([\"open\", \"label\"])], 2, \"syncOpenState\"], [onEvent({\n document: true,\n type: \"keydown\"\n }), 2, \"onDocumentKeydown\"], [onEvent({\n ref: \"backdrop\",\n type: \"click\"\n }), 2, \"onBackdropClick\"], [onEvent({\n selector: \"[data-dialog-close]\",\n type: \"click\"\n }), 2, \"onCloseClick\"]], 0, void 0, RadiantElement));\n }\n open = (_initProto(this), _init_open(this));\n alert = (_init_extra_open(this), _init_alert(this));\n label = (_init_extra_alert(this), _init_label(this));\n dialogTarget = (_init_extra_label(this), _init_dialogTarget(this));\n titleTarget = (_init_extra_dialogTarget(this), _init_titleTarget(this));\n descriptionTarget = (_init_extra_titleTarget(this), _init_descriptionTarget(this));\n closeEvent = (_init_extra_descriptionTarget(this), _init_closeEvent(this));\n previouslyFocused = (_init_extra_closeEvent(this), null);\n uid = uniqueId(\"rui-dialog\");\n get titleId() {\n return `${this.uid}-title`;\n }\n get descriptionId() {\n return `${this.uid}-desc`;\n }\n onConnected() {\n this.syncOpenState();\n }\n syncOpenState() {\n if (!this.dialogTarget) {\n return;\n }\n if (this.titleTarget?.textContent?.trim()) {\n this.titleTarget.id = this.titleId;\n this.dialogTarget.setAttribute(\"aria-labelledby\", this.titleId);\n this.dialogTarget.removeAttribute(\"aria-label\");\n } else if (this.label) {\n this.dialogTarget.setAttribute(\"aria-label\", this.label);\n this.dialogTarget.removeAttribute(\"aria-labelledby\");\n }\n if (this.descriptionTarget) {\n this.descriptionTarget.id = this.descriptionId;\n this.dialogTarget.setAttribute(\"aria-describedby\", this.descriptionId);\n } else {\n this.dialogTarget.removeAttribute(\"aria-describedby\");\n }\n if (this.open) {\n this.previouslyFocused = document.activeElement;\n queueMicrotask(() => this.focusInitial());\n } else {\n this.previouslyFocused?.focus?.();\n this.previouslyFocused = null;\n }\n }\n focusInitial() {\n const focusable = this.getFocusable();\n (focusable[0] ?? this.dialogTarget)?.focus();\n }\n getFocusable() {\n return this.dialogTarget ? queryFocusableCandidates(this.dialogTarget) : [];\n }\n dismiss(reason) {\n if (!this.open) {\n return;\n }\n this.open = false;\n this.closeEvent.emit({\n reason\n });\n }\n onDocumentKeydown(event2) {\n if (!this.open) {\n return;\n }\n if (event2.key === \"Escape\") {\n event2.preventDefault();\n this.dismiss(\"escape\");\n return;\n }\n if (event2.key !== \"Tab\") {\n return;\n }\n const focusable = this.getFocusable();\n if (!focusable.length) {\n event2.preventDefault();\n this.dialogTarget?.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement;\n if (event2.shiftKey && active === first) {\n event2.preventDefault();\n last.focus();\n } else if (!event2.shiftKey && active === last) {\n event2.preventDefault();\n first.focus();\n }\n }\n onBackdropClick() {\n this.dismiss(\"backdrop\");\n }\n onCloseClick() {\n this.dismiss(\"dismiss\");\n }\n static {\n _initClass();\n }\n}\nexport { _RuiDialog as RuiDialog };", "const FOCUSABLE_CANDIDATE_SELECTOR = \"a[href], button, input, select, textarea, [tabindex]\";\nfunction isFocusableCandidate(element) {\n return !element.hasAttribute(\"disabled\") && element.getAttribute(\"tabindex\") !== \"-1\";\n}\nexport function queryFocusableCandidates(root) {\n return Array.from(root.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR)).filter(isFocusableCandidate);\n}\nexport function queryRovingTabindexItems(root) {\n return Array.from(root.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR)).filter(element => !element.hasAttribute(\"disabled\"));\n}\nexport function findFirstFocusableCandidate(root) {\n return queryFocusableCandidates(root)[0];\n}\nfunction isVisible(element) {\n return element.getClientRects().length > 0 && !element.closest(\"[hidden]\");\n}\nexport function getFocusableElements(root) {\n return queryFocusableCandidates(root).filter(isVisible);\n}", "const CSS_SAFE_ID = /^[A-Za-z][A-Za-z0-9_-]*$/;\nexport function isCssSafeId(value) {\n return CSS_SAFE_ID.test(value);\n}\nfunction cssSafePrefix(prefix) {\n const trimmed = prefix.trim();\n if (isCssSafeId(trimmed)) {\n return trimmed;\n }\n const prefixed = `rui-${trimmed}`;\n if (trimmed && isCssSafeId(prefixed)) {\n return prefixed;\n }\n return \"rui\";\n}\nexport function uniqueId(prefix) {\n const token = typeof crypto.randomUUID === \"function\" ? crypto.randomUUID().replace(/-/g, \"\") : Array.from(crypto.getRandomValues(new Uint8Array(16)), byte => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return `${cssSafePrefix(prefix)}-${token}`;\n}", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { withDefaultAriaLabel } from \"@/aria\";\nimport { cx } from \"@/lib/cx\";\nimport { RuiIconX } from \"@/lib/icons\";\nimport \"./dialog.script\";\nexport function RuiDialogTitle({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n \"data-dialog-title\": true,\n \"data-ref\": \"title\",\n class: cx(\"rui-dialog__title\", className),\n children\n });\n}\nexport function RuiDialogBody({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n \"data-dialog-body\": true,\n \"data-ref\": \"description\",\n class: cx(\"rui-dialog__body\", className),\n children\n });\n}\nexport function RuiDialogActions({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n class: cx(\"rui-dialog__actions\", className),\n children\n });\n}\nexport function RuiDialogClose({\n children,\n class: className,\n aria,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"button\", {\n ...props,\n aria: withDefaultAriaLabel(aria, \"Close\"),\n type: \"button\",\n \"data-dialog-close\": true,\n \"data-ref\": \"close\",\n class: cx(\"rui-dialog__close\", className),\n children: children ?? /* @__PURE__ */jsx(RuiIconX, {})\n });\n}\nfunction DialogShell({\n alert,\n children,\n open\n}) {\n return /* @__PURE__ */jsxs(\"div\", {\n \"data-ref\": \"root\",\n class: \"rui-dialog\",\n hidden: open ? void 0 : true,\n children: [/* @__PURE__ */jsx(\"div\", {\n \"data-ref\": \"backdrop\",\n class: \"rui-dialog__backdrop\"\n }), /* @__PURE__ */jsx(\"div\", {\n \"data-ref\": \"dialog\",\n class: \"rui-dialog__surface\",\n tabindex: -1,\n role: alert ? \"alertdialog\" : \"dialog\",\n \"aria-modal\": \"true\",\n children\n })]\n });\n}\nexport function RuiDialog({\n title,\n actions,\n children,\n open,\n alert,\n ...props\n}) {\n if (title != null || actions != null) {\n return /* @__PURE__ */jsx(\"rui-dialog\", {\n ...props,\n open,\n alert,\n children: /* @__PURE__ */jsxs(DialogShell, {\n open,\n alert,\n children: [/* @__PURE__ */jsx(RuiDialogClose, {}), title != null ? /* @__PURE__ */jsx(RuiDialogTitle, {\n children: title\n }) : null, children != null ? /* @__PURE__ */jsx(RuiDialogBody, {\n children\n }) : null, actions != null ? /* @__PURE__ */jsx(RuiDialogActions, {\n children: actions\n }) : null]\n })\n });\n }\n return /* @__PURE__ */jsx(\"rui-dialog\", {\n ...props,\n open,\n alert,\n children: /* @__PURE__ */jsx(DialogShell, {\n open,\n alert,\n children\n })\n });\n}", "export function withDefaultAriaLabel(aria, fallback) {\n if (fallback === void 0 || aria?.label !== void 0) {\n return aria;\n }\n return {\n ...aria,\n label: fallback\n };\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nexport function RuiIconX({\n class: className,\n size = \"sm\",\n ...props\n}) {\n return /* @__PURE__ */jsxs(\"svg\", {\n ...props,\n class: cx(\"rui-icon\", size === \"md\" && \"rui-icon--md\", className),\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: [/* @__PURE__ */jsx(\"path\", {\n d: \"m18 6-12 12\"\n }), /* @__PURE__ */jsx(\"path\", {\n d: \"m6 6 12 12\"\n })]\n });\n}\nexport function createRuiIconX() {\n const icon = document.createElementNS(SVG_NAMESPACE, \"svg\");\n icon.setAttribute(\"class\", \"rui-icon\");\n icon.setAttribute(\"viewBox\", \"0 0 24 24\");\n icon.setAttribute(\"fill\", \"none\");\n icon.setAttribute(\"stroke\", \"currentColor\");\n icon.setAttribute(\"stroke-width\", \"2\");\n icon.setAttribute(\"stroke-linecap\", \"round\");\n icon.setAttribute(\"stroke-linejoin\", \"round\");\n icon.setAttribute(\"aria-hidden\", \"true\");\n for (const d of [\"m18 6-12 12\", \"m6 6 12 12\"]) {\n const path = document.createElementNS(SVG_NAMESPACE, \"path\");\n path.setAttribute(\"d\", d);\n icon.append(path);\n }\n return icon;\n}", "export const RUI_DIALOG_HOST_ID = \"__rui-dialog-host\";\nexport const RUI_DIALOG_OPEN_EVENT = \"rui-dialog-open\";\nexport const RUI_DIALOG_CLOSE_EVENT = \"rui-dialog-close\";\nexport const RUI_DIALOG_TOGGLE_EVENT = \"rui-dialog-toggle\";\nexport const RUI_DIALOG_ACTION_EVENT = \"rui-dialog-action\";\nexport function isNamedDialogOpen(detail) {\n return \"id\" in detail && detail.id != null && detail.id !== \"\";\n}", "import \"./dialog.script\";\nimport { createRuiIconX } from \"@/lib/icons/x\";\nimport { RUI_DIALOG_ACTION_EVENT, RUI_DIALOG_CLOSE_EVENT, RUI_DIALOG_HOST_ID, RUI_DIALOG_OPEN_EVENT, RUI_DIALOG_TOGGLE_EVENT, isNamedDialogOpen } from \"./dialog-types\";\nlet installed = false;\nlet mountParent = null;\nlet hostDialog = null;\nlet openId = null;\nfunction resolveDialog(id) {\n const trimmed = id.trim();\n if (!trimmed) {\n return null;\n }\n const byId = document.getElementById(trimmed);\n if (byId?.localName === \"rui-dialog\") {\n return byId;\n }\n return null;\n}\nfunction createCloseButton() {\n const close2 = document.createElement(\"button\");\n close2.type = \"button\";\n close2.setAttribute(\"data-dialog-close\", \"\");\n close2.setAttribute(\"data-ref\", \"close\");\n close2.className = \"rui-dialog__close\";\n close2.setAttribute(\"aria-label\", \"Close\");\n close2.append(createRuiIconX());\n return close2;\n}\nfunction createTitle(title) {\n const el = document.createElement(\"div\");\n el.setAttribute(\"data-dialog-title\", \"\");\n el.setAttribute(\"data-ref\", \"title\");\n el.className = \"rui-dialog__title\";\n el.textContent = title;\n return el;\n}\nfunction createBody(body) {\n const el = document.createElement(\"div\");\n el.setAttribute(\"data-dialog-body\", \"\");\n el.setAttribute(\"data-ref\", \"description\");\n el.className = \"rui-dialog__body\";\n const paragraph = document.createElement(\"p\");\n paragraph.textContent = body;\n el.append(paragraph);\n return el;\n}\nfunction createActions(actions) {\n const row = document.createElement(\"div\");\n row.className = \"rui-dialog__actions\";\n for (const action of actions) {\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className = `rui-button rui-button--${action.variant ?? \"filled\"} rui-button--${action.size ?? \"md\"}`;\n button.setAttribute(\"data-dialog-action\", action.value ?? \"\");\n if (action.closeOnClick === false) {\n button.setAttribute(\"data-dialog-action-close\", \"false\");\n }\n button.textContent = action.label;\n row.append(button);\n }\n return row;\n}\nfunction createDialogSurface(alert) {\n const root = document.createElement(\"div\");\n root.dataset.ref = \"root\";\n root.className = \"rui-dialog\";\n const backdrop = document.createElement(\"div\");\n backdrop.setAttribute(\"data-ref\", \"backdrop\");\n backdrop.className = \"rui-dialog__backdrop\";\n const surface = document.createElement(\"div\");\n surface.setAttribute(\"data-ref\", \"dialog\");\n surface.className = \"rui-dialog__surface\";\n surface.tabIndex = -1;\n surface.setAttribute(\"role\", alert ? \"alertdialog\" : \"dialog\");\n surface.setAttribute(\"aria-modal\", \"true\");\n root.append(backdrop, surface);\n return root;\n}\nfunction destroyHostDialog() {\n hostDialog?.remove();\n hostDialog = null;\n}\nfunction mountHostDialog(options) {\n destroyHostDialog();\n const dialog = document.createElement(\"rui-dialog\");\n dialog.id = RUI_DIALOG_HOST_ID;\n dialog.alert = Boolean(options.alert);\n dialog.label = options.label ?? \"\";\n dialog.open = true;\n const shell = createDialogSurface(dialog.alert);\n const surface = shell.querySelector('[data-ref=\"dialog\"]');\n if (!surface) {\n throw new Error(\"Failed to create the dialog surface.\");\n }\n surface.append(createCloseButton());\n if (options.title) {\n surface.append(createTitle(options.title));\n }\n if (options.body) {\n surface.append(createBody(options.body));\n }\n if (options.actions?.length) {\n surface.append(createActions(options.actions));\n }\n dialog.append(shell);\n (mountParent ?? document.body).appendChild(dialog);\n hostDialog = dialog;\n return dialog;\n}\nfunction closeCurrentExcept(nextId) {\n if (!openId || openId === nextId) {\n return;\n }\n if (openId === RUI_DIALOG_HOST_ID) {\n destroyHostDialog();\n } else {\n const dialog = resolveDialog(openId);\n if (dialog) {\n dialog.open = false;\n }\n }\n}\nfunction openNamed(id) {\n ensureInstalled();\n const dialog = resolveDialog(id);\n if (!dialog) {\n return;\n }\n closeCurrentExcept(id);\n dialog.open = true;\n openId = id;\n}\nfunction openHost(options) {\n ensureInstalled();\n closeCurrentExcept(RUI_DIALOG_HOST_ID);\n mountHostDialog(options);\n openId = RUI_DIALOG_HOST_ID;\n}\nfunction open(idOrOptions) {\n if (typeof idOrOptions === \"string\") {\n openNamed(idOrOptions);\n return;\n }\n if (isNamedDialogOpen(idOrOptions)) {\n openNamed(idOrOptions.id);\n return;\n }\n openHost(idOrOptions);\n}\nfunction close(id) {\n ensureInstalled();\n const targetId = id ?? openId;\n if (!targetId) {\n return;\n }\n if (targetId === RUI_DIALOG_HOST_ID) {\n destroyHostDialog();\n } else {\n const dialog = resolveDialog(targetId);\n if (dialog) {\n dialog.open = false;\n }\n }\n if (openId === targetId) {\n openId = null;\n }\n}\nfunction toggle(id) {\n ensureInstalled();\n if (openId === id) {\n close(id);\n return;\n }\n openNamed(id);\n}\nfunction onOpenEvent(event) {\n const detail = event.detail;\n if (typeof detail === \"string\") {\n open(detail);\n return;\n }\n if (detail && typeof detail === \"object\") {\n open(detail);\n }\n}\nfunction onCloseEvent(event) {\n const detail = event.detail;\n close(detail?.id);\n}\nfunction onToggleEvent(event) {\n const detail = event.detail;\n if (detail?.id) {\n toggle(detail.id);\n }\n}\nfunction onDocumentClick(event) {\n const target = event.target;\n if (!target?.closest) {\n return;\n }\n const action = target.closest(\"[data-dialog-action]\");\n if (action && hostDialog?.contains(action)) {\n event.preventDefault();\n const value = action.getAttribute(\"data-dialog-action\") || void 0;\n const detail = {\n value: value || void 0\n };\n hostDialog.dispatchEvent(new CustomEvent(RUI_DIALOG_ACTION_EVENT, {\n detail,\n bubbles: true,\n composed: true\n }));\n if (action.getAttribute(\"data-dialog-action-close\") !== \"false\") {\n close(RUI_DIALOG_HOST_ID);\n }\n return;\n }\n const openTrigger = target.closest(\"[data-dialog-open]\");\n if (openTrigger) {\n const id = openTrigger.getAttribute(\"data-dialog-open\")?.trim();\n if (id) {\n event.preventDefault();\n openNamed(id);\n }\n return;\n }\n const closeTrigger = target.closest(\"[data-dialog-close]\");\n if (closeTrigger) {\n const insideDialog = closeTrigger.closest(\"rui-dialog\");\n if (insideDialog?.hasAttribute(\"open\")) {\n return;\n }\n event.preventDefault();\n close();\n }\n}\nfunction onRuiClose(event) {\n const dialog = event.target?.closest?.(\"rui-dialog\");\n if (!dialog) {\n return;\n }\n const id = dialog.id || null;\n if (id && openId === id) {\n if (id === RUI_DIALOG_HOST_ID) {\n destroyHostDialog();\n }\n openId = null;\n }\n}\nexport function installDialogs(options = {}) {\n if (installed) {\n if (options.mount) {\n mountParent = options.mount;\n }\n return uninstallDialogs;\n }\n installed = true;\n mountParent = options.mount ?? document.body;\n document.addEventListener(RUI_DIALOG_OPEN_EVENT, onOpenEvent);\n document.addEventListener(RUI_DIALOG_CLOSE_EVENT, onCloseEvent);\n document.addEventListener(RUI_DIALOG_TOGGLE_EVENT, onToggleEvent);\n document.addEventListener(\"click\", onDocumentClick);\n document.addEventListener(\"rui-close\", onRuiClose);\n return uninstallDialogs;\n}\nfunction ensureInstalled() {\n if (!installed) {\n installDialogs();\n }\n}\nexport function uninstallDialogs() {\n if (!installed) {\n return;\n }\n document.removeEventListener(RUI_DIALOG_OPEN_EVENT, onOpenEvent);\n document.removeEventListener(RUI_DIALOG_CLOSE_EVENT, onCloseEvent);\n document.removeEventListener(RUI_DIALOG_TOGGLE_EVENT, onToggleEvent);\n document.removeEventListener(\"click\", onDocumentClick);\n document.removeEventListener(\"rui-close\", onRuiClose);\n destroyHostDialog();\n mountParent = null;\n openId = null;\n installed = false;\n}\nexport function getOpenDialogId() {\n return openId;\n}\nexport function openDialog(idOrOptions) {\n ensureInstalled();\n open(idOrOptions);\n}\nexport function closeDialog(id) {\n ensureInstalled();\n close(id);\n}\nexport function toggleDialog(id) {\n ensureInstalled();\n toggle(id);\n}\nexport function createDialogHandle(id) {\n ensureInstalled();\n const boundId = id?.trim() || void 0;\n const handleOpen = idOrOptions => {\n if (boundId) {\n openNamed(boundId);\n return;\n }\n if (idOrOptions == null) {\n return;\n }\n if (typeof idOrOptions === \"string\") {\n openNamed(idOrOptions);\n return;\n }\n open(idOrOptions);\n };\n return {\n open: handleOpen,\n close: closeId => {\n close(closeId ?? boundId);\n },\n toggle: toggleId => {\n const target = toggleId ?? boundId;\n if (target) {\n toggle(target);\n }\n },\n get openId() {\n return openId;\n }\n };\n}"],
5
+ "mappings": "AAMA,OAAS,kBAAAA,GAAgB,UAAAC,GAAQ,SAAAC,GAAO,iBAAAC,GAAe,SAAAC,GAAO,WAAAC,GAAS,aAAAC,GAAW,QAAAC,GAAM,SAAAC,OAAa,oBCNrG,IAAMC,GAA+B,uDACrC,SAASC,GAAqBC,EAAS,CACrC,MAAO,CAACA,EAAQ,aAAa,UAAU,GAAKA,EAAQ,aAAa,UAAU,IAAM,IACnF,CACO,SAASC,GAAyBC,EAAM,CAC7C,OAAO,MAAM,KAAKA,EAAK,iBAAiBJ,EAA4B,CAAC,EAAE,OAAOC,EAAoB,CACpG,CCNA,IAAMI,GAAc,2BACb,SAASC,GAAYC,EAAO,CACjC,OAAOF,GAAY,KAAKE,CAAK,CAC/B,CACA,SAASC,GAAcC,EAAQ,CAC7B,IAAMC,EAAUD,EAAO,KAAK,EAC5B,GAAIH,GAAYI,CAAO,EACrB,OAAOA,EAET,IAAMC,EAAW,OAAOD,CAAO,GAC/B,OAAIA,GAAWJ,GAAYK,CAAQ,EAC1BA,EAEF,KACT,CACO,SAASC,GAASH,EAAQ,CAC/B,IAAMI,EAAQ,OAAO,OAAO,YAAe,WAAa,OAAO,WAAW,EAAE,QAAQ,KAAM,EAAE,EAAI,MAAM,KAAK,OAAO,gBAAgB,IAAI,WAAW,EAAE,CAAC,EAAGC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B,EAChBE,EAAKC,CAAW,CAClB,CACO,SAASuB,GAAYzD,EAAI,CAC9B+B,EAAgB,EAChBK,EAAMpC,CAAE,CACV,CACO,SAAS0D,GAAa1D,EAAI,CAC/B+B,EAAgB,EAChBO,GAAOtC,CAAE,CACX,CACO,SAAS2D,GAAmB3D,EAAI,CACrC+B,EAAgB,EAChB,IAAM6B,EAAU5D,GAAI,KAAK,GAAK,OAe9B,MAAO,CACL,KAfiBkC,GAAe,CAChC,GAAI0B,EAAS,CACX9B,EAAU8B,CAAO,EACjB,MACF,CACA,GAAI1B,GAAe,KAGnB,IAAI,OAAOA,GAAgB,SAAU,CACnCJ,EAAUI,CAAW,EACrB,MACF,CACAD,EAAKC,CAAW,EAClB,EAGE,MAAO2B,GAAW,CAChBzB,EAAMyB,GAAWD,CAAO,CAC1B,EACA,OAAQE,GAAY,CAClB,IAAMjB,EAASiB,GAAYF,EACvBf,GACFP,GAAOO,CAAM,CAEjB,EACA,IAAI,QAAS,CACX,OAAO/C,CACT,CACF,CACF",
6
6
  "names": ["RadiantElement", "bindTo", "bound", "customElement", "event", "onEvent", "onUpdated", "prop", "query", "FOCUSABLE_CANDIDATE_SELECTOR", "isFocusableCandidate", "element", "queryFocusableCandidates", "root", "CSS_SAFE_ID", "isCssSafeId", "value", "cssSafePrefix", "prefix", "trimmed", "prefixed", "uniqueId", "token", "byte", "_initProto", "_initClass", "_init_open", "_init_extra_open", "_init_alert", "_init_extra_alert", "_init_label", "_init_extra_label", "_init_dialogTarget", "_init_extra_dialogTarget", "_init_titleTarget", "_init_extra_titleTarget", "_init_descriptionTarget", "_init_extra_descriptionTarget", "_init_closeEvent", "_init_extra_closeEvent", "_applyDecs", "e", "t", "n", "r", "o", "i", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "b", "applyDec", "w", "D", "S", "j", "E", "I", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "_RuiDialog", "RuiDialog", "RadiantElement", "customElement", "prop", "bindTo", "query", "event", "bound", "onUpdated", "onEvent", "uniqueId", "queryFocusableCandidates", "reason", "event2", "focusable", "first", "last", "active", "jsx", "jsxs", "withDefaultAriaLabel", "aria", "fallback", "cx", "parts", "jsx", "jsxs", "SVG_NAMESPACE", "RuiIconX", "className", "size", "props", "jsxs", "cx", "jsx", "createRuiIconX", "icon", "d", "path", "RuiDialogTitle", "children", "className", "props", "jsx", "cx", "RuiDialogBody", "RuiDialogActions", "RuiDialogClose", "aria", "withDefaultAriaLabel", "RuiIconX", "DialogShell", "alert", "open", "jsxs", "RuiDialog", "title", "actions", "RUI_DIALOG_HOST_ID", "RUI_DIALOG_OPEN_EVENT", "RUI_DIALOG_CLOSE_EVENT", "RUI_DIALOG_TOGGLE_EVENT", "RUI_DIALOG_ACTION_EVENT", "isNamedDialogOpen", "detail", "installed", "mountParent", "hostDialog", "openId", "resolveDialog", "id", "trimmed", "byId", "createCloseButton", "close2", "createRuiIconX", "createTitle", "title", "el", "createBody", "body", "paragraph", "createActions", "actions", "row", "action", "button", "createDialogSurface", "alert", "root", "backdrop", "surface", "destroyHostDialog", "mountHostDialog", "options", "dialog", "RUI_DIALOG_HOST_ID", "shell", "closeCurrentExcept", "nextId", "openNamed", "ensureInstalled", "openHost", "open", "idOrOptions", "isNamedDialogOpen", "close", "targetId", "toggle", "onOpenEvent", "event", "detail", "onCloseEvent", "onToggleEvent", "onDocumentClick", "target", "RUI_DIALOG_ACTION_EVENT", "openTrigger", "closeTrigger", "onRuiClose", "installDialogs", "uninstallDialogs", "RUI_DIALOG_OPEN_EVENT", "RUI_DIALOG_CLOSE_EVENT", "RUI_DIALOG_TOGGLE_EVENT", "getOpenDialogId", "openDialog", "closeDialog", "toggleDialog", "createDialogHandle", "boundId", "closeId", "toggleId"]
7
7
  }
@@ -1,4 +1,5 @@
1
1
  import type { JsxCustomElementAttributes, JsxElementProps, JsxRenderable } from '@ecopages/jsx';
2
+ import type { NativeButtonProps } from '@/lib/native-element-props';
2
3
  import type { RuiDisclosureGroup as RuiDisclosureGroupElement, RuiDisclosureGroupProps } from './disclosure-group.script';
3
4
  import './disclosure-group.script';
4
5
  import type { RuiDisclosure as RuiDisclosureElement, RuiDisclosureProps } from './disclosure.script';
@@ -14,7 +15,7 @@ export type RuiDisclosureIconProps = JsxElementProps<HTMLSpanElement> & {
14
15
  * @cssclass rui-disclosure__icon--plus - Toggles between `+` and `×`.
15
16
  */
16
17
  export declare function RuiDisclosureIcon({ variant, class: className, children, ...props }: RuiDisclosureIconProps): JsxRenderable;
17
- export type RuiDisclosureTriggerProps = JsxElementProps<HTMLButtonElement> & {
18
+ export type RuiDisclosureTriggerProps = NativeButtonProps & {
18
19
  disabled?: boolean;
19
20
  icon?: JsxRenderable | null;
20
21
  iconPosition?: 'start' | 'end';
@@ -85,7 +85,7 @@ export declare class RuiHoverCard extends RadiantElement {
85
85
  portal: boolean;
86
86
  disabled: boolean;
87
87
  contentLabel: string;
88
- contentTarget: HTMLElement;
88
+ contentTarget: HTMLElement | null;
89
89
  openChangeEvent: EventEmitter<RuiHoverCardOpenChangeDetail>;
90
90
  private readonly contentId;
91
91
  private controller;
@@ -1,5 +1,5 @@
1
- import type { JsxElementProps } from '@ecopages/jsx';
2
- export type RuiInputProps = JsxElementProps<HTMLInputElement> & {
1
+ import type { NativeInputProps } from '@/lib/native-element-props';
2
+ export type RuiInputProps = NativeInputProps & {
3
3
  value?: string;
4
4
  type?: string;
5
5
  placeholder?: string;
@@ -18,6 +18,7 @@ export type RuiInputProps = JsxElementProps<HTMLInputElement> & {
18
18
  *
19
19
  * Pass `mask` to guide entry with an [IMask](https://imask.js.org/guide.html#masked-pattern) pattern.
20
20
  * No custom element — Field owns labeling, `aria-*`, and validation wiring.
21
+ * Native `<input>` attributes (`required`, `autocomplete`, `pattern`, …) are part of the props type.
21
22
  *
22
23
  * @remarks
23
24
  * Sets `data-rui-control` for `RuiField` discovery. Height uses `--size-control-md`