mtrl 0.2.7 → 0.2.9

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 (190) hide show
  1. package/index.ts +2 -0
  2. package/package.json +14 -3
  3. package/src/components/badge/api.ts +23 -14
  4. package/src/components/badge/badge.ts +2 -2
  5. package/src/components/badge/config.ts +10 -11
  6. package/src/components/badge/features.ts +15 -10
  7. package/src/components/badge/index.ts +27 -2
  8. package/src/components/badge/types.ts +28 -8
  9. package/src/components/bottom-app-bar/bottom-app-bar.ts +2 -44
  10. package/src/components/bottom-app-bar/config.ts +1 -45
  11. package/src/components/bottom-app-bar/index.ts +7 -1
  12. package/src/components/bottom-app-bar/types.ts +7 -1
  13. package/src/components/button/button.ts +0 -1
  14. package/src/components/button/config.ts +1 -2
  15. package/src/components/button/index.ts +10 -2
  16. package/src/components/button/types.ts +14 -2
  17. package/src/components/card/config.ts +17 -9
  18. package/src/components/card/content.ts +8 -10
  19. package/src/components/card/features.ts +4 -6
  20. package/src/components/card/index.ts +29 -2
  21. package/src/components/card/types.ts +6 -23
  22. package/src/components/checkbox/config.ts +3 -4
  23. package/src/components/checkbox/index.ts +1 -2
  24. package/src/components/checkbox/types.ts +12 -3
  25. package/src/components/chip/api.ts +170 -221
  26. package/src/components/chip/chip.ts +34 -302
  27. package/src/components/chip/config.ts +1 -2
  28. package/src/components/chip/index.ts +10 -2
  29. package/src/components/chip/types.ts +224 -35
  30. package/src/components/datepicker/api.ts +18 -25
  31. package/src/components/datepicker/config.ts +9 -12
  32. package/src/components/datepicker/datepicker.ts +7 -12
  33. package/src/components/datepicker/index.ts +10 -7
  34. package/src/components/datepicker/render.ts +16 -18
  35. package/src/components/datepicker/types.ts +164 -35
  36. package/src/components/datepicker/utils.ts +1 -2
  37. package/src/components/dialog/api.ts +7 -8
  38. package/src/components/dialog/config.ts +3 -4
  39. package/src/components/dialog/features.ts +56 -22
  40. package/src/components/dialog/index.ts +38 -8
  41. package/src/components/dialog/types.ts +33 -10
  42. package/src/components/divider/index.ts +5 -1
  43. package/src/components/extended-fab/config.ts +6 -2
  44. package/src/components/extended-fab/index.ts +7 -2
  45. package/src/components/extended-fab/types.ts +21 -4
  46. package/src/components/fab/config.ts +3 -4
  47. package/src/components/fab/fab.ts +1 -1
  48. package/src/components/fab/index.ts +7 -2
  49. package/src/components/fab/types.ts +21 -4
  50. package/src/components/list/config.ts +4 -5
  51. package/src/components/list/features.ts +6 -7
  52. package/src/components/list/index.ts +7 -9
  53. package/src/components/list/list-item.ts +12 -13
  54. package/src/components/list/types.ts +50 -5
  55. package/src/components/list/utils.ts +30 -3
  56. package/src/components/menu/features/items-manager.ts +9 -9
  57. package/src/components/menu/features/positioning.ts +7 -7
  58. package/src/components/menu/features/visibility.ts +7 -7
  59. package/src/components/menu/index.ts +7 -9
  60. package/src/components/menu/menu-item.ts +6 -6
  61. package/src/components/menu/menu.ts +22 -0
  62. package/src/components/menu/types.ts +29 -10
  63. package/src/components/menu/utils.ts +67 -0
  64. package/src/components/navigation/api.ts +131 -96
  65. package/src/components/navigation/config.ts +22 -10
  66. package/src/components/navigation/features/controller.ts +273 -0
  67. package/src/components/navigation/features/items.ts +160 -87
  68. package/src/components/navigation/index.ts +0 -6
  69. package/src/components/navigation/nav-item.ts +12 -24
  70. package/src/components/navigation/navigation.ts +21 -8
  71. package/src/components/navigation/system-types.ts +124 -0
  72. package/src/components/navigation/system.ts +776 -0
  73. package/src/components/navigation/types.ts +228 -203
  74. package/src/components/progress/api.ts +2 -3
  75. package/src/components/progress/config.ts +2 -3
  76. package/src/components/progress/index.ts +0 -1
  77. package/src/components/progress/progress.ts +1 -2
  78. package/src/components/progress/types.ts +186 -33
  79. package/src/components/radios/config.ts +1 -1
  80. package/src/components/radios/index.ts +0 -1
  81. package/src/components/radios/types.ts +0 -7
  82. package/src/components/search/config.ts +1 -2
  83. package/src/components/search/features/search.ts +14 -15
  84. package/src/components/search/features/states.ts +5 -1
  85. package/src/components/search/features/structure.ts +3 -4
  86. package/src/components/search/index.ts +0 -3
  87. package/src/components/search/types.ts +18 -6
  88. package/src/components/segmented-button/config.ts +20 -7
  89. package/src/components/segmented-button/segment.ts +6 -7
  90. package/src/components/segmented-button/segmented-button.ts +4 -5
  91. package/src/components/segmented-button/types.ts +37 -2
  92. package/src/components/slider/config.ts +20 -2
  93. package/src/components/slider/features/controller.ts +761 -0
  94. package/src/components/slider/features/handlers.ts +18 -15
  95. package/src/components/slider/features/index.ts +3 -2
  96. package/src/components/slider/features/range.ts +104 -0
  97. package/src/components/slider/slider.ts +34 -14
  98. package/src/components/slider/structure.ts +152 -0
  99. package/src/components/slider/types.ts +34 -8
  100. package/src/components/snackbar/config.ts +2 -3
  101. package/src/components/snackbar/constants.ts +0 -32
  102. package/src/components/snackbar/index.ts +0 -1
  103. package/src/components/snackbar/position.ts +9 -1
  104. package/src/components/snackbar/types.ts +122 -46
  105. package/src/components/switch/config.ts +2 -3
  106. package/src/components/switch/index.ts +0 -1
  107. package/src/components/switch/types.ts +3 -2
  108. package/src/components/tabs/config.ts +3 -4
  109. package/src/components/tabs/index.ts +0 -15
  110. package/src/components/tabs/tab-api.ts +12 -4
  111. package/src/components/tabs/tab.ts +18 -6
  112. package/src/components/tabs/types.ts +13 -3
  113. package/src/components/textfield/api.ts +53 -0
  114. package/src/components/textfield/config.ts +2 -3
  115. package/src/components/textfield/features.ts +322 -0
  116. package/src/components/textfield/index.ts +0 -1
  117. package/src/components/textfield/textfield.ts +8 -0
  118. package/src/components/textfield/types.ts +29 -6
  119. package/src/components/timepicker/api.ts +1 -1
  120. package/src/components/timepicker/clockdial.ts +2 -5
  121. package/src/components/timepicker/config.ts +102 -4
  122. package/src/components/timepicker/index.ts +1 -6
  123. package/src/components/timepicker/render.ts +1 -1
  124. package/src/components/timepicker/timepicker.ts +1 -1
  125. package/src/components/tooltip/api.ts +1 -1
  126. package/src/components/tooltip/config.ts +27 -6
  127. package/src/components/tooltip/index.ts +0 -1
  128. package/src/components/tooltip/types.ts +13 -3
  129. package/src/core/compose/features/textinput.ts +15 -2
  130. package/src/core/compose/features/textlabel.ts +0 -3
  131. package/src/core/composition/features/dom.ts +33 -0
  132. package/src/core/composition/features/icon.ts +131 -0
  133. package/src/core/composition/features/index.ts +11 -0
  134. package/src/core/composition/features/label.ts +156 -0
  135. package/src/core/composition/features/structure.ts +22 -0
  136. package/src/core/composition/index.ts +26 -0
  137. package/src/core/index.ts +1 -1
  138. package/src/core/structure.ts +288 -0
  139. package/src/index.ts +1 -0
  140. package/src/styles/components/_navigation-mobile.scss +244 -0
  141. package/src/styles/components/_navigation-system.scss +151 -0
  142. package/src/{components/tabs/_styles.scss → styles/components/_tabs.scss} +1 -1
  143. package/src/{components/textfield/_styles.scss → styles/components/_textfield.scss} +314 -72
  144. package/src/styles/main.scss +98 -49
  145. package/src/components/badge/constants.ts +0 -40
  146. package/src/components/button/constants.ts +0 -11
  147. package/src/components/card/constants.ts +0 -84
  148. package/src/components/datepicker/constants.ts +0 -98
  149. package/src/components/dialog/constants.ts +0 -32
  150. package/src/components/extended-fab/constants.ts +0 -36
  151. package/src/components/fab/constants.ts +0 -41
  152. package/src/components/menu/constants.ts +0 -154
  153. package/src/components/navigation/constants.ts +0 -200
  154. package/src/components/progress/constants.ts +0 -29
  155. package/src/components/search/constants.ts +0 -21
  156. package/src/components/segmented-button/constants.ts +0 -42
  157. package/src/components/slider/features/slider.ts +0 -318
  158. package/src/components/slider/features/structure.ts +0 -181
  159. package/src/components/slider/features/ui.ts +0 -388
  160. package/src/components/switch/constants.ts +0 -80
  161. package/src/components/tabs/constants.ts +0 -89
  162. package/src/components/textfield/constants.ts +0 -100
  163. package/src/components/timepicker/constants.ts +0 -138
  164. /package/src/{components/badge/_styles.scss → styles/components/_badge.scss} +0 -0
  165. /package/src/{components/bottom-app-bar/_styles.scss → styles/components/_bottom-app-bar.scss} +0 -0
  166. /package/src/{components/button/_styles.scss → styles/components/_button.scss} +0 -0
  167. /package/src/{components/card/_styles.scss → styles/components/_card.scss} +0 -0
  168. /package/src/{components/carousel/_styles.scss → styles/components/_carousel.scss} +0 -0
  169. /package/src/{components/checkbox/_styles.scss → styles/components/_checkbox.scss} +0 -0
  170. /package/src/{components/chip/_styles.scss → styles/components/_chip.scss} +0 -0
  171. /package/src/{components/datepicker/_styles.scss → styles/components/_datepicker.scss} +0 -0
  172. /package/src/{components/dialog/_styles.scss → styles/components/_dialog.scss} +0 -0
  173. /package/src/{components/divider/_styles.scss → styles/components/_divider.scss} +0 -0
  174. /package/src/{components/extended-fab/_styles.scss → styles/components/_extended-fab.scss} +0 -0
  175. /package/src/{components/fab/_styles.scss → styles/components/_fab.scss} +0 -0
  176. /package/src/{components/list/_styles.scss → styles/components/_list.scss} +0 -0
  177. /package/src/{components/menu/_styles.scss → styles/components/_menu.scss} +0 -0
  178. /package/src/{components/navigation/_styles.scss → styles/components/_navigation.scss} +0 -0
  179. /package/src/{components/progress/_styles.scss → styles/components/_progress.scss} +0 -0
  180. /package/src/{components/radios/_styles.scss → styles/components/_radios.scss} +0 -0
  181. /package/src/{components/search/_styles.scss → styles/components/_search.scss} +0 -0
  182. /package/src/{components/segmented-button/_styles.scss → styles/components/_segmented-button.scss} +0 -0
  183. /package/src/{components/sheet/_styles.scss → styles/components/_sheet.scss} +0 -0
  184. /package/src/{components/slider/_styles.scss → styles/components/_slider.scss} +0 -0
  185. /package/src/{components/snackbar/_styles.scss → styles/components/_snackbar.scss} +0 -0
  186. /package/src/{components/switch/_styles.scss → styles/components/_switch.scss} +0 -0
  187. /package/src/{components/timepicker/_styles.scss → styles/components/_timepicker.scss} +0 -0
  188. /package/src/{components/tooltip/_styles.scss → styles/components/_tooltip.scss} +0 -0
  189. /package/src/{components/top-app-bar/_styles.scss → styles/components/_top-app-bar.scss} +0 -0
  190. /package/src/styles/utilities/{_color.scss → _colors.scss} +0 -0
@@ -1,32 +1,17 @@
1
1
  // src/styles/main.scss
2
2
 
3
+ // Import Sass modules
4
+ @use 'sass:map';
5
+ @use 'sass:list' as sasslist;
6
+ @use 'sass:math';
7
+
3
8
  // Abstract layer
4
9
  @use 'abstract/base';
5
- @use 'abstract/variables';
6
- @use 'abstract/functions';
7
- @use 'abstract/mixins';
8
- @use 'abstract/theme';
9
-
10
- // Themes
11
- @use 'themes/index';
10
+ @use 'abstract/variables' as v;
11
+ @use 'abstract/functions' as f;
12
+ @use 'abstract/mixins' as m;
13
+ @use 'abstract/theme' as t;
12
14
 
13
- // Reset
14
- @use 'base/reset';
15
- @use 'base/typography';
16
-
17
- // Components
18
- @use '../components/button/styles';
19
- @use '../components/checkbox/styles';
20
- @use '../components/container/styles';
21
- @use '../components/list/styles';
22
- @use '../components/menu/styles';
23
- @use '../components/navigation/styles';
24
- @use '../components/snackbar/styles';
25
- @use '../components/switch/styles';
26
- @use '../components/textfield/styles';
27
-
28
-
29
- @use '../core/build/ripple/ripple';
30
15
 
31
16
  // Utilities
32
17
  @use 'utilities/spacing';
@@ -35,41 +20,105 @@
35
20
  @use 'utilities/flexbox';
36
21
  @use 'utilities/typography';
37
22
 
23
+ // Themes
24
+ @use 'themes/index';
25
+
26
+ // Reset
27
+ @use 'base/reset';
28
+ //@use 'base/typography';
29
+
30
+ // Components
31
+ @use './components/textfield' as textfield;
32
+ @use './components/badge' as badge;
33
+ @use './components/bottom-app-bar' as bottom-app-bar;
34
+ @use './components/menu' as menu;
35
+ @use './components/slider' as slider;
36
+ @use './components/switch' as switch;
37
+ @use './components/tabs' as tabs;
38
+ @use './components/top-app-bar' as top-app-bar;
39
+
40
+ @use '../components/styles/button' as button;
41
+ @use '../components/styles/fab' as fab;
42
+ @use '../components/styles/extended-fab' as extended-fab;
43
+ @use '../components/styles/segmented-button' as segmented-button;
44
+ @use '../components/styles/card' as card;
45
+ @use '../components/styles/carousel' as carousel;
46
+ @use '../components/styles/checkbox' as checkbox;
47
+ @use '../components/styles/chip' as chip;
48
+ @use '../components/styles/datepicker' as datepicker;
49
+ @use '../components/styles/dialog' as dialog;
50
+ @use '../components/styles/divider' as divider;
51
+
52
+ @use '../components/styles/progress' as progress;
53
+
54
+ @use '../components/styles/radios' as radios;
55
+ @use '../components/styles/timepicker' as timepicker;
56
+ @use '../components/styles/search' as search;
57
+
58
+ @use '../components/styles/snackbar' as snackbar;
59
+ @use '../components/styles/navigation' as navigation;
60
+ @use '../components/styles/list' as list;
61
+
62
+ @use '../core/build/ripple';
63
+
38
64
  // Initialize theme system
39
65
  :root {
40
66
  // Apply the base theme CSS variables
41
- @include theme.light-theme;
67
+ @include t.light-theme;
42
68
 
43
- // State layer variables
44
- @each $key, $value in theme.$mtrl-sys-state {
45
- --#{base.$prefix}-sys-state-#{$key}: #{$value};
46
- }
69
+ // State layer variables - accessing individual values
70
+ --#{base.$prefix}-sys-state-hover-state-layer-opacity: #{v.state('hover-state-layer-opacity')};
71
+ --#{base.$prefix}-sys-state-focus-state-layer-opacity: #{v.state('focus-state-layer-opacity')};
72
+ --#{base.$prefix}-sys-state-pressed-state-layer-opacity: #{v.state('pressed-state-layer-opacity')};
73
+ --#{base.$prefix}-sys-state-dragged-state-layer-opacity: #{v.state('dragged-state-layer-opacity')};
47
74
 
48
- // Motion variables
49
- @each $key, $value in theme.$mtrl-sys-motion {
50
- --#{base.$prefix}-sys-motion-#{$key}: #{$value};
51
- }
52
-
53
- // Shape variables
54
- @each $key, $value in theme.$mtrl-sys-shape {
55
- --#{base.$prefix}-sys-shape-#{$key}: #{$value};
56
- }
75
+ // Motion variables - accessing individual values
76
+ --#{base.$prefix}-sys-motion-duration-short1: #{v.motion('duration-short1')};
77
+ --#{base.$prefix}-sys-motion-duration-short2: #{v.motion('duration-short2')};
78
+ --#{base.$prefix}-sys-motion-duration-short3: #{v.motion('duration-short3')};
79
+ --#{base.$prefix}-sys-motion-duration-short4: #{v.motion('duration-short4')};
80
+ --#{base.$prefix}-sys-motion-duration-medium1: #{v.motion('duration-medium1')};
81
+ --#{base.$prefix}-sys-motion-duration-medium2: #{v.motion('duration-medium2')};
82
+ --#{base.$prefix}-sys-motion-duration-long1: #{v.motion('duration-long1')};
83
+ --#{base.$prefix}-sys-motion-duration-long2: #{v.motion('duration-long2')};
84
+ --#{base.$prefix}-sys-motion-easing-standard: #{v.motion('easing-standard')};
85
+ --#{base.$prefix}-sys-motion-easing-standard-accelerate: #{v.motion('easing-standard-accelerate')};
86
+ --#{base.$prefix}-sys-motion-easing-standard-decelerate: #{v.motion('easing-standard-decelerate')};
87
+ --#{base.$prefix}-sys-motion-easing-emphasized: #{v.motion('easing-emphasized')};
88
+ --#{base.$prefix}-sys-motion-easing-emphasized-accelerate: #{v.motion('easing-emphasized-accelerate')};
89
+ --#{base.$prefix}-sys-motion-easing-emphasized-decelerate: #{v.motion('easing-emphasized-decelerate')};
90
+
91
+ // Shape variables - accessing individual values
92
+ --#{base.$prefix}-sys-shape-none: #{v.shape('none')};
93
+ --#{base.$prefix}-sys-shape-extra-tiny: #{v.shape('extra-tiny')};
94
+ --#{base.$prefix}-sys-shape-tiny: #{v.shape('tiny')};
95
+ --#{base.$prefix}-sys-shape-extra-small: #{v.shape('extra-small')};
96
+ --#{base.$prefix}-sys-shape-small: #{v.shape('small')};
97
+ --#{base.$prefix}-sys-shape-medium: #{v.shape('medium')};
98
+ --#{base.$prefix}-sys-shape-large: #{v.shape('large')};
99
+ --#{base.$prefix}-sys-shape-extra-large: #{v.shape('extra-large')};
100
+ --#{base.$prefix}-sys-shape-full: #{v.shape('full')};
101
+ --#{base.$prefix}-sys-shape-pill: #{v.shape('pill')};
57
102
 
58
- // Typography
59
- @each $scale, $properties in variables.$typescale {
60
- --#{base.$prefix}-sys-typescale-#{$scale}-font-family-name: #{nth(map-get($properties, font-family), 1)};
61
- --#{base.$prefix}-sys-typescale-#{$scale}-font-family-fallback: #{if(length(map-get($properties, font-family)) > 1, nth(map-get($properties, font-family), 2), 'sans-serif')};
62
- --#{base.$prefix}-sys-typescale-#{$scale}-font-size: #{map-get($properties, font-size)};
63
- --#{base.$prefix}-sys-typescale-#{$scale}-line-height: #{map-get($properties, line-height)};
64
- --#{base.$prefix}-sys-typescale-#{$scale}-letter-spacing: #{map-get($properties, letter-spacing)};
65
- --#{base.$prefix}-sys-typescale-#{$scale}-font-weight: #{map-get($properties, font-weight)};
103
+ // Typography - extracting individual properties
104
+ @each $scale, $properties in v.$typescale {
105
+ $font-family: map.get($properties, 'font-family');
106
+ $primary-font: sasslist.nth($font-family, 1);
107
+ $fallback-font: if(sasslist.length($font-family) > 1, sasslist.nth($font-family, 2), 'sans-serif');
108
+
109
+ --#{base.$prefix}-sys-typescale-#{$scale}-font-family-name: #{$primary-font};
110
+ --#{base.$prefix}-sys-typescale-#{$scale}-font-family-fallback: #{$fallback-font};
111
+ --#{base.$prefix}-sys-typescale-#{$scale}-font-size: #{map.get($properties, 'font-size')};
112
+ --#{base.$prefix}-sys-typescale-#{$scale}-line-height: #{map.get($properties, 'line-height')};
113
+ --#{base.$prefix}-sys-typescale-#{$scale}-letter-spacing: #{map.get($properties, 'letter-spacing')};
114
+ --#{base.$prefix}-sys-typescale-#{$scale}-font-weight: #{map.get($properties, 'font-weight')};
66
115
  }
67
116
  }
68
117
 
69
118
  // Dark mode support
70
119
  @media (prefers-color-scheme: dark) {
71
120
  :root:not([data-theme]) {
72
- @include theme.dark-theme;
121
+ @include t.dark-theme;
73
122
  }
74
123
  }
75
124
 
@@ -86,7 +135,7 @@ body {
86
135
  -webkit-font-smoothing: antialiased;
87
136
  -moz-osx-font-smoothing: grayscale;
88
137
 
89
- @include mixins.motion-transition(background-color, color);
138
+ @include m.motion-transition(background-color, color);
90
139
  }
91
140
 
92
141
  // Ensure links have the correct contrast
@@ -114,7 +163,7 @@ a {
114
163
  html {
115
164
  scroll-behavior: smooth;
116
165
 
117
- @include mixins.reduced-motion {
166
+ @include m.reduced-motion {
118
167
  scroll-behavior: auto;
119
168
  }
120
169
  }
@@ -1,40 +0,0 @@
1
- // src/components/badge/constants.ts
2
-
3
- /**
4
- * Badge variants
5
- * - SMALL: Simple dot badge (6dp diameter)
6
- * - LARGE: Numbered badge (16dp height)
7
- */
8
- export const BADGE_VARIANTS = {
9
- SMALL: 'small',
10
- LARGE: 'large'
11
- } as const;
12
-
13
- /**
14
- * Badge colors
15
- * ERROR is the default
16
- */
17
- export const BADGE_COLORS = {
18
- ERROR: 'error', // Default
19
- PRIMARY: 'primary',
20
- SECONDARY: 'secondary',
21
- TERTIARY: 'tertiary',
22
- SUCCESS: 'success',
23
- WARNING: 'warning',
24
- INFO: 'info'
25
- } as const;
26
-
27
- /**
28
- * Badge positions relative to its container
29
- */
30
- export const BADGE_POSITIONS = {
31
- TOP_RIGHT: 'top-right', // Default
32
- TOP_LEFT: 'top-left',
33
- BOTTOM_RIGHT: 'bottom-right',
34
- BOTTOM_LEFT: 'bottom-left'
35
- } as const;
36
-
37
- /**
38
- * Maximum character count for badge labels
39
- */
40
- export const BADGE_MAX_CHARACTERS = 4;
@@ -1,11 +0,0 @@
1
- // src/components/button/constants.ts
2
-
3
- import { RIPPLE_SCHEMA } from '../../core/build/constants'
4
-
5
- export const BUTTON_VARIANTS = {
6
- FILLED: 'filled',
7
- TONAL: 'tonal',
8
- OUTLINED: 'outlined',
9
- ELEVATED: 'elevated',
10
- TEXT: 'text'
11
- }
@@ -1,84 +0,0 @@
1
- // src/components/card/constants.ts
2
-
3
- import { CardVariant, CardElevation } from './types';
4
-
5
- /**
6
- * Card variant types following Material Design 3
7
- * @enum {string}
8
- */
9
- export const CARD_VARIANTS = {
10
- /** Elevated card with shadow */
11
- ELEVATED: CardVariant.ELEVATED,
12
- /** Filled card with higher surface container color */
13
- FILLED: CardVariant.FILLED,
14
- /** Outlined card with border */
15
- OUTLINED: CardVariant.OUTLINED
16
- };
17
-
18
- /**
19
- * Card elevation levels based on MD3 guidelines
20
- * Uses the MTRL elevation system values
21
- * @enum {number}
22
- */
23
- export const CARD_ELEVATIONS = {
24
- /** No elevation (for filled and outlined variants) */
25
- LEVEL0: CardElevation.LEVEL0,
26
- /** Default elevation for elevated cards */
27
- LEVEL1: CardElevation.LEVEL1,
28
- /** Elevation for hovered state */
29
- LEVEL2: CardElevation.LEVEL2,
30
- /** Elevation for dragged state */
31
- LEVEL4: CardElevation.LEVEL4
32
- };
33
-
34
- /**
35
- * Card validation schema
36
- * @const {Object}
37
- */
38
- export const CARD_SCHEMA = {
39
- variant: {
40
- type: 'string',
41
- enum: Object.values(CARD_VARIANTS),
42
- default: CARD_VARIANTS.ELEVATED
43
- },
44
- interactive: {
45
- type: 'boolean',
46
- default: false
47
- },
48
- fullWidth: {
49
- type: 'boolean',
50
- default: false
51
- },
52
- clickable: {
53
- type: 'boolean',
54
- default: false
55
- },
56
- draggable: {
57
- type: 'boolean',
58
- default: false
59
- },
60
- class: {
61
- type: 'string',
62
- required: false
63
- },
64
- headerConfig: {
65
- type: 'object',
66
- required: false
67
- },
68
- contentConfig: {
69
- type: 'object',
70
- required: false
71
- },
72
- actionsConfig: {
73
- type: 'object',
74
- required: false
75
- },
76
- mediaConfig: {
77
- type: 'object',
78
- required: false
79
- },
80
- aria: {
81
- type: 'object',
82
- required: false
83
- }
84
- };
@@ -1,98 +0,0 @@
1
- // src/components/datepicker/constants.ts
2
-
3
- /**
4
- * DatePicker variant types
5
- */
6
- export const DATEPICKER_VARIANTS = {
7
- /** Displays inline with a text field above the calendar */
8
- DOCKED: 'docked',
9
-
10
- /** Displays as a modal dialog */
11
- MODAL: 'modal',
12
-
13
- /** Displays as a modal dialog with text input */
14
- MODAL_INPUT: 'modal-input'
15
- };
16
-
17
- /**
18
- * DatePicker view types
19
- */
20
- export const DATEPICKER_VIEWS = {
21
- /** Calendar day selection view */
22
- DAY: 'day',
23
-
24
- /** Month selection view */
25
- MONTH: 'month',
26
-
27
- /** Year selection view */
28
- YEAR: 'year'
29
- };
30
-
31
- /**
32
- * DatePicker selection modes
33
- */
34
- export const DATEPICKER_SELECTION_MODES = {
35
- /** Single date selection */
36
- SINGLE: 'single',
37
-
38
- /** Date range selection */
39
- RANGE: 'range'
40
- };
41
-
42
- /**
43
- * Day names for the calendar
44
- */
45
- export const DAY_NAMES = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
46
-
47
- /**
48
- * Month names for the calendar
49
- */
50
- export const MONTH_NAMES = [
51
- 'January', 'February', 'March', 'April',
52
- 'May', 'June', 'July', 'August',
53
- 'September', 'October', 'November', 'December'
54
- ];
55
-
56
- /**
57
- * Month names abbreviated
58
- */
59
- export const MONTH_NAMES_SHORT = [
60
- 'Jan', 'Feb', 'Mar', 'Apr',
61
- 'May', 'Jun', 'Jul', 'Aug',
62
- 'Sep', 'Oct', 'Nov', 'Dec'
63
- ];
64
-
65
- /**
66
- * Default format for displaying dates
67
- */
68
- export const DEFAULT_DATE_FORMAT = 'MM/DD/YYYY';
69
-
70
- /**
71
- * CSS class name for today's date
72
- */
73
- export const TODAY_CLASS = 'today';
74
-
75
- /**
76
- * CSS class name for selected date
77
- */
78
- export const SELECTED_CLASS = 'selected';
79
-
80
- /**
81
- * CSS class name for dates outside the current month
82
- */
83
- export const OUTSIDE_MONTH_CLASS = 'outside-month';
84
-
85
- /**
86
- * CSS class for the first date in a range
87
- */
88
- export const RANGE_START_CLASS = 'range-start';
89
-
90
- /**
91
- * CSS class for the last date in a range
92
- */
93
- export const RANGE_END_CLASS = 'range-end';
94
-
95
- /**
96
- * CSS class for dates between start and end in a range
97
- */
98
- export const RANGE_MIDDLE_CLASS = 'range-middle';
@@ -1,32 +0,0 @@
1
- // src/components/dialog/constants.ts
2
-
3
- export const DIALOG_SIZES = {
4
- SMALL: 'small',
5
- MEDIUM: 'medium',
6
- LARGE: 'large',
7
- FULLWIDTH: 'fullwidth',
8
- FULLSCREEN: 'fullscreen'
9
- };
10
-
11
- export const DIALOG_ANIMATIONS = {
12
- SCALE: 'scale',
13
- SLIDE_UP: 'slide-up',
14
- SLIDE_DOWN: 'slide-down',
15
- FADE: 'fade'
16
- };
17
-
18
- export const DIALOG_FOOTER_ALIGNMENTS = {
19
- RIGHT: 'right',
20
- LEFT: 'left',
21
- CENTER: 'center',
22
- SPACE_BETWEEN: 'space-between'
23
- };
24
-
25
- export const DIALOG_EVENTS = {
26
- OPEN: 'open',
27
- CLOSE: 'close',
28
- BEFORE_OPEN: 'beforeopen',
29
- BEFORE_CLOSE: 'beforeclose',
30
- AFTER_OPEN: 'afteropen',
31
- AFTER_CLOSE: 'afterclose'
32
- };
@@ -1,36 +0,0 @@
1
- // src/components/extended-fab/constants.ts
2
- import { FAB_VARIANTS, FAB_POSITIONS } from '../fab/constants'
3
-
4
- /**
5
- * Re-export FAB variants for styling
6
- */
7
- export { FAB_VARIANTS }
8
-
9
- /**
10
- * Re-export FAB positions for fixed positioning
11
- */
12
- export { FAB_POSITIONS }
13
-
14
- /**
15
- * Extended FAB width behavior options
16
- */
17
- export const EXTENDED_FAB_WIDTH = {
18
- /** Fixed width based on content */
19
- FIXED: 'fixed',
20
- /** Fluid width that can adapt to container */
21
- FLUID: 'fluid'
22
- }
23
-
24
- /**
25
- * Extended FAB dimensions
26
- */
27
- export const EXTENDED_FAB_DIMENSIONS = {
28
- /** Standard height - 56dp */
29
- HEIGHT: 56,
30
- /** Minimum width - 80dp */
31
- MIN_WIDTH: 80,
32
- /** Padding - 16dp */
33
- PADDING: 16,
34
- /** Icon size - 24dp */
35
- ICON_SIZE: 24
36
- }
@@ -1,41 +0,0 @@
1
- // src/components/fab/constants.ts
2
-
3
- /**
4
- * FAB variants for styling
5
- */
6
- export const FAB_VARIANTS = {
7
- /** Primary container color with on-primary-container icons */
8
- PRIMARY: 'primary',
9
- /** Secondary container color with on-secondary-container icons */
10
- SECONDARY: 'secondary',
11
- /** Tertiary container color with on-tertiary-container icons */
12
- TERTIARY: 'tertiary',
13
- /** Surface color with primary color icons */
14
- SURFACE: 'surface'
15
- };
16
-
17
- /**
18
- * FAB size variants
19
- */
20
- export const FAB_SIZES = {
21
- /** Standard FAB size (56dp) */
22
- DEFAULT: 'default',
23
- /** Small FAB size (40dp) */
24
- SMALL: 'small',
25
- /** Large FAB size (96dp) */
26
- LARGE: 'large'
27
- };
28
-
29
- /**
30
- * FAB positions for fixed positioning
31
- */
32
- export const FAB_POSITIONS = {
33
- /** Top right corner */
34
- TOP_RIGHT: 'top-right',
35
- /** Top left corner */
36
- TOP_LEFT: 'top-left',
37
- /** Bottom right corner */
38
- BOTTOM_RIGHT: 'bottom-right',
39
- /** Bottom left corner */
40
- BOTTOM_LEFT: 'bottom-left'
41
- };
@@ -1,154 +0,0 @@
1
- // src/components/menu/constants.ts
2
-
3
- /**
4
- * Menu alignment options
5
- */
6
- export const MENU_ALIGN = {
7
- LEFT: 'left',
8
- RIGHT: 'right',
9
- CENTER: 'center'
10
- } as const;
11
-
12
- /**
13
- * Menu vertical alignment options
14
- */
15
- export const MENU_VERTICAL_ALIGN = {
16
- TOP: 'top',
17
- BOTTOM: 'bottom',
18
- MIDDLE: 'middle'
19
- } as const;
20
-
21
- /**
22
- * Menu item types
23
- */
24
- export const MENU_ITEM_TYPES = {
25
- ITEM: 'item',
26
- DIVIDER: 'divider'
27
- } as const;
28
-
29
- /**
30
- * Menu events
31
- */
32
- export const MENU_EVENTS = {
33
- SELECT: 'select',
34
- OPEN: 'open',
35
- CLOSE: 'close',
36
- SUBMENU_OPEN: 'submenuOpen',
37
- SUBMENU_CLOSE: 'submenuClose'
38
- } as const;
39
-
40
- /**
41
- * Menu states
42
- */
43
- export const MENU_STATES = {
44
- VISIBLE: 'visible',
45
- HIDDEN: 'hidden',
46
- DISABLED: 'disabled'
47
- } as const;
48
-
49
- /**
50
- * Menu element classes
51
- */
52
- export const MENU_CLASSES = {
53
- ROOT: 'menu',
54
- ITEM: 'menu-item',
55
- ITEM_CONTAINER: 'menu-item-container',
56
- LIST: 'menu-list',
57
- DIVIDER: 'menu-divider',
58
- SUBMENU: 'menu--submenu'
59
- } as const;
60
-
61
- /**
62
- * Menu positioning schema
63
- * Used for validation in component creation
64
- */
65
- export const MENU_POSITION_SCHEMA = {
66
- type: 'object',
67
- properties: {
68
- align: {
69
- type: 'string',
70
- enum: Object.values(MENU_ALIGN),
71
- optional: true,
72
- default: MENU_ALIGN.LEFT
73
- },
74
- vAlign: {
75
- type: 'string',
76
- enum: Object.values(MENU_VERTICAL_ALIGN),
77
- optional: true,
78
- default: MENU_VERTICAL_ALIGN.BOTTOM
79
- },
80
- offsetX: {
81
- type: 'number',
82
- optional: true,
83
- default: 0
84
- },
85
- offsetY: {
86
- type: 'number',
87
- optional: true,
88
- default: 0
89
- }
90
- }
91
- } as const;
92
-
93
- /**
94
- * Validation schema for menu configuration
95
- */
96
- export const MENU_SCHEMA = {
97
- type: 'object',
98
- properties: {
99
- items: {
100
- type: 'array',
101
- optional: true,
102
- default: []
103
- },
104
- class: {
105
- type: 'string',
106
- optional: true
107
- },
108
- stayOpenOnSelect: {
109
- type: 'boolean',
110
- optional: true,
111
- default: false
112
- },
113
- openingButton: {
114
- optional: true
115
- }
116
- }
117
- } as const;
118
-
119
- /**
120
- * Menu item schema
121
- */
122
- export const MENU_ITEM_SCHEMA = {
123
- type: 'object',
124
- properties: {
125
- name: {
126
- type: 'string',
127
- required: true
128
- },
129
- text: {
130
- type: 'string',
131
- required: true
132
- },
133
- type: {
134
- type: 'string',
135
- enum: Object.values(MENU_ITEM_TYPES),
136
- optional: true,
137
- default: MENU_ITEM_TYPES.ITEM
138
- },
139
- disabled: {
140
- type: 'boolean',
141
- optional: true,
142
- default: false
143
- },
144
- class: {
145
- type: 'string',
146
- optional: true
147
- },
148
- items: {
149
- type: 'array',
150
- optional: true,
151
- description: 'Submenu items'
152
- }
153
- }
154
- } as const;