@react-md/core 1.0.0-next.5 → 1.0.0-next.7

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 (75) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/.turbo/turbo-lint.log +12 -0
  3. package/CHANGELOG.md +12 -0
  4. package/dist/_core.scss +157 -240
  5. package/dist/_utils.scss +10 -0
  6. package/dist/app-bar/_app-bar.scss +95 -93
  7. package/dist/avatar/_avatar.scss +49 -47
  8. package/dist/badge/_badge.scss +19 -17
  9. package/dist/box/_box.scss +57 -55
  10. package/dist/button/_button.scss +122 -120
  11. package/dist/card/_card.scss +72 -70
  12. package/dist/chip/_chip.scss +105 -103
  13. package/dist/dialog/_dialog.scss +128 -126
  14. package/dist/divider/_divider.scss +24 -22
  15. package/dist/draggable/_draggable.scss +16 -12
  16. package/dist/expansion-panel/_expansion-panel.scss +69 -52
  17. package/dist/form/Form.d.ts +1 -1
  18. package/dist/form/Form.js +2 -1
  19. package/dist/form/Form.js.map +1 -1
  20. package/dist/form/_form.scss +1175 -1128
  21. package/dist/icon/_icon.scss +64 -62
  22. package/dist/interaction/_interaction.scss +39 -35
  23. package/dist/layout/_layout.scss +68 -67
  24. package/dist/link/_link.scss +52 -50
  25. package/dist/list/_list.scss +124 -122
  26. package/dist/menu/_menu.scss +9 -7
  27. package/dist/overlay/_overlay.scss +25 -23
  28. package/dist/progress/_progress.scss +11 -6
  29. package/dist/responsive-item/_responsive-item.scss +91 -89
  30. package/dist/segmented-button/_segmented-button.scss +54 -49
  31. package/dist/sheet/_sheet.scss +84 -82
  32. package/dist/snackbar/_snackbar.scss +128 -123
  33. package/dist/table/_table.scss +159 -157
  34. package/dist/tabs/_tabs.scss +10 -8
  35. package/dist/tooltip/_tooltip.scss +60 -58
  36. package/dist/transition/_transition.scss +44 -39
  37. package/dist/tree/_tree.scss +83 -81
  38. package/dist/typography/_typography.scss +58 -49
  39. package/dist/window-splitter/_window-splitter.scss +72 -70
  40. package/package.json +1 -1
  41. package/src/_core.scss +157 -240
  42. package/src/_utils.scss +10 -0
  43. package/src/app-bar/_app-bar.scss +95 -93
  44. package/src/avatar/_avatar.scss +49 -47
  45. package/src/badge/_badge.scss +19 -17
  46. package/src/box/_box.scss +57 -55
  47. package/src/button/_button.scss +122 -120
  48. package/src/card/_card.scss +72 -70
  49. package/src/chip/_chip.scss +105 -103
  50. package/src/dialog/_dialog.scss +128 -126
  51. package/src/divider/_divider.scss +24 -22
  52. package/src/draggable/_draggable.scss +16 -12
  53. package/src/expansion-panel/_expansion-panel.scss +69 -52
  54. package/src/form/Form.tsx +2 -1
  55. package/src/form/_form.scss +1175 -1128
  56. package/src/icon/_icon.scss +64 -62
  57. package/src/interaction/_interaction.scss +39 -35
  58. package/src/layout/_layout.scss +68 -67
  59. package/src/link/_link.scss +52 -50
  60. package/src/list/_list.scss +124 -122
  61. package/src/menu/_menu.scss +9 -7
  62. package/src/overlay/_overlay.scss +25 -23
  63. package/src/progress/_progress.scss +11 -6
  64. package/src/responsive-item/_responsive-item.scss +91 -89
  65. package/src/segmented-button/_segmented-button.scss +54 -49
  66. package/src/sheet/_sheet.scss +84 -82
  67. package/src/snackbar/_snackbar.scss +128 -123
  68. package/src/table/_table.scss +159 -157
  69. package/src/tabs/_tabs.scss +10 -8
  70. package/src/tooltip/_tooltip.scss +60 -58
  71. package/src/transition/_transition.scss +44 -39
  72. package/src/tree/_tree.scss +83 -81
  73. package/src/typography/_typography.scss +58 -49
  74. package/src/window-splitter/_window-splitter.scss +72 -70
  75. package/tsconfig.json +2 -2
@@ -93,61 +93,63 @@ $variables: (
93
93
  }
94
94
  }
95
95
 
96
- @mixin styles {
96
+ @mixin styles($disable-layer: false) {
97
97
  @if not $disable-everything {
98
- .rmd-avatar {
99
- @if not $disable-icon {
100
- @include icon.set-var(color, currentcolor);
101
- }
102
- @include utils.map-to-styles(typography.$base-font-styles);
103
- @include use-var(background-color);
104
- @include use-var(border-radius);
105
- @include use-var(color);
106
- @include use-var(font-size);
107
- @include use-var(height, size);
108
- @include use-var(width, size);
109
-
110
- align-items: center;
111
- border: 1px solid get-var(border-color);
112
- display: inline-flex;
113
- flex-shrink: 0;
114
- justify-content: center;
115
- line-height: $line-height;
116
- overflow: hidden;
117
-
118
- @if not $disable-icon-size {
119
- &--icon {
120
- @include set-var(size, $icon-sized-size);
121
-
122
- font-size: $icon-sized-font-size;
98
+ @include utils.optional-layer(avatar, $disable-layer) {
99
+ .rmd-avatar {
100
+ @if not $disable-icon {
101
+ @include icon.set-var(color, currentcolor);
123
102
  }
124
- }
125
-
126
- @if not $disable-image {
127
- &__image {
128
- height: 100%;
129
- width: auto;
103
+ @include utils.map-to-styles(typography.$base-font-styles);
104
+ @include use-var(background-color);
105
+ @include use-var(border-radius);
106
+ @include use-var(color);
107
+ @include use-var(font-size);
108
+ @include use-var(height, size);
109
+ @include use-var(width, size);
110
+
111
+ align-items: center;
112
+ border: 1px solid get-var(border-color);
113
+ display: inline-flex;
114
+ flex-shrink: 0;
115
+ justify-content: center;
116
+ line-height: $line-height;
117
+ overflow: hidden;
118
+
119
+ @if not $disable-icon-size {
120
+ &--icon {
121
+ @include set-var(size, $icon-sized-size);
122
+
123
+ font-size: $icon-sized-font-size;
124
+ }
130
125
  }
131
- }
132
126
 
133
- @if not $disable-auto-image {
134
- img {
135
- height: 100%;
136
- width: auto;
127
+ @if not $disable-image {
128
+ &__image {
129
+ height: 100%;
130
+ width: auto;
131
+ }
137
132
  }
138
- }
139
133
 
140
- @each $name, $values in $colors {
141
- @if length($values) != 2 {
142
- @error 'Unable to create an avatar color because the list of values is not of length 2. The first value should be the background-color and the second should be the text color. "#{$values}"';
134
+ @if not $disable-auto-image {
135
+ img {
136
+ height: 100%;
137
+ width: auto;
138
+ }
143
139
  }
144
140
 
145
- @include custom-color(
146
- "&--#{$name}",
147
- nth($values, 2),
148
- nth($values, 1),
149
- true
150
- );
141
+ @each $name, $values in $colors {
142
+ @if length($values) != 2 {
143
+ @error 'Unable to create an avatar color because the list of values is not of length 2. The first value should be the background-color and the second should be the text color. "#{$values}"';
144
+ }
145
+
146
+ @include custom-color(
147
+ "&--#{$name}",
148
+ nth($values, 2),
149
+ nth($values, 1),
150
+ true
151
+ );
152
+ }
151
153
  }
152
154
  }
153
155
  }
@@ -112,26 +112,28 @@ $variables: (
112
112
  }
113
113
  }
114
114
 
115
- @mixin styles {
115
+ @mixin styles($disable-layer: false) {
116
116
  @if not $disable-everything {
117
- .rmd-badge {
118
- @include utils.map-to-styles($typography);
119
- @include use-var(height, size);
120
- @include use-var(width, size);
121
- @include utils.auto-rtl(right, get-var(offset-right, get-var(offset)));
122
- @include use-var(top, offset-top, get-var(offset));
117
+ @include utils.optional-layer(badge, $disable-layer) {
118
+ .rmd-badge {
119
+ @include utils.map-to-styles($typography);
120
+ @include use-var(height, size);
121
+ @include use-var(width, size);
122
+ @include utils.auto-rtl(right, get-var(offset-right, get-var(offset)));
123
+ @include use-var(top, offset-top, get-var(offset));
123
124
 
124
- align-items: center;
125
- border-radius: $border-radius;
126
- display: inline-flex;
127
- justify-content: center;
128
- pointer-events: none; // badges are _kind_ of presentational and shouldn't trigger mouse events
129
- position: absolute;
125
+ align-items: center;
126
+ border-radius: $border-radius;
127
+ display: inline-flex;
128
+ justify-content: center;
129
+ pointer-events: none; // badges are _kind_ of presentational and shouldn't trigger mouse events
130
+ position: absolute;
130
131
 
131
- @if not $disable-greyscale-theme {
132
- &--greyscale {
133
- @include use-var(background-color, greyscale-background-color);
134
- @include use-var(color, greyscale-color);
132
+ @if not $disable-greyscale-theme {
133
+ &--greyscale {
134
+ @include use-var(background-color, greyscale-background-color);
135
+ @include use-var(color, greyscale-color);
136
+ }
135
137
  }
136
138
  }
137
139
  }
package/src/box/_box.scss CHANGED
@@ -83,82 +83,84 @@ $variables: (gap, padding, item-min-size, columns);
83
83
  }
84
84
  }
85
85
 
86
- @mixin styles {
86
+ @mixin styles($disable-layer: false) {
87
87
  @if not $disable-everything {
88
- .rmd-box {
89
- @include use-var(gap, gap);
88
+ @include utils.optional-layer(box, $disable-layer) {
89
+ .rmd-box {
90
+ @include use-var(gap, gap);
90
91
 
91
- align-items: $default-align-items;
92
- display: flex;
92
+ align-items: $default-align-items;
93
+ display: flex;
93
94
 
94
- &--padded {
95
- @include use-var(padding);
96
- }
97
-
98
- &--wrap {
99
- flex-wrap: wrap;
100
- }
101
-
102
- &--full-width {
103
- width: 100%;
104
- }
95
+ &--padded {
96
+ @include use-var(padding);
97
+ }
105
98
 
106
- @if not $disable-stacked {
107
- &--column {
108
- flex-direction: column;
99
+ &--wrap {
100
+ flex-wrap: wrap;
109
101
  }
110
- }
111
102
 
112
- @if not $disable-reversed {
113
- &--reverse {
114
- flex-direction: row-reverse;
103
+ &--full-width {
104
+ width: 100%;
115
105
  }
116
106
 
117
107
  @if not $disable-stacked {
118
- &--column-reverse {
119
- flex-direction: column-reverse;
108
+ &--column {
109
+ flex-direction: column;
120
110
  }
121
111
  }
122
- }
123
112
 
124
- @each $value in $align-items {
125
- &--align-#{$value} {
126
- align-items: $value;
127
- }
128
- }
113
+ @if not $disable-reversed {
114
+ &--reverse {
115
+ flex-direction: row-reverse;
116
+ }
129
117
 
130
- @each $value in $justify-content {
131
- &--justify-#{utils.str-replace($value, "space-", "")} {
132
- justify-content: $value;
118
+ @if not $disable-stacked {
119
+ &--column-reverse {
120
+ flex-direction: column-reverse;
121
+ }
122
+ }
133
123
  }
134
- }
135
124
 
136
- @if not $disable-grid {
137
- &--grid {
138
- display: grid;
139
- grid-template-columns: repeat(
140
- get-var(columns),
141
- minmax(get-var(item-min-size), 1fr)
142
- );
125
+ @each $value in $align-items {
126
+ &--align-#{$value} {
127
+ align-items: $value;
128
+ }
143
129
  }
144
130
 
145
- &--grid-fill {
146
- @include set-var(columns, auto-fill);
131
+ @each $value in $justify-content {
132
+ &--justify-#{utils.str-replace($value, "space-", "")} {
133
+ justify-content: $value;
134
+ }
147
135
  }
148
136
 
149
- @if not $disable-grid-columns {
150
- &--grid-columns {
151
- @include set-var(item-min-size, 0);
137
+ @if not $disable-grid {
138
+ &--grid {
139
+ display: grid;
140
+ grid-template-columns: repeat(
141
+ get-var(columns),
142
+ minmax(get-var(item-min-size), 1fr)
143
+ );
152
144
  }
153
- }
154
145
 
155
- @each $name, $values in $grids {
156
- @include custom-grid-class(
157
- "&--#{$name}",
158
- $min: map.get($values, min),
159
- $gap: map.get($values, gap),
160
- $padding: map.get($values, padding)
161
- );
146
+ &--grid-fill {
147
+ @include set-var(columns, auto-fill);
148
+ }
149
+
150
+ @if not $disable-grid-columns {
151
+ &--grid-columns {
152
+ @include set-var(item-min-size, 0);
153
+ }
154
+ }
155
+
156
+ @each $name, $values in $grids {
157
+ @include custom-grid-class(
158
+ "&--#{$name}",
159
+ $min: map.get($values, min),
160
+ $gap: map.get($values, gap),
161
+ $padding: map.get($values, padding)
162
+ );
163
+ }
162
164
  }
163
165
  }
164
166
  }
@@ -164,160 +164,162 @@ $variables: (
164
164
  }
165
165
  }
166
166
 
167
- @mixin styles {
167
+ @mixin styles($disable-layer: false) {
168
168
  @if not $disable-everything {
169
- .rmd-button {
170
- @if not $disable-circular-progress {
171
- @include progress.set-var(circular-size, $circular-progress-size);
172
- }
169
+ @include utils.optional-layer(button, $disable-layer) {
170
+ .rmd-button {
171
+ @if not $disable-circular-progress {
172
+ @include progress.set-var(circular-size, $circular-progress-size);
173
+ }
173
174
 
174
- @include icon.set-var(color, currentcolor);
175
- @include icon.use-var(gap, spacing);
176
- @include use-var(background-color);
177
- @include use-var(color);
178
- @include use-var(border-radius);
179
-
180
- align-items: center;
181
- border-width: 0;
182
- display: inline-flex;
183
- flex-shrink: 0;
184
- justify-content: center;
185
-
186
- @if not $disable-text {
187
- &--text {
188
- @include text-styles;
175
+ @include icon.set-var(color, currentcolor);
176
+ @include icon.use-var(gap, spacing);
177
+ @include use-var(background-color);
178
+ @include use-var(color);
179
+ @include use-var(border-radius);
180
+
181
+ align-items: center;
182
+ border-width: 0;
183
+ display: inline-flex;
184
+ flex-shrink: 0;
185
+ justify-content: center;
186
+
187
+ @if not $disable-text {
188
+ &--text {
189
+ @include text-styles;
190
+ }
189
191
  }
190
- }
191
192
 
192
- @if not $disable-icon {
193
- &--icon {
194
- @include icon.set-var(size, 1em);
195
- @include set-var(border-radius, get-var(icon-border-radius));
196
- @include use-var(font-size, icon-font-size);
197
- @include use-var(height, icon-size);
198
- @include use-var(width, icon-size);
193
+ @if not $disable-icon {
194
+ &--icon {
195
+ @include icon.set-var(size, 1em);
196
+ @include set-var(border-radius, get-var(icon-border-radius));
197
+ @include use-var(font-size, icon-font-size);
198
+ @include use-var(height, icon-size);
199
+ @include use-var(width, icon-size);
199
200
 
200
- padding: $icon-padding;
201
- }
201
+ padding: $icon-padding;
202
+ }
202
203
 
203
- @if not $disable-icon-square {
204
- &--icon-square {
205
- @include set-var(icon-border-radius, $icon-square-border-radius);
204
+ @if not $disable-icon-square {
205
+ &--icon-square {
206
+ @include set-var(icon-border-radius, $icon-square-border-radius);
207
+ }
206
208
  }
207
- }
208
209
 
209
- @if $icon-small-size {
210
- &--small {
211
- font-size: $icon-small-size;
210
+ @if $icon-small-size {
211
+ &--small {
212
+ font-size: $icon-small-size;
213
+ }
212
214
  }
213
- }
214
215
 
215
- @if $icon-large-size {
216
- &--large {
217
- font-size: $icon-large-size;
216
+ @if $icon-large-size {
217
+ &--large {
218
+ font-size: $icon-large-size;
219
+ }
218
220
  }
219
221
  }
220
- }
221
222
 
222
- &--responsive {
223
- @include media-queries.tablet-media {
224
- @include text-styles;
223
+ &--responsive {
224
+ @include media-queries.tablet-media {
225
+ @include text-styles;
225
226
 
226
- height: auto;
227
- width: auto;
227
+ height: auto;
228
+ width: auto;
229
+ }
228
230
  }
229
- }
230
231
 
231
- &:disabled,
232
- &--disabled {
233
- @include theme.theme-set-var(outline-color, currentcolor);
234
- // this was added for the file input
235
- @include interaction.surface-disabled($clickable: false);
236
- }
232
+ &:disabled,
233
+ &--disabled {
234
+ @include theme.theme-set-var(outline-color, currentcolor);
235
+ // this was added for the file input
236
+ @include interaction.surface-disabled($clickable: false);
237
+ }
237
238
 
238
- @if not $disable-contained {
239
- &--contained {
240
- @include box-shadows.elevation-transition(
241
- $contained-elevation,
242
- if(
243
- $disable-contained-pressed-elevation,
244
- null,
245
- $contained-pressed-elevation
246
- ),
247
- "&.rmd-button--pressed",
248
- $pseudo-before: false,
249
- $position-relative: false
250
- );
251
-
252
- // contained buttons should _normally_ always force dark background
253
- // colors for the interaction states This means use the default light
254
- // theme since it is based off of the root background color
255
- @if not $disable-contained-interaction-colors {
256
- @include interaction.use-light-surface;
257
- }
239
+ @if not $disable-contained {
240
+ &--contained {
241
+ @include box-shadows.elevation-transition(
242
+ $contained-elevation,
243
+ if(
244
+ $disable-contained-pressed-elevation,
245
+ null,
246
+ $contained-pressed-elevation
247
+ ),
248
+ "&.rmd-button--pressed",
249
+ $pseudo-before: false,
250
+ $position-relative: false
251
+ );
252
+
253
+ // contained buttons should _normally_ always force dark background
254
+ // colors for the interaction states This means use the default light
255
+ // theme since it is based off of the root background color
256
+ @if not $disable-contained-interaction-colors {
257
+ @include interaction.use-light-surface;
258
+ }
258
259
 
259
- @include set-var(
260
- background-color,
261
- get-var(contained-background-color)
262
- );
263
- @include set-var(color, get-var(contained-color));
260
+ @include set-var(
261
+ background-color,
262
+ get-var(contained-background-color)
263
+ );
264
+ @include set-var(color, get-var(contained-color));
265
+ }
264
266
  }
265
- }
266
267
 
267
- @if not $disable-async {
268
- &--async {
269
- @include overlay.set-var(background-color, transparent);
270
- @include progress.set-var(color, currentcolor);
271
- // @include progress.set-var(background-color, currentcolor);
272
- }
268
+ @if not $disable-async {
269
+ &--async {
270
+ @include overlay.set-var(background-color, transparent);
271
+ @include progress.set-var(color, currentcolor);
272
+ // @include progress.set-var(background-color, currentcolor);
273
+ }
273
274
 
274
- &--async-overlay {
275
- > * {
276
- opacity: 0;
275
+ &--async-overlay {
276
+ > * {
277
+ opacity: 0;
278
+ }
277
279
  }
278
280
  }
279
281
  }
280
- }
281
282
 
282
- @if not $disable-unstyled-utility-class {
283
- .rmd-button-unstyled {
284
- @include unstyled;
283
+ @if not $disable-unstyled-utility-class {
284
+ .rmd-button-unstyled {
285
+ @include unstyled;
286
+ }
285
287
  }
286
- }
287
288
 
288
- @if not $disable-floating {
289
- .rmd-fab {
290
- position: fixed;
291
- z-index: $floating-z-index;
289
+ @if not $disable-floating {
290
+ .rmd-fab {
291
+ position: fixed;
292
+ z-index: $floating-z-index;
292
293
 
293
- @if not $disable-floating-absolute-position {
294
- &--absolute {
295
- @include set-var(fab-offset, 0px);
294
+ @if not $disable-floating-absolute-position {
295
+ &--absolute {
296
+ @include set-var(fab-offset, 0px);
296
297
 
297
- position: absolute;
298
- z-index: $floating-absolute-z-index;
298
+ position: absolute;
299
+ z-index: $floating-absolute-z-index;
300
+ }
299
301
  }
300
- }
301
302
 
302
- @each $suffix, $styles in $floating-positions {
303
- &--#{$suffix} {
304
- @each $property, $value in $styles {
305
- @if $property == left {
306
- @include utils.rtl {
307
- left: auto;
308
- right: calc(#{$value} + #{get-var(fab-offset)});
309
- }
303
+ @each $suffix, $styles in $floating-positions {
304
+ &--#{$suffix} {
305
+ @each $property, $value in $styles {
306
+ @if $property == left {
307
+ @include utils.rtl {
308
+ left: auto;
309
+ right: calc(#{$value} + #{get-var(fab-offset)});
310
+ }
310
311
 
311
- left: $value;
312
- } @else if $property == right {
313
- @include utils.rtl {
314
312
  left: $value;
315
- right: auto;
316
- }
313
+ } @else if $property == right {
314
+ @include utils.rtl {
315
+ left: $value;
316
+ right: auto;
317
+ }
317
318
 
318
- right: calc(#{$value} + #{get-var(fab-offset)});
319
- } @else {
320
- #{$property}: #{$value};
319
+ right: calc(#{$value} + #{get-var(fab-offset)});
320
+ } @else {
321
+ #{$property}: #{$value};
322
+ }
321
323
  }
322
324
  }
323
325
  }