@salutejs/plasma-new-hope 0.249.0-canary.1719.12951148116.0 → 0.249.0-canary.1720.13005615941.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.
Files changed (144) hide show
  1. package/cjs/components/Calendar/CalendarBase/CalendarBase.js +8 -0
  2. package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  3. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +8 -0
  4. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  5. package/cjs/components/DatePicker/RangeDate/RangeDate.js +28 -37
  6. package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
  7. package/cjs/components/DatePicker/SingleDate/SingleDate.js +8 -15
  8. package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  9. package/cjs/components/Toast/Toast.css +7 -7
  10. package/cjs/components/Toast/Toast.js +2 -5
  11. package/cjs/components/Toast/Toast.js.map +1 -1
  12. package/cjs/components/Toast/Toast.styles.js +2 -11
  13. package/cjs/components/Toast/Toast.styles.js.map +1 -1
  14. package/cjs/components/Toast/{Toast.styles_1kasmzh.css → Toast.styles_1nei944.css} +2 -2
  15. package/cjs/components/Toast/Toast.tokens.js +1 -2
  16. package/cjs/components/Toast/Toast.tokens.js.map +1 -1
  17. package/cjs/components/Toast/ToastController.css +6 -6
  18. package/cjs/components/Toast/ToastProvider/ToastProvider.js +1 -6
  19. package/cjs/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  20. package/cjs/components/Toast/utils.js +0 -2
  21. package/cjs/components/Toast/utils.js.map +1 -1
  22. package/cjs/components/Toast/variations/_pilled/base.js +1 -1
  23. package/cjs/components/Toast/variations/_pilled/base.js.map +1 -1
  24. package/cjs/components/Toast/variations/_pilled/base_199qghc.css +1 -0
  25. package/cjs/index.css +8 -8
  26. package/emotion/cjs/components/Calendar/CalendarBase/CalendarBase.js +8 -0
  27. package/emotion/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +8 -0
  28. package/emotion/cjs/components/DatePicker/RangeDate/RangeDate.js +28 -37
  29. package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +8 -15
  30. package/emotion/cjs/components/Toast/Toast.js +2 -5
  31. package/emotion/cjs/components/Toast/Toast.styles.js +6 -9
  32. package/emotion/cjs/components/Toast/Toast.template-doc.mdx +5 -22
  33. package/emotion/cjs/components/Toast/Toast.tokens.js +1 -2
  34. package/emotion/cjs/components/Toast/ToastProvider/ToastProvider.js +1 -6
  35. package/emotion/cjs/components/Toast/utils.js +1 -2
  36. package/emotion/cjs/components/Toast/variations/_pilled/base.js +1 -1
  37. package/emotion/cjs/examples/plasma_b2c/components/Toast/Toast.config.js +7 -17
  38. package/emotion/cjs/examples/plasma_b2c/components/Toast/Toast.stories.tsx +14 -31
  39. package/emotion/cjs/examples/plasma_web/components/Toast/Toast.config.js +7 -17
  40. package/emotion/cjs/examples/plasma_web/components/Toast/Toast.stories.tsx +14 -31
  41. package/emotion/es/components/Calendar/CalendarBase/CalendarBase.js +8 -0
  42. package/emotion/es/components/Calendar/CalendarDouble/CalendarDouble.js +8 -0
  43. package/emotion/es/components/DatePicker/RangeDate/RangeDate.js +29 -38
  44. package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +9 -16
  45. package/emotion/es/components/Toast/Toast.js +2 -5
  46. package/emotion/es/components/Toast/Toast.styles.js +6 -9
  47. package/emotion/es/components/Toast/Toast.template-doc.mdx +5 -22
  48. package/emotion/es/components/Toast/Toast.tokens.js +1 -2
  49. package/emotion/es/components/Toast/ToastProvider/ToastProvider.js +2 -7
  50. package/emotion/es/components/Toast/utils.js +0 -1
  51. package/emotion/es/components/Toast/variations/_pilled/base.js +1 -1
  52. package/emotion/es/examples/plasma_b2c/components/Toast/Toast.config.js +7 -17
  53. package/emotion/es/examples/plasma_b2c/components/Toast/Toast.stories.tsx +14 -31
  54. package/emotion/es/examples/plasma_web/components/Toast/Toast.config.js +7 -17
  55. package/emotion/es/examples/plasma_web/components/Toast/Toast.stories.tsx +14 -31
  56. package/es/components/Calendar/CalendarBase/CalendarBase.js +8 -0
  57. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  58. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +8 -0
  59. package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  60. package/es/components/DatePicker/RangeDate/RangeDate.js +29 -38
  61. package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
  62. package/es/components/DatePicker/SingleDate/SingleDate.js +9 -16
  63. package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  64. package/es/components/Toast/Toast.css +7 -7
  65. package/es/components/Toast/Toast.js +2 -5
  66. package/es/components/Toast/Toast.js.map +1 -1
  67. package/es/components/Toast/Toast.styles.js +2 -11
  68. package/es/components/Toast/Toast.styles.js.map +1 -1
  69. package/es/components/Toast/{Toast.styles_1kasmzh.css → Toast.styles_1nei944.css} +2 -2
  70. package/es/components/Toast/Toast.tokens.js +1 -2
  71. package/es/components/Toast/Toast.tokens.js.map +1 -1
  72. package/es/components/Toast/ToastController.css +6 -6
  73. package/es/components/Toast/ToastProvider/ToastProvider.js +2 -7
  74. package/es/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  75. package/es/components/Toast/utils.js +1 -2
  76. package/es/components/Toast/utils.js.map +1 -1
  77. package/es/components/Toast/variations/_pilled/base.js +1 -1
  78. package/es/components/Toast/variations/_pilled/base.js.map +1 -1
  79. package/es/components/Toast/variations/_pilled/base_199qghc.css +1 -0
  80. package/es/index.css +8 -8
  81. package/package.json +2 -2
  82. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +8 -0
  83. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +8 -0
  84. package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +28 -37
  85. package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +8 -15
  86. package/styled-components/cjs/components/Toast/Toast.js +2 -5
  87. package/styled-components/cjs/components/Toast/Toast.styles.js +2 -5
  88. package/styled-components/cjs/components/Toast/Toast.template-doc.mdx +5 -22
  89. package/styled-components/cjs/components/Toast/Toast.tokens.js +1 -2
  90. package/styled-components/cjs/components/Toast/ToastProvider/ToastProvider.js +1 -6
  91. package/styled-components/cjs/components/Toast/utils.js +1 -2
  92. package/styled-components/cjs/components/Toast/variations/_pilled/base.js +1 -1
  93. package/styled-components/cjs/examples/plasma_b2c/components/Toast/Toast.config.js +2 -12
  94. package/styled-components/cjs/examples/plasma_b2c/components/Toast/Toast.stories.tsx +14 -31
  95. package/styled-components/cjs/examples/plasma_web/components/Toast/Toast.config.js +2 -12
  96. package/styled-components/cjs/examples/plasma_web/components/Toast/Toast.stories.tsx +14 -31
  97. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +8 -0
  98. package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +8 -0
  99. package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +29 -38
  100. package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +9 -16
  101. package/styled-components/es/components/Toast/Toast.js +2 -5
  102. package/styled-components/es/components/Toast/Toast.styles.js +2 -5
  103. package/styled-components/es/components/Toast/Toast.template-doc.mdx +5 -22
  104. package/styled-components/es/components/Toast/Toast.tokens.js +1 -2
  105. package/styled-components/es/components/Toast/ToastProvider/ToastProvider.js +2 -7
  106. package/styled-components/es/components/Toast/utils.js +0 -1
  107. package/styled-components/es/components/Toast/variations/_pilled/base.js +1 -1
  108. package/styled-components/es/examples/plasma_b2c/components/Toast/Toast.config.js +2 -12
  109. package/styled-components/es/examples/plasma_b2c/components/Toast/Toast.stories.tsx +14 -31
  110. package/styled-components/es/examples/plasma_web/components/Toast/Toast.config.js +2 -12
  111. package/styled-components/es/examples/plasma_web/components/Toast/Toast.stories.tsx +14 -31
  112. package/types/components/Calendar/CalendarBase/CalendarBase.d.ts.map +1 -1
  113. package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts.map +1 -1
  114. package/types/components/DatePicker/RangeDate/RangeDate.d.ts +2 -0
  115. package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -1
  116. package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts +4 -0
  117. package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts.map +1 -1
  118. package/types/components/DatePicker/SingleDate/SingleDate.d.ts +2 -0
  119. package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
  120. package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +4 -0
  121. package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -1
  122. package/types/components/Toast/Toast.styles.d.ts +1 -3
  123. package/types/components/Toast/Toast.styles.d.ts.map +1 -1
  124. package/types/components/Toast/Toast.tokens.d.ts +1 -2
  125. package/types/components/Toast/Toast.tokens.d.ts.map +1 -1
  126. package/types/components/Toast/Toast.types.d.ts +0 -8
  127. package/types/components/Toast/Toast.types.d.ts.map +1 -1
  128. package/types/components/Toast/ToastProvider/ToastProvider.d.ts.map +1 -1
  129. package/types/components/Toast/utils.d.ts +0 -1
  130. package/types/components/Toast/utils.d.ts.map +1 -1
  131. package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts +2 -0
  132. package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts.map +1 -1
  133. package/types/examples/plasma_b2c/components/Toast/Toast.config.d.ts +0 -10
  134. package/types/examples/plasma_b2c/components/Toast/Toast.config.d.ts.map +1 -1
  135. package/types/examples/plasma_b2c/components/Toast/Toast.d.ts +0 -2
  136. package/types/examples/plasma_b2c/components/Toast/Toast.d.ts.map +1 -1
  137. package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts +2 -0
  138. package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts.map +1 -1
  139. package/types/examples/plasma_web/components/Toast/Toast.config.d.ts +0 -10
  140. package/types/examples/plasma_web/components/Toast/Toast.config.d.ts.map +1 -1
  141. package/types/examples/plasma_web/components/Toast/Toast.d.ts +0 -2
  142. package/types/examples/plasma_web/components/Toast/Toast.d.ts.map +1 -1
  143. package/cjs/components/Toast/variations/_pilled/base_13i59v3.css +0 -1
  144. package/es/components/Toast/variations/_pilled/base_13i59v3.css +0 -1
@@ -104,10 +104,6 @@ export interface ShowToastArgs {
104
104
  * Время отображения подсказки. Если не передать значение, подсказка будет отображаться пока ее не закроют.
105
105
  */
106
106
  timeout?: number;
107
- /**
108
- * Цвет текста (по умолчанию берётся цвет из view)
109
- */
110
- textColor?: string;
111
107
  /**
112
108
  * callback срабатывающий в момент события hideToast
113
109
  */
@@ -121,11 +117,9 @@ export interface ShowToastArgs {
121
117
 
122
118
  ## Пример использования
123
119
 
124
- Для изменения цветовой темы компонента `Toast` используйте свойство `view` компонента `ViewContainer`.
125
-
126
120
  ```jsx live
127
121
  import React from 'react'
128
- import { useToast, ToastProvider, Button, ViewContainer } from '@salutejs/{{ package }}'
122
+ import { useToast, ToastProvider, Button } from '@salutejs/{{ package }}'
129
123
 
130
124
  export function App() {
131
125
 
@@ -136,13 +130,12 @@ export function App() {
136
130
  const onHide = () => {}
137
131
  const toastData = {
138
132
  text: 'Подсказка вызванная showToast',
139
- textColor: 'cyan',
140
133
  position: 'bottom',
141
134
  role: 'status',
142
135
  hasClose: true,
143
136
  fade: false,
144
137
  size: 'm',
145
- view: 'default',
138
+ view: 'dark',
146
139
  timeout: 3000,
147
140
  onShow,
148
141
  onHide
@@ -152,19 +145,9 @@ export function App() {
152
145
  }
153
146
 
154
147
  return (
155
- <div style=\{{ display: 'flex', gap: '1rem' }}>
156
- <ViewContainer view="onLight">
157
- <ToastProvider>
158
- <ToastExample />
159
- </ToastProvider>
160
- </ViewContainer>
161
-
162
- <ViewContainer view="onDark">
163
- <ToastProvider>
164
- <ToastExample />
165
- </ToastProvider>
166
- </ViewContainer>
167
- </div>
148
+ <ToastProvider>
149
+ <ToastExample />
150
+ </ToastProvider>
168
151
  )
169
152
  }
170
153
  ```
@@ -25,8 +25,7 @@ var tokens = exports.tokens = {
25
25
  letterSpacing: '--plasma-toast-letter-spacing',
26
26
  lineHeight: '--plasma-toast-lineheight',
27
27
  pilledBorderRadius: '--plasma-toast-pilled-border-radius',
28
- contentLeftMargin: '--plasma-toast-content-left-margin',
29
- contentLeftColor: '--plasma-toast-content-left-color',
28
+ leftContentMargin: '--plasma-toast-left-content-margin',
30
29
  closeIconMargin: '--plasma-toast-close-icon-margin',
31
30
  closeIconColor: '--plasma-toast-close-icon-color',
32
31
  closeIconColorOnHover: '--plasma-toast-close-icon-color-on-hover',
@@ -126,9 +126,6 @@ var ToastProviderHoc = exports.ToastProviderHoc = function ToastProviderHoc(Toas
126
126
  size = _getShowToastCallSign.size,
127
127
  view = _getShowToastCallSign.view,
128
128
  width = _getShowToastCallSign.width,
129
- _getShowToastCallSign4 = _getShowToastCallSign.closeIconType,
130
- closeIconType = _getShowToastCallSign4 === void 0 ? _utils.DEFAULT_CLOSE_ICON_TYPE : _getShowToastCallSign4,
131
- textColor = _getShowToastCallSign.textColor,
132
129
  onHide = _getShowToastCallSign.onHide,
133
130
  onShow = _getShowToastCallSign.onShow;
134
131
  setToastProps({
@@ -142,9 +139,7 @@ var ToastProviderHoc = exports.ToastProviderHoc = function ToastProviderHoc(Toas
142
139
  pilled: pilled,
143
140
  hasClose: hasClose,
144
141
  size: size,
145
- view: view,
146
- closeIconType: closeIconType,
147
- textColor: textColor
142
+ view: view
148
143
  });
149
144
  setToastInfo({
150
145
  timeout: timeout,
@@ -3,12 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.gradients = exports.TOAST_Z_INDEX = exports.TIMER_DELAY = exports.FADE_Z_INDEX = exports.DEFAULT_POSITION = exports.DEFAULT_FADE = exports.DEFAULT_CLOSE_ICON_TYPE = exports.Button = void 0;
6
+ exports.gradients = exports.TOAST_Z_INDEX = exports.TIMER_DELAY = exports.FADE_Z_INDEX = exports.DEFAULT_POSITION = exports.DEFAULT_FADE = exports.Button = void 0;
7
7
  var _Button = /*#__PURE__*/require("../Button");
8
8
  var _engines = /*#__PURE__*/require("../../engines");
9
9
  var DEFAULT_FADE = exports.DEFAULT_FADE = true;
10
10
  var DEFAULT_POSITION = exports.DEFAULT_POSITION = 'bottom';
11
- var DEFAULT_CLOSE_ICON_TYPE = exports.DEFAULT_CLOSE_ICON_TYPE = 'default';
12
11
  var TIMER_DELAY = exports.TIMER_DELAY = 300;
13
12
  var FADE_Z_INDEX = exports.FADE_Z_INDEX = '9900';
14
13
  var TOAST_Z_INDEX = exports.TOAST_Z_INDEX = '9901';
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.base = void 0;
7
7
  var _styledComponents = /*#__PURE__*/require("styled-components");
8
8
  var _Toast = /*#__PURE__*/require("../../Toast.tokens");
9
- var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&.", "{--plasma_private-content-left-margin:var(", ");--plasma_private-close-icon-margin:var(", ");border-radius:var(", ");}"], /*#__PURE__*/String(_Toast.classes.toastPilled), _Toast.tokens.contentLeftMargin, _Toast.tokens.closeIconMargin, _Toast.tokens.pilledBorderRadius);
9
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&.", "{--plasma_private-left-content-margin:var(", ");--plasma_private-close-icon-margin:var(", ");border-radius:var(", ");}"], /*#__PURE__*/String(_Toast.classes.toastPilled), _Toast.tokens.leftContentMargin, _Toast.tokens.closeIconMargin, _Toast.tokens.pilledBorderRadius);
@@ -15,24 +15,14 @@ var config = exports.config = {
15
15
  variations: {
16
16
  view: {
17
17
  "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-solid-card-brightness);", ":var(--text-secondary);", ":var(--text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
18
- positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-solid-card-brightness);", ":var(--text-positive);", ":var(--text-secondary);", ":var(--text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.contentLeftColor, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
19
- negative: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-solid-card-brightness);", ":var(--text-negative);", ":var(--text-secondary);", ":var(--text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.contentLeftColor, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
20
- /**
21
- * @deprecated
22
- * светлый и темный фон регулировать через `view` компонента `ViewContainer`
23
- */
24
18
  dark: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-solid-primary-brightness);", ":var(--on-dark-text-secondary);", ":var(--on-dark-text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
25
- /**
26
- * @deprecated
27
- * светлый и темный фон регулировать через `view` компонента `ViewContainer`
28
- */
29
19
  light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-light-surface-solid-primary-brightness);", ":var(--on-light-text-secondary);", ":var(--on-light-text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover)
30
20
  },
31
21
  size: {
32
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":calc(100vw - 5rem);", ":0.5625rem 0.75rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem 0.375rem -0.0625rem -0.125rem;", ":-0.0625rem -0.25rem -0.0625rem 0.5rem;"], _Toast.toastTokens.borderRadius, _Toast.toastTokens.maxWidth, _Toast.toastTokens.padding, _Toast.toastTokens.fontFamily, _Toast.toastTokens.fontSize, _Toast.toastTokens.fontStyle, _Toast.toastTokens.fontWeight, _Toast.toastTokens.letterSpacing, _Toast.toastTokens.lineHeight, _Toast.toastTokens.contentLeftMargin, _Toast.toastTokens.closeIconMargin)
22
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":calc(100vw - 5rem);", ":0.5625rem 0.75rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem 0.375rem -0.0625rem -0.125rem;", ":-0.0625rem -0.25rem -0.0625rem 0.5rem;"], _Toast.toastTokens.borderRadius, _Toast.toastTokens.maxWidth, _Toast.toastTokens.padding, _Toast.toastTokens.fontFamily, _Toast.toastTokens.fontSize, _Toast.toastTokens.fontStyle, _Toast.toastTokens.fontWeight, _Toast.toastTokens.letterSpacing, _Toast.toastTokens.lineHeight, _Toast.toastTokens.leftContentMargin, _Toast.toastTokens.closeIconMargin)
33
23
  },
34
24
  pilled: {
35
- "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":-0.0625rem 0.375rem -0.0625rem -0.25rem;", ":-0.0625rem -0.25rem -0.0625rem 0.375rem;"], _Toast.toastTokens.pilledBorderRadius, _Toast.toastTokens.contentLeftMargin, _Toast.toastTokens.closeIconMargin)
25
+ "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":-0.0625rem 0.375rem -0.0625rem -0.25rem;", ":-0.0625rem -0.25rem -0.0625rem 0.375rem;"], _Toast.toastTokens.pilledBorderRadius, _Toast.toastTokens.leftContentMargin, _Toast.toastTokens.closeIconMargin)
36
26
  },
37
27
  closeIconType: {
38
28
  "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.5rem;"], _Toast.toastTokens.closeIconButtonSize, _Toast.toastTokens.closeIconSize),
@@ -4,39 +4,21 @@ import { action } from '@storybook/addon-actions';
4
4
  import styled from 'styled-components';
5
5
  import { disableProps } from '@salutejs/plasma-sb-utils';
6
6
 
7
- import { WithTheme } from '../../../_helpers';
7
+ import { toastConfig } from '../../../../components/Toast';
8
+ import { mergeConfig } from '../../../../engines';
9
+ import { WithTheme, argTypesFromConfig } from '../../../_helpers';
8
10
  import { Button } from '../Button/Button';
9
11
  import { PopupProvider } from '../Popup/Popup';
10
12
  import { addNotification } from '../../../../../src/components/Notification';
11
13
  import { NotificationsProvider } from '../Notification/Notification';
12
14
  import { Modal } from '../Modal/Modal';
13
15
 
16
+ import { config } from './Toast.config';
14
17
  import { Toast, ToastController, ToastProvider, useToast } from './Toast';
15
18
 
16
- const views = ['default', 'positive', 'negative'];
17
- const closeIconTypes = ['default', 'thin'];
18
-
19
19
  const meta: Meta<typeof ToastController> = {
20
20
  title: 'b2c/Overlay/Toast',
21
21
  decorators: [WithTheme],
22
- argTypes: {
23
- view: {
24
- options: views,
25
- control: {
26
- type: 'select',
27
- },
28
- },
29
- closeIconType: {
30
- options: closeIconTypes,
31
- control: {
32
- type: 'select',
33
- },
34
- },
35
- textColor: {
36
- control: 'color',
37
- },
38
- ...disableProps(['size']),
39
- },
40
22
  };
41
23
 
42
24
  export default meta;
@@ -67,6 +49,7 @@ const StyledWrapper = styled.div`
67
49
  `;
68
50
 
69
51
  const ToastContainer = styled.div`
52
+ position: fixed;
70
53
  transform: translateX(50%);
71
54
  `;
72
55
 
@@ -78,7 +61,6 @@ const Container = styled.div`
78
61
  export const ToastComponent: StoryComponent = {
79
62
  args: {
80
63
  text: 'Текст всплывающего уведомления',
81
- textColor: undefined,
82
64
  view: 'default',
83
65
  closeIconType: 'default',
84
66
  size: 'm',
@@ -86,6 +68,14 @@ export const ToastComponent: StoryComponent = {
86
68
  enableContentLeft: true,
87
69
  pilled: false,
88
70
  },
71
+ argTypes: {
72
+ closeIconType: {
73
+ options: ['default', 'thin'],
74
+ control: {
75
+ type: 'select',
76
+ },
77
+ },
78
+ },
89
79
  render: ({ enableContentLeft, ...args }) => (
90
80
  <ToastContainer>
91
81
  <Toast contentLeft={enableContentLeft && <BellIcon width="1rem" height="1rem" />} {...args} />
@@ -104,8 +94,6 @@ const StoryLiveDemo = ({
104
94
  size,
105
95
  hasClose,
106
96
  enableContentLeft,
107
- closeIconType,
108
- textColor,
109
97
  }: StoryProps) => {
110
98
  const { showToast, hideToast } = useToast();
111
99
  const contentLeft = enableContentLeft && <BellIcon width="1rem" height="1rem" />;
@@ -126,8 +114,6 @@ const StoryLiveDemo = ({
126
114
  view,
127
115
  size,
128
116
  hasClose,
129
- closeIconType,
130
- textColor,
131
117
  onHide: action('onHide'),
132
118
  onShow: action('onShow'),
133
119
  });
@@ -155,6 +141,7 @@ export const LiveDemo: Story = {
155
141
  type: 'inline-radio',
156
142
  },
157
143
  },
144
+ ...argTypesFromConfig(mergeConfig(toastConfig, config)),
158
145
  ...disableProps(['role', 'onShow', 'onHide', 'contentLeft']),
159
146
  },
160
147
  parameters: {
@@ -180,8 +167,6 @@ const StoryComplex = ({
180
167
  size,
181
168
  hasClose,
182
169
  enableContentLeft,
183
- closeIconType,
184
- textColor,
185
170
  }: StoryProps) => {
186
171
  const [isModalOpen, setIsModalOpen] = useState(false);
187
172
 
@@ -200,8 +185,6 @@ const StoryComplex = ({
200
185
  view,
201
186
  size,
202
187
  hasClose,
203
- closeIconType,
204
- textColor,
205
188
  onHide: action('onHide'),
206
189
  onShow: action('onShow'),
207
190
  });
@@ -15,24 +15,14 @@ var config = exports.config = {
15
15
  variations: {
16
16
  view: {
17
17
  "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-solid-card-brightness);", ":var(--text-secondary);", ":var(--text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
18
- positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-solid-card-brightness);", ":var(--text-positive);", ":var(--text-secondary);", ":var(--text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.contentLeftColor, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
19
- negative: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-solid-card-brightness);", ":var(--text-negative);", ":var(--text-secondary);", ":var(--text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.contentLeftColor, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
20
- /**
21
- * @deprecated
22
- * светлый и темный фон регулировать через `view` компонента `ViewContainer`
23
- */
24
18
  dark: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-solid-primary-brightness);", ":var(--on-dark-text-secondary);", ":var(--on-dark-text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover),
25
- /**
26
- * @deprecated
27
- * светлый и темный фон регулировать через `view` компонента `ViewContainer`
28
- */
29
19
  light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-light-surface-solid-primary-brightness);", ":var(--on-light-text-secondary);", ":var(--on-light-text-secondary);"], _Toast.toastTokens.color, _Toast.toastTokens.background, _Toast.toastTokens.closeIconColor, _Toast.toastTokens.closeIconColorOnHover)
30
20
  },
31
21
  size: {
32
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":calc(100vw - 5rem);", ":0.5625rem 0.75rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem 0.375rem -0.0625rem -0.125rem;", ":-0.0625rem -0.25rem -0.0625rem 0.5rem;"], _Toast.toastTokens.borderRadius, _Toast.toastTokens.maxWidth, _Toast.toastTokens.padding, _Toast.toastTokens.fontFamily, _Toast.toastTokens.fontSize, _Toast.toastTokens.fontStyle, _Toast.toastTokens.fontWeight, _Toast.toastTokens.letterSpacing, _Toast.toastTokens.lineHeight, _Toast.toastTokens.contentLeftMargin, _Toast.toastTokens.closeIconMargin)
22
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":calc(100vw - 5rem);", ":0.5625rem 0.75rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem 0.375rem -0.0625rem -0.125rem;", ":-0.0625rem -0.25rem -0.0625rem 0.5rem;"], _Toast.toastTokens.borderRadius, _Toast.toastTokens.maxWidth, _Toast.toastTokens.padding, _Toast.toastTokens.fontFamily, _Toast.toastTokens.fontSize, _Toast.toastTokens.fontStyle, _Toast.toastTokens.fontWeight, _Toast.toastTokens.letterSpacing, _Toast.toastTokens.lineHeight, _Toast.toastTokens.leftContentMargin, _Toast.toastTokens.closeIconMargin)
33
23
  },
34
24
  pilled: {
35
- "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":-0.0625rem 0.375rem -0.0625rem -0.25rem;", ":-0.0625rem -0.25rem -0.0625rem 0.375rem;"], _Toast.toastTokens.pilledBorderRadius, _Toast.toastTokens.contentLeftMargin, _Toast.toastTokens.closeIconMargin)
25
+ "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":-0.0625rem 0.375rem -0.0625rem -0.25rem;", ":-0.0625rem -0.25rem -0.0625rem 0.375rem;"], _Toast.toastTokens.pilledBorderRadius, _Toast.toastTokens.leftContentMargin, _Toast.toastTokens.closeIconMargin)
36
26
  },
37
27
  closeIconType: {
38
28
  "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.5rem;"], _Toast.toastTokens.closeIconButtonSize, _Toast.toastTokens.closeIconSize),
@@ -4,39 +4,21 @@ import { action } from '@storybook/addon-actions';
4
4
  import styled from 'styled-components';
5
5
  import { disableProps } from '@salutejs/plasma-sb-utils';
6
6
 
7
- import { WithTheme } from '../../../_helpers';
7
+ import { toastConfig } from '../../../../components/Toast';
8
+ import { mergeConfig } from '../../../../engines';
9
+ import { WithTheme, argTypesFromConfig } from '../../../_helpers';
8
10
  import { Button } from '../Button/Button';
9
11
  import { PopupProvider } from '../Popup/Popup';
10
12
  import { addNotification } from '../../../../../src/components/Notification';
11
13
  import { NotificationsProvider } from '../Notification/Notification';
12
14
  import { Modal } from '../Modal/Modal';
13
15
 
16
+ import { config } from './Toast.config';
14
17
  import { Toast, ToastController, ToastProvider, useToast } from './Toast';
15
18
 
16
- const views = ['default', 'positive', 'negative'];
17
- const closeIconTypes = ['default', 'thin'];
18
-
19
19
  const meta: Meta<typeof ToastController> = {
20
20
  title: 'web/Overlay/Toast',
21
21
  decorators: [WithTheme],
22
- argTypes: {
23
- view: {
24
- options: views,
25
- control: {
26
- type: 'select',
27
- },
28
- },
29
- closeIconType: {
30
- options: closeIconTypes,
31
- control: {
32
- type: 'select',
33
- },
34
- },
35
- textColor: {
36
- control: 'color',
37
- },
38
- ...disableProps(['size']),
39
- },
40
22
  };
41
23
 
42
24
  export default meta;
@@ -67,6 +49,7 @@ const StyledWrapper = styled.div`
67
49
  `;
68
50
 
69
51
  const ToastContainer = styled.div`
52
+ position: fixed;
70
53
  transform: translateX(50%);
71
54
  `;
72
55
 
@@ -78,7 +61,6 @@ const Container = styled.div`
78
61
  export const ToastComponent: StoryComponent = {
79
62
  args: {
80
63
  text: 'Текст всплывающего уведомления',
81
- textColor: undefined,
82
64
  view: 'default',
83
65
  closeIconType: 'default',
84
66
  size: 'm',
@@ -86,6 +68,14 @@ export const ToastComponent: StoryComponent = {
86
68
  enableContentLeft: true,
87
69
  pilled: false,
88
70
  },
71
+ argTypes: {
72
+ closeIconType: {
73
+ options: ['default', 'thin'],
74
+ control: {
75
+ type: 'select',
76
+ },
77
+ },
78
+ },
89
79
  render: ({ enableContentLeft, ...args }) => (
90
80
  <ToastContainer>
91
81
  <Toast contentLeft={enableContentLeft && <BellIcon width="1rem" height="1rem" />} {...args} />
@@ -104,8 +94,6 @@ const StoryLiveDemo = ({
104
94
  size,
105
95
  hasClose,
106
96
  enableContentLeft,
107
- closeIconType,
108
- textColor,
109
97
  }: StoryProps) => {
110
98
  const { showToast, hideToast } = useToast();
111
99
  const contentLeft = enableContentLeft && <BellIcon width="1rem" height="1rem" />;
@@ -126,8 +114,6 @@ const StoryLiveDemo = ({
126
114
  view,
127
115
  size,
128
116
  hasClose,
129
- closeIconType,
130
- textColor,
131
117
  onHide: action('onHide'),
132
118
  onShow: action('onShow'),
133
119
  });
@@ -155,6 +141,7 @@ export const LiveDemo: Story = {
155
141
  type: 'inline-radio',
156
142
  },
157
143
  },
144
+ ...argTypesFromConfig(mergeConfig(toastConfig, config)),
158
145
  ...disableProps(['role', 'onShow', 'onHide', 'contentLeft']),
159
146
  },
160
147
  parameters: {
@@ -180,8 +167,6 @@ const StoryComplex = ({
180
167
  size,
181
168
  hasClose,
182
169
  enableContentLeft,
183
- closeIconType,
184
- textColor,
185
170
  }: StoryProps) => {
186
171
  const [isModalOpen, setIsModalOpen] = useState(false);
187
172
 
@@ -200,8 +185,6 @@ const StoryComplex = ({
200
185
  view,
201
186
  size,
202
187
  hasClose,
203
- closeIconType,
204
- textColor,
205
188
  onHide: action('onHide'),
206
189
  onShow: action('onShow'),
207
190
  });
@@ -136,6 +136,14 @@ export var calendarBaseRoot = function calendarBaseRoot(Root) {
136
136
  });
137
137
  setPrevValue(value);
138
138
  }
139
+ if (!value) {
140
+ dispatch({
141
+ type: ActionType.UPDATE_DATE,
142
+ payload: {
143
+ value: min || new Date()
144
+ }
145
+ });
146
+ }
139
147
  }, [value, prevValue]);
140
148
  return /*#__PURE__*/React.createElement(Root, _extends({
141
149
  ref: outerRootRef,
@@ -190,6 +190,14 @@ export var calendarDoubleRoot = function calendarDoubleRoot(Root) {
190
190
  }
191
191
  setPrevValue(value);
192
192
  }
193
+ if (!value) {
194
+ dispatch({
195
+ type: ActionType.UPDATE_DATE,
196
+ payload: {
197
+ value: min || new Date()
198
+ }
199
+ });
200
+ }
193
201
  }, [value, prevValue]);
194
202
  useEffect(function () {
195
203
  setFirstDate(date);
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "autoComplete", "isDoubleCalendar", "opened", "label", "leftHelper", "contentLeft", "contentRight", "view", "size", "readOnly", "disabled", "name", "dividerVariant", "dividerIcon", "defaultFirstDate", "defaultSecondDate", "firstValueError", "secondValueError", "firstValueSuccess", "secondValueSuccess", "firstPlaceholder", "secondPlaceholder", "firstTextfieldContentLeft", "firstTextfieldContentRight", "secondTextfieldContentLeft", "secondTextfieldContentRight", "firstTextfieldTextBefore", "secondTextfieldTextBefore", "firstTextfieldTextAfter", "secondTextfieldTextAfter", "required", "requiredPlacement", "format", "lang", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "frame", "usePortal", "placement", "closeOnOverlayClick", "closeOnEsc", "closeAfterDateSelect", "offset", "onToggle", "onChange", "onChangeFirstValue", "onChangeSecondValue", "onCommitFirstDate", "onCommitSecondDate", "onFocusFirstTextfield", "onFocusSecondTextfield", "onBlurFirstTextfield", "onBlurSecondTextfield"];
1
+ var _excluded = ["className", "autoComplete", "isDoubleCalendar", "opened", "value", "label", "leftHelper", "contentLeft", "contentRight", "view", "size", "readOnly", "disabled", "name", "dividerVariant", "dividerIcon", "defaultFirstDate", "defaultSecondDate", "firstValueError", "secondValueError", "firstValueSuccess", "secondValueSuccess", "firstPlaceholder", "secondPlaceholder", "firstTextfieldContentLeft", "firstTextfieldContentRight", "secondTextfieldContentLeft", "secondTextfieldContentRight", "firstTextfieldTextBefore", "secondTextfieldTextBefore", "firstTextfieldTextAfter", "secondTextfieldTextAfter", "required", "requiredPlacement", "format", "lang", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "frame", "usePortal", "placement", "closeOnOverlayClick", "closeOnEsc", "closeAfterDateSelect", "offset", "onToggle", "onChange", "onChangeFirstValue", "onChangeSecondValue", "onCommitFirstDate", "onCommitSecondDate", "onFocusFirstTextfield", "onFocusSecondTextfield", "onBlurFirstTextfield", "onBlurSecondTextfield"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
4
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -8,7 +8,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
8
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
- import React, { createRef, forwardRef, useCallback, useEffect, useRef, useState } from 'react';
11
+ import React, { createRef, forwardRef, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
12
12
  import { cx, noop } from '../../../utils';
13
13
  import { formatCalendarValue, formatInputValue, getDateFormatDelimiter, getDateFromFormat } from '../utils/dateHelper';
14
14
  import { useDatePicker } from '../hooks/useDatePicker';
@@ -31,6 +31,7 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
31
31
  isDoubleCalendar = _ref$isDoubleCalendar === void 0 ? false : _ref$isDoubleCalendar,
32
32
  _ref$opened = _ref.opened,
33
33
  opened = _ref$opened === void 0 ? false : _ref$opened,
34
+ externalValue = _ref.value,
34
35
  label = _ref.label,
35
36
  leftHelper = _ref.leftHelper,
36
37
  contentLeft = _ref.contentLeft,
@@ -113,6 +114,10 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
113
114
  var rootRef = useRef(null);
114
115
  var innerRefFirst = useRef(null);
115
116
  var innerRefSecond = useRef(null);
117
+ var _ref2 = externalValue || [],
118
+ _ref3 = _slicedToArray(_ref2, 2),
119
+ startExternalValue = _ref3[0],
120
+ endExternalValue = _ref3[1];
116
121
  var _useState = useState(rangeRef === null || rangeRef === void 0 || (_rangeRef$current = rangeRef.current) === null || _rangeRef$current === void 0 ? void 0 : _rangeRef$current.firstTextField()),
117
122
  _useState2 = _slicedToArray(_useState, 2),
118
123
  firstInputRef = _useState2[0],
@@ -125,24 +130,24 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
125
130
  _useState6 = _slicedToArray(_useState5, 2),
126
131
  isInnerOpen = _useState6[0],
127
132
  setIsInnerOpen = _useState6[1];
128
- var _useState7 = useState(formatCalendarValue(defaultFirstDate, format, lang)),
133
+ var _useState7 = useState(formatCalendarValue(startExternalValue || defaultFirstDate, format, lang)),
129
134
  _useState8 = _slicedToArray(_useState7, 2),
130
135
  calendarFirstValue = _useState8[0],
131
136
  setCalendarFirstValue = _useState8[1];
132
137
  var _useState9 = useState(formatInputValue({
133
- value: defaultFirstDate,
138
+ value: startExternalValue || defaultFirstDate,
134
139
  format: format,
135
140
  lang: lang
136
141
  })),
137
142
  _useState10 = _slicedToArray(_useState9, 2),
138
143
  inputFirstValue = _useState10[0],
139
144
  setInputFirstValue = _useState10[1];
140
- var _useState11 = useState(formatCalendarValue(defaultSecondDate, format, lang)),
145
+ var _useState11 = useState(formatCalendarValue(endExternalValue || defaultSecondDate, format, lang)),
141
146
  _useState12 = _slicedToArray(_useState11, 2),
142
147
  calendarSecondValue = _useState12[0],
143
148
  setCalendarSecondValue = _useState12[1];
144
149
  var _useState13 = useState(formatInputValue({
145
- value: defaultSecondDate,
150
+ value: endExternalValue || defaultSecondDate,
146
151
  format: format,
147
152
  lang: lang
148
153
  })),
@@ -305,10 +310,10 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
305
310
  handleToggle(false);
306
311
  }
307
312
  };
308
- var handleChangeCalendarValue = function handleChangeCalendarValue(_ref2, dateInfo) {
309
- var _ref3 = _slicedToArray(_ref2, 2),
310
- firstDate = _ref3[0],
311
- secondDate = _ref3[1];
313
+ var handleChangeCalendarValue = function handleChangeCalendarValue(_ref4, dateInfo) {
314
+ var _ref5 = _slicedToArray(_ref4, 2),
315
+ firstDate = _ref5[0],
316
+ secondDate = _ref5[1];
312
317
  if (firstDate) {
313
318
  handleCommitFirstDate(firstDate, false, true, dateInfo);
314
319
  }
@@ -385,42 +390,28 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
385
390
  });
386
391
  }, [opened]);
387
392
  useEffect(function () {
388
- setCalendarFirstValue(formatCalendarValue(defaultFirstDate, format, lang));
389
- setInputFirstValue(formatInputValue({
390
- value: defaultFirstDate,
391
- format: format,
392
- lang: lang
393
- }));
394
- }, [defaultFirstDate]);
395
- useEffect(function () {
396
- setCalendarSecondValue(formatCalendarValue(defaultSecondDate, format, lang));
397
- setInputSecondValue(formatInputValue({
398
- value: defaultSecondDate,
399
- format: format,
400
- lang: lang
401
- }));
402
- }, [defaultSecondDate]);
403
- useEffect(function () {
404
- setCalendarFirstValue(formatCalendarValue(defaultFirstDate, format, lang));
393
+ if (calendarFirstValue && calendarSecondValue) {
394
+ setFullDateEntered(true);
395
+ }
396
+ }, [calendarFirstValue, calendarSecondValue]);
397
+ useLayoutEffect(function () {
398
+ setCalendarFirstValue(formatCalendarValue(startExternalValue || defaultFirstDate, format, lang));
405
399
  setInputFirstValue(formatInputValue({
406
- value: defaultFirstDate,
400
+ value: startExternalValue || defaultFirstDate,
407
401
  format: format,
408
402
  lang: lang
409
403
  }));
410
- setCalendarSecondValue(formatCalendarValue(defaultSecondDate, format, lang));
404
+ }, [startExternalValue, defaultFirstDate, format, lang]);
405
+ useLayoutEffect(function () {
406
+ setCalendarSecondValue(formatCalendarValue(endExternalValue || defaultSecondDate, format, lang));
411
407
  setInputSecondValue(formatInputValue({
412
- value: defaultSecondDate,
408
+ value: endExternalValue || defaultSecondDate,
413
409
  format: format,
414
410
  lang: lang
415
411
  }));
416
- }, [format, lang]);
417
- useEffect(function () {
418
- if (calendarFirstValue && calendarSecondValue) {
419
- setFullDateEntered(true);
420
- }
421
- }, [calendarFirstValue, calendarSecondValue]);
422
- var RootWrapper = useCallback(function (_ref4) {
423
- var children = _ref4.children;
412
+ }, [endExternalValue, defaultSecondDate, format, lang]);
413
+ var RootWrapper = useCallback(function (_ref6) {
414
+ var children = _ref6.children;
424
415
  return /*#__PURE__*/React.createElement(Root, {
425
416
  view: view,
426
417
  size: size,