@ulu/frontend 0.0.23 → 0.1.0-beta.1
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.
- package/CHANGELOG.md +20 -0
- package/deprecated/js/drupal-programmatic-modal.js +91 -0
- package/{js/ui/modals.js → deprecated/js/micromodal-modals.js} +41 -67
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +70 -1
- package/index.js +6 -1
- package/js/events/index.js +58 -7
- package/js/index.js +3 -7
- package/js/{helpers/css-breakpoint.js → ui/breakpoints.js} +9 -11
- package/js/ui/collapsible.js +195 -0
- package/js/ui/dialog.js +157 -0
- package/js/ui/dialog.todo +37 -0
- package/js/ui/flipcard.js +55 -11
- package/js/ui/grid.js +2 -47
- package/js/ui/index.js +21 -0
- package/js/ui/modal-builder.js +197 -0
- package/js/ui/overflow-scroller-pager.js +1 -1
- package/js/ui/overflow-scroller.js +8 -5
- package/js/ui/page.js +14 -0
- package/js/ui/popover.js +135 -0
- package/js/ui/print-details.js +44 -0
- package/js/ui/print.js +67 -0
- package/js/ui/programmatic-modal.js +79 -81
- package/js/ui/proxy-click.js +80 -0
- package/js/ui/resizer.js +3 -3
- package/js/ui/scroll-slider.js +56 -0
- package/js/ui/scrollpoint.js +300 -0
- package/js/ui/slider.js +72 -10
- package/js/ui/tabs.js +85 -58
- package/js/ui/theme-toggle.js +129 -0
- package/js/ui/tooltip.js +268 -67
- package/js/utils/{logger.js → class-logger.js} +6 -5
- package/js/utils/dom.js +122 -0
- package/js/utils/file-save.js +67 -0
- package/js/utils/floating-ui.js +83 -0
- package/js/utils/id.js +22 -0
- package/js/utils/index.js +7 -0
- package/js/{helpers → utils}/pause-youtube-video.js +1 -1
- package/package.json +33 -13
- package/resources/drupal/twig-macros/accordion.twig +99 -0
- package/resources/drupal/twig-macros/dropdown.twig +44 -0
- package/resources/drupal/twig-macros/flipcard.twig +69 -0
- package/resources/drupal/twig-macros/image.twig +30 -0
- package/resources/drupal/twig-macros/layout.twig +338 -0
- package/resources/drupal/twig-macros/slider.twig +214 -0
- package/resources/drupal/twig-macros/tabs.twig +84 -0
- package/scss/README.md +13 -1
- package/scss/_breakpoint.scss +69 -26
- package/scss/_button.scss +148 -57
- package/scss/_color.scss +46 -28
- package/scss/_cssvar.scss +103 -12
- package/scss/_element.scss +84 -67
- package/scss/_index.scss +0 -3
- package/scss/_layout.scss +57 -26
- package/scss/_path.scss +2 -2
- package/scss/_selector.scss +20 -11
- package/scss/_typography.scss +115 -82
- package/scss/_units.scss +14 -13
- package/scss/_utils.scss +280 -18
- package/scss/base/_color.scss +2 -1
- package/scss/base/_elements.scss +61 -35
- package/scss/base/_index.scss +60 -23
- package/scss/base/_keyframes.scss +115 -16
- package/scss/base/_layout.scss +10 -6
- package/scss/base/_normalize.scss +6 -122
- package/scss/base/_print.scss +49 -0
- package/scss/base/_root.scss +28 -0
- package/scss/base/_typography.scss +4 -1
- package/scss/components/_accordion.scss +217 -0
- package/scss/components/_adaptive-spacing.scss +148 -0
- package/scss/components/_badge.scss +17 -14
- package/scss/components/_button-verbose.scss +138 -0
- package/scss/components/_button.scss +9 -4
- package/scss/components/_callout.scss +175 -0
- package/scss/components/_captioned-figure.scss +173 -0
- package/scss/components/_card-grid.scss +75 -0
- package/scss/components/_card.scss +420 -0
- package/scss/components/_css-icon.scss +433 -0
- package/scss/{_grid.scss → components/_data-grid.scss} +100 -68
- package/scss/components/_data-table.scss +180 -0
- package/scss/components/_fill-context.scss +20 -22
- package/scss/components/_flipcard-grid.scss +66 -0
- package/scss/components/_flipcard.scss +304 -0
- package/scss/components/_form-theme.scss +633 -0
- package/scss/components/_hero.scss +183 -0
- package/scss/components/_horizontal-rule.scss +51 -0
- package/scss/components/_image-grid.scss +71 -0
- package/scss/components/_index.scss +276 -38
- package/scss/components/_links.scss +1 -1
- package/scss/components/_list-lines.scss +14 -3
- package/scss/components/_list-ordered.scss +3 -1
- package/scss/components/_list-unordered.scss +3 -1
- package/scss/components/_menu-stack.scss +245 -0
- package/scss/components/_modal.scss +495 -0
- package/scss/components/_nav-strip.scss +148 -0
- package/scss/components/_overlay-section.scss +122 -0
- package/scss/components/_pager.scss +168 -0
- package/scss/components/_placeholder-block.scss +121 -0
- package/scss/components/_popover.scss +263 -0
- package/scss/components/_pull-quote.scss +111 -0
- package/scss/components/_ratio-box.scss +64 -0
- package/scss/components/_rule.scss +12 -9
- package/scss/components/_scroll-slider.scss +204 -0
- package/scss/components/_skip-link.scss +92 -0
- package/scss/components/_slider.scss +241 -0
- package/scss/components/_spoke-spinner.scss +193 -0
- package/scss/components/_tabs.scss +179 -0
- package/scss/components/_tag.scss +156 -0
- package/scss/components/_tile-button.scss +131 -0
- package/scss/components/_tile-grid-overlay.scss +132 -0
- package/scss/components/_tile-grid.scss +172 -0
- package/scss/components/_vignette.scss +65 -0
- package/scss/components/_wysiwyg.scss +94 -0
- package/scss/helpers/_color.scss +1 -0
- package/scss/helpers/_display.scss +2 -1
- package/scss/helpers/_index.scss +45 -22
- package/scss/helpers/_print.scss +20 -43
- package/scss/helpers/_typography.scss +3 -0
- package/scss/helpers/_units.scss +10 -13
- package/scss/helpers/_utilities.scss +5 -1
- package/scss/stylesheets/base-styles.scss +7 -0
- package/scss/stylesheets/component-styles.scss +7 -0
- package/scss/stylesheets/helper-styles.scss +7 -0
- package/types/events/index.d.ts +1 -1
- package/types/events/index.d.ts.map +1 -1
- package/types/index.d.ts +2 -2
- package/types/{helpers/css-breakpoint.d.ts → ui/breakpoints.d.ts} +3 -3
- package/types/ui/breakpoints.d.ts.map +1 -0
- package/types/ui/collapsible.d.ts +67 -0
- package/types/ui/collapsible.d.ts.map +1 -0
- package/types/ui/dialog.d.ts +42 -0
- package/types/ui/dialog.d.ts.map +1 -0
- package/types/ui/flipcard.d.ts +8 -1
- package/types/ui/flipcard.d.ts.map +1 -1
- package/types/ui/grid.d.ts +0 -11
- package/types/ui/grid.d.ts.map +1 -1
- package/types/ui/index.d.ts +23 -0
- package/types/ui/index.d.ts.map +1 -0
- package/types/ui/modal-builder.d.ts +54 -0
- package/types/ui/modal-builder.d.ts.map +1 -0
- package/types/ui/overflow-scroller-pager.d.ts +1 -1
- package/types/ui/overflow-scroller-pager.d.ts.map +1 -1
- package/types/ui/overflow-scroller.d.ts +3 -1
- package/types/ui/overflow-scroller.d.ts.map +1 -1
- package/types/ui/page.d.ts +5 -0
- package/types/ui/page.d.ts.map +1 -0
- package/types/ui/popover.d.ts +40 -0
- package/types/ui/popover.d.ts.map +1 -0
- package/types/ui/print-details.d.ts +10 -0
- package/types/ui/print-details.d.ts.map +1 -0
- package/types/ui/print.d.ts +10 -0
- package/types/ui/print.d.ts.map +1 -0
- package/types/ui/programmatic-modal.d.ts +19 -1
- package/types/ui/programmatic-modal.d.ts.map +1 -1
- package/types/ui/proxy-click.d.ts +18 -0
- package/types/ui/proxy-click.d.ts.map +1 -0
- package/types/ui/resizer.d.ts +1 -1
- package/types/ui/resizer.d.ts.map +1 -1
- package/types/ui/scroll-slider.d.ts +13 -0
- package/types/ui/scroll-slider.d.ts.map +1 -0
- package/types/ui/scrollpoint.d.ts +133 -0
- package/types/ui/scrollpoint.d.ts.map +1 -0
- package/types/ui/slider.d.ts +14 -2
- package/types/ui/slider.d.ts.map +1 -1
- package/types/ui/tabs.d.ts +22 -0
- package/types/ui/tabs.d.ts.map +1 -1
- package/types/ui/theme-toggle.d.ts +14 -0
- package/types/ui/theme-toggle.d.ts.map +1 -0
- package/types/ui/tooltip.d.ts +92 -10
- package/types/ui/tooltip.d.ts.map +1 -1
- package/types/utils/{logger.d.ts → class-logger.d.ts} +1 -1
- package/types/utils/class-logger.d.ts.map +1 -0
- package/types/utils/dom.d.ts +48 -0
- package/types/utils/dom.d.ts.map +1 -0
- package/types/utils/file-save.d.ts +64 -0
- package/types/utils/file-save.d.ts.map +1 -0
- package/types/utils/floating-ui.d.ts +19 -0
- package/types/utils/floating-ui.d.ts.map +1 -0
- package/types/utils/id.d.ts +10 -0
- package/types/utils/id.d.ts.map +1 -0
- package/types/utils/index.d.ts +9 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/pause-youtube-video.d.ts.map +1 -0
- package/js/helpers/file-save.js +0 -52
- package/js/helpers/scrollbar-width-property.js +0 -14
- package/project.todo +0 -22
- package/scss/_calculate.scss +0 -64
- package/scss/_utility.scss +0 -12
- package/types/helpers/css-breakpoint.d.ts.map +0 -1
- package/types/helpers/file-save.d.ts +0 -17
- package/types/helpers/file-save.d.ts.map +0 -1
- package/types/helpers/node-data-manager.d.ts +0 -45
- package/types/helpers/node-data-manager.d.ts.map +0 -1
- package/types/helpers/pause-youtube-video.d.ts.map +0 -1
- package/types/helpers/scrollbar-width-property.d.ts +0 -11
- package/types/helpers/scrollbar-width-property.d.ts.map +0 -1
- package/types/ui/modals.d.ts +0 -27
- package/types/ui/modals.d.ts.map +0 -1
- package/types/utils/logger.d.ts.map +0 -1
- package/vite.config.js +0 -36
- /package/{js/deprecated → deprecated/js}/doc-ready.js +0 -0
- /package/{js/deprecated → deprecated/js}/jquery-prototypes.js +0 -0
- /package/{js/deprecated → deprecated/js}/mini-collapsible-popper-positioning.js +0 -0
- /package/{js/deprecated → deprecated/js}/mini-collapsible.js +0 -0
- /package/{js/helpers → deprecated/js}/node-data-manager.js +0 -0
- /package/{js/deprecated → deprecated/js}/script-loader.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/README.md +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/anchor-menu.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/element-waypoint.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/examples/page-link-menu.md +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/state-in-attribute.js +0 -0
- /package/types/{helpers → utils}/pause-youtube-video.d.ts +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group accordion
|
|
3
|
+
/// Outputs accordion component stylesheet, which can be used with <details> or custom disclosure components
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:math";
|
|
8
|
+
|
|
9
|
+
@use "../selector";
|
|
10
|
+
@use "../utils";
|
|
11
|
+
@use "../color";
|
|
12
|
+
@use "../typography";
|
|
13
|
+
|
|
14
|
+
/// Module Settings
|
|
15
|
+
/// @type Map
|
|
16
|
+
/// @prop {Color} background-color [white] This is the background color of the accordion before it is expanded.
|
|
17
|
+
/// @prop {Color} background-color-open [#F7F8F7] This is the background color of the accordion before it is expanded. This will change the background color of the accordion's summary as well as the details.
|
|
18
|
+
/// @prop {String} border-color ["rule"]
|
|
19
|
+
/// @prop {Number} border-radius [0] This applies a rounding of edges for the accordion. If there are multiple accordions in a stack, this will only apply to the top of the first accordion and the bottom of the last accordion.
|
|
20
|
+
/// @prop {Dimension} border-width [1px] The width of the borders of the accordions
|
|
21
|
+
/// @prop {CssValue} box-shadow [none] Adds a box shadow to accordion container
|
|
22
|
+
/// @prop {Dimension} margin [3rem] text This is the margin above and below the accordion. Multiple Accordions will stack. See margin-between below.
|
|
23
|
+
/// @prop {Dimension} margin-between [0] This adds a margin between adjacent accordions. By default, accordions do not have any net margin between each other.
|
|
24
|
+
/// @prop {Dimension} padding-x [1.5em] Singular value for the left and right padding
|
|
25
|
+
/// @prop {Dimension} padding-y [1.5em] Singular value for the top and bottom padding
|
|
26
|
+
/// @prop {Color} icon-background-color [transparent] The background color of the icon.
|
|
27
|
+
/// @prop {Color} icon-background-color-hover [transparent] The background color of the icon when hovered or focused.
|
|
28
|
+
/// @prop {Number} icon-border-radius [50%] The border-radius of the icon.
|
|
29
|
+
/// @prop {String} icon-color [link] Color of the icon. This uses color.scss, so the value of this option should be a color variable from color.scss.
|
|
30
|
+
/// @prop {String} icon-color-hover [link-hover] Color of the icon when hovered or focused on. This uses color.scss, so the value of this options should be a color variable from color.scss.
|
|
31
|
+
/// @prop {Dimension} icon-font-size [1.5rem] The font-size of the icon.
|
|
32
|
+
/// @prop {Dimension} icon-size [auto] The size of the icon. Used as the base in the flex property.
|
|
33
|
+
/// @prop {Dimension} icon-stroke-width [0.15em]
|
|
34
|
+
/// @prop {Color} summary-background-color [null] The background color for the summary (toggle button) of the accordion
|
|
35
|
+
/// @prop {Color} summary-color [null] The color of the text in the accordion summary.
|
|
36
|
+
/// @prop {Color} summary-color-hover [null] The color of the text in the accordion summary when hovering or focusing on it.
|
|
37
|
+
/// @prop {Dimension} summary-line-height [null] Adjusts the line height of the summary element.
|
|
38
|
+
/// @prop {Dimension} summary-padding-y [1rem] The vertical padding of the summary.
|
|
39
|
+
/// @prop {Dimension} summary-type-size [false] The size of the text in the accordion summary.
|
|
40
|
+
/// @prop {Dimension} transparent-padding-y [1em] The upper and lower padding of the transparent summary.
|
|
41
|
+
/// @prop {Dimension} transparent-padding-x [0] The upper and lower padding of the transparent summary.
|
|
42
|
+
|
|
43
|
+
$config: (
|
|
44
|
+
"background-color": white,
|
|
45
|
+
"background-color-open": #F7F8F7,
|
|
46
|
+
"border-color": "rule",
|
|
47
|
+
"border-radius": 0,
|
|
48
|
+
"border-width": 1px,
|
|
49
|
+
"box-shadow": none,
|
|
50
|
+
"margin": 3rem,
|
|
51
|
+
"margin-between": 0,
|
|
52
|
+
"padding-x": 1.5em,
|
|
53
|
+
"padding-y": 1.5em,
|
|
54
|
+
"icon-background-color": transparent,
|
|
55
|
+
"icon-background-color-hover": transparent,
|
|
56
|
+
"icon-border-radius": 50%,
|
|
57
|
+
"icon-color": "link",
|
|
58
|
+
"icon-color-hover": "link-hover",
|
|
59
|
+
"icon-font-size": 1.5rem,
|
|
60
|
+
"icon-size": auto,
|
|
61
|
+
"icon-stroke-width": 0.15em,
|
|
62
|
+
"summary-background-color": white,
|
|
63
|
+
"summary-color": null,
|
|
64
|
+
"summary-background-color-hover": null,
|
|
65
|
+
"summary-color-hover": null,
|
|
66
|
+
"summary-line-height": null,
|
|
67
|
+
"summary-padding-y": 1rem,
|
|
68
|
+
"summary-type-size": false,
|
|
69
|
+
"transparent-padding-x": 0,
|
|
70
|
+
"transparent-padding-y": 1em,
|
|
71
|
+
) !default;
|
|
72
|
+
|
|
73
|
+
/// Change modules $config
|
|
74
|
+
/// @param {Map} $changes Map of changes
|
|
75
|
+
/// @example
|
|
76
|
+
/// @include ulu.component-accordion-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-accordion-get("property");
|
|
86
|
+
|
|
87
|
+
@function get($name) {
|
|
88
|
+
@return utils.require-map-get($config, $name, "accordion [config]");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/// Prints component styles
|
|
92
|
+
/// @demo accordion
|
|
93
|
+
/// @example scss
|
|
94
|
+
/// @include ulu.component-accordion-styles();
|
|
95
|
+
|
|
96
|
+
@mixin styles {
|
|
97
|
+
$prefix: selector.class("accordion");
|
|
98
|
+
|
|
99
|
+
$border: get("border-width") solid color.get(get("border-color"));
|
|
100
|
+
|
|
101
|
+
// When not one of our custom classed details components
|
|
102
|
+
#{ $prefix } {
|
|
103
|
+
position: relative; // For active border
|
|
104
|
+
border-radius: 0;
|
|
105
|
+
padding-left: get("padding-x");
|
|
106
|
+
padding-right: get("padding-x");
|
|
107
|
+
margin-top: get("margin");
|
|
108
|
+
margin-bottom: get("margin");
|
|
109
|
+
border: $border;
|
|
110
|
+
background-color: get("background-color");
|
|
111
|
+
box-shadow: get("box-shadow");
|
|
112
|
+
&:first-of-type {
|
|
113
|
+
border-top-left-radius: get("border-radius");
|
|
114
|
+
border-top-right-radius: get("border-radius");
|
|
115
|
+
}
|
|
116
|
+
&:last-of-type {
|
|
117
|
+
border-bottom-left-radius: get("border-radius");
|
|
118
|
+
border-bottom-right-radius: get("border-radius");
|
|
119
|
+
}
|
|
120
|
+
& + & {
|
|
121
|
+
$gap: -(get("margin") - get("margin-between"));
|
|
122
|
+
margin-top: $gap;
|
|
123
|
+
margin-top: calc($gap - 1px);
|
|
124
|
+
}
|
|
125
|
+
&[open],
|
|
126
|
+
&.is-active {
|
|
127
|
+
background-color: get("background-color-open");
|
|
128
|
+
padding-bottom: get("padding-y");
|
|
129
|
+
z-index: 2; // Above child details
|
|
130
|
+
> #{ $prefix }__summary {
|
|
131
|
+
margin-bottom: get("padding-y");
|
|
132
|
+
border-bottom-left-radius: 0;
|
|
133
|
+
border-bottom-right-radius: 0;
|
|
134
|
+
border-bottom: $border;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
#{ $prefix }__summary {
|
|
139
|
+
background-color: get("summary-background-color");
|
|
140
|
+
color: get("summary-color");
|
|
141
|
+
margin-left: -(get("padding-x"));
|
|
142
|
+
margin-right: -(get("padding-x"));
|
|
143
|
+
line-height: get("summary-line-height");
|
|
144
|
+
padding: get("summary-padding-y") get("padding-x");
|
|
145
|
+
vertical-align: top;
|
|
146
|
+
font-weight: bold;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
&:has(#{ $prefix }__icon) {
|
|
149
|
+
display: flex; // For icon
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: space-between;
|
|
152
|
+
list-style: none; // Remove the default arrow (old safari?)
|
|
153
|
+
&::-webkit-details-marker,
|
|
154
|
+
&::marker {
|
|
155
|
+
display: none;
|
|
156
|
+
content: "";
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@if (get("summary-type-size")) {
|
|
161
|
+
@include typography.size(get("summary-type-size"));
|
|
162
|
+
}
|
|
163
|
+
&:hover {
|
|
164
|
+
background-color: get("summary-background-color-hover");
|
|
165
|
+
color: get("summary-color-hover");
|
|
166
|
+
#{ $prefix }__icon {
|
|
167
|
+
background-color: get("icon-background-color-hover");
|
|
168
|
+
color: color.get(get("icon-color-hover"));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
#{ $prefix }__icon {
|
|
173
|
+
flex: 0 0 get("icon-size");
|
|
174
|
+
color: color.get(get("icon-color"));
|
|
175
|
+
margin-left: 0.5em;
|
|
176
|
+
order: 3;
|
|
177
|
+
background-color: get("icon-background-color");
|
|
178
|
+
border-radius: get("icon-border-radius");
|
|
179
|
+
width: get("icon-size");
|
|
180
|
+
height: get("icon-size");
|
|
181
|
+
font-size: get("icon-font-size");
|
|
182
|
+
line-height: 1;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
text-align: center;
|
|
187
|
+
}
|
|
188
|
+
#{ $prefix }--transparent {
|
|
189
|
+
border-left: none;
|
|
190
|
+
border-right: none;
|
|
191
|
+
background-color: transparent;
|
|
192
|
+
padding-left: get("transparent-padding-x");
|
|
193
|
+
padding-right: get("transparent-padding-x");
|
|
194
|
+
> #{ $prefix }__summary {
|
|
195
|
+
margin-left: -(get("transparent-padding-x"));
|
|
196
|
+
margin-right: -(get("transparent-padding-x"));
|
|
197
|
+
padding: get("transparent-padding-y") get("transparent-padding-x");
|
|
198
|
+
background-color: transparent;
|
|
199
|
+
border: none;
|
|
200
|
+
}
|
|
201
|
+
&[open],
|
|
202
|
+
&.is-active {
|
|
203
|
+
background-color: transparent;
|
|
204
|
+
> #{ $prefix }__summary{
|
|
205
|
+
border-bottom: none;
|
|
206
|
+
margin-bottom: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
#{ $prefix }--no-borders {
|
|
211
|
+
border: none;
|
|
212
|
+
margin-bottom: 4rem;
|
|
213
|
+
&[open] > .accordion__summary {
|
|
214
|
+
border-bottom: none;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group adaptive-spacing
|
|
3
|
+
/// Creates adaptive (changing at breakpoints) in between items (vertical/horizontal layout)
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
|
|
8
|
+
@use "../breakpoint";
|
|
9
|
+
@use "../utils";
|
|
10
|
+
@use "../selector";
|
|
11
|
+
|
|
12
|
+
/// Module Settings
|
|
13
|
+
/// @type Map
|
|
14
|
+
/// @prop {Boolean} outputMargin [false] @joe-check need examples for this to build documentation
|
|
15
|
+
/// @prop {Boolean} outputPadding [true] This is the background color of the accordion before it is expanded.
|
|
16
|
+
/// @prop {Boolean} outputX [true] This is the background color of the accordion before it is expanded.
|
|
17
|
+
/// @prop {Boolean} outputY [true] This is the background color of the accordion before it is expanded.
|
|
18
|
+
/// @prop {Boolean} selectorX ["sides"] This is the background color of the accordion before it is expanded.
|
|
19
|
+
/// @prop {Boolean} selectorY ["ends"] This is the background color of the accordion before it is expanded.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
$config: (
|
|
23
|
+
"outputMargin": false,
|
|
24
|
+
"outputPadding": true,
|
|
25
|
+
"outputX": true,
|
|
26
|
+
"outputY": true,
|
|
27
|
+
"selectorX": "sides",
|
|
28
|
+
"selectorY": "ends"
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
/// Sizes Map
|
|
32
|
+
/// @type Map
|
|
33
|
+
|
|
34
|
+
$sizes: (
|
|
35
|
+
"small" : (
|
|
36
|
+
"initial" : (
|
|
37
|
+
"size" : 2rem
|
|
38
|
+
),
|
|
39
|
+
"medium" : (
|
|
40
|
+
"direction" : "min",
|
|
41
|
+
"size": 4rem
|
|
42
|
+
)
|
|
43
|
+
),
|
|
44
|
+
"large" : (
|
|
45
|
+
"initial" : (
|
|
46
|
+
"size" : 4rem
|
|
47
|
+
),
|
|
48
|
+
"medium" : (
|
|
49
|
+
"direction" : "min",
|
|
50
|
+
"size" : 8rem
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
/// Change modules $config
|
|
56
|
+
/// @param {Map} $changes Map of changes
|
|
57
|
+
/// @example
|
|
58
|
+
/// @include ulu.component-adaptive-spacing-set(( "property" : value ));
|
|
59
|
+
|
|
60
|
+
@mixin set($changes) {
|
|
61
|
+
$config: map.merge($config, $changes) !global;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// Set sizes map
|
|
65
|
+
/// @param {Map} $changes Map of changes
|
|
66
|
+
/// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
|
|
67
|
+
|
|
68
|
+
@mixin set-sizes($changes, $merge-mode: null) {
|
|
69
|
+
$sizes: utils.map-merge($sizes, $changes, $merge-mode) !global;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// Get a config option
|
|
73
|
+
/// @param {Map} $name Name of property
|
|
74
|
+
/// @example
|
|
75
|
+
/// @include ulu.component-adaptive-spacing-get("property");
|
|
76
|
+
|
|
77
|
+
@function get($name) {
|
|
78
|
+
@return utils.require-map-get($config, $name, "component-adaptive-spacing [config]");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/// Outputs adaptive spacing component styles
|
|
82
|
+
/// @example scss
|
|
83
|
+
/// @include ulu.component-adaptive-spacing-styles();
|
|
84
|
+
|
|
85
|
+
@mixin styles {
|
|
86
|
+
$prefixMargin: selector.class("adaptive-margin");
|
|
87
|
+
$prefixPadding: selector.class("adaptive-padding");
|
|
88
|
+
$hasMargin: map.get($config, "outputMargin");
|
|
89
|
+
$hasPadding: map.get($config, "outputPadding");
|
|
90
|
+
|
|
91
|
+
@each $name, $breakpoints in $sizes {
|
|
92
|
+
$sizePrefixMargin: "#{ $prefixMargin }-#{ $name }";
|
|
93
|
+
$sizePrefixPadding: "#{ $prefixPadding }-#{ $name }";
|
|
94
|
+
@each $breakpoint, $props in $breakpoints {
|
|
95
|
+
$direction: map.get($props, "direction");
|
|
96
|
+
$value: map.get($props, "size");
|
|
97
|
+
// If no direction it is the default
|
|
98
|
+
@if $direction == null {
|
|
99
|
+
@if $hasMargin {
|
|
100
|
+
@include -classes-for-type($sizePrefixMargin, "margin", $value);
|
|
101
|
+
}
|
|
102
|
+
@if $hasPadding {
|
|
103
|
+
@include -classes-for-type($sizePrefixPadding, "padding", $value);
|
|
104
|
+
}
|
|
105
|
+
} @else {
|
|
106
|
+
@include breakpoint.from($breakpoint, $direction) {
|
|
107
|
+
@if $hasMargin {
|
|
108
|
+
@include -classes-for-type($sizePrefixMargin, "margin", $value);
|
|
109
|
+
}
|
|
110
|
+
@if $hasPadding {
|
|
111
|
+
@include -classes-for-type($sizePrefixPadding, "padding", $value);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@mixin -classes-for-type($prefix, $prop, $value) {
|
|
120
|
+
#{ $prefix } {
|
|
121
|
+
#{ $prop }: $value;
|
|
122
|
+
}
|
|
123
|
+
@if (map.get($config, "outputX")) {
|
|
124
|
+
#{ $prefix }-#{ map.get($config, "selectorX")} {
|
|
125
|
+
#{ $prop }-left: $value;
|
|
126
|
+
#{ $prop }-right: $value;
|
|
127
|
+
}
|
|
128
|
+
#{ $prefix }-left {
|
|
129
|
+
#{ $prop }-left: $value;
|
|
130
|
+
}
|
|
131
|
+
#{ $prefix }-right {
|
|
132
|
+
#{ $prop }-right: $value;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
@if (map.get($config, "outputY")) {
|
|
136
|
+
#{ $prefix }-#{ map.get($config, "selectorY")} {
|
|
137
|
+
#{ $prop }-top: $value;
|
|
138
|
+
#{ $prop }-bottom: $value;
|
|
139
|
+
}
|
|
140
|
+
#{ $prefix }-top {
|
|
141
|
+
#{ $prop }-top: $value;
|
|
142
|
+
}
|
|
143
|
+
#{ $prefix }-bottom {
|
|
144
|
+
#{ $prop }-bottom: $value;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group badge
|
|
3
|
+
/// Outputs badge component stylesheet
|
|
3
4
|
////
|
|
4
5
|
|
|
5
6
|
@use "sass:map";
|
|
@@ -8,21 +9,21 @@
|
|
|
8
9
|
|
|
9
10
|
/// Module Settings
|
|
10
11
|
/// @type Map
|
|
11
|
-
/// @prop {Number}
|
|
12
|
-
/// @prop {Number}
|
|
13
|
-
/// @prop {Number}
|
|
14
|
-
/// @prop {Number}
|
|
15
|
-
/// @prop {Number}
|
|
16
|
-
/// @prop {
|
|
17
|
-
/// @prop {
|
|
12
|
+
/// @prop {Number} background-color [gray] Background color (if no image)
|
|
13
|
+
/// @prop {Number} border-radius [50%] Border radius of badge
|
|
14
|
+
/// @prop {Number} color [black] Type color
|
|
15
|
+
/// @prop {Number} font-size [1.3rem] Font size (basic ie. 1.3rem) for badge
|
|
16
|
+
/// @prop {Number} font-weight [bold] Font weight
|
|
17
|
+
/// @prop {List} sizes [Object] List of other sizes (large by default), each size is a map of (width, font-size)
|
|
18
|
+
/// @prop {Number} width [10rem] Width of badge (default size)
|
|
18
19
|
|
|
19
20
|
$config: (
|
|
20
|
-
"font-size": 1.3rem,
|
|
21
|
-
"border-radius": 50%,
|
|
22
|
-
"width": 10rem,
|
|
23
|
-
"font-weight": bold,
|
|
24
21
|
"background-color": gray,
|
|
22
|
+
"border-radius": 50%,
|
|
25
23
|
"color": black,
|
|
24
|
+
"font-size": 1.3rem,
|
|
25
|
+
"font-weight": bold,
|
|
26
|
+
"width": 10rem,
|
|
26
27
|
"sizes" : (
|
|
27
28
|
"large" : (
|
|
28
29
|
"font-size" : 2.75rem,
|
|
@@ -33,7 +34,8 @@ $config: (
|
|
|
33
34
|
|
|
34
35
|
/// Change modules $config
|
|
35
36
|
/// @param {Map} $changes Map of changes
|
|
36
|
-
///
|
|
37
|
+
/// @example
|
|
38
|
+
/// @include ulu.component-badge-set(( "property" : value ));
|
|
37
39
|
|
|
38
40
|
@mixin set($changes) {
|
|
39
41
|
$config: map.merge($config, $changes) !global;
|
|
@@ -41,13 +43,14 @@ $config: (
|
|
|
41
43
|
|
|
42
44
|
/// Get a config option
|
|
43
45
|
/// @param {Map} $name Name of property
|
|
44
|
-
///
|
|
46
|
+
/// @example
|
|
47
|
+
/// @include ulu.component-badge-get("property");
|
|
45
48
|
|
|
46
49
|
@function get($name) {
|
|
47
50
|
@return utils.require-map-get($config, $name, "badge [config]");
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
///
|
|
53
|
+
/// Output badge component styles
|
|
51
54
|
/// @example scss
|
|
52
55
|
/// @include ulu.component-badge-styles();
|
|
53
56
|
/// @example html {preview}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group button-verbose
|
|
3
|
+
/// A button that has additional markup (ie. page with description for example). Used on things like linear pagination (up next).
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:meta";
|
|
8
|
+
|
|
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"
|
|
18
|
+
),
|
|
19
|
+
"box-shadow" : (
|
|
20
|
+
"function" : meta.get-function("get", false, "element"),
|
|
21
|
+
"property" : "box-shadow"
|
|
22
|
+
),
|
|
23
|
+
"box-shadow-hover" : (
|
|
24
|
+
"function" : meta.get-function("get", false, "element"),
|
|
25
|
+
"property" : "box-shadow-hover"
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/// Module Settings
|
|
30
|
+
/// @type Map
|
|
31
|
+
/// @prop {Color} background-color [white] Font size (basic ie. 1.3rem) for badge
|
|
32
|
+
/// @prop {Color} background-color-hover [link] Font size (basic ie. 1.3rem) for badge
|
|
33
|
+
/// @prop {String} border-radius [border-radius] Font size (basic ie. 1.3rem) for badge
|
|
34
|
+
/// @prop {String} box-shadow [true] Use the fallback. But note it.
|
|
35
|
+
/// @prop {String} box-shadow-hover [true] @joe-check these box-shadows are booleans, but it should be a css value
|
|
36
|
+
/// @prop {String} color [type] Font size (basic ie. 1.3rem) for badge
|
|
37
|
+
/// @prop {String} color-hover [type] Font size (basic ie. 1.3rem) for badge
|
|
38
|
+
/// @prop {Color} icon-color [gray] Font size (basic ie. 1.3rem) for badge
|
|
39
|
+
/// @prop {Dimension} icon-font-size [1.25rem] Font size (basic ie. 1.3rem) for badge
|
|
40
|
+
/// @prop {Number} line-height [1.2] Font size (basic ie. 1.3rem) for badge
|
|
41
|
+
/// @prop {Dimension} margin [1em] Font size (basic ie. 1.3rem) for badge
|
|
42
|
+
/// @prop {Dimension} margin-inline [0.75em] Font size (basic ie. 1.3rem) for badge
|
|
43
|
+
/// @prop {Dimension} min-width [20rem] Font size (basic ie. 1.3rem) for badge
|
|
44
|
+
/// @prop {Dimension} padding-x [0.65em] Font size (basic ie. 1.3rem) for badge
|
|
45
|
+
/// @prop {Dimension} padding-y [1em] Font size (basic ie. 1.3rem) for badge
|
|
46
|
+
/// @prop {String} title-color [link] Font size (basic ie. 1.3rem) for badge
|
|
47
|
+
/// @prop {String} title-color-hover [link-hover] Font size (basic ie. 1.3rem) for badge
|
|
48
|
+
/// @prop {Dimension} title-margin [0.5em] Font size (basic ie. 1.3rem) for badge
|
|
49
|
+
|
|
50
|
+
$config: (
|
|
51
|
+
"background-color" : white,
|
|
52
|
+
"background-color-hover" : "link",
|
|
53
|
+
"border-radius" : "border-radius",
|
|
54
|
+
"box-shadow" : true,
|
|
55
|
+
"box-shadow-hover" : true,
|
|
56
|
+
"color" : "type",
|
|
57
|
+
"color-hover" : "type",
|
|
58
|
+
"icon-color": gray,
|
|
59
|
+
"icon-font-size" : 1.25rem,
|
|
60
|
+
"line-height" : 1.2,
|
|
61
|
+
"margin" : 1em,
|
|
62
|
+
"margin-inline" : 0.75em,
|
|
63
|
+
"min-width": 20rem,
|
|
64
|
+
"padding-x": 0.65em,
|
|
65
|
+
"padding-y": 1em,
|
|
66
|
+
"title-color": "link",
|
|
67
|
+
"title-margin" : 0.5em,
|
|
68
|
+
"title-color-hover" : "link-hover",
|
|
69
|
+
) !default;
|
|
70
|
+
|
|
71
|
+
/// Change modules $config
|
|
72
|
+
/// @param {Map} $changes Map of changes
|
|
73
|
+
/// @example
|
|
74
|
+
/// @include ulu.component-button-verbose-set(( "property" : value ));
|
|
75
|
+
|
|
76
|
+
@mixin set($changes) {
|
|
77
|
+
$config: map.merge($config, $changes) !global;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// Get a config option
|
|
81
|
+
/// @param {Map} $name Name of property
|
|
82
|
+
/// @example
|
|
83
|
+
/// @include ulu.component-button-verbose-get(( "property" : value ));
|
|
84
|
+
|
|
85
|
+
@function get($name) {
|
|
86
|
+
$value: utils.require-map-get($config, $name, "button-verbose [config]");
|
|
87
|
+
@return utils.function-fallback($name, $value, $-fallbacks);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/// Prints component styles
|
|
91
|
+
/// @example scss
|
|
92
|
+
/// @include ulu.component-button-verbose-styles();
|
|
93
|
+
|
|
94
|
+
@mixin styles {
|
|
95
|
+
.button-verbose {
|
|
96
|
+
text-decoration: none;
|
|
97
|
+
border-radius: element.get(get("border-radius"));
|
|
98
|
+
box-shadow: get("box-shadow");
|
|
99
|
+
line-height: get("line-height");
|
|
100
|
+
position: relative;
|
|
101
|
+
display: block;
|
|
102
|
+
margin-bottom: get("margin");
|
|
103
|
+
max-width: 100%;
|
|
104
|
+
width: get("min-width");
|
|
105
|
+
background-color: get("background-color");
|
|
106
|
+
padding: get("padding-y") get("padding-x");
|
|
107
|
+
padding-right: (get("padding-x") * 2) + 1em;
|
|
108
|
+
color: color.get(get("color"));
|
|
109
|
+
&:hover {
|
|
110
|
+
color: color.get(get("color-hover"));
|
|
111
|
+
background-color: color.get(get("background-color-hover"));
|
|
112
|
+
box-shadow: get("box-shadow-hover");
|
|
113
|
+
.button-verbose__title {
|
|
114
|
+
color: color.get(get("title-color-hover"));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
.button-verbose__title {
|
|
119
|
+
display: block;
|
|
120
|
+
margin-bottom: get("title-margin");
|
|
121
|
+
color: color.get(get("title-color"));
|
|
122
|
+
}
|
|
123
|
+
.button-verbose__icon {
|
|
124
|
+
position: absolute;
|
|
125
|
+
top: 50%;
|
|
126
|
+
right: get("padding-x");
|
|
127
|
+
transform: translateY(-50%);
|
|
128
|
+
font-size: get("icon-font-size");
|
|
129
|
+
color: get("icon-color");
|
|
130
|
+
}
|
|
131
|
+
.button-verbose--inline {
|
|
132
|
+
display: inline-block;
|
|
133
|
+
margin-right: get("margin-inline");
|
|
134
|
+
}
|
|
135
|
+
.button-verbose--full-width {
|
|
136
|
+
width: 100%;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group button
|
|
3
|
+
/// Output core button styles and sizes
|
|
3
4
|
////
|
|
4
5
|
|
|
5
6
|
@use "sass:map";
|
|
@@ -9,13 +10,17 @@
|
|
|
9
10
|
@use "../utils";
|
|
10
11
|
@use "../button";
|
|
11
12
|
|
|
13
|
+
/// Module Settings
|
|
14
|
+
/// @type Map
|
|
15
|
+
/// @prop {Dimension} icon-margin [1em] List of other sizes (large by default), each size is a map of (width, font-size)
|
|
16
|
+
|
|
12
17
|
$config: (
|
|
13
|
-
"icon-margin" :
|
|
18
|
+
"icon-margin" : 0.5em
|
|
14
19
|
) !default;
|
|
15
20
|
|
|
16
21
|
/// Change modules $config
|
|
17
22
|
/// @param {Map} $changes Map of changes
|
|
18
|
-
/// @include
|
|
23
|
+
/// @include ulu.component-button-set(( "property" : value ));
|
|
19
24
|
|
|
20
25
|
@mixin set($changes) {
|
|
21
26
|
$config: map.merge($config, $changes) !global;
|
|
@@ -23,13 +28,13 @@ $config: (
|
|
|
23
28
|
|
|
24
29
|
/// Get a config option
|
|
25
30
|
/// @param {Map} $name Name of property
|
|
26
|
-
/// @include
|
|
31
|
+
/// @include ulu.component-button-get("property");
|
|
27
32
|
|
|
28
33
|
@function get($name) {
|
|
29
34
|
@return utils.require-map-get($config, $name, "component-button [config]");
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
///
|
|
37
|
+
/// Output button component styles
|
|
33
38
|
/// @example scss
|
|
34
39
|
/// @include ulu.component-button-styles();
|
|
35
40
|
/// @example html {preview}
|