mtrl 0.3.1 → 0.3.2
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/.env +15 -0
- package/CONTRIBUTING.md +8 -8
- package/DOCS.md +3 -3
- package/README.md +43 -20
- package/TESTING.md +128 -18
- package/dist/index.js +14865 -0
- package/git-user-stats.js +545 -0
- package/index.ts +9 -67
- package/package.json +8 -3
- package/src/components/badge/api.ts +15 -1
- package/src/components/badge/badge.ts +43 -4
- package/src/components/badge/config.ts +40 -8
- package/src/components/badge/index.ts +64 -3
- package/src/components/badge/types.ts +175 -33
- package/src/components/button/api.ts +63 -1
- package/src/components/button/button.ts +39 -3
- package/src/components/button/config.ts +21 -4
- package/src/components/button/index.ts +26 -1
- package/src/components/button/types.ts +7 -1
- package/src/components/card/api.ts +78 -9
- package/src/components/card/card.ts +58 -3
- package/src/components/card/config.ts +41 -11
- package/src/components/card/features.ts +39 -12
- package/src/components/card/index.ts +84 -19
- package/src/components/card/types.ts +218 -29
- package/src/components/carousel/carousel.ts +92 -28
- package/src/components/carousel/constants.ts +107 -21
- package/src/components/carousel/index.ts +31 -13
- package/src/components/checkbox/checkbox.ts +83 -16
- package/src/components/checkbox/index.ts +43 -1
- package/src/components/checkbox/types.ts +219 -32
- package/src/components/chips/api.ts +194 -0
- package/src/components/{chip → chips/chip}/api.ts +42 -2
- package/src/components/chips/chip/chip.ts +131 -0
- package/src/components/{chip → chips/chip}/config.ts +3 -3
- package/src/components/chips/chip/index.ts +3 -0
- package/src/components/chips/chips.md +481 -0
- package/src/components/chips/chips.ts +75 -0
- package/src/components/chips/config.ts +109 -0
- package/src/components/chips/constants.ts +61 -0
- package/src/components/chips/features/chip-items.ts +33 -0
- package/src/components/chips/features/container.ts +77 -0
- package/src/components/chips/features/controller.ts +448 -0
- package/src/components/chips/features/index.ts +5 -0
- package/src/components/chips/features/label.ts +108 -0
- package/src/components/chips/index.ts +11 -0
- package/src/components/chips/schema.ts +61 -0
- package/src/components/{chip → chips}/types.ts +203 -92
- package/src/components/dialog/dialog.ts +99 -16
- package/src/components/dialog/index.ts +97 -1
- package/src/components/dialog/types.ts +375 -69
- package/src/components/divider/config.ts +90 -6
- package/src/components/divider/divider.ts +32 -2
- package/src/components/divider/features.ts +26 -0
- package/src/components/divider/index.ts +30 -0
- package/src/components/divider/types.ts +86 -9
- package/src/components/extended-fab/api.ts +53 -1
- package/src/components/extended-fab/config.ts +29 -1
- package/src/components/extended-fab/extended-fab.ts +28 -0
- package/src/components/extended-fab/index.ts +36 -0
- package/src/components/extended-fab/types.ts +458 -13
- package/src/components/fab/api.ts +42 -2
- package/src/components/fab/config.ts +29 -1
- package/src/components/fab/fab.ts +16 -2
- package/src/components/fab/index.ts +35 -0
- package/src/components/fab/types.ts +374 -10
- package/src/components/list/api.ts +12 -2
- package/src/components/list/config.ts +21 -0
- package/src/components/list/features.ts +6 -0
- package/src/components/list/index.ts +56 -1
- package/src/components/list/list-item.ts +46 -2
- package/src/components/list/list.ts +73 -2
- package/src/components/list/types.ts +172 -0
- package/src/components/list/utils.ts +26 -2
- package/src/components/menu/api.ts +217 -20
- package/src/components/menu/config.ts +27 -0
- package/src/components/menu/features/visibility.ts +55 -6
- package/src/components/menu/index.ts +64 -0
- package/src/components/menu/menu-item.ts +46 -3
- package/src/components/menu/menu.ts +77 -1
- package/src/components/menu/types.ts +404 -39
- package/src/components/sheet/config.ts +1 -2
- package/src/components/sheet/features/gestures.ts +1 -1
- package/src/components/sheet/features/position.ts +1 -2
- package/src/components/sheet/features/state.ts +1 -1
- package/src/components/sheet/index.ts +10 -2
- package/src/components/sheet/sheet.ts +1 -2
- package/src/components/sheet/types.ts +29 -1
- package/src/components/slider/api.ts +1 -1
- package/src/components/slider/config.ts +1 -1
- package/src/components/slider/features/controller.ts +1 -1
- package/src/components/slider/features/handlers.ts +1 -1
- package/src/components/slider/features/states.ts +1 -1
- package/src/components/slider/index.ts +12 -5
- package/src/components/slider/schema.ts +1 -1
- package/src/components/slider/types.ts +31 -0
- package/src/components/tabs/tab-api.ts +1 -1
- package/src/components/tabs/types.ts +1 -1
- package/src/components/tooltip/api.ts +6 -2
- package/src/components/tooltip/config.ts +9 -28
- package/src/components/tooltip/index.ts +10 -1
- package/src/components/tooltip/types.ts +38 -3
- package/src/index.ts +129 -31
- package/src/styles/abstract/_mixins.scss +23 -9
- package/src/styles/abstract/_variables.scss +14 -4
- package/src/styles/components/_card.scss +1 -1
- package/src/styles/components/_chip.scss +323 -113
- package/src/styles/components/_tabs.scss +1 -1
- package/CLAUDE.md +0 -33
- package/src/components/checkbox/constants.ts +0 -37
- package/src/components/chip/chip-set.ts +0 -225
- package/src/components/chip/chip.ts +0 -118
- package/src/components/chip/constants.ts +0 -28
- package/src/components/chip/index.ts +0 -12
- package/src/components/list/constants.ts +0 -116
- package/src/components/sheet/constants.ts +0 -20
- package/src/components/slider/constants.ts +0 -32
- package/src/components/tooltip/constants.ts +0 -27
- package/test/components/badge.test.ts +0 -545
- package/test/components/bottom-app-bar.test.ts +0 -303
- package/test/components/button.test.ts +0 -233
- package/test/components/card.test.ts +0 -560
- package/test/components/carousel.test.ts +0 -951
- package/test/components/checkbox.test.ts +0 -462
- package/test/components/chip.test.ts +0 -692
- package/test/components/datepicker.test.ts +0 -1124
- package/test/components/dialog.test.ts +0 -990
- package/test/components/divider.test.ts +0 -412
- package/test/components/extended-fab.test.ts +0 -672
- package/test/components/fab.test.ts +0 -561
- package/test/components/list.test.ts +0 -365
- package/test/components/menu.test.ts +0 -718
- package/test/components/navigation.test.ts +0 -186
- package/test/components/progress.test.ts +0 -567
- package/test/components/radios.test.ts +0 -699
- package/test/components/search.test.ts +0 -1135
- package/test/components/segmented-button.test.ts +0 -732
- package/test/components/sheet.test.ts +0 -641
- package/test/components/slider.test.ts +0 -1220
- package/test/components/snackbar.test.ts +0 -461
- package/test/components/switch.test.ts +0 -452
- package/test/components/tabs.test.ts +0 -1369
- package/test/components/textfield.test.ts +0 -400
- package/test/components/timepicker.test.ts +0 -592
- package/test/components/tooltip.test.ts +0 -630
- package/test/components/top-app-bar.test.ts +0 -566
- package/test/core/dom.attributes.test.ts +0 -148
- package/test/core/dom.classes.test.ts +0 -152
- package/test/core/dom.events.test.ts +0 -243
- package/test/core/emitter.test.ts +0 -141
- package/test/core/ripple.test.ts +0 -99
- package/test/core/state.store.test.ts +0 -189
- package/test/core/utils.normalize.test.ts +0 -61
- package/test/core/utils.object.test.ts +0 -120
- package/test/setup.js +0 -371
- package/test/setup.ts +0 -451
- package/tsconfig.json +0 -22
- package/typedoc.json +0 -28
- package/typedoc.simple.json +0 -14
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createElementConfig
|
|
5
5
|
} from '../../core/config/component-config';
|
|
6
6
|
import { SliderConfig } from './types';
|
|
7
|
-
import { SLIDER_COLORS, SLIDER_SIZES } from './
|
|
7
|
+
import { SLIDER_COLORS, SLIDER_SIZES } from './types';
|
|
8
8
|
import { createSliderSchema } from './schema';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
// Export main component creator
|
|
4
4
|
export { default } from './slider';
|
|
5
5
|
|
|
6
|
-
// Export constants
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
// Export constants and types
|
|
7
|
+
export {
|
|
8
|
+
// Constants
|
|
9
|
+
SLIDER_COLORS,
|
|
10
|
+
SLIDER_SIZES,
|
|
11
|
+
SLIDER_EVENTS,
|
|
12
|
+
|
|
13
|
+
// Types
|
|
14
|
+
type SliderConfig,
|
|
15
|
+
type SliderComponent,
|
|
16
|
+
type SliderEvent
|
|
17
|
+
} from './types';
|
|
@@ -22,7 +22,7 @@ export function createSliderSchema(component, config: SliderConfig) {
|
|
|
22
22
|
// Calculate initial position
|
|
23
23
|
const valuePercent = ((value - min) / (max - min)) * 100;
|
|
24
24
|
|
|
25
|
-
// Return base structure definition formatted for
|
|
25
|
+
// Return base structure definition formatted for createLayout
|
|
26
26
|
return {
|
|
27
27
|
element: {
|
|
28
28
|
options: {
|
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
// src/components/slider/types.ts
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Available slider color variants
|
|
5
|
+
*/
|
|
6
|
+
export const SLIDER_COLORS = {
|
|
7
|
+
PRIMARY: 'primary',
|
|
8
|
+
SECONDARY: 'secondary',
|
|
9
|
+
TERTIARY: 'tertiary',
|
|
10
|
+
ERROR: 'error'
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Available slider size variants
|
|
15
|
+
*/
|
|
16
|
+
export const SLIDER_SIZES = {
|
|
17
|
+
SMALL: 'small',
|
|
18
|
+
MEDIUM: 'medium',
|
|
19
|
+
LARGE: 'large'
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Available slider events
|
|
24
|
+
*/
|
|
25
|
+
export const SLIDER_EVENTS = {
|
|
26
|
+
CHANGE: 'change',
|
|
27
|
+
INPUT: 'input',
|
|
28
|
+
FOCUS: 'focus',
|
|
29
|
+
BLUR: 'blur',
|
|
30
|
+
START: 'start',
|
|
31
|
+
END: 'end'
|
|
32
|
+
} as const;
|
|
33
|
+
|
|
3
34
|
/**
|
|
4
35
|
* Available slider color variants
|
|
5
36
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// src/components/tooltip/api.ts
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
TooltipComponent,
|
|
4
|
+
TOOLTIP_POSITIONS,
|
|
5
|
+
DEFAULT_OFFSET,
|
|
6
|
+
DEFAULT_ARROW_SIZE
|
|
7
|
+
} from './types';
|
|
4
8
|
|
|
5
9
|
interface ApiOptions {
|
|
6
10
|
lifecycle: {
|
|
@@ -3,34 +3,15 @@ import {
|
|
|
3
3
|
createComponentConfig,
|
|
4
4
|
createElementConfig
|
|
5
5
|
} from '../../core/config/component-config';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
TOP_END: 'top-end',
|
|
16
|
-
RIGHT_START: 'right-start',
|
|
17
|
-
RIGHT_END: 'right-end',
|
|
18
|
-
BOTTOM_START: 'bottom-start',
|
|
19
|
-
BOTTOM_END: 'bottom-end',
|
|
20
|
-
LEFT_START: 'left-start',
|
|
21
|
-
LEFT_END: 'left-end'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const TOOLTIP_VARIANTS = {
|
|
25
|
-
DEFAULT: 'default',
|
|
26
|
-
RICH: 'rich',
|
|
27
|
-
PLAIN: 'plain'
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const DEFAULT_SHOW_DELAY = 300
|
|
31
|
-
export const DEFAULT_HIDE_DELAY = 100
|
|
32
|
-
export const DEFAULT_OFFSET = 8
|
|
33
|
-
export const DEFAULT_ARROW_SIZE = 8
|
|
6
|
+
import {
|
|
7
|
+
TooltipConfig,
|
|
8
|
+
TOOLTIP_POSITIONS,
|
|
9
|
+
TOOLTIP_VARIANTS,
|
|
10
|
+
DEFAULT_SHOW_DELAY,
|
|
11
|
+
DEFAULT_HIDE_DELAY,
|
|
12
|
+
DEFAULT_OFFSET,
|
|
13
|
+
DEFAULT_ARROW_SIZE
|
|
14
|
+
} from './types';
|
|
34
15
|
|
|
35
16
|
/**
|
|
36
17
|
* Default configuration for the Tooltip component
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
// src/components/tooltip/index.ts
|
|
2
2
|
export { default } from './tooltip';
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
TooltipConfig,
|
|
5
|
+
TooltipComponent,
|
|
6
|
+
TOOLTIP_POSITIONS,
|
|
7
|
+
TOOLTIP_VARIANTS,
|
|
8
|
+
DEFAULT_SHOW_DELAY,
|
|
9
|
+
DEFAULT_HIDE_DELAY,
|
|
10
|
+
DEFAULT_OFFSET,
|
|
11
|
+
DEFAULT_ARROW_SIZE
|
|
12
|
+
} from './types';
|
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
// src/components/tooltip/types.ts
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Tooltip positions
|
|
5
|
+
*/
|
|
6
|
+
export const TOOLTIP_POSITIONS = {
|
|
7
|
+
TOP: 'top',
|
|
8
|
+
RIGHT: 'right',
|
|
9
|
+
BOTTOM: 'bottom',
|
|
10
|
+
LEFT: 'left',
|
|
11
|
+
TOP_START: 'top-start',
|
|
12
|
+
TOP_END: 'top-end',
|
|
13
|
+
RIGHT_START: 'right-start',
|
|
14
|
+
RIGHT_END: 'right-end',
|
|
15
|
+
BOTTOM_START: 'bottom-start',
|
|
16
|
+
BOTTOM_END: 'bottom-end',
|
|
17
|
+
LEFT_START: 'left-start',
|
|
18
|
+
LEFT_END: 'left-end'
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Tooltip variants
|
|
23
|
+
*/
|
|
24
|
+
export const TOOLTIP_VARIANTS = {
|
|
25
|
+
DEFAULT: 'default',
|
|
26
|
+
RICH: 'rich',
|
|
27
|
+
PLAIN: 'plain'
|
|
28
|
+
} as const;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Default values
|
|
32
|
+
*/
|
|
33
|
+
export const DEFAULT_SHOW_DELAY = 300;
|
|
34
|
+
export const DEFAULT_HIDE_DELAY = 100;
|
|
35
|
+
export const DEFAULT_OFFSET = 8;
|
|
36
|
+
export const DEFAULT_ARROW_SIZE = 8;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Available Tooltip variants
|
|
5
40
|
*/
|
|
6
41
|
export type TooltipVariant = 'default' | 'rich' | 'plain';
|
|
7
42
|
|
|
8
43
|
/**
|
|
9
|
-
* Available
|
|
44
|
+
* Available Tooltip positions
|
|
10
45
|
*/
|
|
11
46
|
export type TooltipPosition = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
12
47
|
|
|
@@ -38,7 +73,7 @@ export interface TooltipConfig {
|
|
|
38
73
|
* Tooltip variant that determines visual styling
|
|
39
74
|
* @default 'default'
|
|
40
75
|
*/
|
|
41
|
-
variant?:
|
|
76
|
+
variant?: TooltipVariant | string;
|
|
42
77
|
|
|
43
78
|
/**
|
|
44
79
|
* Whether the tooltip is initially visible
|
package/src/index.ts
CHANGED
|
@@ -1,32 +1,130 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Main mtrl library exports
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Direct component imports
|
|
9
|
+
import { createElement } from './core/dom/create';
|
|
10
|
+
import createLayout from './core/layout';
|
|
11
|
+
import createBadge from './components/badge';
|
|
12
|
+
import createBottomAppBar from './components/bottom-app-bar';
|
|
13
|
+
import createButton from './components/button';
|
|
14
|
+
import createCard from './components/card';
|
|
15
|
+
import {
|
|
16
|
+
createCardContent,
|
|
17
|
+
createCardHeader,
|
|
18
|
+
createCardActions,
|
|
19
|
+
createCardMedia
|
|
20
|
+
} from './components/card/content';
|
|
21
|
+
import createCarousel from './components/carousel';
|
|
22
|
+
import createCheckbox from './components/checkbox';
|
|
23
|
+
import { createChip, createChips } from './components/chips';
|
|
24
|
+
import createDatePicker from './components/datepicker';
|
|
25
|
+
import createDialog from './components/dialog';
|
|
26
|
+
import { createDivider } from './components/divider';
|
|
27
|
+
import createFab from './components/fab';
|
|
28
|
+
import createExtendedFab from './components/extended-fab';
|
|
29
|
+
import createList, { createListItem } from './components/list';
|
|
30
|
+
import createMenu from './components/menu';
|
|
31
|
+
import createNavigation, { createNavigationSystem } from './components/navigation';
|
|
32
|
+
import createProgress from './components/progress';
|
|
33
|
+
import createRadios from './components/radios';
|
|
34
|
+
import createSearch from './components/search';
|
|
35
|
+
import createSegmentedButton, { createSegment } from './components/segmented-button';
|
|
36
|
+
import createSheet from './components/sheet';
|
|
37
|
+
import createSlider from './components/slider';
|
|
38
|
+
import createSnackbar from './components/snackbar';
|
|
39
|
+
import createSwitch from './components/switch';
|
|
40
|
+
import createTabs, { createTab } from './components/tabs';
|
|
41
|
+
import createTextfield from './components/textfield';
|
|
42
|
+
import createTimePicker from './components/timepicker';
|
|
43
|
+
import createTopAppBar from './components/top-app-bar';
|
|
44
|
+
import createTooltip from './components/tooltip';
|
|
45
|
+
|
|
46
|
+
// Export all "create*" functions
|
|
47
|
+
export {
|
|
48
|
+
createElement,
|
|
49
|
+
createLayout,
|
|
50
|
+
createBadge,
|
|
51
|
+
createBottomAppBar,
|
|
52
|
+
createButton,
|
|
53
|
+
createCard,
|
|
54
|
+
createCardContent,
|
|
55
|
+
createCardHeader,
|
|
56
|
+
createCardActions,
|
|
57
|
+
createCardMedia,
|
|
58
|
+
createCarousel,
|
|
59
|
+
createCheckbox,
|
|
60
|
+
createChip,
|
|
61
|
+
createChipSet,
|
|
62
|
+
createDatePicker,
|
|
63
|
+
createDialog,
|
|
64
|
+
createDivider,
|
|
65
|
+
createFab,
|
|
66
|
+
createExtendedFab,
|
|
67
|
+
createList,
|
|
68
|
+
createListItem,
|
|
69
|
+
createMenu,
|
|
70
|
+
createNavigation,
|
|
71
|
+
createNavigationSystem,
|
|
72
|
+
createProgress,
|
|
73
|
+
createRadios,
|
|
74
|
+
createSearch,
|
|
75
|
+
createSegmentedButton,
|
|
76
|
+
createSegment,
|
|
77
|
+
createSheet,
|
|
78
|
+
createSlider,
|
|
79
|
+
createSnackbar,
|
|
80
|
+
createSwitch,
|
|
81
|
+
createTabs,
|
|
82
|
+
createTab,
|
|
83
|
+
createTextfield,
|
|
84
|
+
createTimePicker,
|
|
85
|
+
createTopAppBar,
|
|
86
|
+
createTooltip
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Export all "f*" aliases
|
|
90
|
+
export {
|
|
91
|
+
createElement as fElement,
|
|
92
|
+
createLayout as fLayout,
|
|
93
|
+
createBadge as fBadge,
|
|
94
|
+
createBottomAppBar as fBottomAppBar,
|
|
95
|
+
createButton as fButton,
|
|
96
|
+
createCard as fCard,
|
|
97
|
+
createCardContent as fCardContent,
|
|
98
|
+
createCardHeader as fCardHeader,
|
|
99
|
+
createCardActions as fCardActions,
|
|
100
|
+
createCardMedia as fCardMedia,
|
|
101
|
+
createCarousel as fCarousel,
|
|
102
|
+
createCheckbox as fCheckbox,
|
|
103
|
+
createChip as fChip,
|
|
104
|
+
createChips as fChips,
|
|
105
|
+
createDatePicker as fDatePicker,
|
|
106
|
+
createDialog as fDialog,
|
|
107
|
+
createDivider as fDivider,
|
|
108
|
+
createFab as fFab,
|
|
109
|
+
createExtendedFab as fExtendedFab,
|
|
110
|
+
createList as fList,
|
|
111
|
+
createListItem as fListItem,
|
|
112
|
+
createMenu as fMenu,
|
|
113
|
+
createNavigation as fNavigation,
|
|
114
|
+
createNavigationSystem as fNavigationSystem,
|
|
115
|
+
createProgress as fProgress,
|
|
116
|
+
createRadios as fRadios,
|
|
117
|
+
createSearch as fSearch,
|
|
118
|
+
createSegmentedButton as fSegmentedButton,
|
|
119
|
+
createSegment as fSegment,
|
|
120
|
+
createSheet as fSheet,
|
|
121
|
+
createSlider as fSlider,
|
|
122
|
+
createSnackbar as fSnackbar,
|
|
123
|
+
createSwitch as fSwitch,
|
|
124
|
+
createTabs as fTabs,
|
|
125
|
+
createTab as fTab,
|
|
126
|
+
createTextfield as fTextfield,
|
|
127
|
+
createTimePicker as fTimePicker,
|
|
128
|
+
createTopAppBar as fTopAppBar,
|
|
129
|
+
createTooltip as fTooltip
|
|
130
|
+
};
|
|
@@ -37,17 +37,31 @@ $icons: (
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// State Layers
|
|
40
|
-
@mixin state-layer($color, $state: 'hover', $selector:
|
|
40
|
+
@mixin state-layer($color, $state: 'hover', $selector: false) {
|
|
41
41
|
position: relative;
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
@if $selector == false {
|
|
44
|
+
// Default behavior - create a pseudo-element for the state layer
|
|
45
|
+
&::before {
|
|
46
|
+
content: '';
|
|
47
|
+
position: absolute;
|
|
48
|
+
inset: 0;
|
|
49
|
+
background-color: $color;
|
|
50
|
+
opacity: f.get-state-opacity($state);
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
border-radius: inherit;
|
|
53
|
+
}
|
|
54
|
+
} @else {
|
|
55
|
+
// Use the provided selector
|
|
56
|
+
#{$selector} {
|
|
57
|
+
content: '';
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset: 0;
|
|
60
|
+
background-color: $color;
|
|
61
|
+
opacity: f.get-state-opacity($state);
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
border-radius: inherit;
|
|
64
|
+
}
|
|
51
65
|
}
|
|
52
66
|
}
|
|
53
67
|
|
|
@@ -189,11 +189,18 @@ $card: (
|
|
|
189
189
|
'padding': 16px
|
|
190
190
|
) !default;
|
|
191
191
|
|
|
192
|
-
// Chip configuration
|
|
192
|
+
// Chip configuration - updated with MD3 values
|
|
193
193
|
$chip-config: (
|
|
194
194
|
'height': 32px,
|
|
195
195
|
'border-radius': 8px,
|
|
196
|
-
'padding-horizontal': 12px
|
|
196
|
+
'padding-horizontal': 12px,
|
|
197
|
+
'outlined-border-opacity': 0.12,
|
|
198
|
+
'outlined-border-hover-opacity': 0.29,
|
|
199
|
+
'outlined-border-focus-opacity': 0.38,
|
|
200
|
+
'outlined-selected-border-opacity': 0,
|
|
201
|
+
'suggestion-height': 48px,
|
|
202
|
+
'icon-size': 18px,
|
|
203
|
+
'suggestion-icon-size': 24px
|
|
197
204
|
) !default;
|
|
198
205
|
|
|
199
206
|
$button: (
|
|
@@ -272,6 +279,9 @@ $spacing-scale: (
|
|
|
272
279
|
@return map.get($card, $key);
|
|
273
280
|
}
|
|
274
281
|
|
|
275
|
-
@function chip($key) {
|
|
276
|
-
@
|
|
282
|
+
@function chip($key, $fallback: null) {
|
|
283
|
+
@if map.has-key($chip-config, $key) {
|
|
284
|
+
@return map.get($chip-config, $key);
|
|
285
|
+
}
|
|
286
|
+
@return $fallback;
|
|
277
287
|
}
|