@nanahoshi/mona-ui 0.1.0 → 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 (176) 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 +40 -55
  26. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +24 -58
  27. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -48
  28. package/fesm2022/nanahoshi-mona-ui-button.mjs +130 -129
  29. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +69 -165
  30. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +81 -128
  31. package/fesm2022/nanahoshi-mona-ui-chip.mjs +102 -112
  32. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +11 -25
  33. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +41 -92
  34. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +27 -49
  35. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +64 -65
  36. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +39 -61
  37. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +12 -15
  38. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +44 -33
  39. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +58 -60
  40. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +52 -165
  41. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +36 -59
  42. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +56 -61
  43. package/fesm2022/nanahoshi-mona-ui-editor.mjs +302 -81
  44. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +33 -84
  45. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +12 -45
  46. package/fesm2022/nanahoshi-mona-ui-filter.mjs +18 -48
  47. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +14 -14
  48. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
  49. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs +121 -0
  50. package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +26 -55
  51. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs +231 -0
  52. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +167 -451
  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 +57 -87
  56. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -139
  57. package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
  58. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +10 -32
  59. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +8 -21
  60. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -156
  61. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +40 -69
  62. package/fesm2022/nanahoshi-mona-ui-notification.mjs +32 -116
  63. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +81 -107
  64. package/fesm2022/nanahoshi-mona-ui-pager.mjs +33 -85
  65. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +12 -34
  66. package/fesm2022/nanahoshi-mona-ui-popover.mjs +31 -52
  67. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +38 -110
  68. package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
  69. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +21 -62
  70. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +66 -111
  71. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +60 -151
  72. package/fesm2022/nanahoshi-mona-ui-slider.mjs +117 -173
  73. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +32 -45
  74. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +29 -64
  75. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +38 -101
  76. package/fesm2022/nanahoshi-mona-ui-switch.mjs +58 -79
  77. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +42 -118
  78. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +29 -37
  79. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -81
  80. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
  81. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +45 -39
  82. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +45 -109
  83. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +54 -82
  84. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
  85. package/fesm2022/nanahoshi-mona-ui-window.mjs +35 -115
  86. package/fieldset/package.json +4 -0
  87. package/filter/package.json +4 -0
  88. package/grid/package.json +4 -0
  89. package/internal/filter-input/package.json +4 -0
  90. package/internal/indicator-icon/package.json +4 -0
  91. package/internal/list/package.json +4 -0
  92. package/internal/package.json +4 -0
  93. package/internal/tree/package.json +4 -0
  94. package/list/package.json +4 -0
  95. package/list-box/package.json +4 -0
  96. package/list-view/package.json +4 -0
  97. package/menubar/package.json +4 -0
  98. package/multi-select/package.json +4 -0
  99. package/notification/package.json +4 -0
  100. package/numeric-text-box/package.json +4 -0
  101. package/package.json +31 -5
  102. package/pager/package.json +4 -0
  103. package/placeholder/package.json +4 -0
  104. package/popover/package.json +4 -0
  105. package/popup/package.json +4 -0
  106. package/popup-menu/package.json +4 -0
  107. package/progress-bar/package.json +4 -0
  108. package/query/package.json +4 -0
  109. package/radio-button/package.json +4 -0
  110. package/scroll-view/package.json +4 -0
  111. package/slider/package.json +4 -0
  112. package/split-button/package.json +4 -0
  113. package/splitter/package.json +4 -0
  114. package/stepper/package.json +4 -0
  115. package/switch/package.json +4 -0
  116. package/tabs/package.json +4 -0
  117. package/text-area/package.json +4 -0
  118. package/text-box/package.json +4 -0
  119. package/theme/package.json +4 -0
  120. package/time-picker/package.json +4 -0
  121. package/time-selector/package.json +4 -0
  122. package/tooltip/package.json +4 -0
  123. package/tree-view/package.json +4 -0
  124. package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
  125. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
  126. package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
  127. package/types/nanahoshi-mona-ui-button.d.ts +6 -6
  128. package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
  129. package/types/nanahoshi-mona-ui-check-box.d.ts +6 -9
  130. package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
  131. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
  132. package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
  133. package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
  134. package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -8
  135. package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
  136. package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
  137. package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
  138. package/types/nanahoshi-mona-ui-dialog.d.ts +7 -8
  139. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
  140. package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
  141. package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
  142. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
  143. package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
  144. package/types/nanahoshi-mona-ui-filter.d.ts +3 -4
  145. package/types/nanahoshi-mona-ui-grid.d.ts +16 -17
  146. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
  147. package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
  148. package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
  149. package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
  150. package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
  151. package/types/nanahoshi-mona-ui-menubar.d.ts +7 -8
  152. package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
  153. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
  154. package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
  155. package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
  156. package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
  157. package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
  158. package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
  159. package/types/nanahoshi-mona-ui-radio-button.d.ts +8 -11
  160. package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
  161. package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
  162. package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
  163. package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
  164. package/types/nanahoshi-mona-ui-stepper.d.ts +13 -14
  165. package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
  166. package/types/nanahoshi-mona-ui-tabs.d.ts +15 -17
  167. package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
  168. package/types/nanahoshi-mona-ui-text-box.d.ts +4 -6
  169. package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
  170. package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
  171. package/types/nanahoshi-mona-ui-time-selector.d.ts +10 -11
  172. package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
  173. package/types/nanahoshi-mona-ui-window.d.ts +16 -17
  174. package/window/package.json +4 -0
  175. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
  176. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
@@ -4,7 +4,6 @@ import { NgTemplateOutlet } from '@angular/common';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { select } from '@mirei/ts-collections';
6
6
  import { fromEvent } from 'rxjs';
7
- import { ThemeService } from '@nanahoshi/mona-ui/theme';
8
7
  import { cva } from 'class-variance-authority';
9
8
 
10
9
  /**
@@ -53,12 +52,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
53
52
  }]
54
53
  }] });
55
54
 
56
- const stepperBaseVariants = cva(`
57
- relative grid outline-none
55
+ const stepperBaseThemeVariants = cva(`
56
+ relative grid outline-none
58
57
  `, {
59
58
  variants: {
60
59
  orientation: {
61
- horizontal: "w-full h-auto",
60
+ horizontal: "h-auto w-full",
62
61
  vertical: "h-full w-auto"
63
62
  }
64
63
  },
@@ -66,19 +65,19 @@ const stepperBaseVariants = cva(`
66
65
  orientation: "horizontal"
67
66
  }
68
67
  });
69
- const stepperStepListVariants = cva(`
70
- absolute flex list-none col-span-full
71
- font-medium z-1
68
+ const stepperStepListThemeVariants = cva(`
69
+ absolute z-1 col-span-full flex list-none
70
+ font-medium
72
71
  `, {
73
72
  variants: {
74
73
  orientation: {
75
- horizontal: `
76
- flex-row w-full
77
- -translate-y-3
74
+ horizontal: `
75
+ w-full flex-row
76
+ -translate-y-3
78
77
  `,
79
- vertical: `
80
- flex-col h-full w-max
81
- -translate-x-3
78
+ vertical: `
79
+ h-full w-max flex-col
80
+ -translate-x-3
82
81
  `
83
82
  }
84
83
  },
@@ -86,35 +85,31 @@ const stepperStepListVariants = cva(`
86
85
  orientation: "horizontal"
87
86
  }
88
87
  });
89
- const stepperStepListItemVariants = cva(`
90
- flex items-center
91
- grow-1 shrink-0 basis-auto
92
- z-1
88
+ const stepperStepListItemThemeVariants = cva(`
89
+ z-1 flex grow-1 shrink-0 basis-auto items-center
93
90
  `, {
94
91
  variants: {
95
92
  orientation: {
96
93
  horizontal: "flex-col gap-2",
97
- vertical: "flex-row gap-2 justify-start"
94
+ vertical: "flex-row justify-start gap-2"
98
95
  }
99
96
  },
100
97
  defaultVariants: {
101
98
  orientation: "horizontal"
102
99
  }
103
100
  });
104
- const stepperStepIndicatorVariants = cva(`
105
- w-8 h-8
106
- flex items-center justify-center
107
- bg-background border border-border
108
- text-foreground outline-none
109
- transition-colors duration-400 ease-in-out
101
+ const stepperStepIndicatorThemeVariants = cva(`
102
+ flex h-8 w-8 items-center justify-center
103
+ border border-border outline-none
104
+ transition-colors duration-400 ease-in-out
110
105
  `, {
111
106
  variants: {
112
107
  active: {
113
108
  true: "bg-primary text-primary-foreground",
114
- false: ""
109
+ false: "bg-surface-raised text-foreground"
115
110
  },
116
111
  focused: {
117
- true: "ring-2 ring-primary/40",
112
+ true: "border-focus-indicator ring-2 ring-focus-indicator/35",
118
113
  false: ""
119
114
  },
120
115
  rounded: {
@@ -126,13 +121,14 @@ const stepperStepIndicatorVariants = cva(`
126
121
  }
127
122
  }
128
123
  });
129
- const stepperTrackVariants = cva(`
130
- relative grid
131
- bg-background border border-border
124
+ const stepperTrackThemeVariants = cva(`
125
+ relative grid
126
+ bg-surface-muted text-foreground
127
+ border border-border-subtle
132
128
  `, {
133
129
  variants: {
134
130
  orientation: {
135
- horizontal: "w-full h-2",
131
+ horizontal: "h-2 w-full",
136
132
  vertical: "h-full w-2"
137
133
  }
138
134
  },
@@ -140,13 +136,13 @@ const stepperTrackVariants = cva(`
140
136
  orientation: "horizontal"
141
137
  }
142
138
  });
143
- const stepperTrackLineVariants = cva(`
144
- absolute bg-primary
139
+ const stepperTrackLineThemeVariants = cva(`
140
+ absolute bg-primary
145
141
  `, {
146
142
  variants: {
147
143
  orientation: {
148
- horizontal: "h-full transition-width duration-300 ease-out",
149
- vertical: "w-full transition-height duration-300 ease-out"
144
+ horizontal: "h-full transition-width duration-(--mona-motion-standard) ease-out",
145
+ vertical: "w-full transition-height duration-(--mona-motion-standard) ease-out"
150
146
  }
151
147
  },
152
148
  defaultVariants: {
@@ -154,69 +150,17 @@ const stepperTrackLineVariants = cva(`
154
150
  }
155
151
  });
156
152
 
157
- const stepperBaseThemeVariants = (theme) => {
158
- switch (theme) {
159
- case "mona":
160
- return stepperBaseVariants;
161
- default:
162
- return stepperBaseVariants;
163
- }
164
- };
165
- const stepperStepListThemeVariants = (theme) => {
166
- switch (theme) {
167
- case "mona":
168
- return stepperStepListVariants;
169
- default:
170
- return stepperStepListVariants;
171
- }
172
- };
173
- const stepperStepListItemThemeVariants = (theme) => {
174
- switch (theme) {
175
- case "mona":
176
- return stepperStepListItemVariants;
177
- default:
178
- return stepperStepListItemVariants;
179
- }
180
- };
181
- const stepperStepIndicatorThemeVariants = (theme) => {
182
- switch (theme) {
183
- case "mona":
184
- return stepperStepIndicatorVariants;
185
- default:
186
- return stepperStepIndicatorVariants;
187
- }
188
- };
189
- const stepperTrackThemeVariants = (theme) => {
190
- switch (theme) {
191
- case "mona":
192
- return stepperTrackVariants;
193
- default:
194
- return stepperTrackVariants;
195
- }
196
- };
197
- const stepperTrackLineThemeVariants = (theme) => {
198
- switch (theme) {
199
- case "mona":
200
- return stepperTrackLineVariants;
201
- default:
202
- return stepperTrackLineVariants;
203
- }
204
- };
205
-
206
153
  class StepperIndicatorDirective {
207
154
  #wasFocused;
208
155
  #host;
209
- #themeService;
210
156
  constructor() {
211
157
  this.#wasFocused = false;
212
158
  this.#host = inject(ElementRef);
213
- this.#themeService = inject(ThemeService);
214
159
  this.stepIndicatorClass = computed(() => {
215
- const theme = this.#themeService.theme();
216
160
  const active = this.active();
217
161
  const focused = this.focused();
218
162
  const rounded = this.rounded();
219
- return stepperStepIndicatorThemeVariants(theme)({ active, focused, rounded });
163
+ return stepperStepIndicatorThemeVariants({ active, focused, rounded });
220
164
  }, /* @ts-ignore */
221
165
  ...(ngDevMode ? [{ debugName: "stepIndicatorClass" }] : /* istanbul ignore next */ []));
222
166
  this.active = input.required(/* @ts-ignore */
@@ -251,13 +195,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
251
195
  class StepperComponent {
252
196
  #destroyRef;
253
197
  #hostElementRef;
254
- #themeService;
255
198
  #trackItemSize;
256
199
  #trackLength;
257
200
  constructor() {
258
201
  this.#destroyRef = inject(DestroyRef);
259
202
  this.#hostElementRef = inject(ElementRef);
260
- this.#themeService = inject(ThemeService);
261
203
  this.#trackItemSize = computed(() => {
262
204
  const stepCount = this.viewSteps().length;
263
205
  return stepCount !== 0 ? 100 / stepCount : 0;
@@ -280,9 +222,8 @@ class StepperComponent {
280
222
  }, /* @ts-ignore */
281
223
  ...(ngDevMode ? [{ debugName: "activeStep" }] : /* istanbul ignore next */ []));
282
224
  this.baseClass = computed(() => {
283
- const theme = this.#themeService.theme();
284
225
  const orientation = this.orientation();
285
- return stepperBaseThemeVariants(theme)({ orientation });
226
+ return stepperBaseThemeVariants({ orientation });
286
227
  }, /* @ts-ignore */
287
228
  ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
288
229
  this.highlightedStep = signal(0, /* @ts-ignore */
@@ -301,15 +242,13 @@ class StepperComponent {
301
242
  });
302
243
  this.labelTemplate = contentChild(StepperLabelTemplateDirective, { read: TemplateRef });
303
244
  this.listClass = computed(() => {
304
- const theme = this.#themeService.theme();
305
245
  const orientation = this.orientation();
306
- return stepperStepListThemeVariants(theme)({ orientation });
246
+ return stepperStepListThemeVariants({ orientation });
307
247
  }, /* @ts-ignore */
308
248
  ...(ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []));
309
249
  this.listItemClass = computed(() => {
310
- const theme = this.#themeService.theme();
311
250
  const orientation = this.orientation();
312
- return stepperStepListItemThemeVariants(theme)({ orientation });
251
+ return stepperStepListItemThemeVariants({ orientation });
313
252
  }, /* @ts-ignore */
314
253
  ...(ngDevMode ? [{ debugName: "listItemClass" }] : /* istanbul ignore next */ []));
315
254
  this.progressMax = computed(() => Math.max(this.viewSteps().length - 1, 0), /* @ts-ignore */
@@ -318,9 +257,8 @@ class StepperComponent {
318
257
  read: TemplateRef
319
258
  });
320
259
  this.trackClass = computed(() => {
321
- const theme = this.#themeService.theme();
322
260
  const orientation = this.orientation();
323
- return stepperTrackThemeVariants(theme)({ orientation });
261
+ return stepperTrackThemeVariants({ orientation });
324
262
  }, /* @ts-ignore */
325
263
  ...(ngDevMode ? [{ debugName: "trackClass" }] : /* istanbul ignore next */ []));
326
264
  this.trackInnerStyles = computed(() => {
@@ -340,9 +278,8 @@ class StepperComponent {
340
278
  }, /* @ts-ignore */
341
279
  ...(ngDevMode ? [{ debugName: "trackItemStyles" }] : /* istanbul ignore next */ []));
342
280
  this.trackLineClass = computed(() => {
343
- const theme = this.#themeService.theme();
344
281
  const orientation = this.orientation();
345
- return stepperTrackLineThemeVariants(theme)({ orientation });
282
+ return stepperTrackLineThemeVariants({ orientation });
346
283
  }, /* @ts-ignore */
347
284
  ...(ngDevMode ? [{ debugName: "trackLineClass" }] : /* istanbul ignore next */ []));
348
285
  this.trackStyles = computed(() => {
@@ -509,7 +446,7 @@ class StepperComponent {
509
446
  });
510
447
  }
511
448
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
512
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: StepperComponent, isStandalone: true, selector: "mona-stepper", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, progressAriaLabel: { classPropertyName: "progressAriaLabel", publicName: "progressAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { step: "stepChange" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "ariaLabel()", "class": "baseClass()", "style": "hostStyles()" } }, queries: [{ propertyName: "indicatorTemplate", first: true, predicate: StepperIndicatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: StepperLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "stepTemplate", first: true, predicate: StepperStepTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ol [class]=\"listClass()\">\r\n @for (step of viewSteps(); track step.index) {\r\n @let active = isStepActive(step);\r\n @let locked = isStepLocked(step);\r\n @let focused = step.index === highlightedStep();\r\n @let options = step.options;\r\n @let index = step.index;\r\n @let currentIndex = activeStep()?.index ?? -1;\r\n @let disabled = !!options.disabled;\r\n <li\r\n [class]=\"listItemClass()\"\r\n [class.cursor-pointer]=\"!locked\"\r\n [class.cursor-not-allowed]=\"locked\"\r\n [style]=\"trackItemStyles()\"\r\n role=\"presentation\"\r\n (click)=\"onStepClick(step)\">\r\n @if (stepTemplate()) {\r\n <span\r\n role=\"button\"\r\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\r\n [attr.aria-disabled]=\"locked ? true : undefined\"\r\n [attr.aria-label]=\"options.label\"\r\n [attr.tabindex]=\"focused ? 0 : -1\"\r\n (focus)=\"onIndicatorFocus(step)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"stepTemplate()\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: options,\r\n index,\r\n active,\r\n currentIndex,\r\n disabled\r\n }\"></ng-container>\r\n </span>\r\n } @else {\r\n <span\r\n monaStepperIndicator\r\n [rounded]=\"rounded()\"\r\n [active]=\"active\"\r\n [focused]=\"focused\"\r\n role=\"button\"\r\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\r\n [attr.aria-disabled]=\"locked ? true : undefined\"\r\n [attr.aria-label]=\"options.label\"\r\n [attr.tabindex]=\"focused ? 0 : -1\"\r\n (focus)=\"onIndicatorFocus(step)\">\r\n @if (indicatorTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"indicatorTemplate()\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: options,\r\n index,\r\n active,\r\n currentIndex,\r\n disabled\r\n }\"></ng-container>\r\n } @else {\r\n {{ step.index + 1 }}\r\n }\r\n </span>\r\n }\r\n @if (labelTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"labelTemplate()\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: options,\r\n index,\r\n active,\r\n currentIndex,\r\n disabled\r\n }\"></ng-container>\r\n } @else {\r\n <span aria-hidden=\"true\">{{ options.label }}</span>\r\n }\r\n </li>\r\n }\r\n</ol>\r\n<div\r\n [class]=\"trackClass()\"\r\n [style]=\"trackStyles()\"\r\n role=\"progressbar\"\r\n [attr.aria-valuenow]=\"step()\"\r\n [attr.aria-valuemin]=\"0\"\r\n [attr.aria-valuemax]=\"progressMax()\"\r\n [attr.aria-label]=\"progressAriaLabel()\">\r\n <div [class]=\"trackLineClass()\" [style]=\"trackInnerStyles()\"></div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: StepperIndicatorDirective, selector: "span[monaStepperIndicator]", inputs: ["active", "focused", "rounded"] }] }); }
449
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: StepperComponent, isStandalone: true, selector: "mona-stepper", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, progressAriaLabel: { classPropertyName: "progressAriaLabel", publicName: "progressAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { step: "stepChange" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "ariaLabel()", "class": "baseClass()", "style": "hostStyles()" } }, queries: [{ propertyName: "indicatorTemplate", first: true, predicate: StepperIndicatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: StepperLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "stepTemplate", first: true, predicate: StepperStepTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ol [class]=\"listClass()\">\n @for (step of viewSteps(); track step.index) {\n @let active = isStepActive(step);\n @let locked = isStepLocked(step);\n @let focused = step.index === highlightedStep();\n @let options = step.options;\n @let index = step.index;\n @let currentIndex = activeStep()?.index ?? -1;\n @let disabled = !!options.disabled;\n <li\n [class]=\"listItemClass()\"\n [class.cursor-pointer]=\"!locked\"\n [class.cursor-not-allowed]=\"locked\"\n [style]=\"trackItemStyles()\"\n role=\"presentation\"\n (click)=\"onStepClick(step)\">\n @if (stepTemplate()) {\n <span\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n </span>\n } @else {\n <span\n monaStepperIndicator\n [rounded]=\"rounded()\"\n [active]=\"active\"\n [focused]=\"focused\"\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n @if (indicatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"indicatorTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n {{ step.index + 1 }}\n }\n </span>\n }\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n <span aria-hidden=\"true\">{{ options.label }}</span>\n }\n </li>\n }\n</ol>\n<div\n [class]=\"trackClass()\"\n [style]=\"trackStyles()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"step()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"progressMax()\"\n [attr.aria-label]=\"progressAriaLabel()\">\n <div [class]=\"trackLineClass()\" [style]=\"trackInnerStyles()\"></div>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: StepperIndicatorDirective, selector: "span[monaStepperIndicator]", inputs: ["active", "focused", "rounded"] }] }); }
513
450
  }
514
451
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StepperComponent, decorators: [{
515
452
  type: Component,
@@ -518,7 +455,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
518
455
  "[attr.aria-label]": "ariaLabel()",
519
456
  "[class]": "baseClass()",
520
457
  "[style]": "hostStyles()"
521
- }, template: "<ol [class]=\"listClass()\">\r\n @for (step of viewSteps(); track step.index) {\r\n @let active = isStepActive(step);\r\n @let locked = isStepLocked(step);\r\n @let focused = step.index === highlightedStep();\r\n @let options = step.options;\r\n @let index = step.index;\r\n @let currentIndex = activeStep()?.index ?? -1;\r\n @let disabled = !!options.disabled;\r\n <li\r\n [class]=\"listItemClass()\"\r\n [class.cursor-pointer]=\"!locked\"\r\n [class.cursor-not-allowed]=\"locked\"\r\n [style]=\"trackItemStyles()\"\r\n role=\"presentation\"\r\n (click)=\"onStepClick(step)\">\r\n @if (stepTemplate()) {\r\n <span\r\n role=\"button\"\r\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\r\n [attr.aria-disabled]=\"locked ? true : undefined\"\r\n [attr.aria-label]=\"options.label\"\r\n [attr.tabindex]=\"focused ? 0 : -1\"\r\n (focus)=\"onIndicatorFocus(step)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"stepTemplate()\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: options,\r\n index,\r\n active,\r\n currentIndex,\r\n disabled\r\n }\"></ng-container>\r\n </span>\r\n } @else {\r\n <span\r\n monaStepperIndicator\r\n [rounded]=\"rounded()\"\r\n [active]=\"active\"\r\n [focused]=\"focused\"\r\n role=\"button\"\r\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\r\n [attr.aria-disabled]=\"locked ? true : undefined\"\r\n [attr.aria-label]=\"options.label\"\r\n [attr.tabindex]=\"focused ? 0 : -1\"\r\n (focus)=\"onIndicatorFocus(step)\">\r\n @if (indicatorTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"indicatorTemplate()\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: options,\r\n index,\r\n active,\r\n currentIndex,\r\n disabled\r\n }\"></ng-container>\r\n } @else {\r\n {{ step.index + 1 }}\r\n }\r\n </span>\r\n }\r\n @if (labelTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"labelTemplate()\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: options,\r\n index,\r\n active,\r\n currentIndex,\r\n disabled\r\n }\"></ng-container>\r\n } @else {\r\n <span aria-hidden=\"true\">{{ options.label }}</span>\r\n }\r\n </li>\r\n }\r\n</ol>\r\n<div\r\n [class]=\"trackClass()\"\r\n [style]=\"trackStyles()\"\r\n role=\"progressbar\"\r\n [attr.aria-valuenow]=\"step()\"\r\n [attr.aria-valuemin]=\"0\"\r\n [attr.aria-valuemax]=\"progressMax()\"\r\n [attr.aria-label]=\"progressAriaLabel()\">\r\n <div [class]=\"trackLineClass()\" [style]=\"trackInnerStyles()\"></div>\r\n</div>\r\n" }]
458
+ }, template: "<ol [class]=\"listClass()\">\n @for (step of viewSteps(); track step.index) {\n @let active = isStepActive(step);\n @let locked = isStepLocked(step);\n @let focused = step.index === highlightedStep();\n @let options = step.options;\n @let index = step.index;\n @let currentIndex = activeStep()?.index ?? -1;\n @let disabled = !!options.disabled;\n <li\n [class]=\"listItemClass()\"\n [class.cursor-pointer]=\"!locked\"\n [class.cursor-not-allowed]=\"locked\"\n [style]=\"trackItemStyles()\"\n role=\"presentation\"\n (click)=\"onStepClick(step)\">\n @if (stepTemplate()) {\n <span\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n </span>\n } @else {\n <span\n monaStepperIndicator\n [rounded]=\"rounded()\"\n [active]=\"active\"\n [focused]=\"focused\"\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n @if (indicatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"indicatorTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n {{ step.index + 1 }}\n }\n </span>\n }\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n <span aria-hidden=\"true\">{{ options.label }}</span>\n }\n </li>\n }\n</ol>\n<div\n [class]=\"trackClass()\"\n [style]=\"trackStyles()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"step()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"progressMax()\"\n [attr.aria-label]=\"progressAriaLabel()\">\n <div [class]=\"trackLineClass()\" [style]=\"trackInnerStyles()\"></div>\n</div>\n" }]
522
459
  }], ctorParameters: () => [], propDecorators: { indicatorTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StepperIndicatorTemplateDirective), { ...{
523
460
  read: TemplateRef
524
461
  }, isSignal: true }] }], labelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StepperLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], stepTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StepperStepTemplateDirective), { ...{
@@ -2,10 +2,10 @@ import { NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
3
  import { Directive, inject, DestroyRef, ElementRef, computed, contentChild, TemplateRef, input, model, output, afterNextRender, Component } from '@angular/core';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { ThemeService } from '@nanahoshi/mona-ui/theme';
6
5
  import { fromEvent, filter, tap, merge } from 'rxjs';
7
6
  import { twMerge } from 'tailwind-merge';
8
7
  import { cva } from 'class-variance-authority';
8
+ import { themeControlSurfaceClasses, themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
9
9
 
10
10
  class SwitchHandleContentTemplateDirective {
11
11
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SwitchHandleContentTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -40,26 +40,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
40
40
  }]
41
41
  }] });
42
42
 
43
- const switchVariants = cva(`
44
- relative flex items-center cursor-pointer select-none
45
- transition-[background]
46
-
47
- bg-input-background
48
- border border-input-border
49
- outline-none
50
-
51
- focus-within:ring-2 focus-within:ring-primary/40
52
-
53
- data-[disabled='true']:pointer-events-none
54
- data-[disabled='true']:opacity-50
55
-
56
- data-[active='true']:bg-primary
57
- data-[active='true']:text-primary-foreground
58
-
59
- [&.ng-touched.ng-invalid]:border-error
60
-
61
- data-[invalid='true']:border-error
62
- data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/40
43
+ const switchThemeVariants = cva(`
44
+ group relative flex items-center
45
+ cursor-pointer select-none
46
+ ${themeControlSurfaceClasses}
47
+ border border-input-border
48
+ outline-none
49
+ transition-[background,border-color]
50
+
51
+ data-[disabled='true']:pointer-events-none
52
+ data-[disabled='true']:cursor-not-allowed
53
+ data-[disabled='true']:border-disabled-border
54
+ data-[disabled='true']:bg-disabled-background
55
+ data-[disabled='true']:text-disabled-foreground
56
+
57
+ data-[active='true']:bg-primary
58
+ data-[active='true']:text-primary-foreground
59
+ data-[disabled='true']:data-[active='true']:bg-disabled-background
60
+
61
+ focus-visible:border-focus-indicator
62
+ focus-visible:ring-2 focus-visible:ring-focus-indicator/35
63
+
64
+ [&.ng-touched.ng-invalid]:border-error
65
+ data-[invalid='true']:border-error
66
+ data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
67
+ data-[invalid='true']:focus-visible:border-error
68
+ data-[invalid='true']:focus-visible:ring-error/35
63
69
  `, {
64
70
  variants: {
65
71
  rounded: {
@@ -70,18 +76,21 @@ const switchVariants = cva(`
70
76
  small: "rounded-sm"
71
77
  },
72
78
  size: {
73
- large: "w-14 h-7.5 text-md",
74
- medium: "w-12 h-6.5 text-sm",
75
- small: "w-10 h-5.5 text-xs"
79
+ large: "h-7.5 w-14 text-md",
80
+ medium: "h-6.5 w-12 text-sm",
81
+ small: "h-5.5 w-10 text-xs"
76
82
  }
77
83
  }
78
84
  });
79
- const switchHandleVariants = cva(`
80
- absolute inline-flex
81
- items-center justify-center
82
- outline-none transition-[left,background] ease-in-out duration-300
83
- border border-border bg-secondary
84
- data-[active='true']:bg-background
85
+ const switchHandleThemeVariants = cva(`
86
+ absolute inline-flex items-center justify-center
87
+ ${themeRaisedSurfaceClasses} text-foreground
88
+ border border-border-subtle shadow-(--shadow-control)
89
+ outline-none
90
+ transition-[left,background] duration-(--mona-motion-standard) ease-in-out
91
+ data-[active='true']:bg-primary-foreground
92
+ group-data-[disabled='true']:border-disabled-border
93
+ group-data-[disabled='true']:bg-disabled-background
85
94
  `, {
86
95
  variants: {
87
96
  rounded: {
@@ -92,83 +101,53 @@ const switchHandleVariants = cva(`
92
101
  small: "rounded-sm"
93
102
  },
94
103
  size: {
95
- large: `
96
- w-6 h-6
97
- data-[active='true']:left-[calc(100%-26px)]
98
- data-[active='false']:left-0.5
104
+ large: `
105
+ h-6 w-6
106
+ data-[active='true']:left-[calc(100%-26px)]
107
+ data-[active='false']:left-0.5
99
108
  `,
100
- medium: `
101
- w-5 h-5
102
- data-[active='true']:left-[calc(100%-22px)]
103
- data-[active='false']:left-0.5
109
+ medium: `
110
+ h-5 w-5
111
+ data-[active='true']:left-[calc(100%-22px)]
112
+ data-[active='false']:left-0.5
104
113
  `,
105
- small: `
106
- w-4 h-4
107
- data-[active='true']:left-[calc(100%-18px)]
108
- data-[active='false']:left-0.5
114
+ small: `
115
+ h-4 w-4
116
+ data-[active='true']:left-[calc(100%-18px)]
117
+ data-[active='false']:left-0.5
109
118
  `
110
119
  }
111
120
  }
112
121
  });
113
- const switchLabelVariants = cva(`
114
- h-full flex flex-1 items-center justify-center text-xs
122
+ const switchLabelThemeVariants = cva(`
123
+ flex h-full flex-1 items-center justify-center text-xs
115
124
  `);
116
125
 
117
- const switchThemeVariants = (theme) => {
118
- switch (theme) {
119
- case "mona":
120
- return switchVariants;
121
- default:
122
- return switchVariants; // Default to Mona styles
123
- }
124
- };
125
- const switchHandleThemeVariants = (theme) => {
126
- switch (theme) {
127
- case "mona":
128
- return switchHandleVariants;
129
- default:
130
- return switchHandleVariants; // Default to Mona styles
131
- }
132
- };
133
- const switchLabelThemeVariants = (theme) => {
134
- switch (theme) {
135
- case "mona":
136
- return switchLabelVariants;
137
- default:
138
- return switchLabelVariants; // Default to Mona styles
139
- }
140
- };
141
-
142
126
  class SwitchComponent {
143
127
  #destroyRef;
144
128
  #hostElementRef;
145
- #themeService;
146
129
  constructor() {
147
130
  this.#destroyRef = inject(DestroyRef);
148
131
  this.#hostElementRef = inject((ElementRef));
149
- this.#themeService = inject(ThemeService);
150
132
  this.classes = computed(() => {
151
- const theme = this.#themeService.theme();
152
133
  const rounded = this.rounded();
153
134
  const size = this.size();
154
- const classes = switchThemeVariants(theme)({ rounded, size });
135
+ const classes = switchThemeVariants({ rounded, size });
155
136
  return twMerge(classes, this.userClass());
156
137
  }, /* @ts-ignore */
157
138
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
158
139
  this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && !this.checked()), /* @ts-ignore */
159
140
  ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
160
141
  this.handleClasses = computed(() => {
161
- const theme = this.#themeService.theme();
162
142
  const rounded = this.rounded();
163
143
  const size = this.size();
164
- const classes = switchHandleThemeVariants(theme)({ rounded, size });
144
+ const classes = switchHandleThemeVariants({ rounded, size });
165
145
  return twMerge(classes);
166
146
  }, /* @ts-ignore */
167
147
  ...(ngDevMode ? [{ debugName: "handleClasses" }] : /* istanbul ignore next */ []));
168
148
  this.handleContentTemplate = contentChild(SwitchHandleContentTemplateDirective, { ...(ngDevMode ? { debugName: "handleContentTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
169
149
  this.labelClasses = computed(() => {
170
- const theme = this.#themeService.theme();
171
- const classes = switchLabelThemeVariants(theme)();
150
+ const classes = switchLabelThemeVariants();
172
151
  return twMerge(classes);
173
152
  }, /* @ts-ignore */
174
153
  ...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
@@ -274,7 +253,7 @@ class SwitchComponent {
274
253
  this.touch.emit();
275
254
  }
276
255
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
277
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SwitchComponent, isStandalone: true, selector: "mona-switch", 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 }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, offLabel: { classPropertyName: "offLabel", publicName: "offLabel", isSignal: true, isRequired: false, transformFunction: null }, onLabel: { classPropertyName: "onLabel", publicName: "onLabel", 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 }, size: { classPropertyName: "size", publicName: "size", 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 } }, outputs: { checked: "checkedChange", touch: "touch" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.role": "'switch'", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled() || undefined", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.tabindex": "disabled() ? -1 : 0", "attr.data-active": "checked()", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.aria-invalid": "invalidState() ? 'true' : null", "class": "classes()" } }, queries: [{ propertyName: "handleContentTemplate", first: true, predicate: SwitchHandleContentTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "offLabelTemplate", first: true, predicate: SwitchOffLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "onLabelTemplate", first: true, predicate: SwitchOnLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<span [class]=\"labelClasses()\">\r\n @if (checked() && !onLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\r\n }\r\n @if (checked() && onLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\r\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\r\n </span>\r\n }\r\n</span>\r\n<span [class]=\"labelClasses()\">\r\n @if (!checked() && !offLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\r\n }\r\n @if (!checked() && offLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\r\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\r\n </span>\r\n }\r\n</span>\r\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\r\n @if (handleContentTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\r\n }\r\n</div>\r\n", styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
256
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SwitchComponent, isStandalone: true, selector: "mona-switch", 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 }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, offLabel: { classPropertyName: "offLabel", publicName: "offLabel", isSignal: true, isRequired: false, transformFunction: null }, onLabel: { classPropertyName: "onLabel", publicName: "onLabel", 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 }, size: { classPropertyName: "size", publicName: "size", 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 } }, outputs: { checked: "checkedChange", touch: "touch" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.role": "'switch'", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled() || undefined", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.tabindex": "disabled() ? -1 : 0", "attr.data-active": "checked()", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.aria-invalid": "invalidState() ? 'true' : null", "class": "classes()" } }, queries: [{ propertyName: "handleContentTemplate", first: true, predicate: SwitchHandleContentTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "offLabelTemplate", first: true, predicate: SwitchOffLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "onLabelTemplate", first: true, predicate: SwitchOnLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<span [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n", styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
278
257
  }
279
258
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SwitchComponent, decorators: [{
280
259
  type: Component,
@@ -291,7 +270,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
291
270
  "[attr.aria-invalid]": "invalidState() ? 'true' : null",
292
271
  "[class]": "classes()",
293
272
  "(blur)": "onBlur()"
294
- }, template: "<span [class]=\"labelClasses()\">\r\n @if (checked() && !onLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\r\n }\r\n @if (checked() && onLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\r\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\r\n </span>\r\n }\r\n</span>\r\n<span [class]=\"labelClasses()\">\r\n @if (!checked() && !offLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\r\n }\r\n @if (!checked() && offLabelTemplate()) {\r\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\r\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\r\n </span>\r\n }\r\n</span>\r\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\r\n @if (handleContentTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\r\n }\r\n</div>\r\n", styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"] }]
273
+ }, template: "<span [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n", styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"] }]
295
274
  }], ctorParameters: () => [], propDecorators: { handleContentTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SwitchHandleContentTemplateDirective), { ...{
296
275
  read: TemplateRef
297
276
  }, isSignal: true }] }], offLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SwitchOffLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], onLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SwitchOnLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], offLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offLabel", required: false }] }], onLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onLabel", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });