@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.
Files changed (105) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -0
  3. package/dist/css/expressive.css +9914 -0
  4. package/dist/css/expressive.min.css +1 -0
  5. package/dist/js/components/autocomplete.d.ts +152 -0
  6. package/dist/js/components/buttons.d.ts +66 -0
  7. package/dist/js/components/cards.d.ts +50 -0
  8. package/dist/js/components/carousel.d.ts +131 -0
  9. package/dist/js/components/chips.d.ts +135 -0
  10. package/dist/js/components/collapsible.d.ts +74 -0
  11. package/dist/js/components/datepicker.d.ts +336 -0
  12. package/dist/js/components/dropdown.d.ts +148 -0
  13. package/dist/js/components/index.d.ts +21 -0
  14. package/dist/js/components/materialbox.d.ts +97 -0
  15. package/dist/js/components/modal.d.ts +45 -0
  16. package/dist/js/components/parallax.d.ts +40 -0
  17. package/dist/js/components/pushpin.d.ts +51 -0
  18. package/dist/js/components/scrollspy.d.ts +80 -0
  19. package/dist/js/components/sidenav.d.ts +125 -0
  20. package/dist/js/components/slider.d.ts +101 -0
  21. package/dist/js/components/tabs.d.ts +80 -0
  22. package/dist/js/components/tap-target.d.ts +58 -0
  23. package/dist/js/components/timepicker.d.ts +207 -0
  24. package/dist/js/components/toast.d.ts +93 -0
  25. package/dist/js/components/tooltip.d.ts +117 -0
  26. package/dist/js/components/waves.d.ts +15 -0
  27. package/dist/js/expressive.js +8239 -0
  28. package/dist/js/expressive.js.map +1 -0
  29. package/dist/js/expressive.min.js +2 -0
  30. package/dist/js/expressive.min.js.map +1 -0
  31. package/dist/js/expressive.mjs +8206 -0
  32. package/dist/js/expressive.mjs.map +1 -0
  33. package/dist/js/forms/character-counter.d.ts +36 -0
  34. package/dist/js/forms/forms.d.ts +17 -0
  35. package/dist/js/forms/index.d.ts +4 -0
  36. package/dist/js/forms/range.d.ts +40 -0
  37. package/dist/js/forms/select.d.ts +77 -0
  38. package/dist/js/foundation/component.d.ts +73 -0
  39. package/dist/js/foundation/index.d.ts +2 -0
  40. package/dist/js/foundation/utils.d.ts +122 -0
  41. package/dist/js/index.d.ts +52 -0
  42. package/dist/js/plugins/docked-display.d.ts +34 -0
  43. package/dist/js/plugins/index.d.ts +1 -0
  44. package/package.json +71 -0
  45. package/src/scss/components/_appbar.scss +454 -0
  46. package/src/scss/components/_badges.scss +77 -0
  47. package/src/scss/components/_breadcrumb.scss +27 -0
  48. package/src/scss/components/_buttons.scss +412 -0
  49. package/src/scss/components/_cards.scss +267 -0
  50. package/src/scss/components/_carousel.scss +93 -0
  51. package/src/scss/components/_chips.scss +147 -0
  52. package/src/scss/components/_collapsible.scss +84 -0
  53. package/src/scss/components/_collection.scss +114 -0
  54. package/src/scss/components/_date-picker.scss +268 -0
  55. package/src/scss/components/_dropdown.scss +98 -0
  56. package/src/scss/components/_index.scss +28 -0
  57. package/src/scss/components/_material-box.scss +42 -0
  58. package/src/scss/components/_material-icons.scss +6 -0
  59. package/src/scss/components/_modal.scss +84 -0
  60. package/src/scss/components/_pagination.scss +45 -0
  61. package/src/scss/components/_parallax.scss +26 -0
  62. package/src/scss/components/_preloader.scss +422 -0
  63. package/src/scss/components/_pulse.scss +35 -0
  64. package/src/scss/components/_sidenav.scss +229 -0
  65. package/src/scss/components/_slider.scss +119 -0
  66. package/src/scss/components/_table-of-contents.scss +32 -0
  67. package/src/scss/components/_tabs.scss +176 -0
  68. package/src/scss/components/_tap-target.scss +102 -0
  69. package/src/scss/components/_time-picker.scss +294 -0
  70. package/src/scss/components/_toast.scss +70 -0
  71. package/src/scss/components/_tooltip.scss +49 -0
  72. package/src/scss/components/_transitions.scss +19 -0
  73. package/src/scss/components/_video.scss +15 -0
  74. package/src/scss/expressive.scss +7 -0
  75. package/src/scss/forms/_checkboxes.scss +199 -0
  76. package/src/scss/forms/_file-input.scss +41 -0
  77. package/src/scss/forms/_index.scss +17 -0
  78. package/src/scss/forms/_input-fields.scss +360 -0
  79. package/src/scss/forms/_radio-buttons.scss +114 -0
  80. package/src/scss/forms/_range.scss +148 -0
  81. package/src/scss/forms/_select.scss +108 -0
  82. package/src/scss/forms/_switches.scss +127 -0
  83. package/src/scss/foundation/_base.scss +71 -0
  84. package/src/scss/foundation/_color-palette.scss +402 -0
  85. package/src/scss/foundation/_index.scss +10 -0
  86. package/src/scss/foundation/_mixins.scss +198 -0
  87. package/src/scss/foundation/_motion.scss +70 -0
  88. package/src/scss/foundation/_normalize.scss +349 -0
  89. package/src/scss/foundation/_shape.scss +30 -0
  90. package/src/scss/foundation/_state-layers.scss +68 -0
  91. package/src/scss/foundation/_theme.scss +238 -0
  92. package/src/scss/foundation/_tokens.scss +511 -0
  93. package/src/scss/foundation/_variables.scss +57 -0
  94. package/src/scss/layout/_footer.scss +26 -0
  95. package/src/scss/layout/_grid.scss +172 -0
  96. package/src/scss/layout/_index.scss +3 -0
  97. package/src/scss/layout/_table.scss +119 -0
  98. package/src/scss/utilities/_a11y.scss +77 -0
  99. package/src/scss/utilities/_colors.scss +74 -0
  100. package/src/scss/utilities/_elevation.scss +63 -0
  101. package/src/scss/utilities/_helpers.scss +50 -0
  102. package/src/scss/utilities/_index.scss +7 -0
  103. package/src/scss/utilities/_responsive.scss +62 -0
  104. package/src/scss/utilities/_spacing.scss +38 -0
  105. package/src/scss/utilities/_typography.scss +115 -0
@@ -0,0 +1,336 @@
1
+ import { BaseOptions, Component, I18nOptions, InitElements, MElement } from '../foundation/component';
2
+ export interface DateI18nOptions extends I18nOptions {
3
+ previousMonth: string;
4
+ nextMonth: string;
5
+ months: string[];
6
+ monthsShort: string[];
7
+ weekdays: string[];
8
+ weekdaysShort: string[];
9
+ weekdaysAbbrev: string[];
10
+ }
11
+ export interface DatepickerOptions extends BaseOptions {
12
+ /**
13
+ * The date output format for the input field value
14
+ * or a function taking the date and outputting the
15
+ * formatted date string.
16
+ * @default 'mmm dd, yyyy'
17
+ */
18
+ format: string | ((d: Date) => string);
19
+ /**
20
+ * Used to create date object from current input string.
21
+ * @default null
22
+ */
23
+ parse: ((value: string, format: string) => Date) | null;
24
+ /**
25
+ * The initial condition if the datepicker is based on date range.
26
+ * @default false
27
+ */
28
+ isDateRange: boolean;
29
+ /**
30
+ * The selector of the user specified date range end element
31
+ */
32
+ dateRangeEndEl: string | null;
33
+ /**
34
+ * The initial condition if the datepicker is based on multiple date selection.
35
+ * @default false
36
+ */
37
+ isMultipleSelection: boolean;
38
+ /**
39
+ * The initial date to view when first opened.
40
+ * @default null
41
+ */
42
+ defaultDate: Date | null;
43
+ /**
44
+ * The initial end date to view when first opened.
45
+ * @default null
46
+ */
47
+ defaultEndDate: Date | null;
48
+ /**
49
+ * Make the `defaultDate` the initial selected value.
50
+ * @default false
51
+ */
52
+ setDefaultDate: boolean;
53
+ /**
54
+ * Make the `defaultEndDate` the initial selected value.
55
+ * @default false
56
+ */
57
+ setDefaultEndDate: boolean;
58
+ /**
59
+ * Prevent selection of any date on the weekend.
60
+ * @default false
61
+ */
62
+ disableWeekends: boolean;
63
+ /**
64
+ * Custom function to disable certain days.
65
+ * @default null
66
+ */
67
+ disableDayFn: ((day: Date) => boolean) | null;
68
+ /**
69
+ * First day of week (0: Sunday, 1: Monday etc).
70
+ * @default 0
71
+ */
72
+ firstDay: number;
73
+ /**
74
+ * The earliest date that can be selected.
75
+ * @default null
76
+ */
77
+ minDate: Date | null;
78
+ /**
79
+ * The latest date that can be selected.
80
+ * @default null
81
+ */
82
+ maxDate: Date | null;
83
+ /**
84
+ * Number of years either side, or array of upper/lower range.
85
+ * @default 10
86
+ */
87
+ yearRange: number | number[];
88
+ /**
89
+ * Sort year range in reverse order.
90
+ * @default false
91
+ */
92
+ yearRangeReverse: boolean;
93
+ /**
94
+ * Changes Datepicker to RTL.
95
+ * @default false
96
+ */
97
+ isRTL: boolean;
98
+ /**
99
+ * Show month after year in Datepicker title.
100
+ * @default false
101
+ */
102
+ showMonthAfterYear: boolean;
103
+ /**
104
+ * Render days of the calendar grid that fall in the next
105
+ * or previous month.
106
+ * @default false
107
+ */
108
+ showDaysInNextAndPreviousMonths: boolean;
109
+ /**
110
+ * Specify if the docked datepicker is in open state by default
111
+ */
112
+ openByDefault: boolean;
113
+ /**
114
+ * Specify a DOM element OR selector for a DOM element to render
115
+ * the calendar in, by default it will be placed before the input.
116
+ * @default null
117
+ */
118
+ container: HTMLElement | string | null;
119
+ /**
120
+ * Show the clear button in the datepicker.
121
+ * @default false
122
+ */
123
+ showClearBtn: boolean;
124
+ /**
125
+ * Autosubmit calendar day select to input field
126
+ * @default false
127
+ */
128
+ autoSubmit: true;
129
+ /**
130
+ * Internationalization options.
131
+ */
132
+ i18n: Partial<DateI18nOptions>;
133
+ /**
134
+ * An array of string returned by `Date.toDateString()`,
135
+ * indicating there are events in the specified days.
136
+ * @default []
137
+ */
138
+ events: string[];
139
+ /**
140
+ * Callback function when date is selected,
141
+ * first parameter is the newly selected date.
142
+ * @default null
143
+ */
144
+ onSelect: ((selectedDate: Date) => void) | null;
145
+ /**
146
+ * Callback function when Datepicker is closed.
147
+ * @default null
148
+ */
149
+ /**
150
+ * Callback function when Datepicker HTML is refreshed.
151
+ * @default null
152
+ */
153
+ onDraw: (() => void) | null;
154
+ /**
155
+ * Callback function for interaction with input field.
156
+ * @default null
157
+ */
158
+ onInputInteraction: (() => void) | null;
159
+ /**
160
+ * Callback function for interaction with confirm button.
161
+ * @default null
162
+ */
163
+ onConfirm: (() => void) | null;
164
+ /**
165
+ * Callback function for interaction with close button.
166
+ * @default null
167
+ */
168
+ onCancel: (() => void) | null;
169
+ /** Field used for internal calculations DO NOT CHANGE IT */
170
+ minYear?: number;
171
+ /** Field used for internal calculations DO NOT CHANGE IT */
172
+ maxYear?: number;
173
+ /** Field used for internal calculations DO NOT CHANGE IT */
174
+ minMonth?: number;
175
+ /** Field used for internal calculations DO NOT CHANGE IT */
176
+ maxMonth?: number;
177
+ /** Field used for internal calculations DO NOT CHANGE IT */
178
+ startRange?: Date;
179
+ /** Field used for internal calculations DO NOT CHANGE IT */
180
+ endRange?: Date;
181
+ /**
182
+ * Display plugin
183
+ */
184
+ displayPlugin: string;
185
+ /**
186
+ * Configurable display plugin options
187
+ */
188
+ displayPluginOptions: object;
189
+ }
190
+ export declare class Datepicker extends Component<DatepickerOptions> {
191
+ el: HTMLInputElement;
192
+ id: string;
193
+ multiple: boolean;
194
+ calendarEl: HTMLElement;
195
+ /** CLEAR button instance. */
196
+ /** DONE button instance */
197
+ containerEl: HTMLElement;
198
+ yearTextEl: HTMLElement;
199
+ dateTextEl: HTMLElement;
200
+ endDateEl: HTMLInputElement;
201
+ dateEls: HTMLInputElement[];
202
+ /** The selected Date. */
203
+ date: Date;
204
+ endDate: null | Date;
205
+ dates: Date[];
206
+ formats: object;
207
+ calendars: [{
208
+ month: number;
209
+ year: number;
210
+ }];
211
+ private _y;
212
+ private _m;
213
+ private displayPlugin;
214
+ private footer;
215
+ static _template: string;
216
+ constructor(el: HTMLInputElement, options: Partial<DatepickerOptions>);
217
+ static get defaults(): DatepickerOptions;
218
+ /**
219
+ * Initializes instance of Datepicker.
220
+ * @param el HTML element.
221
+ * @param options Component options.
222
+ */
223
+ static init(el: HTMLInputElement, options?: Partial<DatepickerOptions>): Datepicker;
224
+ /**
225
+ * Initializes instances of Datepicker.
226
+ * @param els HTML elements.
227
+ * @param options Component options.
228
+ */
229
+ static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<DatepickerOptions>): Datepicker[];
230
+ static _isDate(obj: any): boolean;
231
+ static _isWeekend(date: any): boolean;
232
+ /**
233
+ * @deprecated as this function has no effect without any return statement or global parameter setter.
234
+ */
235
+ static _setToStartOfDay(date: any): void;
236
+ static _getDaysInMonth(year: any, month: any): number;
237
+ static _isLeapYear(year: any): boolean;
238
+ static _compareDates(a: any, b: any): boolean;
239
+ static _compareWithinRange(day: Date, date: Date, dateEnd: Date): boolean;
240
+ static _comparePastDate(a: Date, b: Date): boolean;
241
+ static getInstance(el: HTMLElement): Datepicker;
242
+ destroy(): void;
243
+ destroySelects(): void;
244
+ _insertHTMLIntoDOM(): void;
245
+ /**
246
+ * Renders the date input format
247
+ */
248
+ _renderDateInputFormat(el: HTMLInputElement): void;
249
+ /**
250
+ * Gets a string representation of the given date.
251
+ */
252
+ toString(date?: Date, format?: string | ((d: Date) => string)): string;
253
+ /**
254
+ * Returns the formatted date.
255
+ */
256
+ formatDate(date: Date, format: string): string;
257
+ /**
258
+ * Sets date from input field.
259
+ */
260
+ setDateFromInput(el: HTMLInputElement): void;
261
+ /**
262
+ * Set a date on the datepicker.
263
+ * @param date Date to set on the datepicker.
264
+ * @param preventOnSelect Undocumented as of 5 March 2018.
265
+ * @param isEndDate
266
+ * @param fromUserInput
267
+ */
268
+ setDate(date?: Date, preventOnSelect?: boolean, isEndDate?: boolean, fromUserInput?: boolean): void;
269
+ validateDate(date: Date): void | Date;
270
+ /**
271
+ * Set a single date on the datepicker.
272
+ * @param date Date to set on the datepicker.
273
+ * @param isEndDate
274
+ */
275
+ setSingleDate(date: Date, isEndDate: boolean): void;
276
+ /**
277
+ * Set a multi date on the datepicker.
278
+ * @param date Date to set on the datepicker.
279
+ */
280
+ setMultiDate(date: Date): void;
281
+ /**
282
+ * Sets the data-date attribute on the date input field
283
+ */
284
+ setDataDate(el: any, date: any): void;
285
+ /**
286
+ * Sets dates on the input values.
287
+ */
288
+ setInputValues(): void;
289
+ setMultipleSelectionInputValues(): void;
290
+ /**
291
+ * Sets given date as the input value on the given element.
292
+ */
293
+ setInputValue(el: any, date: any): void;
294
+ /**
295
+ * Renders the date in the modal head section.
296
+ */
297
+ _renderDateDisplay(date: Date, endDate?: Date): void;
298
+ /**
299
+ * Change date view to a specific date on the datepicker.
300
+ * @param date Date to show on the datepicker.
301
+ */
302
+ gotoDate(date: Date): void;
303
+ adjustCalendars(): void;
304
+ adjustCalendar(calendar: any): any;
305
+ nextMonth(): void;
306
+ prevMonth(): void;
307
+ render(year: any, month: any, randId: any): string;
308
+ renderDay(opts: any): string;
309
+ renderRow(days: any, isRTL: any, isRowSelected: any): string;
310
+ renderTable(opts: any, data: any, randId: any): string;
311
+ renderHead(opts: any): string;
312
+ renderBody(rows: any): string;
313
+ renderTitle(instance: any, c: any, year: any, month: any, refYear: any, randId: any): string;
314
+ draw(): void;
315
+ _setupEventHandlers(): void;
316
+ _setupVariables(): void;
317
+ _removeEventHandlers(): void;
318
+ _handleInputClick: (e: any) => void;
319
+ _handleInputKeydown: (e: KeyboardEvent) => void;
320
+ _handleCalendarClick: (e: any) => void;
321
+ _handleDateRangeCalendarClick: (date: Date) => void;
322
+ _handleClearClick: () => void;
323
+ _clearDates: () => void;
324
+ _handleMonthChange: (e: any) => void;
325
+ _handleYearChange: (e: any) => void;
326
+ gotoMonth(month: any): void;
327
+ gotoYear(year: any): void;
328
+ _handleInputChange: (e: Event) => void;
329
+ renderDayName(opts: any, day: any, abbr?: boolean): any;
330
+ createDateInput(): HTMLInputElement;
331
+ _finishSelection: () => void;
332
+ _confirm: () => void;
333
+ _cancel: () => void;
334
+ open(): this;
335
+ close(): this;
336
+ }
@@ -0,0 +1,148 @@
1
+ import { Component, BaseOptions, InitElements, MElement, Openable } from '../foundation/component';
2
+ export interface DropdownOptions extends BaseOptions {
3
+ /**
4
+ * Defines the edge the menu is aligned to.
5
+ * @default 'left'
6
+ */
7
+ alignment: 'left' | 'right';
8
+ /**
9
+ * If true, automatically focus dropdown el for keyboard.
10
+ * @default true
11
+ */
12
+ autoFocus: boolean;
13
+ /**
14
+ * If true, constrainWidth to the size of the dropdown activator.
15
+ * @default true
16
+ */
17
+ constrainWidth: boolean;
18
+ /**
19
+ * Provide an element that will be the bounding container of the dropdown.
20
+ * @default null
21
+ */
22
+ container: Element;
23
+ /**
24
+ * If false, the dropdown will show below the trigger.
25
+ * @default true
26
+ */
27
+ coverTrigger: boolean;
28
+ /**
29
+ * If true, close dropdown on item click.
30
+ * @default true
31
+ */
32
+ closeOnClick: boolean;
33
+ /**
34
+ * If true, the dropdown will open on hover.
35
+ * @default false
36
+ */
37
+ hover: boolean;
38
+ /**
39
+ * The duration of the transition enter in milliseconds.
40
+ * @default 150
41
+ */
42
+ inDuration: number;
43
+ /**
44
+ * The duration of the transition out in milliseconds.
45
+ * @default 250
46
+ */
47
+ outDuration: number;
48
+ /**
49
+ * Function called when dropdown starts entering.
50
+ * @default null
51
+ */
52
+ onOpenStart: (el: HTMLElement) => void;
53
+ /**
54
+ * Function called when dropdown finishes entering.
55
+ * @default null
56
+ */
57
+ onOpenEnd: (el: HTMLElement) => void;
58
+ /**
59
+ * Function called when dropdown starts exiting.
60
+ * @default null
61
+ */
62
+ onCloseStart: (el: HTMLElement) => void;
63
+ /**
64
+ * Function called when dropdown finishes exiting.
65
+ * @default null
66
+ */
67
+ onCloseEnd: (el: HTMLElement) => void;
68
+ /**
69
+ * Function called when item is clicked.
70
+ * @default null
71
+ */
72
+ onItemClick: (el: HTMLLIElement) => void;
73
+ }
74
+ export declare class Dropdown extends Component<DropdownOptions> implements Openable {
75
+ static _dropdowns: Dropdown[];
76
+ /** ID of the dropdown element. */
77
+ id: string;
78
+ /** The DOM element of the dropdown. */
79
+ dropdownEl: HTMLElement;
80
+ /** If the dropdown is open. */
81
+ isOpen: boolean;
82
+ /** If the dropdown content is scrollable. */
83
+ isScrollable: boolean;
84
+ isTouchMoving: boolean;
85
+ /** The index of the item focused. */
86
+ focusedIndex: number;
87
+ filterQuery: string[];
88
+ filterTimeout: NodeJS.Timeout | number;
89
+ constructor(el: HTMLElement, options: Partial<DropdownOptions>);
90
+ static get defaults(): DropdownOptions;
91
+ /**
92
+ * Initializes instance of Dropdown.
93
+ * @param el HTML element.
94
+ * @param options Component options.
95
+ */
96
+ static init(el: HTMLElement, options?: Partial<DropdownOptions>): Dropdown;
97
+ /**
98
+ * Initializes instances of Dropdown.
99
+ * @param els HTML elements.
100
+ * @param options Component options.
101
+ */
102
+ static init(els: InitElements<MElement>, options?: Partial<DropdownOptions>): Dropdown[];
103
+ static getInstance(el: HTMLElement): Dropdown;
104
+ destroy(): void;
105
+ _setupEventHandlers(): void;
106
+ _removeEventHandlers(): void;
107
+ _setupTemporaryEventHandlers(): void;
108
+ _removeTemporaryEventHandlers(): void;
109
+ _handleClick: (e: MouseEvent) => void;
110
+ _handleMouseEnter: () => void;
111
+ _handleMouseLeave: (e: MouseEvent) => void;
112
+ _handleDocumentClick: (e: MouseEvent) => void;
113
+ _handleTriggerKeydown: (e: KeyboardEvent) => void;
114
+ _handleDocumentTouchmove: (e: TouchEvent) => void;
115
+ _handleDropdownClick: (e: MouseEvent) => void;
116
+ _handleDropdownKeydown: (e: KeyboardEvent) => void;
117
+ _handleWindowResize: () => void;
118
+ _resetFilterQuery: () => void;
119
+ _resetDropdownStyles(): void;
120
+ _resetDropdownPositioningStyles(): void;
121
+ _moveDropdownToElement(containerEl?: HTMLElement): void;
122
+ _makeDropdownFocusable(): void;
123
+ _focusFocusedItem(): void;
124
+ _getDropdownPosition(closestOverflowParent: HTMLElement): {
125
+ x: number;
126
+ y: number;
127
+ verticalAlignment: string;
128
+ horizontalAlignment: "right" | "left";
129
+ height: number;
130
+ width: number;
131
+ };
132
+ _animateIn(): void;
133
+ _animateOut(): void;
134
+ private _getClosestAncestor;
135
+ _placeDropdown(): void;
136
+ /**
137
+ * Open dropdown.
138
+ */
139
+ open: () => void;
140
+ /**
141
+ * Close dropdown.
142
+ */
143
+ close: () => void;
144
+ /**
145
+ * While dropdown is open, you can recalculate its dimensions if its contents have changed.
146
+ */
147
+ recalculateDimensions: () => void;
148
+ }
@@ -0,0 +1,21 @@
1
+ export { Autocomplete, AutocompleteOptions } from './autocomplete';
2
+ export { FloatingActionButton, FloatingActionButtonOptions } from './buttons';
3
+ export { Cards, CardsOptions } from './cards';
4
+ export { Carousel, CarouselOptions } from './carousel';
5
+ export { Chips, ChipsOptions } from './chips';
6
+ export { Collapsible, CollapsibleOptions } from './collapsible';
7
+ export { Datepicker, DatepickerOptions } from './datepicker';
8
+ export { Dropdown, DropdownOptions } from './dropdown';
9
+ export { Materialbox, MaterialboxOptions } from './materialbox';
10
+ export { Modal, ModalOptions } from './modal';
11
+ export { Parallax, ParallaxOptions } from './parallax';
12
+ export { Pushpin, PushpinOptions } from './pushpin';
13
+ export { ScrollSpy, ScrollSpyOptions } from './scrollspy';
14
+ export { Sidenav, SidenavOptions } from './sidenav';
15
+ export { Slider, SliderOptions } from './slider';
16
+ export { Tabs, TabsOptions } from './tabs';
17
+ export { TapTarget, TapTargetOptions } from './tap-target';
18
+ export { Timepicker, TimepickerOptions } from './timepicker';
19
+ export { Toast, ToastOptions } from './toast';
20
+ export { Tooltip, TooltipOptions } from './tooltip';
21
+ export { Waves } from './waves';
@@ -0,0 +1,97 @@
1
+ import { BaseOptions, Component, InitElements, MElement } from '../foundation/component';
2
+ export interface MaterialboxOptions extends BaseOptions {
3
+ /**
4
+ * Transition in duration in milliseconds.
5
+ * @default 275
6
+ */
7
+ inDuration: number;
8
+ /**
9
+ * Transition out duration in milliseconds.
10
+ * @default 200
11
+ */
12
+ outDuration: number;
13
+ /**
14
+ * Callback function called before materialbox is opened.
15
+ * @default null
16
+ */
17
+ onOpenStart: (el: Element) => void;
18
+ /**
19
+ * Callback function called after materialbox is opened.
20
+ * @default null
21
+ */
22
+ onOpenEnd: (el: Element) => void;
23
+ /**
24
+ * Callback function called before materialbox is closed.
25
+ * @default null
26
+ */
27
+ onCloseStart: (el: Element) => void;
28
+ /**
29
+ * Callback function called after materialbox is closed.
30
+ * @default null
31
+ */
32
+ onCloseEnd: (el: Element) => void;
33
+ }
34
+ export declare class Materialbox extends Component<MaterialboxOptions> {
35
+ /** If the materialbox overlay is showing. */
36
+ overlayActive: boolean;
37
+ /** If the materialbox is no longer being animated. */
38
+ doneAnimating: boolean;
39
+ /** Caption, if specified. */
40
+ caption: string;
41
+ /** Original width of image. */
42
+ originalWidth: number;
43
+ /** Original height of image. */
44
+ originalHeight: number;
45
+ private originInlineStyles;
46
+ private placeholder;
47
+ private _changedAncestorList;
48
+ private newHeight;
49
+ private newWidth;
50
+ private windowWidth;
51
+ private windowHeight;
52
+ private attrWidth;
53
+ private attrHeight;
54
+ private _overlay;
55
+ private _photoCaption;
56
+ constructor(el: HTMLElement, options: Partial<MaterialboxOptions>);
57
+ static get defaults(): MaterialboxOptions;
58
+ /**
59
+ * Initializes instance of MaterialBox.
60
+ * @param el HTML element.
61
+ * @param options Component options.
62
+ */
63
+ static init(el: HTMLElement, options?: Partial<MaterialboxOptions>): Materialbox;
64
+ /**
65
+ * Initializes instances of MaterialBox.
66
+ * @param els HTML elements.
67
+ * @param options Component options.
68
+ */
69
+ static init(els: InitElements<MElement>, options?: Partial<MaterialboxOptions>): Materialbox[];
70
+ static getInstance(el: HTMLElement): Materialbox;
71
+ destroy(): void;
72
+ private _setupEventHandlers;
73
+ private _removeEventHandlers;
74
+ private _handleMaterialboxClick;
75
+ private _handleMaterialboxKeypress;
76
+ private _handleMaterialboxToggle;
77
+ private _handleWindowScroll;
78
+ private _handleWindowResize;
79
+ private _handleWindowEscape;
80
+ private _makeAncestorsOverflowVisible;
81
+ private _offset;
82
+ private _updateVars;
83
+ private _animateImageIn;
84
+ private _animateImageOut;
85
+ private _addCaption;
86
+ private _removeCaption;
87
+ private _addOverlay;
88
+ private _removeOverlay;
89
+ /**
90
+ * Open materialbox.
91
+ */
92
+ open: () => void;
93
+ /**
94
+ * Close materialbox.
95
+ */
96
+ close: () => void;
97
+ }
@@ -0,0 +1,45 @@
1
+ import { Component, BaseOptions, InitElements, MElement } from '../foundation/component';
2
+ export interface ModalOptions extends BaseOptions {
3
+ opacity: number;
4
+ inDuration: number;
5
+ outDuration: number;
6
+ preventScrolling: boolean;
7
+ onOpenStart: (this: Modal, el: HTMLElement) => void;
8
+ onOpenEnd: (this: Modal, el: HTMLElement) => void;
9
+ onCloseStart: (el: HTMLElement) => void;
10
+ onCloseEnd: (el: HTMLElement) => void;
11
+ dismissible: boolean;
12
+ startingTop: string;
13
+ endingTop: string;
14
+ }
15
+ export declare class Modal extends Component<ModalOptions> {
16
+ #private;
17
+ constructor(el: HTMLElement, options: Partial<ModalOptions>);
18
+ static get defaults(): {
19
+ opacity: number;
20
+ inDuration: number;
21
+ outDuration: number;
22
+ onOpenStart: any;
23
+ onOpenEnd: any;
24
+ onCloseStart: any;
25
+ onCloseEnd: any;
26
+ preventScrolling: boolean;
27
+ dismissible: boolean;
28
+ startingTop: string;
29
+ endingTop: string;
30
+ };
31
+ static init(el: HTMLElement, options?: Partial<ModalOptions>): Modal;
32
+ static init(els: InitElements<MElement>, options?: Partial<ModalOptions>): Modal[];
33
+ static getInstance(el: HTMLElement): Modal;
34
+ destroy(): void;
35
+ _setupEventHandlers(): void;
36
+ _removeEventHandlers(): void;
37
+ _handleTriggerClick(): void;
38
+ _handleOverlayClick(): void;
39
+ _handleModalCloseClick(): void;
40
+ _handleKeydown(): void;
41
+ _handleFocus(): void;
42
+ open(): this;
43
+ close(): this;
44
+ static create(config: any): string | HTMLDialogElement;
45
+ }
@@ -0,0 +1,40 @@
1
+ import { Utils } from '../foundation/utils';
2
+ import { Component, BaseOptions, InitElements, MElement } from '../foundation/component';
3
+ export interface ParallaxOptions extends BaseOptions {
4
+ /**
5
+ * The minimum width of the screen, in pixels, where the parallax functionality starts working.
6
+ * @default 0
7
+ */
8
+ responsiveThreshold: number;
9
+ }
10
+ export declare class Parallax extends Component<ParallaxOptions> {
11
+ private _enabled;
12
+ private _img;
13
+ static _parallaxes: Parallax[];
14
+ static _handleScrollThrottled: () => Utils;
15
+ static _handleWindowResizeThrottled: () => Utils;
16
+ constructor(el: HTMLElement, options: Partial<ParallaxOptions>);
17
+ static get defaults(): ParallaxOptions;
18
+ /**
19
+ * Initializes instance of Parallax.
20
+ * @param el HTML element.
21
+ * @param options Component options.
22
+ */
23
+ static init(el: HTMLElement, options?: Partial<ParallaxOptions>): Parallax;
24
+ /**
25
+ * Initializes instances of Parallax.
26
+ * @param els HTML elements.
27
+ * @param options Component options.
28
+ */
29
+ static init(els: InitElements<MElement>, options?: Partial<ParallaxOptions>): Parallax[];
30
+ static getInstance(el: HTMLElement): Parallax;
31
+ destroy(): void;
32
+ static _handleScroll(): void;
33
+ static _handleWindowResize(): void;
34
+ _setupEventHandlers(): void;
35
+ _removeEventHandlers(): void;
36
+ _setupStyles(): void;
37
+ _handleImageLoad: () => void;
38
+ private _offset;
39
+ _updateParallax(): void;
40
+ }