@ulu/frontend 0.2.0-beta.1 → 0.2.0-beta.11

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 (163) hide show
  1. package/dist/README.md +12 -0
  2. package/dist/{types/js → es}/core/component.d.ts +3 -9
  3. package/dist/es/core/component.d.ts.map +1 -0
  4. package/dist/es/core/component.js +134 -0
  5. package/dist/{types/js → es}/core/events.d.ts +1 -1
  6. package/dist/es/core/events.d.ts.map +1 -0
  7. package/dist/es/core/events.js +45 -0
  8. package/dist/es/core/index.d.ts +4 -0
  9. package/dist/{types/js/ui → es/core}/index.d.ts.map +1 -1
  10. package/dist/{types/js → es}/core/settings.d.ts +1 -1
  11. package/dist/es/core/settings.d.ts.map +1 -0
  12. package/dist/es/core/settings.js +44 -0
  13. package/dist/es/index.d.ts +4 -0
  14. package/dist/{types/js → es}/index.d.ts.map +1 -1
  15. package/dist/es/index.js +125 -0
  16. package/dist/{types/js → es}/ui/breakpoints.d.ts +5 -3
  17. package/dist/es/ui/breakpoints.d.ts.map +1 -0
  18. package/dist/es/ui/breakpoints.js +194 -0
  19. package/dist/{types/js → es}/ui/collapsible.d.ts +28 -7
  20. package/dist/es/ui/collapsible.d.ts.map +1 -0
  21. package/dist/es/ui/collapsible.js +140 -0
  22. package/dist/{types/js → es}/ui/details-group.d.ts +1 -1
  23. package/dist/es/ui/details-group.d.ts.map +1 -0
  24. package/dist/es/ui/details-group.js +49 -0
  25. package/dist/{types/js → es}/ui/dialog.d.ts +3 -3
  26. package/dist/es/ui/dialog.d.ts.map +1 -0
  27. package/dist/es/ui/dialog.js +112 -0
  28. package/dist/{types/js → es}/ui/flipcard.d.ts +1 -1
  29. package/dist/es/ui/flipcard.d.ts.map +1 -0
  30. package/dist/es/ui/flipcard.js +97 -0
  31. package/dist/{types/js → es}/ui/grid.d.ts +2 -2
  32. package/dist/es/ui/grid.d.ts.map +1 -0
  33. package/dist/es/ui/grid.js +18 -0
  34. package/dist/{types/js → es}/ui/index.d.ts +22 -21
  35. package/dist/{types/js/core → es/ui}/index.d.ts.map +1 -1
  36. package/dist/{types/js → es}/ui/modal-builder.d.ts +21 -16
  37. package/dist/es/ui/modal-builder.d.ts.map +1 -0
  38. package/dist/es/ui/modal-builder.js +136 -0
  39. package/dist/es/ui/overflow-scroller-pager.d.ts.map +1 -0
  40. package/dist/es/ui/overflow-scroller-pager.js +28 -0
  41. package/dist/{types/js → es}/ui/overflow-scroller.d.ts +3 -3
  42. package/dist/es/ui/overflow-scroller.d.ts.map +1 -0
  43. package/dist/es/ui/overflow-scroller.js +90 -0
  44. package/dist/es/ui/page.d.ts.map +1 -0
  45. package/dist/es/ui/page.js +7 -0
  46. package/dist/{types/js → es}/ui/popover.d.ts +3 -3
  47. package/dist/es/ui/popover.d.ts.map +1 -0
  48. package/dist/es/ui/popover.js +77 -0
  49. package/dist/es/ui/print-details.d.ts.map +1 -0
  50. package/dist/es/ui/print-details.js +22 -0
  51. package/dist/es/ui/print.d.ts.map +1 -0
  52. package/dist/es/ui/print.js +34 -0
  53. package/dist/{types/js → es}/ui/programmatic-modal.d.ts +1 -1
  54. package/dist/es/ui/programmatic-modal.d.ts.map +1 -0
  55. package/dist/es/ui/programmatic-modal.js +55 -0
  56. package/dist/{types/js → es}/ui/proxy-click.d.ts +4 -4
  57. package/dist/es/ui/proxy-click.d.ts.map +1 -0
  58. package/dist/es/ui/proxy-click.js +44 -0
  59. package/dist/{types/js → es}/ui/resizer.d.ts +16 -16
  60. package/dist/es/ui/resizer.d.ts.map +1 -0
  61. package/dist/es/ui/resizer.js +242 -0
  62. package/dist/{types/js → es}/ui/scroll-slider.d.ts +1 -1
  63. package/dist/es/ui/scroll-slider.d.ts.map +1 -0
  64. package/dist/es/ui/scroll-slider.js +29 -0
  65. package/dist/{types/js → es}/ui/scrollpoint.d.ts +79 -11
  66. package/dist/es/ui/scrollpoint.d.ts.map +1 -0
  67. package/dist/es/ui/scrollpoint.js +178 -0
  68. package/dist/{types/js → es}/ui/slider.d.ts +11 -8
  69. package/dist/es/ui/slider.d.ts.map +1 -0
  70. package/dist/es/ui/slider.js +290 -0
  71. package/dist/{types/js → es}/ui/tabs.d.ts +2 -2
  72. package/dist/es/ui/tabs.d.ts.map +1 -0
  73. package/dist/es/ui/tabs.js +64 -0
  74. package/dist/{types/js → es}/ui/theme-toggle.d.ts +4 -4
  75. package/dist/es/ui/theme-toggle.d.ts.map +1 -0
  76. package/dist/es/ui/theme-toggle.js +190 -0
  77. package/dist/{types/js → es}/ui/tooltip.d.ts +5 -5
  78. package/dist/es/ui/tooltip.d.ts.map +1 -0
  79. package/dist/es/ui/tooltip.js +184 -0
  80. package/dist/{types/js → es}/utils/class-logger.d.ts +4 -4
  81. package/dist/es/utils/class-logger.d.ts.map +1 -0
  82. package/dist/es/utils/class-logger.js +37 -0
  83. package/dist/es/utils/css.d.ts.map +1 -0
  84. package/dist/es/utils/css.js +6 -0
  85. package/dist/{types/js → es}/utils/dom.d.ts +1 -1
  86. package/dist/es/utils/dom.d.ts.map +1 -0
  87. package/dist/es/utils/dom.js +29 -0
  88. package/dist/es/utils/file-save.d.ts.map +1 -0
  89. package/dist/es/utils/file-save.js +46 -0
  90. package/dist/{types/js → es}/utils/floating-ui.d.ts +1 -1
  91. package/dist/es/utils/floating-ui.d.ts.map +1 -0
  92. package/dist/es/utils/floating-ui.js +46 -0
  93. package/dist/es/utils/font-awesome.d.ts.map +1 -0
  94. package/dist/es/utils/font-awesome.js +13 -0
  95. package/dist/es/utils/id.d.ts.map +1 -0
  96. package/dist/es/utils/id.js +11 -0
  97. package/dist/{types/js → es}/utils/index.d.ts +7 -7
  98. package/dist/{types/js → es}/utils/index.d.ts.map +1 -1
  99. package/dist/es/utils/pause-youtube-video.d.ts.map +1 -0
  100. package/dist/es/utils/pause-youtube-video.js +27 -0
  101. package/dist/umd/style.css +1 -0
  102. package/dist/umd/ulu-frontend.umd.js +70 -0
  103. package/lib/js/ui/breakpoints.js +13 -5
  104. package/lib/js/ui/index.js +4 -0
  105. package/lib/js/ui/modal-builder.js +5 -3
  106. package/lib/js/ui/slider.js +22 -13
  107. package/lib/scss/_element.scss +10 -4
  108. package/lib/scss/components/_accordion.scss +1 -7
  109. package/lib/scss/components/_button.scss +11 -2
  110. package/lib/scss/components/_card.scss +5 -6
  111. package/lib/scss/components/_form-theme.scss +3 -3
  112. package/lib/scss/components/_menu-stack.scss +1 -0
  113. package/lib/scss/components/_modal.scss +13 -13
  114. package/lib/scss/helpers/_utilities.scss +0 -3
  115. package/package.json +54 -45
  116. package/dist/style.css +0 -1
  117. package/dist/types/js/core/component.d.ts.map +0 -1
  118. package/dist/types/js/core/events.d.ts.map +0 -1
  119. package/dist/types/js/core/index.d.ts +0 -4
  120. package/dist/types/js/core/settings.d.ts.map +0 -1
  121. package/dist/types/js/index.d.ts +0 -4
  122. package/dist/types/js/ui/breakpoints.d.ts.map +0 -1
  123. package/dist/types/js/ui/collapsible.d.ts.map +0 -1
  124. package/dist/types/js/ui/details-group.d.ts.map +0 -1
  125. package/dist/types/js/ui/dialog.d.ts.map +0 -1
  126. package/dist/types/js/ui/flipcard.d.ts.map +0 -1
  127. package/dist/types/js/ui/grid.d.ts.map +0 -1
  128. package/dist/types/js/ui/modal-builder.d.ts.map +0 -1
  129. package/dist/types/js/ui/overflow-scroller-pager.d.ts.map +0 -1
  130. package/dist/types/js/ui/overflow-scroller.d.ts.map +0 -1
  131. package/dist/types/js/ui/page.d.ts.map +0 -1
  132. package/dist/types/js/ui/popover.d.ts.map +0 -1
  133. package/dist/types/js/ui/print-details.d.ts.map +0 -1
  134. package/dist/types/js/ui/print.d.ts.map +0 -1
  135. package/dist/types/js/ui/programmatic-modal.d.ts.map +0 -1
  136. package/dist/types/js/ui/proxy-click.d.ts.map +0 -1
  137. package/dist/types/js/ui/resizer.d.ts.map +0 -1
  138. package/dist/types/js/ui/scroll-slider.d.ts.map +0 -1
  139. package/dist/types/js/ui/scrollpoint.d.ts.map +0 -1
  140. package/dist/types/js/ui/slider.d.ts.map +0 -1
  141. package/dist/types/js/ui/tabs.d.ts.map +0 -1
  142. package/dist/types/js/ui/theme-toggle.d.ts.map +0 -1
  143. package/dist/types/js/ui/tooltip.d.ts.map +0 -1
  144. package/dist/types/js/utils/class-logger.d.ts.map +0 -1
  145. package/dist/types/js/utils/css.d.ts.map +0 -1
  146. package/dist/types/js/utils/dom.d.ts.map +0 -1
  147. package/dist/types/js/utils/file-save.d.ts.map +0 -1
  148. package/dist/types/js/utils/floating-ui.d.ts.map +0 -1
  149. package/dist/types/js/utils/font-awesome.d.ts.map +0 -1
  150. package/dist/types/js/utils/id.d.ts.map +0 -1
  151. package/dist/types/js/utils/pause-youtube-video.d.ts.map +0 -1
  152. package/dist/ulu-frontend.es.js +0 -5737
  153. package/dist/ulu-frontend.umd.js +0 -77
  154. package/lib/scss/components/_card-before-no-position-relative.TRASH.scss +0 -576
  155. /package/dist/{types/js → es}/ui/overflow-scroller-pager.d.ts +0 -0
  156. /package/dist/{types/js → es}/ui/page.d.ts +0 -0
  157. /package/dist/{types/js → es}/ui/print-details.d.ts +0 -0
  158. /package/dist/{types/js → es}/ui/print.d.ts +0 -0
  159. /package/dist/{types/js → es}/utils/css.d.ts +0 -0
  160. /package/dist/{types/js → es}/utils/file-save.d.ts +0 -0
  161. /package/dist/{types/js → es}/utils/font-awesome.d.ts +0 -0
  162. /package/dist/{types/js → es}/utils/id.d.ts +0 -0
  163. /package/dist/{types/js → es}/utils/pause-youtube-video.d.ts +0 -0
@@ -1,576 +0,0 @@
1
- ////
2
- /// @group card
3
- /// A versatile container for displaying and summarizing individual items, entities, or resources in a visually appealing and concise format
4
- ////
5
-
6
- @use "sass:map";
7
- @use 'sass:list';
8
-
9
- @use "../breakpoint";
10
- @use "../utils";
11
- @use "../selector";
12
- @use "../color";
13
- @use "../layout";
14
-
15
- // todo
16
- // sass color adjust for smooth transition. Add a comment for this if we can’t get to this
17
-
18
- /// Module Settings
19
- /// @type Map
20
- /// @prop {Dimension} padding [2rem] The padding for the image icon
21
- /// @prop {Dimension} margin-y [3rem] Top and bottom margin for the card.
22
- /// @prop {Dimension} border-radius [5rem] The border radius of the card.
23
- /// @prop {CssValue} box-shadow [null] The box-shadow for the card.
24
- /// @prop {CssValue} box-shadow-hover [null] The box-shadow for the card when hovered or focused.
25
- /// @prop {Color} color [null] The type color of the card.
26
- /// @prop {Color} color-hover [null] The type color of the card when hovered or focused.
27
- /// @prop {Color} color-overlay [white] The type color of the card when using card--overlay.
28
- /// @prop {Color} color-overlay-hover [null] The type color of the card when hovered or focused and when using card--overlay.
29
- /// @prop {Color} overlay-background-color [rgba(0, 0, 0, 0.6)] The background color for the text box when using card--overlay.
30
- /// @prop {Color} background-color [white] The background color of the card.
31
- /// @prop {Color} background-color-hover [rgb(242, 244, 246)] The background color of the card when hovered or focused.
32
- /// @prop {Dimension} max-width [28rem] The max-width of the card.
33
- /// @prop {Dimension} body-min-height [8rem] the min-height of the card body.
34
- /// @prop {CssValue} border [1px solid #ccc] The card border.
35
- /// @prop {CssValue} border-hover [2px solid #278cca] The card border when hovered or focused.
36
- /// @prop {Dimension} header-margin [0.75em] The margin for the card header.
37
- /// @prop {Color} title-color [null] The type color of the title.
38
- /// @prop {Color} title-color-hover [null] The type color of the title (if link/button) when hovered or focused
39
- /// @prop {Dimension} title-margin [0] The margin for the title.
40
- /// @prop {CssValue} title-font-weight [bold] The font weight for the title.
41
- /// @prop {Number} image-ratio [56.25%] The image ratio for the card image.
42
- /// @prop {Color} image-background-color [rgb(197, 197, 197)] The background color behind the image.
43
- /// @prop {Dimension} image-margin [null] The margin for the image.
44
- /// @prop {Dimension} image-border [null] // For when you have a margin, the border for the image.
45
- /// @prop {CssValue} image-transform-hover [null] Animation for the image when hovered or focused.
46
- /// @prop {CssValue} image-filter-hover [null] Filter for the image when hovered or focused.
47
- /// @prop {Color} overlay-background-color-hover [null] The color of the pseudo-element when using proxy click.
48
- /// @prop {Boolean} clickable-card-enabled [true] Enable or disable proxy click.
49
- /// @prop {String} clickable-card-selector [data-ulu-proxy-click-init] The selector for proxy-click.js to find the card and implement the clickable card script.
50
- /// @prop {String} clickable-card-interact-selector [&:hover, &:focus-within] The selectors for the cards being interacted with.
51
- /// @prop {Dimension} footer-padding-y [0.25rem] The top and bottom padding for the footer.
52
- /// @prop {Dimension} footer-min-height [2.5rem] The min height for the footer
53
- /// @prop {Dimension} footer-justify [flex-end] Flex alignment of footer items (on end by default)
54
- /// @prop {String} prefix [card] The class name used to add card styling.
55
- /// @prop {Boolean} transition-enabled [true] Enable or disable transition for card.
56
- /// @prop {CssValue} transition-timing-function [ease-in-out] The timing function for the card animation.
57
- /// @prop {Time} transition-duration [200ms] The animation duration for the card animation.
58
- /// @prop {List} transition-properties [(border-color, background-color, color, box-shadow, transform)] The properties for the card animation.
59
- /// @prop {Boolean} image-transition-enabled [true] Enable or disable the image transition.
60
- /// @prop {Time} image-transition-duration [350ms] The duration of the image transition.
61
- /// @prop {CssValue} image-transition-timing-function [ease-in-out] The timing function for the image transition.
62
- /// @prop {Number} image-fit-padding [1rem] Padding on inside of image when using image fit modifier
63
- /// @prop {CssValue} image-fit-filter [drop-shadow(0 0px 8px rgba(0, 0, 0, 0.2))] Filter to use on image when using image fit modifier
64
- /// @prop {List} image-icon-max-width [10rem] Max width for image when using the modifier on the .card__image--icon
65
- /// @prop {List} image-transition-properties [(transform, filter)] The properties for the image transitions.
66
- /// @prop {String} horizontal-breakpoint [small] The breakpoint used to change the card to vertical if using the card--horizontal styling. Uses ulu's breakpoint module.
67
- /// @prop {Unit} horizontal-min-height [10rem] Minimum height when horizontal
68
- /// @prop {Unit} horizontal-max-width [40rem] Maximum width when horizontal
69
- /// @prop {Unit} horizontal-body-max-width [80rem] The max-width of body when horizontal
70
- /// @prop {Boolean} aside-rule [false] Whether or not to have a rule separating body and aside
71
- /// @prop {CssUnit} aside-rule-width [1px] Size of rule
72
- /// @prop {CssUnit} aside-rule-color ["rule-light"] Color of rule
73
- /// @prop {CssUnit} aside-rule-background-color [transparent] Color of aside background color
74
-
75
- $config: (
76
- "background-color" : white,
77
- "background-color-hover" : rgb(242, 244, 246),
78
- "body-min-height" : 10rem,
79
- "border" : 1px solid #ccc,
80
- "border-hover" : 2px solid #278cca,
81
- "border-radius" : 5px,
82
- "box-shadow" : null,
83
- "box-shadow-hover" : null,
84
- "clickable-card-enabled" : true,
85
- "clickable-card-selector" : "[data-ulu-proxy-click-init]",
86
- "clickable-card-interact-selector" : "&:hover, &:focus-within",
87
- "color" : "type",
88
- "color-hover" : null,
89
- "footer-padding-y" : 0.25rem,
90
- "footer-min-height" : 2.5rem,
91
- "footer-justify" : flex-end,
92
- "horizontal-breakpoint" : "small",
93
- "horizontal-image-width" : min(33%, 20rem),
94
- "horizontal-min-height" : 20rem,
95
- "horizontal-max-width" : 80rem,
96
- "horizontal-main-max-width" : 40rem,
97
- "horizontal-aside-width" : 40%,
98
- "header-margin" : 0.75em,
99
- "image-ratio" : 56.25%,
100
- "image-aspect-ratio": list.slash(5, 3),
101
- "image-background-color" : rgb(238, 238, 238),
102
- "image-border" : null, // For when you have a margin
103
- "image-filter-hover" : null,
104
- "image-margin" : null,
105
- "image-icon-max-width" : 8rem,
106
- "image-transform-hover" : null,
107
- "image-transition-duration" : 350ms,
108
- "image-transition-enabled" : true,
109
- "image-transition-properties" : (transform, filter),
110
- "image-transition-timing-function" : ease-in-out,
111
- "image-fit-padding" : 1rem,
112
- "image-fit-filter" : drop-shadow(0 0px 8px rgba(0, 0, 0, 0.3)),
113
- "margin-y" : 3rem,
114
- "max-width" : 28rem,
115
- "padding" : 2rem,
116
- "title-color" : null,
117
- "title-color-hover" : null,
118
- "title-color-card-hover" : null,
119
- "title-margin" : 1rem,
120
- "title-font-weight" : bold,
121
- "transition-enabled": true,
122
- "transition-timing-function" : ease-in-out,
123
- "transition-duration" : 200ms,
124
- "transition-properties" : (border-color, background-color, color, box-shadow, transform),
125
- "overlay-aspect-ratio": list.slash(4, 3),
126
- "overlay-background-color-hover" : null,
127
- "color-overlay" : white,
128
- "color-overlay-hover" : null,
129
- "overlay-background-color": rgba(0, 0, 0, 0.6),
130
- "overlay-shading": true,
131
- "overlay-body-padding-y": 1rem,
132
- "aside-rule" : false,
133
- "aside-rule-width" : 1px,
134
- "aside-background-color" : transparent,
135
- "aside-rule-color": "rule-light",
136
- ) !default;
137
-
138
- /// Change modules $config
139
- /// @param {Map} $changes Map of changes
140
- /// @example scss
141
- /// @include ulu.component-card-set(( "property" : value ));
142
-
143
- @mixin set($changes) {
144
- $config: map.merge($config, $changes) !global;
145
- }
146
-
147
- /// Get a config option
148
- /// @param {Map} $name Name of property
149
- /// @example scss
150
- /// @include ulu.component-card-get(( "property" : value ));
151
-
152
- @function get($name) {
153
- @return utils.require-map-get($config, $name, "card [config]");
154
- }
155
-
156
- /// Prints component styles
157
- /// @demo card
158
- /// @example scss
159
- /// @example
160
- /// @include ulu.component-card-styles();
161
-
162
- @mixin styles {
163
- $prefix: selector.class("card");
164
-
165
- #{ $prefix } {
166
- color: color.get(get("color"));
167
- background-color: color.get(get("background-color"));
168
- border-radius: get("border-radius");
169
- box-shadow: get("box-shadow");
170
- margin-top: get("margin-y");
171
- margin-bottom: get("margin-y");
172
- position: relative;
173
- display: flex; // Reorder image
174
- flex-direction: column;
175
- justify-content: flex-end;
176
- max-width: get("max-width");
177
-
178
- // Border is on pseudo so that it's on top of image/etc
179
- &::after {
180
- @include layout.absolute-fill();
181
- content: if(get("border"), "", null);
182
- border: get("border");
183
- border-radius: get("border-radius");
184
- // Below body and footer but above the image
185
- // - Note: Starting at 3 instead of 2 so that content can move to
186
- // layer 2 on overlay modifier
187
- // - General style doesn't need bleeding for content so this allows
188
- // popovers/etc to not be affected by this pseudo hover border
189
- z-index: 3;
190
- pointer-events: none;
191
- }
192
- }
193
-
194
- @include when-clickable($hover: true) {
195
- background-color: color.get(get("background-color-hover"));
196
- color: color.get(get("color-hover"));
197
- box-shadow: get("box-shadow-hover");
198
-
199
- @if (get("border-hover") or get("overlay-background-color-hover")) {
200
- &::after {
201
- content: "";
202
- border: get("border-hover");
203
- background-color: color.get(get("overlay-background-color-hover"));
204
- }
205
- }
206
- }
207
-
208
- // Setting transitions regardless of clickable card selector
209
- // This shouldn't interfere since styles aren't changed if not clickable (ie. .card [border-color, etc])
210
- @if get("transition-enabled") {
211
- #{ $prefix },
212
- #{ $prefix }::after,
213
- #{ $prefix }__title {
214
- transition-duration: get("transition-duration");
215
- transition-timing-function: get("transition-timing-function");
216
- transition-property: get("transition-properties");
217
- }
218
- }
219
-
220
- #{ $prefix }__title {
221
- color: color.get(get("title-color"));
222
- margin-bottom: get("title-margin");
223
- display: block;
224
- font-weight: get("title-font-weight");
225
- #{ $prefix }__title-link {
226
- all: unset;
227
- cursor: pointer;
228
- @if get("title-color-hover") {
229
- &:hover,
230
- &:focus {
231
- color: color.get(get("title-color-hover"));
232
- }
233
- }
234
- }
235
- }
236
- @if get("title-color-hover") {
237
- @include when-clickable($hover: true) {
238
- #{ $prefix }__title {
239
- color: color.get(get("title-color-hover"));
240
- }
241
- }
242
- }
243
-
244
- #{ $prefix }__header + #{ $prefix }__content {
245
- margin-top: get("header-margin");
246
- }
247
-
248
- // Fix since sometimes these have nested markup sometimes just raw text
249
- #{ $prefix }__image {
250
- order: -1;
251
- position: relative;
252
- z-index: 1;
253
- overflow: hidden;
254
- // padding-top: get("image-ratio"); // 9:16
255
- margin: get("image-margin");
256
- border: get("image-border");
257
- background-color: color.get(get("image-background-color"));
258
- border-top-right-radius: get("border-radius");
259
- border-top-left-radius: get("border-radius");
260
- aspect-ratio: get("image-aspect-ratio");
261
- width: 100%;
262
- }
263
- #{ $prefix }__image img,
264
- #{ $prefix}__image-media {
265
- @include layout.absolute-fill(true);
266
- border: 0;
267
- object-fit: cover;
268
- transform-origin: center center;
269
- @if (get("image-transition-enabled")) {
270
- transition-duration: get("image-transition-duration");
271
- transition-timing-function: get("image-transition-timing-function");
272
- transition-property: get("image-transition-properties");
273
- }
274
- }
275
- @if (get("image-transform-hover") or get("image-filter-hover")) {
276
- @include when-clickable($hover: true) {
277
- #{ $prefix }__image img,
278
- #{ $prefix}__image-media {
279
- transform: get("image-transform-hover");
280
- filter: get("image-filter-hover");
281
- }
282
- }
283
- }
284
-
285
- #{ $prefix }__footer,
286
- #{ $prefix }__main,
287
- #{ $prefix }__aside {
288
- padding: get("padding");
289
- }
290
- #{ $prefix }__aside {
291
- position: relative;
292
- }
293
-
294
- #{ $prefix }__image--icon {
295
- // background-color: transparent;
296
- display: flex;
297
- align-items: center;
298
- justify-content: center;
299
- // padding: 2rem;
300
- img {
301
- position: static;
302
- display: block;
303
- max-width: get("image-icon-max-width");
304
- height: auto;
305
- top: auto;
306
- left: auto;
307
- }
308
- }
309
- #{ $prefix }__body,
310
- #{ $prefix }__footer {
311
- position: relative;
312
- // Above image and pseudo (in case we have popovers/etc)
313
- z-index: 4;
314
- }
315
- #{ $prefix }__body {
316
- display: flex;
317
- flex-direction: column;
318
- flex-grow: 1;
319
- min-height: get("body-min-height");
320
- }
321
- @if (get("aside-rule")) {
322
- #{ $prefix }__aside {
323
- background-color: color.get(get("aside-background-color"));
324
- }
325
- #{ $prefix }__aside::after {
326
- content: "";
327
- position: absolute;
328
- top: calc(0rem - get("aside-rule-width") / 2);
329
- left: get("padding");
330
- right: get("padding");
331
- height: get("aside-rule-width");
332
- background-color: color.get(get("aside-rule-color"));
333
- }
334
- }
335
- // For actions/messages
336
- // - Layout as flex with min height to support buttons
337
- // and text without relying so much on padding
338
- #{ $prefix }__footer {
339
- flex: 0;
340
- padding-top: get("footer-padding-y");
341
- padding-bottom: get("footer-padding-y");
342
- min-height: get("footer-min-height");
343
- display: flex;
344
- align-items: center;
345
- justify-content: get("footer-justify");
346
- }
347
-
348
- #{ $prefix }--overlay {
349
- aspect-ratio: get("overlay-aspect-ratio");
350
- height: min-content;
351
-
352
- // On overlay putting the body/footer above the image and below the hover pseudo
353
- // - If we have popovers in overlay this would need to be set above the pseudo
354
- // - The trade off would be that the gradients background would be above the hover border, keeping them above will preserve the look / feel since popovers are probably not needed for this style
355
- #{ $prefix }__body,
356
- #{ $prefix }__footer {
357
- z-index: 2;
358
- }
359
- #{ $prefix }__body {
360
- position: relative;
361
- flex-grow: 0;
362
-
363
- color: color.get(get("color-overlay"));
364
- background-color: color.get(get("overlay-background-color"));
365
- min-height: 0;
366
- padding-top: get("overlay-body-padding-y");
367
- padding-bottom: get("overlay-body-padding-y");
368
-
369
- &:not(:has(~ #{ $prefix }__footer)) {
370
- border-bottom-left-radius: get("border-radius");
371
- border-bottom-right-radius: get("border-radius");
372
- }
373
-
374
- @if (get("overlay-shading")) {
375
- margin-top: 4rem;
376
- &::before {
377
- content: "";
378
- position: absolute;
379
- bottom: 100%;
380
- left: 0;
381
- right: 0;
382
- height: 4rem;
383
- background: linear-gradient(to top, get("overlay-background-color") 0%, rgba(0, 0, 0, 0));
384
- }
385
- }
386
- }
387
- #{ $prefix }__footer {
388
- background-color: color.get(get("overlay-background-color"));
389
- color: color.get(get("color-overlay"));
390
- border-bottom-left-radius: get("border-radius");
391
- border-bottom-right-radius: get("border-radius");
392
- }
393
- #{ $prefix }__body,
394
- #{ $prefix }__footer {
395
- &:last-child {
396
- border-bottom-left-radius: get("border-radius");
397
- border-bottom-right-radius: get("border-radius");
398
- }
399
- }
400
- #{ $prefix }__title {
401
- color: color.get(get("color-overlay"));
402
- }
403
- #{ $prefix }__image {
404
- @include layout.absolute-fill();
405
- overflow: hidden;
406
- padding-top: 0;
407
- background-color: color.get(rgb(255, 255, 255));
408
- border-radius: get("border-radius");
409
- aspect-ratio: auto;
410
- img {
411
- z-index: 1;
412
- position: relative;
413
- width: 100%;
414
- height: 100%;
415
- border: 0;
416
- object-fit: cover;
417
- &::before {
418
- @include layout.absolute-fill(true);
419
- display: block;
420
- background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.9));
421
- }
422
- }
423
- }
424
- }
425
-
426
- // Incase this modifier is being used to hide the image
427
- // not just to tell the component how to layout without image
428
- // - Use case is hiding image when you can't control the output
429
- // of the inside of the card (printed no matter what). We had
430
- // this happen in HHRC, including this extra CSS for that
431
- #{ $prefix }--no-image {
432
- #{ $prefix }__image {
433
- display: none;
434
- }
435
- }
436
- #{ $prefix }--image-fit {
437
- #{ $prefix }__image {
438
- img {
439
- padding: get("image-fit-padding");
440
- object-fit: contain;
441
- object-position: top center;
442
- filter: get("image-fit-filter");
443
- }
444
- }
445
- }
446
- #{ $prefix }--fill {
447
- max-width: none;
448
- height: 100%;
449
- margin: 0;
450
- }
451
-
452
- @if (get("horizontal-breakpoint")) {
453
- @include breakpoint.min(get("horizontal-breakpoint")) {
454
- @include -horizontal-card-styles();
455
- }
456
- } @else {
457
- @include -horizontal-card-styles();
458
- }
459
- }
460
-
461
- @mixin -horizontal-card-styles() {
462
- $prefix: selector.class("card");
463
-
464
- #{ $prefix }--horizontal {
465
- display: grid;
466
- grid-template-columns: get("horizontal-image-width") 1fr;
467
- // Creating the two rows (body and footer), if one is missing it's height will be 0
468
- // Cannot use gap with the grid as it will create space when a row isn't needed
469
- grid-template-rows: auto auto;
470
- min-height: get("horizontal-min-height");
471
- max-width: get("horizontal-max-width");
472
-
473
- // When no footer remove extra row
474
- &:not(:has(> #{ $prefix }__footer)) {
475
- grid-template-rows: auto;
476
- }
477
- #{ $prefix }__image {
478
- grid-column: 1 / 2;
479
- grid-row: 1 / -1;
480
- aspect-ratio: auto;
481
- border-top-right-radius: 0;
482
- border-bottom-left-radius: get("border-radius");
483
- }
484
- #{ $prefix }__body,
485
- #{ $prefix }__footer {
486
- grid-column: 2 / 3;
487
- }
488
- #{ $prefix }__body {
489
- flex-direction: row;
490
- justify-content: space-between;
491
- }
492
- #{ $prefix }__main {
493
- flex-grow: 1;
494
- max-width: get("horizontal-main-max-width");
495
- }
496
- #{ $prefix }__aside {
497
- flex: 0 0 get("horizontal-aside-width");
498
- height: 100%;
499
- }
500
- @if(get("aside-rule")) {
501
- #{ $prefix }__aside::after {
502
- content: "";
503
- position: absolute;
504
- top: get("padding");
505
- left: calc(0rem - get("aside-rule-width") / 2);
506
- height: calc(100% - get("padding") - get("padding"));
507
- width: get("aside-rule-width");
508
- background-color: get("aside-rule-color");
509
- }
510
- }
511
-
512
- // For modern browsers
513
- // Optionally use no-image modifier for older browser support
514
- &:not(:has(#{ $prefix }__image)) {
515
- @include -card-horizontal-no-image-styles();
516
- }
517
- &#{ $prefix }--no-image {
518
- @include -card-horizontal-no-image-styles();
519
- }
520
- }
521
- #{ $prefix }--horizontal-center {
522
- #{ $prefix }__body {
523
- align-self: center;
524
- }
525
- }
526
- }
527
-
528
-
529
- /// Mixin styles for card when it has proxy click enabled and is being interacted with (hover/focus)
530
- /// @param {Boolean} $hover [false] Apply styles when the card is being hover/focused within, else applies styles to rest state of a clickable card (one who has a proxy click setup)
531
- /// Prints component styles
532
- /// @example scss
533
- /// @include ulu.component-card-styles();
534
-
535
- @mixin when-clickable($hover: false) {
536
- $prefix: selector.class("card");
537
- // When proxy click enabled
538
- @if (get("clickable-card-enabled") and get("clickable-card-selector")) {
539
- #{ $prefix }#{ get("clickable-card-selector") },
540
- a#{ $prefix },
541
- button#{ $prefix },
542
- #{ $prefix }--clickable {
543
- @if ($hover) {
544
- #{ get("clickable-card-interact-selector") } {
545
- @content;
546
- }
547
- } @else {
548
- @content;
549
- }
550
- }
551
- // Without proxy click (only if interactive)
552
- } @else {
553
- a#{ $prefix },
554
- button#{ $prefix },
555
- #{ $prefix }--clickable {
556
- @if ($hover) {
557
- #{ get("clickable-card-interact-selector") } {
558
- @content;
559
- }
560
- } @else {
561
- @content;
562
- }
563
- }
564
- }
565
- }
566
-
567
-
568
- // Internal mixin for DRY
569
- @mixin -card-horizontal-no-image-styles() {
570
- $prefix: selector.class("card");
571
- grid-template-columns: 1fr;
572
- #{ $prefix }__body,
573
- #{ $prefix }__footer {
574
- grid-column: 1 / 2;
575
- }
576
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes