@rolemodel/optics 1.12.0 → 2.0.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.
Files changed (52) hide show
  1. package/.github/workflows/linting.yml +0 -2
  2. package/.stylelintrc.json +9 -9
  3. package/.yarn/install-state.gz +0 -0
  4. package/NEW_COMPONENT.md +23 -33
  5. package/README.md +9 -11
  6. package/build_token_json.js +1 -6
  7. package/dist/css/addons/panel.css +65 -0
  8. package/dist/{scss/addons/tom-select.scss → css/addons/tom-select.css} +13 -15
  9. package/dist/{scss → css}/components/form.css +1 -1
  10. package/dist/{scss/components/icon.scss → css/components/icon.css} +10 -8
  11. package/dist/{scss → css}/components/sidebar.css +1 -1
  12. package/dist/{scss/core/base.scss → css/core/base.css} +3 -3
  13. package/dist/{scss/core/tokens/base_tokens.scss → css/core/tokens/base_tokens.css} +102 -160
  14. package/dist/{scss/core/tokens/index.scss → css/core/tokens/index.css} +0 -1
  15. package/dist/css/core/tokens/scale_color_tokens.css +1498 -0
  16. package/dist/{scss/core/utilities.scss → css/core/utilities.css} +20 -18
  17. package/dist/css/optics.css +10 -4223
  18. package/dist/css/optics.min.css +4907 -0
  19. package/dist/{scss/recipes/aligned-header.scss → css/recipes/aligned-header.css} +2 -6
  20. package/dist/tokens/tokens.json +14 -566
  21. package/package.json +9 -14
  22. package/postcss.config.js +3 -0
  23. package/dist/css/optics.css.map +0 -1
  24. package/dist/scss/addons/panel.scss +0 -61
  25. package/dist/scss/core/tokens/dark_mode_tokens.scss +0 -479
  26. package/dist/scss/core/tokens/scale_color_tokens.scss +0 -468
  27. package/dist/scss/optics.scss +0 -13
  28. /package/dist/{scss → css}/components/accordion.css +0 -0
  29. /package/dist/{scss → css}/components/alert.css +0 -0
  30. /package/dist/{scss → css}/components/avatar.css +0 -0
  31. /package/dist/{scss → css}/components/badge.css +0 -0
  32. /package/dist/{scss → css}/components/breadcrumbs.css +0 -0
  33. /package/dist/{scss → css}/components/button.css +0 -0
  34. /package/dist/{scss → css}/components/button_group.css +0 -0
  35. /package/dist/{scss → css}/components/card.css +0 -0
  36. /package/dist/{scss → css}/components/confirm-dialog.css +0 -0
  37. /package/dist/{scss → css}/components/divider.css +0 -0
  38. /package/dist/{scss/components/index.scss → css/components/index.css} +0 -0
  39. /package/dist/{scss → css}/components/modal.css +0 -0
  40. /package/dist/{scss → css}/components/navbar.css +0 -0
  41. /package/dist/{scss → css}/components/pagination.css +0 -0
  42. /package/dist/{scss → css}/components/side_panel.css +0 -0
  43. /package/dist/{scss → css}/components/spinner.css +0 -0
  44. /package/dist/{scss → css}/components/switch.css +0 -0
  45. /package/dist/{scss → css}/components/tab.css +0 -0
  46. /package/dist/{scss → css}/components/table.css +0 -0
  47. /package/dist/{scss → css}/components/tag.css +0 -0
  48. /package/dist/{scss → css}/components/text_pair.css +0 -0
  49. /package/dist/{scss → css}/components/tooltip.css +0 -0
  50. /package/dist/{scss/core/layout.scss → css/core/layout.css} +0 -0
  51. /package/dist/{scss → css}/recipes/16six-sidebar.css +0 -0
  52. /package/dist/{scss → css}/recipes/domains-sidebar.css +0 -0
@@ -1,21 +1,25 @@
1
1
  @import 'https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wdth,wght@0,62.5..100,100..900;1,62.5..100,100..900&family=Noto+Serif:ital,wdth,wght@0,62.5..100,100..900;1,62.5..100,100..900&display=swap';
2
2
 
3
- // Noto Sans supports:
4
- // font-weight: {anything between 100 and 900}
5
- // font-stretch: {anything between 62.5% and 100%}
6
- // font-style: {normal or italic}
3
+ /*
4
+ Noto Sans supports:
5
+ font-weight: {anything between 100 and 900}
6
+ font-stretch: {anything between 62.5% and 100%}
7
+ font-style: {normal or italic}
8
+ */
7
9
 
8
- // Noto Serif supports:
9
- // font-weight: {anything between 100 and 900}
10
- // font-stretch: {anything between 62.5% and 100%}
11
- // font-style: {normal or italic}
10
+ /*
11
+ Noto Serif supports:
12
+ font-weight: {anything between 100 and 900}
13
+ font-stretch: {anything between 62.5% and 100%}
14
+ font-style: {normal or italic}
15
+ */
12
16
 
13
- // Using Mixins allows us to include them at a component level
14
- // as needed and override them.
17
+ :root {
18
+ /* Color HSLs
19
+ A theme comprised of a primary, neutral, warning, danger, info, and notice colors.
20
+ */
15
21
 
16
- // A theme comprised of a primary, neutral, warning, danger, info, and notice colors.
17
- @mixin color-varieties {
18
- // Basic Colors
22
+ /* Basic Colors */
19
23
 
20
24
  /**
21
25
  * @tokens Basic Colors
@@ -71,9 +75,7 @@
71
75
  --op-color-alerts-notice-h: 130;
72
76
  --op-color-alerts-notice-s: 61%;
73
77
  --op-color-alerts-notice-l: 64%;
74
- }
75
78
 
76
- @mixin opacities {
77
79
  /**
78
80
  * @tokens Opacities
79
81
  * @presenter Opacity
@@ -83,35 +85,28 @@
83
85
  --op-opacity-disabled: 0.4;
84
86
  --op-opacity-half: 0.5;
85
87
  --op-opacity-full: 1;
86
- }
87
88
 
88
- /*
89
- Breakpoints
90
- CSS does not support using variables within @media or @container queries. Environment variables are drafted but likely to not be implemented soon.
91
- https://drafts.csswg.org/css-env-1/
92
- https://bholmes.dev/blog/alternative-to-css-variable-media-queries/
93
-
94
- Here is a list of breakpoints used throughout Optics
95
-
96
- --op-breakpoint-x-small: 512px;
97
- --op-breakpoint-small: 768px;
98
- --op-breakpoint-medium: 1024px;
99
- --op-breakpoint-large: 1280px;
100
- --op-breakpoint-x-large: 1440px;
101
- */
102
- @mixin breakpoints {
89
+ /*
90
+ Breakpoints
91
+ CSS does not support using variables within @media or @container queries. Environment variables are drafted but likely to not be implemented soon.
92
+ https://drafts.csswg.org/css-env-1/
93
+ https://bholmes.dev/blog/alternative-to-css-variable-media-queries/
94
+
95
+ Here is a list of breakpoints used throughout Optics:
96
+ */
97
+
103
98
  /**
104
99
  * @tokens Breakpoints
105
100
  * @presenter Spacing
106
101
  */
107
- --op-breakpoint-x-small: 512px; // vertical phone
108
- --op-breakpoint-small: 768px; // vertical ipad
109
- --op-breakpoint-medium: 1024px; // landscape ipad
110
- --op-breakpoint-large: 1280px; // small laptop
111
- --op-breakpoint-x-large: 1440px; // medium laptop
112
- }
102
+ --op-breakpoint-x-small: 512px; /* vertical phone */
103
+ --op-breakpoint-small: 768px; /* vertical ipad */
104
+ --op-breakpoint-medium: 1024px; /* landscape ipad */
105
+ --op-breakpoint-large: 1280px; /* small laptop */
106
+ --op-breakpoint-x-large: 1440px; /* medium laptop */
107
+
108
+ /* Border */
113
109
 
114
- @mixin border-radius {
115
110
  /**
116
111
  * @tokens Border Radius
117
112
  * @presenter BorderRadius
@@ -123,9 +118,7 @@
123
118
  --op-radius-2x-large: 16px;
124
119
  --op-radius-circle: 50%;
125
120
  --op-radius-pill: 9999px;
126
- }
127
121
 
128
- @mixin border-widths {
129
122
  /**
130
123
  * @tokens Border Width
131
124
  * @presenter Spacing
@@ -133,18 +126,14 @@
133
126
  --op-border-width: 1px;
134
127
  --op-border-width-large: 2px;
135
128
  --op-border-width-x-large: 4px;
136
- }
137
129
 
138
- @mixin border-colors {
139
130
  /**
140
131
  * @tokens Border Color
141
132
  * @presenter Color
142
133
  */
143
134
  --op-color-border: var(--op-color-neutral-plus-five);
144
- }
145
135
 
146
- @mixin box-shadows {
147
- // E.G. box-shadow: var(--op-border-top) var(--op-color-border);
136
+ /* E.G. box-shadow: var(--op-border-top) var(--op-color-border); */
148
137
 
149
138
  /**
150
139
  * @tokens Border Shadow
@@ -158,28 +147,26 @@
158
147
  --op-border-left: calc(-1 * var(--op-border-width)) 0 0 0;
159
148
  --op-border-y: var(--op-border-top) var(--op-color-border), var(--op-border-bottom) var(--op-color-border);
160
149
  --op-border-x: var(--op-border-left) var(--op-color-border), var(--op-border-right) var(--op-color-border);
161
- }
162
150
 
163
- @mixin font-scales {
151
+ /* Font */
152
+
164
153
  /**
165
154
  * @tokens Font Scale
166
155
  * @presenter FontSize
167
156
  */
168
- --op-font-scale-unit: 1rem; // 10px;
169
- --op-font-2x-small: calc(var(--op-font-scale-unit) * 1); // 10px
170
- --op-font-x-small: calc(var(--op-font-scale-unit) * 1.2); // 12px
171
- --op-font-small: calc(var(--op-font-scale-unit) * 1.4); // 14px
172
- --op-font-medium: calc(var(--op-font-scale-unit) * 1.6); // 16px
173
- --op-font-large: calc(var(--op-font-scale-unit) * 1.8); // 18px
174
- --op-font-x-large: calc(var(--op-font-scale-unit) * 2); // 20px
175
- --op-font-2x-large: calc(var(--op-font-scale-unit) * 2.4); // 24px
176
- --op-font-3x-large: calc(var(--op-font-scale-unit) * 2.8); // 28px
177
- --op-font-4x-large: calc(var(--op-font-scale-unit) * 3.2); // 32px
178
- --op-font-5x-large: calc(var(--op-font-scale-unit) * 3.6); // 36px
179
- --op-font-6x-large: calc(var(--op-font-scale-unit) * 4.8); // 48px
180
- }
157
+ --op-font-scale-unit: 1rem; /* 10px; */
158
+ --op-font-2x-small: calc(var(--op-font-scale-unit) * 1); /* 10px */
159
+ --op-font-x-small: calc(var(--op-font-scale-unit) * 1.2); /* 12px */
160
+ --op-font-small: calc(var(--op-font-scale-unit) * 1.4); /* 14px */
161
+ --op-font-medium: calc(var(--op-font-scale-unit) * 1.6); /* 16px */
162
+ --op-font-large: calc(var(--op-font-scale-unit) * 1.8); /* 18px */
163
+ --op-font-x-large: calc(var(--op-font-scale-unit) * 2); /* 20px */
164
+ --op-font-2x-large: calc(var(--op-font-scale-unit) * 2.4); /* 24px */
165
+ --op-font-3x-large: calc(var(--op-font-scale-unit) * 2.8); /* 28px */
166
+ --op-font-4x-large: calc(var(--op-font-scale-unit) * 3.2); /* 32px */
167
+ --op-font-5x-large: calc(var(--op-font-scale-unit) * 3.6); /* 36px */
168
+ --op-font-6x-large: calc(var(--op-font-scale-unit) * 4.8); /* 48px */
181
169
 
182
- @mixin font-weights {
183
170
  /**
184
171
  * @tokens Font Weight
185
172
  * @presenter FontWeight
@@ -193,9 +180,16 @@
193
180
  --op-font-weight-bold: 700;
194
181
  --op-font-weight-extra-bold: 800;
195
182
  --op-font-weight-black: 900;
196
- }
197
183
 
198
- @mixin line-heights {
184
+ /**
185
+ * @tokens Font Family
186
+ * @presenter FontFamily
187
+ */
188
+ --op-font-family: 'Noto Sans', sans-serif;
189
+ --op-font-family-alt: 'Noto Serif', serif;
190
+
191
+ /* Text */
192
+
199
193
  /**
200
194
  * @tokens Line Height
201
195
  * @presenter LineHeight
@@ -208,18 +202,16 @@
208
202
  --op-line-height-loose: 1.6;
209
203
  --op-line-height-looser: 1.7;
210
204
  --op-line-height-loosest: 1.8;
211
- }
212
205
 
213
- @mixin letter-spacing {
214
206
  /**
215
207
  * @tokens Letter Spacing
216
208
  * @presenter LetterSpacing
217
209
  */
218
210
  --op-letter-spacing-navigation: 0.01rem;
219
211
  --op-letter-spacing-label: 0.04rem;
220
- }
221
212
 
222
- @mixin transitions {
213
+ /* Transitions and Animations */
214
+
223
215
  /**
224
216
  * @tokens Transition
225
217
  */
@@ -229,60 +221,50 @@
229
221
  --op-transition-modal: all 300ms ease-in;
230
222
  --op-transition-panel: right 400ms ease-in;
231
223
  --op-transition-tooltip: all 300ms ease-in 300ms;
232
- }
233
224
 
234
- @mixin animations {
235
225
  /**
236
226
  * @tokens Animation
237
227
  * @presenter Animation
238
228
  */
239
229
  --op-animation-flash: rm-slide-in-out-flash 5s normal forwards;
240
- }
241
230
 
242
- @mixin encoded-images {
231
+ /* Encoded Images */
232
+
243
233
  /**
244
234
  * @tokens Encoded Images
245
235
  */
246
- --op-encoded-images-dropdown-arrow-width: calc(1.2 * var(--op-space-scale-unit)); // 12px No way to string interpolate
236
+ --op-encoded-images-dropdown-arrow-width: calc(
237
+ 1.2 * var(--op-space-scale-unit)
238
+ ); /* 12px No way to string interpolate */
239
+
247
240
  --op-encoded-images-dropdown-arrow: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik02IDguMzc1MDFMMCAyLjM3NTAxTDEuNCAwLjk3NTAwNkw2IDUuNTc1MDFMMTAuNiAwLjk3NTAwNkwxMiAyLjM3NTAxTDYgOC4zNzUwMVoiIGZpbGw9IiMwQTBBMEIiLz4KPC9zdmc+Cg==');
248
- }
249
241
 
250
- @mixin fonts {
251
- /**
252
- * @tokens Font Family
253
- * @presenter FontFamily
254
- */
255
- --op-font-family: 'Noto Sans', sans-serif;
256
- --op-font-family-alt: 'Noto Serif', serif;
257
- }
242
+ /* Spacing */
258
243
 
259
- @mixin spacing-scales {
260
244
  /**
261
- * @tokens Space Scale
245
+ * @tokens Size Scale
262
246
  * @presenter Spacing
263
247
  */
264
- --op-space-scale-unit: 1rem; // 10px;
265
- --op-space-3x-small: calc(var(--op-space-scale-unit) * 0.2); // 2px
266
- --op-space-2x-small: calc(var(--op-space-scale-unit) * 0.4); // 4px
267
- --op-space-x-small: calc(var(--op-space-scale-unit) * 0.8); // 8px
268
- --op-space-small: calc(var(--op-space-scale-unit) * 1.2); // 12px
269
- --op-space-medium: calc(var(--op-space-scale-unit) * 1.6); // 16px
270
- --op-space-large: calc(var(--op-space-scale-unit) * 2); // 20px
271
- --op-space-x-large: calc(var(--op-space-scale-unit) * 2.4); // 24px
272
- --op-space-2x-large: calc(var(--op-space-scale-unit) * 2.8); // 28px
273
- --op-space-3x-large: calc(var(--op-space-scale-unit) * 4); // 40px
274
- --op-space-4x-large: calc(var(--op-space-scale-unit) * 8); // 80px
275
- }
248
+ --op-size-unit: 0.4rem; /* 4px */
276
249
 
277
- @mixin sizing-scales {
278
250
  /**
279
- * @tokens Size Scale
251
+ * @tokens Space Scale
280
252
  * @presenter Spacing
281
253
  */
282
- --op-size-unit: 0.4rem; // 4px;
283
- }
254
+ --op-space-scale-unit: 1rem; /* 10px; */
255
+ --op-space-3x-small: calc(var(--op-space-scale-unit) * 0.2); /* 2px */
256
+ --op-space-2x-small: calc(var(--op-space-scale-unit) * 0.4); /* 4px */
257
+ --op-space-x-small: calc(var(--op-space-scale-unit) * 0.8); /* 8px */
258
+ --op-space-small: calc(var(--op-space-scale-unit) * 1.2); /* 12px */
259
+ --op-space-medium: calc(var(--op-space-scale-unit) * 1.6); /* 16px */
260
+ --op-space-large: calc(var(--op-space-scale-unit) * 2); /* 20px */
261
+ --op-space-x-large: calc(var(--op-space-scale-unit) * 2.4); /* 24px */
262
+ --op-space-2x-large: calc(var(--op-space-scale-unit) * 2.8); /* 28px */
263
+ --op-space-3x-large: calc(var(--op-space-scale-unit) * 4); /* 40px */
264
+ --op-space-4x-large: calc(var(--op-space-scale-unit) * 8); /* 80px */
265
+
266
+ /* Shadows */
284
267
 
285
- @mixin shadows {
286
268
  /**
287
269
  * @tokens Shadows
288
270
  * @presenter Shadow
@@ -292,9 +274,9 @@
292
274
  --op-shadow-medium: 0 4px 8px hsl(0deg 0% 0% / 15%), 0 1px 3px hsl(0deg 0% 0% / 3%);
293
275
  --op-shadow-large: 0 6px 10px hsl(0deg 0% 0% / 15%), 0 2px 3px hsl(0deg 0% 0% / 3%);
294
276
  --op-shadow-x-large: 0 8px 12px hsl(0deg 0% 0% / 15%), 0 4px 4px hsl(0deg 0% 0% / 3%);
295
- }
296
277
 
297
- @mixin z-indexes {
278
+ /* Z Index */
279
+
298
280
  /**
299
281
  * @tokens Z-Index
300
282
  */
@@ -307,20 +289,22 @@
307
289
  --op-z-index-dropdown: 900;
308
290
  --op-z-index-alert-group: 950;
309
291
  --op-z-index-tooltip: 1000;
310
- }
311
292
 
312
- @mixin inputs {
313
- // This should follow multiples of 4
314
- // https: //uxdesign.cc/baseline-grids-design-systems-ae23b5af8cec See example 8
293
+ /* Inputs */
294
+
295
+ /*
296
+ This should follow multiples of 4
297
+ https: //uxdesign.cc/baseline-grids-design-systems-ae23b5af8cec See example 8
298
+ */
315
299
 
316
300
  /**
317
301
  * @tokens Input Heights
318
302
  * @presenter Spacing
319
303
  */
320
- --op-input-height-small: 2.8rem; // 28px
321
- --op-input-height-medium: 3.6rem; // 36px
322
- --op-input-height-large: 4rem; // 40px
323
- --op-input-height-x-large: 8.4rem; // 84px
304
+ --op-input-height-small: 2.8rem; /* 28px */
305
+ --op-input-height-medium: 3.6rem; /* 36px */
306
+ --op-input-height-large: 4rem; /* 40px */
307
+ --op-input-height-x-large: 8.4rem; /* 84px */
324
308
 
325
309
  /**
326
310
  * @tokens Input Focus
@@ -342,69 +326,27 @@
342
326
  var(--op-input-outer-focus) var(--op-color-alerts-notice-plus-five);
343
327
  }
344
328
 
345
- :root {
346
- // Color HSLs
347
- @include color-varieties;
348
- @include opacities;
349
-
350
- // Breakpoints
351
- @include breakpoints;
352
-
353
- // Border
354
- @include border-radius;
355
- @include border-widths;
356
- @include border-colors;
357
- @include box-shadows;
358
-
359
- // Font
360
- @include font-scales;
361
- @include font-weights;
362
- @include fonts;
363
-
364
- // Text
365
- @include line-heights;
366
- @include letter-spacing;
367
-
368
- // Transitions and Animations
369
- @include transitions;
370
- @include animations;
371
-
372
- // Encoded Images
373
- @include encoded-images;
374
-
375
- // Spacing
376
- @include sizing-scales;
377
- @include spacing-scales;
378
-
379
- // Shadows
380
- @include shadows;
381
-
382
- // Z Index
383
- @include z-indexes;
384
-
385
- // Inputs
386
- @include inputs;
387
- }
388
-
389
- // Animations
329
+ /* Animations */
390
330
  @keyframes rm-slide-in-out-flash {
391
- // If an duration of 5s is set:
392
- // Start off the Screen
331
+ /*
332
+ If an duration of 5s is set:
333
+ Start off the Screen
334
+ */
393
335
  0% {
394
336
  right: -100%;
395
337
  }
396
338
 
397
- // Animate onto the screen for 0.5s
339
+ /* Animate onto the screen for 0.5s */
398
340
  10% {
399
341
  right: var(--op-space-large);
400
342
  }
401
343
 
402
- // Stay on the screen for 3s
344
+ /* Stay on the screen for 3s */
403
345
  70% {
404
346
  right: var(--op-space-large);
405
347
  }
406
348
 
407
- // Animate off the screen for 1.5s
349
+ /* Animate off the screen for 1.5s */
408
350
  100% {
409
351
  right: -100%;
410
352
  }
@@ -1,3 +1,2 @@
1
1
  @import 'base_tokens';
2
2
  @import 'scale_color_tokens';
3
- @import 'dark_mode_tokens';