react-gldn-kit 0.1.32 → 0.1.34
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.
- package/dist/index.js +1 -1
- package/dist/lib/components/Scratch/index.js +8 -7
- package/dist/lib/components/Scratch/types.d.ts +1 -1
- package/dist/lib/components/Scratch/types.js +1 -4
- package/dist/lib/components/ui/Buttons/BaseButton/index.js +2 -2
- package/dist/lib/components/ui/Buttons/BaseButton/types.d.ts +1 -0
- package/dist/lib/components/ui/Buttons/DrawerButton/index.js +3 -3
- package/dist/lib/components/ui/Inputs/CheckBox/index.js +1 -1
- package/dist/main.css +21 -44
- package/package.json +1 -1
|
@@ -55,11 +55,12 @@ var types_1 = require("./types");
|
|
|
55
55
|
var styles = __importStar(require("./Scratch.module.css"));
|
|
56
56
|
// TODO: rewrite this code
|
|
57
57
|
var Scratch = function (props) {
|
|
58
|
-
var backgroundPath = props.backgroundPath, backgroundScratchDone = props.backgroundScratchDone, scratchPath = props.scratchPath, slotNamePath = props.slotNamePath, audioFirstPath = props.audioFirstPath, audioSecondPath = props.audioSecondPath, textOne = props.textOne, textTwo = props.textTwo, callback = props.callback;
|
|
59
|
-
var
|
|
60
|
-
var
|
|
58
|
+
var backgroundPath = props.backgroundPath, backgroundScratchDone = props.backgroundScratchDone, scratchPath = props.scratchPath, slotNamePath = props.slotNamePath, audioFirstPath = props.audioFirstPath, audioSecondPath = props.audioSecondPath, textOne = props.textOne, textTwo = props.textTwo, callback = props.callback, _a = props.boxesAmount, boxesAmount = _a === void 0 ? 9 : _a;
|
|
59
|
+
var _b = (0, react_1.useState)([]), scratchedBoxes = _b[0], setScratchedBoxes = _b[1];
|
|
60
|
+
var _c = (0, react_1.useState)({}), scratchedBoxesOpacity = _c[0], setScratchedBoxesOpacity = _c[1];
|
|
61
61
|
var audio1 = new Audio(audioFirstPath);
|
|
62
62
|
var audio2 = new Audio(audioSecondPath);
|
|
63
|
+
var BOXES = new Array(boxesAmount).fill(0).map(function (_, idx) { return idx; });
|
|
63
64
|
var handleScratch = function (idx) { return function () {
|
|
64
65
|
var _a, _b;
|
|
65
66
|
if (scratchedBoxes.includes(idx)) {
|
|
@@ -97,12 +98,12 @@ var Scratch = function (props) {
|
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
}, [scratchedBoxes]);
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.scratch, style: {
|
|
101
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.scratch, 'KIT_Scratch_scratch'), style: {
|
|
101
102
|
background: backgroundPath,
|
|
102
103
|
backgroundSize: '100% 100%',
|
|
103
104
|
backgroundPosition: 'center',
|
|
104
105
|
backgroundRepeat: 'no-repeat',
|
|
105
|
-
} }, { children: [
|
|
106
|
+
} }, { children: [BOXES.map(function (value) {
|
|
106
107
|
var _a;
|
|
107
108
|
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.box, (_a = {},
|
|
108
109
|
_a[styles.scratched] = scratchedBoxes.includes(value),
|
|
@@ -113,7 +114,7 @@ var Scratch = function (props) {
|
|
|
113
114
|
backgroundRepeat: 'no-repeat',
|
|
114
115
|
}, onClick: handleScratch(value) }, { children: [(0, jsx_runtime_1.jsx)("img", { className: styles.image, src: scratchedBoxes.includes(value) ? scratchPath[0] : scratchPath[1], style: {
|
|
115
116
|
opacity: scratchedBoxesOpacity[value],
|
|
116
|
-
}, alt: "" }), scratchedBoxes.includes(value) && ((0, jsx_runtime_1.jsx)("div", __assign({ className: styles.scratchText }, { children: scratchedBoxes[0] === value ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { idT: textOne })) : ((0, jsx_runtime_1.jsx)(Text_1.Text, { idT: textTwo })) })))] }), value));
|
|
117
|
-
}), (0, jsx_runtime_1.jsx)("img", { src: slotNamePath, className: styles.slotName })] })));
|
|
117
|
+
}, alt: "" }), scratchedBoxes.includes(value) && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.scratchText, 'KIT_Scratch_box_scratchText') }, { children: scratchedBoxes[0] === value ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { idT: textOne })) : ((0, jsx_runtime_1.jsx)(Text_1.Text, { idT: textTwo })) })))] }), value));
|
|
118
|
+
}), (0, jsx_runtime_1.jsx)("img", { src: slotNamePath, className: (0, classnames_1.default)(styles.slotName, 'KIT_Scratch_slotName') })] })));
|
|
118
119
|
};
|
|
119
120
|
exports.Scratch = Scratch;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TIMER = exports.OPEN_BOX_COUNT =
|
|
4
|
-
var BOXES_AMOUNT = 9; // TODO remove it
|
|
5
|
-
// Need to pass content with flexible data
|
|
6
|
-
exports.BOXES = new Array(BOXES_AMOUNT).fill(0).map(function (_, idx) { return idx; });
|
|
3
|
+
exports.TIMER = exports.OPEN_BOX_COUNT = void 0;
|
|
7
4
|
exports.OPEN_BOX_COUNT = 2; // TODO: we can open only two boxes
|
|
8
5
|
exports.TIMER = 1000; // REMOVE IT _ BAD CODE FLOW
|
|
@@ -44,7 +44,7 @@ var Text_1 = require("components/Text");
|
|
|
44
44
|
var styles = __importStar(require("./ButtonBase.module.css"));
|
|
45
45
|
var BaseButton = function (props) {
|
|
46
46
|
var _a, _b, _c;
|
|
47
|
-
var text = props.text, startIcon = props.startIcon, children = props.children, size = props.size, color = props.color, isResized = props.isResized, _d = props.classes, classes = _d === void 0 ? '' : _d, _e = props.marginL, marginL = _e === void 0 ? '' : _e, _f = props.fontSize, fontSize = _f === void 0 ? '' : _f, _g = props.borderR, borderR = _g === void 0 ? '' : _g, classesText = props.classesText, centreText = props.centreText, handleClick = props.handleClick, buttonHeight = props.buttonHeight, marginB = props.marginB, disabled = props.disabled;
|
|
47
|
+
var text = props.text, startIcon = props.startIcon, children = props.children, size = props.size, color = props.color, isResized = props.isResized, _d = props.classes, classes = _d === void 0 ? '' : _d, _e = props.marginL, marginL = _e === void 0 ? '' : _e, _f = props.fontSize, fontSize = _f === void 0 ? '' : _f, _g = props.borderR, borderR = _g === void 0 ? '' : _g, classesText = props.classesText, centreText = props.centreText, handleClick = props.handleClick, buttonHeight = props.buttonHeight, marginB = props.marginB, disabled = props.disabled, endIconClasses = props.endIconClasses;
|
|
48
48
|
var marginLKey = "marginLeft-".concat(marginL);
|
|
49
49
|
var marginBKey = "marginBottom-".concat(marginB);
|
|
50
50
|
var sizeKey = "size".concat(size);
|
|
@@ -65,6 +65,6 @@ var BaseButton = function (props) {
|
|
|
65
65
|
_b[styles.center] = centreText,
|
|
66
66
|
_b)) }, { children: [startIcon, text && ((0, jsx_runtime_1.jsx)("span", __assign({ className: (0, classnames_1.default)(styles.text, (_c = {},
|
|
67
67
|
_c[styles['marginLeft-base']] = startIcon,
|
|
68
|
-
_c)) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: text }) }))), children && (0, jsx_runtime_1.jsx)("div", __assign({ className: styles.endIcon }, { children: children }))] })) })));
|
|
68
|
+
_c)) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: text }) }))), children && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.endIcon, endIconClasses) }, { children: children })))] })) })));
|
|
69
69
|
};
|
|
70
70
|
exports.BaseButton = BaseButton;
|
|
@@ -56,8 +56,8 @@ var styles = __importStar(require("./DrawerButton.module.css"));
|
|
|
56
56
|
var DrawerButton = function (props) {
|
|
57
57
|
var _a;
|
|
58
58
|
var classes = props.classes, text = props.text, _b = props.isFullView, isFullView = _b === void 0 ? true : _b, rest = __rest(props, ["classes", "text", "isFullView"]);
|
|
59
|
-
return ((0, jsx_runtime_1.
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(BaseButton_1.BaseButton, __assign({}, rest, { text: isFullView ? text : '', buttonHeight: "--button-height-xxl", size: "--button-full", color: "transparent", classes: (0, classnames_1.default)(styles.buttonIndex, (_a = {},
|
|
60
|
+
_a[styles.center] = !isFullView,
|
|
61
|
+
_a), classes), classesText: styles.full })));
|
|
62
62
|
};
|
|
63
63
|
exports.DrawerButton = DrawerButton;
|
|
@@ -49,6 +49,6 @@ var CheckBox = function (props) {
|
|
|
49
49
|
e.preventDefault();
|
|
50
50
|
onChange(!value);
|
|
51
51
|
};
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.checkboxWrapper, classes) }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: styles.checkboxWrapperBig
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.checkboxWrapper, classes) }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: styles.checkboxWrapperBig }, { children: (0, jsx_runtime_1.jsxs)("label", __assign({ className: styles.switch }, { children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: value, onChange: handleToggle }), (0, jsx_runtime_1.jsx)("div", { className: styles.slider })] })) })), text && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.checkboxText, classesText), onClick: handleText }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: text }) })))] })));
|
|
53
53
|
};
|
|
54
54
|
exports.CheckBox = CheckBox;
|
package/dist/main.css
CHANGED
|
@@ -456,7 +456,6 @@
|
|
|
456
456
|
.KIT__DrawerButton-module__wrapperDrawerButton___VXojY {
|
|
457
457
|
--drawer-button-text-color: white;
|
|
458
458
|
--border-button: var(--border-l);
|
|
459
|
-
--border-background: var(--drawer-button-border-background);
|
|
460
459
|
|
|
461
460
|
--drawer-button-bg: rgb(var(--dark-gray));
|
|
462
461
|
|
|
@@ -472,48 +471,30 @@
|
|
|
472
471
|
}
|
|
473
472
|
|
|
474
473
|
.KIT__DrawerButton-module__buttonIndex___OnNej {
|
|
474
|
+
--height: var(--height-48);
|
|
475
|
+
height: var(--height);
|
|
475
476
|
position: relative;
|
|
476
477
|
z-index: calc(var(--layout-lvl-1) + 1);
|
|
477
478
|
border-radius: var(--border-button);
|
|
478
|
-
|
|
479
|
-
background: var(--drawer-modal-content-color);
|
|
480
|
-
padding-left: var(--indent-l);
|
|
479
|
+
padding: var(--indent-m) 0;
|
|
481
480
|
color: var(--drawer-modal-content-text-color);
|
|
482
481
|
}
|
|
483
482
|
|
|
484
|
-
|
|
485
|
-
|
|
483
|
+
@media screen and (min-width: 768px) {
|
|
484
|
+
|
|
485
|
+
.KIT__DrawerButton-module__buttonIndex___OnNej {
|
|
486
|
+
padding: var(--indent-m) var(--indent-l);
|
|
486
487
|
}
|
|
488
|
+
}
|
|
487
489
|
|
|
488
490
|
.KIT__DrawerButton-module__center___VojH7 {
|
|
489
491
|
justify-content: center;
|
|
490
492
|
}
|
|
491
493
|
|
|
492
|
-
.KIT__DrawerButton-module__borderBg___OHEWy {
|
|
493
|
-
width: 100%;
|
|
494
|
-
height: 100%;
|
|
495
|
-
position: absolute;
|
|
496
|
-
left: 0;
|
|
497
|
-
top: 0;
|
|
498
|
-
z-index: var(--layout-lvl-1);
|
|
499
|
-
background: var(--drawer-button-border-background);
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.KIT__DrawerButton-module__shadowBg___k4cHp {
|
|
503
|
-
position: absolute;
|
|
504
|
-
right: 0%;
|
|
505
|
-
top: 2px;
|
|
506
|
-
width: calc(100% - 2px);
|
|
507
|
-
height: calc(100% - 4px);
|
|
508
|
-
|
|
509
|
-
background: var(--drawer-button-shadow-background);
|
|
510
|
-
z-index: var(--layout-lvl-1);
|
|
511
|
-
border-radius: var(--border-button);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
494
|
.KIT__DrawerButton-module__full___AsBjM {
|
|
515
495
|
width: 100%;
|
|
516
496
|
}
|
|
497
|
+
|
|
517
498
|
.KIT__CasinoCategoryButton-module__wrapperCasinoCategory___Kn74K {
|
|
518
499
|
flex-shrink: 0;
|
|
519
500
|
cursor: pointer;
|
|
@@ -1940,14 +1921,16 @@
|
|
|
1940
1921
|
--drawer-min-width: 100px;
|
|
1941
1922
|
|
|
1942
1923
|
width: 90%;
|
|
1943
|
-
height: 100
|
|
1924
|
+
height: calc(100% - var(--height-48));
|
|
1944
1925
|
overflow-x: hidden;
|
|
1945
|
-
overflow-y: auto;
|
|
1946
1926
|
position: relative;
|
|
1947
1927
|
background: var(--drawer-modal-content-color);
|
|
1948
1928
|
padding: var(--indent-l);
|
|
1949
1929
|
z-index: var(--layout-lvl-1);
|
|
1950
1930
|
transition: 0.3s;
|
|
1931
|
+
display: flex;
|
|
1932
|
+
flex-direction: column;
|
|
1933
|
+
gap: var(--indent-m);
|
|
1951
1934
|
}
|
|
1952
1935
|
|
|
1953
1936
|
.KIT__DrawerLayout-module__animationOpenDrawer___Z3IOK {
|
|
@@ -2017,16 +2000,14 @@
|
|
|
2017
2000
|
.KIT__DrawerLayout-module__wrapperDrawer___DnsQm {
|
|
2018
2001
|
width: var(--drawer-full-width);
|
|
2019
2002
|
flex-shrink: 0;
|
|
2020
|
-
overflow-y: hidden;
|
|
2021
|
-
display: flex;
|
|
2022
|
-
flex-direction: column;
|
|
2023
2003
|
justify-content: space-between;
|
|
2024
2004
|
height: var(--app-height);
|
|
2025
2005
|
position: sticky;
|
|
2026
2006
|
background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;
|
|
2027
2007
|
background: initial;
|
|
2028
2008
|
top: 0;
|
|
2029
|
-
padding: 0;
|
|
2009
|
+
padding: 0 var(--indent-xxxl) var(--indent-xl);
|
|
2010
|
+
gap: var(--indent-xl);
|
|
2030
2011
|
}
|
|
2031
2012
|
|
|
2032
2013
|
.KIT__DrawerLayout-module__animationCasinoDrawerGrowing___wpvdM {
|
|
@@ -2039,6 +2020,7 @@
|
|
|
2039
2020
|
animation: none;
|
|
2040
2021
|
}
|
|
2041
2022
|
}
|
|
2023
|
+
|
|
2042
2024
|
.KIT__Logos-module__wrapperLogo___jKLCC {
|
|
2043
2025
|
--width: 100px;
|
|
2044
2026
|
--height: calc(var(--height-48) - var(--indent-m) / 2);
|
|
@@ -3393,16 +3375,13 @@
|
|
|
3393
3375
|
.KIT__Scratch-module__scratch___n0TBg {
|
|
3394
3376
|
width: 100%;
|
|
3395
3377
|
height: 100%;
|
|
3396
|
-
position: absolute;
|
|
3397
|
-
left: 0;
|
|
3398
|
-
top: 0;
|
|
3399
3378
|
|
|
3400
|
-
display:
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3379
|
+
display: grid;
|
|
3380
|
+
grid-template-columns: repeat(3, 1fr);
|
|
3381
|
+
grid-gap: var(--indent-m);
|
|
3382
|
+
gap: var(--indent-m);
|
|
3404
3383
|
padding: var(--indent-l);
|
|
3405
|
-
|
|
3384
|
+
position: relative;
|
|
3406
3385
|
}
|
|
3407
3386
|
|
|
3408
3387
|
.KIT__Scratch-module__scratchText___jISwD {
|
|
@@ -3424,8 +3403,6 @@
|
|
|
3424
3403
|
}
|
|
3425
3404
|
|
|
3426
3405
|
.KIT__Scratch-module__box___NjFhi {
|
|
3427
|
-
width: 32%;
|
|
3428
|
-
height: 32%;
|
|
3429
3406
|
position: relative;
|
|
3430
3407
|
cursor: pointer;
|
|
3431
3408
|
}
|