@expressivecss/expressive 0.1.0-alpha.3
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/LICENSE +21 -0
- package/README.md +82 -0
- package/dist/css/expressive.css +9914 -0
- package/dist/css/expressive.min.css +1 -0
- package/dist/js/components/autocomplete.d.ts +152 -0
- package/dist/js/components/buttons.d.ts +66 -0
- package/dist/js/components/cards.d.ts +50 -0
- package/dist/js/components/carousel.d.ts +131 -0
- package/dist/js/components/chips.d.ts +135 -0
- package/dist/js/components/collapsible.d.ts +74 -0
- package/dist/js/components/datepicker.d.ts +336 -0
- package/dist/js/components/dropdown.d.ts +148 -0
- package/dist/js/components/index.d.ts +21 -0
- package/dist/js/components/materialbox.d.ts +97 -0
- package/dist/js/components/modal.d.ts +45 -0
- package/dist/js/components/parallax.d.ts +40 -0
- package/dist/js/components/pushpin.d.ts +51 -0
- package/dist/js/components/scrollspy.d.ts +80 -0
- package/dist/js/components/sidenav.d.ts +125 -0
- package/dist/js/components/slider.d.ts +101 -0
- package/dist/js/components/tabs.d.ts +80 -0
- package/dist/js/components/tap-target.d.ts +58 -0
- package/dist/js/components/timepicker.d.ts +207 -0
- package/dist/js/components/toast.d.ts +93 -0
- package/dist/js/components/tooltip.d.ts +117 -0
- package/dist/js/components/waves.d.ts +15 -0
- package/dist/js/expressive.js +8239 -0
- package/dist/js/expressive.js.map +1 -0
- package/dist/js/expressive.min.js +2 -0
- package/dist/js/expressive.min.js.map +1 -0
- package/dist/js/expressive.mjs +8206 -0
- package/dist/js/expressive.mjs.map +1 -0
- package/dist/js/forms/character-counter.d.ts +36 -0
- package/dist/js/forms/forms.d.ts +17 -0
- package/dist/js/forms/index.d.ts +4 -0
- package/dist/js/forms/range.d.ts +40 -0
- package/dist/js/forms/select.d.ts +77 -0
- package/dist/js/foundation/component.d.ts +73 -0
- package/dist/js/foundation/index.d.ts +2 -0
- package/dist/js/foundation/utils.d.ts +122 -0
- package/dist/js/index.d.ts +52 -0
- package/dist/js/plugins/docked-display.d.ts +34 -0
- package/dist/js/plugins/index.d.ts +1 -0
- package/package.json +71 -0
- package/src/scss/components/_appbar.scss +454 -0
- package/src/scss/components/_badges.scss +77 -0
- package/src/scss/components/_breadcrumb.scss +27 -0
- package/src/scss/components/_buttons.scss +412 -0
- package/src/scss/components/_cards.scss +267 -0
- package/src/scss/components/_carousel.scss +93 -0
- package/src/scss/components/_chips.scss +147 -0
- package/src/scss/components/_collapsible.scss +84 -0
- package/src/scss/components/_collection.scss +114 -0
- package/src/scss/components/_date-picker.scss +268 -0
- package/src/scss/components/_dropdown.scss +98 -0
- package/src/scss/components/_index.scss +28 -0
- package/src/scss/components/_material-box.scss +42 -0
- package/src/scss/components/_material-icons.scss +6 -0
- package/src/scss/components/_modal.scss +84 -0
- package/src/scss/components/_pagination.scss +45 -0
- package/src/scss/components/_parallax.scss +26 -0
- package/src/scss/components/_preloader.scss +422 -0
- package/src/scss/components/_pulse.scss +35 -0
- package/src/scss/components/_sidenav.scss +229 -0
- package/src/scss/components/_slider.scss +119 -0
- package/src/scss/components/_table-of-contents.scss +32 -0
- package/src/scss/components/_tabs.scss +176 -0
- package/src/scss/components/_tap-target.scss +102 -0
- package/src/scss/components/_time-picker.scss +294 -0
- package/src/scss/components/_toast.scss +70 -0
- package/src/scss/components/_tooltip.scss +49 -0
- package/src/scss/components/_transitions.scss +19 -0
- package/src/scss/components/_video.scss +15 -0
- package/src/scss/expressive.scss +7 -0
- package/src/scss/forms/_checkboxes.scss +199 -0
- package/src/scss/forms/_file-input.scss +41 -0
- package/src/scss/forms/_index.scss +17 -0
- package/src/scss/forms/_input-fields.scss +360 -0
- package/src/scss/forms/_radio-buttons.scss +114 -0
- package/src/scss/forms/_range.scss +148 -0
- package/src/scss/forms/_select.scss +108 -0
- package/src/scss/forms/_switches.scss +127 -0
- package/src/scss/foundation/_base.scss +71 -0
- package/src/scss/foundation/_color-palette.scss +402 -0
- package/src/scss/foundation/_index.scss +10 -0
- package/src/scss/foundation/_mixins.scss +198 -0
- package/src/scss/foundation/_motion.scss +70 -0
- package/src/scss/foundation/_normalize.scss +349 -0
- package/src/scss/foundation/_shape.scss +30 -0
- package/src/scss/foundation/_state-layers.scss +68 -0
- package/src/scss/foundation/_theme.scss +238 -0
- package/src/scss/foundation/_tokens.scss +511 -0
- package/src/scss/foundation/_variables.scss +57 -0
- package/src/scss/layout/_footer.scss +26 -0
- package/src/scss/layout/_grid.scss +172 -0
- package/src/scss/layout/_index.scss +3 -0
- package/src/scss/layout/_table.scss +119 -0
- package/src/scss/utilities/_a11y.scss +77 -0
- package/src/scss/utilities/_colors.scss +74 -0
- package/src/scss/utilities/_elevation.scss +63 -0
- package/src/scss/utilities/_helpers.scss +50 -0
- package/src/scss/utilities/_index.scss +7 -0
- package/src/scss/utilities/_responsive.scss +62 -0
- package/src/scss/utilities/_spacing.scss +38 -0
- package/src/scss/utilities/_typography.scss +115 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { BaseOptions } from '../foundation/component';
|
|
2
|
+
export interface ToastOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The content of the Toast.
|
|
5
|
+
* @default ""
|
|
6
|
+
*/
|
|
7
|
+
text: string;
|
|
8
|
+
/**
|
|
9
|
+
* Element Id for the tooltip.
|
|
10
|
+
* @default ""
|
|
11
|
+
*/
|
|
12
|
+
toastId?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Length in ms the Toast stays before dismissal.
|
|
15
|
+
* @default 4000
|
|
16
|
+
*/
|
|
17
|
+
displayLength: number;
|
|
18
|
+
/**
|
|
19
|
+
* Transition in duration in milliseconds.
|
|
20
|
+
* @default 300
|
|
21
|
+
*/
|
|
22
|
+
inDuration: number;
|
|
23
|
+
/**
|
|
24
|
+
* Transition out duration in milliseconds.
|
|
25
|
+
* @default 375
|
|
26
|
+
*/
|
|
27
|
+
outDuration: number;
|
|
28
|
+
/**
|
|
29
|
+
* Classes to be added to the toast element.
|
|
30
|
+
* @default ""
|
|
31
|
+
*/
|
|
32
|
+
classes: string;
|
|
33
|
+
/**
|
|
34
|
+
* Callback function called when toast is dismissed.
|
|
35
|
+
* @default null
|
|
36
|
+
*/
|
|
37
|
+
completeCallback: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* The percentage of the toast's width it takes fora drag
|
|
40
|
+
* to dismiss a Toast.
|
|
41
|
+
* @default 0.8
|
|
42
|
+
*/
|
|
43
|
+
activationPercent: number;
|
|
44
|
+
}
|
|
45
|
+
export declare class Toast {
|
|
46
|
+
/** The toast element. */
|
|
47
|
+
el: HTMLElement;
|
|
48
|
+
/**
|
|
49
|
+
* The remaining amount of time in ms that the toast
|
|
50
|
+
* will stay before dismissal.
|
|
51
|
+
*/
|
|
52
|
+
timeRemaining: number;
|
|
53
|
+
/**
|
|
54
|
+
* Describes the current pan state of the Toast.
|
|
55
|
+
*/
|
|
56
|
+
panning: boolean;
|
|
57
|
+
options: ToastOptions;
|
|
58
|
+
message: string;
|
|
59
|
+
counterInterval: NodeJS.Timeout | number;
|
|
60
|
+
wasSwiped: boolean;
|
|
61
|
+
startingXPos: number;
|
|
62
|
+
xPos: number;
|
|
63
|
+
time: number;
|
|
64
|
+
deltaX: number;
|
|
65
|
+
velocityX: number;
|
|
66
|
+
static _toasts: Toast[];
|
|
67
|
+
static _container: HTMLElement;
|
|
68
|
+
static _draggedToast: Toast;
|
|
69
|
+
constructor(options: Partial<ToastOptions>);
|
|
70
|
+
static get defaults(): ToastOptions;
|
|
71
|
+
static getInstance(el: HTMLElement): Toast;
|
|
72
|
+
static _createContainer(): void;
|
|
73
|
+
static _removeContainer(): void;
|
|
74
|
+
static _onDragStart(e: TouchEvent | MouseEvent): void;
|
|
75
|
+
static _onDragMove(e: TouchEvent | MouseEvent): void;
|
|
76
|
+
static _onDragEnd(): void;
|
|
77
|
+
static _xPos(e: TouchEvent | MouseEvent): number;
|
|
78
|
+
/**
|
|
79
|
+
* dismiss all toasts.
|
|
80
|
+
*/
|
|
81
|
+
static dismissAll(): void;
|
|
82
|
+
_createToast(): HTMLElement;
|
|
83
|
+
_animateIn(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Create setInterval which automatically removes toast when timeRemaining >= 0
|
|
86
|
+
* has been reached.
|
|
87
|
+
*/
|
|
88
|
+
_setTimer(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Dismiss toast with animation.
|
|
91
|
+
*/
|
|
92
|
+
dismiss(): void;
|
|
93
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, MElement } from '../foundation/component';
|
|
2
|
+
export type TooltipPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
3
|
+
export interface TooltipOptions extends BaseOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Delay time before tooltip disappears.
|
|
6
|
+
* @default 200
|
|
7
|
+
*/
|
|
8
|
+
exitDelay: number;
|
|
9
|
+
/**
|
|
10
|
+
* Delay time before tooltip appears.
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
enterDelay: number;
|
|
14
|
+
/**
|
|
15
|
+
* Element Id for the tooltip.
|
|
16
|
+
* @default ""
|
|
17
|
+
*/
|
|
18
|
+
tooltipId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Text string for the tooltip.
|
|
21
|
+
* @default ""
|
|
22
|
+
*/
|
|
23
|
+
text: string;
|
|
24
|
+
/**
|
|
25
|
+
* Set distance tooltip appears away from its activator
|
|
26
|
+
* excluding transitionMovement.
|
|
27
|
+
* @default 5
|
|
28
|
+
*/
|
|
29
|
+
margin: number;
|
|
30
|
+
/**
|
|
31
|
+
* Enter transition duration.
|
|
32
|
+
* @default 300
|
|
33
|
+
*/
|
|
34
|
+
inDuration: number;
|
|
35
|
+
/**
|
|
36
|
+
* Opacity of the tooltip.
|
|
37
|
+
* @default 1
|
|
38
|
+
*/
|
|
39
|
+
opacity: number;
|
|
40
|
+
/**
|
|
41
|
+
* Exit transition duration.
|
|
42
|
+
* @default 250
|
|
43
|
+
*/
|
|
44
|
+
outDuration: number;
|
|
45
|
+
/**
|
|
46
|
+
* Set the direction of the tooltip.
|
|
47
|
+
* @default 'bottom'
|
|
48
|
+
*/
|
|
49
|
+
position: TooltipPosition;
|
|
50
|
+
/**
|
|
51
|
+
* Amount in px that the tooltip moves during its transition.
|
|
52
|
+
* @default 10
|
|
53
|
+
*/
|
|
54
|
+
transitionMovement: number;
|
|
55
|
+
}
|
|
56
|
+
export declare class Tooltip extends Component<TooltipOptions> {
|
|
57
|
+
/**
|
|
58
|
+
* If tooltip is open.
|
|
59
|
+
*/
|
|
60
|
+
isOpen: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If tooltip is hovered.
|
|
63
|
+
*/
|
|
64
|
+
isHovered: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* If tooltip is focused.
|
|
67
|
+
*/
|
|
68
|
+
isFocused: boolean;
|
|
69
|
+
tooltipEl: HTMLElement;
|
|
70
|
+
private _exitDelayTimeout;
|
|
71
|
+
private _enterDelayTimeout;
|
|
72
|
+
xMovement: number;
|
|
73
|
+
yMovement: number;
|
|
74
|
+
constructor(el: HTMLElement, options: Partial<TooltipOptions>);
|
|
75
|
+
static get defaults(): TooltipOptions;
|
|
76
|
+
/**
|
|
77
|
+
* Initializes instance of Tooltip.
|
|
78
|
+
* @param el HTML element.
|
|
79
|
+
* @param options Component options.
|
|
80
|
+
*/
|
|
81
|
+
static init(el: HTMLElement, options?: Partial<TooltipOptions>): Tooltip;
|
|
82
|
+
/**
|
|
83
|
+
* Initializes instances of Tooltip.
|
|
84
|
+
* @param els HTML elements.
|
|
85
|
+
* @param options Component options.
|
|
86
|
+
*/
|
|
87
|
+
static init(els: InitElements<MElement>, options?: Partial<TooltipOptions>): Tooltip[];
|
|
88
|
+
static getInstance(el: HTMLElement): Tooltip;
|
|
89
|
+
destroy(): void;
|
|
90
|
+
_appendTooltipEl(): void;
|
|
91
|
+
_setTooltipContent(tooltipContentEl: HTMLElement): void;
|
|
92
|
+
_updateTooltipContent(): void;
|
|
93
|
+
_setupEventHandlers(): void;
|
|
94
|
+
_removeEventHandlers(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Show tooltip.
|
|
97
|
+
*/
|
|
98
|
+
open: (isManual: boolean) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Hide tooltip.
|
|
101
|
+
*/
|
|
102
|
+
close: () => void;
|
|
103
|
+
_setExitDelayTimeout(): void;
|
|
104
|
+
_setEnterDelayTimeout(isManual: any): void;
|
|
105
|
+
_positionTooltip(): void;
|
|
106
|
+
_repositionWithinScreen(x: number, y: number, width: number, height: number): {
|
|
107
|
+
x: number;
|
|
108
|
+
y: number;
|
|
109
|
+
};
|
|
110
|
+
_animateIn(): void;
|
|
111
|
+
_animateOut(): void;
|
|
112
|
+
_handleMouseEnter: () => void;
|
|
113
|
+
_handleMouseLeave: () => void;
|
|
114
|
+
_handleFocus: () => void;
|
|
115
|
+
_handleBlur: () => void;
|
|
116
|
+
_getAttributeOptions(): Partial<TooltipOptions>;
|
|
117
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|