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.
Files changed (159) hide show
  1. package/.env +15 -0
  2. package/CONTRIBUTING.md +8 -8
  3. package/DOCS.md +3 -3
  4. package/README.md +43 -20
  5. package/TESTING.md +128 -18
  6. package/dist/index.js +14865 -0
  7. package/git-user-stats.js +545 -0
  8. package/index.ts +9 -67
  9. package/package.json +8 -3
  10. package/src/components/badge/api.ts +15 -1
  11. package/src/components/badge/badge.ts +43 -4
  12. package/src/components/badge/config.ts +40 -8
  13. package/src/components/badge/index.ts +64 -3
  14. package/src/components/badge/types.ts +175 -33
  15. package/src/components/button/api.ts +63 -1
  16. package/src/components/button/button.ts +39 -3
  17. package/src/components/button/config.ts +21 -4
  18. package/src/components/button/index.ts +26 -1
  19. package/src/components/button/types.ts +7 -1
  20. package/src/components/card/api.ts +78 -9
  21. package/src/components/card/card.ts +58 -3
  22. package/src/components/card/config.ts +41 -11
  23. package/src/components/card/features.ts +39 -12
  24. package/src/components/card/index.ts +84 -19
  25. package/src/components/card/types.ts +218 -29
  26. package/src/components/carousel/carousel.ts +92 -28
  27. package/src/components/carousel/constants.ts +107 -21
  28. package/src/components/carousel/index.ts +31 -13
  29. package/src/components/checkbox/checkbox.ts +83 -16
  30. package/src/components/checkbox/index.ts +43 -1
  31. package/src/components/checkbox/types.ts +219 -32
  32. package/src/components/chips/api.ts +194 -0
  33. package/src/components/{chip → chips/chip}/api.ts +42 -2
  34. package/src/components/chips/chip/chip.ts +131 -0
  35. package/src/components/{chip → chips/chip}/config.ts +3 -3
  36. package/src/components/chips/chip/index.ts +3 -0
  37. package/src/components/chips/chips.md +481 -0
  38. package/src/components/chips/chips.ts +75 -0
  39. package/src/components/chips/config.ts +109 -0
  40. package/src/components/chips/constants.ts +61 -0
  41. package/src/components/chips/features/chip-items.ts +33 -0
  42. package/src/components/chips/features/container.ts +77 -0
  43. package/src/components/chips/features/controller.ts +448 -0
  44. package/src/components/chips/features/index.ts +5 -0
  45. package/src/components/chips/features/label.ts +108 -0
  46. package/src/components/chips/index.ts +11 -0
  47. package/src/components/chips/schema.ts +61 -0
  48. package/src/components/{chip → chips}/types.ts +203 -92
  49. package/src/components/dialog/dialog.ts +99 -16
  50. package/src/components/dialog/index.ts +97 -1
  51. package/src/components/dialog/types.ts +375 -69
  52. package/src/components/divider/config.ts +90 -6
  53. package/src/components/divider/divider.ts +32 -2
  54. package/src/components/divider/features.ts +26 -0
  55. package/src/components/divider/index.ts +30 -0
  56. package/src/components/divider/types.ts +86 -9
  57. package/src/components/extended-fab/api.ts +53 -1
  58. package/src/components/extended-fab/config.ts +29 -1
  59. package/src/components/extended-fab/extended-fab.ts +28 -0
  60. package/src/components/extended-fab/index.ts +36 -0
  61. package/src/components/extended-fab/types.ts +458 -13
  62. package/src/components/fab/api.ts +42 -2
  63. package/src/components/fab/config.ts +29 -1
  64. package/src/components/fab/fab.ts +16 -2
  65. package/src/components/fab/index.ts +35 -0
  66. package/src/components/fab/types.ts +374 -10
  67. package/src/components/list/api.ts +12 -2
  68. package/src/components/list/config.ts +21 -0
  69. package/src/components/list/features.ts +6 -0
  70. package/src/components/list/index.ts +56 -1
  71. package/src/components/list/list-item.ts +46 -2
  72. package/src/components/list/list.ts +73 -2
  73. package/src/components/list/types.ts +172 -0
  74. package/src/components/list/utils.ts +26 -2
  75. package/src/components/menu/api.ts +217 -20
  76. package/src/components/menu/config.ts +27 -0
  77. package/src/components/menu/features/visibility.ts +55 -6
  78. package/src/components/menu/index.ts +64 -0
  79. package/src/components/menu/menu-item.ts +46 -3
  80. package/src/components/menu/menu.ts +77 -1
  81. package/src/components/menu/types.ts +404 -39
  82. package/src/components/sheet/config.ts +1 -2
  83. package/src/components/sheet/features/gestures.ts +1 -1
  84. package/src/components/sheet/features/position.ts +1 -2
  85. package/src/components/sheet/features/state.ts +1 -1
  86. package/src/components/sheet/index.ts +10 -2
  87. package/src/components/sheet/sheet.ts +1 -2
  88. package/src/components/sheet/types.ts +29 -1
  89. package/src/components/slider/api.ts +1 -1
  90. package/src/components/slider/config.ts +1 -1
  91. package/src/components/slider/features/controller.ts +1 -1
  92. package/src/components/slider/features/handlers.ts +1 -1
  93. package/src/components/slider/features/states.ts +1 -1
  94. package/src/components/slider/index.ts +12 -5
  95. package/src/components/slider/schema.ts +1 -1
  96. package/src/components/slider/types.ts +31 -0
  97. package/src/components/tabs/tab-api.ts +1 -1
  98. package/src/components/tabs/types.ts +1 -1
  99. package/src/components/tooltip/api.ts +6 -2
  100. package/src/components/tooltip/config.ts +9 -28
  101. package/src/components/tooltip/index.ts +10 -1
  102. package/src/components/tooltip/types.ts +38 -3
  103. package/src/index.ts +129 -31
  104. package/src/styles/abstract/_mixins.scss +23 -9
  105. package/src/styles/abstract/_variables.scss +14 -4
  106. package/src/styles/components/_card.scss +1 -1
  107. package/src/styles/components/_chip.scss +323 -113
  108. package/src/styles/components/_tabs.scss +1 -1
  109. package/CLAUDE.md +0 -33
  110. package/src/components/checkbox/constants.ts +0 -37
  111. package/src/components/chip/chip-set.ts +0 -225
  112. package/src/components/chip/chip.ts +0 -118
  113. package/src/components/chip/constants.ts +0 -28
  114. package/src/components/chip/index.ts +0 -12
  115. package/src/components/list/constants.ts +0 -116
  116. package/src/components/sheet/constants.ts +0 -20
  117. package/src/components/slider/constants.ts +0 -32
  118. package/src/components/tooltip/constants.ts +0 -27
  119. package/test/components/badge.test.ts +0 -545
  120. package/test/components/bottom-app-bar.test.ts +0 -303
  121. package/test/components/button.test.ts +0 -233
  122. package/test/components/card.test.ts +0 -560
  123. package/test/components/carousel.test.ts +0 -951
  124. package/test/components/checkbox.test.ts +0 -462
  125. package/test/components/chip.test.ts +0 -692
  126. package/test/components/datepicker.test.ts +0 -1124
  127. package/test/components/dialog.test.ts +0 -990
  128. package/test/components/divider.test.ts +0 -412
  129. package/test/components/extended-fab.test.ts +0 -672
  130. package/test/components/fab.test.ts +0 -561
  131. package/test/components/list.test.ts +0 -365
  132. package/test/components/menu.test.ts +0 -718
  133. package/test/components/navigation.test.ts +0 -186
  134. package/test/components/progress.test.ts +0 -567
  135. package/test/components/radios.test.ts +0 -699
  136. package/test/components/search.test.ts +0 -1135
  137. package/test/components/segmented-button.test.ts +0 -732
  138. package/test/components/sheet.test.ts +0 -641
  139. package/test/components/slider.test.ts +0 -1220
  140. package/test/components/snackbar.test.ts +0 -461
  141. package/test/components/switch.test.ts +0 -452
  142. package/test/components/tabs.test.ts +0 -1369
  143. package/test/components/textfield.test.ts +0 -400
  144. package/test/components/timepicker.test.ts +0 -592
  145. package/test/components/tooltip.test.ts +0 -630
  146. package/test/components/top-app-bar.test.ts +0 -566
  147. package/test/core/dom.attributes.test.ts +0 -148
  148. package/test/core/dom.classes.test.ts +0 -152
  149. package/test/core/dom.events.test.ts +0 -243
  150. package/test/core/emitter.test.ts +0 -141
  151. package/test/core/ripple.test.ts +0 -99
  152. package/test/core/state.store.test.ts +0 -189
  153. package/test/core/utils.normalize.test.ts +0 -61
  154. package/test/core/utils.object.test.ts +0 -120
  155. package/test/setup.js +0 -371
  156. package/test/setup.ts +0 -451
  157. package/tsconfig.json +0 -22
  158. package/typedoc.json +0 -28
  159. 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 './constants';
7
+ import { SLIDER_COLORS, SLIDER_SIZES } from './types';
8
8
  import { createSliderSchema } from './schema';
9
9
 
10
10
  /**
@@ -1,5 +1,5 @@
1
1
  // src/components/slider/features/controller.ts
2
- import { SLIDER_EVENTS } from '../constants';
2
+ import { SLIDER_EVENTS } from '../types';
3
3
  import { SliderConfig } from '../types';
4
4
  import { createHandlers } from './handlers';
5
5
 
@@ -1,5 +1,5 @@
1
1
  // src/components/slider/features/handlers.ts
2
- import { SLIDER_EVENTS } from '../constants';
2
+ import { SLIDER_EVENTS } from '../types';
3
3
  import { SliderConfig, SliderEvent } from '../types';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  // src/components/slider/features/states.ts
2
- import { SLIDER_COLORS, SLIDER_SIZES } from '../constants';
2
+ import { SLIDER_COLORS, SLIDER_SIZES } from '../types';
3
3
  import { SliderConfig } from '../types';
4
4
 
5
5
  /**
@@ -3,8 +3,15 @@
3
3
  // Export main component creator
4
4
  export { default } from './slider';
5
5
 
6
- // Export constants
7
- export { SLIDER_COLORS, SLIDER_SIZES, SLIDER_EVENTS } from './constants';
8
-
9
- // Export types for TypeScript users
10
- export type { SliderConfig, SliderComponent, SliderEvent } from './types';
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 createStructure
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,6 @@
1
1
  // src/components/tabs/tab-api.ts
2
2
  import { TabComponent } from './types';
3
- import { BadgeComponent } from '../badge/types';
3
+ import type { BadgeComponent } from '../badge';
4
4
  import createBadge from '../badge';
5
5
 
6
6
  const TAB_LAYOUT = {
@@ -1,5 +1,5 @@
1
1
  // src/components/tabs/types.ts
2
- import { BadgeComponent } from '../badge/types';
2
+ import type { BadgeComponent } from '../badge';
3
3
  import { TabIndicator } from './indicator';
4
4
 
5
5
  /**
@@ -1,6 +1,10 @@
1
1
  // src/components/tooltip/api.ts
2
- import { TooltipComponent } from './types';
3
- import { TOOLTIP_POSITIONS, DEFAULT_OFFSET, DEFAULT_ARROW_SIZE } from './config';
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 { TooltipConfig } from './types';
7
-
8
-
9
- export const TOOLTIP_POSITIONS = {
10
- TOP: 'top',
11
- RIGHT: 'right',
12
- BOTTOM: 'bottom',
13
- LEFT: 'left',
14
- TOP_START: 'top-start',
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 { TooltipConfig, TooltipComponent } from './types';
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
- * Available Textfield variants
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 Textfield states
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?: TooltipVariants | string;
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
- export { createElement } from './core/dom/create'
3
- export { default as createLayout } from './core/layout'
4
- export { default as createButton } from './components/button'
5
- export { default as createFab } from './components/fab'
6
- export { default as createExtendedFab } from './components/extended-fab'
7
- export { default as createSegmentedButton } from './components/segmented-button'
8
- export { default as createBottomAppBar } from './components/bottom-app-bar'
9
- export { default as createBadge } from './components/badge'
10
- export { default as createCard } from './components/card'
11
- export { default as createCarousel } from './components/carousel'
12
- export { default as createCheckbox } from './components/checkbox'
13
- export { default as createChip } from './components/chip'
14
- export { default as createDatePicker } from './components/datepicker'
15
- export { default as createDialog } from './components/dialog'
16
- export { default as createDivider } from './components/divider'
17
- export { default as createMenu } from './components/menu'
18
- export { default as createNavigation } from './components/navigation'
19
- export { default as createNavigationSystem } from './components/navigation'
20
- export { default as createProgress } from './components/progress'
21
- export { default as createRadios } from './components/radios'
22
- export { default as createSearch } from './components/search'
23
- export { default as createSheet } from './components/sheet'
24
- export { default as createSlider } from './components/slider'
25
- export { default as createSnackbar } from './components/snackbar'
26
- export { default as createSwitch } from './components/switch'
27
- export { default as createTabs } from './components/tabs'
28
- export { default as createTextfield } from './components/textfield'
29
- export { default as createTimePicker } from './components/timepicker'
30
- export { default as createTopAppBar } from './components/top-app-bar'
31
- export { default as createTooltip } from './components/tooltip'
32
- export { default as createList } from './components/list'
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: '&::before') {
40
+ @mixin state-layer($color, $state: 'hover', $selector: false) {
41
41
  position: relative;
42
42
 
43
- #{$selector} {
44
- content: '';
45
- position: absolute;
46
- inset: 0;
47
- background-color: $color;
48
- opacity: f.get-state-opacity($state);
49
- pointer-events: none;
50
- border-radius: inherit;
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
- @return map.get($chip-config, $key);
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
  }
@@ -302,7 +302,7 @@ $component: '#{base.$prefix}-card';
302
302
 
303
303
  // State classes
304
304
  &--state-disabled {
305
- opacity: 0.38; // Use MTRL standard opacity
305
+ opacity: 0.38; // Use mtrl standard opacity
306
306
  pointer-events: none;
307
307
  }
308
308