@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,122 @@
1
+ ////
2
+ /// @group overlay-section
3
+ ////
4
+
5
+ // NOTE: This is an updated version that uses floating UI
6
+
7
+ @use "sass:math";
8
+ @use "sass:map";
9
+ @use "../utils";
10
+ @use "../breakpoint";
11
+
12
+ /// Module Settings
13
+ /// @type Map
14
+ /// @prop {Color} content-background-color [white] The background color of the content.
15
+ /// @prop {CssValue} content-border [1px solid rgb(227, 227, 227)] The border of the content
16
+ /// @prop {Dimension} content-padding [2.5rem] The padding of the content.
17
+ /// @prop {Dimension} content-width [34rem] The width of the content.
18
+ /// @prop {Dimension} min-height [75vh] the min-height of the section.
19
+ /// @prop {Dimension} padding [6rem] The padding of the container.
20
+ /// @prop {Map} breakpoints [Map] The breakpoints of the section.
21
+
22
+ $config: (
23
+ "content-background-color" : white,
24
+ "content-border" : 1px solid rgb(227, 227, 227),
25
+ "content-padding" : 2.5rem,
26
+ "content-width" : 34rem,
27
+ "min-height" : 75vh,
28
+ "padding" : 6rem,
29
+ "breakpoints" : (
30
+ "medium" : (
31
+ "direction" : "down",
32
+ "padding" : 4rem,
33
+ ),
34
+ "small" : (
35
+ "direction" : "down",
36
+ "padding" : 2rem,
37
+ "content-padding" : 1.5rem
38
+ )
39
+ )
40
+ ) !default;
41
+
42
+ /// Change modules $config
43
+ /// @param {Map} $changes Map of changes
44
+ /// @example
45
+ /// @include ulu.component-overlay-section-set(( "property" : value ));
46
+
47
+ @mixin set($changes) {
48
+ $config: map.merge($config, $changes) !global;
49
+ }
50
+
51
+ /// Get a config option
52
+ /// @param {Map} $name Name of property
53
+ /// @example
54
+ /// @include ulu.component-overlay-section-get("property");
55
+
56
+ @function get($name) {
57
+ @return utils.require-map-get($config, $name, "overlay-section [config]");
58
+ }
59
+
60
+ /// Prints component styles
61
+ /// @example scss
62
+ /// @example scss
63
+ /// @include ulu.component-overlay-section-styles();
64
+
65
+ @mixin styles {
66
+
67
+ .overlay-section {
68
+ position: relative;
69
+ display: flex;
70
+ min-height: get("min-height");
71
+ align-items: center;
72
+ justify-content: center;
73
+ padding: get("padding");
74
+
75
+ @each $breakpoint, $props in get("breakpoints") {
76
+ $direction: map.get($props, "direction");
77
+ @include breakpoint.from($breakpoint, $direction) {
78
+ padding: map.get($props, "padding");
79
+ min-height: map.get($props, "min-height");
80
+ }
81
+ }
82
+ }
83
+ .overlay-section__background {
84
+ position: absolute;
85
+ top: 0;
86
+ left: 0;
87
+ right: 0;
88
+ bottom: 0;
89
+ img,
90
+ video {
91
+ object-fit: cover;
92
+ height: 100%;
93
+ width: 100%;
94
+ }
95
+ }
96
+ .overlay-section__content {
97
+ position: relative;
98
+ z-index: 2;
99
+ background-color: get("content-background-color");
100
+ border: get("content-border");
101
+ flex: 0 1 get("content-width");
102
+ padding: get("content-padding");
103
+ @each $breakpoint, $props in get("breakpoints") {
104
+ $direction: map.get($props, "direction");
105
+ @include breakpoint.from($breakpoint, $direction) {
106
+ padding: map.get($props, "content-padding");
107
+ }
108
+ }
109
+ }
110
+ .overlay-section--top {
111
+ align-items: flex-start;
112
+ }
113
+ .overlay-section--bottom {
114
+ align-items: flex-end;
115
+ }
116
+ .overlay-section--left {
117
+ justify-content: flex-start;
118
+ }
119
+ .overlay-section--right {
120
+ justify-content: flex-end;
121
+ }
122
+ }
@@ -0,0 +1,168 @@
1
+ ////
2
+ /// @group pager
3
+ ////
4
+
5
+
6
+ @use "sass:map";
7
+
8
+ @use "../utils";
9
+ @use "../color";
10
+
11
+ // Markup Matches Drupal Pager
12
+
13
+ // todo [joe-check] for config options, active comes before (active-color) in this module while other modules have it come afer(color-active) Line 30
14
+
15
+ /// Module Settings
16
+ /// @type Map
17
+ /// @prop {String} background-color [link] The background color of the pager. This uses color.scss, so the value of this options should be a color variable from color.scss.
18
+ /// @prop {String} background-color-hover [linkhover] The background color of the pager when hovered or focused. This uses color.scss, so the value of this options should be a color variable from color.scss.
19
+ /// @prop {String} border-color [link] The border color of the pager item. This uses color.scss, so the value of this options should be a color variable from color.scss.
20
+ /// @prop {String} border-color-hover [linkhover] The border color of the pager item when hovered or focused. This uses color.scss, so the value of this options should be a color variable from color.scss.
21
+ /// @prop {Dimension} border-radius [50%] The border radius of the pager item.
22
+ /// @prop {Dimension} border-width [1px] The border width of the pager item.
23
+ /// @prop {Color} color [white] The type color of the pager item.
24
+ /// @prop {Color} color-hover [white] The type color of the pager item when covered and focused.
25
+ /// @prop {CssValue} font-weight [bold] Font-weight of the pager.
26
+ /// @prop {Dimension} item-margin [0.17rem] The item margin.
27
+ /// @prop {Dimension} margin-bottom [2rem] The bottom margin of the pager.
28
+ /// @prop {Dimension} margin-top [1rem] The top margin of the pager.
29
+ /// @prop {Dimension} width [2.5rem] The width of the pager items.
30
+ /// @prop {Color} active-background-color [#ccc] The background color of the pager when active.
31
+ /// @prop {Color} active-border-color [#ccc] The border color of the pager when active.
32
+ /// @prop {Color} active-color [type] The type color when active. This uses color.scss, so the value of this options should be a color variable from color.scss.
33
+ /// @prop {CssValue} active-font-weight [bold] The font weight of the pager when focused or hovered.
34
+ /// @prop {String} action-background-color [link] The background color of the actions options of the pager. This uses color.scss, so the value of this options should be a color variable from color.scss.
35
+ /// @prop {String} action-background-color-hover [linkhover] The background color of the actions options of the pager when focused or hovered. This uses color.scss, so the value of this options should be a color variable from color.scss.
36
+ /// @prop {Color} action-border-color [transparent] The border color of the action options of the pager.
37
+ /// @prop {String} action-border-color-hover [link] The border color of the action options of the pager when focused or hovered. This uses color.scss, so the value of this options should be a color variable from color.scss.
38
+ /// @prop {Color} action-color [white] The type color of the actions options of the pager.
39
+ /// @prop {Color} action-color-hover [white] The type color of the actions options of the pager when focused or hovered.
40
+ /// @prop {Dimension} action-margin [0.8rem] The margin of the action options of the pager.
41
+ /// @prop {Dimension} action-width [2.5rem] The width of the action options of the pager.
42
+
43
+ $config: (
44
+ "background-color": "link",
45
+ "background-color-hover": "link-hover",
46
+ "border-color": "link",
47
+ "border-color-hover": "link-hover",
48
+ "border-radius": 50%,
49
+ "border-width": 1px,
50
+ "color": white,
51
+ "color-hover": white,
52
+ "font-weight": bold,
53
+ "item-margin": 0.17rem,
54
+ "margin-bottom": 2rem,
55
+ "margin-top": 1rem,
56
+ "width": 2.5rem,
57
+
58
+ "active-background-color": #ccc,
59
+ "active-border-color": #ccc,
60
+ "active-color": "type",
61
+ "active-font-weight": bold,
62
+
63
+ "action-background-color": "link",
64
+ "action-background-color-hover": "link-hover",
65
+ "action-border-color": transparent,
66
+ "action-border-color-hover": "link",
67
+ "action-color": white,
68
+ "action-color-hover": white,
69
+ "action-margin": 0.8rem,
70
+ "action-width": 2.5rem,
71
+ ) !default;
72
+
73
+ /// Change modules $config
74
+ /// @param {Map} $changes Map of changes
75
+ /// @example
76
+ /// @include ulu.component-pager-set(( "property" : value ));
77
+
78
+ @mixin set($changes) {
79
+ $config: map.merge($config, $changes) !global;
80
+ }
81
+
82
+ /// Get a config option
83
+ /// @param {Map} $name Name of property
84
+ /// @example
85
+ /// @include ulu.component-pager-get("property");
86
+
87
+
88
+ @function get($name) {
89
+ @return utils.require-map-get($config, $name, "card [config]");
90
+ }
91
+
92
+ /// Prints component styles
93
+ /// @example scss
94
+ /// @include ulu.component-pager-styles();
95
+
96
+ @mixin styles {
97
+ .pager {
98
+ font-weight: get("font-weight");
99
+ margin-top: get("margin-top");
100
+ margin-bottom: get("margin-bottom");
101
+ }
102
+ .pager__items {
103
+ display: flex;
104
+ justify-content: center;
105
+ align-items: center;
106
+ flex-wrap: wrap;
107
+ }
108
+ .pager__item {
109
+ margin: get("item-margin");
110
+ a {
111
+
112
+ display: block;
113
+ text-align: center;
114
+ width: get("width");
115
+ height: get("width");
116
+ line-height: get("width");
117
+ display: flex;
118
+ justify-content: center;
119
+ align-items: center;
120
+ border-radius: get("border-radius");
121
+ border: get("border-width") solid color.get(get("border-color"));
122
+ background-color: color.get(get("background-color"));
123
+ color: get("color");
124
+ &:hover {
125
+ color: get("color-hover");
126
+ border-color: color.get(get("border-color-hover"));
127
+ background-color: color.get(get("background-color-hover"));
128
+ }
129
+ }
130
+ &.is-active,
131
+ &--current {
132
+ a,
133
+ a:hover,
134
+ span {
135
+ font-weight: get("font-weight");
136
+ color: color.get(get("active-color"));
137
+ background-color: get("active-background-color");
138
+ border-color: get("active-border-color");
139
+ }
140
+ }
141
+ }
142
+ .pager__item--first,
143
+ .pager__item--previous,
144
+ .pager__item--next,
145
+ .pager__item--last {
146
+ a {
147
+ width: get("action-width");
148
+ height: get("action-width");
149
+ line-height: get("action-width");
150
+ background-color: color.get(get("action-background-color"));
151
+ color: get("action-color");
152
+ font-size: 1.2rem;
153
+ line-height: 2.8rem;
154
+ font-weight: bold;
155
+ &:hover {
156
+ border-color: color.get(get("action-border-color-hover"));
157
+ background-color: color.get(get("action-background-color-hover"));
158
+ color: get("action-color-hover");
159
+ }
160
+ }
161
+ }
162
+ .pager__item--previous {
163
+ margin-right: get("action-margin")
164
+ }
165
+ .pager__item--next {
166
+ margin-left: get("action-margin")
167
+ }
168
+ }
@@ -0,0 +1,121 @@
1
+ ////
2
+ /// @group placeholder-block
3
+ ////
4
+
5
+ @use "sass:map";
6
+ @use "sass:meta";
7
+
8
+ @use "../selector";
9
+ @use "../utils";
10
+ @use "../color";
11
+ @use "../element";
12
+
13
+ // Used for function fallback
14
+ $-fallbacks: (
15
+ "border-radius" : (
16
+ "function" : meta.get-function("get", false, "element"),
17
+ "property" : "border-radius-large"
18
+ ),
19
+ "color" : (
20
+ "function" : meta.get-function("get", false, "color"),
21
+ "property" : "type-tertiary"
22
+ ),
23
+ "margin-bottom": (
24
+ "function" : meta.get-function("get", false, "element"),
25
+ "property" : "margin"
26
+ ),
27
+ );
28
+
29
+ // todos [joe-check] for the config options, compact is at the end in this module (padding-compact) but at the beginning in card-grid(gap-compact) Line 35
30
+
31
+ /// Module Settings
32
+ /// @type Map
33
+ /// @prop {Color} background-color [rgba(0,0,0,0.15)] The background color of the placeholder.
34
+ /// @prop {Color} color [true] The type color of the placeholder. If set to true, will use the "type-tertiary" variable from color.scss.
35
+ /// @prop {Dimension} margin-bottom [true] The bottom margin of the placeholder. If set to true, will use the "margin" variable from element.scss.
36
+ /// @prop {Dimension} padding [2em] The padding of the placeholder.
37
+ /// @prop {Dimension} padding-compact [(0.5em 1em)] The padding of the placeholder when using the compact option.
38
+ /// @prop {Dimension} expanded-height [15rem] The height of the placeholder when using the expanded option.
39
+ /// @prop {Color} border-color [rgba(0,0,0,0.3)] The border color.
40
+ /// @prop {Dimension} border-radius [true] The border radius of the placeholder. If set to true, will use the "border-radius-large" variable from element.scss.
41
+ /// @prop {CssValue} border-style [dashed] The border style of the placeholder border.
42
+ /// @prop {Dimension} border-width [2px] The border width of the placeholder.
43
+ /// @prop {Dimension} border-width-compact [1px] The border width of the placeholder when using the compact option.
44
+ /// @prop {Dimension} icon-font-size [3em] The font-size of the placeholder icon.
45
+ /// @prop {Dimension} icon-margin [0.25em] The margin of the placeholder icon.
46
+ /// @prop {Color} icon-color [rgba(0, 0, 0, 0.5)] The icon type color.
47
+
48
+
49
+ $config: (
50
+ "background-color" : rgba(0,0,0,0.15),
51
+ "color" : true,
52
+ "expanded-height" : 15rem,
53
+ "margin-bottom" : true,
54
+ "padding" : 2em,
55
+ "padding-compact" : (0.5em 1em),
56
+
57
+ "border-color" : rgba(0,0,0,0.3),
58
+ "border-radius" : true,
59
+ "border-style" : dashed,
60
+ "border-width" : 2px,
61
+ "border-width-compact" : 1px,
62
+ "icon-color" : rgba(0, 0, 0, 0.5),
63
+ "icon-font-size" : 3em,
64
+ "icon-margin" : 0.25em,
65
+ ) !default;
66
+
67
+
68
+ /// Change modules $config
69
+ /// @param {Map} $changes Map of changes
70
+ /// @example
71
+ /// @include ulu.component-placeholder-block-set(( "property" : value ));
72
+
73
+ @mixin set($changes) {
74
+ $config: map.merge($config, $changes) !global;
75
+ }
76
+
77
+ /// Get a config option
78
+ /// @param {Map} $name Name of property
79
+ /// @example
80
+ /// @include ulu.component-placeholder-block-get("property");
81
+
82
+ @function get($name) {
83
+ $value: utils.require-map-get($config, $name, "placeholder [config]");
84
+ @return utils.function-fallback($name, $value, $-fallbacks);
85
+ }
86
+
87
+ /// Prints component styles
88
+ /// @example scss
89
+ /// @include ulu.component-placeholder-block-styles();
90
+
91
+ @mixin styles {
92
+ $prefix: selector.class("placeholder-block");
93
+
94
+ #{ $prefix } {
95
+ background-color: get("background-color");
96
+ display: flex;
97
+ flex-direction: column;
98
+ justify-content: center;
99
+ align-items: center;
100
+ text-align: center;
101
+ padding: get("padding");
102
+ color: get("color");
103
+ border: get("border-width") get("border-style") get("border-color");
104
+ margin-bottom: get("margin-bottom");
105
+ border-radius: get("border-radius");
106
+ }
107
+ #{ $prefix }__icon {
108
+ color: get("icon-color");
109
+ display: block;
110
+ margin: 0 auto get("icon-margin") auto;
111
+ font-size: get("icon-font-size");
112
+ }
113
+ #{ $prefix }--compact {
114
+ padding: get("padding-compact");
115
+ display: block;
116
+ border-width: get("border-width-compact");
117
+ }
118
+ #{ $prefix }--expanded {
119
+ min-height: get("expanded-height");
120
+ }
121
+ }
@@ -0,0 +1,263 @@
1
+ ////
2
+ /// @group popover
3
+ ////
4
+
5
+ // NOTE: This is an updated version that uses floating UI
6
+
7
+ @use "sass:math";
8
+ @use "sass:map";
9
+ @use "sass:meta";
10
+
11
+ @use "../selector";
12
+ @use "../typography";
13
+ @use "../utils";
14
+ @use "../color";
15
+ @use "../layout";
16
+ @use "../element";
17
+
18
+ // Used for function fallback
19
+ $-fallbacks: (
20
+ "box-shadow" : (
21
+ "function" : meta.get-function("get", false, "element"),
22
+ "property" : "box-shadow-above",
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
+ /// @prop {Dimension} arrow-size [16px]
33
+ /// @prop {Color} background-color [white]
34
+ /// @prop {Dimension} border-radius [6px]
35
+ /// @prop {Color} color [inherit]
36
+ /// @prop {Dimension} max-width [90vw]
37
+ /// @prop {Dimension} max-height [25rem]
38
+ /// @prop {Dimension} padding [1rem]
39
+ /// @prop {Dimension} padding-large [2rem]
40
+ /// @prop {Dimension} type-size [null]
41
+ /// @prop {Number} z-index [true]
42
+ /// @prop {CssValue} box-shadow [true]
43
+ /// @prop {CssValue} box-shadow-footer [0 0 4px]
44
+ /// @prop {String} box-shadow-footer-color ["box-shadow"]
45
+ /// @prop {Color} header-background-color [#ccc]
46
+ /// @prop {Color} header-color [null]
47
+ /// @prop {Color} header-media-background-color [black]
48
+ /// @prop {Dimension} header-padding-y [0.25rem]
49
+ /// @prop {Color} footer-background-color [#ccc]
50
+ /// @prop {Color} footer-color [null]
51
+ /// @prop {Dimension} footer-padding-y [0.25rem]
52
+ /// @prop {Dimension} footer-padding-y-large [0.5rem]
53
+ /// @prop {Color} tooltip-background-color [white]
54
+ /// @prop {Color} tooltip-color [null]
55
+ /// @prop {Dimension} tooltip-max-width [20rem]
56
+ /// @prop {Dimension} tooltip-padding [0.5rem]
57
+ /// @prop {Dimension} tooltip-width [auto]
58
+ /// @prop {Dimension} width [15rem]
59
+ /// @prop {Dimension} width-large [30rem]
60
+ /// @prop {Dimension} width-large-x [50rem]
61
+
62
+ $config: (
63
+ "arrow-size" : 16px,
64
+ "background-color" : white,
65
+ "border-radius" : 6px,
66
+ "color" : inherit,
67
+ "max-width" : 90vw,
68
+ "max-height" : 25rem,
69
+ "padding" : 1rem,
70
+ "padding-large" : 2rem,
71
+ "type-size" : null,
72
+ "z-index" : true,
73
+
74
+ "box-shadow" : true,
75
+ "box-shadow-footer" : 0 0 4px,
76
+ "box-shadow-footer-color" : "box-shadow",
77
+ "header-background-color" : #ccc,
78
+ "header-color" : null,
79
+ "header-media-background-color": black,
80
+ "header-padding-y" : 0.25rem,
81
+ "footer-background-color" : #ccc,
82
+ "footer-color" : null,
83
+ "footer-padding-y" : 0.25rem,
84
+ "footer-padding-y-large" : 0.5rem,
85
+ "tooltip-background-color" : white,
86
+ "tooltip-color" : null,
87
+ "tooltip-max-width" : 20rem,
88
+ "tooltip-padding" : 0.5rem,
89
+ "tooltip-width" : auto,
90
+ "width" : 15rem,
91
+ "width-large" : 30rem,
92
+ "width-large-x" : 50rem,
93
+ ) !default;
94
+
95
+ /// Change modules $config
96
+ /// @param {Map} $changes Map of changes
97
+ /// @example
98
+ /// @include ulu.component-popover-set(( "property" : value ));
99
+
100
+ @mixin set($changes) {
101
+ $config: map.merge($config, $changes) !global;
102
+ }
103
+
104
+ /// Get a config option
105
+ /// @param {Map} $name Name of property
106
+ /// @example
107
+ /// @include ulu.component-popover-get("property");
108
+
109
+ @function get($name) {
110
+ $value: utils.require-map-get($config, $name, "component-popover [config]");
111
+ @return utils.function-fallback($name, $value, $-fallbacks);
112
+ }
113
+
114
+ /// Prints component styles
115
+ /// @example scss
116
+ /// @include ulu.component-popover-styles();
117
+
118
+ @mixin styles {
119
+ $prefix: selector.class("popover");
120
+ $arrow-size-half: math.div(get("arrow-size"), 2);
121
+
122
+ @if (get("arrow-size")) {
123
+ #{ $prefix }__arrow {
124
+ display: block;
125
+ visibility: hidden;
126
+ z-index: 1;
127
+ &,
128
+ &:before {
129
+ position: absolute;
130
+ width: get("arrow-size");
131
+ height: get("arrow-size");
132
+ background: inherit;
133
+ }
134
+ &:before {
135
+ visibility: visible;
136
+ content: '';
137
+ transform: rotate(45deg);
138
+ // box-shadow: $box-shadow;
139
+ }
140
+ [data-placement^='top'] > & {
141
+ bottom: -($arrow-size-half);
142
+ }
143
+ [data-placement^='bottom'] > & {
144
+ top: -($arrow-size-half);
145
+ }
146
+ [data-placement^='left'] > & {
147
+ right: -($arrow-size-half);
148
+ }
149
+ [data-placement^='right'] > & {
150
+ left: -($arrow-size-half);
151
+ }
152
+ }
153
+ }
154
+ // Default position is on the right of the container (Popper handles positioning)
155
+ #{ $prefix } {
156
+ display: none;
157
+ position: absolute;
158
+ z-index: get("z-index") + 1;
159
+ background-color: get("background-color");
160
+ color: get("color");
161
+ width: get("width");
162
+ max-width: get("max-width");
163
+ box-shadow: get("box-shadow");
164
+ border-radius: get("border-radius");
165
+ text-align: left;
166
+ @if (get("type-size")) {
167
+ @include typography.size(get("type-size"));
168
+ }
169
+ &.is-active {
170
+ display: block;
171
+ }
172
+ }
173
+ #{ $prefix }__inner,
174
+ #{ $prefix }__header,
175
+ #{ $prefix }__footer {
176
+ display: block;
177
+ border-radius: get("border-radius");
178
+ position: relative;
179
+ z-index: 2; // Above arrow
180
+ flex: 0;
181
+ }
182
+ #{ $prefix }__inner {
183
+ overflow-y: auto;
184
+ max-height: get("max-height");
185
+ padding: get("padding");
186
+ flex: 1; // When used with footer
187
+ }
188
+ // Image, video above content
189
+ #{ $prefix }__header {
190
+ overflow: hidden;
191
+ padding: get("header-padding-y") get("padding");
192
+ color: get("header-color");
193
+ background-color: get("header-background-color");
194
+ }
195
+ #{ $prefix }__header--media {
196
+ padding: 0;
197
+ background-color: get("header-media-background-color");
198
+ }
199
+ #{ $prefix }__footer {
200
+ box-shadow: get("box-shadow-footer") color.get(get("box-shadow-footer-color"));
201
+ padding: get("footer-padding-y") get("padding");
202
+ color: get("footer-color");
203
+ background-color: get("footer-background-color");
204
+ border-top-left-radius: 0;
205
+ border-top-right-radius: 0;
206
+ }
207
+ #{ $prefix }__header:has(+ #{ $prefix }__inner),
208
+ #{ $prefix }__header:has(+ #{ $prefix }__footer),
209
+ #{ $prefix }__inner:has(+ #{ $prefix }__footer) {
210
+ border-bottom-left-radius: 0;
211
+ border-bottom-right-radius: 0;
212
+ }
213
+
214
+ // Modifiers
215
+ #{ $prefix }--tooltip {
216
+ width: get("tooltip-width");
217
+ max-width: min(get("max-width"), get("tooltip-max-width"));
218
+ color: get("tooltip-color");
219
+ background-color: get("tooltip-background-color");
220
+ pointer-events: none;
221
+ #{ $prefix }__inner {
222
+ padding: get("tooltip-padding");
223
+ min-height: 0;
224
+ }
225
+ }
226
+ // For fixed strategy
227
+ #{ $prefix }--fixed {
228
+ position: fixed;
229
+ }
230
+ // If you want to do something custom (and have it touch the edges)
231
+ #{ $prefix }--no-padding {
232
+ #{ $prefix }__inner {
233
+ padding: 0;
234
+ }
235
+ }
236
+ #{ $prefix }--large {
237
+ width: get("width-large");
238
+ }
239
+ #{ $prefix }--large-x {
240
+ width: get("width-large-x");
241
+ }
242
+ #{ $prefix }--large,
243
+ #{ $prefix }--large-x {
244
+ #{ $prefix }__inner {
245
+ padding: get("padding-large");
246
+ }
247
+ #{ $prefix }__footer {
248
+ padding: get("footer-padding-y-large") get("padding-large");
249
+ }
250
+ }
251
+ #{ $prefix }--prints {
252
+ @media print {
253
+ display: block;
254
+ position: static;
255
+ width: auto;
256
+ box-shadow: none;
257
+ max-width: none;
258
+ #{ $prefix }__arrow {
259
+ display: none;
260
+ }
261
+ }
262
+ }
263
+ }