@licklist/design 0.78.5-dev.41 → 0.78.5-dev.43
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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/v2/components/Alert/Alert.js +87 -0
- package/dist/v2/components/Alert/Alert.scss.js +6 -0
- package/dist/v2/components/Button/Button.d.ts +8 -4
- package/dist/v2/components/Button/Button.d.ts.map +1 -1
- package/dist/v2/components/Button/Button.js +121 -0
- package/dist/v2/components/Button/Button.scss.js +6 -0
- package/dist/v2/components/Button/index.d.ts +2 -2
- package/dist/v2/components/Button/index.d.ts.map +1 -1
- package/dist/v2/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/v2/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/v2/components/Checkbox/Checkbox.js +231 -0
- package/dist/v2/components/Checkbox/Checkbox.scss.js +6 -0
- package/dist/v2/components/Checkbox/index.d.ts +3 -0
- package/dist/v2/components/Checkbox/index.d.ts.map +1 -0
- package/dist/v2/components/FormField/FormField.d.ts +10 -0
- package/dist/v2/components/FormField/FormField.d.ts.map +1 -0
- package/dist/v2/components/FormField/FormField.js +98 -0
- package/dist/v2/components/FormField/FormField.scss.js +6 -0
- package/dist/v2/components/FormField/index.d.ts +3 -0
- package/dist/v2/components/FormField/index.d.ts.map +1 -0
- package/dist/v2/components/NPSScore/NPSScore.js +546 -0
- package/dist/v2/components/NPSScore/NPSScore.scss.js +6 -0
- package/dist/v2/components/NewInput/NewInput.d.ts +20 -0
- package/dist/v2/components/NewInput/NewInput.d.ts.map +1 -0
- package/dist/v2/components/NewInput/NewInput.js +134 -0
- package/dist/v2/components/NewInput/index.d.ts +2 -0
- package/dist/v2/components/NewInput/index.d.ts.map +1 -0
- package/dist/v2/components/NewPageHeader/NewPageHeader.d.ts +10 -0
- package/dist/v2/components/NewPageHeader/NewPageHeader.d.ts.map +1 -0
- package/dist/v2/components/NewPageHeader/NewPageHeader.js +36 -0
- package/dist/v2/components/NewPageHeader/NewPageHeader.scss.js +6 -0
- package/dist/v2/components/NewPageHeader/index.d.ts +2 -0
- package/dist/v2/components/NewPageHeader/index.d.ts.map +1 -0
- package/dist/v2/components/SectionHeader/SectionHeader.d.ts +8 -0
- package/dist/v2/components/SectionHeader/SectionHeader.d.ts.map +1 -0
- package/dist/v2/components/SectionHeader/SectionHeader.js +13 -0
- package/dist/v2/components/SectionHeader/SectionHeader.scss.js +6 -0
- package/dist/v2/components/SectionHeader/index.d.ts +3 -0
- package/dist/v2/components/SectionHeader/index.d.ts.map +1 -0
- package/dist/v2/components/WYSIWYGEditor/Icons.d.ts +17 -0
- package/dist/v2/components/WYSIWYGEditor/Icons.d.ts.map +1 -0
- package/dist/v2/components/WYSIWYGEditor/Icons.js +231 -0
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.d.ts +13 -0
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.d.ts.map +1 -0
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.js +222 -0
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +6 -0
- package/dist/v2/components/WYSIWYGEditor/index.d.ts +3 -0
- package/dist/v2/components/WYSIWYGEditor/index.d.ts.map +1 -0
- package/dist/v2/components/index.d.ts +22 -0
- package/dist/v2/components/index.d.ts.map +1 -0
- package/dist/v2/styles/components/Button.scss +51 -53
- package/dist/v2/styles/form/Layout.scss +15 -0
- package/dist/v2/styles/form/NewInput.scss +60 -49
- package/dist/v2/styles/form/NewInput.scss.js +6 -0
- package/dist/v2/styles/index.scss +1 -0
- package/dist/v2/styles/tokens/_colors.scss +6 -6
- package/dist/v2/styles/tokens/_typography.scss +2 -2
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/v2/components/Alert/Alert.scss +3 -3
- package/src/v2/components/Button/Button.tsx +34 -12
- package/src/v2/components/Button/index.ts +2 -2
- package/src/v2/components/Checkbox/Checkbox.scss +190 -0
- package/src/v2/components/Checkbox/Checkbox.stories.tsx +316 -0
- package/src/v2/components/Checkbox/Checkbox.tsx +106 -0
- package/src/v2/components/Checkbox/index.ts +3 -0
- package/src/v2/components/FormField/FormField.scss +87 -0
- package/src/v2/components/FormField/FormField.stories.tsx +71 -0
- package/src/v2/components/FormField/FormField.tsx +37 -0
- package/src/v2/components/FormField/index.ts +3 -0
- package/src/v2/components/NewInput/NewInput.stories.tsx +433 -0
- package/src/v2/components/NewInput/NewInput.tsx +96 -0
- package/src/v2/components/NewInput/index.ts +1 -0
- package/src/v2/components/NewPageHeader/NewPageHeader.scss +35 -0
- package/src/v2/components/NewPageHeader/NewPageHeader.stories.tsx +44 -0
- package/src/v2/components/NewPageHeader/NewPageHeader.tsx +35 -0
- package/src/v2/components/NewPageHeader/index.ts +1 -0
- package/src/v2/components/SectionHeader/SectionHeader.scss +11 -0
- package/src/v2/components/SectionHeader/SectionHeader.tsx +15 -0
- package/src/v2/components/SectionHeader/index.ts +2 -0
- package/src/v2/components/WYSIWYGEditor/Icons.tsx +98 -0
- package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss +300 -0
- package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.stories.tsx +252 -0
- package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.tsx +224 -0
- package/src/v2/components/WYSIWYGEditor/index.ts +3 -0
- package/src/v2/components/index.ts +37 -0
- package/src/v2/styles/components/Button.scss +51 -53
- package/src/v2/styles/form/Layout.scss +15 -0
- package/src/v2/styles/form/NewInput.scss +60 -49
- package/src/v2/styles/index.scss +1 -0
- package/src/v2/styles/tokens/_colors.scss +6 -6
- package/src/v2/styles/tokens/_typography.scss +2 -2
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
/* New Form Input Styles based on Figma design tokens */
|
|
2
2
|
|
|
3
3
|
.new-form-input {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: flex-start;
|
|
7
|
+
gap: var(--spacing-sm);
|
|
8
|
+
align-self: stretch;
|
|
9
|
+
width: 100%;
|
|
8
10
|
|
|
9
11
|
&__label {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
13
|
+
font-size: 13px;
|
|
14
|
+
font-style: normal;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
line-height: 16px; /* 123.077% */
|
|
17
|
+
color: var(--label-primary, #121E52);
|
|
18
|
+
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
&__label-optional {
|
|
19
|
-
|
|
22
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
20
23
|
font-size: var(--text-xs-size, 11px);
|
|
21
24
|
font-weight: var(--heading-h6-weight, 500);
|
|
22
25
|
line-height: var(--text-xs-line, 14px);
|
|
@@ -32,32 +35,33 @@
|
|
|
32
35
|
width: 100%;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
&__input {
|
|
39
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
40
|
+
font-size: var(--text-sm-size, 13px);
|
|
41
|
+
line-height: var(--text-sm-line, 16px);
|
|
42
|
+
flex: 1 0 0;
|
|
43
|
+
background-color: var(--surfaces-main-background-secondary);
|
|
44
|
+
border: 2px solid var(--border-primary);
|
|
45
|
+
border-radius: var(--radius-md);
|
|
46
|
+
padding: 8px 10px;
|
|
47
|
+
min-height: 40px;
|
|
48
|
+
background: var(--surface-secondary);
|
|
49
|
+
width: 100%;
|
|
50
|
+
transition: all 0.2s ease;
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
&:focus {
|
|
53
|
+
outline: none;
|
|
54
|
+
border-color: var(--border-selected, #6200EE);
|
|
55
|
+
background-color: var(--surfaces-main-background-secondary, #f8f8fa);
|
|
56
|
+
}
|
|
53
57
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
58
|
+
&::placeholder {
|
|
59
|
+
color: var(--labels-main-label-secondary, #626a90);
|
|
57
60
|
}
|
|
61
|
+
}
|
|
58
62
|
|
|
59
63
|
&__textarea {
|
|
60
|
-
|
|
64
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
61
65
|
font-size: var(--text-sm-size, 13px);
|
|
62
66
|
line-height: var(--text-sm-line, 16px);
|
|
63
67
|
color: var(--labels-main-label-primary, #121e52);
|
|
@@ -72,7 +76,7 @@
|
|
|
72
76
|
|
|
73
77
|
&:focus {
|
|
74
78
|
outline: none;
|
|
75
|
-
border-color: var(--
|
|
79
|
+
border-color: var(--border-selected, #6200EE);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
&::placeholder {
|
|
@@ -88,13 +92,13 @@
|
|
|
88
92
|
border: 2px solid var(--borders-main-border-primary, #e8e9ef);
|
|
89
93
|
border-radius: var(--radius-md, 4px);
|
|
90
94
|
padding: 5px;
|
|
91
|
-
height: 40px;
|
|
95
|
+
min-height: 40px;
|
|
92
96
|
|
|
93
97
|
input {
|
|
94
98
|
flex: 1;
|
|
95
99
|
border: none;
|
|
96
100
|
background: transparent;
|
|
97
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
101
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
98
102
|
font-size: var(--text-sm-size, 13px);
|
|
99
103
|
line-height: var(--text-sm-line, 16px);
|
|
100
104
|
color: var(--labels-main-label-primary, #121e52);
|
|
@@ -126,7 +130,7 @@
|
|
|
126
130
|
border: 2px solid var(--borders-main-border-primary, #e8e9ef);
|
|
127
131
|
border-radius: var(--radius-md, 4px);
|
|
128
132
|
text-align: center;
|
|
129
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
133
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
130
134
|
font-size: var(--text-lg-size, 18px);
|
|
131
135
|
font-weight: var(--heading-h3-weight, 600);
|
|
132
136
|
color: var(--labels-main-label-primary, #121e52);
|
|
@@ -134,24 +138,35 @@
|
|
|
134
138
|
|
|
135
139
|
&:focus {
|
|
136
140
|
outline: none;
|
|
137
|
-
border-color: var(--
|
|
141
|
+
border-color: var(--border-selected, #6200EE);
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
&__helper-text {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
148
|
+
font-size: 13px;
|
|
149
|
+
font-style: normal;
|
|
150
|
+
font-weight: 400;
|
|
151
|
+
line-height: 16px;
|
|
152
|
+
margin-top: 2px;
|
|
153
|
+
color: var(--label-secondary, #626A90);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&__error-text {
|
|
157
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
158
|
+
font-size: 11px;
|
|
159
|
+
font-style: normal;
|
|
160
|
+
font-weight: 400;
|
|
161
|
+
line-height: 14px;
|
|
162
|
+
margin-top: 2px;
|
|
163
|
+
color: var(--labels-status-label-error, #ef4444);
|
|
149
164
|
}
|
|
150
165
|
|
|
151
166
|
// States
|
|
152
167
|
&--active {
|
|
153
168
|
.new-form-input__input {
|
|
154
|
-
border-color: var(--
|
|
169
|
+
border-color: var(--border-selected, #6200EE);
|
|
155
170
|
}
|
|
156
171
|
}
|
|
157
172
|
|
|
@@ -159,14 +174,10 @@
|
|
|
159
174
|
.new-form-input__input {
|
|
160
175
|
border-color: var(--borders-status-border-error, #ef4444);
|
|
161
176
|
}
|
|
162
|
-
|
|
163
|
-
.new-form-input__helper-text {
|
|
164
|
-
color: var(--labels-status-label-error, #ef4444);
|
|
165
|
-
}
|
|
166
177
|
}
|
|
167
178
|
|
|
168
179
|
&--disabled {
|
|
169
180
|
opacity: var(--opacity-50, 0.5);
|
|
170
181
|
pointer-events: none;
|
|
171
182
|
}
|
|
172
|
-
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import styleInject from '/opt/atlassian/pipelines/agent/build/node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".new-form-input{align-items:flex-start;align-self:stretch;display:flex;flex-direction:column;gap:var(--spacing-sm);width:100%}.new-form-input__label{color:var(--label-primary,#121e52);font-size:13px;font-style:normal;font-weight:500;line-height:16px}.new-form-input__label,.new-form-input__label-optional{font-family:var(--font-family-sans,\"Geist\",sans-serif),serif}.new-form-input__label-optional{color:var(--labels-main-label-secondary,#626a90);font-size:var(--text-xs-size,11px);font-weight:var(--heading-h6-weight,500);line-height:var(--text-xs-line,14px);text-align:right}.new-form-input__label-row{align-items:center;display:flex;gap:var(--spacing-reg,16px);justify-content:space-between;width:100%}.new-form-input__input{background-color:var(--surfaces-main-background-secondary);background:var(--surface-secondary);border:2px solid var(--border-primary);border-radius:var(--radius-md);flex:1 0 0;font-family:var(--font-family-sans,\"Geist\",sans-serif),serif;font-size:var(--text-sm-size,13px);line-height:var(--text-sm-line,16px);min-height:40px;padding:8px 10px;transition:all .2s ease;width:100%}.new-form-input__input:focus{background-color:var(--surfaces-main-background-secondary,#f8f8fa);border-color:var(--border-selected,#6200ee);outline:none}.new-form-input__input::placeholder{color:var(--labels-main-label-secondary,#626a90)}.new-form-input__textarea{background-color:var(--surfaces-main-background-secondary,#f8f8fa);border:1px solid var(--borders-main-border-primary,#e8e9ef);border-radius:var(--radius-md,4px);color:var(--labels-main-label-primary,#121e52);font-family:var(--font-family-sans,\"Geist\",sans-serif),serif;font-size:var(--text-sm-size,13px);line-height:var(--text-sm-line,16px);min-height:120px;padding:8px 10px;resize:vertical;transition:all .2s ease;width:100%}.new-form-input__textarea:focus{border-color:var(--border-selected,#6200ee);outline:none}.new-form-input__textarea::placeholder{color:var(--labels-main-label-secondary,#626a90)}.new-form-input__input-with-icon{align-items:center;background-color:var(--surfaces-main-background-secondary,#f8f8fa);border:2px solid var(--borders-main-border-primary,#e8e9ef);border-radius:var(--radius-md,4px);display:flex;gap:var(--spacing-sm,8px);min-height:40px;padding:5px}.new-form-input__input-with-icon input{background:#0000;border:none;color:var(--labels-main-label-primary,#121e52);flex:1;font-family:var(--font-family-sans,\"Geist\",sans-serif),serif;font-size:var(--text-sm-size,13px);line-height:var(--text-sm-line,16px)}.new-form-input__input-with-icon input:focus{outline:none}.new-form-input__input-with-icon input::placeholder{color:var(--labels-main-label-secondary,#626a90)}.new-form-input__input-with-icon .icon{flex-shrink:0;height:22px;width:22px}.new-form-input__verification-code{display:flex;gap:var(--spacing-sm,8px);height:62px}.new-form-input__verification-code .code-input{background-color:var(--surfaces-main-background-secondary,#f8f8fa);border:2px solid var(--borders-main-border-primary,#e8e9ef);border-radius:var(--radius-md,4px);color:var(--labels-main-label-primary,#121e52);flex:1;font-family:var(--font-family-sans,\"Geist\",sans-serif),serif;font-size:var(--text-lg-size,18px);font-weight:var(--heading-h3-weight,600);text-align:center;transition:all .2s ease}.new-form-input__verification-code .code-input:focus{border-color:var(--border-selected,#6200ee);outline:none}.new-form-input__helper-text{color:var(--label-secondary,#626a90);font-size:13px;line-height:16px}.new-form-input__error-text,.new-form-input__helper-text{font-family:var(--font-family-sans,\"Geist\",sans-serif),serif;font-style:normal;font-weight:400;margin-top:2px}.new-form-input__error-text{color:var(--labels-status-label-error,#ef4444);font-size:11px;line-height:14px}.new-form-input--active .new-form-input__input{border-color:var(--border-selected,#6200ee)}.new-form-input--error .new-form-input__input{border-color:var(--borders-status-border-error,#ef4444)}.new-form-input--disabled{opacity:var(--opacity-50,.5);pointer-events:none}";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
:root {
|
|
7
7
|
/* Base Colors - BKIT */
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
/* Blues */
|
|
10
10
|
--blue-50: #E7F4FC;
|
|
11
11
|
--blue-100: #B4DBF6;
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
--neutral-black: #000000;
|
|
145
145
|
|
|
146
146
|
/* Main Color Abstractions */
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
/* Purple Scale */
|
|
149
149
|
--purple-lightest: var(--purple-50);
|
|
150
150
|
--purple-lighter: var(--purple-100);
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
--shade-darkest: var(--neutral-black);
|
|
254
254
|
|
|
255
255
|
/* Semantic Colors */
|
|
256
|
-
|
|
256
|
+
|
|
257
257
|
/* Highlight Colors */
|
|
258
258
|
--highlight-lightest: var(--cyan-lightest);
|
|
259
259
|
--highlight-lighter: var(--cyan-lighter);
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
--disabled-darkest: var(--shade-regular);
|
|
327
327
|
|
|
328
328
|
/* Light Theme Palette Mappings */
|
|
329
|
-
|
|
329
|
+
|
|
330
330
|
/* Labels */
|
|
331
331
|
--label-primary: var(--shade-light);
|
|
332
332
|
--label-secondary: var(--tone-darkest);
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
/* Borders */
|
|
388
388
|
--border-primary: var(--tone-light);
|
|
389
389
|
--border-secondary: var(--tone-regular);
|
|
390
|
-
--border-selected: var(--
|
|
390
|
+
--border-selected: var(--purple-regular);
|
|
391
391
|
--border-action: var(--actions-regular);
|
|
392
392
|
--border-status-error: var(--errors-lighter);
|
|
393
393
|
--border-status-success: var(--success-lighter);
|
|
@@ -551,4 +551,4 @@
|
|
|
551
551
|
|
|
552
552
|
@mixin color-border($color) {
|
|
553
553
|
border-color: var(--#{$color});
|
|
554
|
-
}
|
|
554
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
--font-family-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
|
|
8
8
|
--font-family-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/* Headings Desktop */
|
|
11
11
|
--heading-xxl-size: 44px;
|
|
12
12
|
--heading-xxl-line: 48px;
|
|
13
13
|
--heading-xxl-weight: 600;
|
|
@@ -143,4 +143,4 @@ $typo-map: (
|
|
|
143
143
|
@media (max-width: $bp-mobile-max) {
|
|
144
144
|
@include typography($mobileVariant);
|
|
145
145
|
}
|
|
146
|
-
}
|
|
146
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '../../styles/index.scss';
|
|
2
2
|
|
|
3
3
|
.alert {
|
|
4
4
|
background: var(--surfaces-status-background-success, #eef9ea);
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
gap: 8px;
|
|
134
134
|
align-items: center;
|
|
135
135
|
cursor: pointer;
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
&:hover {
|
|
138
138
|
opacity: 0.8;
|
|
139
139
|
}
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
align-items: center;
|
|
173
173
|
justify-content: center;
|
|
174
174
|
transition: opacity 0.2s ease;
|
|
175
|
-
|
|
175
|
+
|
|
176
176
|
&:hover {
|
|
177
177
|
opacity: 0.7;
|
|
178
178
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react'
|
|
2
2
|
import './Button.scss'
|
|
3
3
|
|
|
4
|
-
export interface ButtonProps extends
|
|
4
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
variant?: 'primary' | 'primary-soft' | 'primary-outline' | 'secondary' | 'destructive-soft' | 'destructive-strong' | 'info' | 'disabled'
|
|
6
6
|
size?: 'sm' | 'md' | 'lg'
|
|
7
|
-
disabled?: boolean
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
export function Button({
|
|
11
|
-
variant = 'primary',
|
|
12
|
-
size = 'md',
|
|
13
|
-
disabled = false,
|
|
9
|
+
export function Button({
|
|
10
|
+
variant = 'primary',
|
|
11
|
+
size = 'md',
|
|
12
|
+
disabled = false,
|
|
14
13
|
className = '',
|
|
15
14
|
children,
|
|
16
|
-
...props
|
|
15
|
+
...props
|
|
17
16
|
}: ButtonProps) {
|
|
18
17
|
const classes = [
|
|
19
18
|
'new-button',
|
|
@@ -22,16 +21,39 @@ export function Button({
|
|
|
22
21
|
className
|
|
23
22
|
].filter(Boolean).join(' ')
|
|
24
23
|
|
|
24
|
+
const content = typeof children === 'string' ? (
|
|
25
|
+
<span className="new-button__text">{children}</span>
|
|
26
|
+
) : children
|
|
27
|
+
|
|
25
28
|
return (
|
|
26
|
-
<button
|
|
27
|
-
className={classes}
|
|
29
|
+
<button
|
|
30
|
+
className={classes}
|
|
28
31
|
disabled={disabled}
|
|
29
32
|
{...props}
|
|
30
33
|
>
|
|
31
|
-
{
|
|
34
|
+
{content}
|
|
32
35
|
</button>
|
|
33
36
|
)
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
export
|
|
39
|
+
export interface ButtonTextProps {
|
|
40
|
+
children: React.ReactNode
|
|
41
|
+
className?: string
|
|
42
|
+
color?: 'primary' | 'secondary' | 'danger' | 'white' | 'action'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function ButtonText({ children, className = '', color }: ButtonTextProps) {
|
|
46
|
+
const classes = [
|
|
47
|
+
'new-button__text',
|
|
48
|
+
color ? `new-button__text--${color}` : '',
|
|
49
|
+
className
|
|
50
|
+
].filter(Boolean).join(' ')
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<span className={classes}>
|
|
54
|
+
{children}
|
|
55
|
+
</span>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
37
59
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Button } from './Button'
|
|
2
|
-
export type { ButtonProps } from './Button'
|
|
1
|
+
export { Button, ButtonText } from './Button'
|
|
2
|
+
export type { ButtonProps, ButtonTextProps } from './Button'
|
|
3
3
|
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
@import '../../styles/index.scss';
|
|
2
|
+
|
|
3
|
+
.checkbox {
|
|
4
|
+
display: flex;
|
|
5
|
+
max-width: 500px;
|
|
6
|
+
align-items: flex-start;
|
|
7
|
+
gap: 11px;
|
|
8
|
+
align-self: stretch;
|
|
9
|
+
|
|
10
|
+
&__wrapper {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
gap: 11px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
user-select: none;
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__input {
|
|
20
|
+
position: absolute;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
height: 0;
|
|
24
|
+
width: 0;
|
|
25
|
+
|
|
26
|
+
&:checked ~ .checkbox__toggle {
|
|
27
|
+
background: var(--fill-selected, #14215A);
|
|
28
|
+
border: 1px solid var(--border-primary, #E8E9EF);
|
|
29
|
+
|
|
30
|
+
.checkbox__xmark {
|
|
31
|
+
opacity: 0;
|
|
32
|
+
visibility: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.checkbox__checked-group {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
visibility: visible;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:focus ~ .checkbox__toggle {
|
|
42
|
+
box-shadow: 0 0 0 2px rgba(20, 33, 90, 0.2);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:disabled ~ .checkbox__toggle {
|
|
46
|
+
background-color: var(--surface-status-disabled, #f8f8fa);
|
|
47
|
+
border-color: var(--border-primary, #e8e9ef);
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
opacity: 0.6;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Only show X mark when not pristine and not checked
|
|
54
|
+
&:not(&--pristine) &__input:not(:checked) ~ &__toggle {
|
|
55
|
+
.checkbox__xmark {
|
|
56
|
+
opacity: 1;
|
|
57
|
+
visibility: visible;
|
|
58
|
+
transform: translateX(0); // X mark slides to right (natural position)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.checkbox__checked-group {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
visibility: hidden;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&__toggle {
|
|
68
|
+
position: relative;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: flex-end; // Positions X mark to the right
|
|
72
|
+
width: 58px;
|
|
73
|
+
height: auto;
|
|
74
|
+
min-width: 58px;
|
|
75
|
+
padding: 4px;
|
|
76
|
+
background: transparent;
|
|
77
|
+
border: 1px solid var(--border-primary, #E8E9EF);
|
|
78
|
+
border-radius: var(--padding-xl, 32px);
|
|
79
|
+
transition: background 0.3s ease, border 0.3s ease;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&__xmark {
|
|
84
|
+
width: 24px;
|
|
85
|
+
height: 24px;
|
|
86
|
+
opacity: 0; // Hidden by default (blank state)
|
|
87
|
+
visibility: hidden;
|
|
88
|
+
transition: all 0.3s ease;
|
|
89
|
+
transform: translateX(-20px); // Start from left when hidden
|
|
90
|
+
|
|
91
|
+
svg {
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__checked-group {
|
|
98
|
+
position: absolute;
|
|
99
|
+
left: 4px;
|
|
100
|
+
width: 24px;
|
|
101
|
+
height: 24px;
|
|
102
|
+
opacity: 0;
|
|
103
|
+
visibility: hidden;
|
|
104
|
+
transition: all 0.3s ease;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&__circle {
|
|
108
|
+
position: relative;
|
|
109
|
+
width: 24px;
|
|
110
|
+
height: 24px;
|
|
111
|
+
|
|
112
|
+
svg {
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100%;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__checkmark {
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 50%;
|
|
121
|
+
left: 50%;
|
|
122
|
+
transform: translate(-50%, -50%);
|
|
123
|
+
width: 24px;
|
|
124
|
+
height: 24px;
|
|
125
|
+
|
|
126
|
+
svg {
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: 100%;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&__content {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
gap: 4px;
|
|
136
|
+
flex: 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&__label {
|
|
140
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
141
|
+
color: var(--label-primary);
|
|
142
|
+
font-size: 13px;
|
|
143
|
+
font-style: normal;
|
|
144
|
+
font-weight: 500;
|
|
145
|
+
line-height: 16px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&__description {
|
|
149
|
+
color: var(--label-secondary);
|
|
150
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
151
|
+
font-size: 13px;
|
|
152
|
+
font-style: normal;
|
|
153
|
+
font-weight: 400;
|
|
154
|
+
line-height: 16px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&__error-text {
|
|
158
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
159
|
+
font-size: var(--text-xs-size, 11px);
|
|
160
|
+
line-height: var(--text-xs-line, 14px);
|
|
161
|
+
color: var(--label-status-error, #ef4444);
|
|
162
|
+
margin-left: 69px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&__wrapper:hover &__input:not(:disabled) ~ &__toggle {
|
|
166
|
+
border-color: var(--border-primary-hover, #d1d3de);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Pristine state - blank checkbox on load (no icons)
|
|
170
|
+
&--pristine {
|
|
171
|
+
.checkbox__xmark,
|
|
172
|
+
.checkbox__checked-group {
|
|
173
|
+
opacity: 0 !important;
|
|
174
|
+
visibility: hidden !important;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.checkbox-pristine-wrapper {
|
|
180
|
+
display: flex;
|
|
181
|
+
width: 58px;
|
|
182
|
+
padding: 4px;
|
|
183
|
+
justify-content: flex-end;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: 8px;
|
|
186
|
+
border-radius: var(--padding-xl, 32px);
|
|
187
|
+
border: 1px solid var(--border-primary, #E8E9EF);
|
|
188
|
+
background: var(--surface-primary, #FFF);
|
|
189
|
+
}
|
|
190
|
+
|