@selfcommunity/react-ui 0.7.50-events.71 → 0.7.50-events.77

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 (123) hide show
  1. package/lib/cjs/assets/onBoarding/Android.d.ts +1 -0
  2. package/lib/cjs/assets/onBoarding/Android.js +7 -0
  3. package/lib/cjs/assets/onBoarding/CategoryA.d.ts +1 -0
  4. package/lib/cjs/assets/onBoarding/CategoryA.js +7 -0
  5. package/lib/cjs/assets/onBoarding/CategoryB.d.ts +1 -0
  6. package/lib/cjs/assets/onBoarding/CategoryB.js +7 -0
  7. package/lib/cjs/assets/onBoarding/Header.d.ts +1 -0
  8. package/lib/cjs/assets/onBoarding/Header.js +7 -0
  9. package/lib/cjs/assets/onBoarding/Ios.d.ts +1 -0
  10. package/lib/cjs/assets/onBoarding/Ios.js +7 -0
  11. package/lib/cjs/components/EventInviteButton/EventInviteButton.d.ts +1 -1
  12. package/lib/cjs/components/EventInviteButton/EventInviteButton.js +17 -28
  13. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +11 -4
  14. package/lib/cjs/components/EventMembersWidget/TabContentComponent.d.ts +1 -0
  15. package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +15 -2
  16. package/lib/cjs/components/Feed/Feed.d.ts +1 -0
  17. package/lib/cjs/components/Feed/Feed.js +3 -0
  18. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.d.ts +19 -0
  19. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +209 -0
  20. package/lib/cjs/components/OnBoardingWidget/Skeleton.d.ts +1 -0
  21. package/lib/cjs/components/OnBoardingWidget/Skeleton.js +24 -0
  22. package/lib/cjs/components/OnBoardingWidget/Steps/App/App.d.ts +18 -0
  23. package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +74 -0
  24. package/lib/cjs/components/OnBoardingWidget/Steps/App/index.d.ts +3 -0
  25. package/lib/cjs/components/OnBoardingWidget/Steps/App/index.js +5 -0
  26. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.d.ts +13 -0
  27. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +226 -0
  28. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/index.d.ts +3 -0
  29. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/index.js +5 -0
  30. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/reducer.d.ts +15 -0
  31. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/reducer.js +42 -0
  32. package/lib/cjs/components/OnBoardingWidget/Steps/Category/Category.d.ts +18 -0
  33. package/lib/cjs/components/OnBoardingWidget/Steps/Category/Category.js +81 -0
  34. package/lib/cjs/components/OnBoardingWidget/Steps/Category/index.d.ts +3 -0
  35. package/lib/cjs/components/OnBoardingWidget/Steps/Category/index.js +5 -0
  36. package/lib/cjs/components/OnBoardingWidget/Steps/Content/Content.d.ts +18 -0
  37. package/lib/cjs/components/OnBoardingWidget/Steps/Content/Content.js +51 -0
  38. package/lib/cjs/components/OnBoardingWidget/Steps/Content/index.d.ts +3 -0
  39. package/lib/cjs/components/OnBoardingWidget/Steps/Content/index.js +5 -0
  40. package/lib/cjs/components/OnBoardingWidget/Steps/Invite/Invite.d.ts +13 -0
  41. package/lib/cjs/components/OnBoardingWidget/Steps/Invite/Invite.js +54 -0
  42. package/lib/cjs/components/OnBoardingWidget/Steps/Invite/index.d.ts +3 -0
  43. package/lib/cjs/components/OnBoardingWidget/Steps/Invite/index.js +5 -0
  44. package/lib/cjs/components/OnBoardingWidget/Steps/Profile/Profile.d.ts +25 -0
  45. package/lib/cjs/components/OnBoardingWidget/Steps/Profile/Profile.js +94 -0
  46. package/lib/cjs/components/OnBoardingWidget/Steps/Profile/index.d.ts +3 -0
  47. package/lib/cjs/components/OnBoardingWidget/Steps/Profile/index.js +5 -0
  48. package/lib/cjs/components/OnBoardingWidget/constants.d.ts +1 -0
  49. package/lib/cjs/components/OnBoardingWidget/constants.js +4 -0
  50. package/lib/cjs/components/OnBoardingWidget/index.d.ts +4 -0
  51. package/lib/cjs/components/OnBoardingWidget/index.js +8 -0
  52. package/lib/cjs/components/PlatformWidget/constants.d.ts +4 -0
  53. package/lib/cjs/components/PlatformWidget/constants.js +5 -1
  54. package/lib/cjs/index.d.ts +3 -1
  55. package/lib/cjs/index.js +8 -3
  56. package/lib/cjs/shared/ProgressBar/index.d.ts +23 -0
  57. package/lib/cjs/shared/ProgressBar/index.js +25 -0
  58. package/lib/cjs/utils/onBoarding.d.ts +2 -0
  59. package/lib/cjs/utils/onBoarding.js +20 -0
  60. package/lib/esm/assets/onBoarding/Android.d.ts +1 -0
  61. package/lib/esm/assets/onBoarding/Android.js +4 -0
  62. package/lib/esm/assets/onBoarding/CategoryA.d.ts +1 -0
  63. package/lib/esm/assets/onBoarding/CategoryA.js +4 -0
  64. package/lib/esm/assets/onBoarding/CategoryB.d.ts +1 -0
  65. package/lib/esm/assets/onBoarding/CategoryB.js +4 -0
  66. package/lib/esm/assets/onBoarding/Header.d.ts +1 -0
  67. package/lib/esm/assets/onBoarding/Header.js +4 -0
  68. package/lib/esm/assets/onBoarding/Ios.d.ts +1 -0
  69. package/lib/esm/assets/onBoarding/Ios.js +4 -0
  70. package/lib/esm/components/EventInviteButton/EventInviteButton.d.ts +1 -1
  71. package/lib/esm/components/EventInviteButton/EventInviteButton.js +17 -28
  72. package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +11 -4
  73. package/lib/esm/components/EventMembersWidget/TabContentComponent.d.ts +1 -0
  74. package/lib/esm/components/EventMembersWidget/TabContentComponent.js +15 -2
  75. package/lib/esm/components/Feed/Feed.d.ts +1 -0
  76. package/lib/esm/components/Feed/Feed.js +3 -0
  77. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.d.ts +19 -0
  78. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +207 -0
  79. package/lib/esm/components/OnBoardingWidget/Skeleton.d.ts +1 -0
  80. package/lib/esm/components/OnBoardingWidget/Skeleton.js +20 -0
  81. package/lib/esm/components/OnBoardingWidget/Steps/App/App.d.ts +18 -0
  82. package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +70 -0
  83. package/lib/esm/components/OnBoardingWidget/Steps/App/index.d.ts +3 -0
  84. package/lib/esm/components/OnBoardingWidget/Steps/App/index.js +2 -0
  85. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.d.ts +13 -0
  86. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +223 -0
  87. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/index.d.ts +3 -0
  88. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/index.js +2 -0
  89. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/reducer.d.ts +15 -0
  90. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/reducer.js +37 -0
  91. package/lib/esm/components/OnBoardingWidget/Steps/Category/Category.d.ts +18 -0
  92. package/lib/esm/components/OnBoardingWidget/Steps/Category/Category.js +77 -0
  93. package/lib/esm/components/OnBoardingWidget/Steps/Category/index.d.ts +3 -0
  94. package/lib/esm/components/OnBoardingWidget/Steps/Category/index.js +2 -0
  95. package/lib/esm/components/OnBoardingWidget/Steps/Content/Content.d.ts +18 -0
  96. package/lib/esm/components/OnBoardingWidget/Steps/Content/Content.js +47 -0
  97. package/lib/esm/components/OnBoardingWidget/Steps/Content/index.d.ts +3 -0
  98. package/lib/esm/components/OnBoardingWidget/Steps/Content/index.js +2 -0
  99. package/lib/esm/components/OnBoardingWidget/Steps/Invite/Invite.d.ts +13 -0
  100. package/lib/esm/components/OnBoardingWidget/Steps/Invite/Invite.js +50 -0
  101. package/lib/esm/components/OnBoardingWidget/Steps/Invite/index.d.ts +3 -0
  102. package/lib/esm/components/OnBoardingWidget/Steps/Invite/index.js +2 -0
  103. package/lib/esm/components/OnBoardingWidget/Steps/Profile/Profile.d.ts +25 -0
  104. package/lib/esm/components/OnBoardingWidget/Steps/Profile/Profile.js +91 -0
  105. package/lib/esm/components/OnBoardingWidget/Steps/Profile/index.d.ts +3 -0
  106. package/lib/esm/components/OnBoardingWidget/Steps/Profile/index.js +2 -0
  107. package/lib/esm/components/OnBoardingWidget/constants.d.ts +1 -0
  108. package/lib/esm/components/OnBoardingWidget/constants.js +1 -0
  109. package/lib/esm/components/OnBoardingWidget/index.d.ts +4 -0
  110. package/lib/esm/components/OnBoardingWidget/index.js +4 -0
  111. package/lib/esm/components/PlatformWidget/constants.d.ts +4 -0
  112. package/lib/esm/components/PlatformWidget/constants.js +4 -0
  113. package/lib/esm/index.d.ts +3 -1
  114. package/lib/esm/index.js +5 -3
  115. package/lib/esm/shared/ProgressBar/index.d.ts +23 -0
  116. package/lib/esm/shared/ProgressBar/index.js +22 -0
  117. package/lib/esm/utils/onBoarding.d.ts +2 -0
  118. package/lib/esm/utils/onBoarding.js +15 -0
  119. package/lib/umd/920.js +2 -0
  120. package/lib/umd/react-ui.js +1 -1
  121. package/package.json +181 -180
  122. package/lib/umd/224.js +0 -2
  123. /package/lib/umd/{224.js.LICENSE.txt → 920.js.LICENSE.txt} +0 -0
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = tslib_1.__importStar(require("react"));
6
+ const styles_1 = require("@mui/material/styles");
7
+ const Box_1 = tslib_1.__importDefault(require("@mui/material/Box"));
8
+ const system_1 = require("@mui/system");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const react_core_1 = require("@selfcommunity/react-core");
11
+ const constants_1 = require("../../constants");
12
+ const material_1 = require("@mui/material");
13
+ const mui_color_input_1 = require("mui-color-input");
14
+ const reducer_1 = require("./reducer");
15
+ const reducer_2 = require("./reducer");
16
+ const api_services_1 = require("@selfcommunity/api-services");
17
+ const onBoarding_1 = require("../../../../utils/onBoarding");
18
+ const react_intl_1 = require("react-intl");
19
+ const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
20
+ const Errors_1 = require("../../../../constants/Errors");
21
+ const utils_1 = require("@selfcommunity/utils");
22
+ const lab_1 = require("@mui/lab");
23
+ const ScrollContainer_1 = tslib_1.__importDefault(require("../../../../shared/ScrollContainer"));
24
+ const messages = (0, react_intl_1.defineMessages)({
25
+ titleField: {
26
+ id: 'ui.onBoardingWidget.step.appearance.titleSlogan.field.title',
27
+ defaultMessage: 'ui.onBoardingWidget.step.appearance.titleSlogan.field.title'
28
+ },
29
+ sloganField: {
30
+ id: 'ui.onBoardingWidget.step.appearance.titleSlogan.field.slogan',
31
+ defaultMessage: 'ui.onBoardingWidget.step.appearance.titleSlogan.field.slogan'
32
+ }
33
+ });
34
+ const classes = {
35
+ root: `${constants_1.PREFIX}-appearance-root`,
36
+ title: `${constants_1.PREFIX}-appearance-title`,
37
+ summary: `${constants_1.PREFIX}-appearance-summary`,
38
+ color: `${constants_1.PREFIX}-appearance-color`,
39
+ logoContainer: `${constants_1.PREFIX}-appearance-logo-container`,
40
+ logo: `${constants_1.PREFIX}-appearance-logo`,
41
+ uploadButton: `${constants_1.PREFIX}-appearance-upload-button`,
42
+ drawerRoot: `${constants_1.PREFIX}-appearance-drawer-root`,
43
+ drawerHeader: `${constants_1.PREFIX}-appearance-drawer-header`,
44
+ drawerHeaderAction: `${constants_1.PREFIX}-appearance-drawer-header-action`,
45
+ drawerContent: `${constants_1.PREFIX}-appearance-drawer-content`
46
+ };
47
+ const Root = (0, styles_1.styled)(Box_1.default, {
48
+ name: constants_1.PREFIX,
49
+ slot: 'AppearanceRoot'
50
+ })(() => ({}));
51
+ const DrawerRoot = (0, styles_1.styled)(material_1.Drawer, {
52
+ name: constants_1.PREFIX,
53
+ slot: 'AppearanceDrawerRoot',
54
+ overridesResolver: (props, styles) => styles.appearanceDrawerRoot
55
+ })(({ theme }) => ({}));
56
+ function Appearance(inProps) {
57
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
58
+ // PROPS
59
+ const props = (0, system_1.useThemeProps)({
60
+ props: inProps,
61
+ name: constants_1.PREFIX
62
+ });
63
+ const { className, onCompleteAction } = props;
64
+ // STATE
65
+ const [state, dispatch] = (0, react_1.useReducer)(reducer_2.reducer, (0, reducer_2.getInitialState)(null));
66
+ let fileInput = (0, react_1.useRef)(null);
67
+ const [loadingLogo, setLoadingLogo] = (0, react_1.useState)(false);
68
+ const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
69
+ const [tab, setTab] = (0, react_1.useState)(0);
70
+ const [updating, setUpdating] = (0, react_1.useState)(false);
71
+ // INTL
72
+ const intl = (0, react_intl_1.useIntl)();
73
+ // HANDLERS
74
+ const handleTabChange = (event, newValue) => {
75
+ setTab(newValue);
76
+ };
77
+ const handleOpen = (0, react_1.useCallback)((event) => {
78
+ setAnchorEl(event.currentTarget);
79
+ }, []);
80
+ const handleClose = (0, react_1.useCallback)(() => {
81
+ setAnchorEl(null);
82
+ }, []);
83
+ const fetchColors = () => {
84
+ dispatch({ type: reducer_1.actionTypes.LOADING, payload: { loading: true } });
85
+ api_services_1.PreferenceService.searchPreferences('', '', `${react_core_1.Preferences.COLORS_COLORBACK},${react_core_1.Preferences.COLORS_COLORPRIMARY},${react_core_1.Preferences.COLORS_COLORSECONDARY},${react_core_1.Preferences.COLORS_NAVBARBACK},${react_core_1.Preferences.COLORS_COLORFONT},${react_core_1.Preferences.COLORS_COLORFONTSECONDARY}`)
86
+ .then((res) => {
87
+ dispatch({
88
+ type: reducer_1.actionTypes.SET_COLORS,
89
+ payload: {
90
+ loading: false,
91
+ colors: res.results
92
+ }
93
+ });
94
+ })
95
+ .catch((e) => {
96
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
97
+ dispatch({ type: reducer_1.actionTypes.SET_COLORS, payload: { loading: false, colors: [] } });
98
+ });
99
+ };
100
+ const fetchLogos = () => {
101
+ dispatch({ type: reducer_1.actionTypes.LOADING, payload: { loading: true } });
102
+ api_services_1.PreferenceService.searchPreferences('', '', `${react_core_1.Preferences.LOGO_NAVBAR_LOGO},${react_core_1.Preferences.LOGO_NAVBAR_LOGO_MOBILE}`)
103
+ .then((res) => {
104
+ dispatch({
105
+ type: reducer_1.actionTypes.SET_LOGOS,
106
+ payload: {
107
+ loading: false,
108
+ logos: res.results
109
+ }
110
+ });
111
+ })
112
+ .catch((e) => {
113
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
114
+ dispatch({ type: reducer_1.actionTypes.SET_LOGOS, payload: { loading: false, logos: [] } });
115
+ });
116
+ };
117
+ const fetchSlogans = () => {
118
+ dispatch({ type: reducer_1.actionTypes.LOADING, payload: { loading: true } });
119
+ api_services_1.PreferenceService.searchPreferences('', '', `${react_core_1.Preferences.TEXT_APPLICATION_SLOGAN1},${react_core_1.Preferences.TEXT_APPLICATION_SLOGAN2}`)
120
+ .then((res) => {
121
+ dispatch({
122
+ type: reducer_1.actionTypes.SET_SLOGANS,
123
+ payload: {
124
+ loading: false,
125
+ slogans: res.results
126
+ }
127
+ });
128
+ })
129
+ .catch((e) => {
130
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
131
+ dispatch({ type: reducer_1.actionTypes.SET_SLOGANS, payload: { loading: false, slogans: [] } });
132
+ });
133
+ };
134
+ const updatePreference = (preference) => tslib_1.__awaiter(this, void 0, void 0, function* () {
135
+ try {
136
+ yield api_services_1.PreferenceService.updatePreferences(preference);
137
+ }
138
+ catch (e) {
139
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
140
+ }
141
+ finally {
142
+ setUpdating(false);
143
+ onCompleteAction();
144
+ }
145
+ });
146
+ const updateSlogans = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
147
+ setUpdating(true);
148
+ try {
149
+ yield Promise.all(state.slogans.map(({ name, value }) => {
150
+ return updatePreference({ [name]: value });
151
+ }));
152
+ }
153
+ catch (e) {
154
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
155
+ }
156
+ finally {
157
+ setUpdating(false);
158
+ }
159
+ });
160
+ const updateLogoPreference = (name) => tslib_1.__awaiter(this, void 0, void 0, function* () {
161
+ setLoadingLogo(true);
162
+ const formData = new FormData();
163
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
164
+ // @ts-ignore
165
+ formData.append(name, fileInput);
166
+ yield api_services_1.PreferenceService.updatePreferences(formData)
167
+ .then((preference) => {
168
+ setLoadingLogo(false);
169
+ dispatch({
170
+ type: reducer_1.actionTypes.SET_LOGOS,
171
+ payload: { logos: state.logos.map((l) => (l.name === name ? Object.assign(Object.assign({}, l), { value: preference[name].value }) : l)) }
172
+ });
173
+ onCompleteAction();
174
+ })
175
+ .catch((e) => {
176
+ setLoadingLogo(false);
177
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
178
+ });
179
+ });
180
+ /**
181
+ * Handles logo upload
182
+ * @param event
183
+ * @param name
184
+ */
185
+ const handleUpload = (event, name) => {
186
+ fileInput = event.target.files[0];
187
+ if (fileInput) {
188
+ updateLogoPreference(name);
189
+ }
190
+ };
191
+ (0, react_1.useEffect)(() => {
192
+ fetchColors();
193
+ fetchLogos();
194
+ fetchSlogans();
195
+ }, []);
196
+ // HANDLERS
197
+ const handleColorChange = (color, name) => {
198
+ const currentColor = state.colors.find((col) => col.name === name);
199
+ if (currentColor && currentColor.value !== color) {
200
+ dispatch({
201
+ type: reducer_1.actionTypes.SET_COLORS,
202
+ payload: { colors: state.colors.map((col) => (col.name === name ? Object.assign(Object.assign({}, col), { value: color }) : col)) }
203
+ });
204
+ setTimeout(() => {
205
+ updatePreference({ [`${name}`]: color });
206
+ }, 2000);
207
+ }
208
+ };
209
+ const handleChange = (event) => {
210
+ const { name, value } = event.target;
211
+ dispatch({
212
+ type: reducer_1.actionTypes.SET_SLOGANS,
213
+ payload: { slogans: state.slogans.map((s) => (s.name === name ? Object.assign(Object.assign({}, s), { value: value }) : s)) }
214
+ });
215
+ };
216
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title, alignSelf: "self-start" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.appearance", defaultMessage: "ui.onBoardingWidget.appearance" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.summary", defaultMessage: "ui.onBoardingWidget.step.appearance.summary" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "outlined", size: "small", color: "primary", onClick: handleOpen }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.button", defaultMessage: "ui.onBoardingWidget.step.appearance.button" }) })), (0, jsx_runtime_1.jsxs)(DrawerRoot, Object.assign({ className: classes.drawerRoot, anchor: "right", open: Boolean(anchorEl), onClose: handleClose }, { children: [(0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.drawerHeader }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", color: "primary" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.header.title", defaultMessage: "ui.onBoardingWidget.step.appearance.header.title" }) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: handleClose }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "close" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ value: tab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", "aria-label": "scrollable-tabs" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.colors.title", defaultMessage: "ui.onBoardingWidget.step.appearance.colors.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.logo.title", defaultMessage: "ui.onBoardingWidget.step.appearance.logo.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.title", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.title" }) })] })), (0, jsx_runtime_1.jsx)(ScrollContainer_1.default, { children: (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.drawerContent }, { children: [tab === 0 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: state.colors.map((color) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, onBoarding_1.formatColorLabel)(color) })), (0, jsx_runtime_1.jsx)(mui_color_input_1.MuiColorInput, { className: classes.color, format: "hex", value: color.value, onChange: (newColor) => handleColorChange(newColor, color.name) })] }, color.id))) })), tab === 1 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: state.logos.map((logo) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, onBoarding_1.formatLogoLabel)(logo.name) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.logoContainer }, { children: [(0, jsx_runtime_1.jsx)("img", { src: logo.value, className: classes.logo }), (0, jsx_runtime_1.jsx)("input", { type: "file", onChange: (event) => handleUpload(event, logo.name), ref: fileInput, hidden: true, accept: ".gif,.png,.jpg,.jpeg" }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ className: classes.uploadButton, onClick: () => fileInput.current.click(), loading: loadingLogo, disabled: loadingLogo }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "upload" }) }))] }))] }, logo.id))) })), tab === 2 && ((0, jsx_runtime_1.jsxs)(Box_1.default, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, fullWidth: true,
217
+ //className={classes.field}
218
+ label: `${intl.formatMessage(messages.titleField)}`, margin: "normal", value: (_a = state === null || state === void 0 ? void 0 : state.slogans[0]) === null || _a === void 0 ? void 0 : _a.value, name: "application_slogan1", onChange: handleChange, InputProps: {
219
+ endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_b = state.slogans[0].value) === null || _b === void 0 ? void 0 : _b.length) ? 50 - ((_c = state.slogans[0].value) === null || _c === void 0 ? void 0 : _c.length) : 50 }))
220
+ }, error: Boolean(((_e = (_d = state === null || state === void 0 ? void 0 : state.slogans[0]) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.length) > 50) }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, fullWidth: true,
221
+ //className={classes.field}
222
+ label: `${intl.formatMessage(messages.sloganField)}`, margin: "normal", value: (_f = state === null || state === void 0 ? void 0 : state.slogans[1]) === null || _f === void 0 ? void 0 : _f.value, name: "application_slogan2", onChange: handleChange, InputProps: {
223
+ endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_g = state.slogans[1].value) === null || _g === void 0 ? void 0 : _g.length) ? 150 - ((_h = state.slogans[1].value) === null || _h === void 0 ? void 0 : _h.length) : 150 })))
224
+ }, error: Boolean(((_k = (_j = state === null || state === void 0 ? void 0 : state.slogans[1]) === null || _j === void 0 ? void 0 : _j.value) === null || _k === void 0 ? void 0 : _k.length) > 150) }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: updating, disabled: updating, variant: "outlined", size: "small", color: "primary", onClick: updateSlogans }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.button", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.button" }) }))] }))] })) })] }))] })));
225
+ }
226
+ exports.default = Appearance;
@@ -0,0 +1,3 @@
1
+ import Appearance, { AppearanceProps } from './Appearance';
2
+ export { AppearanceProps };
3
+ export default Appearance;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Appearance_1 = tslib_1.__importDefault(require("./Appearance"));
5
+ exports.default = Appearance_1.default;
@@ -0,0 +1,15 @@
1
+ export declare const actionTypes: {
2
+ LOADING: string;
3
+ SET_COLORS: string;
4
+ SET_LOGOS: string;
5
+ SET_SLOGANS: string;
6
+ };
7
+ export declare const initialState: {
8
+ loading: boolean;
9
+ colors: any[];
10
+ logos: any[];
11
+ slogans: any[];
12
+ modified: boolean;
13
+ };
14
+ export declare function getInitialState(data: any): any;
15
+ export declare function reducer(state: any, action: any): any;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reducer = exports.getInitialState = exports.initialState = exports.actionTypes = void 0;
4
+ exports.actionTypes = {
5
+ LOADING: '_loading',
6
+ SET_COLORS: '_set_colors',
7
+ SET_LOGOS: '_set_logos',
8
+ SET_SLOGANS: '_set_slogans'
9
+ };
10
+ exports.initialState = {
11
+ loading: false,
12
+ colors: [],
13
+ logos: [],
14
+ slogans: [],
15
+ modified: false
16
+ };
17
+ function getInitialState(data) {
18
+ if (data) {
19
+ return Object.assign(Object.assign({}, exports.initialState), data);
20
+ }
21
+ return exports.initialState;
22
+ }
23
+ exports.getInitialState = getInitialState;
24
+ function reducer(state, action) {
25
+ let _state = Object.assign({}, state);
26
+ switch (action.type) {
27
+ case exports.actionTypes.LOADING:
28
+ _state = Object.assign(Object.assign({}, state), { loading: action.payload.loading });
29
+ break;
30
+ case exports.actionTypes.SET_COLORS:
31
+ _state = Object.assign(Object.assign(Object.assign(Object.assign({}, state), { colors: action.payload.colors, logos: state.logos }), (action.payload.loading !== undefined && { loading: action.payload.loading })), { modified: true });
32
+ break;
33
+ case exports.actionTypes.SET_LOGOS:
34
+ _state = Object.assign(Object.assign(Object.assign(Object.assign({}, state), { logos: action.payload.logos, colors: state.colors }), (action.payload.loading !== undefined && { loading: action.payload.loading })), { modified: true });
35
+ break;
36
+ case exports.actionTypes.SET_SLOGANS:
37
+ _state = Object.assign(Object.assign(Object.assign(Object.assign({}, state), { slogans: action.payload.slogans, logos: state.logos, colors: state.colors }), (action.payload.loading !== undefined && { loading: action.payload.loading })), { modified: true });
38
+ break;
39
+ }
40
+ return _state;
41
+ }
42
+ exports.reducer = reducer;
@@ -0,0 +1,18 @@
1
+ import { SCStepType } from '@selfcommunity/types';
2
+ export interface CategoryProps {
3
+ /**
4
+ * The category step
5
+ */
6
+ step: SCStepType;
7
+ /**
8
+ * Overrides or extends the styles applied to the component.
9
+ * @default null
10
+ */
11
+ className?: string;
12
+ /**
13
+ * Callback triggered on success category content generation
14
+ * @default null
15
+ */
16
+ handleCategoriesCreation?: () => void;
17
+ }
18
+ export default function Category(inProps: CategoryProps): JSX.Element;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const styles_1 = require("@mui/material/styles");
6
+ const material_1 = require("@mui/material");
7
+ const Box_1 = tslib_1.__importDefault(require("@mui/material/Box"));
8
+ const system_1 = require("@mui/system");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const react_1 = require("react");
11
+ const react_intl_1 = require("react-intl");
12
+ const constants_1 = require("../../constants");
13
+ const CategoryA_1 = tslib_1.__importDefault(require("../../../../assets/onBoarding/CategoryA"));
14
+ const CategoryB_1 = tslib_1.__importDefault(require("../../../../assets/onBoarding/CategoryB"));
15
+ const ProgressBar_1 = tslib_1.__importDefault(require("../../../../shared/ProgressBar"));
16
+ const types_1 = require("@selfcommunity/types");
17
+ const classes = {
18
+ root: `${constants_1.PREFIX}-category-root`,
19
+ title: `${constants_1.PREFIX}-category-title`,
20
+ summary: `${constants_1.PREFIX}-category-summary`,
21
+ image: `${constants_1.PREFIX}-category-image`,
22
+ action: `${constants_1.PREFIX}-category-action`,
23
+ button: `${constants_1.PREFIX}-category-button`,
24
+ success: `${constants_1.PREFIX}-success`
25
+ };
26
+ function CircledLetter({ letter, statement }) {
27
+ return ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ component: "span", sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1.5 } }, { children: [(0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", sx: {
28
+ width: 22,
29
+ height: 22,
30
+ borderRadius: '50%',
31
+ backgroundColor: 'black',
32
+ display: 'flex',
33
+ justifyContent: 'center',
34
+ alignItems: 'center'
35
+ } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", sx: {
36
+ color: 'white',
37
+ textTransform: 'uppercase',
38
+ fontWeight: 'bold'
39
+ } }, { children: letter })) })), statement] })));
40
+ }
41
+ const Root = (0, styles_1.styled)(Box_1.default, {
42
+ name: constants_1.PREFIX,
43
+ slot: 'CategoryRoot'
44
+ })(() => ({}));
45
+ function Category(inProps) {
46
+ // PROPS
47
+ const props = (0, system_1.useThemeProps)({
48
+ props: inProps,
49
+ name: constants_1.PREFIX
50
+ });
51
+ const { className, step, handleCategoriesCreation } = props;
52
+ // STATE
53
+ const [hover, setHover] = (0, react_1.useState)(false);
54
+ const [progress, setProgress] = (0, react_1.useState)(step.completion_percentage);
55
+ (0, react_1.useEffect)(() => {
56
+ if (step.status === types_1.SCOnBoardingStepStatusType.IN_PROGRESS) {
57
+ const intervalId = setInterval(() => {
58
+ setProgress((prev) => {
59
+ if (prev >= 90) {
60
+ clearInterval(intervalId);
61
+ return prev;
62
+ }
63
+ return prev + 1;
64
+ });
65
+ }, 1000);
66
+ return () => clearInterval(intervalId);
67
+ }
68
+ }, [step.status]);
69
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.categories", defaultMessage: "ui.onBoardingWidget.categories" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.category.summary", defaultMessage: "ui.onBoardingWidget.step.category.summary" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.category.generation.steps", defaultMessage: "ui.onBoardingWidget.step.category.generation.steps", values: {
70
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
71
+ // @ts-ignore
72
+ iconA: (...chunks) => (0, jsx_runtime_1.jsx)(CircledLetter, { letter: "a", statement: chunks }),
73
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
74
+ // @ts-ignore
75
+ iconB: (...chunks) => (0, jsx_runtime_1.jsx)(CircledLetter, { letter: "b", statement: chunks }),
76
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
77
+ // @ts-ignore
78
+ iconC: (...chunks) => (0, jsx_runtime_1.jsx)(CircledLetter, { letter: "c", statement: chunks })
79
+ } }) }), (0, jsx_runtime_1.jsx)(material_1.CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: (0, jsx_runtime_1.jsx)(CategoryA_1.default, {}) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: (0, jsx_runtime_1.jsx)(CategoryB_1.default, {}) })), (0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED ? ((0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ severity: "success" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.categories.success", defaultMessage: "ui.onBoardingWidget.step.categories.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS ? ((0, jsx_runtime_1.jsx)(ProgressBar_1.default, { value: progress, loadingMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.categories.loading", defaultMessage: "ui.onBoardingWidget.step.categories.loading" }) })) })) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleCategoriesCreation, endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.category.button", id: "ui.onBoardingWidget.step.category.button" }) }))) }))] })));
80
+ }
81
+ exports.default = Category;
@@ -0,0 +1,3 @@
1
+ import Category, { CategoryProps } from './Category';
2
+ export { CategoryProps };
3
+ export default Category;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Category_1 = tslib_1.__importDefault(require("./Category"));
5
+ exports.default = Category_1.default;
@@ -0,0 +1,18 @@
1
+ import { SCStepType } from '@selfcommunity/types';
2
+ export interface ContentProps {
3
+ /**
4
+ * The content step
5
+ */
6
+ step: SCStepType;
7
+ /**
8
+ * Overrides or extends the styles applied to the component.
9
+ * @default null
10
+ */
11
+ className?: string;
12
+ /**
13
+ * Callback triggered on success category content generation
14
+ * @default null
15
+ */
16
+ handleContentCreation?: () => void;
17
+ }
18
+ export default function Content(inProps: ContentProps): JSX.Element;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const styles_1 = require("@mui/material/styles");
6
+ const material_1 = require("@mui/material");
7
+ const Box_1 = tslib_1.__importDefault(require("@mui/material/Box"));
8
+ const system_1 = require("@mui/system");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const react_1 = require("react");
11
+ const constants_1 = require("../../constants");
12
+ const react_intl_1 = require("react-intl");
13
+ const types_1 = require("@selfcommunity/types");
14
+ const ProgressBar_1 = tslib_1.__importDefault(require("../../../../shared/ProgressBar"));
15
+ const classes = {
16
+ root: `${constants_1.PREFIX}-content-root`,
17
+ title: `${constants_1.PREFIX}-content-title`,
18
+ summary: `${constants_1.PREFIX}-content-summary`,
19
+ action: `${constants_1.PREFIX}-content-action`
20
+ };
21
+ const Root = (0, styles_1.styled)(Box_1.default, {
22
+ name: constants_1.PREFIX,
23
+ slot: 'ContentRoot'
24
+ })(() => ({}));
25
+ function Content(inProps) {
26
+ // PROPS
27
+ const props = (0, system_1.useThemeProps)({
28
+ props: inProps,
29
+ name: constants_1.PREFIX
30
+ });
31
+ const { className, step, handleContentCreation } = props;
32
+ // STATE
33
+ const [hover, setHover] = (0, react_1.useState)(false);
34
+ const [progress, setProgress] = (0, react_1.useState)(step.completion_percentage);
35
+ (0, react_1.useEffect)(() => {
36
+ if (step.status === types_1.SCOnBoardingStepStatusType.IN_PROGRESS) {
37
+ const intervalId = setInterval(() => {
38
+ setProgress((prev) => {
39
+ if (prev >= 90) {
40
+ clearInterval(intervalId);
41
+ return prev;
42
+ }
43
+ return prev + 1;
44
+ });
45
+ }, 1000);
46
+ return () => clearInterval(intervalId);
47
+ }
48
+ }, [step.status]);
49
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.contents", defaultMessage: "ui.onBoardingWidget.contents" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.content.summary", defaultMessage: "ui.onBoardingWidget.step.content.summary" }) })), (0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED ? ((0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ severity: "success" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.success", defaultMessage: "ui.onBoardingWidget.step.contents.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS ? ((0, jsx_runtime_1.jsx)(ProgressBar_1.default, { value: progress, loadingMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.loading", defaultMessage: "ui.onBoardingWidget.step.contents.loading" }) })) })) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleContentCreation, endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.content.button", id: "ui.onBoardingWidget.step.content.button" }) }))) }))] })));
50
+ }
51
+ exports.default = Content;
@@ -0,0 +1,3 @@
1
+ import Content, { ContentProps } from './Content';
2
+ export { ContentProps };
3
+ export default Content;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Content_1 = tslib_1.__importDefault(require("./Content"));
5
+ exports.default = Content_1.default;
@@ -0,0 +1,13 @@
1
+ export interface InviteProps {
2
+ /**
3
+ * Overrides or extends the styles applied to the component.
4
+ * @default null
5
+ */
6
+ className?: string;
7
+ /**
8
+ * Callback triggered on complete action click
9
+ * @default null
10
+ */
11
+ onCompleteAction: () => void;
12
+ }
13
+ export default function Invite(inProps: InviteProps): JSX.Element;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const styles_1 = require("@mui/material/styles");
7
+ const Box_1 = tslib_1.__importDefault(require("@mui/material/Box"));
8
+ const system_1 = require("@mui/system");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const constants_1 = require("../../constants");
11
+ const material_1 = require("@mui/material");
12
+ const react_intl_1 = require("react-intl");
13
+ const react_core_1 = require("@selfcommunity/react-core");
14
+ const SocialShare_1 = require("../../../../constants/SocialShare");
15
+ const constants_2 = require("../../../PlatformWidget/constants");
16
+ const classes = {
17
+ root: `${constants_1.PREFIX}-invite-root`,
18
+ title: `${constants_1.PREFIX}-invite-title`,
19
+ social: `${constants_1.PREFIX}-invite-social`,
20
+ email: `${constants_1.PREFIX}-invite-email`,
21
+ iconContainer: `${constants_1.PREFIX}-invite-social-icon-container`,
22
+ icon: `${constants_1.PREFIX}-invite-social-icon`,
23
+ action: `${constants_1.PREFIX}-invite-action`
24
+ };
25
+ const Root = (0, styles_1.styled)(Box_1.default, {
26
+ name: constants_1.PREFIX,
27
+ slot: 'InviteRoot'
28
+ })(() => ({}));
29
+ function Invite(inProps) {
30
+ // PROPS
31
+ const props = (0, system_1.useThemeProps)({
32
+ props: inProps,
33
+ name: constants_1.PREFIX
34
+ });
35
+ const { className, onCompleteAction = null } = props;
36
+ // CONTEXT
37
+ const scContext = (0, react_core_1.useSCContext)();
38
+ const scPreferencesContext = (0, react_1.useContext)(react_core_1.SCPreferencesContext);
39
+ const facebookShareEnabled = react_core_1.SCPreferences.ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED in scPreferencesContext.preferences &&
40
+ scPreferencesContext.preferences[react_core_1.SCPreferences.ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED].value;
41
+ const xShareEnabled = react_core_1.SCPreferences.ADDONS_SHARE_POST_ON_TWITTER_ENABLED in scPreferencesContext.preferences &&
42
+ scPreferencesContext.preferences[react_core_1.SCPreferences.ADDONS_SHARE_POST_ON_TWITTER_ENABLED].value;
43
+ const linkedinShareEnabled = react_core_1.SCPreferences.ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED in scPreferencesContext.preferences &&
44
+ scPreferencesContext.preferences[react_core_1.SCPreferences.ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED].value;
45
+ const url = scContext.settings.portal;
46
+ const isStage = scContext.settings.portal.includes('stage');
47
+ // HANDLERS
48
+ const handleShare = (shareUrl, shareType) => {
49
+ window.open(shareUrl, `${shareType}-share-dialog`, 'width=626,height=436');
50
+ onCompleteAction();
51
+ };
52
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.invite", defaultMessage: "ui.onBoardingWidget.invite" }) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.social }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.title, variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.invite.social.title", defaultMessage: "ui.onBoardingWidget.step.invite.social.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.invite.social.subtitle", defaultMessage: "ui.onBoardingWidget.step.invite.social.subtitle" }) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.iconContainer }, { children: [facebookShareEnabled && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => handleShare(SocialShare_1.FACEBOOK_SHARE + url, 'facebook') }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ classes: { root: classes.icon } }, { children: "facebook" })) }))), xShareEnabled && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => handleShare(SocialShare_1.X_SHARE + url, 'x') }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ classes: { root: classes.icon } }, { children: "twitter" })) }))), linkedinShareEnabled && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => handleShare(SocialShare_1.LINKEDIN_SHARE + url, 'linkedin') }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ classes: { root: classes.icon } }, { children: "linkedin" })) })))] }))] })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.email }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.title, variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.invite.email.title", defaultMessage: "ui.onBoardingWidget.step.invite.email.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.invite.email.subtitle", defaultMessage: "ui.onBoardingWidget.step.invite.email.subtitle" }) }))] })), (0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", className: classes.action }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "outlined", size: "small", component: react_core_1.Link, to: isStage ? constants_2.MAKE_MARKETING_STAGE : constants_2.MAKE_MARKETING_PROD, target: "_blank", onClick: onCompleteAction }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.invite.button", id: "ui.onBoardingWidget.step.invite.button" }) })) }))] })));
53
+ }
54
+ exports.default = Invite;
@@ -0,0 +1,3 @@
1
+ import Invite, { InviteProps } from './Invite';
2
+ export default Invite;
3
+ export { InviteProps };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Invite_1 = tslib_1.__importDefault(require("./Invite"));
5
+ exports.default = Invite_1.default;
@@ -0,0 +1,25 @@
1
+ import { SCUserType } from '@selfcommunity/types';
2
+ import { SCUserProfileFields } from '../../../../types/user';
3
+ export interface ProfileProps {
4
+ /**
5
+ * Overrides or extends the styles applied to the component.
6
+ * @default null
7
+ */
8
+ className?: string;
9
+ /**
10
+ * User fields to display in the profile
11
+ * @default [real_name, date_joined, date_of_birth, website, description, bio]
12
+ */
13
+ fields?: SCUserProfileFields[];
14
+ /**
15
+ * User Object
16
+ * @default null
17
+ */
18
+ user?: SCUserType;
19
+ /**
20
+ * Callback triggered on complete action click
21
+ * @default null
22
+ */
23
+ onCompleteAction: () => void;
24
+ }
25
+ export default function Profile(inProps: ProfileProps): JSX.Element;