@ulu/frontend 0.0.22 → 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/CHANGELOG.md +4 -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 +32 -11
  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 +71 -37
  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 +142 -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,111 @@
1
+ ////
2
+ /// @group pull-quote
3
+ ////
4
+ /// Layout for a pull quote, relies on badge component for image
5
+
6
+ @use "sass:map";
7
+ @use "sass:meta";
8
+
9
+ @use "../selector";
10
+ @use "../typography";
11
+ @use "../utils";
12
+ @use "../color";
13
+
14
+ // Used for function fallback
15
+ $-fallbacks: (
16
+ "body-line-height" : (
17
+ "function" : meta.get-function("get", false, "typography"),
18
+ "property" : "line-height-dense"
19
+ ),
20
+ );
21
+
22
+ /// Module Settings
23
+ /// @type Map
24
+ /// @prop {} body-line-height [true]
25
+ /// @prop {} image-margin-bottom [1rem]
26
+ /// @prop {} image-margin-top [2.5rem]
27
+ /// @prop {} name-margin-bottom [1rem]
28
+ /// @prop {} padding-y [2em]
29
+ /// @prop {} title-font-style [italic]
30
+ /// @prop {} quote-mark-character ["\201c"]
31
+ /// @prop {} quote-mark-color [null]
32
+ /// @prop {} quote-mark-font-family ["Georgia"]
33
+ /// @prop {} quote-mark-font-size [3.75em]
34
+ /// @prop {} quote-mark-enabled [true]
35
+ /// @prop {} quote-mark-line-height [0.35]
36
+
37
+ $config: (
38
+ "body-line-height" : true,
39
+ "image-margin-bottom" : 1rem,
40
+ "image-margin-top" : 2.5rem,
41
+ "name-margin-bottom" : 1rem,
42
+ "padding-y" : 2em,
43
+ "title-font-style" : italic,
44
+
45
+ "quote-mark-character" : "\201c",
46
+ "quote-mark-color" : null,
47
+ "quote-mark-font-family" : "Georgia",
48
+ "quote-mark-font-size" : 3.75em,
49
+ "quote-mark-enabled" : true,
50
+ "quote-mark-line-height" : 0.35,
51
+ ) !default;
52
+
53
+ /// Change modules $config
54
+ /// @param {Map} $changes Map of changes
55
+ /// @example
56
+ /// @include ulu.component-pull-quote-set(( "property" : value ));
57
+
58
+ @mixin set($changes) {
59
+ $config: map.merge($config, $changes) !global;
60
+ }
61
+
62
+ /// Get a config option
63
+ /// @param {Map} $name Name of property
64
+ /// @example
65
+ /// @include ulu.component-pull-quote-get("property");
66
+
67
+ @function get($name) {
68
+ $value: utils.require-map-get($config, $name, "pull-quote [config]");
69
+ @return utils.function-fallback($name, $value, $-fallbacks);
70
+ }
71
+
72
+ /// Prints component styles
73
+ /// @example scss
74
+ /// @include ulu.component-pull-quote-styles();
75
+
76
+ @mixin styles {
77
+ $prefix: selector.class("pull-quote");
78
+
79
+ #{ $prefix } {
80
+ padding: get("padding-y") 0;
81
+ text-align: center;
82
+ }
83
+ #{ $prefix }__body {
84
+ line-height: get("body-line-height");
85
+ @if (get("quote-mark-enabled")) {
86
+ &:before {
87
+ display: block;
88
+ position: relative;
89
+ // content: open-quote;
90
+ content: get("quote-mark-character");
91
+ font-family: get("quote-mark-font-family");
92
+ color: color.get(get("quote-mark-color"));
93
+ font-size: get("quote-mark-font-size");
94
+ margin: 0 auto;
95
+ line-height: get("quote-mark-line-height");
96
+ }
97
+ }
98
+ }
99
+ #{ $prefix }__author-name {
100
+ display: block;
101
+ margin-top: get("name-margin-bottom");
102
+ }
103
+ #{ $prefix }__author-title {
104
+ display: block;
105
+ font-style: get("title-font-style");
106
+ }
107
+ #{ $prefix }__author-image {
108
+ margin: get("image-margin-top") auto get("image-margin-bottom") auto;
109
+ width: min-content;
110
+ }
111
+ }
@@ -0,0 +1,64 @@
1
+ ////
2
+ /// @group ratio-box
3
+ ////
4
+ /// Uses padding trick to keep ratio. Defaults to 4:3 (standard). Used for responsive iframe or images (object-fit), etc
5
+
6
+ @use "sass:map";
7
+ @use "../utils";
8
+
9
+ /// Module Settings
10
+ /// @type Map
11
+ /// @prop {Number} size [75%] Default height ratio (of width 100%)
12
+ /// @prop {Map} sizes [Map] Other ratios to add (apply with modifier class)
13
+
14
+ $config: (
15
+ "size" : 75%,
16
+ "sizes" : (
17
+ "16x9" : 56.25%,
18
+ "9x16" : 177.77%,
19
+ "3x4" : 133.33%
20
+ )
21
+ ) !default;
22
+
23
+ /// Change modules $config
24
+ /// @param {Map} $changes Map of changes
25
+ /// @example
26
+ /// @include ulu.component-ratio-box-set(( "property" : value ));
27
+
28
+ @mixin set($changes) {
29
+ $config: map.merge($config, $changes) !global;
30
+ }
31
+
32
+ /// Get a config option
33
+ /// @param {Map} $name Name of property
34
+ /// @example
35
+ /// @include ulu.component-ratio-box-get("property");
36
+
37
+ @function get($name) {
38
+ @return utils.require-map-get($config, $name, "ratio-box [config]");
39
+ }
40
+
41
+ /// Prints component styles
42
+ /// @example scss
43
+ /// @include ulu.component-ratio-box-styles();
44
+
45
+ @mixin styles {
46
+ .ratio-box {
47
+ position: relative;
48
+ overflow: hidden;
49
+ padding: get("size") 0 0 0;
50
+ }
51
+ .ratio-box__content {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ width: 100%;
56
+ height: 100%;
57
+ border: 0;
58
+ }
59
+ @each $name, $size in get("sizes") {
60
+ .ratio-box--#{ $name } {
61
+ padding-top: $size;
62
+ }
63
+ }
64
+ }
@@ -10,19 +10,20 @@
10
10
 
11
11
  /// Module Settings
12
12
  /// @type Map
13
- /// @prop {Number} $config.short-width Short rule width (like an inline rule, normally used above headings), Setting this to false will disable output
14
- /// @prop {Number} $config.short-border-width Short rule width of border
13
+ /// @prop {Number} short-border-width [4px] Short rule width of border
14
+ /// @prop {Number} short-modifiers [false] @joe-check
15
+ /// @prop {Number} short-width [2.75rem] Short rule width (like an inline rule, normally used above headings), Setting this to false will disable output
15
16
 
16
17
  $config: (
17
- "short-width" : 2.75rem,
18
18
  "short-border-width" : 4px,
19
- "short-modifiers" : false
19
+ "short-modifiers" : false,
20
+ "short-width" : 2.75rem,
20
21
  ) !default;
21
22
 
22
23
  /// Change modules $config
23
24
  /// @param {Map} $changes Map of changes
24
- /// @example scss - General example, replace module-name with module's name
25
- /// @include module-name.set(( "property" : value ));
25
+ /// @example
26
+ /// @include ulu.component-rule-set(( "property" : value ));
26
27
 
27
28
  @mixin set($changes) {
28
29
  $config: map.merge($config, $changes) !global;
@@ -30,14 +31,16 @@ $config: (
30
31
 
31
32
  /// Get a config option
32
33
  /// @param {Map} $name Name of property
33
- /// @example scss - General example, replace module-name with module's name
34
- /// @include module-name.get("property");
34
+ /// @example
35
+ /// @include ulu.component-rule-get("property");
35
36
 
36
37
  @function get($name) {
37
38
  @return utils.require-map-get($config, $name, "rule [config]");
38
39
  }
39
40
 
40
41
  /// Output styles
42
+ /// @example scss
43
+ /// @include ulu.component-rule-styles();
41
44
 
42
45
  @mixin styles {
43
46
 
@@ -73,7 +76,7 @@ $config: (
73
76
  }
74
77
  }
75
78
 
76
- // Meant to be user by tself without content
79
+ // Meant to be user by itself without content
77
80
  $short-width: get("short-width");
78
81
  @if ($short-width) {
79
82
  #{ $class }--short {
@@ -0,0 +1,204 @@
1
+ ////
2
+ /// @group scroll-slider
3
+ /// Overflow scrolling slider component (use with ui/overflow-scroller.js)
4
+ ////
5
+
6
+ @use "sass:map";
7
+
8
+ @use "../element";
9
+ @use "../color";
10
+ @use "../utils";
11
+ @use "../layout";
12
+ @use "../breakpoint";
13
+ @use "../selector";
14
+
15
+ /// Module Settings
16
+ /// @type Map
17
+ /// @prop {Color} background-color [false]
18
+ /// @prop {String} container ["container"]
19
+ /// @prop {List} containers [("container",)]
20
+ /// @prop {Dimension} margin-bottom [3rem]
21
+ /// @prop {Dimension} margin-top [1rem]
22
+ /// @prop {Dimension} padding-bottom [0]
23
+ /// @prop {Dimension} padding-top [0]
24
+ /// @prop {String} prefix ["scroll-slide"]
25
+ /// @prop {Color} button-background-color [white]
26
+ /// @prop {Color} button-background-color-hover [white]
27
+ /// @prop {CssValue} button-border [2px solid white]
28
+ /// @prop {Color} button-border-color-hover [white]
29
+ /// @prop {Dimension} button-border-radius [50%]
30
+ /// @prop {CssValue} button-box-shadow [element.get("box-shadow")]
31
+ /// @prop {Color} button-color [color.get("type")]
32
+ /// @prop {Color} button-color-hover [color.get("link")]
33
+ /// @prop {Dimension} button-font-size [1.35rem]
34
+ /// @prop {Dimension} button-indent [1.5rem]
35
+ /// @prop {Dimension} button-indent-small [0.5rem]
36
+ /// @prop {Dimension} button-size [3rem]
37
+ /// @prop {Dimension} button-icon-offset-x [false]
38
+ /// @prop {Dimension} button-icon-offset-y [false]
39
+
40
+ $config: (
41
+ "background-color" : false,
42
+ "container" : "container",
43
+ "containers" : ("container",),
44
+ "margin-bottom" : 3rem,
45
+ "margin-top" : 1rem,
46
+ "padding-bottom" : 0,
47
+ "padding-top" : 0,
48
+ "prefix": "scroll-slider",
49
+ "button-background-color" : white,
50
+ "button-background-color-hover" : white,
51
+ "button-border" : 2px solid white,
52
+ "button-border-color-hover" : white,
53
+ "button-border-radius" : 50%,
54
+ "button-box-shadow" : element.get("box-shadow"),
55
+ "button-color" : color.get("type"),
56
+ "button-color-hover" : color.get("link"),
57
+ "button-font-size" : 1.35rem,
58
+ "button-icon-offset-x" : false,
59
+ "button-icon-offset-y" : false,
60
+ "button-indent" : 1.5rem,
61
+ "button-indent-small" : 0.5rem,
62
+ "button-size" : 3rem,
63
+ ) !default;
64
+
65
+ /// Change modules $config
66
+ /// @param {Map} $changes Map of changes
67
+ /// @example scss - General example
68
+ /// @include ulu.component-scroll-slider-set(( "property" : value ));
69
+
70
+ @mixin set($changes) {
71
+ $config: map.merge($config, $changes) !global;
72
+ }
73
+
74
+ /// Get a config option
75
+ /// @param {Map} $name Name of property
76
+ /// @example scss - General example
77
+ /// @include ulu.component-scroll-slider-get("property");
78
+
79
+ @function get($name) {
80
+ @return utils.require-map-get($config, $name, "scroll-slider [config]");
81
+ }
82
+
83
+ /// Output component stylesheet
84
+ /// @example scss
85
+ /// @include ulu.component-scroll-slider-styles();
86
+
87
+ @mixin styles {
88
+ $prefix: selector.class(get("prefix"));
89
+
90
+ #{ $prefix } {
91
+ position: relative; // for controls
92
+ background-color: get("background-color");
93
+ margin: get("margin-top") 0 get("margin-bottom") 0;
94
+ }
95
+ #{ $prefix }--cards {
96
+ #{ $prefix }__slide {
97
+ margin-right: 1.35rem;
98
+ > .card {
99
+ width: 100%;
100
+ max-width: none;
101
+ height: calc(100% - 2rem);
102
+ margin: 1rem 0 1rem 0;// For shadows
103
+ }
104
+ }
105
+ #{ $prefix }__slide--empty {
106
+ margin-right: 0;
107
+ }
108
+ }
109
+ #{ $prefix }__track {
110
+ display: flex;
111
+ overflow-x: auto;
112
+ scroll-behavior: smooth;
113
+ scroll-snap-type: x mandatory;
114
+ // scroll-padding-left: calc(((100vw - vars.$site-max-width) / 2) + vars.$site-margin);
115
+ // switch below to a modifier (like #{ $prefix }--in-container, #{ $prefix }--in-container-large-x) Default is container
116
+
117
+ // scroll-padding-right: 1rem;
118
+ // Hide scrollbars
119
+ -ms-overflow-style: none; /* for Internet Explorer, Edge */
120
+ scrollbar-width: none; /* for Firefox */
121
+ &::-webkit-scrollbar {
122
+ display: none; /* for Chrome, Safari, and Opera */
123
+ }
124
+ @include layout.match-container-margin("scroll-padding-left", get("container"));
125
+ // padding: 1rem;
126
+ // Add space to end of list
127
+ // &:after {
128
+ // content: "\00a0";
129
+ // display: block;
130
+ // width: 1rem;
131
+ // height: 100%;
132
+ // flex: 0 0 1rem;
133
+ // }
134
+ }
135
+ #{ $prefix }__slide {
136
+
137
+ flex: 0 0 450px;
138
+ max-width: 90vw;
139
+ scroll-snap-align: start;
140
+
141
+ $containerBreakpoint: layout.get-container("container", $breakpoint: "small", $required: false);
142
+ // Only if this container has this breakpoint
143
+ @if ($containerBreakpoint) {
144
+ @include breakpoint.max("small") {
145
+ $pad: layout.get-container-padding-x("container", "small");
146
+ max-width: none;
147
+ flex-basis: calc(100vw - ($pad * 2) - var(--ulu-scrollbar-width));
148
+ }
149
+ }
150
+ }
151
+ #{ $prefix }__slide--empty {
152
+ scroll-snap-align: none;
153
+ // flex-basis: calc(((100vw - vars.$site-max-width) / 2) + vars.$site-margin);
154
+ @include layout.match-container-margin("flex-basis", get("container"));
155
+ & {
156
+ margin-right: 0;
157
+ }
158
+ // @include ulu.breakpoint-max("small") {
159
+ // &:last-child {
160
+ // display: none;
161
+ // }
162
+ // }
163
+ }
164
+ #{ $prefix }__controls {
165
+ list-style: none !important;
166
+ padding: 0;
167
+ }
168
+ .OverflowScroller__control-button {
169
+ position: absolute;
170
+ top: 50%;
171
+ transform: translateY(-50%);
172
+ z-index: 10;
173
+ }
174
+ @if get("button-icon-offset-y") {
175
+ .OverflowScroller__control-icon {
176
+ margin-top: get("button-icon-offset-y");
177
+ }
178
+ }
179
+ .OverflowScroller__control-button--previous {
180
+ left: get("button-indent");
181
+ @if get("button-icon-offset-x") {
182
+ .OverflowScroller__control-icon {
183
+ margin-left: get("button-icon-offset-x");
184
+
185
+ }
186
+ }
187
+ }
188
+ .OverflowScroller__control-button--next {
189
+ right: get("button-indent");
190
+ @if get("button-icon-offset-x") {
191
+ .OverflowScroller__control-icon {
192
+ margin-right: get("button-icon-offset-x");
193
+ }
194
+ }
195
+ }
196
+ @include breakpoint.max("small") {
197
+ .OverflowScroller__control-button--previous {
198
+ left: get("button-indent-small");
199
+ }
200
+ .OverflowScroller__control-button--next {
201
+ right: get("button-indent-small");
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,92 @@
1
+
2
+ ////
3
+ /// @group skip-link
4
+ /// Accessible skip link component (works in combination with .hidden-visually-focusable)
5
+ ////
6
+
7
+ @use "sass:meta";
8
+
9
+ @use "../element";
10
+ @use "../layout";
11
+ @use "../selector";
12
+ @use "../utils";
13
+
14
+ // Used for function fallback
15
+ $-fallbacks: (
16
+ "border-radius" : (
17
+ "function" : meta.get-function("get", false, "element"),
18
+ "property" : "border-radius"
19
+ ),
20
+ "box-shadow" : (
21
+ "function" : meta.get-function("get", false, "element"),
22
+ "property" : "box-shadow"
23
+ ),
24
+ "z-index" : (
25
+ "function" : meta.get-function("get", false, "layout"),
26
+ "property" : "z-index-fixed"
27
+ ),
28
+ );
29
+
30
+ /// Module Settings
31
+ /// @type Map
32
+
33
+ $config: (
34
+ "padding" : (1em 2em),
35
+ "background-color" : white,
36
+ "box-shadow" : true,
37
+ "border-radius" : true,
38
+ "z-index" : true
39
+ ) !default;
40
+
41
+ /// Change modules $config
42
+ /// @param {Map} $changes Map of changes
43
+ /// @example scss
44
+ /// @include ulu.component-skip-link-set(( "property" : value ));
45
+
46
+ @mixin set($changes) {
47
+ $config: map.merge($config, $changes) !global;
48
+ }
49
+
50
+ /// Get a config option
51
+ /// @param {Map} $name Name of property
52
+ /// @example scss
53
+ /// @include ulu.component-skip-link-get("property");
54
+
55
+ @function get($name) {
56
+ $value: utils.require-map-get($config, $name, "button-verbose [config]");
57
+ @return utils.function-fallback($name, $value, $-fallbacks);
58
+ }
59
+
60
+ /// Output component stylesheet
61
+ /// - Note: This needs to be paired with the display helper class "hidden-visually-focusable"
62
+ /// - Note: Remember to add an id to the content you want to skip to. Often this will go to the content after the nav menu.
63
+ /// @example scss
64
+ /// @include ulu.component-skip-link-styles();
65
+ /// @example html
66
+ /// <a
67
+ /// class="skip-link hidden-visually-focusable"
68
+ /// href="#main-content"
69
+ /// >
70
+ /// Skip to main content
71
+ /// </a>
72
+ /// ...
73
+ /// <main id="main-content">...</main>
74
+
75
+ @mixin styles {
76
+ $prefix: selector.class("skip-link");
77
+
78
+ #{ $prefix } {
79
+ display: block;
80
+ position: fixed;
81
+ z-index: get("z-index");
82
+ top: 0;
83
+ left: 50%;
84
+ transform: translateX(-50%);
85
+ padding: get("padding");
86
+ background-color: get("background-color");
87
+ font-weight: bold;
88
+ box-shadow: get("box-shadow");
89
+ border-bottom-left-radius: get("border-radius");
90
+ border-bottom-right-radius: get("border-radius");
91
+ }
92
+ }