@rovula/ui 0.0.71 → 0.0.72

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.
@@ -1,5 +1,13 @@
1
1
  import * as React from "react";
2
2
  import * as SliderPrimitive from "@radix-ui/react-slider";
3
- declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
3
+ export interface CustomSliderProps extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {
4
+ trackClassName?: string;
5
+ rangeClassName?: string;
6
+ thumbClassName?: string;
7
+ trackStyle?: React.CSSProperties;
8
+ thumbStyle?: React.CSSProperties;
9
+ rangeStyle?: React.CSSProperties;
10
+ }
11
+ declare const Slider: React.ForwardRefExoticComponent<CustomSliderProps & React.RefAttributes<HTMLSpanElement>>;
4
12
  export type SliderProps = React.ComponentProps<typeof Slider>;
5
13
  export { Slider };
@@ -1,12 +1,19 @@
1
1
  import React from "react";
2
+ import type { StoryObj } from "@storybook/react";
2
3
  declare const meta: {
3
4
  title: string;
4
- component: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slider").SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
5
+ component: React.ForwardRefExoticComponent<import("./Slider").CustomSliderProps & React.RefAttributes<HTMLSpanElement>>;
5
6
  tags: string[];
6
7
  parameters: {
7
8
  layout: string;
8
9
  };
9
10
  decorators: ((Story: import("@storybook/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
11
+ trackClassName?: string | undefined;
12
+ rangeClassName?: string | undefined;
13
+ thumbClassName?: string | undefined;
14
+ trackStyle?: React.CSSProperties | undefined;
15
+ thumbStyle?: React.CSSProperties | undefined;
16
+ rangeStyle?: React.CSSProperties | undefined;
10
17
  suppressHydrationWarning?: boolean | undefined | undefined;
11
18
  className?: string | undefined | undefined;
12
19
  color?: string | undefined | undefined;
@@ -303,3 +310,4 @@ export declare const Default: {
303
310
  };
304
311
  render: (args: {}) => import("react/jsx-runtime").JSX.Element;
305
312
  };
313
+ export declare const GradientColor: StoryObj;
@@ -15,8 +15,8 @@ import * as React from "react";
15
15
  import * as SliderPrimitive from "@radix-ui/react-slider";
16
16
  import { cn } from "@/utils/cn";
17
17
  const Slider = React.forwardRef((_a, ref) => {
18
- var { className } = _a, props = __rest(_a, ["className"]);
19
- return (_jsxs(SliderPrimitive.Root, Object.assign({ ref: ref, className: cn("relative flex w-full touch-none select-none items-center", className) }, props, { children: [_jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-grey-50", children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }), _jsx(SliderPrimitive.Thumb, { className: "block cursor-pointer h-5 w-5 rounded-full border-[3px] border-primary bg-background ring-0 outline-none disabled:pointer-events-none disabled:opacity-50" })] })));
18
+ var { className, trackClassName, rangeClassName, thumbClassName, thumbStyle, trackStyle, rangeStyle } = _a, props = __rest(_a, ["className", "trackClassName", "rangeClassName", "thumbClassName", "thumbStyle", "trackStyle", "rangeStyle"]);
19
+ return (_jsxs(SliderPrimitive.Root, Object.assign({ ref: ref, className: cn("relative flex w-full touch-none select-none items-center", className) }, props, { children: [_jsx(SliderPrimitive.Track, { className: cn("relative h-2 w-full grow overflow-hidden rounded-full bg-grey-50", trackClassName), style: trackStyle, children: _jsx(SliderPrimitive.Range, { className: cn("absolute h-full bg-primary", rangeClassName), style: rangeStyle }) }), _jsx(SliderPrimitive.Thumb, { className: cn("block h-5 w-5 cursor-pointer rounded-full border-[3px] border-primary bg-background outline-none ring-0 transition-colors disabled:pointer-events-none disabled:opacity-50", thumbClassName), style: thumbStyle })] })));
20
20
  });
21
21
  Slider.displayName = SliderPrimitive.Root.displayName;
22
22
  export { Slider };
@@ -1,4 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { Slider } from "./Slider";
3
4
  // More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
4
5
  const meta = {
@@ -10,7 +11,7 @@ const meta = {
10
11
  layout: "fullscreen",
11
12
  },
12
13
  decorators: [
13
- (Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
14
+ (Story) => (_jsx("div", { className: "p-5 flex w-full bg-background", children: _jsx(Story, {}) })),
14
15
  ],
15
16
  };
16
17
  export default meta;
@@ -31,3 +32,22 @@ export const Default = {
31
32
  return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Slider, Object.assign({ defaultValue: [50], max: 100, step: 1 }, props)) }));
32
33
  },
33
34
  };
35
+ export const GradientColor = {
36
+ render: () => {
37
+ const [exposure, setExposure] = useState([50]);
38
+ const [empty, setEmpty] = useState([50]);
39
+ const [rainbow, setRainbow] = useState([50]);
40
+ const [darkRed, setDarkRed] = useState([50]);
41
+ return (_jsxs("div", { className: "w-[400px] p-6 space-y-8 rounded-md shadow-lg bg-surface", children: [_jsx(Slider, { value: exposure, onValueChange: setExposure, className: "bg-grey-transparent-24", trackClassName: "h-1 rounded-full bg-grey-transparent-24 bg-gradient-to-r from-black to-white", rangeClassName: "bg-unset", thumbClassName: "bg-white border border-white shadow", thumbStyle: {
42
+ filter: "drop-shadow(0px 6px 12px rgba(0, 0, 0, 0.12))",
43
+ }, min: 0, max: 100, step: 1 }), _jsx(Slider, { value: empty, onValueChange: setEmpty, className: "bg-grey-transparent-24", trackClassName: "h-1 rounded-full bg-grey-transparent-24", rangeClassName: "bg-unset", thumbClassName: "bg-white border border-white shadow", thumbStyle: {
44
+ filter: "drop-shadow(0px 6px 12px rgba(0, 0, 0, 0.12))",
45
+ }, min: 0, max: 100, step: 1 }), _jsx(Slider, { value: rainbow, onValueChange: setRainbow, className: "bg-grey-transparent-24", trackClassName: "h-1 rounded-full bg-grey-transparent-24", trackStyle: {
46
+ backgroundImage: "linear-gradient(90deg, #F00 0%, #FF8502 11.54%, #F2FF05 23.08%, #06F90F 35.58%, #00E6FF 48.56%, #0404FF 61.54%, #AB02FF 74.52%, #FF069E 87.5%, #FF0408 100%)",
47
+ }, rangeClassName: "bg-unset", thumbClassName: "bg-white border border-white shadow", thumbStyle: {
48
+ filter: "drop-shadow(0px 6px 12px rgba(0, 0, 0, 0.12))",
49
+ }, min: 0, max: 100, step: 1 }), _jsx(Slider, { value: darkRed, onValueChange: setDarkRed, className: "bg-grey-transparent-24", trackClassName: "h-1 rounded-full bg-grey-transparent-24 bg-gradient-to-r from-[#848484] to-[#A00202]", rangeClassName: "bg-unset", thumbClassName: "bg-white border border-white shadow", thumbStyle: {
50
+ filter: "drop-shadow(0px 6px 12px rgba(0, 0, 0, 0.12))",
51
+ }, min: 0, max: 100, step: 1 })] }));
52
+ },
53
+ };
@@ -828,6 +828,9 @@ input[type=number] {
828
828
  width: 100%;
829
829
  height: 100%;
830
830
  }
831
+ .h-1{
832
+ height: 0.25rem;
833
+ }
831
834
  .h-1\/2{
832
835
  height: 50%;
833
836
  }
@@ -1166,6 +1169,11 @@ input[type=number] {
1166
1169
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
1167
1170
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
1168
1171
  }
1172
+ .space-y-8 > :not([hidden]) ~ :not([hidden]){
1173
+ --tw-space-y-reverse: 0;
1174
+ margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));
1175
+ margin-bottom: calc(2rem * var(--tw-space-y-reverse));
1176
+ }
1169
1177
  .self-center{
1170
1178
  align-self: center;
1171
1179
  }
@@ -1472,6 +1480,10 @@ input[type=number] {
1472
1480
  --tw-border-opacity: 1;
1473
1481
  border-color: color-mix(in srgb, var(--state-color-warning-stroke) calc(100% * var(--tw-border-opacity, 1)), transparent);
1474
1482
  }
1483
+ .border-white{
1484
+ --tw-border-opacity: 1;
1485
+ border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));
1486
+ }
1475
1487
  .border-b-\[rgb\(var\(--navbar-border-color\)\)\]{
1476
1488
  border-bottom-color: rgb(var(--navbar-border-color));
1477
1489
  }
@@ -2713,6 +2725,25 @@ input[type=number] {
2713
2725
  --tw-bg-opacity: 1;
2714
2726
  background-color: color-mix(in srgb, var(--other-transparency-white-8) calc(100% * var(--tw-bg-opacity, 1)), transparent);
2715
2727
  }
2728
+ .bg-gradient-to-r{
2729
+ background-image: linear-gradient(to right, var(--tw-gradient-stops));
2730
+ }
2731
+ .from-\[\#848484\]{
2732
+ --tw-gradient-from: #848484 var(--tw-gradient-from-position);
2733
+ --tw-gradient-to: rgb(132 132 132 / 0) var(--tw-gradient-to-position);
2734
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
2735
+ }
2736
+ .from-black{
2737
+ --tw-gradient-from: #000 var(--tw-gradient-from-position);
2738
+ --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);
2739
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
2740
+ }
2741
+ .to-\[\#A00202\]{
2742
+ --tw-gradient-to: #A00202 var(--tw-gradient-to-position);
2743
+ }
2744
+ .to-white{
2745
+ --tw-gradient-to: #fff var(--tw-gradient-to-position);
2746
+ }
2716
2747
  .fill-action-button-icon-active{
2717
2748
  fill: color-mix(in srgb, var(--action-button-icon-active-text) calc(100% * 1), transparent);
2718
2749
  }
@@ -3563,10 +3594,6 @@ input[type=number] {
3563
3594
  --tw-ring-opacity: 1;
3564
3595
  --tw-ring-color: color-mix(in srgb, var(--input-color-error) calc(100% * var(--tw-ring-opacity, 1)), transparent);
3565
3596
  }
3566
- .ring-primary{
3567
- --tw-ring-opacity: 1;
3568
- --tw-ring-color: color-mix(in srgb, var(--state-color-primary-default) calc(100% * var(--tw-ring-opacity, 1)), transparent);
3569
- }
3570
3597
  .ring-offset-background{
3571
3598
  --tw-ring-offset-color: color-mix(in srgb, var(--background) calc(100% * 1), transparent);
3572
3599
  }
@@ -3574,6 +3601,10 @@ input[type=number] {
3574
3601
  --tw-blur: blur(8px);
3575
3602
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
3576
3603
  }
3604
+ .drop-shadow{
3605
+ --tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));
3606
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
3607
+ }
3577
3608
  .filter{
3578
3609
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
3579
3610
  }