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