@shortfuse/materialdesignweb 0.7.1-0 → 0.7.1-2

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 (138) hide show
  1. package/bin/generate-css.js +1 -2
  2. package/components/Badge.js +40 -3
  3. package/components/Body.js +16 -2
  4. package/components/BottomAppBar.js +25 -2
  5. package/components/Box.js +33 -3
  6. package/components/Button.js +146 -9
  7. package/components/Card.js +111 -3
  8. package/components/Checkbox.js +91 -3
  9. package/components/CheckboxIcon.js +92 -4
  10. package/components/Chip.js +38 -2
  11. package/components/Dialog.js +237 -3
  12. package/components/DialogActions.js +3 -2
  13. package/components/Divider.js +44 -3
  14. package/components/ExtendedFab.js +27 -2
  15. package/components/Fab.js +26 -2
  16. package/components/FilterChip.js +83 -2
  17. package/components/Headline.js +16 -2
  18. package/components/Icon.js +80 -4
  19. package/components/IconButton.js +153 -2
  20. package/components/Label.js +16 -2
  21. package/components/Layout.js +21 -3
  22. package/components/List.js +15 -2
  23. package/components/ListItem.js +229 -3
  24. package/components/ListOption.js +37 -3
  25. package/components/ListSelect.js +12 -2
  26. package/components/Menu.js +173 -3
  27. package/components/MenuItem.js +55 -2
  28. package/components/Nav.js +19 -2
  29. package/components/NavBar.js +37 -2
  30. package/components/NavBarItem.js +44 -2
  31. package/components/NavDrawer.js +34 -2
  32. package/components/NavDrawerItem.js +44 -2
  33. package/components/NavItem.js +183 -3
  34. package/components/NavRail.js +50 -2
  35. package/components/NavRailItem.js +25 -2
  36. package/components/Pane.js +263 -3
  37. package/components/Progress.js +469 -10
  38. package/components/Radio.js +97 -3
  39. package/components/RadioIcon.js +77 -5
  40. package/components/Ripple.js +76 -3
  41. package/components/SegmentedButton.js +97 -2
  42. package/components/SegmentedButtonGroup.js +15 -2
  43. package/components/Select.js +54 -2
  44. package/components/Shape.js +55 -18
  45. package/components/Slider.js +309 -3
  46. package/components/Snackbar.js +82 -2
  47. package/components/Surface.js +13 -4
  48. package/components/Switch.js +67 -4
  49. package/components/SwitchIcon.js +272 -5
  50. package/components/Tab.js +87 -3
  51. package/components/TabContent.js +21 -21
  52. package/components/TabList.js +131 -2
  53. package/components/TextArea.js +97 -3
  54. package/components/Title.js +16 -2
  55. package/components/Tooltip.js +42 -2
  56. package/components/TopAppBar.js +212 -3
  57. package/core/template.js +36 -9
  58. package/mixins/ControlMixin.js +65 -2
  59. package/mixins/DensityMixin.js +17 -3
  60. package/mixins/FlexableMixin.js +81 -3
  61. package/mixins/RippleMixin.js +15 -4
  62. package/mixins/ShapeMixin.js +279 -8
  63. package/mixins/StateMixin.js +87 -5
  64. package/mixins/SurfaceMixin.js +152 -3
  65. package/mixins/TextFieldMixin.js +661 -3
  66. package/mixins/ThemableMixin.js +206 -3
  67. package/mixins/TooltipTriggerMixin.js +30 -4
  68. package/mixins/TouchTargetMixin.js +29 -4
  69. package/package.json +2 -1
  70. package/theming/loader.js +0 -2
  71. package/components/Badge.css +0 -38
  72. package/components/Body.css +0 -14
  73. package/components/BottomAppBar.css +0 -23
  74. package/components/Box.css +0 -31
  75. package/components/Button.css +0 -147
  76. package/components/Card.css +0 -109
  77. package/components/Checkbox.css +0 -89
  78. package/components/CheckboxIcon.css +0 -90
  79. package/components/Chip.css +0 -35
  80. package/components/Dialog.css +0 -235
  81. package/components/Divider.css +0 -41
  82. package/components/ExtendedFab.css +0 -24
  83. package/components/Fab.css +0 -23
  84. package/components/FilterChip.css +0 -80
  85. package/components/Headline.css +0 -14
  86. package/components/Icon.css +0 -76
  87. package/components/IconButton.css +0 -150
  88. package/components/Label.css +0 -14
  89. package/components/Layout.css +0 -19
  90. package/components/List.css +0 -12
  91. package/components/ListItem.css +0 -224
  92. package/components/ListOption.css +0 -34
  93. package/components/ListSelect.css +0 -9
  94. package/components/Menu.css +0 -171
  95. package/components/MenuItem.css +0 -53
  96. package/components/Nav.css +0 -17
  97. package/components/NavBar.css +0 -34
  98. package/components/NavBarItem.css +0 -41
  99. package/components/NavDrawer.css +0 -31
  100. package/components/NavDrawerItem.css +0 -42
  101. package/components/NavItem.css +0 -181
  102. package/components/NavRail.css +0 -47
  103. package/components/NavRailItem.css +0 -25
  104. package/components/Outline.css +0 -138
  105. package/components/Pane.css +0 -261
  106. package/components/Progress.css +0 -75
  107. package/components/ProgressCircle.css +0 -226
  108. package/components/ProgressLine.css +0 -155
  109. package/components/Radio.css +0 -95
  110. package/components/RadioIcon.css +0 -73
  111. package/components/Ripple.css +0 -74
  112. package/components/SegmentedButton.css +0 -94
  113. package/components/SegmentedButtonGroup.css +0 -12
  114. package/components/Select.css +0 -52
  115. package/components/Shape.css +0 -132
  116. package/components/Slider.css +0 -307
  117. package/components/Snackbar.css +0 -80
  118. package/components/Surface.css +0 -10
  119. package/components/Switch.css +0 -64
  120. package/components/SwitchIcon.css +0 -178
  121. package/components/SwitchIconAnimations.css +0 -89
  122. package/components/Tab.css +0 -85
  123. package/components/TabList.css +0 -129
  124. package/components/TextArea.css +0 -93
  125. package/components/Title.css +0 -14
  126. package/components/Tooltip.css +0 -40
  127. package/components/TopAppBar.css +0 -209
  128. package/mixins/ControlMixin.css +0 -57
  129. package/mixins/DensityMixin.css +0 -40
  130. package/mixins/FlexableMixin.css +0 -79
  131. package/mixins/RippleMixin.css +0 -12
  132. package/mixins/ShapeMixin.css +0 -135
  133. package/mixins/StateMixin.css +0 -82
  134. package/mixins/SurfaceMixin.css +0 -150
  135. package/mixins/TextFieldMixin.css +0 -657
  136. package/mixins/ThemableMixin.css +0 -204
  137. package/mixins/TooltipTriggerMixin.css +0 -27
  138. package/mixins/TouchTargetMixin.css +0 -26
@@ -1,11 +1,8 @@
1
1
  import CustomElement from '../core/CustomElement.js';
2
2
  import { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';
3
3
 
4
- import styles from './Ripple.css' assert { type: 'css' };
5
-
6
4
  export default CustomElement
7
5
  .extend()
8
- .css(styles)
9
6
  .set({
10
7
  hadRippleHeld: false,
11
8
  hadRippleReleased: false,
@@ -111,4 +108,80 @@ export default CustomElement
111
108
  }
112
109
  },
113
110
  })
111
+ .css`
112
+ :host {
113
+ --enter-delay: 80ms;
114
+ --touch-down-acceleration: 1024;
115
+ --touch-up-acceleration: 3400;
116
+ --mdw-ripple-expand-duration: 300ms;
117
+ --mdw-ripple-simple-duration: 200ms;
118
+ --mdw-ripple-fade-out-duration: 333ms;
119
+ --mdw-ripple-standard-easing: var(--mdw-motion-standard-easing, cubic-bezier(0.4, 0.0, 0.2, 1));
120
+ --mdw-ripple-deceleration-easing: var(--mdw-motion-deceleration-easing, cubic-bezier(0.0, 0.0, 0.2, 1));
121
+
122
+ --size: 0;
123
+ position: absolute;
124
+ /* stylelint-disable-next-line liberty/use-logical-spec */
125
+ top: 50%;
126
+ /* stylelint-disable-next-line liberty/use-logical-spec */
127
+ left: 50%;
128
+
129
+ display: block;
130
+
131
+ min-block-size: 141.42%; /* √2 * 100% */
132
+ min-inline-size: 141.42%;
133
+
134
+ pointer-events: none;
135
+
136
+ -webkit-tap-highlight-color: transparent;
137
+
138
+ opacity: 0.12;
139
+ transform: translateX(-50%) translateY(-50%) scale(1);
140
+
141
+ background-color: currentColor;
142
+ border-radius: 50%;
143
+
144
+ /* Adds feathered appearance to ripple */
145
+ box-shadow: 0 0 calc(0.10 * var(--size)) calc(0.10 * var(--size)) currentColor;
146
+
147
+ transition-delay: 0s;
148
+ transition-duration: var(--mdw-ripple-simple-duration);
149
+ transition-property: background-color, color;
150
+ transition-timing-function: var(--mdw-ripple-standard-easing);
151
+
152
+ animation-name: ripple-fade-in, none;
153
+ animation-duration: var(--mdw-ripple-expand-duration), var(--mdw-ripple-fade-out-duration);
154
+ animation-timing-function: linear, var(--mdw-ripple-deceleration-easing);
155
+ animation-direction: normal;
156
+ animation-fill-mode: forwards;
157
+ /* stylelint-disable-next-line liberty/use-logical-spec */
158
+ will-change: transform, opacity, top, left, box-shadow;
159
+
160
+ aspect-ratio: 1/1;
161
+ }
162
+
163
+ :host([ripple-state="filled"]) {
164
+ animation-name: none, ripple-fade-out;
165
+ }
166
+
167
+ :host([ripple-state="filled"][hold-ripple]) {
168
+ animation-name: ripple-fade-in, none;
169
+ }
170
+
171
+ :host([ripple-state="complete"]) {
172
+ animation-name: none, ripple-fade-out;
173
+ animation-duration: 0s;
174
+ }
175
+
176
+ @keyframes ripple-fade-in {
177
+ from {
178
+ transform: translateX(-50%) translateY(-50%) scale(0);
179
+ }
180
+ }
181
+
182
+ @keyframes ripple-fade-out {
183
+
184
+ to { opacity: 0; }
185
+ }
186
+ `
114
187
  .autoRegister('mdw-ripple');
@@ -1,7 +1,6 @@
1
1
  import './Icon.js';
2
2
 
3
3
  import Button from './Button.js';
4
- import styles from './SegmentedButton.css' assert { type: 'css' };
5
4
 
6
5
  export default Button
7
6
  .extend()
@@ -12,7 +11,6 @@ export default Button
12
11
  .set({
13
12
  focusableOnDisabled: true,
14
13
  })
15
- .css(styles)
16
14
  .on({
17
15
  composed({ html, inline }) {
18
16
  const { shape, icon, outline, control, slot, state } = this.refs;
@@ -46,4 +44,101 @@ export default Button
46
44
  this.outlined = true;
47
45
  },
48
46
  })
47
+ .css`
48
+ /* https://m3.material.io/components/segmented-buttons/specs */
49
+
50
+ :host {
51
+ --mdw-shape__size: var(--mdw-shape__full);
52
+ --mdw-ink: var(--mdw-color__on-surface);
53
+ gap: 8px;
54
+
55
+ min-inline-size: 24px;
56
+ padding-inline-start: max(12px, calc(16px + (var(--mdw-density) * 2px)));
57
+ padding-inline-end: max(20px, calc(24px + (var(--mdw-density) * 2px)));
58
+
59
+ color: rgb(var(--mdw-ink));
60
+ }
61
+
62
+ :host([inner-segmented-button]) {
63
+ --mdw-shape__size: 0px;
64
+ --mdw-shape__rounded: 1;
65
+ --mdw-shape__mask-border-source: none;
66
+ }
67
+
68
+ #outline {
69
+ inset-inline-end: -1px;
70
+ }
71
+
72
+ #outline[shape-end] {
73
+ inset-inline-end: 0;
74
+ }
75
+
76
+ #shape[selected] {
77
+ background-color: rgb(var(--mdw-bg));
78
+ }
79
+
80
+ #label[selected] {
81
+ color: rgb(var(--mdw-ink));
82
+ }
83
+
84
+ #icons {
85
+ position: relative;
86
+
87
+ display: inline-flex;
88
+ }
89
+
90
+ #icon {
91
+ box-sizing: border-box;
92
+ inline-size: 0;
93
+
94
+ opacity: 1;
95
+ }
96
+
97
+ #icon[has-icon] {
98
+ inline-size: 18px;
99
+
100
+ opacity: 1;
101
+ }
102
+
103
+ #icon[selected] {
104
+ inline-size: 18px;
105
+
106
+ opacity: 0;
107
+ }
108
+
109
+ #check-icon {
110
+ position: absolute;
111
+ inset: 0;
112
+
113
+ display: block;
114
+
115
+ overflow: visible;
116
+
117
+ margin: 0;
118
+
119
+ opacity: 0;
120
+
121
+ font-size: 18px;
122
+ font-variation-settings: 'FILL' 1;
123
+ }
124
+
125
+ #check-icon[selected] {
126
+ opacity: 1;
127
+
128
+ font-size: 18px;
129
+ }
130
+
131
+ #icon[disabled] {
132
+ color: rgba(var(--mdw-color__on-surface), 0.38);
133
+ }
134
+
135
+ #shape[disabled][selected] {
136
+ background-color: rgba(var(--mdw-color__on-surface), 0.12);
137
+ }
138
+
139
+ #label[disabled][selected] {
140
+ color: rgba(var(--mdw-color__on-surface), 0.38);
141
+ }
142
+
143
+ `
49
144
  .autoRegister('mdw-segmented-button');
@@ -3,7 +3,6 @@ import KeyboardNav from '../mixins/KeyboardNavMixin.js';
3
3
 
4
4
  import Box from './Box.js';
5
5
  import SegmentedButton from './SegmentedButton.js';
6
- import styles from './SegmentedButtonGroup.css' assert { type: 'css' };
7
6
 
8
7
  /** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */
9
8
 
@@ -35,7 +34,21 @@ export default Box
35
34
  },
36
35
  },
37
36
  })
38
- .css(styles)
37
+ .css`
38
+ /* https://m3.material.io/components/segmented-buttons/specs */
39
+
40
+ :host {
41
+ --mdw-bg: var(--mdw-color__secondary-container);
42
+ --mdw-ink: var(--mdw-color__on-secondary-container);
43
+
44
+ display: inline-flex;
45
+ }
46
+
47
+ :host([color]) {
48
+ background-color: transparent;
49
+ }
50
+
51
+ `
39
52
  .on({
40
53
  constructed() {
41
54
  this.setAttribute('aria-orientation', 'horizontal');
@@ -4,7 +4,6 @@ import StateMixin from '../mixins/StateMixin.js';
4
4
  import TextFieldMixin from '../mixins/TextFieldMixin.js';
5
5
  import ThemableMixin from '../mixins/ThemableMixin.js';
6
6
 
7
- import styles from './Select.css' assert { type: 'css' };
8
7
 
9
8
  /* @implements {HTMLSelectElement} */
10
9
 
@@ -14,7 +13,6 @@ export default class Select extends CustomElement
14
13
  .mixin(ControlMixin)
15
14
  .mixin(TextFieldMixin)
16
15
  .extend()
17
- .css(styles)
18
16
  .observe({
19
17
  autocomplete: 'string',
20
18
  trailingIcon: {
@@ -53,6 +51,60 @@ export default class Select extends CustomElement
53
51
  suffix.remove();
54
52
  },
55
53
  })
54
+ .css`
55
+ #slot {
56
+ display: none;
57
+ }
58
+
59
+ #label {
60
+ padding: 0;
61
+
62
+ cursor: pointer;
63
+ }
64
+
65
+ #label[disabled] {
66
+ cursor: not-allowed;
67
+ }
68
+
69
+ #icon {
70
+ position: absolute;
71
+
72
+ /* padding-inline-start: 12px; */
73
+ }
74
+
75
+ #trailing-icon {
76
+ position: absolute;
77
+ inset-inline-end: 16px;
78
+ }
79
+
80
+ #control {
81
+ padding-inline-start: 16px;
82
+ padding-inline-end: calc(16px + 24px + 16px);
83
+ accent-color: rgb(var(--mdw-ink));
84
+
85
+ cursor: inherit;
86
+ }
87
+
88
+ #control[icon] {
89
+ margin-inline-start: calc(16px + 24px);
90
+ padding-inline-start: 0;
91
+ }
92
+
93
+ option {
94
+ accent-color: rgb(var(--mdw-ink));
95
+
96
+ min-block-size: var(--mdw-typescale__label-large__line-height);
97
+
98
+ appearance: none;
99
+
100
+ background-color: rgb(var(--mdw-color__surface)) !important;
101
+ border-radius: 0;
102
+ color: rgb(var(--mdw-color__on-surface)) !important;
103
+
104
+ font: var(--mdw-typescale__label-large__font);
105
+ letter-spacing: var(--mdw-typescale__label-large__letter-spacing);
106
+ }
107
+ `
56
108
  .setStatic({
57
109
  controlTagName: 'select',
58
110
  controlVoidElement: false,
@@ -1,25 +1,62 @@
1
+ import ShapeMixin from '../mixins/ShapeMixin.js';
2
+
1
3
  import Box from './Box.js';
2
- import outlineStyles from './Outline.css' assert { type: 'css' };
3
- import styles from './Shape.css' assert { type: 'css' };
4
4
 
5
5
  export default Box
6
+ .mixin(ShapeMixin)
6
7
  .extend()
7
- .observe({
8
- shapeTop: 'boolean',
9
- shapeBottom: 'boolean',
10
- shapeStart: 'boolean',
11
- shapeEnd: 'boolean',
12
- shapeStyle: 'string',
13
- outlined: 'boolean',
8
+ .on({
9
+ composed() {
10
+ const { shape, outline } = this.refs;
11
+ shape.before(outline);
12
+ shape.remove();
13
+ },
14
14
  })
15
- .css(
16
- outlineStyles,
17
- styles,
18
- )
19
- .html/* html */`
20
- <div id=outline _if={outlined} class=outline disabled={disabledState} focused={focusedState} pressed={pressedState} hovered={hoveredState}>
21
- <div id=outline-left class="outline-section outline-left"></div>
22
- <div id=outline-right class="outline-section outline-right"></div>
23
- </div>
15
+ .css`
16
+ :host {
17
+ position: relative;
18
+
19
+ overflow: hidden;
20
+
21
+ z-index: auto;
22
+
23
+ background-color: var(--mdw-shape__bg, transparent);
24
+
25
+ border-start-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-start-size));
26
+ border-start-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-end-size));
27
+ border-end-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-start-size));
28
+ border-end-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-end-size));
29
+
30
+ transition-delay: 1ms;
31
+ transition-duration: 200ms;
32
+ transition-property: background-color, color;
33
+ will-change: background-color, color;
34
+
35
+ }
36
+
37
+ :host([color]) {
38
+ background-color: rgb(var(--mdw-bg));
39
+ }
40
+
41
+ :host(:where([ink],[color])) {
42
+ color: rgb(var(--mdw-ink));
43
+ }
44
+
45
+ :host([outlined]) {
46
+ background-color: transparent;
47
+ }
48
+
49
+ :host(:is([color="none"], [color="transparent"])) {
50
+ background-color: transparent;
51
+ }
52
+
53
+
54
+ @supports(-webkit-mask-box-image: none) {
55
+ :host {
56
+ transition-duration: 200ms, 200ms, 200ms;
57
+ transition-property: background-color, color, -webkit-mask-box-image-width;
58
+ will-change: background-color, color, -webkit-mask-box-image;
59
+ }
60
+ }
24
61
  `
25
62
  .autoRegister('mdw-shape');