@datalayer/primer-addons 1.0.5 → 1.0.6
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/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
import { SliderProps } from '../../../index';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: ({ name, id, min, max, value, label, step, markers, displayValue, disabled, orientation, width, onChange, }: SliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
tags: string[];
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const SliderDay: Story;
|
|
14
|
-
export declare const SliderNight: Story;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { ThemeProvider, BaseStyles, Box, CounterLabel } from "@primer/react";
|
|
4
|
-
import { Slider } from '../../../index';
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/Slider',
|
|
7
|
-
component: Slider,
|
|
8
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
parameters: {
|
|
11
|
-
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
|
|
12
|
-
layout: 'fullscreen',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
const ThemedSlider = (props) => {
|
|
17
|
-
const [value, setValue] = useState(50);
|
|
18
|
-
return (_jsx(ThemeProvider, { colorMode: props.colorMode, children: _jsx(BaseStyles, { children: _jsxs(Box, { p: 3, bg: "canvas.default", children: [_jsx(Box, { children: _jsx(Slider, { ...props, value: value, onChange: setValue }) }), _jsx(Box, { children: _jsx(CounterLabel, { sx: { ml: 2 }, children: value }) })] }) }) }));
|
|
19
|
-
};
|
|
20
|
-
export const SliderDay = {
|
|
21
|
-
args: {
|
|
22
|
-
name: "slider-day",
|
|
23
|
-
id: "slider-day",
|
|
24
|
-
min: 0,
|
|
25
|
-
max: 100,
|
|
26
|
-
step: 10,
|
|
27
|
-
value: 50,
|
|
28
|
-
onChange: (value) => {
|
|
29
|
-
console.log('Slider value changed:', value);
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
render: (args) => _jsx(ThemedSlider, { ...args, colorMode: "day" })
|
|
33
|
-
};
|
|
34
|
-
export const SliderNight = {
|
|
35
|
-
args: {
|
|
36
|
-
name: "slider-night",
|
|
37
|
-
id: "slider-night",
|
|
38
|
-
min: 0,
|
|
39
|
-
max: 100,
|
|
40
|
-
step: 10,
|
|
41
|
-
value: 50,
|
|
42
|
-
onChange: (value) => {
|
|
43
|
-
console.log('Slider value changed:', value);
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
render: (args) => _jsx(ThemedSlider, { ...args, colorMode: "night" })
|
|
47
|
-
};
|