@raqm/ui 0.0.0-stage → 0.1.1

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 (178) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +28 -0
  4. package/README.md +126 -3
  5. package/combobox/README.md +17 -0
  6. package/fesm2022/raqm-ui-accordion.mjs +414 -0
  7. package/fesm2022/raqm-ui-accordion.mjs.map +1 -0
  8. package/fesm2022/raqm-ui-alert-dialog.mjs +457 -0
  9. package/fesm2022/raqm-ui-alert-dialog.mjs.map +1 -0
  10. package/fesm2022/raqm-ui-alert.mjs +195 -0
  11. package/fesm2022/raqm-ui-alert.mjs.map +1 -0
  12. package/fesm2022/raqm-ui-aspect-ratio.mjs +66 -0
  13. package/fesm2022/raqm-ui-aspect-ratio.mjs.map +1 -0
  14. package/fesm2022/raqm-ui-attachment.mjs +435 -0
  15. package/fesm2022/raqm-ui-attachment.mjs.map +1 -0
  16. package/fesm2022/raqm-ui-avatar.mjs +337 -0
  17. package/fesm2022/raqm-ui-avatar.mjs.map +1 -0
  18. package/fesm2022/raqm-ui-badge.mjs +68 -0
  19. package/fesm2022/raqm-ui-badge.mjs.map +1 -0
  20. package/fesm2022/raqm-ui-breadcrumb.mjs +309 -0
  21. package/fesm2022/raqm-ui-breadcrumb.mjs.map +1 -0
  22. package/fesm2022/raqm-ui-button-group.mjs +138 -0
  23. package/fesm2022/raqm-ui-button-group.mjs.map +1 -0
  24. package/fesm2022/raqm-ui-button.mjs +295 -0
  25. package/fesm2022/raqm-ui-button.mjs.map +1 -0
  26. package/fesm2022/raqm-ui-calendar.mjs +1394 -0
  27. package/fesm2022/raqm-ui-calendar.mjs.map +1 -0
  28. package/fesm2022/raqm-ui-card.mjs +331 -0
  29. package/fesm2022/raqm-ui-card.mjs.map +1 -0
  30. package/fesm2022/raqm-ui-carousel.mjs +410 -0
  31. package/fesm2022/raqm-ui-carousel.mjs.map +1 -0
  32. package/fesm2022/raqm-ui-checkbox.mjs +86 -0
  33. package/fesm2022/raqm-ui-checkbox.mjs.map +1 -0
  34. package/fesm2022/raqm-ui-collapsible.mjs +266 -0
  35. package/fesm2022/raqm-ui-collapsible.mjs.map +1 -0
  36. package/fesm2022/raqm-ui-combobox.mjs +1584 -0
  37. package/fesm2022/raqm-ui-combobox.mjs.map +1 -0
  38. package/fesm2022/raqm-ui-command.mjs +1210 -0
  39. package/fesm2022/raqm-ui-command.mjs.map +1 -0
  40. package/fesm2022/raqm-ui-context-menu.mjs +723 -0
  41. package/fesm2022/raqm-ui-context-menu.mjs.map +1 -0
  42. package/fesm2022/raqm-ui-dialog.mjs +1214 -0
  43. package/fesm2022/raqm-ui-dialog.mjs.map +1 -0
  44. package/fesm2022/raqm-ui-drawer.mjs +687 -0
  45. package/fesm2022/raqm-ui-drawer.mjs.map +1 -0
  46. package/fesm2022/raqm-ui-dropdown-menu.mjs +1168 -0
  47. package/fesm2022/raqm-ui-dropdown-menu.mjs.map +1 -0
  48. package/fesm2022/raqm-ui-empty.mjs +272 -0
  49. package/fesm2022/raqm-ui-empty.mjs.map +1 -0
  50. package/fesm2022/raqm-ui-field.mjs +517 -0
  51. package/fesm2022/raqm-ui-field.mjs.map +1 -0
  52. package/fesm2022/raqm-ui-hover-card.mjs +828 -0
  53. package/fesm2022/raqm-ui-hover-card.mjs.map +1 -0
  54. package/fesm2022/raqm-ui-input-group.mjs +270 -0
  55. package/fesm2022/raqm-ui-input-group.mjs.map +1 -0
  56. package/fesm2022/raqm-ui-input-otp.mjs +788 -0
  57. package/fesm2022/raqm-ui-input-otp.mjs.map +1 -0
  58. package/fesm2022/raqm-ui-input.mjs +73 -0
  59. package/fesm2022/raqm-ui-input.mjs.map +1 -0
  60. package/fesm2022/raqm-ui-item.mjs +495 -0
  61. package/fesm2022/raqm-ui-item.mjs.map +1 -0
  62. package/fesm2022/raqm-ui-kbd.mjs +80 -0
  63. package/fesm2022/raqm-ui-kbd.mjs.map +1 -0
  64. package/fesm2022/raqm-ui-label.mjs +44 -0
  65. package/fesm2022/raqm-ui-label.mjs.map +1 -0
  66. package/fesm2022/raqm-ui-menubar.mjs +536 -0
  67. package/fesm2022/raqm-ui-menubar.mjs.map +1 -0
  68. package/fesm2022/raqm-ui-native-select.mjs +131 -0
  69. package/fesm2022/raqm-ui-native-select.mjs.map +1 -0
  70. package/fesm2022/raqm-ui-navigation-menu.mjs +1399 -0
  71. package/fesm2022/raqm-ui-navigation-menu.mjs.map +1 -0
  72. package/fesm2022/raqm-ui-overlay-internal.mjs +185 -0
  73. package/fesm2022/raqm-ui-overlay-internal.mjs.map +1 -0
  74. package/fesm2022/raqm-ui-pagination.mjs +440 -0
  75. package/fesm2022/raqm-ui-pagination.mjs.map +1 -0
  76. package/fesm2022/raqm-ui-popover.mjs +1495 -0
  77. package/fesm2022/raqm-ui-popover.mjs.map +1 -0
  78. package/fesm2022/raqm-ui-progress.mjs +369 -0
  79. package/fesm2022/raqm-ui-progress.mjs.map +1 -0
  80. package/fesm2022/raqm-ui-questionnaire.mjs +1005 -0
  81. package/fesm2022/raqm-ui-questionnaire.mjs.map +1 -0
  82. package/fesm2022/raqm-ui-radio-group.mjs +151 -0
  83. package/fesm2022/raqm-ui-radio-group.mjs.map +1 -0
  84. package/fesm2022/raqm-ui-resizable.mjs +439 -0
  85. package/fesm2022/raqm-ui-resizable.mjs.map +1 -0
  86. package/fesm2022/raqm-ui-scroll-area.mjs +510 -0
  87. package/fesm2022/raqm-ui-scroll-area.mjs.map +1 -0
  88. package/fesm2022/raqm-ui-select.mjs +1073 -0
  89. package/fesm2022/raqm-ui-select.mjs.map +1 -0
  90. package/fesm2022/raqm-ui-separator.mjs +103 -0
  91. package/fesm2022/raqm-ui-separator.mjs.map +1 -0
  92. package/fesm2022/raqm-ui-sheet.mjs +411 -0
  93. package/fesm2022/raqm-ui-sheet.mjs.map +1 -0
  94. package/fesm2022/raqm-ui-sidebar.mjs +1784 -0
  95. package/fesm2022/raqm-ui-sidebar.mjs.map +1 -0
  96. package/fesm2022/raqm-ui-skeleton.mjs +50 -0
  97. package/fesm2022/raqm-ui-skeleton.mjs.map +1 -0
  98. package/fesm2022/raqm-ui-slider.mjs +609 -0
  99. package/fesm2022/raqm-ui-slider.mjs.map +1 -0
  100. package/fesm2022/raqm-ui-spinner.mjs +137 -0
  101. package/fesm2022/raqm-ui-spinner.mjs.map +1 -0
  102. package/fesm2022/raqm-ui-switch.mjs +109 -0
  103. package/fesm2022/raqm-ui-switch.mjs.map +1 -0
  104. package/fesm2022/raqm-ui-table.mjs +271 -0
  105. package/fesm2022/raqm-ui-table.mjs.map +1 -0
  106. package/fesm2022/raqm-ui-tabs.mjs +536 -0
  107. package/fesm2022/raqm-ui-tabs.mjs.map +1 -0
  108. package/fesm2022/raqm-ui-textarea.mjs +37 -0
  109. package/fesm2022/raqm-ui-textarea.mjs.map +1 -0
  110. package/fesm2022/raqm-ui-toast.mjs +918 -0
  111. package/fesm2022/raqm-ui-toast.mjs.map +1 -0
  112. package/fesm2022/raqm-ui-toggle-group.mjs +462 -0
  113. package/fesm2022/raqm-ui-toggle-group.mjs.map +1 -0
  114. package/fesm2022/raqm-ui-toggle.mjs +158 -0
  115. package/fesm2022/raqm-ui-toggle.mjs.map +1 -0
  116. package/fesm2022/raqm-ui-tooltip.mjs +1226 -0
  117. package/fesm2022/raqm-ui-tooltip.mjs.map +1 -0
  118. package/fesm2022/raqm-ui.mjs +50 -0
  119. package/input-otp/README.md +12 -0
  120. package/package.json +275 -3
  121. package/styles/theme.css +4324 -0
  122. package/types/raqm-ui-accordion.d.ts +124 -0
  123. package/types/raqm-ui-alert-dialog.d.ts +81 -0
  124. package/types/raqm-ui-alert.d.ts +29 -0
  125. package/types/raqm-ui-aspect-ratio.d.ts +13 -0
  126. package/types/raqm-ui-attachment.d.ts +72 -0
  127. package/types/raqm-ui-avatar.d.ts +67 -0
  128. package/types/raqm-ui-badge.d.ts +20 -0
  129. package/types/raqm-ui-breadcrumb.d.ts +35 -0
  130. package/types/raqm-ui-button-group.d.ts +27 -0
  131. package/types/raqm-ui-button.d.ts +80 -0
  132. package/types/raqm-ui-calendar.d.ts +359 -0
  133. package/types/raqm-ui-card.d.ts +34 -0
  134. package/types/raqm-ui-carousel.d.ts +81 -0
  135. package/types/raqm-ui-checkbox.d.ts +24 -0
  136. package/types/raqm-ui-collapsible.d.ts +72 -0
  137. package/types/raqm-ui-combobox.d.ts +405 -0
  138. package/types/raqm-ui-command.d.ts +256 -0
  139. package/types/raqm-ui-context-menu.d.ts +196 -0
  140. package/types/raqm-ui-dialog.d.ts +232 -0
  141. package/types/raqm-ui-drawer.d.ts +121 -0
  142. package/types/raqm-ui-dropdown-menu.d.ts +319 -0
  143. package/types/raqm-ui-empty.d.ts +35 -0
  144. package/types/raqm-ui-field.d.ts +88 -0
  145. package/types/raqm-ui-hover-card.d.ts +139 -0
  146. package/types/raqm-ui-input-group.d.ts +45 -0
  147. package/types/raqm-ui-input-otp.d.ts +197 -0
  148. package/types/raqm-ui-input.d.ts +16 -0
  149. package/types/raqm-ui-item.d.ts +71 -0
  150. package/types/raqm-ui-kbd.d.ts +12 -0
  151. package/types/raqm-ui-label.d.ts +6 -0
  152. package/types/raqm-ui-menubar.d.ts +159 -0
  153. package/types/raqm-ui-native-select.d.ts +23 -0
  154. package/types/raqm-ui-navigation-menu.d.ts +230 -0
  155. package/types/raqm-ui-overlay-internal.d.ts +5 -0
  156. package/types/raqm-ui-pagination.d.ts +84 -0
  157. package/types/raqm-ui-popover.d.ts +235 -0
  158. package/types/raqm-ui-progress.d.ts +79 -0
  159. package/types/raqm-ui-questionnaire.d.ts +217 -0
  160. package/types/raqm-ui-radio-group.d.ts +48 -0
  161. package/types/raqm-ui-resizable.d.ts +98 -0
  162. package/types/raqm-ui-scroll-area.d.ts +132 -0
  163. package/types/raqm-ui-select.d.ts +205 -0
  164. package/types/raqm-ui-separator.d.ts +21 -0
  165. package/types/raqm-ui-sheet.d.ts +79 -0
  166. package/types/raqm-ui-sidebar.d.ts +285 -0
  167. package/types/raqm-ui-skeleton.d.ts +6 -0
  168. package/types/raqm-ui-slider.d.ts +129 -0
  169. package/types/raqm-ui-spinner.d.ts +32 -0
  170. package/types/raqm-ui-switch.d.ts +32 -0
  171. package/types/raqm-ui-table.d.ts +36 -0
  172. package/types/raqm-ui-tabs.d.ts +154 -0
  173. package/types/raqm-ui-textarea.d.ts +6 -0
  174. package/types/raqm-ui-toast.d.ts +190 -0
  175. package/types/raqm-ui-toggle-group.d.ts +167 -0
  176. package/types/raqm-ui-toggle.d.ts +42 -0
  177. package/types/raqm-ui-tooltip.d.ts +207 -0
  178. package/types/raqm-ui.d.ts +50 -0
@@ -0,0 +1,1210 @@
1
+ import { ActiveDescendantKeyManager } from "@angular/cdk/a11y";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, InjectionToken, Injector, afterRenderEffect, booleanAttribute, computed, effect, inject, input, isDevMode, model, output, signal, untracked, viewChild } from "@angular/core";
4
+ import { NgTemplateOutlet } from "@angular/common";
5
+ import { RaqmButton } from "@raqm/ui/button";
6
+ import { RAQM_DIALOG, RAQM_DIALOG_POLICY, RaqmDialogBaseComponent, RaqmDialogDescriptionDirective, RaqmDialogTitleDirective } from "@raqm/ui/dialog";
7
+ import * as i1 from "@raqm/ui/input-group";
8
+ import { RaqmInputGroup } from "@raqm/ui/input-group";
9
+ const RAQM_COMMAND = new InjectionToken("RaqmCommand");
10
+ const RAQM_COMMAND_GROUP = new InjectionToken("RaqmCommandGroup");
11
+ /** @license
12
+ * Typed translation of cmdk/src/command-score.ts:
13
+ * https://github.com/dip/cmdk/blob/main/cmdk/src/command-score.ts
14
+ *
15
+ * MIT License
16
+ * Copyright (c) 2022 Paco Coursey
17
+ *
18
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
19
+ * of this software and associated documentation files (the "Software"), to deal
20
+ * in the Software without restriction, including without limitation the rights
21
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ * copies of the Software, and to permit persons to whom the Software is
23
+ * furnished to do so, subject to the following conditions:
24
+ *
25
+ * The above copyright notice and this permission notice shall be included in all
26
+ * copies or substantial portions of the Software.
27
+ *
28
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34
+ * SOFTWARE.
35
+ */
36
+ const SCORE_CONTINUE_MATCH = 1;
37
+ const SCORE_SPACE_WORD_JUMP = .9;
38
+ const SCORE_NON_SPACE_WORD_JUMP = .8;
39
+ const SCORE_CHARACTER_JUMP = .17;
40
+ const SCORE_TRANSPOSITION = .1;
41
+ const PENALTY_SKIPPED = .999;
42
+ const PENALTY_CASE_MISMATCH = .9999;
43
+ const PENALTY_NOT_COMPLETE = .99;
44
+ const IS_GAP_REGEXP = /[\\/_+.#"@\[({&]/;
45
+ const COUNT_GAPS_REGEXP = /[\\/_+.#"@\[({&]/g;
46
+ const IS_SPACE_REGEXP = /[\s-]/;
47
+ const COUNT_SPACE_REGEXP = /[\s-]/g;
48
+ function commandScoreInner(string, abbreviation, lowerString, lowerAbbreviation, stringIndex, abbreviationIndex, memoizedResults) {
49
+ if (abbreviationIndex === abbreviation.length) return stringIndex === string.length ? SCORE_CONTINUE_MATCH : PENALTY_NOT_COMPLETE;
50
+ const memoizeKey = `${stringIndex},${abbreviationIndex}`;
51
+ if (memoizedResults[memoizeKey] !== void 0) return memoizedResults[memoizeKey];
52
+ const abbreviationChar = lowerAbbreviation.charAt(abbreviationIndex);
53
+ let index = lowerString.indexOf(abbreviationChar, stringIndex);
54
+ let highScore = 0;
55
+ while (index >= 0) {
56
+ let score = commandScoreInner(string, abbreviation, lowerString, lowerAbbreviation, index + 1, abbreviationIndex + 1, memoizedResults);
57
+ if (score > highScore) {
58
+ if (index === stringIndex) score *= SCORE_CONTINUE_MATCH;
59
+ else if (IS_GAP_REGEXP.test(string.charAt(index - 1))) {
60
+ score *= SCORE_NON_SPACE_WORD_JUMP;
61
+ const wordBreaks = string.slice(stringIndex, index - 1).match(COUNT_GAPS_REGEXP);
62
+ if (wordBreaks && stringIndex > 0) score *= Math.pow(PENALTY_SKIPPED, wordBreaks.length);
63
+ } else if (IS_SPACE_REGEXP.test(string.charAt(index - 1))) {
64
+ score *= SCORE_SPACE_WORD_JUMP;
65
+ const spaceBreaks = string.slice(stringIndex, index - 1).match(COUNT_SPACE_REGEXP);
66
+ if (spaceBreaks && stringIndex > 0) score *= Math.pow(PENALTY_SKIPPED, spaceBreaks.length);
67
+ } else {
68
+ score *= SCORE_CHARACTER_JUMP;
69
+ if (stringIndex > 0) score *= Math.pow(PENALTY_SKIPPED, index - stringIndex);
70
+ }
71
+ if (string.charAt(index) !== abbreviation.charAt(abbreviationIndex)) score *= PENALTY_CASE_MISMATCH;
72
+ }
73
+ if (score < SCORE_TRANSPOSITION && lowerString.charAt(index - 1) === lowerAbbreviation.charAt(abbreviationIndex + 1) || lowerAbbreviation.charAt(abbreviationIndex + 1) === lowerAbbreviation.charAt(abbreviationIndex) && lowerString.charAt(index - 1) !== lowerAbbreviation.charAt(abbreviationIndex)) {
74
+ const transposedScore = commandScoreInner(string, abbreviation, lowerString, lowerAbbreviation, index + 1, abbreviationIndex + 2, memoizedResults);
75
+ if (transposedScore * SCORE_TRANSPOSITION > score) score = transposedScore * SCORE_TRANSPOSITION;
76
+ }
77
+ if (score > highScore) highScore = score;
78
+ index = lowerString.indexOf(abbreviationChar, index + 1);
79
+ }
80
+ memoizedResults[memoizeKey] = highScore;
81
+ return highScore;
82
+ }
83
+ function commandScore(value, search, aliases) {
84
+ const string = aliases.length > 0 ? `${value} ${aliases.join(" ")}` : value;
85
+ const format = (input) => input.toLowerCase().replace(COUNT_SPACE_REGEXP, " ");
86
+ return commandScoreInner(string, search, format(string), format(search), 0, 0, {});
87
+ }
88
+ let nextCommandId = 0;
89
+ var RaqmCommandComponent = class RaqmCommandComponent {
90
+ label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
91
+ search = model("", ...ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []);
92
+ loop = input(false, {
93
+ ...ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {},
94
+ transform: booleanAttribute
95
+ });
96
+ shouldFilter = input(true, {
97
+ ...ngDevMode ? { debugName: "shouldFilter" } : /* istanbul ignore next */ {},
98
+ transform: booleanAttribute
99
+ });
100
+ listId = `raqm-command-${++nextCommandId}-list`;
101
+ inputId = `${this.listId}-input`;
102
+ items = signal([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
103
+ activeId = signal(null, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
104
+ listPresent = signal(false, ...ngDevMode ? [{ debugName: "listPresent" }] : /* istanbul ignore next */ []);
105
+ visibleItems = computed(() => this.items().filter((item) => this.matches(item)), ...ngDevMode ? [{ debugName: "visibleItems" }] : /* istanbul ignore next */ []);
106
+ hasChecked = computed(() => this.items().some((item) => item.checked()), ...ngDevMode ? [{ debugName: "hasChecked" }] : /* istanbul ignore next */ []);
107
+ scores = computed(() => new Map(this.items().map((item) => [item, commandScore(item.value().trim(), this.search(), [item.title(), ...item.keywords()].filter(Boolean).map((alias) => alias.trim()))])), ...ngDevMode ? [{ debugName: "scores" }] : /* istanbul ignore next */ []);
108
+ rankedItems = computed(() => {
109
+ const items = [...this.items()];
110
+ if (!this.shouldFilter() || !this.search()) return items;
111
+ const scores = this.scores();
112
+ const groups = /* @__PURE__ */ new Map();
113
+ for (const item of items) if (item.group !== null) groups.set(item.group, Math.max(groups.get(item.group) ?? 0, scores.get(item) ?? 0));
114
+ const groupOrder = [...groups.keys()].sort((a, b) => groups.get(b) - groups.get(a));
115
+ return items.sort((a, b) => {
116
+ if (a.group !== b.group) {
117
+ if (a.group === null) return -1;
118
+ if (b.group === null) return 1;
119
+ return groupOrder.indexOf(a.group) - groupOrder.indexOf(b.group);
120
+ }
121
+ if (a.disabled !== b.disabled) return a.disabled ? -1 : 1;
122
+ return (scores.get(b) ?? 0) - (scores.get(a) ?? 0);
123
+ });
124
+ }, ...ngDevMode ? [{ debugName: "rankedItems" }] : /* istanbul ignore next */ []);
125
+ injector = inject(Injector);
126
+ contentInjector = Injector.create({
127
+ providers: [{
128
+ provide: RAQM_COMMAND,
129
+ useValue: this
130
+ }],
131
+ parent: this.injector
132
+ });
133
+ manager = new ActiveDescendantKeyManager(this.rankedItems, this.injector).withVerticalOrientation().withHomeAndEnd().skipPredicate((item) => item.disabled || !this.matches(item));
134
+ sequence = 0;
135
+ focusInput;
136
+ originalChildren = /* @__PURE__ */ new Map();
137
+ constructor() {
138
+ afterRenderEffect(() => {
139
+ const items = this.rankedItems();
140
+ if (!this.shouldFilter() || !this.search()) {
141
+ for (const [parent, children] of this.originalChildren) for (const child of children) if (child.parentNode === parent) parent.appendChild(child);
142
+ this.originalChildren.clear();
143
+ return;
144
+ }
145
+ const remember = (parent) => {
146
+ if (parent && !this.originalChildren.has(parent)) this.originalChildren.set(parent, Array.from(parent.childNodes));
147
+ };
148
+ const groups = /* @__PURE__ */ new Set();
149
+ for (const item of items) {
150
+ const parent = item.element.parentElement;
151
+ remember(parent);
152
+ parent?.appendChild(item.element);
153
+ const group = item.element.closest(".raqm-command-group");
154
+ if (group) {
155
+ remember(group.parentElement);
156
+ groups.add(group);
157
+ }
158
+ }
159
+ for (const group of groups) group.parentElement?.appendChild(group);
160
+ });
161
+ effect(() => {
162
+ const items = this.rankedItems().filter((item) => this.matches(item) && !item.disabled);
163
+ const search = this.search();
164
+ untracked(() => {
165
+ if (search !== this.lastSearch || !items.some((item) => item.id === this.activeId())) {
166
+ this.manager.setActiveItem(items[0] ?? -1);
167
+ this.activeId.set(items[0]?.id ?? null);
168
+ }
169
+ this.lastSearch = search;
170
+ });
171
+ });
172
+ inject(DestroyRef).onDestroy(() => {
173
+ this.manager.destroy();
174
+ this.contentInjector.destroy();
175
+ });
176
+ }
177
+ lastSearch = "";
178
+ register(item) {
179
+ this.items.update((items) => [...items, item]);
180
+ }
181
+ unregister(item) {
182
+ this.items.update((items) => items.filter((candidate) => candidate !== item));
183
+ }
184
+ mintId() {
185
+ return `${this.listId}-option-${++this.sequence}`;
186
+ }
187
+ registerInput(focus) {
188
+ this.focusInput = focus;
189
+ }
190
+ unregisterInput() {
191
+ this.focusInput = void 0;
192
+ }
193
+ matches(item) {
194
+ return !this.shouldFilter() || !this.search() || (this.scores().get(item) ?? 0) > 0;
195
+ }
196
+ activate(item) {
197
+ if (item.disabled || !this.matches(item)) return;
198
+ this.manager.setActiveItem(item);
199
+ this.activeId.set(item.id);
200
+ }
201
+ select(item) {
202
+ if (item.disabled || !this.matches(item)) return;
203
+ this.activate(item);
204
+ this.focusInput?.();
205
+ item.select();
206
+ }
207
+ keydown(event) {
208
+ if (event.isComposing || event.altKey || event.ctrlKey || event.metaKey) return;
209
+ if (event.key === "Enter") {
210
+ const item = this.items().find((item) => item.id === this.activeId());
211
+ if (item) {
212
+ event.preventDefault();
213
+ this.select(item);
214
+ }
215
+ return;
216
+ }
217
+ if (![
218
+ "ArrowDown",
219
+ "ArrowUp",
220
+ "Home",
221
+ "End"
222
+ ].includes(event.key)) return;
223
+ this.manager.withWrap(this.loop()).onKeydown(event);
224
+ const item = this.manager.activeItem;
225
+ this.activeId.set(item?.id ?? null);
226
+ item?.scrollIntoView();
227
+ }
228
+ static ɵfac = i0.ɵɵngDeclareFactory({
229
+ minVersion: "12.0.0",
230
+ version: "22.2.2",
231
+ ngImport: i0,
232
+ type: RaqmCommandComponent,
233
+ deps: [],
234
+ target: i0.ɵɵFactoryTarget.Component
235
+ });
236
+ static ɵcmp = i0.ɵɵngDeclareComponent({
237
+ minVersion: "17.1.0",
238
+ version: "22.2.2",
239
+ type: RaqmCommandComponent,
240
+ isStandalone: true,
241
+ selector: "raqm-command",
242
+ inputs: {
243
+ label: {
244
+ classPropertyName: "label",
245
+ publicName: "label",
246
+ isSignal: true,
247
+ isRequired: true,
248
+ transformFunction: null
249
+ },
250
+ search: {
251
+ classPropertyName: "search",
252
+ publicName: "search",
253
+ isSignal: true,
254
+ isRequired: false,
255
+ transformFunction: null
256
+ },
257
+ loop: {
258
+ classPropertyName: "loop",
259
+ publicName: "loop",
260
+ isSignal: true,
261
+ isRequired: false,
262
+ transformFunction: null
263
+ },
264
+ shouldFilter: {
265
+ classPropertyName: "shouldFilter",
266
+ publicName: "shouldFilter",
267
+ isSignal: true,
268
+ isRequired: false,
269
+ transformFunction: null
270
+ }
271
+ },
272
+ outputs: { search: "searchChange" },
273
+ host: { classAttribute: "raqm-command" },
274
+ providers: [{
275
+ provide: RAQM_COMMAND,
276
+ useExisting: RaqmCommandComponent
277
+ }],
278
+ ngImport: i0,
279
+ template: "<ng-content />\r\n",
280
+ styles: [":host{display:flex;flex-direction:column;inline-size:100%;block-size:100%;min-block-size:0;box-sizing:border-box;overflow:hidden;padding:var(--raqm-spacing);border-radius:var(--raqm-radius-xl);background:var(--raqm-popover);color:var(--raqm-popover-foreground)}\n"],
281
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
282
+ });
283
+ };
284
+ i0.ɵɵngDeclareClassMetadata({
285
+ minVersion: "12.0.0",
286
+ version: "22.2.2",
287
+ ngImport: i0,
288
+ type: RaqmCommandComponent,
289
+ decorators: [{
290
+ type: Component,
291
+ args: [{
292
+ selector: "raqm-command",
293
+ changeDetection: ChangeDetectionStrategy.OnPush,
294
+ host: { class: "raqm-command" },
295
+ providers: [{
296
+ provide: RAQM_COMMAND,
297
+ useExisting: RaqmCommandComponent
298
+ }],
299
+ template: "<ng-content />\r\n",
300
+ styles: [":host{display:flex;flex-direction:column;inline-size:100%;block-size:100%;min-block-size:0;box-sizing:border-box;overflow:hidden;padding:var(--raqm-spacing);border-radius:var(--raqm-radius-xl);background:var(--raqm-popover);color:var(--raqm-popover-foreground)}\n"]
301
+ }]
302
+ }],
303
+ ctorParameters: () => [],
304
+ propDecorators: {
305
+ label: [{
306
+ type: i0.Input,
307
+ args: [{
308
+ isSignal: true,
309
+ alias: "label",
310
+ required: true
311
+ }]
312
+ }],
313
+ search: [{
314
+ type: i0.Input,
315
+ args: [{
316
+ isSignal: true,
317
+ alias: "search",
318
+ required: false
319
+ }]
320
+ }, {
321
+ type: i0.Output,
322
+ args: ["searchChange"]
323
+ }],
324
+ loop: [{
325
+ type: i0.Input,
326
+ args: [{
327
+ isSignal: true,
328
+ alias: "loop",
329
+ required: false
330
+ }]
331
+ }],
332
+ shouldFilter: [{
333
+ type: i0.Input,
334
+ args: [{
335
+ isSignal: true,
336
+ alias: "shouldFilter",
337
+ required: false
338
+ }]
339
+ }]
340
+ }
341
+ });
342
+ var RaqmCommandDialogComponent = class RaqmCommandDialogComponent extends RaqmDialogBaseComponent {
343
+ showCloseButton = input(false, {
344
+ ...ngDevMode ? { debugName: "showCloseButton" } : /* istanbul ignore next */ {},
345
+ transform: booleanAttribute
346
+ });
347
+ closeLabel = input(void 0, ...ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []);
348
+ title = input.required(...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
349
+ description = input("", ...ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []);
350
+ closeButtonVisible = this.showCloseButton;
351
+ closeLabelText = this.closeLabel;
352
+ static ɵfac = i0.ɵɵngDeclareFactory({
353
+ minVersion: "12.0.0",
354
+ version: "22.2.2",
355
+ ngImport: i0,
356
+ type: RaqmCommandDialogComponent,
357
+ deps: null,
358
+ target: i0.ɵɵFactoryTarget.Component
359
+ });
360
+ static ɵcmp = i0.ɵɵngDeclareComponent({
361
+ minVersion: "17.0.0",
362
+ version: "22.2.2",
363
+ type: RaqmCommandDialogComponent,
364
+ isStandalone: true,
365
+ selector: "raqm-command-dialog",
366
+ inputs: {
367
+ showCloseButton: {
368
+ classPropertyName: "showCloseButton",
369
+ publicName: "showCloseButton",
370
+ isSignal: true,
371
+ isRequired: false,
372
+ transformFunction: null
373
+ },
374
+ closeLabel: {
375
+ classPropertyName: "closeLabel",
376
+ publicName: "closeLabel",
377
+ isSignal: true,
378
+ isRequired: false,
379
+ transformFunction: null
380
+ },
381
+ title: {
382
+ classPropertyName: "title",
383
+ publicName: "title",
384
+ isSignal: true,
385
+ isRequired: true,
386
+ transformFunction: null
387
+ },
388
+ description: {
389
+ classPropertyName: "description",
390
+ publicName: "description",
391
+ isSignal: true,
392
+ isRequired: false,
393
+ transformFunction: null
394
+ }
395
+ },
396
+ providers: [{
397
+ provide: RAQM_DIALOG,
398
+ useExisting: RaqmCommandDialogComponent
399
+ }, {
400
+ provide: RAQM_DIALOG_POLICY,
401
+ useFactory: () => ({
402
+ role: "dialog",
403
+ contentClass: "raqm-command-dialog-content",
404
+ paneClass: "raqm-command-dialog-pane",
405
+ touchOpening: signal(false),
406
+ dismissOnBackdrop: true,
407
+ allowWithoutTrigger: true
408
+ })
409
+ }],
410
+ usesInheritance: true,
411
+ ngImport: i0,
412
+ template: "<ng-content />\r\n<ng-template #panel>\r\n <div\r\n class=\"raqm-dialog-content raqm-command-dialog-content\"\r\n [attr.dir]=\"panelDir()\"\r\n [class.raqm-dialog-content--entering]=\"entering()\"\r\n [class.raqm-dialog-content--closing]=\"closing()\"\r\n >\r\n <header class=\"raqm-command-dialog-header\">\r\n <h2 raqm-dialog-title>{{ title() }}</h2>\r\n @if (description()) {\r\n <p raqm-dialog-description>{{ description() }}</p>\r\n }\r\n </header>\r\n <raqm-command #command [label]=\"title()\"\r\n ><ng-container\r\n [ngTemplateOutlet]=\"contentTemplate()\"\r\n [ngTemplateOutletInjector]=\"command.contentInjector\"\r\n /></raqm-command>\r\n @if (closeButtonVisible()) {\r\n <button\r\n raqm-button=\"ghost\"\r\n icon-small\r\n class=\"raqm-dialog-close\"\r\n [attr.aria-label]=\"closeLabelText()\"\r\n (click)=\"onCloseButtonClick()\"\r\n >\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"m18 6-12 12M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n</ng-template>\r\n",
413
+ styles: [":host{display:contents}.raqm-dialog-content{position:relative;display:grid;gap:calc(var(--raqm-spacing) * 6);box-sizing:border-box;inline-size:calc(100vw - 2rem);inline-size:calc(100dvw - 2rem);max-inline-size:100%;max-block-size:calc(100vh - 2rem);max-block-size:calc(100dvh - 2rem);overflow:auto;padding:calc(var(--raqm-spacing) * 6);border-radius:var(--raqm-radius-xl);background-color:var(--raqm-popover);color:var(--raqm-popover-foreground);font-size:var(--raqm-font-size-sm);line-height:1.25rem;box-shadow:0 0 0 1px color-mix(in oklch,var(--raqm-foreground) 10%,transparent);outline:none}@media(min-width:40rem){.raqm-dialog-content{inline-size:24rem}}.raqm-dialog-content--entering{animation:raqm-dialog-in var(--raqm-duration-fast) var(--raqm-ease-out)}@keyframes raqm-dialog-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}.raqm-dialog-content--closing{opacity:0;transform:scale(.95);transition:opacity var(--raqm-duration-fast) var(--raqm-ease-out),transform var(--raqm-duration-fast) var(--raqm-ease-out)}@media(prefers-reduced-motion:reduce){.raqm-dialog-content,.raqm-dialog-content--closing{animation:none;transition:none}}.raqm-dialog-close{position:absolute;inset-block-start:calc(var(--raqm-spacing) * 4.5);inset-inline-end:calc(var(--raqm-spacing) * 4.5)}@media(forced-colors:active){.raqm-dialog-close{border-color:ButtonText}.raqm-dialog-content{border:1px solid CanvasText}}\n", ".raqm-command-dialog-content{padding:0;gap:0;overflow:hidden;border-radius:var(--raqm-radius-xl);max-block-size:calc(66.6666666667dvh - 1rem)}.raqm-command-dialog-content .raqm-dialog-close{inset-block-start:calc(var(--raqm-spacing) * 2.5);inset-inline-end:calc(var(--raqm-spacing) * 2)}.raqm-command-dialog-header{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"],
414
+ dependencies: [
415
+ {
416
+ kind: "directive",
417
+ type: NgTemplateOutlet,
418
+ selector: "[ngTemplateOutlet]",
419
+ inputs: [
420
+ "ngTemplateOutletContext",
421
+ "ngTemplateOutlet",
422
+ "ngTemplateOutletInjector"
423
+ ]
424
+ },
425
+ {
426
+ kind: "component",
427
+ type: RaqmButton,
428
+ selector: "button[raqm-button], a[raqm-button]",
429
+ inputs: [
430
+ "raqm-button",
431
+ "extra-small",
432
+ "small",
433
+ "large",
434
+ "icon",
435
+ "icon-extra-small",
436
+ "icon-small",
437
+ "icon-large",
438
+ "disabled",
439
+ "tabindex"
440
+ ]
441
+ },
442
+ {
443
+ kind: "component",
444
+ type: RaqmCommandComponent,
445
+ selector: "raqm-command",
446
+ inputs: [
447
+ "label",
448
+ "search",
449
+ "loop",
450
+ "shouldFilter"
451
+ ],
452
+ outputs: ["searchChange"]
453
+ },
454
+ {
455
+ kind: "directive",
456
+ type: RaqmDialogTitleDirective,
457
+ selector: "[raqm-dialog-title]"
458
+ },
459
+ {
460
+ kind: "directive",
461
+ type: RaqmDialogDescriptionDirective,
462
+ selector: "[raqm-dialog-description]"
463
+ }
464
+ ],
465
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
466
+ });
467
+ };
468
+ i0.ɵɵngDeclareClassMetadata({
469
+ minVersion: "12.0.0",
470
+ version: "22.2.2",
471
+ ngImport: i0,
472
+ type: RaqmCommandDialogComponent,
473
+ decorators: [{
474
+ type: Component,
475
+ args: [{
476
+ selector: "raqm-command-dialog",
477
+ imports: [
478
+ NgTemplateOutlet,
479
+ RaqmButton,
480
+ RaqmCommandComponent,
481
+ RaqmDialogTitleDirective,
482
+ RaqmDialogDescriptionDirective
483
+ ],
484
+ changeDetection: ChangeDetectionStrategy.OnPush,
485
+ providers: [{
486
+ provide: RAQM_DIALOG,
487
+ useExisting: RaqmCommandDialogComponent
488
+ }, {
489
+ provide: RAQM_DIALOG_POLICY,
490
+ useFactory: () => ({
491
+ role: "dialog",
492
+ contentClass: "raqm-command-dialog-content",
493
+ paneClass: "raqm-command-dialog-pane",
494
+ touchOpening: signal(false),
495
+ dismissOnBackdrop: true,
496
+ allowWithoutTrigger: true
497
+ })
498
+ }],
499
+ template: "<ng-content />\r\n<ng-template #panel>\r\n <div\r\n class=\"raqm-dialog-content raqm-command-dialog-content\"\r\n [attr.dir]=\"panelDir()\"\r\n [class.raqm-dialog-content--entering]=\"entering()\"\r\n [class.raqm-dialog-content--closing]=\"closing()\"\r\n >\r\n <header class=\"raqm-command-dialog-header\">\r\n <h2 raqm-dialog-title>{{ title() }}</h2>\r\n @if (description()) {\r\n <p raqm-dialog-description>{{ description() }}</p>\r\n }\r\n </header>\r\n <raqm-command #command [label]=\"title()\"\r\n ><ng-container\r\n [ngTemplateOutlet]=\"contentTemplate()\"\r\n [ngTemplateOutletInjector]=\"command.contentInjector\"\r\n /></raqm-command>\r\n @if (closeButtonVisible()) {\r\n <button\r\n raqm-button=\"ghost\"\r\n icon-small\r\n class=\"raqm-dialog-close\"\r\n [attr.aria-label]=\"closeLabelText()\"\r\n (click)=\"onCloseButtonClick()\"\r\n >\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"m18 6-12 12M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n</ng-template>\r\n",
500
+ styles: [":host{display:contents}.raqm-dialog-content{position:relative;display:grid;gap:calc(var(--raqm-spacing) * 6);box-sizing:border-box;inline-size:calc(100vw - 2rem);inline-size:calc(100dvw - 2rem);max-inline-size:100%;max-block-size:calc(100vh - 2rem);max-block-size:calc(100dvh - 2rem);overflow:auto;padding:calc(var(--raqm-spacing) * 6);border-radius:var(--raqm-radius-xl);background-color:var(--raqm-popover);color:var(--raqm-popover-foreground);font-size:var(--raqm-font-size-sm);line-height:1.25rem;box-shadow:0 0 0 1px color-mix(in oklch,var(--raqm-foreground) 10%,transparent);outline:none}@media(min-width:40rem){.raqm-dialog-content{inline-size:24rem}}.raqm-dialog-content--entering{animation:raqm-dialog-in var(--raqm-duration-fast) var(--raqm-ease-out)}@keyframes raqm-dialog-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}.raqm-dialog-content--closing{opacity:0;transform:scale(.95);transition:opacity var(--raqm-duration-fast) var(--raqm-ease-out),transform var(--raqm-duration-fast) var(--raqm-ease-out)}@media(prefers-reduced-motion:reduce){.raqm-dialog-content,.raqm-dialog-content--closing{animation:none;transition:none}}.raqm-dialog-close{position:absolute;inset-block-start:calc(var(--raqm-spacing) * 4.5);inset-inline-end:calc(var(--raqm-spacing) * 4.5)}@media(forced-colors:active){.raqm-dialog-close{border-color:ButtonText}.raqm-dialog-content{border:1px solid CanvasText}}\n", ".raqm-command-dialog-content{padding:0;gap:0;overflow:hidden;border-radius:var(--raqm-radius-xl);max-block-size:calc(66.6666666667dvh - 1rem)}.raqm-command-dialog-content .raqm-dialog-close{inset-block-start:calc(var(--raqm-spacing) * 2.5);inset-inline-end:calc(var(--raqm-spacing) * 2)}.raqm-command-dialog-header{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"]
501
+ }]
502
+ }],
503
+ propDecorators: {
504
+ showCloseButton: [{
505
+ type: i0.Input,
506
+ args: [{
507
+ isSignal: true,
508
+ alias: "showCloseButton",
509
+ required: false
510
+ }]
511
+ }],
512
+ closeLabel: [{
513
+ type: i0.Input,
514
+ args: [{
515
+ isSignal: true,
516
+ alias: "closeLabel",
517
+ required: false
518
+ }]
519
+ }],
520
+ title: [{
521
+ type: i0.Input,
522
+ args: [{
523
+ isSignal: true,
524
+ alias: "title",
525
+ required: true
526
+ }]
527
+ }],
528
+ description: [{
529
+ type: i0.Input,
530
+ args: [{
531
+ isSignal: true,
532
+ alias: "description",
533
+ required: false
534
+ }]
535
+ }]
536
+ }
537
+ });
538
+ var RaqmCommandInputComponent = class RaqmCommandInputComponent {
539
+ command = inject(RAQM_COMMAND);
540
+ placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
541
+ label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
542
+ disabled = input(false, {
543
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
544
+ transform: booleanAttribute
545
+ });
546
+ control = viewChild("control", ...ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []);
547
+ constructor() {
548
+ this.command.registerInput(() => this.control()?.nativeElement.focus());
549
+ inject(DestroyRef).onDestroy(() => this.command.unregisterInput());
550
+ }
551
+ onInput(event) {
552
+ this.command.search.set(event.target.value);
553
+ }
554
+ static ɵfac = i0.ɵɵngDeclareFactory({
555
+ minVersion: "12.0.0",
556
+ version: "22.2.2",
557
+ ngImport: i0,
558
+ type: RaqmCommandInputComponent,
559
+ deps: [],
560
+ target: i0.ɵɵFactoryTarget.Component
561
+ });
562
+ static ɵcmp = i0.ɵɵngDeclareComponent({
563
+ minVersion: "17.2.0",
564
+ version: "22.2.2",
565
+ type: RaqmCommandInputComponent,
566
+ isStandalone: true,
567
+ selector: "raqm-command-input",
568
+ inputs: {
569
+ placeholder: {
570
+ classPropertyName: "placeholder",
571
+ publicName: "placeholder",
572
+ isSignal: true,
573
+ isRequired: false,
574
+ transformFunction: null
575
+ },
576
+ label: {
577
+ classPropertyName: "label",
578
+ publicName: "label",
579
+ isSignal: true,
580
+ isRequired: true,
581
+ transformFunction: null
582
+ },
583
+ disabled: {
584
+ classPropertyName: "disabled",
585
+ publicName: "disabled",
586
+ isSignal: true,
587
+ isRequired: false,
588
+ transformFunction: null
589
+ }
590
+ },
591
+ host: { classAttribute: "raqm-command-input-wrapper" },
592
+ viewQueries: [{
593
+ propertyName: "control",
594
+ first: true,
595
+ predicate: ["control"],
596
+ descendants: true,
597
+ isSignal: true
598
+ }],
599
+ ngImport: i0,
600
+ template: "<raqm-input-group class=\"raqm-command-input-group\">\r\n <input\r\n #control\r\n raqm-input-group-control\r\n class=\"raqm-command-input\"\r\n type=\"text\"\r\n role=\"combobox\"\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n aria-autocomplete=\"list\"\r\n aria-haspopup=\"listbox\"\r\n [id]=\"command.inputId\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-expanded]=\"command.listPresent()\"\r\n [attr.aria-controls]=\"command.listPresent() ? command.listId : null\"\r\n [attr.aria-activedescendant]=\"command.listPresent() ? command.activeId() : null\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [value]=\"command.search()\"\r\n (input)=\"onInput($event)\"\r\n (keydown)=\"command.keydown($event)\"\r\n />\r\n <raqm-input-group-addon>\r\n <svg\r\n class=\"raqm-command-input-icon\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\r\n <path d=\"m21 21-4.3-4.3\" />\r\n </svg>\r\n </raqm-input-group-addon>\r\n</raqm-input-group>\r\n",
601
+ styles: [":host{display:block;padding:var(--raqm-spacing);padding-block-end:0}.raqm-command-input-group.raqm-input-group{block-size:calc(var(--raqm-spacing) * 8);border-color:color-mix(in oklch,var(--raqm-input) 30%,transparent);background:color-mix(in oklch,var(--raqm-input) 30%,transparent);border-radius:var(--raqm-radius-lg)}.raqm-command-input{inline-size:100%;min-inline-size:0;align-self:stretch;padding-inline:calc(var(--raqm-spacing) * 1.5);border:0;outline:none;background:transparent;color:inherit;font:inherit;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}.raqm-command-input::placeholder{color:var(--raqm-muted-foreground)}.raqm-command-input:disabled{cursor:not-allowed;opacity:var(--raqm-disabled-opacity)}.raqm-command-input-icon{inline-size:calc(var(--raqm-spacing) * 4);block-size:calc(var(--raqm-spacing) * 4);flex-shrink:0;opacity:.5}\n"],
602
+ dependencies: [
603
+ {
604
+ kind: "component",
605
+ type: i1.RaqmInputGroupComponent,
606
+ selector: "raqm-input-group"
607
+ },
608
+ {
609
+ kind: "component",
610
+ type: i1.RaqmInputGroupAddonComponent,
611
+ selector: "raqm-input-group-addon",
612
+ inputs: ["align"]
613
+ },
614
+ {
615
+ kind: "directive",
616
+ type: i1.RaqmInputGroupControlDirective,
617
+ selector: "[raqm-input-group-control]"
618
+ }
619
+ ],
620
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
621
+ });
622
+ };
623
+ i0.ɵɵngDeclareClassMetadata({
624
+ minVersion: "12.0.0",
625
+ version: "22.2.2",
626
+ ngImport: i0,
627
+ type: RaqmCommandInputComponent,
628
+ decorators: [{
629
+ type: Component,
630
+ args: [{
631
+ selector: "raqm-command-input",
632
+ imports: [RaqmInputGroup],
633
+ changeDetection: ChangeDetectionStrategy.OnPush,
634
+ host: { class: "raqm-command-input-wrapper" },
635
+ template: "<raqm-input-group class=\"raqm-command-input-group\">\r\n <input\r\n #control\r\n raqm-input-group-control\r\n class=\"raqm-command-input\"\r\n type=\"text\"\r\n role=\"combobox\"\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n aria-autocomplete=\"list\"\r\n aria-haspopup=\"listbox\"\r\n [id]=\"command.inputId\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-expanded]=\"command.listPresent()\"\r\n [attr.aria-controls]=\"command.listPresent() ? command.listId : null\"\r\n [attr.aria-activedescendant]=\"command.listPresent() ? command.activeId() : null\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [value]=\"command.search()\"\r\n (input)=\"onInput($event)\"\r\n (keydown)=\"command.keydown($event)\"\r\n />\r\n <raqm-input-group-addon>\r\n <svg\r\n class=\"raqm-command-input-icon\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\r\n <path d=\"m21 21-4.3-4.3\" />\r\n </svg>\r\n </raqm-input-group-addon>\r\n</raqm-input-group>\r\n",
636
+ styles: [":host{display:block;padding:var(--raqm-spacing);padding-block-end:0}.raqm-command-input-group.raqm-input-group{block-size:calc(var(--raqm-spacing) * 8);border-color:color-mix(in oklch,var(--raqm-input) 30%,transparent);background:color-mix(in oklch,var(--raqm-input) 30%,transparent);border-radius:var(--raqm-radius-lg)}.raqm-command-input{inline-size:100%;min-inline-size:0;align-self:stretch;padding-inline:calc(var(--raqm-spacing) * 1.5);border:0;outline:none;background:transparent;color:inherit;font:inherit;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}.raqm-command-input::placeholder{color:var(--raqm-muted-foreground)}.raqm-command-input:disabled{cursor:not-allowed;opacity:var(--raqm-disabled-opacity)}.raqm-command-input-icon{inline-size:calc(var(--raqm-spacing) * 4);block-size:calc(var(--raqm-spacing) * 4);flex-shrink:0;opacity:.5}\n"]
637
+ }]
638
+ }],
639
+ ctorParameters: () => [],
640
+ propDecorators: {
641
+ placeholder: [{
642
+ type: i0.Input,
643
+ args: [{
644
+ isSignal: true,
645
+ alias: "placeholder",
646
+ required: false
647
+ }]
648
+ }],
649
+ label: [{
650
+ type: i0.Input,
651
+ args: [{
652
+ isSignal: true,
653
+ alias: "label",
654
+ required: true
655
+ }]
656
+ }],
657
+ disabled: [{
658
+ type: i0.Input,
659
+ args: [{
660
+ isSignal: true,
661
+ alias: "disabled",
662
+ required: false
663
+ }]
664
+ }],
665
+ control: [{
666
+ type: i0.ViewChild,
667
+ args: ["control", { isSignal: true }]
668
+ }]
669
+ }
670
+ });
671
+ var RaqmCommandListComponent = class RaqmCommandListComponent {
672
+ command = inject(RAQM_COMMAND);
673
+ label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
674
+ constructor() {
675
+ this.command.listPresent.set(true);
676
+ inject(DestroyRef).onDestroy(() => this.command.listPresent.set(false));
677
+ }
678
+ static ɵfac = i0.ɵɵngDeclareFactory({
679
+ minVersion: "12.0.0",
680
+ version: "22.2.2",
681
+ ngImport: i0,
682
+ type: RaqmCommandListComponent,
683
+ deps: [],
684
+ target: i0.ɵɵFactoryTarget.Component
685
+ });
686
+ static ɵcmp = i0.ɵɵngDeclareComponent({
687
+ minVersion: "17.1.0",
688
+ version: "22.2.2",
689
+ type: RaqmCommandListComponent,
690
+ isStandalone: true,
691
+ selector: "raqm-command-list",
692
+ inputs: { label: {
693
+ classPropertyName: "label",
694
+ publicName: "label",
695
+ isSignal: true,
696
+ isRequired: false,
697
+ transformFunction: null
698
+ } },
699
+ host: {
700
+ attributes: { "role": "listbox" },
701
+ properties: {
702
+ "id": "command.listId",
703
+ "attr.aria-label": "label() || command.label()",
704
+ "attr.aria-multiselectable": "command.hasChecked() ? \"true\" : null"
705
+ },
706
+ classAttribute: "raqm-command-list"
707
+ },
708
+ ngImport: i0,
709
+ template: "<ng-content />",
710
+ isInline: true,
711
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"],
712
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
713
+ });
714
+ };
715
+ i0.ɵɵngDeclareClassMetadata({
716
+ minVersion: "12.0.0",
717
+ version: "22.2.2",
718
+ ngImport: i0,
719
+ type: RaqmCommandListComponent,
720
+ decorators: [{
721
+ type: Component,
722
+ args: [{
723
+ selector: "raqm-command-list",
724
+ template: "<ng-content />",
725
+ changeDetection: ChangeDetectionStrategy.OnPush,
726
+ host: {
727
+ class: "raqm-command-list",
728
+ role: "listbox",
729
+ "[id]": "command.listId",
730
+ "[attr.aria-label]": "label() || command.label()",
731
+ "[attr.aria-multiselectable]": "command.hasChecked() ? \"true\" : null"
732
+ },
733
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"]
734
+ }]
735
+ }],
736
+ ctorParameters: () => [],
737
+ propDecorators: { label: [{
738
+ type: i0.Input,
739
+ args: [{
740
+ isSignal: true,
741
+ alias: "label",
742
+ required: false
743
+ }]
744
+ }] }
745
+ });
746
+ var RaqmCommandEmptyComponent = class RaqmCommandEmptyComponent {
747
+ command = inject(RAQM_COMMAND);
748
+ static ɵfac = i0.ɵɵngDeclareFactory({
749
+ minVersion: "12.0.0",
750
+ version: "22.2.2",
751
+ ngImport: i0,
752
+ type: RaqmCommandEmptyComponent,
753
+ deps: [],
754
+ target: i0.ɵɵFactoryTarget.Component
755
+ });
756
+ static ɵcmp = i0.ɵɵngDeclareComponent({
757
+ minVersion: "14.0.0",
758
+ version: "22.2.2",
759
+ type: RaqmCommandEmptyComponent,
760
+ isStandalone: true,
761
+ selector: "raqm-command-empty",
762
+ host: {
763
+ attributes: { "role": "presentation" },
764
+ properties: { "hidden": "command.visibleItems().length !== 0" },
765
+ classAttribute: "raqm-command-empty"
766
+ },
767
+ ngImport: i0,
768
+ template: "<ng-content />",
769
+ isInline: true,
770
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"],
771
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
772
+ });
773
+ };
774
+ i0.ɵɵngDeclareClassMetadata({
775
+ minVersion: "12.0.0",
776
+ version: "22.2.2",
777
+ ngImport: i0,
778
+ type: RaqmCommandEmptyComponent,
779
+ decorators: [{
780
+ type: Component,
781
+ args: [{
782
+ selector: "raqm-command-empty",
783
+ template: "<ng-content />",
784
+ changeDetection: ChangeDetectionStrategy.OnPush,
785
+ host: {
786
+ class: "raqm-command-empty",
787
+ role: "presentation",
788
+ "[hidden]": "command.visibleItems().length !== 0"
789
+ },
790
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"]
791
+ }]
792
+ }]
793
+ });
794
+ let nextGroupId = 0;
795
+ var RaqmCommandGroupComponent = class RaqmCommandGroupComponent {
796
+ command = inject(RAQM_COMMAND);
797
+ id = `raqm-command-group-${++nextGroupId}`;
798
+ headingId = `${this.id}-heading`;
799
+ heading = input("", ...ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []);
800
+ label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
801
+ visible = computed(() => this.command.visibleItems().some((item) => item.group === this.id), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
802
+ ngOnInit() {
803
+ if (isDevMode() && !this.heading() && !this.label()) console.error("[raqm-command-group] The group has no accessible name. Provide a `heading` or a `label`.");
804
+ }
805
+ static ɵfac = i0.ɵɵngDeclareFactory({
806
+ minVersion: "12.0.0",
807
+ version: "22.2.2",
808
+ ngImport: i0,
809
+ type: RaqmCommandGroupComponent,
810
+ deps: [],
811
+ target: i0.ɵɵFactoryTarget.Component
812
+ });
813
+ static ɵcmp = i0.ɵɵngDeclareComponent({
814
+ minVersion: "17.0.0",
815
+ version: "22.2.2",
816
+ type: RaqmCommandGroupComponent,
817
+ isStandalone: true,
818
+ selector: "raqm-command-group",
819
+ inputs: {
820
+ heading: {
821
+ classPropertyName: "heading",
822
+ publicName: "heading",
823
+ isSignal: true,
824
+ isRequired: false,
825
+ transformFunction: null
826
+ },
827
+ label: {
828
+ classPropertyName: "label",
829
+ publicName: "label",
830
+ isSignal: true,
831
+ isRequired: false,
832
+ transformFunction: null
833
+ }
834
+ },
835
+ host: {
836
+ attributes: { "role": "group" },
837
+ properties: {
838
+ "attr.aria-labelledby": "heading() ? headingId : null",
839
+ "attr.aria-label": "heading() ? null : label()",
840
+ "hidden": "!visible()"
841
+ },
842
+ classAttribute: "raqm-command-group"
843
+ },
844
+ providers: [{
845
+ provide: RAQM_COMMAND_GROUP,
846
+ useFactory: () => inject(RaqmCommandGroupComponent).id
847
+ }],
848
+ ngImport: i0,
849
+ template: "@if (heading()) { <div class=\"raqm-command-group-heading\" [id]=\"headingId\">{{ heading() }}</div> }<ng-content />",
850
+ isInline: true,
851
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"],
852
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
853
+ });
854
+ };
855
+ i0.ɵɵngDeclareClassMetadata({
856
+ minVersion: "12.0.0",
857
+ version: "22.2.2",
858
+ ngImport: i0,
859
+ type: RaqmCommandGroupComponent,
860
+ decorators: [{
861
+ type: Component,
862
+ args: [{
863
+ selector: "raqm-command-group",
864
+ template: "@if (heading()) { <div class=\"raqm-command-group-heading\" [id]=\"headingId\">{{ heading() }}</div> }<ng-content />",
865
+ changeDetection: ChangeDetectionStrategy.OnPush,
866
+ providers: [{
867
+ provide: RAQM_COMMAND_GROUP,
868
+ useFactory: () => inject(RaqmCommandGroupComponent).id
869
+ }],
870
+ host: {
871
+ class: "raqm-command-group",
872
+ role: "group",
873
+ "[attr.aria-labelledby]": "heading() ? headingId : null",
874
+ "[attr.aria-label]": "heading() ? null : label()",
875
+ "[hidden]": "!visible()"
876
+ },
877
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"]
878
+ }]
879
+ }],
880
+ propDecorators: {
881
+ heading: [{
882
+ type: i0.Input,
883
+ args: [{
884
+ isSignal: true,
885
+ alias: "heading",
886
+ required: false
887
+ }]
888
+ }],
889
+ label: [{
890
+ type: i0.Input,
891
+ args: [{
892
+ isSignal: true,
893
+ alias: "label",
894
+ required: false
895
+ }]
896
+ }]
897
+ }
898
+ });
899
+ var RaqmCommandSeparatorDirective = class RaqmCommandSeparatorDirective {
900
+ command = inject(RAQM_COMMAND);
901
+ alwaysRender = input(false, {
902
+ ...ngDevMode ? { debugName: "alwaysRender" } : /* istanbul ignore next */ {},
903
+ transform: booleanAttribute
904
+ });
905
+ static ɵfac = i0.ɵɵngDeclareFactory({
906
+ minVersion: "12.0.0",
907
+ version: "22.2.2",
908
+ ngImport: i0,
909
+ type: RaqmCommandSeparatorDirective,
910
+ deps: [],
911
+ target: i0.ɵɵFactoryTarget.Directive
912
+ });
913
+ static ɵdir = i0.ɵɵngDeclareDirective({
914
+ minVersion: "17.1.0",
915
+ version: "22.2.2",
916
+ type: RaqmCommandSeparatorDirective,
917
+ isStandalone: true,
918
+ selector: "[raqm-command-separator]",
919
+ inputs: { alwaysRender: {
920
+ classPropertyName: "alwaysRender",
921
+ publicName: "alwaysRender",
922
+ isSignal: true,
923
+ isRequired: false,
924
+ transformFunction: null
925
+ } },
926
+ host: {
927
+ attributes: { "role": "presentation" },
928
+ properties: { "hidden": "!alwaysRender() && command.search().trim().length > 0" },
929
+ classAttribute: "raqm-command-separator"
930
+ },
931
+ ngImport: i0
932
+ });
933
+ };
934
+ i0.ɵɵngDeclareClassMetadata({
935
+ minVersion: "12.0.0",
936
+ version: "22.2.2",
937
+ ngImport: i0,
938
+ type: RaqmCommandSeparatorDirective,
939
+ decorators: [{
940
+ type: Directive,
941
+ args: [{
942
+ selector: "[raqm-command-separator]",
943
+ host: {
944
+ class: "raqm-command-separator",
945
+ role: "presentation",
946
+ "[hidden]": "!alwaysRender() && command.search().trim().length > 0"
947
+ }
948
+ }]
949
+ }],
950
+ propDecorators: { alwaysRender: [{
951
+ type: i0.Input,
952
+ args: [{
953
+ isSignal: true,
954
+ alias: "alwaysRender",
955
+ required: false
956
+ }]
957
+ }] }
958
+ });
959
+ var RaqmCommandItemComponent = class RaqmCommandItemComponent {
960
+ command = inject(RAQM_COMMAND);
961
+ host = inject(ElementRef);
962
+ group = inject(RAQM_COMMAND_GROUP, { optional: true });
963
+ id = this.command.mintId();
964
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
965
+ title = input("", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
966
+ keywords = input([], ...ngDevMode ? [{ debugName: "keywords" }] : /* istanbul ignore next */ []);
967
+ disabledValue = input(false, {
968
+ ...ngDevMode ? { debugName: "disabledValue" } : /* istanbul ignore next */ {},
969
+ alias: "disabled",
970
+ transform: booleanAttribute
971
+ });
972
+ checked = input(false, {
973
+ ...ngDevMode ? { debugName: "checked" } : /* istanbul ignore next */ {},
974
+ transform: booleanAttribute
975
+ });
976
+ selected = output();
977
+ get disabled() {
978
+ return this.disabledValue();
979
+ }
980
+ get element() {
981
+ return this.host.nativeElement;
982
+ }
983
+ constructor() {
984
+ inject(DestroyRef).onDestroy(() => this.command.unregister(this));
985
+ }
986
+ ngOnInit() {
987
+ this.command.register(this);
988
+ }
989
+ setActiveStyles() {
990
+ this.command.activeId.set(this.id);
991
+ }
992
+ setInactiveStyles() {
993
+ if (this.command.activeId() === this.id) this.command.activeId.set(null);
994
+ }
995
+ select() {
996
+ this.selected.emit(this.value());
997
+ }
998
+ scrollIntoView() {
999
+ this.host.nativeElement.scrollIntoView({ block: "nearest" });
1000
+ }
1001
+ onPointerMove(event) {
1002
+ if (event.pointerType !== "touch") this.command.activate(this);
1003
+ }
1004
+ static ɵfac = i0.ɵɵngDeclareFactory({
1005
+ minVersion: "12.0.0",
1006
+ version: "22.2.2",
1007
+ ngImport: i0,
1008
+ type: RaqmCommandItemComponent,
1009
+ deps: [],
1010
+ target: i0.ɵɵFactoryTarget.Component
1011
+ });
1012
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1013
+ minVersion: "17.1.0",
1014
+ version: "22.2.2",
1015
+ type: RaqmCommandItemComponent,
1016
+ isStandalone: true,
1017
+ selector: "raqm-command-item",
1018
+ inputs: {
1019
+ value: {
1020
+ classPropertyName: "value",
1021
+ publicName: "value",
1022
+ isSignal: true,
1023
+ isRequired: true,
1024
+ transformFunction: null
1025
+ },
1026
+ title: {
1027
+ classPropertyName: "title",
1028
+ publicName: "title",
1029
+ isSignal: true,
1030
+ isRequired: false,
1031
+ transformFunction: null
1032
+ },
1033
+ keywords: {
1034
+ classPropertyName: "keywords",
1035
+ publicName: "keywords",
1036
+ isSignal: true,
1037
+ isRequired: false,
1038
+ transformFunction: null
1039
+ },
1040
+ disabledValue: {
1041
+ classPropertyName: "disabledValue",
1042
+ publicName: "disabled",
1043
+ isSignal: true,
1044
+ isRequired: false,
1045
+ transformFunction: null
1046
+ },
1047
+ checked: {
1048
+ classPropertyName: "checked",
1049
+ publicName: "checked",
1050
+ isSignal: true,
1051
+ isRequired: false,
1052
+ transformFunction: null
1053
+ }
1054
+ },
1055
+ outputs: { selected: "selected" },
1056
+ host: {
1057
+ attributes: { "role": "option" },
1058
+ listeners: {
1059
+ "pointermove": "onPointerMove($event)",
1060
+ "mousedown": "$event.preventDefault()",
1061
+ "click": "command.select(this)"
1062
+ },
1063
+ properties: {
1064
+ "id": "id",
1065
+ "hidden": "!command.matches(this)",
1066
+ "attr.aria-label": "title() || value()",
1067
+ "attr.aria-checked": "command.hasChecked() ? (checked() ? \"true\" : \"false\") : null",
1068
+ "attr.aria-disabled": "disabled ? \"true\" : null",
1069
+ "attr.data-raqm-selected": "command.activeId() === id ? \"true\" : null",
1070
+ "attr.data-raqm-disabled": "disabled ? \"true\" : null",
1071
+ "attr.data-raqm-checked": "checked() ? \"true\" : null"
1072
+ },
1073
+ classAttribute: "raqm-command-item"
1074
+ },
1075
+ ngImport: i0,
1076
+ template: "<ng-content /><svg class=\"raqm-command-item-indicator\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"m20 6-11 11-5-5\"/></svg>",
1077
+ isInline: true,
1078
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"],
1079
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1080
+ });
1081
+ };
1082
+ i0.ɵɵngDeclareClassMetadata({
1083
+ minVersion: "12.0.0",
1084
+ version: "22.2.2",
1085
+ ngImport: i0,
1086
+ type: RaqmCommandItemComponent,
1087
+ decorators: [{
1088
+ type: Component,
1089
+ args: [{
1090
+ selector: "raqm-command-item",
1091
+ template: "<ng-content /><svg class=\"raqm-command-item-indicator\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"m20 6-11 11-5-5\"/></svg>",
1092
+ changeDetection: ChangeDetectionStrategy.OnPush,
1093
+ host: {
1094
+ class: "raqm-command-item",
1095
+ role: "option",
1096
+ "[id]": "id",
1097
+ "[hidden]": "!command.matches(this)",
1098
+ "[attr.aria-label]": "title() || value()",
1099
+ "[attr.aria-checked]": "command.hasChecked() ? (checked() ? \"true\" : \"false\") : null",
1100
+ "[attr.aria-disabled]": "disabled ? \"true\" : null",
1101
+ "[attr.data-raqm-selected]": "command.activeId() === id ? \"true\" : null",
1102
+ "[attr.data-raqm-disabled]": "disabled ? \"true\" : null",
1103
+ "[attr.data-raqm-checked]": "checked() ? \"true\" : null",
1104
+ "(pointermove)": "onPointerMove($event)",
1105
+ "(mousedown)": "$event.preventDefault()",
1106
+ "(click)": "command.select(this)"
1107
+ },
1108
+ styles: [":host(.raqm-command-list){display:block;min-block-size:0;max-block-size:calc(var(--raqm-spacing) * 72);overflow-x:hidden;overflow-y:auto;scrollbar-width:none;scroll-padding-block:var(--raqm-spacing);outline:none}:host(.raqm-command-group){display:block;overflow:hidden;padding:var(--raqm-spacing);color:var(--raqm-foreground)}.raqm-command-group-heading{padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);color:var(--raqm-muted-foreground);font-size:var(--raqm-font-size-xs);line-height:calc(var(--raqm-spacing) * 4);font-weight:var(--raqm-font-weight-medium)}:host(.raqm-command-empty){display:block;padding-block:calc(var(--raqm-spacing) * 6);text-align:center;font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5)}:host(.raqm-command-item){position:relative;display:flex;align-items:center;gap:calc(var(--raqm-spacing) * 2);padding-inline:calc(var(--raqm-spacing) * 2);padding-block:calc(var(--raqm-spacing) * 1.5);border-radius:var(--raqm-radius-sm);font-size:var(--raqm-font-size-sm);line-height:calc(var(--raqm-spacing) * 5);cursor:default;outline:none;-webkit-user-select:none;user-select:none}:host(.raqm-command-item[data-raqm-selected=true]){background:var(--raqm-muted);color:var(--raqm-foreground)}:host(.raqm-command-item[data-raqm-disabled=true]){pointer-events:none;opacity:var(--raqm-disabled-opacity)}.raqm-command-item-indicator{margin-inline-start:auto;opacity:0}:host([data-raqm-checked=true]) .raqm-command-item-indicator{opacity:1}:host([hidden]){display:none}@media(forced-colors:active){:host(.raqm-command-item[data-raqm-selected=true]){outline:1px solid Highlight}}\n"]
1109
+ }]
1110
+ }],
1111
+ ctorParameters: () => [],
1112
+ propDecorators: {
1113
+ value: [{
1114
+ type: i0.Input,
1115
+ args: [{
1116
+ isSignal: true,
1117
+ alias: "value",
1118
+ required: true
1119
+ }]
1120
+ }],
1121
+ title: [{
1122
+ type: i0.Input,
1123
+ args: [{
1124
+ isSignal: true,
1125
+ alias: "title",
1126
+ required: false
1127
+ }]
1128
+ }],
1129
+ keywords: [{
1130
+ type: i0.Input,
1131
+ args: [{
1132
+ isSignal: true,
1133
+ alias: "keywords",
1134
+ required: false
1135
+ }]
1136
+ }],
1137
+ disabledValue: [{
1138
+ type: i0.Input,
1139
+ args: [{
1140
+ isSignal: true,
1141
+ alias: "disabled",
1142
+ required: false
1143
+ }]
1144
+ }],
1145
+ checked: [{
1146
+ type: i0.Input,
1147
+ args: [{
1148
+ isSignal: true,
1149
+ alias: "checked",
1150
+ required: false
1151
+ }]
1152
+ }],
1153
+ selected: [{
1154
+ type: i0.Output,
1155
+ args: ["selected"]
1156
+ }]
1157
+ }
1158
+ });
1159
+ var RaqmCommandShortcutDirective = class RaqmCommandShortcutDirective {
1160
+ static ɵfac = i0.ɵɵngDeclareFactory({
1161
+ minVersion: "12.0.0",
1162
+ version: "22.2.2",
1163
+ ngImport: i0,
1164
+ type: RaqmCommandShortcutDirective,
1165
+ deps: [],
1166
+ target: i0.ɵɵFactoryTarget.Directive
1167
+ });
1168
+ static ɵdir = i0.ɵɵngDeclareDirective({
1169
+ minVersion: "14.0.0",
1170
+ version: "22.2.2",
1171
+ type: RaqmCommandShortcutDirective,
1172
+ isStandalone: true,
1173
+ selector: "[raqm-command-shortcut]",
1174
+ host: {
1175
+ attributes: { "aria-hidden": "true" },
1176
+ classAttribute: "raqm-command-shortcut"
1177
+ },
1178
+ ngImport: i0
1179
+ });
1180
+ };
1181
+ i0.ɵɵngDeclareClassMetadata({
1182
+ minVersion: "12.0.0",
1183
+ version: "22.2.2",
1184
+ ngImport: i0,
1185
+ type: RaqmCommandShortcutDirective,
1186
+ decorators: [{
1187
+ type: Directive,
1188
+ args: [{
1189
+ selector: "[raqm-command-shortcut]",
1190
+ host: {
1191
+ class: "raqm-command-shortcut",
1192
+ "aria-hidden": "true"
1193
+ }
1194
+ }]
1195
+ }]
1196
+ });
1197
+ const RaqmCommand = [
1198
+ RaqmCommandComponent,
1199
+ RaqmCommandDialogComponent,
1200
+ RaqmCommandInputComponent,
1201
+ RaqmCommandListComponent,
1202
+ RaqmCommandEmptyComponent,
1203
+ RaqmCommandGroupComponent,
1204
+ RaqmCommandSeparatorDirective,
1205
+ RaqmCommandItemComponent,
1206
+ RaqmCommandShortcutDirective
1207
+ ];
1208
+ export { RaqmCommand, RaqmCommandComponent, RaqmCommandDialogComponent, RaqmCommandEmptyComponent, RaqmCommandGroupComponent, RaqmCommandInputComponent, RaqmCommandItemComponent, RaqmCommandListComponent, RaqmCommandSeparatorDirective, RaqmCommandShortcutDirective };
1209
+
1210
+ //# sourceMappingURL=raqm-ui-command.mjs.map