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

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 (74) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/CHANGELOG.md +6 -0
  3. package/dist/_core.scss +157 -240
  4. package/dist/_utils.scss +10 -0
  5. package/dist/app-bar/_app-bar.scss +95 -93
  6. package/dist/avatar/_avatar.scss +49 -47
  7. package/dist/badge/_badge.scss +19 -17
  8. package/dist/box/_box.scss +57 -55
  9. package/dist/button/_button.scss +122 -120
  10. package/dist/card/_card.scss +72 -70
  11. package/dist/chip/_chip.scss +105 -103
  12. package/dist/dialog/_dialog.scss +128 -126
  13. package/dist/divider/_divider.scss +24 -22
  14. package/dist/draggable/_draggable.scss +16 -12
  15. package/dist/expansion-panel/_expansion-panel.scss +69 -52
  16. package/dist/form/Form.d.ts +1 -1
  17. package/dist/form/Form.js +2 -1
  18. package/dist/form/Form.js.map +1 -1
  19. package/dist/form/_form.scss +1175 -1127
  20. package/dist/icon/_icon.scss +64 -62
  21. package/dist/interaction/_interaction.scss +39 -35
  22. package/dist/layout/_layout.scss +68 -67
  23. package/dist/link/_link.scss +52 -50
  24. package/dist/list/_list.scss +124 -122
  25. package/dist/menu/_menu.scss +9 -7
  26. package/dist/overlay/_overlay.scss +25 -23
  27. package/dist/progress/_progress.scss +11 -6
  28. package/dist/responsive-item/_responsive-item.scss +91 -89
  29. package/dist/segmented-button/_segmented-button.scss +54 -49
  30. package/dist/sheet/_sheet.scss +84 -82
  31. package/dist/snackbar/_snackbar.scss +128 -123
  32. package/dist/table/_table.scss +159 -157
  33. package/dist/tabs/_tabs.scss +10 -8
  34. package/dist/tooltip/_tooltip.scss +60 -58
  35. package/dist/transition/_transition.scss +44 -39
  36. package/dist/tree/_tree.scss +83 -81
  37. package/dist/typography/_typography.scss +58 -49
  38. package/dist/window-splitter/_window-splitter.scss +72 -70
  39. package/package.json +1 -1
  40. package/src/_core.scss +157 -240
  41. package/src/_utils.scss +10 -0
  42. package/src/app-bar/_app-bar.scss +95 -93
  43. package/src/avatar/_avatar.scss +49 -47
  44. package/src/badge/_badge.scss +19 -17
  45. package/src/box/_box.scss +57 -55
  46. package/src/button/_button.scss +122 -120
  47. package/src/card/_card.scss +72 -70
  48. package/src/chip/_chip.scss +105 -103
  49. package/src/dialog/_dialog.scss +128 -126
  50. package/src/divider/_divider.scss +24 -22
  51. package/src/draggable/_draggable.scss +16 -12
  52. package/src/expansion-panel/_expansion-panel.scss +69 -52
  53. package/src/form/Form.tsx +2 -1
  54. package/src/form/_form.scss +1175 -1127
  55. package/src/icon/_icon.scss +64 -62
  56. package/src/interaction/_interaction.scss +39 -35
  57. package/src/layout/_layout.scss +68 -67
  58. package/src/link/_link.scss +52 -50
  59. package/src/list/_list.scss +124 -122
  60. package/src/menu/_menu.scss +9 -7
  61. package/src/overlay/_overlay.scss +25 -23
  62. package/src/progress/_progress.scss +11 -6
  63. package/src/responsive-item/_responsive-item.scss +91 -89
  64. package/src/segmented-button/_segmented-button.scss +54 -49
  65. package/src/sheet/_sheet.scss +84 -82
  66. package/src/snackbar/_snackbar.scss +128 -123
  67. package/src/table/_table.scss +159 -157
  68. package/src/tabs/_tabs.scss +10 -8
  69. package/src/tooltip/_tooltip.scss +60 -58
  70. package/src/transition/_transition.scss +44 -39
  71. package/src/tree/_tree.scss +83 -81
  72. package/src/typography/_typography.scss +58 -49
  73. package/src/window-splitter/_window-splitter.scss +72 -70
  74. package/tsconfig.json +2 -2
@@ -100,168 +100,170 @@ $variables: (
100
100
  }
101
101
  }
102
102
 
103
- @mixin styles {
103
+ @mixin styles($disable-layer: false) {
104
104
  @if not $disable-everything {
105
- .rmd-dialog-container {
106
- @include use-var(z-index);
107
-
108
- align-items: center;
109
- display: flex;
110
- inset: 0;
111
- justify-content: center;
112
- margin: get-var(vertical-margin) get-var(horizontal-margin);
113
- margin-right: calc(
114
- #{get-var(horizontal-margin)} + #{utils.scrollbar-size()}
115
- );
116
- pointer-events: none;
117
- position: fixed;
118
- }
105
+ @include utils.optional-layer(dialog, $disable-layer) {
106
+ .rmd-dialog-container {
107
+ @include use-var(z-index);
119
108
 
120
- .rmd-dialog {
121
- @include box-shadows.box-shadow($elevation);
109
+ align-items: center;
110
+ display: flex;
111
+ inset: 0;
112
+ justify-content: center;
113
+ margin: get-var(vertical-margin) get-var(horizontal-margin);
114
+ margin-right: calc(
115
+ #{get-var(horizontal-margin)} + #{utils.scrollbar-size()}
116
+ );
117
+ pointer-events: none;
118
+ position: fixed;
119
+ }
122
120
 
123
- background-color: $background-color;
124
- color: $color;
125
- display: flex;
126
- flex-direction: column;
127
- max-height: 100%;
128
- max-width: 100%;
129
- outline: none;
121
+ .rmd-dialog {
122
+ @include box-shadows.box-shadow($elevation);
130
123
 
131
- &--centered {
132
- @include use-var(min-width);
124
+ background-color: $background-color;
125
+ color: $color;
126
+ display: flex;
127
+ flex-direction: column;
128
+ max-height: 100%;
129
+ max-width: 100%;
130
+ outline: none;
133
131
 
134
- pointer-events: auto;
135
- }
132
+ &--centered {
133
+ @include use-var(min-width);
136
134
 
137
- &--full-page {
138
- @include use-var(z-index);
135
+ pointer-events: auto;
136
+ }
139
137
 
140
- height: 100%;
141
- inset: 0;
142
- overflow: auto;
143
- position: fixed;
144
- width: 100%;
145
- }
138
+ &--full-page {
139
+ @include use-var(z-index);
146
140
 
147
- @if not $disable-focus-outline {
148
- // Note: Do not use the `interaction-outline` mixin +
149
- // `interaction.set-var(interaction.$focus-color)` like normal focus
150
- // elements since it'll make all focusable children update with the
151
- // outline color as well
152
- @if utils.$disable-focus-visible {
153
- @include utils.keyboard-only {
154
- &--outline:focus {
155
- outline: interaction.get-var(focus-color) solid
141
+ height: 100%;
142
+ inset: 0;
143
+ overflow: auto;
144
+ position: fixed;
145
+ width: 100%;
146
+ }
147
+
148
+ @if not $disable-focus-outline {
149
+ // Note: Do not use the `interaction-outline` mixin +
150
+ // `interaction.set-var(interaction.$focus-color)` like normal focus
151
+ // elements since it'll make all focusable children update with the
152
+ // outline color as well
153
+ @if utils.$disable-focus-visible {
154
+ @include utils.keyboard-only {
155
+ &--outline:focus {
156
+ outline: interaction.get-var(focus-color) solid
157
+ interaction.get-var(focus-width);
158
+ }
159
+ }
160
+ } @else {
161
+ &--outline:focus-visible {
162
+ outline: interaction.get-var(focus-color)
163
+ solid
156
164
  interaction.get-var(focus-width);
157
165
  }
158
166
  }
159
- } @else {
160
- &--outline:focus-visible {
161
- outline: interaction.get-var(focus-color)
162
- solid
163
- interaction.get-var(focus-width);
164
- }
165
167
  }
166
- }
167
-
168
- &--enter {
169
- transform: translateY($transition-distance);
170
- }
171
-
172
- &--enter-active {
173
- transform: translateY(0);
174
- transition: transform $enter-duration;
175
- transition-timing-function: $enter-timing-function;
176
- }
177
-
178
- &--exit {
179
- opacity: 1;
180
- transform: translateY(0);
181
- transition:
182
- transform $leave-duration,
183
- opacity $leave-duration;
184
- transition-timing-function: $leave-timing-function;
185
- }
186
168
 
187
- &--exit-active {
188
- opacity: 0;
189
- transform: translateY($transition-distance);
190
- }
169
+ &--enter {
170
+ transform: translateY($transition-distance);
171
+ }
191
172
 
192
- @if not $disable-fixed {
193
- &--fixed {
194
- @include use-var(z-index);
173
+ &--enter-active {
174
+ transform: translateY(0);
175
+ transition: transform $enter-duration;
176
+ transition-timing-function: $enter-timing-function;
195
177
  }
196
- }
197
178
 
198
- @if not $disable-header {
199
- &__header {
200
- @include use-var(padding, header-padding);
201
- @include use-var(padding-bottom, header-padding-bottom);
179
+ &--exit {
180
+ opacity: 1;
181
+ transform: translateY(0);
182
+ transition:
183
+ transform $leave-duration,
184
+ opacity $leave-duration;
185
+ transition-timing-function: $leave-timing-function;
186
+ }
202
187
 
203
- align-items: center;
204
- display: flex;
205
- flex: 0 0 auto;
188
+ &--exit-active {
189
+ opacity: 0;
190
+ transform: translateY($transition-distance);
206
191
  }
207
- }
208
192
 
209
- @if not $disable-title {
210
- &__title {
211
- // this makes it so it's easy to add a close button after the title
212
- flex: 1 1 auto;
193
+ @if not $disable-fixed {
194
+ &--fixed {
195
+ @include use-var(z-index);
196
+ }
213
197
  }
214
- }
215
198
 
216
- @if not $disable-content {
217
- &__content {
218
- flex: 1 1 auto;
219
- overflow: auto;
199
+ @if not $disable-header {
200
+ &__header {
201
+ @include use-var(padding, header-padding);
202
+ @include use-var(padding-bottom, header-padding-bottom);
220
203
 
221
- &--padded {
222
- @include use-var(padding, content-padding);
204
+ align-items: center;
205
+ display: flex;
206
+ flex: 0 0 auto;
223
207
  }
224
208
  }
225
- }
226
209
 
227
- @if not $disable-footer {
228
- &__footer {
229
- @include use-var(padding, footer-padding);
210
+ @if not $disable-title {
211
+ &__title {
212
+ // this makes it so it's easy to add a close button after the title
213
+ flex: 1 1 auto;
214
+ }
215
+ }
230
216
 
231
- flex: 0 0 auto;
217
+ @if not $disable-content {
218
+ &__content {
219
+ flex: 1 1 auto;
220
+ overflow: auto;
232
221
 
233
- @if not
234
- $disable-footer-flex-vertical or not
235
- $disable-footer-flex-start or not
236
- $disable-footer-space-between or not
237
- $disable-footer-flex-end
238
- {
239
- &--flex {
240
- display: flex;
222
+ &--padded {
223
+ @include use-var(padding, content-padding);
241
224
  }
242
225
  }
226
+ }
243
227
 
244
- @if not $disable-footer-flex-vertical {
245
- &--flex-v {
246
- flex-direction: column;
228
+ @if not $disable-footer {
229
+ &__footer {
230
+ @include use-var(padding, footer-padding);
231
+
232
+ flex: 0 0 auto;
233
+
234
+ @if not
235
+ $disable-footer-flex-vertical or not
236
+ $disable-footer-flex-start or not
237
+ $disable-footer-space-between or not
238
+ $disable-footer-flex-end
239
+ {
240
+ &--flex {
241
+ display: flex;
242
+ }
247
243
  }
248
- }
249
244
 
250
- @if not $disable-footer-flex-start {
251
- &--start {
252
- justify-content: flex-start;
245
+ @if not $disable-footer-flex-vertical {
246
+ &--flex-v {
247
+ flex-direction: column;
248
+ }
253
249
  }
254
- }
255
250
 
256
- @if not $disable-footer-space-between {
257
- &--between {
258
- justify-content: space-between;
251
+ @if not $disable-footer-flex-start {
252
+ &--start {
253
+ justify-content: flex-start;
254
+ }
255
+ }
256
+
257
+ @if not $disable-footer-space-between {
258
+ &--between {
259
+ justify-content: space-between;
260
+ }
259
261
  }
260
- }
261
262
 
262
- @if not $disable-footer-flex-end {
263
- &--end {
264
- justify-content: flex-end;
263
+ @if not $disable-footer-flex-end {
264
+ &--end {
265
+ justify-content: flex-end;
266
+ }
265
267
  }
266
268
  }
267
269
  }
@@ -85,36 +85,38 @@ $variables: (
85
85
  }
86
86
  }
87
87
 
88
- @mixin styles {
88
+ @mixin styles($disable-layer: false) {
89
89
  @if not $disable-everything {
90
- @include theme.default-system-theme {
91
- @include use-dark-theme;
92
- }
90
+ @include utils.optional-layer(divider, $disable-layer) {
91
+ @include theme.default-system-theme {
92
+ @include use-dark-theme;
93
+ }
93
94
 
94
- .rmd-divider {
95
- @include use-var(margin, spacing);
96
- @include use-var(width, max-size);
95
+ .rmd-divider {
96
+ @include use-var(margin, spacing);
97
+ @include use-var(width, max-size);
97
98
 
98
- border: get-var(size) solid get-var(color);
99
- display: block;
100
- flex-shrink: 0;
99
+ border: get-var(size) solid get-var(color);
100
+ display: block;
101
+ flex-shrink: 0;
101
102
 
102
- @if not $disable-inset {
103
- &--inset {
104
- @include utils.auto-rtl(margin-left, get-var(inset), auto);
103
+ @if not $disable-inset {
104
+ &--inset {
105
+ @include utils.auto-rtl(margin-left, get-var(inset), auto);
105
106
 
106
- width: calc(get-var(max-size) - get-var(inset));
107
+ width: calc(get-var(max-size) - get-var(inset));
108
+ }
107
109
  }
108
- }
109
110
 
110
- @if not $disable-vertical {
111
- &--vertical {
112
- @include border-style(left);
113
- @include use-var(height, max-size);
114
- @include use-var(width, size);
115
- @include use-var(margin, vertical-spacing);
111
+ @if not $disable-vertical {
112
+ &--vertical {
113
+ @include border-style(left);
114
+ @include use-var(height, max-size);
115
+ @include use-var(width, size);
116
+ @include use-var(margin, vertical-spacing);
116
117
 
117
- display: inline-block;
118
+ display: inline-block;
119
+ }
118
120
  }
119
121
  }
120
122
  }
@@ -1,23 +1,27 @@
1
+ @use "../utils";
2
+
1
3
  $disable-everything: false !default;
2
4
  $disable-horizontal: false !default;
3
5
  $disable-vertical: false !default;
4
6
 
5
- @mixin styles {
7
+ @mixin styles($disable-layer: false) {
6
8
  @if not $disable-everything {
7
- .rmd-dragging {
8
- * {
9
- pointer-events: none;
10
- }
9
+ @include utils.optional-layer(draggable, $disable-layer) {
10
+ .rmd-dragging {
11
+ * {
12
+ pointer-events: none;
13
+ }
11
14
 
12
- @if not $disable-horizontal {
13
- &--h {
14
- cursor: col-resize;
15
+ @if not $disable-horizontal {
16
+ &--h {
17
+ cursor: col-resize;
18
+ }
15
19
  }
16
- }
17
20
 
18
- @if not $disable-vertical {
19
- &--v {
20
- cursor: row-resize;
21
+ @if not $disable-vertical {
22
+ &--v {
23
+ cursor: row-resize;
24
+ }
21
25
  }
22
26
  }
23
27
  }
@@ -16,74 +16,91 @@ $rotate-to: icon.$rotate-to !default;
16
16
  $box-shadow-overlay-height: 10px !default;
17
17
  $box-shadow-overlay-bottom: -6px !default;
18
18
 
19
- @mixin styles {
19
+ @mixin styles($disable-layer: false) {
20
20
  @if not $disable-everything {
21
- // does not require custom styles
22
- .rmd-expansion-panel {
23
- @if not $disable-margin-top-transition and $spacing {
24
- &--animate {
25
- transition: margin-top transition.$linear-duration;
21
+ @include utils.optional-layer(expansion-panel, $disable-layer) {
22
+ // does not require custom styles
23
+ .rmd-expansion-panel {
24
+ @if not $disable-margin-top-transition and $spacing {
25
+ &--animate {
26
+ transition: margin-top transition.$linear-duration;
27
+ }
26
28
  }
27
- }
28
29
 
29
- @if $spacing {
30
- &--expanded + .rmd-expansion-panel {
31
- margin-top: $spacing;
30
+ @if $spacing {
31
+ &--expanded + .rmd-expansion-panel {
32
+ margin-top: $spacing;
33
+ }
32
34
  }
33
- }
34
35
 
35
- @if not utils.$disable-has-selectors {
36
- // this makes it so that the box-shadow between closed panels is not
37
- // visible by covering it in a small overlay of the current
38
- // background-color
39
- &:where(:not(.rmd-expansion-panel--expanded)):has(
40
- + .rmd-expansion-panel
41
- ) {
42
- position: relative;
36
+ @if not utils.$disable-has-selectors {
37
+ // this makes it so that the box-shadow between closed panels is not
38
+ // visible by covering it in a small overlay of the current
39
+ // background-color
40
+ &:where(:not(.rmd-expansion-panel--expanded)):has(
41
+ + .rmd-expansion-panel
42
+ ) {
43
+ position: relative;
43
44
 
44
- &::after {
45
- @include theme.theme-use-var(background-color);
45
+ &::after {
46
+ @include theme.theme-use-var(background-color);
46
47
 
47
- bottom: $box-shadow-overlay-bottom;
48
- content: "";
49
- height: $box-shadow-overlay-height;
50
- left: 0;
51
- position: absolute;
52
- right: 0;
53
- z-index: 1;
48
+ bottom: $box-shadow-overlay-bottom;
49
+ content: "";
50
+ height: $box-shadow-overlay-height;
51
+ left: 0;
52
+ position: absolute;
53
+ right: 0;
54
+ z-index: 1;
55
+ }
54
56
  }
55
57
  }
56
58
  }
57
- }
58
59
 
59
- // .rmd-expansion-panel__header {
60
- // }
60
+ // .rmd-expansion-panel__header {
61
+ // }
61
62
 
62
- .rmd-expansion-panel__button {
63
- @if $rotate-from != icon.$rotate-from {
64
- @include icon.set-var(rotate-from, $rotate-from);
65
- }
63
+ .rmd-expansion-panel__button {
64
+ @if $rotate-from != icon.$rotate-from {
65
+ @include icon.set-var(rotate-from, $rotate-from);
66
+ }
66
67
 
67
- @if $rotate-to != icon.$rotate-to {
68
- @include icon.set-var(rotate-to, $rotate-to);
69
- }
68
+ @if $rotate-to != icon.$rotate-to {
69
+ @include icon.set-var(rotate-to, $rotate-to);
70
+ }
70
71
 
71
- @if button.$disable-unstyled-utility-class {
72
- @include button.unstyled;
73
- }
74
- @include utils.auto-rtl(text-align, left);
72
+ @if button.$disable-unstyled-utility-class {
73
+ @include button.unstyled;
74
+ }
75
+ @include utils.auto-rtl(text-align, left);
75
76
 
76
- align-items: center;
77
- color: inherit;
78
- font: inherit;
79
- gap: $button-spacing;
80
- justify-content: space-between;
81
- letter-spacing: inherit;
82
- padding: $padding;
83
- width: 100%;
77
+ align-items: center;
78
+ color: inherit;
79
+ font: inherit;
80
+ gap: $button-spacing;
81
+ justify-content: space-between;
82
+ letter-spacing: inherit;
83
+ padding: $padding;
84
+ width: 100%;
84
85
 
85
- &[aria-disabled="true"] {
86
- cursor: auto;
86
+ &[aria-disabled="true"] {
87
+ cursor: auto;
88
+ }
89
+
90
+ // need to raise the focus outline z-index so it is above the box-shadow
91
+ @if not utils.$disable-has-selectors {
92
+ @if not utils.$disable-focus-visible {
93
+ &::before {
94
+ z-index: 2;
95
+ }
96
+ } @else {
97
+ @include utils.keyboard-only {
98
+ &::before {
99
+ z-index: 2;
100
+ }
101
+ }
102
+ }
103
+ }
87
104
  }
88
105
  }
89
106
  }
package/src/form/Form.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { forwardRef, type FormHTMLAttributes } from "react";
2
3
 
3
4
  const noop = (): void => {
@@ -16,7 +17,7 @@ export interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
16
17
  }
17
18
 
18
19
  /**
19
- * **Server Component**
20
+ * **Client Component**
20
21
  *
21
22
  * This is probably one of the least useful components available as it doesn't
22
23
  * do much styling or logic. All this form component will do is add basic flex