@ulu/frontend 0.1.0-beta.8 → 0.1.0-beta.80

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 (287) hide show
  1. package/CHANGELOG.md +529 -0
  2. package/README.dev.md +3 -3
  3. package/README.md +14 -4
  4. package/dist/ulu-frontend.min.css +1 -1
  5. package/dist/ulu-frontend.min.js +35 -28
  6. package/docs-dev/assets/main.js +8290 -635
  7. package/docs-dev/assets/placeholder/icon-calendar.svg +1 -0
  8. package/docs-dev/assets/placeholder/icon-check.svg +1 -0
  9. package/docs-dev/assets/style.css +789 -338
  10. package/docs-dev/changelog/index.html +6553 -0
  11. package/docs-dev/demos/accordion/index.html +850 -328
  12. package/docs-dev/demos/badge/index.html +5265 -0
  13. package/docs-dev/demos/basic-hero/index.html +111 -0
  14. package/docs-dev/demos/breakpoints-manager/index.html +5276 -0
  15. package/docs-dev/demos/button/index.html +892 -328
  16. package/docs-dev/demos/button-verbose/index.html +5268 -0
  17. package/docs-dev/demos/callout/index.html +895 -332
  18. package/docs-dev/demos/captioned-figure/index.html +850 -327
  19. package/docs-dev/demos/card/index.html +930 -768
  20. package/docs-dev/demos/card-grid/index.html +5387 -0
  21. package/docs-dev/demos/counter-list/index.html +5270 -0
  22. package/docs-dev/demos/css-icons/index.html +850 -327
  23. package/docs-dev/demos/data-grid/index.html +870 -347
  24. package/docs-dev/demos/data-table/index.html +1024 -368
  25. package/docs-dev/demos/details-group/index.html +5297 -0
  26. package/docs-dev/demos/file-save/index.html +850 -327
  27. package/docs-dev/demos/flipcard/index.html +850 -327
  28. package/docs-dev/demos/form-theme/index.html +868 -358
  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 +851 -328
  32. package/docs-dev/demos/list-inline/index.html +850 -327
  33. package/docs-dev/demos/list-lines/index.html +850 -327
  34. package/docs-dev/demos/menu-stack/index.html +884 -346
  35. package/docs-dev/demos/modals/index.html +968 -330
  36. package/docs-dev/demos/nav-strip/index.html +850 -327
  37. package/docs-dev/demos/overlay-section/index.html +939 -346
  38. package/docs-dev/demos/popovers/index.html +1112 -347
  39. package/docs-dev/demos/print/index.html +850 -327
  40. package/docs-dev/demos/pull-quote/index.html +850 -327
  41. package/docs-dev/demos/rule/index.html +863 -328
  42. package/docs-dev/demos/scroll-slider/index.html +72 -106
  43. package/docs-dev/demos/scrollpoints/index.html +851 -328
  44. package/docs-dev/demos/slider/index.html +12 -4
  45. package/docs-dev/demos/spoke-spinner/index.html +850 -327
  46. package/docs-dev/demos/{list-inline.1 → sticky-list}/index.html +883 -357
  47. package/docs-dev/demos/tabs/index.html +886 -327
  48. package/docs-dev/demos/tag/index.html +850 -327
  49. package/docs-dev/demos/theme-toggle/index.html +5309 -0
  50. package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
  51. package/docs-dev/demos/tiles/index.html +850 -327
  52. package/docs-dev/demos/tooltip/index.html +850 -327
  53. package/docs-dev/guide/building-stylesheet/index.html +850 -327
  54. package/docs-dev/guide/developing-ulu-scss-module/index.html +850 -327
  55. package/docs-dev/guide/index.html +850 -327
  56. package/docs-dev/index.html +850 -327
  57. package/docs-dev/javascript/events/index.html +847 -326
  58. package/docs-dev/javascript/index.html +850 -327
  59. package/docs-dev/javascript/settings/index.html +5430 -0
  60. package/docs-dev/javascript/ui-breakpoints/index.html +862 -341
  61. package/docs-dev/javascript/ui-collapsible/index.html +847 -326
  62. package/docs-dev/javascript/ui-details-group/index.html +5352 -0
  63. package/docs-dev/javascript/ui-dialog/index.html +879 -343
  64. package/docs-dev/javascript/ui-flipcard/index.html +908 -331
  65. package/docs-dev/javascript/ui-grid/index.html +857 -362
  66. package/docs-dev/javascript/ui-modal-builder/index.html +1047 -386
  67. package/docs-dev/javascript/ui-overflow-scroller/index.html +847 -326
  68. package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +847 -326
  69. package/docs-dev/javascript/ui-page/index.html +847 -326
  70. package/docs-dev/javascript/ui-popover/index.html +855 -338
  71. package/docs-dev/javascript/ui-print/index.html +847 -334
  72. package/docs-dev/javascript/ui-print-details/index.html +847 -326
  73. package/docs-dev/javascript/ui-programmatic-modal/index.html +847 -326
  74. package/docs-dev/javascript/ui-proxy-click/index.html +934 -328
  75. package/docs-dev/javascript/ui-resizer/index.html +847 -326
  76. package/docs-dev/javascript/ui-scroll-slider/index.html +885 -332
  77. package/docs-dev/javascript/ui-scrollpoint/index.html +853 -339
  78. package/docs-dev/javascript/ui-slider/index.html +1043 -331
  79. package/docs-dev/javascript/ui-tabs/index.html +858 -374
  80. package/docs-dev/javascript/ui-theme-toggle/index.html +5440 -0
  81. package/docs-dev/javascript/ui-tooltip/index.html +854 -337
  82. package/docs-dev/javascript/utils-class-logger/index.html +847 -326
  83. package/docs-dev/javascript/utils-css/index.html +5254 -0
  84. package/docs-dev/javascript/utils-dom/index.html +887 -446
  85. package/docs-dev/javascript/utils-file-save/index.html +847 -326
  86. package/docs-dev/javascript/utils-floating-ui/index.html +847 -326
  87. package/docs-dev/javascript/utils-id/index.html +847 -326
  88. package/docs-dev/javascript/utils-pause-youtube-video/index.html +847 -326
  89. package/docs-dev/javascript/utils-system/index.html +5557 -0
  90. package/docs-dev/sass/base/color/index.html +847 -326
  91. package/docs-dev/sass/base/elements/index.html +847 -326
  92. package/docs-dev/sass/base/index/index.html +847 -326
  93. package/docs-dev/sass/base/index.html +850 -327
  94. package/docs-dev/sass/base/keyframes/index.html +847 -326
  95. package/docs-dev/sass/base/layout/index.html +847 -326
  96. package/docs-dev/sass/base/normalize/index.html +847 -326
  97. package/docs-dev/sass/base/print/index.html +847 -326
  98. package/docs-dev/sass/base/root/index.html +847 -326
  99. package/docs-dev/sass/base/typography/index.html +847 -326
  100. package/docs-dev/sass/components/accordion/index.html +866 -338
  101. package/docs-dev/sass/components/adaptive-spacing/index.html +847 -326
  102. package/docs-dev/sass/components/badge/index.html +869 -337
  103. package/docs-dev/sass/components/basic-hero/index.html +5415 -0
  104. package/docs-dev/sass/components/button/index.html +847 -326
  105. package/docs-dev/sass/components/button-verbose/index.html +933 -337
  106. package/docs-dev/sass/components/callout/index.html +958 -418
  107. package/docs-dev/sass/components/captioned-figure/index.html +970 -334
  108. package/docs-dev/sass/components/card/index.html +939 -346
  109. package/docs-dev/sass/components/card-grid/index.html +847 -326
  110. package/docs-dev/sass/components/counter-list/index.html +5497 -0
  111. package/docs-dev/sass/components/css-icon/index.html +864 -336
  112. package/docs-dev/sass/components/data-grid/index.html +868 -340
  113. package/docs-dev/sass/components/data-table/index.html +1063 -352
  114. package/docs-dev/sass/components/fill-context/index.html +847 -326
  115. package/docs-dev/sass/components/flipcard/index.html +888 -336
  116. package/docs-dev/sass/components/flipcard-grid/index.html +847 -326
  117. package/docs-dev/sass/components/form-theme/index.html +1063 -446
  118. package/docs-dev/sass/components/hero/index.html +903 -334
  119. package/docs-dev/sass/components/horizontal-rule/index.html +847 -326
  120. package/docs-dev/sass/components/image-grid/index.html +847 -326
  121. package/docs-dev/sass/components/index/index.html +860 -336
  122. package/docs-dev/sass/components/index.html +850 -327
  123. package/docs-dev/sass/components/links/index.html +847 -326
  124. package/docs-dev/sass/components/list-inline/index.html +847 -326
  125. package/docs-dev/sass/components/list-lines/index.html +847 -326
  126. package/docs-dev/sass/components/list-ordered/index.html +847 -326
  127. package/docs-dev/sass/components/list-unordered/index.html +847 -326
  128. package/docs-dev/sass/components/menu-stack/index.html +881 -347
  129. package/docs-dev/sass/components/modal/index.html +891 -342
  130. package/docs-dev/sass/components/nav-strip/index.html +855 -334
  131. package/docs-dev/sass/components/overlay-section/index.html +855 -334
  132. package/docs-dev/sass/components/pager/index.html +847 -326
  133. package/docs-dev/sass/components/placeholder-block/index.html +847 -326
  134. package/docs-dev/sass/components/popover/index.html +904 -347
  135. package/docs-dev/sass/components/pull-quote/index.html +859 -338
  136. package/docs-dev/sass/components/ratio-box/index.html +855 -334
  137. package/docs-dev/sass/components/rule/index.html +848 -327
  138. package/docs-dev/sass/components/scroll-slider/index.html +855 -346
  139. package/docs-dev/sass/components/skip-link/index.html +847 -326
  140. package/docs-dev/sass/components/slider/index.html +897 -388
  141. package/docs-dev/sass/components/spoke-spinner/index.html +849 -328
  142. package/docs-dev/sass/components/sticky-list/index.html +5633 -0
  143. package/docs-dev/sass/components/tabs/index.html +872 -336
  144. package/docs-dev/sass/components/tag/index.html +849 -328
  145. package/docs-dev/sass/components/tile-button/index.html +847 -326
  146. package/docs-dev/sass/components/tile-grid/index.html +847 -326
  147. package/docs-dev/sass/components/tile-grid-overlay/index.html +847 -326
  148. package/docs-dev/sass/components/vignette/index.html +861 -334
  149. package/docs-dev/sass/components/wysiwyg/index.html +847 -326
  150. package/docs-dev/sass/core/breakpoint/index.html +931 -358
  151. package/docs-dev/sass/core/button/index.html +847 -326
  152. package/docs-dev/sass/core/color/index.html +1019 -366
  153. package/docs-dev/sass/core/cssvar/index.html +847 -326
  154. package/docs-dev/sass/core/element/index.html +1108 -381
  155. package/docs-dev/sass/core/index.html +847 -326
  156. package/docs-dev/sass/core/layout/index.html +903 -363
  157. package/docs-dev/sass/core/path/index.html +847 -326
  158. package/docs-dev/sass/core/selector/index.html +847 -326
  159. package/docs-dev/sass/core/typography/index.html +847 -326
  160. package/docs-dev/sass/core/units/index.html +857 -330
  161. package/docs-dev/sass/core/utils/index.html +2104 -476
  162. package/docs-dev/sass/helpers/color/index.html +847 -326
  163. package/docs-dev/sass/helpers/display/index.html +848 -327
  164. package/docs-dev/sass/helpers/index/index.html +847 -326
  165. package/docs-dev/sass/helpers/index.html +850 -327
  166. package/docs-dev/sass/helpers/print/index.html +759 -298
  167. package/docs-dev/sass/helpers/typography/index.html +847 -326
  168. package/docs-dev/sass/helpers/units/index.html +847 -326
  169. package/docs-dev/sass/helpers/utilities/index.html +849 -328
  170. package/docs-dev/sass/index.html +850 -327
  171. package/js/index.js +1 -0
  172. package/js/settings.js +95 -0
  173. package/js/ui/breakpoints.js +19 -16
  174. package/js/ui/collapsible.js +8 -1
  175. package/js/ui/details-group.js +112 -0
  176. package/js/ui/dialog.js +85 -42
  177. package/js/ui/dialog.todo +2 -36
  178. package/js/ui/flipcard.js +37 -57
  179. package/js/ui/grid.js +15 -13
  180. package/js/ui/index.js +1 -0
  181. package/js/ui/modal-builder.js +105 -59
  182. package/js/ui/overflow-scroller.js +6 -4
  183. package/js/ui/page.js +2 -2
  184. package/js/ui/popover.js +38 -38
  185. package/js/ui/print.js +16 -25
  186. package/js/ui/programmatic-modal.js +9 -3
  187. package/js/ui/proxy-click.js +50 -36
  188. package/js/ui/scroll-slider.js +24 -30
  189. package/js/ui/scrollpoint.js +29 -64
  190. package/js/ui/slider.js +108 -63
  191. package/js/ui/tabs.js +23 -36
  192. package/js/ui/theme-toggle.js +332 -94
  193. package/js/ui/tooltip.js +27 -32
  194. package/js/utils/css.js +13 -0
  195. package/js/utils/dom.js +23 -64
  196. package/js/utils/font-awesome.js +18 -0
  197. package/js/utils/index.js +2 -1
  198. package/js/utils/system.js +155 -0
  199. package/package.json +23 -8
  200. package/scss/README.md +4 -0
  201. package/scss/_breakpoint.scss +38 -4
  202. package/scss/_color.scss +40 -9
  203. package/scss/_element.scss +108 -2
  204. package/scss/_layout.scss +7 -8
  205. package/scss/_units.scss +3 -2
  206. package/scss/_utils.scss +380 -16
  207. package/scss/components/README.todos +14 -0
  208. package/scss/components/_accordion.scss +33 -19
  209. package/scss/components/_badge.scss +23 -4
  210. package/scss/components/_basic-hero.scss +112 -0
  211. package/scss/components/_button-verbose.scss +100 -18
  212. package/scss/components/_callout.scss +125 -78
  213. package/scss/components/_captioned-figure.scss +17 -0
  214. package/scss/components/_card-grid.scss +1 -1
  215. package/scss/components/_card.scss +246 -74
  216. package/scss/components/_counter-list.scss +151 -0
  217. package/scss/components/_css-icon.scss +25 -21
  218. package/scss/components/_data-grid.scss +55 -9
  219. package/scss/components/_data-table.scss +39 -3
  220. package/scss/components/_flipcard.scss +8 -3
  221. package/scss/components/_form-theme.scss +119 -108
  222. package/scss/components/_hero.scss +12 -10
  223. package/scss/components/_index.scss +18 -0
  224. package/scss/components/_menu-stack.scss +42 -26
  225. package/scss/components/_modal.scss +42 -26
  226. package/scss/components/_nav-strip.scss +2 -0
  227. package/scss/components/_overlay-section.scss +2 -5
  228. package/scss/components/_popover.scss +165 -64
  229. package/scss/components/_pull-quote.scss +13 -13
  230. package/scss/components/_ratio-box.scss +2 -5
  231. package/scss/components/_rule.scss +1 -0
  232. package/scss/components/_scroll-slider.scss +1 -5
  233. package/scss/components/_slider.scss +49 -72
  234. package/scss/components/_spoke-spinner.scss +2 -2
  235. package/scss/components/_sticky-list.scss +206 -0
  236. package/scss/components/_tabs.scss +22 -4
  237. package/scss/components/_vignette.scss +3 -5
  238. package/scss/helpers/_display.scss +15 -18
  239. package/scss/helpers/_print.scss +12 -7
  240. package/scss/helpers/_utilities.scss +42 -32
  241. package/types/index.d.ts +1 -0
  242. package/types/settings.d.ts +66 -0
  243. package/types/settings.d.ts.map +1 -0
  244. package/types/ui/breakpoints.d.ts +14 -14
  245. package/types/ui/breakpoints.d.ts.map +1 -1
  246. package/types/ui/collapsible.d.ts.map +1 -1
  247. package/types/ui/details-group.d.ts +38 -0
  248. package/types/ui/details-group.d.ts.map +1 -0
  249. package/types/ui/dialog.d.ts +20 -14
  250. package/types/ui/dialog.d.ts.map +1 -1
  251. package/types/ui/flipcard.d.ts +16 -10
  252. package/types/ui/flipcard.d.ts.map +1 -1
  253. package/types/ui/grid.d.ts +4 -6
  254. package/types/ui/grid.d.ts.map +1 -1
  255. package/types/ui/index.d.ts +2 -1
  256. package/types/ui/modal-builder.d.ts +113 -11
  257. package/types/ui/modal-builder.d.ts.map +1 -1
  258. package/types/ui/overflow-scroller.d.ts +2 -2
  259. package/types/ui/overflow-scroller.d.ts.map +1 -1
  260. package/types/ui/popover.d.ts +6 -7
  261. package/types/ui/popover.d.ts.map +1 -1
  262. package/types/ui/print.d.ts +0 -4
  263. package/types/ui/print.d.ts.map +1 -1
  264. package/types/ui/programmatic-modal.d.ts.map +1 -1
  265. package/types/ui/proxy-click.d.ts +19 -3
  266. package/types/ui/proxy-click.d.ts.map +1 -1
  267. package/types/ui/scroll-slider.d.ts +5 -7
  268. package/types/ui/scroll-slider.d.ts.map +1 -1
  269. package/types/ui/scrollpoint.d.ts +3 -8
  270. package/types/ui/scrollpoint.d.ts.map +1 -1
  271. package/types/ui/slider.d.ts +33 -14
  272. package/types/ui/slider.d.ts.map +1 -1
  273. package/types/ui/tabs.d.ts +6 -8
  274. package/types/ui/tabs.d.ts.map +1 -1
  275. package/types/ui/theme-toggle.d.ts +51 -7
  276. package/types/ui/theme-toggle.d.ts.map +1 -1
  277. package/types/ui/tooltip.d.ts +3 -5
  278. package/types/ui/tooltip.d.ts.map +1 -1
  279. package/types/utils/css.d.ts +11 -0
  280. package/types/utils/css.d.ts.map +1 -0
  281. package/types/utils/dom.d.ts +12 -32
  282. package/types/utils/dom.d.ts.map +1 -1
  283. package/types/utils/font-awesome.d.ts +5 -0
  284. package/types/utils/font-awesome.d.ts.map +1 -0
  285. package/types/utils/index.d.ts +2 -1
  286. package/types/utils/system.d.ts +113 -0
  287. package/types/utils/system.d.ts.map +1 -0
@@ -3,11 +3,21 @@
3
3
  /// Outputs badge component stylesheet
4
4
  ////
5
5
 
6
+ @use "sass:meta";
6
7
  @use "sass:map";
7
8
  @use "../utils";
8
9
  @use "../selector";
10
+ @use "../typography";
9
11
  @use "../color";
10
12
 
13
+ // Used for function fallback
14
+ $-fallbacks: (
15
+ "font-family" : (
16
+ "function" : meta.get-function("get", false, "typography"),
17
+ "property" : "font-family-sans"
18
+ )
19
+ );
20
+
11
21
  /// Module Settings
12
22
  /// @type Map
13
23
  /// @prop {Number} background-color [gray] Background color (if no image)
@@ -15,6 +25,7 @@
15
25
  /// @prop {Number} color [black] Type color
16
26
  /// @prop {Number} font-size [1.3rem] Font size (basic ie. 1.3rem) for badge
17
27
  /// @prop {Number} font-weight [bold] Font weight
28
+ /// @prop {Number} font-family [true] Specify font family, defaults to typography font-family-sans
18
29
  /// @prop {List} sizes [Object] List of other sizes (large by default), each size is a map of (width, font-size)
19
30
  /// @prop {Number} width [10rem] Width of badge (default size)
20
31
 
@@ -22,13 +33,18 @@ $config: (
22
33
  "background-color": gray,
23
34
  "border-radius": 50%,
24
35
  "color": black,
25
- "font-size": 1.3rem,
36
+ "font-size": 1.5rem,
26
37
  "font-weight": bold,
27
- "width": 10rem,
38
+ "font-family": true,
39
+ "width": 7rem,
28
40
  "sizes" : (
41
+ "small" : (
42
+ "font-size" : 1.2rem,
43
+ "width" : 5rem
44
+ ),
29
45
  "large" : (
30
46
  "font-size" : 2.75rem,
31
- "width" : 6rem
47
+ "width" : 9rem
32
48
  )
33
49
  )
34
50
  ) !default;
@@ -48,7 +64,8 @@ $config: (
48
64
  /// @include ulu.component-badge-get("property");
49
65
 
50
66
  @function get($name) {
51
- @return utils.require-map-get($config, $name, "badge [config]");
67
+ $value: utils.require-map-get($config, $name, "badge [config]");
68
+ @return utils.function-fallback($name, $value, $-fallbacks);
52
69
  }
53
70
 
54
71
  /// Output badge component styles
@@ -77,6 +94,7 @@ $config: (
77
94
  flex: 0 0 get("width");
78
95
  font-size: get("font-size");
79
96
  font-weight: get("font-weight");
97
+ font-family: get("font-family");
80
98
  }
81
99
  #{ $prefix }__inner {
82
100
  display: block;
@@ -118,6 +136,7 @@ $config: (
118
136
  width: 100%;
119
137
  height: 100%;
120
138
  object-fit: cover;
139
+ margin: 0 !important;
121
140
  }
122
141
 
123
142
  @each $name, $props in get("sizes") {
@@ -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,8 @@
9
9
  @use "../utils";
10
10
  @use "../color";
11
11
  @use "../element";
12
+ @use "../selector";
13
+ @use "../button";
12
14
 
13
15
  // Used for function fallback
14
16
  $-fallbacks: (
@@ -23,6 +25,14 @@ $-fallbacks: (
23
25
  "box-shadow-hover" : (
24
26
  "function" : meta.get-function("get", false, "element"),
25
27
  "property" : "box-shadow-hover"
28
+ ),
29
+ "border-color" : (
30
+ "function" : meta.get-function("get", false, "button"),
31
+ "property" : "border-color"
32
+ ),
33
+ "border-width" : (
34
+ "function" : meta.get-function("get", false, "button"),
35
+ "property" : "border-width"
26
36
  )
27
37
  );
28
38
 
@@ -31,11 +41,14 @@ $-fallbacks: (
31
41
  /// @prop {Color} background-color [white] Background color for the button.
32
42
  /// @prop {Color} background-color-hover [link] Background color for the button when hovered or focused.
33
43
  /// @prop {String} border-radius [border-radius] Border radius of the button.
44
+ /// @prop {String} border-width [null] Border width (or set to true to inherit button border width default)
45
+ /// @prop {String} border-color [null] Border color (or set to true to inherit button border width default)
34
46
  /// @prop {CssValue} box-shadow [true] Box shadow for the button. If set to true, uses default box-shadow.
35
47
  /// @prop {CssValue} box-shadow-hover [true] Box shadow for the button when hovered or focused. If set to true, uses default box-shadow-hover.
36
48
  /// @prop {String} color [type] Text color for the button.
37
49
  /// @prop {String} color-hover [type] Text color for the button when hovered or focused.
38
50
  /// @prop {Color} icon-color [gray] Color for button icons.
51
+ /// @prop {Color} icon-color-hover [null] Optional color for icon when hovered
39
52
  /// @prop {Dimension} icon-font-size [1.25rem] Font size for the button.
40
53
  /// @prop {Number} line-height [1.2] Line height for button text.
41
54
  /// @prop {Dimension} margin [1em] Margin for the button.
@@ -46,26 +59,44 @@ $-fallbacks: (
46
59
  /// @prop {String} title-color [link] Color of the title of the button.
47
60
  /// @prop {String} title-color-hover [link-hover] Color of the title of the button when hovered or focused.
48
61
  /// @prop {Dimension} title-margin [0.5em] Margin for the button's title.
62
+ /// @prop {Boolean} cap [false] Enable left cap style
63
+ /// @prop {Color} cap-side ["left"] The side that gets the cap
64
+ /// @prop {Number} cap-match-radius [true] The cap should have be rounded to match the parent's border radius
65
+ /// @prop {Map} cap-options The options for cap (see element.cap for options)
66
+ /// @prop {Map} cap-options-hover The options for cap when hovered
49
67
 
50
68
  $config: (
51
69
  "background-color" : white,
52
- "background-color-hover" : "link",
53
- "border-radius" : "border-radius",
70
+ "background-color-hover" : #F7F8F7,
71
+ "border-radius" : true,
72
+ "border-color" : null,
73
+ "border-width" : null,
54
74
  "box-shadow" : true,
55
75
  "box-shadow-hover" : true,
56
76
  "color" : "type",
57
77
  "color-hover" : "type",
58
78
  "icon-color": gray,
79
+ "icon-color-hover": null,
59
80
  "icon-font-size" : 1.25rem,
60
81
  "line-height" : 1.2,
61
82
  "margin" : 1em,
62
83
  "margin-inline" : 0.75em,
63
84
  "min-width": 20rem,
64
- "padding-x": 0.65em,
85
+ "padding-x": 0.75em,
65
86
  "padding-y": 1em,
66
87
  "title-color": "link",
67
88
  "title-margin" : 0.5em,
68
89
  "title-color-hover" : "link-hover",
90
+ "cap" : false,
91
+ "cap-side" : "left",
92
+ "cap-match-radius" : true,
93
+ "cap-options" : (
94
+ "color" : "link",
95
+ "size" : 0.5rem,
96
+ ),
97
+ "cap-options-hover" : (
98
+ "color" : "link-hover"
99
+ ),
69
100
  ) !default;
70
101
 
71
102
  /// Change modules $config
@@ -89,50 +120,101 @@ $config: (
89
120
 
90
121
  /// Prints component styles
91
122
  /// @example scss
92
- /// @include ulu.component-button-verbose-styles();
123
+ /// @include ulu.component-button-verbose-styles();
124
+ /// @example html {preview} - Basic Example
125
+ /// <a href="#" class="button-verbose">
126
+ /// <strong class="button-verbose__title">Example Link</strong>
127
+ /// <span class="button-verbose__body">This is the body</span>
128
+ /// <span class="button-verbose__icon fas fa-arrow-right" aria-hidden="true"></span>
129
+ /// </a>
93
130
 
94
131
  @mixin styles {
95
- .button-verbose {
132
+ $prefix: selector.class("button-verbose");
133
+ $padding-x: get("padding-x");
134
+ $padding-y: get("padding-y");
135
+ $padding-right: ($padding-x * 2) + 1em;
136
+ $cap-side: get("cap-side");
137
+ $cap-defaults: (
138
+ "offset" : utils.if-type("number", get("border-width"), 0),
139
+ "border-radius" : if(get("cap-match-radius"), get("border-radius"), 0),
140
+ "padding-adjust" : if(utils.is-side($cap-side), $padding-x, $padding-y)
141
+ );
142
+
143
+ #{ $prefix } {
144
+ position: relative; // For cap and icon
145
+ display: block;
96
146
  text-decoration: none;
97
- border-radius: element.get(get("border-radius"));
147
+ border-radius: get("border-radius");
148
+ @if (get("border-width")) {
149
+ border: get("border-width") solid color.get(get("border-color"));
150
+ }
98
151
  box-shadow: get("box-shadow");
99
152
  line-height: get("line-height");
100
- position: relative;
101
- display: block;
102
153
  margin-bottom: get("margin");
103
154
  max-width: 100%;
104
155
  width: get("min-width");
105
156
  background-color: color.get(get("background-color"));
106
- padding: get("padding-y") get("padding-x");
107
- padding-right: (get("padding-x") * 2) + 1em;
157
+ padding: $padding-y $padding-right $padding-y $padding-x;
108
158
  color: color.get(get("color"));
159
+ text-align: left;
160
+
109
161
  &:hover {
110
162
  color: color.get(get("color-hover"));
111
163
  background-color: color.get(get("background-color-hover"));
112
164
  box-shadow: get("box-shadow-hover");
113
- .button-verbose__title {
114
- color: color.get(get("title-color-hover"));
165
+ @if get("title-color-hover") {
166
+ #{ $prefix }__title {
167
+ color: color.get(get("title-color-hover"));
168
+ }
169
+ }
170
+ @if get("icon-color-hover") {
171
+ #{ $prefix }__icon {
172
+ color: color.get(get("icon-color-hover"));
173
+ }
174
+ }
175
+ }
176
+ @if get("cap") {
177
+ @include element.cap(
178
+ $side: $cap-side,
179
+ $options: map.merge($cap-defaults, get("cap-options"))
180
+ );
181
+ @if get("cap-options-hover") {
182
+ &:hover,
183
+ &:focus {
184
+ @include element.cap-appearance(
185
+ $side: $cap-side,
186
+ $options: get("cap-options-hover")
187
+ );
188
+ }
115
189
  }
116
190
  }
117
191
  }
118
- .button-verbose__title {
192
+ #{ $prefix }__title,
193
+ #{ $prefix }__body {
119
194
  display: block;
120
- margin-bottom: get("title-margin");
195
+ &:first-child {
196
+ margin-bottom: get("title-margin");
197
+ }
198
+ }
199
+ #{ $prefix }__title {
121
200
  color: color.get(get("title-color"));
122
201
  }
123
- .button-verbose__icon {
202
+ #{ $prefix }__icon {
124
203
  position: absolute;
125
204
  top: 50%;
126
- right: get("padding-x");
205
+ right: $padding-x;
127
206
  transform: translateY(-50%);
128
207
  font-size: get("icon-font-size");
129
208
  color: color.get(get("icon-color"));
130
209
  }
131
- .button-verbose--inline {
210
+ #{ $prefix }--inline {
132
211
  display: inline-block;
133
212
  margin-right: get("margin-inline");
213
+ &:last-child {
214
+ margin-right: 0;
215
+ }
134
216
  }
135
- .button-verbose--full-width {
217
+ #{ $prefix }--full-width {
136
218
  width: 100%;
137
219
  }
138
220
  }
@@ -14,10 +14,6 @@
14
14
 
15
15
  // Used for function fallback
16
16
  $-fallbacks: (
17
- "border" : (
18
- "function" : meta.get-function("get-rule-style", false, "element"),
19
- "property" : "light"
20
- ),
21
17
  "border-radius" : (
22
18
  "function" : meta.get-function("get", false, "element"),
23
19
  "property" : "border-radius"
@@ -27,69 +23,56 @@ $-fallbacks: (
27
23
  /// Module Settings
28
24
  /// @type Map
29
25
  /// @prop {Color} background-color [rgb(240, 240, 240)] The background color of the Callout.
30
- /// @prop {Boolean} border [true] The border of the Callout.
26
+ /// @prop {Color} border-color ["rule-light"] The border color of the Callout.
31
27
  /// @prop {Boolean} border-radius [true] The border radius of the Callout.
28
+ /// @prop {Dimension} border-width [1px] The border width of the Callout.
32
29
  /// @prop {CssValue} box-shadow [none] The box-shadow of the Callout.
33
- /// @prop {Boolean} left-cap [false] Toggles the use of left caps in styled callouts.
34
- /// @prop {Color} left-cap-color [green] Color of the left cap.
35
- /// @prop {Dimension} left-cap-width [0.5rem] Width of the left cap.
30
+ /// @prop {Boolean} caps-disabled [false] If set will not output any cap styles for both base and styles
31
+ /// @prop {Boolean} cap [false] Toggles the use of caps on default callout
32
+ /// @prop {Boolean} cap-side ["left"] The side that gets the cap
33
+ /// @prop {Number} cap-match-radius [true] The cap should have be rounded to match the parent's border radius
34
+ /// @prop {Map} cap-options The options for cap (see element.cap for options)
36
35
  /// @prop {Dimension} margin [2rem] Bottom margin of the Callout.
37
36
  /// @prop {Dimension} padding [1.5rem] Padding of the Callout.
38
37
 
39
38
  $config: (
40
39
  "background-color" : rgb(240, 240, 240),
41
- "border" : true,
42
- "border-radius" : true,
40
+ "border-color" : "rule-light",
41
+ "border-radius" : 6px,
42
+ "border-width" : 1px,
43
43
  "box-shadow" : none,
44
- "left-cap" : false,
45
- "left-cap-color" : green,
46
- "left-cap-width" : 0.5rem,
44
+ "caps-disabled" : false,
45
+ "cap" : false,
46
+ "cap-side" : "left",
47
+ "cap-match-radius" : false,
48
+ "cap-options" : (
49
+ "color" : rgb(160, 160, 160),
50
+ "size" : 0.5rem,
51
+ ),
47
52
  "margin" : 2rem,
48
53
  "padding" : 1.5rem,
49
54
  ) !default;
50
55
 
56
+ /// Styles Map (for unique variations/modifiers)
57
+ /// - Adjust this with set-styles
58
+ /// @type Map
59
+
51
60
  $styles: (
52
- "background-dark" : (
53
- "background-color" : rgb(240, 240, 240)
54
- ),
55
61
  "outline" : (
56
62
  "background-color": transparent
57
63
  ),
58
- "light" : (
59
- "background-color" : white,
60
- "border-color" : gray
61
- ),
62
- "informative" : (
63
- "background-color" : #e7f6f8,
64
- "left-cap-color" : #00bde3,
65
- "left-cap" : true,
66
- "left-cap-width": 0.5rem
64
+ "info" : (
65
+ "background-color" : "info-background",
67
66
  ),
68
67
  "warning" : (
69
- "background-color" : #faf3d1,
70
- "left-cap-color" : #ffbe2e,
71
- "left-cap" : true,
72
- "left-cap-width": 0.5rem
68
+ "background-color" : "info-background",
73
69
  ),
74
70
  "success" : (
75
- "background-color" : #ecf3ec,
76
- "left-cap-color" : #00a91c,
77
- "left-cap" : true,
78
- "left-cap-width": 0.5rem
71
+ "background-color" : "success-background",
79
72
  ),
80
73
  "danger" : (
81
- "background-color" : #f4e3db,
82
- "left-cap-color" : #d54309,
83
- "left-cap" : true,
84
- "left-cap-width": 0.5rem
74
+ "background-color" : "danger-background",
85
75
  ),
86
- "emergency" : (
87
- "background-color" : #9c3d10,
88
- "left-cap-color" : #9c3d10,
89
- "left-cap" : true,
90
- "color" : white,
91
- "left-cap-width": 0.5rem
92
- )
93
76
  ) !default;
94
77
 
95
78
  /// Change modules $config
@@ -112,64 +95,128 @@ $styles: (
112
95
  }
113
96
 
114
97
  /// Set callout style variations
115
- /// @param {Map} $changes Map of changes (options for style include [background-color, color, border, border-radius, border-color, box-shadow, padding, left-cap, left-cap-width, left-cap-color]
98
+ /// - Styles that modify padding when using mix-match caps on/off should be included last
99
+ /// @param {Map} $changes Map of changes (options for style include [background-color, color, border-color, border-radius, border-width, box-shadow, padding, cap, cap-options]
116
100
  /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
117
101
 
118
102
  @mixin set-styles($changes, $merge-mode: null) {
119
103
  $styles: utils.map-merge($styles, $changes, $merge-mode) !global;
120
104
  }
121
105
 
122
- /// Output styling for a callout that adds a left cap
123
- /// @param {Dimension} $width The width of the left cap
124
- /// @param {Color} $color The left cap color
125
-
126
- @mixin left-cap($width: get("left-cap-width"), $color: get("left-cap-color")) {
127
- position: relative;
128
- border-top-left-radius: 0;
129
- border-bottom-left-radius: 0;
130
- &::before {
131
- position: absolute;
132
- content: "";
133
- left: 0;
134
- top: 0;
135
- bottom: 0;
136
- width: $width;
137
- background-color: color.get($color);
138
- }
139
- }
140
-
141
106
  /// Output component stylesheet
142
107
  /// @example scss
143
108
  /// @include ulu.component-callout-styles();
144
109
 
145
110
  @mixin styles {
146
- $prefix: selector.class("callout");
111
+ $prefix: selector.class("callout");
112
+ $padding: get("padding");
113
+ $padding-info: utils.get-spacing($padding);
114
+ $cap-options: get("cap-options");
115
+ $cap-size: map.get($cap-options, "size");
116
+ $cap-side: get("cap-side");
147
117
 
148
118
  #{ $prefix } {
119
+ position: relative; // For cap
149
120
  background-color: color.get(get("background-color"));
150
- padding: get("padding");
151
- border: get("border");
121
+ padding: $padding;
122
+ border: get("border-width") solid color.get(get("border-color"));
152
123
  margin-bottom: get("margin");
153
124
  box-shadow: get("box-shadow");
154
125
  border-radius: get("border-radius");
155
126
  & >:first-child {
156
127
  margin-top: 0;
157
128
  }
158
- @if get("left-cap") {
159
- @include left-cap();
129
+
130
+ // If we have left cap on default we reuse this for all
131
+ // Else we will print it out manually for each unique style
132
+ @if (not get("caps-disabled")) {
133
+ $cap-defaults: (
134
+ "offset" : get("border-width"),
135
+ "border-radius" : if(get("cap-match-radius"), get("border-radius"), null),
136
+ // "padding-adjust" : map.get($padding-info, $cap-side)
137
+ );
138
+ @include element.cap(
139
+ $side: $cap-side,
140
+ $options: map.merge($cap-defaults, $cap-options)
141
+ );
142
+ }
143
+
144
+ // If the left cap is disabled we still include it's CSS but we hide it
145
+ // so that other styles of callouts can use it
146
+ @if (not get("cap")) {
147
+ &::before {
148
+ content: none;
149
+ }
150
+ // Since this is hidden and reused we need to not use padding adjust unless it
151
+ // was visible
152
+ } @else if ($cap-size) {
153
+ padding-#{ $cap-side }: calc(map.get($padding-info, $cap-side) + $cap-size);
160
154
  }
161
155
  }
156
+
157
+ @include -output-style-modifiers();
158
+ }
159
+
160
+ // Output Each Style Modifier
161
+ // - Note if cap is not disabled this will just update appearance values of cap styling
162
+ @mixin -output-style-modifiers() {
163
+ $prefix: selector.class("callout");
164
+ $caps-enabled: not get("caps-disabled");
165
+ $cap-side: get("cap-side");
166
+
162
167
  @each $name, $style in $styles {
168
+ $cap: map.get($style, "cap");
169
+ $padding: map.get($style, "padding");
170
+ $border-radius: map.get($style, "border-radius");
171
+ $background-color: map.get($style, "background-color");
172
+ $color: map.get($style, "color");
173
+ $border-color: map.get($style, "border-color");
174
+ $border-width: map.get($style, "border-width");
175
+ $box-shadow: map.get($style, "box-shadow");
176
+ $cap-match-radius: map.get($style, "cap-match-radius");
177
+
163
178
  #{ $prefix }--#{ $name } {
164
- background-color: color.get(map.get($style, "background-color"));
165
- color: color.get(map.get($style, "color"));
166
- border: map.get($style, "border");
167
- border-radius: map.get($style, "border-radius");
168
- border-color: color.get(map.get($style, "border-color"));
169
- box-shadow: map.get($style, "box-shadow");
170
- padding: map.get($style, "padding");
171
- @if map.get($style, "left-cap") {
172
- @include left-cap( map.get($style, "left-cap-width"), map.get($style, "left-cap-color"));
179
+ background-color: color.get($background-color);
180
+ color: color.get($color);
181
+ border-radius: $border-radius;
182
+ border-color: color.get($border-color);
183
+ border-width: $border-width;
184
+ box-shadow: $box-shadow;
185
+ padding: $padding;
186
+
187
+ @if ($cap and $caps-enabled) {
188
+ $match-radius: utils.if-type("bool", $cap-match-radius, get("cap-match-radius"));
189
+ // Padding adjust always has to be set (since size could change or padding)
190
+ $padding-info: utils.get-spacing(if($padding, $padding, get("padding")));
191
+ $cap-radius: utils.if-type("number", $border-radius, get("border-radius"));
192
+ $cap-options: utils.ensure-map(map.get($style, "cap-options"));
193
+ $cap-defaults: (
194
+ "size" : map.get(get("cap-options"), "size"),
195
+ "padding-adjust" : map.get($padding-info, $cap-side),
196
+ "offset" : $border-width,
197
+ "border-radius" : if($match-radius, $cap-radius, null)
198
+ );
199
+
200
+ @include element.cap-appearance(
201
+ $side: $cap-side,
202
+ $options: map.merge($cap-defaults, $cap-options),
203
+ $before: true
204
+ );
205
+
206
+ // Because the main callout's cap may not be visible
207
+ &::before {
208
+ content: "";
209
+ }
210
+ // If set to false remove the cap (if enabled) and reset default cap padding adjust
211
+ } @else if ($cap == false and $caps-enabled) {
212
+ // if this style doesn't set padding
213
+ @if (not $padding) {
214
+ $padding-info: utils.get-spacing(get("padding"));
215
+ padding-#{ $cap-side }: map.get($padding-info, $cap-side);
216
+ }
217
+ &::before {
218
+ content: none;
219
+ }
173
220
  }
174
221
  }
175
222
  }