@qoretechnologies/reqore 0.41.1 → 0.43.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/dist/components/ControlGroup/index.d.ts +1 -0
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +18 -4
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/index.d.ts +6 -0
- package/dist/components/Label/index.d.ts.map +1 -0
- package/dist/components/Label/index.js +24 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/Slider/index.d.ts +40 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Slider/index.js +148 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/Tag/index.d.ts +4 -2
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ControlGroup/index.tsx +19 -3
- package/src/components/Input/index.tsx +1 -0
- package/src/components/Label/index.tsx +10 -0
- package/src/components/Slider/index.tsx +358 -0
- package/src/components/Tag/index.tsx +19 -18
- package/src/index.tsx +2 -0
- package/src/stories/Label/Label.stories.tsx +33 -0
- package/src/stories/Slider/Slider.stories.tsx +173 -0
- package/tests.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import ReqoreControlGroup from '../../components/ControlGroup';
|
|
4
|
+
import ReqoreSlider from '../../components/Slider';
|
|
5
|
+
import { StoryMeta } from '../utils';
|
|
6
|
+
import { DisabledArg, IconArg, MinimalArg, SizeArg } from '../utils/args';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Form/Slider/Stories',
|
|
10
|
+
component: ReqoreSlider,
|
|
11
|
+
argTypes: {
|
|
12
|
+
...MinimalArg,
|
|
13
|
+
...SizeArg,
|
|
14
|
+
...DisabledArg,
|
|
15
|
+
...IconArg('icon', 'Icon'),
|
|
16
|
+
...IconArg('rightIcon', 'Right Icon'),
|
|
17
|
+
fluid: {
|
|
18
|
+
control: 'boolean',
|
|
19
|
+
defaultValue: true,
|
|
20
|
+
},
|
|
21
|
+
labelsPosition: {
|
|
22
|
+
control: 'select',
|
|
23
|
+
defaultValue: 'top',
|
|
24
|
+
options: ['top', 'bottom'],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
value: [2, 9.6],
|
|
29
|
+
min: 0,
|
|
30
|
+
max: 10,
|
|
31
|
+
fluid: true,
|
|
32
|
+
},
|
|
33
|
+
render(args) {
|
|
34
|
+
const [value, setValue] = useState(args.value);
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<ReqoreControlGroup style={{ width: '100%' }} vertical gapSize='huge'>
|
|
38
|
+
<ReqoreSlider {...args} value={value[0]} onChange={(min) => setValue([min, value[1]])} />
|
|
39
|
+
|
|
40
|
+
<ReqoreSlider {...args} value={value} onChange={setValue} />
|
|
41
|
+
<ReqoreControlGroup gapSize='huge'>
|
|
42
|
+
<ReqoreSlider
|
|
43
|
+
{...args}
|
|
44
|
+
orientation='vertical'
|
|
45
|
+
value={value[0]}
|
|
46
|
+
onChange={(min) => setValue([min, value[1]])}
|
|
47
|
+
/>
|
|
48
|
+
<ReqoreSlider {...args} orientation='vertical' value={value} onChange={setValue} />
|
|
49
|
+
</ReqoreControlGroup>
|
|
50
|
+
</ReqoreControlGroup>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
} as StoryMeta<typeof ReqoreSlider>;
|
|
55
|
+
type Story = StoryObj<typeof meta>;
|
|
56
|
+
|
|
57
|
+
export default meta;
|
|
58
|
+
export const Default: Story = {};
|
|
59
|
+
export const Disabled: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
disabled: true,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const WithIcons: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
icon: 'VolumeDownLine',
|
|
68
|
+
rightIcon: 'VolumeUpLine',
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
export const WithIntent: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
intent: 'success',
|
|
74
|
+
},
|
|
75
|
+
render(args, ctx) {
|
|
76
|
+
return (
|
|
77
|
+
<ReqoreControlGroup vertical gapSize='huge'>
|
|
78
|
+
{meta.render({ ...args, intent: 'info' }, ctx)}
|
|
79
|
+
{meta.render({ ...args, intent: 'success', showLabels: true }, ctx)}
|
|
80
|
+
{meta.render(
|
|
81
|
+
{
|
|
82
|
+
...args,
|
|
83
|
+
intent: 'warning',
|
|
84
|
+
showLabels: true,
|
|
85
|
+
minLabelProps: { intent: 'info' },
|
|
86
|
+
icon: 'WeiboFill',
|
|
87
|
+
},
|
|
88
|
+
ctx
|
|
89
|
+
)}
|
|
90
|
+
{meta.render({ ...args, intent: 'danger' }, ctx)}
|
|
91
|
+
</ReqoreControlGroup>
|
|
92
|
+
);
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
export const WithLabels: Story = {
|
|
96
|
+
args: {
|
|
97
|
+
showLabels: true,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
export const WithLabelsBelow: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
showLabels: true,
|
|
103
|
+
labelsPosition: 'bottom',
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
export const WithLabelsAndIcons: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
...WithLabels.args,
|
|
109
|
+
...WithIcons.args,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const WithCurrentValueOverThumb: Story = {
|
|
114
|
+
args: {
|
|
115
|
+
...WithLabels.args,
|
|
116
|
+
...WithIcons.args,
|
|
117
|
+
displayCurrentValueOverThumb: true,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const WithSize: Story = {
|
|
122
|
+
args: {
|
|
123
|
+
...WithLabels.args,
|
|
124
|
+
...WithIcons.args,
|
|
125
|
+
size: 'small',
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const WithEffect: Story = {
|
|
130
|
+
args: {
|
|
131
|
+
showLabels: true,
|
|
132
|
+
effect: {
|
|
133
|
+
gradient: {
|
|
134
|
+
direction: 'to right bottom',
|
|
135
|
+
colors: { 0: '#ca74da', 100: '#521b6e' },
|
|
136
|
+
animate: 'active',
|
|
137
|
+
},
|
|
138
|
+
spaced: 2,
|
|
139
|
+
uppercase: true,
|
|
140
|
+
weight: 'thick',
|
|
141
|
+
textSize: 'small',
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
rangeProps: {
|
|
145
|
+
effect: {
|
|
146
|
+
gradient: {
|
|
147
|
+
direction: 'to right bottom',
|
|
148
|
+
colors: { 0: '#f9f9f9', 100: '#ca55a9' },
|
|
149
|
+
animate: 'always',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
thumbProps: {
|
|
154
|
+
effect: {
|
|
155
|
+
gradient: {
|
|
156
|
+
direction: 'to right bottom',
|
|
157
|
+
colors: { 0: '#f9f9f9', 100: '#ca55a9' },
|
|
158
|
+
animate: 'active',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
currentMaxLabelProps: {
|
|
164
|
+
effect: {
|
|
165
|
+
gradient: {
|
|
166
|
+
type: 'radial',
|
|
167
|
+
colors: { 0: '#41baea', 100: '#80ffd9' },
|
|
168
|
+
animate: 'hover',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|