@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,241 @@
1
+ ////
2
+ /// @group slider
3
+ /// Slider/Carousal component that works with the ui/slider.js script
4
+ ////
5
+
6
+ @use "sass:map";
7
+
8
+ @use "../color";
9
+ @use "../utils";
10
+ @use "../breakpoint";
11
+ @use "../selector";
12
+
13
+ /// Module Settings
14
+ /// @type Map
15
+ /// @prop {Color} background-color [transparent] Background color for the entire slider section.
16
+ /// @prop {List} breakpoint ["small"] Currently commented out @joe-check
17
+ /// @prop {Dimension} margin-bottom [3rem] Bottom margin color for the entire slider section.
18
+ /// @prop {Dimension} margin-top [1rem] Top margin color for the entire slider section.
19
+ /// @prop {Dimension} padding-bottom [0] Bottom padding for individual slides.
20
+ /// @prop {Dimension} padding-bottom-small [0] Smaller option for bottom padding for individual slides. Currently commented out @joe-check
21
+ /// @prop {Dimension} padding-top [0] Top padding for individual slides.
22
+ /// @prop {Dimension} padding-top-small [0] Smaller option for top padding for individual slides. Currently commented out @joe-check
23
+ /// @prop {Color} button-background-color [transparent] Currently unused @joe-check
24
+ /// @prop {Color} button-background-color-hover [color.get("link-hover")] Currently unused @joe-check
25
+ /// @prop {CssValue} button-border [2px solid color.get("link")] Currently unused @joe-check
26
+ /// @prop {Color} button-border-color-hover [color.get("link-hover")] Currently unused @joe-check
27
+ /// @prop {Dimension} button-border-radius [50%] Currently unused @joe-check
28
+ /// @prop {Color} button-color [color.get("link")] Currently unused @joe-check
29
+ /// @prop {Color} button-color-hover [white] Currently unused @joe-check
30
+ /// @prop {Dimension} button-font-size [1.35rem] Currently unused @joe-check
31
+ /// @prop {Dimension} button-font-size-small [false] Currently unused @joe-check
32
+ /// @prop {Dimension} button-icon-offset-x [false] Offsets the control icons in from their respective sides. @joe-check
33
+ /// @prop {Dimension} button-icon-offset-y [false] Offsets the control options down by adding a margin.
34
+ /// @prop {Dimension} button-margin [0.75rem] The margin between the controls and the slide content when using .slide-gap-for-controls
35
+ /// @prop {Dimension} button-margin-small [0.75rem] Currently commented out @joe-check
36
+ /// @prop {Dimension} button-size [3rem] Size of the button. Likely antiquated and replaced with button-width and button-height
37
+ /// @prop {Dimension} button-size-small [false] Currently commented out @joe-check
38
+ /// @prop {Color} dot-background-color [transparent] The color of the dot when unselected.
39
+ /// @prop {Color} dot-background-color-hover [color.get("link")] The color of the dot when hovered.
40
+ /// @prop {Color} dot-background-color-selected [color.get("link")] The color of the dot when selected.
41
+ /// @prop {Dimension} dot-border-radius [50%] The border-radius of the dot.
42
+ /// @prop {Color} dot-border-color [color.get("link")] The border color of the dot.
43
+ /// @prop {Color} dot-border-color-hover [color.get("link")] The border color of the dot when hovered.
44
+ /// @prop {Color} dot-border-color-selected [color.get("link")] The border color of the dot when selected.
45
+ /// @prop {Dimension} dot-border-width [2px] The border width of the dot.
46
+ /// @prop {Dimension} dot-size [1rem] The height and width of the dot.
47
+ /// @prop {Dimension} button-height [1rem] The height of the button.
48
+ /// @prop {Dimension} button-width [1rem] The width of the button.
49
+
50
+ $config: (
51
+ "background-color" : transparent,
52
+ "breakpoint" : "small",
53
+ "margin-bottom" : 3rem,
54
+ "margin-top" : 1rem,
55
+ "button-background-color" : transparent,
56
+ "button-border" : 2px solid color.get("link"),
57
+ "button-border-color-hover" : color.get("link-hover"),
58
+ "button-border-radius" : 50%,
59
+ "button-color-hover" : white,
60
+ "button-background-color-hover" : color.get("link-hover"),
61
+ "button-color" : color.get("link"),
62
+ "button-font-size" : 1.35rem,
63
+ "button-icon-offset-x" : 2rem,
64
+ "button-icon-offset-y" : false,
65
+ "button-font-size-small" : false,
66
+ "button-margin" : 2rem,
67
+ "button-margin-small" : 0.75rem,
68
+ "button-size" : 3rem,
69
+ "button-size-small" : false,
70
+ "button-height": 2.5rem,
71
+ "button-width": 2.5rem,
72
+ "dot-background-color" : transparent,
73
+ "dot-background-color-hover" : color.get("link"),
74
+ "dot-background-color-selected" : color.get("link"),
75
+ "dot-border-color" : color.get("link"),
76
+ "dot-border-color-hover" : color.get("link"),
77
+ "dot-border-color-selected" : color.get("link"),
78
+ "dot-border-radius" : 50%,
79
+ "dot-border-width" : 2px,
80
+ "dot-size" : 1rem,
81
+ "padding-bottom" : 0,
82
+ "padding-bottom-small" : 0,
83
+ "padding-top" : 0,
84
+ "padding-top-small" : 0,
85
+ ) !default;
86
+
87
+ /// Change modules $config
88
+ /// @param {Map} $changes Map of changes
89
+ /// @example scss - General example
90
+ /// @include ulu.component-slider-set(( "property" : value ));
91
+
92
+ @mixin set($changes) {
93
+ $config: map.merge($config, $changes) !global;
94
+ }
95
+
96
+ /// Get a config option
97
+ /// @param {Map} $name Name of property
98
+ /// @example scss - General example
99
+ /// @include ulu.component-slider-get("property");
100
+
101
+ @function get($name) {
102
+ @return utils.require-map-get($config, $name, 'slider [config]');
103
+ }
104
+
105
+ /// Output component stylesheet
106
+ /// @example scss
107
+ /// @include ulu.component-slider-styles();
108
+
109
+ @mixin styles {
110
+ $prefix: selector.class("slider");
111
+ $prefix-plugin: selector.class("Slider");
112
+ $slide-padding-x: get("button-width") + get("button-margin");
113
+ #{ $prefix } {
114
+ position: relative; // for controls
115
+ background-color: get("background-color");
116
+ margin: get("margin-top") 0 get("margin-bottom") 0;
117
+ }
118
+ #{ $prefix }__track,
119
+ #{ $prefix-plugin }__controls,
120
+ #{ $prefix-plugin }__nav {
121
+ list-style: none !important;
122
+ padding-left: 0;
123
+ }
124
+ #{ $prefix-plugin }__control-button {
125
+ position: absolute;
126
+ top: 50%;
127
+ transform: translateY(-50%);
128
+ z-index: 10;
129
+ }
130
+ @if get("button-icon-offset-y") {
131
+ #{ $prefix-plugin }__control-icon {
132
+ margin-top: get("button-icon-offset-y");
133
+ }
134
+ }
135
+ #{ $prefix-plugin }__nav {
136
+ display: flex;
137
+ justify-content: center;
138
+ li {
139
+ margin: 0.5rem 0.15rem;
140
+ }
141
+ }
142
+ #{ $prefix-plugin }__nav-button {
143
+ display: block;
144
+ width: get("dot-size");
145
+ height: get("dot-size");
146
+ background-color: get("dot-background-color");
147
+ border: get("dot-border-width") solid get("dot-border-color");
148
+ border-radius: get("dot-border-radius");
149
+ &:hover {
150
+ background-color: get("dot-background-color-hover");
151
+ }
152
+ }
153
+ #{ $prefix-plugin }__nav-button--active,
154
+ #{ $prefix-plugin }__nav-button--active:hover {
155
+ background-color: get("dot-background-color-selected");
156
+ border-color: get("dot-border-color-selected");
157
+ }
158
+ #{ $prefix-plugin }__control-button,
159
+ #{ $prefix-plugin }__nav-button {
160
+ transition-property: color, background-color, border-color;
161
+ transition-duration: 300ms;
162
+ }
163
+ #{ $prefix }__title {
164
+ margin-top: -1.5rem !important;
165
+ margin-bottom: 1rem !important;
166
+ padding-bottom: 1rem;
167
+ text-align: center;
168
+ border-bottom: 1px solid rgba(0, 0, 0, 0.075);
169
+ }
170
+ #{ $prefix }__track {
171
+ // @daniel test this
172
+ #{ $prefix }--vertical-center & {
173
+ align-items: center;
174
+ }
175
+ }
176
+ // Options inner container to limit the controls to the just the track aria
177
+ // in order to exclude the dots/nav from the positioning of the controls
178
+ #{ $prefix }__control-context {
179
+ position: relative;
180
+ }
181
+ #{ $prefix }__slide {
182
+ margin: 0;
183
+ // @if (get("button-size-small")) {
184
+ // @include breakpoint.max(get("breakpoint")) {
185
+ // $bp-slide-padding: get("button-size-small") + get("button-margin-small");
186
+ // padding: get("padding-top-small") $bp-slide-padding get("padding-bottom-small") $bp-slide-padding;
187
+ // }
188
+ // }
189
+ }
190
+ // @joe-check should we remove this modifier for universal slide padding in favor of the individualized modifiers below?
191
+ #{ $prefix }--slide-control-margins {
192
+ #{ $prefix }__slide {
193
+ padding: get("padding-top") $slide-padding-x get("padding-bottom") $slide-padding-x;
194
+ }
195
+ }
196
+ .slide-gap-for-controls {
197
+ $padding: get("button-width") + get("button-margin");
198
+ padding-left: $padding;
199
+ padding-right: $padding;
200
+ }
201
+ #{ $prefix-plugin }__control-button--previous {
202
+ left: 0;
203
+ @if get("button-icon-offset-x") {
204
+ #{ $prefix-plugin }__control-icon {
205
+ margin-left: get("button-icon-offset-x");
206
+ }
207
+ }
208
+ }
209
+ #{ $prefix-plugin }__control-button--next {
210
+ right: 0;
211
+ @if get("button-icon-offset-x") {
212
+ #{ $prefix-plugin }__control-icon {
213
+ margin-right: get("button-icon-offset-x");
214
+ }
215
+ }
216
+ }
217
+ #{ $prefix }--inset-controls {
218
+ .slide-gap-for-controls {
219
+ $padding: get("button-width") + get("button-margin") + get("button-icon-offset-x");
220
+ padding-left: $padding;
221
+ padding-right: $padding;
222
+ }
223
+ #{ $prefix-plugin }__control-button--previous {
224
+ left: 0;
225
+ @if get("button-icon-offset-x") {
226
+ &#{ $prefix-plugin }__control-icon {
227
+ margin-left: get("button-icon-offset-x");
228
+
229
+ }
230
+ }
231
+ }
232
+ #{ $prefix-plugin }__control-button--next {
233
+ right: 0;
234
+ @if get("button-icon-offset-x") {
235
+ &#{ $prefix-plugin }__control-icon {
236
+ margin-right: get("button-icon-offset-x");
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
@@ -0,0 +1,193 @@
1
+ ////
2
+ /// @group spoke-spinner
3
+ /// A spoke style spinner/loader icon, requires ulu.base-keyframes
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:math";
8
+
9
+ @use "../selector";
10
+ @use "../utils";
11
+ @use "../color";
12
+
13
+ /// Module Settings
14
+ /// @type Map
15
+
16
+ $config: (
17
+ "size" : 48px,
18
+ "spoke-width" : 3px,
19
+ "spoke-height" : 12px,
20
+ "color" : "accent",
21
+ "border-radius" : 2px,
22
+ "duration" : 1.2s
23
+ ) !default;
24
+
25
+ /// Map of other sizes (use as modifiers), same properties as config/defaults
26
+ $styles: () !default;
27
+
28
+ /// Change modules $config
29
+ /// @param {Map} $changes Map of changes
30
+ /// @example scss
31
+ /// @include ulu.component-spoke-spinner-set(( "property" : value ));
32
+
33
+ @mixin set($changes) {
34
+ $config: map.merge($config, $changes) !global;
35
+ }
36
+
37
+ /// Set tag styles
38
+ /// @param {Map} $changes Map of changes
39
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
40
+
41
+ @mixin set-styles($changes, $merge-mode: null) {
42
+ $styles: utils.map-merge($styles, $changes, $merge-mode) !global;
43
+ }
44
+
45
+ /// Get a config option
46
+ /// @param {Map} $name Name of property
47
+ /// @example scss
48
+ /// @include ulu.component-spoke-spinner-get("property");
49
+
50
+ @function get($name) {
51
+ @return utils.require-map-get($config, $name, "spoke-spinner [config]");
52
+ }
53
+
54
+ /// Output component stylesheet
55
+ /// @example scss
56
+ /// @include ulu.component-spoke-spinner-styles();
57
+ /// @example html Example markup
58
+ /// <div class="spoke-spinner">
59
+ /// <div class="spoke-spinner__spinner">
60
+ /// <div></div>
61
+ /// <div></div>
62
+ /// <div></div>
63
+ /// <div></div>
64
+ /// <div></div>
65
+ /// <div></div>
66
+ /// <div></div>
67
+ /// <div></div>
68
+ /// <div></div>
69
+ /// <div></div>
70
+ /// <div></div>
71
+ /// <div></div>
72
+ /// </div>
73
+ /// </div>
74
+
75
+ @mixin styles {
76
+ $prefix: selector.class("spoke-spinner");
77
+
78
+
79
+ $size: get("size");
80
+ $sizeHalf: math.div($size, 2);
81
+
82
+ $spoke-width: get("spoke-width");
83
+ $spoke-widthHalf: math.div($spoke-width, 2);
84
+
85
+ #{ $prefix } {
86
+ position: relative;
87
+ vertical-align: middle; // When used as inline-block
88
+ }
89
+ #{ $prefix }__spinner {
90
+ display: inline-block;
91
+ position: relative;
92
+ width: $size;
93
+ height: $size;
94
+ }
95
+ #{ $prefix }__spinner div {
96
+ transform-origin: $sizeHalf $sizeHalf;
97
+ animation: UluFadeOut get("duration") linear infinite;
98
+ }
99
+ #{ $prefix }__spinner div:after {
100
+ content: " ";
101
+ display: block;
102
+ position: absolute;
103
+ top: 0;
104
+ left: $sizeHalf - $spoke-widthHalf;
105
+ width: $spoke-width;
106
+ height: get("spoke-height");
107
+ border-radius: get("border-radius");
108
+ background: color.get(get("color"));
109
+ }
110
+ #{ $prefix }__spinner div:nth-child(1) {
111
+ transform: rotate(0deg);
112
+ animation-delay: -1.1s;
113
+ }
114
+ #{ $prefix }__spinner div:nth-child(2) {
115
+ transform: rotate(30deg);
116
+ animation-delay: -1s;
117
+ }
118
+ #{ $prefix }__spinner div:nth-child(3) {
119
+ transform: rotate(60deg);
120
+ animation-delay: -0.9s;
121
+ }
122
+ #{ $prefix }__spinner div:nth-child(4) {
123
+ transform: rotate(90deg);
124
+ animation-delay: -0.8s;
125
+ }
126
+ #{ $prefix }__spinner div:nth-child(5) {
127
+ transform: rotate(120deg);
128
+ animation-delay: -0.7s;
129
+ }
130
+ #{ $prefix }__spinner div:nth-child(6) {
131
+ transform: rotate(150deg);
132
+ animation-delay: -0.6s;
133
+ }
134
+ #{ $prefix }__spinner div:nth-child(7) {
135
+ transform: rotate(180deg);
136
+ animation-delay: -0.5s;
137
+ }
138
+ #{ $prefix }__spinner div:nth-child(8) {
139
+ transform: rotate(210deg);
140
+ animation-delay: -0.4s;
141
+ }
142
+ #{ $prefix }__spinner div:nth-child(9) {
143
+ transform: rotate(240deg);
144
+ animation-delay: -0.3s;
145
+ }
146
+ #{ $prefix }__spinner div:nth-child(10) {
147
+ transform: rotate(270deg);
148
+ animation-delay: -0.2s;
149
+ }
150
+ #{ $prefix }__spinner div:nth-child(11) {
151
+ transform: rotate(300deg);
152
+ animation-delay: -0.1s;
153
+ }
154
+ #{ $prefix }__spinner div:nth-child(12) {
155
+ transform: rotate(330deg);
156
+ animation-delay: 0s;
157
+ }
158
+
159
+ // Map of config props needed for a new style, omitting props like color that aren't required
160
+ $required: (
161
+ "size" : get("size"),
162
+ "spoke-width" : get("spoke-width"),
163
+ "spoke-height" : get("spoke-height"),
164
+ );
165
+
166
+ @each $name, $style in $styles {
167
+ $merged: map.merge($required, $style);
168
+
169
+ $size: map.get($merged, "size");
170
+ $sizeHalf: math.div($size, 2);
171
+
172
+ $spoke-width: map.get($merged, "spoke-width");
173
+ $spoke-widthHalf: math.div($spoke-width, 2);
174
+
175
+ #{ $prefix }--#{ $name } {
176
+ #{ $prefix }__spinner {
177
+ width: $size;
178
+ height: $size;
179
+ }
180
+ #{ $prefix }__spinner div {
181
+ transform-origin: $sizeHalf $sizeHalf;
182
+ animation-duration: map.get($merged, "duration");
183
+ }
184
+ #{ $prefix }__spinner div:after {
185
+ left: $sizeHalf - $spoke-widthHalf;
186
+ width: $spoke-width;
187
+ height: map.get($merged, "spoke-height");
188
+ border-radius: map.get($merged, "border-radius");
189
+ background: color.get(map.get($merged, "color"));
190
+ }
191
+ }
192
+ }
193
+ }
@@ -0,0 +1,179 @@
1
+ ////
2
+ /// @group tabs
3
+ /// Tab interface component styles, for aria based tab interface
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:meta";
8
+
9
+ @use "../color";
10
+ @use "../selector";
11
+ @use "../breakpoint";
12
+ @use "../element";
13
+ @use "../utils";
14
+
15
+ // Used for function fallback
16
+ $-fallbacks: (
17
+ "tablist-border-bottom" : (
18
+ "function" : meta.get-function("get-rule-style", false, "element"),
19
+ "arguments" : ("light",)
20
+ )
21
+ );
22
+
23
+ /// Module Settings
24
+ /// @type Map
25
+ /// @prop {Dimension} border-radius [8px] The border radius of the tabs.
26
+ /// @prop {Dimension} border-width [0.25em] The width of the tab border.
27
+ /// @prop {Dimension} margin [2rem] The gap between tabs and above and below tabs.
28
+ /// @prop {Dimension} print-margin [1.5em] Margin between tabs when stacked for print
29
+ /// @prop {CssValue} tablist-border-bottom [true] The bottom border of the tabs. If set to true, will use the element.scss property for "get-rule-style".
30
+ /// @prop {Color} tabpanel-background-color [rgb(245, 245, 245)] The tabpanel background color.
31
+ /// @prop {Color} tab-border-color-selected [currentColor] The border color when selected.
32
+ /// @prop {String} tab-color [link] The type color for the tabs. This uses color.scss, so the value of this options should be a variable from color.scss.
33
+ /// @prop {String} tab-color-hover [link-hover] The type color for the tabs when hovered or focused. This uses color.scss, so the value of this options should be a variable from color.scss.
34
+ /// @prop {String} tab-color-selected [selected] The tab type color when selected. This uses color.scss, so the value of this options should be a variable from color.scss.
35
+
36
+ $config: (
37
+ "border-radius" : 8px,
38
+ "border-width" : 0.25em,
39
+ "margin" : 2rem,
40
+ "print-margin" : 1.5em,
41
+ "tablist-border-bottom" : true,
42
+ "tabpanel-background-color" : rgb(245, 245, 245),
43
+ "tab-border-color-selected" : currentColor,
44
+ "tab-color" : "link",
45
+ "tab-color-hover" : "link-hover",
46
+ "tab-color-selected" : "selected",
47
+ ) !default;
48
+
49
+ /// Change modules $config
50
+ /// @param {Map} $changes Map of changes
51
+ /// @example scss
52
+ /// @include ulu.component-tabs-set(( "property" : value ));
53
+
54
+ @mixin set($changes) {
55
+ $config: map.merge($config, $changes) !global;
56
+ }
57
+
58
+ /// Get a config option
59
+ /// @param {Map} $name Name of property
60
+ /// @example scss
61
+ /// @include ulu.component-tabs-get("property");
62
+
63
+ @function get($name) {
64
+ $value: utils.require-map-get($config, $name, "component-tabs [config]");
65
+ @return utils.function-fallback($name, $value, $-fallbacks);
66
+ }
67
+
68
+ /// Output component stylesheet
69
+ /// @example scss
70
+ /// @include ulu.component-tabs-styles();
71
+
72
+ @mixin styles {
73
+ @include utils.file-header("component", "tabs");
74
+
75
+ $prefix: selector.class("tabs");
76
+
77
+ #{ $prefix } {
78
+ margin-bottom: get("margin");
79
+ margin-top: get("margin");
80
+ [role="tablist"] {
81
+ position: relative;
82
+ z-index: 2;
83
+ display: flex;
84
+ overflow-x: auto;
85
+ margin-bottom: -1px;
86
+ border-bottom: get("tablist-border-bottom");
87
+ }
88
+ [role="tab"] {
89
+ display: block;
90
+ position: relative;
91
+ cursor: pointer;
92
+ padding: 0.75em 0.1em 0.75em 0.1em;
93
+ color: color.get(get("tab-color"));
94
+ font-weight: bold;
95
+ border-bottom: get("border-width") solid transparent;
96
+ text-align: center;
97
+ white-space: nowrap;
98
+ &:not(:first-child) {
99
+ margin-left: 1.25em;
100
+ @include breakpoint.min("small") {
101
+ margin-left: 2em;
102
+ }
103
+ }
104
+ &:hover {
105
+ color: color.get(get("tab-color-hover"));
106
+ }
107
+ &:hover,
108
+ &:focus,
109
+ &[aria-selected="true"] {
110
+ border-bottom-color: currentColor;
111
+ }
112
+ &[aria-selected="true"] {
113
+ color: color.get(get("tab-color-selected"));
114
+ border-bottom-color: get("tab-border-color-selected");
115
+ opacity: 1;
116
+ }
117
+ }
118
+ [role="tabpanel"] {
119
+ position: relative;
120
+ z-index: 1;
121
+ padding: 2rem get("margin");
122
+ margin-bottom: -1px;
123
+ overflow: hidden;
124
+
125
+ background-color: get("tabpanel-background-color");
126
+ [class*="video-embed"],
127
+ .full-width-image {
128
+ margin-left: -(get("margin"));
129
+ margin-right: -(get("margin"));
130
+ width: calc(100% + #{ get("margin") * 2 });
131
+ max-width: none;
132
+ &:first-child {
133
+ margin-top: -2rem;
134
+ }
135
+ &:last-child {
136
+ margin-bottom: -2rem;
137
+ }
138
+ }
139
+ }
140
+ }
141
+ #{ $prefix }--transparent {
142
+ [role="tablist"] {
143
+ background-color: transparent;
144
+ box-shadow: none;
145
+ padding-left: 0;
146
+ padding-right: 0;
147
+ }
148
+ [role="tabpanel"] {
149
+ background-color: transparent;
150
+ padding-left: 0;
151
+ padding-right: 0;
152
+ }
153
+ }
154
+
155
+ #{ $prefix }--full-width {
156
+ > [role="tablist"] {
157
+ justify-content: safe center;
158
+ box-shadow: 0 4px 4px rgba(0,0,0,0.2);
159
+ }
160
+ >[role="tabpanel"] {
161
+ background-color: transparent;
162
+ padding: 0;
163
+ }
164
+ }
165
+ // Display all tabs during print
166
+ #{ $prefix }--print {
167
+ @media print {
168
+ [role="tablist"] {
169
+ display: none;
170
+ }
171
+ [role="tabpanel"] {
172
+ display: block;
173
+ + [role="tabpanel"] {
174
+ margin-top: get("print-margin");
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }