mtrl 0.2.6 → 0.2.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 (147) hide show
  1. package/index.ts +18 -0
  2. package/package.json +1 -1
  3. package/src/components/badge/_styles.scss +117 -109
  4. package/src/components/badge/api.ts +57 -59
  5. package/src/components/badge/badge.ts +16 -2
  6. package/src/components/badge/config.ts +65 -11
  7. package/src/components/badge/constants.ts +22 -12
  8. package/src/components/badge/features.ts +44 -40
  9. package/src/components/badge/types.ts +42 -30
  10. package/src/components/bottom-app-bar/_styles.scss +103 -0
  11. package/src/components/bottom-app-bar/bottom-app-bar.ts +196 -0
  12. package/src/components/bottom-app-bar/config.ts +73 -0
  13. package/src/components/bottom-app-bar/index.ts +11 -0
  14. package/src/components/bottom-app-bar/types.ts +108 -0
  15. package/src/components/button/_styles.scss +0 -10
  16. package/src/components/button/api.ts +5 -0
  17. package/src/components/button/config.ts +5 -0
  18. package/src/components/button/types.ts +6 -0
  19. package/src/components/card/card.ts +13 -25
  20. package/src/components/card/config.ts +67 -22
  21. package/src/components/card/features.ts +3 -0
  22. package/src/components/card/types.ts +28 -0
  23. package/src/components/checkbox/_styles.scss +0 -2
  24. package/src/components/datepicker/_styles.scss +358 -0
  25. package/src/components/datepicker/api.ts +272 -0
  26. package/src/components/datepicker/config.ts +144 -0
  27. package/src/components/datepicker/constants.ts +98 -0
  28. package/src/components/datepicker/datepicker.ts +346 -0
  29. package/src/components/datepicker/index.ts +9 -0
  30. package/src/components/datepicker/render.ts +452 -0
  31. package/src/components/datepicker/types.ts +268 -0
  32. package/src/components/datepicker/utils.ts +290 -0
  33. package/src/components/dialog/_styles.scss +174 -128
  34. package/src/components/dialog/api.ts +48 -13
  35. package/src/components/dialog/config.ts +9 -5
  36. package/src/components/dialog/dialog.ts +6 -3
  37. package/src/components/dialog/features.ts +290 -130
  38. package/src/components/dialog/types.ts +7 -4
  39. package/src/components/divider/_styles.scss +57 -0
  40. package/src/components/divider/config.ts +81 -0
  41. package/src/components/divider/divider.ts +37 -0
  42. package/src/components/divider/features.ts +207 -0
  43. package/src/components/divider/index.ts +5 -0
  44. package/src/components/divider/types.ts +55 -0
  45. package/src/components/extended-fab/_styles.scss +267 -0
  46. package/src/components/extended-fab/api.ts +141 -0
  47. package/src/components/extended-fab/config.ts +108 -0
  48. package/src/components/extended-fab/constants.ts +36 -0
  49. package/src/components/extended-fab/extended-fab.ts +125 -0
  50. package/src/components/extended-fab/index.ts +4 -0
  51. package/src/components/extended-fab/types.ts +287 -0
  52. package/src/components/fab/_styles.scss +225 -0
  53. package/src/components/fab/api.ts +97 -0
  54. package/src/components/fab/config.ts +94 -0
  55. package/src/components/fab/constants.ts +41 -0
  56. package/src/components/fab/fab.ts +67 -0
  57. package/src/components/fab/index.ts +4 -0
  58. package/src/components/fab/types.ts +234 -0
  59. package/src/components/navigation/_styles.scss +1 -0
  60. package/src/components/navigation/api.ts +78 -50
  61. package/src/components/navigation/features/items.ts +280 -0
  62. package/src/components/navigation/nav-item.ts +72 -23
  63. package/src/components/navigation/navigation.ts +54 -2
  64. package/src/components/navigation/types.ts +210 -188
  65. package/src/components/search/_styles.scss +306 -0
  66. package/src/components/search/api.ts +203 -0
  67. package/src/components/search/config.ts +87 -0
  68. package/src/components/search/constants.ts +21 -0
  69. package/src/components/search/features/index.ts +4 -0
  70. package/src/components/search/features/search.ts +718 -0
  71. package/src/components/search/features/states.ts +165 -0
  72. package/src/components/search/features/structure.ts +198 -0
  73. package/src/components/search/index.ts +10 -0
  74. package/src/components/search/search.ts +52 -0
  75. package/src/components/search/types.ts +163 -0
  76. package/src/components/segmented-button/_styles.scss +117 -0
  77. package/src/components/segmented-button/config.ts +67 -0
  78. package/src/components/segmented-button/constants.ts +42 -0
  79. package/src/components/segmented-button/index.ts +4 -0
  80. package/src/components/segmented-button/segment.ts +155 -0
  81. package/src/components/segmented-button/segmented-button.ts +250 -0
  82. package/src/components/segmented-button/types.ts +219 -0
  83. package/src/components/slider/_styles.scss +83 -24
  84. package/src/components/slider/accessibility.md +5 -5
  85. package/src/components/slider/api.ts +41 -120
  86. package/src/components/slider/config.ts +51 -47
  87. package/src/components/slider/features/handlers.ts +495 -0
  88. package/src/components/slider/features/index.ts +1 -2
  89. package/src/components/slider/features/slider.ts +66 -84
  90. package/src/components/slider/features/states.ts +195 -0
  91. package/src/components/slider/features/structure.ts +136 -206
  92. package/src/components/slider/features/ui.ts +145 -206
  93. package/src/components/slider/index.ts +2 -11
  94. package/src/components/slider/slider.ts +9 -12
  95. package/src/components/slider/types.ts +39 -24
  96. package/src/components/switch/_styles.scss +0 -2
  97. package/src/components/tabs/_styles.scss +94 -32
  98. package/src/components/tabs/features.ts +4 -2
  99. package/src/components/tabs/indicator.ts +73 -13
  100. package/src/components/tabs/types.ts +10 -2
  101. package/src/components/timepicker/README.md +277 -0
  102. package/src/components/timepicker/_styles.scss +451 -0
  103. package/src/components/timepicker/api.ts +632 -0
  104. package/src/components/timepicker/clockdial.ts +482 -0
  105. package/src/components/timepicker/config.ts +130 -0
  106. package/src/components/timepicker/constants.ts +138 -0
  107. package/src/components/timepicker/index.ts +8 -0
  108. package/src/components/timepicker/render.ts +613 -0
  109. package/src/components/timepicker/timepicker.ts +117 -0
  110. package/src/components/timepicker/types.ts +336 -0
  111. package/src/components/timepicker/utils.ts +241 -0
  112. package/src/components/top-app-bar/_styles.scss +225 -0
  113. package/src/components/top-app-bar/config.ts +83 -0
  114. package/src/components/top-app-bar/index.ts +11 -0
  115. package/src/components/top-app-bar/top-app-bar.ts +316 -0
  116. package/src/components/top-app-bar/types.ts +140 -0
  117. package/src/core/build/_ripple.scss +6 -6
  118. package/src/core/build/ripple.ts +72 -95
  119. package/src/core/compose/features/icon.ts +3 -1
  120. package/src/core/compose/features/ripple.ts +4 -1
  121. package/src/core/compose/features/textlabel.ts +26 -2
  122. package/src/core/dom/create.ts +5 -0
  123. package/src/index.ts +9 -0
  124. package/src/styles/abstract/_theme.scss +9 -1
  125. package/src/styles/themes/_autumn.scss +21 -0
  126. package/src/styles/themes/_base-theme.scss +61 -0
  127. package/src/styles/themes/_baseline.scss +58 -0
  128. package/src/styles/themes/_bluekhaki.scss +125 -0
  129. package/src/styles/themes/_brownbeige.scss +125 -0
  130. package/src/styles/themes/_browngreen.scss +125 -0
  131. package/src/styles/themes/_forest.scss +6 -0
  132. package/src/styles/themes/_greenbeige.scss +125 -0
  133. package/src/styles/themes/_material.scss +125 -0
  134. package/src/styles/themes/_ocean.scss +6 -0
  135. package/src/styles/themes/_sageivory.scss +125 -0
  136. package/src/styles/themes/_spring.scss +6 -0
  137. package/src/styles/themes/_summer.scss +5 -0
  138. package/src/styles/themes/_sunset.scss +5 -0
  139. package/src/styles/themes/_tealcaramel.scss +125 -0
  140. package/src/styles/themes/_winter.scss +6 -0
  141. package/src/components/navigation/features/items.js +0 -192
  142. package/src/components/slider/features/appearance.ts +0 -94
  143. package/src/components/slider/features/disabled.ts +0 -68
  144. package/src/components/slider/features/events.ts +0 -164
  145. package/src/components/slider/features/interactions.ts +0 -396
  146. package/src/components/slider/features/keyboard.ts +0 -233
  147. package/src/core/collection/adapters/mongodb.js +0 -232
@@ -0,0 +1,138 @@
1
+ // src/components/timepicker/constants.ts
2
+
3
+ import {
4
+ TIME_PICKER_TYPE,
5
+ TIME_PICKER_ORIENTATION,
6
+ TIME_FORMAT,
7
+ TIME_PERIOD
8
+ } from './types';
9
+
10
+ /**
11
+ * Default clock icon for time picker.
12
+ * Simple clock SVG.
13
+ */
14
+ export const DEFAULT_CLOCK_ICON = `
15
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
16
+ <circle cx="12" cy="12" r="10"></circle>
17
+ <polyline points="12 6 12 12 16 14"></polyline>
18
+ </svg>
19
+ `;
20
+
21
+ /**
22
+ * Default keyboard icon for time picker.
23
+ * Simple keyboard SVG.
24
+ */
25
+ export const DEFAULT_KEYBOARD_ICON = `
26
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
27
+ <rect x="2" y="4" width="20" height="16" rx="2" ry="2"></rect>
28
+ <line x1="6" y1="8" x2="6" y2="8"></line>
29
+ <line x1="10" y1="8" x2="10" y2="8"></line>
30
+ <line x1="14" y1="8" x2="14" y2="8"></line>
31
+ <line x1="18" y1="8" x2="18" y2="8"></line>
32
+ <line x1="6" y1="12" x2="6" y2="12"></line>
33
+ <line x1="10" y1="12" x2="10" y2="12"></line>
34
+ <line x1="14" y1="12" x2="14" y2="12"></line>
35
+ <line x1="18" y1="12" x2="18" y2="12"></line>
36
+ <line x1="6" y1="16" x2="18" y2="16"></line>
37
+ </svg>
38
+ `;
39
+
40
+ /**
41
+ * Element selectors for time picker components.
42
+ * Used for DOM manipulation and event delegation.
43
+ */
44
+ export const SELECTORS = {
45
+ CONTAINER: '.mtrl-time-picker',
46
+ MODAL: '.mtrl-time-picker-modal',
47
+ DIALOG: '.mtrl-time-picker-dialog',
48
+ TITLE: '.mtrl-time-picker-title',
49
+ CONTENT: '.mtrl-time-picker-content',
50
+ DIAL: '.mtrl-time-picker-dial',
51
+ DIAL_CANVAS: '.mtrl-time-picker-dial-canvas',
52
+ DIAL_FACE: '.mtrl-time-picker-dial-face',
53
+ DIAL_HAND: '.mtrl-time-picker-dial-hand',
54
+ DIAL_CENTER: '.mtrl-time-picker-dial-center',
55
+ DIAL_NUMBERS: '.mtrl-time-picker-dial-numbers',
56
+ DIAL_NUMBER: '.mtrl-time-picker-dial-number',
57
+ INPUT_CONTAINER: '.mtrl-time-picker-input-container',
58
+ HOURS_INPUT: '.mtrl-time-picker-hours',
59
+ MINUTES_INPUT: '.mtrl-time-picker-minutes',
60
+ SECONDS_INPUT: '.mtrl-time-picker-seconds',
61
+ SEPARATOR: '.mtrl-time-picker-separator',
62
+ PERIOD_CONTAINER: '.mtrl-time-picker-period',
63
+ PERIOD_AM: '.mtrl-time-picker-period-am',
64
+ PERIOD_PM: '.mtrl-time-picker-period-pm',
65
+ ACTIONS: '.mtrl-time-picker-actions',
66
+ TOGGLE_TYPE_BUTTON: '.mtrl-time-picker-toggle-type',
67
+ CANCEL_BUTTON: '.mtrl-time-picker-cancel',
68
+ CONFIRM_BUTTON: '.mtrl-time-picker-confirm',
69
+ };
70
+
71
+ export const DIAL_CONSTANTS = {
72
+ DIAMETER: 256,
73
+ INNER_RADIUS: 65,
74
+ OUTER_RADIUS: 110,
75
+ NUMBER_SIZE: 40,
76
+ CENTER_SIZE: 8,
77
+ HAND_SIZE: 36,
78
+ TRACK_WIDTH: 2,
79
+ };
80
+
81
+
82
+ /**
83
+ * Z-index values for different parts of the time picker.
84
+ */
85
+ export const Z_INDEX = {
86
+ MODAL: 1050,
87
+ DIALOG: 1051,
88
+ };
89
+
90
+ /**
91
+ * Time constants used in the time picker.
92
+ */
93
+ export const TIME_CONSTANTS = {
94
+ HOURS_12: Array.from({ length: 12 }, (_, i) => (i === 0 ? 12 : i)),
95
+ HOURS_24: Array.from({ length: 24 }, (_, i) => i),
96
+ MINUTES: Array.from({ length: 60 }, (_, i) => i),
97
+ SECONDS: Array.from({ length: 60 }, (_, i) => i),
98
+ };
99
+
100
+ /**
101
+ * Custom events fired by the time picker.
102
+ */
103
+ export const EVENTS = {
104
+ CHANGE: 'change',
105
+ OPEN: 'open',
106
+ CLOSE: 'close',
107
+ CONFIRM: 'confirm',
108
+ CANCEL: 'cancel',
109
+ };
110
+
111
+ /**
112
+ * Animation timing for the time picker.
113
+ */
114
+ export const ANIMATION = {
115
+ OPEN_DURATION: 300,
116
+ CLOSE_DURATION: 200,
117
+ DIAL_SELECT_DURATION: 150,
118
+ };
119
+
120
+ /**
121
+ * Size constants for the time input fields.
122
+ */
123
+ export const INPUT_CONSTANTS = {
124
+ FIELD_WIDTH: 96,
125
+ FIELD_HEIGHT: 72,
126
+ PERIOD_WIDTH: 52,
127
+ PERIOD_HEIGHT: 72,
128
+ };
129
+
130
+ /**
131
+ * Time picker type exports for convenience.
132
+ */
133
+ export {
134
+ TIME_PICKER_TYPE,
135
+ TIME_PICKER_ORIENTATION,
136
+ TIME_FORMAT,
137
+ TIME_PERIOD
138
+ };
@@ -0,0 +1,8 @@
1
+ export { default } from './timepicker';
2
+ export {
3
+ TIME_PICKER_TYPE,
4
+ TIME_PICKER_ORIENTATION,
5
+ TIME_FORMAT,
6
+ TIME_PERIOD
7
+ } from './constants';
8
+ export type { TimePickerConfig, TimePickerComponent, TimeValue } from './types';