@pathscale/ui 1.1.27 → 1.1.29

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.
@@ -42,33 +42,39 @@ const ThemeColorPicker_ThemeColorPicker = (props)=>{
42
42
  const GRAYSCALE_SWATCHES = [
43
43
  {
44
44
  label: "White",
45
+ hex: "#fafafa",
45
46
  theme: "light"
46
47
  },
47
48
  {
48
49
  label: "Light gray",
50
+ hex: "#d4d4d4",
49
51
  theme: "light"
50
52
  },
51
53
  {
52
54
  label: "Gray",
55
+ hex: "#737373",
53
56
  theme: "light"
54
57
  },
55
58
  {
56
59
  label: "Dark gray",
60
+ hex: "#404040",
57
61
  theme: "dark"
58
62
  },
59
63
  {
60
64
  label: "Charcoal",
65
+ hex: "#262626",
61
66
  theme: "dark"
62
67
  },
63
68
  {
64
69
  label: "Black",
70
+ hex: "#0a0a0a",
65
71
  theme: "dark"
66
72
  }
67
73
  ];
68
- const handleGrayscale = (theme)=>{
69
- store().setThemeColor(null);
74
+ const handleGrayscale = (swatch)=>{
75
+ store().setThemeColor(swatch.hex);
70
76
  local.onColorChange?.(null, 0);
71
- local.onThemeSwitch?.(theme);
77
+ local.onThemeSwitch?.(swatch.theme);
72
78
  };
73
79
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
74
80
  if (!isOpen()) return;
@@ -156,18 +162,11 @@ const ThemeColorPicker_ThemeColorPicker = (props)=>{
156
162
  }));
157
163
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
158
164
  each: GRAYSCALE_SWATCHES,
159
- children: (g, i)=>(()=>{
165
+ children: (g)=>(()=>{
160
166
  var _el$6 = _tmpl$4();
161
- _el$6.$$click = ()=>handleGrayscale(g.theme);
167
+ _el$6.$$click = ()=>handleGrayscale(g);
162
168
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
163
- var _v$ = `oklch(${[
164
- 95,
165
- 80,
166
- 60,
167
- 40,
168
- 25,
169
- 5
170
- ][i()]}% 0 0)`, _v$2 = g.label;
169
+ var _v$ = `${g.hex}`, _v$2 = g.label;
171
170
  _v$ !== _p$.e && (null != (_p$.e = _v$) ? _el$6.style.setProperty("background-color", _v$) : _el$6.style.removeProperty("background-color"));
172
171
  _v$2 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$6, "aria-label", _p$.t = _v$2);
173
172
  return _p$;
@@ -165,10 +165,10 @@ function createHueShiftStore(storagePrefix) {
165
165
  });
166
166
  if ("undefined" != typeof window) {
167
167
  const observer = new MutationObserver((mutations)=>{
168
- for (const mutation of mutations)if ("attributes" === mutation.type && "data-theme" === mutation.attributeName) {
168
+ for (const mutation of mutations)if ("attributes" === mutation.type && "data-theme" === mutation.attributeName) requestAnimationFrame(()=>{
169
169
  const color = themeColor();
170
- if (null !== color) requestAnimationFrame(()=>applyThemeColor(color));
171
- }
170
+ if (null !== color) applyThemeColor(color);
171
+ });
172
172
  });
173
173
  observer.observe(document.documentElement, {
174
174
  attributes: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "1.1.27",
3
+ "version": "1.1.29",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",