@momentum-design/components 0.133.3 → 0.133.5
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 +205 -215
- package/dist/browser/index.js.map +3 -3
- package/dist/components/formfieldgroup/formfieldgroup.component.d.ts +2 -3
- package/dist/components/formfieldgroup/formfieldgroup.component.js +13 -16
- package/dist/components/formfieldgroup/formfieldgroup.styles.js +1 -1
- package/dist/components/radio/radio.component.d.ts +27 -16
- package/dist/components/radio/radio.component.js +103 -120
- package/dist/components/radio/radio.styles.js +31 -17
- package/dist/components/radio/radio.types.d.ts +3 -2
- package/dist/components/radiogroup/radiogroup.component.d.ts +0 -2
- package/dist/components/radiogroup/radiogroup.component.js +10 -8
- package/dist/components/themeprovider/themeprovider.component.d.ts +0 -1
- package/dist/components/themeprovider/themeprovider.component.js +0 -1
- package/dist/components/themeprovider/themeprovider.styles.js +0 -3
- package/dist/custom-elements.json +152 -234
- package/dist/react/formfieldgroup/index.d.ts +0 -1
- package/dist/react/formfieldgroup/index.js +0 -1
- package/dist/react/radio/index.d.ts +17 -13
- package/dist/react/radio/index.js +17 -13
- package/dist/react/radiogroup/index.d.ts +0 -2
- package/dist/react/radiogroup/index.js +0 -2
- package/dist/react/themeprovider/index.d.ts +0 -1
- package/dist/react/themeprovider/index.js +0 -1
- package/dist/utils/mixins/DataAriaLabelMixin.d.ts +14 -0
- package/dist/utils/mixins/DataAriaLabelMixin.js +14 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ import { property } from 'lit/decorators.js';
|
|
|
11
11
|
import FormfieldGroup from '../formfieldgroup';
|
|
12
12
|
import { TAG_NAME as RADIO_TAGNAME } from '../radio/radio.constants';
|
|
13
13
|
import { TAG_NAME as CARD_RADIO_TAGNAME } from '../cardradio/cardradio.constants';
|
|
14
|
+
const isRadio = new RegExp(`^(${RADIO_TAGNAME}|${CARD_RADIO_TAGNAME})$`, 'i');
|
|
14
15
|
/**
|
|
15
16
|
* `mdc-radiogroup` - This is the wrapper component for radio buttons which are grouped together.
|
|
16
17
|
* It can have a header text and a description. It enables users to select a single option from a set of options.
|
|
@@ -18,8 +19,6 @@ import { TAG_NAME as CARD_RADIO_TAGNAME } from '../cardradio/cardradio.constants
|
|
|
18
19
|
*
|
|
19
20
|
* @tagname mdc-radiogroup
|
|
20
21
|
*
|
|
21
|
-
* @cssproperty --mdc-radiogroup-description-text-normal - color of the description text
|
|
22
|
-
*
|
|
23
22
|
*/
|
|
24
23
|
class RadioGroup extends FormfieldGroup {
|
|
25
24
|
constructor() {
|
|
@@ -31,7 +30,6 @@ class RadioGroup extends FormfieldGroup {
|
|
|
31
30
|
*/
|
|
32
31
|
this.name = '';
|
|
33
32
|
// This is used to set the role of the component as `radiogroup`.
|
|
34
|
-
/** @internal */
|
|
35
33
|
this.isRadio = true;
|
|
36
34
|
}
|
|
37
35
|
/**
|
|
@@ -39,11 +37,15 @@ class RadioGroup extends FormfieldGroup {
|
|
|
39
37
|
* If the name is not set, it will be set to the name of the radio group.
|
|
40
38
|
*/
|
|
41
39
|
firstUpdated() {
|
|
42
|
-
var _a
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
var _a;
|
|
41
|
+
Array.from(((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('slot')) || [])
|
|
42
|
+
.flatMap(slot => slot.assignedElements({ flatten: true }))
|
|
43
|
+
.filter(el => isRadio.test(el.tagName))
|
|
44
|
+
.forEach(radio => {
|
|
45
|
+
if (!radio.hasAttribute('name')) {
|
|
46
|
+
radio.setAttribute('name', this.name);
|
|
47
|
+
}
|
|
48
|
+
radio.toggleAttribute('required', this.required);
|
|
47
49
|
});
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -36,7 +36,6 @@ import ThemeProviderContext from './themeprovider.context';
|
|
|
36
36
|
* @cssproperty --mdc-themeprovider-font-family - Option to override the font family,
|
|
37
37
|
* default: `Momentum` (from momentum-design/fonts)
|
|
38
38
|
* @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`
|
|
39
|
-
* @cssproperty --mdc-themeprovider-letter-spacing-adjustment - Option to override the default letter-spacing,
|
|
40
39
|
* default: `-0.25px` (this is to match the old CiscoSans)
|
|
41
40
|
* @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,
|
|
42
41
|
* default: `"ss02" on`
|
|
@@ -47,7 +47,6 @@ import styles from './themeprovider.styles';
|
|
|
47
47
|
* @cssproperty --mdc-themeprovider-font-family - Option to override the font family,
|
|
48
48
|
* default: `Momentum` (from momentum-design/fonts)
|
|
49
49
|
* @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`
|
|
50
|
-
* @cssproperty --mdc-themeprovider-letter-spacing-adjustment - Option to override the default letter-spacing,
|
|
51
50
|
* default: `-0.25px` (this is to match the old CiscoSans)
|
|
52
51
|
* @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,
|
|
53
52
|
* default: `"ss02" on`
|
|
@@ -4,8 +4,6 @@ const styles = css `
|
|
|
4
4
|
--mdc-themeprovider-color-default: var(--mds-color-theme-text-primary-normal);
|
|
5
5
|
--mdc-themeprovider-font-family: var(--mds-font-family-primary);
|
|
6
6
|
--mdc-themeprovider-font-weight: 400;
|
|
7
|
-
/* adjusting Inter's letter spacing to better match the old CiscoSans */
|
|
8
|
-
--mdc-themeprovider-letter-spacing-adjustment: -0.25px;
|
|
9
7
|
/* Adjusting font feature settings for accessibility reasons */
|
|
10
8
|
--mdc-themeprovider-font-feature-settings: 'ss02' on;
|
|
11
9
|
|
|
@@ -16,7 +14,6 @@ const styles = css `
|
|
|
16
14
|
color: var(--mdc-themeprovider-color-default);
|
|
17
15
|
font-family: var(--mdc-themeprovider-font-family);
|
|
18
16
|
font-weight: var(--mdc-themeprovider-font-weight);
|
|
19
|
-
letter-spacing: var(--mdc-themeprovider-letter-spacing-adjustment);
|
|
20
17
|
|
|
21
18
|
font-feature-settings: var(--mdc-themeprovider-font-feature-settings);
|
|
22
19
|
}
|