@momentum-design/components 0.95.7 → 0.96.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.
Files changed (57) hide show
  1. package/dist/browser/index.js +597 -327
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/components/buttonsimple/buttonsimple.component.js +5 -4
  4. package/dist/components/buttonsimple/buttonsimple.constants.d.ts +3 -0
  5. package/dist/components/buttonsimple/buttonsimple.constants.js +3 -0
  6. package/dist/components/cardcheckbox/cardcheckbox.component.js +3 -2
  7. package/dist/components/cardradio/cardradio.component.js +3 -2
  8. package/dist/components/checkbox/checkbox.component.js +2 -1
  9. package/dist/components/input/input.component.js +2 -1
  10. package/dist/components/linkbutton/index.d.ts +8 -0
  11. package/dist/components/linkbutton/index.js +5 -0
  12. package/dist/components/linkbutton/linkbutton.component.d.ts +65 -0
  13. package/dist/components/linkbutton/linkbutton.component.js +111 -0
  14. package/dist/components/linkbutton/linkbutton.constants.d.ts +13 -0
  15. package/dist/components/linkbutton/linkbutton.constants.js +16 -0
  16. package/dist/components/linkbutton/linkbutton.styles.d.ts +2 -0
  17. package/dist/components/linkbutton/linkbutton.styles.js +66 -0
  18. package/dist/components/linkbutton/linkbutton.types.d.ts +10 -0
  19. package/dist/components/linkbutton/linkbutton.types.js +1 -0
  20. package/dist/components/linkbutton/linkbutton.utils.d.ts +3 -0
  21. package/dist/components/linkbutton/linkbutton.utils.js +12 -0
  22. package/dist/components/radio/radio.component.js +3 -2
  23. package/dist/components/searchfield/searchfield.component.js +3 -2
  24. package/dist/components/stepperconnector/index.d.ts +7 -0
  25. package/dist/components/stepperconnector/index.js +4 -0
  26. package/dist/components/stepperconnector/stepperconnector.component.d.ts +31 -0
  27. package/dist/components/stepperconnector/stepperconnector.component.js +60 -0
  28. package/dist/components/stepperconnector/stepperconnector.constants.d.ts +14 -0
  29. package/dist/components/stepperconnector/stepperconnector.constants.js +15 -0
  30. package/dist/components/stepperconnector/stepperconnector.styles.d.ts +2 -0
  31. package/dist/components/stepperconnector/stepperconnector.styles.js +38 -0
  32. package/dist/components/stepperconnector/stepperconnector.types.d.ts +5 -0
  33. package/dist/components/stepperconnector/stepperconnector.types.js +1 -0
  34. package/dist/components/stepperitem/index.d.ts +9 -0
  35. package/dist/components/stepperitem/index.js +6 -0
  36. package/dist/components/stepperitem/stepperitem.component.d.ts +107 -0
  37. package/dist/components/stepperitem/stepperitem.component.js +199 -0
  38. package/dist/components/stepperitem/stepperitem.constants.d.ts +22 -0
  39. package/dist/components/stepperitem/stepperitem.constants.js +23 -0
  40. package/dist/components/stepperitem/stepperitem.styles.d.ts +2 -0
  41. package/dist/components/stepperitem/stepperitem.styles.js +157 -0
  42. package/dist/components/stepperitem/stepperitem.types.d.ts +11 -0
  43. package/dist/components/stepperitem/stepperitem.types.js +1 -0
  44. package/dist/components/toggle/toggle.component.js +2 -1
  45. package/dist/custom-elements.json +4582 -3605
  46. package/dist/index.d.ts +4 -1
  47. package/dist/index.js +4 -1
  48. package/dist/react/index.d.ts +6 -3
  49. package/dist/react/index.js +6 -3
  50. package/dist/react/linkbutton/index.d.ts +38 -0
  51. package/dist/react/linkbutton/index.js +46 -0
  52. package/dist/react/stepperconnector/index.d.ts +15 -0
  53. package/dist/react/stepperconnector/index.js +24 -0
  54. package/dist/react/stepperitem/index.d.ts +40 -0
  55. package/dist/react/stepperitem/index.js +48 -0
  56. package/dist/utils/keys.d.ts +12 -12
  57. package/package.json +1 -1
@@ -13,6 +13,7 @@ import { Component } from '../../models';
13
13
  import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
14
14
  import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
15
15
  import { AutoFocusMixin } from '../../utils/mixins/AutoFocusMixin';
16
+ import { KEYS } from '../../utils/keys';
16
17
  import { BUTTON_TYPE, DEFAULTS } from './buttonsimple.constants';
17
18
  import styles from './buttonsimple.styles';
18
19
  /**
@@ -181,9 +182,9 @@ class Buttonsimple extends AutoFocusMixin(TabIndexMixin(DisabledMixin(Component)
181
182
  * @param event - The keyboard event.
182
183
  */
183
184
  handleKeyDown(event) {
184
- if (['Enter', ' '].includes(event.key)) {
185
+ if ([KEYS.ENTER, KEYS.SPACE].includes(event.key)) {
185
186
  this.classList.add('pressed');
186
- if (event.key === 'Enter') {
187
+ if (event.key === KEYS.ENTER) {
187
188
  this.triggerClickEvent();
188
189
  }
189
190
  // preventing the default event behavior for space key
@@ -201,9 +202,9 @@ class Buttonsimple extends AutoFocusMixin(TabIndexMixin(DisabledMixin(Component)
201
202
  * @param event - The keyboard event.
202
203
  */
203
204
  handleKeyUp(event) {
204
- if (['Enter', ' '].includes(event.key)) {
205
+ if ([KEYS.ENTER, KEYS.SPACE].includes(event.key)) {
205
206
  this.classList.remove('pressed');
206
- if (event.key === ' ') {
207
+ if (event.key === KEYS.SPACE) {
207
208
  this.triggerClickEvent();
208
209
  }
209
210
  }
@@ -1,5 +1,8 @@
1
1
  declare const TAG_NAME: "mdc-buttonsimple";
2
2
  declare const BUTTON_SIZES: {
3
+ readonly 12: 12;
4
+ readonly 14: 14;
5
+ readonly 16: 16;
3
6
  readonly 20: 20;
4
7
  readonly 24: 24;
5
8
  readonly 28: 28;
@@ -1,6 +1,9 @@
1
1
  import utils from '../../utils/tag-name';
2
2
  const TAG_NAME = utils.constructTagName('buttonsimple');
3
3
  const BUTTON_SIZES = {
4
+ 12: 12,
5
+ 14: 14,
6
+ 16: 16,
4
7
  20: 20,
5
8
  24: 24,
6
9
  28: 28,
@@ -13,6 +13,7 @@ import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
13
13
  import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
14
14
  import Card from '../card/card.component';
15
15
  import { ROLE } from '../../utils/roles';
16
+ import { KEYS } from '../../utils/keys';
16
17
  import { CHECK_MARK, DEFAULTS, SELECTION_TYPE } from './cardcheckbox.constants';
17
18
  import styles from './cardcheckbox.styles';
18
19
  /**
@@ -89,7 +90,7 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
89
90
  * @param event - The keyboard event
90
91
  */
91
92
  toggleOnEnter(event) {
92
- if (event.key === 'Enter') {
93
+ if (event.key === KEYS.ENTER) {
93
94
  this.toggleChecked();
94
95
  }
95
96
  }
@@ -98,7 +99,7 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
98
99
  * @param event - The keyboard event
99
100
  */
100
101
  toggleOnSpace(event) {
101
- if (event.key === ' ') {
102
+ if (event.key === KEYS.SPACE) {
102
103
  this.toggleChecked();
103
104
  }
104
105
  }
@@ -14,6 +14,7 @@ import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
14
14
  import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
15
15
  import Card from '../card/card.component';
16
16
  import { ROLE } from '../../utils/roles';
17
+ import { KEYS } from '../../utils/keys';
17
18
  import styles from './cardradio.styles';
18
19
  /**
19
20
  * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.
@@ -126,7 +127,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
126
127
  const prevIndex = (currentIndex - 1 + enabledCards.length) % enabledCards.length;
127
128
  this.updateCardRadio(enabledCards, prevIndex);
128
129
  }
129
- if (event.key === 'Enter') {
130
+ if (event.key === KEYS.ENTER) {
130
131
  this.toggleChecked();
131
132
  }
132
133
  }
@@ -135,7 +136,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
135
136
  * @param event - The keyboard event
136
137
  */
137
138
  toggleOnSpace(event) {
138
- if (event.key === ' ') {
139
+ if (event.key === KEYS.SPACE) {
139
140
  this.toggleChecked();
140
141
  }
141
142
  }
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { html, nothing } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
+ import { KEYS } from '../../utils/keys';
13
14
  import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
14
15
  import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
15
16
  import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
@@ -140,7 +141,7 @@ class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
140
141
  */
141
142
  handleKeyDown(event) {
142
143
  var _a;
143
- if (event.key === 'Enter') {
144
+ if (event.key === KEYS.ENTER) {
144
145
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
145
146
  }
146
147
  }
@@ -15,6 +15,7 @@ import FormfieldWrapper from '../formfieldwrapper';
15
15
  import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
16
16
  import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
17
17
  import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
18
+ import { KEYS } from '../../utils/keys';
18
19
  import { AUTO_CAPITALIZE, AUTO_COMPLETE, DEFAULTS, PREFIX_TEXT_OPTIONS } from './input.constants';
19
20
  import styles from './input.styles';
20
21
  /**
@@ -193,7 +194,7 @@ class Input extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
193
194
  */
194
195
  handleKeyDown(event) {
195
196
  var _a;
196
- if (event.key === 'Enter') {
197
+ if (event.key === KEYS.ENTER) {
197
198
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
198
199
  }
199
200
  }
@@ -0,0 +1,8 @@
1
+ import LinkButton from './linkbutton.component';
2
+ import '../icon';
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ ['mdc-linkbutton']: LinkButton;
6
+ }
7
+ }
8
+ export default LinkButton;
@@ -0,0 +1,5 @@
1
+ import LinkButton from './linkbutton.component';
2
+ import { TAG_NAME } from './linkbutton.constants';
3
+ import '../icon';
4
+ LinkButton.register(TAG_NAME);
5
+ export default LinkButton;
@@ -0,0 +1,65 @@
1
+ import { CSSResult, PropertyValues } from 'lit';
2
+ import Buttonsimple from '../buttonsimple/buttonsimple.component';
3
+ import type { LinkButtonSize } from './linkbutton.types';
4
+ declare const LinkButton_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/IconNameMixin").IconNameMixinInterface> & typeof Buttonsimple;
5
+ /**
6
+ * `mdc-linkbutton` visually mimics a hyperlink while functioning as a button. It blends the appearance of `mdc-link` with the accessibility and interaction capabilities of `mdc-button`.
7
+ *
8
+ * ### Features:
9
+ * - Looks like a link, behaves like a button.
10
+ * - Supports slots for a text label and an optional trailing icon.
11
+ * - Inherits accessibility and keyboard interaction behavior from `mdc-buttonsimple`.
12
+ *
13
+ * @dependency mdc-icon
14
+ *
15
+ * @tagname mdc-linkbutton
16
+ *
17
+ * @slot - Text label of the linkbutton.
18
+ *
19
+ * @event click - (React: onClick) This event is dispatched when the linkbutton is clicked.
20
+ * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the linkbutton.
21
+ * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the linkbutton.
22
+ * @event focus - (React: onFocus) This event is dispatched when the linkbutton receives focus.
23
+ *
24
+ * @cssproperty --mdc-link-border-radius - Border radius of the linkbutton.
25
+ * @cssproperty --mdc-link-color-active - Color of the linkbutton’s child content in the active state.
26
+ * @cssproperty --mdc-link-color-disabled - Color of the linkbutton’s child content in the disabled state.
27
+ * @cssproperty --mdc-link-color-hover - Color of the linkbutton’s child content in the hover state.
28
+ * @cssproperty --mdc-link-color-normal - Color of the linkbutton’s child content in the normal state.
29
+ * @cssproperty --mdc-link-inverted-color-active - Color of the inverted linkbutton’s child content in the active state.
30
+ * @cssproperty --mdc-link-inverted-color-disabled - Color of the inverted linkbutton’s child content in the disabled state.
31
+ * @cssproperty --mdc-link-inverted-color-hover - Color of the inverted linkbutton’s child content in the hover state.
32
+ * @cssproperty --mdc-link-inverted-color-normal - Color of the inverted linkbutton’s child content in the normal state.
33
+ */
34
+ declare class LinkButton extends LinkButton_base {
35
+ /**
36
+ * Sets the size of the linkbutton.
37
+ * Acceptable values:
38
+ * - 12
39
+ * - 14
40
+ * - 16
41
+ * @default 16
42
+ */
43
+ size: LinkButtonSize;
44
+ /**
45
+ * The linkbutton can be inline or standalone.
46
+ * @default false
47
+ */
48
+ inline: boolean;
49
+ /**
50
+ * The linkbutton color can be inverted by setting the inverted attribute to true.
51
+ * @default false
52
+ */
53
+ inverted: boolean;
54
+ connectedCallback(): void;
55
+ update(changedProperties: PropertyValues): void;
56
+ /**
57
+ * Sets the `size` attribute for the linkbutton, falling back to the default if the value is invalid.
58
+ *
59
+ * @param size - The desired link size.
60
+ */
61
+ private setSize;
62
+ render(): import("lit-html").TemplateResult<1>;
63
+ static styles: Array<CSSResult>;
64
+ }
65
+ export default LinkButton;
@@ -0,0 +1,111 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { html, nothing } from 'lit';
11
+ import { property } from 'lit/decorators.js';
12
+ import { IconNameMixin } from '../../utils/mixins/IconNameMixin';
13
+ import Buttonsimple from '../buttonsimple/buttonsimple.component';
14
+ import Link from '../link/link.component';
15
+ import { DEFAULTS, LINKBUTTON_SIZES } from './linkbutton.constants';
16
+ import { getIconSize } from './linkbutton.utils';
17
+ import styles from './linkbutton.styles';
18
+ /**
19
+ * `mdc-linkbutton` visually mimics a hyperlink while functioning as a button. It blends the appearance of `mdc-link` with the accessibility and interaction capabilities of `mdc-button`.
20
+ *
21
+ * ### Features:
22
+ * - Looks like a link, behaves like a button.
23
+ * - Supports slots for a text label and an optional trailing icon.
24
+ * - Inherits accessibility and keyboard interaction behavior from `mdc-buttonsimple`.
25
+ *
26
+ * @dependency mdc-icon
27
+ *
28
+ * @tagname mdc-linkbutton
29
+ *
30
+ * @slot - Text label of the linkbutton.
31
+ *
32
+ * @event click - (React: onClick) This event is dispatched when the linkbutton is clicked.
33
+ * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the linkbutton.
34
+ * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the linkbutton.
35
+ * @event focus - (React: onFocus) This event is dispatched when the linkbutton receives focus.
36
+ *
37
+ * @cssproperty --mdc-link-border-radius - Border radius of the linkbutton.
38
+ * @cssproperty --mdc-link-color-active - Color of the linkbutton’s child content in the active state.
39
+ * @cssproperty --mdc-link-color-disabled - Color of the linkbutton’s child content in the disabled state.
40
+ * @cssproperty --mdc-link-color-hover - Color of the linkbutton’s child content in the hover state.
41
+ * @cssproperty --mdc-link-color-normal - Color of the linkbutton’s child content in the normal state.
42
+ * @cssproperty --mdc-link-inverted-color-active - Color of the inverted linkbutton’s child content in the active state.
43
+ * @cssproperty --mdc-link-inverted-color-disabled - Color of the inverted linkbutton’s child content in the disabled state.
44
+ * @cssproperty --mdc-link-inverted-color-hover - Color of the inverted linkbutton’s child content in the hover state.
45
+ * @cssproperty --mdc-link-inverted-color-normal - Color of the inverted linkbutton’s child content in the normal state.
46
+ */
47
+ class LinkButton extends IconNameMixin(Buttonsimple) {
48
+ constructor() {
49
+ super(...arguments);
50
+ /**
51
+ * Sets the size of the linkbutton.
52
+ * Acceptable values:
53
+ * - 12
54
+ * - 14
55
+ * - 16
56
+ * @default 16
57
+ */
58
+ this.size = DEFAULTS.SIZE;
59
+ /**
60
+ * The linkbutton can be inline or standalone.
61
+ * @default false
62
+ */
63
+ this.inline = DEFAULTS.INLINE;
64
+ /**
65
+ * The linkbutton color can be inverted by setting the inverted attribute to true.
66
+ * @default false
67
+ */
68
+ this.inverted = DEFAULTS.INVERTED;
69
+ }
70
+ connectedCallback() {
71
+ super.connectedCallback();
72
+ this.active = undefined;
73
+ this.role = DEFAULTS.ROLE;
74
+ }
75
+ update(changedProperties) {
76
+ super.update(changedProperties);
77
+ if (changedProperties.has('size')) {
78
+ this.setSize(this.size);
79
+ }
80
+ }
81
+ /**
82
+ * Sets the `size` attribute for the linkbutton, falling back to the default if the value is invalid.
83
+ *
84
+ * @param size - The desired link size.
85
+ */
86
+ setSize(size) {
87
+ this.setAttribute('size', Object.values(LINKBUTTON_SIZES).includes(size) ? `${size}` : DEFAULTS.SIZE.toString());
88
+ }
89
+ render() {
90
+ return html `
91
+ <slot></slot>
92
+ ${this.iconName
93
+ ? html ` <mdc-icon name=${this.iconName} size=${getIconSize(this.size)} length-unit="rem"></mdc-icon> `
94
+ : nothing}
95
+ `;
96
+ }
97
+ }
98
+ LinkButton.styles = [...Link.styles, ...styles];
99
+ __decorate([
100
+ property({ type: Number, reflect: true }),
101
+ __metadata("design:type", Number)
102
+ ], LinkButton.prototype, "size", void 0);
103
+ __decorate([
104
+ property({ type: Boolean, reflect: true }),
105
+ __metadata("design:type", Boolean)
106
+ ], LinkButton.prototype, "inline", void 0);
107
+ __decorate([
108
+ property({ type: Boolean, reflect: true }),
109
+ __metadata("design:type", Boolean)
110
+ ], LinkButton.prototype, "inverted", void 0);
111
+ export default LinkButton;
@@ -0,0 +1,13 @@
1
+ declare const TAG_NAME: "mdc-linkbutton";
2
+ declare const LINKBUTTON_SIZES: {
3
+ readonly 12: 12;
4
+ readonly 14: 14;
5
+ readonly 16: 16;
6
+ };
7
+ declare const DEFAULTS: {
8
+ SIZE: 16;
9
+ ROLE: "button";
10
+ INLINE: boolean;
11
+ INVERTED: boolean;
12
+ };
13
+ export { TAG_NAME, LINKBUTTON_SIZES, DEFAULTS };
@@ -0,0 +1,16 @@
1
+ import { ROLE } from '../../utils/roles';
2
+ import utils from '../../utils/tag-name';
3
+ import { DEFAULTS as LINKSIMPLE_DEFAULTS } from '../linksimple/linksimple.constants';
4
+ const TAG_NAME = utils.constructTagName('linkbutton');
5
+ const LINKBUTTON_SIZES = {
6
+ 12: 12,
7
+ 14: 14,
8
+ 16: 16,
9
+ };
10
+ const DEFAULTS = {
11
+ SIZE: LINKBUTTON_SIZES[16],
12
+ ROLE: ROLE.BUTTON,
13
+ INLINE: LINKSIMPLE_DEFAULTS.INLINE,
14
+ INVERTED: LINKSIMPLE_DEFAULTS.INVERTED,
15
+ };
16
+ export { TAG_NAME, LINKBUTTON_SIZES, DEFAULTS };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult[];
2
+ export default _default;
@@ -0,0 +1,66 @@
1
+ import { css } from 'lit';
2
+ const styles = css `
3
+ :host {
4
+ --mdc-link-color-disabled: var(--mds-color-theme-text-primary-disabled);
5
+ gap: 0.25rem;
6
+ }
7
+
8
+ :host([size='16']) {
9
+ font-size: var(--mds-font-apps-body-large-regular-font-size);
10
+ font-weight: var(--mds-font-apps-body-large-regular-font-weight);
11
+ line-height: var(--mds-font-apps-body-large-regular-line-height);
12
+ text-decoration: var(--mds-font-apps-body-large-regular-text-decoration);
13
+ text-transform: var(--mds-font-apps-body-large-regular-text-case);
14
+ }
15
+
16
+ :host([size='14']) {
17
+ font-size: var(--mds-font-apps-body-midsize-regular-font-size);
18
+ font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
19
+ line-height: var(--mds-font-apps-body-midsize-regular-line-height);
20
+ text-decoration: var(--mds-font-apps-body-midsize-regular-text-decoration);
21
+ text-transform: var(--mds-font-apps-body-midsize-regular-text-case);
22
+ }
23
+
24
+ :host([size='12']) {
25
+ font-size: var(--mds-font-apps-body-small-regular-font-size);
26
+ font-weight: var(--mds-font-apps-body-small-regular-font-weight);
27
+ line-height: var(--mds-font-apps-body-small-regular-line-height);
28
+ text-decoration: var(--mds-font-apps-body-small-regular-text-decoration);
29
+ text-transform: var(--mds-font-apps-body-small-regular-text-case);
30
+ }
31
+
32
+ :host([size='16']:hover),
33
+ :host([size='16']:active),
34
+ :host([size='16'][inline]) {
35
+ font-size: var(--mds-font-apps-body-large-regular-underline-font-size);
36
+ font-weight: var(--mds-font-apps-body-large-regular-underline-font-weight);
37
+ line-height: var(--mds-font-apps-body-large-regular-underline-line-height);
38
+ text-decoration: var(--mds-font-apps-body-large-regular-underline-text-decoration);
39
+ text-transform: var(--mds-font-apps-body-large-regular-underline-text-case);
40
+ }
41
+
42
+ :host([size='14']:hover),
43
+ :host([size='14']:active),
44
+ :host([size='14'][inline]) {
45
+ font-size: var(--mds-font-apps-body-midsize-regular-underline-font-size);
46
+ font-weight: var(--mds-font-apps-body-midsize-regular-underline-font-weight);
47
+ line-height: var(--mds-font-apps-body-midsize-regular-underline-line-height);
48
+ text-decoration: var(--mds-font-apps-body-midsize-regular-underline-text-decoration);
49
+ text-transform: var(--mds-font-apps-body-midsize-regular-underline-text-case);
50
+ }
51
+
52
+ :host([size='12']:hover),
53
+ :host([size='12']:active),
54
+ :host([size='12'][inline]) {
55
+ font-size: var(--mds-font-apps-body-small-regular-underline-font-size);
56
+ font-weight: var(--mds-font-apps-body-small-regular-underline-font-weight);
57
+ line-height: var(--mds-font-apps-body-small-regular-underline-line-height);
58
+ text-decoration: var(--mds-font-apps-body-small-regular-underline-text-decoration);
59
+ text-transform: var(--mds-font-apps-body-small-regular-underline-text-case);
60
+ }
61
+
62
+ :host([soft-disabled]) {
63
+ color: var(--mdc-link-color-disabled);
64
+ }
65
+ `;
66
+ export default [styles];
@@ -0,0 +1,10 @@
1
+ import type { ValueOf } from '../../utils/types';
2
+ import { LINKBUTTON_SIZES } from './linkbutton.constants';
3
+ type LinkButtonSize = ValueOf<typeof LINKBUTTON_SIZES>;
4
+ interface Events {
5
+ onClickEvent: MouseEvent;
6
+ onKeyDownEvent: KeyboardEvent;
7
+ onFocusEvent: FocusEvent;
8
+ onBlurEvent: Event;
9
+ }
10
+ export type { Events, LinkButtonSize };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { LinkButtonSize } from "./linkbutton.types";
2
+ declare const getIconSize: (size: LinkButtonSize) => number;
3
+ export { getIconSize };
@@ -0,0 +1,12 @@
1
+ import { LINKBUTTON_SIZES } from "./linkbutton.constants";
2
+ const getIconSize = (size) => {
3
+ switch (size) {
4
+ case LINKBUTTON_SIZES[12]:
5
+ return 0.75;
6
+ case LINKBUTTON_SIZES[14]:
7
+ return 0.875;
8
+ default:
9
+ return 1;
10
+ }
11
+ };
12
+ export { getIconSize };
@@ -16,6 +16,7 @@ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
16
16
  import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
17
17
  import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
18
18
  import { ROLE } from '../../utils/roles';
19
+ import { KEYS } from '../../utils/keys';
19
20
  import styles from './radio.styles';
20
21
  /**
21
22
  * Radio allow users to select single options from a list or turn an item/feature on or off.
@@ -238,11 +239,11 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
238
239
  const prevIndex = (currentIndex - 1 + enabledRadios.length) % enabledRadios.length;
239
240
  this.updateRadio(enabledRadios, prevIndex, event);
240
241
  }
241
- else if (event.key === ' ') {
242
+ else if (event.key === KEYS.SPACE) {
242
243
  this.updateRadio(enabledRadios, currentIndex, event);
243
244
  }
244
245
  this.updateTabIndex();
245
- if (event.key === 'Enter') {
246
+ if (event.key === KEYS.ENTER) {
246
247
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
247
248
  }
248
249
  }
@@ -11,6 +11,7 @@ import { html } from 'lit';
11
11
  import { queryAssignedElements, state } from 'lit/decorators.js';
12
12
  import { classMap } from 'lit-html/directives/class-map.js';
13
13
  import Input from '../input/input.component';
14
+ import { KEYS } from '../../utils/keys';
14
15
  import styles from './searchfield.styles';
15
16
  import { DEFAULTS } from './searchfield.constants';
16
17
  /**
@@ -110,8 +111,8 @@ class Searchfield extends Input {
110
111
  <div
111
112
  part="filters-container"
112
113
  @click=${() => this.inputElement.focus()}
113
- @keydown=${(e) => (e.key === 'Enter' ? this.inputElement.focus() : null)}
114
- @keyup=${(e) => (e.key === ' ' ? this.inputElement.focus() : null)}
114
+ @keydown=${(e) => (e.key === KEYS.ENTER ? this.inputElement.focus() : null)}
115
+ @keyup=${(e) => (e.key === KEYS.SPACE ? this.inputElement.focus() : null)}
115
116
  >
116
117
  <slot name="filters" @slotchange=${this.renderInputChips}></slot>
117
118
  </div>
@@ -0,0 +1,7 @@
1
+ import Connector from './stepperconnector.component';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ ['mdc-stepperconnector']: Connector;
5
+ }
6
+ }
7
+ export default Connector;
@@ -0,0 +1,4 @@
1
+ import Connector from './stepperconnector.component';
2
+ import { TAG_NAME } from './stepperconnector.constants';
3
+ Connector.register(TAG_NAME);
4
+ export default Connector;
@@ -0,0 +1,31 @@
1
+ import type { CSSResult } from 'lit';
2
+ import { Component } from '../../models';
3
+ import type { OrientationType, StatusType } from './stepperconnector.types';
4
+ /**
5
+ * StepperConnector component visually represents the connection between two stepper items.
6
+ * Indicates whether the connection is complete or incomplete, and supports vertical or horizontal orientation.
7
+ * They are used between 2 `mdc-stepperitem` components to visually connect them and wrapped in a `mdc-stepper` component.
8
+ *
9
+ * @tagname mdc-stepperconnector
10
+ *
11
+ * @csspart connector - The main connector line between steps
12
+ *
13
+ * @cssproperty --mdc-stepperconnector-complete-background - Background color for the complete connector
14
+ * @cssproperty --mdc-stepperconnector-incomplete-background - Background color for the incomplete connector
15
+ */
16
+ declare class StepperConnector extends Component {
17
+ /**
18
+ * The status of the connector (complete or incomplete)
19
+ * @default "incomplete"
20
+ */
21
+ status: StatusType;
22
+ /**
23
+ * The orientation of the connector (vertical or horizontal)
24
+ * @default "horizontal"
25
+ */
26
+ orientation: OrientationType;
27
+ updated(changedProperties: Map<string, unknown>): void;
28
+ render(): import("lit-html").TemplateResult<1>;
29
+ static styles: Array<CSSResult>;
30
+ }
31
+ export default StepperConnector;
@@ -0,0 +1,60 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { html } from 'lit';
11
+ import { property } from 'lit/decorators.js';
12
+ import { Component } from '../../models';
13
+ import { DEFAULTS } from './stepperconnector.constants';
14
+ import styles from './stepperconnector.styles';
15
+ /**
16
+ * StepperConnector component visually represents the connection between two stepper items.
17
+ * Indicates whether the connection is complete or incomplete, and supports vertical or horizontal orientation.
18
+ * They are used between 2 `mdc-stepperitem` components to visually connect them and wrapped in a `mdc-stepper` component.
19
+ *
20
+ * @tagname mdc-stepperconnector
21
+ *
22
+ * @csspart connector - The main connector line between steps
23
+ *
24
+ * @cssproperty --mdc-stepperconnector-complete-background - Background color for the complete connector
25
+ * @cssproperty --mdc-stepperconnector-incomplete-background - Background color for the incomplete connector
26
+ */
27
+ class StepperConnector extends Component {
28
+ constructor() {
29
+ super(...arguments);
30
+ /**
31
+ * The status of the connector (complete or incomplete)
32
+ * @default "incomplete"
33
+ */
34
+ this.status = DEFAULTS.STATUS;
35
+ /**
36
+ * The orientation of the connector (vertical or horizontal)
37
+ * @default "horizontal"
38
+ */
39
+ this.orientation = DEFAULTS.ORIENTATION;
40
+ }
41
+ updated(changedProperties) {
42
+ super.updated(changedProperties);
43
+ if (changedProperties.has('orientation')) {
44
+ this.ariaOrientation = this.orientation;
45
+ }
46
+ }
47
+ render() {
48
+ return html ` <div part="connector"></div> `;
49
+ }
50
+ }
51
+ StepperConnector.styles = [...Component.styles, ...styles];
52
+ __decorate([
53
+ property({ type: String, reflect: true }),
54
+ __metadata("design:type", String)
55
+ ], StepperConnector.prototype, "status", void 0);
56
+ __decorate([
57
+ property({ type: String, reflect: true }),
58
+ __metadata("design:type", String)
59
+ ], StepperConnector.prototype, "orientation", void 0);
60
+ export default StepperConnector;
@@ -0,0 +1,14 @@
1
+ declare const STATUS: {
2
+ readonly COMPLETE: "complete";
3
+ readonly INCOMPLETE: "incomplete";
4
+ };
5
+ declare const ORIENTATION: {
6
+ readonly VERTICAL: "vertical";
7
+ readonly HORIZONTAL: "horizontal";
8
+ };
9
+ declare const DEFAULTS: {
10
+ readonly STATUS: "incomplete";
11
+ readonly ORIENTATION: "horizontal";
12
+ };
13
+ declare const TAG_NAME: "mdc-stepperconnector";
14
+ export { TAG_NAME, STATUS, ORIENTATION, DEFAULTS };
@@ -0,0 +1,15 @@
1
+ import utils from '../../utils/tag-name';
2
+ const STATUS = {
3
+ COMPLETE: 'complete',
4
+ INCOMPLETE: 'incomplete',
5
+ };
6
+ const ORIENTATION = {
7
+ VERTICAL: 'vertical',
8
+ HORIZONTAL: 'horizontal',
9
+ };
10
+ const DEFAULTS = {
11
+ STATUS: STATUS.INCOMPLETE,
12
+ ORIENTATION: ORIENTATION.HORIZONTAL,
13
+ };
14
+ const TAG_NAME = utils.constructTagName('stepperconnector');
15
+ export { TAG_NAME, STATUS, ORIENTATION, DEFAULTS };