mtrl 0.2.5 → 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 (196) hide show
  1. package/index.ts +18 -0
  2. package/package.json +1 -1
  3. package/src/components/badge/_styles.scss +123 -115
  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 -66
  16. package/src/components/button/api.ts +5 -0
  17. package/src/components/button/button.ts +0 -2
  18. package/src/components/button/config.ts +5 -0
  19. package/src/components/button/constants.ts +0 -6
  20. package/src/components/button/index.ts +2 -2
  21. package/src/components/button/types.ts +7 -7
  22. package/src/components/card/_styles.scss +67 -25
  23. package/src/components/card/api.ts +54 -3
  24. package/src/components/card/card.ts +25 -6
  25. package/src/components/card/config.ts +189 -22
  26. package/src/components/card/constants.ts +20 -19
  27. package/src/components/card/content.ts +299 -2
  28. package/src/components/card/features.ts +158 -4
  29. package/src/components/card/index.ts +31 -9
  30. package/src/components/card/types.ts +166 -15
  31. package/src/components/checkbox/_styles.scss +0 -2
  32. package/src/components/chip/chip.ts +1 -9
  33. package/src/components/chip/constants.ts +0 -10
  34. package/src/components/chip/index.ts +1 -1
  35. package/src/components/chip/types.ts +1 -4
  36. package/src/components/datepicker/_styles.scss +358 -0
  37. package/src/components/datepicker/api.ts +272 -0
  38. package/src/components/datepicker/config.ts +144 -0
  39. package/src/components/datepicker/constants.ts +98 -0
  40. package/src/components/datepicker/datepicker.ts +346 -0
  41. package/src/components/datepicker/index.ts +9 -0
  42. package/src/components/datepicker/render.ts +452 -0
  43. package/src/components/datepicker/types.ts +268 -0
  44. package/src/components/datepicker/utils.ts +290 -0
  45. package/src/components/dialog/_styles.scss +174 -128
  46. package/src/components/dialog/api.ts +48 -13
  47. package/src/components/dialog/config.ts +9 -5
  48. package/src/components/dialog/dialog.ts +6 -3
  49. package/src/components/dialog/features.ts +290 -130
  50. package/src/components/dialog/types.ts +7 -4
  51. package/src/components/divider/_styles.scss +57 -0
  52. package/src/components/divider/config.ts +81 -0
  53. package/src/components/divider/divider.ts +37 -0
  54. package/src/components/divider/features.ts +207 -0
  55. package/src/components/divider/index.ts +5 -0
  56. package/src/components/divider/types.ts +55 -0
  57. package/src/components/extended-fab/_styles.scss +267 -0
  58. package/src/components/extended-fab/api.ts +141 -0
  59. package/src/components/extended-fab/config.ts +108 -0
  60. package/src/components/extended-fab/constants.ts +36 -0
  61. package/src/components/extended-fab/extended-fab.ts +125 -0
  62. package/src/components/extended-fab/index.ts +4 -0
  63. package/src/components/extended-fab/types.ts +287 -0
  64. package/src/components/fab/_styles.scss +225 -0
  65. package/src/components/fab/api.ts +97 -0
  66. package/src/components/fab/config.ts +94 -0
  67. package/src/components/fab/constants.ts +41 -0
  68. package/src/components/fab/fab.ts +67 -0
  69. package/src/components/fab/index.ts +4 -0
  70. package/src/components/fab/types.ts +234 -0
  71. package/src/components/navigation/_styles.scss +1 -0
  72. package/src/components/navigation/api.ts +78 -50
  73. package/src/components/navigation/features/items.ts +280 -0
  74. package/src/components/navigation/nav-item.ts +72 -23
  75. package/src/components/navigation/navigation.ts +54 -2
  76. package/src/components/navigation/types.ts +210 -188
  77. package/src/components/progress/_styles.scss +0 -65
  78. package/src/components/progress/config.ts +1 -2
  79. package/src/components/progress/constants.ts +0 -14
  80. package/src/components/progress/index.ts +1 -1
  81. package/src/components/progress/progress.ts +1 -4
  82. package/src/components/progress/types.ts +1 -4
  83. package/src/components/radios/_styles.scss +0 -45
  84. package/src/components/radios/api.ts +85 -60
  85. package/src/components/radios/config.ts +1 -2
  86. package/src/components/radios/constants.ts +0 -9
  87. package/src/components/radios/index.ts +1 -1
  88. package/src/components/radios/radio.ts +34 -11
  89. package/src/components/radios/radios.ts +2 -1
  90. package/src/components/radios/types.ts +1 -7
  91. package/src/components/search/_styles.scss +306 -0
  92. package/src/components/search/api.ts +203 -0
  93. package/src/components/search/config.ts +87 -0
  94. package/src/components/search/constants.ts +21 -0
  95. package/src/components/search/features/index.ts +4 -0
  96. package/src/components/search/features/search.ts +718 -0
  97. package/src/components/search/features/states.ts +165 -0
  98. package/src/components/search/features/structure.ts +198 -0
  99. package/src/components/search/index.ts +10 -0
  100. package/src/components/search/search.ts +52 -0
  101. package/src/components/search/types.ts +163 -0
  102. package/src/components/segmented-button/_styles.scss +117 -0
  103. package/src/components/segmented-button/config.ts +67 -0
  104. package/src/components/segmented-button/constants.ts +42 -0
  105. package/src/components/segmented-button/index.ts +4 -0
  106. package/src/components/segmented-button/segment.ts +155 -0
  107. package/src/components/segmented-button/segmented-button.ts +250 -0
  108. package/src/components/segmented-button/types.ts +219 -0
  109. package/src/components/slider/_styles.scss +221 -168
  110. package/src/components/slider/accessibility.md +59 -0
  111. package/src/components/slider/api.ts +41 -120
  112. package/src/components/slider/config.ts +51 -49
  113. package/src/components/slider/features/handlers.ts +495 -0
  114. package/src/components/slider/features/index.ts +1 -2
  115. package/src/components/slider/features/slider.ts +66 -84
  116. package/src/components/slider/features/states.ts +195 -0
  117. package/src/components/slider/features/structure.ts +141 -184
  118. package/src/components/slider/features/ui.ts +150 -201
  119. package/src/components/slider/index.ts +2 -11
  120. package/src/components/slider/slider.ts +9 -12
  121. package/src/components/slider/types.ts +39 -24
  122. package/src/components/switch/_styles.scss +0 -2
  123. package/src/components/tabs/_styles.scss +346 -154
  124. package/src/components/tabs/api.ts +178 -400
  125. package/src/components/tabs/config.ts +46 -52
  126. package/src/components/tabs/constants.ts +85 -8
  127. package/src/components/tabs/features.ts +403 -0
  128. package/src/components/tabs/index.ts +60 -3
  129. package/src/components/tabs/indicator.ts +285 -0
  130. package/src/components/tabs/responsive.ts +144 -0
  131. package/src/components/tabs/scroll-indicators.ts +149 -0
  132. package/src/components/tabs/state.ts +186 -0
  133. package/src/components/tabs/tab-api.ts +258 -0
  134. package/src/components/tabs/tab.ts +255 -0
  135. package/src/components/tabs/tabs.ts +50 -31
  136. package/src/components/tabs/types.ts +332 -128
  137. package/src/components/tabs/utils.ts +107 -0
  138. package/src/components/textfield/_styles.scss +0 -98
  139. package/src/components/textfield/config.ts +2 -3
  140. package/src/components/textfield/constants.ts +0 -14
  141. package/src/components/textfield/index.ts +2 -2
  142. package/src/components/textfield/textfield.ts +0 -2
  143. package/src/components/textfield/types.ts +1 -4
  144. package/src/components/timepicker/README.md +277 -0
  145. package/src/components/timepicker/_styles.scss +451 -0
  146. package/src/components/timepicker/api.ts +632 -0
  147. package/src/components/timepicker/clockdial.ts +482 -0
  148. package/src/components/timepicker/config.ts +130 -0
  149. package/src/components/timepicker/constants.ts +138 -0
  150. package/src/components/timepicker/index.ts +8 -0
  151. package/src/components/timepicker/render.ts +613 -0
  152. package/src/components/timepicker/timepicker.ts +117 -0
  153. package/src/components/timepicker/types.ts +336 -0
  154. package/src/components/timepicker/utils.ts +241 -0
  155. package/src/components/top-app-bar/_styles.scss +225 -0
  156. package/src/components/top-app-bar/config.ts +83 -0
  157. package/src/components/top-app-bar/index.ts +11 -0
  158. package/src/components/top-app-bar/top-app-bar.ts +316 -0
  159. package/src/components/top-app-bar/types.ts +140 -0
  160. package/src/core/build/_ripple.scss +6 -6
  161. package/src/core/build/ripple.ts +72 -95
  162. package/src/core/compose/component.ts +1 -1
  163. package/src/core/compose/features/badge.ts +79 -0
  164. package/src/core/compose/features/icon.ts +3 -1
  165. package/src/core/compose/features/index.ts +3 -1
  166. package/src/core/compose/features/ripple.ts +4 -1
  167. package/src/core/compose/features/textlabel.ts +26 -2
  168. package/src/core/dom/create.ts +5 -0
  169. package/src/index.ts +9 -0
  170. package/src/styles/abstract/_theme.scss +115 -3
  171. package/src/styles/themes/_autumn.scss +21 -0
  172. package/src/styles/themes/_base-theme.scss +61 -0
  173. package/src/styles/themes/_baseline.scss +58 -0
  174. package/src/styles/themes/_bluekhaki.scss +125 -0
  175. package/src/styles/themes/_brownbeige.scss +125 -0
  176. package/src/styles/themes/_browngreen.scss +125 -0
  177. package/src/styles/themes/_forest.scss +6 -0
  178. package/src/styles/themes/_greenbeige.scss +125 -0
  179. package/src/styles/themes/_material.scss +125 -0
  180. package/src/styles/themes/_ocean.scss +6 -0
  181. package/src/styles/themes/_sageivory.scss +125 -0
  182. package/src/styles/themes/_spring.scss +6 -0
  183. package/src/styles/themes/_summer.scss +5 -0
  184. package/src/styles/themes/_sunset.scss +5 -0
  185. package/src/styles/themes/_tealcaramel.scss +125 -0
  186. package/src/styles/themes/_winter.scss +6 -0
  187. package/src/components/card/actions.ts +0 -48
  188. package/src/components/card/header.ts +0 -88
  189. package/src/components/card/media.ts +0 -52
  190. package/src/components/navigation/features/items.js +0 -192
  191. package/src/components/slider/features/appearance.ts +0 -94
  192. package/src/components/slider/features/disabled.ts +0 -43
  193. package/src/components/slider/features/events.ts +0 -164
  194. package/src/components/slider/features/interactions.ts +0 -261
  195. package/src/components/slider/features/keyboard.ts +0 -112
  196. package/src/core/collection/adapters/mongodb.js +0 -232
@@ -1,9 +1,11 @@
1
1
  // src/components/slider/features/structure.ts
2
2
  import { SLIDER_COLORS, SLIDER_SIZES } from '../constants';
3
3
  import { SliderConfig } from '../types';
4
+ import createLayout from '../../../core/layout';
5
+ import { createElement } from '../../../core/dom/create';
4
6
 
5
7
  /**
6
- * Creates the slider DOM structure following MD3 principles
8
+ * Creates the slider DOM structure using layout system
7
9
  * @param config Slider configuration
8
10
  * @returns Component enhancer with DOM structure
9
11
  */
@@ -11,214 +13,169 @@ export const withStructure = (config: SliderConfig) => component => {
11
13
  // Set default values
12
14
  const min = config.min || 0;
13
15
  const max = config.max || 100;
14
- const range = max - min;
15
16
  const value = config.value !== undefined ? config.value : min;
16
17
  const secondValue = config.secondValue !== undefined ? config.secondValue : null;
17
18
  const isRangeSlider = config.range && secondValue !== null;
19
+ const isDisabled = config.disabled === true;
18
20
 
19
- // Helper function to calculate percentage
20
- const getPercentage = (val) => ((val - min) / range) * 100;
21
- const valuePercent = getPercentage(value);
22
-
23
- // Create track element and segments
24
- const track = createElement('slider-track');
25
- const remainingTrack = createElement('slider-remaining-track');
26
- const startTrack = createElement('slider-start-track');
27
- const activeTrack = createElement('slider-active-track');
28
-
29
- // Create ticks container
30
- const ticksContainer = createElement('slider-ticks-container');
31
-
32
- // Create dots for track ends
33
- const startDot = createElement('slider-dot');
34
- startDot.classList.add(component.getClass('slider-dot--start'));
35
-
36
- const endDot = createElement('slider-dot');
37
- endDot.classList.add(component.getClass('slider-dot--end'));
38
-
39
- // Create value bubble and format the value
21
+ // Format the values
40
22
  const formatter = config.valueFormatter || (val => val.toString());
41
- const valueBubble = createElement('slider-value');
42
- valueBubble.textContent = formatter(value);
43
-
44
- // Create thumb element
45
- const thumb = createElement('slider-thumb');
46
- thumb.setAttribute('tabindex', '0');
47
- thumb.setAttribute('role', 'slider');
48
-
49
- // Set initial thumb position
50
- thumb.style.left = `${valuePercent}%`;
51
-
52
- // Calculate padding adjustment (8px equivalent as percentage)
53
- const paddingAdjustment = 8; // 8px padding
54
- const estimatedTrackSize = 300; // A reasonable guess at track width
55
- const paddingPercent = (paddingAdjustment / estimatedTrackSize) * 100;
56
-
57
- // Create second thumb and value bubble for range slider
58
- let secondThumb = null;
59
- let secondValueBubble = null;
60
23
 
24
+ // Get prefixed class names
25
+ const getClass = (className) => component.getClass(className);
26
+
27
+ // Define slider structure
28
+ const structure = [
29
+ [createElement, 'container', {
30
+ className: getClass('slider-container')
31
+ }, [
32
+ // Track with segments
33
+ [createElement, 'track', {
34
+ className: getClass('slider-track')
35
+ }, [
36
+ [createElement, 'startTrack', {
37
+ className: getClass('slider-start-track')
38
+ }],
39
+ [createElement, 'activeTrack', {
40
+ className: getClass('slider-active-track')
41
+ }],
42
+ [createElement, 'remainingTrack', {
43
+ className: getClass('slider-remaining-track')
44
+ }]
45
+ ]],
46
+
47
+ // Ticks container
48
+ [createElement, 'ticksContainer', {
49
+ className: getClass('slider-ticks-container')
50
+ }],
51
+
52
+ // Dots for ends
53
+ [createElement, 'startDot', {
54
+ className: [
55
+ getClass('slider-dot'),
56
+ getClass('slider-dot--start')
57
+ ]
58
+ }],
59
+ [createElement, 'endDot', {
60
+ className: [
61
+ getClass('slider-dot'),
62
+ getClass('slider-dot--end')
63
+ ]
64
+ }],
65
+
66
+ // Main handle
67
+ [createElement, 'handle', {
68
+ className: getClass('slider-handle'),
69
+ attrs: {
70
+ 'role': 'slider',
71
+ 'aria-valuemin': String(min),
72
+ 'aria-valuemax': String(max),
73
+ 'aria-valuenow': String(value),
74
+ 'aria-orientation': 'horizontal',
75
+ 'tabindex': isDisabled ? '-1' : '0',
76
+ 'aria-disabled': isDisabled ? 'true' : 'false'
77
+ },
78
+ style: {
79
+ left: `${((value - min) / (max - min)) * 100}%`
80
+ }
81
+ }],
82
+
83
+ // Main value bubble
84
+ [createElement, 'valueBubble', {
85
+ className: getClass('slider-value'),
86
+ text: formatter(value)
87
+ }]
88
+ ]]
89
+ ];
90
+
91
+ // Add second handle and bubble for range slider
61
92
  if (isRangeSlider) {
62
- secondThumb = createElement('slider-thumb');
63
- secondThumb.setAttribute('tabindex', '0');
64
- secondThumb.setAttribute('role', 'slider');
93
+ const secondHandlePos = ((secondValue - min) / (max - min)) * 100;
65
94
 
66
- const secondPercent = getPercentage(secondValue);
67
- secondThumb.style.left = `${secondPercent}%`;
95
+ // Add second handle to structure
96
+ structure[0][3].push(
97
+ [createElement, 'secondHandle', {
98
+ className: getClass('slider-handle'),
99
+ attrs: {
100
+ 'role': 'slider',
101
+ 'aria-valuemin': String(min),
102
+ 'aria-valuemax': String(max),
103
+ 'aria-valuenow': String(secondValue),
104
+ 'aria-orientation': 'horizontal',
105
+ 'tabindex': isDisabled ? '-1' : '0',
106
+ 'aria-disabled': isDisabled ? 'true' : 'false'
107
+ },
108
+ style: {
109
+ left: `${secondHandlePos}%`
110
+ }
111
+ }]
112
+ );
68
113
 
69
- secondValueBubble = createElement('slider-value');
70
- secondValueBubble.textContent = formatter(secondValue);
114
+ // Add second bubble to structure
115
+ structure[0][3].push(
116
+ [createElement, 'secondValueBubble', {
117
+ className: getClass('slider-value'),
118
+ text: formatter(secondValue)
119
+ }]
120
+ );
71
121
  }
72
122
 
73
- // Set initial track segment dimensions
74
- setupInitialTrackSegments();
123
+ // Create layout and get structure elements
124
+ const components = createLayout(structure, component.element).component;
75
125
 
76
- // Add tracks to container
77
- track.appendChild(remainingTrack);
78
- track.appendChild(startTrack);
79
- track.appendChild(activeTrack);
80
-
81
- // Add elements to the slider
126
+ // Add component base class and accessibility attributes
82
127
  component.element.classList.add(component.getClass('slider'));
83
- component.element.appendChild(track);
84
- component.element.appendChild(ticksContainer); // Add ticks container
85
- component.element.appendChild(startDot);
86
- component.element.appendChild(endDot);
87
- component.element.appendChild(thumb);
88
- component.element.appendChild(valueBubble);
89
-
90
- if (isRangeSlider && secondThumb && secondValueBubble) {
91
- component.element.classList.add(`${component.getClass('slider')}--range`);
92
- component.element.appendChild(secondThumb);
93
- component.element.appendChild(secondValueBubble);
128
+ component.element.setAttribute('tabindex', '-1');
129
+ component.element.setAttribute('role', 'none');
130
+ component.element.setAttribute('aria-disabled', isDisabled ? 'true' : 'false');
131
+
132
+ // Position any icon properly
133
+ const iconElement = component.element.querySelector(`.${component.getClass('icon')}`);
134
+ if (iconElement && config.label) {
135
+ iconElement.classList.add(component.getClass('slider-icon'));
136
+ component.element.classList.add(component.getClass('slider--icon'));
94
137
  }
95
138
 
96
- // Apply styling classes
97
- applyStyleClasses();
98
-
99
- // Schedule UI update after DOM is attached
100
- setTimeout(() => {
101
- component.slider?.updateUi?.();
102
- }, 0);
139
+ // Apply style classes
140
+ applyStyleClasses(component, config, isRangeSlider, isDisabled);
103
141
 
104
142
  // Return enhanced component with structure
105
143
  return {
106
144
  ...component,
107
- structure: {
108
- track,
109
- activeTrack,
110
- startTrack,
111
- remainingTrack,
112
- ticksContainer,
113
- thumb,
114
- valueBubble,
115
- secondThumb,
116
- secondValueBubble,
117
- startDot,
118
- endDot
119
- }
145
+ structure: components
120
146
  };
147
+ };
148
+
149
+ /**
150
+ * Applies style classes based on configuration
151
+ */
152
+ function applyStyleClasses(component, config, isRangeSlider, isDisabled) {
153
+ const baseClass = component.getClass('slider');
121
154
 
122
- /**
123
- * Creates DOM element with slider class
124
- * @param className Base class name
125
- * @returns DOM element
126
- */
127
- function createElement(className) {
128
- const element = document.createElement('div');
129
- element.classList.add(component.getClass(className));
130
- return element;
155
+ // Apply size class
156
+ const size = config.size || SLIDER_SIZES.MEDIUM;
157
+ if (size !== SLIDER_SIZES.MEDIUM) {
158
+ component.element.classList.add(`${baseClass}--${size}`);
131
159
  }
132
160
 
133
- /**
134
- * Sets up initial track segment positions and dimensions
135
- */
136
- function setupInitialTrackSegments() {
137
- if (isRangeSlider) {
138
- // Range slider with two thumbs
139
- const lowerValue = Math.min(value, secondValue);
140
- const higherValue = Math.max(value, secondValue);
141
- const lowerPercent = getPercentage(lowerValue);
142
- const higherPercent = getPercentage(higherValue);
143
-
144
- // Adjust positions to account for spacing
145
- let adjustedLowerPercent = lowerPercent + paddingPercent;
146
- let adjustedHigherPercent = higherPercent - paddingPercent;
147
-
148
- // Handle case when thumbs are very close
149
- if (adjustedHigherPercent <= adjustedLowerPercent) {
150
- adjustedLowerPercent = (lowerPercent + higherPercent) / 2 - 1;
151
- adjustedHigherPercent = (lowerPercent + higherPercent) / 2 + 1;
152
- }
153
-
154
- // Calculate segment sizes
155
- const startWidth = Math.max(0, lowerPercent - paddingPercent);
156
- const activeWidth = Math.max(0, adjustedHigherPercent - adjustedLowerPercent);
157
- const remainingWidth = Math.max(0, 100 - higherPercent - paddingPercent);
158
-
159
- // Set styles
160
- startTrack.style.display = 'block';
161
- activeTrack.style.display = 'block';
162
- remainingTrack.style.display = 'block';
163
-
164
- // Horizontal orientation
165
- setTrackStyles(startTrack, startWidth, 0);
166
- setTrackStyles(activeTrack, activeWidth, adjustedLowerPercent);
167
- setTrackStyles(remainingTrack, remainingWidth, higherPercent + paddingPercent);
168
- } else {
169
- // Single thumb slider
170
- const adjustedWidth = Math.max(0, valuePercent - paddingPercent);
171
- const remainingWidth = Math.max(0, 100 - valuePercent - paddingPercent);
172
-
173
- // Hide start track for single thumb
174
- startTrack.style.display = 'none';
175
- activeTrack.style.display = 'block';
176
- remainingTrack.style.display = 'block';
177
-
178
- // Horizontal orientation
179
- setTrackStyles(activeTrack, adjustedWidth, 0);
180
- setTrackStyles(remainingTrack, remainingWidth, valuePercent + paddingPercent);
181
- }
161
+ // Apply color class
162
+ const color = config.color || SLIDER_COLORS.PRIMARY;
163
+ if (color !== SLIDER_COLORS.PRIMARY) {
164
+ component.element.classList.add(`${baseClass}--${color}`);
182
165
  }
183
166
 
184
- /**
185
- * Sets styles for track segments
186
- * @param element Track segment element
187
- * @param width Width as percentage
188
- * @param left Left position as percentage
189
- */
190
- function setTrackStyles(element, width, left) {
191
- element.style.width = `${width}%`;
192
- element.style.left = `${left}%`;
193
- element.style.height = '100%';
167
+ // Apply discrete class if step is specified
168
+ if (config.step !== undefined && config.step > 0) {
169
+ component.element.classList.add(`${baseClass}--discrete`);
194
170
  }
195
171
 
196
- /**
197
- * Applies style classes based on configuration
198
- */
199
- function applyStyleClasses() {
200
- const baseClass = component.getClass('slider');
201
-
202
- // Apply size class
203
- const size = config.size || SLIDER_SIZES.MEDIUM;
204
- if (size !== SLIDER_SIZES.MEDIUM) {
205
- component.element.classList.add(`${baseClass}--${size}`);
206
- }
207
-
208
- // Apply color class
209
- const color = config.color || SLIDER_COLORS.PRIMARY;
210
- if (color !== SLIDER_COLORS.PRIMARY) {
211
- component.element.classList.add(`${baseClass}--${color}`);
212
- }
213
-
214
- // Apply discrete class if step is specified
215
- if (config.step !== undefined && config.step > 0) {
216
- component.element.classList.add(`${baseClass}--discrete`);
217
- }
218
-
219
- // Apply disabled class if needed
220
- if (config.disabled) {
221
- component.element.classList.add(`${baseClass}--disabled`);
222
- }
172
+ // Apply disabled class if needed
173
+ if (isDisabled) {
174
+ component.element.classList.add(`${baseClass}--disabled`);
175
+ }
176
+
177
+ // Apply range class if needed
178
+ if (isRangeSlider) {
179
+ component.element.classList.add(`${baseClass}--range`);
223
180
  }
224
- };
181
+ }