@expressivecss/expressive 0.7.0 → 0.9.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/CHANGELOG.md +1313 -1
- package/README.md +76 -30
- package/dist/css/expressive.css +4896 -1777
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/LICENSE-material-symbols +93 -0
- package/dist/fonts/LICENSE-noto-sans +93 -0
- package/dist/fonts/LICENSE-roboto +93 -0
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-400.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-500.woff2 +0 -0
- package/dist/fonts/roboto-latin-400.woff2 +0 -0
- package/dist/fonts/roboto-latin-500.woff2 +0 -0
- package/dist/js/expressive.cjs +1673 -1338
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +1673 -1338
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +13 -13
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +1673 -1338
- package/dist/js/expressive.mjs.map +4 -4
- package/dist/types/behaviors/bottomSheets.d.ts +19 -11
- package/dist/types/behaviors/sheetDrag.d.ts +40 -0
- package/dist/types/behaviors/sideSheets.d.ts +2 -9
- package/dist/types/components/appBar.d.ts +26 -0
- package/dist/types/components/autocomplete.d.ts +15 -3
- package/dist/types/components/buttonGroup.d.ts +39 -0
- package/dist/types/components/buttons.d.ts +5 -1
- package/dist/types/components/cards.d.ts +11 -13
- package/dist/types/components/carousel.d.ts +87 -53
- package/dist/types/components/chips.d.ts +21 -1
- package/dist/types/components/expandingCard.d.ts +31 -0
- package/dist/types/components/index.d.ts +23 -20
- package/dist/types/components/lightbox.d.ts +1 -0
- package/dist/types/components/menu.d.ts +11 -1
- package/dist/types/components/{sidenav.d.ts → navigationDrawer.d.ts} +16 -16
- package/dist/types/components/registry.d.ts +18 -8
- package/dist/types/components/slider.d.ts +26 -85
- package/dist/types/components/snackbar.d.ts +20 -5
- package/dist/types/components/tabs.d.ts +12 -0
- package/dist/types/components/timepicker.d.ts +12 -10
- package/dist/types/components/tooltip.d.ts +1 -0
- package/dist/types/core/utils.d.ts +64 -53
- package/dist/types/index.d.ts +8 -9
- package/package.json +39 -3
- package/src/sass/README.md +61 -11
- package/src/sass/abstracts/_breakpoints.scss +17 -19
- package/src/sass/abstracts/_mixins.scss +155 -21
- package/src/sass/abstracts/_variables.scss +69 -5
- package/src/sass/base/_fonts.scss +63 -0
- package/src/sass/base/_global.scss +6 -24
- package/src/sass/base/_grid.scss +15 -12
- package/src/sass/base/_normalize.scss +34 -38
- package/src/sass/base/_typography.scss +4 -18
- package/src/sass/components/_badges.scss +3 -5
- package/src/sass/components/_banners.scss +298 -0
- package/src/sass/components/_bottom-app-bar.scss +180 -0
- package/src/sass/components/_bottom-sheet.scss +12 -4
- package/src/sass/components/_button-groups.scss +358 -0
- package/src/sass/components/_buttons.scss +245 -92
- package/src/sass/components/_cards.scss +514 -78
- package/src/sass/components/_carousel.scss +562 -68
- package/src/sass/components/_chips.scss +64 -5
- package/src/sass/components/_datepicker.scss +24 -24
- package/src/sass/components/_dialog.scss +17 -11
- package/src/sass/components/_drag-handle.scss +130 -0
- package/src/sass/components/_expanding-card.scss +226 -0
- package/src/sass/components/_fab-menu.scss +232 -0
- package/src/sass/components/_floating-sheet.scss +86 -0
- package/src/sass/components/_icon-buttons.scss +172 -0
- package/src/sass/components/_icons-material-design.scss +22 -10
- package/src/sass/components/_index.scss +22 -6
- package/src/sass/components/_list.scss +16 -13
- package/src/sass/components/_loading-indicator.scss +106 -0
- package/src/sass/components/_menu.scss +335 -61
- package/src/sass/components/_navbar.scss +245 -45
- package/src/sass/components/_navigation-bar.scss +22 -11
- package/src/sass/components/{_sidenav.scss → _navigation-drawer.scss} +123 -33
- package/src/sass/components/_navigation-rail.scss +31 -23
- package/src/sass/components/_page-footer.scss +19 -16
- package/src/sass/components/_pagination.scss +24 -6
- package/src/sass/components/_panes.scss +52 -11
- package/src/sass/components/{_preloader.scss → _progress.scss} +11 -3
- package/src/sass/components/_scrim.scss +37 -0
- package/src/sass/components/_search.scss +259 -0
- package/src/sass/components/_segmented-buttons.scss +188 -0
- package/src/sass/components/_side-sheet.scss +2 -2
- package/src/sass/components/_snackbar.scss +20 -15
- package/src/sass/components/_split-button.scss +196 -0
- package/src/sass/components/_tabs.scss +7 -8
- package/src/sass/components/_timepicker.scss +67 -58
- package/src/sass/components/_toolbar.scss +206 -80
- package/src/sass/components/_transitions.scss +8 -1
- package/src/sass/components/forms/_checkboxes.scss +49 -12
- package/src/sass/components/forms/_fieldset.scss +4 -4
- package/src/sass/components/forms/_file-input.scss +8 -1
- package/src/sass/components/forms/_index.scss +1 -1
- package/src/sass/components/forms/_input-fields.scss +50 -44
- package/src/sass/components/forms/_radio-buttons.scss +42 -10
- package/src/sass/components/forms/_select.scss +38 -1
- package/src/sass/components/forms/{_range.scss → _slider.scss} +8 -9
- package/src/sass/components/forms/_switches.scss +6 -7
- package/src/sass/expressive.scss +5 -0
- package/src/sass/tokens/_index.scss +4 -1
- package/src/sass/tokens/_reference.scss +70 -61
- package/src/sass/tokens/_state.scss +24 -0
- package/src/sass/tokens/_theme.scss +6 -3
- package/src/sass/tokens/_vibrant.scss +76 -0
- package/src/sass/utilities/_colors.scss +14 -1
- package/src/sass/utilities/_helpers.scss +5 -5
- package/src/sass/utilities/_visibility.scss +48 -26
- package/dist/types/behaviors/waves.d.ts +0 -15
- package/dist/types/components/parallax.d.ts +0 -16
- package/dist/types/components/range.d.ts +0 -43
- package/dist/types/core/bounding.d.ts +0 -6
- package/dist/types/core/edges.d.ts +0 -6
- package/src/sass/components/_parallax.scss +0 -104
- package/src/sass/components/_pulse.scss +0 -37
- package/src/sass/components/_slider.scss +0 -129
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Material Design 3 state layer opacities.
|
|
2
|
+
//
|
|
3
|
+
// A state layer is the translucent overlay a component paints over itself to
|
|
4
|
+
// show hover, focus, pressed or dragged. M3 replaced the ripple with it, which
|
|
5
|
+
// is why this is a foundation and not a component: no author writes markup for
|
|
6
|
+
// it, components put it behind themselves.
|
|
7
|
+
//
|
|
8
|
+
// Values are md.sys.state.* from DSP 34.0.21, verified against
|
|
9
|
+
// material-web/tokens/versions/latest/sass/_md-sys-state.scss. Note focus and
|
|
10
|
+
// pressed are 0.1, not the 0.12 quoted in some secondary sources.
|
|
11
|
+
//
|
|
12
|
+
// Two shapes consume these. An overlay pseudo-element uses the number as an
|
|
13
|
+
// `opacity` directly; a ring drawn with `color-mix()` needs a percentage, so it
|
|
14
|
+
// multiplies by 100% - see the `state-layer-ring` mixin in abstracts.
|
|
15
|
+
|
|
16
|
+
@use "../abstracts" as *;
|
|
17
|
+
|
|
18
|
+
:root,
|
|
19
|
+
:host {
|
|
20
|
+
--md-sys-state-hover-state-layer-opacity: 0.08;
|
|
21
|
+
--md-sys-state-focus-state-layer-opacity: 0.1;
|
|
22
|
+
--md-sys-state-pressed-state-layer-opacity: 0.1;
|
|
23
|
+
--md-sys-state-dragged-state-layer-opacity: 0.16;
|
|
24
|
+
}
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
|
|
37
37
|
// Opting out of the OS preference. Every token above re-resolves from these.
|
|
38
38
|
// `auto` is the explicit follow-OS value — same as omitting the attribute.
|
|
39
|
-
:root[theme='light']
|
|
40
|
-
:
|
|
41
|
-
:root[theme='
|
|
39
|
+
:root[theme='light'],
|
|
40
|
+
:host([theme='light']) { color-scheme: light; }
|
|
41
|
+
:root[theme='dark'],
|
|
42
|
+
:host([theme='dark']) { color-scheme: dark; }
|
|
43
|
+
:root[theme='auto'],
|
|
44
|
+
:host([theme='auto']) { color-scheme: light dark; }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "../abstracts" as *;
|
|
4
|
+
|
|
5
|
+
// Vibrant emphasis (M3 Expressive).
|
|
6
|
+
//
|
|
7
|
+
// Vibrant is not a component variant. It is a surface *emphasis*: the same
|
|
8
|
+
// component, drawn on an accent container instead of a neutral surface. M3
|
|
9
|
+
// ships it as a parallel token set per component - md.comp.menus-vibrant,
|
|
10
|
+
// md.comp.toolbar-vibrant, VibrantTimePickerDialog in Compose - which means
|
|
11
|
+
// every component that gains the axis restates the same mappings and every one
|
|
12
|
+
// of them can drift. Here it is one subtree remap of the surface family, so a
|
|
13
|
+
// component needs no vibrant code at all to sit on a vibrant surface.
|
|
14
|
+
//
|
|
15
|
+
// The mechanism is the one tokens/_theme.scss already relies on: a custom
|
|
16
|
+
// property redeclared on an element is inherited by everything under it, and a
|
|
17
|
+
// light-dark() token substituted into it stays unresolved until it is *used*.
|
|
18
|
+
// So [vibrant] follows a runtime theme switch for free - it points at the live
|
|
19
|
+
// --md-sys-color-* roles, not at the -light / -dark pair behind them.
|
|
20
|
+
//
|
|
21
|
+
// What is deliberately NOT remapped, because a vibrant surface is a surface
|
|
22
|
+
// change and nothing else:
|
|
23
|
+
//
|
|
24
|
+
// accent roles primary, secondary, tertiary and their containers keep
|
|
25
|
+
// their values, which is what lets a filled button still
|
|
26
|
+
// stand out on a vibrant panel. It is also the constraint
|
|
27
|
+
// that keeps this to one ramp: tertiary is what M3 uses for
|
|
28
|
+
// the axis, and pointing the surfaces at primary or
|
|
29
|
+
// secondary instead would erase every component whose own
|
|
30
|
+
// fill is that container - a tonal button, a FAB, and
|
|
31
|
+
// .toolbar.vibrant itself. An author who wants a different
|
|
32
|
+
// ramp sets --md-sys-color-surface* on their own wrapper,
|
|
33
|
+
// the way the Themes page already shows for any token.
|
|
34
|
+
// outline roles neutral-variant in M3, not an opacity of the text color.
|
|
35
|
+
// Deriving them from on-*-container turns every checkbox,
|
|
36
|
+
// radio and switch border inside the subtree translucent.
|
|
37
|
+
// surface-tint an accent despite the name - it is the elevation tint.
|
|
38
|
+
// inverse-*, scrim they exist to contrast with the page, not to follow it.
|
|
39
|
+
//
|
|
40
|
+
// The elevation ladder does collapse: every surface-container rung resolves to
|
|
41
|
+
// the one container color, because that is what a vibrant surface is in M3 and
|
|
42
|
+
// inventing intermediate tints would put five numbers in the framework that the
|
|
43
|
+
// spec does not have. on-surface-variant collapses onto on-surface for the same
|
|
44
|
+
// reason - the container has one text color. The consequence of both is that
|
|
45
|
+
// nesting surfaces inside a vibrant subtree stops distinguishing them, so put
|
|
46
|
+
// [vibrant] on the component you want emphasized, not on the page.
|
|
47
|
+
//
|
|
48
|
+
// A component that carries its own .vibrant class - Menu, Toolbar - is
|
|
49
|
+
// unaffected inside a vibrant subtree: those rules are in the components layer
|
|
50
|
+
// and beat this one, so each keeps the colors its own M3 token set gives it.
|
|
51
|
+
|
|
52
|
+
// Every surface role, derived rather than restated: a rung added to
|
|
53
|
+
// $sys-color-roles and forgotten here would keep its neutral value and sit as a
|
|
54
|
+
// grey patch on an accent one. `on-` and `inverse-surface` are excluded by the
|
|
55
|
+
// prefix test; surface-tint by name, per the note above.
|
|
56
|
+
$_vibrant-surfaces: ();
|
|
57
|
+
@each $role in $sys-color-roles {
|
|
58
|
+
@if $role == "background" or
|
|
59
|
+
(string.index($role, "surface") == 1 and $role != "surface-tint") {
|
|
60
|
+
$_vibrant-surfaces: list.append($_vibrant-surfaces, $role);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// :host([vibrant]) for the same reason tokens/_theme.scss carries :host - a
|
|
65
|
+
// sheet loaded inside a shadow root cannot reach its own host with a descendant
|
|
66
|
+
// selector, so <my-panel vibrant> would leave the whole shadow tree neutral.
|
|
67
|
+
[vibrant],
|
|
68
|
+
:host([vibrant]) {
|
|
69
|
+
@each $role in $_vibrant-surfaces {
|
|
70
|
+
--md-sys-color-#{$role}: var(--md-sys-color-tertiary-container);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
--md-sys-color-on-surface: var(--md-sys-color-on-tertiary-container);
|
|
74
|
+
--md-sys-color-on-surface-variant: var(--md-sys-color-on-tertiary-container);
|
|
75
|
+
--md-sys-color-on-background: var(--md-sys-color-on-tertiary-container);
|
|
76
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:list";
|
|
1
2
|
@use "../abstracts" as *;
|
|
2
3
|
|
|
3
4
|
// One fill class and one `-text` foreground class per color role.
|
|
@@ -5,8 +6,20 @@
|
|
|
5
6
|
// token layer. Pair a fill with its `on-*` text class — container
|
|
6
7
|
// roles are fills, not text; `on-*` roles are text/icons, not fills.
|
|
7
8
|
|
|
9
|
+
// Three fills step aside for the components that name those same roles as
|
|
10
|
+
// their own colour axis, the way `.circle` steps aside for the FAB's corner
|
|
11
|
+
// in `_helpers`. Utilities win by layer, not by weight, so a role class on
|
|
12
|
+
// one of these would repaint the container and leave the label colour and
|
|
13
|
+
// both state layers - which are mixed from the same role - behind. On the FAB
|
|
14
|
+
// menu it is worse than a miss: the class sits on the host, which is a bare
|
|
15
|
+
// 56px box behind a round FAB, so the fill lands as a square. Only those
|
|
16
|
+
// three roles: a role no component names has nothing to lose and keeps its
|
|
17
|
+
// fill everywhere.
|
|
18
|
+
$_role-named: "primary-container", "secondary-container", "tertiary-container";
|
|
19
|
+
$_role-named-hosts: ":not(.extend):not(.fab-menu)";
|
|
20
|
+
|
|
8
21
|
@each $role in $sys-color-roles {
|
|
9
|
-
.#{$role} {
|
|
22
|
+
#{if(list.index($_role-named, $role), ".#{$role}#{$_role-named-hosts}", ".#{$role}")} {
|
|
10
23
|
background-color: var(--md-sys-color-#{$role});
|
|
11
24
|
}
|
|
12
25
|
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
.right-align { text-align: right }
|
|
13
13
|
.center-align { text-align: center; }
|
|
14
14
|
|
|
15
|
-
// TODO: Remove this
|
|
16
|
-
.left { float: left !important; }
|
|
17
|
-
.right { float: right !important; }
|
|
18
|
-
|
|
19
15
|
// Dividers
|
|
20
16
|
.divider {
|
|
21
17
|
height: 1px;
|
|
@@ -25,7 +21,11 @@
|
|
|
25
21
|
|
|
26
22
|
// Shape and text behaviour
|
|
27
23
|
.no-select { user-select: none; }
|
|
28
|
-
|
|
24
|
+
// A FAB is `circle extra` / `circle large`, and its container shape is
|
|
25
|
+
// 16dp rounded corners, not a full round - so the utility skips it. Layer
|
|
26
|
+
// order puts utilities after components, which is why the exclusion has to
|
|
27
|
+
// live here: no selector in `components` can outrank this one.
|
|
28
|
+
.circle:not(.extra, .large) { border-radius: 50%; }
|
|
29
29
|
.center-block { display: block; margin-left: auto; margin-right: auto; }
|
|
30
30
|
.truncate { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
31
31
|
.no-padding { padding: 0 !important; }
|
|
@@ -1,71 +1,93 @@
|
|
|
1
1
|
@use "../abstracts" as *;
|
|
2
2
|
|
|
3
|
-
// Showing and hiding
|
|
4
|
-
//
|
|
3
|
+
// Showing and hiding by the exact M3 window size classes.
|
|
4
|
+
// The Materialize-era small/med/xxl names remain aliases for compatibility.
|
|
5
5
|
|
|
6
6
|
.hide { display: none !important; }
|
|
7
7
|
|
|
8
|
-
.hide-on-
|
|
9
|
-
|
|
8
|
+
.hide-on-compact-only,
|
|
9
|
+
.hide-on-small-only,
|
|
10
|
+
.hide-on-small-and-down {
|
|
11
|
+
@include bp-down("medium") { display: none !important; }
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
.hide-on-med-and-down {
|
|
13
|
-
@include bp-down("
|
|
15
|
+
@include bp-down("expanded") { display: none !important; }
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
.hide-on-med-and-up {
|
|
17
|
-
@include bp-up("
|
|
19
|
+
@include bp-up("medium") { display: none !important; }
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
.hide-on-medium-only,
|
|
20
23
|
.hide-on-med-only {
|
|
21
|
-
@include bp-between("
|
|
24
|
+
@include bp-between("medium", "expanded") {
|
|
22
25
|
display: none !important;
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
.hide-on-
|
|
27
|
-
@include bp-
|
|
29
|
+
.hide-on-expanded-only {
|
|
30
|
+
@include bp-between("expanded", "large") {
|
|
31
|
+
display: none !important;
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
.hide-on-
|
|
31
|
-
@include bp-up("
|
|
35
|
+
.hide-on-expanded-and-up {
|
|
36
|
+
@include bp-up("expanded") { display: none !important; }
|
|
32
37
|
}
|
|
33
38
|
|
|
39
|
+
.hide-on-large-only {
|
|
40
|
+
@include bp-between("large", "extra-large") {
|
|
41
|
+
display: none !important;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.hide-on-extra-large-only,
|
|
34
46
|
.hide-on-xxl-only {
|
|
35
|
-
@include bp-up("
|
|
47
|
+
@include bp-up("extra-large") { display: none !important; }
|
|
36
48
|
}
|
|
37
49
|
|
|
38
|
-
.show-on-
|
|
39
|
-
|
|
50
|
+
.show-on-compact,
|
|
51
|
+
.show-on-small {
|
|
52
|
+
@include bp-down("medium") { display: block !important; }
|
|
40
53
|
}
|
|
41
54
|
|
|
42
|
-
.show-on-
|
|
43
|
-
@include bp-
|
|
55
|
+
.show-on-medium {
|
|
56
|
+
@include bp-between("medium", "expanded") {
|
|
57
|
+
display: block !important;
|
|
58
|
+
}
|
|
44
59
|
}
|
|
45
60
|
|
|
46
|
-
.show-on-
|
|
47
|
-
@include bp-
|
|
61
|
+
.show-on-expanded {
|
|
62
|
+
@include bp-between("expanded", "large") {
|
|
63
|
+
display: block !important;
|
|
64
|
+
}
|
|
48
65
|
}
|
|
49
66
|
|
|
50
|
-
.show-on-
|
|
51
|
-
@include bp-
|
|
67
|
+
.show-on-expanded-and-up {
|
|
68
|
+
@include bp-up("expanded") { display: block !important; }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.show-on-large {
|
|
72
|
+
@include bp-between("large", "extra-large") {
|
|
52
73
|
display: block !important;
|
|
53
74
|
}
|
|
54
75
|
}
|
|
55
76
|
|
|
56
|
-
.show-on-
|
|
57
|
-
|
|
77
|
+
.show-on-extra-large,
|
|
78
|
+
.show-on-xxl {
|
|
79
|
+
@include bp-up("extra-large") { display: block !important; }
|
|
58
80
|
}
|
|
59
81
|
|
|
60
82
|
.show-on-medium-and-up {
|
|
61
|
-
@include bp-up("
|
|
83
|
+
@include bp-up("medium") { display: block !important; }
|
|
62
84
|
}
|
|
63
85
|
|
|
64
86
|
.show-on-medium-and-down {
|
|
65
|
-
@include bp-down("
|
|
87
|
+
@include bp-down("expanded") { display: block !important; }
|
|
66
88
|
}
|
|
67
89
|
|
|
68
|
-
// Center text on
|
|
90
|
+
// Center text on Compact windows.
|
|
69
91
|
.center-on-small-only {
|
|
70
|
-
@include bp-down("
|
|
92
|
+
@include bp-down("medium") { text-align: center; }
|
|
71
93
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type RGBColor = {
|
|
2
|
-
r: number;
|
|
3
|
-
g: number;
|
|
4
|
-
b: number;
|
|
5
|
-
};
|
|
6
|
-
type Position = {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
};
|
|
10
|
-
export declare class Waves {
|
|
11
|
-
private static _offset;
|
|
12
|
-
static renderWaveEffect(targetElement: HTMLElement, position?: Position | null, color?: RGBColor | null): void;
|
|
13
|
-
static Init(): void;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
|
-
export interface ParallaxOptions extends BaseOptions {
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Parallax. The effect is CSS (see components/_parallax.scss). This class
|
|
6
|
-
* exists so AutoInit / getInstance / destroy keep working; it does not
|
|
7
|
-
* attach scroll or resize listeners.
|
|
8
|
-
*/
|
|
9
|
-
export declare class Parallax extends Component<ParallaxOptions> {
|
|
10
|
-
constructor(el: HTMLElement, options: Partial<ParallaxOptions>);
|
|
11
|
-
static get defaults(): ParallaxOptions;
|
|
12
|
-
static init(el: HTMLElement, options?: Partial<ParallaxOptions>): Parallax;
|
|
13
|
-
static init(els: InitElements<InitElement>, options?: Partial<ParallaxOptions>): Parallax[];
|
|
14
|
-
static getInstance(el: HTMLElement): Parallax;
|
|
15
|
-
destroy(): void;
|
|
16
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
|
-
export interface RangeOptions extends BaseOptions {
|
|
3
|
-
}
|
|
4
|
-
export declare class Range extends Component<RangeOptions> {
|
|
5
|
-
el: HTMLInputElement;
|
|
6
|
-
private _mousedown;
|
|
7
|
-
value: HTMLElement;
|
|
8
|
-
thumb: HTMLElement;
|
|
9
|
-
constructor(el: HTMLInputElement, options: Partial<RangeOptions>);
|
|
10
|
-
static get defaults(): RangeOptions;
|
|
11
|
-
/**
|
|
12
|
-
* Initializes instance of Range.
|
|
13
|
-
* @param el HTML element.
|
|
14
|
-
* @param options Component options.
|
|
15
|
-
*/
|
|
16
|
-
static init(el: HTMLInputElement, options?: Partial<RangeOptions>): Range;
|
|
17
|
-
/**
|
|
18
|
-
* Initializes instances of Range.
|
|
19
|
-
* @param els HTML elements.
|
|
20
|
-
* @param options Component options.
|
|
21
|
-
*/
|
|
22
|
-
static init(els: InitElements<HTMLInputElement | InitElement>, options?: Partial<RangeOptions>): Range[];
|
|
23
|
-
static getInstance(el: HTMLInputElement): Range;
|
|
24
|
-
destroy(): void;
|
|
25
|
-
_setupEventHandlers(): void;
|
|
26
|
-
_removeEventHandlers(): void;
|
|
27
|
-
_handleRangeChange: () => void;
|
|
28
|
-
_handleRangeMousedownTouchstart: (e: MouseEvent | TouchEvent) => void;
|
|
29
|
-
_handleRangeInputMousemoveTouchmove: () => void;
|
|
30
|
-
_handleRangeMouseupTouchend: () => void;
|
|
31
|
-
_handleRangeBlurMouseoutTouchleave: () => void;
|
|
32
|
-
_setupThumb(): void;
|
|
33
|
-
_removeThumb(): void;
|
|
34
|
-
_isVertical(): boolean;
|
|
35
|
-
_host(): HTMLElement | null;
|
|
36
|
-
_clampDual(): void;
|
|
37
|
-
_fraction(el: HTMLInputElement): number;
|
|
38
|
-
_sync(): void;
|
|
39
|
-
/**
|
|
40
|
-
* Initializes every range input in the current document.
|
|
41
|
-
*/
|
|
42
|
-
static Init(): void;
|
|
43
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
@use "../abstracts" as *;
|
|
2
|
-
|
|
3
|
-
// Parallax. Anatomy is the HTML: a .parallax (or <figure class="parallax">)
|
|
4
|
-
// clips an <img>, <picture>, or <video>. A heading / <p> / <figcaption> is
|
|
5
|
-
// the overlay.
|
|
6
|
-
//
|
|
7
|
-
// Motion is CSS. A named view timeline on the clip drives the image; without
|
|
8
|
-
// animation-timeline the image is just object-fit: cover. JS does not scroll.
|
|
9
|
-
//
|
|
10
|
-
// Tokens:
|
|
11
|
-
// --md-comp-parallax-height visible window (500px)
|
|
12
|
-
// --md-comp-parallax-travel how far the image moves (64px)
|
|
13
|
-
// --md-comp-parallax-shape 12px, same as media / lightbox / slider
|
|
14
|
-
|
|
15
|
-
.parallax {
|
|
16
|
-
--md-comp-parallax-height: 500px;
|
|
17
|
-
--md-comp-parallax-travel: 120px;
|
|
18
|
-
--md-comp-parallax-shape: 12px;
|
|
19
|
-
|
|
20
|
-
position: relative;
|
|
21
|
-
isolation: isolate;
|
|
22
|
-
overflow: hidden;
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
height: var(--md-comp-parallax-height);
|
|
25
|
-
margin: 0;
|
|
26
|
-
border-radius: var(--md-comp-parallax-shape);
|
|
27
|
-
view-timeline-name: --parallax;
|
|
28
|
-
view-timeline-axis: block;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.parallax > :is(img, video),
|
|
32
|
-
.parallax > picture {
|
|
33
|
-
position: absolute;
|
|
34
|
-
inset: 0;
|
|
35
|
-
display: block;
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 100%;
|
|
38
|
-
border: 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.parallax > picture img {
|
|
42
|
-
display: block;
|
|
43
|
-
width: 100%;
|
|
44
|
-
height: 100%;
|
|
45
|
-
border: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.parallax > :is(img, video),
|
|
49
|
-
.parallax > picture img {
|
|
50
|
-
object-fit: cover;
|
|
51
|
-
object-position: center;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Overlay. A heading or <p> is a centered hero; figcaption docks to the
|
|
55
|
-
// bottom on a translucent surface, same idea as a card figure.
|
|
56
|
-
.parallax > :is(h1, h2, h3, h4, h5, h6),
|
|
57
|
-
.parallax > p {
|
|
58
|
-
position: absolute;
|
|
59
|
-
inset: 0;
|
|
60
|
-
z-index: 1;
|
|
61
|
-
display: grid;
|
|
62
|
-
place-items: center;
|
|
63
|
-
margin: 0;
|
|
64
|
-
padding: 24px;
|
|
65
|
-
color: var(--md-sys-color-on-surface);
|
|
66
|
-
text-align: center;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.parallax > figcaption {
|
|
70
|
-
position: absolute;
|
|
71
|
-
inset: auto 0 0;
|
|
72
|
-
z-index: 1;
|
|
73
|
-
margin: 0;
|
|
74
|
-
padding: 16px 24px;
|
|
75
|
-
color: var(--md-sys-color-on-surface);
|
|
76
|
-
background: color-mix(in oklab, var(--md-sys-color-surface) 72%, transparent);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Full-bleed hero. Meets the viewport edges; no corners.
|
|
80
|
-
.parallax.max {
|
|
81
|
-
height: 100vh;
|
|
82
|
-
height: 100dvh;
|
|
83
|
-
border-radius: 0;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Progressive enhancement: without animation-timeline the image stays a
|
|
87
|
-
// static cover. Named timeline is the clip, not the (taller) image.
|
|
88
|
-
@supports (animation-timeline: view()) {
|
|
89
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
90
|
-
.parallax > :is(img, video),
|
|
91
|
-
.parallax > picture img {
|
|
92
|
-
height: calc(100% + 2 * var(--md-comp-parallax-travel));
|
|
93
|
-
inset: calc(-1 * var(--md-comp-parallax-travel)) 0 auto;
|
|
94
|
-
animation: parallax-shift linear both;
|
|
95
|
-
animation-timeline: --parallax;
|
|
96
|
-
animation-range: cover;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@keyframes parallax-shift {
|
|
102
|
-
from { transform: translateY(var(--md-comp-parallax-travel)); }
|
|
103
|
-
to { transform: translateY(calc(-1 * var(--md-comp-parallax-travel))); }
|
|
104
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
@use "../abstracts" as *;
|
|
2
|
-
|
|
3
|
-
.pulse {
|
|
4
|
-
overflow: visible;
|
|
5
|
-
position: relative;
|
|
6
|
-
|
|
7
|
-
&::before {
|
|
8
|
-
content: '';
|
|
9
|
-
display: block;
|
|
10
|
-
position: absolute;
|
|
11
|
-
pointer-events: none;
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
top: 0;
|
|
15
|
-
left: 0;
|
|
16
|
-
background-color: inherit;
|
|
17
|
-
border-radius: inherit;
|
|
18
|
-
transition: opacity .3s, transform .3s;
|
|
19
|
-
animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;
|
|
20
|
-
z-index: -1;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@keyframes pulse-animation {
|
|
25
|
-
0% {
|
|
26
|
-
opacity: 1;
|
|
27
|
-
transform: scale(1);
|
|
28
|
-
}
|
|
29
|
-
50% {
|
|
30
|
-
opacity: 0;
|
|
31
|
-
transform: scale(1.5);
|
|
32
|
-
}
|
|
33
|
-
100% {
|
|
34
|
-
opacity: 0;
|
|
35
|
-
transform: scale(1.5);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
@use "../abstracts" as *;
|
|
2
|
-
|
|
3
|
-
.slider {
|
|
4
|
-
position: relative;
|
|
5
|
-
height: 400px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
// Same 12px as .responsive-img / .lightboxed. Applied to the slide
|
|
8
|
-
// stack, not the slider: init() adds 40px under the slides for the
|
|
9
|
-
// indicators, so a radius on the outer box never meets the photo.
|
|
10
|
-
// Fullscreen stays square so it can meet the viewport edges.
|
|
11
|
-
&:not(.fullscreen) .slides,
|
|
12
|
-
&:not(.fullscreen) .slides li {
|
|
13
|
-
border-radius: 12px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Fullscreen slider
|
|
17
|
-
&.fullscreen {
|
|
18
|
-
height: 100%;
|
|
19
|
-
width: 100%;
|
|
20
|
-
position: absolute;
|
|
21
|
-
top: 0;
|
|
22
|
-
left: 0;
|
|
23
|
-
right: 0;
|
|
24
|
-
bottom: 0;
|
|
25
|
-
|
|
26
|
-
ul.slides {
|
|
27
|
-
padding-left: 0;
|
|
28
|
-
list-style-type: none;
|
|
29
|
-
height: 100%;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
ul.indicators {
|
|
33
|
-
padding-left: 0;
|
|
34
|
-
list-style-type: none;
|
|
35
|
-
z-index: 2;
|
|
36
|
-
bottom: 30px;
|
|
37
|
-
|
|
38
|
-
.indicator-item {
|
|
39
|
-
background-color: rgba(255, 255, 255, 0.45);
|
|
40
|
-
|
|
41
|
-
&.active {
|
|
42
|
-
background-color: var(--md-ref-palette-primary100);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.slides {
|
|
50
|
-
background-color: var(--md-sys-color-surface);
|
|
51
|
-
margin: 0;
|
|
52
|
-
height: 400px;
|
|
53
|
-
padding-left: 0;
|
|
54
|
-
list-style-type: none;
|
|
55
|
-
|
|
56
|
-
li {
|
|
57
|
-
padding-left: 0;
|
|
58
|
-
list-style-type: none;
|
|
59
|
-
opacity: 0;
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: 0;
|
|
62
|
-
left: 0;
|
|
63
|
-
z-index: 1;
|
|
64
|
-
width: 100%;
|
|
65
|
-
height: inherit;
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
|
|
68
|
-
img {
|
|
69
|
-
height: 100%;
|
|
70
|
-
width: 100%;
|
|
71
|
-
background-size: cover;
|
|
72
|
-
background-position: center;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.caption {
|
|
76
|
-
color: #fff;
|
|
77
|
-
position: absolute;
|
|
78
|
-
top: 15%;
|
|
79
|
-
left: 15%;
|
|
80
|
-
width: 70%;
|
|
81
|
-
opacity: 0;
|
|
82
|
-
|
|
83
|
-
p {
|
|
84
|
-
color: rgba(255, 255, 255, 0.75);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.active {
|
|
89
|
-
z-index: 2;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.indicators {
|
|
95
|
-
padding-left: 0;
|
|
96
|
-
list-style-type: none;
|
|
97
|
-
position: absolute;
|
|
98
|
-
text-align: center;
|
|
99
|
-
left: 0;
|
|
100
|
-
right: 0;
|
|
101
|
-
bottom: 0;
|
|
102
|
-
margin: 0;
|
|
103
|
-
|
|
104
|
-
.indicator-item {
|
|
105
|
-
display: inline-block;
|
|
106
|
-
position: relative;
|
|
107
|
-
height: 16px;
|
|
108
|
-
width: 16px;
|
|
109
|
-
margin: 0 12px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.indicator-item-btn {
|
|
113
|
-
position: absolute;
|
|
114
|
-
top: 0;
|
|
115
|
-
left: 0;
|
|
116
|
-
width: 100%;
|
|
117
|
-
height: 100%;
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
background-color: var(--md-sys-color-shadow);
|
|
120
|
-
transition: background-color .3s;
|
|
121
|
-
border-radius: 50%;
|
|
122
|
-
border-width: 0;
|
|
123
|
-
|
|
124
|
-
&.active {
|
|
125
|
-
background-color: var(--md-sys-color-primary);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|