@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
@@ -117,128 +117,130 @@ $variables: (height, surface-background-color, surface-color);
117
117
  }
118
118
  }
119
119
 
120
- @mixin styles {
120
+ @mixin styles($disable-layer: false) {
121
121
  @if not $disable-everything {
122
- @include theme.default-system-theme {
123
- @include use-dark-theme;
124
- }
122
+ @include utils.optional-layer(app-bar, $disable-layer) {
123
+ @include theme.default-system-theme {
124
+ @include use-dark-theme;
125
+ }
125
126
 
126
- .rmd-app-bar {
127
- @include use-var(height);
128
- @include box.set-var(gap, $gap);
129
- @include box.set-var(padding, $vertical-padding $horizontal-padding);
130
-
131
- // since app bars can appear a lot in full page dialogs, setting these flex
132
- // values allows it be be a direct replacement of the `DialogHeader`
133
- // component without all the offsets and additional styles needed for fixed
134
- // app bars.
135
- flex: 0 0 auto;
136
-
137
- @if not $disable-fixed or not $disable-sticky {
138
- &--fixed {
139
- left: 0;
140
- position: fixed;
141
- // Note: right and width were added to support the main navigation
142
- // behavior with toggleable full-height navigation
143
- right: 0;
144
- width: auto;
145
- z-index: $fixed-z-index;
146
- }
127
+ .rmd-app-bar {
128
+ @include use-var(height);
129
+ @include box.set-var(gap, $gap);
130
+ @include box.set-var(padding, $vertical-padding $horizontal-padding);
131
+
132
+ // since app bars can appear a lot in full page dialogs, setting these flex
133
+ // values allows it be be a direct replacement of the `DialogHeader`
134
+ // component without all the offsets and additional styles needed for fixed
135
+ // app bars.
136
+ flex: 0 0 auto;
137
+
138
+ @if not $disable-fixed or not $disable-sticky {
139
+ &--fixed {
140
+ left: 0;
141
+ position: fixed;
142
+ // Note: right and width were added to support the main navigation
143
+ // behavior with toggleable full-height navigation
144
+ right: 0;
145
+ width: auto;
146
+ z-index: $fixed-z-index;
147
+ }
147
148
 
148
- @if $fixed-elevation and $fixed-elevation != 0 {
149
- &--elevated {
150
- @include box-shadows.box-shadow(
151
- $fixed-elevation,
152
- $disable-colors: true
153
- );
149
+ @if $fixed-elevation and $fixed-elevation != 0 {
150
+ &--elevated {
151
+ @include box-shadows.box-shadow(
152
+ $fixed-elevation,
153
+ $disable-colors: true
154
+ );
155
+ }
154
156
  }
155
- }
156
157
 
157
- @each $position in $fixed-positions {
158
- &--#{$position} {
159
- #{$position}: 0;
158
+ @each $position in $fixed-positions {
159
+ &--#{$position} {
160
+ #{$position}: 0;
161
+ }
160
162
  }
161
- }
162
163
 
163
- @if not $disable-sticky {
164
- &--sticky {
165
- position: sticky;
164
+ @if not $disable-sticky {
165
+ &--sticky {
166
+ position: sticky;
167
+ }
166
168
  }
167
169
  }
168
- }
169
170
 
170
- &--auto {
171
- // do not set variable so that child AppBar can maintain their height as needed
172
- height: auto;
173
- }
174
-
175
- &--stacked {
176
- flex-direction: column;
177
- gap: 0;
178
- padding: 0;
179
- }
180
-
181
- @if not $disable-dense-theme {
182
- &--dense {
183
- @include set-var(height, $dense-height);
171
+ &--auto {
172
+ // do not set variable so that child AppBar can maintain their height as needed
173
+ height: auto;
184
174
  }
185
- }
186
175
 
187
- @if not $disable-prominent-theme {
188
- &--prominent {
189
- @include set-var(height, $prominent-height);
176
+ &--stacked {
177
+ flex-direction: column;
178
+ gap: 0;
179
+ padding: 0;
190
180
  }
191
- }
192
181
 
193
- @if not $disable-prominent-dense-theme {
194
- &--prominent-dense {
195
- @include set-var(height, $prominent-dense-height);
182
+ @if not $disable-dense-theme {
183
+ &--dense {
184
+ @include set-var(height, $dense-height);
185
+ }
196
186
  }
197
- }
198
187
 
199
- @if not $disable-surface-theme {
200
- &--surface {
201
- @include use-var(background-color, surface-background-color);
202
- @include use-var(color, surface-color);
188
+ @if not $disable-prominent-theme {
189
+ &--prominent {
190
+ @include set-var(height, $prominent-height);
191
+ }
203
192
  }
204
- }
205
193
 
206
- @if not $disable-scrollbar-offset {
207
- &--scrollbar-offset {
208
- @include utils.rtl {
209
- margin-right: calc(-1 * #{utils.scrollbar-size()});
194
+ @if not $disable-prominent-dense-theme {
195
+ &--prominent-dense {
196
+ @include set-var(height, $prominent-dense-height);
210
197
  }
198
+ }
211
199
 
212
- padding-right: calc(
213
- #{$horizontal-padding} + #{utils.scrollbar-size()}
214
- );
200
+ @if not $disable-surface-theme {
201
+ &--surface {
202
+ @include use-var(background-color, surface-background-color);
203
+ @include use-var(color, surface-color);
204
+ }
215
205
  }
216
206
 
217
- @if not $disable-static-scrollbar-offset {
218
- &--static-scrollbar-offset {
219
- width: calc(100% + utils.scrollbar-size());
207
+ @if not $disable-scrollbar-offset {
208
+ &--scrollbar-offset {
209
+ @include utils.rtl {
210
+ margin-right: calc(-1 * #{utils.scrollbar-size()});
211
+ }
212
+
213
+ padding-right: calc(
214
+ #{$horizontal-padding} + #{utils.scrollbar-size()}
215
+ );
216
+ }
217
+
218
+ @if not $disable-static-scrollbar-offset {
219
+ &--static-scrollbar-offset {
220
+ width: calc(100% + utils.scrollbar-size());
221
+ }
220
222
  }
221
223
  }
222
224
  }
223
- }
224
225
 
225
- @if not $disable-title {
226
- .rmd-app-bar-title {
227
- @include utils.auto-rtl(margin-left, $keyline - $horizontal-padding);
226
+ @if not $disable-title {
227
+ .rmd-app-bar-title {
228
+ @include utils.auto-rtl(margin-left, $keyline - $horizontal-padding);
228
229
 
229
- flex: 1 1 auto;
230
- margin-bottom: 0;
231
- margin-top: 0;
230
+ flex: 1 1 auto;
231
+ margin-bottom: 0;
232
+ margin-top: 0;
232
233
 
233
- &--keyline {
234
- @include utils.auto-rtl(
235
- margin-left,
236
- $title-keyline - $horizontal-padding
237
- );
238
- }
234
+ &--keyline {
235
+ @include utils.auto-rtl(
236
+ margin-left,
237
+ $title-keyline - $horizontal-padding
238
+ );
239
+ }
239
240
 
240
- &--nav-keyline {
241
- @include utils.auto-rtl(margin-left, $nav-keyline);
241
+ &--nav-keyline {
242
+ @include utils.auto-rtl(margin-left, $nav-keyline);
243
+ }
242
244
  }
243
245
  }
244
246
  }
@@ -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
  }
@@ -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
  }