@expressms/smartapp-ui 0.0.8 → 1.0.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 (84) hide show
  1. package/build/main/assets/icons/arrow-back.svg +1 -1
  2. package/build/main/assets/icons/cancel-cross.svg +1 -1
  3. package/build/main/assets/icons/check-mark.svg +1 -1
  4. package/build/main/assets/icons/close-stories.svg +4 -0
  5. package/build/main/assets/icons/close.svg +1 -1
  6. package/build/main/assets/icons/download.svg +2 -2
  7. package/build/main/assets/icons/error.svg +3 -3
  8. package/build/main/assets/icons/file.svg +1 -1
  9. package/build/main/assets/icons/logout.svg +2 -2
  10. package/build/main/assets/icons/order.svg +3 -3
  11. package/build/main/assets/icons/plus.svg +2 -2
  12. package/build/main/constants/constants.d.ts +13 -0
  13. package/build/main/constants/constants.js +14 -0
  14. package/build/main/constants/index.d.ts +1 -0
  15. package/build/main/constants/index.js +1 -0
  16. package/build/main/helpers/index.d.ts +1 -0
  17. package/build/main/helpers/index.js +3 -0
  18. package/build/main/styles/stories.module.scss +189 -105
  19. package/build/main/styles/styles.min.css +1 -85
  20. package/build/main//321/201omponents/ActionModal/ActionModal.d.ts +1 -1
  21. package/build/main//321/201omponents/ActionModal/ActionModal.js +10 -7
  22. package/build/main//321/201omponents/ActionModal/types.d.ts +2 -1
  23. package/build/main//321/201omponents/AttachedFile/AttachedFile.d.ts +2 -2
  24. package/build/main//321/201omponents/AttachedFile/AttachedFile.js +13 -8
  25. package/build/main//321/201omponents/AttachedFile/types.d.ts +4 -1
  26. package/build/main//321/201omponents/Avatar/Avatar.d.ts +2 -2
  27. package/build/main//321/201omponents/Avatar/Avatar.js +2 -2
  28. package/build/main//321/201omponents/Avatar/types.d.ts +2 -2
  29. package/build/main//321/201omponents/Button/Button.d.ts +1 -1
  30. package/build/main//321/201omponents/Button/Button.js +5 -4
  31. package/build/main//321/201omponents/Button/types.d.ts +10 -3
  32. package/build/main//321/201omponents/Button/types.js +11 -1
  33. package/build/main//321/201omponents/Calendar/Calendar.d.ts +2 -2
  34. package/build/main//321/201omponents/Calendar/Calendar.js +5 -7
  35. package/build/main//321/201omponents/Checkbox/Checkbox.d.ts +1 -1
  36. package/build/main//321/201omponents/Checkbox/Checkbox.js +7 -4
  37. package/build/main//321/201omponents/Checkbox/types.d.ts +2 -1
  38. package/build/main//321/201omponents/Chips/Chips.d.ts +1 -1
  39. package/build/main//321/201omponents/Chips/Chips.js +8 -6
  40. package/build/main//321/201omponents/Chips/types.d.ts +1 -0
  41. package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +1 -1
  42. package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +6 -5
  43. package/build/main//321/201omponents/CustomSelect/CustomSelect.d.ts +2 -2
  44. package/build/main//321/201omponents/CustomSelect/CustomSelect.js +4 -3
  45. package/build/main//321/201omponents/CustomSelect/types.d.ts +1 -1
  46. package/build/main//321/201omponents/CustomSelectPriority/CustomSelectPriority.d.ts +2 -2
  47. package/build/main//321/201omponents/CustomSelectPriority/CustomSelectPriority.js +16 -17
  48. package/build/main//321/201omponents/CustomSelectPriority/types.d.ts +1 -1
  49. package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.d.ts +2 -2
  50. package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js +16 -17
  51. package/build/main//321/201omponents/CustomSelectProfiles/types.d.ts +3 -2
  52. package/build/main//321/201omponents/DragAndDrop/DragAndDrop.d.ts +2 -2
  53. package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js +8 -7
  54. package/build/main//321/201omponents/DragAndDrop/types.d.ts +5 -2
  55. package/build/main//321/201omponents/Error/Error.d.ts +1 -1
  56. package/build/main//321/201omponents/Error/Error.js +6 -4
  57. package/build/main//321/201omponents/Error/types.d.ts +3 -0
  58. package/build/main//321/201omponents/Header/Header.d.ts +1 -1
  59. package/build/main//321/201omponents/Header/Header.js +8 -6
  60. package/build/main//321/201omponents/Input/Input.d.ts +2 -2
  61. package/build/main//321/201omponents/Input/Input.js +3 -3
  62. package/build/main//321/201omponents/Input/types.d.ts +1 -1
  63. package/build/main//321/201omponents/Loader/Loader.d.ts +1 -1
  64. package/build/main//321/201omponents/Loader/Loader.js +2 -2
  65. package/build/main//321/201omponents/Profile/Profile.d.ts +1 -1
  66. package/build/main//321/201omponents/Profile/Profile.js +11 -6
  67. package/build/main//321/201omponents/Profile/types.d.ts +3 -0
  68. package/build/main//321/201omponents/Stories/Stories.d.ts +4 -0
  69. package/build/main//321/201omponents/Stories/Stories.js +167 -0
  70. package/build/main//321/201omponents/Stories/index.d.ts +1 -0
  71. package/build/main//321/201omponents/Stories/index.js +1 -0
  72. package/build/main//321/201omponents/Stories/types.d.ts +34 -0
  73. package/build/main//321/201omponents/Stories/types.js +5 -0
  74. package/build/main//321/201omponents/Switcher/Switcher.d.ts +1 -1
  75. package/build/main//321/201omponents/Switcher/Switcher.js +4 -4
  76. package/build/main//321/201omponents/Switcher/types.d.ts +6 -4
  77. package/build/main//321/201omponents/Toggle/Toggle.d.ts +1 -1
  78. package/build/main//321/201omponents/Toggle/Toggle.js +4 -4
  79. package/build/main//321/201omponents/Toggle/types.d.ts +3 -3
  80. package/build/main//321/201omponents/index.d.ts +1 -0
  81. package/build/main//321/201omponents/index.js +1 -0
  82. package/package.json +15 -4
  83. package/build/main/assets/icons/calendar.svg +0 -4
  84. package/build/main/styles/aac6c83b0a358f7f0f6a.svg +0 -3
@@ -12,17 +12,18 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useState } from 'react';
14
14
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
15
- import { ReactComponent as Order } from '../../assets/icons/order.svg';
16
- import { ReactComponent as Close } from '../../assets/icons/close.svg';
15
+ import { ReactComponent as OrderIcon } from '../../assets/icons/order.svg';
16
+ import { ReactComponent as DeleteIcon } from '../../assets/icons/close.svg';
17
17
  import CheckBox from '../Checkbox';
18
+ import { getIconColor } from '../../helpers';
19
+ import { DEFAULT_BLUE_ICON_COLOR, DEFAULT_GRAY_ICON_COLOR } from '../../constants';
18
20
  import '../../styles/stories.module.scss';
19
- function DragAndDrop(_a) {
20
- var options = _a.options, onDragEndFunction = _a.onDragEndFunction, onChangeIsCompletedOption = _a.onChangeIsCompletedOption, onChangeOption = _a.onChangeOption, onClickDeleteOption = _a.onClickDeleteOption, placeholder = _a.placeholder, width = _a.width;
21
+ var DragAndDrop = function (_a) {
22
+ var placeholder = _a.placeholder, options = _a.options, onDragEndFunction = _a.onDragEndFunction, onChangeIsCompletedOption = _a.onChangeIsCompletedOption, onChangeOption = _a.onChangeOption, onClickDeleteOption = _a.onClickDeleteOption, width = _a.width, checkboxColor = _a.checkboxColor, orderColor = _a.orderColor, deleteColor = _a.deleteColor;
21
23
  var _b = useState(false), isOnDragStart = _b[0], setIsOnDragStart = _b[1];
22
24
  var isCheckbox = function (option) { return (option === null || option === void 0 ? void 0 : option.isCompleted) !== undefined; };
23
25
  var reorderOptions = function (options, startIndex, endIndex) {
24
26
  var result = Array.from(options);
25
- console.log(options);
26
27
  result.forEach(function (item, index) {
27
28
  if (startIndex > endIndex && index < startIndex && index >= endIndex) {
28
29
  item.orderId = item.orderId + 1;
@@ -49,6 +50,6 @@ function DragAndDrop(_a) {
49
50
  var newOptions = reorderOptions(options, result.source.index, result.destination.index);
50
51
  onDragEndFunction(newOptions);
51
52
  };
52
- return (_jsx("div", __assign({ style: { width: "".concat(width, "%") }, className: "smartapp-drag-drop" }, { children: _jsx(DragDropContext, __assign({ onDragStart: onDragStart, onDragEnd: onDragEnd }, { children: _jsx(Droppable, __assign({ droppableId: "droppable" }, { children: function (provided) { return (_jsx("div", __assign({}, provided.droppableProps, { ref: provided.innerRef, className: "smartapp-drag-drop__container" }, { children: options === null || options === void 0 ? void 0 : options.map(function (instanceOption, index) { return (_jsx(Draggable, __assign({ draggableId: instanceOption.id, index: index }, { children: function (provided) { return (_jsxs("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { className: "smartapp-drag-drop__container--instance" }, { children: [_jsxs("div", __assign({ className: "smartapp-drag-drop__container--instance__info" }, { children: [isCheckbox(instanceOption) && onChangeIsCompletedOption && (_jsx(CheckBox, { checked: instanceOption.isCompleted, id: instanceOption.id, onChange: function () { return onChangeIsCompletedOption(instanceOption); } })), onChangeOption ? (_jsx("input", { onChange: function (e) { return onChangeOption && onChangeOption(e, instanceOption); }, defaultValue: instanceOption.defaultValue, className: "smartapp-drag-drop__container--instance__info--name", type: "text", enterKeyHint: "enter", placeholder: placeholder }, instanceOption === null || instanceOption === void 0 ? void 0 : instanceOption.id)) : (_jsx("p", __assign({ className: "smartapp-drag-drop__container--instance__info--name" }, { children: instanceOption.defaultValue })))] })), _jsxs("div", __assign({ className: "smartapp-drag-drop__container--instance__icons" }, { children: [_jsx(Order, {}), onClickDeleteOption && _jsx(Close, { onClick: function () { return onClickDeleteOption(instanceOption); }, className: "cp" })] }))] }))); } }), instanceOption.id)); }) }))); } })) })) })));
53
- }
53
+ return (_jsx("div", __assign({ style: { width: "".concat(width, "%") }, className: "smartapp-drag-drop" }, { children: _jsx(DragDropContext, __assign({ onDragStart: onDragStart, onDragEnd: onDragEnd }, { children: _jsx(Droppable, __assign({ droppableId: "droppable" }, { children: function (provided) { return (_jsx("div", __assign({}, provided.droppableProps, { ref: provided.innerRef, className: "smartapp-drag-drop__container" }, { children: options === null || options === void 0 ? void 0 : options.map(function (instanceOption, index) { return (_jsx(Draggable, __assign({ draggableId: instanceOption.id, index: index }, { children: function (provided) { return (_jsxs("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { className: "smartapp-drag-drop__container--instance" }, { children: [_jsxs("div", __assign({ className: "smartapp-drag-drop__container--instance__info" }, { children: [isCheckbox(instanceOption) && onChangeIsCompletedOption && (_jsx(CheckBox, { id: instanceOption.id, checked: instanceOption.isCompleted, iconColor: checkboxColor, onChange: function () { return onChangeIsCompletedOption(instanceOption); } })), onChangeOption ? (_jsx("input", { onChange: function (e) { return onChangeOption && onChangeOption(e, instanceOption); }, defaultValue: instanceOption.defaultValue, className: "smartapp-drag-drop__container--instance__info--name", type: "text", enterKeyHint: "enter", placeholder: placeholder }, instanceOption === null || instanceOption === void 0 ? void 0 : instanceOption.id)) : (_jsx("p", __assign({ className: "smartapp-drag-drop__container--instance__info--name" }, { children: instanceOption.defaultValue })))] })), _jsxs("div", __assign({ className: "smartapp-drag-drop__container--instance__icons" }, { children: [_jsx(OrderIcon, { style: { color: getIconColor(orderColor, DEFAULT_GRAY_ICON_COLOR) } }), onClickDeleteOption && _jsx(DeleteIcon, { className: "cp", style: { color: getIconColor(deleteColor, DEFAULT_BLUE_ICON_COLOR) }, onClick: function () { return onClickDeleteOption(instanceOption); } })] }))] }))); } }), instanceOption.id)); }) }))); } })) })) })));
54
+ };
54
55
  export default DragAndDrop;
@@ -5,12 +5,15 @@ export type TDragAndDropOption = {
5
5
  isCompleted?: boolean;
6
6
  orderId: number;
7
7
  };
8
- export interface IDragAndDrop {
8
+ export interface IDragAndDropProps {
9
+ placeholder: string;
9
10
  options: TDragAndDropOption[];
10
11
  onDragEndFunction: (result: any) => void;
11
12
  onChangeIsCompletedOption?: (instanceOption: TDragAndDropOption) => void;
12
13
  onChangeOption?: (e: any, instanceOption: TDragAndDropOption) => void;
13
14
  onClickDeleteOption?: (instanceOption: TDragAndDropOption) => void;
14
- placeholder: string;
15
15
  width?: IntRange<1, 101>;
16
+ checkboxColor?: string;
17
+ orderColor?: string;
18
+ deleteColor?: string;
16
19
  }
@@ -1,4 +1,4 @@
1
1
  import { IErrorProps } from './types';
2
2
  import '../../styles/stories.module.scss';
3
- declare function Error({ title, text }: IErrorProps): import("react/jsx-runtime").JSX.Element;
3
+ declare const Error: ({ title, text, width, iconColor }: IErrorProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Error;
@@ -11,9 +11,11 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { ReactComponent as ErrorIcon } from '../../assets/icons/error.svg';
14
+ import { getIconColor } from '../../helpers';
15
+ import { DEFAULT_GRAY_ICON_COLOR } from '../../constants';
14
16
  import '../../styles/stories.module.scss';
15
- function Error(_a) {
16
- var _b = _a.title, title = _b === void 0 ? 'Ошибка' : _b, _c = _a.text, text = _c === void 0 ? 'Попробуйте еще раз' : _c;
17
- return (_jsxs("div", __assign({ className: "smartapp-error" }, { children: [_jsx("div", __assign({ className: "smartapp-error__icon" }, { children: _jsx(ErrorIcon, {}) })), _jsx("p", __assign({ className: "smartapp-error__title" }, { children: title })), _jsx("p", __assign({ className: "smartapp-error__text" }, { children: text }))] })));
18
- }
17
+ var Error = function (_a) {
18
+ var _b = _a.title, title = _b === void 0 ? 'Ошибка' : _b, _c = _a.text, text = _c === void 0 ? 'Попробуйте еще раз' : _c, _d = _a.width, width = _d === void 0 ? 100 : _d, iconColor = _a.iconColor;
19
+ return (_jsxs("div", __assign({ className: "smartapp-error", style: { width: "".concat(width, "%") } }, { children: [_jsx("div", __assign({ className: "smartapp-error__icon" }, { children: _jsx(ErrorIcon, { style: { color: getIconColor(iconColor, DEFAULT_GRAY_ICON_COLOR) } }) })), _jsx("p", __assign({ className: "smartapp-error__title" }, { children: title })), _jsx("p", __assign({ className: "smartapp-error__text" }, { children: text }))] })));
20
+ };
19
21
  export default Error;
@@ -1,4 +1,7 @@
1
+ import { IntRange } from '../types';
1
2
  export interface IErrorProps {
2
3
  title?: string;
3
4
  text?: string;
5
+ width?: IntRange<1, 101>;
6
+ iconColor?: string;
4
7
  }
@@ -1,4 +1,4 @@
1
1
  import { IHeaderProps } from './types';
2
2
  import '../../styles/stories.module.scss';
3
- declare function Header(props: IHeaderProps): import("react/jsx-runtime").JSX.Element;
3
+ declare const Header: ({ title, isBack, isRemove, onClickBack, onClickRemove, arrowColor, trashColor, }: IHeaderProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Header;
@@ -10,11 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { ReactComponent as ArrowBack } from '../../assets/icons/arrow-back.svg';
14
- import { ReactComponent as Trash } from '../../assets/icons/trash.svg';
13
+ import { ReactComponent as ArrowBackIcon } from '../../assets/icons/arrow-back.svg';
14
+ import { ReactComponent as TrashIcon } from '../../assets/icons/trash.svg';
15
+ import { getIconColor } from '../../helpers';
16
+ import { DEFAULT_BLACK_ICON_COLOR, DEFAULT_RED_ICON_COLOR } from '../../constants';
15
17
  import '../../styles/stories.module.scss';
16
- function Header(props) {
17
- var _a = props.title, title = _a === void 0 ? '' : _a, _b = props.isBack, isBack = _b === void 0 ? false : _b, _c = props.isRemove, isRemove = _c === void 0 ? false : _c, _d = props.onClickBack, onClickBack = _d === void 0 ? function () { return undefined; } : _d, _e = props.onClickRemove, onClickRemove = _e === void 0 ? function () { return undefined; } : _e, _f = props.arrowColor, arrowColor = _f === void 0 ? '#111111' : _f, _g = props.trashColor, trashColor = _g === void 0 ? '#EB5545' : _g;
18
- return (_jsxs("div", __assign({ className: "smartapp-header" }, { children: [_jsxs("div", __assign({ className: "smartapp-header__info" }, { children: [isBack && (_jsx(ArrowBack, { style: { color: arrowColor, stroke: arrowColor }, onClick: function () { return onClickBack(); }, className: "smartapp-header__info--arrow-back" })), title && _jsx("p", __assign({ className: "smartapp-header__info--title" }, { children: title }))] })), isRemove && (_jsx("div", __assign({ onClick: function () { return onClickRemove(); }, className: "smartapp-header__trash" }, { children: _jsx(Trash, { style: { color: trashColor } }) })))] })));
19
- }
18
+ var Header = function (_a) {
19
+ var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.isBack, isBack = _c === void 0 ? false : _c, _d = _a.isRemove, isRemove = _d === void 0 ? false : _d, _e = _a.onClickBack, onClickBack = _e === void 0 ? function () { return undefined; } : _e, _f = _a.onClickRemove, onClickRemove = _f === void 0 ? function () { return undefined; } : _f, arrowColor = _a.arrowColor, trashColor = _a.trashColor;
20
+ return (_jsxs("div", __assign({ className: "smartapp-header" }, { children: [_jsxs("div", __assign({ className: "smartapp-header__info" }, { children: [isBack && (_jsx(ArrowBackIcon, { style: { color: getIconColor(arrowColor, DEFAULT_BLACK_ICON_COLOR) }, onClick: onClickBack, className: "smartapp-header__info--arrow-back" })), title && _jsx("p", __assign({ className: "smartapp-header__info--title" }, { children: title }))] })), isRemove && (_jsx("div", __assign({ onClick: onClickRemove, className: "smartapp-header__trash" }, { children: _jsx(TrashIcon, { style: { color: getIconColor(trashColor, DEFAULT_RED_ICON_COLOR) } }) })))] })));
21
+ };
20
22
  export default Header;
@@ -1,4 +1,4 @@
1
- import { IInput } from './types';
1
+ import { IInputProps } from './types';
2
2
  import '../../styles/stories.module.scss';
3
- declare function Input({ title, onChange, placeholder, width, defaultValue }: IInput): import("react/jsx-runtime").JSX.Element;
3
+ declare const Input: ({ title, onChange, placeholder, width, defaultValue }: IInputProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Input;
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import '../../styles/stories.module.scss';
14
- function Input(_a) {
14
+ var Input = function (_a) {
15
15
  var title = _a.title, onChange = _a.onChange, placeholder = _a.placeholder, _b = _a.width, width = _b === void 0 ? 100 : _b, defaultValue = _a.defaultValue;
16
- return (_jsxs("div", __assign({ style: { width: "".concat(width, "%") }, className: "smartapp-input" }, { children: [title && _jsx("p", __assign({ className: "smartapp-input__title" }, { children: title })), _jsx("input", { defaultValue: defaultValue, placeholder: placeholder, onChange: function (e) { return onChange(e.target.value); }, className: "smartapp-input__field" })] })));
17
- }
16
+ return (_jsxs("div", __assign({ style: { width: "".concat(width, "%") }, className: "smartapp-input" }, { children: [title && _jsx("p", __assign({ className: "smartapp-input__title" }, { children: title })), _jsx("input", { className: "smartapp-input__field", defaultValue: defaultValue, placeholder: placeholder, onChange: function (e) { return onChange(e.target.value); } })] })));
17
+ };
18
18
  export default Input;
@@ -1,5 +1,5 @@
1
1
  import { IntRange } from '../types';
2
- export interface IInput {
2
+ export interface IInputProps {
3
3
  title?: string;
4
4
  onChange: (str: string) => void;
5
5
  placeholder?: string;
@@ -1,4 +1,4 @@
1
1
  import { ILoaderProps } from './types';
2
2
  import '../../styles/stories.module.scss';
3
- declare function Loader({ isLoader, title }: ILoaderProps): import("react/jsx-runtime").JSX.Element;
3
+ declare const Loader: ({ isLoader, title }: ILoaderProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Loader;
@@ -12,8 +12,8 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { ColorRing } from 'react-loader-spinner';
14
14
  import '../../styles/stories.module.scss';
15
- function Loader(_a) {
15
+ var Loader = function (_a) {
16
16
  var _b = _a.isLoader, isLoader = _b === void 0 ? false : _b, title = _a.title;
17
17
  return (_jsx("div", __assign({ className: "smartapp-loader-wrapper" }, { children: _jsxs("div", __assign({ className: "smartapp-loader" }, { children: [_jsx(ColorRing, { visible: isLoader, height: "32", width: "32", ariaLabel: "blocks-loading", wrapperStyle: {}, wrapperClass: "blocks-wrapper", colors: ['#4799E3', '#4799E3', '#4799E3', '#4799E3', '#4799E3'] }), title && _jsx("p", __assign({ className: "smartapp-loader__title" }, { children: title }))] })) })));
18
- }
18
+ };
19
19
  export default Loader;
@@ -1,4 +1,4 @@
1
1
  import { IProfileProps } from './types';
2
2
  import '../../styles/stories.module.scss';
3
- declare function Profile({ username, email, isShowProfile, onChange, onClickLogout, isMultipleProfile, onClickAddProfile, width, }: IProfileProps): import("react/jsx-runtime").JSX.Element;
3
+ declare const Profile: ({ username, email, isShowProfile, onChange, onClickLogout, isMultipleProfile, onClickAddProfile, width, logoutColor, addProfileColor, addProfileBackgroundColor, }: IProfileProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Profile;
@@ -11,12 +11,14 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useEffect, useRef } from 'react';
14
- import { ReactComponent as Logout } from '../../assets/icons/logout.svg';
15
- import { ReactComponent as AddProfile } from '../../assets/icons/plus.svg';
14
+ import { ReactComponent as LogoutIcon } from '../../assets/icons/logout.svg';
15
+ import { ReactComponent as AddProfileIcon } from '../../assets/icons/plus.svg';
16
+ import { getIconColor } from '../../helpers';
17
+ import { DEFAULT_BLUE_ICON_COLOR, DEFAULT_BLUE_LIGHT_ICON_COLOR } from '../../constants';
16
18
  import '../../styles/stories.module.scss';
17
- function Profile(_a) {
19
+ var Profile = function (_a) {
18
20
  var _b, _c, _d;
19
- var username = _a.username, email = _a.email, _e = _a.isShowProfile, isShowProfile = _e === void 0 ? false : _e, _f = _a.onChange, onChange = _f === void 0 ? function () { return undefined; } : _f, onClickLogout = _a.onClickLogout, isMultipleProfile = _a.isMultipleProfile, onClickAddProfile = _a.onClickAddProfile, _g = _a.width, width = _g === void 0 ? 100 : _g;
21
+ var username = _a.username, email = _a.email, _e = _a.isShowProfile, isShowProfile = _e === void 0 ? false : _e, _f = _a.onChange, onChange = _f === void 0 ? function () { return undefined; } : _f, onClickLogout = _a.onClickLogout, isMultipleProfile = _a.isMultipleProfile, onClickAddProfile = _a.onClickAddProfile, _g = _a.width, width = _g === void 0 ? 100 : _g, logoutColor = _a.logoutColor, addProfileColor = _a.addProfileColor, addProfileBackgroundColor = _a.addProfileBackgroundColor;
20
22
  var ref = useRef(null);
21
23
  var initials = (_d = (_c = (_b = username === null || username === void 0 ? void 0 : username.split(' ')) === null || _b === void 0 ? void 0 : _b.map(function (n) { return n[0]; })) === null || _c === void 0 ? void 0 : _c.join('.')) === null || _d === void 0 ? void 0 : _d.toUpperCase();
22
24
  useEffect(function () {
@@ -31,6 +33,9 @@ function Profile(_a) {
31
33
  document.removeEventListener('mousedown', checkIfClickedOutside);
32
34
  };
33
35
  }, [isShowProfile, onChange]);
34
- return (_jsxs("div", __assign({ ref: ref, className: "smartapp-profile__container" }, { children: [_jsx("div", __assign({ onClick: function () { return onChange(!isShowProfile); }, className: "smartapp-profile__avatar" }, { children: initials })), isShowProfile && (_jsxs("div", __assign({ style: { width: "".concat(width, "%") }, className: "smartapp-profile" }, { children: [_jsxs("div", __assign({ className: "smartapp-profile__current-profile" }, { children: [_jsxs("div", __assign({ className: "smartapp-profile__current-profile--info" }, { children: [_jsx("div", __assign({ className: "smartapp-profile__avatar" }, { children: initials })), _jsxs("div", __assign({ className: "smartapp-profile__current-profile--info__data" }, { children: [_jsx("p", __assign({ className: "smartapp-profile__current-profile--info__data--username" }, { children: username })), email && _jsx("p", __assign({ className: "smartapp-profile__current-profile--info__data--email" }, { children: email }))] }))] })), _jsx("div", __assign({ onClick: onClickLogout, className: "smartapp-profile__current-profile--logout" }, { children: _jsx(Logout, {}) }))] })), isMultipleProfile && (_jsxs("div", __assign({ onClick: onClickAddProfile, className: "smartapp-profile__add-profile" }, { children: [_jsx("div", __assign({ className: "smartapp-profile__add-profile--icon" }, { children: _jsx(AddProfile, {}) })), _jsx("p", __assign({ className: "smartapp-profile__add-profile--title" }, { children: "\u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u0430\u043A\u043A\u0430\u0443\u043D\u0442" }))] })))] })))] })));
35
- }
36
+ return (_jsxs("div", __assign({ ref: ref, className: "smartapp-profile__container" }, { children: [_jsx("div", __assign({ onClick: function () { return onChange(!isShowProfile); }, className: "smartapp-profile__avatar" }, { children: initials })), isShowProfile && (_jsxs("div", __assign({ style: { width: "".concat(width, "%") }, className: "smartapp-profile" }, { children: [_jsxs("div", __assign({ className: "smartapp-profile__current-profile" }, { children: [_jsxs("div", __assign({ className: "smartapp-profile__current-profile--info" }, { children: [_jsx("div", __assign({ className: "smartapp-profile__avatar" }, { children: initials })), _jsxs("div", __assign({ className: "smartapp-profile__current-profile--info__data" }, { children: [_jsx("p", __assign({ className: "smartapp-profile__current-profile--info__data--username" }, { children: username })), email && _jsx("p", __assign({ className: "smartapp-profile__current-profile--info__data--email" }, { children: email }))] }))] })), _jsx("div", __assign({ onClick: onClickLogout, className: "smartapp-profile__current-profile--logout" }, { children: _jsx(LogoutIcon, { style: { color: getIconColor(logoutColor, DEFAULT_BLUE_ICON_COLOR) } }) }))] })), isMultipleProfile && (_jsxs("div", __assign({ onClick: onClickAddProfile, className: "smartapp-profile__add-profile" }, { children: [_jsx("div", __assign({ className: "smartapp-profile__add-profile--icon" }, { children: _jsx(AddProfileIcon, { style: {
37
+ stroke: getIconColor(addProfileColor, DEFAULT_BLUE_ICON_COLOR),
38
+ color: getIconColor(addProfileBackgroundColor, DEFAULT_BLUE_LIGHT_ICON_COLOR)
39
+ } }) })), _jsx("p", __assign({ className: "smartapp-profile__add-profile--title" }, { children: "\u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u0430\u043A\u043A\u0430\u0443\u043D\u0442" }))] })))] })))] })));
40
+ };
36
41
  export default Profile;
@@ -8,4 +8,7 @@ export interface IProfileProps {
8
8
  isMultipleProfile?: boolean;
9
9
  onClickAddProfile?: () => void;
10
10
  width?: IntRange<1, 101>;
11
+ logoutColor?: string;
12
+ addProfileColor?: string;
13
+ addProfileBackgroundColor?: string;
11
14
  }
@@ -0,0 +1,4 @@
1
+ import { IStoriesProps } from './types';
2
+ import './stories.module.scss';
3
+ declare const StoriesComponent: ({ platform, fontFamily, groupStories, allGroupsStories, changeStoryToViewed, changeGroupStoriesToViewed, handleCloseGroupStories, }: IStoriesProps) => import("react/jsx-runtime").JSX.Element | null;
4
+ export default StoriesComponent;
@@ -0,0 +1,167 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useEffect, useState } from 'react';
14
+ import classNames from 'classnames';
15
+ import { isNull, sortBy } from 'lodash';
16
+ import Stories from 'react-insta-stories';
17
+ import Popup from 'reactjs-popup';
18
+ import { useSwipeable } from 'react-swipeable';
19
+ import { ReactComponent as CloseStoriesIcon } from '../../assets/icons/close-stories.svg';
20
+ import { STORY_BACKGROUND_TYPES } from './types';
21
+ import { BUTTON_PADDING, DEFAULT_FONT_FAMILY, MAX_PADDING_FOR_IMAGE, PLATFORM, } from '../../constants';
22
+ import './stories.module.scss';
23
+ var storyItemBaseStyles = {
24
+ height: '100%',
25
+ width: '100%',
26
+ };
27
+ var progressContainerStyles = function (platform) { return ({
28
+ gap: '12px',
29
+ width: '100%',
30
+ maxWidth: platform === PLATFORM.ios || platform === PLATFORM.android ? '139px' : '198px',
31
+ paddingTop: platform === PLATFORM.web ? '22px' : platform === PLATFORM.ios ? '21px' : '26px',
32
+ paddingLeft: '0',
33
+ paddingRight: '0',
34
+ paddingBottom: '0',
35
+ }); };
36
+ var progressWrapperStyles = {
37
+ height: '4px',
38
+ borderRadius: '51px',
39
+ background: 'rgba(255, 255, 255, 0.4)',
40
+ margin: 0,
41
+ };
42
+ var progressStyles = {
43
+ height: '4px',
44
+ borderRadius: '51px',
45
+ background: 'rgba(255, 255, 255, 1)',
46
+ };
47
+ var StoriesComponent = function (_a) {
48
+ var _b, _c;
49
+ var _d;
50
+ var _e = _a.platform, platform = _e === void 0 ? PLATFORM.web : _e, _f = _a.fontFamily, fontFamily = _f === void 0 ? DEFAULT_FONT_FAMILY : _f, groupStories = _a.groupStories, allGroupsStories = _a.allGroupsStories, changeStoryToViewed = _a.changeStoryToViewed, changeGroupStoriesToViewed = _a.changeGroupStoriesToViewed, handleCloseGroupStories = _a.handleCloseGroupStories;
51
+ var sortStoriesByOrder = function (stories) { return sortBy(stories, ['order']); };
52
+ var getActiveGroupStoriesIndex = function () { return allGroupsStories.findIndex(function (_a) {
53
+ var id = _a.id;
54
+ return id === (activeGroupStories === null || activeGroupStories === void 0 ? void 0 : activeGroupStories.id);
55
+ }); };
56
+ var _g = useState(groupStories), activeGroupStories = _g[0], setActiveGroupStories = _g[1];
57
+ var _h = useState(sortStoriesByOrder((groupStories === null || groupStories === void 0 ? void 0 : groupStories.stories) || [])), stories = _h[0], setStories = _h[1];
58
+ var _j = useState((_d = stories[0]) === null || _d === void 0 ? void 0 : _d.id), activeStoryId = _j[0], setActiveStoryId = _j[1];
59
+ var _k = useState(false), isAnimateToRight = _k[0], setIsAnimateToRight = _k[1];
60
+ var _l = useState(false), isAnimateToLeft = _l[0], setIsAnimateToLeft = _l[1];
61
+ var activeStory = stories.find(function (_a) {
62
+ var id = _a.id;
63
+ return id === activeStoryId;
64
+ });
65
+ var getStoryStyles = function (story) {
66
+ var _a, _b;
67
+ if (((_a = story === null || story === void 0 ? void 0 : story.backgroundSource) === null || _a === void 0 ? void 0 : _a.type) === STORY_BACKGROUND_TYPES.color) {
68
+ return __assign(__assign({}, storyItemBaseStyles), { background: story.backgroundSource.value });
69
+ }
70
+ return __assign(__assign({}, storyItemBaseStyles), { backgroundImage: "url(".concat((_b = story === null || story === void 0 ? void 0 : story.backgroundSource) === null || _b === void 0 ? void 0 : _b.value, ")"), backgroundSize: 'cover' });
71
+ };
72
+ var changeActiveGroupStories = function (groupStoriesItem) {
73
+ setActiveGroupStories(groupStoriesItem);
74
+ setStories(sortStoriesByOrder(groupStoriesItem.stories));
75
+ setTimeout(function () {
76
+ setIsAnimateToLeft(false);
77
+ setIsAnimateToRight(false);
78
+ }, 500);
79
+ };
80
+ var handlePrevious = function () {
81
+ var prevGroupStories = allGroupsStories[getActiveGroupStoriesIndex() - 1];
82
+ if (prevGroupStories) {
83
+ setIsAnimateToLeft(true);
84
+ changeActiveGroupStories(prevGroupStories);
85
+ }
86
+ else {
87
+ handleCloseGroupStories();
88
+ }
89
+ };
90
+ var handleNext = function () {
91
+ var nextGroupStories = allGroupsStories[getActiveGroupStoriesIndex() + 1];
92
+ if (nextGroupStories) {
93
+ setIsAnimateToRight(true);
94
+ changeActiveGroupStories(nextGroupStories);
95
+ }
96
+ else {
97
+ handleCloseGroupStories();
98
+ }
99
+ };
100
+ var onPrevious = function () { return activeStoryId === stories[0].id && handlePrevious(); };
101
+ var onStoryStart = function () {
102
+ var story = stories.find(function (_a) {
103
+ var id = _a.id;
104
+ return id === activeStoryId;
105
+ });
106
+ var isLastStory = stories.at(-1).id === story.id;
107
+ if (!story.viewed && changeStoryToViewed) {
108
+ changeStoryToViewed(story, activeGroupStories);
109
+ }
110
+ if (isLastStory && !activeGroupStories.viewed && changeGroupStoriesToViewed) {
111
+ changeGroupStoriesToViewed(activeGroupStories);
112
+ }
113
+ };
114
+ var getStories = function () { return stories.map(function (story) { return ({
115
+ content: function () {
116
+ // eslint-disable-next-line react-hooks/rules-of-hooks
117
+ useEffect(function () {
118
+ setActiveStoryId(story.id);
119
+ var storyWrapper = document.querySelector('.smartapp-stories');
120
+ var storyWrapperHeight = (storyWrapper === null || storyWrapper === void 0 ? void 0 : storyWrapper.getBoundingClientRect().height) || 0;
121
+ var storyContent = document.querySelector('.smartapp-stories__story');
122
+ var storyContentHeight = (storyContent === null || storyContent === void 0 ? void 0 : storyContent.getBoundingClientRect().height) || 0;
123
+ var buttonElement = document.querySelector('.smartapp-stories__story--button');
124
+ var buttonElementHeight = buttonElement ? (buttonElement.getBoundingClientRect().height + BUTTON_PADDING) : 0;
125
+ var padding = (storyWrapperHeight - storyContentHeight - buttonElementHeight) / 2;
126
+ var paddingTop = (padding > MAX_PADDING_FOR_IMAGE && story.image) ? "".concat(MAX_PADDING_FOR_IMAGE, "px") : "".concat(padding, "px");
127
+ storyContent === null || storyContent === void 0 ? void 0 : storyContent.style.setProperty('--padding', paddingTop);
128
+ }, []);
129
+ return (_jsx("div", __assign({ style: getStoryStyles(story) }, { children: _jsxs("div", __assign({ style: { fontFamily: "".concat(fontFamily, ", sans-serif") }, className: "smartapp-stories__story" }, { children: [story.image && _jsx("div", __assign({ className: "smartapp-stories__story--image" }, { children: _jsx("img", { src: story.image, alt: "" }) })), story.title && _jsx("div", __assign({ className: "smartapp-stories__story--title" }, { children: story.title })), story.body && _jsx("div", __assign({ className: "smartapp-stories__story--body" }, { children: story.body })), story.button && (_jsx("div", __assign({ className: classNames('smartapp-stories__story--button', "smartapp-stories__story--button__".concat(platform)), onClick: story.button.action }, { children: story.button.text })))] })) }), story.id));
130
+ },
131
+ }); }); };
132
+ var swipeableHandlers = useSwipeable({
133
+ trackMouse: true,
134
+ onSwipedLeft: function () { return handleNext(); },
135
+ onSwipedRight: function () { return handlePrevious(); },
136
+ });
137
+ useEffect(function () {
138
+ var _a;
139
+ var sortedStories = sortStoriesByOrder((groupStories === null || groupStories === void 0 ? void 0 : groupStories.stories) || []);
140
+ setActiveGroupStories(groupStories);
141
+ setStories(sortedStories);
142
+ setActiveStoryId((groupStories === null || groupStories === void 0 ? void 0 : groupStories.stories) ? (_a = sortedStories[0]) === null || _a === void 0 ? void 0 : _a.id : null);
143
+ }, [groupStories]);
144
+ useEffect(function () {
145
+ var _a, _b;
146
+ var popupElement = document.querySelector('.smartapp-stories-content');
147
+ var background = ((_a = activeStory === null || activeStory === void 0 ? void 0 : activeStory.backgroundSource) === null || _a === void 0 ? void 0 : _a.type) === STORY_BACKGROUND_TYPES.color
148
+ ? activeStory.backgroundSource.value
149
+ : "url(".concat((_b = activeStory === null || activeStory === void 0 ? void 0 : activeStory.backgroundSource) === null || _b === void 0 ? void 0 : _b.value, ")");
150
+ popupElement === null || popupElement === void 0 ? void 0 : popupElement.style.setProperty('--background', background);
151
+ }, [activeStory]);
152
+ if (isNull(activeGroupStories)) {
153
+ return null;
154
+ }
155
+ return (_jsxs(Popup, __assign({ className: "smartapp-stories", open: true }, { children: [_jsx("div", __assign({ className: classNames((_b = {
156
+ 'smartapp-stories': true
157
+ },
158
+ _b["smartapp-stories__".concat(platform)] = true,
159
+ _b['smartapp-stories__animate-right'] = isAnimateToRight,
160
+ _b['smartapp-stories__animate-left'] = isAnimateToLeft,
161
+ _b)) }, swipeableHandlers, { children: _jsx(Stories, { defaultInterval: 6000, width: "100%", height: "100%", stories: getStories(), onStoryStart: onStoryStart, onPrevious: onPrevious, onAllStoriesEnd: handleNext, progressContainerStyles: progressContainerStyles(platform), progressWrapperStyles: progressWrapperStyles, progressStyles: progressStyles }, activeGroupStories.id) })), _jsx(CloseStoriesIcon, { className: classNames((_c = {
162
+ 'smartapp-stories__icon': true
163
+ },
164
+ _c["smartapp-stories__icon--".concat(platform)] = true,
165
+ _c)), onClick: handleCloseGroupStories })] })));
166
+ };
167
+ export default StoriesComponent;
@@ -0,0 +1 @@
1
+ export { default } from './Stories';
@@ -0,0 +1 @@
1
+ export { default } from './Stories';
@@ -0,0 +1,34 @@
1
+ export declare enum STORY_BACKGROUND_TYPES {
2
+ color = "color",
3
+ image = "image"
4
+ }
5
+ export type TStoryItem = {
6
+ id: number;
7
+ order: number;
8
+ viewed?: boolean;
9
+ title: string | null;
10
+ body: string | null;
11
+ backgroundSource: {
12
+ type: STORY_BACKGROUND_TYPES;
13
+ value: string;
14
+ };
15
+ button: {
16
+ text: string;
17
+ action: () => void;
18
+ } | null;
19
+ image: string | null;
20
+ };
21
+ export type TGroupStories = {
22
+ id: number;
23
+ viewed: boolean;
24
+ stories: TStoryItem[];
25
+ };
26
+ export interface IStoriesProps {
27
+ platform?: string;
28
+ fontFamily?: string;
29
+ groupStories: TGroupStories | null;
30
+ allGroupsStories: TGroupStories[];
31
+ changeStoryToViewed?: (story: TStoryItem, groupStories: TGroupStories) => void;
32
+ changeGroupStoriesToViewed?: (groupStories: TGroupStories) => void;
33
+ handleCloseGroupStories: () => void;
34
+ }
@@ -0,0 +1,5 @@
1
+ export var STORY_BACKGROUND_TYPES;
2
+ (function (STORY_BACKGROUND_TYPES) {
3
+ STORY_BACKGROUND_TYPES["color"] = "color";
4
+ STORY_BACKGROUND_TYPES["image"] = "image";
5
+ })(STORY_BACKGROUND_TYPES || (STORY_BACKGROUND_TYPES = {}));
@@ -1,4 +1,4 @@
1
1
  import { ISwitcherProps } from './types';
2
2
  import '../../styles/stories.module.scss';
3
- declare function Switcher({ pages }: ISwitcherProps): import("react/jsx-runtime").JSX.Element;
3
+ declare const Switcher: ({ pages }: ISwitcherProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Switcher;
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import Slider from 'react-slick';
14
14
  import { NavLink } from 'react-router-dom';
15
15
  import '../../styles/stories.module.scss';
16
- function Switcher(_a) {
16
+ var Switcher = function (_a) {
17
17
  var pages = _a.pages;
18
18
  var sliderSettings = {
19
19
  variableWidth: true,
@@ -25,9 +25,9 @@ function Switcher(_a) {
25
25
  infinite: false,
26
26
  speed: 300,
27
27
  };
28
- return (_jsx("div", __assign({ className: "smartapp-switcher" }, { children: _jsx(Slider, __assign({}, sliderSettings, { children: pages === null || pages === void 0 ? void 0 : pages.map(function (page) { return (_jsx(NavLink, __assign({ className: function (_a) {
28
+ return (_jsx("div", __assign({ className: "smartapp-switcher" }, { children: _jsx(Slider, __assign({}, sliderSettings, { children: pages.map(function (page) { return (_jsx(NavLink, __assign({ className: function (_a) {
29
29
  var isActive = _a.isActive;
30
30
  return isActive ? ' smartapp-switcher__instance smartapp-switcher__instance--active' : 'smartapp-switcher__instance';
31
- }, to: page === null || page === void 0 ? void 0 : page.route }, { children: page.title }), page === null || page === void 0 ? void 0 : page.route)); }) })) })));
32
- }
31
+ }, to: page.route }, { children: page.title }), page.route)); }) })) })));
32
+ };
33
33
  export default Switcher;
@@ -1,6 +1,8 @@
1
+ type PageType = {
2
+ route: string;
3
+ title: string;
4
+ };
1
5
  export interface ISwitcherProps {
2
- pages: {
3
- route: string;
4
- title: string;
5
- }[];
6
+ pages: PageType[];
6
7
  }
8
+ export {};
@@ -1,4 +1,4 @@
1
1
  import { IToggleProps } from './types';
2
2
  import '../../styles/stories.module.scss';
3
- declare function Toggle({ id, onClick, checked }: IToggleProps): import("react/jsx-runtime").JSX.Element;
3
+ declare const Toggle: ({ id, checked, onClick }: IToggleProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Toggle;
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import '../../styles/stories.module.scss';
14
- function Toggle(_a) {
15
- var _b = _a.id, id = _b === void 0 ? 'toggle' : _b, _c = _a.onClick, onClick = _c === void 0 ? function () { return undefined; } : _c, _d = _a.checked, checked = _d === void 0 ? false : _d;
16
- return (_jsx("div", __assign({ className: "smartapp-toggle-wrapper" }, { children: _jsxs("label", __assign({ htmlFor: "smartapp-toggle-".concat(id), onClick: function () { return onClick(); }, className: "smartapp-toggle" }, { children: [_jsx("input", { type: "checkbox", id: "smartapp-toggle-".concat(id), checked: checked, disabled: true }), _jsx("span", { className: "smartapp-slider round" })] })) })));
17
- }
14
+ var Toggle = function (_a) {
15
+ var _b = _a.id, id = _b === void 0 ? 'toggle' : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { return undefined; } : _d;
16
+ return (_jsx("div", __assign({ className: "smartapp-toggle-wrapper" }, { children: _jsxs("label", __assign({ className: "smartapp-toggle", htmlFor: "smartapp-toggle-".concat(id), onClick: function () { return onClick(); } }, { children: [_jsx("input", { type: "checkbox", id: "smartapp-toggle-".concat(id), checked: checked, disabled: true }), _jsx("span", { className: "smartapp-slider round" })] })) })));
17
+ };
18
18
  export default Toggle;
@@ -1,5 +1,5 @@
1
1
  export interface IToggleProps {
2
- id: string;
3
- onClick: () => void;
4
- checked: boolean;
2
+ id?: string;
3
+ checked?: boolean;
4
+ onClick?: () => void;
5
5
  }
@@ -17,3 +17,4 @@ export { default as Loader } from './Loader';
17
17
  export { default as Profile } from './Profile';
18
18
  export { default as Switcher } from './Switcher';
19
19
  export { default as Toggle } from './Toggle';
20
+ export { default as Stories } from './Stories';
@@ -17,3 +17,4 @@ export { default as Loader } from './Loader';
17
17
  export { default as Profile } from './Profile';
18
18
  export { default as Switcher } from './Switcher';
19
19
  export { default as Toggle } from './Toggle';
20
+ export { default as Stories } from './Stories';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expressms/smartapp-ui",
3
- "version": "0.0.8",
3
+ "version": "1.0.0",
4
4
  "description": "SmartApp UI library",
5
5
  "license": "MIT",
6
6
  "main": "build/main/index.js",
@@ -15,6 +15,7 @@
15
15
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
16
16
  "@storybook/addon-essentials": "^6.5.15",
17
17
  "@storybook/addon-links": "^6.5.15",
18
+ "@storybook/addon-viewport": "^6.5.15",
18
19
  "@storybook/preset-scss": "^1.0.3",
19
20
  "@storybook/react": "^6.5.15",
20
21
  "@svgr/webpack": "5.5",
@@ -28,6 +29,9 @@
28
29
  "@types/react-datepicker": "^4.8.0",
29
30
  "@types/react-dom": "^18.0.10",
30
31
  "@types/react-slick": "^0.23.10",
32
+ "@typescript-eslint/eslint-plugin": "^6.6.0",
33
+ "@typescript-eslint/parser": "^6.6.0",
34
+ "animate.css": "^4.1.1",
31
35
  "babel-jest": "^18.0.0",
32
36
  "babel-loader": "8.2.3",
33
37
  "babel-plugin-named-asset-import": "^0.3.8",
@@ -45,6 +49,11 @@
45
49
  "enhanced-resolve": "^5.12.0",
46
50
  "eslint": "^8.3.0",
47
51
  "eslint-config-react-app": "^6.0.0",
52
+ "eslint-plugin-flowtype": "^8.0.3",
53
+ "eslint-plugin-import": "^2.28.1",
54
+ "eslint-plugin-jsx-a11y": "^6.7.1",
55
+ "eslint-plugin-react": "^7.33.2",
56
+ "eslint-plugin-react-hooks": "^4.6.0",
48
57
  "eslint-webpack-plugin": "^3.1.1",
49
58
  "file-loader": "^6.2.0",
50
59
  "fs-extra": "^10.0.0",
@@ -66,15 +75,17 @@
66
75
  "react-datepicker": "^4.8.0",
67
76
  "react-dev-utils": "^12.0.1",
68
77
  "react-dom": "^18.2.0",
78
+ "react-insta-stories": "^2.6.2",
69
79
  "react-loader-spinner": "^5.3.4",
70
80
  "react-refresh": "^0.11.0",
71
81
  "react-router-dom": "^6.7.0",
72
82
  "react-select": "^5.7.2",
73
83
  "react-slick": "^0.29.0",
84
+ "react-swipeable": "^7.0.1",
74
85
  "reactjs-popup": "^2.0.5",
75
86
  "resolve": "^1.20.0",
76
87
  "resolve-url-loader": "2.3.1",
77
- "sass": "^1.57.1",
88
+ "sass": "^1.66.1",
78
89
  "sass-loader": "^12.3.0",
79
90
  "semver": "^7.3.5",
80
91
  "source-map-loader": "^3.0.0",
@@ -97,7 +108,7 @@
97
108
  "scripts": {
98
109
  "start": "node scripts/start.js",
99
110
  "storybook": "rm -rf node_modules/.cache/storybook && start-storybook -p 6006",
100
- "build-storybook": "build-storybook -s public",
111
+ "build-storybook": "build-storybook -o storybook-build",
101
112
  "copy-scss-files": "copyfiles -u 1 src/styles/*.module.scss build/main",
102
113
  "copy-svg-files": "copyfiles -u 1 src/assets/icons/*.svg build/main",
103
114
  "build": "tsc -p tsconfig.json && webpack && npm run copy-svg-files && npm run copy-scss-files",
@@ -151,7 +162,7 @@
151
162
  "babel-plugin-named-exports-order": "^0.0.2",
152
163
  "css-loader": "^6.7.3",
153
164
  "prop-types": "^15.8.1",
154
- "style-loader": "2.0.0",
165
+ "style-loader": "^3.3.3",
155
166
  "webpack": "^5.75.0",
156
167
  "webpack-cli": "^5.0.1"
157
168
  },