@ulu/frontend 0.1.0-beta.3 → 0.1.0-beta.31

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 (242) hide show
  1. package/CHANGELOG.md +210 -1
  2. package/dist/ulu-frontend.min.css +1 -1
  3. package/dist/ulu-frontend.min.js +19 -18
  4. package/docs-dev/assets/main.js +832 -421
  5. package/docs-dev/assets/placeholder/icon-calendar.svg +1 -0
  6. package/docs-dev/assets/placeholder/icon-check.svg +1 -0
  7. package/docs-dev/assets/style.css +629 -233
  8. package/docs-dev/changelog/index.html +5660 -0
  9. package/docs-dev/changelog/updates-and-changes/index.html +5109 -0
  10. package/docs-dev/demos/accordion/index.html +758 -295
  11. package/docs-dev/demos/basic-hero/index.html +111 -0
  12. package/docs-dev/demos/button/index.html +758 -295
  13. package/docs-dev/demos/button-verbose/index.html +5118 -0
  14. package/docs-dev/demos/callout/index.html +783 -307
  15. package/docs-dev/demos/captioned-figure/index.html +758 -295
  16. package/docs-dev/demos/card/index.html +819 -719
  17. package/docs-dev/demos/card-grid/index.html +5241 -0
  18. package/docs-dev/demos/card-new/index.html +5088 -0
  19. package/docs-dev/demos/card-old/index.html +5223 -0
  20. package/docs-dev/demos/card.1/index.html +5223 -0
  21. package/docs-dev/demos/card.TRASH/index.html +5541 -0
  22. package/docs-dev/demos/css-icons/index.html +758 -295
  23. package/docs-dev/demos/data-grid/index.html +866 -483
  24. package/docs-dev/demos/data-table/index.html +783 -320
  25. package/docs-dev/demos/details-group/index.html +5114 -0
  26. package/docs-dev/demos/file-save/index.html +758 -295
  27. package/docs-dev/demos/flipcard/index.html +758 -295
  28. package/docs-dev/demos/form-theme/index.html +776 -326
  29. package/docs-dev/demos/hero/index.html +12 -4
  30. package/docs-dev/demos/image-grid/index.html +12 -4
  31. package/docs-dev/demos/index.html +758 -295
  32. package/docs-dev/demos/list-inline/index.html +5100 -0
  33. package/docs-dev/demos/list-inline.1/index.html +4727 -0
  34. package/docs-dev/demos/list-lines/index.html +5090 -0
  35. package/docs-dev/demos/menu-stack/index.html +777 -314
  36. package/docs-dev/demos/modals/index.html +758 -295
  37. package/docs-dev/demos/nav-strip/index.html +778 -351
  38. package/docs-dev/demos/overlay-section/index.html +758 -295
  39. package/docs-dev/demos/popovers/index.html +860 -299
  40. package/docs-dev/demos/print/index.html +758 -295
  41. package/docs-dev/demos/pull-quote/index.html +758 -295
  42. package/docs-dev/demos/rule/index.html +758 -295
  43. package/docs-dev/demos/scroll-slider/index.html +72 -106
  44. package/docs-dev/demos/scrollpoints/index.html +758 -295
  45. package/docs-dev/demos/slider/index.html +12 -4
  46. package/docs-dev/demos/spoke-spinner/index.html +758 -295
  47. package/docs-dev/demos/sticky-list/index.html +5103 -0
  48. package/docs-dev/demos/tabs/index.html +758 -295
  49. package/docs-dev/demos/tag/index.html +758 -295
  50. package/docs-dev/demos/theme-toggle/index.html +5159 -0
  51. package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
  52. package/docs-dev/demos/tiles/index.html +758 -295
  53. package/docs-dev/demos/tooltip/index.html +758 -295
  54. package/docs-dev/guide/building-stylesheet/index.html +758 -295
  55. package/docs-dev/guide/developing-ulu-scss-module/index.html +758 -295
  56. package/docs-dev/guide/index.html +758 -295
  57. package/docs-dev/guide/updates-and-changes/index.html +5033 -0
  58. package/docs-dev/index.html +758 -295
  59. package/docs-dev/javascript/events/index.html +755 -294
  60. package/docs-dev/javascript/index.html +758 -295
  61. package/docs-dev/javascript/settings/index.html +5214 -0
  62. package/docs-dev/javascript/ui-breakpoints/index.html +755 -294
  63. package/docs-dev/javascript/ui-collapsible/index.html +755 -294
  64. package/docs-dev/javascript/ui-details-group/index.html +5214 -0
  65. package/docs-dev/javascript/ui-dialog/index.html +755 -294
  66. package/docs-dev/javascript/ui-flipcard/index.html +755 -294
  67. package/docs-dev/javascript/ui-grid/index.html +755 -294
  68. package/docs-dev/javascript/ui-modal-builder/index.html +755 -294
  69. package/docs-dev/javascript/ui-overflow-scroller/index.html +755 -294
  70. package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +755 -294
  71. package/docs-dev/javascript/ui-page/index.html +755 -294
  72. package/docs-dev/javascript/ui-popover/index.html +755 -294
  73. package/docs-dev/javascript/ui-print/index.html +755 -294
  74. package/docs-dev/javascript/ui-print-details/index.html +755 -294
  75. package/docs-dev/javascript/ui-programmatic-modal/index.html +755 -294
  76. package/docs-dev/javascript/ui-proxy-click/index.html +755 -294
  77. package/docs-dev/javascript/ui-resizer/index.html +755 -294
  78. package/docs-dev/javascript/ui-scroll-slider/index.html +755 -294
  79. package/docs-dev/javascript/ui-scrollpoint/index.html +755 -294
  80. package/docs-dev/javascript/ui-slider/index.html +755 -294
  81. package/docs-dev/javascript/ui-tabs/index.html +755 -294
  82. package/docs-dev/javascript/ui-theme-toggle/index.html +5298 -0
  83. package/docs-dev/javascript/ui-tooltip/index.html +755 -294
  84. package/docs-dev/javascript/utils-class-logger/index.html +755 -294
  85. package/docs-dev/javascript/utils-dom/index.html +819 -298
  86. package/docs-dev/javascript/utils-file-save/index.html +755 -294
  87. package/docs-dev/javascript/utils-floating-ui/index.html +755 -294
  88. package/docs-dev/javascript/utils-id/index.html +755 -294
  89. package/docs-dev/javascript/utils-pause-youtube-video/index.html +755 -294
  90. package/docs-dev/sass/base/color/index.html +755 -294
  91. package/docs-dev/sass/base/elements/index.html +755 -294
  92. package/docs-dev/sass/base/index/index.html +755 -294
  93. package/docs-dev/sass/base/index.html +758 -295
  94. package/docs-dev/sass/base/keyframes/index.html +755 -294
  95. package/docs-dev/sass/base/layout/index.html +755 -294
  96. package/docs-dev/sass/base/normalize/index.html +755 -294
  97. package/docs-dev/sass/base/print/index.html +755 -294
  98. package/docs-dev/sass/base/root/index.html +755 -294
  99. package/docs-dev/sass/base/typography/index.html +755 -294
  100. package/docs-dev/sass/components/accordion/index.html +761 -300
  101. package/docs-dev/sass/components/adaptive-spacing/index.html +755 -294
  102. package/docs-dev/sass/components/badge/index.html +763 -302
  103. package/docs-dev/sass/components/basic-hero/index.html +5265 -0
  104. package/docs-dev/sass/components/button/index.html +755 -294
  105. package/docs-dev/sass/components/button-verbose/index.html +813 -303
  106. package/docs-dev/sass/components/callout/index.html +780 -355
  107. package/docs-dev/sass/components/captioned-figure/index.html +878 -302
  108. package/docs-dev/sass/components/card/index.html +817 -313
  109. package/docs-dev/sass/components/card-grid/index.html +755 -294
  110. package/docs-dev/sass/components/css-icon/index.html +772 -304
  111. package/docs-dev/sass/components/data-grid/index.html +755 -294
  112. package/docs-dev/sass/components/data-table/index.html +951 -305
  113. package/docs-dev/sass/components/fill-context/index.html +755 -294
  114. package/docs-dev/sass/components/flipcard/index.html +791 -299
  115. package/docs-dev/sass/components/flipcard-grid/index.html +755 -294
  116. package/docs-dev/sass/components/form-theme/index.html +965 -402
  117. package/docs-dev/sass/components/hero/index.html +811 -302
  118. package/docs-dev/sass/components/horizontal-rule/index.html +755 -294
  119. package/docs-dev/sass/components/image-grid/index.html +755 -294
  120. package/docs-dev/sass/components/index/index.html +768 -304
  121. package/docs-dev/sass/components/index.html +758 -295
  122. package/docs-dev/sass/components/links/index.html +755 -294
  123. package/docs-dev/sass/components/list-inline/index.html +5279 -0
  124. package/docs-dev/sass/components/list-lines/index.html +787 -330
  125. package/docs-dev/sass/components/list-ordered/index.html +757 -296
  126. package/docs-dev/sass/components/list-unordered/index.html +755 -294
  127. package/docs-dev/sass/components/menu-stack/index.html +789 -315
  128. package/docs-dev/sass/components/modal/index.html +776 -308
  129. package/docs-dev/sass/components/nav-strip/index.html +767 -306
  130. package/docs-dev/sass/components/overlay-section/index.html +763 -302
  131. package/docs-dev/sass/components/pager/index.html +755 -294
  132. package/docs-dev/sass/components/placeholder-block/index.html +755 -294
  133. package/docs-dev/sass/components/popover/index.html +812 -315
  134. package/docs-dev/sass/components/pull-quote/index.html +767 -306
  135. package/docs-dev/sass/components/ratio-box/index.html +755 -294
  136. package/docs-dev/sass/components/rule/index.html +763 -302
  137. package/docs-dev/sass/components/scroll-slider/index.html +755 -294
  138. package/docs-dev/sass/components/skip-link/index.html +763 -302
  139. package/docs-dev/sass/components/slider/index.html +762 -301
  140. package/docs-dev/sass/components/spoke-spinner/index.html +755 -294
  141. package/docs-dev/sass/components/sticky-list/index.html +5483 -0
  142. package/docs-dev/sass/components/tabs/index.html +764 -303
  143. package/docs-dev/sass/components/tag/index.html +755 -294
  144. package/docs-dev/sass/components/tile-button/index.html +755 -294
  145. package/docs-dev/sass/components/tile-grid/index.html +755 -294
  146. package/docs-dev/sass/components/tile-grid-overlay/index.html +755 -294
  147. package/docs-dev/sass/components/vignette/index.html +769 -302
  148. package/docs-dev/sass/components/wysiwyg/index.html +755 -294
  149. package/docs-dev/sass/core/breakpoint/index.html +755 -294
  150. package/docs-dev/sass/core/button/index.html +755 -294
  151. package/docs-dev/sass/core/color/index.html +793 -325
  152. package/docs-dev/sass/core/cssvar/index.html +755 -294
  153. package/docs-dev/sass/core/element/index.html +755 -294
  154. package/docs-dev/sass/core/index.html +755 -294
  155. package/docs-dev/sass/core/layout/index.html +762 -301
  156. package/docs-dev/sass/core/path/index.html +755 -294
  157. package/docs-dev/sass/core/selector/index.html +755 -294
  158. package/docs-dev/sass/core/typography/index.html +755 -294
  159. package/docs-dev/sass/core/units/index.html +755 -294
  160. package/docs-dev/sass/core/utils/index.html +1477 -382
  161. package/docs-dev/sass/helpers/color/index.html +755 -294
  162. package/docs-dev/sass/helpers/display/index.html +755 -294
  163. package/docs-dev/sass/helpers/index/index.html +755 -294
  164. package/docs-dev/sass/helpers/index.html +758 -295
  165. package/docs-dev/sass/helpers/print/index.html +755 -294
  166. package/docs-dev/sass/helpers/typography/index.html +755 -294
  167. package/docs-dev/sass/helpers/units/index.html +755 -294
  168. package/docs-dev/sass/helpers/utilities/index.html +755 -294
  169. package/docs-dev/sass/index.html +758 -295
  170. package/js/index.js +1 -0
  171. package/js/settings.js +78 -0
  172. package/js/ui/details-group.js +121 -0
  173. package/js/ui/index.js +1 -0
  174. package/js/ui/modal-builder.js +3 -2
  175. package/js/ui/overflow-scroller.js +5 -4
  176. package/js/ui/popover.js +1 -0
  177. package/js/ui/programmatic-modal.js +9 -3
  178. package/js/ui/slider.js +7 -6
  179. package/js/ui/theme-toggle.js +330 -89
  180. package/js/utils/dom.js +43 -1
  181. package/js/utils/font-awesome.js +18 -0
  182. package/js/utils/index.js +2 -1
  183. package/package.json +9 -6
  184. package/scss/_color.scss +9 -2
  185. package/scss/_layout.scss +1 -4
  186. package/scss/_utils.scss +187 -11
  187. package/scss/components/README.todos +14 -0
  188. package/scss/components/_accordion.scss +17 -18
  189. package/scss/components/_badge.scss +3 -2
  190. package/scss/components/_basic-hero.scss +112 -0
  191. package/scss/components/_button-verbose.scss +66 -12
  192. package/scss/components/_callout.scss +43 -54
  193. package/scss/components/_captioned-figure.scss +23 -5
  194. package/scss/components/_card-grid.scss +1 -1
  195. package/scss/components/_card.scss +190 -70
  196. package/scss/components/_css-icon.scss +16 -11
  197. package/scss/components/_data-table.scss +41 -4
  198. package/scss/components/_flipcard.scss +20 -14
  199. package/scss/components/_form-theme.scss +135 -123
  200. package/scss/components/_hero.scss +9 -0
  201. package/scss/components/_index.scss +18 -0
  202. package/scss/components/_list-inline.scss +80 -0
  203. package/scss/components/_list-lines.scss +44 -33
  204. package/scss/components/_list-ordered.scss +0 -1
  205. package/scss/components/_menu-stack.scss +42 -26
  206. package/scss/components/_modal.scss +23 -19
  207. package/scss/components/_nav-strip.scss +25 -16
  208. package/scss/components/_overlay-section.scss +2 -1
  209. package/scss/components/_pager.scss +6 -6
  210. package/scss/components/_placeholder-block.scss +4 -4
  211. package/scss/components/_popover.scss +174 -73
  212. package/scss/components/_pull-quote.scss +12 -12
  213. package/scss/components/_rule.scss +0 -1
  214. package/scss/components/_scroll-slider.scss +1 -1
  215. package/scss/components/_skip-link.scss +2 -1
  216. package/scss/components/_slider.scss +17 -38
  217. package/scss/components/_sticky-list.scss +206 -0
  218. package/scss/components/_tabs.scss +5 -2
  219. package/scss/components/_tag.scss +1 -1
  220. package/scss/components/_vignette.scss +1 -0
  221. package/types/index.d.ts +1 -0
  222. package/types/settings.d.ts +38 -0
  223. package/types/settings.d.ts.map +1 -0
  224. package/types/ui/details-group.d.ts +43 -0
  225. package/types/ui/details-group.d.ts.map +1 -0
  226. package/types/ui/index.d.ts +1 -0
  227. package/types/ui/modal-builder.d.ts +2 -2
  228. package/types/ui/modal-builder.d.ts.map +1 -1
  229. package/types/ui/overflow-scroller.d.ts +2 -2
  230. package/types/ui/overflow-scroller.d.ts.map +1 -1
  231. package/types/ui/popover.d.ts.map +1 -1
  232. package/types/ui/programmatic-modal.d.ts.map +1 -1
  233. package/types/ui/slider.d.ts +2 -2
  234. package/types/ui/slider.d.ts.map +1 -1
  235. package/types/ui/tabs.d.ts.map +1 -1
  236. package/types/ui/theme-toggle.d.ts +58 -7
  237. package/types/ui/theme-toggle.d.ts.map +1 -1
  238. package/types/utils/dom.d.ts +19 -1
  239. package/types/utils/dom.d.ts.map +1 -1
  240. package/types/utils/font-awesome.d.ts +5 -0
  241. package/types/utils/font-awesome.d.ts.map +1 -0
  242. package/types/utils/index.d.ts +1 -0
package/scss/_utils.scss CHANGED
@@ -20,7 +20,7 @@ $config: (
20
20
  "debug-maps": true,
21
21
  "file-header-comments": true,
22
22
  "responsive-change": 0.5vw,
23
- "pixel-em-base" : 16px
23
+ "pixel-em-base" : 16px,
24
24
  ) !default;
25
25
 
26
26
  /// Change modules $config
@@ -128,24 +128,39 @@ $config: (
128
128
 
129
129
  // Returns number unit info, and strips the unit
130
130
  /// @param {String} $number Number to get meta info for
131
- /// @return {Map} With properties (unit, value)
131
+ /// @return {Map} With properties (unit, value, invalid [true/false if not number])
132
132
 
133
- @function number-info($number) {
134
- $is-number: meta.type-of($number) != 'number';
135
- $is-unitless: math.is-unitless($number);
136
- @if ($is-unitless or not $is-number) {
133
+ @function number-info($number, $errors: false) {
134
+
135
+ @if (meta.type-of($number) == 'number') {
136
+ $is-unitless: math.is-unitless($number);
137
137
  @return (
138
- "unit": null,
139
- "value": $number
138
+ "unit": if($is-unitless, null, math.unit($number)),
139
+ "value": if($is-unitless, $number, strip-unit($number)),
140
+ "invalid" : false
140
141
  );
142
+
141
143
  } @else {
144
+ @if ($errors) {
145
+ @error "Expected Number, got #{ meta.type-of($number) } for #{ $number }";
146
+ }
142
147
  @return (
143
- "unit" : math.unit($value),
144
- "value": math.div($number, ($number * 0 + 1))
148
+ "unit": null,
149
+ "value": $number,
150
+ "invalid" : true
145
151
  );
146
152
  }
147
153
  }
148
154
 
155
+ /// Adds unit to unitless number
156
+ /// @param {Number} $number The unitless number to add unit to
157
+ /// @param {String} $unit The unit to add to number
158
+ /// @return {String} Number with unit attached (can't be used in maths)
159
+
160
+ @function add-unit($number, $unit) {
161
+ @return $number + string.unquote($unit);
162
+ }
163
+
149
164
  /// Reusable merge method
150
165
  /// @param {Map} $original Source map
151
166
  /// @param {Map} $changes Changes to merge into source map
@@ -450,7 +465,15 @@ $config: (
450
465
  /// @link https://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass/12335841#12335841 Original source (Miriam Suzanne)
451
466
 
452
467
  @function strip-unit($value) {
453
- @return math.div($value, ($value * 0 + 1));
468
+ @if (is-number($value)) {
469
+ @if (math.is-unitless($value)) {
470
+ @return $value;
471
+ } @else {
472
+ @return math.div($value, ($value * 0 + 1));
473
+ }
474
+ } @else {
475
+ @error "Expected number, got #{ $value }";
476
+ }
454
477
  }
455
478
 
456
479
  /// Calculate the size of something at a given scale (percentage/exponential)
@@ -485,4 +508,157 @@ $config: (
485
508
  ) {
486
509
  #{ $property } : $value;
487
510
  #{ $property } : calc(#{ $value } + #{ $responsive-change });
511
+ }
512
+
513
+ /// Calculates the hypotenuse of a triangle
514
+ /// - Can be used to get length between two corners of a rectangle
515
+ /// @param {Number} $width The width of the triangle
516
+ /// @param {Number} $height The height of the triangle
517
+ /// @return {Number} Hypotenuse of a triangle
518
+
519
+ @function hypotenuse($width, $height) {
520
+ @return math.sqrt(math.pow($width, 2) + math.pow($height, 2));
521
+ }
522
+
523
+ /// Get's the info about a box shadow
524
+ /// @param {List} $shadow The box shadow property (ie. 0 0 4px red)
525
+ /// @return {Map} Map with info about the shadow with the following keys (inset, offset-x, offset-y, blur, spread, color)
526
+ /// @throw When shadow is not type list
527
+
528
+ @function box-shadow-info($shadow) {
529
+ @if (meta.type-of($shadow) != "list") {
530
+ @error "Box shadow passed is not correct type (list)";
531
+ }
532
+ $result: (
533
+ "inset": false,
534
+ "offset-x": 0,
535
+ "offset-y": 0,
536
+ "blur": 0,
537
+ "spread": 0,
538
+ "color": null,
539
+ );
540
+
541
+ $number-keys: ("offset-x", "offset-y", "blur", "spread");
542
+ $number-index: 1;
543
+
544
+ @each $value in $shadow {
545
+ $type: meta.type-of($value);
546
+ @if $type == "color" {
547
+ $result: map.merge($result, ("color": $value));
548
+ } @else if $type == "string" and $value == inset {
549
+ $result: map.merge($result, ("inset": true));
550
+ } @else if $type == "number" and $number-index <= 4 {
551
+ // Add each back in by key in the order they appear
552
+ // if not found it's the default
553
+ $result: map.merge($result, (list.nth($number-keys, $number-index): $value));
554
+ $number-index: $number-index + 1;
555
+ }
556
+ }
557
+
558
+ @return $result;
559
+ }
560
+
561
+ /// Get's the extent (how far the shadow extends past the box's edge)
562
+ /// - This will only work on box-shadows that have matching units for the numbers
563
+ /// @param {List} $shadow The box shadow property (ie. 0 0 4px red)
564
+ /// @param {String} $side Optionally pass the side of box to get extend for, if not specified offsets are ignored and just the extent of the shadow is passed
565
+ /// @return {Number} The size the shadow extends past it's box
566
+
567
+ @function box-shadow-extent($shadow, $side: null) {
568
+ $info: box-shadow-info($shadow);
569
+ $extent: map.get($info, "spread") + map.get($info, "blur");
570
+ $offset-x: map.get($info, "offset-x");
571
+ $offset-y: map.get($info, "offset-y");
572
+ @if (not $side) {
573
+ @return $extent;
574
+ } @else {
575
+ @if ($side == "top") {
576
+ @return $extent - $offset-y;
577
+ } @else if ($side == "bottom") {
578
+ @return $extent + $offset-y;
579
+ } @else if ($side == "left") {
580
+ @return $extent - $offset-x;
581
+ } @else if ($side == "right") {
582
+ @return $extent + $offset-x;
583
+ }
584
+ }
585
+ }
586
+
587
+ /// Determines if value passed is a list
588
+ /// @param {*} $value Value to check
589
+ /// @return {Boolean} Whether the item was type list
590
+
591
+ @function is-list($value) {
592
+ @return meta.type-of($value) == "list";
593
+ }
594
+
595
+ /// Determines if value passed is a map
596
+ /// @param {*} $value Value to check
597
+ /// @return {Boolean} Whether the item was type map
598
+
599
+ @function is-map($value) {
600
+ @return meta.type-of($value) == "map";
601
+ }
602
+
603
+ /// Determines if value passed is a number
604
+ /// @param {*} $value Value to check
605
+ /// @return {Boolean} Whether the item was type number
606
+
607
+ @function is-number($value) {
608
+ @return meta.type-of($value) == "number";
609
+ }
610
+
611
+ /// Determines if value passed is a string
612
+ /// @param {*} $value Value to check
613
+ /// @return {Boolean} Whether the item was type string
614
+
615
+ @function is-string($value) {
616
+ @return meta.type-of($value) == "string";
617
+ }
618
+
619
+ /// Determines if value passed is a color
620
+ /// @param {*} $value Value to check
621
+ /// @return {Boolean} Whether the item was type color
622
+
623
+ @function is-color($value) {
624
+ @return meta.type-of($value) == "color";
625
+ }
626
+
627
+
628
+
629
+ // /// Determines if value passed is a bool
630
+ // /// @param {*} $value Value to check
631
+ // /// @return {Boolean} Whether the item was type bool
632
+
633
+ // @function is-bool($value) {
634
+ // @return meta.type-of($value) == "bool";
635
+ // }
636
+
637
+ // /// Determines if value passed is a null
638
+ // /// @param {*} $value Value to check
639
+ // /// @return {Boolean} Whether the item was type null
640
+
641
+ // @function is-null($value) {
642
+ // @return meta.type-of($value) == "null";
643
+ // }
644
+
645
+ /// Returns true if number passed is even
646
+ /// - Allows unit and unitless numbers
647
+ /// @param {Number} $number The number to check
648
+ /// @return {Boolean} Whether or not it is an even number
649
+
650
+ @function is-even($number) {
651
+ @if (is-number($number)) {
652
+ @return strip-unit($number) % 2 == 0;
653
+ } @else {
654
+ @error "Expected Number, got #{ $number }";
655
+ }
656
+ }
657
+
658
+ /// Returns true if number passed is odd
659
+ /// @param {Number} $number The number to check
660
+ /// @return {Boolean} Whether or not it is an odd number
661
+
662
+ @function is-odd($number) {
663
+ @return not is-even($number);
488
664
  }
@@ -13,3 +13,17 @@ Todos:
13
13
  * May override base styles
14
14
  * May contain layouts
15
15
  * May wrap or contain base (button vs button-group)
16
+
17
+ Daniel Todos:
18
+ ☐ Remove uswds stylings for informative and emergency callouts and move it into soar's site
19
+ ☐ get rid of extra styles in frontend to clean up the left cap
20
+ ✔ add a dash to left-cap mixin (to make private) and remove documentation for that mixin @done
21
+ ✔ setup cap colors (define colors) @done
22
+ remove the width of the individual callout styles
23
+ remove background-dark, light, emergency styles
24
+ ☐ Reach out to Rachel about the bug with the theme toggle not working
25
+ ☐ ask her to recreate it
26
+ ☐ Setup search results page
27
+ ☐ General Node/Page Setup
28
+ ☐ Setup View
29
+
@@ -13,8 +13,8 @@
13
13
 
14
14
  /// Module Settings
15
15
  /// @type Map
16
- /// @prop {Color} background-color [white] This is the background color of the accordion before it is expanded.
17
- /// @prop {Color} background-color-open [#F7F8F7] This is the background color of the accordion before it is expanded. This will change the background color of the accordion's summary as well as the details.
16
+ /// @prop {Color} background-color [accordion-background] This is the background color of the accordion before it is expanded.
17
+ /// @prop {Color} background-color-open [accordion-background-open] This is the background color of the accordion before it is expanded. This will change the background color of the accordion's summary as well as the details.
18
18
  /// @prop {String} border-color ["rule"]
19
19
  /// @prop {Number} border-radius [0] This applies a rounding of edges for the accordion. If there are multiple accordions in a stack, this will only apply to the top of the first accordion and the bottom of the last accordion.
20
20
  /// @prop {Dimension} border-width [1px] The width of the borders of the accordions
@@ -41,8 +41,8 @@
41
41
  /// @prop {Dimension} transparent-padding-x [0] The upper and lower padding of the transparent summary.
42
42
 
43
43
  $config: (
44
- "background-color": white,
45
- "background-color-open": #F7F8F7,
44
+ "background-color": "background",
45
+ "background-color-open": "background-gray",
46
46
  "border-color": "rule",
47
47
  "border-radius": 0,
48
48
  "border-width": 1px,
@@ -59,7 +59,7 @@ $config: (
59
59
  "icon-font-size": 1.5rem,
60
60
  "icon-size": auto,
61
61
  "icon-stroke-width": 0.15em,
62
- "summary-background-color": white,
62
+ "summary-background-color": "white",
63
63
  "summary-color": null,
64
64
  "summary-background-color-hover": null,
65
65
  "summary-color-hover": null,
@@ -107,7 +107,7 @@ $config: (
107
107
  margin-top: get("margin");
108
108
  margin-bottom: get("margin");
109
109
  border: $border;
110
- background-color: get("background-color");
110
+ background-color: color.get(get("background-color"));
111
111
  box-shadow: get("box-shadow");
112
112
  &:first-of-type {
113
113
  border-top-left-radius: get("border-radius");
@@ -124,7 +124,7 @@ $config: (
124
124
  }
125
125
  &[open],
126
126
  &.is-active {
127
- background-color: get("background-color-open");
127
+ background-color: color.get(get("background-color-open"));
128
128
  padding-bottom: get("padding-y");
129
129
  z-index: 2; // Above child details
130
130
  > #{ $prefix }__summary {
@@ -136,8 +136,8 @@ $config: (
136
136
  }
137
137
  }
138
138
  #{ $prefix }__summary {
139
- background-color: get("summary-background-color");
140
- color: get("summary-color");
139
+ background-color: color.get(get("summary-background-color"));
140
+ color: color.get(get("summary-color"));
141
141
  margin-left: -(get("padding-x"));
142
142
  margin-right: -(get("padding-x"));
143
143
  line-height: get("summary-line-height");
@@ -145,10 +145,9 @@ $config: (
145
145
  vertical-align: top;
146
146
  font-weight: bold;
147
147
  cursor: pointer;
148
+ display: flex; // For icon
149
+ align-items: center;
148
150
  &:has(#{ $prefix }__icon) {
149
- display: flex; // For icon
150
- align-items: center;
151
- justify-content: space-between;
152
151
  list-style: none; // Remove the default arrow (old safari?)
153
152
  &::-webkit-details-marker,
154
153
  &::marker {
@@ -161,10 +160,10 @@ $config: (
161
160
  @include typography.size(get("summary-type-size"));
162
161
  }
163
162
  &:hover {
164
- background-color: get("summary-background-color-hover");
165
- color: get("summary-color-hover");
163
+ background-color: color.get(get("summary-background-color-hover"));
164
+ color: color.get(get("summary-color-hover"));
166
165
  #{ $prefix }__icon {
167
- background-color: get("icon-background-color-hover");
166
+ background-color: color.get(get("icon-background-color-hover"));
168
167
  color: color.get(get("icon-color-hover"));
169
168
  }
170
169
  }
@@ -172,9 +171,9 @@ $config: (
172
171
  #{ $prefix }__icon {
173
172
  flex: 0 0 get("icon-size");
174
173
  color: color.get(get("icon-color"));
175
- margin-left: 0.5em;
176
- order: 3;
177
- background-color: get("icon-background-color");
174
+ margin-left: auto;
175
+ padding-left: 0.5em;
176
+ background-color: color.get(get("icon-background-color"));
178
177
  border-radius: get("icon-border-radius");
179
178
  width: get("icon-size");
180
179
  height: get("icon-size");
@@ -6,6 +6,7 @@
6
6
  @use "sass:map";
7
7
  @use "../utils";
8
8
  @use "../selector";
9
+ @use "../color";
9
10
 
10
11
  /// Module Settings
11
12
  /// @type Map
@@ -94,8 +95,8 @@ $config: (
94
95
  &:hover,
95
96
  &:focus,
96
97
  &:visited {
97
- background-color: get("background-color");
98
- color: get("color");
98
+ background-color: color.get(get("background-color"));
99
+ color: color.get(get("color"));
99
100
  }
100
101
  }
101
102
  #{ $prefix }--clickable {
@@ -0,0 +1,112 @@
1
+ ////
2
+ /// @group basic-hero
3
+ /// Basic styling for a hero
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:math";
8
+ @use "sass:meta";
9
+ @use "sass:list";
10
+
11
+ @use "../breakpoint";
12
+ @use "../selector";
13
+ @use "../utils";
14
+ @use "../typography";
15
+ @use "../color";
16
+
17
+ // Used for function fallback
18
+ $-fallbacks: (
19
+ "main-max-width" : (
20
+ "function" : meta.get-function("get", false, "typography"),
21
+ "property" : "max-width"
22
+ ),
23
+ "main-min-width" : (
24
+ "function" : meta.get-function("get", false, "typography"),
25
+ "property" : "max-width-small"
26
+ ),
27
+ );
28
+
29
+ /// Module Settings
30
+ /// @type Map
31
+ /// @prop {CssValue} text-align [center] Alignment of text within hero.
32
+ /// @prop {Color} background-color ["color-hero-background"] Background color of the hero
33
+
34
+ $config: (
35
+ "background-color" : "background-gray",
36
+ "padding-top": 3rem,
37
+ "padding-bottom" : 2rem,
38
+ "gap" : (4rem 2rem),
39
+ "main-max-width" : true,
40
+ "main-min-width" : true,
41
+ "media-max-width" : 20rem,
42
+ "media-vertical-align" : center
43
+ ) !default;
44
+
45
+ /// Change modules $config
46
+ /// @param {Map} $changes Map of changes
47
+ /// @example scss
48
+ /// @include ulu.component-basic-hero-set(( "property" : value ));
49
+
50
+ @mixin set($changes) {
51
+ $config: map.merge($config, $changes) !global;
52
+ }
53
+
54
+ /// Get a config option
55
+ /// @param {Map} $name Name of property
56
+ /// @example scss
57
+ /// @include ulu.component-basic-hero-get("property");
58
+
59
+ @function get($name) {
60
+ $value: utils.require-map-get($config, $name, "basic-hero [config]");
61
+ @return utils.function-fallback($name, $value, $-fallbacks);
62
+ }
63
+
64
+ /// Prints component styles
65
+ /// @example scss
66
+ /// @include ulu.component-basic-hero-styles();
67
+
68
+ @mixin styles {
69
+ $prefix: selector.class("basic-hero");
70
+
71
+ #{ $prefix } {
72
+ background-color: color.get(get("background-color"));
73
+ }
74
+ #{ $prefix }__content {
75
+ display: flex;
76
+ align-items: stretch;
77
+ flex-wrap: wrap;
78
+ justify-content: space-between;
79
+ gap: get("gap");
80
+ padding-top: get("padding-top");
81
+ padding-bottom: get("padding-bottom");
82
+ }
83
+ #{ $prefix }__content-main {
84
+ $min-width: if(get("main-min-width"), get("main-min-width"), get("main-max-width"));
85
+ // Using max/min-width so that we don't need to add selectors to change flex-basis
86
+ // when centered. Using flex-basis: 0 to allow flexbox to decide the items width
87
+ // allows it to expand/shrink within. min(100%... Never larger than parent
88
+ min-width: min(100%, $min-width);
89
+ max-width: get("main-max-width");
90
+ flex-shrink: 1;
91
+ flex-grow: 1;
92
+ flex-basis: 0;
93
+ }
94
+ #{ $prefix }__content-media {
95
+ display: flex;
96
+ align-items: center;
97
+ align-self: get("media-vertical-align");
98
+ justify-content: center;
99
+ flex: 0 0 auto;
100
+ width: min(100%, get("media-max-width"));
101
+ }
102
+
103
+ // Modifiers
104
+ #{ $prefix }--center {
105
+ #{ $prefix }__content {
106
+ flex-direction: column;
107
+ flex-wrap: nowrap;
108
+ text-align: center;
109
+ align-items: center;
110
+ }
111
+ }
112
+ }
@@ -9,6 +9,7 @@
9
9
  @use "../utils";
10
10
  @use "../color";
11
11
  @use "../element";
12
+ @use "../selector";
12
13
 
13
14
  // Used for function fallback
14
15
  $-fallbacks: (
@@ -36,6 +37,7 @@ $-fallbacks: (
36
37
  /// @prop {String} color [type] Text color for the button.
37
38
  /// @prop {String} color-hover [type] Text color for the button when hovered or focused.
38
39
  /// @prop {Color} icon-color [gray] Color for button icons.
40
+ /// @prop {Color} icon-color-hover [null] Optional color for icon when hovered
39
41
  /// @prop {Dimension} icon-font-size [1.25rem] Font size for the button.
40
42
  /// @prop {Number} line-height [1.2] Line height for button text.
41
43
  /// @prop {Dimension} margin [1em] Margin for the button.
@@ -46,16 +48,21 @@ $-fallbacks: (
46
48
  /// @prop {String} title-color [link] Color of the title of the button.
47
49
  /// @prop {String} title-color-hover [link-hover] Color of the title of the button when hovered or focused.
48
50
  /// @prop {Dimension} title-margin [0.5em] Margin for the button's title.
51
+ /// @prop {Boolean} left-cap [false] Enable left cap style
52
+ /// @prop {Color} left-cap-color ["link"] The color for the left cap
53
+ /// @prop {color} left-cap-color-hover ["link-hover"] The color for the left cap when the button is hovered
54
+ /// @prop {Number} left-cap-color-hover [0.5rem] Width of the cap
49
55
 
50
56
  $config: (
51
57
  "background-color" : white,
52
- "background-color-hover" : "link",
58
+ "background-color-hover" : #F7F8F7,
53
59
  "border-radius" : "border-radius",
54
60
  "box-shadow" : true,
55
61
  "box-shadow-hover" : true,
56
62
  "color" : "type",
57
63
  "color-hover" : "type",
58
64
  "icon-color": gray,
65
+ "icon-color-hover": null,
59
66
  "icon-font-size" : 1.25rem,
60
67
  "line-height" : 1.2,
61
68
  "margin" : 1em,
@@ -66,6 +73,10 @@ $config: (
66
73
  "title-color": "link",
67
74
  "title-margin" : 0.5em,
68
75
  "title-color-hover" : "link-hover",
76
+ "left-cap" : false,
77
+ "left-cap-color" : "link",
78
+ "left-cap-color-hover" : "link-hover",
79
+ "left-cap-width" : 0.5rem
69
80
  ) !default;
70
81
 
71
82
  /// Change modules $config
@@ -89,10 +100,18 @@ $config: (
89
100
 
90
101
  /// Prints component styles
91
102
  /// @example scss
92
- /// @include ulu.component-button-verbose-styles();
103
+ /// @include ulu.component-button-verbose-styles();
104
+ /// @example html {preview} - Basic Example
105
+ /// <a href="#" class="button-verbose">
106
+ /// <strong class="button-verbose__title">Example Link</strong>
107
+ /// <span class="button-verbose__body">This is the body</span>
108
+ /// <span class="button-verbose__icon fas fa-arrow-right" aria-hidden="true"></span>
109
+ /// </a>
93
110
 
94
111
  @mixin styles {
95
- .button-verbose {
112
+ $prefix: selector.class("button-verbose");
113
+
114
+ #{ $prefix } {
96
115
  text-decoration: none;
97
116
  border-radius: element.get(get("border-radius"));
98
117
  box-shadow: get("box-shadow");
@@ -102,37 +121,72 @@ $config: (
102
121
  margin-bottom: get("margin");
103
122
  max-width: 100%;
104
123
  width: get("min-width");
105
- background-color: get("background-color");
124
+ background-color: color.get(get("background-color"));
106
125
  padding: get("padding-y") get("padding-x");
107
126
  padding-right: (get("padding-x") * 2) + 1em;
108
127
  color: color.get(get("color"));
128
+ text-align: left;
129
+ // Add border like cap
130
+ @if get("left-cap") {
131
+ padding-left: calc(get("padding-x") + get("left-cap-width"));
132
+ &::after {
133
+ content: "";
134
+ display: block;
135
+ position: absolute;
136
+ top: 0;
137
+ bottom: 0;
138
+ left: 0;
139
+ width: get("left-cap-width");
140
+ background-color: color.get(get("left-cap-color"));
141
+ }
142
+ }
109
143
  &:hover {
110
144
  color: color.get(get("color-hover"));
111
145
  background-color: color.get(get("background-color-hover"));
112
146
  box-shadow: get("box-shadow-hover");
113
- .button-verbose__title {
114
- color: color.get(get("title-color-hover"));
147
+ @if get("title-color-hover") {
148
+ #{ $prefix }__title {
149
+ color: color.get(get("title-color-hover"));
150
+ }
151
+ }
152
+ @if get("icon-color-hover") {
153
+ #{ $prefix }__icon {
154
+ color: color.get(get("icon-color-hover"));
155
+ }
156
+ }
157
+ @if (get("left-cap") and get("left-cap-color-hover")) {
158
+ &::after {
159
+ background-color: color.get(get("left-cap-color-hover"));
160
+ }
115
161
  }
116
162
  }
117
163
  }
118
- .button-verbose__title {
164
+ #{ $prefix }__title,
165
+ #{ $prefix }__body {
119
166
  display: block;
120
- margin-bottom: get("title-margin");
167
+ &:first-child {
168
+ margin-bottom: get("title-margin");
169
+ }
170
+ }
171
+ #{ $prefix }__title {
121
172
  color: color.get(get("title-color"));
122
173
  }
123
- .button-verbose__icon {
174
+ #{ $prefix }__icon {
124
175
  position: absolute;
125
176
  top: 50%;
126
177
  right: get("padding-x");
127
178
  transform: translateY(-50%);
128
179
  font-size: get("icon-font-size");
129
- color: get("icon-color");
180
+ color: color.get(get("icon-color"));
130
181
  }
131
- .button-verbose--inline {
182
+ #{ $prefix }--inline {
132
183
  display: inline-block;
133
184
  margin-right: get("margin-inline");
185
+ &:last-child {
186
+ margin-right: 0;
187
+ }
134
188
  }
135
- .button-verbose--full-width {
189
+ #{ $prefix }--full-width {
136
190
  width: 100%;
137
191
  }
138
192
  }