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.
- package/index.ts +18 -0
- package/package.json +1 -1
- package/src/components/badge/_styles.scss +117 -109
- package/src/components/badge/api.ts +57 -59
- package/src/components/badge/badge.ts +16 -2
- package/src/components/badge/config.ts +65 -11
- package/src/components/badge/constants.ts +22 -12
- package/src/components/badge/features.ts +44 -40
- package/src/components/badge/types.ts +42 -30
- package/src/components/bottom-app-bar/_styles.scss +103 -0
- package/src/components/bottom-app-bar/bottom-app-bar.ts +196 -0
- package/src/components/bottom-app-bar/config.ts +73 -0
- package/src/components/bottom-app-bar/index.ts +11 -0
- package/src/components/bottom-app-bar/types.ts +108 -0
- package/src/components/button/_styles.scss +0 -10
- package/src/components/button/api.ts +5 -0
- package/src/components/button/config.ts +5 -0
- package/src/components/button/types.ts +6 -0
- package/src/components/card/card.ts +13 -25
- package/src/components/card/config.ts +67 -22
- package/src/components/card/features.ts +3 -0
- package/src/components/card/types.ts +28 -0
- package/src/components/checkbox/_styles.scss +0 -2
- package/src/components/datepicker/_styles.scss +358 -0
- package/src/components/datepicker/api.ts +272 -0
- package/src/components/datepicker/config.ts +144 -0
- package/src/components/datepicker/constants.ts +98 -0
- package/src/components/datepicker/datepicker.ts +346 -0
- package/src/components/datepicker/index.ts +9 -0
- package/src/components/datepicker/render.ts +452 -0
- package/src/components/datepicker/types.ts +268 -0
- package/src/components/datepicker/utils.ts +290 -0
- package/src/components/dialog/_styles.scss +174 -128
- package/src/components/dialog/api.ts +48 -13
- package/src/components/dialog/config.ts +9 -5
- package/src/components/dialog/dialog.ts +6 -3
- package/src/components/dialog/features.ts +290 -130
- package/src/components/dialog/types.ts +7 -4
- package/src/components/divider/_styles.scss +57 -0
- package/src/components/divider/config.ts +81 -0
- package/src/components/divider/divider.ts +37 -0
- package/src/components/divider/features.ts +207 -0
- package/src/components/divider/index.ts +5 -0
- package/src/components/divider/types.ts +55 -0
- package/src/components/extended-fab/_styles.scss +267 -0
- package/src/components/extended-fab/api.ts +141 -0
- package/src/components/extended-fab/config.ts +108 -0
- package/src/components/extended-fab/constants.ts +36 -0
- package/src/components/extended-fab/extended-fab.ts +125 -0
- package/src/components/extended-fab/index.ts +4 -0
- package/src/components/extended-fab/types.ts +287 -0
- package/src/components/fab/_styles.scss +225 -0
- package/src/components/fab/api.ts +97 -0
- package/src/components/fab/config.ts +94 -0
- package/src/components/fab/constants.ts +41 -0
- package/src/components/fab/fab.ts +67 -0
- package/src/components/fab/index.ts +4 -0
- package/src/components/fab/types.ts +234 -0
- package/src/components/navigation/_styles.scss +1 -0
- package/src/components/navigation/api.ts +78 -50
- package/src/components/navigation/features/items.ts +280 -0
- package/src/components/navigation/nav-item.ts +72 -23
- package/src/components/navigation/navigation.ts +54 -2
- package/src/components/navigation/types.ts +210 -188
- package/src/components/search/_styles.scss +306 -0
- package/src/components/search/api.ts +203 -0
- package/src/components/search/config.ts +87 -0
- package/src/components/search/constants.ts +21 -0
- package/src/components/search/features/index.ts +4 -0
- package/src/components/search/features/search.ts +718 -0
- package/src/components/search/features/states.ts +165 -0
- package/src/components/search/features/structure.ts +198 -0
- package/src/components/search/index.ts +10 -0
- package/src/components/search/search.ts +52 -0
- package/src/components/search/types.ts +163 -0
- package/src/components/segmented-button/_styles.scss +117 -0
- package/src/components/segmented-button/config.ts +67 -0
- package/src/components/segmented-button/constants.ts +42 -0
- package/src/components/segmented-button/index.ts +4 -0
- package/src/components/segmented-button/segment.ts +155 -0
- package/src/components/segmented-button/segmented-button.ts +250 -0
- package/src/components/segmented-button/types.ts +219 -0
- package/src/components/slider/_styles.scss +83 -24
- package/src/components/slider/accessibility.md +5 -5
- package/src/components/slider/api.ts +41 -120
- package/src/components/slider/config.ts +51 -47
- package/src/components/slider/features/handlers.ts +495 -0
- package/src/components/slider/features/index.ts +1 -2
- package/src/components/slider/features/slider.ts +66 -84
- package/src/components/slider/features/states.ts +195 -0
- package/src/components/slider/features/structure.ts +136 -206
- package/src/components/slider/features/ui.ts +145 -206
- package/src/components/slider/index.ts +2 -11
- package/src/components/slider/slider.ts +9 -12
- package/src/components/slider/types.ts +39 -24
- package/src/components/switch/_styles.scss +0 -2
- package/src/components/tabs/_styles.scss +94 -32
- package/src/components/tabs/features.ts +4 -2
- package/src/components/tabs/indicator.ts +73 -13
- package/src/components/tabs/types.ts +10 -2
- package/src/components/timepicker/README.md +277 -0
- package/src/components/timepicker/_styles.scss +451 -0
- package/src/components/timepicker/api.ts +632 -0
- package/src/components/timepicker/clockdial.ts +482 -0
- package/src/components/timepicker/config.ts +130 -0
- package/src/components/timepicker/constants.ts +138 -0
- package/src/components/timepicker/index.ts +8 -0
- package/src/components/timepicker/render.ts +613 -0
- package/src/components/timepicker/timepicker.ts +117 -0
- package/src/components/timepicker/types.ts +336 -0
- package/src/components/timepicker/utils.ts +241 -0
- package/src/components/top-app-bar/_styles.scss +225 -0
- package/src/components/top-app-bar/config.ts +83 -0
- package/src/components/top-app-bar/index.ts +11 -0
- package/src/components/top-app-bar/top-app-bar.ts +316 -0
- package/src/components/top-app-bar/types.ts +140 -0
- package/src/core/build/_ripple.scss +6 -6
- package/src/core/build/ripple.ts +72 -95
- package/src/core/compose/features/icon.ts +3 -1
- package/src/core/compose/features/ripple.ts +4 -1
- package/src/core/compose/features/textlabel.ts +26 -2
- package/src/core/dom/create.ts +5 -0
- package/src/index.ts +9 -0
- package/src/styles/abstract/_theme.scss +9 -1
- package/src/styles/themes/_autumn.scss +21 -0
- package/src/styles/themes/_base-theme.scss +61 -0
- package/src/styles/themes/_baseline.scss +58 -0
- package/src/styles/themes/_bluekhaki.scss +125 -0
- package/src/styles/themes/_brownbeige.scss +125 -0
- package/src/styles/themes/_browngreen.scss +125 -0
- package/src/styles/themes/_forest.scss +6 -0
- package/src/styles/themes/_greenbeige.scss +125 -0
- package/src/styles/themes/_material.scss +125 -0
- package/src/styles/themes/_ocean.scss +6 -0
- package/src/styles/themes/_sageivory.scss +125 -0
- package/src/styles/themes/_spring.scss +6 -0
- package/src/styles/themes/_summer.scss +5 -0
- package/src/styles/themes/_sunset.scss +5 -0
- package/src/styles/themes/_tealcaramel.scss +125 -0
- package/src/styles/themes/_winter.scss +6 -0
- package/src/components/navigation/features/items.js +0 -192
- package/src/components/slider/features/appearance.ts +0 -94
- package/src/components/slider/features/disabled.ts +0 -68
- package/src/components/slider/features/events.ts +0 -164
- package/src/components/slider/features/interactions.ts +0 -396
- package/src/components/slider/features/keyboard.ts +0 -233
- 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
|
+
};
|