@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.
Files changed (122) hide show
  1. package/CHANGELOG.md +1313 -1
  2. package/README.md +76 -30
  3. package/dist/css/expressive.css +4896 -1777
  4. package/dist/css/expressive.css.map +1 -1
  5. package/dist/css/expressive.min.css +1 -1
  6. package/dist/css/expressive.min.css.map +1 -1
  7. package/dist/fonts/LICENSE-material-symbols +93 -0
  8. package/dist/fonts/LICENSE-noto-sans +93 -0
  9. package/dist/fonts/LICENSE-roboto +93 -0
  10. package/dist/fonts/material-symbols-outlined.woff2 +0 -0
  11. package/dist/fonts/material-symbols-rounded.woff2 +0 -0
  12. package/dist/fonts/material-symbols-sharp.woff2 +0 -0
  13. package/dist/fonts/noto-sans-latin-400.woff2 +0 -0
  14. package/dist/fonts/noto-sans-latin-500.woff2 +0 -0
  15. package/dist/fonts/roboto-latin-400.woff2 +0 -0
  16. package/dist/fonts/roboto-latin-500.woff2 +0 -0
  17. package/dist/js/expressive.cjs +1673 -1338
  18. package/dist/js/expressive.cjs.map +4 -4
  19. package/dist/js/expressive.js +1673 -1338
  20. package/dist/js/expressive.js.map +4 -4
  21. package/dist/js/expressive.min.js +13 -13
  22. package/dist/js/expressive.min.js.map +4 -4
  23. package/dist/js/expressive.mjs +1673 -1338
  24. package/dist/js/expressive.mjs.map +4 -4
  25. package/dist/types/behaviors/bottomSheets.d.ts +19 -11
  26. package/dist/types/behaviors/sheetDrag.d.ts +40 -0
  27. package/dist/types/behaviors/sideSheets.d.ts +2 -9
  28. package/dist/types/components/appBar.d.ts +26 -0
  29. package/dist/types/components/autocomplete.d.ts +15 -3
  30. package/dist/types/components/buttonGroup.d.ts +39 -0
  31. package/dist/types/components/buttons.d.ts +5 -1
  32. package/dist/types/components/cards.d.ts +11 -13
  33. package/dist/types/components/carousel.d.ts +87 -53
  34. package/dist/types/components/chips.d.ts +21 -1
  35. package/dist/types/components/expandingCard.d.ts +31 -0
  36. package/dist/types/components/index.d.ts +23 -20
  37. package/dist/types/components/lightbox.d.ts +1 -0
  38. package/dist/types/components/menu.d.ts +11 -1
  39. package/dist/types/components/{sidenav.d.ts → navigationDrawer.d.ts} +16 -16
  40. package/dist/types/components/registry.d.ts +18 -8
  41. package/dist/types/components/slider.d.ts +26 -85
  42. package/dist/types/components/snackbar.d.ts +20 -5
  43. package/dist/types/components/tabs.d.ts +12 -0
  44. package/dist/types/components/timepicker.d.ts +12 -10
  45. package/dist/types/components/tooltip.d.ts +1 -0
  46. package/dist/types/core/utils.d.ts +64 -53
  47. package/dist/types/index.d.ts +8 -9
  48. package/package.json +39 -3
  49. package/src/sass/README.md +61 -11
  50. package/src/sass/abstracts/_breakpoints.scss +17 -19
  51. package/src/sass/abstracts/_mixins.scss +155 -21
  52. package/src/sass/abstracts/_variables.scss +69 -5
  53. package/src/sass/base/_fonts.scss +63 -0
  54. package/src/sass/base/_global.scss +6 -24
  55. package/src/sass/base/_grid.scss +15 -12
  56. package/src/sass/base/_normalize.scss +34 -38
  57. package/src/sass/base/_typography.scss +4 -18
  58. package/src/sass/components/_badges.scss +3 -5
  59. package/src/sass/components/_banners.scss +298 -0
  60. package/src/sass/components/_bottom-app-bar.scss +180 -0
  61. package/src/sass/components/_bottom-sheet.scss +12 -4
  62. package/src/sass/components/_button-groups.scss +358 -0
  63. package/src/sass/components/_buttons.scss +245 -92
  64. package/src/sass/components/_cards.scss +514 -78
  65. package/src/sass/components/_carousel.scss +562 -68
  66. package/src/sass/components/_chips.scss +64 -5
  67. package/src/sass/components/_datepicker.scss +24 -24
  68. package/src/sass/components/_dialog.scss +17 -11
  69. package/src/sass/components/_drag-handle.scss +130 -0
  70. package/src/sass/components/_expanding-card.scss +226 -0
  71. package/src/sass/components/_fab-menu.scss +232 -0
  72. package/src/sass/components/_floating-sheet.scss +86 -0
  73. package/src/sass/components/_icon-buttons.scss +172 -0
  74. package/src/sass/components/_icons-material-design.scss +22 -10
  75. package/src/sass/components/_index.scss +22 -6
  76. package/src/sass/components/_list.scss +16 -13
  77. package/src/sass/components/_loading-indicator.scss +106 -0
  78. package/src/sass/components/_menu.scss +335 -61
  79. package/src/sass/components/_navbar.scss +245 -45
  80. package/src/sass/components/_navigation-bar.scss +22 -11
  81. package/src/sass/components/{_sidenav.scss → _navigation-drawer.scss} +123 -33
  82. package/src/sass/components/_navigation-rail.scss +31 -23
  83. package/src/sass/components/_page-footer.scss +19 -16
  84. package/src/sass/components/_pagination.scss +24 -6
  85. package/src/sass/components/_panes.scss +52 -11
  86. package/src/sass/components/{_preloader.scss → _progress.scss} +11 -3
  87. package/src/sass/components/_scrim.scss +37 -0
  88. package/src/sass/components/_search.scss +259 -0
  89. package/src/sass/components/_segmented-buttons.scss +188 -0
  90. package/src/sass/components/_side-sheet.scss +2 -2
  91. package/src/sass/components/_snackbar.scss +20 -15
  92. package/src/sass/components/_split-button.scss +196 -0
  93. package/src/sass/components/_tabs.scss +7 -8
  94. package/src/sass/components/_timepicker.scss +67 -58
  95. package/src/sass/components/_toolbar.scss +206 -80
  96. package/src/sass/components/_transitions.scss +8 -1
  97. package/src/sass/components/forms/_checkboxes.scss +49 -12
  98. package/src/sass/components/forms/_fieldset.scss +4 -4
  99. package/src/sass/components/forms/_file-input.scss +8 -1
  100. package/src/sass/components/forms/_index.scss +1 -1
  101. package/src/sass/components/forms/_input-fields.scss +50 -44
  102. package/src/sass/components/forms/_radio-buttons.scss +42 -10
  103. package/src/sass/components/forms/_select.scss +38 -1
  104. package/src/sass/components/forms/{_range.scss → _slider.scss} +8 -9
  105. package/src/sass/components/forms/_switches.scss +6 -7
  106. package/src/sass/expressive.scss +5 -0
  107. package/src/sass/tokens/_index.scss +4 -1
  108. package/src/sass/tokens/_reference.scss +70 -61
  109. package/src/sass/tokens/_state.scss +24 -0
  110. package/src/sass/tokens/_theme.scss +6 -3
  111. package/src/sass/tokens/_vibrant.scss +76 -0
  112. package/src/sass/utilities/_colors.scss +14 -1
  113. package/src/sass/utilities/_helpers.scss +5 -5
  114. package/src/sass/utilities/_visibility.scss +48 -26
  115. package/dist/types/behaviors/waves.d.ts +0 -15
  116. package/dist/types/components/parallax.d.ts +0 -16
  117. package/dist/types/components/range.d.ts +0 -43
  118. package/dist/types/core/bounding.d.ts +0 -6
  119. package/dist/types/core/edges.d.ts +0 -6
  120. package/src/sass/components/_parallax.scss +0 -104
  121. package/src/sass/components/_pulse.scss +0 -37
  122. 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 SidenavOptions extends BaseOptions {
2
+ export interface NavigationDrawerOptions extends BaseOptions {
3
3
  /**
4
- * Side of screen on which Sidenav appears.
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 Sidenav.
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 large-screen dock.
38
+ * while dragging. CSS owns the slide, the scrim, and the Expanded+ dock.
39
39
  */
40
- export declare class Sidenav extends Component<SidenavOptions> implements Openable {
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
- /** Describes if sidenav has sidenav-fixed. */
44
+ /** Whether the drawer is docked (`navigation-drawer-fixed`). */
45
45
  isFixed: boolean;
46
- /** Describes if Sidenav is being dragged. */
46
+ /** Describes if NavigationDrawer is being dragged. */
47
47
  isDragged: boolean;
48
- static _sidenavs: Sidenav[];
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<SidenavOptions>);
61
- static get defaults(): SidenavOptions;
60
+ constructor(el: HTMLElement, options: Partial<NavigationDrawerOptions>);
61
+ static get defaults(): NavigationDrawerOptions;
62
62
  /**
63
- * Initializes instance of Sidenav.
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<SidenavOptions>): Sidenav;
67
+ static init(el: HTMLElement, options?: Partial<NavigationDrawerOptions>): NavigationDrawer;
68
68
  /**
69
- * Initializes instances of Sidenav.
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<SidenavOptions>): Sidenav[];
74
- static getInstance(el: HTMLElement): Sidenav;
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
- * (sidenav-fixed at the large breakpoint).
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 './index';
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
- Sidenav: {
57
- component: typeof Components.Sidenav;
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]['component']>['options']>;
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
- /** Index of current slide. */
44
- activeIndex: number;
45
- interval: ReturnType<typeof setTimeout>;
46
- eventPause: boolean;
47
- _slider: HTMLUListElement;
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: HTMLElement, options?: Partial<SliderOptions>): Slider;
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: HTMLElement): Slider;
22
+ static init(els: InitElements<HTMLInputElement | InitElement>, options?: Partial<SliderOptions>): Slider[];
23
+ static getInstance(el: HTMLInputElement): Slider;
70
24
  destroy(): void;
71
- private _setupEventHandlers;
72
- private _removeEventHandlers;
73
- private _handleVisibilityChange;
74
- private _handleIndicatorClick;
75
- private _handleAutoPauseHover;
76
- private _handleAutoPauseFocus;
77
- private _handleAutoStartHover;
78
- private _handleAutoStartFocus;
79
- private _handleInterval;
80
- private _animateSlide;
81
- private _setSliderHeight;
82
- private _setupIndicators;
83
- private _removeIndicators;
84
- set(index: number): void;
85
- _pause(fromEvent: boolean): void;
86
- /**
87
- * Pause slider autoslide.
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: TouchEvent | MouseEvent): void;
95
- static _onDragMove(e: TouchEvent | MouseEvent): void;
96
- static _onDragEnd(): void;
97
- static _xPos(e: TouchEvent | MouseEvent): number;
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
- _handleTimeInputEnterKey: (e: KeyboardEvent) => void;
172
- _handleClockClickStart: (e: any) => void;
173
- _handleDocumentClickMove: (e: any) => void;
174
- _handleDocumentClickEnd: (e: any) => void;
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
- import { Edges } from './edges';
2
- import { Bounding } from './bounding';
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
- * Fires the given function after a certain ammount of time.
105
- * @param func Function to be fired.
106
- * @param wait Wait time.
107
- * @param options Additional options.
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, options?: Partial<{
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 {};
@@ -1,9 +1,8 @@
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 { Waves } from './behaviors/waves';
7
- export { AutoInit } from './components/registry';
8
- export type { AutoInitOptions } from './components/registry';
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.7.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:css": "run-s build:css:expanded build:css:min",
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
  }