@ulu/frontend 0.2.0-beta.9 → 0.3.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.
- package/README.dev.md +52 -13
- package/README.md +3 -1
- package/dist/es/core/events.js +36 -25
- package/dist/es/core/settings.js +33 -22
- package/dist/es/index.js +47 -45
- package/dist/es/ui/dialog.d.ts +3 -1
- package/dist/es/ui/dialog.d.ts.map +1 -1
- package/dist/es/ui/dialog.js +70 -53
- package/dist/es/ui/index.d.ts +1 -0
- package/dist/es/ui/modal-builder.d.ts +6 -0
- package/dist/es/ui/modal-builder.d.ts.map +1 -1
- package/dist/es/ui/modal-builder.js +66 -47
- package/dist/es/ui/overflow-scroller.js +30 -24
- package/dist/es/ui/proxy-click.js +37 -26
- package/dist/es/ui/resizer.js +57 -49
- package/dist/es/ui/slider.d.ts.map +1 -1
- package/dist/es/ui/slider.js +90 -67
- package/dist/es/ui/tab-manager.d.ts +145 -0
- package/dist/es/ui/tab-manager.d.ts.map +1 -0
- package/dist/es/ui/tab-manager.js +155 -0
- package/dist/es/ui/tabs.d.ts +5 -5
- package/dist/es/ui/tabs.d.ts.map +1 -1
- package/dist/es/ui/tabs.js +34 -51
- package/dist/es/ui/theme-toggle.js +80 -69
- package/dist/es/ui/tooltip.js +53 -44
- package/dist/es/utils/dialog.d.ts +14 -0
- package/dist/es/utils/dialog.d.ts.map +1 -0
- package/dist/es/utils/dialog.js +16 -0
- package/dist/es/utils/floating-ui.js +35 -24
- package/dist/es/utils/iframe.d.ts +15 -0
- package/dist/es/utils/iframe.d.ts.map +1 -0
- package/dist/es/utils/iframe.js +33 -0
- package/dist/umd/frontend.css +1 -0
- package/dist/umd/ulu-frontend.umd.js +40 -47
- package/lib/js/exports.md +1 -0
- package/lib/js/ui/dialog.js +23 -3
- package/lib/js/ui/index.js +4 -0
- package/lib/js/ui/modal-builder.js +21 -0
- package/lib/js/ui/slider.js +3 -3
- package/lib/js/ui/tab-manager.js +324 -0
- package/lib/js/ui/tabs.js +33 -92
- package/lib/js/utils/dialog.js +29 -0
- package/lib/js/utils/iframe.js +59 -0
- package/lib/scss/_breakpoint.scss +3 -3
- package/lib/scss/_button.scss +3 -3
- package/lib/scss/_color.scss +4 -3
- package/lib/scss/_element.scss +25 -4
- package/lib/scss/_layout.scss +11 -4
- package/lib/scss/_selector.scss +2 -1
- package/lib/scss/_typography.scss +9 -10
- package/lib/scss/_utils.scss +74 -19
- package/lib/scss/base/_elements.scss +4 -1
- package/lib/scss/components/_accordion.scss +7 -2
- package/lib/scss/components/_badge.scss +1 -1
- package/lib/scss/components/_basic-hero.scss +1 -1
- package/lib/scss/components/_button-group.scss +8 -3
- package/lib/scss/components/_button-verbose.scss +2 -2
- package/lib/scss/components/_callout.scss +3 -4
- package/lib/scss/components/_card-grid.scss +8 -14
- package/lib/scss/components/_card.scss +15 -13
- package/lib/scss/components/_css-icon.scss +2 -2
- package/lib/scss/components/_data-grid.scss +5 -5
- package/lib/scss/components/_data-list.scss +270 -0
- package/lib/scss/components/_data-table.scss +3 -1
- package/lib/scss/components/_flipcard.scss +3 -2
- package/lib/scss/components/_index.scss +18 -0
- package/lib/scss/components/_menu-stack.scss +1 -1
- package/lib/scss/components/_modal.scss +97 -19
- package/lib/scss/components/_panel.scss +1 -1
- package/lib/scss/components/_popover.scss +9 -6
- package/lib/scss/components/_ratio-box.scss +11 -10
- package/lib/scss/components/_table-scroller.scss +63 -0
- package/lib/scss/components/_tabs.scss +20 -5
- package/lib/scss/components/_tagged.scss +59 -0
- package/lib/scss/helpers/_utilities.scss +23 -1
- package/package.json +28 -35
- package/dist/umd/style.css +0 -1
- package/lib/js/ui/dialog.todo +0 -3
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
@use "sass:map";
|
|
6
6
|
@use "sass:meta";
|
|
7
|
+
@use "sass:list";
|
|
7
8
|
|
|
8
9
|
@use "../color";
|
|
9
10
|
@use "../element";
|
|
@@ -11,9 +12,14 @@
|
|
|
11
12
|
@use "../typography";
|
|
12
13
|
@use "../selector";
|
|
13
14
|
@use "../utils";
|
|
15
|
+
@use "../breakpoint";
|
|
14
16
|
|
|
15
17
|
// Used for function fallback
|
|
16
18
|
$-fallbacks: (
|
|
19
|
+
"breakpoint" : (
|
|
20
|
+
"function" : meta.get-function("get", false, "breakpoint"),
|
|
21
|
+
"property" : "default"
|
|
22
|
+
),
|
|
17
23
|
"backdrop-color" : (
|
|
18
24
|
"function" : meta.get-function("get", false, "element"),
|
|
19
25
|
"property" : "backdrop-color"
|
|
@@ -43,6 +49,7 @@ $-fallbacks: (
|
|
|
43
49
|
/// @prop {Dimension} height [340px] The min-height of the modal.
|
|
44
50
|
/// @prop {Dimension} height-no-header [100px] The min-height of the modal.
|
|
45
51
|
/// @prop {Dimension} width [60rem] The width of the Modal
|
|
52
|
+
/// @prop {Dimension} min-width [300px] The min-width of the Modal (for resizing, etc)
|
|
46
53
|
/// @prop {Time} animation-duration [300ms] Animation duration for the modal opening.
|
|
47
54
|
/// @prop {Time} animation-duration-exit [150ms] Animation duration for the modal closing.
|
|
48
55
|
/// @prop {CssValue} animation-timing-function [cubic-bezier(0, 0, .2, 1)] The animation timing menu of the modal.
|
|
@@ -75,6 +82,9 @@ $-fallbacks: (
|
|
|
75
82
|
/// @prop {String} title-size [large] The font-size of the title. This uses typography.scss, so the value of this options should be a variable from typography.scss.
|
|
76
83
|
/// @prop {CssValue} title-text-transform [null] Transform option for the title.
|
|
77
84
|
/// @prop {Map} sizes [Map] Size options to enable unique stylings.
|
|
85
|
+
/// @prop {String} breakpoint [true] Optional breakpoint for modals (used for adaptive things like fullscreen-mobile), if set to true will fallback to breakpoint default
|
|
86
|
+
/// @prop {String} frame-aspect-ratio [list.slash(16, 9)] Default aspect ratio for single embedded items in frame-ratio layout
|
|
87
|
+
/// @prop {String} frame-fill-min-height [65vh] Default minimum height for single embedded items in frame-fill layout
|
|
78
88
|
|
|
79
89
|
$config: (
|
|
80
90
|
"backdrop-color" : true,
|
|
@@ -86,6 +96,7 @@ $config: (
|
|
|
86
96
|
"height": 340px,
|
|
87
97
|
"height-no-header": 100px,
|
|
88
98
|
"width": 60rem,
|
|
99
|
+
"min-width": 300px,
|
|
89
100
|
"width-left-right" : 30rem,
|
|
90
101
|
"animation-duration" : 300ms,
|
|
91
102
|
"animation-duration-exit" : 150ms,
|
|
@@ -119,6 +130,9 @@ $config: (
|
|
|
119
130
|
"title-icon-margin" : 0.5em,
|
|
120
131
|
"title-size" : "large",
|
|
121
132
|
"title-text-transform" : null,
|
|
133
|
+
"breakpoint" : true,
|
|
134
|
+
"frame-aspect-ratio" : list.slash(16, 9),
|
|
135
|
+
"frame-fill-min-height" : 65vh,
|
|
122
136
|
"sizes" : (
|
|
123
137
|
"small" : 30rem,
|
|
124
138
|
"large" : 80rem
|
|
@@ -150,6 +164,7 @@ $config: (
|
|
|
150
164
|
|
|
151
165
|
@mixin styles {
|
|
152
166
|
$prefix: selector.class("modal");
|
|
167
|
+
$breakpoint: get("breakpoint");
|
|
153
168
|
|
|
154
169
|
// // Before it's moved
|
|
155
170
|
[data-ulu-modal-builder] {
|
|
@@ -171,9 +186,10 @@ $config: (
|
|
|
171
186
|
padding: 0;
|
|
172
187
|
border: 0;
|
|
173
188
|
width: get("width");
|
|
174
|
-
min-width:
|
|
189
|
+
min-width: get("min-width"); // For resizing minimum width
|
|
175
190
|
min-height: get("height");
|
|
176
191
|
max-height: 100vh;
|
|
192
|
+
max-height: 100dvh;
|
|
177
193
|
max-width: 100%;
|
|
178
194
|
overflow-y: hidden;
|
|
179
195
|
box-sizing: border-box;
|
|
@@ -196,19 +212,20 @@ $config: (
|
|
|
196
212
|
display: flex;
|
|
197
213
|
justify-content: space-between;
|
|
198
214
|
align-items: center;
|
|
199
|
-
flex: 0;
|
|
215
|
+
flex: 0 0 auto;
|
|
200
216
|
padding: get("header-padding");
|
|
201
217
|
border-bottom: get("header-border-bottom");
|
|
202
218
|
background-color: color.get(get("header-background-color"));
|
|
203
219
|
color: color.get(get("header-color"));
|
|
204
220
|
}
|
|
205
221
|
#{ $prefix }__body {
|
|
206
|
-
flex: 1;
|
|
222
|
+
flex: 1 1 auto;
|
|
223
|
+
min-height: 0; // to ensure the flex grow container can get smaller than it's content (and scroll) when needed
|
|
207
224
|
overflow: auto;
|
|
208
225
|
padding: get("body-padding");
|
|
209
226
|
}
|
|
210
227
|
#{ $prefix }__footer {
|
|
211
|
-
flex: 0;
|
|
228
|
+
flex: 0 0 auto;
|
|
212
229
|
padding: get("footer-padding");
|
|
213
230
|
background-color: color.get(get("footer-background-color"));
|
|
214
231
|
border-top: get("footer-border-top");
|
|
@@ -245,10 +262,6 @@ $config: (
|
|
|
245
262
|
}
|
|
246
263
|
}
|
|
247
264
|
|
|
248
|
-
#{ $prefix }__close-icon {
|
|
249
|
-
// transform: translatey(get("close-icon-vertical-offset"));
|
|
250
|
-
}
|
|
251
|
-
|
|
252
265
|
#{ $prefix }__resizer {
|
|
253
266
|
position: absolute;
|
|
254
267
|
overflow: hidden;
|
|
@@ -293,15 +306,17 @@ $config: (
|
|
|
293
306
|
}
|
|
294
307
|
}
|
|
295
308
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
309
|
+
// Fullscreen and left and right defaults (width overridden below)
|
|
310
|
+
#{ $prefix }--fullscreen,
|
|
311
|
+
#{ $prefix }--right,
|
|
312
|
+
#{ $prefix }--left {
|
|
313
|
+
@include -fullscreen-common-properties();
|
|
300
314
|
}
|
|
315
|
+
// Left/Right specific
|
|
316
|
+
// - Note these properties are all important even though they seem redundant
|
|
317
|
+
// they are tested and solve quirks with dialog positioning/animation
|
|
301
318
|
#{ $prefix }--right,
|
|
302
319
|
#{ $prefix }--left {
|
|
303
|
-
border-radius: 0;
|
|
304
|
-
height: 100vh;
|
|
305
320
|
width: get("width-left-right");
|
|
306
321
|
top: 0;
|
|
307
322
|
bottom: 0;
|
|
@@ -358,11 +373,11 @@ $config: (
|
|
|
358
373
|
&#{ $prefix }--left {
|
|
359
374
|
padding-right: get("resizer-width");
|
|
360
375
|
}
|
|
361
|
-
// &#{ $prefix }--center {
|
|
362
|
-
// resize: both;
|
|
363
|
-
// }
|
|
364
376
|
}
|
|
365
|
-
|
|
377
|
+
// Share body flush layout
|
|
378
|
+
#{ $prefix }--body-fills,
|
|
379
|
+
#{ $prefix }--frame-ratio,
|
|
380
|
+
#{ $prefix }--frame-fill {
|
|
366
381
|
#{ $prefix }__header {
|
|
367
382
|
border-bottom: none;
|
|
368
383
|
}
|
|
@@ -370,10 +385,65 @@ $config: (
|
|
|
370
385
|
padding: 0;
|
|
371
386
|
}
|
|
372
387
|
}
|
|
373
|
-
|
|
374
388
|
#{ $prefix }--no-min-height {
|
|
375
389
|
min-height: 0;
|
|
376
390
|
}
|
|
391
|
+
|
|
392
|
+
// Frame layouts for absolute positioned single content (e.g. iframes)
|
|
393
|
+
// Both modes use absolute positioning to escape wrappers (p, div, etc)
|
|
394
|
+
#{ $prefix }--frame-ratio,
|
|
395
|
+
#{ $prefix }--frame-fill {
|
|
396
|
+
#{ $prefix }__body {
|
|
397
|
+
position: relative;
|
|
398
|
+
}
|
|
399
|
+
#{ $prefix }__frame-content {
|
|
400
|
+
position: absolute;
|
|
401
|
+
top: 0;
|
|
402
|
+
left: 0;
|
|
403
|
+
width: 100%;
|
|
404
|
+
height: 100%;
|
|
405
|
+
border: none;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// Ratio-specific: disable minimum heights and flex-grow so it perfectly wraps
|
|
410
|
+
#{ $prefix }--frame-ratio {
|
|
411
|
+
min-height: 0;
|
|
412
|
+
#{ $prefix }__body {
|
|
413
|
+
flex: none;
|
|
414
|
+
// Default, can be overridden inline
|
|
415
|
+
aspect-ratio: utils.normalize-aspect-ratio(get("frame-aspect-ratio"));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// Fill-specific: default height
|
|
420
|
+
#{ $prefix }--frame-fill {
|
|
421
|
+
#{ $prefix }__body {
|
|
422
|
+
// Default, can be overridden inline
|
|
423
|
+
min-height: get("frame-fill-min-height");
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
@if breakpoint.exists($breakpoint) {
|
|
428
|
+
#{ $prefix }--fullscreen-mobile {
|
|
429
|
+
@include breakpoint.max($breakpoint) {
|
|
430
|
+
@include -fullscreen-common-properties();
|
|
431
|
+
top: 50%;
|
|
432
|
+
left: 50%;
|
|
433
|
+
bottom: auto;
|
|
434
|
+
right: auto;
|
|
435
|
+
transform: translate(-50%, -50%);
|
|
436
|
+
animation: uluModalCenterOut get("animation-duration-exit") get("animation-timing-function");
|
|
437
|
+
&[open] {
|
|
438
|
+
animation: uluModalCenterIn get("animation-duration") get("animation-timing-function");
|
|
439
|
+
}
|
|
440
|
+
#{ $prefix }__resizer {
|
|
441
|
+
display: none;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
377
447
|
// Will display as content when printing
|
|
378
448
|
// NOTE: This will not work with native dialog
|
|
379
449
|
// Printing works with modal printer by cloning mechanism
|
|
@@ -522,3 +592,11 @@ $config: (
|
|
|
522
592
|
}
|
|
523
593
|
}
|
|
524
594
|
|
|
595
|
+
|
|
596
|
+
// Internal mixin to make sure this repeated CSS is identical for compression
|
|
597
|
+
@mixin -fullscreen-common-properties() {
|
|
598
|
+
width: 100%;
|
|
599
|
+
height: 100%;
|
|
600
|
+
height: 100dvh;
|
|
601
|
+
border-radius: 0;
|
|
602
|
+
}
|
|
@@ -229,7 +229,7 @@ $styles: (
|
|
|
229
229
|
font-family: map.get($props, "font-family");
|
|
230
230
|
color: color.get(map.get($props, "color"));
|
|
231
231
|
box-shadow: map.get($props, "box-shadow");
|
|
232
|
-
flex-grow:
|
|
232
|
+
flex-grow: utils.when(map.get($props, "grow") == false, 0, 1); // Default is grow
|
|
233
233
|
border-top: element.get-optional-rule-style(map.get($props, "border-top"));
|
|
234
234
|
border-bottom: element.get-optional-rule-style(map.get($props, "border-bottom"));
|
|
235
235
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
@use "sass:map";
|
|
9
9
|
@use "sass:meta";
|
|
10
10
|
|
|
11
|
+
@use "../utils";
|
|
11
12
|
@use "../selector";
|
|
12
13
|
@use "../typography";
|
|
13
|
-
@use "../utils";
|
|
14
14
|
@use "../color";
|
|
15
15
|
@use "../layout";
|
|
16
16
|
@use "../element";
|
|
@@ -298,11 +298,14 @@ $config: (
|
|
|
298
298
|
$hypotenuse: utils.hypotenuse($unitless, $unitless);
|
|
299
299
|
$hypotenuse-half: math.div($hypotenuse, 2);
|
|
300
300
|
$manual-extent: get("arrow-box-shadow-extent");
|
|
301
|
-
$shadow-extent:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
)
|
|
301
|
+
$shadow-extent: 5px;
|
|
302
|
+
|
|
303
|
+
@if ($manual-extent) {
|
|
304
|
+
$shadow-extent: $manual-extent;
|
|
305
|
+
} @else if (utils.is-list($box-shadow)) {
|
|
306
|
+
$shadow-extent: utils.box-shadow-extent($box-shadow);
|
|
307
|
+
}
|
|
308
|
+
|
|
306
309
|
$overlap: utils.strip-unit($shadow-extent);
|
|
307
310
|
$mask-height: utils.add-unit($hypotenuse-half + $overlap, $unit);
|
|
308
311
|
$mask-width: utils.add-unit($hypotenuse + $overlap, $unit);
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group ratio-box
|
|
3
3
|
////
|
|
4
|
-
/// Uses
|
|
4
|
+
/// Uses aspect-ratio to keep ratio. Defaults to 4/3 (standard). Used for responsive iframe or images (object-fit), etc.
|
|
5
5
|
|
|
6
6
|
@use "sass:map";
|
|
7
|
+
@use "sass:math";
|
|
8
|
+
@use "sass:meta";
|
|
9
|
+
@use "sass:list";
|
|
7
10
|
@use "../utils";
|
|
8
11
|
@use "../layout";
|
|
9
12
|
|
|
10
13
|
/// Module Settings
|
|
11
14
|
/// @type Map
|
|
12
|
-
/// @prop {Number} size [
|
|
15
|
+
/// @prop {String|Number} size ["4/3"] Default aspect ratio (can be string like "16/9" or legacy percentage value)
|
|
13
16
|
/// @prop {Map} sizes [Map] Other ratios to add (apply with modifier class)
|
|
14
17
|
|
|
15
18
|
$config: (
|
|
16
|
-
"size" :
|
|
19
|
+
"size" : list.slash(4, 3),
|
|
17
20
|
"sizes" : (
|
|
18
|
-
"16x9" :
|
|
19
|
-
"9x16" :
|
|
20
|
-
"3x4" :
|
|
21
|
+
"16x9" : list.slash(16, 9),
|
|
22
|
+
"9x16" : list.slash(9, 16),
|
|
23
|
+
"3x4" : list.slash(3, 4)
|
|
21
24
|
)
|
|
22
25
|
) !default;
|
|
23
26
|
|
|
@@ -46,16 +49,14 @@ $config: (
|
|
|
46
49
|
@mixin styles {
|
|
47
50
|
.ratio-box {
|
|
48
51
|
position: relative;
|
|
49
|
-
|
|
50
|
-
padding: get("size") 0 0 0;
|
|
52
|
+
aspect-ratio: utils.normalize-aspect-ratio(get("size"));
|
|
51
53
|
}
|
|
52
54
|
.ratio-box__content {
|
|
53
55
|
@include layout.absolute-fill(true);
|
|
54
|
-
border: 0;
|
|
55
56
|
}
|
|
56
57
|
@each $name, $size in get("sizes") {
|
|
57
58
|
.ratio-box--#{ $name } {
|
|
58
|
-
|
|
59
|
+
aspect-ratio: utils.normalize-aspect-ratio($size);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group table-scroller
|
|
3
|
+
/// Simple wrapper for tables to make them overflow-x, not to be confused with
|
|
4
|
+
/// sticky table plugin, this is for simple html tables
|
|
5
|
+
/// - Note in situations where you can't use a wrapper you can sometimes get by with display block / max-content hack
|
|
6
|
+
////
|
|
7
|
+
|
|
8
|
+
@use "sass:map";
|
|
9
|
+
@use "sass:math";
|
|
10
|
+
|
|
11
|
+
@use "../selector";
|
|
12
|
+
@use "../utils";
|
|
13
|
+
|
|
14
|
+
/// Module Settings
|
|
15
|
+
/// @type Map
|
|
16
|
+
/// @prop {List|Number} margin [(1em, 0)] Optional margin for this component
|
|
17
|
+
|
|
18
|
+
$config: (
|
|
19
|
+
"margin" : (1em, 0),
|
|
20
|
+
// "example": "background",
|
|
21
|
+
) !default;
|
|
22
|
+
|
|
23
|
+
/// Change modules $config
|
|
24
|
+
/// @param {Map} $changes Map of changes
|
|
25
|
+
/// @example scss
|
|
26
|
+
/// @include ulu.component-table-scroller-set(( "property" : value ));
|
|
27
|
+
|
|
28
|
+
@mixin set($changes) {
|
|
29
|
+
$config: map.merge($config, $changes) !global;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/// Get a config option
|
|
33
|
+
/// @param {Map} $name Name of property
|
|
34
|
+
/// @example scss
|
|
35
|
+
/// @include ulu.component-table-scroller-get("property");
|
|
36
|
+
|
|
37
|
+
@function get($name) {
|
|
38
|
+
@return utils.require-map-get($config, $name, "table-scroller [config]");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/// Prints component styles
|
|
42
|
+
/// @demo table-scroller
|
|
43
|
+
/// @example scss
|
|
44
|
+
/// @include ulu.component-table-scroller-styles();
|
|
45
|
+
|
|
46
|
+
@mixin styles {
|
|
47
|
+
$prefix: selector.class("table-scroller");
|
|
48
|
+
|
|
49
|
+
#{ $prefix } {
|
|
50
|
+
width: 100%;
|
|
51
|
+
overflow-x: auto;
|
|
52
|
+
margin: get("margin");
|
|
53
|
+
> table {
|
|
54
|
+
min-width: 100%;
|
|
55
|
+
max-width: none;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
#{ $prefix }--nowrap {
|
|
59
|
+
> table > thead th {
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
@use "sass:map";
|
|
7
7
|
@use "sass:meta";
|
|
8
8
|
|
|
9
|
+
@use "../utils";
|
|
9
10
|
@use "../color";
|
|
10
11
|
@use "../selector";
|
|
11
12
|
@use "../breakpoint";
|
|
12
13
|
@use "../layout";
|
|
13
14
|
@use "../typography";
|
|
14
15
|
@use "../element";
|
|
15
|
-
@use "../utils";
|
|
16
16
|
|
|
17
17
|
// Used for function fallback
|
|
18
18
|
$-fallbacks: (
|
|
@@ -43,7 +43,10 @@ $-fallbacks: (
|
|
|
43
43
|
/// @prop {Color} indicator-transition-duration [200ms] The transition duration for indicator
|
|
44
44
|
/// @prop {Color} indicator-scale-start [0] The starting scale for the indicator (set to 1 to disable expanding on click)
|
|
45
45
|
/// @prop {Color} tab-color [link] The type color for the tabs. This uses color.scss, so the value of this options should be a variable from color.scss.
|
|
46
|
-
/// @prop {Color} tab-color-hover [link-hover] The type color for the tabs when hovered
|
|
46
|
+
/// @prop {Color} tab-color-hover [link-hover] The type color for the tabs when hovered. This uses color.scss, so the value of this options should be a variable from color.scss.
|
|
47
|
+
/// @prop {Color|null} tab-color-focus [null] The type color for a tab when it has keyboard focus.
|
|
48
|
+
/// @prop {Color} tab-background-color-focus [#eeeeee] The background color for a tab when it has keyboard focus.
|
|
49
|
+
/// @prop {Boolean} tab-hide-native-focus [true] Hides the default browser outline on focused tabs.
|
|
47
50
|
/// @prop {Color} tab-color-selected [selected] The tab type color when selected. This uses color.scss, so the value of this options should be a variable from color.scss.
|
|
48
51
|
/// @prop {Color} tab-background-color-selected [null] The tab background color when selected
|
|
49
52
|
/// @prop {CssValue} tab-font-weight [true] The font weight for the tab, defaults to typography "font-weight-semibold"
|
|
@@ -69,6 +72,9 @@ $config: (
|
|
|
69
72
|
"indicator-scale-start" : 0,
|
|
70
73
|
"tab-color" : "type-tertiary",
|
|
71
74
|
"tab-color-hover" : "selected",
|
|
75
|
+
"tab-color-focus": null,
|
|
76
|
+
"tab-background-color-focus": "selected-background",
|
|
77
|
+
"tab-hide-native-focus": true,
|
|
72
78
|
"tab-color-selected" : "selected",
|
|
73
79
|
"tab-background-color-selected" : null,
|
|
74
80
|
"tab-font-weight" : true,
|
|
@@ -159,12 +165,21 @@ $config: (
|
|
|
159
165
|
// Add focus so as user clicks item it starts the active state styling
|
|
160
166
|
&:focus,
|
|
161
167
|
&[aria-selected="true"] {
|
|
162
|
-
|
|
168
|
+
@if get("tab-hide-native-focus") {
|
|
169
|
+
outline: none;
|
|
170
|
+
}
|
|
163
171
|
&::after {
|
|
164
172
|
opacity: 1;
|
|
165
173
|
transform: scaleX(1);
|
|
166
174
|
}
|
|
167
175
|
}
|
|
176
|
+
// Add new focus-specific colors
|
|
177
|
+
// Using :focus-visible so it only applies to keyboard focus
|
|
178
|
+
&:focus-visible,
|
|
179
|
+
&[aria-selected="true"]:focus-visible {
|
|
180
|
+
color: color.get(get("tab-color-focus"));
|
|
181
|
+
background-color: color.get(get("tab-background-color-focus"));
|
|
182
|
+
}
|
|
168
183
|
&[aria-selected="true"] {
|
|
169
184
|
color: color.get(get("tab-color-selected"));
|
|
170
185
|
background-color: color.get(get("tab-background-color-selected"));
|
|
@@ -209,8 +224,8 @@ $config: (
|
|
|
209
224
|
white-space: normal;
|
|
210
225
|
text-align: left;
|
|
211
226
|
&::after {
|
|
212
|
-
left:
|
|
213
|
-
right:
|
|
227
|
+
left: utils.when(get("vertical-indicator-left"), 0, auto);
|
|
228
|
+
right: utils.when(not get("vertical-indicator-left"), 0, auto);
|
|
214
229
|
bottom: 0;
|
|
215
230
|
top: 0;
|
|
216
231
|
width: get("indicator-size");
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group tagged
|
|
3
|
+
/// Provides styles to tags that should appear as superscripts of their related content. Custom properties --ulu-tagged-y, --ulu-tagged-x, and --ulu-tagged-transform can be adjusted if needed (inline style, in a specific styling for something, etc)
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
|
|
8
|
+
@use "../selector";
|
|
9
|
+
@use "../utils";
|
|
10
|
+
|
|
11
|
+
/// Module Settings
|
|
12
|
+
/// @type Map
|
|
13
|
+
/// @prop {Dimension} position-x [-0.75em] Horizontal absolute position of the tag.
|
|
14
|
+
/// @prop {Dimension} position-y [-0.75em] Vertical absolute position of the tag.
|
|
15
|
+
/// @prop {CssValue} icon-opacity [null] Adds a transform styling to the tag.
|
|
16
|
+
|
|
17
|
+
$config: (
|
|
18
|
+
"position-x": 0,
|
|
19
|
+
"position-y": 0,
|
|
20
|
+
"transform": translate(50%, -50%)
|
|
21
|
+
) !default;
|
|
22
|
+
|
|
23
|
+
/// Change modules $config
|
|
24
|
+
/// @param {Map} $changes Map of changes
|
|
25
|
+
/// @example scss
|
|
26
|
+
/// @include ulu.component-tagged-set(( "property" : value ));
|
|
27
|
+
|
|
28
|
+
@mixin set($changes) {
|
|
29
|
+
$config: map.merge($config, $changes) !global;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/// Get a config option
|
|
33
|
+
/// @param {Map} $name Name of property
|
|
34
|
+
/// @example scss
|
|
35
|
+
/// @include ulu.component-tagged-get("property");
|
|
36
|
+
|
|
37
|
+
@function get($name) {
|
|
38
|
+
@return utils.require-map-get($config, $name, "tagged [config]");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/// Output component styles
|
|
42
|
+
/// @example scss
|
|
43
|
+
/// @include ulu.component-tagged-styles();
|
|
44
|
+
|
|
45
|
+
@mixin styles {
|
|
46
|
+
|
|
47
|
+
$prefix: selector.class("tagged");
|
|
48
|
+
|
|
49
|
+
#{ $prefix } {
|
|
50
|
+
position: relative;
|
|
51
|
+
}
|
|
52
|
+
#{ $prefix }__tag {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: var(--ulu-tagged-y, get("position-y"));
|
|
55
|
+
right: var(--ulu-tagged-x, get("position-x"));
|
|
56
|
+
transform: var(--ulu-tagged-transform, get("transform"));
|
|
57
|
+
margin: 0; // So it doesn't interfere if present
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
$prefix-crop-margins: selector.class("crop-margins");
|
|
24
24
|
$prefix-no-padding: selector.class("no-padding");
|
|
25
25
|
$prefix-align-self: selector.class("align-self");
|
|
26
|
-
|
|
26
|
+
$prefix-align-items: selector.class("align-items");
|
|
27
|
+
$prefix-justify-content: selector.class("justify-content");
|
|
27
28
|
|
|
28
29
|
@include utils.file-header('helpers', 'utilities');
|
|
29
30
|
|
|
@@ -129,6 +130,27 @@
|
|
|
129
130
|
#{ $prefix-align-self }-baseline {
|
|
130
131
|
align-self: baseline;
|
|
131
132
|
}
|
|
133
|
+
#{ $prefix-align-items }-start {
|
|
134
|
+
align-items: flex-start;
|
|
135
|
+
}
|
|
136
|
+
#{ $prefix-align-items }-center {
|
|
137
|
+
align-items: center;
|
|
138
|
+
}
|
|
139
|
+
#{ $prefix-align-items }-end {
|
|
140
|
+
align-items: flex-end;
|
|
141
|
+
}
|
|
142
|
+
#{ $prefix-justify-content }-start {
|
|
143
|
+
justify-content: flex-start;
|
|
144
|
+
}
|
|
145
|
+
#{ $prefix-justify-content }-center {
|
|
146
|
+
justify-content: center;
|
|
147
|
+
}
|
|
148
|
+
#{ $prefix-justify-content }-end {
|
|
149
|
+
justify-content: flex-end;
|
|
150
|
+
}
|
|
151
|
+
#{ $prefix-justify-content }-space-between {
|
|
152
|
+
justify-content: space-between;
|
|
153
|
+
}
|
|
132
154
|
#{ selector.class("overflow-hidden") } {
|
|
133
155
|
overflow: hidden;
|
|
134
156
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A framework-agnostic frontend toolkit providing a modular, tree-shakable library of accessible components and utilities. Designed for seamless integration, it features a highly configurable SCSS system for any environment and vanilla JavaScript modules optimized for traditional websites and content management systems.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"types": "./dist/es/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
+
"types": "./dist/es/index.d.ts",
|
|
15
16
|
"import": "./dist/es/index.js",
|
|
16
|
-
"require": "./dist/umd/ulu-frontend.umd.js"
|
|
17
|
-
"types": "./dist/es/index.d.ts"
|
|
17
|
+
"require": "./dist/umd/ulu-frontend.umd.js"
|
|
18
18
|
},
|
|
19
19
|
"./style.css": "./dist/umd/style.css",
|
|
20
20
|
"./scss/*.scss": "./lib/scss/*.scss",
|
|
@@ -33,16 +33,12 @@
|
|
|
33
33
|
"build": "npm run build:es && npm run build:umd",
|
|
34
34
|
"build:es": "BUILD_FORMAT=es vite build",
|
|
35
35
|
"build:umd": "BUILD_FORMAT=umd vite build",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"docs:build
|
|
41
|
-
"
|
|
42
|
-
"docs:assets:build": "vite build --config docs.vite.config.js",
|
|
43
|
-
"docs:assets:build:prod": "IS_PRODUCTION=true vite build --config docs.vite.config.js",
|
|
44
|
-
"deploy": "npm run build && npm run docs:build:prod && npm run docs:assets:build:prod",
|
|
45
|
-
"deploy:docs": "npm run docs:build:prod && npm run docs:assets:build:prod"
|
|
36
|
+
"dev": "vite --config site/vite.config.js",
|
|
37
|
+
"dev:inspect": "node --inspect-brk node_modules/.bin/vite --config site/vite.config.js",
|
|
38
|
+
"dev:host": "vite --config site/vite.config.js --host",
|
|
39
|
+
"dev:nogen": "NO_DOC_GEN=true vite --config site/vite.config.js",
|
|
40
|
+
"docs:build": "vite build --config site/vite.config.js",
|
|
41
|
+
"deploy": "npm run build && npm run docs:build"
|
|
46
42
|
},
|
|
47
43
|
"repository": {
|
|
48
44
|
"type": "git",
|
|
@@ -87,44 +83,41 @@
|
|
|
87
83
|
"homepage": "https://github.com/Jscherbe/frontend#readme",
|
|
88
84
|
"peerDependencies": {
|
|
89
85
|
"@floating-ui/dom": "^1.6.5",
|
|
90
|
-
"@ulu/utils": "^0.0.
|
|
91
|
-
"ally.js": "^1.4.1",
|
|
92
|
-
"aria-tablist": "^1.2.2",
|
|
86
|
+
"@ulu/utils": "^0.0.34",
|
|
93
87
|
"swipe-listener": "^1.3.0"
|
|
94
88
|
},
|
|
95
89
|
"devDependencies": {
|
|
96
|
-
"@11ty/eleventy": "^3.
|
|
97
|
-
"@11ty/eleventy-navigation": "^0.
|
|
98
|
-
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.
|
|
90
|
+
"@11ty/eleventy": "^3.1.2",
|
|
91
|
+
"@11ty/eleventy-navigation": "^1.0.5",
|
|
92
|
+
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.2",
|
|
99
93
|
"@floating-ui/dom": "^1.6.5",
|
|
100
94
|
"@fortawesome/fontawesome-free": "^6.5.2",
|
|
95
|
+
"@ulu/eleventy-plugin-nav-tree": "^0.0.1",
|
|
101
96
|
"@ulu/markdown-output-utils": "^0.0.6",
|
|
102
97
|
"@ulu/sassdoc-to-markdown": "^0.0.16",
|
|
103
|
-
"@ulu/utils": "^0.0.
|
|
104
|
-
"@ulu/vite-
|
|
105
|
-
"@ulu/vitepress-auto-menus": "^0.0.3",
|
|
106
|
-
"@ulu/vitepress-sassdoc": "^0.0.9",
|
|
98
|
+
"@ulu/utils": "^0.0.34",
|
|
99
|
+
"@ulu/vite-plugin-eleventy": "^0.0.1",
|
|
107
100
|
"algoliasearch": "^4.23.3",
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"autoprefixer": "^10.4.16",
|
|
111
|
-
"chokidar": "^3.6.0",
|
|
101
|
+
"autoprefixer": "^10.4.23",
|
|
102
|
+
"chokidar": "^5.0.0",
|
|
112
103
|
"eleventy-plugin-nesting-toc": "^1.3.0",
|
|
113
104
|
"fs-extra": "^11.2.0",
|
|
114
105
|
"instantsearch.js": "^4.68.1",
|
|
106
|
+
"js-beautify": "^1.15.4",
|
|
115
107
|
"jsdoc": "^4.0.2",
|
|
116
|
-
"jsdoc-to-markdown": "^
|
|
108
|
+
"jsdoc-to-markdown": "^9.1.3",
|
|
117
109
|
"markdown-it-anchor": "^8.6.7",
|
|
118
110
|
"markdown-it-attrs": "^4.1.6",
|
|
119
|
-
"
|
|
111
|
+
"mime-types": "^3.0.2",
|
|
120
112
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
121
|
-
"sass-embedded": "
|
|
122
|
-
"sharp": "^0.
|
|
123
|
-
"svgo": "^
|
|
113
|
+
"sass-embedded": "1.97.3",
|
|
114
|
+
"sharp": "^0.34.5",
|
|
115
|
+
"svgo": "^4.0.0",
|
|
124
116
|
"swipe-listener": "^1.3.0",
|
|
125
117
|
"twig": "^1.17.1",
|
|
126
|
-
"typescript": "^5.
|
|
127
|
-
"vite": "^
|
|
128
|
-
"vite-plugin-dts": "^4.5.4"
|
|
118
|
+
"typescript": "^5.9.3",
|
|
119
|
+
"vite": "^7.3.1",
|
|
120
|
+
"vite-plugin-dts": "^4.5.4",
|
|
121
|
+
"vite-plugin-image-optimizer": "^2.0.3"
|
|
129
122
|
}
|
|
130
123
|
}
|