@rolemodel/optics 0.2.5 → 0.3.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/.storybook/documentation.scss +33 -36
- package/.stylelintrc.json +1 -1
- package/dist/css/optics.css +1727 -1325
- package/dist/css/optics.css.map +1 -1
- package/dist/scss/addons/rails-modal-and-panel/modal.scss +38 -13
- package/dist/scss/addons/rails-modal-and-panel/panel.scss +38 -13
- package/dist/scss/addons/tom-select.scss +22 -22
- package/dist/scss/components/alert.scss +48 -48
- package/dist/scss/components/badge.scss +20 -20
- package/dist/scss/components/button.scss +72 -72
- package/dist/scss/components/card.scss +14 -14
- package/dist/scss/components/flash.scss +24 -24
- package/dist/scss/components/form.scss +48 -48
- package/dist/scss/components/icon.scss +32 -32
- package/dist/scss/components/sidebar.scss +67 -67
- package/dist/scss/components/table.scss +26 -26
- package/dist/scss/core/base.scss +16 -16
- package/dist/scss/core/layout.scss +8 -8
- package/dist/scss/core/tokens/base_tokens.scss +122 -112
- package/dist/scss/core/tokens/dark_mode_tokens.scss +375 -262
- package/dist/scss/core/tokens/scale_color_tokens.scss +380 -240
- package/dist/scss/core/utilities.scss +70 -70
- package/dist/scss/recipes/16six-sidebar.scss +17 -17
- package/dist/scss/recipes/domains-sidebar.scss +9 -9
- package/dist/tokens/tokens.json +567 -276
- package/package.json +3 -2
|
@@ -12,56 +12,56 @@
|
|
|
12
12
|
* @tokens Basic Colors
|
|
13
13
|
* @presenter Color
|
|
14
14
|
*/
|
|
15
|
-
--
|
|
16
|
-
--
|
|
15
|
+
--op-color-white: hsl(0deg 100% 100%);
|
|
16
|
+
--op-color-black: hsl(0deg 0% 0%);
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @tokens Primary Colors
|
|
20
20
|
* @presenter Color
|
|
21
21
|
*/
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--
|
|
22
|
+
--op-color-primary-h: 216;
|
|
23
|
+
--op-color-primary-s: 58%;
|
|
24
|
+
--op-color-primary-l: 48%;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* @tokens Neutral Colors
|
|
28
28
|
* @presenter Color
|
|
29
29
|
*/
|
|
30
|
-
--
|
|
31
|
-
--
|
|
32
|
-
--
|
|
30
|
+
--op-color-neutral-h: var(--op-color-primary-h);
|
|
31
|
+
--op-color-neutral-s: 4%;
|
|
32
|
+
--op-color-neutral-l: var(--op-color-primary-l);
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* @tokens Alerts Warning Colors
|
|
36
36
|
* @presenter Color
|
|
37
37
|
*/
|
|
38
|
-
--
|
|
39
|
-
--
|
|
40
|
-
--
|
|
38
|
+
--op-color-alerts-warning-h: 47;
|
|
39
|
+
--op-color-alerts-warning-s: 100%;
|
|
40
|
+
--op-color-alerts-warning-l: 61%;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @tokens Alerts Danger Colors
|
|
44
44
|
* @presenter Color
|
|
45
45
|
*/
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
--
|
|
46
|
+
--op-color-alerts-danger-h: 0;
|
|
47
|
+
--op-color-alerts-danger-s: 99%;
|
|
48
|
+
--op-color-alerts-danger-l: 76%;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* @tokens Alerts Info Colors
|
|
52
52
|
* @presenter Color
|
|
53
53
|
*/
|
|
54
|
-
--
|
|
55
|
-
--
|
|
56
|
-
--
|
|
54
|
+
--op-color-alerts-info-h: 216;
|
|
55
|
+
--op-color-alerts-info-s: 58%;
|
|
56
|
+
--op-color-alerts-info-l: 48%;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* @tokens Alerts Notice Colors
|
|
60
60
|
* @presenter Color
|
|
61
61
|
*/
|
|
62
|
-
--
|
|
63
|
-
--
|
|
64
|
-
--
|
|
62
|
+
--op-color-alerts-notice-h: 130;
|
|
63
|
+
--op-color-alerts-notice-s: 61%;
|
|
64
|
+
--op-color-alerts-notice-l: 64%;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
@mixin border-radius {
|
|
@@ -69,12 +69,13 @@
|
|
|
69
69
|
* @tokens Border Radius
|
|
70
70
|
* @presenter BorderRadius
|
|
71
71
|
*/
|
|
72
|
-
--
|
|
73
|
-
--
|
|
74
|
-
--
|
|
75
|
-
--
|
|
76
|
-
--
|
|
77
|
-
--
|
|
72
|
+
--op-radius-small: 2px;
|
|
73
|
+
--op-radius-medium: 4px;
|
|
74
|
+
--op-radius-large: 8px;
|
|
75
|
+
--op-radius-x-large: 12px;
|
|
76
|
+
--op-radius-2x-large: 16px;
|
|
77
|
+
--op-radius-circle: 50%;
|
|
78
|
+
--op-radius-pill: 9999px;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
@mixin border-widths {
|
|
@@ -82,9 +83,9 @@
|
|
|
82
83
|
* @tokens Border Width
|
|
83
84
|
* @presenter Spacing
|
|
84
85
|
*/
|
|
85
|
-
--
|
|
86
|
-
--
|
|
87
|
-
--
|
|
86
|
+
--op-border-width: 1px;
|
|
87
|
+
--op-border-width-large: 2px;
|
|
88
|
+
--op-border-width-x-large: 4px;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
@mixin border-colors {
|
|
@@ -92,24 +93,24 @@
|
|
|
92
93
|
* @tokens Border Color
|
|
93
94
|
* @presenter Color
|
|
94
95
|
*/
|
|
95
|
-
--
|
|
96
|
+
--op-border-color: var(--op-color-neutral-plus-five);
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
@mixin box-shadows {
|
|
99
|
-
// E.G. box-shadow: var(--
|
|
100
|
+
// E.G. box-shadow: var(--op-border-top) var(--op-border-color);
|
|
100
101
|
|
|
101
102
|
/**
|
|
102
103
|
* @tokens Border Shadow
|
|
103
104
|
* @presenter Shadow
|
|
104
105
|
*/
|
|
105
|
-
--
|
|
106
|
-
--
|
|
107
|
-
--
|
|
108
|
-
--
|
|
109
|
-
--
|
|
110
|
-
--
|
|
111
|
-
--
|
|
112
|
-
--
|
|
106
|
+
--op-border-none: 0 0 0 0;
|
|
107
|
+
--op-border-all: 0 0 0 var(--op-border-width);
|
|
108
|
+
--op-border-top: 0 calc(-1 * var(--op-border-width)) 0 0;
|
|
109
|
+
--op-border-right: var(--op-border-width) 0 0 0;
|
|
110
|
+
--op-border-bottom: 0 var(--op-border-width) 0 0;
|
|
111
|
+
--op-border-left: calc(-1 * var(--op-border-width)) 0 0 0;
|
|
112
|
+
--op-border-y: var(--op-border-top) var(--op-border-color), var(--op-border-bottom) var(--op-border-color);
|
|
113
|
+
--op-border-x: var(--op-border-left) var(--op-border-color), var(--op-border-right) var(--op-border-color);
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
@mixin font-scales {
|
|
@@ -117,16 +118,18 @@
|
|
|
117
118
|
* @tokens Font Scale
|
|
118
119
|
* @presenter FontSize
|
|
119
120
|
*/
|
|
120
|
-
--
|
|
121
|
-
--
|
|
122
|
-
--
|
|
123
|
-
--
|
|
124
|
-
--
|
|
125
|
-
--
|
|
126
|
-
--
|
|
127
|
-
--
|
|
128
|
-
--
|
|
129
|
-
--
|
|
121
|
+
--op-font-scale-unit: 1rem; // 10px;
|
|
122
|
+
--op-font-2x-small: calc(var(--op-font-scale-unit) * 1); // 10px
|
|
123
|
+
--op-font-x-small: calc(var(--op-font-scale-unit) * 1.2); // 12px
|
|
124
|
+
--op-font-small: calc(var(--op-font-scale-unit) * 1.4); // 14px
|
|
125
|
+
--op-font-medium: calc(var(--op-font-scale-unit) * 1.6); // 16px
|
|
126
|
+
--op-font-large: calc(var(--op-font-scale-unit) * 1.8); // 18px
|
|
127
|
+
--op-font-x-large: calc(var(--op-font-scale-unit) * 2); // 20px
|
|
128
|
+
--op-font-2x-large: calc(var(--op-font-scale-unit) * 2.4); // 24px
|
|
129
|
+
--op-font-3x-large: calc(var(--op-font-scale-unit) * 2.8); // 28px
|
|
130
|
+
--op-font-4x-large: calc(var(--op-font-scale-unit) * 3.2); // 32px
|
|
131
|
+
--op-font-5x-large: calc(var(--op-font-scale-unit) * 3.6); // 36px
|
|
132
|
+
--op-font-6x-large: calc(var(--op-font-scale-unit) * 4.8); // 48px
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
@mixin font-weights {
|
|
@@ -134,15 +137,15 @@
|
|
|
134
137
|
* @tokens Font Weight
|
|
135
138
|
* @presenter FontWeight
|
|
136
139
|
*/
|
|
137
|
-
--
|
|
138
|
-
--
|
|
139
|
-
--
|
|
140
|
-
--
|
|
141
|
-
--
|
|
142
|
-
--
|
|
143
|
-
--
|
|
144
|
-
--
|
|
145
|
-
--
|
|
140
|
+
--op-font-weight-thin: 100;
|
|
141
|
+
--op-font-weight-extra-light: 200;
|
|
142
|
+
--op-font-weight-light: 300;
|
|
143
|
+
--op-font-weight-normal: 400;
|
|
144
|
+
--op-font-weight-medium: 500;
|
|
145
|
+
--op-font-weight-semi-bold: 600;
|
|
146
|
+
--op-font-weight-bold: 700;
|
|
147
|
+
--op-font-weight-extra-bold: 800;
|
|
148
|
+
--op-font-weight-black: 900;
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
@mixin line-heights {
|
|
@@ -150,14 +153,14 @@
|
|
|
150
153
|
* @tokens Line Height
|
|
151
154
|
* @presenter LineHeight
|
|
152
155
|
*/
|
|
153
|
-
--
|
|
154
|
-
--
|
|
155
|
-
--
|
|
156
|
-
--
|
|
157
|
-
--
|
|
158
|
-
--
|
|
159
|
-
--
|
|
160
|
-
--
|
|
156
|
+
--op-line-height-none: 0;
|
|
157
|
+
--op-line-height-densest: 1;
|
|
158
|
+
--op-line-height-denser: 1.15;
|
|
159
|
+
--op-line-height-dense: 1.3;
|
|
160
|
+
--op-line-height-base: 1.5;
|
|
161
|
+
--op-line-height-loose: 1.6;
|
|
162
|
+
--op-line-height-looser: 1.7;
|
|
163
|
+
--op-line-height-loosest: 1.8;
|
|
161
164
|
}
|
|
162
165
|
|
|
163
166
|
@mixin letter-spacing {
|
|
@@ -165,28 +168,34 @@
|
|
|
165
168
|
* @tokens Letter Spacing
|
|
166
169
|
* @presenter LetterSpacing
|
|
167
170
|
*/
|
|
168
|
-
--
|
|
169
|
-
--
|
|
171
|
+
--op-letter-spacing-navigation: 0.01rem;
|
|
172
|
+
--op-letter-spacing-label: 0.04rem;
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
@mixin transitions {
|
|
173
176
|
/**
|
|
174
177
|
* @tokens Transition
|
|
175
178
|
*/
|
|
176
|
-
--
|
|
177
|
-
--
|
|
178
|
-
--
|
|
179
|
-
--
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
--op-transition-input: all 120ms ease-in;
|
|
180
|
+
--op-transition-sidebar: all 200ms ease-in-out;
|
|
181
|
+
--op-transition-modal: all 300ms ease-in;
|
|
182
|
+
--op-transition-panel: right 400ms ease-in;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@mixin animations {
|
|
186
|
+
/**
|
|
187
|
+
* @tokens Animation
|
|
188
|
+
* @presenter Animation
|
|
189
|
+
*/
|
|
190
|
+
--op-animation-flash: rm-slide-in-out-flash 5s normal forwards;
|
|
182
191
|
}
|
|
183
192
|
|
|
184
193
|
@mixin encoded-images {
|
|
185
194
|
/**
|
|
186
195
|
* @tokens Encoded Images
|
|
187
196
|
*/
|
|
188
|
-
--
|
|
189
|
-
--
|
|
197
|
+
--op-form-dropdown-arrow-width: 1rem; // No way to string interpolate
|
|
198
|
+
--op-form-dropdown-arrow: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 7' version='1.1' xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cg transform='matrix(0.983953,0,0,1.00934,-9.22679,-3.65885)'%3E%3Cpath fill='%23d1d1d1' d='M9.37727 3.625l5.08154 6.93523L19.54036 3.625'/%3E%3C/g%3E%3C/svg%3E%0A");
|
|
190
199
|
}
|
|
191
200
|
|
|
192
201
|
@mixin fonts {
|
|
@@ -194,7 +203,7 @@
|
|
|
194
203
|
* @tokens Font Family
|
|
195
204
|
* @presenter FontFamily
|
|
196
205
|
*/
|
|
197
|
-
--
|
|
206
|
+
--op-font-family: 'Noto Sans', 'Noto Serif', sans-serif;
|
|
198
207
|
}
|
|
199
208
|
|
|
200
209
|
@mixin spacing-scales {
|
|
@@ -202,17 +211,17 @@
|
|
|
202
211
|
* @tokens Space Scale
|
|
203
212
|
* @presenter Spacing
|
|
204
213
|
*/
|
|
205
|
-
--
|
|
206
|
-
--
|
|
207
|
-
--
|
|
208
|
-
--
|
|
209
|
-
--
|
|
210
|
-
--
|
|
211
|
-
--
|
|
212
|
-
--
|
|
213
|
-
--
|
|
214
|
-
--
|
|
215
|
-
--
|
|
214
|
+
--op-space-scale-unit: 1rem; // 10px;
|
|
215
|
+
--op-space-3x-small: calc(var(--op-space-scale-unit) * 0.2); // 2px
|
|
216
|
+
--op-space-2x-small: calc(var(--op-space-scale-unit) * 0.4); // 4px
|
|
217
|
+
--op-space-x-small: calc(var(--op-space-scale-unit) * 0.8); // 8px
|
|
218
|
+
--op-space-small: calc(var(--op-space-scale-unit) * 1.2); // 12px
|
|
219
|
+
--op-space-medium: calc(var(--op-space-scale-unit) * 1.6); // 16px
|
|
220
|
+
--op-space-large: calc(var(--op-space-scale-unit) * 2); // 20px
|
|
221
|
+
--op-space-x-large: calc(var(--op-space-scale-unit) * 2.4); // 24px
|
|
222
|
+
--op-space-2x-large: calc(var(--op-space-scale-unit) * 2.8); // 28px
|
|
223
|
+
--op-space-3x-large: calc(var(--op-space-scale-unit) * 4); // 40px
|
|
224
|
+
--op-space-4x-large: calc(var(--op-space-scale-unit) * 8); // 80px
|
|
216
225
|
}
|
|
217
226
|
|
|
218
227
|
@mixin shadows {
|
|
@@ -220,26 +229,26 @@
|
|
|
220
229
|
* @tokens Shadows
|
|
221
230
|
* @presenter Shadow
|
|
222
231
|
*/
|
|
223
|
-
--
|
|
224
|
-
--
|
|
225
|
-
--
|
|
226
|
-
--
|
|
227
|
-
--
|
|
232
|
+
--op-shadow-x-small: 0 1px 2px hsl(0deg 0% 0% / 3%), 0 1px 3px hsl(0deg 0% 0% / 15%);
|
|
233
|
+
--op-shadow-small: 0 1px 2px hsl(0deg 0% 0% / 3%), 0 2px 6px hsl(0deg 0% 0% / 15%);
|
|
234
|
+
--op-shadow-medium: 0 4px 8px hsl(0deg 0% 0% / 15%), 0 1px 3px hsl(0deg 0% 0% / 3%);
|
|
235
|
+
--op-shadow-large: 0 6px 10px hsl(0deg 0% 0% / 15%), 0 2px 3px hsl(0deg 0% 0% / 3%);
|
|
236
|
+
--op-shadow-x-large: 0 8px 12px hsl(0deg 0% 0% / 15%), 0 4px 4px hsl(0deg 0% 0% / 3%);
|
|
228
237
|
}
|
|
229
238
|
|
|
230
239
|
@mixin z-indexes {
|
|
231
240
|
/**
|
|
232
241
|
* @tokens Z-Index
|
|
233
242
|
*/
|
|
234
|
-
--
|
|
235
|
-
--
|
|
236
|
-
--
|
|
237
|
-
--
|
|
238
|
-
--
|
|
239
|
-
--
|
|
240
|
-
--
|
|
241
|
-
--
|
|
242
|
-
--
|
|
243
|
+
--op-z-index-header: 500;
|
|
244
|
+
--op-z-index-footer: 500;
|
|
245
|
+
--op-z-index-drawer: 700;
|
|
246
|
+
--op-z-index-dialog: 800;
|
|
247
|
+
--op-z-index-dialog-backdrop: 801;
|
|
248
|
+
--op-z-index-dialog-content: 802;
|
|
249
|
+
--op-z-index-dropdown: 900;
|
|
250
|
+
--op-z-index-alert-group: 950;
|
|
251
|
+
--op-z-index-tooltip: 1000;
|
|
243
252
|
}
|
|
244
253
|
|
|
245
254
|
@mixin inputs {
|
|
@@ -250,18 +259,18 @@
|
|
|
250
259
|
* @tokens Input Heights
|
|
251
260
|
* @presenter Spacing
|
|
252
261
|
*/
|
|
253
|
-
--
|
|
254
|
-
--
|
|
255
|
-
--
|
|
256
|
-
--
|
|
262
|
+
--op-input-height-small: 2.8rem; // 28px
|
|
263
|
+
--op-input-height-medium: 3.6rem; // 36px
|
|
264
|
+
--op-input-height-large: 4rem; // 40px
|
|
265
|
+
--op-input-height-x-large: 8.4rem; // 84px
|
|
257
266
|
|
|
258
267
|
/**
|
|
259
268
|
* @tokens Input Focus
|
|
260
269
|
* @presenter Shadow
|
|
261
270
|
*/
|
|
262
|
-
--
|
|
263
|
-
--
|
|
264
|
-
--
|
|
271
|
+
--op-input-outer-focus: 0 0 0 var(--op-border-width-large) var(--op-color-primary-plus-four);
|
|
272
|
+
--op-input-inner-focus: inset var(--op-border-all) var(--op-color-primary-minus-three);
|
|
273
|
+
--op-input-focus: var(--op-input-inner-focus), var(--op-input-outer-focus);
|
|
265
274
|
}
|
|
266
275
|
|
|
267
276
|
// We use SCSS variables outside the root since support for custom properties / css variables
|
|
@@ -297,8 +306,9 @@ $breakpoint-x-large: 1440px; // medium laptop
|
|
|
297
306
|
@include line-heights;
|
|
298
307
|
@include letter-spacing;
|
|
299
308
|
|
|
300
|
-
// Transitions
|
|
309
|
+
// Transitions and Animations
|
|
301
310
|
@include transitions;
|
|
311
|
+
@include animations;
|
|
302
312
|
|
|
303
313
|
// Encoded Images
|
|
304
314
|
@include encoded-images;
|
|
@@ -326,12 +336,12 @@ $breakpoint-x-large: 1440px; // medium laptop
|
|
|
326
336
|
|
|
327
337
|
// Animate onto the screen for 0.5s
|
|
328
338
|
10% {
|
|
329
|
-
right: var(--
|
|
339
|
+
right: var(--op-space-large);
|
|
330
340
|
}
|
|
331
341
|
|
|
332
342
|
// Stay on the screen for 3s
|
|
333
343
|
70% {
|
|
334
|
-
right: var(--
|
|
344
|
+
right: var(--op-space-large);
|
|
335
345
|
}
|
|
336
346
|
|
|
337
347
|
// Animate off the screen for 1.5s
|