@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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Component, BaseOptions, InitElements, InitElement, Openable } from '../core/component';
|
|
2
|
-
export interface
|
|
2
|
+
export interface NavigationDrawerOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
|
-
* Side of screen on which
|
|
4
|
+
* Side of screen on which NavigationDrawer appears.
|
|
5
5
|
* @default 'left'
|
|
6
6
|
*/
|
|
7
7
|
edge: 'left' | 'right';
|
|
8
8
|
/**
|
|
9
|
-
* Allow swipe gestures to open/close
|
|
9
|
+
* Allow swipe gestures to open/close NavigationDrawer.
|
|
10
10
|
* @default true
|
|
11
11
|
*/
|
|
12
12
|
draggable: boolean;
|
|
@@ -35,17 +35,17 @@ export interface SidenavOptions extends BaseOptions {
|
|
|
35
35
|
/**
|
|
36
36
|
* Navigation drawer. Overlay is a modal <dialog>; fixed is a breakpoint.
|
|
37
37
|
* JS opens/closes, handles the trigger, and writes --md-comp-nav-drawer-shift
|
|
38
|
-
* while dragging. CSS owns the slide, the scrim, and the
|
|
38
|
+
* while dragging. CSS owns the slide, the scrim, and the Expanded+ dock.
|
|
39
39
|
*/
|
|
40
|
-
export declare class
|
|
40
|
+
export declare class NavigationDrawer extends Component<NavigationDrawerOptions> implements Openable {
|
|
41
41
|
id: string;
|
|
42
42
|
/** Describes open/close state of the overlay drawer. */
|
|
43
43
|
isOpen: boolean;
|
|
44
|
-
/**
|
|
44
|
+
/** Whether the drawer is docked (`navigation-drawer-fixed`). */
|
|
45
45
|
isFixed: boolean;
|
|
46
|
-
/** Describes if
|
|
46
|
+
/** Describes if NavigationDrawer is being dragged. */
|
|
47
47
|
isDragged: boolean;
|
|
48
|
-
static _sidenavs:
|
|
48
|
+
static _sidenavs: NavigationDrawer[];
|
|
49
49
|
dragTarget: HTMLElement | null;
|
|
50
50
|
private _dialog;
|
|
51
51
|
private _createdDialog;
|
|
@@ -57,25 +57,25 @@ export declare class Sidenav extends Component<SidenavOptions> implements Openab
|
|
|
57
57
|
private _initialScrollTop;
|
|
58
58
|
private _verticallyScrolling;
|
|
59
59
|
private percentOpen;
|
|
60
|
-
constructor(el: HTMLElement, options: Partial<
|
|
61
|
-
static get defaults():
|
|
60
|
+
constructor(el: HTMLElement, options: Partial<NavigationDrawerOptions>);
|
|
61
|
+
static get defaults(): NavigationDrawerOptions;
|
|
62
62
|
/**
|
|
63
|
-
* Initializes instance of
|
|
63
|
+
* Initializes instance of NavigationDrawer.
|
|
64
64
|
* @param el HTML element.
|
|
65
65
|
* @param options Component options.
|
|
66
66
|
*/
|
|
67
|
-
static init(el: HTMLElement, options?: Partial<
|
|
67
|
+
static init(el: HTMLElement, options?: Partial<NavigationDrawerOptions>): NavigationDrawer;
|
|
68
68
|
/**
|
|
69
|
-
* Initializes instances of
|
|
69
|
+
* Initializes instances of NavigationDrawer.
|
|
70
70
|
* @param els HTML elements.
|
|
71
71
|
* @param options Component options.
|
|
72
72
|
*/
|
|
73
|
-
static init(els: InitElements<InitElement>, options?: Partial<
|
|
74
|
-
static getInstance(el: HTMLElement):
|
|
73
|
+
static init(els: InitElements<InitElement>, options?: Partial<NavigationDrawerOptions>): NavigationDrawer[];
|
|
74
|
+
static getInstance(el: HTMLElement): NavigationDrawer;
|
|
75
75
|
destroy(): void;
|
|
76
76
|
/**
|
|
77
77
|
* Opens the overlay drawer. No-op while the sidenav is docked
|
|
78
|
-
* (
|
|
78
|
+
* (navigation-drawer-fixed at the Expanded breakpoint).
|
|
79
79
|
*/
|
|
80
80
|
open: () => void;
|
|
81
81
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as Components from
|
|
1
|
+
import * as Components from "./index";
|
|
2
|
+
import { isCardReveal } from "./cards";
|
|
2
3
|
/**
|
|
3
4
|
* The components `AutoInit()` starts, in initialization order, with the
|
|
4
5
|
* selector each one claims.
|
|
@@ -13,13 +14,26 @@ import * as Components from './index';
|
|
|
13
14
|
* CharacterCounter, Range, ...) simply stays out of this table.
|
|
14
15
|
*/
|
|
15
16
|
export declare const AUTO_INIT_COMPONENTS: {
|
|
17
|
+
AppBar: {
|
|
18
|
+
component: typeof Components.AppBar;
|
|
19
|
+
selector: string;
|
|
20
|
+
};
|
|
16
21
|
Autocomplete: {
|
|
17
22
|
component: typeof Components.Autocomplete;
|
|
18
23
|
selector: string;
|
|
19
24
|
};
|
|
25
|
+
ButtonGroup: {
|
|
26
|
+
component: typeof Components.ButtonGroup;
|
|
27
|
+
selector: string;
|
|
28
|
+
};
|
|
20
29
|
Cards: {
|
|
21
30
|
component: typeof Components.Cards;
|
|
22
31
|
selector: string;
|
|
32
|
+
filter: typeof isCardReveal;
|
|
33
|
+
};
|
|
34
|
+
ExpandingCard: {
|
|
35
|
+
component: typeof Components.ExpandingCard;
|
|
36
|
+
selector: string;
|
|
23
37
|
};
|
|
24
38
|
Carousel: {
|
|
25
39
|
component: typeof Components.Carousel;
|
|
@@ -41,10 +55,6 @@ export declare const AUTO_INIT_COMPONENTS: {
|
|
|
41
55
|
component: typeof Components.Lightbox;
|
|
42
56
|
selector: string;
|
|
43
57
|
};
|
|
44
|
-
Parallax: {
|
|
45
|
-
component: typeof Components.Parallax;
|
|
46
|
-
selector: string;
|
|
47
|
-
};
|
|
48
58
|
ScrollSpy: {
|
|
49
59
|
component: typeof Components.ScrollSpy;
|
|
50
60
|
selector: string;
|
|
@@ -53,8 +63,8 @@ export declare const AUTO_INIT_COMPONENTS: {
|
|
|
53
63
|
component: typeof Components.FormSelect;
|
|
54
64
|
selector: string;
|
|
55
65
|
};
|
|
56
|
-
|
|
57
|
-
component: typeof Components.
|
|
66
|
+
NavigationDrawer: {
|
|
67
|
+
component: typeof Components.NavigationDrawer;
|
|
58
68
|
selector: string;
|
|
59
69
|
};
|
|
60
70
|
NavigationRail: {
|
|
@@ -84,7 +94,7 @@ type Registry = typeof AUTO_INIT_COMPONENTS;
|
|
|
84
94
|
* above - each key takes that component's own options type.
|
|
85
95
|
*/
|
|
86
96
|
export type AutoInitOptions = {
|
|
87
|
-
[K in keyof Registry]?: Partial<InstanceType<Registry[K][
|
|
97
|
+
[K in keyof Registry]?: Partial<InstanceType<Registry[K]["component"]>["options"]>;
|
|
88
98
|
};
|
|
89
99
|
/**
|
|
90
100
|
* Automatically initialize components.
|
|
@@ -1,102 +1,43 @@
|
|
|
1
1
|
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
2
|
export interface SliderOptions extends BaseOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Set to false to hide slide indicators.
|
|
5
|
-
* @default true
|
|
6
|
-
*/
|
|
7
|
-
indicators: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Set height of slider.
|
|
10
|
-
* @default 400
|
|
11
|
-
*/
|
|
12
|
-
height: number;
|
|
13
|
-
/**
|
|
14
|
-
* Set the duration of the transition animation in ms.
|
|
15
|
-
* @default 500
|
|
16
|
-
*/
|
|
17
|
-
duration: number;
|
|
18
|
-
/**
|
|
19
|
-
* Set the duration between transitions in ms.
|
|
20
|
-
* @default 6000
|
|
21
|
-
*/
|
|
22
|
-
interval: number;
|
|
23
|
-
/**
|
|
24
|
-
* If slider should pause when keyboard focus is received.
|
|
25
|
-
* @default true
|
|
26
|
-
*/
|
|
27
|
-
pauseOnFocus: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* If slider should pause when is hovered by a pointer.
|
|
30
|
-
* @default true
|
|
31
|
-
*/
|
|
32
|
-
pauseOnHover: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Optional function used to generate ARIA label to indicators (for accessibility purposes).
|
|
35
|
-
* @param index Current index, starting from "1".
|
|
36
|
-
* @param current A which indicates whether it is the current element or not
|
|
37
|
-
* @returns a string to be used as label indicator.
|
|
38
|
-
* @default null
|
|
39
|
-
*/
|
|
40
|
-
indicatorLabelFunc: (index: number, current: boolean) => string;
|
|
41
3
|
}
|
|
42
4
|
export declare class Slider extends Component<SliderOptions> {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_slides: HTMLLIElement[];
|
|
49
|
-
_activeSlide: HTMLLIElement;
|
|
50
|
-
_indicators: HTMLLIElement[];
|
|
51
|
-
_hovered: boolean;
|
|
52
|
-
_focused: boolean;
|
|
53
|
-
_focusCurrent: boolean;
|
|
54
|
-
_sliderId: string;
|
|
55
|
-
constructor(el: HTMLElement, options: Partial<SliderOptions>);
|
|
5
|
+
el: HTMLInputElement;
|
|
6
|
+
private _pointerDown;
|
|
7
|
+
value: HTMLElement;
|
|
8
|
+
thumb: HTMLElement;
|
|
9
|
+
constructor(el: HTMLInputElement, options: Partial<SliderOptions>);
|
|
56
10
|
static get defaults(): SliderOptions;
|
|
57
11
|
/**
|
|
58
12
|
* Initializes instance of Slider.
|
|
59
13
|
* @param el HTML element.
|
|
60
14
|
* @param options Component options.
|
|
61
15
|
*/
|
|
62
|
-
static init(el:
|
|
16
|
+
static init(el: HTMLInputElement, options?: Partial<SliderOptions>): Slider;
|
|
63
17
|
/**
|
|
64
18
|
* Initializes instances of Slider.
|
|
65
19
|
* @param els HTML elements.
|
|
66
20
|
* @param options Component options.
|
|
67
21
|
*/
|
|
68
|
-
static init(els: InitElements<InitElement>, options?: Partial<SliderOptions>): Slider[];
|
|
69
|
-
static getInstance(el:
|
|
22
|
+
static init(els: InitElements<HTMLInputElement | InitElement>, options?: Partial<SliderOptions>): Slider[];
|
|
23
|
+
static getInstance(el: HTMLInputElement): Slider;
|
|
70
24
|
destroy(): void;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
pause: () => void;
|
|
90
|
-
/**
|
|
91
|
-
* Start slider autoslide.
|
|
92
|
-
*/
|
|
93
|
-
start: () => void;
|
|
94
|
-
/**
|
|
95
|
-
* Move to next slider.
|
|
96
|
-
*/
|
|
97
|
-
next: () => void;
|
|
98
|
-
/**
|
|
99
|
-
* Move to prev slider.
|
|
100
|
-
*/
|
|
101
|
-
prev: () => void;
|
|
25
|
+
_setupEventHandlers(): void;
|
|
26
|
+
_removeEventHandlers(): void;
|
|
27
|
+
_handleRangeChange: () => void;
|
|
28
|
+
_handleRangePointerDown: (e: PointerEvent) => void;
|
|
29
|
+
_handleRangeInputOrMove: () => void;
|
|
30
|
+
_handleRangePointerUp: (e: PointerEvent) => void;
|
|
31
|
+
_handleRangeRelease: () => 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;
|
|
102
43
|
}
|
|
@@ -58,6 +58,14 @@ export interface SnackbarOptions extends BaseOptions {
|
|
|
58
58
|
* @default 0.8
|
|
59
59
|
*/
|
|
60
60
|
activationPercent: number;
|
|
61
|
+
/**
|
|
62
|
+
* Any element in the tree the snackbar should render into. A Snackbar has no
|
|
63
|
+
* originating element to infer this from, so pass one when the page lives in
|
|
64
|
+
* a shadow root — the container is appended to that root instead of to
|
|
65
|
+
* `document.body`, where a root-scoped stylesheet could not reach it.
|
|
66
|
+
* @default null
|
|
67
|
+
*/
|
|
68
|
+
root: HTMLElement;
|
|
61
69
|
}
|
|
62
70
|
export declare class Snackbar {
|
|
63
71
|
/** The snackbar element. */
|
|
@@ -86,15 +94,22 @@ export declare class Snackbar {
|
|
|
86
94
|
static _snackbars: Snackbar[];
|
|
87
95
|
static _container: HTMLElement;
|
|
88
96
|
static _draggedSnackbar: Snackbar;
|
|
97
|
+
/** Which pointer owns the drag in flight; a second finger is ignored. */
|
|
98
|
+
static _dragPointerId: number | null;
|
|
89
99
|
constructor(options?: Partial<SnackbarOptions>);
|
|
90
100
|
static get defaults(): SnackbarOptions;
|
|
91
101
|
static getInstance(el: HTMLElement): Snackbar;
|
|
92
|
-
static _createContainer(): void;
|
|
102
|
+
static _createContainer(root?: HTMLElement | ShadowRoot): void;
|
|
93
103
|
static _removeContainer(): void;
|
|
94
|
-
static _onDragStart(e:
|
|
95
|
-
static _onDragMove(e:
|
|
96
|
-
static _onDragEnd(): void;
|
|
97
|
-
|
|
104
|
+
static _onDragStart(e: PointerEvent): void;
|
|
105
|
+
static _onDragMove(e: PointerEvent): void;
|
|
106
|
+
static _onDragEnd(e: PointerEvent): void;
|
|
107
|
+
/**
|
|
108
|
+
* A cancelled pointer is not a short swipe. Snap back and resume the timer
|
|
109
|
+
* without consulting the distance travelled - the browser took the gesture
|
|
110
|
+
* over, so the movement so far says nothing about what the user wanted.
|
|
111
|
+
*/
|
|
112
|
+
static _onDragCancel(e: PointerEvent): void;
|
|
98
113
|
/**
|
|
99
114
|
* dismiss all snackbars.
|
|
100
115
|
*/
|
|
@@ -59,6 +59,18 @@ export declare class Tabs extends Component<TabsOptions> {
|
|
|
59
59
|
_queryTabLinks(): NodeListOf<HTMLAnchorElement>;
|
|
60
60
|
_handleTabClick: (e: MouseEvent) => void;
|
|
61
61
|
_createIndicator(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Which tab is current, for the eye and for assistive technology.
|
|
64
|
+
*
|
|
65
|
+
* The class alone is a colour. `aria-current` is the part a screen reader
|
|
66
|
+
* reads, and because tabs are navigation rather than a tablist (rule 2 -
|
|
67
|
+
* there is no keyboard model here to back a tablist), "current" is exactly
|
|
68
|
+
* the right word for it. Its *value* changes as the user clicks, which makes
|
|
69
|
+
* maintaining it the component's job, not the author's - see CONTEXT.md on
|
|
70
|
+
* static semantics versus dynamic state. Writing it once in the markup and
|
|
71
|
+
* never moving it left the old tab announcing itself as current.
|
|
72
|
+
*/
|
|
73
|
+
private _setActiveTabLink;
|
|
62
74
|
_setupActiveTabLink(): void;
|
|
63
75
|
_setupSwipeableTabs(): void;
|
|
64
76
|
_teardownSwipeableTabs(): void;
|
|
@@ -95,10 +95,6 @@ export interface TimepickerOptions extends BaseOptions {
|
|
|
95
95
|
*/
|
|
96
96
|
displayPluginOptions: object;
|
|
97
97
|
}
|
|
98
|
-
type Point = {
|
|
99
|
-
x: number;
|
|
100
|
-
y: number;
|
|
101
|
-
};
|
|
102
98
|
export declare class Timepicker extends Component<TimepickerOptions> {
|
|
103
99
|
el: HTMLInputElement;
|
|
104
100
|
id: string;
|
|
@@ -110,6 +106,8 @@ export declare class Timepicker extends Component<TimepickerOptions> {
|
|
|
110
106
|
x0: number;
|
|
111
107
|
y0: number;
|
|
112
108
|
moved: boolean;
|
|
109
|
+
/** Which pointer is dragging the clock hand; a second finger is ignored. */
|
|
110
|
+
private _dragPointerId;
|
|
113
111
|
dx: number;
|
|
114
112
|
dy: number;
|
|
115
113
|
/**
|
|
@@ -161,17 +159,22 @@ export declare class Timepicker extends Component<TimepickerOptions> {
|
|
|
161
159
|
static init(els: InitElements<HTMLInputElement | InitElement>, options?: Partial<TimepickerOptions>): Timepicker[];
|
|
162
160
|
static _addLeadingZero(num: number): string;
|
|
163
161
|
static _createSVGEl(name: string): SVGElement;
|
|
164
|
-
static _Pos(e: TouchEvent | MouseEvent): Point;
|
|
165
162
|
static getInstance(el: HTMLElement): Timepicker;
|
|
166
163
|
destroy(): void;
|
|
167
164
|
_setupEventHandlers(): void;
|
|
168
165
|
_removeEventHandlers(): void;
|
|
169
166
|
_handleInputClick: () => void;
|
|
170
167
|
_handleInputKeydown: (e: KeyboardEvent) => void;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
_handleClockClickStart: (e: PointerEvent) => void;
|
|
169
|
+
_handleDocumentClickMove: (e: PointerEvent) => void;
|
|
170
|
+
_handleDocumentClickEnd: (e: PointerEvent) => void;
|
|
171
|
+
/**
|
|
172
|
+
* A cancelled pointer is not a completed selection. The browser or the OS
|
|
173
|
+
* took the gesture over, so this only lets go of the drag - it must not run
|
|
174
|
+
* the pointer-up path, which advances hours to minutes, fires `onSelect`,
|
|
175
|
+
* and under `autoSubmit` closes the picker on a time the user never chose.
|
|
176
|
+
*/
|
|
177
|
+
_handleDocumentClickCancel: (e: PointerEvent) => void;
|
|
175
178
|
_insertHTMLIntoDOM(): void;
|
|
176
179
|
_setupVariables(): void;
|
|
177
180
|
_pickerSetup(): void;
|
|
@@ -210,4 +213,3 @@ export declare class Timepicker extends Component<TimepickerOptions> {
|
|
|
210
213
|
cancel: () => void;
|
|
211
214
|
clear: () => void;
|
|
212
215
|
}
|
|
213
|
-
export {};
|
|
@@ -69,6 +69,7 @@ export declare class Tooltip extends Component<TooltipOptions> {
|
|
|
69
69
|
tooltipEl: HTMLElement;
|
|
70
70
|
private _exitDelayTimeout;
|
|
71
71
|
private _enterDelayTimeout;
|
|
72
|
+
private _animationTimeout;
|
|
72
73
|
xMovement: number;
|
|
73
74
|
yMovement: number;
|
|
74
75
|
constructor(el: HTMLElement, options: Partial<TooltipOptions>);
|
|
@@ -1,55 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** The part of a `DOMRect` the positioning helpers below actually read. */
|
|
2
|
+
type Bounding = Pick<DOMRect, 'left' | 'top' | 'width' | 'height'>;
|
|
3
|
+
/** Which edges of a container a box has crossed. */
|
|
4
|
+
type Edges = {
|
|
5
|
+
top: boolean;
|
|
6
|
+
right: boolean;
|
|
7
|
+
bottom: boolean;
|
|
8
|
+
left: boolean;
|
|
9
|
+
};
|
|
3
10
|
/**
|
|
4
11
|
* Class with utilitary functions for global usage.
|
|
5
12
|
*/
|
|
6
13
|
export declare class Utils {
|
|
7
|
-
/** Specifies wether tab is pressed or not. */
|
|
8
|
-
static tabPressed: boolean;
|
|
9
|
-
/** Specifies wether there is a key pressed. */
|
|
10
|
-
static keyDown: boolean;
|
|
11
14
|
/**
|
|
12
|
-
* Key maps.
|
|
15
|
+
* Key maps. One `KeyboardEvent.key` value each: the second entries these used
|
|
16
|
+
* to carry (`Esc`, `Up`, `Del`, ...) were IE and Edge Legacy spellings, and
|
|
17
|
+
* the support baseline excludes both.
|
|
13
18
|
*/
|
|
14
19
|
static keys: {
|
|
15
|
-
TAB: string
|
|
16
|
-
ENTER: string
|
|
17
|
-
ESC: string
|
|
18
|
-
BACKSPACE: string
|
|
19
|
-
ARROW_UP: string
|
|
20
|
-
ARROW_DOWN: string
|
|
21
|
-
ARROW_LEFT: string
|
|
22
|
-
ARROW_RIGHT: string
|
|
23
|
-
DELETE: string
|
|
20
|
+
TAB: string;
|
|
21
|
+
ENTER: string;
|
|
22
|
+
ESC: string;
|
|
23
|
+
BACKSPACE: string;
|
|
24
|
+
ARROW_UP: string;
|
|
25
|
+
ARROW_DOWN: string;
|
|
26
|
+
ARROW_LEFT: string;
|
|
27
|
+
ARROW_RIGHT: string;
|
|
28
|
+
DELETE: string;
|
|
24
29
|
};
|
|
25
|
-
/**
|
|
26
|
-
* Keys that count as keyboard navigation, precomputed.
|
|
27
|
-
*
|
|
28
|
-
* These handlers run at capture phase on the document for every keystroke on
|
|
29
|
-
* the page, and used to rebuild three arrays and spread them into a fourth
|
|
30
|
-
* on each one.
|
|
31
|
-
*/
|
|
32
|
-
private static _navigationKeys;
|
|
33
|
-
/**
|
|
34
|
-
* Detects when a key is pressed.
|
|
35
|
-
* @param e Event instance.
|
|
36
|
-
*/
|
|
37
|
-
static docHandleKeydown(e: KeyboardEvent): void;
|
|
38
|
-
/**
|
|
39
|
-
* Detects when a key is released.
|
|
40
|
-
* @param e Event instance.
|
|
41
|
-
*/
|
|
42
|
-
static docHandleKeyup(e: KeyboardEvent): void;
|
|
43
|
-
/**
|
|
44
|
-
* Detects when document is focused.
|
|
45
|
-
* @param e Event instance.
|
|
46
|
-
*/
|
|
47
|
-
static docHandleFocus(e: FocusEvent): void;
|
|
48
|
-
/**
|
|
49
|
-
* Detects when document is not focused.
|
|
50
|
-
* @param e Event instance.
|
|
51
|
-
*/
|
|
52
|
-
static docHandleBlur(e: FocusEvent): void;
|
|
53
30
|
/**
|
|
54
31
|
* Run `callback` once the document is parsed.
|
|
55
32
|
*
|
|
@@ -60,9 +37,39 @@ export declare class Utils {
|
|
|
60
37
|
*/
|
|
61
38
|
static onDocumentReady(callback: () => void): void;
|
|
62
39
|
/**
|
|
63
|
-
* Generates a unique string identifier.
|
|
40
|
+
* Generates a unique string identifier. Every caller prefixes the result and
|
|
41
|
+
* uses it as an element id, and a UUID is valid in that position.
|
|
42
|
+
*
|
|
43
|
+
* `randomUUID` is exposed only in secure contexts, and a dev server on a
|
|
44
|
+
* plain-HTTP LAN address - the usual way a page is opened on a phone - is
|
|
45
|
+
* not one. Without the fallback every component that stamps an id would
|
|
46
|
+
* throw there. The ids only have to be unique within one document, so the
|
|
47
|
+
* fallback does not need to be cryptographic.
|
|
64
48
|
*/
|
|
65
49
|
static guid(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Where an element created at runtime has to be appended to stay in the same
|
|
52
|
+
* tree as `el`. A stylesheet adopted into a shadow root cannot match a node
|
|
53
|
+
* in the document, so a portal that lands on `document.body` is unstyled
|
|
54
|
+
* whenever its origin lives in a shadow root (adr/0002).
|
|
55
|
+
*
|
|
56
|
+
* Light-DOM elements still get `document.body`, which is what escapes an
|
|
57
|
+
* ancestor's `overflow: hidden` and stacking context. Inside a shadow root
|
|
58
|
+
* both hazards come back: the host's own ancestors still form the containing
|
|
59
|
+
* block, so a transformed ancestor re-anchors `position: fixed` and a
|
|
60
|
+
* positioned one re-anchors `position: absolute`.
|
|
61
|
+
*/
|
|
62
|
+
static portalRoot(el: Node): HTMLElement | ShadowRoot;
|
|
63
|
+
/**
|
|
64
|
+
* `getElementById` against the tree `el` lives in. The mirror of
|
|
65
|
+
* `portalRoot`: an id in a shadow root is invisible to
|
|
66
|
+
* `document.getElementById`, so a trigger and its target inside the same
|
|
67
|
+
* root could not find each other at all.
|
|
68
|
+
*
|
|
69
|
+
* Falls back to the document for a detached `el`, whose root is a plain
|
|
70
|
+
* element with no lookup of its own.
|
|
71
|
+
*/
|
|
72
|
+
static getElementById(el: Node, id: string): HTMLElement;
|
|
66
73
|
/**
|
|
67
74
|
* Checks for exceeded edges
|
|
68
75
|
* @param container Container element.
|
|
@@ -101,15 +108,18 @@ export declare class Utils {
|
|
|
101
108
|
*/
|
|
102
109
|
static getDocumentScrollLeft(): number;
|
|
103
110
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
111
|
+
* Trailing-edge throttle: run `func` now, then at most once per `wait` ms
|
|
112
|
+
* with the most recent arguments.
|
|
113
|
+
*
|
|
114
|
+
* This used to carry its underscore ancestor's whole configuration - leading
|
|
115
|
+
* and trailing switches, a result passthrough - and both call sites are
|
|
116
|
+
* resize handlers passing nothing but a function and a delay.
|
|
117
|
+
*
|
|
118
|
+
* Assign the return value once. `x = Utils.throttle(fn, 200)` is right;
|
|
119
|
+
* wrapping it in an arrow builds a fresh closure per event and never calls
|
|
120
|
+
* it, which is how resize handling was dead in three components.
|
|
108
121
|
*/
|
|
109
|
-
static throttle(func: (...args: unknown[]) => void, wait: number
|
|
110
|
-
leading: boolean;
|
|
111
|
-
trailing: boolean;
|
|
112
|
-
}>): (...args: unknown[]) => any;
|
|
122
|
+
static throttle(func: (...args: unknown[]) => void, wait: number): (...args: unknown[]) => void;
|
|
113
123
|
/**
|
|
114
124
|
* Renders confirm/close buttons with callback function
|
|
115
125
|
*/
|
|
@@ -127,3 +137,4 @@ export declare class Utils {
|
|
|
127
137
|
y: number;
|
|
128
138
|
};
|
|
129
139
|
}
|
|
140
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { Dialogs } from
|
|
3
|
-
export { BottomSheets } from
|
|
4
|
-
export { SideSheets } from
|
|
5
|
-
export { Forms } from
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export
|
|
9
|
-
export declare const version = "0.7.0";
|
|
1
|
+
export * from "./components";
|
|
2
|
+
export { Dialogs } from "./behaviors/dialogs";
|
|
3
|
+
export { BottomSheets } from "./behaviors/bottomSheets";
|
|
4
|
+
export { SideSheets } from "./behaviors/sideSheets";
|
|
5
|
+
export { Forms } from "./behaviors/forms";
|
|
6
|
+
export { AutoInit } from "./components/registry";
|
|
7
|
+
export type { AutoInitOptions } from "./components/registry";
|
|
8
|
+
export declare const version = "0.9.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressivecss/expressive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "ExpressiveCSS - a Material Design 3 front-end framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "BaezFJ <baezdevs@gmail.com>",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"./css": "./dist/css/expressive.css",
|
|
47
47
|
"./css/min": "./dist/css/expressive.min.css",
|
|
48
|
+
"./fonts/*": "./dist/fonts/*",
|
|
48
49
|
"./scss": "./src/sass/expressive.scss",
|
|
49
50
|
"./scss/*": "./src/sass/*"
|
|
50
51
|
},
|
|
@@ -60,7 +61,8 @@
|
|
|
60
61
|
"prepack": "npm run build",
|
|
61
62
|
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
62
63
|
"build": "run-s clean build:css build:js build:types",
|
|
63
|
-
"build:
|
|
64
|
+
"build:fonts": "node scripts/copy-fonts.mjs",
|
|
65
|
+
"build:css": "run-s build:fonts build:css:expanded build:css:min",
|
|
64
66
|
"build:css:expanded": "sass src/sass/expressive.scss dist/css/expressive.css --style=expanded --source-map --load-path=src/sass",
|
|
65
67
|
"build:css:min": "sass src/sass/expressive.scss dist/css/expressive.min.css --style=compressed --source-map --load-path=src/sass",
|
|
66
68
|
"build:js": "run-s build:js:esm build:js:cjs build:js:iife build:js:iife-min",
|
|
@@ -69,13 +71,36 @@
|
|
|
69
71
|
"build:js:iife": "esbuild src/ts/index.ts --bundle --format=iife --global-name=Expressive --target=es2020 --outfile=dist/js/expressive.js --sourcemap",
|
|
70
72
|
"build:js:iife-min": "esbuild src/ts/index.ts --bundle --format=iife --global-name=Expressive --target=es2020 --outfile=dist/js/expressive.min.js --minify --sourcemap",
|
|
71
73
|
"build:types": "tsc -p tsconfig.build.json",
|
|
74
|
+
"build:skill": "node scripts/gen-expressivecss-skill.mjs && node mcp/expressivecss/scripts/sync-guides.mjs",
|
|
75
|
+
"build:semantics": "node scripts/gen-semantics.mjs",
|
|
76
|
+
"resolve:expressivecss": "node skills/expressivecss/scripts/resolve-version.mjs",
|
|
77
|
+
"test:skill": "node --test tests/expressivecss-skill.test.js tests/expressivecss-version-resolution.test.js tests/expressivecss-component-decisions.test.js tests/expressivecss-skill-evals.test.js tests/expressivecss-codex-adapter.test.js tests/expressivecss-skill-benchmark.test.js tests/expressivecss-eval-browser.test.js tests/expressivecss-interface-quality.test.js tests/expressivecss-material-quality.test.js tests/expressivecss-eval-provenance.test.js tests/expressivecss-natural-discovery.test.js && npm run test:skill-evals",
|
|
78
|
+
"test:skill-evals": "node scripts/eval-expressivecss-skill.mjs --responses=tests/fixtures/expressivecss-skill-evals/passing-responses.json",
|
|
79
|
+
"docs:dev": "run-s build docs:watch",
|
|
80
|
+
"docs:watch": "run-p watch:css watch:js docs:server",
|
|
81
|
+
"docs:server": "astro dev --root docs",
|
|
82
|
+
"docs:build": "run-s build docs:build:astro docs:verify",
|
|
83
|
+
"docs:build:astro": "astro build --root docs",
|
|
84
|
+
"docs:preview": "astro preview --root docs",
|
|
85
|
+
"docs:verify": "node scripts/verify-site.mjs",
|
|
72
86
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
73
87
|
"test": "run-s build:js build:css test:run",
|
|
74
88
|
"test:run": "node --test",
|
|
89
|
+
"test:browser": "run-s build:js build:css test:browser:run",
|
|
90
|
+
"test:browser:critical": "node scripts/check-browser.mjs && node --test tests/expressivecss-cross-browser.test.js",
|
|
91
|
+
"test:browser:run": "node scripts/check-browser.mjs && node --test tests/*-browser.test.js",
|
|
75
92
|
"test:watch": "node --test --watch",
|
|
93
|
+
"test:visual": "node visual/run.mjs",
|
|
94
|
+
"test:visual:report": "playwright show-report visual/report",
|
|
76
95
|
"watch": "run-p watch:css watch:js",
|
|
77
96
|
"watch:css": "sass --watch src/sass/expressive.scss:dist/css/expressive.css --style=expanded --source-map --load-path=src/sass",
|
|
78
|
-
"watch:js": "esbuild src/ts/index.ts --bundle --format=iife --global-name=Expressive --target=es2020 --outfile=dist/js/expressive.js --sourcemap --watch=forever"
|
|
97
|
+
"watch:js": "esbuild src/ts/index.ts --bundle --format=iife --global-name=Expressive --target=es2020 --outfile=dist/js/expressive.js --sourcemap --watch=forever",
|
|
98
|
+
"check:generated": "node scripts/gen-semantics.mjs --check && node scripts/gen-expressivecss-skill.mjs --check && node mcp/expressivecss/scripts/sync-guides.mjs --check",
|
|
99
|
+
"verify": "run-s build typecheck test:run check:generated docs:build:astro docs:verify",
|
|
100
|
+
"verify:packages": "node scripts/verify-packages.mjs",
|
|
101
|
+
"test:node": "node scripts/run-node-tests.mjs",
|
|
102
|
+
"record:capabilities": "node scripts/record-capability-evidence.mjs --record",
|
|
103
|
+
"verify:consumer": "node scripts/lib/verify-consumer.mjs"
|
|
79
104
|
},
|
|
80
105
|
"engines": {
|
|
81
106
|
"node": ">=20"
|
|
@@ -87,10 +112,21 @@
|
|
|
87
112
|
"not dead"
|
|
88
113
|
],
|
|
89
114
|
"devDependencies": {
|
|
115
|
+
"@fontsource-variable/material-symbols-outlined": "^5.3.4",
|
|
116
|
+
"@fontsource-variable/material-symbols-rounded": "^5.3.4",
|
|
117
|
+
"@fontsource-variable/material-symbols-sharp": "^5.3.4",
|
|
118
|
+
"@fontsource/noto-sans": "^5.3.0",
|
|
119
|
+
"@fontsource/roboto": "^5.3.0",
|
|
120
|
+
"@playwright/test": "^1.56.0",
|
|
121
|
+
"astro": "^7.2.8",
|
|
90
122
|
"esbuild": "^0.28.2",
|
|
123
|
+
"fallow": "^3.23.0",
|
|
91
124
|
"jsdom": "^30.0.1",
|
|
92
125
|
"npm-run-all2": "^9.0.3",
|
|
93
126
|
"sass": "^1.102.0",
|
|
127
|
+
"smol-toml": "^1.8.0",
|
|
128
|
+
"turndown": "^7.2.4",
|
|
129
|
+
"turndown-plugin-gfm": "^1.0.2",
|
|
94
130
|
"typescript": "^7.0.2"
|
|
95
131
|
}
|
|
96
132
|
}
|