@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,495 @@
1
+ ////
2
+ /// @group modal
3
+ ////
4
+
5
+ @use "sass:map";
6
+ @use "sass:meta";
7
+
8
+ @use "../color";
9
+ @use "../element";
10
+ @use "../layout";
11
+ @use "../typography";
12
+ @use "../selector";
13
+ @use "../utils";
14
+
15
+ // Used for function fallback
16
+ $-fallbacks: (
17
+ "backdrop-color" : (
18
+ "function" : meta.get-function("get", false, "element"),
19
+ "property" : "backdrop-color"
20
+ ),
21
+ "box-shadow" : (
22
+ "function" : meta.get-function("get", false, "element"),
23
+ "property" : "box-shadow-above",
24
+ ),
25
+ "border-radius" : (
26
+ "function" : meta.get-function("get", false, "element"),
27
+ "property" : "border-radius-large",
28
+ )
29
+ );
30
+
31
+ // todo [joe-check] for config options should items like 'dark-background-color' be 'background-color-dark' instead? Line 94
32
+
33
+ /// Module Settings
34
+ /// @type Map
35
+ /// @prop {CssValue} backdrop-blur [4px] Determines the blur of the backdrop.
36
+ /// @prop {Color} backdrop-color [true] The unblurred background color outside the modal. If set to true, will use the element.scss property for backdrop-color.
37
+ /// @prop {Color} background-color [white] The background color of the modal.
38
+ /// @prop {Dimension} body-padding [1rem] The padding of the body content.
39
+ /// @prop {CssValue} border-radius [true] The border radius of the modal. If set to true, will use the element.scss property for border-radius-large.
40
+ /// @prop {CssValue} box-shadow [true] Determines the box-shadow of the modal. If set to true, will use the element.scss property for backdrop-color.
41
+ /// @prop {Dimension} height [340px] The min-height of the modal.
42
+ /// @prop {Dimension} height-no-header [100px] The min-height of the modal.
43
+ /// @prop {Dimension} width [60rem] The width of the Modal
44
+ /// @prop {Time} animation-duration [300ms] Animation duration for the modal opening.
45
+ /// @prop {Time} animation-duration-exit [150ms] Animation duration for the modal closing.
46
+ /// @prop {CssValue} animation-timing-function [cubic-bezier(0, 0, .2, 1)] The animation timing menu of the modal.
47
+ /// @prop {Color} close-background-color [white] Background color for the modal close icon.
48
+ /// @prop {Close} close-background-color-hover [blue] Background color for the modal close icon when hovered or focused.
49
+ /// @prop {Color} close-color [black] Type color for the modal close icon.
50
+ /// @prop {Color} close-color-hover [black] Type color for the modal close icon when hovered or focused.
51
+ /// @prop {Dimension} close-font-size [1.2rem] Font-siz of of the modal close icon font size.
52
+ /// @prop {Dimension} close-margin [0.5rem] The margin for the modal close icon.
53
+ /// @prop {Dimension} close-size [2.5rem] Size of the modal close icon.
54
+ /// @prop {} dark-background-color [false] @joe-check unused
55
+ /// @prop {} dark-color [white] @joe-check unused
56
+ /// @prop {} dark-header-background-color [false] @joe-check unused
57
+ /// @prop {} dark-header-border-bottom [false] @joe-check unused
58
+ /// @prop {} dark-header-color [false] @joe-check unused
59
+ /// @prop {Color} header-background-color [black] Background color for the header.
60
+ /// @prop {CssValue} header-border-bottom [none] Bottom-border on the modal header.
61
+ /// @prop {Color} header-color [white] Type color of the header.
62
+ /// @prop {Dimension} header-padding [1rem] The padding of the modal header.
63
+ /// @prop {Color} resizer-background-color [rgb(221, 221, 221)] The background color of the resizer.
64
+ /// @prop {Color} resizer-background-color-hover [rgb(66, 66, 66)] The background color of the resizer when hovered or focused.
65
+ /// @prop {Color} resizer-color [black] The type color of the resizer.
66
+ /// @prop {Color} resizer-color-hover [black] The type color of the resizer when hovered or focused.
67
+ /// @prop {Dimension} resizer-width [1rem] The width of the resizer.
68
+ /// @prop {Color} title-color [white] Type color of the title.
69
+ /// @prop {CssValue} title-font-weight [bold] Font weight of the title.
70
+ /// @prop {Dimension} title-icon-margin [0.5em] The margin of the title icon
71
+ /// @prop {String} title-size [large] The font-size of the title. This uses typography.scss, so the value of this options should be a variable from typography.scss.
72
+ /// @prop {CssValue} title-text-transform [null] Transform option for the title.
73
+ /// @prop {Map} sizes [Map] Size options to enable unique stylings.
74
+
75
+ $config: (
76
+ "backdrop-color" : true,
77
+ "backdrop-blur" : 4px,
78
+ "background-color": white,
79
+ "body-padding": 1rem,
80
+ "border-radius" : true,
81
+ "box-shadow" : true,
82
+ "height": 340px,
83
+ "height-no-header": 100px,
84
+ "width": 60rem,
85
+
86
+ "animation-duration" : 300ms,
87
+ "animation-duration-exit" : 150ms,
88
+ "animation-timing-function" : cubic-bezier(0, 0, .2, 1),
89
+ "close-background-color": white,
90
+ "close-background-color-hover": blue,
91
+ "close-color": black,
92
+ "close-color-hover": black,
93
+ "close-font-size": 1.2rem,
94
+ "close-margin": 0.5rem,
95
+ "close-size": 2.5rem,
96
+ "dark-background-color" : false,
97
+ "dark-color" : white,
98
+ "dark-header-border-bottom" : false,
99
+ "dark-header-background-color" : false,
100
+ "dark-header-color" : false,
101
+ "header-background-color": black,
102
+ "header-border-bottom": none,
103
+ "header-color": white,
104
+ "header-padding": 1rem,
105
+ "resizer-background-color": rgb(221, 221, 221),
106
+ "resizer-background-color-hover": rgb(66, 66, 66),
107
+ "resizer-color": black,
108
+ "resizer-color-hover": black,
109
+ "resizer-width": 1rem,
110
+ "title-color": white,
111
+ "title-font-weight": bold,
112
+ "title-icon-margin" : 0.5em,
113
+ "title-size" : "large",
114
+ "title-text-transform" : null,
115
+ "sizes" : (
116
+ "small" : 30rem,
117
+ "large" : 80rem
118
+ ),
119
+ ) !default;
120
+
121
+ /// Change modules $config
122
+ /// @param {Map} $changes Map of changes
123
+ /// @example scss
124
+ /// @example
125
+ /// @include ulu.component-modal-set(( "property" : value ));
126
+
127
+ @mixin set($changes) {
128
+ $config: map.merge($config, $changes) !global;
129
+ }
130
+
131
+ /// Get a config option
132
+ /// @param {Map} $name Name of property
133
+ /// @example
134
+ /// @include ulu.component-modal-get("property");
135
+
136
+ @function get($name) {
137
+ $value: utils.require-map-get($config, $name, "component-modal [config]");
138
+ @return utils.function-fallback($name, $value, $-fallbacks);
139
+ }
140
+
141
+ /// Prints modal component styles
142
+ /// @example scss
143
+ /// @include ulu.component-modal-styles();
144
+
145
+ @mixin styles {
146
+ $prefix: selector.class("modal");
147
+
148
+ // // Before it's moved
149
+ [data-ulu-modal-builder] {
150
+ display: none;
151
+ }
152
+
153
+ #{ $prefix } {
154
+ // Required for click outside
155
+ position: fixed;
156
+ // Important: If you use the margin layout system (ie. auto) on dialogs they
157
+ // can't animate out correctly (thinking it jumps from dialog display system
158
+ // to normal block and doesn't work. This ALSO affects the z-index (seems to move from top-layer to normal layer). Z-index is for close
159
+ top: 50%;
160
+ left: 50%;
161
+ transform: translate(-50%, -50%);
162
+ z-index: layout.get("z-index-fixed") + 1;
163
+ margin: 0;
164
+ padding: 0;
165
+ border: 0;
166
+ width: get("width");
167
+ min-width: 200px; // For resizing minimum width
168
+ min-height: get("height");
169
+ max-height: 100vh;
170
+ max-width: 100%;
171
+ overflow-y: hidden;
172
+ box-sizing: border-box;
173
+ box-shadow: get("box-shadow");
174
+ border-radius: get("border-radius");
175
+ background-color: get("background-color");
176
+ box-sizing: border-box;
177
+ animation: uluModalCenterOut get("animation-duration-exit") get("animation-timing-function");
178
+ &[open] {
179
+ animation: uluModalCenterIn get("animation-duration") get("animation-timing-function");
180
+ display: flex;
181
+ flex-direction: column;
182
+ }
183
+ &::backdrop {
184
+ background: get("backdrop-color");
185
+ backdrop-filter: blur(get("backdrop-blur"));
186
+ animation: uluModalBackdropIn get("animation-duration") get("animation-timing-function");
187
+ }
188
+ }
189
+ #{ $prefix }__header {
190
+ display: flex;
191
+ justify-content: space-between;
192
+ align-items: center;
193
+ flex: 0;
194
+ padding: get("header-padding");
195
+ border-bottom: get("header-border-bottom");
196
+ background-color: get("header-background-color");
197
+ color: get("header-color");
198
+ }
199
+ #{ $prefix }__body {
200
+ flex: 1;
201
+ overflow: auto;
202
+ padding: get("body-padding");
203
+ }
204
+ #{ $prefix }__title {
205
+ display: flex;
206
+ align-items: baseline;
207
+ margin: 0;
208
+ color: color.get(get("title-color"));
209
+ font-weight: get("title-font-weight");
210
+ text-transform: get("title-text-transform");
211
+ @if (get("title-size")) {
212
+ @include typography.size(get("title-size"), $only-font-size: true);
213
+ }
214
+ }
215
+ #{ $prefix }__title-icon {
216
+ margin-right: get("title-icon-margin");
217
+ }
218
+ #{ $prefix }__close {
219
+ margin: 0 0 0 get("close-margin");
220
+ flex: 0 0 auto;
221
+ font-size: get("close-font-size");
222
+ width: get("close-size");
223
+ height: get("close-size");
224
+ background-color: get("close-background-color");
225
+ border-radius: 50%;
226
+ display: flex;
227
+ align-items: center;
228
+ justify-content: center;
229
+ color: get("close-color");
230
+ &:hover {
231
+ background-color: get("close-background-color-hover");
232
+ color: get("close-color-hover");
233
+ }
234
+ }
235
+ #{ $prefix }__resizer {
236
+ position: absolute;
237
+ top: 0;
238
+ bottom: 0;
239
+ left: 0;
240
+ width: get("resizer-width");
241
+ display: block;
242
+ cursor: col-resize;
243
+ background-color: get("resizer-background-color");
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: center;
247
+ transition-property: background-color, color;
248
+ transition-duration: 300ms;
249
+ transition-delay: 100ms;
250
+ color: get("resizer-color");
251
+ &:hover {
252
+ color: get("resizer-color-hover");
253
+ background-color: get("resizer-background-color-hover");
254
+ }
255
+ #{ $prefix }--left & {
256
+ left: auto;
257
+ right: 0;
258
+ }
259
+ }
260
+ #{ $prefix }__content {
261
+ margin-top: 2rem;
262
+ margin-bottom: 2rem;
263
+ line-height: 1.5;
264
+ color: rgba(0,0,0,.8);
265
+ }
266
+
267
+ // Modifiers
268
+ @each $name, $size-width in get("sizes") {
269
+ #{ $prefix }--#{ $name } {
270
+ width: $size-width;
271
+ }
272
+ }
273
+ #{ $prefix }--right,
274
+ #{ $prefix }--left {
275
+ border-radius: 0;
276
+ height: 100vh;
277
+ top: 0;
278
+ bottom: 0;
279
+ transform: none;
280
+ }
281
+ #{ $prefix }--top {
282
+ top: 0;
283
+ border-top-right-radius: 0;
284
+ border-top-left-radius: 0;
285
+ transform: translateX(-50%);
286
+ animation: uluModalTopOut get("animation-duration-exit") get("animation-timing-function");
287
+ &[open] {
288
+ animation: uluModalTopIn get("animation-duration") get("animation-timing-function");
289
+ }
290
+ }
291
+ #{ $prefix }--bottom {
292
+ top: auto;
293
+ bottom: 0;
294
+ transform: translateX(-50%);
295
+ border-bottom-left-radius: 0;
296
+ border-bottom-right-radius: 0;
297
+ animation: uluModalBottomOut get("animation-duration-exit") get("animation-timing-function");
298
+ &[open] {
299
+ animation: uluModalBottomIn get("animation-duration") get("animation-timing-function");
300
+ }
301
+ }
302
+ #{ $prefix }--right {
303
+ right: 0;
304
+ left: auto;
305
+ animation: uluModalRightOut get("animation-duration-exit") get("animation-timing-function");
306
+ &[open] {
307
+ animation: uluModalRightIn get("animation-duration") get("animation-timing-function");
308
+ }
309
+ }
310
+ #{ $prefix }--left {
311
+ left: 0;
312
+ animation: uluModalLeftOut get("animation-duration-exit") get("animation-timing-function");
313
+ &[open] {
314
+ animation: uluModalLeftIn get("animation-duration") get("animation-timing-function");
315
+ }
316
+ }
317
+ #{ $prefix }--no-header {
318
+ min-height: get("height-no-header");
319
+ }
320
+ #{ $prefix }--no-backdrop {
321
+ &::backdrop {
322
+ display: none;
323
+ }
324
+ }
325
+ #{ $prefix }--resize {
326
+ &#{ $prefix }--center {
327
+ resize: both;
328
+ }
329
+ &#{ $prefix }--right {
330
+ padding-left: get("resizer-width");
331
+ }
332
+ &#{ $prefix }--left {
333
+ padding-right: get("resizer-width");
334
+ }
335
+ }
336
+ #{ $prefix }--body-fills {
337
+ #{ $prefix }__header {
338
+ border-bottom: none;
339
+ }
340
+ #{ $prefix }__body {
341
+ padding: 0;
342
+ }
343
+ }
344
+
345
+ #{ $prefix }--no-min-height {
346
+ min-height: 0;
347
+ }
348
+ // Will display as content when printing
349
+ // NOTE: This will not work with native dialog
350
+ // Printing works with modal printer by cloning mechanism
351
+ // .modal--print {
352
+ // @media screen {
353
+ // display: block !important;
354
+ // position: static;
355
+ // top: auto;
356
+ // left: auto;
357
+ // right: auto;
358
+ // bottom: auto;
359
+ // width: auto;
360
+ // max-width: none;
361
+ // }
362
+ // }
363
+
364
+ @keyframes uluModalBackdropIn {
365
+ 0% {
366
+ background-color: rgba(0, 0, 0, 0);
367
+ backdrop-filter: blur(0);
368
+ }
369
+ 100% {
370
+ background-color: get("backdrop-color");
371
+ backdrop-filter: blur(get("backdrop-blur"));
372
+ }
373
+ }
374
+ @keyframes uluModalCenterIn {
375
+ from {
376
+ opacity: 0;
377
+ transform: translate(-50%, -40%);
378
+ display: none;
379
+ }
380
+ to {
381
+ opacity: 1;
382
+ transform: translate(-50%, -50%);
383
+ display: block;
384
+ }
385
+ }
386
+ @keyframes uluModalCenterOut {
387
+ from {
388
+ opacity: 1;
389
+ display: block;
390
+ transform: translate(-50%, -50%);
391
+ }
392
+ to {
393
+ opacity: 0;
394
+ display: none;
395
+ transform: translate(-50%, 40%);
396
+ }
397
+ }
398
+ @keyframes uluModalTopIn {
399
+ from {
400
+ opacity: 0;
401
+ transform: translate(-50%, -15%);
402
+ display: none;
403
+ }
404
+ to {
405
+ opacity: 1;
406
+ transform: translate(-50%, 0);
407
+ display: block;
408
+ }
409
+ }
410
+ @keyframes uluModalTopOut {
411
+ from {
412
+ opacity: 1;
413
+ display: block;
414
+ transform: translate(-50%, 0);
415
+ }
416
+ to {
417
+ opacity: 0;
418
+ display: none;
419
+ transform: translate(-50%, -15%);
420
+ }
421
+ }
422
+ @keyframes uluModalBottomIn {
423
+ from {
424
+ opacity: 0;
425
+ transform: translate(-50%, 15%);
426
+ display: none;
427
+ }
428
+ to {
429
+ opacity: 1;
430
+ transform: translate(-50%, 0);
431
+ display: block;
432
+ }
433
+ }
434
+ @keyframes uluModalBottomOut {
435
+ from {
436
+ opacity: 1;
437
+ display: block;
438
+ transform: translate(-50%, 0);
439
+ }
440
+ to {
441
+ opacity: 0;
442
+ display: none;
443
+ transform: translate(-50%, 15%);
444
+ }
445
+ }
446
+ @keyframes uluModalLeftIn {
447
+ from {
448
+ opacity: 0;
449
+ transform: translateX(-15%);
450
+ display: none;
451
+ }
452
+ to {
453
+ opacity: 1;
454
+ transform: translateX(0);
455
+ display: block;
456
+ }
457
+ }
458
+ @keyframes uluModalLeftOut {
459
+ from {
460
+ opacity: 1;
461
+ display: block;
462
+ transform: translateX(0);
463
+ }
464
+ to {
465
+ opacity: 0;
466
+ display: none;
467
+ transform: translateX(-15%);
468
+ }
469
+ }
470
+ @keyframes uluModalRightIn {
471
+ from {
472
+ opacity: 0;
473
+ transform: translateX(15%);
474
+ display: none;
475
+ }
476
+ to {
477
+ opacity: 1;
478
+ transform: translateX(0);
479
+ display: block;
480
+ }
481
+ }
482
+ @keyframes uluModalRightOut {
483
+ from {
484
+ opacity: 1;
485
+ display: block;
486
+ transform: translateX(0);
487
+ }
488
+ to {
489
+ opacity: 0;
490
+ display: none;
491
+ transform: translateX(15%);
492
+ }
493
+ }
494
+ }
495
+
@@ -0,0 +1,148 @@
1
+ ////
2
+ /// @group nav-strip
3
+ ////
4
+ /// A horizontal navigation strip or rail that displays a list of links to
5
+ /// different pages or sections of a website. The active link, indicating the
6
+ /// current page or section, is visually emphasized with an underline.
7
+
8
+ @use "sass:map";
9
+
10
+ @use "../utils";
11
+ @use "../color";
12
+ @use "../selector";
13
+ @use "../typography";
14
+
15
+ /// Module Settings
16
+ /// @type Map
17
+ /// @prop {String} activeSelector [.is-active] Selector that portrays active status.
18
+ /// @prop {Color} color [null] Type color for the nav-strip.
19
+ /// @prop {Color} color-active [null] Type color for the nav-strip when active.
20
+ /// @prop {Color} color-hover [null] Type color for the nav-strip when hovered or focused.
21
+ /// @prop {CssValue} font-weight [null] Font weight of navstrip.
22
+ /// @prop {Dimension} margin-between [2.25em] Margin between nav-strip items.
23
+ /// @prop {Boolean} nowrap [true] Disables the word wrap.
24
+ /// @prop {Dimension} padding-x [0] Horizontal padding for the nav-strip links.
25
+ /// @prop {Dimension} padding-y [0.3em] Vertical padding for the nav-strip links.
26
+ /// @prop {Dimension} padding-y-ruled [null] Vertical padding for the nav-strip links when using nav-strip--rule.
27
+ /// @prop {Color} underline-color [orange] Underline color when link is active.
28
+ /// @prop {Dimension} underline-size [3px] Size of the underline.
29
+ /// @prop {Color} underline-color-hover [gray] Color of the underline when hovered or focused.
30
+ /// @prop {String} rule-color [rule] Rule color. Uses rule.scss so the value of this options should be a variable from rule.scss.
31
+ /// @prop {Dimension} rule-size [3px] Size of the nav-strip rule.
32
+ /// @prop {Dimension} rule-offset [-3px] Offset the rule for the navstrip.
33
+
34
+ $config: (
35
+ "activeSelector" : "&.is-active, &.has-active",
36
+ "color" : null,
37
+ "color-active" : null,
38
+ "color-hover" : null,
39
+ "font-weight" : null,
40
+ "margin-between" : 2.25em,
41
+ "padding-x" : 0,
42
+ "padding-y" : 0.3em,
43
+ "padding-y-ruled" : null,
44
+ "nowrap" : true,
45
+ "rule-color" : "rule",
46
+ "rule-offset" : -3px,
47
+ "rule-size" : 3px,
48
+ "underline-color" : orange,
49
+ "underline-color-hover" : gray,
50
+ "underline-size" : 3px,
51
+ ) !default;
52
+
53
+
54
+ /// Change modules $config
55
+ /// @param {Map} $changes Map of changes
56
+ /// @example
57
+ /// @include ulu.component-nav-strip-set(( "property" : value ));
58
+
59
+ @mixin set($changes) {
60
+ $config: map.merge($config, $changes) !global;
61
+ }
62
+
63
+ /// Get a config option
64
+ /// @param {Map} $name Name of property
65
+ /// @example
66
+ /// @include ulu.component-nav-strip-get("property");
67
+
68
+ @function get($name) {
69
+ @return utils.require-map-get($config, $name, "card [config]");
70
+ }
71
+
72
+ /// Prints component styles
73
+ /// @example
74
+ /// @include ulu.component-nav-strip-styles();
75
+
76
+ @mixin styles {
77
+ $prefix: selector.class("nav-strip");
78
+
79
+ // Original thought to not limit to direct child
80
+ // auto is for when we don't have control over markup
81
+ // The list descendants will be selected that way but the list is
82
+ // currently selecting any list/list-item
83
+ #{ $prefix }__list,
84
+ #{ $prefix }--auto ul {
85
+ display: flex;
86
+ line-height: typography.get("line-height-dense");
87
+ }
88
+ #{ $prefix }__item,
89
+ #{ $prefix }--auto li {
90
+ margin-right: get("margin-between");
91
+ // layout flex since items inside may not be the same height
92
+ display: flex;
93
+ align-items: flex-end;
94
+ &:last-child {
95
+ margin-right: 0;
96
+ }
97
+ }
98
+
99
+ #{ $prefix }__link,
100
+ #{ $prefix }--auto li > a,
101
+ #{ $prefix }--auto li > button {
102
+ display: block;
103
+ color: get("color");
104
+ padding: get("padding-y") get("padding-x");
105
+ border-top: get("underline-size") solid transparent;
106
+ border-bottom: get("underline-size") solid transparent;
107
+ font-weight: get("font-weight");
108
+ @if (get("nowrap")) {
109
+ white-space: nowrap;
110
+ }
111
+ &:hover,
112
+ &:focus {
113
+ border-bottom-color: get("underline-color-hover");
114
+ color: get("color-hover");
115
+ }
116
+ #{ get("activeSelector") } {
117
+ border-bottom-color: get("underline-color");
118
+ color: get("color-active");
119
+ }
120
+ }
121
+
122
+ // Modifiers
123
+ #{ $prefix }--right {
124
+ #{ $prefix }__list,
125
+ &#{ $prefix }--auto ul {
126
+ justify-content: flex-end;
127
+ }
128
+ }
129
+ #{ $prefix }--center {
130
+ #{ $prefix }__list,
131
+ &#{ $prefix }--auto ul {
132
+ justify-content: center;
133
+ }
134
+ }
135
+ #{ $prefix }--rule {
136
+ #{ $prefix }__list,
137
+ &#{ $prefix }--auto ul {
138
+ border-bottom: get("rule-size") solid color.get(get("rule-color"));
139
+ }
140
+ #{ $prefix }__link,
141
+ &#{ $prefix }--auto li > a,
142
+ &#{ $prefix }--auto li > button {
143
+ margin-bottom: get("rule-offset");
144
+ padding-top: get("padding-y-ruled");
145
+ padding-bottom: get("padding-y-ruled");
146
+ }
147
+ }
148
+ }