@momentum-design/components 0.106.0 → 0.106.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.
- package/dist/browser/index.js +98 -79
- package/dist/browser/index.js.map +2 -2
- package/dist/components/buttongroup/buttongroup.styles.js +49 -30
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +10 -0
- package/dist/components/buttonsimple/buttonsimple.component.js +8 -0
- package/dist/components/menuitem/menuitem.component.d.ts +2 -2
- package/dist/components/menuitem/menuitem.component.js +2 -11
- package/dist/custom-elements.json +2040 -1604
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +4 -4
- package/package.json +1 -1
@@ -5,65 +5,84 @@ const styles = css `
|
|
5
5
|
--mdc-buttongroup-border-radius: 1.25rem;
|
6
6
|
--mdc-buttongroup-border-color: var(--mds-color-theme-outline-button-normal);
|
7
7
|
--mdc-buttongroup-divider-color: var(--mds-color-theme-outline-secondary-normal);
|
8
|
+
--mdc-buttongroup-border-width: 1px;
|
8
9
|
}
|
9
10
|
|
10
11
|
:host::part(container) {
|
11
12
|
display: flex;
|
12
13
|
border-radius: var(--mdc-buttongroup-border-radius);
|
13
|
-
border: 1px solid var(--mdc-buttongroup-border-color);
|
14
14
|
}
|
15
15
|
|
16
16
|
:host([variant='primary'])::part(container) {
|
17
|
+
gap: 1px;
|
17
18
|
border: none;
|
18
19
|
background-color: var(--mds-color-theme-outline-primary-normal);
|
19
|
-
gap: 1px;
|
20
20
|
}
|
21
21
|
|
22
22
|
::slotted(mdc-button) {
|
23
23
|
width: inherit;
|
24
24
|
border-radius: 0;
|
25
25
|
border: none;
|
26
|
-
box-sizing:
|
26
|
+
box-sizing: border-box;
|
27
|
+
position: relative;
|
27
28
|
}
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
:host([orientation='horizontal'][variant='secondary']) ::slotted(mdc-button) {
|
30
|
+
border-block-start: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
31
|
+
border-block-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
32
|
+
}
|
33
|
+
:host([orientation='horizontal'][variant='secondary']) ::slotted(mdc-button:first-of-type) {
|
34
|
+
border-inline-start: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
35
|
+
}
|
36
|
+
:host([orientation='horizontal'][variant='secondary']) ::slotted(mdc-button:last-of-type) {
|
37
|
+
border-inline-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
31
38
|
}
|
32
39
|
|
33
|
-
:host([orientation='
|
34
|
-
border-
|
40
|
+
:host([orientation='vertical'][variant='secondary']) ::slotted(mdc-button) {
|
41
|
+
border-inline-start: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
42
|
+
border-inline-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
35
43
|
}
|
36
|
-
:host([orientation='
|
37
|
-
border-
|
44
|
+
:host([orientation='vertical'][variant='secondary']) ::slotted(mdc-button:first-of-type) {
|
45
|
+
border-block-start: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
38
46
|
}
|
39
|
-
:host([orientation='vertical'][variant='secondary']) ::slotted(mdc-button:
|
40
|
-
border-
|
47
|
+
:host([orientation='vertical'][variant='secondary']) ::slotted(mdc-button:last-of-type) {
|
48
|
+
border-block-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-border-color);
|
41
49
|
}
|
42
50
|
|
43
|
-
:host([orientation='vertical'])
|
44
|
-
|
45
|
-
border-top-right-radius: var(--mdc-buttongroup-border-radius);
|
51
|
+
:host([orientation='vertical'])::part(container) {
|
52
|
+
flex-direction: column;
|
46
53
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
54
|
+
|
55
|
+
:host([variant='secondary'][orientation='horizontal']) ::slotted(mdc-button:not(:last-of-type))::after {
|
56
|
+
content: '';
|
57
|
+
position: absolute;
|
58
|
+
height: 100%;
|
59
|
+
border-inline-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-divider-color);
|
60
|
+
inset-inline-end: calc(var(--mdc-buttongroup-border-width) / 2);
|
61
|
+
}
|
62
|
+
:host([variant='secondary'][orientation='vertical']) ::slotted(mdc-button:not(:last-of-type))::after {
|
63
|
+
content: '';
|
64
|
+
position: absolute;
|
65
|
+
width: 100%;
|
66
|
+
border-block-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-divider-color);
|
67
|
+
inset-block-end: calc(var(--mdc-buttongroup-border-width) / 2);
|
50
68
|
}
|
51
69
|
|
52
|
-
:host([orientation='
|
53
|
-
border-
|
54
|
-
border-
|
70
|
+
:host([orientation='vertical']) ::slotted(mdc-button:first-of-type) {
|
71
|
+
border-start-start-radius: var(--mdc-buttongroup-border-radius);
|
72
|
+
border-start-end-radius: var(--mdc-buttongroup-border-radius);
|
55
73
|
}
|
56
|
-
:host([orientation='
|
57
|
-
border-
|
58
|
-
border-
|
74
|
+
:host([orientation='vertical']) ::slotted(mdc-button:last-of-type) {
|
75
|
+
border-end-start-radius: var(--mdc-buttongroup-border-radius);
|
76
|
+
border-end-end-radius: var(--mdc-buttongroup-border-radius);
|
59
77
|
}
|
60
|
-
|
61
|
-
|
62
|
-
border-
|
78
|
+
|
79
|
+
:host([orientation='horizontal']) ::slotted(mdc-button:first-of-type) {
|
80
|
+
border-start-start-radius: var(--mdc-buttongroup-border-radius);
|
81
|
+
border-end-start-radius: var(--mdc-buttongroup-border-radius);
|
63
82
|
}
|
64
|
-
:host([orientation='horizontal']
|
65
|
-
border-
|
66
|
-
border-
|
83
|
+
:host([orientation='horizontal']) ::slotted(mdc-button:last-of-type) {
|
84
|
+
border-start-end-radius: var(--mdc-buttongroup-border-radius);
|
85
|
+
border-end-end-radius: var(--mdc-buttongroup-border-radius);
|
67
86
|
}
|
68
87
|
|
69
88
|
:host([compact][orientation='horizontal']) ::slotted(mdc-button) {
|
@@ -72,6 +72,16 @@ declare class Buttonsimple extends Buttonsimple_base {
|
|
72
72
|
* @default button
|
73
73
|
*/
|
74
74
|
type: ButtonType;
|
75
|
+
/**
|
76
|
+
* The name of the button, submitted as a pair with the button's value as part of the form data,
|
77
|
+
* when that button is used to submit the form.
|
78
|
+
*/
|
79
|
+
name?: string;
|
80
|
+
/**
|
81
|
+
* Defines the value associated with the button's name when it's submitted with the form data.
|
82
|
+
* This value is passed to the server in params when the form is submitted using this button.
|
83
|
+
*/
|
84
|
+
value?: string;
|
75
85
|
/**
|
76
86
|
* @internal
|
77
87
|
*/
|
@@ -240,4 +240,12 @@ __decorate([
|
|
240
240
|
property({ reflect: true }),
|
241
241
|
__metadata("design:type", String)
|
242
242
|
], Buttonsimple.prototype, "type", void 0);
|
243
|
+
__decorate([
|
244
|
+
property({ type: String, reflect: true }),
|
245
|
+
__metadata("design:type", String)
|
246
|
+
], Buttonsimple.prototype, "name", void 0);
|
247
|
+
__decorate([
|
248
|
+
property({ type: String, reflect: true }),
|
249
|
+
__metadata("design:type", String)
|
250
|
+
], Buttonsimple.prototype, "value", void 0);
|
243
251
|
export default Buttonsimple;
|
@@ -54,12 +54,12 @@ declare class MenuItem extends ListItem {
|
|
54
54
|
/**
|
55
55
|
* The name attribute is used to identify the menu item when it is selected.
|
56
56
|
*/
|
57
|
-
name?:
|
57
|
+
name?: string;
|
58
58
|
/**
|
59
59
|
* The value attribute is used to represent a value when the menu item is selected.
|
60
60
|
* It is typically used with checkbox and radio menu items, but can be handy for any menu item.
|
61
61
|
*/
|
62
|
-
value?:
|
62
|
+
value?: string;
|
63
63
|
constructor();
|
64
64
|
/**
|
65
65
|
* Handles the keydown event for the menu item.
|
@@ -53,15 +53,6 @@ import styles from './menuitem.styles';
|
|
53
53
|
class MenuItem extends ListItem {
|
54
54
|
constructor() {
|
55
55
|
super();
|
56
|
-
/**
|
57
|
-
* The name attribute is used to identify the menu item when it is selected.
|
58
|
-
*/
|
59
|
-
this.name = undefined;
|
60
|
-
/**
|
61
|
-
* The value attribute is used to represent a value when the menu item is selected.
|
62
|
-
* It is typically used with checkbox and radio menu items, but can be handy for any menu item.
|
63
|
-
*/
|
64
|
-
this.value = undefined;
|
65
56
|
this.addEventListener('keyup', this.handleKeyUp.bind(this));
|
66
57
|
}
|
67
58
|
/**
|
@@ -153,10 +144,10 @@ __decorate([
|
|
153
144
|
], MenuItem.prototype, "arrowDirection", void 0);
|
154
145
|
__decorate([
|
155
146
|
property({ type: String, reflect: true }),
|
156
|
-
__metadata("design:type",
|
147
|
+
__metadata("design:type", String)
|
157
148
|
], MenuItem.prototype, "name", void 0);
|
158
149
|
__decorate([
|
159
150
|
property({ type: String, reflect: true }),
|
160
|
-
__metadata("design:type",
|
151
|
+
__metadata("design:type", String)
|
161
152
|
], MenuItem.prototype, "value", void 0);
|
162
153
|
export default MenuItem;
|