mtrl 0.5.2 → 0.5.4

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 (80) hide show
  1. package/dist/components/checkbox/api.d.ts +1 -1
  2. package/dist/components/checkbox/types.d.ts +17 -6
  3. package/dist/components/chips/api.d.ts +5 -2
  4. package/dist/components/chips/chip/api.d.ts +1 -1
  5. package/dist/components/chips/config.d.ts +5 -1
  6. package/dist/components/chips/types.d.ts +14 -3
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/components/select/types.d.ts +21 -3
  9. package/dist/components/switch/types.d.ts +8 -4
  10. package/dist/index.cjs +14 -14
  11. package/dist/index.cjs.map +13 -13
  12. package/dist/index.js +14 -14
  13. package/dist/index.js.map +13 -13
  14. package/dist/package.json +1 -1
  15. package/dist/styles.css +2 -2
  16. package/package.json +4 -2
  17. package/src/styles/abstract/_base.scss +2 -0
  18. package/src/styles/abstract/_config.scss +28 -0
  19. package/src/styles/abstract/_functions.scss +124 -0
  20. package/src/styles/abstract/_mixins.scss +401 -0
  21. package/src/styles/abstract/_theme.scss +269 -0
  22. package/src/styles/abstract/_variables.scss +338 -0
  23. package/src/styles/base/_reset.scss +86 -0
  24. package/src/styles/base/_typography.scss +155 -0
  25. package/src/styles/components/_badge.scss +183 -0
  26. package/src/styles/components/_bottom-app-bar.scss +103 -0
  27. package/src/styles/components/_button.scss +756 -0
  28. package/src/styles/components/_card.scss +401 -0
  29. package/src/styles/components/_carousel.scss +645 -0
  30. package/src/styles/components/_checkbox.scss +231 -0
  31. package/src/styles/components/_chips.scss +643 -0
  32. package/src/styles/components/_datepicker.scss +358 -0
  33. package/src/styles/components/_dialog.scss +259 -0
  34. package/src/styles/components/_divider.scss +57 -0
  35. package/src/styles/components/_extended-fab.scss +309 -0
  36. package/src/styles/components/_fab.scss +244 -0
  37. package/src/styles/components/_list.scss +774 -0
  38. package/src/styles/components/_menu.scss +245 -0
  39. package/src/styles/components/_navigation-mobile.scss +244 -0
  40. package/src/styles/components/_navigation-system.scss +151 -0
  41. package/src/styles/components/_navigation.scss +407 -0
  42. package/src/styles/components/_progress.scss +101 -0
  43. package/src/styles/components/_radios.scss +187 -0
  44. package/src/styles/components/_search.scss +306 -0
  45. package/src/styles/components/_segmented-button.scss +227 -0
  46. package/src/styles/components/_select.scss +274 -0
  47. package/src/styles/components/_sheet.scss +236 -0
  48. package/src/styles/components/_slider.scss +264 -0
  49. package/src/styles/components/_snackbar.scss +211 -0
  50. package/src/styles/components/_switch.scss +305 -0
  51. package/src/styles/components/_tabs.scss +421 -0
  52. package/src/styles/components/_textfield.scss +1035 -0
  53. package/src/styles/components/_timepicker.scss +451 -0
  54. package/src/styles/components/_tooltip.scss +241 -0
  55. package/src/styles/components/_top-app-bar.scss +225 -0
  56. package/src/styles/main.scss +129 -0
  57. package/src/styles/themes/_autumn.scss +105 -0
  58. package/src/styles/themes/_base-theme.scss +85 -0
  59. package/src/styles/themes/_baseline.scss +173 -0
  60. package/src/styles/themes/_bluekhaki.scss +125 -0
  61. package/src/styles/themes/_brownbeige.scss +125 -0
  62. package/src/styles/themes/_browngreen.scss +125 -0
  63. package/src/styles/themes/_forest.scss +77 -0
  64. package/src/styles/themes/_greenbeige.scss +125 -0
  65. package/src/styles/themes/_index.scss +19 -0
  66. package/src/styles/themes/_material.scss +125 -0
  67. package/src/styles/themes/_ocean.scss +77 -0
  68. package/src/styles/themes/_sageivory.scss +125 -0
  69. package/src/styles/themes/_spring.scss +77 -0
  70. package/src/styles/themes/_summer.scss +87 -0
  71. package/src/styles/themes/_sunset.scss +60 -0
  72. package/src/styles/themes/_tealcaramel.scss +125 -0
  73. package/src/styles/themes/_winter.scss +77 -0
  74. package/src/styles/utilities/_colors.scss +154 -0
  75. package/src/styles/utilities/_flexbox.scss +194 -0
  76. package/src/styles/utilities/_layout.scss +665 -0
  77. package/src/styles/utilities/_ripple.scss +79 -0
  78. package/src/styles/utilities/_spacing.scss +139 -0
  79. package/src/styles/utilities/_typography.scss +178 -0
  80. package/src/styles/utilities/_visibility.scss +142 -0
@@ -0,0 +1,155 @@
1
+ // src/styles/base/_typography.scss
2
+ @use '../abstract/base' as base;
3
+ @use '../abstract/variables' as v;
4
+ @use '../abstract/mixins' as m;
5
+
6
+ // Typography scale classes
7
+ $prefix: base.$prefix;
8
+
9
+ // Display typography
10
+ .#{$prefix}-display-large {
11
+ @include m.typography('display-large');
12
+ }
13
+
14
+ .#{$prefix}-display-medium {
15
+ @include m.typography('display-medium');
16
+ }
17
+
18
+ .#{$prefix}-display-small {
19
+ @include m.typography('display-small');
20
+ }
21
+
22
+ // Headline typography
23
+ .#{$prefix}-headline-large {
24
+ @include m.typography('headline-large');
25
+ }
26
+
27
+ .#{$prefix}-headline-medium {
28
+ @include m.typography('headline-medium');
29
+ }
30
+
31
+ .#{$prefix}-headline-small {
32
+ @include m.typography('headline-small');
33
+ }
34
+
35
+ // Title typography
36
+ .#{$prefix}-title-large {
37
+ @include m.typography('title-large');
38
+ }
39
+
40
+ .#{$prefix}-title-medium {
41
+ @include m.typography('title-medium');
42
+ }
43
+
44
+ .#{$prefix}-title-small {
45
+ @include m.typography('title-small');
46
+ }
47
+
48
+ // Body typography
49
+ .#{$prefix}-body-large {
50
+ @include m.typography('body-large');
51
+ }
52
+
53
+ .#{$prefix}-body-medium {
54
+ @include m.typography('body-medium');
55
+ }
56
+
57
+ .#{$prefix}-body-small {
58
+ @include m.typography('body-small');
59
+ }
60
+
61
+ // Label typography
62
+ .#{$prefix}-label-large {
63
+ @include m.typography('label-large');
64
+ }
65
+
66
+ .#{$prefix}-label-medium {
67
+ @include m.typography('label-medium');
68
+ }
69
+
70
+ .#{$prefix}-label-small {
71
+ @include m.typography('label-small');
72
+ }
73
+
74
+ // Convenience modifiers
75
+ .#{$prefix}-text-center {
76
+ text-align: center;
77
+ }
78
+
79
+ .#{$prefix}-text-left {
80
+ text-align: left;
81
+ }
82
+
83
+ .#{$prefix}-text-right {
84
+ text-align: right;
85
+ }
86
+
87
+ // Font weight modifiers
88
+ .#{$prefix}-font-thin {
89
+ font-weight: 100;
90
+ }
91
+
92
+ .#{$prefix}-font-light {
93
+ font-weight: 300;
94
+ }
95
+
96
+ .#{$prefix}-font-regular {
97
+ font-weight: 400;
98
+ }
99
+
100
+ .#{$prefix}-font-medium {
101
+ font-weight: 500;
102
+ }
103
+
104
+ .#{$prefix}-font-bold {
105
+ font-weight: 700;
106
+ }
107
+
108
+ // Text truncation with ellipsis
109
+ .#{$prefix}-truncate {
110
+ @include m.truncate;
111
+ }
112
+
113
+ .#{$prefix}-truncate-2 {
114
+ @include m.truncate(2);
115
+ }
116
+
117
+ .#{$prefix}-truncate-3 {
118
+ @include m.truncate(3);
119
+ }
120
+
121
+ // Set base styles for heading elements
122
+ h1 {
123
+ @include m.typography('headline-large');
124
+ margin-bottom: 0.5em;
125
+ }
126
+
127
+ h2 {
128
+ @include m.typography('headline-medium');
129
+ margin-bottom: 0.5em;
130
+ }
131
+
132
+ h3 {
133
+ @include m.typography('headline-small');
134
+ margin-bottom: 0.5em;
135
+ }
136
+
137
+ h4 {
138
+ @include m.typography('title-large');
139
+ margin-bottom: 0.5em;
140
+ }
141
+
142
+ h5 {
143
+ @include m.typography('title-medium');
144
+ margin-bottom: 0.5em;
145
+ }
146
+
147
+ h6 {
148
+ @include m.typography('title-small');
149
+ margin-bottom: 0.5em;
150
+ }
151
+
152
+ p {
153
+ @include m.typography('body-medium');
154
+ margin-bottom: 1em;
155
+ }
@@ -0,0 +1,183 @@
1
+ // src/components/badge/_badge.scss
2
+ @use '../../styles/abstract/base' as base;
3
+ @use '../../styles/abstract/variables' as v;
4
+ @use '../../styles/abstract/functions' as f;
5
+ @use '../../styles/abstract/mixins' as m;
6
+ @use '../../styles/abstract/theme' as t;
7
+
8
+ /**
9
+ * Badge component styles
10
+ *
11
+ * Badge specifications:
12
+ * - Small badge size: 6dp
13
+ * - Large badge height: 16dp
14
+ * - Small badge corner radius: 3dp
15
+ * - Large badge corner radius: 8dp
16
+ * - Small badge: positioned 6dp from container edge
17
+ * - Large badge: positioned 14dp (height) x 12dp (width) from container edge
18
+ */
19
+ $component: '#{base.$prefix}-badge';
20
+ $wrapper: '#{base.$prefix}-badge-wrapper';
21
+
22
+ // Wrapper styles to establish positioning context
23
+ .#{$wrapper} {
24
+ position: relative;
25
+ display: inline-flex;
26
+ flex-shrink: 0;
27
+ }
28
+
29
+ .#{$component} {
30
+ // Base badge styles
31
+ position: absolute;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ font-weight: 500;
36
+ box-sizing: border-box;
37
+ overflow: hidden;
38
+ transition: all 200ms ease;
39
+ text-overflow: ellipsis;
40
+
41
+ // Hide for visibility: false
42
+ &--invisible {
43
+ display: none;
44
+ }
45
+
46
+ // Small badge (dot)
47
+ &--small {
48
+ width: 6px;
49
+ height: 6px;
50
+ min-width: 6px;
51
+ border-radius: 3px; // 3dp corner radius
52
+ font-size: 0;
53
+ padding: 0;
54
+ }
55
+
56
+ // Large badge
57
+ &--large {
58
+ height: 16px;
59
+ min-width: 16px;
60
+ border-radius: 8px; // 8dp corner radius
61
+ padding: 0 4px;
62
+ font-size: 11px;
63
+ line-height: 16px;
64
+ padding-top: 0.5px; // for some reason, we need this to be properly vertically centered
65
+
66
+ // Handle max character count container (16dp x 34dp)
67
+ &.#{$component}--overflow {
68
+ min-width: auto;
69
+ max-width: 34px; // max width is 34dp for overflow badges
70
+ padding: 0 4px;
71
+ }
72
+ }
73
+
74
+ // Position specs
75
+ &--positioned {
76
+ // Small badge placement (6dp from container edge)
77
+ &.#{$component}--small {
78
+ &.#{$component}--top-right {
79
+ top: -3px;
80
+ right: -3px;
81
+ }
82
+
83
+ &.#{$component}--top-left {
84
+ top: -3px;
85
+ left: -3px;
86
+ }
87
+
88
+ &.#{$component}--bottom-right {
89
+ bottom: -3px;
90
+ right: -3px;
91
+ }
92
+
93
+ &.#{$component}--bottom-left {
94
+ bottom: -3px;
95
+ left: -3px;
96
+ }
97
+ }
98
+
99
+ // Large badge placement (14dp x 12dp from container edge)
100
+ &.#{$component}--large {
101
+ &.#{$component}--top-right {
102
+ top: -8px;
103
+ right: -8px;
104
+ }
105
+
106
+ &.#{$component}--top-left {
107
+ top: -8px;
108
+ left: -8px;
109
+ }
110
+
111
+ &.#{$component}--bottom-right {
112
+ bottom: -8px;
113
+ right: -8px;
114
+ }
115
+
116
+ &.#{$component}--bottom-left {
117
+ bottom: -8px;
118
+ left: -8px;
119
+ }
120
+ }
121
+ }
122
+
123
+ // badge color system
124
+ &--error {
125
+ background-color: t.color('error');
126
+ color: t.color('on-error');
127
+ }
128
+
129
+ &--primary {
130
+ background-color: t.color('primary');
131
+ color: t.color('on-primary');
132
+ }
133
+
134
+ &--secondary {
135
+ background-color: t.color('secondary');
136
+ color: t.color('on-secondary');
137
+ }
138
+
139
+ &--tertiary {
140
+ background-color: t.color('tertiary');
141
+ color: t.color('on-tertiary');
142
+ }
143
+
144
+ &--success {
145
+ background-color: t.color('success');
146
+ color: t.color('on-success');
147
+ }
148
+
149
+ &--warning {
150
+ background-color: t.color('warning');
151
+ color: t.color('on-warning');
152
+ }
153
+
154
+ &--info {
155
+ background-color: t.color('info');
156
+ color: t.color('on-info');
157
+ }
158
+ }
159
+
160
+ // RTL support
161
+ [dir="rtl"] {
162
+ .#{$component}--positioned {
163
+ &.#{$component}--top-right {
164
+ right: auto;
165
+ left: -8px;
166
+ }
167
+
168
+ &.#{$component}--top-left {
169
+ left: auto;
170
+ right: -8px;
171
+ }
172
+
173
+ &.#{$component}--bottom-right {
174
+ right: auto;
175
+ left: -8px;
176
+ }
177
+
178
+ &.#{$component}--bottom-left {
179
+ left: auto;
180
+ right: -8px;
181
+ }
182
+ }
183
+ }
@@ -0,0 +1,103 @@
1
+ // src/components/bottom-app-bar/styles.scss
2
+ @use 'sass:map';
3
+ @use '../../styles/abstract/base' as base;
4
+ @use '../../styles/abstract/variables' as v;
5
+ @use '../../styles/abstract/functions' as f;
6
+ @use '../../styles/abstract/mixins' as m;
7
+ @use '../../styles/abstract/theme' as t;
8
+
9
+ $component: '#{base.$prefix}-bottom-app-bar';
10
+
11
+ .#{$component} {
12
+ // Core Properties
13
+ position: absolute;
14
+ bottom: 0;
15
+ left: 0;
16
+ right: 0;
17
+ z-index: f.get-z-index('fixed');
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: space-between;
21
+ height: 80px; // Default height as per specs
22
+ padding: 12px 16px 12px 4px; // top/bottom 12px, right 16px, left 4px
23
+ background-color: t.color('surface-container');
24
+
25
+ // Apply material elevation
26
+ @include m.elevation(2);
27
+
28
+ // Apply border radius at the top
29
+ border-top-left-radius: t.shape('medium');
30
+ border-top-right-radius: t.shape('medium');
31
+
32
+ // Add transition for smooth animations
33
+ transition: transform 0.3s ease-in-out;
34
+
35
+ // Actions container on the left side
36
+ &-actions {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 4px; // Small gap between action buttons
40
+ height: 100%;
41
+
42
+ // Icon buttons should have consistent sizing
43
+ > * {
44
+ flex-shrink: 0;
45
+ }
46
+ }
47
+
48
+ // FAB container on the right side
49
+ &-fab-container {
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ margin-left: auto;
54
+ }
55
+
56
+ // Adjustment for when FAB is present - use the specified height
57
+ &--with-fab {
58
+ height: 72px;
59
+ }
60
+
61
+ // Adjustment for when FAB is centered
62
+ &--fab-center {
63
+ .#{$component}-fab-container {
64
+ position: absolute;
65
+ left: 50%;
66
+ transform: translateX(-50%);
67
+ }
68
+ }
69
+
70
+ // Hidden state - moved off-screen
71
+ &--hidden {
72
+ transform: translateY(100%);
73
+ }
74
+
75
+ // RTL Support
76
+ [dir="rtl"] & {
77
+ padding: 12px 4px 12px 16px;
78
+
79
+ &-actions {
80
+ flex-direction: row-reverse;
81
+ }
82
+
83
+ &-fab-container {
84
+ margin-right: auto;
85
+ margin-left: initial;
86
+ }
87
+ }
88
+
89
+ // // Media query to hide on large screens
90
+ // @media (min-width: map.get(v.$breakpoints, 'lg')) {
91
+ // display: none;
92
+ // }
93
+
94
+ // Reduced motion support
95
+ @include m.reduced-motion {
96
+ transition-duration: 0.01ms;
97
+ }
98
+
99
+ // High contrast mode support
100
+ @include m.high-contrast {
101
+ border-top: 1px solid currentColor;
102
+ }
103
+ }