@momentum-design/components 0.129.21 → 0.129.23
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 +49 -46
- package/dist/browser/index.js.map +2 -2
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +1 -1
- package/dist/components/card/card.component.d.ts +13 -23
- package/dist/components/card/card.component.js +13 -23
- package/dist/components/cardbutton/cardbutton.component.d.ts +13 -9
- package/dist/components/cardbutton/cardbutton.component.js +13 -9
- package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +21 -15
- package/dist/components/cardcheckbox/cardcheckbox.component.js +21 -15
- package/dist/components/cardradio/cardradio.component.d.ts +21 -15
- package/dist/components/cardradio/cardradio.component.js +21 -15
- package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +5 -3
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +4 -2
- package/dist/components/statictoggle/statictoggle.component.d.ts +24 -23
- package/dist/components/statictoggle/statictoggle.component.js +24 -23
- package/dist/components/statictoggle/statictoggle.styles.js +37 -37
- package/dist/components/toggle/toggle.component.d.ts +30 -19
- package/dist/components/toggle/toggle.component.js +30 -19
- package/dist/components/toggle/toggle.styles.js +12 -9
- package/dist/custom-elements.json +272 -356
- package/dist/react/card/index.d.ts +13 -23
- package/dist/react/card/index.js +13 -23
- package/dist/react/cardbutton/index.d.ts +13 -9
- package/dist/react/cardbutton/index.js +13 -9
- package/dist/react/cardcheckbox/index.d.ts +18 -14
- package/dist/react/cardcheckbox/index.js +18 -14
- package/dist/react/cardradio/index.d.ts +19 -14
- package/dist/react/cardradio/index.js +19 -14
- package/dist/react/statictoggle/index.d.ts +13 -15
- package/dist/react/statictoggle/index.js +13 -15
- package/dist/react/toggle/index.d.ts +18 -15
- package/dist/react/toggle/index.js +18 -15
- package/dist/utils/mixins/CardComponentMixin.js +7 -2
- package/package.json +1 -1
|
@@ -3,14 +3,25 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/toggle';
|
|
4
4
|
import { TAG_NAME } from '../../components/toggle/toggle.constants';
|
|
5
5
|
/**
|
|
6
|
-
* Toggle
|
|
7
|
-
* such as On/Off
|
|
6
|
+
* The Toggle component is an interactive control used to switch between two mutually exclusive states,
|
|
7
|
+
* such as On/Off or Active/Inactive. It is commonly used in settings panels, forms, and preference selections
|
|
8
8
|
* where users need to enable or disable a feature.
|
|
9
|
-
* It contains an optional label and an optional helper text.
|
|
10
9
|
*
|
|
11
|
-
* To create a group of toggles, use the
|
|
10
|
+
* To create a group of toggles, use the `mdc-formfieldgroup` component.
|
|
12
11
|
*
|
|
13
|
-
* Note
|
|
12
|
+
* **Note:** This component internally renders a native checkbox input element styled as a toggle switch.
|
|
13
|
+
*
|
|
14
|
+
* ## When to use
|
|
15
|
+
* Use toggles for binary choices where the change takes effect immediately, such as enabling/disabling settings or features.
|
|
16
|
+
*
|
|
17
|
+
* ## Accessibility
|
|
18
|
+
* - Provide clear labels that describe what the toggle controls
|
|
19
|
+
* - Use `data-aria-label` when a visual label is not present
|
|
20
|
+
* - Keyboard navigation: Space to toggle, Tab to navigate, Enter to submit form
|
|
21
|
+
*
|
|
22
|
+
* ## Styling
|
|
23
|
+
* Use the `static-toggle` part to apply custom styles to the toggle switch visual element.
|
|
24
|
+
* This part exposes the underlying [StaticToggle](?path=/docs/components-decorator-statictoggle--docs) component for advanced styling.
|
|
14
25
|
*
|
|
15
26
|
* @dependency mdc-button
|
|
16
27
|
* @dependency mdc-icon
|
|
@@ -23,14 +34,6 @@ import { TAG_NAME } from '../../components/toggle/toggle.constants';
|
|
|
23
34
|
* @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
|
|
24
35
|
* @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
|
|
25
36
|
*
|
|
26
|
-
* @cssproperty --mdc-toggle-width - The width of the toggle
|
|
27
|
-
* @cssproperty --mdc-toggle-height - The height of the toggle
|
|
28
|
-
* @cssproperty --mdc-toggle-border-radius - The border radius of the toggle
|
|
29
|
-
* @cssproperty --mdc-toggle-border-color - The border color of the toggle
|
|
30
|
-
* @cssproperty --mdc-toggle-background-color - The background color of the toggle
|
|
31
|
-
* @cssproperty --mdc-toggle-icon-color - The icon color of the toggle
|
|
32
|
-
* @cssproperty --mdc-toggle-icon-background-color - The icon background color of the toggle
|
|
33
|
-
*
|
|
34
37
|
* @csspart label - The label element.
|
|
35
38
|
* @csspart label-text - The container for the label and required indicator elements.
|
|
36
39
|
* @csspart required-indicator - The required indicator element that is displayed next to the label when the `required` property is set to true.
|
|
@@ -39,8 +42,8 @@ import { TAG_NAME } from '../../components/toggle/toggle.constants';
|
|
|
39
42
|
* @csspart help-text - The helper/validation text element.
|
|
40
43
|
* @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
|
|
41
44
|
* @csspart help-text-container - The container for the helper/validation icon and text elements.
|
|
42
|
-
* @csspart static-toggle - The
|
|
43
|
-
* @csspart toggle-input - The native checkbox input element
|
|
45
|
+
* @csspart static-toggle - The statictoggle that provides the visual toggle switch appearance.
|
|
46
|
+
* @csspart toggle-input - The native checkbox input element that provides the interactive functionality.
|
|
44
47
|
*/
|
|
45
48
|
const reactWrapper = createComponent({
|
|
46
49
|
tagName: TAG_NAME,
|
|
@@ -36,12 +36,17 @@ export const CardComponentMixin = (superClass) => {
|
|
|
36
36
|
*/
|
|
37
37
|
this.imageAlt = '';
|
|
38
38
|
/**
|
|
39
|
-
* The variant of the card
|
|
39
|
+
* The variant of the card that represents the border styling.
|
|
40
|
+
* - `border`: Card with border (default)
|
|
41
|
+
* - `ghost`: Card without border
|
|
42
|
+
* - `promotional`: Card with promotional styling
|
|
40
43
|
* @default 'border'
|
|
41
44
|
*/
|
|
42
45
|
this.variant = DEFAULTS.VARIANT;
|
|
43
46
|
/**
|
|
44
|
-
* The orientation of the card.
|
|
47
|
+
* The orientation of the card.
|
|
48
|
+
* - `vertical`: Card in vertical layout with min-width of 20rem (default)
|
|
49
|
+
* - `horizontal`: Card in horizontal layout with min-width of 40rem
|
|
45
50
|
* @default 'vertical'
|
|
46
51
|
*/
|
|
47
52
|
this.orientation = DEFAULTS.ORIENTATION;
|