@momentum-design/components 0.98.1 → 0.99.0
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 +410 -271
- package/dist/browser/index.js.map +4 -4
- package/dist/components/card/card.styles.js +2 -2
- package/dist/components/toast/index.d.ts +11 -0
- package/dist/components/toast/index.js +8 -0
- package/dist/components/toast/toast.component.d.ts +101 -0
- package/dist/components/toast/toast.component.js +242 -0
- package/dist/components/toast/toast.constants.d.ts +26 -0
- package/dist/components/toast/toast.constants.js +28 -0
- package/dist/components/toast/toast.styles.d.ts +2 -0
- package/dist/components/toast/toast.styles.js +88 -0
- package/dist/components/toast/toast.types.d.ts +7 -0
- package/dist/components/toast/toast.types.js +1 -0
- package/dist/components/toast/toast.utils.d.ts +3 -0
- package/dist/components/toast/toast.utils.js +14 -0
- package/dist/custom-elements.json +386 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/react/toast/index.d.ts +45 -0
- package/dist/react/toast/index.js +53 -0
- package/package.json +1 -1
@@ -34780,6 +34780,392 @@
|
|
34780
34780
|
}
|
34781
34781
|
]
|
34782
34782
|
},
|
34783
|
+
{
|
34784
|
+
"kind": "javascript-module",
|
34785
|
+
"path": "components/toast/toast.component.js",
|
34786
|
+
"declarations": [
|
34787
|
+
{
|
34788
|
+
"kind": "class",
|
34789
|
+
"description": "`mdc-toast` is a lightweight, non-blocking alert used to inform users about application processes.\nIt supports success, warning, error, and custom messages, and is designed to be controlled externally.\n\n**Note**: When using `slot=\"toast-body-normal\"` and `slot=\"toast-body-detailed\"`, it's strongly recommended to wrap the content with `<mdc-text tagname=\"span\">`.\nIf not used, ensure your custom content is styled appropriately to match the design and alignment expectations of the toast component.",
|
34790
|
+
"name": "Toast",
|
34791
|
+
"cssProperties": [
|
34792
|
+
{
|
34793
|
+
"description": "Background color of the toast.",
|
34794
|
+
"name": "--mdc-toast-background-color"
|
34795
|
+
},
|
34796
|
+
{
|
34797
|
+
"description": "Border color of the toast.",
|
34798
|
+
"name": "--mdc-toast-border-color"
|
34799
|
+
},
|
34800
|
+
{
|
34801
|
+
"description": "Color of the header text in the toast.",
|
34802
|
+
"name": "--mdc-toast-header-text-color"
|
34803
|
+
},
|
34804
|
+
{
|
34805
|
+
"description": "Color of the icon in the toast.",
|
34806
|
+
"name": "--mdc-toast-icon-color"
|
34807
|
+
},
|
34808
|
+
{
|
34809
|
+
"description": "Elevation effect applied to the toast.",
|
34810
|
+
"name": "--mdc-toast-elevation-3"
|
34811
|
+
},
|
34812
|
+
{
|
34813
|
+
"description": "Width of the toast.",
|
34814
|
+
"name": "--mdc-toast-width"
|
34815
|
+
},
|
34816
|
+
{
|
34817
|
+
"description": "Padding inside the toast.",
|
34818
|
+
"name": "--mdc-toast-padding"
|
34819
|
+
}
|
34820
|
+
],
|
34821
|
+
"cssParts": [
|
34822
|
+
{
|
34823
|
+
"description": "The container for the toast's main content, including icon, text, and close button.",
|
34824
|
+
"name": "content-container"
|
34825
|
+
},
|
34826
|
+
{
|
34827
|
+
"description": "The icon shown at the start of the toast, styled by variant.",
|
34828
|
+
"name": "toast-prefix-icon"
|
34829
|
+
},
|
34830
|
+
{
|
34831
|
+
"description": "The container for the header and body content of the toast.",
|
34832
|
+
"name": "toast-content"
|
34833
|
+
},
|
34834
|
+
{
|
34835
|
+
"description": "The header text of the toast.",
|
34836
|
+
"name": "toast-header"
|
34837
|
+
},
|
34838
|
+
{
|
34839
|
+
"description": "The container for the toast's footer, including toggle and action buttons.",
|
34840
|
+
"name": "footer"
|
34841
|
+
},
|
34842
|
+
{
|
34843
|
+
"description": "The toggle button for showing/hiding detailed content.",
|
34844
|
+
"name": "footer-button-toggle"
|
34845
|
+
},
|
34846
|
+
{
|
34847
|
+
"description": "The close button for the toast.",
|
34848
|
+
"name": "toast-close-btn"
|
34849
|
+
}
|
34850
|
+
],
|
34851
|
+
"slots": [
|
34852
|
+
{
|
34853
|
+
"description": "Slot for custom content before the icon (only for custom variant).",
|
34854
|
+
"name": "content-prefix"
|
34855
|
+
},
|
34856
|
+
{
|
34857
|
+
"description": "Slot for the main body content of the toast.",
|
34858
|
+
"name": "toast-body-normal"
|
34859
|
+
},
|
34860
|
+
{
|
34861
|
+
"description": "Slot for additional detailed content, shown when expanded.",
|
34862
|
+
"name": "toast-body-detailed"
|
34863
|
+
},
|
34864
|
+
{
|
34865
|
+
"description": "Slot for custom footer content. Prefer using footer-button-primary and footer-button-secondary slots.",
|
34866
|
+
"name": "footer"
|
34867
|
+
},
|
34868
|
+
{
|
34869
|
+
"description": "Slot for passing the primary variant of `mdc-button` in the footer.",
|
34870
|
+
"name": "footer-button-primary"
|
34871
|
+
},
|
34872
|
+
{
|
34873
|
+
"description": "Slot for passing the secondary variant of `mdc-button` in the footer.",
|
34874
|
+
"name": "footer-button-secondary"
|
34875
|
+
}
|
34876
|
+
],
|
34877
|
+
"members": [
|
34878
|
+
{
|
34879
|
+
"kind": "field",
|
34880
|
+
"name": "variant",
|
34881
|
+
"type": {
|
34882
|
+
"text": "ToastVariant"
|
34883
|
+
},
|
34884
|
+
"description": "Type of toast\n- Can be `custom`, `success`, `warning` or `error`.",
|
34885
|
+
"default": "'custom'",
|
34886
|
+
"attribute": "variant",
|
34887
|
+
"reflects": true
|
34888
|
+
},
|
34889
|
+
{
|
34890
|
+
"kind": "field",
|
34891
|
+
"name": "closeButtonAriaLabel",
|
34892
|
+
"type": {
|
34893
|
+
"text": "string | undefined"
|
34894
|
+
},
|
34895
|
+
"description": "Defines aria-label attribute for close button accessibility",
|
34896
|
+
"attribute": "close-button-aria-label"
|
34897
|
+
},
|
34898
|
+
{
|
34899
|
+
"kind": "field",
|
34900
|
+
"name": "headerText",
|
34901
|
+
"type": {
|
34902
|
+
"text": "string | undefined"
|
34903
|
+
},
|
34904
|
+
"description": "Defines a string value to display as the title of the toast",
|
34905
|
+
"attribute": "header-text",
|
34906
|
+
"reflects": true
|
34907
|
+
},
|
34908
|
+
{
|
34909
|
+
"kind": "field",
|
34910
|
+
"name": "headerTagName",
|
34911
|
+
"type": {
|
34912
|
+
"text": "TagName"
|
34913
|
+
},
|
34914
|
+
"description": "The html tag to be used for the header text",
|
34915
|
+
"default": "'h2'",
|
34916
|
+
"attribute": "header-tag-name",
|
34917
|
+
"reflects": true
|
34918
|
+
},
|
34919
|
+
{
|
34920
|
+
"kind": "field",
|
34921
|
+
"name": "ariaLabel",
|
34922
|
+
"type": {
|
34923
|
+
"text": "string | null"
|
34924
|
+
},
|
34925
|
+
"default": "null",
|
34926
|
+
"description": "Defines aria-label attribute when header is not used",
|
34927
|
+
"attribute": "aria-label",
|
34928
|
+
"reflects": true
|
34929
|
+
},
|
34930
|
+
{
|
34931
|
+
"kind": "field",
|
34932
|
+
"name": "showMoreText",
|
34933
|
+
"type": {
|
34934
|
+
"text": "string | undefined"
|
34935
|
+
},
|
34936
|
+
"description": "Defines the text shown on the linkbutton when detailed content is hidden.",
|
34937
|
+
"attribute": "show-more-text",
|
34938
|
+
"reflects": true
|
34939
|
+
},
|
34940
|
+
{
|
34941
|
+
"kind": "field",
|
34942
|
+
"name": "showLessText",
|
34943
|
+
"type": {
|
34944
|
+
"text": "string | undefined"
|
34945
|
+
},
|
34946
|
+
"description": "Defines the text shown on the linkbutton when detailed content is visible.",
|
34947
|
+
"attribute": "show-less-text",
|
34948
|
+
"reflects": true
|
34949
|
+
},
|
34950
|
+
{
|
34951
|
+
"kind": "field",
|
34952
|
+
"name": "isDetailVisible",
|
34953
|
+
"type": {
|
34954
|
+
"text": "boolean"
|
34955
|
+
},
|
34956
|
+
"privacy": "private",
|
34957
|
+
"default": "false"
|
34958
|
+
},
|
34959
|
+
{
|
34960
|
+
"kind": "field",
|
34961
|
+
"name": "hasDetailedSlot",
|
34962
|
+
"type": {
|
34963
|
+
"text": "boolean"
|
34964
|
+
},
|
34965
|
+
"privacy": "private",
|
34966
|
+
"default": "false"
|
34967
|
+
},
|
34968
|
+
{
|
34969
|
+
"kind": "field",
|
34970
|
+
"name": "detailedElements",
|
34971
|
+
"type": {
|
34972
|
+
"text": "HTMLElement[]"
|
34973
|
+
},
|
34974
|
+
"privacy": "private"
|
34975
|
+
},
|
34976
|
+
{
|
34977
|
+
"kind": "field",
|
34978
|
+
"name": "hasFooterButtons",
|
34979
|
+
"type": {
|
34980
|
+
"text": "string"
|
34981
|
+
},
|
34982
|
+
"privacy": "private",
|
34983
|
+
"default": "''"
|
34984
|
+
},
|
34985
|
+
{
|
34986
|
+
"kind": "method",
|
34987
|
+
"name": "closeToast",
|
34988
|
+
"privacy": "private",
|
34989
|
+
"description": "Fired when Close Button is clicked using mouse or keyboard.\nThis method dispatches the close event.\nIt is used to notify that the toast should be closed."
|
34990
|
+
},
|
34991
|
+
{
|
34992
|
+
"kind": "method",
|
34993
|
+
"name": "toggleDetailVisibility",
|
34994
|
+
"privacy": "private"
|
34995
|
+
},
|
34996
|
+
{
|
34997
|
+
"kind": "method",
|
34998
|
+
"name": "updateDetailedSlotPresence",
|
34999
|
+
"privacy": "private"
|
35000
|
+
},
|
35001
|
+
{
|
35002
|
+
"kind": "method",
|
35003
|
+
"name": "updateFooterButtonsPresence",
|
35004
|
+
"privacy": "private"
|
35005
|
+
},
|
35006
|
+
{
|
35007
|
+
"kind": "method",
|
35008
|
+
"name": "renderIcon",
|
35009
|
+
"privacy": "protected",
|
35010
|
+
"parameters": [
|
35011
|
+
{
|
35012
|
+
"name": "iconName",
|
35013
|
+
"type": {
|
35014
|
+
"text": "string"
|
35015
|
+
}
|
35016
|
+
}
|
35017
|
+
]
|
35018
|
+
},
|
35019
|
+
{
|
35020
|
+
"kind": "method",
|
35021
|
+
"name": "shouldRenderToggleButton",
|
35022
|
+
"privacy": "private"
|
35023
|
+
},
|
35024
|
+
{
|
35025
|
+
"kind": "method",
|
35026
|
+
"name": "renderToggleDetailButton",
|
35027
|
+
"privacy": "private"
|
35028
|
+
},
|
35029
|
+
{
|
35030
|
+
"kind": "method",
|
35031
|
+
"name": "renderHeader",
|
35032
|
+
"privacy": "protected"
|
35033
|
+
},
|
35034
|
+
{
|
35035
|
+
"kind": "method",
|
35036
|
+
"name": "handleFooterSlot",
|
35037
|
+
"privacy": "protected",
|
35038
|
+
"return": {
|
35039
|
+
"type": {
|
35040
|
+
"text": "void"
|
35041
|
+
}
|
35042
|
+
},
|
35043
|
+
"parameters": [
|
35044
|
+
{
|
35045
|
+
"name": "tagname",
|
35046
|
+
"type": {
|
35047
|
+
"text": "string"
|
35048
|
+
}
|
35049
|
+
},
|
35050
|
+
{
|
35051
|
+
"name": "variant",
|
35052
|
+
"optional": true,
|
35053
|
+
"type": {
|
35054
|
+
"text": "string | undefined"
|
35055
|
+
}
|
35056
|
+
}
|
35057
|
+
]
|
35058
|
+
},
|
35059
|
+
{
|
35060
|
+
"kind": "method",
|
35061
|
+
"name": "renderFooter",
|
35062
|
+
"privacy": "protected",
|
35063
|
+
"description": "Renders the footer of the card if footer-link,\nfooter-button-primary, or footer-button-secondary slots are provided",
|
35064
|
+
"return": {
|
35065
|
+
"type": {
|
35066
|
+
"text": ""
|
35067
|
+
}
|
35068
|
+
},
|
35069
|
+
"inheritedFrom": {
|
35070
|
+
"name": "FooterMixin",
|
35071
|
+
"module": "utils/mixins/FooterMixin.js"
|
35072
|
+
}
|
35073
|
+
}
|
35074
|
+
],
|
35075
|
+
"events": [
|
35076
|
+
{
|
35077
|
+
"description": "(React: onClose) Dispatched when the Close Button is clicked using mouse or keyboard.",
|
35078
|
+
"name": "close",
|
35079
|
+
"reactName": "onClose"
|
35080
|
+
}
|
35081
|
+
],
|
35082
|
+
"attributes": [
|
35083
|
+
{
|
35084
|
+
"name": "variant",
|
35085
|
+
"type": {
|
35086
|
+
"text": "ToastVariant"
|
35087
|
+
},
|
35088
|
+
"description": "Type of toast\n- Can be `custom`, `success`, `warning` or `error`.",
|
35089
|
+
"default": "'custom'",
|
35090
|
+
"fieldName": "variant"
|
35091
|
+
},
|
35092
|
+
{
|
35093
|
+
"name": "close-button-aria-label",
|
35094
|
+
"type": {
|
35095
|
+
"text": "string | undefined"
|
35096
|
+
},
|
35097
|
+
"description": "Defines aria-label attribute for close button accessibility",
|
35098
|
+
"fieldName": "closeButtonAriaLabel"
|
35099
|
+
},
|
35100
|
+
{
|
35101
|
+
"name": "header-text",
|
35102
|
+
"type": {
|
35103
|
+
"text": "string | undefined"
|
35104
|
+
},
|
35105
|
+
"description": "Defines a string value to display as the title of the toast",
|
35106
|
+
"fieldName": "headerText"
|
35107
|
+
},
|
35108
|
+
{
|
35109
|
+
"name": "header-tag-name",
|
35110
|
+
"type": {
|
35111
|
+
"text": "TagName"
|
35112
|
+
},
|
35113
|
+
"description": "The html tag to be used for the header text",
|
35114
|
+
"default": "'h2'",
|
35115
|
+
"fieldName": "headerTagName"
|
35116
|
+
},
|
35117
|
+
{
|
35118
|
+
"name": "aria-label",
|
35119
|
+
"type": {
|
35120
|
+
"text": "string | null"
|
35121
|
+
},
|
35122
|
+
"default": "null",
|
35123
|
+
"description": "Defines aria-label attribute when header is not used",
|
35124
|
+
"fieldName": "ariaLabel"
|
35125
|
+
},
|
35126
|
+
{
|
35127
|
+
"name": "show-more-text",
|
35128
|
+
"type": {
|
35129
|
+
"text": "string | undefined"
|
35130
|
+
},
|
35131
|
+
"description": "Defines the text shown on the linkbutton when detailed content is hidden.",
|
35132
|
+
"fieldName": "showMoreText"
|
35133
|
+
},
|
35134
|
+
{
|
35135
|
+
"name": "show-less-text",
|
35136
|
+
"type": {
|
35137
|
+
"text": "string | undefined"
|
35138
|
+
},
|
35139
|
+
"description": "Defines the text shown on the linkbutton when detailed content is visible.",
|
35140
|
+
"fieldName": "showLessText"
|
35141
|
+
}
|
35142
|
+
],
|
35143
|
+
"mixins": [
|
35144
|
+
{
|
35145
|
+
"name": "FooterMixin",
|
35146
|
+
"module": "/src/utils/mixins/FooterMixin"
|
35147
|
+
}
|
35148
|
+
],
|
35149
|
+
"superclass": {
|
35150
|
+
"name": "Component",
|
35151
|
+
"module": "/src/models"
|
35152
|
+
},
|
35153
|
+
"tagName": "mdc-toast",
|
35154
|
+
"jsDoc": "/**\n * `mdc-toast` is a lightweight, non-blocking alert used to inform users about application processes.\n * It supports success, warning, error, and custom messages, and is designed to be controlled externally.\n * \n * **Note**: When using `slot=\"toast-body-normal\"` and `slot=\"toast-body-detailed\"`, it's strongly recommended to wrap the content with `<mdc-text tagname=\"span\">`.\n * If not used, ensure your custom content is styled appropriately to match the design and alignment expectations of the toast component.\n * \n * @dependency mdc-icon\n * @dependency mdc-text\n * @dependency mdc-button\n * @dependency mdc-linkbutton\n *\n * @slot content-prefix - Slot for custom content before the icon (only for custom variant).\n * @slot toast-body-normal - Slot for the main body content of the toast.\n * @slot toast-body-detailed - Slot for additional detailed content, shown when expanded.\n * @slot footer - Slot for custom footer content. Prefer using footer-button-primary and footer-button-secondary slots.\n * @slot footer-button-primary - Slot for passing the primary variant of `mdc-button` in the footer.\n * @slot footer-button-secondary - Slot for passing the secondary variant of `mdc-button` in the footer.\n *\n * @tagname mdc-toast\n * \n * @event close - (React: onClose) Dispatched when the Close Button is clicked using mouse or keyboard.\n *\n * @csspart content-container - The container for the toast's main content, including icon, text, and close button.\n * @csspart toast-prefix-icon - The icon shown at the start of the toast, styled by variant.\n * @csspart toast-content - The container for the header and body content of the toast.\n * @csspart toast-header - The header text of the toast.\n * @csspart footer - The container for the toast's footer, including toggle and action buttons.\n * @csspart footer-button-toggle - The toggle button for showing/hiding detailed content.\n * @csspart toast-close-btn - The close button for the toast.\n *\n * @cssproperty --mdc-toast-background-color - Background color of the toast.\n * @cssproperty --mdc-toast-border-color - Border color of the toast.\n * @cssproperty --mdc-toast-header-text-color - Color of the header text in the toast.\n * @cssproperty --mdc-toast-icon-color - Color of the icon in the toast.\n * @cssproperty --mdc-toast-elevation-3 - Elevation effect applied to the toast.\n * @cssproperty --mdc-toast-width - Width of the toast.\n * @cssproperty --mdc-toast-padding - Padding inside the toast.\n */",
|
35155
|
+
"customElement": true
|
35156
|
+
}
|
35157
|
+
],
|
35158
|
+
"exports": [
|
35159
|
+
{
|
35160
|
+
"kind": "js",
|
35161
|
+
"name": "default",
|
35162
|
+
"declaration": {
|
35163
|
+
"name": "Toast",
|
35164
|
+
"module": "components/toast/toast.component.js"
|
35165
|
+
}
|
35166
|
+
}
|
35167
|
+
]
|
35168
|
+
},
|
34783
35169
|
{
|
34784
35170
|
"kind": "javascript-module",
|
34785
35171
|
"path": "components/toggle/toggle.component.js",
|
package/dist/index.d.ts
CHANGED
@@ -55,6 +55,7 @@ import Spinner from './components/spinner';
|
|
55
55
|
import StaticCheckbox from './components/staticcheckbox';
|
56
56
|
import StaticRadio from './components/staticradio';
|
57
57
|
import StaticToggle from './components/statictoggle';
|
58
|
+
import Toast from './components/toast';
|
58
59
|
import Tab from './components/tab';
|
59
60
|
import TabList from './components/tablist';
|
60
61
|
import Text from './components/text';
|
@@ -81,6 +82,6 @@ import type { MenuSectionChangeEvent } from './components/menusection/menusectio
|
|
81
82
|
import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from './components/button/button.constants';
|
82
83
|
import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
|
83
84
|
import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
|
84
|
-
export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toggle, ToggleTip, Tooltip, VirtualizedList, Listheader, SelectListbox, StepperConnector, Stepper, };
|
85
|
+
export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList, Listheader, SelectListbox, StepperConnector, Stepper, };
|
85
86
|
export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, TextType, };
|
86
87
|
export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIIconsCache, };
|
package/dist/index.js
CHANGED
@@ -57,6 +57,7 @@ import Spinner from './components/spinner';
|
|
57
57
|
import StaticCheckbox from './components/staticcheckbox';
|
58
58
|
import StaticRadio from './components/staticradio';
|
59
59
|
import StaticToggle from './components/statictoggle';
|
60
|
+
import Toast from './components/toast';
|
60
61
|
import Tab from './components/tab';
|
61
62
|
import TabList from './components/tablist';
|
62
63
|
import Text from './components/text';
|
@@ -76,6 +77,6 @@ import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, }
|
|
76
77
|
import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
|
77
78
|
import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
|
78
79
|
// Components Exports
|
79
|
-
export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toggle, ToggleTip, Tooltip, VirtualizedList, Listheader, SelectListbox, StepperConnector, Stepper, };
|
80
|
+
export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList, Listheader, SelectListbox, StepperConnector, Stepper, };
|
80
81
|
// Constants / Utils Exports
|
81
82
|
export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIIconsCache, };
|
package/dist/react/index.d.ts
CHANGED
@@ -67,6 +67,7 @@ export { default as TabList } from './tablist';
|
|
67
67
|
export { default as Text } from './text';
|
68
68
|
export { default as Textarea } from './textarea';
|
69
69
|
export { default as ThemeProvider } from './themeprovider';
|
70
|
+
export { default as Toast } from './toast';
|
70
71
|
export { default as Toggle } from './toggle';
|
71
72
|
export { default as ToggleTip } from './toggletip';
|
72
73
|
export { default as Tooltip } from './tooltip';
|
package/dist/react/index.js
CHANGED
@@ -67,6 +67,7 @@ export { default as TabList } from './tablist';
|
|
67
67
|
export { default as Text } from './text';
|
68
68
|
export { default as Textarea } from './textarea';
|
69
69
|
export { default as ThemeProvider } from './themeprovider';
|
70
|
+
export { default as Toast } from './toast';
|
70
71
|
export { default as Toggle } from './toggle';
|
71
72
|
export { default as ToggleTip } from './toggletip';
|
72
73
|
export { default as Tooltip } from './tooltip';
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { type EventName } from '@lit/react';
|
2
|
+
import Component from '../../components/toast';
|
3
|
+
/**
|
4
|
+
* `mdc-toast` is a lightweight, non-blocking alert used to inform users about application processes.
|
5
|
+
* It supports success, warning, error, and custom messages, and is designed to be controlled externally.
|
6
|
+
*
|
7
|
+
* **Note**: When using `slot="toast-body-normal"` and `slot="toast-body-detailed"`, it's strongly recommended to wrap the content with `<mdc-text tagname="span">`.
|
8
|
+
* If not used, ensure your custom content is styled appropriately to match the design and alignment expectations of the toast component.
|
9
|
+
*
|
10
|
+
* @dependency mdc-icon
|
11
|
+
* @dependency mdc-text
|
12
|
+
* @dependency mdc-button
|
13
|
+
* @dependency mdc-linkbutton
|
14
|
+
*
|
15
|
+
* @slot content-prefix - Slot for custom content before the icon (only for custom variant).
|
16
|
+
* @slot toast-body-normal - Slot for the main body content of the toast.
|
17
|
+
* @slot toast-body-detailed - Slot for additional detailed content, shown when expanded.
|
18
|
+
* @slot footer - Slot for custom footer content. Prefer using footer-button-primary and footer-button-secondary slots.
|
19
|
+
* @slot footer-button-primary - Slot for passing the primary variant of `mdc-button` in the footer.
|
20
|
+
* @slot footer-button-secondary - Slot for passing the secondary variant of `mdc-button` in the footer.
|
21
|
+
*
|
22
|
+
* @tagname mdc-toast
|
23
|
+
*
|
24
|
+
* @event close - (React: onClose) Dispatched when the Close Button is clicked using mouse or keyboard.
|
25
|
+
*
|
26
|
+
* @csspart content-container - The container for the toast's main content, including icon, text, and close button.
|
27
|
+
* @csspart toast-prefix-icon - The icon shown at the start of the toast, styled by variant.
|
28
|
+
* @csspart toast-content - The container for the header and body content of the toast.
|
29
|
+
* @csspart toast-header - The header text of the toast.
|
30
|
+
* @csspart footer - The container for the toast's footer, including toggle and action buttons.
|
31
|
+
* @csspart footer-button-toggle - The toggle button for showing/hiding detailed content.
|
32
|
+
* @csspart toast-close-btn - The close button for the toast.
|
33
|
+
*
|
34
|
+
* @cssproperty --mdc-toast-background-color - Background color of the toast.
|
35
|
+
* @cssproperty --mdc-toast-border-color - Border color of the toast.
|
36
|
+
* @cssproperty --mdc-toast-header-text-color - Color of the header text in the toast.
|
37
|
+
* @cssproperty --mdc-toast-icon-color - Color of the icon in the toast.
|
38
|
+
* @cssproperty --mdc-toast-elevation-3 - Elevation effect applied to the toast.
|
39
|
+
* @cssproperty --mdc-toast-width - Width of the toast.
|
40
|
+
* @cssproperty --mdc-toast-padding - Padding inside the toast.
|
41
|
+
*/
|
42
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
43
|
+
onClose: EventName<Event>;
|
44
|
+
}>;
|
45
|
+
export default reactWrapper;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { createComponent } from '@lit/react';
|
3
|
+
import Component from '../../components/toast';
|
4
|
+
import { TAG_NAME } from '../../components/toast/toast.constants';
|
5
|
+
/**
|
6
|
+
* `mdc-toast` is a lightweight, non-blocking alert used to inform users about application processes.
|
7
|
+
* It supports success, warning, error, and custom messages, and is designed to be controlled externally.
|
8
|
+
*
|
9
|
+
* **Note**: When using `slot="toast-body-normal"` and `slot="toast-body-detailed"`, it's strongly recommended to wrap the content with `<mdc-text tagname="span">`.
|
10
|
+
* If not used, ensure your custom content is styled appropriately to match the design and alignment expectations of the toast component.
|
11
|
+
*
|
12
|
+
* @dependency mdc-icon
|
13
|
+
* @dependency mdc-text
|
14
|
+
* @dependency mdc-button
|
15
|
+
* @dependency mdc-linkbutton
|
16
|
+
*
|
17
|
+
* @slot content-prefix - Slot for custom content before the icon (only for custom variant).
|
18
|
+
* @slot toast-body-normal - Slot for the main body content of the toast.
|
19
|
+
* @slot toast-body-detailed - Slot for additional detailed content, shown when expanded.
|
20
|
+
* @slot footer - Slot for custom footer content. Prefer using footer-button-primary and footer-button-secondary slots.
|
21
|
+
* @slot footer-button-primary - Slot for passing the primary variant of `mdc-button` in the footer.
|
22
|
+
* @slot footer-button-secondary - Slot for passing the secondary variant of `mdc-button` in the footer.
|
23
|
+
*
|
24
|
+
* @tagname mdc-toast
|
25
|
+
*
|
26
|
+
* @event close - (React: onClose) Dispatched when the Close Button is clicked using mouse or keyboard.
|
27
|
+
*
|
28
|
+
* @csspart content-container - The container for the toast's main content, including icon, text, and close button.
|
29
|
+
* @csspart toast-prefix-icon - The icon shown at the start of the toast, styled by variant.
|
30
|
+
* @csspart toast-content - The container for the header and body content of the toast.
|
31
|
+
* @csspart toast-header - The header text of the toast.
|
32
|
+
* @csspart footer - The container for the toast's footer, including toggle and action buttons.
|
33
|
+
* @csspart footer-button-toggle - The toggle button for showing/hiding detailed content.
|
34
|
+
* @csspart toast-close-btn - The close button for the toast.
|
35
|
+
*
|
36
|
+
* @cssproperty --mdc-toast-background-color - Background color of the toast.
|
37
|
+
* @cssproperty --mdc-toast-border-color - Border color of the toast.
|
38
|
+
* @cssproperty --mdc-toast-header-text-color - Color of the header text in the toast.
|
39
|
+
* @cssproperty --mdc-toast-icon-color - Color of the icon in the toast.
|
40
|
+
* @cssproperty --mdc-toast-elevation-3 - Elevation effect applied to the toast.
|
41
|
+
* @cssproperty --mdc-toast-width - Width of the toast.
|
42
|
+
* @cssproperty --mdc-toast-padding - Padding inside the toast.
|
43
|
+
*/
|
44
|
+
const reactWrapper = createComponent({
|
45
|
+
tagName: TAG_NAME,
|
46
|
+
elementClass: Component,
|
47
|
+
react: React,
|
48
|
+
events: {
|
49
|
+
onClose: 'close',
|
50
|
+
},
|
51
|
+
displayName: 'Toast',
|
52
|
+
});
|
53
|
+
export default reactWrapper;
|