@luminescent/ui-qwik 6.8.3-2 → 7.0.0-0

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 (98) hide show
  1. package/LICENSE +661 -0
  2. package/lib/assets/BBIagblG-bundle-graph.json +1 -0
  3. package/lib/assets/ChtqwOpy-bundle-graph.json +1 -0
  4. package/lib/components/elements/Anchor.d.ts +1 -4
  5. package/lib/components/elements/Anchor.qwik.cjs +21 -25
  6. package/lib/components/elements/Anchor.qwik.mjs +21 -25
  7. package/lib/components/elements/Blobs.d.ts +3 -4
  8. package/lib/components/elements/Blobs.qwik.cjs +181 -187
  9. package/lib/components/elements/Blobs.qwik.mjs +182 -189
  10. package/lib/components/elements/ColorPicker.d.ts +1 -4
  11. package/lib/components/elements/ColorPicker.qwik.cjs +285 -303
  12. package/lib/components/elements/ColorPicker.qwik.mjs +285 -303
  13. package/lib/components/elements/Dropdown.d.ts +1 -4
  14. package/lib/components/elements/Dropdown.qwik.cjs +20 -30
  15. package/lib/components/elements/Dropdown.qwik.mjs +20 -30
  16. package/lib/components/elements/Label.d.ts +6 -0
  17. package/lib/components/elements/Label.qwik.cjs +10 -0
  18. package/lib/components/elements/Label.qwik.mjs +10 -0
  19. package/lib/components/elements/Nav.d.ts +3 -6
  20. package/lib/components/elements/Nav.qwik.cjs +63 -97
  21. package/lib/components/elements/Nav.qwik.mjs +63 -97
  22. package/lib/components/elements/NumberInput.d.ts +4 -11
  23. package/lib/components/elements/NumberInput.qwik.cjs +52 -78
  24. package/lib/components/elements/NumberInput.qwik.mjs +51 -77
  25. package/lib/components/elements/RangeInput.d.ts +2 -9
  26. package/lib/components/elements/RangeInput.qwik.cjs +45 -76
  27. package/lib/components/elements/RangeInput.qwik.mjs +46 -77
  28. package/lib/components/elements/SelectMenu.d.ts +5 -8
  29. package/lib/components/elements/SelectMenu.qwik.cjs +90 -133
  30. package/lib/components/elements/SelectMenu.qwik.mjs +90 -133
  31. package/lib/components/elements/Sidebar.d.ts +1 -4
  32. package/lib/components/elements/Sidebar.qwik.cjs +19 -36
  33. package/lib/components/elements/Sidebar.qwik.mjs +20 -37
  34. package/lib/components/elements/Toggle.d.ts +1 -2
  35. package/lib/components/elements/Toggle.qwik.cjs +22 -38
  36. package/lib/components/elements/Toggle.qwik.mjs +23 -39
  37. package/lib/components/elements.d.ts +1 -0
  38. package/lib/components/functions.d.ts +2 -0
  39. package/lib/components/functions.qwik.cjs +19 -16
  40. package/lib/components/functions.qwik.mjs +19 -17
  41. package/lib/index.d.ts +0 -1
  42. package/lib/index.qwik.cjs +26 -48
  43. package/lib/index.qwik.mjs +6 -42
  44. package/lib/q-manifest.json +239 -0
  45. package/lib/svg/ChevronDown.d.ts +1 -1
  46. package/lib/svg/ChevronDown.qwik.cjs +18 -22
  47. package/lib/svg/ChevronDown.qwik.mjs +19 -23
  48. package/lib/svg/Link.d.ts +1 -1
  49. package/lib/svg/Link.qwik.cjs +27 -33
  50. package/lib/svg/Link.qwik.mjs +28 -34
  51. package/lib/svg/Menu.d.ts +1 -1
  52. package/lib/svg/Menu.qwik.cjs +22 -30
  53. package/lib/svg/Menu.qwik.mjs +23 -31
  54. package/lib/svg/Minus.d.ts +1 -1
  55. package/lib/svg/Minus.qwik.cjs +18 -22
  56. package/lib/svg/Minus.qwik.mjs +19 -23
  57. package/lib/svg/Plus.d.ts +1 -1
  58. package/lib/svg/Plus.qwik.cjs +18 -27
  59. package/lib/svg/Plus.qwik.mjs +19 -28
  60. package/lib/svg/Shuffle.d.ts +1 -1
  61. package/lib/svg/Shuffle.qwik.cjs +24 -36
  62. package/lib/svg/Shuffle.qwik.mjs +25 -37
  63. package/lib/utils/color.qwik.cjs +101 -115
  64. package/lib/utils/color.qwik.mjs +102 -122
  65. package/package.json +14 -14
  66. package/lib/components/logos/Birdflop.d.ts +0 -7
  67. package/lib/components/logos/Birdflop.qwik.cjs +0 -73
  68. package/lib/components/logos/Birdflop.qwik.mjs +0 -73
  69. package/lib/components/logos/Discord.d.ts +0 -2
  70. package/lib/components/logos/Discord.qwik.cjs +0 -18
  71. package/lib/components/logos/Discord.qwik.mjs +0 -18
  72. package/lib/components/logos/Fabric.d.ts +0 -2
  73. package/lib/components/logos/Fabric.qwik.cjs +0 -32
  74. package/lib/components/logos/Fabric.qwik.mjs +0 -32
  75. package/lib/components/logos/Forge.d.ts +0 -2
  76. package/lib/components/logos/Forge.qwik.cjs +0 -31
  77. package/lib/components/logos/Forge.qwik.mjs +0 -31
  78. package/lib/components/logos/Luminescent.d.ts +0 -3
  79. package/lib/components/logos/Luminescent.qwik.cjs +0 -143
  80. package/lib/components/logos/Luminescent.qwik.mjs +0 -143
  81. package/lib/components/logos/Paper.d.ts +0 -2
  82. package/lib/components/logos/Paper.qwik.cjs +0 -40
  83. package/lib/components/logos/Paper.qwik.mjs +0 -40
  84. package/lib/components/logos/Pterodactyl.d.ts +0 -2
  85. package/lib/components/logos/Pterodactyl.qwik.cjs +0 -35
  86. package/lib/components/logos/Pterodactyl.qwik.mjs +0 -35
  87. package/lib/components/logos/Purpur.d.ts +0 -2
  88. package/lib/components/logos/Purpur.qwik.cjs +0 -76
  89. package/lib/components/logos/Purpur.qwik.mjs +0 -76
  90. package/lib/components/logos/Velocity.d.ts +0 -2
  91. package/lib/components/logos/Velocity.qwik.cjs +0 -27
  92. package/lib/components/logos/Velocity.qwik.mjs +0 -27
  93. package/lib/components/logos/Waterfall.d.ts +0 -2
  94. package/lib/components/logos/Waterfall.qwik.cjs +0 -21
  95. package/lib/components/logos/Waterfall.qwik.mjs +0 -21
  96. package/lib/components/logos.d.ts +0 -10
  97. /package/lib/components/docs/{IconsLogos.d.ts → Label.d.ts} +0 -0
  98. /package/lib/{components/logos → svg}/IconProps.d.ts +0 -0
@@ -1,314 +1,296 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("@qwik.dev/core/jsx-runtime");
4
- const core = require("@qwik.dev/core");
5
- const color = require("../../utils/color.qwik.cjs");
6
- const Shuffle = require("../../svg/Shuffle.qwik.cjs");
7
- const ColorPicker = core.component$(({ id, value = "#000000", colors = [
8
- "#FAEDCB",
9
- "#C9E4DE",
10
- "#C6DEF1",
11
- "#DBCDF0",
12
- "#F2C6DE",
13
- "#FCD05C",
14
- "#5FE2C5",
15
- "#4498DB",
16
- "#9863E7",
17
- "#E43A96",
18
- "#000000",
19
- "#555555",
20
- "#AAAAAA",
21
- "#FFFFFF"
22
- ], onInput$, preview = "left", horizontal, showInput = true, opacity, ...props }) => {
23
- const height = 150;
24
- const width = height - 25;
25
- const maxHue = height - 2;
26
- const hsvColor = color.rgbToHsv(color.hexToRgba(value));
27
- const store = core.useStore({
28
- hue: {
29
- position: hsvColor.h * maxHue,
30
- color: color.rgbToHex(color.hsvToRgb({
31
- h: hsvColor.h,
32
- s: 1,
33
- v: 1
34
- }))
35
- },
36
- opacity: {
37
- position: hsvColor.a !== void 0 ? (1 - hsvColor.a) * maxHue : 0
38
- },
39
- bPosition: (1 - hsvColor.v) * maxHue,
40
- sPosition: hsvColor.s * width,
41
- value
42
- });
43
- const setColor = core.$(async (color$1) => {
44
- if (!/^#[0-9a-f]{0,8}$/i.test(color$1)) return;
45
- const hsv = color.rgbToHsv(color.hexToRgba(color$1));
46
- store.hue.position = hsv.h * maxHue;
47
- store.hue.color = color.rgbToHex(color.hsvToRgb({
48
- h: hsv.h,
49
- s: 1,
50
- v: 1,
51
- a: hsv.a
52
- }));
53
- store.sPosition = hsv.s * width;
54
- store.bPosition = (1 - hsv.v) * maxHue;
55
- store.value = color$1;
56
- await onInput$?.(store.value);
57
- });
58
- const hueChange = core.$(async (e, hOffset) => {
59
- const { y } = color.getMousePosition(e);
60
- store.hue.position = color.clamp(maxHue - (y - hOffset), 0, maxHue);
61
- const hsvColor2 = color.rgbToHsv(color.hexToRgba(store.value));
62
- const h = store.hue.position / maxHue;
63
- hsvColor2.h = h;
64
- store.hue.color = color.rgbToHex(color.hsvToRgb({
65
- h,
66
- s: 1,
67
- v: 1,
68
- a: hsvColor2.a
69
- }));
70
- store.value = color.rgbToHex(color.hsvToRgb(hsvColor2));
71
- await onInput$?.(store.value);
72
- });
73
- const hueMouseDown = core.$(async (e, el) => {
74
- const hOffset = el.getBoundingClientRect().top;
75
- await hueChange(e, hOffset);
76
- const eventListener = (e2) => void hueChange(e2, hOffset);
77
- window.addEventListener("mousemove", eventListener);
78
- window.addEventListener("touchmove", eventListener);
79
- const mouseUpListener = () => {
80
- window.removeEventListener("mousemove", eventListener);
81
- window.removeEventListener("touchmove", eventListener);
82
- window.removeEventListener("mouseup", mouseUpListener);
83
- window.removeEventListener("touchend", mouseUpListener);
84
- };
85
- window.addEventListener("mouseup", mouseUpListener);
86
- window.addEventListener("touchend", mouseUpListener);
87
- });
88
- const sbChange = core.$(async (e, hOffset) => {
89
- const { x, y } = color.getMousePosition(e);
90
- store.bPosition = color.clamp(y - hOffset.top, 0, maxHue);
91
- store.sPosition = color.clamp(x - hOffset.left, 0, width);
92
- const s = store.sPosition / width;
93
- const v = 1 - store.bPosition / maxHue;
94
- store.value = color.rgbToHex(color.hsvToRgb({
95
- h: store.hue.position / maxHue,
96
- s,
97
- v,
98
- a: store.opacity.position !== void 0 ? 1 - store.opacity.position / maxHue : 1
99
- }));
100
- await onInput$?.(store.value);
101
- });
102
- const sbMouseDown = core.$(async (e, el) => {
103
- const offset = el.getBoundingClientRect();
104
- await sbChange(e, offset);
105
- const eventListener = (e2) => void sbChange(e2, offset);
106
- window.addEventListener("mousemove", eventListener);
107
- window.addEventListener("touchmove", eventListener);
108
- const mouseUpListener = () => {
109
- window.removeEventListener("mousemove", eventListener);
110
- window.removeEventListener("touchmove", eventListener);
111
- window.removeEventListener("mouseup", mouseUpListener);
112
- window.removeEventListener("touchend", mouseUpListener);
113
- };
114
- window.addEventListener("mouseup", mouseUpListener);
115
- window.addEventListener("touchend", mouseUpListener);
116
- });
117
- const opacityChange = core.$(async (e, hOffset) => {
118
- const { x } = color.getMousePosition(e);
119
- store.opacity.position = color.clamp(x - hOffset.left, 0, maxHue);
120
- const a = 1 - store.opacity.position / maxHue;
121
- const hsvColor2 = color.rgbToHsv(color.hexToRgba(store.value));
122
- hsvColor2.a = a;
123
- store.value = color.rgbToHex(color.hsvToRgb(hsvColor2));
124
- await onInput$?.(store.value);
125
- });
126
- const opacityMouseDown = core.$(async (e, el) => {
127
- const offset = el.getBoundingClientRect();
128
- await opacityChange(e, offset);
129
- const eventListener = (e2) => void opacityChange(e2, offset);
130
- window.addEventListener("mousemove", eventListener);
131
- window.addEventListener("touchmove", eventListener);
132
- const mouseUpListener = () => {
133
- window.removeEventListener("mousemove", eventListener);
134
- window.removeEventListener("touchmove", eventListener);
135
- window.removeEventListener("mouseup", mouseUpListener);
136
- window.removeEventListener("touchend", mouseUpListener);
137
- };
138
- window.addEventListener("mouseup", mouseUpListener);
139
- window.addEventListener("touchend", mouseUpListener);
140
- });
141
- return /* @__PURE__ */ jsxRuntime.jsxs("div", {
142
- class: {
143
- "lum-card touch-none p-4": true,
144
- "flex-col": !horizontal,
145
- ...props.class
146
- },
147
- id,
148
- onInput$: async (e, el) => {
149
- if (!el.dataset.value) return;
150
- await setColor(el.dataset.value);
151
- },
152
- children: [
153
- /* @__PURE__ */ jsxRuntime.jsxs("div", {
154
- class: "flex gap-4",
155
- children: [
156
- /* @__PURE__ */ jsxRuntime.jsxs("div", {
157
- class: "relative h-37.5 w-31.25 rounded-md",
158
- style: {
159
- background: `linear-gradient(to right, #FFFFFF, ${store.hue.color})`
160
- },
161
- onMouseDown$: sbMouseDown,
162
- onTouchStart$: sbMouseDown,
163
- "preventdefault:mousedown": true,
164
- "preventdefault:touchstart": true,
165
- children: [
166
- /* @__PURE__ */ jsxRuntime.jsx("div", {
167
- class: "h-37.5 w-31.25 rounded-md border border-gray-700 bg-linear-to-b from-transparent to-black"
168
- }),
169
- /* @__PURE__ */ jsxRuntime.jsx("div", {
170
- class: {
171
- "absolute -top-2 -left-2 h-4 w-4 rounded-md border lum-bg drop-shadow-lg": true
172
- },
173
- style: {
174
- "--bg-color": store.value,
175
- transform: `translate(${store.sPosition}px, ${store.bPosition}px)`
176
- }
177
- })
178
- ]
179
- }),
180
- /* @__PURE__ */ jsxRuntime.jsx("div", {
181
- class: "relative h-37.5 w-2 rounded-md border border-gray-700",
182
- style: {
183
- background: "linear-gradient(to bottom, #ff0000, #ff00ff, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000)"
184
- },
185
- onMouseDown$: hueMouseDown,
186
- onTouchStart$: hueMouseDown,
187
- "preventdefault:mousedown": true,
188
- "preventdefault:touchstart": true,
189
- children: /* @__PURE__ */ jsxRuntime.jsx("div", {
190
- class: "absolute -bottom-2 -left-1.25 h-4 w-4 rounded-md lum-bg! bg-[#ff0000] ",
191
- style: {
192
- transform: `translateY(${-store.hue.position}px)`,
193
- "--bg-color": store.hue.color
194
- }
195
- })
196
- })
197
- ]
198
- }),
199
- opacity && /* @__PURE__ */ jsxRuntime.jsxs("div", {
200
- class: "relative h-2 w-full rounded-md",
201
- onMouseDown$: opacityMouseDown,
202
- onTouchStart$: opacityMouseDown,
203
- "preventdefault:mousedown": true,
204
- "preventdefault:touchstart": true,
205
- style: {
206
- backgroundColor: "white",
207
- backgroundImage: `
1
+ const require_functions = require("../functions.qwik.cjs");
2
+ const require_color = require("../../utils/color.qwik.cjs");
3
+ const require_Shuffle = require("../../svg/Shuffle.qwik.cjs");
4
+ let _qwik_dev_core = require("@qwik.dev/core");
5
+ //#region src/components/elements/ColorPicker.tsx
6
+ var _hf0 = (p0) => ({ background: `linear-gradient(to right, #FFFFFF, ${p0.hue.color})` });
7
+ var _hf1 = (p0) => ({
8
+ "--bg-color": p0.value,
9
+ transform: `translate(${p0.sPosition}px, ${p0.bPosition}px)`
10
+ });
11
+ var _hf2 = (p0) => ({
12
+ transform: `translateY(${-p0.hue.position}px)`,
13
+ "--bg-color": p0.hue.color
14
+ });
15
+ var _hf3 = (p0) => ({ background: `linear-gradient(to right, ${p0.value}, transparent)` });
16
+ var _hf4 = (p0) => ({ backgroundColor: `${p0.value}` });
17
+ var _hf5 = (p0, p1) => ({
18
+ "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] p-0 lum-bg hover:brightness-150": true,
19
+ "border-lum-accent": p0 === p1.value
20
+ });
21
+ var ColorPicker = /* @__PURE__ */ (0, _qwik_dev_core.componentQrl)(/* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(({ id, class: Class, value = "#000000", colors = [
22
+ "#FAEDCB",
23
+ "#C9E4DE",
24
+ "#C6DEF1",
25
+ "#DBCDF0",
26
+ "#F2C6DE",
27
+ "#FCD05C",
28
+ "#5FE2C5",
29
+ "#4498DB",
30
+ "#9863E7",
31
+ "#E43A96",
32
+ "#000000",
33
+ "#555555",
34
+ "#AAAAAA",
35
+ "#FFFFFF"
36
+ ], onInput$, preview = "left", horizontal, showInput = true, opacity }) => {
37
+ const height = 150;
38
+ const width = height - 25;
39
+ const maxHue = height - 2;
40
+ const hsvColor = require_color.rgbToHsv(require_color.hexToRgba(value));
41
+ const store = (0, _qwik_dev_core.useStore)({
42
+ hue: {
43
+ position: hsvColor.h * maxHue,
44
+ color: require_color.rgbToHex(require_color.hsvToRgb({
45
+ h: hsvColor.h,
46
+ s: 1,
47
+ v: 1
48
+ }))
49
+ },
50
+ opacity: { position: hsvColor.a !== void 0 ? (1 - hsvColor.a) * maxHue : 0 },
51
+ bPosition: (1 - hsvColor.v) * maxHue,
52
+ sPosition: hsvColor.s * width,
53
+ value
54
+ });
55
+ const setColor = /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (color) => {
56
+ const maxHue = _qwik_dev_core._captures[0], onInput$ = _qwik_dev_core._captures[1], store = _qwik_dev_core._captures[2], width = _qwik_dev_core._captures[3];
57
+ if (!/^#[0-9a-f]{0,8}$/i.test(color)) return;
58
+ const hsv = require_color.rgbToHsv(require_color.hexToRgba(color));
59
+ store.hue.position = hsv.h * maxHue;
60
+ store.hue.color = require_color.rgbToHex(require_color.hsvToRgb({
61
+ h: hsv.h,
62
+ s: 1,
63
+ v: 1,
64
+ a: hsv.a
65
+ }));
66
+ store.sPosition = hsv.s * width;
67
+ store.bPosition = (1 - hsv.v) * maxHue;
68
+ store.value = color;
69
+ await onInput$?.(store.value);
70
+ }, "ColorPicker_component_setColor_m9tT2MF9iI8", [
71
+ maxHue,
72
+ onInput$,
73
+ store,
74
+ width
75
+ ]);
76
+ const hueMouseDown = /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, el) => {
77
+ const hueChange = _qwik_dev_core._captures[0];
78
+ const hOffset = el.getBoundingClientRect().top;
79
+ await hueChange(e, hOffset);
80
+ const eventListener = (e) => void hueChange(e, hOffset);
81
+ window.addEventListener("mousemove", eventListener);
82
+ window.addEventListener("touchmove", eventListener);
83
+ const mouseUpListener = () => {
84
+ window.removeEventListener("mousemove", eventListener);
85
+ window.removeEventListener("touchmove", eventListener);
86
+ window.removeEventListener("mouseup", mouseUpListener);
87
+ window.removeEventListener("touchend", mouseUpListener);
88
+ };
89
+ window.addEventListener("mouseup", mouseUpListener);
90
+ window.addEventListener("touchend", mouseUpListener);
91
+ }, "ColorPicker_component_hueMouseDown_cw08gCPBKtw", [/* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, hOffset) => {
92
+ const maxHue = _qwik_dev_core._captures[0], onInput$ = _qwik_dev_core._captures[1], store = _qwik_dev_core._captures[2];
93
+ const { y } = require_color.getMousePosition(e);
94
+ store.hue.position = require_color.clamp(maxHue - (y - hOffset), 0, maxHue);
95
+ const hsvColor = require_color.rgbToHsv(require_color.hexToRgba(store.value));
96
+ const h = store.hue.position / maxHue;
97
+ hsvColor.h = h;
98
+ store.hue.color = require_color.rgbToHex(require_color.hsvToRgb({
99
+ h,
100
+ s: 1,
101
+ v: 1,
102
+ a: hsvColor.a
103
+ }));
104
+ store.value = require_color.rgbToHex(require_color.hsvToRgb(hsvColor));
105
+ await onInput$?.(store.value);
106
+ }, "ColorPicker_component_hueChange_c0i9qwof0Yw", [
107
+ maxHue,
108
+ onInput$,
109
+ store
110
+ ])]);
111
+ const sbMouseDown = /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, el) => {
112
+ const sbChange = _qwik_dev_core._captures[0];
113
+ const offset = el.getBoundingClientRect();
114
+ await sbChange(e, offset);
115
+ const eventListener = (e) => void sbChange(e, offset);
116
+ window.addEventListener("mousemove", eventListener);
117
+ window.addEventListener("touchmove", eventListener);
118
+ const mouseUpListener = () => {
119
+ window.removeEventListener("mousemove", eventListener);
120
+ window.removeEventListener("touchmove", eventListener);
121
+ window.removeEventListener("mouseup", mouseUpListener);
122
+ window.removeEventListener("touchend", mouseUpListener);
123
+ };
124
+ window.addEventListener("mouseup", mouseUpListener);
125
+ window.addEventListener("touchend", mouseUpListener);
126
+ }, "ColorPicker_component_sbMouseDown_Vor71dUNt7g", [/* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, hOffset) => {
127
+ const maxHue = _qwik_dev_core._captures[0], onInput$ = _qwik_dev_core._captures[1], store = _qwik_dev_core._captures[2], width = _qwik_dev_core._captures[3];
128
+ const { x, y } = require_color.getMousePosition(e);
129
+ store.bPosition = require_color.clamp(y - hOffset.top, 0, maxHue);
130
+ store.sPosition = require_color.clamp(x - hOffset.left, 0, width);
131
+ const s = store.sPosition / width;
132
+ const v = 1 - store.bPosition / maxHue;
133
+ store.value = require_color.rgbToHex(require_color.hsvToRgb({
134
+ h: store.hue.position / maxHue,
135
+ s,
136
+ v,
137
+ a: store.opacity.position !== void 0 ? 1 - store.opacity.position / maxHue : 1
138
+ }));
139
+ await onInput$?.(store.value);
140
+ }, "ColorPicker_component_sbChange_NwrBaY0ccx0", [
141
+ maxHue,
142
+ onInput$,
143
+ store,
144
+ width
145
+ ])]);
146
+ const opacityMouseDown = /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, el) => {
147
+ const opacityChange = _qwik_dev_core._captures[0];
148
+ const offset = el.getBoundingClientRect();
149
+ await opacityChange(e, offset);
150
+ const eventListener = (e) => void opacityChange(e, offset);
151
+ window.addEventListener("mousemove", eventListener);
152
+ window.addEventListener("touchmove", eventListener);
153
+ const mouseUpListener = () => {
154
+ window.removeEventListener("mousemove", eventListener);
155
+ window.removeEventListener("touchmove", eventListener);
156
+ window.removeEventListener("mouseup", mouseUpListener);
157
+ window.removeEventListener("touchend", mouseUpListener);
158
+ };
159
+ window.addEventListener("mouseup", mouseUpListener);
160
+ window.addEventListener("touchend", mouseUpListener);
161
+ }, "ColorPicker_component_opacityMouseDown_U0p127RN2e0", [/* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, hOffset) => {
162
+ const maxHue = _qwik_dev_core._captures[0], onInput$ = _qwik_dev_core._captures[1], store = _qwik_dev_core._captures[2];
163
+ const { x } = require_color.getMousePosition(e);
164
+ store.opacity.position = require_color.clamp(x - hOffset.left, 0, maxHue);
165
+ const a = 1 - store.opacity.position / maxHue;
166
+ const hsvColor = require_color.rgbToHsv(require_color.hexToRgba(store.value));
167
+ hsvColor.a = a;
168
+ store.value = require_color.rgbToHex(require_color.hsvToRgb(hsvColor));
169
+ await onInput$?.(store.value);
170
+ }, "ColorPicker_component_opacityChange_WBZtDRHmnMU", [
171
+ maxHue,
172
+ onInput$,
173
+ store
174
+ ])]);
175
+ return /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", {
176
+ class: {
177
+ "lum-card touch-none p-4": true,
178
+ "flex-col": !horizontal,
179
+ ...require_functions.getClassObject(Class)
180
+ },
181
+ id,
182
+ "q-e:input": /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, el, setColor) => {
183
+ if (!el.dataset.value) return;
184
+ await setColor(el.dataset.value);
185
+ }, "ColorPicker_component_div_q_e_input_6CeAo90QNf4"),
186
+ "q:p": setColor
187
+ }, null, [
188
+ /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, { class: "flex gap-4" }, [/* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, {
189
+ class: "relative h-37.5 w-31.25 rounded-md",
190
+ style: (0, _qwik_dev_core._fnSignal)(_hf0, [store]),
191
+ "q-e:mousedown": sbMouseDown,
192
+ "q-e:touchstart": sbMouseDown,
193
+ "preventdefault:mousedown": true,
194
+ "preventdefault:touchstart": true
195
+ }, [/* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, { class: "h-37.5 w-31.25 rounded-md border border-gray-700 bg-linear-to-b from-transparent to-black" }, null, 3, null), /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, {
196
+ class: { "absolute -top-2 -left-2 h-4 w-4 rounded-md border lum-bg drop-shadow-lg": true },
197
+ style: (0, _qwik_dev_core._fnSignal)(_hf1, [store])
198
+ }, null, 3, null)], 3, null), /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, {
199
+ class: "relative h-37.5 w-2 rounded-md border border-gray-700",
200
+ style: { background: "linear-gradient(to bottom, #ff0000, #ff00ff, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000)" },
201
+ "q-e:mousedown": hueMouseDown,
202
+ "q-e:touchstart": hueMouseDown,
203
+ "preventdefault:mousedown": true,
204
+ "preventdefault:touchstart": true
205
+ }, /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, {
206
+ class: "absolute -bottom-2 -left-1.25 h-4 w-4 rounded-md lum-bg! bg-[#ff0000] ",
207
+ style: (0, _qwik_dev_core._fnSignal)(_hf2, [store])
208
+ }, null, 3, null), 3, null)], 3, null),
209
+ opacity && /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, {
210
+ class: "relative h-2 w-full rounded-md",
211
+ "q-e:mousedown": opacityMouseDown,
212
+ "q-e:touchstart": opacityMouseDown,
213
+ "preventdefault:mousedown": true,
214
+ "preventdefault:touchstart": true,
215
+ style: {
216
+ backgroundColor: "white",
217
+ backgroundImage: `
208
218
  linear-gradient(45deg, #ccc 25%, transparent 25%),
209
219
  linear-gradient(135deg, #ccc 25%, transparent 25%),
210
220
  linear-gradient(45deg, transparent 75%, #ccc 75%),
211
221
  linear-gradient(135deg, transparent 75%, #ccc 75%);
212
222
  `,
213
- backgroundSize: "8px 8px",
214
- backgroundPosition: "0 0, 4px 0, 4px -4px, 0 4px"
215
- },
216
- children: [
217
- /* @__PURE__ */ jsxRuntime.jsx("div", {
218
- class: "alsolute inset-0 h-2 w-full rounded-md border border-gray-700",
219
- style: {
220
- background: `linear-gradient(to right, ${store.value}, transparent)`
221
- }
222
- }),
223
- /* @__PURE__ */ jsxRuntime.jsx("div", {
224
- class: "absolute -bottom-1.25 -left-1.25 h-4 w-4 rounded-md",
225
- style: {
226
- transform: `translateX(${store.opacity.position ?? 1}px)`,
227
- backgroundColor: store.value,
228
- backgroundImage: `
223
+ backgroundSize: "8px 8px",
224
+ backgroundPosition: "0 0, 4px 0, 4px -4px, 0 4px"
225
+ }
226
+ }, [/* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, {
227
+ class: "alsolute inset-0 h-2 w-full rounded-md border border-gray-700",
228
+ style: (0, _qwik_dev_core._fnSignal)(_hf3, [store])
229
+ }, null, 3, null), /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", { style: {
230
+ transform: `translateX(${store.opacity.position ?? 1}px)`,
231
+ backgroundColor: store.value,
232
+ backgroundImage: `
229
233
  linear-gradient(45deg, #ccc4 25%, transparent 25%),
230
234
  linear-gradient(135deg, #ccc4 25%, transparent 25%),
231
235
  linear-gradient(45deg, transparent 75%, #ccc4 75%),
232
236
  linear-gradient(135deg, transparent 75%, #ccc4 75%);
233
237
  `,
234
- backgroundSize: "8px 8px",
235
- backgroundPosition: "0 0, 4px 0, 4px -4px, 0 4px"
236
- }
237
- })
238
- ]
239
- }),
240
- /* @__PURE__ */ jsxRuntime.jsxs("div", {
241
- class: "flex w-37.5 flex-wrap justify-between gap-1",
242
- children: [
243
- showInput && /* @__PURE__ */ jsxRuntime.jsxs("div", {
244
- class: {
245
- "mb-2 flex w-37.5 border-b border-b-gray-700 pb-3": true,
246
- "flex-row gap-1": preview == "left",
247
- "flex-row-reverse gap-1": preview == "right",
248
- "flex-col": preview == "top",
249
- "flex-col-reverse": preview == "bottom"
250
- },
251
- children: [
252
- preview != "full" && /* @__PURE__ */ jsxRuntime.jsx("div", {
253
- class: {
254
- "border border-gray-700 rounded-sm": true,
255
- "aspect-square h-full": preview == "left" || preview == "right",
256
- "h-3 w-full": preview == "top" || preview == "bottom",
257
- "rounded-b-none": preview == "top",
258
- "rounded-t-none": preview == "bottom"
259
- },
260
- style: {
261
- backgroundColor: `${store.value}`
262
- }
263
- }),
264
- /* @__PURE__ */ jsxRuntime.jsx("input", {
265
- class: {
266
- "lum-input w-full p-1 text-xs rounded-sm": true,
267
- "rounded-t-none border-t-0": preview == "top",
268
- "rounded-b-none border-b-0": preview == "bottom"
269
- },
270
- value: store.value,
271
- style: preview == "full" ? {
272
- backgroundColor: `${store.value}`,
273
- color: color.getBrightness(color.hexToRgba(store.value)) > 0.5 ? "black" : "white"
274
- } : {},
275
- onInput$: async (e, el) => {
276
- await setColor(el.value);
277
- }
278
- })
279
- ]
280
- }),
281
- colors.map((color2, i) => {
282
- return /* @__PURE__ */ jsxRuntime.jsx("button", {
283
- type: "button",
284
- name: color2,
285
- class: {
286
- "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] p-0 lum-bg hover:brightness-150": true,
287
- "border-lum-accent": color2 === store.value
288
- },
289
- style: {
290
- "--bg-color": color2
291
- },
292
- onClick$: async () => {
293
- await setColor(color2);
294
- }
295
- }, i);
296
- }),
297
- /* @__PURE__ */ jsxRuntime.jsx("button", {
298
- type: "button",
299
- class: "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] p-0.5",
300
- name: "Randomize",
301
- onClick$: async () => {
302
- const color2 = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
303
- await setColor(color2);
304
- },
305
- children: /* @__PURE__ */ jsxRuntime.jsx(Shuffle.Shuffle, {
306
- class: "p-0.5 pl-0.5 text-lum-text"
307
- })
308
- })
309
- ]
310
- })
311
- ]
312
- });
313
- });
238
+ backgroundSize: "8px 8px",
239
+ backgroundPosition: "0 0, 4px 0, 4px -4px, 0 4px"
240
+ } }, { class: "absolute -bottom-1.25 -left-1.25 h-4 w-4 rounded-md" }, null, 3, null)], 1, "Xr_0"),
241
+ /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", null, { class: "flex w-37.5 flex-wrap justify-between gap-1" }, [
242
+ showInput && /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", { class: {
243
+ "mb-2 flex w-37.5 border-b border-b-gray-700 pb-3": true,
244
+ "flex-row gap-1": preview == "left",
245
+ "flex-row-reverse gap-1": preview == "right",
246
+ "flex-col": preview == "top",
247
+ "flex-col-reverse": preview == "bottom"
248
+ } }, null, [preview != "full" && /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("div", { class: {
249
+ "border border-gray-700 rounded-sm": true,
250
+ "aspect-square h-full": preview == "left" || preview == "right",
251
+ "h-3 w-full": preview == "top" || preview == "bottom",
252
+ "rounded-b-none": preview == "top",
253
+ "rounded-t-none": preview == "bottom"
254
+ } }, { style: (0, _qwik_dev_core._fnSignal)(_hf4, [store]) }, null, 3, "Xr_1"), /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("input", {
255
+ class: {
256
+ "lum-input w-full p-1 text-xs rounded-sm": true,
257
+ "rounded-t-none border-t-0": preview == "top",
258
+ "rounded-b-none border-b-0": preview == "bottom"
259
+ },
260
+ "q-e:input": /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (e, el, setColor) => {
261
+ await setColor(el.value);
262
+ }, "ColorPicker_component_div_div_div_input_q_e_input_ExKkgH2ke0g"),
263
+ "q:p": setColor,
264
+ style: preview == "full" ? {
265
+ backgroundColor: `${store.value}`,
266
+ color: require_color.getBrightness(require_color.hexToRgba(store.value)) > .5 ? "black" : "white"
267
+ } : {}
268
+ }, { value: (0, _qwik_dev_core._wrapProp)(store) }, null, 6, null)], 1, "Xr_2"),
269
+ colors.map((color, i) => {
270
+ const qrl_4294901768 = /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (_, _1, color) => {
271
+ const setColor = _qwik_dev_core._captures[0];
272
+ await setColor(color);
273
+ }, "ColorPicker_component_div_div_button_q_e_click_iKRo0q0pNkI", [setColor]);
274
+ return /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("button", {
275
+ class: (0, _qwik_dev_core._fnSignal)(_hf5, [color, store]),
276
+ name: color,
277
+ "q-e:click": qrl_4294901768,
278
+ "q:p": color,
279
+ style: { "--bg-color": color }
280
+ }, { type: "button" }, null, 6, i);
281
+ }),
282
+ /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)("button", {
283
+ "q-e:click": /* @__PURE__ */ (0, _qwik_dev_core.inlinedQrl)(async (_, _1, setColor) => {
284
+ await setColor(`#${Math.floor(Math.random() * 16777215).toString(16)}`);
285
+ }, "ColorPicker_component_div_div_button_q_e_click_1_50T6z49ncA8"),
286
+ "q:p": setColor
287
+ }, {
288
+ type: "button",
289
+ class: "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] p-0.5",
290
+ name: "Randomize"
291
+ }, /* @__PURE__ */ (0, _qwik_dev_core._jsxSorted)(require_Shuffle.Shuffle, null, { class: "p-0.5 pl-0.5 text-lum-text" }, null, 3, "Xr_3"), 4, null)
292
+ ], 1, null)
293
+ ], 4, "Xr_4");
294
+ }, "ColorPicker_component_8ldznufwKro"));
295
+ //#endregion
314
296
  exports.ColorPicker = ColorPicker;