mtrl 0.2.8 → 0.2.9

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 (42) hide show
  1. package/index.ts +2 -0
  2. package/package.json +1 -1
  3. package/src/components/navigation/api.ts +131 -96
  4. package/src/components/navigation/features/controller.ts +273 -0
  5. package/src/components/navigation/features/items.ts +133 -64
  6. package/src/components/navigation/navigation.ts +17 -2
  7. package/src/components/navigation/system-types.ts +124 -0
  8. package/src/components/navigation/system.ts +776 -0
  9. package/src/components/slider/config.ts +20 -2
  10. package/src/components/slider/features/controller.ts +761 -0
  11. package/src/components/slider/features/handlers.ts +18 -15
  12. package/src/components/slider/features/index.ts +3 -2
  13. package/src/components/slider/features/range.ts +104 -0
  14. package/src/components/slider/slider.ts +34 -14
  15. package/src/components/slider/structure.ts +152 -0
  16. package/src/components/textfield/api.ts +53 -0
  17. package/src/components/textfield/features.ts +322 -0
  18. package/src/components/textfield/textfield.ts +8 -0
  19. package/src/components/textfield/types.ts +12 -3
  20. package/src/components/timepicker/clockdial.ts +1 -4
  21. package/src/core/compose/features/textinput.ts +15 -2
  22. package/src/core/composition/features/dom.ts +33 -0
  23. package/src/core/composition/features/icon.ts +131 -0
  24. package/src/core/composition/features/index.ts +11 -0
  25. package/src/core/composition/features/label.ts +156 -0
  26. package/src/core/composition/features/structure.ts +22 -0
  27. package/src/core/composition/index.ts +26 -0
  28. package/src/core/index.ts +1 -1
  29. package/src/core/structure.ts +288 -0
  30. package/src/index.ts +1 -0
  31. package/src/styles/components/_navigation-mobile.scss +244 -0
  32. package/src/styles/components/_navigation-system.scss +151 -0
  33. package/src/styles/components/_textfield.scss +250 -11
  34. package/demo/build.ts +0 -349
  35. package/demo/index.html +0 -110
  36. package/demo/main.js +0 -448
  37. package/demo/styles.css +0 -239
  38. package/server.ts +0 -86
  39. package/src/components/slider/features/slider.ts +0 -318
  40. package/src/components/slider/features/structure.ts +0 -181
  41. package/src/components/slider/features/ui.ts +0 -388
  42. package/src/components/textfield/constants.ts +0 -100
@@ -5,6 +5,7 @@ import {
5
5
  } from '../../core/config/component-config';
6
6
  import { SliderConfig } from './types';
7
7
  import { SLIDER_COLORS, SLIDER_SIZES } from './constants';
8
+ import { createSliderDefinition } from './structure';
8
9
 
9
10
  /**
10
11
  * Default configuration for the Slider component
@@ -31,8 +32,25 @@ export const defaultConfig: SliderConfig = {
31
32
  * @param {SliderConfig} config - User provided configuration
32
33
  * @returns {SliderConfig} Complete configuration with defaults applied
33
34
  */
34
- export const createBaseConfig = (config: SliderConfig = {}): SliderConfig =>
35
- createComponentConfig(defaultConfig, config, 'slider') as SliderConfig;
35
+ export const createBaseConfig = (config: SliderConfig = {}): SliderConfig => {
36
+ // Create the base config with defaults applied
37
+ const baseConfig = createComponentConfig(defaultConfig, config, 'slider') as SliderConfig;
38
+
39
+ // Create a basic component object for structure generation
40
+ const baseComponent = {
41
+ componentName: 'slider',
42
+ config: baseConfig,
43
+ getClass: (className) => {
44
+ const prefix = baseConfig.prefix || 'mtrl';
45
+ return `${prefix}-${className}`;
46
+ }
47
+ };
48
+
49
+ // Add the structure definition to the config
50
+ baseConfig.structureDefinition = createSliderDefinition(baseComponent, baseConfig);
51
+
52
+ return baseConfig;
53
+ };
36
54
 
37
55
  /**
38
56
  * Generates element configuration for the Slider component