stimeo-ui 0.1.0.pre.beta.3 → 0.2.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +149 -0
  3. data/README.md +6 -6
  4. data/dist/controllers/alert_dialog_controller.js +318 -0
  5. data/dist/controllers/auto_submit_controller.js +56 -21
  6. data/dist/controllers/carousel_controller.js +272 -0
  7. data/dist/controllers/character_counter_controller.js +52 -15
  8. data/dist/controllers/clipboard_controller.js +144 -0
  9. data/dist/controllers/collapsible_controller.js +327 -0
  10. data/dist/controllers/color_picker_controller.js +213 -0
  11. data/dist/controllers/combobox_controller.js +64 -3
  12. data/dist/controllers/command_palette_controller.js +243 -39
  13. data/dist/controllers/confirm_controller.js +94 -8
  14. data/dist/controllers/context_menu_controller.js +191 -13
  15. data/dist/controllers/count_up_controller.js +8 -1
  16. data/dist/controllers/countdown_controller.js +2 -2
  17. data/dist/controllers/currency_input_controller.js +147 -0
  18. data/dist/controllers/data_grid_controller.js +168 -0
  19. data/dist/controllers/date_range_picker_controller.js +417 -0
  20. data/dist/controllers/dialog_controller.js +94 -8
  21. data/dist/controllers/dismissible_controller.js +117 -0
  22. data/dist/controllers/drawer_controller.js +630 -0
  23. data/dist/controllers/dropdown_controller.js +139 -16
  24. data/dist/controllers/editable_controller.js +168 -0
  25. data/dist/controllers/file_dropzone_controller.js +165 -0
  26. data/dist/controllers/filter_controller.js +86 -0
  27. data/dist/controllers/flash_controller.js +36 -5
  28. data/dist/controllers/focus_controller.js +94 -8
  29. data/dist/controllers/form_validation_controller.js +2 -2
  30. data/dist/controllers/highlight_controller.js +6 -4
  31. data/dist/controllers/hover_card_controller.js +103 -27
  32. data/dist/controllers/intersection_controller.js +41 -18
  33. data/dist/controllers/lazy_frame_controller.js +33 -11
  34. data/dist/controllers/listbox_controller.js +1 -0
  35. data/dist/controllers/masonry_controller.js +142 -0
  36. data/dist/controllers/menu_controller.js +181 -8
  37. data/dist/controllers/menubar_controller.js +433 -0
  38. data/dist/controllers/multi_select_controller.js +472 -0
  39. data/dist/controllers/navigation_menu_controller.js +384 -0
  40. data/dist/controllers/otp_controller.js +62 -22
  41. data/dist/controllers/overflow_indicator_controller.js +178 -27
  42. data/dist/controllers/password_reveal_controller.js +117 -0
  43. data/dist/controllers/pointer_drag_controller.js +3 -3
  44. data/dist/controllers/popover_controller.js +118 -27
  45. data/dist/controllers/range_slider_controller.js +166 -0
  46. data/dist/controllers/read_more_controller.js +194 -0
  47. data/dist/controllers/scroll_area_controller.js +15 -2
  48. data/dist/controllers/scroll_restore_controller.js +93 -0
  49. data/dist/controllers/scroll_visibility_controller.js +8 -4
  50. data/dist/controllers/scrollspy_controller.js +33 -11
  51. data/dist/controllers/separator_controller.js +87 -0
  52. data/dist/controllers/sidebar_controller.js +761 -0
  53. data/dist/controllers/stepper_controller.js +28 -12
  54. data/dist/controllers/stick_to_bottom_controller.js +8 -4
  55. data/dist/controllers/sticky_observer_controller.js +88 -20
  56. data/dist/controllers/tags_input_controller.js +275 -0
  57. data/dist/controllers/theme_controller.js +20 -10
  58. data/dist/controllers/time_picker_controller.js +212 -0
  59. data/dist/controllers/toast_controller.js +144 -38
  60. data/dist/controllers/tooltip_controller.js +148 -42
  61. data/dist/controllers/transition_controller.js +153 -38
  62. data/dist/controllers/tree_view_controller.js +275 -0
  63. data/dist/index.js +1644 -643
  64. data/lib/stimeo/ui/version.rb +5 -4
  65. metadata +28 -2
@@ -0,0 +1,272 @@
1
+ import { Controller } from '@hotwired/stimulus';
2
+
3
+ // src/controllers/carousel_controller.ts
4
+
5
+ // src/utils/roving_tabindex.ts
6
+ var RovingTabindex = class {
7
+ /** Returns the current ordered item elements; called on every operation. */
8
+ #getItems;
9
+ /**
10
+ * @param getItems - Returns the current ordered item elements. Called on every
11
+ * operation so the live target list is always used.
12
+ */
13
+ constructor(getItems) {
14
+ this.#getItems = getItems;
15
+ }
16
+ /** Index of the currently tabbable item (`tabindex="0"`), or `-1` if none. */
17
+ get activeIndex() {
18
+ return this.#getItems().findIndex((item) => item.tabIndex === 0);
19
+ }
20
+ /**
21
+ * Makes exactly the item at `index` tabbable (`tabindex="0"`) and removes every
22
+ * other item from the Tab sequence (`tabindex="-1"`). An out-of-range `index`
23
+ * (e.g. `-1`) leaves all items at `-1`, which a controller can use to express
24
+ * "nothing is currently tabbable".
25
+ *
26
+ * @param index - Position of the item to make tabbable.
27
+ * @param options - Pass `{ focus: true }` to also move DOM focus to that item.
28
+ */
29
+ setActive(index, { focus = false } = {}) {
30
+ const items = this.#getItems();
31
+ items.forEach((item, i) => {
32
+ item.tabIndex = i === index ? 0 : -1;
33
+ });
34
+ if (focus) items[index]?.focus();
35
+ }
36
+ };
37
+ function rovingMove(current, length, delta, wrap) {
38
+ if (length === 0) return -1;
39
+ const next = current + delta;
40
+ return (next + length) % length;
41
+ }
42
+
43
+ // src/utils/safe_timeout.ts
44
+ var TimerRegistry = class {
45
+ /** Live timer ids that have not yet been cleared (or, for timeouts, fired). */
46
+ ids = /* @__PURE__ */ new Set();
47
+ /**
48
+ * Cancels a single tracked timer.
49
+ *
50
+ * No-ops if the id is unknown (already cleared, fired, or never owned by this
51
+ * registry), so callers can clear defensively without guarding.
52
+ */
53
+ clear(id) {
54
+ if (this.ids.delete(id)) {
55
+ this.cancel(id);
56
+ }
57
+ }
58
+ /**
59
+ * Cancels every tracked timer. Call this from a controller's `disconnect()`
60
+ * to guarantee no timer outlives the element.
61
+ */
62
+ clearAll() {
63
+ for (const id of this.ids) {
64
+ this.cancel(id);
65
+ }
66
+ this.ids.clear();
67
+ }
68
+ /** Number of timers currently tracked (pending). */
69
+ get size() {
70
+ return this.ids.size;
71
+ }
72
+ };
73
+ var SafeInterval = class extends TimerRegistry {
74
+ /** Schedules a repeating `callback` every `delay` ms and returns the timer id. */
75
+ set(callback, delay) {
76
+ const id = this.schedule(callback, delay);
77
+ this.ids.add(id);
78
+ return id;
79
+ }
80
+ schedule(callback, delay) {
81
+ return window.setInterval(callback, delay);
82
+ }
83
+ cancel(id) {
84
+ window.clearInterval(id);
85
+ }
86
+ };
87
+
88
+ // src/controllers/carousel_controller.ts
89
+ var CarouselController = class extends Controller {
90
+ static targets = ["slide", "viewport", "prev", "next", "picker", "playToggle"];
91
+ static values = {
92
+ autoplay: { type: Boolean, default: false },
93
+ interval: { type: Number, default: 5e3 },
94
+ loop: { type: Boolean, default: true }
95
+ };
96
+ static actions = [
97
+ "goto",
98
+ "next",
99
+ "onPickerKeydown",
100
+ "pause",
101
+ "prev",
102
+ "resume",
103
+ "togglePlay"
104
+ ];
105
+ static events = ["change", "pause", "play"];
106
+ #roving = new RovingTabindex(() => this.pickerTargets);
107
+ #intervals = new SafeInterval();
108
+ /** Index of the visible slide. */
109
+ #index = 0;
110
+ /** User intent to autoplay (toggled by the play button / focus hard-stop). */
111
+ #playing = false;
112
+ /** Pointer is hovering the carousel: a temporary, auto-resuming suspension. */
113
+ #pointerPaused = false;
114
+ /** Id of the live autoplay interval, or null when stopped. */
115
+ #timerId = null;
116
+ /** Renders the initial slide and starts autoplay when requested. */
117
+ connect() {
118
+ const preselected = this.pickerTargets.findIndex(
119
+ (picker) => picker.getAttribute("aria-selected") === "true"
120
+ );
121
+ this.#index = preselected === -1 ? 0 : preselected;
122
+ this.#playing = this.#initialPlaying();
123
+ this.#render({ focus: false });
124
+ this.#syncTimer();
125
+ }
126
+ /**
127
+ * Resolves the starting autoplay intent. The play toggle's `aria-pressed` is the
128
+ * source of truth **when present**, so a Turbo Drive cache restore / morph that
129
+ * re-runs `connect()` against existing DOM does not silently resume autoplay the
130
+ * user had stopped (e.g. by focusing into the carousel). Only when no toggle
131
+ * carries `aria-pressed` does it fall back to the declarative `autoplay` value.
132
+ */
133
+ #initialPlaying() {
134
+ if (this.hasPlayToggleTarget && this.playToggleTarget.hasAttribute("aria-pressed")) {
135
+ return this.playToggleTarget.getAttribute("aria-pressed") === "true";
136
+ }
137
+ return this.autoplayValue;
138
+ }
139
+ /** Clears the autoplay interval so it never fires after teardown. */
140
+ disconnect() {
141
+ this.#intervals.clearAll();
142
+ this.#timerId = null;
143
+ }
144
+ /** Advances to the next slide. Bound via `data-action`. */
145
+ next() {
146
+ this.#select(this.#step(1), { focus: false });
147
+ }
148
+ /** Returns to the previous slide. Bound via `data-action`. */
149
+ prev() {
150
+ this.#select(this.#step(-1), { focus: false });
151
+ }
152
+ /** Jumps to the slide whose picker was activated (click / Enter / Space). */
153
+ goto(event) {
154
+ const target = event.currentTarget;
155
+ const index = this.pickerTargets.indexOf(target);
156
+ if (index !== -1) this.#select(index, { focus: false });
157
+ }
158
+ /** Toggles autoplay on the user's explicit request and syncs the timer. */
159
+ togglePlay() {
160
+ this.#playing = !this.#playing;
161
+ this.#syncTimer();
162
+ }
163
+ /**
164
+ * Suspends autoplay. Hover (`mouseenter`) is a temporary suspension that resumes
165
+ * on leave; keyboard focus (`focusin`) is a hard stop that turns autoplay off so
166
+ * it cannot resume without an explicit play (WCAG 2.2.2).
167
+ */
168
+ pause(event) {
169
+ if (event?.type.startsWith("focus")) {
170
+ this.#playing = false;
171
+ } else {
172
+ this.#pointerPaused = true;
173
+ }
174
+ this.#syncTimer();
175
+ }
176
+ /**
177
+ * Lifts a hover suspension (`mouseleave`) and resumes autoplay if it is still
178
+ * on. A `focusout` does nothing here: the focus pause was a hard stop, so the
179
+ * user must press play to restart.
180
+ */
181
+ resume(event) {
182
+ if (event?.type.startsWith("focus")) return;
183
+ this.#pointerPaused = false;
184
+ this.#syncTimer();
185
+ }
186
+ /** Picker roving: arrows move focus only; Home/End activate first/last slide. */
187
+ onPickerKeydown(event) {
188
+ const current = this.pickerTargets.indexOf(event.currentTarget);
189
+ if (current === -1) return;
190
+ const length = this.pickerTargets.length;
191
+ switch (event.key) {
192
+ case "ArrowRight":
193
+ case "ArrowDown":
194
+ event.preventDefault();
195
+ this.#roving.setActive(rovingMove(current, length, 1), { focus: true });
196
+ return;
197
+ case "ArrowLeft":
198
+ case "ArrowUp":
199
+ event.preventDefault();
200
+ this.#roving.setActive(rovingMove(current, length, -1), { focus: true });
201
+ return;
202
+ case "Home":
203
+ event.preventDefault();
204
+ this.#select(0, { focus: true });
205
+ return;
206
+ case "End":
207
+ event.preventDefault();
208
+ this.#select(length - 1, { focus: true });
209
+ return;
210
+ }
211
+ }
212
+ /** Resolves the index one step away from the current one, honoring `loop`. */
213
+ #step(delta) {
214
+ const total = this.slideTargets.length;
215
+ if (total === 0) return 0;
216
+ const next = this.#index + delta;
217
+ if (this.loopValue) return (next + total) % total;
218
+ return Math.min(total - 1, Math.max(0, next));
219
+ }
220
+ /**
221
+ * Changes the active slide, updates state hooks, and emits `change` — but only
222
+ * when the index actually changes, so a `next`/`prev` clamped at the end (or an
223
+ * autoplay tick at a non-looping boundary) re-renders without a spurious event
224
+ * (matching the "emit on real change" policy of flash/masonry/bulk-select).
225
+ */
226
+ #select(index, { focus }) {
227
+ const changed = index !== this.#index;
228
+ this.#index = index;
229
+ this.#render({ focus });
230
+ this.#syncTimer();
231
+ if (changed) this.dispatch("change", { detail: { index, total: this.slideTargets.length } });
232
+ }
233
+ /** Reflects `this.#index` onto slides and pickers (state hooks + roving). */
234
+ #render({ focus }) {
235
+ this.slideTargets.forEach((slide, i) => {
236
+ const active = i === this.#index;
237
+ slide.setAttribute("data-state", active ? "active" : "inactive");
238
+ slide.hidden = !active;
239
+ });
240
+ this.pickerTargets.forEach((picker, i) => {
241
+ picker.setAttribute("aria-selected", i === this.#index ? "true" : "false");
242
+ });
243
+ this.#roving.setActive(this.#index, { focus });
244
+ }
245
+ /**
246
+ * Drives the autoplay interval toward the desired state. Autoplay should run
247
+ * only when the user wants it (`playing`), the pointer is not hovering, and more
248
+ * than one slide exists. Transitions emit `play`/`pause` and keep the toggle's
249
+ * `aria-pressed` in sync.
250
+ */
251
+ #syncTimer() {
252
+ if (!this.loopValue && this.#index >= this.slideTargets.length - 1) {
253
+ this.#playing = false;
254
+ }
255
+ const shouldRun = this.#playing && !this.#pointerPaused && this.slideTargets.length > 1;
256
+ if (shouldRun && this.#timerId === null) {
257
+ this.#timerId = this.#intervals.set(() => this.next(), this.intervalValue);
258
+ this.dispatch("play");
259
+ } else if (!shouldRun && this.#timerId !== null) {
260
+ this.#intervals.clear(this.#timerId);
261
+ this.#timerId = null;
262
+ this.dispatch("pause");
263
+ }
264
+ if (this.hasPlayToggleTarget) {
265
+ this.playToggleTarget.setAttribute("aria-pressed", this.#playing ? "true" : "false");
266
+ }
267
+ }
268
+ };
269
+
270
+ export { CarouselController };
271
+ //# sourceMappingURL=carousel_controller.js.map
272
+ //# sourceMappingURL=carousel_controller.js.map
@@ -2,6 +2,53 @@ import { Controller } from '@hotwired/stimulus';
2
2
 
3
3
  // src/controllers/character_counter_controller.ts
4
4
 
5
+ // src/utils/composition_tracker.ts
6
+ var CompositionTracker = class {
7
+ #observedTargets = /* @__PURE__ */ new Set();
8
+ #activeTargets = /* @__PURE__ */ new Set();
9
+ #onStart;
10
+ #onEnd;
11
+ constructor(options = {}) {
12
+ this.#onStart = options.onStart;
13
+ this.#onEnd = options.onEnd;
14
+ }
15
+ /** Starts lifecycle tracking for `target`; repeated calls are idempotent. */
16
+ observe(target) {
17
+ if (this.#observedTargets.has(target)) return;
18
+ target.addEventListener("compositionstart", this.#handleStart);
19
+ target.addEventListener("compositionend", this.#handleEnd);
20
+ this.#observedTargets.add(target);
21
+ }
22
+ /** Stops tracking one target and clears any active composition it owned. */
23
+ unobserve(target) {
24
+ if (!this.#observedTargets.delete(target)) return;
25
+ target.removeEventListener("compositionstart", this.#handleStart);
26
+ target.removeEventListener("compositionend", this.#handleEnd);
27
+ this.#activeTargets.delete(target);
28
+ }
29
+ /** Releases every listener and clears state so reconnect starts cleanly. */
30
+ disconnect() {
31
+ for (const target of this.#observedTargets) {
32
+ target.removeEventListener("compositionstart", this.#handleStart);
33
+ target.removeEventListener("compositionend", this.#handleEnd);
34
+ }
35
+ this.#observedTargets.clear();
36
+ this.#activeTargets.clear();
37
+ }
38
+ /** True when lifecycle tracking or the current event reports composition. */
39
+ isComposing(event) {
40
+ return this.#activeTargets.size > 0 || event?.isComposing === true;
41
+ }
42
+ #handleStart = (event) => {
43
+ if (event.currentTarget) this.#activeTargets.add(event.currentTarget);
44
+ this.#onStart?.(event);
45
+ };
46
+ #handleEnd = (event) => {
47
+ if (event.currentTarget) this.#activeTargets.delete(event.currentTarget);
48
+ this.#onEnd?.(event);
49
+ };
50
+ };
51
+
5
52
  // src/utils/safe_timeout.ts
6
53
  var TimerRegistry = class {
7
54
  /** Live timer ids that have not yet been cleared (or, for timeouts, fired). */
@@ -69,35 +116,25 @@ var CharacterCounterController = class _CharacterCounterController extends Contr
69
116
  static #announceDelay = 200;
70
117
  #timeouts = new SafeTimeout();
71
118
  #announceId = null;
72
- /** True while an IME composition is active; intermediate input is skipped. */
73
- #composing = false;
119
+ /** Owns IME lifecycle state and applies the confirmed count once. */
120
+ #composition = new CompositionTracker({ onEnd: () => this.#update() });
74
121
  #onInput = (event) => {
75
- if (this.#composing || event.isComposing) return;
76
- this.#update();
77
- };
78
- #onCompositionStart = () => {
79
- this.#composing = true;
80
- };
81
- #onCompositionEnd = () => {
82
- this.#composing = false;
122
+ if (this.#composition.isComposing(event)) return;
83
123
  this.#update();
84
124
  };
85
125
  connect() {
86
126
  const field = this.#field;
87
127
  if (!field) return;
88
128
  field.addEventListener("input", this.#onInput);
89
- field.addEventListener("compositionstart", this.#onCompositionStart);
90
- field.addEventListener("compositionend", this.#onCompositionEnd);
129
+ this.#composition.observe(field);
91
130
  this.#update({ announce: false });
92
131
  }
93
132
  disconnect() {
94
133
  const field = this.#field;
95
134
  field?.removeEventListener("input", this.#onInput);
96
- field?.removeEventListener("compositionstart", this.#onCompositionStart);
97
- field?.removeEventListener("compositionend", this.#onCompositionEnd);
135
+ this.#composition.disconnect();
98
136
  this.#timeouts.clearAll();
99
137
  this.#announceId = null;
100
- this.#composing = false;
101
138
  }
102
139
  /**
103
140
  * Recomputes length-derived state. Non-text state (data hooks, `aria-invalid`)
@@ -0,0 +1,144 @@
1
+ import { Controller } from '@hotwired/stimulus';
2
+
3
+ // src/controllers/clipboard_controller.ts
4
+
5
+ // src/utils/safe_timeout.ts
6
+ var TimerRegistry = class {
7
+ /** Live timer ids that have not yet been cleared (or, for timeouts, fired). */
8
+ ids = /* @__PURE__ */ new Set();
9
+ /**
10
+ * Cancels a single tracked timer.
11
+ *
12
+ * No-ops if the id is unknown (already cleared, fired, or never owned by this
13
+ * registry), so callers can clear defensively without guarding.
14
+ */
15
+ clear(id) {
16
+ if (this.ids.delete(id)) {
17
+ this.cancel(id);
18
+ }
19
+ }
20
+ /**
21
+ * Cancels every tracked timer. Call this from a controller's `disconnect()`
22
+ * to guarantee no timer outlives the element.
23
+ */
24
+ clearAll() {
25
+ for (const id of this.ids) {
26
+ this.cancel(id);
27
+ }
28
+ this.ids.clear();
29
+ }
30
+ /** Number of timers currently tracked (pending). */
31
+ get size() {
32
+ return this.ids.size;
33
+ }
34
+ };
35
+ var SafeTimeout = class extends TimerRegistry {
36
+ /**
37
+ * Schedules `callback` after `delay` ms and returns the timer id.
38
+ *
39
+ * The id is removed from the registry automatically when the timeout fires,
40
+ * so {@link TimerRegistry.size | size} reflects only still-pending timers.
41
+ */
42
+ set(callback, delay) {
43
+ const id = this.schedule(() => {
44
+ this.ids.delete(id);
45
+ callback();
46
+ }, delay);
47
+ this.ids.add(id);
48
+ return id;
49
+ }
50
+ schedule(callback, delay) {
51
+ return window.setTimeout(callback, delay);
52
+ }
53
+ cancel(id) {
54
+ window.clearTimeout(id);
55
+ }
56
+ };
57
+
58
+ // src/controllers/clipboard_controller.ts
59
+ var ClipboardController = class extends Controller {
60
+ static targets = ["source", "button", "feedback"];
61
+ static values = {
62
+ text: { type: String, default: "" },
63
+ feedbackDuration: { type: Number, default: 2e3 },
64
+ copiedLabel: { type: String, default: "Copied" },
65
+ errorLabel: { type: String, default: "Copy failed" }
66
+ };
67
+ static actions = ["copy"];
68
+ static events = ["copy"];
69
+ /** Auto-clear timer for the completion notice; torn down on disconnect. */
70
+ #timers = new SafeTimeout();
71
+ /**
72
+ * The pending auto-clear timer id, or `null` when none is scheduled. Tracked so
73
+ * a rapid second copy cancels the first window instead of letting a stale timer
74
+ * reset the freshly-shown notice early.
75
+ */
76
+ #resetTimerId = null;
77
+ connect() {
78
+ if (!this.element.hasAttribute("data-state")) {
79
+ this.element.setAttribute("data-state", "idle");
80
+ }
81
+ }
82
+ disconnect() {
83
+ this.#timers.clearAll();
84
+ }
85
+ /**
86
+ * Copies the resolved text and reports the outcome. Bound via `data-action`
87
+ * (click). Always dispatches `stimeo--clipboard:copy` with `{ success, text }`
88
+ * — including on failure — so consumers can react either way.
89
+ */
90
+ async copy() {
91
+ const text = this.#resolveText();
92
+ let success = false;
93
+ try {
94
+ if (!navigator.clipboard?.writeText) throw new Error("Clipboard API unavailable");
95
+ await navigator.clipboard.writeText(text);
96
+ success = true;
97
+ } catch {
98
+ success = false;
99
+ }
100
+ this.#reportResult(success);
101
+ this.dispatch("copy", { detail: { success, text } });
102
+ }
103
+ /**
104
+ * The text to copy: the explicit `text` value when set, otherwise the source
105
+ * target's current value (inputs/textareas) or text content.
106
+ */
107
+ #resolveText() {
108
+ if (this.textValue.length > 0) return this.textValue;
109
+ if (!this.hasSourceTarget) return "";
110
+ const source = this.sourceTarget;
111
+ if (source instanceof HTMLInputElement || source instanceof HTMLTextAreaElement) {
112
+ return source.value;
113
+ }
114
+ return source.textContent ?? "";
115
+ }
116
+ /** Reflects the result on `data-state`, announces it, and schedules a reset. */
117
+ #reportResult(success) {
118
+ this.element.setAttribute("data-state", success ? "copied" : "error");
119
+ if (this.hasFeedbackTarget) {
120
+ this.feedbackTarget.textContent = success ? this.copiedLabelValue : this.errorLabelValue;
121
+ }
122
+ if (this.#resetTimerId !== null) {
123
+ this.#timers.clear(this.#resetTimerId);
124
+ this.#resetTimerId = null;
125
+ }
126
+ if (this.feedbackDurationValue > 0) {
127
+ this.#resetTimerId = this.#timers.set(() => {
128
+ this.#resetTimerId = null;
129
+ this.#reset();
130
+ }, this.feedbackDurationValue);
131
+ }
132
+ }
133
+ /** Returns to the idle state and clears the completion notice. */
134
+ #reset() {
135
+ this.element.setAttribute("data-state", "idle");
136
+ if (this.hasFeedbackTarget) {
137
+ this.feedbackTarget.textContent = "";
138
+ }
139
+ }
140
+ };
141
+
142
+ export { ClipboardController };
143
+ //# sourceMappingURL=clipboard_controller.js.map
144
+ //# sourceMappingURL=clipboard_controller.js.map