@snack-uikit/toaster 0.6.11 → 0.6.12

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.6.12 (2024-04-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **PDS-0000:** set default button type as button ([4ec64de](https://github.com/cloud-ru-tech/snack-uikit/commit/4ec64de508826df4a1e82fd8c75448d9919e563f))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 0.6.11 (2024-04-23)
7
18
 
8
19
  ### Only dependencies have been changed
@@ -29,5 +29,5 @@ export function ToastSystemEvent(_a) {
29
29
  onCloseClick ? onCloseClick(e, closeToast) : closeToast === null || closeToast === void 0 ? void 0 : closeToast();
30
30
  };
31
31
  const icon = useMemo(() => getIcon(appearance), [appearance]);
32
- return (_jsxs("div", Object.assign({ className: cn(styles.container, className) }, extractSupportProps(rest), { "data-appearance": appearance, children: [_jsxs("div", { className: styles.body, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { className: styles.contentLayout, children: [_jsxs("div", { children: [_jsx("span", { className: styles.title, children: _jsx(TruncateString, { text: title, maxLines: 2, hideTooltip: true, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.title }) }), description && (_jsx("span", { className: styles.description, children: _jsx(TruncateString, { maxLines: 4, text: description, hideTooltip: true, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.description }) }))] }), link && (_jsx(Link, { text: link.text, href: link.href, size: 'm', onClick: link.onClick, appearance: APPEARANCE_TO_ON_COLOR_MAP[appearance], "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.link, textMode: appearance === 'errorCritical' ? 'on-accent' : 'accent' }))] }), closable && (_jsx("button", { className: styles.buttonClose, onClick: handleCloseClick, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.buttonClose, "aria-label": 'close notification', children: _jsx(CrossSVG, {}) }))] }), progressBar && (_jsx("div", { role: 'progressbar', "aria-label": 'progressbar', "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.progressbar, className: styles.progress, style: { animationDuration: `${AUTO_CLOSE_TIME[TOASTER_TYPE.SystemEvent]}ms` } })), Array.isArray(action) && action.length > 0 && (_jsx("div", { className: styles.footer, children: action.map(buttonProps => (_jsx(ButtonAction, Object.assign({}, buttonProps, { critical: appearance === 'errorCritical' }), buttonProps.label))) }))] })));
32
+ return (_jsxs("div", Object.assign({ className: cn(styles.container, className) }, extractSupportProps(rest), { "data-appearance": appearance, children: [_jsxs("div", { className: styles.body, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { className: styles.contentLayout, children: [_jsxs("div", { children: [_jsx("span", { className: styles.title, children: _jsx(TruncateString, { text: title, maxLines: 2, hideTooltip: true, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.title }) }), description && (_jsx("span", { className: styles.description, children: _jsx(TruncateString, { maxLines: 4, text: description, hideTooltip: true, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.description }) }))] }), link && (_jsx(Link, { text: link.text, href: link.href, size: 'm', onClick: link.onClick, appearance: APPEARANCE_TO_ON_COLOR_MAP[appearance], "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.link, textMode: appearance === 'errorCritical' ? 'on-accent' : 'accent' }))] }), closable && (_jsx("button", { type: 'button', className: styles.buttonClose, onClick: handleCloseClick, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.buttonClose, "aria-label": 'close notification', children: _jsx(CrossSVG, {}) }))] }), progressBar && (_jsx("div", { role: 'progressbar', "aria-label": 'progressbar', "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.progressbar, className: styles.progress, style: { animationDuration: `${AUTO_CLOSE_TIME[TOASTER_TYPE.SystemEvent]}ms` } })), Array.isArray(action) && action.length > 0 && (_jsx("div", { className: styles.footer, children: action.map(buttonProps => (_jsx(ButtonAction, Object.assign({}, buttonProps, { critical: appearance === 'errorCritical' }), buttonProps.label))) }))] })));
33
33
  }
@@ -32,5 +32,5 @@ export function ToasterContainer({ position = 'bottom-right', limit = 5, contain
32
32
  [styles.containerWithCloseAllButton]: hasCloseAllButton,
33
33
  'osThemeSnack__toast-container__system-event': type === TOASTER_TYPE.SystemEvent,
34
34
  'osThemeSnack__toast-container__user-action': type === TOASTER_TYPE.UserAction,
35
- }), toastClassName: styles.toaster, bodyClassName: styles.toaster, position: position, limit: limit, containerId: containerId }), hasCloseAllButton && (_jsx("div", { className: cn(styles.buttonCloseColumnWrapper, styles[position]), children: _jsx("button", { className: styles.buttonCloseColumn, onClick: closeAll, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.buttonCloseColumn, children: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0432\u0441\u0435" }) }))] }));
35
+ }), toastClassName: styles.toaster, bodyClassName: styles.toaster, position: position, limit: limit, containerId: containerId }), hasCloseAllButton && (_jsx("div", { className: cn(styles.buttonCloseColumnWrapper, styles[position]), children: _jsx("button", { type: 'button', className: styles.buttonCloseColumn, onClick: closeAll, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.buttonCloseColumn, children: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0432\u0441\u0435" }) }))] }));
36
36
  }
@@ -2,5 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TOAST_SYSTEM_EVENT_TEST_IDS } from '../../testIds';
3
3
  import styles from './styles.module.css';
4
4
  export function ButtonAction({ label, onClick, critical }) {
5
- return (_jsx("button", { className: styles.buttonAction, onClick: onClick, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.buttonAction, "aria-label": 'action', "data-critical": critical || undefined, children: label }));
5
+ return (_jsx("button", { type: 'button', className: styles.buttonAction, onClick: onClick, "data-test-id": TOAST_SYSTEM_EVENT_TEST_IDS.buttonAction, "aria-label": 'action', "data-critical": critical || undefined, children: label }));
6
6
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Toaster",
7
- "version": "0.6.11",
7
+ "version": "0.6.12",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -40,5 +40,5 @@
40
40
  "classnames": "2.3.2",
41
41
  "react-toastify": "10.0.5"
42
42
  },
43
- "gitHead": "bf1e1f3cfabccc1ee288c18722e33009bd001798"
43
+ "gitHead": "17bfcf1150776cd35c77d9cca8f45dde97472bf1"
44
44
  }
@@ -95,6 +95,7 @@ export function ToastSystemEvent({
95
95
 
96
96
  {closable && (
97
97
  <button
98
+ type='button'
98
99
  className={styles.buttonClose}
99
100
  onClick={handleCloseClick}
100
101
  data-test-id={TOAST_SYSTEM_EVENT_TEST_IDS.buttonClose}
@@ -78,6 +78,7 @@ export function ToasterContainer({
78
78
  {hasCloseAllButton && (
79
79
  <div className={cn(styles.buttonCloseColumnWrapper, styles[position])}>
80
80
  <button
81
+ type='button'
81
82
  className={styles.buttonCloseColumn}
82
83
  onClick={closeAll}
83
84
  data-test-id={TOAST_SYSTEM_EVENT_TEST_IDS.buttonCloseColumn}
@@ -12,6 +12,7 @@ export type ButtonActionProps = {
12
12
  export function ButtonAction({ label, onClick, critical }: ButtonActionProps) {
13
13
  return (
14
14
  <button
15
+ type='button'
15
16
  className={styles.buttonAction}
16
17
  onClick={onClick}
17
18
  data-test-id={TOAST_SYSTEM_EVENT_TEST_IDS.buttonAction}