@ulu/frontend 0.0.23 → 0.1.0-beta.1

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 (212) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/deprecated/js/drupal-programmatic-modal.js +91 -0
  3. package/{js/ui/modals.js → deprecated/js/micromodal-modals.js} +41 -67
  4. package/dist/ulu-frontend.min.css +1 -1
  5. package/dist/ulu-frontend.min.js +70 -1
  6. package/index.js +6 -1
  7. package/js/events/index.js +58 -7
  8. package/js/index.js +3 -7
  9. package/js/{helpers/css-breakpoint.js → ui/breakpoints.js} +9 -11
  10. package/js/ui/collapsible.js +195 -0
  11. package/js/ui/dialog.js +157 -0
  12. package/js/ui/dialog.todo +37 -0
  13. package/js/ui/flipcard.js +55 -11
  14. package/js/ui/grid.js +2 -47
  15. package/js/ui/index.js +21 -0
  16. package/js/ui/modal-builder.js +197 -0
  17. package/js/ui/overflow-scroller-pager.js +1 -1
  18. package/js/ui/overflow-scroller.js +8 -5
  19. package/js/ui/page.js +14 -0
  20. package/js/ui/popover.js +135 -0
  21. package/js/ui/print-details.js +44 -0
  22. package/js/ui/print.js +67 -0
  23. package/js/ui/programmatic-modal.js +79 -81
  24. package/js/ui/proxy-click.js +80 -0
  25. package/js/ui/resizer.js +3 -3
  26. package/js/ui/scroll-slider.js +56 -0
  27. package/js/ui/scrollpoint.js +300 -0
  28. package/js/ui/slider.js +72 -10
  29. package/js/ui/tabs.js +85 -58
  30. package/js/ui/theme-toggle.js +129 -0
  31. package/js/ui/tooltip.js +268 -67
  32. package/js/utils/{logger.js → class-logger.js} +6 -5
  33. package/js/utils/dom.js +122 -0
  34. package/js/utils/file-save.js +67 -0
  35. package/js/utils/floating-ui.js +83 -0
  36. package/js/utils/id.js +22 -0
  37. package/js/utils/index.js +7 -0
  38. package/js/{helpers → utils}/pause-youtube-video.js +1 -1
  39. package/package.json +33 -13
  40. package/resources/drupal/twig-macros/accordion.twig +99 -0
  41. package/resources/drupal/twig-macros/dropdown.twig +44 -0
  42. package/resources/drupal/twig-macros/flipcard.twig +69 -0
  43. package/resources/drupal/twig-macros/image.twig +30 -0
  44. package/resources/drupal/twig-macros/layout.twig +338 -0
  45. package/resources/drupal/twig-macros/slider.twig +214 -0
  46. package/resources/drupal/twig-macros/tabs.twig +84 -0
  47. package/scss/README.md +13 -1
  48. package/scss/_breakpoint.scss +69 -26
  49. package/scss/_button.scss +148 -57
  50. package/scss/_color.scss +46 -28
  51. package/scss/_cssvar.scss +103 -12
  52. package/scss/_element.scss +84 -67
  53. package/scss/_index.scss +0 -3
  54. package/scss/_layout.scss +57 -26
  55. package/scss/_path.scss +2 -2
  56. package/scss/_selector.scss +20 -11
  57. package/scss/_typography.scss +115 -82
  58. package/scss/_units.scss +14 -13
  59. package/scss/_utils.scss +280 -18
  60. package/scss/base/_color.scss +2 -1
  61. package/scss/base/_elements.scss +61 -35
  62. package/scss/base/_index.scss +60 -23
  63. package/scss/base/_keyframes.scss +115 -16
  64. package/scss/base/_layout.scss +10 -6
  65. package/scss/base/_normalize.scss +6 -122
  66. package/scss/base/_print.scss +49 -0
  67. package/scss/base/_root.scss +28 -0
  68. package/scss/base/_typography.scss +4 -1
  69. package/scss/components/_accordion.scss +217 -0
  70. package/scss/components/_adaptive-spacing.scss +148 -0
  71. package/scss/components/_badge.scss +17 -14
  72. package/scss/components/_button-verbose.scss +138 -0
  73. package/scss/components/_button.scss +9 -4
  74. package/scss/components/_callout.scss +175 -0
  75. package/scss/components/_captioned-figure.scss +173 -0
  76. package/scss/components/_card-grid.scss +75 -0
  77. package/scss/components/_card.scss +420 -0
  78. package/scss/components/_css-icon.scss +433 -0
  79. package/scss/{_grid.scss → components/_data-grid.scss} +100 -68
  80. package/scss/components/_data-table.scss +180 -0
  81. package/scss/components/_fill-context.scss +20 -22
  82. package/scss/components/_flipcard-grid.scss +66 -0
  83. package/scss/components/_flipcard.scss +304 -0
  84. package/scss/components/_form-theme.scss +633 -0
  85. package/scss/components/_hero.scss +183 -0
  86. package/scss/components/_horizontal-rule.scss +51 -0
  87. package/scss/components/_image-grid.scss +71 -0
  88. package/scss/components/_index.scss +276 -38
  89. package/scss/components/_links.scss +1 -1
  90. package/scss/components/_list-lines.scss +14 -3
  91. package/scss/components/_list-ordered.scss +3 -1
  92. package/scss/components/_list-unordered.scss +3 -1
  93. package/scss/components/_menu-stack.scss +245 -0
  94. package/scss/components/_modal.scss +495 -0
  95. package/scss/components/_nav-strip.scss +148 -0
  96. package/scss/components/_overlay-section.scss +122 -0
  97. package/scss/components/_pager.scss +168 -0
  98. package/scss/components/_placeholder-block.scss +121 -0
  99. package/scss/components/_popover.scss +263 -0
  100. package/scss/components/_pull-quote.scss +111 -0
  101. package/scss/components/_ratio-box.scss +64 -0
  102. package/scss/components/_rule.scss +12 -9
  103. package/scss/components/_scroll-slider.scss +204 -0
  104. package/scss/components/_skip-link.scss +92 -0
  105. package/scss/components/_slider.scss +241 -0
  106. package/scss/components/_spoke-spinner.scss +193 -0
  107. package/scss/components/_tabs.scss +179 -0
  108. package/scss/components/_tag.scss +156 -0
  109. package/scss/components/_tile-button.scss +131 -0
  110. package/scss/components/_tile-grid-overlay.scss +132 -0
  111. package/scss/components/_tile-grid.scss +172 -0
  112. package/scss/components/_vignette.scss +65 -0
  113. package/scss/components/_wysiwyg.scss +94 -0
  114. package/scss/helpers/_color.scss +1 -0
  115. package/scss/helpers/_display.scss +2 -1
  116. package/scss/helpers/_index.scss +45 -22
  117. package/scss/helpers/_print.scss +20 -43
  118. package/scss/helpers/_typography.scss +3 -0
  119. package/scss/helpers/_units.scss +10 -13
  120. package/scss/helpers/_utilities.scss +5 -1
  121. package/scss/stylesheets/base-styles.scss +7 -0
  122. package/scss/stylesheets/component-styles.scss +7 -0
  123. package/scss/stylesheets/helper-styles.scss +7 -0
  124. package/types/events/index.d.ts +1 -1
  125. package/types/events/index.d.ts.map +1 -1
  126. package/types/index.d.ts +2 -2
  127. package/types/{helpers/css-breakpoint.d.ts → ui/breakpoints.d.ts} +3 -3
  128. package/types/ui/breakpoints.d.ts.map +1 -0
  129. package/types/ui/collapsible.d.ts +67 -0
  130. package/types/ui/collapsible.d.ts.map +1 -0
  131. package/types/ui/dialog.d.ts +42 -0
  132. package/types/ui/dialog.d.ts.map +1 -0
  133. package/types/ui/flipcard.d.ts +8 -1
  134. package/types/ui/flipcard.d.ts.map +1 -1
  135. package/types/ui/grid.d.ts +0 -11
  136. package/types/ui/grid.d.ts.map +1 -1
  137. package/types/ui/index.d.ts +23 -0
  138. package/types/ui/index.d.ts.map +1 -0
  139. package/types/ui/modal-builder.d.ts +54 -0
  140. package/types/ui/modal-builder.d.ts.map +1 -0
  141. package/types/ui/overflow-scroller-pager.d.ts +1 -1
  142. package/types/ui/overflow-scroller-pager.d.ts.map +1 -1
  143. package/types/ui/overflow-scroller.d.ts +3 -1
  144. package/types/ui/overflow-scroller.d.ts.map +1 -1
  145. package/types/ui/page.d.ts +5 -0
  146. package/types/ui/page.d.ts.map +1 -0
  147. package/types/ui/popover.d.ts +40 -0
  148. package/types/ui/popover.d.ts.map +1 -0
  149. package/types/ui/print-details.d.ts +10 -0
  150. package/types/ui/print-details.d.ts.map +1 -0
  151. package/types/ui/print.d.ts +10 -0
  152. package/types/ui/print.d.ts.map +1 -0
  153. package/types/ui/programmatic-modal.d.ts +19 -1
  154. package/types/ui/programmatic-modal.d.ts.map +1 -1
  155. package/types/ui/proxy-click.d.ts +18 -0
  156. package/types/ui/proxy-click.d.ts.map +1 -0
  157. package/types/ui/resizer.d.ts +1 -1
  158. package/types/ui/resizer.d.ts.map +1 -1
  159. package/types/ui/scroll-slider.d.ts +13 -0
  160. package/types/ui/scroll-slider.d.ts.map +1 -0
  161. package/types/ui/scrollpoint.d.ts +133 -0
  162. package/types/ui/scrollpoint.d.ts.map +1 -0
  163. package/types/ui/slider.d.ts +14 -2
  164. package/types/ui/slider.d.ts.map +1 -1
  165. package/types/ui/tabs.d.ts +22 -0
  166. package/types/ui/tabs.d.ts.map +1 -1
  167. package/types/ui/theme-toggle.d.ts +14 -0
  168. package/types/ui/theme-toggle.d.ts.map +1 -0
  169. package/types/ui/tooltip.d.ts +92 -10
  170. package/types/ui/tooltip.d.ts.map +1 -1
  171. package/types/utils/{logger.d.ts → class-logger.d.ts} +1 -1
  172. package/types/utils/class-logger.d.ts.map +1 -0
  173. package/types/utils/dom.d.ts +48 -0
  174. package/types/utils/dom.d.ts.map +1 -0
  175. package/types/utils/file-save.d.ts +64 -0
  176. package/types/utils/file-save.d.ts.map +1 -0
  177. package/types/utils/floating-ui.d.ts +19 -0
  178. package/types/utils/floating-ui.d.ts.map +1 -0
  179. package/types/utils/id.d.ts +10 -0
  180. package/types/utils/id.d.ts.map +1 -0
  181. package/types/utils/index.d.ts +9 -0
  182. package/types/utils/index.d.ts.map +1 -0
  183. package/types/utils/pause-youtube-video.d.ts.map +1 -0
  184. package/js/helpers/file-save.js +0 -52
  185. package/js/helpers/scrollbar-width-property.js +0 -14
  186. package/project.todo +0 -22
  187. package/scss/_calculate.scss +0 -64
  188. package/scss/_utility.scss +0 -12
  189. package/types/helpers/css-breakpoint.d.ts.map +0 -1
  190. package/types/helpers/file-save.d.ts +0 -17
  191. package/types/helpers/file-save.d.ts.map +0 -1
  192. package/types/helpers/node-data-manager.d.ts +0 -45
  193. package/types/helpers/node-data-manager.d.ts.map +0 -1
  194. package/types/helpers/pause-youtube-video.d.ts.map +0 -1
  195. package/types/helpers/scrollbar-width-property.d.ts +0 -11
  196. package/types/helpers/scrollbar-width-property.d.ts.map +0 -1
  197. package/types/ui/modals.d.ts +0 -27
  198. package/types/ui/modals.d.ts.map +0 -1
  199. package/types/utils/logger.d.ts.map +0 -1
  200. package/vite.config.js +0 -36
  201. /package/{js/deprecated → deprecated/js}/doc-ready.js +0 -0
  202. /package/{js/deprecated → deprecated/js}/jquery-prototypes.js +0 -0
  203. /package/{js/deprecated → deprecated/js}/mini-collapsible-popper-positioning.js +0 -0
  204. /package/{js/deprecated → deprecated/js}/mini-collapsible.js +0 -0
  205. /package/{js/helpers → deprecated/js}/node-data-manager.js +0 -0
  206. /package/{js/deprecated → deprecated/js}/script-loader.js +0 -0
  207. /package/{js/deprecated → deprecated/js}/waypoints/README.md +0 -0
  208. /package/{js/deprecated → deprecated/js}/waypoints/anchor-menu.js +0 -0
  209. /package/{js/deprecated → deprecated/js}/waypoints/element-waypoint.js +0 -0
  210. /package/{js/deprecated → deprecated/js}/waypoints/examples/page-link-menu.md +0 -0
  211. /package/{js/deprecated → deprecated/js}/waypoints/state-in-attribute.js +0 -0
  212. /package/types/{helpers → utils}/pause-youtube-video.d.ts +0 -0
@@ -0,0 +1,156 @@
1
+ ////
2
+ /// @group tag
3
+ /// A small, lightweight label used to categorize, classify, or identify items within an interface
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:math";
8
+ @use "sass:meta";
9
+
10
+ @use "../selector";
11
+ @use "../utils";
12
+ @use "../color";
13
+ @use "../typography";
14
+
15
+
16
+ // Used for function fallback
17
+ $-fallbacks: (
18
+ "font-family" : (
19
+ "function" : meta.get-function("get", false, "typography"),
20
+ "property" : "font-family-sans"
21
+ ),
22
+ );
23
+
24
+ /// Module Settings
25
+ /// @type Map
26
+ /// @prop {CssValue} font-weight [normal] Font weight for the tag text.
27
+ /// @prop {String} font-family [true] Font family for the tag text.
28
+ /// @prop {CssValue} box-shadow [none] Box shadow for the tag.
29
+ /// @prop {Dimension} padding [(0.4em 0.75em)] Inner padding for the tag.
30
+ /// @prop {CssValue} vertical-align [baseline] Vertical alignment of tag text.
31
+ /// @prop {Dimension} margin-between [0.5em] Margin between tags.
32
+ /// @prop {Dimension} margin-between-tags [0] @joe-check
33
+ /// @prop {Number} line-height [1] Line height for the tag text.
34
+ /// @prop {String} type-size ["small"] Font size for the tag text.
35
+ /// @prop {Color} background-color [#eaeaea] Background color of the tag.
36
+ /// @prop {Dimension} border-radius [1.25em] Border radius of the tag.
37
+ /// @prop {Color} border-color [transparent] Border color for the tag.
38
+ /// @prop {Dimension} border-width [1px] Border width of the tag.
39
+ /// @prop {String} color ["type-tertiary"] Color of the tag text.
40
+
41
+ $config: (
42
+ "font-weight" : normal,
43
+ "font-family" : true,
44
+ "box-shadow" : none,
45
+ "padding" : (0.4em 0.75em),
46
+ "vertical-align" : baseline,
47
+ "margin-between" : 0.5em,
48
+ "margin-between-tags" : 0,
49
+ "line-height" : 1,
50
+ "type-size" : "small",
51
+ "background-color" : #eaeaea,
52
+ "border-radius" : 1.25em,
53
+ "border-color" : transparent,
54
+ "border-width" : 1px,
55
+ "color": "type-tertiary",
56
+ ) !default;
57
+
58
+ /// Style Map (alternate tag styles)
59
+
60
+ $styles: (
61
+ "success" : (
62
+ "color" : rgb(37, 73, 37),
63
+ "background-color" : rgb(190, 220, 190),
64
+ ),
65
+ "danger" : (
66
+ "color" : rgb(78, 24, 24),
67
+ "background-color" : rgb(235, 179, 179),
68
+ ),
69
+ "outline" : (
70
+ "background-color" : transparent,
71
+ "border-color" : #ccc
72
+ )
73
+ ) !default;
74
+
75
+
76
+ /// Change modules $config
77
+ /// @param {Map} $changes Map of changes
78
+ /// @example scss
79
+ /// @include ulu.component-tag-set(( "property" : value ));
80
+
81
+ @mixin set($changes) {
82
+ $config: map.merge($config, $changes) !global;
83
+ }
84
+
85
+ /// Set tag styles
86
+ /// @param {Map} $changes Map of changes
87
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
88
+
89
+ @mixin set-styles($changes, $merge-mode: null) {
90
+ $styles: utils.map-merge($styles, $changes, $merge-mode) !global;
91
+ }
92
+
93
+ /// Get a config option
94
+ /// @param {Map} $name Name of property
95
+ /// @example scss
96
+ /// @include ulu.component-tag-get("property");
97
+
98
+ @function get($name) {
99
+ $value: utils.require-map-get($config, $name, "tag [config]");
100
+ @return utils.function-fallback($name, $value, $-fallbacks);
101
+ }
102
+
103
+ /// Output component stylesheet
104
+ /// @example scss
105
+ /// @include ulu.component-tag-styles();
106
+
107
+ @mixin styles {
108
+ $prefix: selector.class("tag");
109
+
110
+ #{ $prefix } {
111
+ border-radius: get("border-radius");
112
+ display: inline-block;
113
+ padding: get("padding");
114
+ font-weight: get("font-weight");
115
+ vertical-align: get("vertical-align");
116
+ font-style: normal;
117
+ text-overflow: ellipsis;
118
+ text-align: center;
119
+ white-space: nowrap;
120
+ border: get("border-width") solid color.get(get("border-color"));
121
+ background-color: color.get(get("background-color"));
122
+ color: color.get(get("color"));
123
+ font-family: get("font-family");
124
+ @if (typography.has-size(get("type-size"))) {
125
+ @include typography.size(get("type-size"), $only-font-size: true);
126
+ }
127
+ line-height: get("line-height");
128
+ &:not(:last-child) {
129
+ margin-right: get("margin-between");
130
+ }
131
+ &:not(:first-child) {
132
+ margin-left: get("margin-between");
133
+ }
134
+ & + & {
135
+ margin-left: get("margin-between-tags");
136
+ }
137
+ }
138
+
139
+ @each $name, $style in $styles {
140
+ $type-size: map.get($style, "type-size");
141
+ #{ $prefix }--#{ $name } {
142
+ background-color: color.get(map.get($style, "background-color"));
143
+ color: color.get(map.get($style, "color"));
144
+ border: map.get($style, "border");
145
+ border-radius: map.get($style, "border-radius");
146
+ border-color: color.get(map.get($style, "border-color"));
147
+ border-width: color.get(map.get($style, "border-width"));
148
+ box-shadow: map.get($style, "box-shadow");
149
+ padding: map.get($style, "padding");
150
+ @if (typography.has-size($type-size)) {
151
+ @include typography.size($type-size, $only-font-size: true);
152
+ }
153
+ line-height: map.get($style, "line-height");
154
+ }
155
+ }
156
+ }
@@ -0,0 +1,131 @@
1
+ ////
2
+ /// @group tile-button
3
+ /// Button to be used within tile-grid. Used in combination with button component classes.
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:meta";
8
+
9
+ @use "../selector";
10
+ @use "../element";
11
+ @use "../typography";
12
+ @use "../utils";
13
+ @use "../button";
14
+
15
+ $-fallbacks: (
16
+ "border-radius" : (
17
+ "function" : meta.get-function("get", false, "element"),
18
+ "property" : "border-radius"
19
+ ),
20
+ "line-height" : (
21
+ "function" : meta.get-function("get", false, "typography"),
22
+ "property" : "line-height-densest"
23
+ ),
24
+ "transition-duration" : (
25
+ "function" : meta.get-function("get", false, "button"),
26
+ "property" : "transition-duration"
27
+ ),
28
+ "transition-properties" : (
29
+ "function" : meta.get-function("get", false, "button"),
30
+ "property" : "transition-properties"
31
+ ),
32
+ "transition-enabled" : (
33
+ "function" : meta.get-function("get", false, "button"),
34
+ "property" : "transition-enabled"
35
+ ),
36
+ );
37
+
38
+ /// Module Settings
39
+ /// @type Map
40
+ /// @prop {Dimension} border-radius [true] The border radius of the tile button. If set to true, will use the element.scss property for "border-radius".
41
+ /// @prop {String} description-size [small-x] The type size of the description. This uses typography.scss, so the value of this options should be a variable from typography.scss.
42
+ /// @prop {Dimension} line-height [true] The line-height of the tile-button. If set to true, will use the typography.scss property for "line-height-densest".
43
+ /// @prop {Dimension} padding [(1em 0.5em)] The padding of the tile button
44
+ /// @prop {Dimension} row-margin [0.5em] The margin between rows.
45
+ /// @prop {Dimension} icon-font-size [1.5em] The font size of the icon.
46
+ /// @prop {Dimension} icon-margin [1em] The margin for the icon.
47
+ /// @prop {Number} icon-opacity [0.5] The opacity of the icon.
48
+
49
+ $config: (
50
+ "border-radius" : true,
51
+ "description-size" : "small-x",
52
+ "line-height" : true,
53
+ "padding" : (1em 0.5em),
54
+ "row-margin" : 0.5em,
55
+ "icon-font-size" : 1.5em,
56
+ "icon-margin" : 1em,
57
+ "icon-opacity" : 0.5,
58
+ "transition-enabled" : true,
59
+ "transition-duration" : true,
60
+ "transition-properties" : true
61
+ ) !default;
62
+
63
+ /// Change modules $config
64
+ /// @param {Map} $changes Map of changes
65
+ /// @example scss
66
+ /// @include ulu.component-tile-button-set(( "property" : value ));
67
+
68
+ @mixin set($changes) {
69
+ $config: map.merge($config, $changes) !global;
70
+ }
71
+
72
+ /// Get a config option
73
+ /// @param {Map} $name Name of property
74
+ /// @example scss
75
+ /// @include ulu.component-tile-button-get("property");
76
+
77
+ @function get($name) {
78
+ $value: utils.require-map-get($config, $name, "component-tile-button [config]");
79
+ @return utils.function-fallback($name, $value, $-fallbacks);
80
+ }
81
+
82
+ /// Prints component styles
83
+ /// @example scss
84
+ /// @include ulu.component-tile-button-styles();
85
+
86
+ @mixin styles {
87
+ $prefix: selector.class("tile-button");
88
+
89
+ #{ $prefix } {
90
+ white-space: normal;
91
+ margin: 0;
92
+ height: 100%;
93
+ width: 100%;
94
+ display: flex;
95
+ flex-direction: column;
96
+ align-items: center;
97
+ justify-content: center;
98
+ text-align: center;
99
+ padding: get("padding");
100
+ border-radius: get("border-radius");
101
+ line-height: get("line-height");
102
+ @if get("transition-enabled") {
103
+ transition-duration: get("transition-duration");
104
+ transition-property: get("transition-properties");
105
+ }
106
+ }
107
+ #{ $prefix }__row {
108
+
109
+ & + & {
110
+ margin-top: get("row-margin");
111
+ }
112
+ }
113
+
114
+ $desc-size: get("description-size");
115
+
116
+ @if ($desc-size and typography.has-size($desc-size)) {
117
+ #{ $prefix }__row--description {
118
+ @include typography.size($desc-size, $only-font-size: true);
119
+ }
120
+ }
121
+ // Special row style for icons (optionally transparent)
122
+ #{ $prefix }__row--icon {
123
+ margin: 0 auto;
124
+ opacity: get("icon-opacity");
125
+ font-size: get("icon-font-size");
126
+ & + #{ $prefix }__row {
127
+ margin-top: get("icon-margin");
128
+ }
129
+ }
130
+ }
131
+
@@ -0,0 +1,132 @@
1
+ ////
2
+ /// @group tile-grid-overlay
3
+ /// Provides styles to use tile-grid over the top of image
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:math";
8
+
9
+ @use "../selector";
10
+ @use "../utils";
11
+ @use "../color";
12
+ @use "../layout";
13
+ @use "../breakpoint";
14
+
15
+ /// Module Settings
16
+ /// @type Map
17
+
18
+ $config: (
19
+ "button-background-color": #ce97e6dc,
20
+ "button-background-color-hover": #b882cf,
21
+ "button-background-color-striped": #b397e6cc,
22
+ "button-background-color-active": #868dece4,
23
+ "background-image-filter" : (grayscale(1) contrast(0.6) brightness(1.5)),
24
+ "breakpoint-even-columns-min" : "small",
25
+ "breakpoint-even-columns-max" : "medium",
26
+ "wide-breakpoint-even-columns-min" : "small"
27
+ ) !default;
28
+
29
+ /// Change modules $config
30
+ /// @param {Map} $changes Map of changes
31
+ /// @example scss
32
+ /// @include ulu.component-tile-grid-overlay-set(( "property" : value ));
33
+
34
+ @mixin set($changes) {
35
+ $config: map.merge($config, $changes) !global;
36
+ }
37
+
38
+ /// Get a config option
39
+ /// @param {Map} $name Name of property
40
+ /// @example scss
41
+ /// @include ulu.component-tile-grid-overlay-get("property");
42
+
43
+ @function get($name) {
44
+ @return utils.require-map-get($config, $name, "tile-grid-overlay [config]");
45
+ }
46
+
47
+ /// Output component styles
48
+ /// @example scss
49
+ /// @include ulu.component-tile-grid-overlay-styles();
50
+
51
+ @mixin styles {
52
+
53
+ $prefix: selector.class("tile-grid-overlay");
54
+
55
+ #{ $prefix } {
56
+ position: relative;
57
+ }
58
+ #{ $prefix }__background-image {
59
+ @include layout.absolute-fill();
60
+ filter: get("background-image-filter");
61
+ }
62
+ #{ $prefix }__grid {
63
+ position: relative;
64
+ @media print {
65
+ display: block;
66
+ }
67
+ }
68
+ #{ $prefix }__button {
69
+ background-color: color.get(get("button-background-color"));
70
+ border-radius: 0;
71
+ padding-left: 1em;
72
+ padding-right: 1em;
73
+ &:hover,
74
+ &:focus {
75
+ // Competes with striping
76
+ background-color: color.get(get("button-background-color-hover")) !important;
77
+ }
78
+ &.is-active {
79
+ // Competes with striping
80
+ background-color: color.get(get("button-background-color-active")) !important;
81
+ }
82
+ @media print {
83
+ display: block;
84
+ text-align: left;
85
+ height: auto;
86
+ aspect-ratio: auto;
87
+ padding-left: 0;
88
+ }
89
+ }
90
+
91
+ // Striping
92
+ #{ $prefix }__item {
93
+ &:nth-child(even) #{ $prefix }__button {
94
+ background-color: color.get(get("button-background-color-striped"));
95
+ }
96
+ // They want it to alternate when 2 column, so it has to flip flop
97
+ // Then when it returns to above or below this 2 column area odd works like before
98
+ @include breakpoint.min-max(
99
+ get("breakpoint-even-columns-min"),
100
+ get("breakpoint-even-columns-max")
101
+ ) {
102
+ @include -two-column-striping($prefix);
103
+ }
104
+ }
105
+
106
+ // When 2 columns needs the same styles as between small/medium on standard layout
107
+ // no way to reuse because it's inside different media queries
108
+ #{ $prefix }__grid--wide {
109
+ #{ $prefix }__item {
110
+ @include breakpoint.min(get("wide-breakpoint-even-columns-min")) {
111
+ @include -two-column-striping($prefix);
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ // Since we can't reuse this at least rules will match for compression using mixin
118
+ // Needs to correspond with breakpoints for static tile-grid
119
+ @mixin -two-column-striping($prefix) {
120
+ &:nth-child(4n + 1) #{ $prefix }__button {
121
+ background-color: color.get(get("button-background-color"));
122
+ }
123
+ &:nth-child(4n + 2) #{ $prefix }__button {
124
+ background-color: color.get(get("button-background-color-striped"));
125
+ }
126
+ &:nth-child(4n + 3) #{ $prefix }__button {
127
+ background-color: color.get(get("button-background-color-striped"));
128
+ }
129
+ &:nth-child(4n + 4) #{ $prefix }__button {
130
+ background-color: color.get(get("button-background-color"));
131
+ }
132
+ }
@@ -0,0 +1,172 @@
1
+ ////
2
+ /// @group tile-grid
3
+ /// Creates a CSS grid with items that have matching aspect ratios. Reflows to fit as many items as can be fit withing current grid's width by default. Allows passing static styles to create fixed number of columns per row. Static styles are set adaptively and can adjust the number of columns at different breakpoints.
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:list";
8
+
9
+ @use "../selector";
10
+ @use "../breakpoint";
11
+ @use "../utils";
12
+
13
+
14
+ /// Module Settings
15
+ /// @type Map
16
+ /// @prop {CssValue} aspect-ratio [list.slash(4, 3)]
17
+ /// @prop {Number} gap [1rem] The gap for the tile grid.
18
+ /// @prop {Number} width [10em]
19
+
20
+ $config: (
21
+ "aspect-ratio" : list.slash(4, 3),
22
+ "gap" : 1rem,
23
+ "width" : 10em,
24
+ ) !default;
25
+
26
+ /// Alternate Sizes for reflowable grid
27
+ /// - Map of preferred width for columns and optional aspect-ratio for item
28
+ /// @type Map
29
+
30
+ $sizes: (
31
+ "large" : (
32
+ "width" : 20em,
33
+ )
34
+ ) !default;
35
+
36
+ /// Static grid width styles
37
+ /// @type Map
38
+
39
+ $static-sizes: (
40
+ "static" : (
41
+ "default" : (
42
+ "columns" : 1,
43
+ "gap" : null,
44
+ "aspect-ratio" : list.slash(4, 3)
45
+ ),
46
+ "small" : (
47
+ "direction" : "min",
48
+ "columns" : 2,
49
+ "gap" : null,
50
+ ),
51
+ "medium" : (
52
+ "direction" : "min",
53
+ "columns" : 3,
54
+ "gap" : null,
55
+ ),
56
+ ),
57
+ "static-wide" : (
58
+ "default" : (
59
+ "columns" : 1,
60
+ "gap" : null,
61
+ "aspect-ratio" : list.slash(4, 3)
62
+ ),
63
+ "small" : (
64
+ "direction" : "min",
65
+ "columns" : 2,
66
+ "gap" : null,
67
+ ),
68
+ )
69
+ ) !default;
70
+
71
+ /// Change modules $config
72
+ /// @param {Map} $changes Map of changes
73
+ /// @example scss
74
+ /// @include ulu.component-tile-grid-set(( "property" : value ));
75
+
76
+ @mixin set($changes) {
77
+ $config: map.merge($config, $changes) !global;
78
+ }
79
+
80
+ /// Set fixed sizes map
81
+ /// @param {Map} $changes Map of changes
82
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
83
+
84
+ @mixin set-static($changes, $merge-mode: null) {
85
+ $static-sizes: utils.map-merge($static-sizes, $changes, $merge-mode) !global;
86
+ }
87
+
88
+ /// Set sizes map
89
+ /// @param {Map} $changes Map of changes
90
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
91
+
92
+ @mixin set-sizes($changes, $merge-mode: null) {
93
+ $sizes: utils.map-merge($sizes, $changes, $merge-mode) !global;
94
+ }
95
+
96
+ /// Get a config option
97
+ /// @param {Map} $name Name of property
98
+ /// @example scss
99
+ /// @include ulu.component-tile-grid-get("property");
100
+
101
+ @function get($name) {
102
+ @return utils.require-map-get($config, $name, "component-tile-grid [config]");
103
+ }
104
+
105
+ /// Output component stylesheet
106
+ /// @example scss
107
+ /// @include ulu.component-tile-grid-styles();
108
+
109
+ @mixin styles {
110
+ $prefix: selector.class("tile-grid");
111
+
112
+ #{ $prefix } {
113
+ display: grid;
114
+ gap: get("gap");
115
+ grid-template-columns: repeat(auto-fit, minmax(get("width"), 1fr));
116
+ grid-auto-rows: 1fr;
117
+ }
118
+ #{ $prefix }__item {
119
+ aspect-ratio: get("aspect-ratio");
120
+ }
121
+ // Use with fill-context, creates the space for images/etc
122
+ #{ $prefix }--expanded {
123
+ #{ $prefix }__item {
124
+ width: 100%;
125
+ height: 100%;
126
+ overflow: hidden;
127
+ }
128
+ }
129
+
130
+ // Print out reflowable sizes modifiers
131
+ @each $modifier, $props in $sizes {
132
+ $width: map.get($props, "width");
133
+ $gap: map.get($props, "gap");
134
+ $aspect-ratio: map.get($props, "aspect-ratio");
135
+
136
+ @if ($width or $gap) {
137
+ #{ $prefix }--#{ $modifier } {
138
+ @if utils.map-has($props, "width") {
139
+ grid-template-columns: repeat(auto-fit, minmax($width, 1fr));
140
+ }
141
+ gap: $gap;
142
+ }
143
+ }
144
+ @if $aspect-ratio {
145
+ #{ $prefix }--#{ $modifier } #{ $prefix }__item {
146
+ aspect-ratio: $aspect-ratio;
147
+ }
148
+ }
149
+ }
150
+
151
+ // Print out the static column styles
152
+ // - Adaptive column count per breakpoint, equal widths
153
+ @each $modifier, $breakpoints in $static-sizes {
154
+ @include breakpoint.from-each($breakpoints) using ($props) {
155
+ #{ $prefix }--#{ $modifier } {
156
+ grid-template-columns: repeat(map.get($props, "columns"), 1fr);
157
+ gap: map.get($props, "gap");
158
+ }
159
+ @if utils.map-contains-any($props, ("aspect-ratio",)) {
160
+ #{ $prefix }__item {
161
+ aspect-ratio: map.get($props, "aspect-ratio");
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ // Modifier to force no gap on grid
168
+ #{ $prefix }--no-gap {
169
+ gap: 0 !important;
170
+ }
171
+ }
172
+
@@ -0,0 +1,65 @@
1
+
2
+ ////
3
+ /// @group vignette
4
+ /// Create a vignette effect around image/video/etc
5
+ ////
6
+
7
+ @use 'sass:color';
8
+ @use "sass:map";
9
+ @use "../utils";
10
+ @use "../selector";
11
+
12
+ /// Module Settings
13
+ /// @type Map
14
+ /// @prop {Color} background-color [rgb(0,0,0)] Color used for the fade-in of the vignette. Must be actual color not color module palette name
15
+
16
+ $config: (
17
+ "background-color" : rgb(0,0,0),
18
+ "image-filter" : saturate(85%)
19
+ );
20
+
21
+ /// Change modules $config
22
+ /// @param {Map} $changes Map of changes
23
+ /// @example scss
24
+ /// @include ulu.component-vignette-set(( "property" : value ));
25
+
26
+ @mixin set($changes) {
27
+ $config: map.merge($config, $changes) !global;
28
+ }
29
+
30
+ /// Get a config option
31
+ /// @param {Map} $name Name of property
32
+ /// @example scss
33
+ /// @include ulu.component-vignette-get("property");
34
+
35
+ @function get($name) {
36
+ @return utils.require-map-get($config, $name, "vignette [config]");
37
+ }
38
+
39
+ /// Output component stylesheet
40
+ /// @example scss
41
+ /// @include ulu.component-vignette-styles();
42
+
43
+ @mixin styles {
44
+ $prefix: selector.class("vignette");
45
+
46
+ #{ $prefix } {
47
+ position: relative;
48
+ &::after {
49
+ content: "";
50
+ display: block;
51
+ position: absolute;
52
+ top: 0;
53
+ bottom: 0;
54
+ left: 0;
55
+ right: 0;
56
+ background: linear-gradient(0deg,color.change(get("background-color"), $alpha: 0.8),color.change(get("background-color"), $alpha: 0) 45%);
57
+ pointer-events: none;
58
+ }
59
+ @if get("image-filter") {
60
+ img {
61
+ filter: get("image-filter");
62
+ }
63
+ }
64
+ }
65
+ }