@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
@@ -115,94 +115,96 @@ $variables: (
115
115
  }
116
116
  }
117
117
 
118
- @mixin styles {
118
+ @mixin styles($disable-layer: false) {
119
119
  // shouldn't really use react-md without icons though...
120
- @if not $disable-font or not $disable-svg and not $disable-symbol {
121
- @include theme.default-system-theme {
122
- @include use-dark-theme;
123
- }
120
+ @if not $disable-font or not $disable-svg or not $disable-symbol {
121
+ @include utils.optional-layer(icon, $disable-layer) {
122
+ @include theme.default-system-theme {
123
+ @include use-dark-theme;
124
+ }
124
125
 
125
- .rmd-icon {
126
- @include use-var(font-size, size);
127
- @include use-var(color);
126
+ .rmd-icon {
127
+ @include use-var(font-size, size);
128
+ @include use-var(color);
128
129
 
129
- // you normally don't want icons to shrink in flex containers.
130
- // update the icon manually instead.
131
- flex-shrink: 0;
132
- user-select: none;
130
+ // you normally don't want icons to shrink in flex containers.
131
+ // update the icon manually instead.
132
+ flex-shrink: 0;
133
+ user-select: none;
133
134
 
134
- @if not $disable-font {
135
- &--font {
136
- text-align: center;
135
+ @if not $disable-font {
136
+ &--font {
137
+ text-align: center;
138
+ }
137
139
  }
138
- }
139
140
 
140
- @if not $disable-svg {
141
- &--svg {
142
- fill: currentcolor;
143
- height: 1em;
144
- width: 1em;
141
+ @if not $disable-svg {
142
+ &--svg {
143
+ fill: currentcolor;
144
+ height: 1em;
145
+ width: 1em;
146
+ }
145
147
  }
146
- }
147
148
 
148
- @if not $disable-symbol {
149
- &--symbol {
150
- font-variation-settings:
151
- "FILL" get-var(symbol-fill),
152
- "wght" get-var(symbol-weight),
153
- "GRAD" get-var(symbol-grade),
154
- "opsz" get-var(symbol-optical-size);
149
+ @if not $disable-symbol {
150
+ &--symbol {
151
+ font-variation-settings:
152
+ "FILL" get-var(symbol-fill),
153
+ "wght" get-var(symbol-weight),
154
+ "GRAD" get-var(symbol-grade),
155
+ "opsz" get-var(symbol-optical-size);
156
+ }
155
157
  }
156
- }
157
158
 
158
- @if not $disable-inline {
159
- &--vab {
160
- vertical-align: bottom;
159
+ @if not $disable-inline {
160
+ &--vab {
161
+ vertical-align: bottom;
162
+ }
161
163
  }
162
- }
163
164
 
164
- @if not $disable-spacing-before {
165
- &--before {
166
- @include utils.auto-rtl(margin-right, get-var(spacing), 0);
165
+ @if not $disable-spacing-before {
166
+ &--before {
167
+ @include utils.auto-rtl(margin-right, get-var(spacing), 0);
168
+ }
167
169
  }
168
- }
169
170
 
170
- @if not $disable-spacing-after {
171
- &--after {
172
- @include utils.auto-rtl(margin-left, get-var(spacing), 0);
171
+ @if not $disable-spacing-after {
172
+ &--after {
173
+ @include utils.auto-rtl(margin-left, get-var(spacing), 0);
174
+ }
173
175
  }
174
- }
175
176
 
176
- @if not $disable-spacing-above {
177
- &--above {
178
- @include use-var(margin-bottom, spacing);
177
+ @if not $disable-spacing-above {
178
+ &--above {
179
+ @include use-var(margin-bottom, spacing);
180
+ }
179
181
  }
180
- }
181
182
 
182
- @if not $disable-spacing-below {
183
- &--below {
184
- @include use-var(margin-top, spacing);
183
+ @if not $disable-spacing-below {
184
+ &--below {
185
+ @include use-var(margin-top, spacing);
186
+ }
185
187
  }
186
- }
187
188
 
188
- @if not $disable-dense {
189
- &--dense {
190
- @include set-var(size, $dense-size);
189
+ @if not $disable-dense {
190
+ &--dense {
191
+ @include set-var(size, $dense-size);
192
+ }
191
193
  }
192
194
  }
193
195
  }
194
- }
195
196
 
196
- @if not $disable-rotator {
197
- .rmd-icon-rotator {
198
- transform: rotate(get-var(rotate-from));
197
+ @if not $disable-rotator {
198
+ .rmd-icon-rotator {
199
+ transform: rotate(get-var(rotate-from));
199
200
 
200
- &--animate {
201
- transition: transform $rotate-duration linear;
202
- }
201
+ &--animate {
202
+ transition: transform $rotate-duration linear;
203
+ }
203
204
 
204
- &--rotated {
205
- transform: rotate(get-var(rotate-to));
205
+ &--rotated {
206
+ transform: rotate(get-var(rotate-to));
207
+ }
206
208
  }
207
209
  }
208
210
  }
@@ -375,46 +375,50 @@ $variables: (
375
375
  }
376
376
  }
377
377
 
378
- @mixin styles {
379
- @if not $_disable-ripple {
380
- .rmd-ripple-container {
381
- @include use-var(border-radius, ripple-border-radius);
382
- @include use-var(inset, ripple-inset);
383
-
384
- overflow: hidden;
385
- pointer-events: none;
386
- position: absolute;
387
- z-index: 0 !important;
388
- }
389
-
390
- .rmd-ripple {
391
- @include use-var(background-color, ripple-background-color);
392
-
393
- border-radius: 50%;
394
- position: absolute;
395
- transform: scale(0);
396
-
397
- &--animating {
398
- transition:
399
- transform
400
- $ripple-transform-duration
401
- transition.$deceleration-timing-function,
402
- opacity
403
- $ripple-opacity-duration
404
- transition.$acceleration-timing-function;
378
+ @mixin styles($disable-layer: false) {
379
+ @include utils.optional-layer(interaction, $disable-layer) {
380
+ @if not $_disable-ripple {
381
+ .rmd-ripple-container {
382
+ @include use-var(border-radius, ripple-border-radius);
383
+ @include use-var(inset, ripple-inset);
384
+
385
+ overflow: hidden;
386
+ pointer-events: none;
387
+ position: absolute;
388
+ z-index: 0 !important;
405
389
  }
406
390
 
407
- &--scaling {
408
- transform: scale(1);
409
- }
391
+ .rmd-ripple {
392
+ @include use-var(background-color, ripple-background-color);
393
+
394
+ border-radius: 50%;
395
+ position: absolute;
396
+ transform: scale(0);
397
+
398
+ &--animating {
399
+ transition:
400
+ transform
401
+ $ripple-transform-duration
402
+ transition.$deceleration-timing-function,
403
+ opacity
404
+ $ripple-opacity-duration
405
+ transition.$acceleration-timing-function;
406
+ }
410
407
 
411
- &--fading {
412
- opacity: 0;
408
+ &--scaling {
409
+ transform: scale(1);
410
+ }
411
+
412
+ &--fading {
413
+ opacity: 0;
414
+ }
413
415
  }
414
416
  }
415
- }
416
417
 
417
- .rmd-interaction-surface {
418
- @include surface($disabled-selector: "&:disabled,&[aria-disabled='true']");
418
+ .rmd-interaction-surface {
419
+ @include surface(
420
+ $disabled-selector: "&:disabled,&[aria-disabled='true']"
421
+ );
422
+ }
419
423
  }
420
424
  }
@@ -57,93 +57,94 @@ $variables: (size, header-height);
57
57
  }
58
58
  }
59
59
 
60
- @mixin styles {
60
+ @mixin styles($disable-layer: false) {
61
61
  @if not $disable-everything {
62
- .rmd-layout-main {
63
- display: block;
64
- outline: none;
65
-
66
- &::before {
67
- @include utils.pseudo-element(
68
- $fixed: true,
69
- $z-index: $main-focus-z-index,
70
- $inset: get-var(header-height) 0 interaction.get-var(focus-width)
71
- );
72
- @include interaction.focus-styles($box-shadow: true);
73
-
74
- opacity: 0;
75
- transition: opacity
76
- transition.$linear-duration
77
- transition.$linear-timing-function;
78
- }
62
+ @include utils.optional-layer(layout, $disable-layer) {
63
+ .rmd-layout-main {
64
+ display: block;
65
+ outline: none;
66
+
67
+ &::before {
68
+ @include utils.pseudo-element(
69
+ $fixed: true,
70
+ $z-index: $main-focus-z-index,
71
+ $inset: get-var(header-height) 0 interaction.get-var(focus-width)
72
+ );
73
+ @include interaction.focus-styles($box-shadow: true);
74
+
75
+ opacity: 0;
76
+ transition: opacity transition.$linear-duration
77
+ transition.$linear-timing-function;
78
+ }
79
79
 
80
- &:focus::before {
81
- opacity: 1;
82
- }
80
+ &:focus::before {
81
+ opacity: 1;
82
+ }
83
83
 
84
- &--offset-v {
85
- @include use-var(padding-top, header-height);
84
+ &--offset-v {
85
+ @include use-var(padding-top, header-height);
86
+ }
86
87
  }
87
- }
88
88
 
89
- /// I decided to go with an "SSR-first" approach by having the nav element
90
- /// always be rendered, but use media queries to show it for tablets and
91
- /// above. This makes it so there is less javascript to dynamically switch
92
- /// between layout types as you resize the browser.
93
- .rmd-layout-nav {
94
- @include sheet.set-var(width, get-var(size));
95
- @include media-queries.media($navigation-breakpoint) {
96
- // use grid so that you can easily have a header + tree that fills the remaining space
97
- display: grid;
98
- }
89
+ /// I decided to go with an "SSR-first" approach by having the nav element
90
+ /// always be rendered, but use media queries to show it for tablets and
91
+ /// above. This makes it so there is less javascript to dynamically switch
92
+ /// between layout types as you resize the browser.
93
+ .rmd-layout-nav {
94
+ @include sheet.set-var(width, get-var(size));
95
+ @include media-queries.media($navigation-breakpoint) {
96
+ // use grid so that you can easily have a header + tree that fills the remaining space
97
+ display: grid;
98
+ }
99
99
 
100
- container: $navigation-container-name;
101
- display: none;
102
- z-index: $navigation-z-index;
100
+ container: $navigation-container-name;
101
+ display: none;
102
+ z-index: $navigation-z-index;
103
103
 
104
- &--offset-v {
105
- @include use-var(top, header-height);
104
+ &--offset-v {
105
+ @include use-var(top, header-height);
106
+ }
106
107
  }
107
- }
108
108
 
109
- /// This class is used to transition when the nav expands/collapses on
110
- /// larger screen sizes
111
- .rmd-layout-h {
112
- will-change: margin;
109
+ /// This class is used to transition when the nav expands/collapses on
110
+ /// larger screen sizes
111
+ .rmd-layout-h {
112
+ will-change: margin;
113
113
 
114
- &--active {
115
- @include media-queries.media($navigation-breakpoint) {
116
- @include utils.auto-rtl(margin-left, get-var(size));
114
+ &--active {
115
+ @include media-queries.media($navigation-breakpoint) {
116
+ @include utils.auto-rtl(margin-left, get-var(size));
117
117
 
118
- &::before {
119
- @include utils.auto-rtl(left, get-var(size));
118
+ &::before {
119
+ @include utils.auto-rtl(left, get-var(size));
120
+ }
120
121
  }
121
122
  }
122
- }
123
123
 
124
- &--enter {
125
- transition: margin $enter-duration $enter-timing-function;
126
- }
124
+ &--enter {
125
+ transition: margin $enter-duration $enter-timing-function;
126
+ }
127
127
 
128
- &--exit {
129
- transition: margin $leave-duration $leave-timing-function;
128
+ &--exit {
129
+ transition: margin $leave-duration $leave-timing-function;
130
+ }
130
131
  }
131
- }
132
132
 
133
- @if not $disable-resizable {
134
- .rmd-layout-splitter {
135
- @include window-splitter.set-var(position, get-var(size));
133
+ @if not $disable-resizable {
134
+ .rmd-layout-splitter {
135
+ @include window-splitter.set-var(position, get-var(size));
136
136
 
137
- &--offset-v {
138
- @include window-splitter.set-var(top, get-var(header-height));
139
- }
140
-
141
- &--responsive {
142
- @include media-queries.media($navigation-breakpoint) {
143
- display: inline-block;
137
+ &--offset-v {
138
+ @include window-splitter.set-var(top, get-var(header-height));
144
139
  }
145
140
 
146
- display: none;
141
+ &--responsive {
142
+ @include media-queries.media($navigation-breakpoint) {
143
+ display: inline-block;
144
+ }
145
+
146
+ display: none;
147
+ }
147
148
  }
148
149
  }
149
150
  }
@@ -72,73 +72,75 @@ $variables: (color, visited-color, hover-color);
72
72
  }
73
73
  }
74
74
 
75
- @mixin styles {
75
+ @mixin styles($disable-layer: false) {
76
76
  @if not $disable-everything {
77
- .rmd-link {
78
- @include interaction.outline($outline-offset: false);
79
- @include use-var(color);
77
+ @include utils.optional-layer(link, $disable-layer) {
78
+ .rmd-link {
79
+ @include interaction.outline($outline-offset: false);
80
+ @include use-var(color);
80
81
 
81
- transition: color $transition-duration;
82
+ transition: color $transition-duration;
82
83
 
83
- &:visited {
84
- @include set-var(color, get-var(visited-color));
85
- }
84
+ &:visited {
85
+ @include set-var(color, get-var(visited-color));
86
+ }
86
87
 
87
- &:hover {
88
- @include set-var(color, get-var(hover-color));
89
- }
88
+ &:hover {
89
+ @include set-var(color, get-var(hover-color));
90
+ }
90
91
 
91
- // can't use the normal @include interaction.surface since links are
92
- // rendered inline and the `::before`/`::after` pseudo selectors only work
93
- // nicely with block-like elements
94
- @if utils.$disable-focus-visible {
95
- @include utils.keyboard-only {
96
- &:focus {
92
+ // can't use the normal @include interaction.surface since links are
93
+ // rendered inline and the `::before`/`::after` pseudo selectors only work
94
+ // nicely with block-like elements
95
+ @if utils.$disable-focus-visible {
96
+ @include utils.keyboard-only {
97
+ &:focus {
98
+ @include interaction.focus-styles($disable-background: true);
99
+ }
100
+ }
101
+ } @else {
102
+ &:focus-visible {
97
103
  @include interaction.focus-styles($disable-background: true);
98
104
  }
99
105
  }
100
- } @else {
101
- &:focus-visible {
102
- @include interaction.focus-styles($disable-background: true);
103
- }
104
- }
105
106
 
106
- @if not $disable-flex {
107
- &--flex {
108
- @include icon.use-var(gap, spacing);
107
+ @if not $disable-flex {
108
+ &--flex {
109
+ @include icon.use-var(gap, spacing);
109
110
 
110
- align-items: center;
111
- display: inline-flex;
111
+ align-items: center;
112
+ display: inline-flex;
113
+ }
112
114
  }
113
- }
114
115
 
115
- @if not $disable-skip-to-main {
116
- &--skip {
117
- @include utils.map-to-styles(
118
- map.remove(
119
- typography.$headline-6-styles,
120
- font-size,
121
- font-weight,
122
- letter-spacing
123
- )
124
- );
125
- @include utils.sr-only(true, null);
126
- }
116
+ @if not $disable-skip-to-main {
117
+ &--skip {
118
+ @include utils.map-to-styles(
119
+ map.remove(
120
+ typography.$headline-6-styles,
121
+ font-size,
122
+ font-weight,
123
+ letter-spacing
124
+ )
125
+ );
126
+ @include utils.sr-only(true, null);
127
+ }
127
128
 
128
- &--skip-styled {
129
- @include utils.map-to-styles($skip-to-main-styles);
129
+ &--skip-styled {
130
+ @include utils.map-to-styles($skip-to-main-styles);
130
131
 
131
- @if utils.$disable-focus-visible {
132
- @include utils.keyboard-only {
133
- &:focus,
134
- &:active {
132
+ @if utils.$disable-focus-visible {
133
+ @include utils.keyboard-only {
134
+ &:focus,
135
+ &:active {
136
+ @include utils.map-to-styles($skip-to-main-active-styles);
137
+ }
138
+ }
139
+ } @else {
140
+ &:focus-visible {
135
141
  @include utils.map-to-styles($skip-to-main-active-styles);
136
142
  }
137
143
  }
138
- } @else {
139
- &:focus-visible {
140
- @include utils.map-to-styles($skip-to-main-active-styles);
141
- }
142
144
  }
143
145
  }
144
146
  }