@ecopages/radiant-ui 0.1.0-rc.8 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +9 -1
  2. package/dist/components/ui/autocomplete/autocomplete.css +1 -2
  3. package/dist/components/ui/avatar/avatar.css +10 -8
  4. package/dist/components/ui/avatar/avatar.d.ts +3 -1
  5. package/dist/components/ui/calendar/calendar.css +10 -5
  6. package/dist/components/ui/calendar/calendar.script.d.ts +1 -0
  7. package/dist/components/ui/calendar/index.js +1 -1
  8. package/dist/components/ui/calendar/index.js.map +3 -3
  9. package/dist/components/ui/carousel/carousel-autoplay.d.ts +22 -0
  10. package/dist/components/ui/carousel/carousel-swipe.d.ts +17 -0
  11. package/dist/components/ui/carousel/carousel-window.d.ts +63 -0
  12. package/dist/components/ui/carousel/carousel.css +71 -18
  13. package/dist/components/ui/carousel/carousel.d.ts +1 -1
  14. package/dist/components/ui/carousel/carousel.script.d.ts +49 -21
  15. package/dist/components/ui/carousel/index.js +1 -1
  16. package/dist/components/ui/carousel/index.js.map +4 -4
  17. package/dist/components/ui/checkbox/checkbox.script.d.ts +0 -3
  18. package/dist/components/ui/checkbox/index.js +1 -1
  19. package/dist/components/ui/checkbox/index.js.map +4 -4
  20. package/dist/components/ui/checkbox-group/checkbox-group.d.ts +0 -1
  21. package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +8 -7
  22. package/dist/components/ui/checkbox-group/index.js +1 -1
  23. package/dist/components/ui/checkbox-group/index.js.map +4 -4
  24. package/dist/components/ui/combobox/combobox.css +2 -2
  25. package/dist/components/ui/combobox/combobox.d.ts +1 -2
  26. package/dist/components/ui/combobox/combobox.script.d.ts +13 -6
  27. package/dist/components/ui/combobox/index.js +1 -1
  28. package/dist/components/ui/combobox/index.js.map +4 -4
  29. package/dist/components/ui/cycle-toggle/index.js +1 -1
  30. package/dist/components/ui/cycle-toggle/index.js.map +3 -3
  31. package/dist/components/ui/date-field/date-field.css +13 -17
  32. package/dist/components/ui/date-field/date-field.d.ts +7 -5
  33. package/dist/components/ui/date-field/date-field.script.d.ts +16 -48
  34. package/dist/components/ui/date-field/index.js +1 -1
  35. package/dist/components/ui/date-field/index.js.map +4 -4
  36. package/dist/components/ui/date-input/date-input-segment-dom.d.ts +24 -0
  37. package/dist/components/ui/date-input/date-input.css +50 -0
  38. package/dist/components/ui/date-input/date-input.d.ts +8 -0
  39. package/dist/components/ui/date-input/date-input.script.d.ts +137 -0
  40. package/dist/components/ui/date-input/index.d.ts +2 -0
  41. package/dist/components/ui/date-input/index.js +2 -0
  42. package/dist/components/ui/date-input/index.js.map +7 -0
  43. package/dist/components/ui/date-range-picker/date-range-picker.css +18 -19
  44. package/dist/components/ui/date-range-picker/date-range-picker.d.ts +8 -6
  45. package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +24 -47
  46. package/dist/components/ui/date-range-picker/index.js +1 -1
  47. package/dist/components/ui/date-range-picker/index.js.map +4 -4
  48. package/dist/components/ui/dialog/dialog.css +18 -14
  49. package/dist/components/ui/dialog/dialog.script.d.ts +10 -3
  50. package/dist/components/ui/dialog/index.js +1 -1
  51. package/dist/components/ui/dialog/index.js.map +4 -4
  52. package/dist/components/ui/disclosure/disclosure.css +3 -6
  53. package/dist/components/ui/disclosure/disclosure.d.ts +15 -5
  54. package/dist/components/ui/disclosure/disclosure.script.d.ts +2 -2
  55. package/dist/components/ui/disclosure/index.d.ts +1 -1
  56. package/dist/components/ui/disclosure/index.js +1 -1
  57. package/dist/components/ui/disclosure/index.js.map +4 -4
  58. package/dist/components/ui/field/field.d.ts +1 -1
  59. package/dist/components/ui/field/field.script.d.ts +27 -4
  60. package/dist/components/ui/field/index.js +1 -1
  61. package/dist/components/ui/field/index.js.map +4 -4
  62. package/dist/components/ui/form/control-protocol.d.ts +38 -1
  63. package/dist/components/ui/form/form-context.d.ts +3 -0
  64. package/dist/components/ui/form/form.script.d.ts +7 -0
  65. package/dist/components/ui/form/index.d.ts +2 -1
  66. package/dist/components/ui/form/index.js +1 -1
  67. package/dist/components/ui/form/index.js.map +4 -4
  68. package/dist/components/ui/hover-card/hover-card.css +12 -101
  69. package/dist/components/ui/hover-card/hover-card.script.d.ts +7 -0
  70. package/dist/components/ui/hover-card/index.js +1 -1
  71. package/dist/components/ui/hover-card/index.js.map +4 -4
  72. package/dist/components/ui/input/index.js +1 -1
  73. package/dist/components/ui/input/index.js.map +4 -4
  74. package/dist/components/ui/input/input.css +1 -1
  75. package/dist/components/ui/knob/index.js +1 -1
  76. package/dist/components/ui/knob/index.js.map +3 -3
  77. package/dist/components/ui/knob/knob.css +6 -1
  78. package/dist/components/ui/knob/knob.d.ts +1 -1
  79. package/dist/components/ui/knob/knob.script.d.ts +25 -10
  80. package/dist/components/ui/label/index.js +1 -1
  81. package/dist/components/ui/label/index.js.map +4 -4
  82. package/dist/components/ui/listbox/index.js +1 -1
  83. package/dist/components/ui/listbox/index.js.map +4 -4
  84. package/dist/components/ui/listbox/listbox.d.ts +1 -2
  85. package/dist/components/ui/listbox/listbox.script.d.ts +7 -5
  86. package/dist/components/ui/menu-button/index.js +1 -1
  87. package/dist/components/ui/menu-button/index.js.map +4 -4
  88. package/dist/components/ui/menu-button/menu-button.script.d.ts +1 -1
  89. package/dist/components/ui/menubar/index.js +1 -1
  90. package/dist/components/ui/menubar/index.js.map +4 -4
  91. package/dist/components/ui/meter/index.js +1 -1
  92. package/dist/components/ui/meter/index.js.map +3 -3
  93. package/dist/components/ui/meter/meter.css +27 -2
  94. package/dist/components/ui/meter/meter.script.d.ts +14 -4
  95. package/dist/components/ui/navigation-menu/index.d.ts +1 -1
  96. package/dist/components/ui/navigation-menu/index.js +1 -1
  97. package/dist/components/ui/navigation-menu/index.js.map +4 -4
  98. package/dist/components/ui/navigation-menu/navigation-menu.css +32 -34
  99. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +33 -4
  100. package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +71 -9
  101. package/dist/components/ui/number-field/index.js +1 -1
  102. package/dist/components/ui/number-field/index.js.map +4 -4
  103. package/dist/components/ui/number-field/number-field.css +1 -1
  104. package/dist/components/ui/number-field/number-field.d.ts +1 -1
  105. package/dist/components/ui/number-field/number-field.script.d.ts +7 -9
  106. package/dist/components/ui/pagination/index.d.ts +1 -1
  107. package/dist/components/ui/pagination/index.js +1 -1
  108. package/dist/components/ui/pagination/index.js.map +3 -3
  109. package/dist/components/ui/pagination/pagination.css +50 -13
  110. package/dist/components/ui/pagination/pagination.d.ts +25 -6
  111. package/dist/components/ui/popover/index.js +1 -1
  112. package/dist/components/ui/popover/index.js.map +4 -4
  113. package/dist/components/ui/popover/popover.script.d.ts +5 -0
  114. package/dist/components/ui/radio-group/index.js +1 -1
  115. package/dist/components/ui/radio-group/index.js.map +4 -4
  116. package/dist/components/ui/radio-group/radio-group.script.d.ts +2 -1
  117. package/dist/components/ui/select/index.d.ts +1 -1
  118. package/dist/components/ui/select/index.js +1 -1
  119. package/dist/components/ui/select/index.js.map +4 -4
  120. package/dist/components/ui/select/select.css +4 -3
  121. package/dist/components/ui/select/select.d.ts +7 -5
  122. package/dist/components/ui/select/select.script.d.ts +32 -12
  123. package/dist/components/ui/shared/calendar-popover-behavior.d.ts +27 -0
  124. package/dist/components/ui/shared/listbox-host-controller.d.ts +5 -4
  125. package/dist/components/ui/shared/multi-value.d.ts +18 -8
  126. package/dist/components/ui/shared/numeric-range.d.ts +8 -0
  127. package/dist/components/ui/shared/popover.css +10 -99
  128. package/dist/components/ui/sidebar/index.d.ts +2 -1
  129. package/dist/components/ui/sidebar/index.js +1 -1
  130. package/dist/components/ui/sidebar/index.js.map +4 -4
  131. package/dist/components/ui/sidebar/sidebar-trigger.d.ts +12 -0
  132. package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +42 -29
  133. package/dist/components/ui/sidebar/sidebar.css +67 -61
  134. package/dist/components/ui/sidebar/sidebar.d.ts +1 -7
  135. package/dist/components/ui/sidebar/sidebar.script.d.ts +12 -7
  136. package/dist/components/ui/slider/index.js +1 -1
  137. package/dist/components/ui/slider/index.js.map +4 -4
  138. package/dist/components/ui/slider/slider.css +5 -5
  139. package/dist/components/ui/slider/slider.d.ts +5 -6
  140. package/dist/components/ui/slider/slider.script.d.ts +72 -29
  141. package/dist/components/ui/switch/index.js +1 -1
  142. package/dist/components/ui/switch/index.js.map +4 -4
  143. package/dist/components/ui/switch/switch.css +28 -22
  144. package/dist/components/ui/switch/switch.script.d.ts +10 -3
  145. package/dist/components/ui/table/index.js +1 -1
  146. package/dist/components/ui/table/index.js.map +4 -4
  147. package/dist/components/ui/table/table.d.ts +5 -3
  148. package/dist/components/ui/table/table.script.d.ts +25 -10
  149. package/dist/components/ui/tabs/tabs.css +18 -12
  150. package/dist/components/ui/tabs/tabs.script.d.ts +7 -0
  151. package/dist/components/ui/tag-group/index.js +1 -1
  152. package/dist/components/ui/tag-group/index.js.map +4 -4
  153. package/dist/components/ui/tag-group/tag-group.d.ts +7 -4
  154. package/dist/components/ui/tag-group/tag-group.script.d.ts +7 -5
  155. package/dist/components/ui/textarea/index.js +1 -1
  156. package/dist/components/ui/textarea/index.js.map +4 -4
  157. package/dist/components/ui/textarea/textarea.css +1 -1
  158. package/dist/components/ui/toast/index.js +1 -1
  159. package/dist/components/ui/toast/index.js.map +3 -3
  160. package/dist/components/ui/toast/toast.css +35 -32
  161. package/dist/components/ui/toast/toast.script.d.ts +2 -1
  162. package/dist/components/ui/toast/toaster.script.d.ts +6 -0
  163. package/dist/components/ui/tooltip/index.js +1 -1
  164. package/dist/components/ui/tooltip/index.js.map +4 -4
  165. package/dist/components/ui/tooltip/tooltip.css +14 -94
  166. package/dist/components/ui/tooltip/tooltip.script.d.ts +9 -1
  167. package/dist/components/ui/window-splitter/index.d.ts +1 -1
  168. package/dist/components/ui/window-splitter/index.js +1 -1
  169. package/dist/components/ui/window-splitter/index.js.map +3 -3
  170. package/dist/components/ui/window-splitter/window-splitter.d.ts +1 -1
  171. package/dist/components/ui/window-splitter/window-splitter.script.d.ts +5 -1
  172. package/dist/index.d.ts +1 -0
  173. package/dist/index.js +1 -1
  174. package/dist/index.js.map +4 -4
  175. package/dist/lib/icons/chevron-down.d.ts +0 -1
  176. package/dist/lib/intl-date/index.d.ts +4 -2
  177. package/dist/lib/intl-date/segment-editing.d.ts +34 -0
  178. package/dist/lib/intl-date/segments.d.ts +26 -4
  179. package/dist/lib/non-empty.d.ts +6 -0
  180. package/dist/lib/unique-id.d.ts +11 -0
  181. package/dist/lib/viewport/breakpoints.d.ts +6 -0
  182. package/dist/lib/viewport/mobile-layout.d.ts +15 -0
  183. package/dist/styles/primitives.css +10 -7
  184. package/dist/styles/radiant-ui-core.css +10 -0
  185. package/dist/styles/radiant-ui.css +40 -3
  186. package/dist/styles/style-dependencies.json +18 -6
  187. package/dist/styles/styles.css +456 -246
  188. package/dist/styles/tailwind.css +40 -93
  189. package/dist/styles/tokens/presets/colors/aurora.css +2 -0
  190. package/dist/styles/tokens/presets/colors/basalt.css +2 -0
  191. package/dist/styles/tokens/presets/colors/ember.css +2 -0
  192. package/dist/styles/tokens/presets/colors/glacier.css +2 -0
  193. package/dist/styles/tokens/semantic.css +1 -0
  194. package/dist/styles/tokens/system.css +11 -3
  195. package/dist/styles/tokens/typography/default.css +8 -0
  196. package/package.json +20 -10
@@ -1,7 +1,12 @@
1
1
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  rui-dialog {
4
- --dialog-offset-x: 16px;
4
+ --rui-dialog-max-width: 28rem;
5
+ --rui-dialog-padding: var(--space-inset);
6
+ --rui-dialog-radius: var(--radius-container);
7
+ --rui-dialog-surface: var(--background);
8
+ --rui-dialog-shadow: var(--shadow-modal);
9
+ --rui-dialog-inset-x: 1rem;
5
10
  display: contents;
6
11
  }
7
12
  @layer components {
@@ -25,15 +30,14 @@ rui-dialog {
25
30
  position: relative;
26
31
  z-index: var(--z-index-modal, var(--z-modal));
27
32
  width: 100%;
28
- max-width: var(--container-md, 28rem);
29
- border-radius: var(--radius-container, var(--radius-container));
30
- background-color: var(--color-background, var(--background));
31
- padding: var(--spacing-inset, var(--space-inset));
32
33
  color: var(--color-on-background, var(--on-background));
33
- --tw-shadow: var(--shadow-modal);
34
- box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
35
34
  --tw-outline-style: none;
36
35
  outline-style: none;
36
+ max-inline-size: var(--rui-dialog-max-width);
37
+ padding: var(--rui-dialog-padding);
38
+ border-radius: var(--rui-dialog-radius);
39
+ background-color: var(--rui-dialog-surface);
40
+ box-shadow: var(--rui-dialog-shadow);
37
41
  }
38
42
  .rui-dialog__close {
39
43
  position: absolute;
@@ -85,9 +89,14 @@ rui-dialog {
85
89
  }
86
90
  @media (max-width: 600px) {
87
91
  .rui-dialog {
88
- padding-inline: var(--dialog-offset-x);
92
+ padding-inline: var(--rui-dialog-inset-x);
89
93
  }
90
94
  }
95
+ @property --tw-border-style {
96
+ syntax: "*";
97
+ inherits: false;
98
+ initial-value: solid;
99
+ }
91
100
  @property --tw-shadow {
92
101
  syntax: "*";
93
102
  inherits: false;
@@ -153,11 +162,6 @@ rui-dialog {
153
162
  inherits: false;
154
163
  initial-value: 0 0 #0000;
155
164
  }
156
- @property --tw-border-style {
157
- syntax: "*";
158
- inherits: false;
159
- initial-value: solid;
160
- }
161
165
  @property --tw-font-weight {
162
166
  syntax: "*";
163
167
  inherits: false;
@@ -165,6 +169,7 @@ rui-dialog {
165
169
  @layer properties {
166
170
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
167
171
  *, ::before, ::after, ::backdrop {
172
+ --tw-border-style: solid;
168
173
  --tw-shadow: 0 0 #0000;
169
174
  --tw-shadow-color: initial;
170
175
  --tw-shadow-alpha: 100%;
@@ -179,7 +184,6 @@ rui-dialog {
179
184
  --tw-ring-offset-width: 0px;
180
185
  --tw-ring-offset-color: #fff;
181
186
  --tw-ring-offset-shadow: 0 0 #0000;
182
- --tw-border-style: solid;
183
187
  --tw-font-weight: initial;
184
188
  }
185
189
  }
@@ -52,6 +52,13 @@ export type RuiDialogCloseDetail = {
52
52
  * @attr {string} label - Accessible name when there is no visible title.
53
53
  * @fires rui-close - Emitted when the dialog is dismissed; `detail.reason` is `escape`, `backdrop`, or `dismiss`.
54
54
  *
55
+ * @cssprop --rui-dialog-max-width - Surface max inline size. Default: `28rem`.
56
+ * @cssprop --rui-dialog-padding - Surface padding. Default: `--space-inset`.
57
+ * @cssprop --rui-dialog-radius - Surface corner radius. Default: `--radius-container`.
58
+ * @cssprop --rui-dialog-surface - Surface fill. Default: `--background`.
59
+ * @cssprop --rui-dialog-shadow - Surface shadow. Default: `--shadow-modal`.
60
+ * @cssprop --rui-dialog-inset-x - Viewport inline inset below 600px. Default: `1rem`.
61
+ *
55
62
  * @remarks
56
63
  * Minimum tree: `[data-ref="root"]` > backdrop + `[data-ref="dialog"]` with optional title, body, and close.
57
64
  * BEM classes live on the view `DialogShell` and helpers; the host never queries them.
@@ -60,14 +67,14 @@ export declare class RuiDialog extends RadiantElement {
60
67
  open: boolean;
61
68
  alert: boolean;
62
69
  label: string;
63
- rootTarget: HTMLElement;
64
70
  dialogTarget: HTMLElement;
65
71
  titleTarget: HTMLElement;
66
72
  descriptionTarget: HTMLElement;
67
73
  closeEvent: EventEmitter<RuiDialogCloseDetail>;
68
74
  private previouslyFocused;
69
- private titleId;
70
- private descriptionId;
75
+ private readonly uid;
76
+ private get titleId();
77
+ private get descriptionId();
71
78
  protected onConnected(): void;
72
79
  syncOpenState(): void;
73
80
  private focusInitial;
@@ -1,2 +1,2 @@
1
- import{RadiantElement as Mt,bound as _e,customElement as ve,event as Ee,onEvent as rt,onUpdated as ye,prop as nt,query as K}from"@ecopages/radiant";var fe="a[href], button, input, select, textarea, [tabindex]";function ge(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function Tt(t){return Array.from(t.querySelectorAll(fe)).filter(ge)}var xt,Ct,Rt,wt,Lt,Ot,kt,St,Nt,Gt,jt,Ut,Vt,Bt,Ft,qt,Ht,Kt;function pe(t,e,i,o,u,g){var D,l,Q,W,U,Y,O,dt=Symbol.metadata||Symbol.for("Symbol.metadata"),ft=Object.defineProperty,Z=Object.create,gt=[Z(null),Z(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,_,x,b,v,E,ht){function P(c){if(!ht(c))throw new TypeError("Attempted to access private element on non-instance")}var tt=[].concat(h[0]),_t=h[3],et=!x,k=a===1,vt=a===3,Et=a===4,B=a===2;function F(c,R,It){return function(H,At){return R&&(At=H,H=r),It&&It(H),s[c].call(H,At)}}if(!et){var s={},it=[],A=vt?"get":Et||k?"set":"value";if(v?(E||k?s={get:Xt(function(){return _t(this)},n,"get"),set:function(c){h[4](this,c)}}:s[A]=_t,E||Xt(s[A],n,B?"":A)):E||(s=Object.getOwnPropertyDescriptor(r,n)),!E&&!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,q=tt.length-1;q>=0;q-=m?2:1){var yt=I(tt[q],"A decorator","be",!0),Dt=m?tt[q-1]:void 0,ot={},S={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,ot)};if(et)l=yt.call(Dt,p,S),ot.v=1,I(l,"class decorators","return")&&(p=l);else if(S.static=b,S.private=v,l=S.access={has:v?ht.bind():function(c){return n in c}},Et||(l.get=v?B?function(c){return P(c),s.value}:F("get",0,P):function(c){return c[n]}),B||vt||(l.set=v?F("set",0,P):function(c,R){c[n]=R}),p=yt.call(Dt,k?{get:s.get,set:s.set}:s[A],S),ot.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"))&&it.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,(E?"field":"method")+" decorators","return")&&(E?it.unshift(p):s[A]=p)}return a<2&&x.push(V(it,b,1),V(_,b,0)),E||et||(v?k?x.splice(-1,0,F("get",b),F("set",b)):x.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=Z(D??null),U=[],Y=function(r){r&&U.push(V(r))},O=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 x=n[2],b=!!n[3],v=16&a;mt(r?t:t.prototype,n,v,b?"#"+x:me(x),_,_<2?[]:r?W=W||[]:Q=Q||[],U,!!r,b,h,r&&b?function(E){return he(E)===t}:u)}}},O(8,0),O(0,0),O(8,1),O(0,1),Y(Q),Y(W),l=U,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 me(t){var e=be(t,"string");return typeof e=="symbol"?e:e+""}function be(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 Xt(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 he(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 zt,$t=class extends Mt{static{({e:[Rt,wt,Lt,Ot,kt,St,Nt,Gt,jt,Ut,Vt,Bt,Ft,qt,Ht,Kt,xt],c:[zt,Ct]}=pe(this,[ve("rui-dialog")],[[nt({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[nt({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[nt({type:String,defaultValue:""}),0,"label"],[K({ref:"root"}),0,"rootTarget"],[K({ref:"dialog"}),0,"dialogTarget"],[K({selector:"[data-dialog-title]"}),0,"titleTarget"],[K({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[Ee({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[_e,ye(["open","label"])],2,"syncOpenState"],[rt({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[rt({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[rt({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Mt))}open=(xt(this),Rt(this));alert=(wt(this),Lt(this));label=(Ot(this),kt(this));rootTarget=(St(this),Nt(this));dialogTarget=(Gt(this),jt(this));titleTarget=(Ut(this),Vt(this));descriptionTarget=(Bt(this),Ft(this));closeEvent=(qt(this),Ht(this));previouslyFocused=(Kt(this),null);titleId=`rui-dialog-title-${Math.random().toString(36).slice(2,9)}`;descriptionId=`rui-dialog-desc-${Math.random().toString(36).slice(2,9)}`;onConnected(){this.syncOpenState()}syncOpenState(){this.rootTarget?.toggleAttribute("hidden",!this.open),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?Tt(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{Ct()}};import{jsx as f,jsxs as Pt}from"@ecopages/jsx/jsx-runtime";function Jt(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 Qt,jsxs as De}from"@ecopages/jsx/jsx-runtime";var Wt="http://www.w3.org/2000/svg";function at({class:t,size:e="sm",...i}){return De("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:[Qt("path",{d:"m18 6-12 12"}),Qt("path",{d:"m6 6 12 12"})]})}function Yt(){let t=document.createElementNS(Wt,"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(Wt,"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:Jt(i,"Close"),type:"button","data-dialog-close":!0,"data-ref":"close",class:C("rui-dialog__close",e),children:t??f(at,{})})}function Zt({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 Ie({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(Zt,{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(Zt,{open:o,alert:u,children:i})})}var y="__rui-dialog-host",X="rui-dialog-open",M="rui-dialog-close",$="rui-dialog-toggle",lt="rui-dialog-action";function re(t){return"id"in t&&t.id!=null&&t.id!==""}var N=!1,z=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 Ae(){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(Yt()),t}function Te(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 xe(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 Ce(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 Re(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 j(){G?.remove(),G=null}function we(t){j();let e=document.createElement("rui-dialog");e.id=y,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=Re(e.alert),o=i.querySelector('[data-ref="dialog"]');if(!o)throw new Error("Failed to create the dialog surface.");return o.append(Ae()),t.title&&o.append(Te(t.title)),t.body&&o.append(xe(t.body)),t.actions?.length&&o.append(Ce(t.actions)),e.append(i),(z??document.body).appendChild(e),G=e,e}function ne(t){if(!(!d||d===t))if(d===y)j();else{let e=ut(d);e&&(e.open=!1)}}function w(t){T();let e=ut(t);e&&(ne(t),e.open=!0,d=t)}function Le(t){T(),ne(y),we(t),d=y}function J(t){if(typeof t=="string"){w(t);return}if(re(t)){w(t.id);return}Le(t)}function L(t){T();let e=t??d;if(e){if(e===y)j();else{let i=ut(e);i&&(i.open=!1)}d===e&&(d=null)}}function ct(t){if(T(),d===t){L(t);return}w(t)}function ae(t){let e=t.detail;if(typeof e=="string"){J(e);return}e&&typeof e=="object"&&J(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(y);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===y&&j(),d=null)}function de(t={}){return N?(t.mount&&(z=t.mount),st):(N=!0,z=t.mount??document.body,document.addEventListener(X,ae),document.addEventListener(M,le),document.addEventListener($,se),document.addEventListener("click",ue),document.addEventListener("rui-close",ce),st)}function T(){N||de()}function st(){N&&(document.removeEventListener(X,ae),document.removeEventListener(M,le),document.removeEventListener($,se),document.removeEventListener("click",ue),document.removeEventListener("rui-close",ce),j(),z=null,d=null,N=!1)}function Oe(){return d}function ke(t){T(),J(t)}function Se(t){T(),L(t)}function Ne(t){T(),ct(t)}function Ge(t){T();let e=t?.trim()||void 0;return{open:o=>{if(e){w(e);return}if(o!=null){if(typeof o=="string"){w(o);return}J(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,M as RUI_DIALOG_CLOSE_EVENT,y as RUI_DIALOG_HOST_ID,X as RUI_DIALOG_OPEN_EVENT,$ as RUI_DIALOG_TOGGLE_EVENT,Ie as RuiDialog,ie as RuiDialogActions,ee as RuiDialogBody,oe as RuiDialogClose,zt as RuiDialogElement,te as RuiDialogTitle,Se as closeDialog,Ge as createDialogHandle,Oe as getOpenDialogId,de as installDialogs,ke as openDialog,Ne 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
- "sources": ["../../../../src/components/ui/dialog/dialog.script.tsx", "../../../../src/lib/focusable-elements.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_rootTarget, _init_extra_rootTarget, _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, bound, customElement, event, onEvent, onUpdated, prop, query } from \"@ecopages/radiant\";\nimport { queryFocusableCandidates } from \"@/lib/focusable-elements\";\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_rootTarget, _init_extra_rootTarget, _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 }), 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: \"root\"\n }), 0, \"rootTarget\"], [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 rootTarget = (_init_extra_label(this), _init_rootTarget(this));\n dialogTarget = (_init_extra_rootTarget(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 titleId = `rui-dialog-title-${Math.random().toString(36).slice(2, 9)}`;\n descriptionId = `rui-dialog-desc-${Math.random().toString(36).slice(2, 9)}`;\n onConnected() {\n this.syncOpenState();\n }\n syncOpenState() {\n this.rootTarget?.toggleAttribute(\"hidden\", !this.open);\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}", "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,SAAAC,GAAO,iBAAAC,GAAe,SAAAC,GAAO,WAAAC,GAAS,aAAAC,GAAW,QAAAC,GAAM,SAAAC,MAAa,oBCN7F,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,CDNA,IAAII,GAAYC,GAAYC,GAAYC,GAAkBC,GAAaC,GAAmBC,GAAaC,GAAmBC,GAAkBC,GAAwBC,GAAoBC,GAA0BC,GAAmBC,GAAyBC,GAAyBC,GAA+BC,GAAkBC,GACxU,SAASC,GAAWC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,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
- "names": ["RadiantElement", "bound", "customElement", "event", "onEvent", "onUpdated", "prop", "query", "FOCUSABLE_CANDIDATE_SELECTOR", "isFocusableCandidate", "element", "queryFocusableCandidates", "root", "_initProto", "_initClass", "_init_open", "_init_extra_open", "_init_alert", "_init_extra_alert", "_init_label", "_init_extra_label", "_init_rootTarget", "_init_extra_rootTarget", "_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", "query", "event", "bound", "onUpdated", "onEvent", "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"]
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,OAAOA,EAET,IAAMC,EA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Y,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",
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
  }
@@ -59,14 +59,11 @@ rui-disclosure {
59
59
  color 150ms ease;
60
60
  }
61
61
  .rui-disclosure__icon--chevron {
62
- width: 0;
63
- height: 0;
64
- border-top: 4px solid transparent;
65
- border-bottom: 4px solid transparent;
66
- border-left: 6px solid currentColor;
62
+ width: var(--spacing-4, var(--space-4));
63
+ height: var(--spacing-4, var(--space-4));
67
64
  }
68
65
  .rui-disclosure__trigger[aria-expanded='true'] .rui-disclosure__icon--chevron {
69
- transform: rotate(90deg);
66
+ transform: rotate(180deg);
70
67
  }
71
68
  .rui-disclosure__icon--plus {
72
69
  width: var(--spacing-5, var(--space-5));
@@ -10,13 +10,12 @@ export type RuiDisclosureIconProps = JsxElementProps<HTMLSpanElement> & {
10
10
  * Default disclosure indicator. Override via `RuiDisclosureTrigger` `icon` prop.
11
11
  *
12
12
  * @cssclass rui-disclosure__icon - Indicator wrapper (decorative, `aria-hidden`).
13
- * @cssclass rui-disclosure__icon--chevron - Rotates 90° when the disclosure is open.
13
+ * @cssclass rui-disclosure__icon--chevron - Rotates 180° when the disclosure is open.
14
14
  * @cssclass rui-disclosure__icon--plus - Toggles between `+` and `×`.
15
15
  */
16
- export declare function RuiDisclosureIcon({ variant, class: className, ...props }: RuiDisclosureIconProps): JsxRenderable;
16
+ export declare function RuiDisclosureIcon({ variant, class: className, children, ...props }: RuiDisclosureIconProps): JsxRenderable;
17
17
  export type RuiDisclosureTriggerProps = JsxElementProps<HTMLButtonElement> & {
18
18
  disabled?: boolean;
19
- /** Custom indicator. Pass `null` to hide. Defaults to chevron. */
20
19
  icon?: JsxRenderable | null;
21
20
  iconPosition?: 'start' | 'end';
22
21
  };
@@ -36,9 +35,20 @@ export type RuiDisclosurePanelProps = JsxElementProps<HTMLDivElement>;
36
35
  * @cssclass rui-disclosure__panel-inner - Panel padding wrapper (drives the height animation).
37
36
  */
38
37
  export declare function RuiDisclosurePanel({ children, class: className, ...props }: RuiDisclosurePanelProps): JsxRenderable;
39
- export declare function RuiDisclosure({ trigger, children, ...props }: JsxCustomElementAttributes<RuiDisclosureElement, RuiDisclosureProps & {
38
+ export type RuiDisclosureViewProps = {
40
39
  trigger?: JsxRenderable;
41
- }>): JsxRenderable;
40
+ icon?: JsxRenderable | null;
41
+ iconPosition?: 'start' | 'end';
42
+ };
43
+ /**
44
+ * Importable JSX helper around `<rui-disclosure>`.
45
+ *
46
+ * Renders a show/hide disclosure region. Pass `trigger` to compose a default trigger
47
+ * and panel, or compose with `RuiDisclosureTrigger` and `RuiDisclosurePanel`.
48
+ *
49
+ * @cssclass rui-disclosure - Root wrapper around trigger and panel regions.
50
+ */
51
+ export declare function RuiDisclosure({ trigger, icon, iconPosition, children, ...props }: JsxCustomElementAttributes<RuiDisclosureElement, RuiDisclosureProps & RuiDisclosureViewProps>): JsxRenderable;
42
52
  /**
43
53
  * Accordion group wrapper. Expects `rui-disclosure` children; wraps them in
44
54
  * `[data-ref="root"]`.
@@ -55,10 +55,10 @@ export declare class RuiDisclosure extends RadiantElement {
55
55
  open: boolean;
56
56
  value: string;
57
57
  animated: boolean;
58
- private panelId;
58
+ private readonly panelId;
59
59
  protected onConnected(): void;
60
- private syncAnimated;
61
60
  onTriggerClick(event: Event): void;
62
61
  private toggle;
62
+ private syncPanelRelationship;
63
63
  syncExpanded(): void;
64
64
  }
@@ -1,3 +1,3 @@
1
1
  export { RuiDisclosure as RuiDisclosureElement, type RuiDisclosureProps, type RuiDisclosureToggleDetail, } from './disclosure.script';
2
2
  export { RuiDisclosureGroup as RuiDisclosureGroupElement, type RuiDisclosureGroupProps, } from './disclosure-group.script';
3
- export { RuiDisclosure, RuiDisclosureGroup, RuiDisclosureIcon, RuiDisclosurePanel, RuiDisclosureTrigger, } from './disclosure';
3
+ export { RuiDisclosure, RuiDisclosureGroup, RuiDisclosureIcon, RuiDisclosurePanel, RuiDisclosureTrigger, type RuiDisclosureIconProps, type RuiDisclosurePanelProps, type RuiDisclosureTriggerProps, type RuiDisclosureViewProps, } from './disclosure';
@@ -1,2 +1,2 @@
1
- import{RadiantElement as me,bound as Ue,customElement as Ve,onEvent as Le,onUpdated as $e,prop as oe}from"@ecopages/radiant";var ue,ae,le,ce,de,fe,pe,he;function ke(t,e,n,l,_,w){var d,o,D,S,I,k,R,$=Symbol.metadata||Symbol.for("Symbol.metadata"),J=Object.defineProperty,B=Object.create,Q=[B(null),B(null)],W=e.length;function C(r,h,f){return function(i,s){h&&(s=i,i=t);for(var g=0;g<r.length;g++)s=r[g].apply(i,f?[s]:[]);return f?s:i}}function v(r,h,f,i){if(typeof r!="function"&&(i||r!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(i?"":" or undefined"));return r}function X(r,h,f,i,s,g,x,p,m,y,Z){function G(a){if(!Z(a))throw new TypeError("Attempted to access private element on non-instance")}var K=[].concat(h[0]),H=h[3],U=!x,T=s===1,F=s===3,P=s===4,O=s===2;function q(a,E,te){return function(M,re){return E&&(re=M,M=r),te&&te(M),u[a].call(M,re)}}if(!U){var u={},V=[],b=F?"get":P||T?"set":"value";if(m?(y||T?u={get:ge(function(){return H(this)},i,"get"),set:function(a){h[4](this,a)}}:u[b]=H,y||ge(u[b],i,O?"":b)):y||(u=Object.getOwnPropertyDescriptor(r,i)),!y&&!m){if((o=Q[+p][i])&&(o^s)!==7)throw Error("Decorating two elements with the same name ("+u[b].name+") is not supported yet");Q[+p][i]=s<3?1:s}}for(var c=r,z=K.length-1;z>=0;z-=f?2:1){var N=v(K[z],"A decorator","be",!0),ee=f?K[z-1]:void 0,L={},j={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:d,addInitializer:function(a,E){if(a.v)throw new TypeError("attempted to call addInitializer after decoration was finished");v(E,"An initializer","be",!0),g.push(E)}.bind(null,L)};if(U)o=N.call(ee,c,j),L.v=1,v(o,"class decorators","return")&&(c=o);else if(j.static=p,j.private=m,o=j.access={has:m?Z.bind():function(a){return i in a}},P||(o.get=m?O?function(a){return G(a),u.value}:q("get",0,G):function(a){return a[i]}),O||F||(o.set=m?q("set",0,G):function(a,E){a[i]=E}),c=N.call(ee,T?{get:u.get,set:u.set}:u[b],j),L.v=1,T){if(typeof c=="object"&&c)(o=v(c.get,"accessor.get"))&&(u.get=o),(o=v(c.set,"accessor.set"))&&(u.set=o),(o=v(c.init,"accessor.init"))&&V.unshift(o);else if(c!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else v(c,(y?"field":"method")+" decorators","return")&&(y?V.unshift(c):u[b]=c)}return s<2&&x.push(C(V,p,1),C(g,p,0)),y||U||(m?T?x.splice(-1,0,q("get",p),q("set",p)):x.push(O?u[b]:v.call.bind(u[b])):J(r,i,u)),c}function Y(r){return J(r,$,{configurable:!0,enumerable:!0,value:d})}return w!==void 0&&(d=w[$]),d=B(d??null),I=[],k=function(r){r&&I.push(C(r))},R=function(r,h){for(var f=0;f<n.length;f++){var i=n[f],s=i[1],g=7&s;if((8&s)==r&&!g==h){var x=i[2],p=!!i[3],m=16&s;X(r?t:t.prototype,i,m,p?"#"+x:Be(x),g,g<2?[]:r?S=S||[]:D=D||[],I,!!r,p,h,r&&p?function(y){return Ke(y)===t}:_)}}},R(8,0),R(0,0),R(8,1),R(0,1),k(D),k(S),o=I,W||Y(t),{e:o,get c(){var r=[];return W&&[Y(t=X(t,[e],l,t.name,5,r)),C(r,1)]}}}function Be(t){var e=Ge(t,"string");return typeof e=="symbol"?e:e+""}function Ge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var l=n.call(t,e||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ge(t,e,n){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch{}return t}function Ke(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 ne,ye=class extends me{static{({e:[le,ce,de,fe,pe,he,ue],c:[ne,ae]}=ke(this,[Ve("rui-disclosure")],[[oe({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[oe({type:String,reflect:!0,defaultValue:""}),0,"value"],[oe({type:Boolean,reflect:!0,defaultValue:!1}),0,"animated"],[Le({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[Ue,$e(["open","animated"])],2,"syncExpanded"]],0,void 0,me))}open=(ue(this),le(this));value=(ce(this),de(this));animated=(fe(this),pe(this));panelId=(he(this),`rui-disclosure-${Math.random().toString(36).slice(2,9)}`);onConnected(){this.syncAnimated(),this.syncExpanded()}syncAnimated(){this.toggleAttribute("data-animated",this.animated)}onTriggerClick(e){e.preventDefault(),this.toggle()}toggle(){let e=!this.open;this.open=e,this.dispatchEvent(new CustomEvent("rui-disclosure-toggle",{bubbles:!0,composed:!0,detail:{value:this.value,open:e}}))}syncExpanded(){this.syncAnimated();let e=this.querySelector("[data-disclosure-trigger]"),n=this.querySelector("[data-disclosure-panel]");if(!(!e||!n)){if(e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-controls",this.panelId),n.id=this.panelId,n.dataset.state=this.open?"open":"closed",this.animated){n.toggleAttribute("hidden",!1),n.setAttribute("aria-hidden",String(!this.open));return}n.toggleAttribute("hidden",!this.open),n.removeAttribute("aria-hidden")}}static{ae()}};import{RadiantElement as Re,customElement as He,onEvent as Te,onUpdated as Fe,prop as je}from"@ecopages/radiant";function se(t,e){t.forEach((n,l)=>{let _=l===e?0:-1;n.tabIndex!==_&&(n.tabIndex=_)})}function Je(t,e){if(!t.length)return null;let n=Math.max(0,Math.min(t.length-1,e));return se(t,n),t[n]?.focus(),t[n]??null}function Qe(t,e){return t==="Home"?"first":t==="End"?"last":e==="horizontal"?t==="ArrowRight"?"next":t==="ArrowLeft"?"prev":null:t==="ArrowDown"?"next":t==="ArrowUp"?"prev":null}function ve(t){let{items:e,current:n,key:l,orientation:_="horizontal",wrap:w=!0}=t;if(!e.length||!n)return{handled:!1};let d=e.indexOf(n);if(d<0)return{handled:!1};let o=Qe(l,_);if(!o)return{handled:!1};let D=d;o==="first"?D=0:o==="last"?D=e.length-1:o==="next"?D=w?(d+1)%e.length:Math.min(e.length-1,d+1):D=w?(d-1+e.length)%e.length:Math.max(0,d-1);let S=Je(e,D);return S?{handled:!0,index:D,item:S}:{handled:!1}}var be,_e,we,xe,De,Ee;function We(t,e,n,l,_,w){var d,o,D,S,I,k,R,$=Symbol.metadata||Symbol.for("Symbol.metadata"),J=Object.defineProperty,B=Object.create,Q=[B(null),B(null)],W=e.length;function C(r,h,f){return function(i,s){h&&(s=i,i=t);for(var g=0;g<r.length;g++)s=r[g].apply(i,f?[s]:[]);return f?s:i}}function v(r,h,f,i){if(typeof r!="function"&&(i||r!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(i?"":" or undefined"));return r}function X(r,h,f,i,s,g,x,p,m,y,Z){function G(a){if(!Z(a))throw new TypeError("Attempted to access private element on non-instance")}var K=[].concat(h[0]),H=h[3],U=!x,T=s===1,F=s===3,P=s===4,O=s===2;function q(a,E,te){return function(M,re){return E&&(re=M,M=r),te&&te(M),u[a].call(M,re)}}if(!U){var u={},V=[],b=F?"get":P||T?"set":"value";if(m?(y||T?u={get:Ae(function(){return H(this)},i,"get"),set:function(a){h[4](this,a)}}:u[b]=H,y||Ae(u[b],i,O?"":b)):y||(u=Object.getOwnPropertyDescriptor(r,i)),!y&&!m){if((o=Q[+p][i])&&(o^s)!==7)throw Error("Decorating two elements with the same name ("+u[b].name+") is not supported yet");Q[+p][i]=s<3?1:s}}for(var c=r,z=K.length-1;z>=0;z-=f?2:1){var N=v(K[z],"A decorator","be",!0),ee=f?K[z-1]:void 0,L={},j={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:d,addInitializer:function(a,E){if(a.v)throw new TypeError("attempted to call addInitializer after decoration was finished");v(E,"An initializer","be",!0),g.push(E)}.bind(null,L)};if(U)o=N.call(ee,c,j),L.v=1,v(o,"class decorators","return")&&(c=o);else if(j.static=p,j.private=m,o=j.access={has:m?Z.bind():function(a){return i in a}},P||(o.get=m?O?function(a){return G(a),u.value}:q("get",0,G):function(a){return a[i]}),O||F||(o.set=m?q("set",0,G):function(a,E){a[i]=E}),c=N.call(ee,T?{get:u.get,set:u.set}:u[b],j),L.v=1,T){if(typeof c=="object"&&c)(o=v(c.get,"accessor.get"))&&(u.get=o),(o=v(c.set,"accessor.set"))&&(u.set=o),(o=v(c.init,"accessor.init"))&&V.unshift(o);else if(c!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else v(c,(y?"field":"method")+" decorators","return")&&(y?V.unshift(c):u[b]=c)}return s<2&&x.push(C(V,p,1),C(g,p,0)),y||U||(m?T?x.splice(-1,0,q("get",p),q("set",p)):x.push(O?u[b]:v.call.bind(u[b])):J(r,i,u)),c}function Y(r){return J(r,$,{configurable:!0,enumerable:!0,value:d})}return w!==void 0&&(d=w[$]),d=B(d??null),I=[],k=function(r){r&&I.push(C(r))},R=function(r,h){for(var f=0;f<n.length;f++){var i=n[f],s=i[1],g=7&s;if((8&s)==r&&!g==h){var x=i[2],p=!!i[3],m=16&s;X(r?t:t.prototype,i,m,p?"#"+x:Xe(x),g,g<2?[]:r?S=S||[]:D=D||[],I,!!r,p,h,r&&p?function(y){return Ze(y)===t}:_)}}},R(8,0),R(0,0),R(8,1),R(0,1),k(D),k(S),o=I,W||Y(t),{e:o,get c(){var r=[];return W&&[Y(t=X(t,[e],l,t.name,5,r)),C(r,1)]}}}function Xe(t){var e=Ye(t,"string");return typeof e=="symbol"?e:e+""}function Ye(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var l=n.call(t,e||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ae(t,e,n){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch{}return t}function Ze(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 Ie,Se=class extends Re{static{({e:[we,xe,De,Ee,be],c:[Ie,_e]}=We(this,[He("rui-disclosure-group")],[[je({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[je({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[Fe("animated"),2,"onAnimatedUpdated"],[Te({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[Te({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Re))}constructor(...e){super(...e),Ee(this)}multiple=(be(this),we(this));animated=(xe(this),De(this));onConnected(){this.syncChildrenAnimated(),this.syncTriggers()}getTriggers(){return Array.from(this.querySelectorAll("[data-disclosure-trigger]"))}getDisclosureForTrigger(e){return e.closest("rui-disclosure")}syncTriggers(){let e=this.getTriggers();if(!e.length)return;let n=Math.max(0,e.findIndex(l=>l.tabIndex===0||l===document.activeElement));se(e,n)}syncChildrenAnimated(){for(let e of this.querySelectorAll("rui-disclosure"))e.animated=this.animated}onAnimatedUpdated(){this.syncChildrenAnimated()}onDisclosureToggle(e){if(this.multiple||!e.detail?.open)return;let l=e.target;if(l instanceof ne)for(let _ of this.querySelectorAll("rui-disclosure"))_!==l&&(_.open=!1)}onTriggerKeydown(e){let n=this.getTriggers(),l=e.target.closest("[data-disclosure-trigger]");if(!l)return;if(e.key==="ArrowLeft"||e.key==="ArrowRight"){let w=this.getDisclosureForTrigger(l);if(!w)return;let d=e.key==="ArrowRight";if(w.open===d){e.preventDefault();return}if(e.preventDefault(),w.open=d,d&&!this.multiple)for(let o of this.querySelectorAll("rui-disclosure"))o!==w&&(o.open=!1);return}ve({items:n,current:l,key:e.key,orientation:"vertical",wrap:!0}).handled&&e.preventDefault()}static{_e()}};import{jsx as A,jsxs as Oe}from"@ecopages/jsx/jsx-runtime";function ie(...t){return t.filter(Boolean).join(" ")}function qe({variant:t="chevron",class:e,...n}){return A("span",{...n,class:ie("rui-disclosure__icon",`rui-disclosure__icon--${t}`,e),"data-disclosure-icon":!0,"aria-hidden":"true"})}function ze({children:t,class:e,disabled:n,icon:l,iconPosition:_="start",...w}){let o=l!==null?l??A(qe,{}):null;return Oe("button",{...w,type:"button","data-disclosure-trigger":!0,class:ie("rui-disclosure__trigger",_==="end"&&"rui-disclosure__trigger--icon-end",e),disabled:n,children:[_==="start"?o:null,A("span",{class:"rui-disclosure__label",children:t}),_==="end"?o:null]})}function Me({children:t,class:e,...n}){return A("div",{...n,"data-disclosure-panel":!0,"data-ref":"panel",class:ie("rui-disclosure__panel",e),children:A("div",{class:"rui-disclosure__panel-inner",children:t})})}function Ce({children:t}){return A("div",{class:"rui-disclosure","data-ref":"root",children:t})}function Pe({trigger:t,children:e,...n}){return t!=null?A("rui-disclosure",{...n,children:Oe(Ce,{children:[A(ze,{children:t}),e!=null?A(Me,{children:e}):null]})}):A("rui-disclosure",{...n,children:A(Ce,{children:e})})}function Ne({children:t,...e}){return A("rui-disclosure-group",{...e,children:A("div",{class:"rui-disclosure-group","data-ref":"root",children:t})})}export{Pe as RuiDisclosure,ne as RuiDisclosureElement,Ne as RuiDisclosureGroup,Ie as RuiDisclosureGroupElement,qe as RuiDisclosureIcon,Me as RuiDisclosurePanel,ze as RuiDisclosureTrigger};
1
+ import{RadiantElement as be,bindTo as xe,bound as Qe,customElement as We,onEvent as Ye,onUpdated as He,prop as oe}from"@ecopages/radiant";var Me=/^[A-Za-z][A-Za-z0-9_-]*$/;function ae(t){return Me.test(t)}function $e(t){let e=t.trim();if(ae(e))return e;let n=`rui-${e}`;return e&&ae(n)?n:"rui"}function le(t){let e=typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,""):Array.from(crypto.getRandomValues(new Uint8Array(16)),n=>n.toString(16).padStart(2,"0")).join("");return`${$e(t)}-${e}`}var ce,de,fe,pe,he,ge,me,ye;function Le(t,e,n,u,m,w){var d,o,D,A,j,O,E,Z=Symbol.metadata||Symbol.for("Symbol.metadata"),X=Object.defineProperty,B=Object.create,J=[B(null),B(null)],Q=e.length;function C(r,h,f){return function(i,s){h&&(s=i,i=t);for(var g=0;g<r.length;g++)s=r[g].apply(i,f?[s]:[]);return f?s:i}}function b(r,h,f,i){if(typeof r!="function"&&(i||r!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(i?"":" or undefined"));return r}function W(r,h,f,i,s,g,_,p,y,v,H){function V(l){if(!H(l))throw new TypeError("Attempted to access private element on non-instance")}var G=[].concat(h[0]),F=h[3],K=!_,S=s===1,P=s===3,N=s===4,k=s===2;function U(l,I,re){return function(z,ne){return I&&(ne=z,z=r),re&&re(z),a[l].call(z,ne)}}if(!K){var a={},M=[],x=P?"get":N||S?"set":"value";if(y?(v||S?a={get:ve(function(){return F(this)},i,"get"),set:function(l){h[4](this,l)}}:a[x]=F,v||ve(a[x],i,k?"":x)):v||(a=Object.getOwnPropertyDescriptor(r,i)),!v&&!y){if((o=J[+p][i])&&(o^s)!==7)throw Error("Decorating two elements with the same name ("+a[x].name+") is not supported yet");J[+p][i]=s<3?1:s}}for(var c=r,q=G.length-1;q>=0;q-=f?2:1){var ee=b(G[q],"A decorator","be",!0),te=f?G[q-1]:void 0,$={},T={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:d,addInitializer:function(l,I){if(l.v)throw new TypeError("attempted to call addInitializer after decoration was finished");b(I,"An initializer","be",!0),g.push(I)}.bind(null,$)};if(K)o=ee.call(te,c,T),$.v=1,b(o,"class decorators","return")&&(c=o);else if(T.static=p,T.private=y,o=T.access={has:y?H.bind():function(l){return i in l}},N||(o.get=y?k?function(l){return V(l),a.value}:U("get",0,V):function(l){return l[i]}),k||P||(o.set=y?U("set",0,V):function(l,I){l[i]=I}),c=ee.call(te,S?{get:a.get,set:a.set}:a[x],T),$.v=1,S){if(typeof c=="object"&&c)(o=b(c.get,"accessor.get"))&&(a.get=o),(o=b(c.set,"accessor.set"))&&(a.set=o),(o=b(c.init,"accessor.init"))&&M.unshift(o);else if(c!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else b(c,(v?"field":"method")+" decorators","return")&&(v?M.unshift(c):a[x]=c)}return s<2&&_.push(C(M,p,1),C(g,p,0)),v||K||(y?S?_.splice(-1,0,U("get",p),U("set",p)):_.push(k?a[x]:b.call.bind(a[x])):X(r,i,a)),c}function Y(r){return X(r,Z,{configurable:!0,enumerable:!0,value:d})}return w!==void 0&&(d=w[Z]),d=B(d??null),j=[],O=function(r){r&&j.push(C(r))},E=function(r,h){for(var f=0;f<n.length;f++){var i=n[f],s=i[1],g=7&s;if((8&s)==r&&!g==h){var _=i[2],p=!!i[3],y=16&s;W(r?t:t.prototype,i,y,p?"#"+_:Ze(_),g,g<2?[]:r?A=A||[]:D=D||[],j,!!r,p,h,r&&p?function(v){return Je(v)===t}:m)}}},E(8,0),E(0,0),E(8,1),E(0,1),O(D),O(A),o=j,Q||Y(t),{e:o,get c(){var r=[];return Q&&[Y(t=W(t,[e],u,t.name,5,r)),C(r,1)]}}}function Ze(t){var e=Xe(t,"string");return typeof e=="symbol"?e:e+""}function Xe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var u=n.call(t,e||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ve(t,e,n){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch{}return t}function Je(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 ie,we=class extends be{static{({e:[fe,pe,he,ge,me,ye,ce],c:[ie,de]}=Le(this,[We("rui-disclosure")],[[[oe({type:Boolean,reflect:!0,defaultValue:!1}),xe([{selector:"[data-disclosure-trigger]",attr:"aria-expanded"},{selector:"[data-disclosure-panel]",attr:"data-state",map:e=>e?"open":"closed"}])],0,"open"],[oe({type:String,reflect:!0,defaultValue:""}),0,"value"],[[oe({type:Boolean,reflect:!0,defaultValue:!1}),xe({bool:"data-animated"})],0,"animated"],[Ye({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[Qe,He(["open","animated"])],2,"syncExpanded"]],0,void 0,be))}open=(ce(this),fe(this));value=(pe(this),he(this));animated=(ge(this),me(this));panelId=(ye(this),le("rui-disclosure"));onConnected(){this.syncPanelRelationship(),this.syncExpanded()}onTriggerClick(e){e.preventDefault(),this.toggle()}toggle(){let e=!this.open;this.open=e,this.dispatchEvent(new CustomEvent("rui-disclosure-toggle",{bubbles:!0,composed:!0,detail:{value:this.value,open:e}}))}syncPanelRelationship(){let e=this.querySelector("[data-disclosure-trigger]"),n=this.querySelector("[data-disclosure-panel]");!e||!n||(e.setAttribute("aria-controls",this.panelId),n.id=this.panelId)}syncExpanded(){let e=this.querySelector("[data-disclosure-panel]");if(e){if(this.animated){e.toggleAttribute("hidden",!1),e.setAttribute("aria-hidden",String(!this.open));return}e.toggleAttribute("hidden",!this.open),e.removeAttribute("aria-hidden")}}static{de()}};import{RadiantElement as je,customElement as nt,onEvent as Ce,onUpdated as it,prop as ke}from"@ecopages/radiant";function se(t,e){t.forEach((n,u)=>{let m=u===e?0:-1;n.tabIndex!==m&&(n.tabIndex=m)})}function Fe(t,e){if(!t.length)return null;let n=Math.max(0,Math.min(t.length-1,e));return se(t,n),t[n]?.focus(),t[n]??null}function Pe(t,e){return t==="Home"?"first":t==="End"?"last":e==="horizontal"?t==="ArrowRight"?"next":t==="ArrowLeft"?"prev":null:t==="ArrowDown"?"next":t==="ArrowUp"?"prev":null}function _e(t){let{items:e,current:n,key:u,orientation:m="horizontal",wrap:w=!0}=t;if(!e.length||!n)return{handled:!1};let d=e.indexOf(n);if(d<0)return{handled:!1};let o=Pe(u,m);if(!o)return{handled:!1};let D=d;o==="first"?D=0:o==="last"?D=e.length-1:o==="next"?D=w?(d+1)%e.length:Math.min(e.length-1,d+1):D=w?(d-1+e.length)%e.length:Math.max(0,d-1);let A=Fe(e,D);return A?{handled:!0,index:D,item:A}:{handled:!1}}var De,Re,Ie,Ee,Se,Te;function Ne(t,e,n,u,m,w){var d,o,D,A,j,O,E,Z=Symbol.metadata||Symbol.for("Symbol.metadata"),X=Object.defineProperty,B=Object.create,J=[B(null),B(null)],Q=e.length;function C(r,h,f){return function(i,s){h&&(s=i,i=t);for(var g=0;g<r.length;g++)s=r[g].apply(i,f?[s]:[]);return f?s:i}}function b(r,h,f,i){if(typeof r!="function"&&(i||r!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(i?"":" or undefined"));return r}function W(r,h,f,i,s,g,_,p,y,v,H){function V(l){if(!H(l))throw new TypeError("Attempted to access private element on non-instance")}var G=[].concat(h[0]),F=h[3],K=!_,S=s===1,P=s===3,N=s===4,k=s===2;function U(l,I,re){return function(z,ne){return I&&(ne=z,z=r),re&&re(z),a[l].call(z,ne)}}if(!K){var a={},M=[],x=P?"get":N||S?"set":"value";if(y?(v||S?a={get:Ae(function(){return F(this)},i,"get"),set:function(l){h[4](this,l)}}:a[x]=F,v||Ae(a[x],i,k?"":x)):v||(a=Object.getOwnPropertyDescriptor(r,i)),!v&&!y){if((o=J[+p][i])&&(o^s)!==7)throw Error("Decorating two elements with the same name ("+a[x].name+") is not supported yet");J[+p][i]=s<3?1:s}}for(var c=r,q=G.length-1;q>=0;q-=f?2:1){var ee=b(G[q],"A decorator","be",!0),te=f?G[q-1]:void 0,$={},T={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:d,addInitializer:function(l,I){if(l.v)throw new TypeError("attempted to call addInitializer after decoration was finished");b(I,"An initializer","be",!0),g.push(I)}.bind(null,$)};if(K)o=ee.call(te,c,T),$.v=1,b(o,"class decorators","return")&&(c=o);else if(T.static=p,T.private=y,o=T.access={has:y?H.bind():function(l){return i in l}},N||(o.get=y?k?function(l){return V(l),a.value}:U("get",0,V):function(l){return l[i]}),k||P||(o.set=y?U("set",0,V):function(l,I){l[i]=I}),c=ee.call(te,S?{get:a.get,set:a.set}:a[x],T),$.v=1,S){if(typeof c=="object"&&c)(o=b(c.get,"accessor.get"))&&(a.get=o),(o=b(c.set,"accessor.set"))&&(a.set=o),(o=b(c.init,"accessor.init"))&&M.unshift(o);else if(c!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else b(c,(v?"field":"method")+" decorators","return")&&(v?M.unshift(c):a[x]=c)}return s<2&&_.push(C(M,p,1),C(g,p,0)),v||K||(y?S?_.splice(-1,0,U("get",p),U("set",p)):_.push(k?a[x]:b.call.bind(a[x])):X(r,i,a)),c}function Y(r){return X(r,Z,{configurable:!0,enumerable:!0,value:d})}return w!==void 0&&(d=w[Z]),d=B(d??null),j=[],O=function(r){r&&j.push(C(r))},E=function(r,h){for(var f=0;f<n.length;f++){var i=n[f],s=i[1],g=7&s;if((8&s)==r&&!g==h){var _=i[2],p=!!i[3],y=16&s;W(r?t:t.prototype,i,y,p?"#"+_:et(_),g,g<2?[]:r?A=A||[]:D=D||[],j,!!r,p,h,r&&p?function(v){return rt(v)===t}:m)}}},E(8,0),E(0,0),E(8,1),E(0,1),O(D),O(A),o=j,Q||Y(t),{e:o,get c(){var r=[];return Q&&[Y(t=W(t,[e],u,t.name,5,r)),C(r,1)]}}}function et(t){var e=tt(t,"string");return typeof e=="symbol"?e:e+""}function tt(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var u=n.call(t,e||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ae(t,e,n){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch{}return t}function rt(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 qe,Ue=class extends je{static{({e:[Ie,Ee,Se,Te,De],c:[qe,Re]}=Ne(this,[nt("rui-disclosure-group")],[[ke({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[ke({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[it("animated"),2,"onAnimatedUpdated"],[Ce({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[Ce({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,je))}constructor(...e){super(...e),Te(this)}multiple=(De(this),Ie(this));animated=(Ee(this),Se(this));onConnected(){this.syncChildrenAnimated(),this.syncTriggers()}getTriggers(){return Array.from(this.querySelectorAll("[data-disclosure-trigger]"))}getDisclosureForTrigger(e){return e.closest("rui-disclosure")}syncTriggers(){let e=this.getTriggers();if(!e.length)return;let n=Math.max(0,e.findIndex(u=>u.tabIndex===0||u===document.activeElement));se(e,n)}syncChildrenAnimated(){for(let e of this.querySelectorAll("rui-disclosure"))e.animated=this.animated}onAnimatedUpdated(){this.syncChildrenAnimated()}onDisclosureToggle(e){if(this.multiple||!e.detail?.open)return;let u=e.target;if(u instanceof ie)for(let m of this.querySelectorAll("rui-disclosure"))m!==u&&(m.open=!1)}onTriggerKeydown(e){let n=this.getTriggers(),u=e.target.closest("[data-disclosure-trigger]");if(!u)return;if(e.key==="ArrowLeft"||e.key==="ArrowRight"){let w=this.getDisclosureForTrigger(u);if(!w)return;let d=e.key==="ArrowRight";if(w.open===d){e.preventDefault();return}if(e.preventDefault(),w.open=d,d&&!this.multiple)for(let o of this.querySelectorAll("rui-disclosure"))o!==w&&(o.open=!1);return}_e({items:n,current:u,key:e.key,orientation:"vertical",wrap:!0}).handled&&e.preventDefault()}static{Re()}};import{jsx as R,jsxs as Be}from"@ecopages/jsx/jsx-runtime";function L(...t){return t.filter(Boolean).join(" ")}import{jsx as ze}from"@ecopages/jsx/jsx-runtime";function ue({class:t,size:e="sm",...n}){return ze("svg",{...n,class:L("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:ze("path",{d:"m6 9 6 6 6-6"})})}function Ve({variant:t="chevron",class:e,children:n,...u}){return R("span",{...u,class:L("rui-disclosure__icon",`rui-disclosure__icon--${t}`,e),"data-disclosure-icon":!0,"aria-hidden":"true",children:n??(t==="chevron"?R(ue,{}):null)})}function Ge({children:t,class:e,disabled:n,icon:u,iconPosition:m="start",...w}){let o=u!==null?u??R(Ve,{}):null;return Be("button",{...w,type:"button","data-disclosure-trigger":!0,class:L("rui-disclosure__trigger",m==="end"&&"rui-disclosure__trigger--icon-end",e),disabled:n,children:[m==="start"?o:null,R("span",{class:"rui-disclosure__label",children:t}),m==="end"?o:null]})}function Ke({children:t,class:e,...n}){return R("div",{...n,"data-disclosure-panel":!0,"data-ref":"panel",class:L("rui-disclosure__panel",e),children:R("div",{class:"rui-disclosure__panel-inner",children:t})})}function Oe({children:t}){return R("div",{class:"rui-disclosure","data-ref":"root",children:t})}function ot({trigger:t,icon:e,iconPosition:n,children:u,...m}){return t!=null?R("rui-disclosure",{...m,children:Be(Oe,{children:[R(Ge,{icon:e,iconPosition:n,children:t}),u!=null?R(Ke,{children:u}):null]})}):R("rui-disclosure",{...m,children:R(Oe,{children:u})})}function st({children:t,...e}){return R("rui-disclosure-group",{...e,children:R("div",{class:"rui-disclosure-group","data-ref":"root",children:t})})}export{ot as RuiDisclosure,ie as RuiDisclosureElement,st as RuiDisclosureGroup,qe as RuiDisclosureGroupElement,Ve as RuiDisclosureIcon,Ke as RuiDisclosurePanel,Ge as RuiDisclosureTrigger};
2
2
  //# sourceMappingURL=index.js.map