@momentum-design/components 0.129.22 → 0.129.24

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/index.d.ts CHANGED
@@ -104,6 +104,7 @@ import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES }
104
104
  import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
105
105
  import { inMemoryCache, webAPIAssetsCache } from './utils/assets-cache';
106
106
  import type { TablistChangeEvent } from './components/tablist/tablist.types';
107
+ import type { ToggleOnChangeEvent } from './components/toggle/toggle.types';
107
108
  export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, AnnouncementDialog, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, ControlTypeProvider, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Illustration, IllustrationProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ResponsiveSettingsProvider, ScreenreaderAnnouncer, Searchfield, Searchpopover, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticChip, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, Typewriter, ToggleTip, Tooltip, VirtualizedList, Combobox, Slider, ListBox, Banner, };
108
- export type { BadgeType, ChipColorType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, SliderChangeEvent, TextType, TypewriterType, InputInputEvent, InputChangeEvent, InputFocusEvent, InputBlurEvent, InputClearEvent, VirtualizedListScrollEvent, TablistChangeEvent, TextareaInputEvent, TextareaChangeEvent, TextareaFocusEvent, TextareaBlurEvent, TextareaLimitExceededEvent, };
109
+ export type { BadgeType, ChipColorType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, SliderChangeEvent, TextType, TypewriterType, InputInputEvent, InputChangeEvent, InputFocusEvent, InputBlurEvent, InputClearEvent, VirtualizedListScrollEvent, TablistChangeEvent, TextareaInputEvent, TextareaChangeEvent, TextareaFocusEvent, TextareaBlurEvent, TextareaLimitExceededEvent, ToggleOnChangeEvent, };
109
110
  export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIAssetsCache, };
@@ -1,27 +1,25 @@
1
1
  import Component from '../../components/statictoggle';
2
2
  /**
3
- * This is a decorative component that is styled to look as a toggle. <br/>
4
- * It has 5 properties - checked, size, disabled, readonly and soft-disabled. <br/>
5
- * We are using the same styling that has been created for the `mdc-toggle` component.
3
+ * The StaticToggle is a decorative component that visually represents a toggle switch without interactive functionality.
4
+ * It is primarily used for display purposes or as a building block within custom interactive components.
5
+ * This component shares the same visual styling as the interactive `mdc-toggle` component.
6
6
  *
7
7
  * @dependency mdc-icon
8
8
  *
9
9
  * @tagname mdc-statictoggle
10
10
  *
11
- * @slot default - This is a default/unnamed slot
11
+ * @slot - Default slot for slotted content (typically used by parent `mdc-toggle` for the checkbox input).
12
12
  *
13
- * @cssproperty --mdc-toggle-width - The width of the toggle
14
- * @cssproperty --mdc-toggle-height - The height of the toggle
15
- * @cssproperty --mdc-toggle-border-radius - The border radius of the toggle
16
- * @cssproperty --mdc-toggle-border-color - The border color of the toggle
17
- * @cssproperty --mdc-toggle-background-color - The background color of the toggle
18
- * @cssproperty --mdc-toggle-icon-color - The icon color of the toggle
19
- * @cssproperty --mdc-toggle-icon-background-color - The icon background color of the toggle
13
+ * @cssproperty --mdc-statictoggle-width - The width of the static toggle.
14
+ * @cssproperty --mdc-statictoggle-height - The height of the static toggle.
15
+ * @cssproperty --mdc-statictoggle-border-radius - The border radius of the static toggle.
16
+ * @cssproperty --mdc-statictoggle-border-color - The border color of the static toggle.
17
+ * @cssproperty --mdc-statictoggle-background-color - The background color of the static toggle.
18
+ * @cssproperty --mdc-statictoggle-icon-color - The icon color of the static toggle.
19
+ * @cssproperty --mdc-statictoggle-icon-background-color - The icon background color of the static toggle.
20
20
  *
21
- * @csspart slider - The slider part of the toggle
22
- * @csspart toggle-icon - The icon part of the toggle
23
- *
24
- * @slot - Default slot for adding label text.
21
+ * @csspart slider - The slider part of the toggle.
22
+ * @csspart toggle-icon - The icon part of the toggle.
25
23
  */
26
24
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
27
25
  export default reactWrapper;
@@ -3,28 +3,26 @@ import { createComponent } from '@lit/react';
3
3
  import Component from '../../components/statictoggle';
4
4
  import { TAG_NAME } from '../../components/statictoggle/statictoggle.constants';
5
5
  /**
6
- * This is a decorative component that is styled to look as a toggle. <br/>
7
- * It has 5 properties - checked, size, disabled, readonly and soft-disabled. <br/>
8
- * We are using the same styling that has been created for the `mdc-toggle` component.
6
+ * The StaticToggle is a decorative component that visually represents a toggle switch without interactive functionality.
7
+ * It is primarily used for display purposes or as a building block within custom interactive components.
8
+ * This component shares the same visual styling as the interactive `mdc-toggle` component.
9
9
  *
10
10
  * @dependency mdc-icon
11
11
  *
12
12
  * @tagname mdc-statictoggle
13
13
  *
14
- * @slot default - This is a default/unnamed slot
14
+ * @slot - Default slot for slotted content (typically used by parent `mdc-toggle` for the checkbox input).
15
15
  *
16
- * @cssproperty --mdc-toggle-width - The width of the toggle
17
- * @cssproperty --mdc-toggle-height - The height of the toggle
18
- * @cssproperty --mdc-toggle-border-radius - The border radius of the toggle
19
- * @cssproperty --mdc-toggle-border-color - The border color of the toggle
20
- * @cssproperty --mdc-toggle-background-color - The background color of the toggle
21
- * @cssproperty --mdc-toggle-icon-color - The icon color of the toggle
22
- * @cssproperty --mdc-toggle-icon-background-color - The icon background color of the toggle
16
+ * @cssproperty --mdc-statictoggle-width - The width of the static toggle.
17
+ * @cssproperty --mdc-statictoggle-height - The height of the static toggle.
18
+ * @cssproperty --mdc-statictoggle-border-radius - The border radius of the static toggle.
19
+ * @cssproperty --mdc-statictoggle-border-color - The border color of the static toggle.
20
+ * @cssproperty --mdc-statictoggle-background-color - The background color of the static toggle.
21
+ * @cssproperty --mdc-statictoggle-icon-color - The icon color of the static toggle.
22
+ * @cssproperty --mdc-statictoggle-icon-background-color - The icon background color of the static toggle.
23
23
  *
24
- * @csspart slider - The slider part of the toggle
25
- * @csspart toggle-icon - The icon part of the toggle
26
- *
27
- * @slot - Default slot for adding label text.
24
+ * @csspart slider - The slider part of the toggle.
25
+ * @csspart toggle-icon - The icon part of the toggle.
28
26
  */
29
27
  const reactWrapper = createComponent({
30
28
  tagName: TAG_NAME,
@@ -2,14 +2,25 @@ import { type EventName } from '@lit/react';
2
2
  import Component from '../../components/toggle';
3
3
  import type { Events } from '../../components/toggle/toggle.types';
4
4
  /**
5
- * Toggle Component is an interactive control used to switch between two mutually exclusive options,
6
- * such as On/Off, Active/Inactive. These are commonly used in settings panels, forms, and preference selections
5
+ * The Toggle component is an interactive control used to switch between two mutually exclusive states,
6
+ * such as On/Off or Active/Inactive. It is commonly used in settings panels, forms, and preference selections
7
7
  * where users need to enable or disable a feature.
8
- * It contains an optional label and an optional helper text.
9
8
  *
10
- * To create a group of toggles, use the FormFieldGroup component.
9
+ * To create a group of toggles, use the `mdc-formfieldgroup` component.
11
10
  *
12
- * Note: It internally renders a checkbox styled as a toggle switch.
11
+ * **Note:** This component internally renders a native checkbox input element styled as a toggle switch.
12
+ *
13
+ * ## When to use
14
+ * Use toggles for binary choices where the change takes effect immediately, such as enabling/disabling settings or features.
15
+ *
16
+ * ## Accessibility
17
+ * - Provide clear labels that describe what the toggle controls
18
+ * - Use `data-aria-label` when a visual label is not present
19
+ * - Keyboard navigation: Space to toggle, Tab to navigate, Enter to submit form
20
+ *
21
+ * ## Styling
22
+ * Use the `static-toggle` part to apply custom styles to the toggle switch visual element.
23
+ * This part exposes the underlying [StaticToggle](?path=/docs/components-decorator-statictoggle--docs) component for advanced styling.
13
24
  *
14
25
  * @dependency mdc-button
15
26
  * @dependency mdc-icon
@@ -22,14 +33,6 @@ import type { Events } from '../../components/toggle/toggle.types';
22
33
  * @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
23
34
  * @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
24
35
  *
25
- * @cssproperty --mdc-toggle-width - The width of the toggle
26
- * @cssproperty --mdc-toggle-height - The height of the toggle
27
- * @cssproperty --mdc-toggle-border-radius - The border radius of the toggle
28
- * @cssproperty --mdc-toggle-border-color - The border color of the toggle
29
- * @cssproperty --mdc-toggle-background-color - The background color of the toggle
30
- * @cssproperty --mdc-toggle-icon-color - The icon color of the toggle
31
- * @cssproperty --mdc-toggle-icon-background-color - The icon background color of the toggle
32
- *
33
36
  * @csspart label - The label element.
34
37
  * @csspart label-text - The container for the label and required indicator elements.
35
38
  * @csspart required-indicator - The required indicator element that is displayed next to the label when the `required` property is set to true.
@@ -38,8 +41,8 @@ import type { Events } from '../../components/toggle/toggle.types';
38
41
  * @csspart help-text - The helper/validation text element.
39
42
  * @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
40
43
  * @csspart help-text-container - The container for the helper/validation icon and text elements.
41
- * @csspart static-toggle - The static-toggle element that wraps the toggle input.
42
- * @csspart toggle-input - The native checkbox input element styled as a toggle switch.
44
+ * @csspart static-toggle - The statictoggle that provides the visual toggle switch appearance.
45
+ * @csspart toggle-input - The native checkbox input element that provides the interactive functionality.
43
46
  */
44
47
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
45
48
  onChange: EventName<Events["onChangeEvent"]>;
@@ -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 Component is an interactive control used to switch between two mutually exclusive options,
7
- * such as On/Off, Active/Inactive. These are commonly used in settings panels, forms, and preference selections
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 FormFieldGroup component.
10
+ * To create a group of toggles, use the `mdc-formfieldgroup` component.
12
11
  *
13
- * Note: It internally renders a checkbox styled as a toggle switch.
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 static-toggle element that wraps the toggle input.
43
- * @csspart toggle-input - The native checkbox input element styled as a toggle switch.
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,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.129.22",
4
+ "version": "0.129.24",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"