@momentum-design/components 0.110.1 → 0.111.0

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.
@@ -1,6 +1,6 @@
1
- export { default as Accordion } from './accordion';
2
- export { default as AccordionGroup } from './accordiongroup';
3
1
  export { default as AccordionButton } from './accordionbutton';
2
+ export { default as AccordionGroup } from './accordiongroup';
3
+ export { default as Accordion } from './accordion';
4
4
  export { default as AlertChip } from './alertchip';
5
5
  export { default as Animation } from './animation';
6
6
  export { default as Appheader } from './appheader';
@@ -1,6 +1,6 @@
1
- export { default as Accordion } from './accordion';
2
- export { default as AccordionGroup } from './accordiongroup';
3
1
  export { default as AccordionButton } from './accordionbutton';
2
+ export { default as AccordionGroup } from './accordiongroup';
3
+ export { default as Accordion } from './accordion';
4
4
  export { default as AlertChip } from './alertchip';
5
5
  export { default as Animation } from './animation';
6
6
  export { default as Appheader } from './appheader';
@@ -1,12 +1,42 @@
1
+ import { type EventName } from '@lit/react';
1
2
  import Component from '../../components/slider';
2
3
  /**
3
- * slider component, which ...
4
+ * Slider component is used to select a value or range of values from within a defined range.
5
+ * It provides a visual representation of the current value(s) and allows users to adjust the value(s) by dragging the thumb(s) along the track.
6
+ * It can be used as a single slider or a range slider. This is set by the boolean attribute `range`
7
+ * If the step value is more than 1, tick marks are shown to represent the steps between the min and max values. The slider thumb will snap to the nearest tick mark.
4
8
  *
5
9
  * @tagname mdc-slider
6
10
  *
7
- * @slot default - This is a default/unnamed slot
11
+ * @dependency mdc-icon
8
12
  *
9
- * @cssproperty --custom-property-name - Description of the CSS custom property
13
+ * @csspart slider-tooltip - The tooltip of the slider
14
+ * @csspart slider-track - The track of the slider
15
+ * @csspart slider-wrapper - The wrapper around the slider input(s)
16
+ * @csspart slider-ticks - The container for the tick marks
17
+ * @csspart slider-tick - The individual tick marks
18
+ * @csspart slider-input - The input element of the slider
19
+ * @csspart slider-label - The label of the slider
20
+ *
21
+ * @event input - Fired when the slider value changes
22
+ * @event change - Fired when the slider value is committed
23
+ *
24
+ * @cssproperty --mdc-slider-thumb-color - The color of the slider thumb
25
+ * @cssproperty --mdc-slider-thumb-border-color - The color of the slider thumb border
26
+ * @cssproperty --mdc-slider-thumb-size - The size of the slider thumb
27
+ * @cssproperty --mdc-slider-input-size - The height of the slider input
28
+ * @cssproperty --mdc-slider-tick-size - The size of the slider tick marks
29
+ * @cssproperty --mdc-slider-track-height - The height of the slider track
30
+ * @cssproperty --mdc-slider-tick-color - The color of the slider tick marks
31
+ * @cssproperty --mdc-slider-progress-color - The color of the slider progress
32
+ * @cssproperty --mdc-slider-track-color - The color of the slider track
33
+ * @cssproperty --mdc-slider-tooltip-left - The left position of the slider tooltip
34
+ * @cssproperty --mdc-slider-tick-left - The left position of the slider tick marks
10
35
  */
11
- declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
36
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
37
+ onChange: EventName<CustomEvent<unknown> & {
38
+ target: Component;
39
+ }>;
40
+ onInput: EventName<import("../../utils/types").OverrideEventTarget<InputEvent, Component>>;
41
+ }>;
12
42
  export default reactWrapper;
@@ -3,19 +3,46 @@ import { createComponent } from '@lit/react';
3
3
  import Component from '../../components/slider';
4
4
  import { TAG_NAME } from '../../components/slider/slider.constants';
5
5
  /**
6
- * slider component, which ...
6
+ * Slider component is used to select a value or range of values from within a defined range.
7
+ * It provides a visual representation of the current value(s) and allows users to adjust the value(s) by dragging the thumb(s) along the track.
8
+ * It can be used as a single slider or a range slider. This is set by the boolean attribute `range`
9
+ * If the step value is more than 1, tick marks are shown to represent the steps between the min and max values. The slider thumb will snap to the nearest tick mark.
7
10
  *
8
11
  * @tagname mdc-slider
9
12
  *
10
- * @slot default - This is a default/unnamed slot
13
+ * @dependency mdc-icon
11
14
  *
12
- * @cssproperty --custom-property-name - Description of the CSS custom property
15
+ * @csspart slider-tooltip - The tooltip of the slider
16
+ * @csspart slider-track - The track of the slider
17
+ * @csspart slider-wrapper - The wrapper around the slider input(s)
18
+ * @csspart slider-ticks - The container for the tick marks
19
+ * @csspart slider-tick - The individual tick marks
20
+ * @csspart slider-input - The input element of the slider
21
+ * @csspart slider-label - The label of the slider
22
+ *
23
+ * @event input - Fired when the slider value changes
24
+ * @event change - Fired when the slider value is committed
25
+ *
26
+ * @cssproperty --mdc-slider-thumb-color - The color of the slider thumb
27
+ * @cssproperty --mdc-slider-thumb-border-color - The color of the slider thumb border
28
+ * @cssproperty --mdc-slider-thumb-size - The size of the slider thumb
29
+ * @cssproperty --mdc-slider-input-size - The height of the slider input
30
+ * @cssproperty --mdc-slider-tick-size - The size of the slider tick marks
31
+ * @cssproperty --mdc-slider-track-height - The height of the slider track
32
+ * @cssproperty --mdc-slider-tick-color - The color of the slider tick marks
33
+ * @cssproperty --mdc-slider-progress-color - The color of the slider progress
34
+ * @cssproperty --mdc-slider-track-color - The color of the slider track
35
+ * @cssproperty --mdc-slider-tooltip-left - The left position of the slider tooltip
36
+ * @cssproperty --mdc-slider-tick-left - The left position of the slider tick marks
13
37
  */
14
38
  const reactWrapper = createComponent({
15
39
  tagName: TAG_NAME,
16
40
  elementClass: Component,
17
41
  react: React,
18
- events: {},
42
+ events: {
43
+ onChange: 'change',
44
+ onInput: 'input',
45
+ },
19
46
  displayName: 'Slider',
20
47
  });
21
48
  export default reactWrapper;
@@ -1,4 +1,5 @@
1
1
  declare const hostFitContentStyles: import("lit").CSSResult;
2
2
  declare const baseHostStyleVariables: import("lit").CSSResult;
3
+ declare const focusRingBoxShadow: import("lit").CSSResult;
3
4
  declare const hostFocusRingStyles: (applyFocusRingOnClass?: boolean) => import("lit").CSSResult[];
4
- export { hostFitContentStyles, hostFocusRingStyles, baseHostStyleVariables };
5
+ export { hostFitContentStyles, hostFocusRingStyles, baseHostStyleVariables, focusRingBoxShadow };
@@ -22,11 +22,11 @@ const baseHostStyleVariables = css `
22
22
  --mdc-focus-ring-outer-offset: calc(var(--mdc-focus-ring-inner-width) + var(--mdc-focus-ring-middle-width));
23
23
  }
24
24
  `;
25
- const hostFocusRingStyles = (applyFocusRingOnClass = false) => {
26
- const boxShadow = css `0 0 0 var(--mdc-focus-ring-inner-width) var(--mdc-focus-ring-inner-color),
25
+ const focusRingBoxShadow = css `0 0 0 var(--mdc-focus-ring-inner-width) var(--mdc-focus-ring-inner-color),
27
26
  0 0 0 var(--mdc-focus-ring-middle-width) var(--mdc-focus-ring-middle-color),
28
27
  0 0 0 var(--mdc-focus-ring-outer-width) var(--mdc-focus-ring-outer-color)
29
28
  `;
29
+ const hostFocusRingStyles = (applyFocusRingOnClass = false) => {
30
30
  if (applyFocusRingOnClass) {
31
31
  return [
32
32
  baseHostStyleVariables,
@@ -40,7 +40,7 @@ const hostFocusRingStyles = (applyFocusRingOnClass = false) => {
40
40
  /* Add focus ring to parent when child is focused. The parent element must have class name mdc-focus-ring */
41
41
  .mdc-focus-ring:focus-within {
42
42
  position: relative;
43
- box-shadow: ${boxShadow};
43
+ box-shadow: ${focusRingBoxShadow};
44
44
  }
45
45
  /* Remove focus ring from parent when children has its own focus ring.
46
46
  The child element must have class name own-focus-ring */
@@ -66,7 +66,7 @@ const hostFocusRingStyles = (applyFocusRingOnClass = false) => {
66
66
  :host(:focus-visible) {
67
67
  outline: none;
68
68
  position: relative;
69
- box-shadow: ${boxShadow};
69
+ box-shadow: ${focusRingBoxShadow};
70
70
  }
71
71
  /* High Contrast Mode */
72
72
  @media (forced-colors: active) {
@@ -77,4 +77,4 @@ const hostFocusRingStyles = (applyFocusRingOnClass = false) => {
77
77
  `,
78
78
  ];
79
79
  };
80
- export { hostFitContentStyles, hostFocusRingStyles, baseHostStyleVariables };
80
+ export { hostFitContentStyles, hostFocusRingStyles, baseHostStyleVariables, focusRingBoxShadow };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.110.1",
4
+ "version": "0.111.0",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"