@momentum-design/components 0.25.3 → 0.25.4
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 +126 -59
- package/dist/browser/index.js.map +2 -2
- package/dist/components/divider/divider.component.d.ts +7 -0
- package/dist/components/divider/divider.component.js +7 -0
- package/dist/components/divider/divider.styles.js +86 -19
- package/dist/custom-elements.json +17 -1
- package/dist/react/divider/index.d.ts +7 -0
- package/dist/react/divider/index.js +7 -0
- package/package.json +1 -1
@@ -40,6 +40,13 @@ import type { Directions, DividerOrientation, DividerVariant } from './divider.t
|
|
40
40
|
* @cssproperty --mdc-divider-text-color - font color of label in the text divider
|
41
41
|
* @cssproperty --mdc-divider-text-margin - left and right margin of label in the text divider
|
42
42
|
* @cssproperty --mdc-divider-text-line-height - line height of label in the text divider
|
43
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-normal - background color of the grabber button
|
44
|
+
* in rest state
|
45
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-hover - background color of the grabber button
|
46
|
+
* in hover state
|
47
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-pressed - background color of the grabber button
|
48
|
+
* in pressed state
|
49
|
+
* @cssproperty --mdc-divider-grabber-button-border-color - border color of the grabber button
|
43
50
|
* @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button
|
44
51
|
*/
|
45
52
|
declare class Divider extends Component {
|
@@ -50,6 +50,13 @@ import styles from './divider.styles';
|
|
50
50
|
* @cssproperty --mdc-divider-text-color - font color of label in the text divider
|
51
51
|
* @cssproperty --mdc-divider-text-margin - left and right margin of label in the text divider
|
52
52
|
* @cssproperty --mdc-divider-text-line-height - line height of label in the text divider
|
53
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-normal - background color of the grabber button
|
54
|
+
* in rest state
|
55
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-hover - background color of the grabber button
|
56
|
+
* in hover state
|
57
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-pressed - background color of the grabber button
|
58
|
+
* in pressed state
|
59
|
+
* @cssproperty --mdc-divider-grabber-button-border-color - border color of the grabber button
|
53
60
|
* @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button
|
54
61
|
*/
|
55
62
|
class Divider extends Component {
|
@@ -17,6 +17,10 @@ const styles = [
|
|
17
17
|
--mdc-divider-text-line-height: var(--mds-font-lineheight-body-midsize);
|
18
18
|
--mdc-divider-text-margin: 1.5rem;
|
19
19
|
--mdc-divider-grabber-button-border-radius: 0.5rem;
|
20
|
+
--mdc-divider-grabber-button-border-color: var(--mds-color-theme-outline-secondary-normal);
|
21
|
+
--mdc-divider-grabber-button-background-color-normal: var(--mds-color-theme-overlay-button-secondary-normal);
|
22
|
+
--mdc-divider-grabber-button-background-color-hover: var(--mds-color-theme-overlay-button-secondary-hover);
|
23
|
+
--mdc-divider-grabber-button-background-color-pressed: var(--mds-color-theme-overlay-button-secondary-pressed);
|
20
24
|
|
21
25
|
display: flex;
|
22
26
|
justify-content: center;
|
@@ -28,6 +32,37 @@ const styles = [
|
|
28
32
|
background-color: var(--mdc-divider-background-color);
|
29
33
|
}
|
30
34
|
|
35
|
+
@media (forced-colors: active) {
|
36
|
+
/* Primary and grabber divider styles */
|
37
|
+
:host([data-type='mdc-primary-divider'][button-position='positive']),
|
38
|
+
:host([data-type='mdc-grabber-divider'][button-position='positive']) {
|
39
|
+
border: 0;
|
40
|
+
border-top: var(--mdc-divider-width) solid var(--mdc-divider-background-color);
|
41
|
+
}
|
42
|
+
|
43
|
+
:host([data-type='mdc-primary-divider'][button-position='negative']),
|
44
|
+
:host([data-type='mdc-grabber-divider'][button-position='negative']) {
|
45
|
+
border: 0;
|
46
|
+
border-bottom: var(--mdc-divider-width) solid var(--mdc-divider-background-color);
|
47
|
+
}
|
48
|
+
|
49
|
+
:host([data-type='mdc-primary-divider'][orientation='vertical'][button-position='positive']),
|
50
|
+
:host([data-type='mdc-grabber-divider'][orientation='vertical'][button-position='positive']),
|
51
|
+
:host([data-type='mdc-primary-divider'][orientation='vertical'][button-position='negative']:dir(rtl)),
|
52
|
+
:host([data-type='mdc-grabber-divider'][orientation='vertical'][button-position='negative']:dir(rtl)) {
|
53
|
+
border: 0;
|
54
|
+
border-right: var(--mdc-divider-width) solid var(--mdc-divider-background-color);
|
55
|
+
}
|
56
|
+
|
57
|
+
:host([data-type='mdc-primary-divider'][orientation='vertical'][button-position='negative']),
|
58
|
+
:host([data-type='mdc-grabber-divider'][orientation='vertical'][button-position='negative']),
|
59
|
+
:host([data-type='mdc-primary-divider'][orientation='vertical'][button-position='positive']:dir(rtl)),
|
60
|
+
:host([data-type='mdc-grabber-divider'][orientation='vertical'][button-position='positive']:dir(rtl)) {
|
61
|
+
border: 0;
|
62
|
+
border-left: var(--mdc-divider-width) solid var(--mdc-divider-background-color);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
31
66
|
/* Orientation-specific styles */
|
32
67
|
:host([orientation='horizontal']) {
|
33
68
|
flex-direction: row;
|
@@ -58,21 +93,35 @@ const styles = [
|
|
58
93
|
}
|
59
94
|
|
60
95
|
/** Button divider styles */
|
96
|
+
|
97
|
+
::slotted(mdc-button) {
|
98
|
+
background-color: var(--mdc-divider-grabber-button-background-color-normal);
|
99
|
+
border-color: var(--mdc-divider-grabber-button-border-color);
|
100
|
+
}
|
101
|
+
|
102
|
+
::slotted(mdc-button:hover) {
|
103
|
+
background-color: var(--mdc-divider-grabber-button-background-color-hover);
|
104
|
+
}
|
105
|
+
|
106
|
+
::slotted(mdc-button:active) {
|
107
|
+
background-color: var(--mdc-divider-grabber-button-background-color-pressed);
|
108
|
+
}
|
109
|
+
|
61
110
|
:host([orientation='vertical']) ::slotted(mdc-button) {
|
62
111
|
width: 1.25rem;
|
63
112
|
height: 2.5rem;
|
64
|
-
border-radius: 0
|
65
|
-
var(--mdc-divider-grabber-button-border-radius)
|
66
|
-
var(--mdc-divider-grabber-button-border-radius)
|
113
|
+
border-radius: 0
|
114
|
+
var(--mdc-divider-grabber-button-border-radius)
|
115
|
+
var(--mdc-divider-grabber-button-border-radius)
|
67
116
|
0;
|
68
117
|
}
|
69
118
|
|
70
119
|
:host([orientation='horizontal']) ::slotted(mdc-button) {
|
71
120
|
height: 1.25rem;
|
72
121
|
width: 2.5rem;
|
73
|
-
border-radius: 0
|
74
|
-
0
|
75
|
-
var(--mdc-divider-grabber-button-border-radius)
|
122
|
+
border-radius: 0
|
123
|
+
0
|
124
|
+
var(--mdc-divider-grabber-button-border-radius)
|
76
125
|
var(--mdc-divider-grabber-button-border-radius);
|
77
126
|
}
|
78
127
|
|
@@ -87,41 +136,53 @@ const styles = [
|
|
87
136
|
}
|
88
137
|
|
89
138
|
:host([orientation='horizontal'][button-position='positive']) ::slotted(mdc-button) {
|
90
|
-
border-radius: var(--mdc-divider-grabber-button-border-radius)
|
91
|
-
var(--mdc-divider-grabber-button-border-radius)
|
92
|
-
0
|
139
|
+
border-radius: var(--mdc-divider-grabber-button-border-radius)
|
140
|
+
var(--mdc-divider-grabber-button-border-radius)
|
141
|
+
0
|
93
142
|
0;
|
94
|
-
|
143
|
+
margin: 0;
|
144
|
+
margin-bottom: var(--mdc-divider-width);
|
145
|
+
border-bottom: 0;
|
95
146
|
}
|
96
147
|
|
97
148
|
:host([orientation='horizontal'][button-position='negative']) ::slotted(mdc-button) {
|
98
|
-
|
149
|
+
margin: 0;
|
150
|
+
margin-top: var(--mdc-divider-width);
|
151
|
+
border-top: 0;
|
99
152
|
}
|
100
153
|
|
101
154
|
:host([orientation='vertical'][button-position='negative']:dir(ltr)) ::slotted(mdc-button),
|
102
155
|
:host([orientation='vertical'][button-position='negative']:dir(rtl)) ::slotted(mdc-button) {
|
103
|
-
border-radius: var(--mdc-divider-grabber-button-border-radius)
|
104
|
-
0
|
105
|
-
0
|
156
|
+
border-radius: var(--mdc-divider-grabber-button-border-radius)
|
157
|
+
0
|
158
|
+
0
|
106
159
|
var(--mdc-divider-grabber-button-border-radius);
|
107
|
-
|
160
|
+
margin: 0;
|
161
|
+
margin-right: var(--mdc-divider-width);
|
162
|
+
border-right: 0;
|
108
163
|
}
|
109
164
|
|
110
165
|
:host([orientation='vertical'][button-position='positive']:dir(ltr)) ::slotted(mdc-button),
|
111
166
|
:host([orientation='vertical'][button-position='positive']:dir(rtl)) ::slotted(mdc-button) {
|
112
|
-
|
167
|
+
margin: 0;
|
168
|
+
margin-left: var(--mdc-divider-width);
|
169
|
+
border-left: 0;
|
113
170
|
}
|
114
171
|
|
115
172
|
:host([orientation='vertical'][button-position='positive']:dir(rtl)) ::slotted(mdc-button) {
|
116
|
-
border-radius: 0
|
117
|
-
var(--mdc-divider-grabber-button-border-radius)
|
118
|
-
var(--mdc-divider-grabber-button-border-radius)
|
173
|
+
border-radius: 0
|
174
|
+
var(--mdc-divider-grabber-button-border-radius)
|
175
|
+
var(--mdc-divider-grabber-button-border-radius)
|
119
176
|
0;
|
120
177
|
transform: rotate(180deg);
|
178
|
+
margin: 0;
|
179
|
+
margin-right: var(--mdc-divider-width);
|
121
180
|
}
|
122
181
|
|
123
182
|
:host([orientation='vertical'][button-position='negative']:dir(rtl)) ::slotted(mdc-button) {
|
124
183
|
transform: rotate(180deg);
|
184
|
+
margin: 0;
|
185
|
+
margin-left: var(--mdc-divider-width);
|
125
186
|
}
|
126
187
|
|
127
188
|
/** Text divider styles */
|
@@ -136,6 +197,12 @@ const styles = [
|
|
136
197
|
background-color: var(--mdc-divider-background-color);
|
137
198
|
}
|
138
199
|
|
200
|
+
@media (forced-colors: active) {
|
201
|
+
:host([data-type='mdc-text-divider']) > div {
|
202
|
+
border-bottom: var(--mdc-divider-width) solid var(--mdc-divider-background-color);
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
139
206
|
:host([orientation='horizontal'][variant='gradient'][data-type='mdc-text-divider']) > div:first-of-type {
|
140
207
|
background: linear-gradient(to right, transparent, 30%, var(--mdc-divider-background-color));
|
141
208
|
}
|
@@ -2580,6 +2580,22 @@
|
|
2580
2580
|
"description": "line height of label in the text divider",
|
2581
2581
|
"name": "--mdc-divider-text-line-height"
|
2582
2582
|
},
|
2583
|
+
{
|
2584
|
+
"description": "background color of the grabber button in rest state",
|
2585
|
+
"name": "--mdc-divider-grabber-button-background-color-normal"
|
2586
|
+
},
|
2587
|
+
{
|
2588
|
+
"description": "background color of the grabber button in hover state",
|
2589
|
+
"name": "--mdc-divider-grabber-button-background-color-hover"
|
2590
|
+
},
|
2591
|
+
{
|
2592
|
+
"description": "background color of the grabber button in pressed state",
|
2593
|
+
"name": "--mdc-divider-grabber-button-background-color-pressed"
|
2594
|
+
},
|
2595
|
+
{
|
2596
|
+
"description": "border color of the grabber button",
|
2597
|
+
"name": "--mdc-divider-grabber-button-border-color"
|
2598
|
+
},
|
2583
2599
|
{
|
2584
2600
|
"description": "border radius of the grabber button",
|
2585
2601
|
"name": "--mdc-divider-grabber-button-border-radius"
|
@@ -2754,7 +2770,7 @@
|
|
2754
2770
|
"module": "/src/models"
|
2755
2771
|
},
|
2756
2772
|
"tagName": "mdc-divider",
|
2757
|
-
"jsDoc": "/**\n * `mdc-divider` is a component that provides a line to separate and organize content.\n * It can also include a button or text positioned centrally, allowing users to interact with the layout.\n *\n * **Divider Orientation:**\n * - **Horizontal**: A thin, horizontal line.\n * - **Vertical**: A thin, vertical line.\n *\n * **Divider Variants:**\n * - **solid**: Solid line.\n * - **gradient**: Gradient Line.\n *\n * **Divider Types:**\n * - The type of divider is inferred based on the kind of slot present.\n * - **Primary**: A simple horizontal or vertical divider.\n * - **Text**: A horizontal divider with a text label in the center.\n * - **Grabber Button**: A horizontal or vertical divider with a styled button in the center.\n *\n * **Accessibility:**\n * - When the slot is replaced by an `mdc-button`:\n * - `aria-label` should be passed to the `mdc-button`.\n * - `aria-expanded` should be passed to the `mdc-button`.\n *\n * **Notes:**\n * - If the slot is replaced by an invalid tag name or contains multiple elements,\n * the divider defaults to the **Primary** type.\n * - To override the styles of the divider, use the provided CSS custom properties.\n *\n * @tagname mdc-divider\n *\n * @cssproperty --mdc-divider-background-color - background color of the divider\n * @cssproperty --mdc-divider-width - width of the divider\n * @cssproperty --mdc-divider-horizontal-gradient - gradient of the horizontal divider\n * @cssproperty --mdc-divider-vertical-gradient - gradient of the vertical divider\n * @cssproperty --mdc-divider-text-size - font size of label in the text divider\n * @cssproperty --mdc-divider-text-color - font color of label in the text divider\n * @cssproperty --mdc-divider-text-margin - left and right margin of label in the text divider\n * @cssproperty --mdc-divider-text-line-height - line height of label in the text divider\n * @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button\n */",
|
2773
|
+
"jsDoc": "/**\n * `mdc-divider` is a component that provides a line to separate and organize content.\n * It can also include a button or text positioned centrally, allowing users to interact with the layout.\n *\n * **Divider Orientation:**\n * - **Horizontal**: A thin, horizontal line.\n * - **Vertical**: A thin, vertical line.\n *\n * **Divider Variants:**\n * - **solid**: Solid line.\n * - **gradient**: Gradient Line.\n *\n * **Divider Types:**\n * - The type of divider is inferred based on the kind of slot present.\n * - **Primary**: A simple horizontal or vertical divider.\n * - **Text**: A horizontal divider with a text label in the center.\n * - **Grabber Button**: A horizontal or vertical divider with a styled button in the center.\n *\n * **Accessibility:**\n * - When the slot is replaced by an `mdc-button`:\n * - `aria-label` should be passed to the `mdc-button`.\n * - `aria-expanded` should be passed to the `mdc-button`.\n *\n * **Notes:**\n * - If the slot is replaced by an invalid tag name or contains multiple elements,\n * the divider defaults to the **Primary** type.\n * - To override the styles of the divider, use the provided CSS custom properties.\n *\n * @tagname mdc-divider\n *\n * @cssproperty --mdc-divider-background-color - background color of the divider\n * @cssproperty --mdc-divider-width - width of the divider\n * @cssproperty --mdc-divider-horizontal-gradient - gradient of the horizontal divider\n * @cssproperty --mdc-divider-vertical-gradient - gradient of the vertical divider\n * @cssproperty --mdc-divider-text-size - font size of label in the text divider\n * @cssproperty --mdc-divider-text-color - font color of label in the text divider\n * @cssproperty --mdc-divider-text-margin - left and right margin of label in the text divider\n * @cssproperty --mdc-divider-text-line-height - line height of label in the text divider\n * @cssproperty --mdc-divider-grabber-button-background-color-normal - background color of the grabber button\n * in rest state\n * @cssproperty --mdc-divider-grabber-button-background-color-hover - background color of the grabber button\n * in hover state\n * @cssproperty --mdc-divider-grabber-button-background-color-pressed - background color of the grabber button\n * in pressed state\n * @cssproperty --mdc-divider-grabber-button-border-color - border color of the grabber button\n * @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button\n */",
|
2758
2774
|
"customElement": true
|
2759
2775
|
}
|
2760
2776
|
],
|
@@ -37,6 +37,13 @@ import Component from '../../components/divider';
|
|
37
37
|
* @cssproperty --mdc-divider-text-color - font color of label in the text divider
|
38
38
|
* @cssproperty --mdc-divider-text-margin - left and right margin of label in the text divider
|
39
39
|
* @cssproperty --mdc-divider-text-line-height - line height of label in the text divider
|
40
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-normal - background color of the grabber button
|
41
|
+
* in rest state
|
42
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-hover - background color of the grabber button
|
43
|
+
* in hover state
|
44
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-pressed - background color of the grabber button
|
45
|
+
* in pressed state
|
46
|
+
* @cssproperty --mdc-divider-grabber-button-border-color - border color of the grabber button
|
40
47
|
* @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button
|
41
48
|
*/
|
42
49
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
@@ -40,6 +40,13 @@ import { TAG_NAME } from '../../components/divider/divider.constants';
|
|
40
40
|
* @cssproperty --mdc-divider-text-color - font color of label in the text divider
|
41
41
|
* @cssproperty --mdc-divider-text-margin - left and right margin of label in the text divider
|
42
42
|
* @cssproperty --mdc-divider-text-line-height - line height of label in the text divider
|
43
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-normal - background color of the grabber button
|
44
|
+
* in rest state
|
45
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-hover - background color of the grabber button
|
46
|
+
* in hover state
|
47
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-pressed - background color of the grabber button
|
48
|
+
* in pressed state
|
49
|
+
* @cssproperty --mdc-divider-grabber-button-border-color - border color of the grabber button
|
43
50
|
* @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button
|
44
51
|
*/
|
45
52
|
const reactWrapper = createComponent({
|
package/package.json
CHANGED