@hanzo/ui 8.0.59 → 8.0.60

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.
@@ -28,6 +28,20 @@ const jsx_runtime_1 = require("react/jsx-runtime");
28
28
  * with no signal in it — which is what a full page of these actually looked
29
29
  * like. Off is muted, on is filled, and the loudest treatment is the one that
30
30
  * means something.
31
+ *
32
+ * THE THUMB TAKES THE SAME TOKEN AS ITS TRACK, and that is not a copy-paste
33
+ * slip. gui wraps the thumb in a `t_SwitchThumb` sub-theme that INVERTS the
34
+ * whole ramp — measured live, `$color3` is rgb(26,26,26) at the frame and
35
+ * rgb(171,171,171) inside the thumb; `$color12` is rgb(250,250,250) and
36
+ * rgb(10,10,10). So naming one token paints both sides of the pair and the
37
+ * contrast is structural: the thumb cannot come out the same colour as the
38
+ * track it sits on, in either state, whatever the palette does later.
39
+ *
40
+ * Picking the tokens by eye instead shipped once, in 8.0.57-8.0.59, and it
41
+ * shipped INVISIBLE: `$color10` under the thumb resolved to the off track's own
42
+ * rgb(26,26,26) and `$color1` to the on track's rgb(255,255,255). The tests
43
+ * passed, because they asked whether the two states DIFFER from each other and
44
+ * never whether either one differs from the thing behind it.
31
45
  */
32
46
  const gui_1 = require("@hanzo/gui");
33
47
  const slot_1 = require("./slot.cjs");
@@ -42,7 +56,7 @@ const Switch = ({ disabled, ...props }) => ((0, jsx_runtime_1.jsx)(gui_1.Switch,
42
56
  // else: a control that ignores its own disabled prop looks identical to a
43
57
  // live one, and the page this was found on had a disabled switch sitting
44
58
  // beside eight enabled ones with nothing to tell them apart.
45
- disabled: disabled, opacity: disabled ? 0.5 : 1, cursor: disabled ? 'not-allowed' : 'pointer', ...(0, gesture_1.touch)(TRACK_H, 44, 'y'), ...props, children: (0, jsx_runtime_1.jsx)(gui_1.Switch.Thumb, { ...(0, slot_1.slot)('switch-thumb'), width: THUMB, height: THUMB, backgroundColor: "$color10",
59
+ disabled: disabled, opacity: disabled ? 0.5 : 1, cursor: disabled ? 'not-allowed' : 'pointer', ...(0, gesture_1.touch)(TRACK_H, 44, 'y'), ...props, children: (0, jsx_runtime_1.jsx)(gui_1.Switch.Thumb, { ...(0, slot_1.slot)('switch-thumb'), width: THUMB, height: THUMB, backgroundColor: "$color3",
46
60
  // `bg`, and it is the only one of the three spellings that is both typed
47
61
  // and correct. The Thumb's activeStyle is typed as the SHORTHAND style set:
48
62
  // `backgroundColor` paints but is not in that type; `background` is in it
@@ -51,5 +65,5 @@ const Switch = ({ disabled, ...props }) => ((0, jsx_runtime_1.jsx)(gui_1.Switch,
51
65
  // Consumers build with ignoreBuildErrors, so the first would have shipped
52
66
  // an error nobody sees and the second a colour that lands or does not
53
67
  // depending on stylesheet order.
54
- activeStyle: { bg: '$color1' } }) }));
68
+ activeStyle: { bg: '$color12' } }) }));
55
69
  exports.Switch = Switch;
@@ -23,6 +23,20 @@
23
23
  * with no signal in it — which is what a full page of these actually looked
24
24
  * like. Off is muted, on is filled, and the loudest treatment is the one that
25
25
  * means something.
26
+ *
27
+ * THE THUMB TAKES THE SAME TOKEN AS ITS TRACK, and that is not a copy-paste
28
+ * slip. gui wraps the thumb in a `t_SwitchThumb` sub-theme that INVERTS the
29
+ * whole ramp — measured live, `$color3` is rgb(26,26,26) at the frame and
30
+ * rgb(171,171,171) inside the thumb; `$color12` is rgb(250,250,250) and
31
+ * rgb(10,10,10). So naming one token paints both sides of the pair and the
32
+ * contrast is structural: the thumb cannot come out the same colour as the
33
+ * track it sits on, in either state, whatever the palette does later.
34
+ *
35
+ * Picking the tokens by eye instead shipped once, in 8.0.57-8.0.59, and it
36
+ * shipped INVISIBLE: `$color10` under the thumb resolved to the off track's own
37
+ * rgb(26,26,26) and `$color1` to the on track's rgb(255,255,255). The tests
38
+ * passed, because they asked whether the two states DIFFER from each other and
39
+ * never whether either one differs from the thing behind it.
26
40
  */
27
41
  import { Switch as GuiSwitch } from '@hanzo/gui';
28
42
  import type { ComponentProps } from 'react';
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/switch.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAQ3C,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAA;AAE1D,QAAA,MAAM,MAAM,GAAI,wBAAwB,WAAW,4CAuClD,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/switch.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAQ3C,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAA;AAE1D,QAAA,MAAM,MAAM,GAAI,wBAAwB,WAAW,4CAuClD,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -25,6 +25,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
25
25
  * with no signal in it — which is what a full page of these actually looked
26
26
  * like. Off is muted, on is filled, and the loudest treatment is the one that
27
27
  * means something.
28
+ *
29
+ * THE THUMB TAKES THE SAME TOKEN AS ITS TRACK, and that is not a copy-paste
30
+ * slip. gui wraps the thumb in a `t_SwitchThumb` sub-theme that INVERTS the
31
+ * whole ramp — measured live, `$color3` is rgb(26,26,26) at the frame and
32
+ * rgb(171,171,171) inside the thumb; `$color12` is rgb(250,250,250) and
33
+ * rgb(10,10,10). So naming one token paints both sides of the pair and the
34
+ * contrast is structural: the thumb cannot come out the same colour as the
35
+ * track it sits on, in either state, whatever the palette does later.
36
+ *
37
+ * Picking the tokens by eye instead shipped once, in 8.0.57-8.0.59, and it
38
+ * shipped INVISIBLE: `$color10` under the thumb resolved to the off track's own
39
+ * rgb(26,26,26) and `$color1` to the on track's rgb(255,255,255). The tests
40
+ * passed, because they asked whether the two states DIFFER from each other and
41
+ * never whether either one differs from the thing behind it.
28
42
  */
29
43
  import { Switch as GuiSwitch } from '@hanzo/gui';
30
44
  import { slot } from './slot.js';
@@ -39,7 +53,7 @@ const Switch = ({ disabled, ...props }) => (_jsx(GuiSwitch, { ...slot('switch'),
39
53
  // else: a control that ignores its own disabled prop looks identical to a
40
54
  // live one, and the page this was found on had a disabled switch sitting
41
55
  // beside eight enabled ones with nothing to tell them apart.
42
- disabled: disabled, opacity: disabled ? 0.5 : 1, cursor: disabled ? 'not-allowed' : 'pointer', ...touch(TRACK_H, 44, 'y'), ...props, children: _jsx(GuiSwitch.Thumb, { ...slot('switch-thumb'), width: THUMB, height: THUMB, backgroundColor: "$color10",
56
+ disabled: disabled, opacity: disabled ? 0.5 : 1, cursor: disabled ? 'not-allowed' : 'pointer', ...touch(TRACK_H, 44, 'y'), ...props, children: _jsx(GuiSwitch.Thumb, { ...slot('switch-thumb'), width: THUMB, height: THUMB, backgroundColor: "$color3",
43
57
  // `bg`, and it is the only one of the three spellings that is both typed
44
58
  // and correct. The Thumb's activeStyle is typed as the SHORTHAND style set:
45
59
  // `backgroundColor` paints but is not in that type; `background` is in it
@@ -48,6 +62,6 @@ const Switch = ({ disabled, ...props }) => (_jsx(GuiSwitch, { ...slot('switch'),
48
62
  // Consumers build with ignoreBuildErrors, so the first would have shipped
49
63
  // an error nobody sees and the second a colour that lands or does not
50
64
  // depending on stylesheet order.
51
- activeStyle: { bg: '$color1' } }) }));
65
+ activeStyle: { bg: '$color12' } }) }));
52
66
  export { Switch };
53
67
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src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AAC,aAAa,CAAC,CAAC,CAAC,SAAS,KACxC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,KACvB,KAAK,YAET,KAAC,SAAS,CAAC,KAAK,OACV,IAAI,CAAC,cAAc,CAAC,EACxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,EACb,eAAe,EAAC,SAAS;QACzB,yEAAyE;QACzE,4EAA4E;QAC5E,0EAA0E;QAC1E,sEAAsE;QACtE,uEAAuE;QACvE,0EAA0E;QAC1E,sEAAsE;QACtE,iCAAiC;QACjC,WAAW,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,GAC/B,GACQ,CACb,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
package/dist/styles.css CHANGED
@@ -2109,8 +2109,6 @@
2109
2109
  :root ._bg-background{background-color:var(--background);}
2110
2110
  :root ._bg-backgroundA94988999{background-color:var(--backgroundActive);}
2111
2111
  :root ._bg-borderColor{background-color:var(--borderColor);}
2112
- :root ._bg-color1{background-color:var(--color1);}
2113
- :root ._bg-color10{background-color:var(--color10);}
2114
2112
  :root ._bg-color12{background-color:var(--color12);}
2115
2113
  :root ._bg-color2{background-color:var(--color2);}
2116
2114
  :root ._bg-color3{background-color:var(--color3);}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "8.0.59",
3
+ "version": "8.0.60",
4
4
  "type": "module",
5
5
  "description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
6
6
  "exports": {