@luminescent/ui-qwik 6.4.26 → 6.6.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.
@@ -895,6 +895,77 @@ const NumberInputRaw = qwik.component$(({ input, onDecrement$, onIncrement$, val
895
895
  ]
896
896
  });
897
897
  });
898
+ const RangeInput = qwik.component$((props) => {
899
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", {
900
+ class: "flex flex-col",
901
+ children: [
902
+ /* @__PURE__ */ jsxRuntime.jsx("label", {
903
+ for: props.id,
904
+ class: "pb-1 text-lum-text select-none",
905
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
906
+ }),
907
+ /* @__PURE__ */ jsxRuntime.jsx(RangeInputRaw, {
908
+ ...props,
909
+ children: void 0
910
+ })
911
+ ]
912
+ });
913
+ });
914
+ const RangeInputRaw = qwik.component$(({ value, min = 5, max = 100, onInput$, ...props }) => {
915
+ const valueSignal = qwik.useSignal(value ?? min);
916
+ const filledPercentage = qwik.useComputed$(() => (valueSignal.value - min) / (max - min) * 100);
917
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", {
918
+ class: {
919
+ "group relative flex touch-manipulation gap-1 text-lum-text lum-input p-0": true
920
+ },
921
+ children: [
922
+ /* @__PURE__ */ jsxRuntime.jsx("div", {
923
+ class: "absolute w-full flex justify-evenly",
924
+ children: [
925
+ ...Array(max - min + 1)
926
+ ].map((_, i) => {
927
+ if (i === 0 || i === max - min) return null;
928
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
929
+ class: "border-l border-l-lum-border/20 h-1 my-0.5"
930
+ }, i);
931
+ })
932
+ }),
933
+ /* @__PURE__ */ jsxRuntime.jsx("div", {
934
+ class: "h-2 lum-bg-lum-accent group-hover:lum-bg-lum-accent rounded-lum",
935
+ style: {
936
+ width: `${filledPercentage.value}%`
937
+ }
938
+ }),
939
+ /* @__PURE__ */ jsxRuntime.jsxs("div", {
940
+ class: "absolute -top-1 flex flex-col gap-4 items-center",
941
+ style: {
942
+ left: `calc(${filledPercentage.value}% - 0.5rem)`
943
+ },
944
+ children: [
945
+ /* @__PURE__ */ jsxRuntime.jsx("div", {
946
+ class: "w-4 h-4 lum-bg-lum-accent group-hover:lum-bg-lum-accent rounded-full"
947
+ }),
948
+ /* @__PURE__ */ jsxRuntime.jsx("div", {
949
+ class: "absolute top-6 lum-bg-lum-card-bg lum-btn-p-2 text-center rounded-lum opacity-0 group-hover:opacity-100 transition-all z-50",
950
+ children: valueSignal.value
951
+ })
952
+ ]
953
+ }),
954
+ /* @__PURE__ */ jsxRuntime.jsx("input", {
955
+ ...props,
956
+ min,
957
+ max,
958
+ type: "range",
959
+ value: valueSignal.value,
960
+ class: "absolute top-0 h-2 w-full opacity-0 cursor-pointer",
961
+ onInput$: async (event, element) => {
962
+ valueSignal.value = parseInt(element.value);
963
+ if (onInput$) await onInput$(event, element);
964
+ }
965
+ })
966
+ ]
967
+ });
968
+ });
898
969
  const SelectMenu = qwik.component$((props) => {
899
970
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
900
971
  class: "flex flex-col",
@@ -1567,6 +1638,8 @@ exports.LogoWaterfall = LogoWaterfall;
1567
1638
  exports.Nav = Nav;
1568
1639
  exports.NumberInput = NumberInput;
1569
1640
  exports.NumberInputRaw = NumberInputRaw;
1641
+ exports.RangeInput = RangeInput;
1642
+ exports.RangeInputRaw = RangeInputRaw;
1570
1643
  exports.SelectMenu = SelectMenu;
1571
1644
  exports.SelectMenuRaw = SelectMenuRaw;
1572
1645
  exports.Sidebar = Sidebar;
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, Slot, useStore, $, useSignal, useTask$, useStyles$ } from "@builder.io/qwik";
2
+ import { component$, Slot, useStore, $, useSignal, useTask$, useStyles$, useComputed$ } from "@builder.io/qwik";
3
3
  const Link = component$(({ size, ...props }) => {
4
4
  return /* @__PURE__ */ jsxs("svg", {
5
5
  xmlns: "http://www.w3.org/2000/svg",
@@ -893,6 +893,77 @@ const NumberInputRaw = component$(({ input, onDecrement$, onIncrement$, value =
893
893
  ]
894
894
  });
895
895
  });
896
+ const RangeInput = component$((props) => {
897
+ return /* @__PURE__ */ jsxs("div", {
898
+ class: "flex flex-col",
899
+ children: [
900
+ /* @__PURE__ */ jsx("label", {
901
+ for: props.id,
902
+ class: "pb-1 text-lum-text select-none",
903
+ children: /* @__PURE__ */ jsx(Slot, {})
904
+ }),
905
+ /* @__PURE__ */ jsx(RangeInputRaw, {
906
+ ...props,
907
+ children: void 0
908
+ })
909
+ ]
910
+ });
911
+ });
912
+ const RangeInputRaw = component$(({ value, min = 5, max = 100, onInput$, ...props }) => {
913
+ const valueSignal = useSignal(value ?? min);
914
+ const filledPercentage = useComputed$(() => (valueSignal.value - min) / (max - min) * 100);
915
+ return /* @__PURE__ */ jsxs("div", {
916
+ class: {
917
+ "group relative flex touch-manipulation gap-1 text-lum-text lum-input p-0": true
918
+ },
919
+ children: [
920
+ /* @__PURE__ */ jsx("div", {
921
+ class: "absolute w-full flex justify-evenly",
922
+ children: [
923
+ ...Array(max - min + 1)
924
+ ].map((_, i) => {
925
+ if (i === 0 || i === max - min) return null;
926
+ return /* @__PURE__ */ jsx("div", {
927
+ class: "border-l border-l-lum-border/20 h-1 my-0.5"
928
+ }, i);
929
+ })
930
+ }),
931
+ /* @__PURE__ */ jsx("div", {
932
+ class: "h-2 lum-bg-lum-accent group-hover:lum-bg-lum-accent rounded-lum",
933
+ style: {
934
+ width: `${filledPercentage.value}%`
935
+ }
936
+ }),
937
+ /* @__PURE__ */ jsxs("div", {
938
+ class: "absolute -top-1 flex flex-col gap-4 items-center",
939
+ style: {
940
+ left: `calc(${filledPercentage.value}% - 0.5rem)`
941
+ },
942
+ children: [
943
+ /* @__PURE__ */ jsx("div", {
944
+ class: "w-4 h-4 lum-bg-lum-accent group-hover:lum-bg-lum-accent rounded-full"
945
+ }),
946
+ /* @__PURE__ */ jsx("div", {
947
+ class: "absolute top-6 lum-bg-lum-card-bg lum-btn-p-2 text-center rounded-lum opacity-0 group-hover:opacity-100 transition-all z-50",
948
+ children: valueSignal.value
949
+ })
950
+ ]
951
+ }),
952
+ /* @__PURE__ */ jsx("input", {
953
+ ...props,
954
+ min,
955
+ max,
956
+ type: "range",
957
+ value: valueSignal.value,
958
+ class: "absolute top-0 h-2 w-full opacity-0 cursor-pointer",
959
+ onInput$: async (event, element) => {
960
+ valueSignal.value = parseInt(element.value);
961
+ if (onInput$) await onInput$(event, element);
962
+ }
963
+ })
964
+ ]
965
+ });
966
+ });
896
967
  const SelectMenu = component$((props) => {
897
968
  return /* @__PURE__ */ jsxs("div", {
898
969
  class: "flex flex-col",
@@ -1566,6 +1637,8 @@ export {
1566
1637
  Nav,
1567
1638
  NumberInput,
1568
1639
  NumberInputRaw,
1640
+ RangeInput,
1641
+ RangeInputRaw,
1569
1642
  SelectMenu,
1570
1643
  SelectMenuRaw,
1571
1644
  Sidebar,
@@ -0,0 +1,4 @@
1
+ declare const _default: import("@builder.io/qwik").Component<{
2
+ id: string;
3
+ }>;
4
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import type { PropsOf, QRL } from '@builder.io/qwik';
2
+ interface RangeInputRawProps extends Omit<PropsOf<'input'> & {
3
+ type: 'number';
4
+ }, 'class' | 'type'> {
5
+ onInput$?: QRL<(event: InputEvent, element: HTMLInputElement) => void>;
6
+ class?: {
7
+ [key: string]: boolean;
8
+ };
9
+ value?: number;
10
+ min?: number;
11
+ max?: number;
12
+ }
13
+ interface RangeInputProps extends Omit<RangeInputRawProps, 'children'> {
14
+ id: string;
15
+ }
16
+ export declare const RangeInput: import("@builder.io/qwik").Component<RangeInputProps>;
17
+ export declare const RangeInputRaw: import("@builder.io/qwik").Component<RangeInputRawProps>;
18
+ export {};
@@ -4,6 +4,7 @@ export * from './elements/ColorPicker';
4
4
  export * from './elements/Dropdown';
5
5
  export * from './elements/Nav';
6
6
  export * from './elements/NumberInput';
7
+ export * from './elements/RangeInput';
7
8
  export * from './elements/SelectMenu';
8
9
  export * from './elements/Sidebar';
9
10
  export * from './elements/Toggle';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminescent/ui-qwik",
3
- "version": "6.4.26",
3
+ "version": "6.6.0-0",
4
4
  "description": "Luminescent UI library - Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",
@@ -50,7 +50,7 @@
50
50
  "vite-tsconfig-paths": "^6.0.3"
51
51
  },
52
52
  "peerDependencies": {
53
- "@luminescent/ui": "6.4.26"
53
+ "@luminescent/ui": "6.6.0-0"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "qwik build",