@ambientcss/components 3.0.0 → 3.0.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.
package/dist/index.d.cts CHANGED
@@ -387,7 +387,6 @@ declare function useBank(options: UseBankOptions): {
387
387
  "data-disabled": string | undefined;
388
388
  };
389
389
  keyProps: (option: BankOption, index: number) => {
390
- key: string;
391
390
  type: "button";
392
391
  ref: (node: HTMLButtonElement | null) => void;
393
392
  role: "checkbox" | "radio";
@@ -612,7 +611,7 @@ declare function ConsoleWell({ className }: {
612
611
  declare function ConsoleBar({ className }: {
613
612
  className?: string | undefined;
614
613
  }): react_jsx_runtime.JSX.Element;
615
- /** Panel graphics around the knob: the accent centre mark above it, and the
614
+ /** Panel graphics around the knob: the centre mark above it, and the
616
615
  * −/+ legends at the ends of the travel. Both sit outside the knob's own
617
616
  * box, which is what the `panel` frame is for. */
618
617
  declare function ConsoleMarks({ mark, legend, className }: {
@@ -629,13 +628,15 @@ declare function ConsoleMarks({ mark, legend, className }: {
629
628
  declare function ToggleTrack({ className }: {
630
629
  className?: string | undefined;
631
630
  }): react_jsx_runtime.JSX.Element;
632
- /** The travelling thumb: an accent disc inside a white ring.
631
+ /** The travelling thumb: an albedo disc inside a light ring.
633
632
  *
634
633
  * Flat on top and deliberately so — no chamfer, no fillet — but still a
635
634
  * knob-scale body, so it casts. That pairing is why the classes are spelt
636
635
  * out rather than reached through `.amb-fillet-2`: the edge treatments set
637
636
  * a thickness of their own, and here the thickness is wanted without the
638
- * cut that usually comes with it. */
637
+ * cut that usually comes with it. It wears `amb-surface`, so its colour IS
638
+ * the scene's albedo under the current light rather than a fixed paint —
639
+ * it re-shades when the lamp moves or the intensities change. */
639
640
  declare function ToggleThumb({ className }: {
640
641
  className?: string | undefined;
641
642
  }): react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -387,7 +387,6 @@ declare function useBank(options: UseBankOptions): {
387
387
  "data-disabled": string | undefined;
388
388
  };
389
389
  keyProps: (option: BankOption, index: number) => {
390
- key: string;
391
390
  type: "button";
392
391
  ref: (node: HTMLButtonElement | null) => void;
393
392
  role: "checkbox" | "radio";
@@ -612,7 +611,7 @@ declare function ConsoleWell({ className }: {
612
611
  declare function ConsoleBar({ className }: {
613
612
  className?: string | undefined;
614
613
  }): react_jsx_runtime.JSX.Element;
615
- /** Panel graphics around the knob: the accent centre mark above it, and the
614
+ /** Panel graphics around the knob: the centre mark above it, and the
616
615
  * −/+ legends at the ends of the travel. Both sit outside the knob's own
617
616
  * box, which is what the `panel` frame is for. */
618
617
  declare function ConsoleMarks({ mark, legend, className }: {
@@ -629,13 +628,15 @@ declare function ConsoleMarks({ mark, legend, className }: {
629
628
  declare function ToggleTrack({ className }: {
630
629
  className?: string | undefined;
631
630
  }): react_jsx_runtime.JSX.Element;
632
- /** The travelling thumb: an accent disc inside a white ring.
631
+ /** The travelling thumb: an albedo disc inside a light ring.
633
632
  *
634
633
  * Flat on top and deliberately so — no chamfer, no fillet — but still a
635
634
  * knob-scale body, so it casts. That pairing is why the classes are spelt
636
635
  * out rather than reached through `.amb-fillet-2`: the edge treatments set
637
636
  * a thickness of their own, and here the thickness is wanted without the
638
- * cut that usually comes with it. */
637
+ * cut that usually comes with it. It wears `amb-surface`, so its colour IS
638
+ * the scene's albedo under the current light rather than a fixed paint —
639
+ * it re-shades when the lamp moves or the intensities change. */
639
640
  declare function ToggleThumb({ className }: {
640
641
  className?: string | undefined;
641
642
  }): react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -905,7 +905,9 @@ function useBank(options) {
905
905
  const keyProps = (option, index) => {
906
906
  const on = selected.includes(option.value);
907
907
  return {
908
- key: option.value,
908
+ /* No `key` here on purpose: the caller maps the options, so it owns
909
+ the list key. Spreading one into JSX makes React warn and drops
910
+ the key on release builds. */
909
911
  type: "button",
910
912
  ref: (node) => {
911
913
  keyRefs.current[index] = node;
@@ -1004,7 +1006,8 @@ function AmbientBank({
1004
1006
  ...option.color ? { "--amb-led-color": option.color } : null
1005
1007
  },
1006
1008
  children: /* @__PURE__ */ jsx16(ControlStateProvider, { value: ks, children: /* @__PURE__ */ jsx16(BankKeyProvider, { value: { option, on, index }, children: renderKey ? renderKey(option, on) : /* @__PURE__ */ jsx16(Frames, { parts: keyParts }) }) })
1007
- }
1009
+ },
1010
+ option.value
1008
1011
  );
1009
1012
  })
1010
1013
  ]
@@ -1568,7 +1571,7 @@ function ConsoleMarks({
1568
1571
  className
1569
1572
  }) {
1570
1573
  return /* @__PURE__ */ jsxs10("span", { className: cn("amb-console-marks", className), "aria-hidden": true, children: [
1571
- mark ? /* @__PURE__ */ jsx23("span", { className: "amb-console-mark" }) : null,
1574
+ mark ? /* @__PURE__ */ jsx23("span", { className: "amb-console-mark amb-surface" }) : null,
1572
1575
  legend ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
1573
1576
  /* @__PURE__ */ jsx23("span", { className: "amb-console-legend amb-console-legend-min", children: "\u2212" }),
1574
1577
  /* @__PURE__ */ jsx23("span", { className: "amb-console-legend amb-console-legend-max", children: "+" })
@@ -1579,7 +1582,7 @@ function ToggleTrack({ className }) {
1579
1582
  return /* @__PURE__ */ jsx23("span", { className: cn("amb-console-track amb-groove", className) });
1580
1583
  }
1581
1584
  function ToggleThumb({ className }) {
1582
- return /* @__PURE__ */ jsx23("span", { className: cn("amb-console-thumb ambient amb-thickness-2", className) });
1585
+ return /* @__PURE__ */ jsx23("span", { className: cn("amb-console-thumb ambient amb-surface amb-thickness-2", className) });
1583
1586
  }
1584
1587
 
1585
1588
  // src/kits/console.tsx