@expressivecss/expressive 0.2.0 → 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.md +8 -8
- package/dist/css/expressive.css +1038 -361
- 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/js/expressive.cjs +708 -746
- package/dist/js/expressive.cjs.map +3 -3
- package/dist/js/expressive.js +708 -746
- package/dist/js/expressive.js.map +3 -3
- package/dist/js/expressive.min.js +10 -10
- package/dist/js/expressive.min.js.map +3 -3
- package/dist/js/expressive.mjs +708 -746
- package/dist/js/expressive.mjs.map +3 -3
- package/dist/types/components/buttons.d.ts +17 -41
- package/dist/types/components/carousel.d.ts +40 -46
- package/dist/types/components/chips.d.ts +2 -2
- package/dist/types/components/collapsible.d.ts +35 -13
- package/dist/types/components/parallax.d.ts +7 -31
- package/dist/types/components/tapTarget.d.ts +23 -24
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/sass/README.md +4 -3
- package/src/sass/components/_badges.scss +5 -4
- package/src/sass/components/_breadcrumb.scss +93 -16
- package/src/sass/components/_buttons.scss +195 -96
- package/src/sass/components/_carousel.scss +130 -63
- package/src/sass/components/_chips.scss +1 -1
- package/src/sass/components/_collapsible.scss +160 -60
- package/src/sass/components/_collection.scss +161 -77
- package/src/sass/components/_icons-material-design.scss +77 -4
- package/src/sass/components/_lightbox.scss +4 -0
- package/src/sass/components/_navbar.scss +15 -0
- package/src/sass/components/_pagination.scss +131 -25
- package/src/sass/components/_parallax.scss +116 -20
- package/src/sass/components/_sidenav.scss +10 -5
- package/src/sass/components/_slider.scss +8 -0
- package/src/sass/components/_tapTarget.scss +134 -47
|
@@ -6,54 +6,33 @@ export interface FloatingActionButtonOptions extends BaseOptions {
|
|
|
6
6
|
*/
|
|
7
7
|
direction: 'top' | 'right' | 'bottom' | 'left';
|
|
8
8
|
/**
|
|
9
|
-
* true: FAB menu appears on hover,
|
|
9
|
+
* true: FAB menu appears on hover (CSS, when the pointer can hover).
|
|
10
|
+
* false: FAB menu toggles on click. `.click-to-toggle` is the markup switch.
|
|
10
11
|
* @default true
|
|
11
12
|
*/
|
|
12
13
|
hoverEnabled: boolean;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Expand the FAB into a toolbar on click. Prefer a hover or click menu.
|
|
16
|
+
* `.toolbar` on the element is the markup switch.
|
|
15
17
|
* @default false
|
|
16
18
|
*/
|
|
17
19
|
toolbarEnabled: boolean;
|
|
18
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Speed dial around a FAB. Open/close is the `.active` class; motion is
|
|
23
|
+
* CSS. Hover is CSS (`:hover` when the pointer can hover). This class
|
|
24
|
+
* toggles the class, wires keyboard / click-outside, and stamps direction.
|
|
25
|
+
*/
|
|
19
26
|
export declare class FloatingActionButton extends Component<FloatingActionButtonOptions> implements Openable {
|
|
20
|
-
/**
|
|
21
|
-
* Describes open/close state of FAB.
|
|
22
|
-
*/
|
|
23
27
|
isOpen: boolean;
|
|
24
28
|
private _anchor;
|
|
25
29
|
private _menu;
|
|
26
|
-
private _floatingBtns;
|
|
27
|
-
private _floatingBtnsReverse;
|
|
28
|
-
/** Toolbar-mode backdrop, kept so closing can take it back out. */
|
|
29
|
-
private _backdrop;
|
|
30
|
-
offsetY: number;
|
|
31
|
-
offsetX: number;
|
|
32
|
-
btnBottom: number;
|
|
33
|
-
btnLeft: number;
|
|
34
|
-
btnWidth: number;
|
|
35
30
|
constructor(el: HTMLElement, options: Partial<FloatingActionButtonOptions>);
|
|
36
31
|
static get defaults(): FloatingActionButtonOptions;
|
|
37
|
-
/**
|
|
38
|
-
* Initializes instance of FloatingActionButton.
|
|
39
|
-
* @param el HTML element.
|
|
40
|
-
* @param options Component options.
|
|
41
|
-
*/
|
|
42
32
|
static init(el: HTMLElement, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton;
|
|
43
|
-
/**
|
|
44
|
-
* Initializes instances of FloatingActionButton.
|
|
45
|
-
* @param els HTML elements.
|
|
46
|
-
* @param options Component options.
|
|
47
|
-
*/
|
|
48
33
|
static init(els: InitElements<MElement>, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton[];
|
|
49
34
|
static getInstance(el: HTMLElement): FloatingActionButton;
|
|
50
35
|
destroy(): void;
|
|
51
|
-
_setupEventHandlers(): void;
|
|
52
|
-
_removeEventHandlers(): void;
|
|
53
|
-
_handleFABClick: () => void;
|
|
54
|
-
_handleFABKeyPress: (e: any) => void;
|
|
55
|
-
_handleFABToggle: () => void;
|
|
56
|
-
_handleDocumentClick: (e: MouseEvent) => void;
|
|
57
36
|
/**
|
|
58
37
|
* Open FAB.
|
|
59
38
|
*/
|
|
@@ -62,15 +41,12 @@ export declare class FloatingActionButton extends Component<FloatingActionButton
|
|
|
62
41
|
* Close FAB.
|
|
63
42
|
*/
|
|
64
43
|
close: () => void;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* backdrop appended on every subsequent open.
|
|
74
|
-
*/
|
|
75
|
-
_animateOutToolbar(): void;
|
|
44
|
+
private _directionFromClass;
|
|
45
|
+
private _setupEventHandlers;
|
|
46
|
+
private _removeEventHandlers;
|
|
47
|
+
private _handleFABClick;
|
|
48
|
+
private _handleAnchorKeydown;
|
|
49
|
+
private _handleDocumentKeydown;
|
|
50
|
+
private _handleDocumentClick;
|
|
51
|
+
private _toggle;
|
|
76
52
|
}
|
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
import { Component, BaseOptions, InitElements, MElement } from '../core/component';
|
|
2
2
|
export interface CarouselOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
|
-
* Transition duration in milliseconds.
|
|
4
|
+
* Transition duration in milliseconds (coverflow). Snap mode uses CSS.
|
|
5
5
|
* @default 200
|
|
6
6
|
*/
|
|
7
7
|
duration: number;
|
|
8
8
|
/**
|
|
9
|
-
* Perspective zoom. If 0, all items are the same size.
|
|
9
|
+
* Perspective zoom. If 0, all items are the same size. Coverflow only.
|
|
10
10
|
* @default -100
|
|
11
11
|
*/
|
|
12
12
|
dist: number;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Extra spacing on the center item. Coverflow only.
|
|
15
15
|
* @default 0
|
|
16
16
|
*/
|
|
17
17
|
shift: number;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Padding between items that are not in the center. Coverflow only.
|
|
20
20
|
* @default 0
|
|
21
21
|
*/
|
|
22
22
|
padding: number;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* How many items stay visible. Coverflow only.
|
|
25
25
|
* @default 5
|
|
26
26
|
*/
|
|
27
27
|
numVisible: number;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Linear snap track instead of 3D coverflow.
|
|
30
|
+
* Also implied by `.flat` / `.carousel-slider`.
|
|
30
31
|
* @default false
|
|
31
32
|
*/
|
|
32
33
|
fullWidth: boolean;
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
+
* Show paging dots. Only drawn when there is more than one item.
|
|
35
36
|
* @default false
|
|
36
37
|
*/
|
|
37
38
|
indicators: boolean;
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
+
* Stop at the first and last items instead of wrapping. Coverflow only.
|
|
41
|
+
* Snap tracks do not wrap.
|
|
40
42
|
* @default false
|
|
41
43
|
*/
|
|
42
44
|
noWrap: boolean;
|
|
43
45
|
/**
|
|
44
|
-
*
|
|
46
|
+
* Called when a new item becomes the center.
|
|
45
47
|
* @default null
|
|
46
48
|
*/
|
|
47
49
|
onCycleTo: (current: Element, dragged: boolean) => void;
|
|
@@ -50,9 +52,7 @@ export declare class Carousel extends Component<CarouselOptions> {
|
|
|
50
52
|
hasMultipleSlides: boolean;
|
|
51
53
|
showIndicators: boolean;
|
|
52
54
|
noWrap: boolean;
|
|
53
|
-
/** If the carousel is being clicked or tapped. */
|
|
54
55
|
pressed: boolean;
|
|
55
|
-
/** If the carousel is currently being dragged. */
|
|
56
56
|
dragged: boolean;
|
|
57
57
|
offset: number;
|
|
58
58
|
target: number;
|
|
@@ -60,7 +60,7 @@ export declare class Carousel extends Component<CarouselOptions> {
|
|
|
60
60
|
itemWidth: number;
|
|
61
61
|
itemHeight: number;
|
|
62
62
|
dim: number;
|
|
63
|
-
_indicators: HTMLUListElement;
|
|
63
|
+
_indicators: HTMLUListElement | HTMLElement;
|
|
64
64
|
count: number;
|
|
65
65
|
verticalDragged: boolean;
|
|
66
66
|
reference: number;
|
|
@@ -68,63 +68,57 @@ export declare class Carousel extends Component<CarouselOptions> {
|
|
|
68
68
|
velocity: number;
|
|
69
69
|
frame: number;
|
|
70
70
|
timestamp: number;
|
|
71
|
-
ticker: ReturnType<typeof setTimeout>;
|
|
72
71
|
amplitude: number;
|
|
73
|
-
/** The index of the center carousel item. */
|
|
74
72
|
center: number;
|
|
75
73
|
imageHeight: number;
|
|
76
74
|
scrollingTimeout: ReturnType<typeof setTimeout>;
|
|
77
75
|
oneTimeCallback: (current: Element, dragged: boolean) => void | null;
|
|
76
|
+
private _flat;
|
|
77
|
+
private _ownIndicators;
|
|
78
|
+
private _trackEl;
|
|
79
|
+
private _ignoreScroll;
|
|
80
|
+
private _trackRaf;
|
|
81
|
+
private _started;
|
|
82
|
+
private get _scroller();
|
|
83
|
+
private static _live;
|
|
84
|
+
private static _resizeListening;
|
|
85
|
+
private static _onResize;
|
|
78
86
|
constructor(el: HTMLElement, options: Partial<CarouselOptions>);
|
|
79
87
|
static get defaults(): CarouselOptions;
|
|
80
|
-
/**
|
|
81
|
-
* Initializes instance of Carousel.
|
|
82
|
-
* @param el HTML element.
|
|
83
|
-
* @param options Component options.
|
|
84
|
-
*/
|
|
85
88
|
static init(el: HTMLElement, options?: Partial<CarouselOptions>): Carousel;
|
|
86
|
-
/**
|
|
87
|
-
* Initializes instances of Carousel.
|
|
88
|
-
* @param els HTML elements.
|
|
89
|
-
* @param options Component options.
|
|
90
|
-
*/
|
|
91
89
|
static init(els: InitElements<MElement>, options?: Partial<CarouselOptions>): Carousel[];
|
|
92
90
|
static getInstance(el: HTMLElement): Carousel;
|
|
93
91
|
destroy(): void;
|
|
92
|
+
private _collectItems;
|
|
93
|
+
private _setupIndicators;
|
|
94
94
|
_setupEventHandlers(): void;
|
|
95
95
|
_removeEventHandlers(): void;
|
|
96
|
+
private _teardown;
|
|
96
97
|
_handleThrottledResize: (...args: unknown[]) => any;
|
|
97
|
-
_handleCarouselTap: (e:
|
|
98
|
-
_handleCarouselDrag: (e:
|
|
99
|
-
_handleCarouselRelease: (e:
|
|
100
|
-
_handleCarouselClick: (e: MouseEvent
|
|
98
|
+
_handleCarouselTap: (e: PointerEvent) => void;
|
|
99
|
+
_handleCarouselDrag: (e: PointerEvent) => void;
|
|
100
|
+
_handleCarouselRelease: (e: PointerEvent) => void;
|
|
101
|
+
_handleCarouselClick: (e: MouseEvent) => void;
|
|
101
102
|
_handleIndicatorClick: (e: Event) => void;
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
_handleKeydown: (e: KeyboardEvent) => void;
|
|
104
|
+
_handleFlatScroll: () => void;
|
|
104
105
|
_handleResize: () => void;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
_ypos(e: MouseEvent | TouchEvent): number;
|
|
106
|
+
_xpos(e: PointerEvent | MouseEvent | TouchEvent): number;
|
|
107
|
+
_ypos(e: PointerEvent | MouseEvent | TouchEvent): number;
|
|
108
108
|
_wrap(x: number): any;
|
|
109
109
|
_track: () => void;
|
|
110
110
|
_autoScroll: () => void;
|
|
111
111
|
_scroll(x?: number): void;
|
|
112
112
|
_updateItemStyle(el: HTMLElement, opacity: number, zIndex: number, transform: string): void;
|
|
113
|
+
private _paintIndicators;
|
|
114
|
+
private _syncA11y;
|
|
115
|
+
private _syncActive;
|
|
116
|
+
private _wrapTrack;
|
|
117
|
+
private _unwrapTrack;
|
|
118
|
+
private _nearestIndex;
|
|
119
|
+
private _scrollToIndex;
|
|
113
120
|
_cycleTo(n: number, callback?: CarouselOptions['onCycleTo']): void;
|
|
114
|
-
/**
|
|
115
|
-
* Move carousel to next slide or go forward a given amount of slides.
|
|
116
|
-
* @param n How many times the carousel slides.
|
|
117
|
-
*/
|
|
118
121
|
next(n?: number): void;
|
|
119
|
-
/**
|
|
120
|
-
* Move carousel to previous slide or go back a given amount of slides.
|
|
121
|
-
* @param n How many times the carousel slides.
|
|
122
|
-
*/
|
|
123
122
|
prev(n?: number): void;
|
|
124
|
-
/**
|
|
125
|
-
* Move carousel to nth slide.
|
|
126
|
-
* @param n Index of slide.
|
|
127
|
-
* @param callback "onCycleTo" optional callback.
|
|
128
|
-
*/
|
|
129
123
|
set(n: number, callback?: CarouselOptions['onCycleTo']): void;
|
|
130
124
|
}
|
|
@@ -46,8 +46,8 @@ export interface ChipsOptions extends BaseOptions {
|
|
|
46
46
|
*/
|
|
47
47
|
limit: number;
|
|
48
48
|
/**
|
|
49
|
-
* Specifies class to be used in "close" button
|
|
50
|
-
* @default 'material-
|
|
49
|
+
* Specifies class to be used in "close" button.
|
|
50
|
+
* @default 'material-symbols'
|
|
51
51
|
*/
|
|
52
52
|
closeIconClass: string;
|
|
53
53
|
/**
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { Component, BaseOptions, InitElements, MElement } from '../core/component';
|
|
2
2
|
export interface CollapsibleOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
|
-
* If accordion versus collapsible.
|
|
4
|
+
* If accordion versus collapsible. When omitted, `.expandable` on the
|
|
5
|
+
* element turns accordion off. `<details>` with the same `name` already
|
|
6
|
+
* exclusive-open in the browser; this option is the switch for the
|
|
7
|
+
* `<ul>/<li>` alias and assigns `name` when it is missing.
|
|
5
8
|
* @default true
|
|
6
9
|
*/
|
|
7
10
|
accordion: boolean;
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
12
|
+
* @deprecated Duration is CSS (`--md-comp-collapsible-duration`).
|
|
13
|
+
* Accepted so existing init calls keep compiling, and ignored.
|
|
10
14
|
* @default 300
|
|
11
15
|
*/
|
|
12
16
|
inDuration: number;
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
18
|
+
* @deprecated Duration is CSS (`--md-comp-collapsible-duration`).
|
|
19
|
+
* Accepted so existing init calls keep compiling, and ignored.
|
|
15
20
|
* @default 300
|
|
16
21
|
*/
|
|
17
22
|
outDuration: number;
|
|
@@ -36,8 +41,16 @@ export interface CollapsibleOptions extends BaseOptions {
|
|
|
36
41
|
*/
|
|
37
42
|
onCloseEnd: (el: Element) => void;
|
|
38
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Collapsible. Open/close is HTML (`<details>` / `[open]`, or `.active` on
|
|
46
|
+
* the `<li>` alias). Height is CSS. This class is the public API, accordion
|
|
47
|
+
* for the alias, and aria on non-native headers.
|
|
48
|
+
*/
|
|
39
49
|
export declare class Collapsible extends Component<CollapsibleOptions> {
|
|
40
|
-
private
|
|
50
|
+
private _items;
|
|
51
|
+
private _groupName;
|
|
52
|
+
private _endTimers;
|
|
53
|
+
private _wrappedBodies;
|
|
41
54
|
constructor(el: HTMLElement, options: Partial<CollapsibleOptions>);
|
|
42
55
|
static get defaults(): CollapsibleOptions;
|
|
43
56
|
/**
|
|
@@ -54,21 +67,30 @@ export declare class Collapsible extends Component<CollapsibleOptions> {
|
|
|
54
67
|
static init(els: InitElements<MElement>, options?: Partial<CollapsibleOptions>): Collapsible[];
|
|
55
68
|
static getInstance(el: HTMLElement): Collapsible;
|
|
56
69
|
destroy(): void;
|
|
57
|
-
_setupEventHandlers(): void;
|
|
58
|
-
_removeEventHandlers(): void;
|
|
59
|
-
_handleCollapsibleClick: (e: MouseEvent | KeyboardEvent) => void;
|
|
60
|
-
_handleCollapsibleKeydown: (e: KeyboardEvent) => void;
|
|
61
|
-
private _setExpanded;
|
|
62
|
-
_animateIn(index: number): void;
|
|
63
|
-
_animateOut(index: number): void;
|
|
64
70
|
/**
|
|
65
71
|
* Open collapsible section.
|
|
66
|
-
* @param
|
|
72
|
+
* @param index 0-based index of the section to open.
|
|
67
73
|
*/
|
|
68
74
|
open: (index: number) => void;
|
|
69
75
|
/**
|
|
70
76
|
* Close collapsible section.
|
|
71
|
-
* @param
|
|
77
|
+
* @param index 0-based index of the section to close.
|
|
72
78
|
*/
|
|
73
79
|
close: (index: number) => void;
|
|
80
|
+
private _collectItems;
|
|
81
|
+
private _setupItems;
|
|
82
|
+
private _isOpen;
|
|
83
|
+
private _setOpen;
|
|
84
|
+
private _headerOf;
|
|
85
|
+
private _wrapDetailsBodies;
|
|
86
|
+
private _unwrapDetailsBodies;
|
|
87
|
+
private _bodyOf;
|
|
88
|
+
private _syncAria;
|
|
89
|
+
private _setupEventHandlers;
|
|
90
|
+
private _removeEventHandlers;
|
|
91
|
+
private _handleClick;
|
|
92
|
+
private _handleKeydown;
|
|
93
|
+
private _handleToggle;
|
|
94
|
+
private _notify;
|
|
95
|
+
private _durationMs;
|
|
74
96
|
}
|
|
@@ -1,46 +1,22 @@
|
|
|
1
1
|
import { Component, BaseOptions, InitElements, MElement } from '../core/component';
|
|
2
2
|
export interface ParallaxOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* @deprecated Motion is CSS (`animation-timeline: view()`). This value
|
|
5
|
+
* is accepted so existing AutoInit calls keep compiling, and is ignored.
|
|
5
6
|
* @default 0
|
|
6
7
|
*/
|
|
7
8
|
responsiveThreshold: number;
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Parallax. The effect is CSS (see components/_parallax.scss). This class
|
|
12
|
+
* exists so AutoInit / getInstance / destroy keep working; it does not
|
|
13
|
+
* attach scroll or resize listeners.
|
|
14
|
+
*/
|
|
9
15
|
export declare class Parallax extends Component<ParallaxOptions> {
|
|
10
|
-
private _enabled;
|
|
11
|
-
private _img;
|
|
12
|
-
static _parallaxes: Parallax[];
|
|
13
|
-
static _handleWindowResizeThrottled: (...args: unknown[]) => void;
|
|
14
|
-
private static _scrollFrame;
|
|
15
16
|
constructor(el: HTMLElement, options: Partial<ParallaxOptions>);
|
|
16
17
|
static get defaults(): ParallaxOptions;
|
|
17
|
-
/**
|
|
18
|
-
* Initializes instance of Parallax.
|
|
19
|
-
* @param el HTML element.
|
|
20
|
-
* @param options Component options.
|
|
21
|
-
*/
|
|
22
18
|
static init(el: HTMLElement, options?: Partial<ParallaxOptions>): Parallax;
|
|
23
|
-
/**
|
|
24
|
-
* Initializes instances of Parallax.
|
|
25
|
-
* @param els HTML elements.
|
|
26
|
-
* @param options Component options.
|
|
27
|
-
*/
|
|
28
19
|
static init(els: InitElements<MElement>, options?: Partial<ParallaxOptions>): Parallax[];
|
|
29
20
|
static getInstance(el: HTMLElement): Parallax;
|
|
30
21
|
destroy(): void;
|
|
31
|
-
static _handleScroll(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Coalesce scroll events onto animation frames.
|
|
34
|
-
*
|
|
35
|
-
* The handler reads layout and then writes a transform, so running it more
|
|
36
|
-
* than once per frame is wasted work - and the 5ms throttle it replaces was
|
|
37
|
-
* short enough to let several run per frame anyway.
|
|
38
|
-
*/
|
|
39
|
-
static _requestScrollUpdate: () => void;
|
|
40
|
-
static _handleWindowResize(): void;
|
|
41
|
-
_setupEventHandlers(): void;
|
|
42
|
-
_removeEventHandlers(): void;
|
|
43
|
-
_setupStyles(): void;
|
|
44
|
-
_handleImageLoad: () => void;
|
|
45
|
-
_updateParallax(): void;
|
|
46
22
|
}
|
|
@@ -11,42 +11,29 @@ export interface TapTargetOptions extends BaseOptions {
|
|
|
11
11
|
*/
|
|
12
12
|
onClose: (origin: HTMLElement) => void;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Tap target (Feature Discovery). Placement is CSS custom properties;
|
|
16
|
+
* the wrapper is a popover when the platform has one. This class is
|
|
17
|
+
* open/close, origin lookup, and the two geometry variables.
|
|
18
|
+
*/
|
|
14
19
|
export declare class TapTarget extends Component<TapTargetOptions> implements Openable {
|
|
15
|
-
/**
|
|
16
|
-
* If the tap target is open.
|
|
17
|
-
*/
|
|
18
20
|
isOpen: boolean;
|
|
21
|
+
originEl: HTMLElement | null;
|
|
19
22
|
static _taptargets: TapTarget[];
|
|
20
23
|
private wrapper;
|
|
21
|
-
private originEl;
|
|
22
24
|
private waveEl;
|
|
23
25
|
private contentEl;
|
|
26
|
+
private _createdWrapper;
|
|
27
|
+
private _createdWave;
|
|
28
|
+
private _usePopover;
|
|
29
|
+
private _liftedStatic;
|
|
30
|
+
private _opening;
|
|
24
31
|
constructor(el: HTMLElement, options: Partial<TapTargetOptions>);
|
|
25
32
|
static get defaults(): TapTargetOptions;
|
|
26
|
-
/**
|
|
27
|
-
* Initializes instance of TapTarget.
|
|
28
|
-
* @param el HTML element.
|
|
29
|
-
* @param options Component options.
|
|
30
|
-
*/
|
|
31
33
|
static init(el: HTMLElement, options?: Partial<TapTargetOptions>): TapTarget;
|
|
32
|
-
/**
|
|
33
|
-
* Initializes instances of TapTarget.
|
|
34
|
-
* @param els HTML elements.
|
|
35
|
-
* @param options Component options.
|
|
36
|
-
*/
|
|
37
34
|
static init(els: InitElements<MElement>, options?: Partial<TapTargetOptions>): TapTarget[];
|
|
38
35
|
static getInstance(el: HTMLElement): TapTarget;
|
|
39
36
|
destroy(): void;
|
|
40
|
-
_setupEventHandlers(): void;
|
|
41
|
-
_removeEventHandlers(): void;
|
|
42
|
-
_handleThrottledResize: (...args: unknown[]) => any;
|
|
43
|
-
_handleKeyboardInteraction: (e: KeyboardEvent) => void;
|
|
44
|
-
_handleTargetToggle: () => void;
|
|
45
|
-
_handleResize: () => void;
|
|
46
|
-
_handleDocumentClick: (e: MouseEvent | TouchEvent | KeyboardEvent) => void;
|
|
47
|
-
_setup(): void;
|
|
48
|
-
private _offset;
|
|
49
|
-
_calculatePositioning(): void;
|
|
50
37
|
/**
|
|
51
38
|
* Open Tap Target.
|
|
52
39
|
*/
|
|
@@ -55,4 +42,16 @@ export declare class TapTarget extends Component<TapTargetOptions> implements Op
|
|
|
55
42
|
* Close Tap Target.
|
|
56
43
|
*/
|
|
57
44
|
close: () => void;
|
|
45
|
+
private _setup;
|
|
46
|
+
private _ensureId;
|
|
47
|
+
private _labelFromHeading;
|
|
48
|
+
private _teardownDom;
|
|
49
|
+
private _setupEventHandlers;
|
|
50
|
+
private _removeEventHandlers;
|
|
51
|
+
private _handleThrottledResize;
|
|
52
|
+
private _handleOriginKeydown;
|
|
53
|
+
private _handleTargetToggle;
|
|
54
|
+
private _handleResize;
|
|
55
|
+
private _handlePopoverToggle;
|
|
56
|
+
private _calculatePositioning;
|
|
58
57
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export { Forms } from './behaviors/forms';
|
|
|
4
4
|
export { Waves } from './behaviors/waves';
|
|
5
5
|
export { AutoInit } from './components/registry';
|
|
6
6
|
export type { AutoInitOptions } from './components/registry';
|
|
7
|
-
export declare const version = "0.
|
|
7
|
+
export declare const version = "0.3.0";
|
package/package.json
CHANGED
package/src/sass/README.md
CHANGED
|
@@ -195,6 +195,7 @@ unlayered declaration. Drop the flag from `.hide` and it stops beating a
|
|
|
195
195
|
consumer's own `display` — silently, and in the common case. Classes whose whole
|
|
196
196
|
job is to be unconditional (`.hide`, `.m-3`, the palette classes) keep it.
|
|
197
197
|
|
|
198
|
-
The `!important` in `components/` is a different thing again: `.pushpin
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
The `!important` in `components/` is a different thing again: `.pushpin`
|
|
199
|
+
and the preloader set JS-driven geometry that must not be overridable.
|
|
200
|
+
Those stay. Tap target placement is custom properties now, so it no
|
|
201
|
+
longer needs the flag.
|
|
@@ -48,9 +48,10 @@ header:has(> nav) nav a span.badge {
|
|
|
48
48
|
-webkit-font-smoothing: auto;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
margin-
|
|
51
|
+
.collection span.badge {
|
|
52
|
+
float: none;
|
|
53
|
+
margin-block: 0;
|
|
54
|
+
margin-inline-start: auto;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
.collapsible span.badge {
|
|
@@ -62,7 +63,7 @@ header:has(> nav) nav a span.badge {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
.collapsible .active span.badge:not(.new) {
|
|
66
|
+
.collapsible :is(.active, [open]) span.badge:not(.new) {
|
|
66
67
|
color: var(--md-sys-color-on-surface-variant);
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -1,29 +1,106 @@
|
|
|
1
1
|
@use "../abstracts" as *;
|
|
2
2
|
|
|
3
|
+
// Breadcrumbs. Anatomy is the HTML: a <nav> whose child is an <ol> of
|
|
4
|
+
// links. The last crumb is the current page (aria-current="page").
|
|
5
|
+
// .breadcrumb / .breadcrumb-wrapper stay as aliases.
|
|
6
|
+
//
|
|
7
|
+
// Tokens:
|
|
8
|
+
// --md-comp-breadcrumb-label-color ancestors
|
|
9
|
+
// --md-comp-breadcrumb-current-color current page
|
|
10
|
+
// --md-comp-breadcrumb-separator "/"
|
|
11
|
+
// --md-comp-breadcrumb-gap 8px
|
|
12
|
+
//
|
|
13
|
+
// Nest descendants inside this block. `#{$_crumb} > ol` would only attach
|
|
14
|
+
// `> ol` to the last item in the list (same bug as the icon size classes).
|
|
15
|
+
|
|
16
|
+
nav:has(> ol):not(.pagination),
|
|
17
|
+
nav:has(> .breadcrumb),
|
|
3
18
|
.breadcrumb-wrapper {
|
|
19
|
+
--md-comp-breadcrumb-label-color: var(--md-sys-color-on-surface-variant);
|
|
20
|
+
--md-comp-breadcrumb-current-color: var(--md-sys-color-on-surface);
|
|
21
|
+
--md-comp-breadcrumb-separator: "/";
|
|
22
|
+
--md-comp-breadcrumb-gap: 8px;
|
|
23
|
+
|
|
4
24
|
display: flex;
|
|
25
|
+
flex-wrap: wrap;
|
|
5
26
|
align-items: center;
|
|
6
|
-
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
color: var(--md-comp-breadcrumb-label-color);
|
|
30
|
+
@include typescale("body-small");
|
|
7
31
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
32
|
+
&.nowrap {
|
|
33
|
+
flex-wrap: nowrap;
|
|
34
|
+
overflow-x: auto;
|
|
35
|
+
scrollbar-width: none;
|
|
36
|
+
|
|
37
|
+
&::-webkit-scrollbar {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
> ol {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-wrap: inherit;
|
|
45
|
+
align-items: center;
|
|
46
|
+
list-style: none;
|
|
47
|
+
min-width: 0;
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding: 0;
|
|
50
|
+
|
|
51
|
+
> li {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
min-width: 0;
|
|
55
|
+
}
|
|
11
56
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
57
|
+
> li:has(> [aria-current="page"]) {
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Separator before every crumb after the first. A real character, not
|
|
62
|
+
// a private-use icon-font slot — no Symbols file required.
|
|
63
|
+
> li + li::before {
|
|
64
|
+
content: var(--md-comp-breadcrumb-separator);
|
|
65
|
+
margin-inline: var(--md-comp-breadcrumb-gap);
|
|
66
|
+
color: var(--md-comp-breadcrumb-label-color);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
> .breadcrumb + .breadcrumb::before {
|
|
71
|
+
content: var(--md-comp-breadcrumb-separator);
|
|
72
|
+
margin-inline: var(--md-comp-breadcrumb-gap);
|
|
73
|
+
color: var(--md-comp-breadcrumb-label-color);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:is(a, .breadcrumb) {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
min-height: 32px;
|
|
80
|
+
color: var(--md-comp-breadcrumb-label-color);
|
|
81
|
+
text-decoration: none;
|
|
82
|
+
@include focus-visible;
|
|
83
|
+
|
|
84
|
+
&:hover {
|
|
85
|
+
color: var(--md-comp-breadcrumb-current-color);
|
|
86
|
+
}
|
|
19
87
|
}
|
|
20
88
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
font-family: 'Material Symbols Outlined', 'Material Symbols Rounded', 'Material Symbols Sharp', 'Material Icons';
|
|
89
|
+
[aria-current="page"] {
|
|
90
|
+
color: var(--md-comp-breadcrumb-current-color);
|
|
24
91
|
}
|
|
25
92
|
|
|
26
|
-
|
|
27
|
-
|
|
93
|
+
i {
|
|
94
|
+
font-size: 1.125em;
|
|
95
|
+
margin-inline-end: 4px;
|
|
28
96
|
}
|
|
29
97
|
}
|
|
98
|
+
|
|
99
|
+
// Inside a top app bar the trail follows the bar, not the muted ancestor
|
|
100
|
+
// pair. Loose .breadcrumb links in the bar are already excluded from
|
|
101
|
+
// destination styling in _navbar.scss.
|
|
102
|
+
header:has(> nav) > nav:has(> ol):not(.pagination),
|
|
103
|
+
header:has(> nav) > nav:has(> .breadcrumb) {
|
|
104
|
+
--md-comp-breadcrumb-label-color: inherit;
|
|
105
|
+
--md-comp-breadcrumb-current-color: inherit;
|
|
106
|
+
}
|