@salutejs/plasma-new-hope 0.324.1-canary.1996.15273628835.0 → 0.324.1-canary.1998.15294767801.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 (89) hide show
  1. package/cjs/components/Notification/Notification.css +12 -12
  2. package/cjs/components/Notification/Notification.js +5 -1
  3. package/cjs/components/Notification/Notification.js.map +1 -1
  4. package/cjs/components/Notification/Notification.styles.js +63 -48
  5. package/cjs/components/Notification/Notification.styles.js.map +1 -1
  6. package/cjs/components/Notification/{Notification.styles_1yt699o.css → Notification.styles_1uyb7ob.css} +1 -1
  7. package/cjs/components/Notification/Notification.types.js.map +1 -1
  8. package/cjs/components/Notification/NotificationsProvider.css +11 -11
  9. package/cjs/components/Notification/variations/_layout/base.js +1 -1
  10. package/cjs/components/Notification/variations/_layout/base.js.map +1 -1
  11. package/cjs/components/Notification/variations/_layout/base_1g9g70c.css +1 -0
  12. package/cjs/components/NumberFormat/NumberFormat.js +2 -7
  13. package/cjs/components/NumberFormat/NumberFormat.js.map +1 -1
  14. package/cjs/index.css +12 -12
  15. package/emotion/cjs/components/Notification/Notification.js +5 -1
  16. package/emotion/cjs/components/Notification/Notification.styles.js +43 -36
  17. package/emotion/cjs/components/Notification/Notification.template-doc.mdx +44 -0
  18. package/emotion/cjs/components/Notification/variations/_layout/base.js +1 -1
  19. package/emotion/cjs/components/NumberFormat/NumberFormat.js +2 -7
  20. package/emotion/cjs/components/TextField/TextField.template-doc.mdx +16 -1
  21. package/emotion/cjs/examples/fixtures/Notification.js +1 -1
  22. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
  23. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +23 -22
  24. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
  25. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
  26. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.config.js +23 -22
  27. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
  28. package/emotion/es/components/Notification/Notification.js +5 -1
  29. package/emotion/es/components/Notification/Notification.styles.js +43 -36
  30. package/emotion/es/components/Notification/Notification.template-doc.mdx +44 -0
  31. package/emotion/es/components/Notification/variations/_layout/base.js +1 -1
  32. package/emotion/es/components/NumberFormat/NumberFormat.js +2 -7
  33. package/emotion/es/components/TextField/TextField.template-doc.mdx +16 -1
  34. package/emotion/es/examples/fixtures/Notification.js +1 -1
  35. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
  36. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.config.js +23 -22
  37. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
  38. package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
  39. package/emotion/es/examples/plasma_web/components/TextField/TextField.config.js +23 -22
  40. package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
  41. package/es/components/Notification/Notification.css +12 -12
  42. package/es/components/Notification/Notification.js +5 -1
  43. package/es/components/Notification/Notification.js.map +1 -1
  44. package/es/components/Notification/Notification.styles.js +63 -48
  45. package/es/components/Notification/Notification.styles.js.map +1 -1
  46. package/es/components/Notification/{Notification.styles_1yt699o.css → Notification.styles_1uyb7ob.css} +1 -1
  47. package/es/components/Notification/Notification.types.js.map +1 -1
  48. package/es/components/Notification/NotificationsProvider.css +11 -11
  49. package/es/components/Notification/variations/_layout/base.js +1 -1
  50. package/es/components/Notification/variations/_layout/base.js.map +1 -1
  51. package/es/components/Notification/variations/_layout/base_1g9g70c.css +1 -0
  52. package/es/components/NumberFormat/NumberFormat.js +2 -7
  53. package/es/components/NumberFormat/NumberFormat.js.map +1 -1
  54. package/es/index.css +12 -12
  55. package/package.json +4 -4
  56. package/styled-components/cjs/components/Notification/Notification.js +5 -1
  57. package/styled-components/cjs/components/Notification/Notification.styles.js +33 -26
  58. package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +44 -0
  59. package/styled-components/cjs/components/Notification/variations/_layout/base.js +1 -1
  60. package/styled-components/cjs/components/NumberFormat/NumberFormat.js +2 -7
  61. package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +16 -1
  62. package/styled-components/cjs/examples/fixtures/Notification.js +1 -1
  63. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
  64. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +2 -1
  65. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
  66. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
  67. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +7 -6
  68. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
  69. package/styled-components/es/components/Notification/Notification.js +5 -1
  70. package/styled-components/es/components/Notification/Notification.styles.js +33 -26
  71. package/styled-components/es/components/Notification/Notification.template-doc.mdx +44 -0
  72. package/styled-components/es/components/Notification/variations/_layout/base.js +1 -1
  73. package/styled-components/es/components/NumberFormat/NumberFormat.js +2 -7
  74. package/styled-components/es/components/TextField/TextField.template-doc.mdx +16 -1
  75. package/styled-components/es/examples/fixtures/Notification.js +1 -1
  76. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
  77. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +2 -1
  78. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
  79. package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
  80. package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +7 -6
  81. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
  82. package/types/components/Notification/Notification.d.ts.map +1 -1
  83. package/types/components/Notification/Notification.styles.d.ts +3 -1
  84. package/types/components/Notification/Notification.styles.d.ts.map +1 -1
  85. package/types/components/Notification/Notification.types.d.ts +9 -0
  86. package/types/components/Notification/Notification.types.d.ts.map +1 -1
  87. package/types/components/NumberFormat/NumberFormat.d.ts.map +1 -1
  88. package/cjs/components/Notification/variations/_layout/base_qkc3i4.css +0 -1
  89. package/es/components/Notification/variations/_layout/base_qkc3i4.css +0 -1
@@ -133,3 +133,47 @@ export function App() {
133
133
  );
134
134
  }
135
135
  ```
136
+
137
+ ## Управление шириной уведомления
138
+
139
+ Для управления шириной компонента доступны следующие свойства:
140
+
141
+ - `width` — устанавливает ширину компонента.
142
+ - `maxWidth` — устанавливает максимальную ширину компонента.
143
+
144
+ Оба свойства принимает любые действительные CSS значения для [width](https://developer.mozilla.org/en-US/docs/Web/CSS/width#syntax) и [maxWidth](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width#syntax)
145
+
146
+ ```jsx live
147
+ import React, { useCallback } from 'react';
148
+ import { IconBell } from '@salutejs/plasma-icons';
149
+ import { Button, ButtonGroup, addNotification, closeNotification, NotificationsProvider } from '@salutejs/{{ package }}';
150
+
151
+ export function App() {
152
+ const handleShow = useCallback(() => {
153
+ addNotification({
154
+ id: 'incoming-call',
155
+ title: 'Входящий вызов',
156
+ icon: <IconBell color="inherit" size="xs" />,
157
+ children: 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.',
158
+ view: 'positive',
159
+ textColor: 'black',
160
+ titleColor: 'blue',
161
+ width: 'fit-content',
162
+ maxWidth: '30rem'
163
+ }, 3000);
164
+ }, []);
165
+
166
+ const handleHide = useCallback(() => {
167
+ closeNotification('incoming-call');
168
+ }, []);
169
+
170
+ return (
171
+ <NotificationsProvider>
172
+ <ButtonGroup>
173
+ <Button text="Показать оповещение" onClick={handleShow} />
174
+ <Button text="Скрыть оповещение" onClick={handleHide} />
175
+ </ButtonGroup>
176
+ </NotificationsProvider>
177
+ );
178
+ }
179
+ ```
@@ -1,3 +1,3 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { classes, tokens } from "../../Notification.tokens";
3
- export var base = /*#__PURE__*/css(".", classes.wrapper, "{width:var(", tokens.width, ");padding:var(", tokens.padding, ");}.", classes.wrapper, ".", classes.horizontal, "{padding:var(", tokens.horizontalLayoutPadding, ");&.", classes.withoutCloseIcon, "{padding-right:var(", tokens.horizontalLayoutRightPaddingWithoutCloseIcon, ");}}.", classes.wrapper, ".", classes.horizontal, ".", classes.oneLine, "{padding:var(", tokens.paddingOneLineTextbox, ");};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvTm90aWZpY2F0aW9uL3ZhcmlhdGlvbnMvX2xheW91dC9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUl1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL05vdGlmaWNhdGlvbi92YXJpYXRpb25zL19sYXlvdXQvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY2xhc3NlcywgdG9rZW5zIH0gZnJvbSAnLi4vLi4vTm90aWZpY2F0aW9uLnRva2Vucyc7XG5cbmV4cG9ydCBjb25zdCBiYXNlID0gY3NzYFxuICAgIC4ke2NsYXNzZXMud3JhcHBlcn0ge1xuICAgICAgICB3aWR0aDogdmFyKCR7dG9rZW5zLndpZHRofSk7XG4gICAgICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG4gICAgfVxuXG4gICAgLiR7Y2xhc3Nlcy53cmFwcGVyfS4ke2NsYXNzZXMuaG9yaXpvbnRhbH0ge1xuICAgICAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMuaG9yaXpvbnRhbExheW91dFBhZGRpbmd9KTtcbiAgICAgICAgJi4ke2NsYXNzZXMud2l0aG91dENsb3NlSWNvbn0ge1xuICAgICAgICAgICAgcGFkZGluZy1yaWdodDogdmFyKCR7dG9rZW5zLmhvcml6b250YWxMYXlvdXRSaWdodFBhZGRpbmdXaXRob3V0Q2xvc2VJY29ufSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAuJHtjbGFzc2VzLndyYXBwZXJ9LiR7Y2xhc3Nlcy5ob3Jpem9udGFsfS4ke2NsYXNzZXMub25lTGluZX0ge1xuICAgICAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ09uZUxpbmVUZXh0Ym94fSk7XG4gICAgfVxuYDtcbiJdfQ== */"));
3
+ export var base = /*#__PURE__*/css(".", classes.wrapper, "{padding:var(", tokens.padding, ");}.", classes.wrapper, ".", classes.horizontal, "{padding:var(", tokens.horizontalLayoutPadding, ");&.", classes.withoutCloseIcon, "{padding-right:var(", tokens.horizontalLayoutRightPaddingWithoutCloseIcon, ");}}.", classes.wrapper, ".", classes.horizontal, ".", classes.oneLine, "{padding:var(", tokens.paddingOneLineTextbox, ");};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvTm90aWZpY2F0aW9uL3ZhcmlhdGlvbnMvX2xheW91dC9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUl1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL05vdGlmaWNhdGlvbi92YXJpYXRpb25zL19sYXlvdXQvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY2xhc3NlcywgdG9rZW5zIH0gZnJvbSAnLi4vLi4vTm90aWZpY2F0aW9uLnRva2Vucyc7XG5cbmV4cG9ydCBjb25zdCBiYXNlID0gY3NzYFxuICAgIC4ke2NsYXNzZXMud3JhcHBlcn0ge1xuICAgICAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ30pO1xuICAgIH1cblxuICAgIC4ke2NsYXNzZXMud3JhcHBlcn0uJHtjbGFzc2VzLmhvcml6b250YWx9IHtcbiAgICAgICAgcGFkZGluZzogdmFyKCR7dG9rZW5zLmhvcml6b250YWxMYXlvdXRQYWRkaW5nfSk7XG5cbiAgICAgICAgJi4ke2NsYXNzZXMud2l0aG91dENsb3NlSWNvbn0ge1xuICAgICAgICAgICAgcGFkZGluZy1yaWdodDogdmFyKCR7dG9rZW5zLmhvcml6b250YWxMYXlvdXRSaWdodFBhZGRpbmdXaXRob3V0Q2xvc2VJY29ufSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAuJHtjbGFzc2VzLndyYXBwZXJ9LiR7Y2xhc3Nlcy5ob3Jpem9udGFsfS4ke2NsYXNzZXMub25lTGluZX0ge1xuICAgICAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ09uZUxpbmVUZXh0Ym94fSk7XG4gICAgfVxuYDtcbiJdfQ== */"));
@@ -20,18 +20,13 @@ export var composeNumberFormat = function composeNumberFormat(InputComponent) {
20
20
  onChange(changeEvent, values);
21
21
  }
22
22
  };
23
- var InputComponentWithoutEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
24
- return /*#__PURE__*/React.createElement(InputComponent, _extends({
25
- ref: ref,
26
- _textEllipsisDisable: true
27
- }, props));
28
- });
29
23
  return /*#__PURE__*/React.createElement(NumericFormat, _extends({
30
24
  thousandSeparator: thousandSeparator,
31
25
  decimalScale: decimalScale,
32
26
  decimalSeparator: decimalSeparator,
33
- customInput: InputComponentWithoutEllipsis,
27
+ customInput: InputComponent,
34
28
  getInputRef: outerRef,
29
+ _textEllipsisDisable: true,
35
30
  onValueChange: handleChangeValue
36
31
  }, rest));
37
32
  });
@@ -37,7 +37,7 @@ export function App() {
37
37
  ```
38
38
 
39
39
  ### Размер поля
40
- Размер поля задаётся с помощью свойства `size`. Свойство принимает значения `"l" | "m" | "s" | "xs"`:
40
+ Размер поля задаётся с помощью свойства `size`:
41
41
 
42
42
  ```tsx live
43
43
  import React from 'react';
@@ -46,6 +46,11 @@ import { TextField } from '@salutejs/{{ package }}';
46
46
  export function App() {
47
47
  return (
48
48
  <div>
49
+ <TextField
50
+ placeholder="Размер"
51
+ size="xl"
52
+ defaultValue="XL64"
53
+ />
49
54
  <TextField
50
55
  placeholder="Размер"
51
56
  size="l"
@@ -56,6 +61,16 @@ export function App() {
56
61
  size="s"
57
62
  defaultValue="S40"
58
63
  />
64
+ <TextField
65
+ placeholder="Размер"
66
+ size="s"
67
+ defaultValue="S32"
68
+ />
69
+ <TextField
70
+ placeholder="Размер"
71
+ size="xs"
72
+ defaultValue="XS24"
73
+ />
59
74
  </div>
60
75
  );
61
76
  }
@@ -1,5 +1,5 @@
1
1
  export var titles = ['Выполнено', 'Внимание', 'Ошибка'];
2
- export var texts = ['SSH ключ успешно скопирован', 'Нельзя скопировать SSH ключ', 'Не удалось скопировать SSH ключ'];
2
+ export var texts = ['Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.', 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.', 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.'];
3
3
  export var size = ['xs', 'xxs'];
4
4
  export var iconPlacement = ['top', 'left'];
5
5
  export var notificationsPlacements = ['center', 'top', 'bottom', 'right', 'left', 'top-right', 'top-left', 'bottom-right', 'bottom-left'];
@@ -167,12 +167,14 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
167
167
  placement?: NotificationPlacement;
168
168
  };
169
169
 
170
- const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
170
+ const StoryLiveDemo = ({ timeout, placement, width, maxWidth, ...rest }: StoryLiveDemoProps) => {
171
171
  const count = useRef(0);
172
172
  const handleClick = useCallback(() => {
173
173
  addNotification(
174
174
  {
175
175
  icon: <IconDisclosureRight color="inherit" />,
176
+ width,
177
+ maxWidth,
176
178
  ...rest,
177
179
  ...getNotificationProps(count.current),
178
180
  },
@@ -210,6 +212,8 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
210
212
  role: 'alert',
211
213
  layout: 'vertical',
212
214
  placement: 'bottom-right',
215
+ width: '',
216
+ maxWidth: '',
213
217
  },
214
218
  render: (args) => <StoryLiveDemo {...args} />,
215
219
  };