stimeo-ui 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +68 -0
  3. data/dist/controllers/aspect_ratio_controller.js +1 -1
  4. data/dist/controllers/breadcrumb_controller.js +5 -1
  5. data/dist/controllers/carousel_controller.js +5 -1
  6. data/dist/controllers/clipboard_controller.js +8 -3
  7. data/dist/controllers/collapsible_controller.js +4 -1
  8. data/dist/controllers/color_picker_controller.js +6 -2
  9. data/dist/controllers/context_menu_controller.js +2 -2
  10. data/dist/controllers/countdown_controller.js +5 -1
  11. data/dist/controllers/date_range_picker_controller.js +5 -1
  12. data/dist/controllers/direct_upload_controller.js +3 -3
  13. data/dist/controllers/empty_state_controller.js +107 -16
  14. data/dist/controllers/flash_controller.js +161 -21
  15. data/dist/controllers/form_validation_controller.js +8 -2
  16. data/dist/controllers/frame_loading_controller.js +94 -22
  17. data/dist/controllers/highlight_controller.js +38 -1
  18. data/dist/controllers/idle_controller.js +13 -2
  19. data/dist/controllers/local_time_controller.js +2 -0
  20. data/dist/controllers/masonry_controller.js +1 -1
  21. data/dist/controllers/meter_controller.js +3 -1
  22. data/dist/controllers/network_status_controller.js +1 -3
  23. data/dist/controllers/number_input_controller.js +191 -24
  24. data/dist/controllers/overflow_menu_controller.js +1 -1
  25. data/dist/controllers/pagination_controller.js +5 -1
  26. data/dist/controllers/password_strength_controller.js +1 -1
  27. data/dist/controllers/pointer_drag_controller.js +10 -0
  28. data/dist/controllers/portal_controller.js +10 -0
  29. data/dist/controllers/progress_controller.js +7 -3
  30. data/dist/controllers/range_slider_controller.js +385 -94
  31. data/dist/controllers/rating_controller.js +2 -0
  32. data/dist/controllers/relative_time_controller.js +2 -0
  33. data/dist/controllers/scroll_area_controller.js +1 -1
  34. data/dist/controllers/separator_controller.js +13 -17
  35. data/dist/controllers/skeleton_controller.js +71 -3
  36. data/dist/controllers/slider_controller.js +325 -48
  37. data/dist/controllers/spinner_controller.js +18 -3
  38. data/dist/controllers/step_indicator_controller.js +3 -1
  39. data/dist/controllers/stepper_controller.js +2 -0
  40. data/dist/controllers/switch_controller.js +162 -18
  41. data/dist/controllers/textarea_autosize_controller.js +1 -1
  42. data/dist/controllers/time_picker_controller.js +6 -3
  43. data/dist/controllers/tree_view_controller.js +19 -1
  44. data/dist/index.js +1214 -307
  45. data/lib/stimeo/ui/version.rb +1 -1
  46. metadata +2 -2
@@ -190,7 +190,7 @@ var INDEX = "data-stimeo--overflow-menu-index";
190
190
  var BOUNDARY = "data-stimeo--overflow-menu-boundary";
191
191
  var SAVED_ROLE = "data-stimeo--overflow-menu-role";
192
192
  var SAVED_TABINDEX = "data-stimeo--overflow-menu-tabindex";
193
- var SAVED_MENU_TARGET = "data-stimeo--overflow-menu-menu-target";
193
+ var SAVED_MENU_TARGET = "data-stimeo--overflow-menu-saved-menu";
194
194
  var MENU_TARGET = "data-stimeo--menu-target";
195
195
  var BOOKKEEPING = [BANKED, INDEX, SAVED_ROLE, SAVED_TABINDEX, SAVED_MENU_TARGET];
196
196
  var OverflowMenuController = class extends Controller {
@@ -132,7 +132,11 @@ var PaginationController = class _PaginationController extends Controller {
132
132
  if (!Object.is(page, this.pageValue)) this.pageValue = page;
133
133
  this.#render();
134
134
  }
135
- /** Syncs `aria-current` on the page buttons and the prev/next `disabled` state. */
135
+ /**
136
+ * Syncs `aria-current` on the page buttons and the prev/next `disabled` state.
137
+ *
138
+ * @stimeoRenderRoot
139
+ */
136
140
  #render() {
137
141
  const page = this.#page;
138
142
  for (const button of this.pageTargets) {
@@ -126,7 +126,7 @@ var PasswordStrengthController = class _PasswordStrengthController extends Contr
126
126
  this.#toggle("data-strength", band, band.length > 0);
127
127
  this.#toggle("data-below-min", "true", score > 0 && score < this.minScoreValue);
128
128
  const ratio = max > 0 ? score / max : 0;
129
- this.element.style.setProperty("--stimeo-password-strength", String(ratio));
129
+ this.element.style.setProperty("--stimeo--password-strength", String(ratio));
130
130
  }
131
131
  #writeLabel(label) {
132
132
  if (this.hasLabelTarget) this.labelTarget.textContent = label;
@@ -12,6 +12,16 @@ function isReservedArrowChord(event, allow = []) {
12
12
  var DetachGate = class _DetachGate {
13
13
  /** Set while a probe is queued, waiting for a reconnect to cancel it. */
14
14
  #pending = false;
15
+ /**
16
+ * True while a probe is queued — the last disconnect was ambiguous and no
17
+ * reconnect has cancelled it yet. Read it from `connect()` to tell the
18
+ * reconnect half of an in-page move from a first connect: a controller whose
19
+ * initialisation restarts a measurement (a min-duration floor, an elapsed
20
+ * counter) must skip it for the move, where nothing actually restarted.
21
+ */
22
+ get pending() {
23
+ return this.#pending;
24
+ }
15
25
  /**
16
26
  * True when the disconnect is definitely a real detach — the element left
17
27
  * the document, or `data-controller` no longer lists the identifier. False
@@ -6,6 +6,16 @@ import { Controller } from '@hotwired/stimulus';
6
6
  var DetachGate = class _DetachGate {
7
7
  /** Set while a probe is queued, waiting for a reconnect to cancel it. */
8
8
  #pending = false;
9
+ /**
10
+ * True while a probe is queued — the last disconnect was ambiguous and no
11
+ * reconnect has cancelled it yet. Read it from `connect()` to tell the
12
+ * reconnect half of an in-page move from a first connect: a controller whose
13
+ * initialisation restarts a measurement (a min-duration floor, an elapsed
14
+ * counter) must skip it for the move, where nothing actually restarted.
15
+ */
16
+ get pending() {
17
+ return this.#pending;
18
+ }
9
19
  /**
10
20
  * True when the disconnect is definitely a real detach — the element left
11
21
  * the document, or `data-controller` no longer lists the identifier. False
@@ -153,20 +153,24 @@ var ProgressController = class extends Controller {
153
153
  get #ratio() {
154
154
  return rangeFraction(this.valueValue, this.minValue, this.maxValue);
155
155
  }
156
- /** Reflects value/range/indeterminate onto ARIA, `data-state`, and the ratio. */
156
+ /**
157
+ * Reflects value/range/indeterminate onto ARIA, `data-state`, and the ratio.
158
+ *
159
+ * @stimeoRenderRoot
160
+ */
157
161
  #render() {
158
162
  this.element.setAttribute("aria-valuemin", String(this.minValue));
159
163
  this.element.setAttribute("aria-valuemax", String(this.maxValue));
160
164
  if (this.indeterminateValue) {
161
165
  this.element.removeAttribute("aria-valuenow");
162
166
  this.#clearOwnValueText();
163
- this.element.style.removeProperty("--stimeo-progress-ratio");
167
+ this.element.style.removeProperty("--stimeo--progress-ratio");
164
168
  this.element.setAttribute("data-state", "indeterminate");
165
169
  return;
166
170
  }
167
171
  const value = this.#clamp(this.valueValue);
168
172
  this.element.setAttribute("aria-valuenow", String(value));
169
- this.element.style.setProperty("--stimeo-progress-ratio", String(this.#ratio));
173
+ this.element.style.setProperty("--stimeo--progress-ratio", String(this.#ratio));
170
174
  this.element.setAttribute("data-state", "determinate");
171
175
  this.#applyValueText(value);
172
176
  }