@alacris/ui 0.2.3 → 0.2.4

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.
package/README.md CHANGED
@@ -47,9 +47,9 @@ The published package is plain ESM. Point an import map at a pinned CDN build of
47
47
  {
48
48
  "imports": {
49
49
  "@alacris/core": "https://cdn.jsdelivr.net/npm/@alacris/core@0.11.1/dist/alacris.js",
50
- "@alacris/ui": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.2.3/src/index.js",
51
- "@alacris/ui/theme": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.2.3/src/theme/index.js",
52
- "@alacris/ui/components/": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.2.3/src/components/"
50
+ "@alacris/ui": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.2.4/src/index.js",
51
+ "@alacris/ui/theme": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.2.4/src/theme/index.js",
52
+ "@alacris/ui/components/": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.2.4/src/components/"
53
53
  }
54
54
  }
55
55
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alacris/ui",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Themeable design system for Alacris — Material defaults, sixty-eight custom elements, ESM-only, no build step.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -222,21 +222,22 @@ const styles = css`
222
222
  .filled.has-label textarea { padding-top: ${sys.space(7)}; }
223
223
  .with-leading.multiline .field { padding-inline-start: ${sys.space(4)}; }
224
224
  .with-leading.multiline textarea { padding-inline-start: 0; }
225
- /* A number field's stepper gets its own lane.
226
-
227
- The browser draws the spin buttons inside the input's content box, at the
228
- inline end, and they are painted over whatever is already there: the
229
- floating label, the placeholder, and the value itself once it is long
230
- enough. On a narrow field it lands squarely on the label a chevron
231
- sitting on the word it is meant to sit beside.
232
-
233
- So the end of the field is reserved for it. The input is padded by the
234
- stepper's width, and the label and legend are shortened by the same
235
- amount so a long label ellipsises before it reaches the buttons rather
236
- than sliding underneath them. appearance:none does not help here: it
237
- removes the field's own chrome and leaves the ::-webkit-*-spin-button
238
- alone, which is why this needs saying explicitly. */
239
- .numeric input { padding-inline-end: ${t.stepperWidth}; }
225
+ /* A number field's spin buttons are laid out at the inline end of the
226
+ input's *content* box rather than at the edge of the field. That is the
227
+ opposite of what it looks like, and it is why the obvious fix makes
228
+ things worse: padding the input to reserve a lane for them moves the end
229
+ of the content box inward and takes the buttons with it, so they land
230
+ further onto the label than they started. That is what shipped in 0.2.3
231
+ — a chevron sitting on the "n" of "Min", clipped to a single arrow —
232
+ and it was a regression, not the original complaint.
233
+
234
+ They cannot be moved out of the way either: margin-inline-end on the
235
+ pseudo-element is ignored. So they are left where the browser puts them,
236
+ at the end of the field where there is already room, and only the label
237
+ and the legend are shortened, so a long one ellipsises before it reaches
238
+ the buttons rather than sliding underneath them. appearance:none does
239
+ not help here: it removes the field's own chrome and leaves the
240
+ ::-webkit-*-spin-button alone, which is why this needs saying. */
240
241
  .numeric .label {
241
242
  max-inline-size: calc(100% - ${sys.space(4)} - ${t.stepperWidth});
242
243
  overflow: hidden;
@@ -246,15 +247,15 @@ const styles = css`
246
247
  .numeric legend { max-inline-size: calc(100% - ${t.stepperWidth}); }
247
248
  .numeric input::-webkit-outer-spin-button,
248
249
  .numeric input::-webkit-inner-spin-button {
249
- /* Held at the end of the reserved lane rather than tight against the
250
- text, and always visible: a stepper that appears on hover is a control
251
- nobody knows is there. */
250
+ /* Nudged off the text rather than sitting tight against it, and always
251
+ visible: a stepper that only appears on hover is a control nobody
252
+ knows is there. */
252
253
  margin: 0;
253
254
  margin-inline-start: ${sys.space(2)};
254
255
  opacity: 1;
255
256
  }
256
- /* Firefox draws no buttons at all unless asked, so the reserved lane would
257
- be an empty gap. Asking for them makes the two engines agree. */
257
+ /* Firefox draws no buttons at all unless asked. Asking for them makes the
258
+ two engines agree about what a number field looks like. */
258
259
  @supports (-moz-appearance: number-input) {
259
260
  .numeric input { -moz-appearance: number-input; }
260
261
  }