@luminescent/ui 0.18.1 → 0.19.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.
package/lib/index.qwik.cjs
CHANGED
|
@@ -291,9 +291,15 @@ const buttonColorClasses = {
|
|
|
291
291
|
bg: "bg-rose-700/90 border-rose-600"
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
const
|
|
294
|
+
const mobileSizeClasses = {
|
|
295
|
+
xs: {
|
|
296
|
+
base: "text-sm gap-1",
|
|
297
|
+
round: "rounded-md",
|
|
298
|
+
pad: "px-2 py-1",
|
|
299
|
+
equal: "p-1"
|
|
300
|
+
},
|
|
295
301
|
sm: {
|
|
296
|
-
base: "text-
|
|
302
|
+
base: "text-sm gap-2",
|
|
297
303
|
round: "rounded-md",
|
|
298
304
|
pad: "px-2.5 py-1.5",
|
|
299
305
|
equal: "p-1.5"
|
|
@@ -317,12 +323,45 @@ const sizeClasses = {
|
|
|
317
323
|
equal: "p-4"
|
|
318
324
|
}
|
|
319
325
|
};
|
|
326
|
+
const sizeClasses = {
|
|
327
|
+
xs: {
|
|
328
|
+
base: "sm:text-sm sm:gap-1",
|
|
329
|
+
round: "sm:rounded-md",
|
|
330
|
+
pad: "sm:px-2 sm:py-1",
|
|
331
|
+
equal: "sm:p-1"
|
|
332
|
+
},
|
|
333
|
+
sm: {
|
|
334
|
+
base: "sm:text-base sm:gap-2",
|
|
335
|
+
round: "sm:rounded-md",
|
|
336
|
+
pad: "sm:px-2.5 sm:py-1.5",
|
|
337
|
+
equal: "sm:p-1.5"
|
|
338
|
+
},
|
|
339
|
+
md: {
|
|
340
|
+
base: "sm:text-base sm:gap-3",
|
|
341
|
+
round: "sm:rounded-md",
|
|
342
|
+
pad: "sm:px-4 sm:py-2",
|
|
343
|
+
equal: "sm:p-2"
|
|
344
|
+
},
|
|
345
|
+
lg: {
|
|
346
|
+
base: "sm:text-lg sm:gap-3",
|
|
347
|
+
round: "sm:rounded-lg",
|
|
348
|
+
pad: "sm:px-6 sm:py-3",
|
|
349
|
+
equal: "sm:p-3"
|
|
350
|
+
},
|
|
351
|
+
xl: {
|
|
352
|
+
base: "sm:text-lg sm:gap-4",
|
|
353
|
+
round: "sm:rounded-xl",
|
|
354
|
+
pad: "sm:px-8 sm:py-4",
|
|
355
|
+
equal: "sm:p-4"
|
|
356
|
+
}
|
|
357
|
+
};
|
|
320
358
|
const buttonClass = "relative flex items-center gap-3 motion-safe:transition ease-in-out border text-gray-50 fill-gray-50 disabled:opacity-50 hover:shadow-lg motion-safe:active:scale-95 whitespace-nowrap touch-manipulation select-none text-center";
|
|
321
359
|
const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
322
360
|
const props1 = qwik._restProps(props, [
|
|
323
361
|
"color",
|
|
324
362
|
"transparent",
|
|
325
363
|
"size",
|
|
364
|
+
"mobilesize",
|
|
326
365
|
"round",
|
|
327
366
|
"square"
|
|
328
367
|
]);
|
|
@@ -331,10 +370,14 @@ const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
|
|
|
331
370
|
[buttonColorClasses[props.color ?? "darkgray"].bg]: !props.transparent,
|
|
332
371
|
"border-transparent": props.transparent,
|
|
333
372
|
[buttonColorClasses[props.color ?? "darkgray"].hover]: true,
|
|
373
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].base]: true,
|
|
334
374
|
[sizeClasses[props.size ?? "md"].base]: true,
|
|
375
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].round]: !props.round,
|
|
335
376
|
[sizeClasses[props.size ?? "md"].round]: !props.round,
|
|
336
377
|
"rounded-full": props.round,
|
|
378
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].pad]: !props.square,
|
|
337
379
|
[sizeClasses[props.size ?? "md"].pad]: !props.square,
|
|
380
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].equal]: props.square,
|
|
338
381
|
[sizeClasses[props.size ?? "md"].equal]: props.square,
|
|
339
382
|
...props1.class
|
|
340
383
|
};
|
|
@@ -797,8 +840,9 @@ const ColorPicker = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
797
840
|
});
|
|
798
841
|
const setColor = /* @__PURE__ */ qwik.inlinedQrl((color) => {
|
|
799
842
|
const [maxHue2, props2, store2, width2] = qwik.useLexicalScope();
|
|
800
|
-
|
|
801
|
-
|
|
843
|
+
if (!color.match(/^#[0-9A-F]{6}$/i)) return;
|
|
844
|
+
const number = hexStringToNumber(color);
|
|
845
|
+
const hsv = rgbToHsv(hexNumberToRgb(number));
|
|
802
846
|
store2.hue.position = hsv.h * maxHue2;
|
|
803
847
|
store2.hue.color = rgbToHex(hsvToRgb({
|
|
804
848
|
h: hsv.h,
|
|
@@ -807,6 +851,7 @@ const ColorPicker = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
807
851
|
}));
|
|
808
852
|
store2.sPosition = hsv.s * width2;
|
|
809
853
|
store2.bPosition = (1 - hsv.v) * maxHue2;
|
|
854
|
+
store2.value = color;
|
|
810
855
|
props2.onInput$?.(store2.value);
|
|
811
856
|
}, "ColorPicker_component_setColor_QqVIlZ9HOqM", [
|
|
812
857
|
maxHue,
|
|
@@ -888,35 +933,30 @@ const ColorPicker = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
888
933
|
}, "ColorPicker_component_sbMouseDown_lP7vsjR4o9U", [
|
|
889
934
|
sbChange
|
|
890
935
|
]);
|
|
891
|
-
qwik.useOn("change", /* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
892
|
-
const [props2, setColor2] = qwik.useLexicalScope();
|
|
893
|
-
if (!props2.id)
|
|
894
|
-
return;
|
|
895
|
-
const inputElement = document.getElementById(props2.id);
|
|
896
|
-
if (!inputElement)
|
|
897
|
-
return;
|
|
898
|
-
setColor2(inputElement.value);
|
|
899
|
-
}, "ColorPicker_component_useOn_U80lAP6qXKg", [
|
|
900
|
-
props,
|
|
901
|
-
setColor
|
|
902
|
-
]));
|
|
903
936
|
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
904
937
|
class: {
|
|
905
|
-
"motion-safe:transition-all p-4 bg-gray-800/50 backdrop-blur-xl flex gap-
|
|
938
|
+
"motion-safe:transition-all p-4 bg-gray-800/50 backdrop-blur-xl flex gap-4 rounded-lg border border-gray-700 touch-none": true,
|
|
906
939
|
"flex": true,
|
|
907
940
|
"flex-col": !props.horizontal,
|
|
908
941
|
...props1.class
|
|
909
942
|
}
|
|
910
943
|
}, {
|
|
911
|
-
id: qwik._fnSignal((p0) => p0.id
|
|
944
|
+
id: qwik._fnSignal((p0) => p0.id, [
|
|
912
945
|
props
|
|
913
|
-
], "p0.id
|
|
946
|
+
], "p0.id"),
|
|
947
|
+
onInput$: /* @__PURE__ */ qwik.inlinedQrl((e, el) => {
|
|
948
|
+
const [setColor2] = qwik.useLexicalScope();
|
|
949
|
+
if (!el.dataset.value) return;
|
|
950
|
+
setColor2(el.dataset.value);
|
|
951
|
+
}, "ColorPicker_component_div_onInput_61AfRqNB51A", [
|
|
952
|
+
setColor
|
|
953
|
+
])
|
|
914
954
|
}, [
|
|
915
955
|
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
916
956
|
class: "flex gap-4"
|
|
917
957
|
}, [
|
|
918
958
|
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
919
|
-
class: "w-[125px] h-[150px]
|
|
959
|
+
class: "w-[125px] h-[150px] rounded-md relative",
|
|
920
960
|
style: qwik._fnSignal((p0) => ({
|
|
921
961
|
background: `linear-gradient(to right, #FFFFFF, ${p0.hue.color})`
|
|
922
962
|
}), [
|
|
@@ -928,7 +968,7 @@ const ColorPicker = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
928
968
|
onTouchStart$: sbMouseDown
|
|
929
969
|
}, [
|
|
930
970
|
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
931
|
-
class: "w-[
|
|
971
|
+
class: "w-[125px] h-[150px] rounded-[0.3rem] bg-gradient-to-b from-transparent to-black border border-gray-700"
|
|
932
972
|
}, null, 3, null),
|
|
933
973
|
/* @__PURE__ */ qwik._jsxQ("div", {
|
|
934
974
|
class: {
|
|
@@ -967,45 +1007,72 @@ const ColorPicker = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
967
1007
|
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
968
1008
|
class: "w-[150px] flex flex-wrap gap-1 justify-between"
|
|
969
1009
|
}, [
|
|
970
|
-
(props.showInput ?? true) && /* @__PURE__ */ qwik.
|
|
1010
|
+
(props.showInput ?? true) && /* @__PURE__ */ qwik._jsxQ("div", {
|
|
971
1011
|
class: {
|
|
972
|
-
"w-[150px] mb-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
style: (props.preview ?? "left") == "full" ? {
|
|
978
|
-
backgroundColor: `${store.value}`,
|
|
979
|
-
color: getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5 ? "black" : "white"
|
|
980
|
-
} : (props.preview ?? "left") == "left" ? {
|
|
981
|
-
borderLeft: `35px solid ${store.value}`
|
|
982
|
-
} : (props.preview ?? "left") == "right" ? {
|
|
983
|
-
borderRight: `35px solid ${store.value}`
|
|
984
|
-
} : (props.preview ?? "left") == "top" ? {
|
|
985
|
-
borderTop: `10px solid ${store.value}`
|
|
986
|
-
} : (props.preview ?? "left") == "bottom" ? {
|
|
987
|
-
borderBottom: `10px solid ${store.value}`
|
|
988
|
-
} : {},
|
|
989
|
-
get color() {
|
|
990
|
-
return props.color ?? "gray";
|
|
991
|
-
},
|
|
992
|
-
onInput$: /* @__PURE__ */ qwik.inlinedQrl((e, el) => {
|
|
993
|
-
const [setColor2] = qwik.useLexicalScope();
|
|
994
|
-
setColor2(el.value);
|
|
995
|
-
}, "ColorPicker_component_div_div_TextInputRaw_onInput_nhKRhFMCxTk", [
|
|
996
|
-
setColor
|
|
997
|
-
]),
|
|
998
|
-
[qwik._IMMUTABLE]: {
|
|
999
|
-
class: qwik._IMMUTABLE,
|
|
1000
|
-
value: qwik._fnSignal((p0) => p0.value, [
|
|
1001
|
-
store
|
|
1002
|
-
], "p0.value"),
|
|
1003
|
-
color: qwik._fnSignal((p0) => p0.color ?? "gray", [
|
|
1004
|
-
props
|
|
1005
|
-
], 'p0.color??"gray"'),
|
|
1006
|
-
onInput$: qwik._IMMUTABLE
|
|
1012
|
+
"flex w-[150px] pb-3 mb-2 border-b border-b-gray-700": true,
|
|
1013
|
+
"flex-row gap-1": (props.preview ?? "left") == "left",
|
|
1014
|
+
"flex-row-reverse gap-1": (props.preview ?? "left") == "right",
|
|
1015
|
+
"flex-col": (props.preview ?? "left") == "top",
|
|
1016
|
+
"flex-col-reverse": (props.preview ?? "left") == "bottom"
|
|
1007
1017
|
}
|
|
1008
|
-
},
|
|
1018
|
+
}, null, [
|
|
1019
|
+
(props.preview ?? "left") != "full" && /* @__PURE__ */ qwik._jsxQ("div", {
|
|
1020
|
+
class: {
|
|
1021
|
+
"border border-gray-700": true,
|
|
1022
|
+
"h-full aspect-square rounded-md": (props.preview ?? "left") == "left" || (props.preview ?? "left") == "right",
|
|
1023
|
+
"w-full h-3": (props.preview ?? "left") == "top" || (props.preview ?? "left") == "bottom",
|
|
1024
|
+
"rounded-t-md": (props.preview ?? "left") == "top",
|
|
1025
|
+
"rounded-b-md": (props.preview ?? "left") == "bottom"
|
|
1026
|
+
}
|
|
1027
|
+
}, {
|
|
1028
|
+
style: qwik._fnSignal((p0) => ({
|
|
1029
|
+
backgroundColor: `${p0.value}`
|
|
1030
|
+
}), [
|
|
1031
|
+
store
|
|
1032
|
+
], "{backgroundColor:`${p0.value}`}")
|
|
1033
|
+
}, null, 3, "sj_0"),
|
|
1034
|
+
/* @__PURE__ */ qwik._jsxC(TextInputRaw, {
|
|
1035
|
+
get class() {
|
|
1036
|
+
return {
|
|
1037
|
+
"w-full": true,
|
|
1038
|
+
"border-t-0 rounded-t-none": (props.preview ?? "left") == "top",
|
|
1039
|
+
"border-b-0 rounded-b-none": (props.preview ?? "left") == "bottom"
|
|
1040
|
+
};
|
|
1041
|
+
},
|
|
1042
|
+
get value() {
|
|
1043
|
+
return store.value;
|
|
1044
|
+
},
|
|
1045
|
+
style: (props.preview ?? "left") == "full" ? {
|
|
1046
|
+
backgroundColor: `${store.value}`,
|
|
1047
|
+
color: getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5 ? "black" : "white"
|
|
1048
|
+
} : {},
|
|
1049
|
+
get color() {
|
|
1050
|
+
return props.color ?? "gray";
|
|
1051
|
+
},
|
|
1052
|
+
onInput$: /* @__PURE__ */ qwik.inlinedQrl((e, el) => {
|
|
1053
|
+
const [setColor2] = qwik.useLexicalScope();
|
|
1054
|
+
setColor2(el.value);
|
|
1055
|
+
}, "ColorPicker_component_div_div_div_TextInputRaw_onInput_tZr31WTZETw", [
|
|
1056
|
+
setColor
|
|
1057
|
+
]),
|
|
1058
|
+
[qwik._IMMUTABLE]: {
|
|
1059
|
+
class: qwik._fnSignal((p0) => ({
|
|
1060
|
+
"w-full": true,
|
|
1061
|
+
"border-t-0 rounded-t-none": (p0.preview ?? "left") == "top",
|
|
1062
|
+
"border-b-0 rounded-b-none": (p0.preview ?? "left") == "bottom"
|
|
1063
|
+
}), [
|
|
1064
|
+
props
|
|
1065
|
+
], '{"w-full":true,"border-t-0 rounded-t-none":(p0.preview??"left")=="top","border-b-0 rounded-b-none":(p0.preview??"left")=="bottom"}'),
|
|
1066
|
+
value: qwik._fnSignal((p0) => p0.value, [
|
|
1067
|
+
store
|
|
1068
|
+
], "p0.value"),
|
|
1069
|
+
color: qwik._fnSignal((p0) => p0.color ?? "gray", [
|
|
1070
|
+
props
|
|
1071
|
+
], 'p0.color??"gray"'),
|
|
1072
|
+
onInput$: qwik._IMMUTABLE
|
|
1073
|
+
}
|
|
1074
|
+
}, 3, "sj_1")
|
|
1075
|
+
], 1, "sj_2"),
|
|
1009
1076
|
(props.colors ?? [
|
|
1010
1077
|
"#FAEDCB",
|
|
1011
1078
|
"#C9E4DE",
|
|
@@ -1054,175 +1121,10 @@ const ColorPicker = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
1054
1121
|
[qwik._IMMUTABLE]: {
|
|
1055
1122
|
class: qwik._IMMUTABLE
|
|
1056
1123
|
}
|
|
1057
|
-
}, 3, "
|
|
1124
|
+
}, 3, "sj_3"), 1, null)
|
|
1058
1125
|
], 1, null)
|
|
1059
|
-
], 1, "
|
|
1126
|
+
], 1, "sj_4");
|
|
1060
1127
|
}, "ColorPicker_component_D1OSB6ycLrI"));
|
|
1061
|
-
const ColorInput = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1062
|
-
const props1 = qwik._restProps(props, [
|
|
1063
|
-
"onInput$",
|
|
1064
|
-
"value",
|
|
1065
|
-
"colors",
|
|
1066
|
-
"preview",
|
|
1067
|
-
"horizontal",
|
|
1068
|
-
"class",
|
|
1069
|
-
"showInput"
|
|
1070
|
-
]);
|
|
1071
|
-
const store = qwik.useStore({
|
|
1072
|
-
opened: false
|
|
1073
|
-
});
|
|
1074
|
-
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1075
|
-
class: "relative"
|
|
1076
|
-
}, [
|
|
1077
|
-
/* @__PURE__ */ qwik._jsxQ("label", {
|
|
1078
|
-
for: qwik._wrapSignal(props1, "id")
|
|
1079
|
-
}, {
|
|
1080
|
-
class: "text-gray-300 pb-1 flex select-none"
|
|
1081
|
-
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "0s_0"), 1, null),
|
|
1082
|
-
/* @__PURE__ */ qwik._jsxC(TextInputRaw, {
|
|
1083
|
-
get class() {
|
|
1084
|
-
return {
|
|
1085
|
-
"w-full": true,
|
|
1086
|
-
...props.class
|
|
1087
|
-
};
|
|
1088
|
-
},
|
|
1089
|
-
...props1,
|
|
1090
|
-
get value() {
|
|
1091
|
-
return props.value ?? "#000000";
|
|
1092
|
-
},
|
|
1093
|
-
onFocus$: /* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1094
|
-
const [props12, store2] = qwik.useLexicalScope();
|
|
1095
|
-
const abortController = new AbortController();
|
|
1096
|
-
document.addEventListener("click", (e) => {
|
|
1097
|
-
if (e.target instanceof HTMLElement && !e.target.closest(`#${props12.id}-picker`) && !e.target.closest(`#${props12.id}`)) {
|
|
1098
|
-
store2.opened = false;
|
|
1099
|
-
abortController.abort();
|
|
1100
|
-
}
|
|
1101
|
-
}, {
|
|
1102
|
-
signal: abortController.signal
|
|
1103
|
-
});
|
|
1104
|
-
store2.opened = true;
|
|
1105
|
-
}, "ColorInput_component_div_TextInputRaw_onFocus_9bHrhSeTgfI", [
|
|
1106
|
-
props1,
|
|
1107
|
-
store
|
|
1108
|
-
]),
|
|
1109
|
-
onInput$: /* @__PURE__ */ qwik.inlinedQrl((e, el) => {
|
|
1110
|
-
const [props12, props2] = qwik.useLexicalScope();
|
|
1111
|
-
const div = document.getElementById(`${props12.id}-picker`);
|
|
1112
|
-
const event = new Event("change");
|
|
1113
|
-
div.dispatchEvent(event);
|
|
1114
|
-
props2.onInput$?.(el.value);
|
|
1115
|
-
}, "ColorInput_component_div_TextInputRaw_onInput_nsV3cUv0Sxg", [
|
|
1116
|
-
props1,
|
|
1117
|
-
props
|
|
1118
|
-
]),
|
|
1119
|
-
style: (props.preview ?? "left") == "full" ? {
|
|
1120
|
-
backgroundColor: `${props.value ?? "#000000"}`,
|
|
1121
|
-
color: getBrightness(hexNumberToRgb(hexStringToNumber(props.value ?? "#000000"))) > 0.5 ? "black" : "white"
|
|
1122
|
-
} : (props.preview ?? "left") == "left" ? {
|
|
1123
|
-
borderLeft: `35px solid ${props.value ?? "#000000"}`
|
|
1124
|
-
} : (props.preview ?? "left") == "right" ? {
|
|
1125
|
-
borderRight: `35px solid ${props.value ?? "#000000"}`
|
|
1126
|
-
} : (props.preview ?? "left") == "top" ? {
|
|
1127
|
-
borderTop: `10px solid ${props.value ?? "#000000"}`
|
|
1128
|
-
} : (props.preview ?? "left") == "bottom" ? {
|
|
1129
|
-
borderBottom: `10px solid ${props.value ?? "#000000"}`
|
|
1130
|
-
} : {},
|
|
1131
|
-
[qwik._IMMUTABLE]: {
|
|
1132
|
-
class: qwik._fnSignal((p0) => ({
|
|
1133
|
-
"w-full": true,
|
|
1134
|
-
...p0.class
|
|
1135
|
-
}), [
|
|
1136
|
-
props
|
|
1137
|
-
], '{"w-full":true,...p0.class}'),
|
|
1138
|
-
value: qwik._fnSignal((p0) => p0.value ?? "#000000", [
|
|
1139
|
-
props
|
|
1140
|
-
], 'p0.value??"#000000"')
|
|
1141
|
-
}
|
|
1142
|
-
}, 0, "0s_1"),
|
|
1143
|
-
/* @__PURE__ */ qwik._jsxC(ColorPicker, {
|
|
1144
|
-
get id() {
|
|
1145
|
-
return props1.id;
|
|
1146
|
-
},
|
|
1147
|
-
get value() {
|
|
1148
|
-
return props.value ?? "#000000";
|
|
1149
|
-
},
|
|
1150
|
-
get color() {
|
|
1151
|
-
return props1.color;
|
|
1152
|
-
},
|
|
1153
|
-
get colors() {
|
|
1154
|
-
return props.colors;
|
|
1155
|
-
},
|
|
1156
|
-
get preview() {
|
|
1157
|
-
return props.preview ?? "left";
|
|
1158
|
-
},
|
|
1159
|
-
get horizontal() {
|
|
1160
|
-
return props.horizontal;
|
|
1161
|
-
},
|
|
1162
|
-
get showInput() {
|
|
1163
|
-
return props.showInput ?? false;
|
|
1164
|
-
},
|
|
1165
|
-
get class() {
|
|
1166
|
-
return {
|
|
1167
|
-
"motion-safe:transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]": true,
|
|
1168
|
-
"opacity-0 scale-95 pointer-events-none": !store.opened
|
|
1169
|
-
};
|
|
1170
|
-
},
|
|
1171
|
-
onInput$: /* @__PURE__ */ qwik.inlinedQrl((color) => {
|
|
1172
|
-
const [props12, props2] = qwik.useLexicalScope();
|
|
1173
|
-
const el = document.getElementById(props12.id);
|
|
1174
|
-
el.value = color;
|
|
1175
|
-
switch (props2.preview ?? "left") {
|
|
1176
|
-
case "full":
|
|
1177
|
-
el.style.backgroundColor = color;
|
|
1178
|
-
el.style.color = getBrightness(hexNumberToRgb(hexStringToNumber(color))) > 0.5 ? "black" : "white";
|
|
1179
|
-
break;
|
|
1180
|
-
case "left":
|
|
1181
|
-
el.style.borderLeft = `35px solid ${color}`;
|
|
1182
|
-
break;
|
|
1183
|
-
case "right":
|
|
1184
|
-
el.style.borderRight = `35px solid ${color}`;
|
|
1185
|
-
break;
|
|
1186
|
-
case "top":
|
|
1187
|
-
el.style.borderTop = `10px solid ${color}`;
|
|
1188
|
-
break;
|
|
1189
|
-
case "bottom":
|
|
1190
|
-
el.style.borderBottom = `10px solid ${color}`;
|
|
1191
|
-
break;
|
|
1192
|
-
}
|
|
1193
|
-
props2.onInput$?.(color);
|
|
1194
|
-
}, "ColorInput_component_div_ColorPicker_onInput_iZguRdHILBQ", [
|
|
1195
|
-
props1,
|
|
1196
|
-
props
|
|
1197
|
-
]),
|
|
1198
|
-
[qwik._IMMUTABLE]: {
|
|
1199
|
-
id: qwik._wrapProp(props1, "id"),
|
|
1200
|
-
value: qwik._fnSignal((p0) => p0.value ?? "#000000", [
|
|
1201
|
-
props
|
|
1202
|
-
], 'p0.value??"#000000"'),
|
|
1203
|
-
color: qwik._wrapProp(props1, "color"),
|
|
1204
|
-
colors: qwik._fnSignal((p0) => p0.colors, [
|
|
1205
|
-
props
|
|
1206
|
-
], "p0.colors"),
|
|
1207
|
-
preview: qwik._fnSignal((p0) => p0.preview ?? "left", [
|
|
1208
|
-
props
|
|
1209
|
-
], 'p0.preview??"left"'),
|
|
1210
|
-
horizontal: qwik._fnSignal((p0) => p0.horizontal, [
|
|
1211
|
-
props
|
|
1212
|
-
], "p0.horizontal"),
|
|
1213
|
-
showInput: qwik._fnSignal((p0) => p0.showInput ?? false, [
|
|
1214
|
-
props
|
|
1215
|
-
], "p0.showInput??false"),
|
|
1216
|
-
class: qwik._fnSignal((p0) => ({
|
|
1217
|
-
"motion-safe:transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]": true,
|
|
1218
|
-
"opacity-0 scale-95 pointer-events-none": !p0.opened
|
|
1219
|
-
}), [
|
|
1220
|
-
store
|
|
1221
|
-
], '{"motion-safe:transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]":true,"opacity-0 scale-95 pointer-events-none":!p0.opened}')
|
|
1222
|
-
}
|
|
1223
|
-
}, 3, "0s_2")
|
|
1224
|
-
], 1, "0s_3");
|
|
1225
|
-
}, "ColorInput_component_jilGo0Bn3Ps"));
|
|
1226
1128
|
const ChevronDown = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1227
1129
|
return /* @__PURE__ */ qwik._jsxS("svg", {
|
|
1228
1130
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1565,37 +1467,35 @@ const Header = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
|
|
|
1565
1467
|
}, 3, "dL_2"), 1, "dL_3")
|
|
1566
1468
|
], 1, null)
|
|
1567
1469
|
}, 1, "dL_4");
|
|
1568
|
-
if (props.subheader)
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1470
|
+
if (props.subheader) Component = /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1471
|
+
class: "flex flex-col gap-1"
|
|
1472
|
+
}, [
|
|
1473
|
+
Component,
|
|
1474
|
+
/* @__PURE__ */ qwik._jsxQ("h3", null, {
|
|
1475
|
+
class: "flex items-center text-gray-400 text-sm"
|
|
1476
|
+
}, qwik._fnSignal((p0) => p0.subheader, [
|
|
1477
|
+
props
|
|
1478
|
+
], "p0.subheader"), 3, null)
|
|
1479
|
+
], 1, "dL_5");
|
|
1480
|
+
if (props.loading !== void 0) Component = /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1481
|
+
class: "flex"
|
|
1482
|
+
}, [
|
|
1483
|
+
Component,
|
|
1484
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1485
|
+
class: qwik._fnSignal((p0) => ({
|
|
1486
|
+
"motion-safe:transition-all duration-200": true,
|
|
1487
|
+
"opacity-0": !p0.loading,
|
|
1488
|
+
"opacity-100": p0.loading
|
|
1489
|
+
}), [
|
|
1576
1490
|
props
|
|
1577
|
-
], "p0.
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
class: qwik._fnSignal((p0) => ({
|
|
1586
|
-
"motion-safe:transition-all duration-200": true,
|
|
1587
|
-
"opacity-0": !p0.loading,
|
|
1588
|
-
"opacity-100": p0.loading
|
|
1589
|
-
}), [
|
|
1590
|
-
props
|
|
1591
|
-
], '{"motion-safe:transition-all duration-200":true,"opacity-0":!p0.loading,"opacity-100":p0.loading}')
|
|
1592
|
-
}, /* @__PURE__ */ qwik._jsxC(LoadingIcon, {
|
|
1593
|
-
width: 24,
|
|
1594
|
-
[qwik._IMMUTABLE]: {
|
|
1595
|
-
width: qwik._IMMUTABLE
|
|
1596
|
-
}
|
|
1597
|
-
}, 3, "dL_6"), 1, null)
|
|
1598
|
-
], 1, "dL_7");
|
|
1491
|
+
], '{"motion-safe:transition-all duration-200":true,"opacity-0":!p0.loading,"opacity-100":p0.loading}')
|
|
1492
|
+
}, /* @__PURE__ */ qwik._jsxC(LoadingIcon, {
|
|
1493
|
+
width: 24,
|
|
1494
|
+
[qwik._IMMUTABLE]: {
|
|
1495
|
+
width: qwik._IMMUTABLE
|
|
1496
|
+
}
|
|
1497
|
+
}, 3, "dL_6"), 1, null)
|
|
1498
|
+
], 1, "dL_7");
|
|
1599
1499
|
return Component;
|
|
1600
1500
|
}, "Header_component_FfGOhhBNG5k"));
|
|
1601
1501
|
const navColorClasses = {
|
|
@@ -1643,9 +1543,9 @@ const Nav = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((p
|
|
|
1643
1543
|
children: [
|
|
1644
1544
|
/* @__PURE__ */ qwik._jsxQ("div", {
|
|
1645
1545
|
class: {
|
|
1646
|
-
"sm:hidden motion-safe:transition-all flex flex-col px-2 items-center absolute w-full": true,
|
|
1647
|
-
"
|
|
1648
|
-
"opacity-0
|
|
1546
|
+
"sm:hidden motion-safe:transition-all flex flex-col px-2 items-center absolute w-full top-full": true,
|
|
1547
|
+
"mt-2": menu.value,
|
|
1548
|
+
"opacity-0 pointer-events-none": !menu.value,
|
|
1649
1549
|
"before:backdrop-blur-lg": props.color !== "transparent",
|
|
1650
1550
|
'before:absolute before:content-[""] before:w-full before:h-full before:drop-shadow-xl before:-z-10 before:rounded-lg': true
|
|
1651
1551
|
}
|
|
@@ -2783,7 +2683,6 @@ exports.Blobs = Blobs;
|
|
|
2783
2683
|
exports.Button = Button;
|
|
2784
2684
|
exports.ButtonAnchor = ButtonAnchor;
|
|
2785
2685
|
exports.Card = Card;
|
|
2786
|
-
exports.ColorInput = ColorInput;
|
|
2787
2686
|
exports.ColorPicker = ColorPicker;
|
|
2788
2687
|
exports.Dropdown = Dropdown;
|
|
2789
2688
|
exports.DropdownRaw = DropdownRaw;
|
|
@@ -2815,6 +2714,7 @@ exports._auto_buttonClass = buttonClass;
|
|
|
2815
2714
|
exports.blobColorClasses = blobColorClasses;
|
|
2816
2715
|
exports.buttonColorClasses = buttonColorClasses;
|
|
2817
2716
|
exports.cardColorClasses = cardColorClasses;
|
|
2717
|
+
exports.mobileSizeClasses = mobileSizeClasses;
|
|
2818
2718
|
exports.navColorClasses = navColorClasses;
|
|
2819
2719
|
exports.sizeClasses = sizeClasses;
|
|
2820
2720
|
exports.toggleOffColorClasses = toggleOffColorClasses;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { componentQrl, inlinedQrl, _jsxQ, _fnSignal, _restProps, _jsxS, _jsxC, Slot, _jsxBranch, _IMMUTABLE, _wrapSignal, useStore,
|
|
1
|
+
import { componentQrl, inlinedQrl, _jsxQ, _fnSignal, _restProps, _jsxS, _jsxC, Slot, _jsxBranch, _IMMUTABLE, _wrapSignal, useStore, useLexicalScope, useStylesQrl, useSignal } from "@builder.io/qwik";
|
|
2
2
|
import { Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
3
3
|
const Anchor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => /* @__PURE__ */ _jsxQ("span", null, {
|
|
4
4
|
id: _fnSignal((p0) => p0.id, [
|
|
@@ -289,9 +289,15 @@ const buttonColorClasses = {
|
|
|
289
289
|
bg: "bg-rose-700/90 border-rose-600"
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
|
-
const
|
|
292
|
+
const mobileSizeClasses = {
|
|
293
|
+
xs: {
|
|
294
|
+
base: "text-sm gap-1",
|
|
295
|
+
round: "rounded-md",
|
|
296
|
+
pad: "px-2 py-1",
|
|
297
|
+
equal: "p-1"
|
|
298
|
+
},
|
|
293
299
|
sm: {
|
|
294
|
-
base: "text-
|
|
300
|
+
base: "text-sm gap-2",
|
|
295
301
|
round: "rounded-md",
|
|
296
302
|
pad: "px-2.5 py-1.5",
|
|
297
303
|
equal: "p-1.5"
|
|
@@ -315,12 +321,45 @@ const sizeClasses = {
|
|
|
315
321
|
equal: "p-4"
|
|
316
322
|
}
|
|
317
323
|
};
|
|
324
|
+
const sizeClasses = {
|
|
325
|
+
xs: {
|
|
326
|
+
base: "sm:text-sm sm:gap-1",
|
|
327
|
+
round: "sm:rounded-md",
|
|
328
|
+
pad: "sm:px-2 sm:py-1",
|
|
329
|
+
equal: "sm:p-1"
|
|
330
|
+
},
|
|
331
|
+
sm: {
|
|
332
|
+
base: "sm:text-base sm:gap-2",
|
|
333
|
+
round: "sm:rounded-md",
|
|
334
|
+
pad: "sm:px-2.5 sm:py-1.5",
|
|
335
|
+
equal: "sm:p-1.5"
|
|
336
|
+
},
|
|
337
|
+
md: {
|
|
338
|
+
base: "sm:text-base sm:gap-3",
|
|
339
|
+
round: "sm:rounded-md",
|
|
340
|
+
pad: "sm:px-4 sm:py-2",
|
|
341
|
+
equal: "sm:p-2"
|
|
342
|
+
},
|
|
343
|
+
lg: {
|
|
344
|
+
base: "sm:text-lg sm:gap-3",
|
|
345
|
+
round: "sm:rounded-lg",
|
|
346
|
+
pad: "sm:px-6 sm:py-3",
|
|
347
|
+
equal: "sm:p-3"
|
|
348
|
+
},
|
|
349
|
+
xl: {
|
|
350
|
+
base: "sm:text-lg sm:gap-4",
|
|
351
|
+
round: "sm:rounded-xl",
|
|
352
|
+
pad: "sm:px-8 sm:py-4",
|
|
353
|
+
equal: "sm:p-4"
|
|
354
|
+
}
|
|
355
|
+
};
|
|
318
356
|
const buttonClass = "relative flex items-center gap-3 motion-safe:transition ease-in-out border text-gray-50 fill-gray-50 disabled:opacity-50 hover:shadow-lg motion-safe:active:scale-95 whitespace-nowrap touch-manipulation select-none text-center";
|
|
319
357
|
const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
320
358
|
const props1 = _restProps(props, [
|
|
321
359
|
"color",
|
|
322
360
|
"transparent",
|
|
323
361
|
"size",
|
|
362
|
+
"mobilesize",
|
|
324
363
|
"round",
|
|
325
364
|
"square"
|
|
326
365
|
]);
|
|
@@ -329,10 +368,14 @@ const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =
|
|
|
329
368
|
[buttonColorClasses[props.color ?? "darkgray"].bg]: !props.transparent,
|
|
330
369
|
"border-transparent": props.transparent,
|
|
331
370
|
[buttonColorClasses[props.color ?? "darkgray"].hover]: true,
|
|
371
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].base]: true,
|
|
332
372
|
[sizeClasses[props.size ?? "md"].base]: true,
|
|
373
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].round]: !props.round,
|
|
333
374
|
[sizeClasses[props.size ?? "md"].round]: !props.round,
|
|
334
375
|
"rounded-full": props.round,
|
|
376
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].pad]: !props.square,
|
|
335
377
|
[sizeClasses[props.size ?? "md"].pad]: !props.square,
|
|
378
|
+
[mobileSizeClasses[props.mobilesize ? props.mobilesize : (props.size ?? "md") == "xs" ? "xs" : (props.size ?? "md") == "sm" ? "xs" : (props.size ?? "md") == "md" ? "sm" : (props.size ?? "md") == "lg" ? "md" : (props.size ?? "md") == "xl" ? "lg" : "md"].equal]: props.square,
|
|
336
379
|
[sizeClasses[props.size ?? "md"].equal]: props.square,
|
|
337
380
|
...props1.class
|
|
338
381
|
};
|
|
@@ -795,8 +838,9 @@ const ColorPicker = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
795
838
|
});
|
|
796
839
|
const setColor = /* @__PURE__ */ inlinedQrl((color) => {
|
|
797
840
|
const [maxHue2, props2, store2, width2] = useLexicalScope();
|
|
798
|
-
|
|
799
|
-
|
|
841
|
+
if (!color.match(/^#[0-9A-F]{6}$/i)) return;
|
|
842
|
+
const number = hexStringToNumber(color);
|
|
843
|
+
const hsv = rgbToHsv(hexNumberToRgb(number));
|
|
800
844
|
store2.hue.position = hsv.h * maxHue2;
|
|
801
845
|
store2.hue.color = rgbToHex(hsvToRgb({
|
|
802
846
|
h: hsv.h,
|
|
@@ -805,6 +849,7 @@ const ColorPicker = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
805
849
|
}));
|
|
806
850
|
store2.sPosition = hsv.s * width2;
|
|
807
851
|
store2.bPosition = (1 - hsv.v) * maxHue2;
|
|
852
|
+
store2.value = color;
|
|
808
853
|
props2.onInput$?.(store2.value);
|
|
809
854
|
}, "ColorPicker_component_setColor_QqVIlZ9HOqM", [
|
|
810
855
|
maxHue,
|
|
@@ -886,35 +931,30 @@ const ColorPicker = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
886
931
|
}, "ColorPicker_component_sbMouseDown_lP7vsjR4o9U", [
|
|
887
932
|
sbChange
|
|
888
933
|
]);
|
|
889
|
-
useOn("change", /* @__PURE__ */ inlinedQrl(() => {
|
|
890
|
-
const [props2, setColor2] = useLexicalScope();
|
|
891
|
-
if (!props2.id)
|
|
892
|
-
return;
|
|
893
|
-
const inputElement = document.getElementById(props2.id);
|
|
894
|
-
if (!inputElement)
|
|
895
|
-
return;
|
|
896
|
-
setColor2(inputElement.value);
|
|
897
|
-
}, "ColorPicker_component_useOn_U80lAP6qXKg", [
|
|
898
|
-
props,
|
|
899
|
-
setColor
|
|
900
|
-
]));
|
|
901
934
|
return /* @__PURE__ */ _jsxQ("div", {
|
|
902
935
|
class: {
|
|
903
|
-
"motion-safe:transition-all p-4 bg-gray-800/50 backdrop-blur-xl flex gap-
|
|
936
|
+
"motion-safe:transition-all p-4 bg-gray-800/50 backdrop-blur-xl flex gap-4 rounded-lg border border-gray-700 touch-none": true,
|
|
904
937
|
"flex": true,
|
|
905
938
|
"flex-col": !props.horizontal,
|
|
906
939
|
...props1.class
|
|
907
940
|
}
|
|
908
941
|
}, {
|
|
909
|
-
id: _fnSignal((p0) => p0.id
|
|
942
|
+
id: _fnSignal((p0) => p0.id, [
|
|
910
943
|
props
|
|
911
|
-
], "p0.id
|
|
944
|
+
], "p0.id"),
|
|
945
|
+
onInput$: /* @__PURE__ */ inlinedQrl((e, el) => {
|
|
946
|
+
const [setColor2] = useLexicalScope();
|
|
947
|
+
if (!el.dataset.value) return;
|
|
948
|
+
setColor2(el.dataset.value);
|
|
949
|
+
}, "ColorPicker_component_div_onInput_61AfRqNB51A", [
|
|
950
|
+
setColor
|
|
951
|
+
])
|
|
912
952
|
}, [
|
|
913
953
|
/* @__PURE__ */ _jsxQ("div", null, {
|
|
914
954
|
class: "flex gap-4"
|
|
915
955
|
}, [
|
|
916
956
|
/* @__PURE__ */ _jsxQ("div", null, {
|
|
917
|
-
class: "w-[125px] h-[150px]
|
|
957
|
+
class: "w-[125px] h-[150px] rounded-md relative",
|
|
918
958
|
style: _fnSignal((p0) => ({
|
|
919
959
|
background: `linear-gradient(to right, #FFFFFF, ${p0.hue.color})`
|
|
920
960
|
}), [
|
|
@@ -926,7 +966,7 @@ const ColorPicker = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
926
966
|
onTouchStart$: sbMouseDown
|
|
927
967
|
}, [
|
|
928
968
|
/* @__PURE__ */ _jsxQ("div", null, {
|
|
929
|
-
class: "w-[
|
|
969
|
+
class: "w-[125px] h-[150px] rounded-[0.3rem] bg-gradient-to-b from-transparent to-black border border-gray-700"
|
|
930
970
|
}, null, 3, null),
|
|
931
971
|
/* @__PURE__ */ _jsxQ("div", {
|
|
932
972
|
class: {
|
|
@@ -965,45 +1005,72 @@ const ColorPicker = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
965
1005
|
/* @__PURE__ */ _jsxQ("div", null, {
|
|
966
1006
|
class: "w-[150px] flex flex-wrap gap-1 justify-between"
|
|
967
1007
|
}, [
|
|
968
|
-
(props.showInput ?? true) && /* @__PURE__ */
|
|
1008
|
+
(props.showInput ?? true) && /* @__PURE__ */ _jsxQ("div", {
|
|
969
1009
|
class: {
|
|
970
|
-
"w-[150px] mb-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
style: (props.preview ?? "left") == "full" ? {
|
|
976
|
-
backgroundColor: `${store.value}`,
|
|
977
|
-
color: getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5 ? "black" : "white"
|
|
978
|
-
} : (props.preview ?? "left") == "left" ? {
|
|
979
|
-
borderLeft: `35px solid ${store.value}`
|
|
980
|
-
} : (props.preview ?? "left") == "right" ? {
|
|
981
|
-
borderRight: `35px solid ${store.value}`
|
|
982
|
-
} : (props.preview ?? "left") == "top" ? {
|
|
983
|
-
borderTop: `10px solid ${store.value}`
|
|
984
|
-
} : (props.preview ?? "left") == "bottom" ? {
|
|
985
|
-
borderBottom: `10px solid ${store.value}`
|
|
986
|
-
} : {},
|
|
987
|
-
get color() {
|
|
988
|
-
return props.color ?? "gray";
|
|
989
|
-
},
|
|
990
|
-
onInput$: /* @__PURE__ */ inlinedQrl((e, el) => {
|
|
991
|
-
const [setColor2] = useLexicalScope();
|
|
992
|
-
setColor2(el.value);
|
|
993
|
-
}, "ColorPicker_component_div_div_TextInputRaw_onInput_nhKRhFMCxTk", [
|
|
994
|
-
setColor
|
|
995
|
-
]),
|
|
996
|
-
[_IMMUTABLE]: {
|
|
997
|
-
class: _IMMUTABLE,
|
|
998
|
-
value: _fnSignal((p0) => p0.value, [
|
|
999
|
-
store
|
|
1000
|
-
], "p0.value"),
|
|
1001
|
-
color: _fnSignal((p0) => p0.color ?? "gray", [
|
|
1002
|
-
props
|
|
1003
|
-
], 'p0.color??"gray"'),
|
|
1004
|
-
onInput$: _IMMUTABLE
|
|
1010
|
+
"flex w-[150px] pb-3 mb-2 border-b border-b-gray-700": true,
|
|
1011
|
+
"flex-row gap-1": (props.preview ?? "left") == "left",
|
|
1012
|
+
"flex-row-reverse gap-1": (props.preview ?? "left") == "right",
|
|
1013
|
+
"flex-col": (props.preview ?? "left") == "top",
|
|
1014
|
+
"flex-col-reverse": (props.preview ?? "left") == "bottom"
|
|
1005
1015
|
}
|
|
1006
|
-
},
|
|
1016
|
+
}, null, [
|
|
1017
|
+
(props.preview ?? "left") != "full" && /* @__PURE__ */ _jsxQ("div", {
|
|
1018
|
+
class: {
|
|
1019
|
+
"border border-gray-700": true,
|
|
1020
|
+
"h-full aspect-square rounded-md": (props.preview ?? "left") == "left" || (props.preview ?? "left") == "right",
|
|
1021
|
+
"w-full h-3": (props.preview ?? "left") == "top" || (props.preview ?? "left") == "bottom",
|
|
1022
|
+
"rounded-t-md": (props.preview ?? "left") == "top",
|
|
1023
|
+
"rounded-b-md": (props.preview ?? "left") == "bottom"
|
|
1024
|
+
}
|
|
1025
|
+
}, {
|
|
1026
|
+
style: _fnSignal((p0) => ({
|
|
1027
|
+
backgroundColor: `${p0.value}`
|
|
1028
|
+
}), [
|
|
1029
|
+
store
|
|
1030
|
+
], "{backgroundColor:`${p0.value}`}")
|
|
1031
|
+
}, null, 3, "sj_0"),
|
|
1032
|
+
/* @__PURE__ */ _jsxC(TextInputRaw, {
|
|
1033
|
+
get class() {
|
|
1034
|
+
return {
|
|
1035
|
+
"w-full": true,
|
|
1036
|
+
"border-t-0 rounded-t-none": (props.preview ?? "left") == "top",
|
|
1037
|
+
"border-b-0 rounded-b-none": (props.preview ?? "left") == "bottom"
|
|
1038
|
+
};
|
|
1039
|
+
},
|
|
1040
|
+
get value() {
|
|
1041
|
+
return store.value;
|
|
1042
|
+
},
|
|
1043
|
+
style: (props.preview ?? "left") == "full" ? {
|
|
1044
|
+
backgroundColor: `${store.value}`,
|
|
1045
|
+
color: getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5 ? "black" : "white"
|
|
1046
|
+
} : {},
|
|
1047
|
+
get color() {
|
|
1048
|
+
return props.color ?? "gray";
|
|
1049
|
+
},
|
|
1050
|
+
onInput$: /* @__PURE__ */ inlinedQrl((e, el) => {
|
|
1051
|
+
const [setColor2] = useLexicalScope();
|
|
1052
|
+
setColor2(el.value);
|
|
1053
|
+
}, "ColorPicker_component_div_div_div_TextInputRaw_onInput_tZr31WTZETw", [
|
|
1054
|
+
setColor
|
|
1055
|
+
]),
|
|
1056
|
+
[_IMMUTABLE]: {
|
|
1057
|
+
class: _fnSignal((p0) => ({
|
|
1058
|
+
"w-full": true,
|
|
1059
|
+
"border-t-0 rounded-t-none": (p0.preview ?? "left") == "top",
|
|
1060
|
+
"border-b-0 rounded-b-none": (p0.preview ?? "left") == "bottom"
|
|
1061
|
+
}), [
|
|
1062
|
+
props
|
|
1063
|
+
], '{"w-full":true,"border-t-0 rounded-t-none":(p0.preview??"left")=="top","border-b-0 rounded-b-none":(p0.preview??"left")=="bottom"}'),
|
|
1064
|
+
value: _fnSignal((p0) => p0.value, [
|
|
1065
|
+
store
|
|
1066
|
+
], "p0.value"),
|
|
1067
|
+
color: _fnSignal((p0) => p0.color ?? "gray", [
|
|
1068
|
+
props
|
|
1069
|
+
], 'p0.color??"gray"'),
|
|
1070
|
+
onInput$: _IMMUTABLE
|
|
1071
|
+
}
|
|
1072
|
+
}, 3, "sj_1")
|
|
1073
|
+
], 1, "sj_2"),
|
|
1007
1074
|
(props.colors ?? [
|
|
1008
1075
|
"#FAEDCB",
|
|
1009
1076
|
"#C9E4DE",
|
|
@@ -1052,175 +1119,10 @@ const ColorPicker = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
1052
1119
|
[_IMMUTABLE]: {
|
|
1053
1120
|
class: _IMMUTABLE
|
|
1054
1121
|
}
|
|
1055
|
-
}, 3, "
|
|
1122
|
+
}, 3, "sj_3"), 1, null)
|
|
1056
1123
|
], 1, null)
|
|
1057
|
-
], 1, "
|
|
1124
|
+
], 1, "sj_4");
|
|
1058
1125
|
}, "ColorPicker_component_D1OSB6ycLrI"));
|
|
1059
|
-
const ColorInput = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
1060
|
-
const props1 = _restProps(props, [
|
|
1061
|
-
"onInput$",
|
|
1062
|
-
"value",
|
|
1063
|
-
"colors",
|
|
1064
|
-
"preview",
|
|
1065
|
-
"horizontal",
|
|
1066
|
-
"class",
|
|
1067
|
-
"showInput"
|
|
1068
|
-
]);
|
|
1069
|
-
const store = useStore({
|
|
1070
|
-
opened: false
|
|
1071
|
-
});
|
|
1072
|
-
return /* @__PURE__ */ _jsxQ("div", null, {
|
|
1073
|
-
class: "relative"
|
|
1074
|
-
}, [
|
|
1075
|
-
/* @__PURE__ */ _jsxQ("label", {
|
|
1076
|
-
for: _wrapSignal(props1, "id")
|
|
1077
|
-
}, {
|
|
1078
|
-
class: "text-gray-300 pb-1 flex select-none"
|
|
1079
|
-
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "0s_0"), 1, null),
|
|
1080
|
-
/* @__PURE__ */ _jsxC(TextInputRaw, {
|
|
1081
|
-
get class() {
|
|
1082
|
-
return {
|
|
1083
|
-
"w-full": true,
|
|
1084
|
-
...props.class
|
|
1085
|
-
};
|
|
1086
|
-
},
|
|
1087
|
-
...props1,
|
|
1088
|
-
get value() {
|
|
1089
|
-
return props.value ?? "#000000";
|
|
1090
|
-
},
|
|
1091
|
-
onFocus$: /* @__PURE__ */ inlinedQrl(() => {
|
|
1092
|
-
const [props12, store2] = useLexicalScope();
|
|
1093
|
-
const abortController = new AbortController();
|
|
1094
|
-
document.addEventListener("click", (e) => {
|
|
1095
|
-
if (e.target instanceof HTMLElement && !e.target.closest(`#${props12.id}-picker`) && !e.target.closest(`#${props12.id}`)) {
|
|
1096
|
-
store2.opened = false;
|
|
1097
|
-
abortController.abort();
|
|
1098
|
-
}
|
|
1099
|
-
}, {
|
|
1100
|
-
signal: abortController.signal
|
|
1101
|
-
});
|
|
1102
|
-
store2.opened = true;
|
|
1103
|
-
}, "ColorInput_component_div_TextInputRaw_onFocus_9bHrhSeTgfI", [
|
|
1104
|
-
props1,
|
|
1105
|
-
store
|
|
1106
|
-
]),
|
|
1107
|
-
onInput$: /* @__PURE__ */ inlinedQrl((e, el) => {
|
|
1108
|
-
const [props12, props2] = useLexicalScope();
|
|
1109
|
-
const div = document.getElementById(`${props12.id}-picker`);
|
|
1110
|
-
const event = new Event("change");
|
|
1111
|
-
div.dispatchEvent(event);
|
|
1112
|
-
props2.onInput$?.(el.value);
|
|
1113
|
-
}, "ColorInput_component_div_TextInputRaw_onInput_nsV3cUv0Sxg", [
|
|
1114
|
-
props1,
|
|
1115
|
-
props
|
|
1116
|
-
]),
|
|
1117
|
-
style: (props.preview ?? "left") == "full" ? {
|
|
1118
|
-
backgroundColor: `${props.value ?? "#000000"}`,
|
|
1119
|
-
color: getBrightness(hexNumberToRgb(hexStringToNumber(props.value ?? "#000000"))) > 0.5 ? "black" : "white"
|
|
1120
|
-
} : (props.preview ?? "left") == "left" ? {
|
|
1121
|
-
borderLeft: `35px solid ${props.value ?? "#000000"}`
|
|
1122
|
-
} : (props.preview ?? "left") == "right" ? {
|
|
1123
|
-
borderRight: `35px solid ${props.value ?? "#000000"}`
|
|
1124
|
-
} : (props.preview ?? "left") == "top" ? {
|
|
1125
|
-
borderTop: `10px solid ${props.value ?? "#000000"}`
|
|
1126
|
-
} : (props.preview ?? "left") == "bottom" ? {
|
|
1127
|
-
borderBottom: `10px solid ${props.value ?? "#000000"}`
|
|
1128
|
-
} : {},
|
|
1129
|
-
[_IMMUTABLE]: {
|
|
1130
|
-
class: _fnSignal((p0) => ({
|
|
1131
|
-
"w-full": true,
|
|
1132
|
-
...p0.class
|
|
1133
|
-
}), [
|
|
1134
|
-
props
|
|
1135
|
-
], '{"w-full":true,...p0.class}'),
|
|
1136
|
-
value: _fnSignal((p0) => p0.value ?? "#000000", [
|
|
1137
|
-
props
|
|
1138
|
-
], 'p0.value??"#000000"')
|
|
1139
|
-
}
|
|
1140
|
-
}, 0, "0s_1"),
|
|
1141
|
-
/* @__PURE__ */ _jsxC(ColorPicker, {
|
|
1142
|
-
get id() {
|
|
1143
|
-
return props1.id;
|
|
1144
|
-
},
|
|
1145
|
-
get value() {
|
|
1146
|
-
return props.value ?? "#000000";
|
|
1147
|
-
},
|
|
1148
|
-
get color() {
|
|
1149
|
-
return props1.color;
|
|
1150
|
-
},
|
|
1151
|
-
get colors() {
|
|
1152
|
-
return props.colors;
|
|
1153
|
-
},
|
|
1154
|
-
get preview() {
|
|
1155
|
-
return props.preview ?? "left";
|
|
1156
|
-
},
|
|
1157
|
-
get horizontal() {
|
|
1158
|
-
return props.horizontal;
|
|
1159
|
-
},
|
|
1160
|
-
get showInput() {
|
|
1161
|
-
return props.showInput ?? false;
|
|
1162
|
-
},
|
|
1163
|
-
get class() {
|
|
1164
|
-
return {
|
|
1165
|
-
"motion-safe:transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]": true,
|
|
1166
|
-
"opacity-0 scale-95 pointer-events-none": !store.opened
|
|
1167
|
-
};
|
|
1168
|
-
},
|
|
1169
|
-
onInput$: /* @__PURE__ */ inlinedQrl((color) => {
|
|
1170
|
-
const [props12, props2] = useLexicalScope();
|
|
1171
|
-
const el = document.getElementById(props12.id);
|
|
1172
|
-
el.value = color;
|
|
1173
|
-
switch (props2.preview ?? "left") {
|
|
1174
|
-
case "full":
|
|
1175
|
-
el.style.backgroundColor = color;
|
|
1176
|
-
el.style.color = getBrightness(hexNumberToRgb(hexStringToNumber(color))) > 0.5 ? "black" : "white";
|
|
1177
|
-
break;
|
|
1178
|
-
case "left":
|
|
1179
|
-
el.style.borderLeft = `35px solid ${color}`;
|
|
1180
|
-
break;
|
|
1181
|
-
case "right":
|
|
1182
|
-
el.style.borderRight = `35px solid ${color}`;
|
|
1183
|
-
break;
|
|
1184
|
-
case "top":
|
|
1185
|
-
el.style.borderTop = `10px solid ${color}`;
|
|
1186
|
-
break;
|
|
1187
|
-
case "bottom":
|
|
1188
|
-
el.style.borderBottom = `10px solid ${color}`;
|
|
1189
|
-
break;
|
|
1190
|
-
}
|
|
1191
|
-
props2.onInput$?.(color);
|
|
1192
|
-
}, "ColorInput_component_div_ColorPicker_onInput_iZguRdHILBQ", [
|
|
1193
|
-
props1,
|
|
1194
|
-
props
|
|
1195
|
-
]),
|
|
1196
|
-
[_IMMUTABLE]: {
|
|
1197
|
-
id: _wrapProp(props1, "id"),
|
|
1198
|
-
value: _fnSignal((p0) => p0.value ?? "#000000", [
|
|
1199
|
-
props
|
|
1200
|
-
], 'p0.value??"#000000"'),
|
|
1201
|
-
color: _wrapProp(props1, "color"),
|
|
1202
|
-
colors: _fnSignal((p0) => p0.colors, [
|
|
1203
|
-
props
|
|
1204
|
-
], "p0.colors"),
|
|
1205
|
-
preview: _fnSignal((p0) => p0.preview ?? "left", [
|
|
1206
|
-
props
|
|
1207
|
-
], 'p0.preview??"left"'),
|
|
1208
|
-
horizontal: _fnSignal((p0) => p0.horizontal, [
|
|
1209
|
-
props
|
|
1210
|
-
], "p0.horizontal"),
|
|
1211
|
-
showInput: _fnSignal((p0) => p0.showInput ?? false, [
|
|
1212
|
-
props
|
|
1213
|
-
], "p0.showInput??false"),
|
|
1214
|
-
class: _fnSignal((p0) => ({
|
|
1215
|
-
"motion-safe:transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]": true,
|
|
1216
|
-
"opacity-0 scale-95 pointer-events-none": !p0.opened
|
|
1217
|
-
}), [
|
|
1218
|
-
store
|
|
1219
|
-
], '{"motion-safe:transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]":true,"opacity-0 scale-95 pointer-events-none":!p0.opened}')
|
|
1220
|
-
}
|
|
1221
|
-
}, 3, "0s_2")
|
|
1222
|
-
], 1, "0s_3");
|
|
1223
|
-
}, "ColorInput_component_jilGo0Bn3Ps"));
|
|
1224
1126
|
const ChevronDown = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
1225
1127
|
return /* @__PURE__ */ _jsxS("svg", {
|
|
1226
1128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1563,37 +1465,35 @@ const Header = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =
|
|
|
1563
1465
|
}, 3, "dL_2"), 1, "dL_3")
|
|
1564
1466
|
], 1, null)
|
|
1565
1467
|
}, 1, "dL_4");
|
|
1566
|
-
if (props.subheader)
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1468
|
+
if (props.subheader) Component = /* @__PURE__ */ _jsxQ("div", null, {
|
|
1469
|
+
class: "flex flex-col gap-1"
|
|
1470
|
+
}, [
|
|
1471
|
+
Component,
|
|
1472
|
+
/* @__PURE__ */ _jsxQ("h3", null, {
|
|
1473
|
+
class: "flex items-center text-gray-400 text-sm"
|
|
1474
|
+
}, _fnSignal((p0) => p0.subheader, [
|
|
1475
|
+
props
|
|
1476
|
+
], "p0.subheader"), 3, null)
|
|
1477
|
+
], 1, "dL_5");
|
|
1478
|
+
if (props.loading !== void 0) Component = /* @__PURE__ */ _jsxQ("div", null, {
|
|
1479
|
+
class: "flex"
|
|
1480
|
+
}, [
|
|
1481
|
+
Component,
|
|
1482
|
+
/* @__PURE__ */ _jsxQ("div", null, {
|
|
1483
|
+
class: _fnSignal((p0) => ({
|
|
1484
|
+
"motion-safe:transition-all duration-200": true,
|
|
1485
|
+
"opacity-0": !p0.loading,
|
|
1486
|
+
"opacity-100": p0.loading
|
|
1487
|
+
}), [
|
|
1574
1488
|
props
|
|
1575
|
-
], "p0.
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
class: _fnSignal((p0) => ({
|
|
1584
|
-
"motion-safe:transition-all duration-200": true,
|
|
1585
|
-
"opacity-0": !p0.loading,
|
|
1586
|
-
"opacity-100": p0.loading
|
|
1587
|
-
}), [
|
|
1588
|
-
props
|
|
1589
|
-
], '{"motion-safe:transition-all duration-200":true,"opacity-0":!p0.loading,"opacity-100":p0.loading}')
|
|
1590
|
-
}, /* @__PURE__ */ _jsxC(LoadingIcon, {
|
|
1591
|
-
width: 24,
|
|
1592
|
-
[_IMMUTABLE]: {
|
|
1593
|
-
width: _IMMUTABLE
|
|
1594
|
-
}
|
|
1595
|
-
}, 3, "dL_6"), 1, null)
|
|
1596
|
-
], 1, "dL_7");
|
|
1489
|
+
], '{"motion-safe:transition-all duration-200":true,"opacity-0":!p0.loading,"opacity-100":p0.loading}')
|
|
1490
|
+
}, /* @__PURE__ */ _jsxC(LoadingIcon, {
|
|
1491
|
+
width: 24,
|
|
1492
|
+
[_IMMUTABLE]: {
|
|
1493
|
+
width: _IMMUTABLE
|
|
1494
|
+
}
|
|
1495
|
+
}, 3, "dL_6"), 1, null)
|
|
1496
|
+
], 1, "dL_7");
|
|
1597
1497
|
return Component;
|
|
1598
1498
|
}, "Header_component_FfGOhhBNG5k"));
|
|
1599
1499
|
const navColorClasses = {
|
|
@@ -1641,9 +1541,9 @@ const Nav = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
|
1641
1541
|
children: [
|
|
1642
1542
|
/* @__PURE__ */ _jsxQ("div", {
|
|
1643
1543
|
class: {
|
|
1644
|
-
"sm:hidden motion-safe:transition-all flex flex-col px-2 items-center absolute w-full": true,
|
|
1645
|
-
"
|
|
1646
|
-
"opacity-0
|
|
1544
|
+
"sm:hidden motion-safe:transition-all flex flex-col px-2 items-center absolute w-full top-full": true,
|
|
1545
|
+
"mt-2": menu.value,
|
|
1546
|
+
"opacity-0 pointer-events-none": !menu.value,
|
|
1647
1547
|
"before:backdrop-blur-lg": props.color !== "transparent",
|
|
1648
1548
|
'before:absolute before:content-[""] before:w-full before:h-full before:drop-shadow-xl before:-z-10 before:rounded-lg': true
|
|
1649
1549
|
}
|
|
@@ -2782,7 +2682,6 @@ export {
|
|
|
2782
2682
|
Button,
|
|
2783
2683
|
ButtonAnchor,
|
|
2784
2684
|
Card,
|
|
2785
|
-
ColorInput,
|
|
2786
2685
|
ColorPicker,
|
|
2787
2686
|
Dropdown,
|
|
2788
2687
|
DropdownRaw,
|
|
@@ -2814,6 +2713,7 @@ export {
|
|
|
2814
2713
|
blobColorClasses,
|
|
2815
2714
|
buttonColorClasses,
|
|
2816
2715
|
cardColorClasses,
|
|
2716
|
+
mobileSizeClasses,
|
|
2817
2717
|
navColorClasses,
|
|
2818
2718
|
sizeClasses,
|
|
2819
2719
|
toggleOffColorClasses,
|
|
@@ -97,7 +97,45 @@ export declare const buttonColorClasses: {
|
|
|
97
97
|
bg: string;
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
+
export declare const mobileSizeClasses: {
|
|
101
|
+
xs: {
|
|
102
|
+
base: string;
|
|
103
|
+
round: string;
|
|
104
|
+
pad: string;
|
|
105
|
+
equal: string;
|
|
106
|
+
};
|
|
107
|
+
sm: {
|
|
108
|
+
base: string;
|
|
109
|
+
round: string;
|
|
110
|
+
pad: string;
|
|
111
|
+
equal: string;
|
|
112
|
+
};
|
|
113
|
+
md: {
|
|
114
|
+
base: string;
|
|
115
|
+
round: string;
|
|
116
|
+
pad: string;
|
|
117
|
+
equal: string;
|
|
118
|
+
};
|
|
119
|
+
lg: {
|
|
120
|
+
base: string;
|
|
121
|
+
round: string;
|
|
122
|
+
pad: string;
|
|
123
|
+
equal: string;
|
|
124
|
+
};
|
|
125
|
+
xl: {
|
|
126
|
+
base: string;
|
|
127
|
+
round: string;
|
|
128
|
+
pad: string;
|
|
129
|
+
equal: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
100
132
|
export declare const sizeClasses: {
|
|
133
|
+
xs: {
|
|
134
|
+
base: string;
|
|
135
|
+
round: string;
|
|
136
|
+
pad: string;
|
|
137
|
+
equal: string;
|
|
138
|
+
};
|
|
101
139
|
sm: {
|
|
102
140
|
base: string;
|
|
103
141
|
round: string;
|
|
@@ -127,6 +165,7 @@ interface GenericButtonProps {
|
|
|
127
165
|
color?: keyof typeof buttonColorClasses;
|
|
128
166
|
transparent?: boolean;
|
|
129
167
|
size?: keyof typeof sizeClasses;
|
|
168
|
+
mobilesize?: keyof typeof mobileSizeClasses;
|
|
130
169
|
round?: boolean;
|
|
131
170
|
square?: boolean;
|
|
132
171
|
class?: {
|
|
@@ -2,7 +2,6 @@ export * from './elements/Anchor';
|
|
|
2
2
|
export * from './elements/Blobs';
|
|
3
3
|
export * from './elements/Button';
|
|
4
4
|
export * from './elements/Card';
|
|
5
|
-
export * from './elements/ColorInput';
|
|
6
5
|
export * from './elements/ColorPicker';
|
|
7
6
|
export * from './elements/Dropdown';
|
|
8
7
|
export * from './elements/Header';
|