@getaster/elements 0.1.0-preview.0 → 0.1.0-preview.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.
@@ -171,8 +171,8 @@ function oklch(args, lookup) {
171
171
  if (!base)
172
172
  return;
173
173
  const [l, c, h] = toOklch(base);
174
- const parts2 = splitTop(from[2]);
175
- if (parts2.length !== 3)
174
+ const parts = splitTop(from[2]);
175
+ if (parts.length !== 3)
176
176
  return;
177
177
  const channel = (p, own, key) => {
178
178
  if (p === key)
@@ -180,12 +180,12 @@ function oklch(args, lookup) {
180
180
  const calc = new RegExp(`^calc\\(${key}\\s*([+-])\\s*([\\d.]+)\\)$`).exec(p);
181
181
  return calc ? own + (calc[1] === "+" ? 1 : -1) * Number(calc[2]) : number(p);
182
182
  };
183
- const L2 = channel(parts2[0], l, "l");
184
- const C2 = channel(parts2[1], c, "c");
185
- const H2 = channel(parts2[2], h, "h");
186
- if ([L2, C2, H2].some((x) => x === undefined || Number.isNaN(x)))
183
+ const L = channel(parts[0], l, "l");
184
+ const C = channel(parts[1], c, "c");
185
+ const H = channel(parts[2], h, "h");
186
+ if ([L, C, H].some((x) => x === undefined || Number.isNaN(x)))
187
187
  return;
188
- return { ...fromOklch(L2, C2, H2), a: alpha ?? base.a };
188
+ return { ...fromOklch(L, C, H), a: alpha ?? base.a };
189
189
  }
190
190
  const parts = main.split(/\s+/).filter(Boolean);
191
191
  if (parts.length !== 3)
package/dist/grid/grid.js CHANGED
@@ -2167,6 +2167,9 @@ export class Grid extends AsterElement {
2167
2167
  }
2168
2168
  #focusEditor(key, col) {
2169
2169
  const row = this.querySelector(`.aster-grid-row[data-key="${CSS.escape(key)}"]`);
2170
+ // A user may choose another control before deferred initial focus runs.
2171
+ if (row?.contains(document.activeElement))
2172
+ return;
2170
2173
  const cells = row ? [...row.querySelectorAll('[role="gridcell"]')] : [];
2171
2174
  const target = cells[col]?.querySelector("input:not([readonly]), textarea:not([readonly]), [role=combobox]:not([aria-readonly])") ??
2172
2175
  row?.querySelector("input:not([readonly]), textarea:not([readonly]), [role=combobox]:not([aria-readonly])");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getaster/elements",
3
- "version": "0.1.0-preview.0",
3
+ "version": "0.1.0-preview.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -11,7 +11,7 @@
11
11
  "./styles/*": "./styles/*"
12
12
  },
13
13
  "dependencies": {
14
- "@getaster/data": "0.1.0-preview.0",
14
+ "@getaster/data": "0.1.0-preview.1",
15
15
  "@preact/signals-core": "1.14.4",
16
16
  "lit-html": "3.3.3"
17
17
  },
@@ -34,6 +34,8 @@
34
34
  mix-blend-mode: var(--aster-texture-blend, normal);
35
35
  }
36
36
  button, input, select, textarea { font: inherit; color: inherit; }
37
+ /* Native controls inherit ink, so their surfaces must follow the same theme. */
38
+ select, option, optgroup { background-color: var(--aster-sunk); }
37
39
  button { background: none; border: 0; padding: 0; margin: 0; text-align: inherit; }
38
40
  h1, h2, h3 { text-wrap: balance; }
39
41
  p { text-wrap: pretty; }
package/styles/base.css CHANGED
@@ -34,6 +34,8 @@
34
34
  mix-blend-mode: var(--aster-texture-blend, normal);
35
35
  }
36
36
  button, input, select, textarea { font: inherit; color: inherit; }
37
+ /* Native controls inherit ink, so their surfaces must follow the same theme. */
38
+ select, option, optgroup { background-color: var(--aster-sunk); }
37
39
  button { background: none; border: 0; padding: 0; margin: 0; text-align: inherit; }
38
40
  h1, h2, h3 { text-wrap: balance; }
39
41
  p { text-wrap: pretty; }