@hanzogui/logo 8.3.0 → 8.3.2

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 (129) hide show
  1. package/dist/cjs/GuiLogo.js +12 -0
  2. package/dist/cjs/GuiLogo.js.map +1 -0
  3. package/dist/cjs/GuiLogoSvg.js +19 -0
  4. package/dist/cjs/GuiLogoSvg.js.map +1 -0
  5. package/dist/cjs/LogoIcon.js +14 -0
  6. package/dist/cjs/LogoIcon.js.map +1 -0
  7. package/dist/cjs/LogoWords.js +80 -0
  8. package/dist/cjs/LogoWords.js.map +1 -0
  9. package/dist/cjs/SeasonProvider.js +42 -0
  10. package/dist/cjs/SeasonProvider.js.map +1 -0
  11. package/dist/cjs/ThemeTint.js +18 -0
  12. package/dist/cjs/ThemeTint.js.map +1 -0
  13. package/dist/cjs/index.js +11 -0
  14. package/dist/cjs/index.js.map +1 -0
  15. package/dist/cjs/package.json +1 -0
  16. package/dist/cjs/tints.js +102 -0
  17. package/dist/cjs/tints.js.map +1 -0
  18. package/dist/cjs/useTint.js +93 -0
  19. package/dist/cjs/useTint.js.map +1 -0
  20. package/dist/esm/GuiLogo.js +8 -0
  21. package/dist/esm/GuiLogo.js.map +1 -0
  22. package/dist/esm/GuiLogoSvg.js +15 -0
  23. package/dist/esm/GuiLogoSvg.js.map +1 -0
  24. package/dist/esm/LogoIcon.js +10 -0
  25. package/dist/esm/LogoIcon.js.map +1 -0
  26. package/dist/esm/LogoWords.js +76 -0
  27. package/dist/esm/LogoWords.js.map +1 -0
  28. package/dist/esm/SeasonProvider.js +39 -0
  29. package/dist/esm/SeasonProvider.js.map +1 -0
  30. package/dist/esm/ThemeTint.js +13 -0
  31. package/dist/esm/ThemeTint.js.map +1 -0
  32. package/dist/esm/index.js +8 -8
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/tints.js +93 -0
  35. package/dist/esm/tints.js.map +1 -0
  36. package/dist/esm/useTint.js +83 -0
  37. package/dist/esm/useTint.js.map +1 -0
  38. package/package.json +24 -25
  39. package/src/GuiLogo.tsx +2 -2
  40. package/src/LogoIcon.tsx +1 -1
  41. package/src/LogoWords.tsx +1 -1
  42. package/src/SeasonProvider.tsx +1 -1
  43. package/src/ThemeTint.tsx +1 -1
  44. package/src/index.tsx +7 -7
  45. package/src/useTint.tsx +1 -1
  46. package/types/GuiLogo.d.ts +7 -8
  47. package/types/GuiLogo.d.ts.map +1 -11
  48. package/types/GuiLogoSvg.d.ts +12 -13
  49. package/types/GuiLogoSvg.d.ts.map +1 -11
  50. package/types/LogoIcon.d.ts +4 -5
  51. package/types/LogoIcon.d.ts.map +1 -11
  52. package/types/LogoWords.d.ts +5 -6
  53. package/types/LogoWords.d.ts.map +1 -11
  54. package/types/SeasonProvider.d.ts +3 -4
  55. package/types/SeasonProvider.d.ts.map +1 -11
  56. package/types/ThemeTint.d.ts +5 -6
  57. package/types/ThemeTint.d.ts.map +1 -11
  58. package/types/index.d.ts +7 -8
  59. package/types/index.d.ts.map +1 -11
  60. package/types/tints.d.ts +17 -16
  61. package/types/tints.d.ts.map +1 -11
  62. package/types/useTint.d.ts +22 -23
  63. package/types/useTint.d.ts.map +1 -11
  64. package/dist/cjs/GuiLogo.cjs +0 -59
  65. package/dist/cjs/GuiLogo.native.js +0 -63
  66. package/dist/cjs/GuiLogo.native.js.map +0 -1
  67. package/dist/cjs/GuiLogoSvg.cjs +0 -42
  68. package/dist/cjs/GuiLogoSvg.native.js +0 -50
  69. package/dist/cjs/GuiLogoSvg.native.js.map +0 -1
  70. package/dist/cjs/LogoIcon.cjs +0 -51
  71. package/dist/cjs/LogoIcon.native.js +0 -55
  72. package/dist/cjs/LogoIcon.native.js.map +0 -1
  73. package/dist/cjs/LogoWords.cjs +0 -130
  74. package/dist/cjs/LogoWords.native.js +0 -139
  75. package/dist/cjs/LogoWords.native.js.map +0 -1
  76. package/dist/cjs/SeasonProvider.cjs +0 -46
  77. package/dist/cjs/SeasonProvider.native.js +0 -57
  78. package/dist/cjs/SeasonProvider.native.js.map +0 -1
  79. package/dist/cjs/ThemeTint.cjs +0 -57
  80. package/dist/cjs/ThemeTint.native.js +0 -62
  81. package/dist/cjs/ThemeTint.native.js.map +0 -1
  82. package/dist/cjs/index.cjs +0 -26
  83. package/dist/cjs/index.native.js +0 -29
  84. package/dist/cjs/index.native.js.map +0 -1
  85. package/dist/cjs/tints.cjs +0 -102
  86. package/dist/cjs/tints.native.js +0 -107
  87. package/dist/cjs/tints.native.js.map +0 -1
  88. package/dist/cjs/useTint.cjs +0 -116
  89. package/dist/cjs/useTint.native.js +0 -128
  90. package/dist/cjs/useTint.native.js.map +0 -1
  91. package/dist/esm/GuiLogo.mjs +0 -34
  92. package/dist/esm/GuiLogo.mjs.map +0 -1
  93. package/dist/esm/GuiLogo.native.js +0 -35
  94. package/dist/esm/GuiLogo.native.js.map +0 -1
  95. package/dist/esm/GuiLogoSvg.mjs +0 -17
  96. package/dist/esm/GuiLogoSvg.mjs.map +0 -1
  97. package/dist/esm/GuiLogoSvg.native.js +0 -22
  98. package/dist/esm/GuiLogoSvg.native.js.map +0 -1
  99. package/dist/esm/LogoIcon.mjs +0 -26
  100. package/dist/esm/LogoIcon.mjs.map +0 -1
  101. package/dist/esm/LogoIcon.native.js +0 -27
  102. package/dist/esm/LogoIcon.native.js.map +0 -1
  103. package/dist/esm/LogoWords.mjs +0 -94
  104. package/dist/esm/LogoWords.mjs.map +0 -1
  105. package/dist/esm/LogoWords.native.js +0 -100
  106. package/dist/esm/LogoWords.native.js.map +0 -1
  107. package/dist/esm/SeasonProvider.mjs +0 -21
  108. package/dist/esm/SeasonProvider.mjs.map +0 -1
  109. package/dist/esm/SeasonProvider.native.js +0 -29
  110. package/dist/esm/SeasonProvider.native.js.map +0 -1
  111. package/dist/esm/ThemeTint.mjs +0 -31
  112. package/dist/esm/ThemeTint.mjs.map +0 -1
  113. package/dist/esm/ThemeTint.native.js +0 -33
  114. package/dist/esm/ThemeTint.native.js.map +0 -1
  115. package/dist/esm/index.mjs +0 -8
  116. package/dist/esm/index.mjs.map +0 -1
  117. package/dist/esm/index.native.js +0 -8
  118. package/dist/esm/index.native.js.map +0 -1
  119. package/dist/esm/tints.mjs +0 -62
  120. package/dist/esm/tints.mjs.map +0 -1
  121. package/dist/esm/tints.native.js +0 -64
  122. package/dist/esm/tints.native.js.map +0 -1
  123. package/dist/esm/useTint.mjs +0 -74
  124. package/dist/esm/useTint.mjs.map +0 -1
  125. package/dist/esm/useTint.native.js +0 -83
  126. package/dist/esm/useTint.native.js.map +0 -1
  127. package/icon/index.js +0 -1
  128. package/icon/index.native.js +0 -1
  129. package/icon.cjs +0 -1
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Theme } from '@hanzogui/web';
3
+ import { useTint } from './useTint.js';
4
+ export const ThemeTint = ({ disable, children, ...rest }) => {
5
+ const curTint = useTint().tint;
6
+ return (_jsx(Theme, { ...rest, name: disable ? null : curTint, children: children }));
7
+ };
8
+ export const ThemeTintAlt = ({ children, disable, offset = 1, ...rest }) => {
9
+ const curTint = useTint(offset).tintAlt;
10
+ const name = disable ? null : curTint;
11
+ return (_jsx(Theme, { name: name, ...rest, children: children }));
12
+ };
13
+ //# sourceMappingURL=ThemeTint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeTint.js","sourceRoot":"","sources":["../../src/ThemeTint.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,KAAK,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAA;AAEvC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,OAAO,EACP,QAAQ,EACR,GAAG,IAAI,EAC4B,EAAe,EAAE;IACpD,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC,IAAI,CAAA;IAE9B,OAAO,CACL,KAAC,KAAK,OAAK,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,YAC5C,QAAQ,GACH,CACT,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,CAAC,EACV,GAAG,IAAI,EAC6C,EAAe,EAAE;IACrE,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAA;IACvC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAA;IACrC,OAAO,CACL,KAAC,KAAK,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,YACxB,QAAQ,GACH,CACT,CAAA;AACH,CAAC,CAAA"}
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./GuiLogo.mjs";
2
- export * from "./LogoWords.mjs";
3
- export * from "./LogoIcon.mjs";
4
- export * from "./tints.mjs";
5
- export * from "./useTint.mjs";
6
- export * from "./ThemeTint.mjs";
7
- export * from "./SeasonProvider.mjs";
8
- //# sourceMappingURL=index.js.map
1
+ export * from './GuiLogo.js';
2
+ export * from './LogoWords.js';
3
+ export * from './LogoIcon.js';
4
+ export * from './tints.js';
5
+ export * from './useTint.js';
6
+ export * from './ThemeTint.js';
7
+ export * from './SeasonProvider.js';
8
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAe,CAAA;AAC7B,cAAc,gBAAiB,CAAA;AAC/B,cAAc,eAAgB,CAAA;AAC9B,cAAc,YAAa,CAAA;AAC3B,cAAc,cAAe,CAAA;AAC7B,cAAc,gBAAiB,CAAA;AAC/B,cAAc,qBAAsB,CAAA"}
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ const listeners = new Set();
3
+ // A seasonal ramp of tint stops. These used to be one entry per letter of the
4
+ // old seven-letter wordmark, with index 3 reserved as the neutral notch; the
5
+ // wordmark is Hanzo now and every reader indexes by `tints.length`, so the
6
+ // length is just how many stops the ramp has.
7
+ const familiesValues = {
8
+ hanzogui: ['yellow', 'yellow', 'yellow', 'gray', 'red', 'green', 'blue'],
9
+ xmas: ['red', 'green', 'red', 'green', 'red', 'green', 'red'],
10
+ easter: [
11
+ 'yellow',
12
+ 'yellow',
13
+ 'yellow',
14
+ 'yellow',
15
+ 'yellow',
16
+ 'yellow',
17
+ 'yellow',
18
+ ],
19
+ halloween: [
20
+ 'yellow',
21
+ 'gray',
22
+ 'yellow',
23
+ 'gray',
24
+ 'yellow',
25
+ 'gray',
26
+ 'yellow',
27
+ ],
28
+ valentine: ['red', 'red', 'red', 'red', 'red', 'red', 'red'],
29
+ lunar: ['yellow', 'red', 'red', 'red', 'red', 'red', 'yellow'],
30
+ stpatricks: [
31
+ 'green',
32
+ 'yellow',
33
+ 'green',
34
+ 'yellow',
35
+ 'green',
36
+ 'yellow',
37
+ 'green',
38
+ ],
39
+ };
40
+ const DEFAULT_FAMILY = 'hanzogui';
41
+ const familiesNames = Object.keys(familiesValues);
42
+ const families = familiesValues;
43
+ let fam = DEFAULT_FAMILY;
44
+ export function getTints() {
45
+ return {
46
+ name: fam || DEFAULT_FAMILY,
47
+ tints: families[fam] || families.hanzogui,
48
+ families,
49
+ };
50
+ }
51
+ export function useTints() {
52
+ const [val, setVal] = React.useState(getTints());
53
+ React.useEffect(() => {
54
+ return onTintFamilyChange(() => {
55
+ React.startTransition(() => {
56
+ setVal(getTints());
57
+ });
58
+ });
59
+ }, []);
60
+ return val;
61
+ }
62
+ export function setTintFamily(next) {
63
+ if (!families[next])
64
+ throw `impossible`;
65
+ fam = next;
66
+ // update DOM class for CSS-based styling (e.g., rainbow gradients)
67
+ if (typeof document !== 'undefined') {
68
+ const root = document.documentElement.classList;
69
+ // remove all season classes
70
+ familiesNames.forEach((s) => {
71
+ if (s !== 'hanzogui') {
72
+ root.remove(`${s}-season`);
73
+ }
74
+ });
75
+ // add the new one if not hanzogui
76
+ if (next !== 'hanzogui') {
77
+ root.add(`${next}-season`);
78
+ }
79
+ }
80
+ React.startTransition(() => {
81
+ listeners.forEach((l) => l(next));
82
+ });
83
+ }
84
+ export const setNextTintFamily = () => {
85
+ setTintFamily(familiesNames[(familiesNames.indexOf(fam) + 1) % familiesNames.length]);
86
+ };
87
+ export const onTintFamilyChange = (cb) => {
88
+ listeners.add(cb);
89
+ return () => {
90
+ listeners.delete(cb);
91
+ };
92
+ };
93
+ //# sourceMappingURL=tints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tints.js","sourceRoot":"","sources":["../../src/tints.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAiB,CAAA;AAE1C,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,8CAA8C;AAC9C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAgB;IACvF,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAgB;IAC5E,MAAM,EAAE;QACN,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;KACM;IAChB,SAAS,EAAE;QACT,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,MAAM;QACN,QAAQ;KACM;IAChB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAA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Q,KAAK,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAA;QAC/C,4BAA4B;QAC5B,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1B,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;gBACrB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC,CAAC,CAAA;QACF,kCAAkC;QAClC,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,SAAS,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAS,EAAE;IAC1C,aAAa,CAAC,aAAa,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAA;AACvF,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAiB,EAAE,EAAE;IACtD,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACjB,OAAO,GAAS,EAAE;QAChB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACtB,CAAC,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,83 @@
1
+ import React, { createContext, useContext, useEffect, useState } from 'react';
2
+ import { useDidFinishSSR } from '@hanzo/gui';
3
+ import { getTints, setNextTintFamily, useTints } from './tints.js';
4
+ let current = 3;
5
+ let disableTintTheme = false;
6
+ const listeners = new Set();
7
+ const disableListeners = new Set();
8
+ export const onTintChange = (listener) => {
9
+ listeners.add(listener);
10
+ return () => {
11
+ listeners.delete(listener);
12
+ };
13
+ };
14
+ const numTints = getTints().tints.length;
15
+ export const setTintIndex = (next) => {
16
+ const val = Math.max(0, next % numTints);
17
+ if (val === current)
18
+ return;
19
+ current = val;
20
+ listeners.forEach((x) => x(val));
21
+ };
22
+ // when true, useTint returns null for tint/tintAlt so ThemeTint doesn't apply sub-themes
23
+ export const setDisableTintTheme = (disable) => {
24
+ if (disable === disableTintTheme)
25
+ return;
26
+ disableTintTheme = disable;
27
+ disableListeners.forEach((x) => x(disable));
28
+ };
29
+ export const getDisableTintTheme = () => disableTintTheme;
30
+ export function getDocsSection(pathname) {
31
+ return pathname === '/docs/intro/compiler-install' ||
32
+ pathname === '/docs/intro/benchmarks' ||
33
+ pathname === '/docs/intro/why-a-compiler'
34
+ ? 'compiler'
35
+ : pathname.startsWith('/ui/')
36
+ ? 'ui'
37
+ : pathname.startsWith('/docs/')
38
+ ? 'core'
39
+ : null;
40
+ }
41
+ export const InitialPathContext = createContext(3);
42
+ export const useTint = (altOffset = -1) => {
43
+ const initial = useContext(InitialPathContext);
44
+ const didHydrate = useDidFinishSSR();
45
+ const [index, setIndex] = useState(didHydrate ? current : initial);
46
+ const [disabled, setDisabled] = useState(disableTintTheme);
47
+ const tintsContext = useTints();
48
+ const { tints } = tintsContext;
49
+ const tintAltIndex = Math.abs((index + altOffset) % tints.length);
50
+ useEffect(() => {
51
+ return onTintChange((cur) => {
52
+ setIndex(cur);
53
+ });
54
+ }, []);
55
+ useEffect(() => {
56
+ const cb = (val) => setDisabled(val);
57
+ disableListeners.add(cb);
58
+ return () => {
59
+ disableListeners.delete(cb);
60
+ };
61
+ }, []);
62
+ // return null for tint when disabled or at the "none" position (index 3)
63
+ const tint = disabled || index === 3 ? null : tints[index];
64
+ const tintAlt = disabled || tintAltIndex === 3 ? null : tints[tintAltIndex];
65
+ return {
66
+ ...tintsContext,
67
+ tints: tintsContext.tints,
68
+ tintIndex: index,
69
+ tintAltIndex,
70
+ tint: tint,
71
+ tintAlt: tintAlt,
72
+ setTintIndex,
73
+ setNextTintFamily,
74
+ setDisableTintTheme,
75
+ disableTintTheme: disabled,
76
+ setNextTint: () => {
77
+ React.startTransition(() => {
78
+ setTintIndex(index + 1);
79
+ });
80
+ },
81
+ };
82
+ };
83
+ //# sourceMappingURL=useTint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTint.js","sourceRoot":"","sources":["../../src/useTint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAkB,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,YAAa,CAAA;AAEnE,IAAI,OAAO,GAAG,CAAC,CAAA;AACf,IAAI,gBAAgB,GAAG,KAAK,CAAA;AAE5B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAY,CAAA;AACrC,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAY,CAAA;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAA+B,EAAE,EAAE;IAC9D,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACvB,OAAO,GAAS,EAAE;QAChB,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC5B,CAAC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,CAAA;AAExC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAQ,EAAE;IACjD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAA;IACxC,IAAI,GAAG,KAAK,OAAO;QAAE,OAAM;IAC3B,OAAO,GAAG,G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AW,EAAE,GAAG,EAAE;YAChB,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;gBACzB,YAAY,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;YACzB,CAAC,CAAC,CAAA;QACJ,CAAC;KACO,CAAA;AACZ,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,60 +1,59 @@
1
1
  {
2
2
  "name": "@hanzogui/logo",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "source": "src/index.tsx",
5
5
  "files": [
6
6
  "src",
7
7
  "types",
8
8
  "dist",
9
- "*.cjs",
10
- "icon"
9
+ "*.cjs"
11
10
  ],
12
11
  "type": "module",
13
- "main": "dist/cjs",
14
- "module": "dist/esm",
12
+ "main": "./dist/cjs/index.js",
13
+ "module": "./dist/esm/index.js",
15
14
  "types": "./types/index.d.ts",
16
15
  "exports": {
17
16
  "./package.json": "./package.json",
18
17
  ".": {
19
18
  "types": "./types/index.d.ts",
20
- "react-native": "./dist/esm/index.native.js",
21
- "browser": "./dist/esm/index.mjs",
22
- "module": "./dist/esm/index.mjs",
23
- "import": "./dist/esm/index.mjs",
24
- "require": "./dist/cjs/index.cjs",
25
- "default": "./dist/esm/index.mjs"
19
+ "react-native": "./dist/esm/index.js",
20
+ "browser": "./dist/esm/index.js",
21
+ "module": "./dist/esm/index.js",
22
+ "import": "./dist/esm/index.js",
23
+ "require": "./dist/cjs/index.js",
24
+ "default": "./dist/esm/index.js"
26
25
  },
27
26
  "./icon": {
28
27
  "types": "./types/LogoIcon.d.ts",
29
- "react-native": "./dist/esm/LogoIcon.native.js",
30
- "browser": "./dist/esm/LogoIcon.mjs",
31
- "module": "./dist/esm/LogoIcon.mjs",
32
- "import": "./dist/esm/LogoIcon.mjs",
33
- "require": "./dist/cjs/LogoIcon.cjs",
34
- "default": "./dist/cjs/LogoIcon.native.js"
28
+ "react-native": "./dist/esm/LogoIcon.js",
29
+ "browser": "./dist/esm/LogoIcon.js",
30
+ "module": "./dist/esm/LogoIcon.js",
31
+ "import": "./dist/esm/LogoIcon.js",
32
+ "require": "./dist/cjs/LogoIcon.js",
33
+ "default": "./dist/esm/LogoIcon.js"
35
34
  }
36
35
  },
37
36
  "publishConfig": {
38
37
  "access": "public"
39
38
  },
40
39
  "scripts": {
41
- "build": "hanzogui-build",
40
+ "build": "hanzogui-build --skip-native",
42
41
  "watch": "hanzogui-build --watch",
43
42
  "clean": "hanzogui-build clean",
44
43
  "clean:build": "hanzogui-build clean:build"
45
44
  },
46
45
  "dependencies": {
47
- "@hanzo/gui": "8.3.0",
48
- "@hanzo/logo": "^1.0.24",
49
- "@hanzogui/use-element-layout": "8.3.0",
50
- "@hanzogui/web": "8.3.0"
46
+ "@hanzo/gui": "8.3.2",
47
+ "@hanzo/logo": "^1.0.26",
48
+ "@hanzogui/use-element-layout": "8.3.2",
49
+ "@hanzogui/web": "8.3.2"
51
50
  },
52
51
  "devDependencies": {
53
- "@hanzogui/build": "8.3.0",
54
- "react": ">=19"
52
+ "@hanzogui/build": "8.3.2",
53
+ "react": "19.2.8"
55
54
  },
56
55
  "peerDependencies": {
57
- "react": ">=19"
56
+ "react": ">=19.2.8"
58
57
  },
59
58
  "repository": {
60
59
  "type": "git",
package/src/GuiLogo.tsx CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { JSX } from 'react/jsx-runtime'
2
2
  import type { XStackProps } from '@hanzo/gui'
3
3
  import { XStack, YStack } from '@hanzo/gui'
4
- import { LogoIcon } from './LogoIcon'
5
- import { LogoWords } from './LogoWords'
4
+ import { LogoIcon } from './LogoIcon.tsx'
5
+ import { LogoWords } from './LogoWords.tsx'
6
6
 
7
7
  type LogoProps = {
8
8
  showWords?: boolean
package/src/LogoIcon.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import { YStack } from '@hanzo/gui'
2
- import { GuiIconSvg } from './GuiLogoSvg'
2
+ import { GuiIconSvg } from './GuiLogoSvg.tsx'
3
3
  import type { JSX } from 'react/jsx-runtime'
4
4
 
5
5
  export const LogoIcon = ({
package/src/LogoWords.tsx CHANGED
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react'
3
3
  import type { XStackProps } from '@hanzo/gui'
4
4
  import { Circle, XStack } from '@hanzo/gui'
5
5
  import { WORDMARKS } from '@hanzo/logo/wordmarks'
6
- import { useTint } from './useTint'
6
+ import { useTint } from './useTint.tsx'
7
7
 
8
8
  /**
9
9
  * The wordmark.
@@ -1,6 +1,6 @@
1
1
  import type React from 'react'
2
2
  import { useEffect } from 'react'
3
- import { setTintFamily, type TintFamily } from './tints'
3
+ import { setTintFamily, type TintFamily } from './tints.tsx'
4
4
 
5
5
  // inline script that runs before hydration to set season class on html
6
6
  // auto-detects season from current date
package/src/ThemeTint.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type ThemeProps, Theme } from '@hanzogui/web'
2
2
  import type { JSX } from 'react/jsx-runtime'
3
- import { useTint } from './useTint'
3
+ import { useTint } from './useTint.tsx'
4
4
 
5
5
  export const ThemeTint = ({
6
6
  disable,
package/src/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
- export * from './GuiLogo'
2
- export * from './LogoWords'
3
- export * from './LogoIcon'
4
- export * from './tints'
5
- export * from './useTint'
6
- export * from './ThemeTint'
7
- export * from './SeasonProvider'
1
+ export * from './GuiLogo.tsx'
2
+ export * from './LogoWords.tsx'
3
+ export * from './LogoIcon.tsx'
4
+ export * from './tints.tsx'
5
+ export * from './useTint.tsx'
6
+ export * from './ThemeTint.tsx'
7
+ export * from './SeasonProvider.tsx'
package/src/useTint.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { createContext, useContext, useEffect, useState } from 'react'
2
2
  import { useDidFinishSSR, type ThemeName } from '@hanzo/gui'
3
- import { getTints, setNextTintFamily, useTints } from './tints'
3
+ import { getTints, setNextTintFamily, useTints } from './tints.tsx'
4
4
 
5
5
  let current = 3
6
6
  let disableTintTheme = false
@@ -1,13 +1,12 @@
1
- import type { JSX } from "react/jsx-runtime";
2
- import type { XStackProps } from "@hanzo/gui";
1
+ import type { JSX } from 'react/jsx-runtime';
2
+ import type { XStackProps } from '@hanzo/gui';
3
3
  type LogoProps = {
4
- showWords?: boolean;
5
- downscale?: number;
6
- animated?: boolean;
7
- color?: string;
8
- ref?: any;
4
+ showWords?: boolean;
5
+ downscale?: number;
6
+ animated?: boolean;
7
+ color?: string;
8
+ ref?: any;
9
9
  } & XStackProps;
10
10
  export declare const GuiLogo: ({ showWords, downscale, animated, color, ref, ...props }: LogoProps) => JSX.Element;
11
11
  export {};
12
-
13
12
  //# sourceMappingURL=GuiLogo.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAAA,cAAc,WAAW;AACzB,cAAc,mBAAmB;KAK5B,YAAY;CACf;CACA;CACA;CACA;CACA;IACE;AAEJ,OAAO,cAAM,UAAW,EACtB,WACA,WACA,UACA,OACA,KACA,GAAG,SACF,cAAY,IAAI",
3
- "names": [],
4
- "sources": [
5
- "src/GuiLogo.tsx"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import type { JSX } from 'react/jsx-runtime'\nimport type { XStackProps } from '@hanzo/gui'\nimport { XStack, YStack } from '@hanzo/gui'\nimport { LogoIcon } from './LogoIcon'\nimport { LogoWords } from './LogoWords'\n\ntype LogoProps = {\n showWords?: boolean\n downscale?: number\n animated?: boolean\n color?: string\n ref?: any\n} & XStackProps\n\nexport const GuiLogo = ({\n showWords,\n downscale,\n animated,\n color,\n ref,\n ...props\n}: LogoProps): JSX.Element => {\n return (\n <XStack\n render=\"span\"\n ref={ref}\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"$5\"\n {...props}\n >\n <LogoIcon downscale={(downscale ?? 1) * (showWords ? 2 : 1.5)} color={color} />\n {showWords && (\n <YStack render=\"span\" marginBottom={-4}>\n <LogoWords animated={animated} downscale={downscale ?? 2} />\n </YStack>\n )}\n </XStack>\n )\n}\n"
10
- ]
11
- }
1
+ {"version":3,"file":"GuiLogo.d.ts","sourceRoot":"","sources":["../src/GuiLogo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAK7C,KAAK,SAAS,GAAG;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,GAAG,CAAA;CACV,GAAG,WAAW,CAAA;AAEf,eAAO,MAAM,OAAO,6DAOjB,SAAS,KAAG,GAAG,CAAC,OAkBlB,CAAA"}
@@ -1,19 +1,18 @@
1
- import type { JSX } from "react/jsx-runtime";
1
+ import type { JSX } from 'react/jsx-runtime';
2
2
  type GuiIconSvgProps = React.SVGProps<SVGSVGElement> & {
3
- color?: string;
3
+ color?: string;
4
4
  };
5
5
  /**
6
- * The Hanzo mark.
7
- *
8
- * This drew a duck — `<g id="duck">`, pixel art, `#ECD20A` — because the fork
9
- * renamed the package and left the artwork. It was the mark in this site's
10
- * header, footer, login, 404, every doc page and its favicon.
11
- *
12
- * The geometry comes from `@hanzo/logo`, never retyped: MARK_BLOCKS is the five
13
- * body blocks of the block-H on its own 67 viewBox. `currentColor` by default so
14
- * the mark themes with the text around it rather than pinning a brand hex.
15
- */
6
+ * The Hanzo mark.
7
+ *
8
+ * This drew a duck — `<g id="duck">`, pixel art, `#ECD20A` — because the fork
9
+ * renamed the package and left the artwork. It was the mark in this site's
10
+ * header, footer, login, 404, every doc page and its favicon.
11
+ *
12
+ * The geometry comes from `@hanzo/logo`, never retyped: MARK_BLOCKS is the five
13
+ * body blocks of the block-H on its own 67 viewBox. `currentColor` by default so
14
+ * the mark themes with the text around it rather than pinning a brand hex.
15
+ */
16
16
  export declare const GuiIconSvg: ({ color, ...props }: GuiIconSvgProps) => JSX.Element;
17
17
  export {};
18
-
19
18
  //# sourceMappingURL=GuiLogoSvg.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAAA,cAAc,WAAW;KAGpB,kBAAkB,MAAM,SAAS,iBAAiB;CACrD;;;;;;;;;;;;;AAcF,OAAO,cAAM,aAAc,EACzB,OACA,GAAG,SACF,oBAAkB,IAAI",
3
- "names": [],
4
- "sources": [
5
- "src/GuiLogoSvg.tsx"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import type { JSX } from 'react/jsx-runtime'\nimport { MARK_BLOCKS } from '@hanzo/logo/logos'\n\ntype GuiIconSvgProps = React.SVGProps<SVGSVGElement> & {\n color?: string\n}\n\n/**\n * The Hanzo mark.\n *\n * This drew a duck — `<g id=\"duck\">`, pixel art, `#ECD20A` — because the fork\n * renamed the package and left the artwork. It was the mark in this site's\n * header, footer, login, 404, every doc page and its favicon.\n *\n * The geometry comes from `@hanzo/logo`, never retyped: MARK_BLOCKS is the five\n * body blocks of the block-H on its own 67 viewBox. `currentColor` by default so\n * the mark themes with the text around it rather than pinning a brand hex.\n */\nexport const GuiIconSvg = ({\n color = 'currentColor',\n ...props\n}: GuiIconSvgProps): JSX.Element => (\n <svg viewBox=\"0 0 67 67\" width=\"67px\" height=\"67px\" {...props}>\n {MARK_BLOCKS.map((d) => (\n <path key={d} d={d} fill={color} />\n ))}\n </svg>\n)\n"
10
- ]
11
- }
1
+ {"version":3,"file":"GuiLogoSvg.d.ts","sourceRoot":"","sources":["../src/GuiLogoSvg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAG5C,KAAK,eAAe,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,wBAGpB,eAAe,KAAG,GAAG,CAAC,OAMxB,CAAA"}
@@ -1,7 +1,6 @@
1
- import type { JSX } from "react/jsx-runtime";
2
- export declare const LogoIcon: ({ downscale, color }: {
3
- downscale?: number;
4
- color?: string;
1
+ import type { JSX } from 'react/jsx-runtime';
2
+ export declare const LogoIcon: ({ downscale, color, }: {
3
+ downscale?: number;
4
+ color?: string;
5
5
  }) => JSX.Element;
6
-
7
6
  //# sourceMappingURL=LogoIcon.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAEA,cAAc,WAAW;AAEzB,OAAO,cAAM,WAAY,EACvB,WACA,SACC;CACD;CACA;MACE,IAAI",
3
- "names": [],
4
- "sources": [
5
- "src/LogoIcon.tsx"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { YStack } from '@hanzo/gui'\nimport { GuiIconSvg } from './GuiLogoSvg'\nimport type { JSX } from 'react/jsx-runtime'\n\nexport const LogoIcon = ({\n downscale = 2,\n color,\n}: {\n downscale?: number\n color?: string\n}): JSX.Element => {\n return (\n <YStack\n render=\"span\"\n className=\"unselectable\"\n alignSelf=\"center\"\n marginVertical={-10}\n pressStyle={{\n opacity: 0.7,\n scaleX: -1,\n }}\n >\n <GuiIconSvg\n className=\"hanzogui-icon\"\n width={440 / 8 / downscale}\n height={440 / 8 / downscale}\n color={color}\n />\n </YStack>\n )\n}\n"
10
- ]
11
- }
1
+ {"version":3,"file":"LogoIcon.d.ts","sourceRoot":"","sources":["../src/LogoIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE5C,eAAO,MAAM,QAAQ,0BAGlB;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KAAG,GAAG,CAAC,OAoBP,CAAA"}
@@ -1,8 +1,7 @@
1
- import React from "react";
2
- import type { XStackProps } from "@hanzo/gui";
1
+ import React from 'react';
2
+ import type { XStackProps } from '@hanzo/gui';
3
3
  export declare const LogoWords: React.MemoExoticComponent<({ downscale, animated, ...props }: XStackProps & {
4
- downscale?: number;
5
- animated?: boolean;
6
- }) => import("react/jsx-runtime").JSX.Element>;
7
-
4
+ downscale?: number;
5
+ animated?: boolean;
6
+ }) => import('react/jsx-runtime').JSX.Element>;
8
7
  //# sourceMappingURL=LogoWords.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AACA,OAAO,WAAoC;AAC3C,cAAc,mBAAmB;AA0BjC,OAAO,cAAM,WAAW,MAAM,qBAC3B,EACC,WACA,UACA,GAAG,SACF,cAAc;CACf;CACA;aACW",
3
- "names": [],
4
- "sources": [
5
- "src/LogoWords.tsx"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import type { LayoutValue } from '@hanzogui/use-element-layout'\nimport React, { useEffect, useState } from 'react'\nimport type { XStackProps } from '@hanzo/gui'\nimport { Circle, XStack } from '@hanzo/gui'\nimport { WORDMARKS } from '@hanzo/logo/wordmarks'\nimport { useTint } from './useTint'\n\n/**\n * The wordmark.\n *\n * This drew T-A-M-A-G-U-I: seven pixel-art letter polygons on a 373x41 box,\n * each tinted from a seven-colour table, with the hover strip split into seven\n * sections and the dot stepped by a constant fitted to those letters. The fork\n * renamed the package and kept the artwork, so the site's own name was another\n * company's.\n *\n * It renders the outlined Hanzo wordmark from @hanzo/logo now — real paths cut\n * from Zen, so it needs no font loaded and cannot drift from the wordmark every\n * other Hanzo surface uses.\n *\n * The tint interaction stays, because it is a feature rather than a piece of\n * the old wordmark — but it is no longer DIMENSIONED to seven letters. The\n * strip divides by however many tints there are, and the dot rides the same\n * fraction, so the two agree whatever that number becomes.\n */\nconst WORDMARK = WORDMARKS['Hanzo']\nconst [WM_X, WM_Y, WM_W, WM_H] = WORDMARK.box\n\nexport const LogoWords: React.MemoExoticComponent<\n ({\n downscale,\n animated,\n ...props\n }: XStackProps & {\n downscale?: number\n animated?: boolean\n }) => import('react/jsx-runtime').JSX.Element\n> = React.memo(({ downscale = 1, animated, ...props }) => {\n const Tint = useTint()\n const [hovered, setHovered] = React.useState(false)\n const [mounted, setMounted] = React.useState<'start' | 'animate' | 'done'>('start')\n\n const { tintIndex: index } = Tint\n const sections = Tint.tints.length\n\n useEffect(() => {\n const idle = window.requestIdleCallback || setTimeout\n idle(() => {\n setTimeout(() => {\n setMounted('animate')\n }, 50)\n\n setTimeout(() => {\n setMounted('done')\n }, 1500)\n })\n }, [])\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const i = Number.parseInt(event.key, 10) - 1 // Convert key to index (0-based)\n if (!Number.isNaN(i) && i >= 0 && i < Tint.tints.length) {\n Tint.setTintIndex(i)\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown)\n }\n }, [Tint])\n\n const [layout, setLayout] = useState<LayoutValue>()\n\n // The mark is one ink; the tint shows through the dot rather than by\n // recolouring letters, which is what the seven-colour table did.\n const fill = hovered ? `var(--${Tint.tints[index]}9)` : 'var(--color12)'\n\n const width = 373 * (1 / downscale) * 0.3333333\n const height = (width * WM_H) / WM_W\n // the dot sits over the section the current tint owns\n const dotX = Math.round((width / sections) * (index + 0.5))\n\n return (\n <XStack\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n paddingVertical=\"$2\"\n data-tauri-drag-region\n marginVertical=\"$-2\"\n position=\"relative\"\n className=\"logo-words\"\n onLayout={(e) => {\n setLayout(e.nativeEvent.layout as any)\n }}\n // @ts-ignore\n onMouseMove={(e: MouseEvent) => {\n if (!layout) return\n const x = e.clientX - layout.pageX\n const sectionWidth = layout.width / sections\n const section = Math.min(sections - 1, Math.max(0, Math.floor(x / sectionWidth)))\n Tint.setTintIndex(section)\n }}\n {...props}\n >\n {animated && (\n <Circle\n transition=\"medium\"\n position=\"absolute\"\n top={0}\n left={0}\n y={mounted === 'start' ? -30 : -4}\n x={dotX}\n size={4}\n backgroundColor=\"$color12\"\n />\n )}\n\n <svg\n data-tauri-drag-region\n role=\"img\"\n aria-label=\"Hanzo\"\n width={width}\n height={height}\n viewBox={`${WM_X} ${-WM_Y - WM_H} ${WM_W} ${WM_H}`}\n >\n <g transform=\"scale(1,-1)\">\n <path d={WORDMARK.d} fill={fill} />\n </g>\n </svg>\n </XStack>\n )\n})\n"
10
- ]
11
- }
1
+ {"version":3,"file":"LogoWords.d.ts","sourceRoot":"","sources":["../src/LogoWords.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AA0B7C,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAC/C,CAAC,EACC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,GAAG;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,KAAK,OAAO,mBAAmB,EAAE,GAAG,CAAC,OAAO,CAiG7C,CAAA"}
@@ -1,6 +1,5 @@
1
- import type React from "react";
2
- export declare function SeasonProvider({ children }: {
3
- children: React.ReactNode;
1
+ import type React from 'react';
2
+ export declare function SeasonProvider({ children, }: {
3
+ children: React.ReactNode;
4
4
  }): React.ReactNode;
5
-
6
5
  //# sourceMappingURL=SeasonProvider.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAAA,YAAY,WAAW;AAqCvB,OAAO,iBAAS,eAAe,EAC7B,YACC;CACD,UAAU,MAAM;IACd,MAAM",
3
- "names": [],
4
- "sources": [
5
- "src/SeasonProvider.tsx"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import type React from 'react'\nimport { useEffect } from 'react'\nimport { setTintFamily, type TintFamily } from './tints'\n\n// inline script that runs before hydration to set season class on html\n// auto-detects season from current date\nfunction getInlineScript() {\n return `(function(){\n var d = new Date();\n var m = d.getMonth();\n var day = d.getDate();\n var season = 'hanzogui';\n\n if (m === 11 && day >= 14) season = 'xmas';\n else if (m === 9 && day >= 20) season = 'halloween';\n else if (m === 2 && day >= 10 && day <= 17) season = 'stpatricks';\n else if (m === 2 && day >= 30 || m === 3 && day <= 20) season = 'easter';\n else if (m === 1 && day >= 7 && day <= 14) season = 'valentine';\n else if (m === 0 && day >= 20 || m === 1 && day <= 12) season = 'lunar';\n\n if (season !== 'hanzogui') {\n document.documentElement.classList.add(season + '-season');\n }\n window.__GUI_SEASON__ = season;\n})();`\n}\n\n// syncs the tint family with the value computed by the inline script\nfunction useSeasonSync() {\n useEffect(() => {\n const computed = (window as any).__GUI_SEASON__ as TintFamily | undefined\n if (computed) {\n setTintFamily(computed)\n }\n }, [])\n}\n\nexport function SeasonProvider({\n children,\n}: {\n children: React.ReactNode\n}): React.ReactNode {\n useSeasonSync()\n\n return (\n <>\n {/* disabled because were launchig v2 and its lunar new year */}\n {/* <script\n suppressHydrationWarning\n dangerouslySetInnerHTML={{\n __html: getInlineScript(),\n }}\n /> */}\n {children}\n </>\n )\n}\n"
10
- ]
11
- }
1
+ {"version":3,"file":"SeasonProvider.d.ts","sourceRoot":"","sources":["../src/SeasonProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAqC9B,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,GAAG,KAAK,CAAC,SAAS,CAelB"}
@@ -1,11 +1,10 @@
1
- import { type ThemeProps } from "@hanzogui/web";
2
- import type { JSX } from "react/jsx-runtime";
1
+ import { type ThemeProps } from '@hanzogui/web';
2
+ import type { JSX } from 'react/jsx-runtime';
3
3
  export declare const ThemeTint: ({ disable, children, ...rest }: ThemeProps & {
4
- disable?: boolean;
4
+ disable?: boolean;
5
5
  }) => JSX.Element;
6
6
  export declare const ThemeTintAlt: ({ children, disable, offset, ...rest }: ThemeProps & {
7
- disable?: boolean;
8
- offset?: number;
7
+ disable?: boolean;
8
+ offset?: number;
9
9
  }) => JSX.Element;
10
-
11
10
  //# sourceMappingURL=ThemeTint.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAAA,cAAc,kBAAyB;AACvC,cAAc,WAAW;AAGzB,OAAO,cAAM,YAAa,EACxB,SACA,UACA,GAAG,QACF,aAAa;CAAE;MAAsB,IAAI;AAU5C,OAAO,cAAM,eAAgB,EAC3B,UACA,SACA,QACA,GAAG,QACF,aAAa;CAAE;CAAmB;MAAoB,IAAI",
3
- "names": [],
4
- "sources": [
5
- "src/ThemeTint.tsx"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { type ThemeProps, Theme } from '@hanzogui/web'\nimport type { JSX } from 'react/jsx-runtime'\nimport { useTint } from './useTint'\n\nexport const ThemeTint = ({\n disable,\n children,\n ...rest\n}: ThemeProps & { disable?: boolean }): JSX.Element => {\n const curTint = useTint().tint\n\n return (\n <Theme {...rest} name={disable ? null : curTint}>\n {children}\n </Theme>\n )\n}\n\nexport const ThemeTintAlt = ({\n children,\n disable,\n offset = 1,\n ...rest\n}: ThemeProps & { disable?: boolean; offset?: number }): JSX.Element => {\n const curTint = useTint(offset).tintAlt\n const name = disable ? null : curTint\n return (\n <Theme name={name} {...rest}>\n {children}\n </Theme>\n )\n}\n"
10
- ]
11
- }
1
+ {"version":3,"file":"ThemeTint.d.ts","sourceRoot":"","sources":["../src/ThemeTint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAS,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAG5C,eAAO,MAAM,SAAS,mCAInB,UAAU,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,GAAG,CAAC,OAQ3C,CAAA;AAED,eAAO,MAAM,YAAY,2CAKtB,UAAU,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,GAAG,CAAC,OAQ5D,CAAA"}
package/types/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- export * from "./GuiLogo";
2
- export * from "./LogoWords";
3
- export * from "./LogoIcon";
4
- export * from "./tints";
5
- export * from "./useTint";
6
- export * from "./ThemeTint";
7
- export * from "./SeasonProvider";
8
-
1
+ export * from './GuiLogo.tsx';
2
+ export * from './LogoWords.tsx';
3
+ export * from './LogoIcon.tsx';
4
+ export * from './tints.tsx';
5
+ export * from './useTint.tsx';
6
+ export * from './ThemeTint.tsx';
7
+ export * from './SeasonProvider.tsx';
9
8
  //# sourceMappingURL=index.d.ts.map