claritas-web-framework 7.0.0 → 8.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 (66) hide show
  1. package/dist/index.css +276 -1
  2. package/dist/index.html +1 -1
  3. package/index.html +11 -6
  4. package/index.js +1 -1
  5. package/package.json +9 -5
  6. package/sass/_functions.scss +3 -145
  7. package/sass/_mixins.scss +0 -5
  8. package/sass/_reboot.scss +72 -410
  9. package/sass/_root.scss +11 -1
  10. package/sass/_variables.scss +120 -219
  11. package/sass/helpers/_grid.scss +11 -15
  12. package/sass/{_index.scss → index.scss} +2 -0
  13. package/sass/mixins/_button.scss +124 -232
  14. package/sass/mixins/_caret.scss +17 -10
  15. package/sass/mixins/_colors.scss +1 -1
  16. package/sass/mixins/_gradient.scss +0 -8
  17. package/sass/mixins/_group.scss +2 -2
  18. package/sass/mixins/_list.scss +1 -1
  19. package/sass/modules/_alert.scss +8 -8
  20. package/sass/modules/_breadcrumbs.scss +3 -3
  21. package/sass/modules/_button.scss +72 -96
  22. package/sass/modules/_card.scss +41 -56
  23. package/sass/modules/_close.scss +20 -10
  24. package/sass/modules/_details.scss +7 -25
  25. package/sass/modules/_dialog.scss +5 -5
  26. package/sass/modules/_dropdown.scss +28 -56
  27. package/sass/modules/_form.scss +167 -39
  28. package/sass/modules/_list.scss +19 -17
  29. package/sass/modules/_loader.scss +36 -36
  30. package/sass/modules/_nav.scss +92 -67
  31. package/sass/modules/_pill.scss +9 -22
  32. package/sass/modules/_table.scss +4 -4
  33. package/sass/modules/_tabs.scss +34 -57
  34. package/sass/modules/_tag.scss +11 -23
  35. package/sass/modules/_tile.scss +7 -7
  36. package/sass/modules/_tooltip.scss +13 -11
  37. package/sass/modules/form/_checkbox.scss +20 -21
  38. package/sass/modules/form/_file.scss +30 -25
  39. package/sass/modules/form/_formFieldGroup.scss +25 -37
  40. package/sass/modules/form/_output.scss +1 -1
  41. package/sass/modules/form/_progress.scss +20 -33
  42. package/sass/modules/form/_radio.scss +15 -39
  43. package/sass/modules/form/_range.scss +76 -24
  44. package/sass/modules/form/_select.scss +5 -5
  45. package/sass/modules/form/_switch.scss +1 -1
  46. package/sass/modules/form/_text.scss +20 -17
  47. package/sass/modules/form/_textarea.scss +1 -1
  48. package/sass/modules/form/_toggle.scss +23 -52
  49. package/webpack.config.js +5 -22
  50. package/webpack.plugins.js +15 -0
  51. package/webpack.rules.js +8 -0
  52. package/images/block.svg +0 -3
  53. package/images/check.svg +0 -3
  54. package/images/chevron-down.svg +0 -1
  55. package/images/menu.svg +0 -3
  56. package/images/remove.svg +0 -3
  57. package/images/subdirectory.svg +0 -3
  58. package/images/upload.svg +0 -3
  59. package/sass/mixins/_borderRadius.scss +0 -79
  60. package/sass/mixins/_boxShadow.scss +0 -22
  61. package/sass/mixins/_colors.temp.scss +0 -89
  62. package/sass/mixins/_pill.scss +0 -14
  63. package/sass/mixins/_rfs.scss +0 -297
  64. package/sass/mixins/_tag.scss +0 -52
  65. package/sass/mixins/_transition.scss +0 -27
  66. package/sass/modules/_button.old.scss +0 -215
package/sass/_reboot.scss CHANGED
@@ -3,159 +3,99 @@
3
3
  @use "./variables" as *;
4
4
  @use "./mixins" as *;
5
5
 
6
- // Reboot
7
- // Normalization of HTML elements, manually forked from Normalize.css to remove
8
- // styles targeting irrelevant browsers while applying new styles.
9
- // Normalize is licensed MIT. https://github.com/necolas/normalize.css
10
-
11
- // Document
12
- // Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
13
-
14
- *,
15
- *::before,
16
- *::after {
17
- box-sizing: border-box;
18
- }
19
-
20
- // Root
21
- // Ability to the value of the root font sizes, affecting the value of `rem`.
22
- // null by default, thus nothing is generated.
23
-
24
- :root {
25
- @if $font-size-root {
26
- @include font-size(var(--root-font-size));
27
- }
28
-
29
- @if $enable-smooth-scroll {
30
- @media (prefers-reduced-motion: no-preference) {
31
- scroll-behavior: smooth;
32
- }
33
- }
34
- }
35
-
36
- // Body
37
- // 1. Remove the margin in all browsers.
38
- // 2. As a best practice, apply a default `background-color`.
39
- // 3. Prevent adjustments of font size after orientation changes in iOS.
40
- // 4. Change the default tap highlight to be completely transparent in iOS.
41
-
42
- // scss-docs-start reboot-body-rules
43
6
  body {
44
- margin: 0; // 1
45
7
  font-family: var(--font-family-body);
46
-
47
- @include font-size(var(--font-size-body));
48
-
8
+ font-size: var(--font-size-body);
49
9
  font-weight: var(--font-weight-body);
50
10
  line-height: var(--line-height-body);
51
11
  color: var(--body-color);
52
12
  text-align: var(--body-text-align);
53
- background-color: var(--body-background); // 2
54
- text-size-adjust: 100%; // 3
55
- -webkit-tap-highlight-color: transparent; // 4
13
+ background-color: var(--body-background);
14
+ text-size-adjust: 100%;
15
+ -webkit-tap-highlight-color: transparent;
56
16
  width: 100vw;
57
17
  }
58
18
 
59
- // scss-docs-end reboot-body-rules
60
-
61
- // Content grouping
62
- // 1. Reset Firefox's gray color
63
-
64
19
  hr {
65
- margin: $hr-margin-y $hr-margin-x;
20
+ margin: 1rem 0;
66
21
  border: 0;
67
- border-top: $hr-border-width $hr-border-style
68
- rgb(
69
- #{color.red($hr-border-color)} #{color.green($hr-border-color)} #{color.blue($hr-border-color)} / $hr-border-opacity
70
- );
71
- color: $hr-color;
72
- background-color: $hr-background-color;
73
- height: $hr-height;
74
- }
75
-
76
- // Typography
77
- // 1. Remove top margins from headings
78
- // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
79
- // margin for easier control within type scales as it avoids margin collapsing.
80
-
81
- @mixin make-heading($size) {
82
- --color: #{$headings-color};
83
- --font-style: #{$headings-font-style};
84
- --font-weight: #{$headings-font-weight};
85
- --line-height: #{$headings-line-height};
86
- --font-size: var(--font-size-#{$size});
87
-
88
- @if $headings-font-family {
89
- --font-family: #{$headings-font-family};
90
-
91
- font-family: var(--font-family);
92
- }
93
-
94
- @if $headings-font-style {
95
- --font-style: #{$headings-font-style};
96
-
97
- font-style: var(--font-style);
98
- }
22
+ border-top: 1px solid hsl(var(--border-color-h) var(--border-color-s) var(--border-color-l) / $border-opacity);
23
+ }
99
24
 
100
- color: var(--color);
101
- font-weight: var(--font-weight);
102
- font-size: var(--font-size);
103
- line-height: var(--line-height);
25
+ %heading {
104
26
  margin-top: 0;
27
+ font-family: $headings-font-family;
28
+ font-style: $headings-font-style;
29
+ font-weight: $headings-font-weight;
30
+ line-height: $headings-line-height;
31
+ color: $headings-color;
105
32
 
106
33
  @if $enable-margins {
107
- margin-bottom: calc(var(--spacer) * 0.5);
34
+ margin-bottom: 0.5rem;
108
35
  } @else {
109
36
  margin-bottom: 0;
110
37
  }
111
38
  }
112
39
 
113
- @each $key in (1, 2, 3, 4, 5, 6) {
114
- h#{$key},
115
- .h#{$key} {
116
- @include make-heading($key);
117
- }
40
+ h1 {
41
+ @extend %heading;
42
+ font-size: var(--font-size-1);
43
+ }
44
+
45
+ h2 {
46
+ @extend %heading;
47
+ font-size: var(--font-size-2);
48
+ }
49
+
50
+ h3 {
51
+ @extend %heading;
52
+ font-size: var(--font-size-3);
53
+ }
54
+
55
+ h4 {
56
+ @extend %heading;
57
+ font-size: var(--font-size-4);
58
+ }
59
+
60
+ h5 {
61
+ @extend %heading;
62
+ font-size: var(--font-size-5);
63
+ }
64
+
65
+ h6 {
66
+ @extend %heading;
67
+ font-size: var(--font-size-6);
118
68
  }
119
69
 
120
70
  p {
121
71
  margin-top: 0;
122
72
 
123
73
  @if $enable-margins {
124
- margin-bottom: calc(var(--spacer) * 0.5);
74
+ margin-bottom: 0.5rem;
125
75
  } @else {
126
76
  margin-bottom: 0;
127
77
  }
128
78
  }
129
79
 
130
- // Abbreviations
131
- // 1. Add the correct text decoration in Chrome, Edge, Opera, and Safari.
132
- // 2. Add explicit cursor to indicate changed behavior.
133
- // 3. Prevent the text-decoration to be skipped.
134
-
135
80
  abbr[title] {
136
- text-decoration: underline dotted; // 1
137
- cursor: help; // 2
138
- text-decoration-skip-ink: none; // 3
81
+ cursor: help;
82
+ text-decoration-skip-ink: none;
139
83
  }
140
84
 
141
- // Address
142
-
143
85
  address {
144
86
  font-style: normal;
145
87
  line-height: inherit;
146
88
 
147
89
  @if $enable-margins {
148
- margin-bottom: var(--spacer);
90
+ margin-bottom: 1rem;
149
91
  } @else {
150
92
  margin-bottom: 0;
151
93
  }
152
94
  }
153
95
 
154
- // Lists
155
-
156
96
  ol,
157
97
  ul {
158
- padding-left: calc(var(--spacer) * 2);
98
+ padding-left: 2rem;
159
99
  }
160
100
 
161
101
  ol,
@@ -164,7 +104,7 @@ dl {
164
104
  margin-top: 0;
165
105
 
166
106
  @if $enable-margins {
167
- margin-bottom: var(--spacer);
107
+ margin-bottom: 1rem;
168
108
  } @else {
169
109
  margin-bottom: 0;
170
110
  }
@@ -178,82 +118,25 @@ ul ol {
178
118
  }
179
119
 
180
120
  dt {
181
- font-weight: $dt-font-weight;
121
+ font-weight: bolder;
182
122
  }
183
123
 
184
- // 1. Undo browser default
185
-
186
124
  dd {
187
- margin-bottom: calc(var(--spacer) * 0.5);
188
- margin-left: 0; // 1
125
+ margin-bottom: 0.5rem;
126
+ margin-left: 0;
189
127
  }
190
128
 
191
- // Blockquote
192
-
193
- blockquote {
194
- margin: 0 0 var(--spacer);
195
- }
196
-
197
- // Strong
198
- // Add the correct font weight in Chrome, Edge, and Safari
199
-
200
- b,
201
- strong {
202
- font-weight: $font-weight-bolder;
203
- }
204
-
205
- // Small
206
- // Add the correct font size in all browsers
207
-
208
- small {
209
- @include font-size($font-size-small);
210
- }
211
-
212
- // Mark
213
-
214
- mark {
215
- padding: $mark-padding;
216
- background-color: var(--highlight-background);
217
- }
218
-
219
- // Sub and Sup
220
- // Prevent `sub` and `sup` elements from affecting the line height in
221
- // all browsers.
222
-
223
- sub,
224
- sup {
225
- position: relative;
226
-
227
- @include font-size($font-size-sub-sup);
228
-
229
- line-height: 0;
230
- vertical-align: baseline;
231
- }
232
-
233
- sub {
234
- bottom: -0.25em;
235
- }
236
-
237
- sup {
238
- top: -0.5em;
239
- }
240
-
241
- // Links
242
- a:not(.button) {
129
+ a {
130
+ color: hsl(var(--primary-h) var(--primary-s) var(--primary-l) / 100%);
243
131
  text-decoration: $link-decoration;
244
- color: hsl(var(--primary-h) var(--primary-s) var(--primary-l) / var(--primary-a));
245
132
 
246
133
  &:hover {
134
+ color: hsl(var(--primary-h) var(--primary-s) calc(var(--primary-l) - #{$link-shade-percentage}) / 100%);
247
135
  text-decoration: $link-hover-decoration;
248
- color: hsl(var(--primary-h) var(--primary-s) calc(var(--primary-l) - #{$link-shade-percentage}) / var(--primary-a));
249
136
  }
250
137
  }
251
138
 
252
- // And undo these styles for placeholder links/named anchors (without href).
253
- // It would be more straightforward to just use a[href] in previous block, but that
254
- // causes specificity issues in many other styles that are too complex to fix.
255
-
256
- a:not([href], [class]) {
139
+ a:not([href]):not([class]) {
257
140
  &,
258
141
  &:hover {
259
142
  color: inherit;
@@ -261,91 +144,15 @@ a:not([href], [class]) {
261
144
  }
262
145
  }
263
146
 
264
- // Code
265
-
266
- pre,
267
- code,
268
- kbd,
269
- samp {
270
- font-family: $font-family-monospace;
271
-
272
- @include font-size(1em); // Correct the odd `em` font sizing in all browsers.
273
- }
274
-
275
- // 1. Remove browser default top margin
276
- // 2. Reset browser default of `1em` to use `rem`s
277
- // 3. Don't allow content to break outside
278
-
279
- code {
280
- @include font-size($font-size-code);
281
-
282
- color: var(--code-color);
283
- word-wrap: break-word;
284
-
285
- // Streamline the style when inside anchors to avoid broken underline and more
286
- a > & {
287
- color: inherit;
288
- }
289
- }
290
-
291
- pre {
292
- display: block;
293
- margin-top: 0; // 1
294
- overflow: auto; // 3
295
-
296
- @include font-size($font-size-code);
297
-
298
- color: $pre-color;
299
-
300
- @if $enable-margins {
301
- margin-bottom: var(--spacer);
302
- } @else {
303
- margin-bottom: 0;
304
- }
305
-
306
- // Account for some code outputs that place code tags in pre tags
307
- code {
308
- @include font-size(inherit);
309
-
310
- color: inherit;
311
- word-break: normal;
312
- }
313
- }
314
-
315
- kbd {
316
- padding: $kbd-padding-y $kbd-padding-x;
317
-
318
- @include font-size($kbd-font-size);
319
-
320
- color: $kbd-color;
321
- background-color: $kbd-background;
322
-
323
- @include border-radius($border-radius-small);
324
-
325
- kbd {
326
- padding: 0;
327
-
328
- @include font-size(1em);
329
- }
330
- }
331
-
332
- // Figures
333
- // Apply a consistent margin strategy (matches our type styles).
334
-
335
147
  figure {
336
- margin: 0 0 var(--spacer);
148
+ margin: 0 0 1rem;
337
149
  }
338
150
 
339
- // Images and content
340
-
341
151
  img,
342
152
  svg {
343
153
  vertical-align: middle;
344
154
  }
345
155
 
346
- // Tables
347
- // Prevent double borders
348
-
349
156
  table {
350
157
  caption-side: bottom;
351
158
  border-collapse: collapse;
@@ -358,14 +165,10 @@ caption {
358
165
  text-align: left;
359
166
  }
360
167
 
361
- // 1. Removes font-weight bold by inheriting
362
- // 2. Matches default `<td>` alignment by inheriting `text-align`.
363
- // 3. Fix alignment for Safari
364
-
365
168
  th {
366
- font-weight: $table-th-font-weight; // 1
367
- text-align: inherit; // 2
368
- text-align: -webkit-match-parent; // 3
169
+ font-weight: $table-th-font-weight;
170
+ text-align: inherit;
171
+ text-align: -webkit-match-parent;
369
172
  }
370
173
 
371
174
  thead,
@@ -379,143 +182,59 @@ th {
379
182
  border-width: 0;
380
183
  }
381
184
 
382
- // Forms
383
- // 1. Allow labels to use `margin` for spacing.
384
-
385
185
  label {
386
- display: inline-block; // 1
186
+ display: inline-block;
387
187
  }
388
188
 
389
- // Remove the default `border-radius` that macOS Chrome adds.
390
-
391
189
  button {
392
190
  border-radius: 0;
393
191
  }
394
192
 
395
- // Explicitly remove focus outline in Chromium when it shouldn't be
396
- // visible (e.g. as result of mouse click or touch tap). It already
397
- // should be doing this automatically, but seems to currently be
398
- // confused and applies its very visible two-tone outline anyway.
399
-
400
- // 1. Remove the margin in Firefox and Safari
401
-
402
- input,
403
- button,
404
- select,
405
- optgroup,
406
- textarea {
407
- margin: 0; // 1
408
- font-family: inherit;
409
-
410
- @include font-size(inherit);
411
-
412
- line-height: inherit;
413
- }
414
-
415
- // Remove the inheritance of text transform in Firefox
416
- button,
417
- select {
418
- text-transform: none;
419
- }
420
-
421
- // Set the cursor for non-`<button>` buttons
422
193
  [role="button"] {
423
194
  cursor: pointer;
424
195
  }
425
196
 
426
197
  select {
427
- // Remove the inheritance of word-wrap in Safari.
428
198
  word-wrap: normal;
429
199
 
430
- // Undo the opacity change from Chrome
431
200
  &:disabled {
432
201
  opacity: 1;
433
202
  }
434
203
  }
435
204
 
436
- // Remove the dropdown arrow only from text type inputs built with datalists in Chrome.
437
- // See https://stackoverflow.com/a/54997118
438
-
439
- [list]:not(
440
- [type="date"],
441
- [type="datetime-local"],
442
- [type="month"],
443
- [type="week"],
205
+ [list]:not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not(
444
206
  [type="time"]
445
207
  )::-webkit-calendar-picker-indicator {
446
208
  display: none !important;
447
209
  }
448
210
 
449
- // 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
450
- // controls in Android 4.
451
- // 2. Correct the inability to style clickable types in iOS and Safari.
452
- // 3. Opinionated: add "hand" cursor to non-disabled button elements.
453
-
454
- button,
455
- [type="button"], // 1
456
- [type="reset"],
457
- [type="submit"] {
458
- appearance: button; // 2
459
-
460
- @if $enable-button-pointers {
461
- &:not(:disabled) {
462
- cursor: pointer; // 3
463
- }
464
- }
465
- }
466
-
467
211
  button:focus:not(:focus-visible) {
468
212
  outline: 0;
469
213
  }
470
214
 
471
- // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
472
-
473
- ::-moz-focus-inner {
474
- padding: 0;
475
- border-style: none;
476
- }
477
-
478
- // 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
479
-
480
215
  textarea {
481
- resize: vertical; // 1
216
+ resize: vertical;
482
217
  }
483
218
 
484
- // 1. Browsers set a default `min-width: min-content;` on fieldsets,
485
- // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
486
- // So we reset that to ensure fieldsets behave more like a standard block element.
487
- // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
488
- // 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
489
-
490
219
  fieldset {
491
- min-width: 0; // 1
492
- padding: 0; // 2
493
- margin: 0; // 2
494
- border: 0; // 2
220
+ min-width: 0;
221
+ padding: 0;
222
+ margin: 0;
223
+ border: 0;
495
224
  }
496
225
 
497
- // 1. By using `float: left`, the legend will behave like a block element.
498
- // This way the border of a fieldset wraps around the legend if present.
499
- // 2. Fix wrapping bug.
500
-
501
226
  legend {
502
- float: left; // 1
227
+ float: left;
503
228
  width: 100%;
504
- padding: 0;
505
- margin-bottom: $legend-margin-bottom;
506
-
507
- @include font-size($legend-font-size);
508
-
509
- font-weight: $legend-font-weight;
229
+ margin-bottom: 0.5rem;
230
+ font-size: var(--font-size-5);
510
231
  line-height: inherit;
511
232
 
512
233
  + * {
513
- clear: left; // 2
234
+ clear: left;
514
235
  }
515
236
  }
516
237
 
517
- // Fix height of inputs with a type of datetime-local, date, month, week, or time
518
-
519
238
  ::-webkit-datetime-edit-fields-wrapper,
520
239
  ::-webkit-datetime-edit-text,
521
240
  ::-webkit-datetime-edit-minute,
@@ -526,84 +245,27 @@ legend {
526
245
  padding: 0;
527
246
  }
528
247
 
529
- ::-webkit-inner-spin-button {
530
- height: auto;
531
- }
532
-
533
- // 1. Correct the outline style in Safari.
534
- // 2. This overrides the extra rounded corners on search inputs in iOS so that our
535
- // `.form-control` class can properly style them. Note that this cannot simply
536
- // be added to `.form-control` as it's not specific enough. For details, see
537
-
538
- [type="search"] {
539
- outline-offset: -2px; // 1
540
- appearance: textfield; // 2
541
- }
542
-
543
- // 1. A few input types should stay LTR
544
- // See https://rtlstyling.com/posts/rtl-styling#form-inputs
545
- // 2. RTL only output
546
- // See https://rtlcss.com/learn/usage-guide/control-directives/#raw
547
-
548
- /* rtl:raw:
549
- [type="tel"],
550
- [type="url"],
551
- [type="email"],
552
- [type="number"] {
553
- direction: ltr;
554
- }
555
- */
556
-
557
- // Remove the inner padding in Chrome and Safari on macOS.
558
-
559
- ::-webkit-search-decoration {
560
- appearance: none;
561
- }
562
-
563
- // Remove padding around color pickers in webkit browsers
564
-
565
248
  ::-webkit-color-swatch-wrapper {
566
249
  padding: 0;
567
250
  }
568
251
 
569
- // 1. Inherit font family and line height for file input buttons
570
- // 2. Correct the inability to style clickable types in iOS and Safari.
571
-
572
252
  ::file-selector-button {
573
- font: inherit; // 1
574
- appearance: button; // 2
253
+ font: inherit;
254
+ appearance: button;
575
255
  }
576
256
 
577
- // Correct element displays
578
-
579
257
  output {
580
258
  display: inline-block;
581
259
  }
582
260
 
583
- // Remove border from iframe
584
-
585
261
  iframe {
586
262
  border: 0;
587
263
  }
588
264
 
589
- // Summary
590
- // 1. Add the correct display in all browsers
591
-
592
265
  summary {
593
- display: list-item; // 1
594
266
  cursor: pointer;
595
267
  }
596
268
 
597
- // Progress
598
- // Add the correct vertical alignment in Chrome, Firefox, and Opera.
599
-
600
- progress {
601
- vertical-align: baseline;
602
- }
603
-
604
- // Hidden attribute
605
- // Always hide an element with the `hidden` HTML attribute.
606
-
607
269
  [hidden] {
608
270
  display: none !important;
609
271
  }
package/sass/_root.scss CHANGED
@@ -2,6 +2,16 @@
2
2
  @use "./mixins/colors" as *;
3
3
 
4
4
  :root {
5
+ @if $font-size-root {
6
+ @include font-size(var(--root-font-size));
7
+ }
8
+
9
+ @if $enable-smooth-scroll {
10
+ @media (prefers-reduced-motion: no-preference) {
11
+ scroll-behavior: smooth;
12
+ }
13
+ }
14
+
5
15
  // Colors
6
16
  // Generate palettes for full colors, grays, and theme colors.
7
17
 
@@ -21,7 +31,7 @@
21
31
  @include define-color-variables($key, $value);
22
32
  }
23
33
 
24
- @include define-color-variables("body-color", $body-color);
34
+ @include define-color-variables($title: "body-color", $color: $body-color);
25
35
  @include define-color-variables($title: "border-color", $color: $border-color-main);
26
36
 
27
37
  @each $key, $value in $zindexes {