@licklist/design 0.78.5-dev.112 → 0.78.5-dev.115
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/index.js +1 -0
- package/dist/v2/components/AccountManagerCard/AccountManagerCard.scss.js +1 -1
- package/dist/v2/components/ActionMenu/ActionMenu.scss.js +1 -1
- package/dist/v2/components/Alert/Alert.scss.js +1 -1
- package/dist/v2/components/AvatarUpload/AvatarUpload.scss.js +1 -1
- package/dist/v2/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/v2/components/Checkbox/Checkbox.js +9 -18
- package/dist/v2/components/Checkbox/Checkbox.scss.js +1 -1
- package/dist/v2/components/ColorPicker/ColorPicker.d.ts +5 -3
- package/dist/v2/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/v2/components/ColorPicker/ColorPicker.js +55 -28
- package/dist/v2/components/ColorPicker/ColorPicker.scss.js +1 -1
- package/dist/v2/components/DataTable/DataTable.scss.js +1 -1
- package/dist/v2/components/EmptyState/EmptyState.scss.js +1 -1
- package/dist/v2/components/FeatureCard/FeatureCard.scss.js +1 -1
- package/dist/v2/components/FeatureToggle/FeatureToggle.scss.js +1 -1
- package/dist/v2/components/FormField/FormField.scss.js +1 -1
- package/dist/v2/components/InfoGrid/InfoGrid.scss.js +1 -1
- package/dist/v2/components/NotificationBanner/NotificationBanner.scss.js +1 -1
- package/dist/v2/components/RadioGroup/RadioGroup.d.ts +16 -0
- package/dist/v2/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/v2/components/RadioGroup/RadioGroup.js +54 -0
- package/dist/v2/components/RadioGroup/RadioGroup.scss.js +6 -0
- package/dist/v2/components/RadioGroup/index.d.ts +2 -0
- package/dist/v2/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/v2/components/StatusBadge/StatusBadge.scss.js +1 -1
- package/dist/v2/components/TableControls/TableControls.scss.js +1 -1
- package/dist/v2/components/Tabs/Tabs.scss.js +1 -1
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +1 -1
- package/dist/v2/components/index.d.ts +1 -0
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/icons/index.js +25 -16
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.js +14 -11
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +1 -1
- package/dist/v2/pages/DeleteEntity/DeleteEntityPage.js +1 -1
- package/dist/v2/pages/Settings/SettingsPage.scss.js +1 -1
- package/dist/v2/pages/Settings/SettingsTabs.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarCustomisation.js +1 -0
- package/dist/v2/pages/Settings/components/SidebarCustomisation.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarNavItem.js +1 -0
- package/dist/v2/pages/Settings/components/SidebarNavItem.scss.js +1 -1
- package/dist/v2/styles/form/NewInput.scss +12 -1
- package/dist/v2/styles/form/NewInput.scss.js +1 -1
- package/dist/v2/styles/tokens/_colors.scss +1 -0
- package/package.json +3 -3
- package/src/v2/components/Checkbox/Checkbox.scss +61 -67
- package/src/v2/components/Checkbox/Checkbox.tsx +4 -9
- package/src/v2/components/ColorPicker/ColorPicker.scss +15 -2
- package/src/v2/components/ColorPicker/ColorPicker.tsx +45 -23
- package/src/v2/components/RadioGroup/RadioGroup.scss +86 -0
- package/src/v2/components/RadioGroup/RadioGroup.stories.tsx +71 -0
- package/src/v2/components/RadioGroup/RadioGroup.tsx +55 -0
- package/src/v2/components/RadioGroup/index.ts +1 -0
- package/src/v2/components/index.ts +3 -0
- package/src/v2/icons/index.tsx +4 -4
- package/src/v2/index.ts +10 -10
- package/src/v2/navigation/DashboardLayout/DashboardLayout.scss +6 -0
- package/src/v2/navigation/DashboardLayout/DashboardLayout.tsx +4 -2
- package/src/v2/navigation/DashboardLayout/ProviderSidebar.scss +8 -0
- package/src/v2/pages/DeleteEntity/DeleteEntityPage.tsx +1 -1
- package/src/v2/styles/form/NewInput.scss +12 -1
- package/src/v2/styles/tokens/_colors.scss +1 -0
|
@@ -28,17 +28,18 @@
|
|
|
28
28
|
width: 0;
|
|
29
29
|
|
|
30
30
|
&:checked ~ .checkbox__toggle {
|
|
31
|
-
background: var(--fill-
|
|
31
|
+
background: var(--fill-primary, #14215A);
|
|
32
32
|
border: none;
|
|
33
33
|
|
|
34
|
-
.
|
|
35
|
-
|
|
36
|
-
visibility: hidden;
|
|
37
|
-
}
|
|
34
|
+
.checkbox__thumb {
|
|
35
|
+
transform: translateX(24px);
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
svg:first-child {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
svg:last-child {
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -54,76 +55,68 @@
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
//
|
|
58
|
+
// Unchecked state (when interacted or checked, but now unchecked)
|
|
58
59
|
&:not(&--pristine) &__input:not(:checked) ~ &__toggle {
|
|
59
|
-
background: var(--
|
|
60
|
+
background: var(--surface-tertiary, #D1D5E0);
|
|
60
61
|
border: none;
|
|
61
62
|
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
visibility: visible;
|
|
65
|
-
}
|
|
63
|
+
.checkbox__thumb {
|
|
64
|
+
transform: translateX(0);
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
svg:first-child {
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
69
|
+
svg:last-child {
|
|
70
|
+
opacity: 0;
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
&__toggle {
|
|
74
|
-
|
|
75
|
-
display: flex;
|
|
76
|
+
display: inline-flex;
|
|
76
77
|
align-items: center;
|
|
77
|
-
width:
|
|
78
|
-
height:
|
|
79
|
-
min-width: 58px;
|
|
80
|
-
padding: 4px;
|
|
81
|
-
background: var(--surface-secondary, var(--neutral-25));
|
|
82
|
-
border: none;
|
|
83
|
-
border-radius: var(--padding-xl, 32px);
|
|
78
|
+
width: 52px;
|
|
79
|
+
height: 28px;
|
|
84
80
|
flex-shrink: 0;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
border-radius: 9999px;
|
|
83
|
+
border: none;
|
|
84
|
+
padding: 2px;
|
|
85
85
|
transition: background-color 0.2s ease;
|
|
86
|
+
position: relative;
|
|
87
|
+
background: var(--surface-tertiary, #D1D5E0);
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
&
|
|
89
|
-
position: absolute;
|
|
90
|
-
left: 4px;
|
|
91
|
-
top: 50%;
|
|
92
|
-
transform: translateY(-50%);
|
|
93
|
-
width: 24px;
|
|
94
|
-
height: 24px;
|
|
95
|
-
opacity: 0;
|
|
96
|
-
visibility: hidden;
|
|
90
|
+
&__thumb {
|
|
97
91
|
display: flex;
|
|
98
92
|
align-items: center;
|
|
99
93
|
justify-content: center;
|
|
100
|
-
background: white;
|
|
101
|
-
border-radius: 50%;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&__icon-cross {
|
|
105
|
-
fill: var(--grey-500);
|
|
106
|
-
opacity: 0.5;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
&__checked-group {
|
|
110
|
-
position: absolute;
|
|
111
|
-
right: 4px; // Checked position on the right
|
|
112
|
-
top: 50%;
|
|
113
|
-
transform: translateY(-50%);
|
|
114
94
|
width: 24px;
|
|
115
95
|
height: 24px;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
96
|
+
background: #ffffff;
|
|
97
|
+
border-radius: 9999px;
|
|
98
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
99
|
+
transition: transform 0.2s ease;
|
|
100
|
+
pointer-events: none;
|
|
101
|
+
transform: translateX(0);
|
|
102
|
+
position: relative;
|
|
103
|
+
|
|
104
|
+
svg {
|
|
105
|
+
position: absolute;
|
|
106
|
+
width: 14px;
|
|
107
|
+
height: 14px;
|
|
108
|
+
transition: opacity 0.2s ease;
|
|
109
|
+
}
|
|
124
110
|
|
|
125
|
-
|
|
126
|
-
|
|
111
|
+
svg:first-child {
|
|
112
|
+
color: var(--label-tertiary, #A1A5B7);
|
|
113
|
+
opacity: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
svg:last-child {
|
|
117
|
+
color: var(--fill-primary, #14215A);
|
|
118
|
+
opacity: 0;
|
|
119
|
+
}
|
|
127
120
|
}
|
|
128
121
|
|
|
129
122
|
&__content {
|
|
@@ -158,7 +151,7 @@
|
|
|
158
151
|
font-size: var(--text-xs-size, 11px);
|
|
159
152
|
line-height: var(--text-xs-line, 14px);
|
|
160
153
|
color: var(--label-status-error, var(--red-500));
|
|
161
|
-
margin-left:
|
|
154
|
+
margin-left: 63px;
|
|
162
155
|
}
|
|
163
156
|
|
|
164
157
|
&__wrapper:hover &__input:not(:disabled) ~ &__toggle {
|
|
@@ -169,22 +162,23 @@
|
|
|
169
162
|
.checkbox__toggle {
|
|
170
163
|
background: var(--surface-secondary, var(--neutral-25));
|
|
171
164
|
}
|
|
172
|
-
.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
165
|
+
.checkbox__thumb {
|
|
166
|
+
transform: translateX(0);
|
|
167
|
+
svg {
|
|
168
|
+
opacity: 0 !important;
|
|
169
|
+
}
|
|
176
170
|
}
|
|
177
171
|
}
|
|
178
172
|
}
|
|
179
173
|
|
|
180
174
|
.checkbox-pristine-wrapper {
|
|
181
175
|
display: flex;
|
|
182
|
-
width:
|
|
183
|
-
padding:
|
|
176
|
+
width: 52px;
|
|
177
|
+
padding: 2px;
|
|
184
178
|
justify-content: flex-end;
|
|
185
179
|
align-items: center;
|
|
186
180
|
gap: 8px;
|
|
187
|
-
border-radius:
|
|
181
|
+
border-radius: 9999px;
|
|
188
182
|
border: 1px solid var(--border-primary, var(--neutral-50));
|
|
189
183
|
background: var(--surface-primary, var(--neutral-white));
|
|
190
184
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes, forwardRef } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { ToggleCheckIcon, ToggleCrossIcon } from '../../icons'
|
|
3
3
|
import './Checkbox.scss'
|
|
4
4
|
|
|
5
5
|
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
@@ -42,14 +42,9 @@ export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
|
|
|
42
42
|
{...props}
|
|
43
43
|
/>
|
|
44
44
|
<span className="checkbox__toggle">
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
</span>
|
|
49
|
-
|
|
50
|
-
{/* White circle + Checkmark - visible when checked, positioned to the right */}
|
|
51
|
-
<span className="checkbox__checked-group">
|
|
52
|
-
<IconTick size={16} className="checkbox__icon-tick" />
|
|
45
|
+
<span className="checkbox__thumb">
|
|
46
|
+
<ToggleCrossIcon />
|
|
47
|
+
<ToggleCheckIcon />
|
|
53
48
|
</span>
|
|
54
49
|
</span>
|
|
55
50
|
{(label || description) && (
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
column-gap: 20px;
|
|
5
5
|
row-gap: 32px;
|
|
6
|
-
margin-top: 16px;
|
|
7
6
|
width: 100%;
|
|
8
7
|
border-radius: 8px;
|
|
9
8
|
border: 1px solid transparent;
|
|
10
9
|
transition: all 0.2s;
|
|
11
10
|
|
|
12
11
|
&--error {
|
|
13
|
-
border-color:
|
|
12
|
+
border-color: var(--border-red-regular);
|
|
14
13
|
background-color: rgba(224, 66, 58, 0.05);
|
|
14
|
+
padding: 8px;
|
|
15
|
+
margin-top: 8px;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
@media (max-width: 480px) {
|
|
@@ -85,6 +86,18 @@
|
|
|
85
86
|
height: 38px;
|
|
86
87
|
border-radius: 50%;
|
|
87
88
|
transition: all 0.2s ease-out;
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
position: relative;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.color-picker-check-icon {
|
|
96
|
+
width: 20px;
|
|
97
|
+
height: 20px;
|
|
98
|
+
position: absolute;
|
|
99
|
+
color: white;
|
|
100
|
+
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
|
|
88
101
|
}
|
|
89
102
|
|
|
90
103
|
.color-picker-name {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { NotificationSuccessIcon } from '../../icons'
|
|
2
3
|
import './ColorPicker.scss'
|
|
3
4
|
|
|
4
5
|
export interface ColorOption {
|
|
@@ -9,9 +10,11 @@ export interface ColorOption {
|
|
|
9
10
|
export interface ColorPickerProps {
|
|
10
11
|
colors: ColorOption[]
|
|
11
12
|
selectedColor?: string
|
|
12
|
-
onChange: (
|
|
13
|
-
t: (
|
|
14
|
-
error?: string
|
|
13
|
+
onChange: (...args: any[]) => void
|
|
14
|
+
t: (...args: any[]) => string
|
|
15
|
+
error?: string | boolean | null
|
|
16
|
+
label?: string
|
|
17
|
+
optional?: boolean
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
export const ColorPicker: React.FC<ColorPickerProps> = ({
|
|
@@ -20,30 +23,49 @@ export const ColorPicker: React.FC<ColorPickerProps> = ({
|
|
|
20
23
|
onChange,
|
|
21
24
|
t,
|
|
22
25
|
error,
|
|
26
|
+
label,
|
|
27
|
+
optional,
|
|
23
28
|
}) => {
|
|
29
|
+
const showError = !!error
|
|
24
30
|
return (
|
|
25
|
-
<div className=
|
|
26
|
-
{
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
<div className="new-form-input">
|
|
32
|
+
{(label || optional) && (
|
|
33
|
+
<label className="new-form-input__label">
|
|
34
|
+
<span>{label}</span>
|
|
35
|
+
{optional && <span className="new-form-input__label-optional">(optional)</span>}
|
|
36
|
+
</label>
|
|
37
|
+
)}
|
|
38
|
+
<div className={`color-picker-grid ${showError ? 'color-picker-grid--error' : ''}`}>
|
|
39
|
+
{colors.map((color) => (
|
|
40
|
+
<button
|
|
41
|
+
key={color.name}
|
|
42
|
+
type="button"
|
|
43
|
+
className="color-picker-button"
|
|
44
|
+
onClick={() => onChange(color.hex)}
|
|
38
45
|
>
|
|
39
46
|
<div
|
|
40
|
-
className=
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
className={`color-picker-outer-circle ${
|
|
48
|
+
selectedColor === color.hex ? 'color-picker-outer-circle--selected' : ''
|
|
49
|
+
}`}
|
|
50
|
+
style={selectedColor === color.hex ? { borderColor: color.hex, borderWidth: '2px' } : {}}
|
|
51
|
+
>
|
|
52
|
+
<div
|
|
53
|
+
className="color-picker-inner-circle"
|
|
54
|
+
style={{ backgroundColor: color.hex }}
|
|
55
|
+
>
|
|
56
|
+
{selectedColor === color.hex && (
|
|
57
|
+
<NotificationSuccessIcon
|
|
58
|
+
size={20}
|
|
59
|
+
className="color-picker-check-icon"
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<span className="color-picker-name">{t(color.name)}</span>
|
|
65
|
+
</button>
|
|
66
|
+
))}
|
|
67
|
+
</div>
|
|
68
|
+
<p className="pricing-period-form__hint">{t('colourHint')}</p>
|
|
47
69
|
</div>
|
|
48
70
|
)
|
|
49
71
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
.radio-group {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.radio-group-item {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex: 1;
|
|
10
|
+
padding: 12px 4px;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
transition: background-color 0.2s ease;
|
|
16
|
+
user-select: none;
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
background-color: var(--surface-primary-hover, #F3F4F6);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__input-wrapper {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
padding: 0 12px;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__input {
|
|
31
|
+
position: absolute;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
width: 0;
|
|
34
|
+
height: 0;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__circle {
|
|
39
|
+
width: 16px;
|
|
40
|
+
height: 16px;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
border: 1px solid var(--border-primary, #E5E7EB);
|
|
43
|
+
background-color: var(--surface-primary, #FFFFFF);
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
transition: border-color 0.2s ease;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__inner-dot {
|
|
51
|
+
width: 10px;
|
|
52
|
+
height: 10px;
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
background-color: var(--fill-primary, #14215A);
|
|
55
|
+
transform: scale(0);
|
|
56
|
+
transition: transform 0.2s ease;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&__input:checked + &__circle {
|
|
60
|
+
.radio-group-item__inner-dot {
|
|
61
|
+
transform: scale(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__content {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
flex: 1;
|
|
69
|
+
min-width: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__title {
|
|
73
|
+
color: var(--label-primary, #111827);
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
line-height: 1.25;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__description {
|
|
80
|
+
color: var(--label-secondary, #6B7280);
|
|
81
|
+
font-size: 12px;
|
|
82
|
+
font-weight: 400;
|
|
83
|
+
line-height: 1.5;
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { RadioGroup } from './RadioGroup'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'v2/Components/RadioGroup',
|
|
7
|
+
component: RadioGroup,
|
|
8
|
+
args: {
|
|
9
|
+
name: 'radio-group-example',
|
|
10
|
+
options: [
|
|
11
|
+
{ value: 'option1', label: 'Option 1' },
|
|
12
|
+
{ value: 'option2', label: 'Option 2' },
|
|
13
|
+
{ value: 'option3', label: 'Option 3' },
|
|
14
|
+
],
|
|
15
|
+
value: 'option1',
|
|
16
|
+
},
|
|
17
|
+
} as Meta<typeof RadioGroup>
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof RadioGroup>
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
render: (args) => {
|
|
23
|
+
const [value, setValue] = useState(args.value)
|
|
24
|
+
return <RadioGroup {...args} value={value} onChange={setValue} />
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const WithDescriptions: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
options: [
|
|
31
|
+
{
|
|
32
|
+
value: 'all',
|
|
33
|
+
label: 'All conditions are met',
|
|
34
|
+
description: 'Every rule must be satisfied for this tier to apply',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: 'any',
|
|
38
|
+
label: 'Any condition is met',
|
|
39
|
+
description: 'At least one rule must be satisfied for this tier to apply',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
value: 'all',
|
|
43
|
+
},
|
|
44
|
+
render: (args) => {
|
|
45
|
+
const [value, setValue] = useState(args.value)
|
|
46
|
+
return <RadioGroup {...args} value={value} onChange={setValue} />
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Controlled: Story = {
|
|
51
|
+
render: () => {
|
|
52
|
+
const [value, setValue] = useState('one')
|
|
53
|
+
const options = [
|
|
54
|
+
{ value: 'one', label: 'Label One', description: 'Description for label one' },
|
|
55
|
+
{ value: 'two', label: 'Label Two', description: 'Description for label two' },
|
|
56
|
+
]
|
|
57
|
+
return (
|
|
58
|
+
<div style={{ maxWidth: '400px', padding: '20px', background: '#fff' }}>
|
|
59
|
+
<RadioGroup
|
|
60
|
+
name="controlled-example"
|
|
61
|
+
value={value}
|
|
62
|
+
onChange={setValue}
|
|
63
|
+
options={options}
|
|
64
|
+
/>
|
|
65
|
+
<div style={{ marginTop: '20px', fontSize: '14px' }}>
|
|
66
|
+
Selected value: <strong>{value}</strong>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
},
|
|
71
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import './RadioGroup.scss'
|
|
3
|
+
|
|
4
|
+
export interface RadioOption {
|
|
5
|
+
value: string
|
|
6
|
+
label: string
|
|
7
|
+
description?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface RadioGroupProps {
|
|
11
|
+
name: string
|
|
12
|
+
options: RadioOption[]
|
|
13
|
+
value: string
|
|
14
|
+
onChange: (value: string) => void
|
|
15
|
+
className?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const RadioGroup: React.FC<RadioGroupProps> = ({
|
|
19
|
+
name,
|
|
20
|
+
options,
|
|
21
|
+
value,
|
|
22
|
+
onChange,
|
|
23
|
+
className = '',
|
|
24
|
+
}) => {
|
|
25
|
+
return (
|
|
26
|
+
<div className={`radio-group ${className}`} role="radiogroup">
|
|
27
|
+
{options.map((opt) => (
|
|
28
|
+
<label
|
|
29
|
+
key={opt.value}
|
|
30
|
+
className={`radio-group-item ${value === opt.value ? 'radio-group-item--selected' : ''}`}
|
|
31
|
+
>
|
|
32
|
+
<div className="radio-group-item__input-wrapper">
|
|
33
|
+
<input
|
|
34
|
+
type="radio"
|
|
35
|
+
name={name}
|
|
36
|
+
value={opt.value}
|
|
37
|
+
checked={value === opt.value}
|
|
38
|
+
onChange={() => onChange(opt.value)}
|
|
39
|
+
className="radio-group-item__input"
|
|
40
|
+
/>
|
|
41
|
+
<div className="radio-group-item__circle">
|
|
42
|
+
<div className="radio-group-item__inner-dot" />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div className="radio-group-item__content">
|
|
46
|
+
<span className="radio-group-item__title">{opt.label}</span>
|
|
47
|
+
{opt.description && (
|
|
48
|
+
<p className="radio-group-item__description">{opt.description}</p>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
</label>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RadioGroup'
|
|
@@ -67,6 +67,7 @@ export type { CheckboxProps } from './Checkbox'
|
|
|
67
67
|
export { InputCheckbox } from './InputCheckbox'
|
|
68
68
|
export type { InputCheckboxProps } from './InputCheckbox'
|
|
69
69
|
|
|
70
|
+
|
|
70
71
|
export { WYSIWYGEditor } from './WYSIWYGEditor'
|
|
71
72
|
export type { WYSIWYGEditorProps } from './WYSIWYGEditor'
|
|
72
73
|
|
|
@@ -114,6 +115,8 @@ export type { PaginationProps } from './Pagination'
|
|
|
114
115
|
export { RadioCardGroup } from './RadioCard'
|
|
115
116
|
export type { RadioCardGroupProps, RadioCardOption } from './RadioCard'
|
|
116
117
|
|
|
118
|
+
export * from './RadioGroup'
|
|
119
|
+
|
|
117
120
|
export { ZoneCard, ZoneContainer, ZoneHeader, ResourceRow, AddResourceButton } from './ZoneCard'
|
|
118
121
|
export type { ZoneCardProps, ZoneResource, ZoneContainerProps, DragHandleProps, ZoneHeaderProps, ResourceRowProps, AddResourceButtonProps } from './ZoneCard'
|
|
119
122
|
|
package/src/v2/icons/index.tsx
CHANGED
|
@@ -110,10 +110,10 @@ export const EditIcon = () => (
|
|
|
110
110
|
|
|
111
111
|
export const NoRulesIcon = ({ width = 24, height = 24, className = '' }: { width?: number; height?: number; className?: string } = {}) => (
|
|
112
112
|
<svg width={width} height={height} viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
|
113
|
-
<path d="M24 6C25.6569 6 27 7.34315 27 9V11H25V23C25 24.6569 23.6569 26 22 26H8C6.34315 26 5 24.6569 5 23V21H21V23C21 23.5128 21.386 23.9355 21.8834 23.9933L22 24C22.5128 24 22.9355 23.614 22.9933 23.1166L23 23V8H10C9.48716 8 9.06449 8.38604 9.00673 8.88338L9 9V19H7V9C7 7.34315 8.34315 6 10 6H24Z" fill="
|
|
114
|
-
<path d="M11 11C11 10.4477 11.4477 10 12 10H20C20.5523 10 21 10.4477 21 11C21 11.5523 20.5523 12 20 12H12C11.4477 12 11 11.5523 11 11Z" fill="
|
|
115
|
-
<path d="M11 15C11 14.4477 11.4477 14 12 14H20C20.5523 14 21 14.4477 21 15C21 15.5523 20.5523 16 20 16H12C11.4477 16 11 15.5523 11 15Z" fill="
|
|
116
|
-
<path d="M11 19C11 18.4477 11.4477 18 12 18H20C20.5523 18 21 18.4477 21 19C21 19.5523 20.5523 20 20 20H12C11.4477 20 11 19.5523 11 19Z" fill="
|
|
113
|
+
<path d="M24 6C25.6569 6 27 7.34315 27 9V11H25V23C25 24.6569 23.6569 26 22 26H8C6.34315 26 5 24.6569 5 23V21H21V23C21 23.5128 21.386 23.9355 21.8834 23.9933L22 24C22.5128 24 22.9355 23.614 22.9933 23.1166L23 23V8H10C9.48716 8 9.06449 8.38604 9.00673 8.88338L9 9V19H7V9C7 7.34315 8.34315 6 10 6H24Z" fill="currentColor"/>
|
|
114
|
+
<path d="M11 11C11 10.4477 11.4477 10 12 10H20C20.5523 10 21 10.4477 21 11C21 11.5523 20.5523 12 20 12H12C11.4477 12 11 11.5523 11 11Z" fill="currentColor" fillOpacity="0.25"/>
|
|
115
|
+
<path d="M11 15C11 14.4477 11.4477 14 12 14H20C20.5523 14 21 14.4477 21 15C21 15.5523 20.5523 16 20 16H12C11.4477 16 11 15.5523 11 15Z" fill="currentColor" fillOpacity="0.25"/>
|
|
116
|
+
<path d="M11 19C11 18.4477 11.4477 18 12 18H20C20.5523 18 21 18.4477 21 19C21 19.5523 20.5523 20 20 20H12C11.4477 20 11 19.5523 11 19Z" fill="currentColor" fillOpacity="0.25"/>
|
|
117
117
|
</svg>
|
|
118
118
|
)
|
|
119
119
|
|
package/src/v2/index.ts
CHANGED
|
@@ -143,11 +143,11 @@ export { SidebarWithAuth } from './navigation/SidebarWithAuth'
|
|
|
143
143
|
export type { SidebarWithAuthProps } from './navigation/SidebarWithAuth'
|
|
144
144
|
|
|
145
145
|
// Dashboard Layout (Complete layout with sidebar, tophat, and content area)
|
|
146
|
-
export {
|
|
147
|
-
DashboardLayout,
|
|
148
|
-
ProviderSidebar,
|
|
149
|
-
AdminSidebar,
|
|
150
|
-
TopNavigation,
|
|
146
|
+
export {
|
|
147
|
+
DashboardLayout,
|
|
148
|
+
ProviderSidebar,
|
|
149
|
+
AdminSidebar,
|
|
150
|
+
TopNavigation,
|
|
151
151
|
DashboardFooter,
|
|
152
152
|
// Sidebar Icons
|
|
153
153
|
HomeIcon,
|
|
@@ -161,14 +161,14 @@ export {
|
|
|
161
161
|
WaiversIcon,
|
|
162
162
|
SettingsIcon,
|
|
163
163
|
} from './navigation/DashboardLayout'
|
|
164
|
-
export type {
|
|
165
|
-
DashboardLayoutProps,
|
|
164
|
+
export type {
|
|
165
|
+
DashboardLayoutProps,
|
|
166
166
|
DestinationType,
|
|
167
167
|
ProviderSidebarProps,
|
|
168
168
|
NavItem,
|
|
169
|
-
AdminSidebarProps,
|
|
170
|
-
TopNavigationProps,
|
|
171
|
-
DashboardFooterProps
|
|
169
|
+
AdminSidebarProps,
|
|
170
|
+
TopNavigationProps,
|
|
171
|
+
DashboardFooterProps
|
|
172
172
|
} from './navigation/DashboardLayout'
|
|
173
173
|
|
|
174
174
|
// Navigation Configuration
|
|
@@ -56,6 +56,12 @@
|
|
|
56
56
|
flex: 1;
|
|
57
57
|
min-height: 0;
|
|
58
58
|
overflow-y: auto;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__content-inner {
|
|
64
|
+
flex: 1 0 auto;
|
|
59
65
|
padding-left: var(--container-padding-desktop, 32px);
|
|
60
66
|
padding-right: var(--container-padding-desktop, 32px);
|
|
61
67
|
@media (max-width: 768px) {
|
|
@@ -232,9 +232,11 @@ export const DashboardLayout: React.FC<DashboardLayoutProps> = ({
|
|
|
232
232
|
}}
|
|
233
233
|
>
|
|
234
234
|
<div id="main" className="dashboard-layout__content">
|
|
235
|
-
|
|
235
|
+
<div className="dashboard-layout__content-inner">
|
|
236
|
+
{children}
|
|
237
|
+
</div>
|
|
238
|
+
{showFooter && <DashboardFooter version={version} />}
|
|
236
239
|
</div>
|
|
237
|
-
{showFooter && <DashboardFooter version={version} />}
|
|
238
240
|
</main>
|
|
239
241
|
</div>
|
|
240
242
|
|
|
@@ -231,6 +231,10 @@
|
|
|
231
231
|
width: 100%;
|
|
232
232
|
color: var(--fills-main-fill-primary, #14215A);
|
|
233
233
|
|
|
234
|
+
@media (max-width: 768px) {
|
|
235
|
+
padding: 10px;
|
|
236
|
+
}
|
|
237
|
+
|
|
234
238
|
&:hover:not(&--active) {
|
|
235
239
|
background: var(--surfaces-main-background-secondary-hover, #F0F0F4);
|
|
236
240
|
}
|
|
@@ -308,5 +312,9 @@
|
|
|
308
312
|
color: var(--labels-main-label-primary, #121E52);
|
|
309
313
|
margin: 0;
|
|
310
314
|
white-space: nowrap;
|
|
315
|
+
|
|
316
|
+
@media (max-width: 768px) {
|
|
317
|
+
font-size: 15px;
|
|
318
|
+
}
|
|
311
319
|
}
|
|
312
320
|
}
|