@nanahoshi/mona-ui 0.1.1 → 0.2.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 (170) hide show
  1. package/auto-complete/package.json +4 -0
  2. package/avatar/package.json +4 -0
  3. package/breadcrumb/package.json +4 -0
  4. package/button/package.json +4 -0
  5. package/button-group/package.json +4 -0
  6. package/calendar/package.json +4 -0
  7. package/check-box/package.json +4 -0
  8. package/chip/package.json +4 -0
  9. package/circular-progress-bar/package.json +4 -0
  10. package/color-gradient/package.json +4 -0
  11. package/color-palette/package.json +4 -0
  12. package/color-picker/package.json +4 -0
  13. package/combo-box/package.json +4 -0
  14. package/common/package.json +4 -0
  15. package/contextmenu/package.json +4 -0
  16. package/date-input/package.json +4 -0
  17. package/date-picker/package.json +4 -0
  18. package/datetime-picker/package.json +4 -0
  19. package/dialog/package.json +4 -0
  20. package/dropdown-button/package.json +4 -0
  21. package/dropdown-list/package.json +4 -0
  22. package/dropdowns/package.json +4 -0
  23. package/editor/package.json +4 -0
  24. package/expansion-panel/package.json +4 -0
  25. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +38 -53
  26. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +19 -53
  27. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +15 -26
  28. package/fesm2022/nanahoshi-mona-ui-button.mjs +67 -68
  29. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +53 -149
  30. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +48 -95
  31. package/fesm2022/nanahoshi-mona-ui-chip.mjs +35 -45
  32. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +9 -23
  33. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +26 -77
  34. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +16 -38
  35. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +41 -46
  36. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +32 -52
  37. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
  38. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +40 -27
  39. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +51 -51
  40. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
  41. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +32 -53
  42. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +7 -12
  43. package/fesm2022/nanahoshi-mona-ui-editor.mjs +59 -219
  44. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +24 -75
  45. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +11 -44
  46. package/fesm2022/nanahoshi-mona-ui-filter.mjs +11 -41
  47. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +2 -2
  48. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
  49. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs → nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs} +9 -16
  50. package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +15 -44
  51. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs} +11 -20
  52. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +109 -393
  53. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  54. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
  55. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +26 -56
  56. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +31 -122
  57. package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
  58. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +4 -26
  59. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +5 -18
  60. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +48 -154
  61. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +35 -62
  62. package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
  63. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +37 -63
  64. package/fesm2022/nanahoshi-mona-ui-pager.mjs +21 -73
  65. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +8 -30
  66. package/fesm2022/nanahoshi-mona-ui-popover.mjs +29 -50
  67. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +36 -108
  68. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +19 -60
  69. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +47 -92
  70. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +53 -144
  71. package/fesm2022/nanahoshi-mona-ui-slider.mjs +54 -110
  72. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +7 -20
  73. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +15 -50
  74. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +28 -91
  75. package/fesm2022/nanahoshi-mona-ui-switch.mjs +37 -58
  76. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
  77. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +22 -30
  78. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +40 -61
  79. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
  80. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +41 -27
  81. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +35 -99
  82. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +13 -41
  83. package/fesm2022/nanahoshi-mona-ui-window.mjs +29 -108
  84. package/fieldset/package.json +4 -0
  85. package/filter/package.json +4 -0
  86. package/grid/package.json +4 -0
  87. package/internal/filter-input/package.json +4 -0
  88. package/internal/indicator-icon/package.json +4 -0
  89. package/internal/list/package.json +4 -0
  90. package/internal/package.json +4 -0
  91. package/internal/tree/package.json +4 -0
  92. package/list/package.json +4 -0
  93. package/list-box/package.json +4 -0
  94. package/list-view/package.json +4 -0
  95. package/menubar/package.json +4 -0
  96. package/multi-select/package.json +4 -0
  97. package/notification/package.json +4 -0
  98. package/numeric-text-box/package.json +4 -0
  99. package/package.json +2 -1
  100. package/pager/package.json +4 -0
  101. package/placeholder/package.json +4 -0
  102. package/popover/package.json +4 -0
  103. package/popup/package.json +4 -0
  104. package/popup-menu/package.json +4 -0
  105. package/progress-bar/package.json +4 -0
  106. package/query/package.json +4 -0
  107. package/radio-button/package.json +4 -0
  108. package/scroll-view/package.json +4 -0
  109. package/slider/package.json +4 -0
  110. package/split-button/package.json +4 -0
  111. package/splitter/package.json +4 -0
  112. package/stepper/package.json +4 -0
  113. package/switch/package.json +4 -0
  114. package/tabs/package.json +4 -0
  115. package/text-area/package.json +4 -0
  116. package/text-box/package.json +4 -0
  117. package/theme/package.json +4 -0
  118. package/time-picker/package.json +4 -0
  119. package/time-selector/package.json +4 -0
  120. package/tooltip/package.json +4 -0
  121. package/tree-view/package.json +4 -0
  122. package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
  123. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
  124. package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
  125. package/types/nanahoshi-mona-ui-button.d.ts +2 -3
  126. package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
  127. package/types/nanahoshi-mona-ui-check-box.d.ts +6 -9
  128. package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
  129. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
  130. package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
  131. package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
  132. package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -5
  133. package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
  134. package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
  135. package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
  136. package/types/nanahoshi-mona-ui-dialog.d.ts +6 -7
  137. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
  138. package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
  139. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
  140. package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
  141. package/types/nanahoshi-mona-ui-filter.d.ts +2 -3
  142. package/types/nanahoshi-mona-ui-grid.d.ts +14 -15
  143. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
  144. package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
  145. package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
  146. package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
  147. package/types/nanahoshi-mona-ui-menubar.d.ts +6 -7
  148. package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
  149. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
  150. package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
  151. package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
  152. package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
  153. package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
  154. package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
  155. package/types/nanahoshi-mona-ui-radio-button.d.ts +8 -11
  156. package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
  157. package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
  158. package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
  159. package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
  160. package/types/nanahoshi-mona-ui-stepper.d.ts +12 -13
  161. package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
  162. package/types/nanahoshi-mona-ui-tabs.d.ts +14 -16
  163. package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
  164. package/types/nanahoshi-mona-ui-text-box.d.ts +4 -6
  165. package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
  166. package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
  167. package/types/nanahoshi-mona-ui-time-selector.d.ts +10 -11
  168. package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
  169. package/types/nanahoshi-mona-ui-window.d.ts +16 -17
  170. package/window/package.json +4 -0
@@ -4,13 +4,12 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { PopupDataInjectionToken, PopupCloseEvent, PopupCloseSource, PopupService } from '@nanahoshi/mona-ui/popup';
5
5
  import { Subject, map, takeUntil, take } from 'rxjs';
6
6
  import { PreventableEvent, AnyPipe } from '@nanahoshi/mona-ui/common';
7
- import { createElementControlId, focusElement, setWindowStyles } from '@nanahoshi/mona-ui/internal';
7
+ import { themeOverlaySurfaceClasses, createElementControlId, focusElement, setWindowStyles } from '@nanahoshi/mona-ui/internal';
8
8
  import * as i1 from '@angular/cdk/a11y';
9
9
  import { CdkTrapFocus } from '@angular/cdk/a11y';
10
10
  import { NgTemplateOutlet } from '@angular/common';
11
11
  import { LucideOctagonAlert, LucideCircleCheckBig, LucideBadgeInfo, LucideOctagonX, LucideBadgeQuestionMark, LucideX, LucideDynamicIcon } from '@lucide/angular';
12
12
  import { ButtonDirective } from '@nanahoshi/mona-ui/button';
13
- import { ThemeService } from '@nanahoshi/mona-ui/theme';
14
13
  import { cva } from 'class-variance-authority';
15
14
 
16
15
  class DialogContentTemplateDirective {
@@ -85,12 +84,10 @@ class DialogActionEvent extends PreventableEvent {
85
84
  }
86
85
  }
87
86
 
88
- const dialogBaseVariants = cva(`
89
- flex flex-col gap-0.5
90
- w-full h-full
91
- bg-background text-foreground
92
- border border-border shadow-sm
93
- outline-none overflow-hidden
87
+ const dialogBaseThemeVariants = cva(`
88
+ flex h-full w-full flex-col gap-0.5 overflow-hidden
89
+ ${themeOverlaySurfaceClasses} text-foreground
90
+ border border-border shadow-(--shadow-overlay) outline-none
94
91
  `, {
95
92
  variants: {
96
93
  rounded: {
@@ -104,12 +101,11 @@ const dialogBaseVariants = cva(`
104
101
  rounded: "medium"
105
102
  }
106
103
  });
107
- const dialogContentContainerVariants = cva(`
108
- flex flex-row gap-1 flex-1
104
+ const dialogContentContainerThemeVariants = cva(`
105
+ flex flex-1 flex-row gap-1
109
106
  `);
110
- const dialogBodyVariants = cva(`
111
- flex flex-col gap-0 pb-2
112
- w-full h-full pr-2
107
+ const dialogBodyThemeVariants = cva(`
108
+ flex h-full w-full flex-col gap-0 pr-2 pb-2
113
109
  `, {
114
110
  variants: {
115
111
  hasIcon: {
@@ -118,18 +114,18 @@ const dialogBodyVariants = cva(`
118
114
  }
119
115
  }
120
116
  });
121
- const dialogHeaderVariants = cva(`
122
- flex flex-row gap-2
123
- pt-4 select-none
117
+ const dialogHeaderThemeVariants = cva(`
118
+ flex flex-row gap-2 pt-4
119
+ select-none
124
120
  `);
125
- const dialogIconContainerVariants = cva(`
121
+ const dialogIconContainerThemeVariants = cva(`
126
122
  flex items-start justify-center pt-8 pr-4 pl-6
127
123
  `);
128
- const dialogIconVariants = cva(`
129
- rounded-full w-fit h-fit p-1.5 border relative
124
+ const dialogIconThemeVariants = cva(`
125
+ relative h-fit w-fit rounded-full border p-1.5
130
126
  [&>span]:absolute [&>span]:flex [&>span]:rounded-full
131
127
  [&>span]:-top-3 [&>span]:-right-3 [&>span]:-bottom-3 [&>span]:-left-3
132
- [&>span]:border [&>span]:min-w-full [&>span]:min-h-full
128
+ [&>span]:min-h-full [&>span]:min-w-full [&>span]:border
133
129
  `, {
134
130
  variants: {
135
131
  type: {
@@ -144,27 +140,29 @@ const dialogIconVariants = cva(`
144
140
  type: "info"
145
141
  }
146
142
  });
147
- const dialogTitleContainerVariants = cva(`
148
- flex flex-1 items-center justify-start select-none p-1
143
+ const dialogTitleContainerThemeVariants = cva(`
144
+ flex flex-1 items-center justify-start p-1
145
+ select-none
149
146
  `);
150
- const dialogCloseButtonContainerVariants = cva(`
147
+ const dialogCloseButtonContainerThemeVariants = cva(`
151
148
  flex items-start justify-end
152
149
  `);
153
- const dialogTitleVariants = cva(`
150
+ const dialogTitleThemeVariants = cva(`
154
151
  text-lg font-semibold leading-none tracking-tight
155
152
  `);
156
- const dialogDescriptionVariants = cva(`
153
+ const dialogDescriptionThemeVariants = cva(`
157
154
  text-sm text-muted-foreground
158
155
  select-none
159
156
  `);
160
- const dialogContentVariants = cva(`
157
+ const dialogContentThemeVariants = cva(`
161
158
  flex-1 overflow-auto p-1
159
+ [scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
162
160
  `);
163
- const dialogFooterVariants = cva(`
164
- flex flex-row
165
- gap-2 px-4 py-2
166
- border-t border-border
161
+ const dialogFooterThemeVariants = cva(`
162
+ flex flex-row gap-2 px-4 py-2
167
163
  select-none
164
+ bg-surface-muted
165
+ border-t border-border-subtle
168
166
  `, {
169
167
  variants: {
170
168
  layout: {
@@ -185,108 +183,10 @@ const dialogFooterVariants = cva(`
185
183
  }
186
184
  });
187
185
 
188
- const dialogBaseThemeVariants = (theme) => {
189
- switch (theme) {
190
- case "mona":
191
- return dialogBaseVariants;
192
- default:
193
- return dialogBaseVariants;
194
- }
195
- };
196
- const dialogIconThemeVariants = (theme) => {
197
- switch (theme) {
198
- case "mona":
199
- return dialogIconVariants;
200
- default:
201
- return dialogIconVariants;
202
- }
203
- };
204
- const dialogBodyThemeVariants = (theme) => {
205
- switch (theme) {
206
- case "mona":
207
- return dialogBodyVariants;
208
- default:
209
- return dialogBodyVariants;
210
- }
211
- };
212
- const dialogContentContainerThemeVariants = (theme) => {
213
- switch (theme) {
214
- case "mona":
215
- return dialogContentContainerVariants;
216
- default:
217
- return dialogContentContainerVariants;
218
- }
219
- };
220
- const dialogHeaderThemeVariants = (theme) => {
221
- switch (theme) {
222
- case "mona":
223
- return dialogHeaderVariants;
224
- default:
225
- return dialogHeaderVariants;
226
- }
227
- };
228
- const dialogIconContainerThemeVariants = (theme) => {
229
- switch (theme) {
230
- case "mona":
231
- return dialogIconContainerVariants;
232
- default:
233
- return dialogIconContainerVariants;
234
- }
235
- };
236
- const dialogTitleContainerThemeVariants = (theme) => {
237
- switch (theme) {
238
- case "mona":
239
- return dialogTitleContainerVariants;
240
- default:
241
- return dialogTitleContainerVariants;
242
- }
243
- };
244
- const dialogCloseButtonContainerThemeVariants = (theme) => {
245
- switch (theme) {
246
- case "mona":
247
- return dialogCloseButtonContainerVariants;
248
- default:
249
- return dialogCloseButtonContainerVariants;
250
- }
251
- };
252
- const dialogTitleThemeVariants = (theme) => {
253
- switch (theme) {
254
- case "mona":
255
- return dialogTitleVariants;
256
- default:
257
- return dialogTitleVariants;
258
- }
259
- };
260
- const dialogDescriptionThemeVariants = (theme) => {
261
- switch (theme) {
262
- case "mona":
263
- return dialogDescriptionVariants;
264
- default:
265
- return dialogDescriptionVariants;
266
- }
267
- };
268
- const dialogContentThemeVariants = (theme) => {
269
- switch (theme) {
270
- case "mona":
271
- return dialogContentVariants;
272
- default:
273
- return dialogContentVariants;
274
- }
275
- };
276
- const dialogFooterThemeVariants = (theme) => {
277
- switch (theme) {
278
- case "mona":
279
- return dialogFooterVariants;
280
- default:
281
- return dialogFooterVariants;
282
- }
283
- };
284
-
285
186
  class DialogContentComponent {
286
187
  #hostElementRef;
287
188
  #iconMap;
288
189
  #injectedData;
289
- #themeService;
290
190
  #trapFocus;
291
191
  constructor() {
292
192
  this.#hostElementRef = inject(ElementRef);
@@ -298,33 +198,27 @@ class DialogContentComponent {
298
198
  warning: { color: "var(--color-warning)", icon: LucideOctagonAlert }
299
199
  };
300
200
  this.#injectedData = inject(PopupDataInjectionToken);
301
- this.#themeService = inject(ThemeService);
302
201
  this.#trapFocus = inject(CdkTrapFocus);
303
202
  this.baseClass = computed(() => {
304
- const theme = this.#themeService.theme();
305
203
  const rounded = this.dialogData().rounded;
306
- return dialogBaseThemeVariants(theme)({ rounded });
204
+ return dialogBaseThemeVariants({ rounded });
307
205
  }, /* @ts-ignore */
308
206
  ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
309
207
  this.bodyClass = computed(() => {
310
- const theme = this.#themeService.theme();
311
208
  const hasIcon = this.dialogData().type != null;
312
- return dialogBodyThemeVariants(theme)({ hasIcon });
209
+ return dialogBodyThemeVariants({ hasIcon });
313
210
  }, /* @ts-ignore */
314
211
  ...(ngDevMode ? [{ debugName: "bodyClass" }] : /* istanbul ignore next */ []));
315
212
  this.closeButtonContainerClass = computed(() => {
316
- const theme = this.#themeService.theme();
317
- return dialogCloseButtonContainerThemeVariants(theme)();
213
+ return dialogCloseButtonContainerThemeVariants();
318
214
  }, /* @ts-ignore */
319
215
  ...(ngDevMode ? [{ debugName: "closeButtonContainerClass" }] : /* istanbul ignore next */ []));
320
216
  this.contentClass = computed(() => {
321
- const theme = this.#themeService.theme();
322
- return dialogContentThemeVariants(theme)();
217
+ return dialogContentThemeVariants();
323
218
  }, /* @ts-ignore */
324
219
  ...(ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []));
325
220
  this.contentContainerClass = computed(() => {
326
- const theme = this.#themeService.theme();
327
- return dialogContentContainerThemeVariants(theme)();
221
+ return dialogContentContainerThemeVariants();
328
222
  }, /* @ts-ignore */
329
223
  ...(ngDevMode ? [{ debugName: "contentContainerClass" }] : /* istanbul ignore next */ []));
330
224
  this.describedById = computed(() => {
@@ -333,8 +227,7 @@ class DialogContentComponent {
333
227
  }, /* @ts-ignore */
334
228
  ...(ngDevMode ? [{ debugName: "describedById" }] : /* istanbul ignore next */ []));
335
229
  this.descriptionClass = computed(() => {
336
- const theme = this.#themeService.theme();
337
- return dialogDescriptionThemeVariants(theme)();
230
+ return dialogDescriptionThemeVariants();
338
231
  }, /* @ts-ignore */
339
232
  ...(ngDevMode ? [{ debugName: "descriptionClass" }] : /* istanbul ignore next */ []));
340
233
  this.descriptionId = createElementControlId();
@@ -342,15 +235,13 @@ class DialogContentComponent {
342
235
  ...(ngDevMode ? [{ debugName: "dialogData" }] : /* istanbul ignore next */ []));
343
236
  this.dialogReference = this.#injectedData.dialogReference;
344
237
  this.footerClass = computed(() => {
345
- const theme = this.#themeService.theme();
346
238
  const layout = this.dialogData().actionsLayout;
347
239
  const rounded = this.dialogData().rounded;
348
- return dialogFooterThemeVariants(theme)({ layout, rounded });
240
+ return dialogFooterThemeVariants({ layout, rounded });
349
241
  }, /* @ts-ignore */
350
242
  ...(ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []));
351
243
  this.headerClass = computed(() => {
352
- const theme = this.#themeService.theme();
353
- return dialogHeaderThemeVariants(theme)();
244
+ return dialogHeaderThemeVariants();
354
245
  }, /* @ts-ignore */
355
246
  ...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
356
247
  this.headerId = createElementControlId();
@@ -360,14 +251,12 @@ class DialogContentComponent {
360
251
  }, /* @ts-ignore */
361
252
  ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
362
253
  this.iconClass = computed(() => {
363
- const theme = this.#themeService.theme();
364
254
  const type = this.dialogData().type;
365
- return dialogIconThemeVariants(theme)({ type });
255
+ return dialogIconThemeVariants({ type });
366
256
  }, /* @ts-ignore */
367
257
  ...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
368
258
  this.iconContainerClass = computed(() => {
369
- const theme = this.#themeService.theme();
370
- return dialogIconContainerThemeVariants(theme)();
259
+ return dialogIconContainerThemeVariants();
371
260
  }, /* @ts-ignore */
372
261
  ...(ngDevMode ? [{ debugName: "iconContainerClass" }] : /* istanbul ignore next */ []));
373
262
  this.role = computed(() => {
@@ -376,13 +265,11 @@ class DialogContentComponent {
376
265
  }, /* @ts-ignore */
377
266
  ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
378
267
  this.titleClass = computed(() => {
379
- const theme = this.#themeService.theme();
380
- return dialogTitleThemeVariants(theme)();
268
+ return dialogTitleThemeVariants();
381
269
  }, /* @ts-ignore */
382
270
  ...(ngDevMode ? [{ debugName: "titleClass" }] : /* istanbul ignore next */ []));
383
271
  this.titleContainerClass = computed(() => {
384
- const theme = this.#themeService.theme();
385
- return dialogTitleContainerThemeVariants(theme)();
272
+ return dialogTitleContainerThemeVariants();
386
273
  }, /* @ts-ignore */
387
274
  ...(ngDevMode ? [{ debugName: "titleContainerClass" }] : /* istanbul ignore next */ []));
388
275
  this.#trapFocus.autoCapture = true;
@@ -4,10 +4,9 @@ import { Directive, inject, DestroyRef, ElementRef, linkedSignal, computed, cont
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import * as i1 from '@nanahoshi/mona-ui/dropdowns';
6
6
  import { DropdownListService, DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DropdownPopupInputToken, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
7
- import { createElementControlId, isTypeaheadKey, setupTypeahead } from '@nanahoshi/mona-ui/internal';
7
+ import { themeControlSurfaceClasses, createElementControlId, isTypeaheadKey, setupTypeahead } from '@nanahoshi/mona-ui/internal';
8
8
  import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
9
9
  import { ListService, ListComponent, ListItemTemplateDirective, ListGroupHeaderTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
10
- import { ThemeService } from '@nanahoshi/mona-ui/theme';
11
10
  import { Subject } from 'rxjs';
12
11
  import { twMerge } from 'tailwind-merge';
13
12
  import { cva } from 'class-variance-authority';
@@ -23,32 +22,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
23
22
  }]
24
23
  }] });
25
24
 
26
- const dropdownListInputVariants = cva(`
25
+ const dropdownListInputThemeVariants = cva(`
27
26
  inline-flex items-center
28
-
29
- border border-input-border
30
- bg-background outline-none
31
- text-foreground shadow-xs
32
27
  cursor-pointer select-none
33
-
34
- hover:bg-accent hover:text-accent-foreground
35
- transition-[color,box-shadow,border] ease-in-out duration-300
36
- focus-within:ring-1 focus-within:ring-primary/40
28
+ ${themeControlSurfaceClasses} text-foreground
29
+ border border-input-border shadow-(--shadow-control) outline-none
30
+ transition-[color,box-shadow,border] duration-(--mona-motion-standard) ease-in-out
31
+ data-[readonly='true']:cursor-default
32
+ hover:bg-hover active:bg-active
33
+ focus-within:border-focus-indicator focus-within:ring-2 focus-within:ring-focus-indicator/35
37
34
  `, {
38
35
  variants: {
39
36
  disabled: {
40
- true: "pointer-events-none cursor-not-allowed opacity-50",
37
+ true: `
38
+ pointer-events-none cursor-not-allowed
39
+ bg-disabled-background text-disabled-foreground
40
+ border-disabled-border shadow-none
41
+ `,
41
42
  false: ""
42
43
  },
43
44
  expanded: {
44
- true: "ring-1 ring-primary/40",
45
+ true: "border-focus-indicator ring-2 ring-focus-indicator/35",
45
46
  false: ""
46
47
  },
47
48
  hasPrefix: {
48
49
  false: "ps-2"
49
50
  },
50
51
  invalid: {
51
- true: "border-error ring-1 ring-error/40",
52
+ true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
52
53
  false: ""
53
54
  },
54
55
  rounded: {
@@ -63,41 +64,23 @@ const dropdownListInputVariants = cva(`
63
64
  medium: "h-9 text-sm",
64
65
  small: "h-8 text-xs"
65
66
  }
66
- }
67
+ },
68
+ compoundVariants: [
69
+ {
70
+ expanded: true,
71
+ invalid: true,
72
+ class: "border-error ring-error/35"
73
+ }
74
+ ]
67
75
  });
68
- const dropdownListValueContainerVariants = cva(`overflow-hidden h-full w-full flex items-center`, {
76
+ const dropdownListValueContainerThemeVariants = cva(`flex h-full w-full items-center overflow-hidden`, {
69
77
  variants: {
70
78
  hasTemplate: {
71
79
  false: "[&>span]:truncate [&>span]:items-center [&>span]:inline-block"
72
80
  }
73
81
  }
74
82
  });
75
- const dropdownListAffixContainerVariants = cva(`h-full flex flex-none items-center justify-center`);
76
-
77
- const dropdownListAffixContainerThemeVariants = (theme) => {
78
- switch (theme) {
79
- case "mona":
80
- return dropdownListAffixContainerVariants;
81
- default:
82
- return dropdownListAffixContainerVariants;
83
- }
84
- };
85
- const dropdownListInputThemeVariants = (theme) => {
86
- switch (theme) {
87
- case "mona":
88
- return dropdownListInputVariants;
89
- default:
90
- return dropdownListInputVariants;
91
- }
92
- };
93
- const dropdownListValueContainerThemeVariants = (theme) => {
94
- switch (theme) {
95
- case "mona":
96
- return dropdownListValueContainerVariants;
97
- default:
98
- return dropdownListValueContainerVariants;
99
- }
100
- };
83
+ const dropdownListAffixContainerThemeVariants = cva(`flex h-full flex-none items-center justify-center`);
101
84
 
102
85
  class DropdownListComponent {
103
86
  #destroyRef;
@@ -106,7 +89,6 @@ class DropdownListComponent {
106
89
  #hostElementRef;
107
90
  #navigatedValue;
108
91
  #listService;
109
- #themeService;
110
92
  #typeaheadKey;
111
93
  constructor() {
112
94
  this.#destroyRef = inject(DestroyRef);
@@ -116,7 +98,6 @@ class DropdownListComponent {
116
98
  this.#navigatedValue = linkedSignal(() => this.value(), /* @ts-ignore */
117
99
  ...(ngDevMode ? [{ debugName: "#navigatedValue" }] : /* istanbul ignore next */ []));
118
100
  this.#listService = inject(ListService);
119
- this.#themeService = inject(ThemeService);
120
101
  this.#typeaheadKey = new Subject();
121
102
  this.activeDescendant = computed(() => {
122
103
  const highlightedItem = this.#listService.highlightedItem();
@@ -124,19 +105,17 @@ class DropdownListComponent {
124
105
  }, /* @ts-ignore */
125
106
  ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
126
107
  this.affixClass = computed(() => {
127
- const theme = this.#themeService.theme();
128
- return dropdownListAffixContainerThemeVariants(theme)();
108
+ return dropdownListAffixContainerThemeVariants();
129
109
  }, /* @ts-ignore */
130
110
  ...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
131
111
  this.baseClass = computed(() => {
132
- const theme = this.#themeService.theme();
133
112
  const disabled = this.disabled();
134
113
  const expanded = this.expanded();
135
114
  const hasPrefix = this.prefixTemplate() != null;
136
115
  const invalid = this.invalidState();
137
116
  const rounded = this.rounded();
138
117
  const size = this.size();
139
- const classes = dropdownListInputThemeVariants(theme)({
118
+ const classes = dropdownListInputThemeVariants({
140
119
  disabled,
141
120
  expanded,
142
121
  hasPrefix,
@@ -162,11 +141,10 @@ class DropdownListComponent {
162
141
  ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
163
142
  this.listId = createElementControlId();
164
143
  this.listPopupClass = computed(() => {
165
- const theme = this.#themeService.theme();
166
144
  const rounded = this.rounded();
167
145
  const size = this.size();
168
146
  const userClass = this.popupClass();
169
- const variantClass = dropdownPopupThemeVariants(theme)({ rounded, size });
147
+ const variantClass = dropdownPopupThemeVariants({ rounded, size });
170
148
  return twMerge(variantClass, userClass);
171
149
  }, /* @ts-ignore */
172
150
  ...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
@@ -188,9 +166,8 @@ class DropdownListComponent {
188
166
  }, /* @ts-ignore */
189
167
  ...(ngDevMode ? [{ debugName: "selectedListItem" }] : /* istanbul ignore next */ []));
190
168
  this.valueContainerClass = computed(() => {
191
- const theme = this.#themeService.theme();
192
169
  const hasTemplate = this.valueTemplate() != null;
193
- return dropdownListValueContainerThemeVariants(theme)({ hasTemplate });
170
+ return dropdownListValueContainerThemeVariants({ hasTemplate });
194
171
  }, /* @ts-ignore */
195
172
  ...(ngDevMode ? [{ debugName: "valueContainerClass" }] : /* istanbul ignore next */ []));
196
173
  this.valueTemplate = contentChild(DropdownListValueTemplateDirective, { ...(ngDevMode ? { debugName: "valueTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
@@ -537,7 +514,7 @@ class DropdownListComponent {
537
514
  }
538
515
  }
539
516
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
540
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DropdownListComponent, isStandalone: true, selector: "mona-dropdown-list", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, popupClass: { classPropertyName: "popupClass", publicName: "popupClass", isSignal: true, isRequired: false, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: false, transformFunction: null }, popupWidth: { classPropertyName: "popupWidth", publicName: "popupWidth", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "effectiveAriaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy()", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.data-invalid": "invalidState() || null", "attr.role": "'combobox'", "attr.tabindex": "disabled() ? null : 0", "class": "baseClass()" } }, providers: [
517
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DropdownListComponent, isStandalone: true, selector: "mona-dropdown-list", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, popupClass: { classPropertyName: "popupClass", publicName: "popupClass", isSignal: true, isRequired: false, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: false, transformFunction: null }, popupWidth: { classPropertyName: "popupWidth", publicName: "popupWidth", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "effectiveAriaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy()", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "attr.role": "'combobox'", "attr.tabindex": "disabled() ? null : 0", "class": "baseClass()" } }, providers: [
541
518
  ListService,
542
519
  DropdownService,
543
520
  DropdownListService,
@@ -591,7 +568,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
591
568
  "[attr.aria-labelledby]": "ariaLabelledBy()",
592
569
  "[attr.aria-readonly]": "readonly() ? true : undefined",
593
570
  "[attr.aria-required]": "required() ? true : undefined",
571
+ "[attr.data-disabled]": "disabled() || null",
594
572
  "[attr.data-invalid]": "invalidState() || null",
573
+ "[attr.data-readonly]": "readonly() || null",
595
574
  "[attr.role]": "'combobox'",
596
575
  "[attr.tabindex]": "disabled() ? null : 0",
597
576
  "[class]": "baseClass()",
@@ -7,6 +7,7 @@ import { Subject, takeUntil, take, filter, switchMap, fromEvent } from 'rxjs';
7
7
  import { ConnectionPositionPair } from '@angular/cdk/overlay';
8
8
  import { PopupService, dropdownPopupAnimation } from '@nanahoshi/mona-ui/popup';
9
9
  import { cva } from 'class-variance-authority';
10
+ import { themeOverlaySurfaceClasses } from '@nanahoshi/mona-ui/internal';
10
11
 
11
12
  const DropdownDataInputToken = new InjectionToken("DROPDOWN_DATA_INPUT");
12
13
 
@@ -659,10 +660,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
659
660
  }]
660
661
  }] });
661
662
 
662
- const dropdownPopupVariants = cva(`
663
- bg-background shadow-md text-foreground
664
- border border-input-border
663
+ const dropdownPopupThemeVariants = cva(`
665
664
  h-full max-h-64 overflow-auto
665
+ [scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
666
+ text-foreground
667
+ ${themeOverlaySurfaceClasses}
668
+ [&_mona-list]:[background-color:var(--mona-dropdown-popup-list-background,var(--mona-list-background))]!
669
+ border border-border shadow-(--shadow-overlay)
666
670
  `, {
667
671
  variants: {
668
672
  rounded: {
@@ -684,15 +688,6 @@ const dropdownPopupVariants = cva(`
684
688
  }
685
689
  });
686
690
 
687
- const dropdownPopupThemeVariants = (theme) => {
688
- switch (theme) {
689
- case "mona":
690
- return dropdownPopupVariants;
691
- default:
692
- return dropdownPopupVariants;
693
- }
694
- };
695
-
696
691
  /**
697
692
  * Generated bundle index. Do not edit.
698
693
  */