argous 1.2.216 → 1.2.218

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.
@@ -0,0 +1,71 @@
1
+ export interface CarouselProps {
2
+ /**
3
+ * ID
4
+ */
5
+ id: string,
6
+ /**
7
+ * Left icon
8
+ */
9
+ leftIcon?: SVGElement,
10
+ /**
11
+ * Right icon
12
+ */
13
+ rightIcon?: SVGElement,
14
+ /**
15
+ * Number to represent the icon size in pixels
16
+ */
17
+ iconSize?: number,
18
+ /**
19
+ * Value of scroll sensitivity
20
+ */
21
+ scrollSensitivity?: number,
22
+ /**
23
+ * Number to represent the item spacing in pixels
24
+ */
25
+ itemSpacing?: number,
26
+ /**
27
+ * Show buttons
28
+ */
29
+ buttons?: boolean,
30
+ /**
31
+ * Show indicator
32
+ */
33
+ indicator?: boolean,
34
+ /**
35
+ * Number to represent the indicator size in pixels
36
+ */
37
+ indicatorSize?: number,
38
+ /**
39
+ * Number to represent the indicator gap in pixels
40
+ */
41
+ indicatorGap?: number,
42
+ /**
43
+ * Number to represent the indicator padding in pixels
44
+ */
45
+ indicatorPadding?: number,
46
+ /**
47
+ * Style to carousel element
48
+ */
49
+ carouselStyle?: object,
50
+ /**
51
+ * Css class to button element
52
+ */
53
+ buttonClassName?: string,
54
+ /**
55
+ * Css class to indicator element
56
+ */
57
+ indicatorClassName?: string,
58
+ /**
59
+ * Css class to current indicator element
60
+ */
61
+ currentIndicatorClassName?: string,
62
+ /**
63
+ * Function called on click
64
+ */
65
+ onClick?: (event: Event) => void
66
+ }
67
+
68
+
69
+ declare function Carousel(props: CarouselProps) : JSX.Element
70
+
71
+ export default Carousel;
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || function (mod) {
26
+ if (mod && mod.__esModule) return mod;
27
+ var result = {};
28
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
+ __setModuleDefault(result, mod);
30
+ return result;
31
+ };
32
+ var __importDefault = (this && this.__importDefault) || function (mod) {
33
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ var core_1 = require("@material-ui/core");
37
+ var clsx_1 = __importDefault(require("clsx"));
38
+ var react_1 = __importStar(require("react"));
39
+ var io_1 = require("react-icons/io");
40
+ var useStyles = core_1.makeStyles(function (theme) { return ({
41
+ container: {
42
+ height: '100%',
43
+ width: '100%'
44
+ },
45
+ carouselContainer: {
46
+ width: '100%',
47
+ height: function (_a) {
48
+ var indicator = _a.indicator, indicatorPadding = _a.indicatorPadding;
49
+ return (indicator) ? "calc(100% - " + indicatorPadding * 2 + "px)" : '100%';
50
+ },
51
+ minWidth: '100%',
52
+ display: 'flex',
53
+ alignItems: 'center'
54
+ },
55
+ carousel: {
56
+ width: '100%',
57
+ height: '100%',
58
+ margin: 'auto',
59
+ display: 'flex',
60
+ alignItems: 'center',
61
+ flexDirection: 'row',
62
+ overflow: 'hidden',
63
+ scrollBehavior: 'smooth',
64
+ '&>*:not(:last-child)': {
65
+ marginRight: function (_a) {
66
+ var itemSpacing = _a.itemSpacing;
67
+ return (itemSpacing || '');
68
+ }
69
+ }
70
+ },
71
+ button: {
72
+ display: 'flex',
73
+ alignItems: 'center',
74
+ cursor: 'pointer',
75
+ border: 0,
76
+ padding: 0,
77
+ backgroundColor: '#0000',
78
+ color: (theme.palette.type === 'light') ? 'rgba(0, 0, 0, .4)' : 'rgba(255, 255, 255, .5)',
79
+ '&:hover': {
80
+ color: (theme.palette.type === 'light') ? 'rgba(0, 0, 0, .6)' : 'rgba(255, 255, 255, .8)'
81
+ },
82
+ '&:disabled': {
83
+ color: (theme.palette.type === 'light') ? 'rgba(0, 0, 0, .23)' : 'rgba(255, 255, 255, .3)',
84
+ backgroundColor: 'transparent',
85
+ cursor: 'default',
86
+ pointerEvents: 'none'
87
+ }
88
+ },
89
+ leftButton: {
90
+ left: 0
91
+ },
92
+ rightButton: {
93
+ right: 0
94
+ },
95
+ indicator: {
96
+ display: 'flex',
97
+ flexWrap: 'wrap',
98
+ alignItems: 'center',
99
+ justifyContent: 'center',
100
+ gap: function (_a) {
101
+ var indicatorGap = _a.indicatorGap;
102
+ return (indicatorGap || '');
103
+ },
104
+ padding: function (_a) {
105
+ var indicatorPadding = _a.indicatorPadding, indicatorSize = _a.indicatorSize, iconSize = _a.iconSize;
106
+ return indicatorPadding - (indicatorSize / 2) + "px " + iconSize + "px";
107
+ },
108
+ '& span': {
109
+ width: function (_a) {
110
+ var indicatorSize = _a.indicatorSize;
111
+ return (indicatorSize || '');
112
+ },
113
+ height: function (_a) {
114
+ var indicatorSize = _a.indicatorSize;
115
+ return (indicatorSize || '');
116
+ },
117
+ borderRadius: '50%',
118
+ backgroundColor: (theme.palette.type === 'light') ? 'rgba(0, 0, 0, .4)' : 'rgba(255, 255, 255, .5)',
119
+ transition: 'background-color 500ms'
120
+ }
121
+ },
122
+ currentIndicator: {
123
+ backgroundColor: (theme.palette.type === 'light') ? '#000 !important' : '#fff !important'
124
+ }
125
+ }); });
126
+ var CAROUSEL_ID = 'carousel';
127
+ var initialState = {
128
+ position: 0,
129
+ indicatorArray: []
130
+ };
131
+ var Carousel = function (_a) {
132
+ var _b, _c, _d;
133
+ var id = _a.id, _e = _a.leftIcon, LEFT_ICON = _e === void 0 ? io_1.IoIosArrowBack : _e, _f = _a.rightIcon, RIGHT_ICON = _f === void 0 ? io_1.IoIosArrowForward : _f, _g = _a.iconSize, iconSize = _g === void 0 ? 20 : _g, _h = _a.scrollSensitivity, scrollSensitivity = _h === void 0 ? 2 : _h, _j = _a.itemSpacing, itemSpacing = _j === void 0 ? 6 : _j, children = _a.children, _k = _a.buttons, buttons = _k === void 0 ? true : _k, _l = _a.indicator, indicator = _l === void 0 ? false : _l, _m = _a.indicatorSize, indicatorSize = _m === void 0 ? 6 : _m, _o = _a.indicatorGap, indicatorGap = _o === void 0 ? 10 : _o, _p = _a.indicatorPadding, indicatorPadding = _p === void 0 ? 20 : _p, carouselStyle = _a.carouselStyle, onClick = _a.onClick, buttonClassName = _a.buttonClassName, indicatorClassName = _a.indicatorClassName, currentIndicatorClassName = _a.currentIndicatorClassName;
134
+ var classes = useStyles({ itemSpacing: itemSpacing, indicator: indicator, indicatorSize: indicatorSize, indicatorGap: indicatorGap, indicatorPadding: indicatorPadding, iconSize: iconSize });
135
+ var _q = react_1.useState(initialState), state = _q[0], setState = _q[1];
136
+ var position = state.position, indicatorArray = state.indicatorArray;
137
+ var carousel = react_1.useRef(null);
138
+ var childWidth = (_d = (_c = (_b = carousel.current) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.offsetWidth;
139
+ var disabledButtonsRef = react_1.useRef(false);
140
+ var carouselId = (id) ? id : CAROUSEL_ID;
141
+ var leftButtonId = carouselId + "-left-button";
142
+ var rightButtonId = carouselId + "-right-button";
143
+ var logicSetState = function (_a) {
144
+ var type = _a.type, field = _a.field, value = _a.value;
145
+ return setState(function (states) {
146
+ var _a, _b;
147
+ return (__assign(__assign({}, states), (_a = {}, _a[type] = (type && field) ? __assign(__assign({}, states[type]), (_b = {}, _b[field] = value, _b)) : value, _a)));
148
+ });
149
+ };
150
+ var control = react_1.useCallback(function (e) {
151
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
152
+ if (disabledButtonsRef.current)
153
+ return;
154
+ var childWidth = (_c = (_b = (_a = carousel.current) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.offsetWidth;
155
+ var maxWidth = (childWidth * (((_e = (_d = carousel.current) === null || _d === void 0 ? void 0 : _d.children) === null || _e === void 0 ? void 0 : _e.length) - 1));
156
+ var scrollLeft = (_f = carousel.current) === null || _f === void 0 ? void 0 : _f.scrollLeft;
157
+ var leftButtonElement = document.getElementById(leftButtonId);
158
+ var rightButtonElement = document.getElementById(rightButtonId);
159
+ var childrenWidth = ((childWidth + itemSpacing) * ((_h = (_g = carousel.current) === null || _g === void 0 ? void 0 : _g.children) === null || _h === void 0 ? void 0 : _h.length));
160
+ var childrenSmallerThanParent = (childrenWidth < ((_j = carousel.current) === null || _j === void 0 ? void 0 : _j.offsetWidth));
161
+ if (leftButtonElement) {
162
+ if ((scrollLeft === 0) || childrenSmallerThanParent)
163
+ leftButtonElement.disabled = true;
164
+ else if (scrollLeft > 0)
165
+ leftButtonElement.disabled = false;
166
+ }
167
+ if (rightButtonElement) {
168
+ if ((scrollLeft === maxWidth) || childrenSmallerThanParent)
169
+ rightButtonElement.disabled = true;
170
+ else if (scrollLeft < maxWidth)
171
+ rightButtonElement.disabled = false;
172
+ }
173
+ (position === children.length) && logicSetState({ type: 'position', value: (children.length - 1) });
174
+ }, [itemSpacing, leftButtonId, rightButtonId, position, children.length]);
175
+ react_1.useEffect(function () { return control(); }, [control]);
176
+ control();
177
+ var createIndicatorArray = react_1.useCallback(function () {
178
+ var _a, _b;
179
+ var childrenLength = (_b = (_a = carousel.current) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length;
180
+ var newIndicatorArray = Array.from(Array(childrenLength).keys());
181
+ logicSetState({ type: 'indicatorArray', value: newIndicatorArray });
182
+ }, []);
183
+ react_1.useEffect(function () { return (indicator) && createIndicatorArray(); }, [indicator, children, createIndicatorArray]);
184
+ var handleCarouselClick = function (e, direction) {
185
+ if (!childWidth || (typeof childWidth !== 'number'))
186
+ return;
187
+ var newPosition = position;
188
+ var scrollWidth = (childWidth * scrollSensitivity);
189
+ var leftButtonElement = document.getElementById(leftButtonId);
190
+ var rightButtonElement = document.getElementById(rightButtonId);
191
+ leftButtonElement.disabled = true;
192
+ rightButtonElement.disabled = true;
193
+ disabledButtonsRef.current = true;
194
+ if (direction === 'right') {
195
+ (carousel.current.scrollLeft += scrollWidth);
196
+ (position < (indicatorArray.length - 1)) && logicSetState({ type: 'position', value: (newPosition += 1) });
197
+ }
198
+ else {
199
+ (carousel.current.scrollLeft -= scrollWidth);
200
+ (position > 0) && logicSetState({ type: 'position', value: (newPosition -= 1) });
201
+ }
202
+ (onClick && (typeof onClick === 'function')) && onClick(e);
203
+ setTimeout(function () {
204
+ leftButtonElement.disabled = false;
205
+ rightButtonElement.disabled = false;
206
+ disabledButtonsRef.current = false;
207
+ control();
208
+ }, ((childWidth <= 500) ? 500 : (childWidth * ((childWidth > 1000) ? 0.6 : 0.9)) || 500));
209
+ };
210
+ return react_1.default.createElement("div", { id: carouselId, className: classes.container },
211
+ react_1.default.createElement("div", { className: classes.carouselContainer },
212
+ (buttons && LEFT_ICON) && (react_1.default.createElement("button", { id: leftButtonId, onClick: function (e) { return handleCarouselClick(e, 'left'); }, className: clsx_1.default(classes.button, classes.leftButton, buttonClassName) },
213
+ react_1.default.createElement(LEFT_ICON, { size: iconSize, className: classes.leftButton }))),
214
+ react_1.default.createElement("div", { ref: carousel, style: __assign({}, carouselStyle), className: classes.carousel }, children),
215
+ (buttons && RIGHT_ICON) && (react_1.default.createElement("button", { id: rightButtonId, onClick: function (e) { return handleCarouselClick(e, 'right'); }, className: clsx_1.default(classes.button, classes.rightButton, buttonClassName) },
216
+ react_1.default.createElement(RIGHT_ICON, { size: iconSize, className: classes.rightButton })))),
217
+ (indicator) && (react_1.default.createElement("div", { className: clsx_1.default(classes.indicator, indicatorClassName) }, indicatorArray.map(function (_, index) {
218
+ var _a;
219
+ return (react_1.default.createElement("span", { key: "indicator-" + index, className: clsx_1.default((_a = {},
220
+ _a[classes.currentIndicator] = (position === index),
221
+ _a[currentIndicatorClassName] = (position === index),
222
+ _a)) }));
223
+ }))));
224
+ };
225
+ exports.default = Carousel;
@@ -0,0 +1,2 @@
1
+ export { default } from './Carousel';
2
+ export * from './Carousel';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var Carousel_1 = require("./Carousel");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Carousel_1).default; } });
@@ -0,0 +1,7 @@
1
+ export default Cursor;
2
+ declare function Cursor({ id, speed, className }: {
3
+ id: any;
4
+ speed?: number | undefined;
5
+ className: any;
6
+ }): React.JSX.Element;
7
+ import React from "react";
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ var react_1 = __importStar(require("react"));
23
+ var Cursor = function (_a) {
24
+ var id = _a.id, _b = _a.speed, speed = _b === void 0 ? 500 : _b, className = _a.className;
25
+ var cursorId = id + "-cursor-component";
26
+ var intervalIdRef = react_1.useRef(null);
27
+ react_1.useEffect(function () {
28
+ var cursorElement = document.getElementById(cursorId);
29
+ if (cursorElement)
30
+ cursorElement.style.opacity = '1';
31
+ intervalIdRef.current = setInterval(function () {
32
+ if (cursorElement)
33
+ cursorElement.style.opacity = (cursorElement.style.opacity === '0') ? '1' : '0';
34
+ }, speed);
35
+ return function () { return clearInterval(intervalIdRef.current); };
36
+ });
37
+ return react_1.default.createElement("span", { id: cursorId, className: "" + className }, "|");
38
+ };
39
+ exports.default = Cursor;
@@ -0,0 +1,11 @@
1
+ export default TextStyles;
2
+ declare function TextStyles({ color, setColor, defaultSpacing, toggleClickAway, handleFontSizeChange, textAlign, handleTextAlignChange }: {
3
+ color: any;
4
+ setColor: any;
5
+ defaultSpacing: any;
6
+ toggleClickAway: any;
7
+ handleFontSizeChange: any;
8
+ textAlign: any;
9
+ handleTextAlignChange: any;
10
+ }): React.JSX.Element;
11
+ import React from "react";
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || function (mod) {
26
+ if (mod && mod.__esModule) return mod;
27
+ var result = {};
28
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
+ __setModuleDefault(result, mod);
30
+ return result;
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ var core_1 = require("@material-ui/core");
34
+ var react_1 = __importStar(require("react"));
35
+ var react_colorful_1 = require("react-colorful");
36
+ var ri_1 = require("react-icons/ri");
37
+ var ICON_SIZE = '2.5rem';
38
+ var BOX_SHADOW = 'rgba(0, 0, 0, 0.3) 0px 1px 12px -2px';
39
+ var useStyles = core_1.makeStyles(function (theme) { return ({
40
+ container: {
41
+ zIndex: 1,
42
+ position: 'absolute',
43
+ top: 0,
44
+ right: 0,
45
+ display: 'flex',
46
+ alignItems: 'flex-start',
47
+ justifyContent: 'flex-end',
48
+ gap: function (_a) {
49
+ var defaultSpacing = _a.defaultSpacing;
50
+ return (defaultSpacing) ? defaultSpacing : '';
51
+ }
52
+ },
53
+ button: {
54
+ padding: function (_a) {
55
+ var defaultSpacing = _a.defaultSpacing;
56
+ return (defaultSpacing) ? (defaultSpacing / 2) : '';
57
+ },
58
+ color: "rgba(" + ((theme.palette.type === 'light') ? '0, 0, 0' : '255, 255, 255') + ", .7)",
59
+ backgroundColor: "rgba(" + ((theme.palette.type === 'light') ? '255, 255, 255' : '0, 0, 0') + ", .5)",
60
+ '&:hover': {
61
+ backgroundColor: "rgba(" + ((theme.palette.type === 'light') ? '255, 255, 255' : '0, 0, 0') + ", .7)"
62
+ }
63
+ },
64
+ colorPickerContainer: {
65
+ zIndex: 2,
66
+ position: 'absolute',
67
+ padding: '2rem'
68
+ },
69
+ colorPickerBoxShadow: {
70
+ borderRadius: 8,
71
+ webKitBoxShadow: BOX_SHADOW,
72
+ mozBoxShadow: BOX_SHADOW,
73
+ boxShadow: BOX_SHADOW
74
+ }
75
+ }); });
76
+ var initialStateOpen = {
77
+ colorPicker: undefined
78
+ };
79
+ var initialState = {
80
+ open: initialStateOpen
81
+ };
82
+ var TextStyles = function (_a) {
83
+ var color = _a.color, setColor = _a.setColor, defaultSpacing = _a.defaultSpacing, toggleClickAway = _a.toggleClickAway, handleFontSizeChange = _a.handleFontSizeChange, textAlign = _a.textAlign, handleTextAlignChange = _a.handleTextAlignChange;
84
+ var classes = useStyles({ defaultSpacing: defaultSpacing });
85
+ var _b = react_1.useState(initialState), state = _b[0], setState = _b[1];
86
+ var open = state.open;
87
+ var logicSetState = function (type, field, value) { return setState(function (values) {
88
+ var _a, _b;
89
+ return (__assign(__assign({}, values), (_a = {}, _a[type] = (type && field) ? __assign(__assign({}, values[type]), (_b = {}, _b[field] = value, _b)) : value, _a)));
90
+ }); };
91
+ var handleColorPickerOpen = function (e) {
92
+ toggleClickAway();
93
+ var elRect = e.target.parentElement.getBoundingClientRect();
94
+ logicSetState('open', 'colorPicker', elRect);
95
+ };
96
+ var handleColorPickerClose = function (e) {
97
+ toggleClickAway();
98
+ logicSetState('open', 'colorPicker', undefined);
99
+ };
100
+ return react_1.default.createElement("div", { className: classes.container },
101
+ react_1.default.createElement(core_1.IconButton, { onClick: handleTextAlignChange, onTouchStart: handleTextAlignChange, className: classes.button }, (function () {
102
+ switch (textAlign) {
103
+ case 'start':
104
+ return react_1.default.createElement(ri_1.RiAlignLeft, { size: ICON_SIZE });
105
+ case 'end':
106
+ return react_1.default.createElement(ri_1.RiAlignRight, { size: ICON_SIZE });
107
+ case 'center':
108
+ return react_1.default.createElement(ri_1.RiAlignCenter, { size: ICON_SIZE });
109
+ case 'justify':
110
+ return react_1.default.createElement(ri_1.RiAlignJustify, { size: ICON_SIZE });
111
+ default:
112
+ return null;
113
+ }
114
+ })()),
115
+ react_1.default.createElement(core_1.IconButton, { onClick: handleColorPickerOpen, onTouchStart: handleColorPickerOpen, className: classes.button },
116
+ react_1.default.createElement(ri_1.RiFontColor, { size: ICON_SIZE })),
117
+ react_1.default.createElement(core_1.IconButton, { onClick: handleFontSizeChange, onTouchStart: handleFontSizeChange, className: classes.button },
118
+ react_1.default.createElement(ri_1.RiFontSize, { size: ICON_SIZE })),
119
+ (!!open.colorPicker) && (react_1.default.createElement(core_1.ClickAwayListener, { disableReactTree: true, onClickAway: handleColorPickerClose },
120
+ react_1.default.createElement("div", { className: classes.colorPickerContainer },
121
+ react_1.default.createElement("div", { className: classes.colorPickerBoxShadow },
122
+ react_1.default.createElement(react_colorful_1.RgbaColorPicker, { color: color, onChange: setColor }))))));
123
+ };
124
+ exports.default = TextStyles;
@@ -0,0 +1,38 @@
1
+ export interface TextToHtmlInitialValue {
2
+ text?: string,
3
+ cssText?: string
4
+ }
5
+
6
+ export interface TextToHtmlProps {
7
+ /**
8
+ * Object containing properties to use as initial value
9
+ */
10
+ initialValue?: TextToHtmlInitialValue,
11
+ /**
12
+ * Function called on change
13
+ * @param htmlString
14
+ * @returns
15
+ */
16
+ onChange?: (htmlString: string) => void,
17
+ /**
18
+ * Function called on delete
19
+ * @param event
20
+ * @param deleted
21
+ * @param newCharacters
22
+ * @returns
23
+ */
24
+ onDelete?: (event: Event, deleted: object, newCharacters: Array<object>) => void,
25
+ /**
26
+ * Number to represent the default spacing in pixels
27
+ */
28
+ defaultSpacing?: number,
29
+ /**
30
+ * Function called to set external values
31
+ */
32
+ setExternalValues?: (state: object) => void
33
+ }
34
+
35
+
36
+ declare function TextToHtml(props: TextToHtmlProps) : JSX.Element
37
+
38
+ export default TextToHtml;