@enigma-lake/tower-play-controller-sdk 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.
- package/README.md +202 -0
- package/dist/components/AutoManualPlayStateProvider/AutoManualPlayProvider.d.ts +9 -0
- package/dist/components/AutoManualPlayStateProvider/AutoManualPlayStateContext.d.ts +28 -0
- package/dist/components/AutoManualPlayStateProvider/index.d.ts +1 -0
- package/dist/components/base/AutoPlayController/AutoPlayController.d.ts +2 -0
- package/dist/components/base/AutoPlayController/index.d.ts +1 -0
- package/dist/components/base/Button/Button.d.ts +21 -0
- package/dist/components/base/Button/index.d.ts +1 -0
- package/dist/components/base/ChevronIcon/ChevronIcon.d.ts +5 -0
- package/dist/components/base/ChevronIcon/index.d.ts +1 -0
- package/dist/components/base/DifficultySelector/DifficultySelector.d.ts +14 -0
- package/dist/components/base/DifficultySelector/Selector.d.ts +3 -0
- package/dist/components/base/DifficultySelector/types.d.ts +16 -0
- package/dist/components/base/GroupRow/GroupRow.d.ts +6 -0
- package/dist/components/base/GroupRow/index.d.ts +1 -0
- package/dist/components/base/Input/Input.d.ts +3 -0
- package/dist/components/base/Input/cleanInputNumber.d.ts +2 -0
- package/dist/components/base/Input/index.d.ts +1 -0
- package/dist/components/base/InputWithIcon/InputWithIcon.d.ts +15 -0
- package/dist/components/base/InputWithIcon/index.d.ts +1 -0
- package/dist/components/base/InputWithSwitch/InputWithSwitch.d.ts +15 -0
- package/dist/components/base/InputWithSwitch/index.d.ts +1 -0
- package/dist/components/base/ManualPlayController/ManualPlayController.d.ts +2 -0
- package/dist/components/base/ManualPlayController/index.d.ts +1 -0
- package/dist/components/base/PlayController/PlayController.d.ts +15 -0
- package/dist/components/base/SelectMenu/GoldIcon.d.ts +1 -0
- package/dist/components/base/SelectMenu/SelectMenu.d.ts +11 -0
- package/dist/components/base/SelectMenu/SweepsIcon.d.ts +1 -0
- package/dist/components/base/SelectMenu/index.d.ts +1 -0
- package/dist/components/base/Switch/Switch.d.ts +10 -0
- package/dist/components/base/index.d.ts +6 -0
- package/dist/components/hooks/usePlayController.d.ts +27 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/utils.d.ts +5 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.mjs +568 -0
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/gameMode.d.ts +9 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/playController.d.ts +53 -0
- package/package.json +84 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Button-module__base___muNxk{background:transparent;border:0;cursor:pointer;font-weight:700;margin:0;outline:none;user-select:none}.Button-module__base__theme-ghost___I5-LJ{align-items:center;backdrop-filter:blur(10px);border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;height:100%;width:100%}.Button-module__base__theme-ghost___I5-LJ:active,.Button-module__base__theme-ghost___I5-LJ:focus,.Button-module__base__theme-ghost___I5-LJ:hover{background:rgba(var(--bg-color-rgb),.05)}.Button-module__base__theme-primary___Zuswb{align-items:center;border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;height:39px;justify-content:center;letter-spacing:.75px;line-height:125%;margin-top:7px;width:100%}.Button-module__base__state-disabled___EU5tH{color:rgba(var(--text-color-hex),.5)!important;pointer-events:none}.Button-module__buttonCashout___LG-Yr{background:linear-gradient(357deg,#7f44c3 22.01%,#9f5eeb 97.97%)}.Button-module__buttonCashout___LG-Yr:active,.Button-module__buttonCashout__active___qnE3h{background:#592f9d}.Button-module__buttonSweeps___0snDQ{background:linear-gradient(357deg,#10be68 23.9%,#29cf7d 97.97%)}.Button-module__buttonSweeps___0snDQ:active,.Button-module__buttonSweeps__active___PXIFH{background:#008c47}.Button-module__buttonGold___DAj-d{background:linear-gradient(357deg,#bf9e21 22.01%,#f0c72c 97.97%)}.Button-module__buttonGold___DAj-d:active,.Button-module__buttonGold__active___vsi7m{background:#9a7c04}.GroupRow-module__base___b241-{display:flex;width:100%}.GroupRow-module__label___Du57P{color:hsla(0,6%,41%,.6);font-size:12px;font-style:Inter;font-weight:700;letter-spacing:.02em;line-height:18px;margin-bottom:6px}.GroupRow-module__group___V7xa6{display:flex;margin-top:5px;width:100%}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8{border-radius:0;box-sizing:border-box}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8:last-child{border-bottom-right-radius:10px;border-top-right-radius:10px}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8:first-child{border-bottom-left-radius:10px;border-top-left-radius:10px}.GroupRow-module__group___V7xa6 .GroupRow-module__groupItem___yNSX8+.GroupRow-module__groupItem___yNSX8{margin-left:2px}.GroupRow-module__x2___9bLae{align-items:center;background:hsla(0,0%,100%,.15);cursor:pointer;display:block;display:flex;font-family:Inter;font-size:15px;font-style:normal;font-weight:700;height:35px;justify-content:center;width:35px}.GroupRow-module__x2___9bLae.GroupRow-module__last___ArsSn{border-bottom-right-radius:10px;border-top-right-radius:10px}.GroupRow-module__gap-2___1eib1{gap:9px}.Input-module__base___IifiA{border:none;color:rgba(var(--text-color-hex),1);outline:none;padding:10px 12px;user-select:none!important;width:100%}.Input-module__disabled___WqyKa{color:rgba(var(--text-color-hex),.1)!important;cursor:pointer;pointer-events:none}.Switch-module__base___gj2ey{align-items:center;cursor:pointer;display:flex;gap:6px}.Switch-module__switcher___gHXIx{align-items:center;background-color:#0e2749;border-radius:23px;cursor:pointer;display:inline-flex;height:21px;justify-content:center;position:relative;transition:background-color .3s ease;width:43px}.Switch-module__gold___oewnb{background-color:#d4af26}.Switch-module__sweeps___yS-IY{background-color:#10be68}.Switch-module__unchecked___ooSS2{background-color:rgba(14,39,73,.722)}.Switch-module__disabled___lMRv0{opacity:.1}.Switch-module__base___gj2ey .Switch-module__thumb___1wJ9D{background-color:#5c74b1;border-radius:50%;cursor:pointer;height:17px;left:3px;position:absolute;transition:all .3s ease;width:17px}.Switch-module__base___gj2ey .Switch-module__thumb___1wJ9D.Switch-module__move-right___ca-6D{background-color:#fff;transform:translateX(21px)}.Switch-module__base___gj2ey .Switch-module__label___pG2uz{color:#fff;cursor:pointer;font-family:Inter;font-size:10px;font-style:normal;font-weight:700;letter-spacing:.5px;line-height:125%}.InputWithIcon-module__base___FwgXx{background:hsla(0,0%,100%,.15);border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;font-family:Inter;font-size:15px;font-style:normal;font-weight:700;height:35px;position:relative;width:100%;z-index:1}.InputWithIcon-module__icon___KtOjW{display:block;font-family:Inter;font-size:15px;font-style:normal;font-weight:700;left:11px;position:absolute;top:50%;transform:translateY(-50%)}.InputWithIcon-module__inputWithLabel___06L8W,.InputWithIcon-module__input___mQFr9,.InputWithIcon-module__label___O28vw{background:transparent;color:rgba(var(--text-color-hex),1);margin-left:50px;padding:0;text-align:left;width:146px}.InputWithIcon-module__label___O28vw{font-size:10px;position:absolute;top:2px}.InputWithIcon-module__inputWithLabel___06L8W{padding-top:15px;user-select:none;z-index:1}.InputWithIcon-module__gold___GlVw1{color:#d4af26}.InputWithIcon-module__sweeps___J4JdJ{color:#10be68}.SelectMenu-module__button___N-HeB{align-items:center;display:flex;gap:3px;height:35px;justify-content:space-between;transition:all .7s;width:35px}.SelectMenu-module__menu___c5jvZ{cursor:pointer;width:auto}.SelectMenu-module__menuItems___BX1YQ{background-color:rgba(var(--play-dropdown-bg),1);border-radius:6px;cursor:pointer;overflow-y:auto;padding:4px 0;width:100%;width:110px}.SelectMenu-module__menuItem___eXbi3{align-items:center;background-color:rgba(var(--play-dropdown-bg),1);color:rgba(var(--text-color-hex),1);display:flex;font-size:12px;font-weight:600;gap:6px;padding:2px 12px}.SelectMenu-module__menuItem___eXbi3:hover{background:rgba(var(--bg-color-rgb),.16);color:rgba(var(--text-color-hex),1)}.SelectMenu-module__selected___XyADw{position:relative}.SelectMenu-module__selected___XyADw:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' d='M20.53 6.47a.75.75 0 0 1 0 1.06l-10 10a.75.75 0 0 1-1.06 0l-5-5a.75.75 0 1 1 1.06-1.06L10 15.94l9.47-9.47a.75.75 0 0 1 1.06 0Z' clip-rule='evenodd' fill='%23FFF'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain;content:"";height:16px;position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px}.SelectMenu-module__disabled___jiTPl{cursor:not-allowed}.SelectMenu-module__disabled___jiTPl svg{opacity:.1}.ChevronIcon-module__chevron___lif8s{stroke:rgba(var(--text-color-hex),1);height:14px;transform-origin:center;transition:transform .3s ease;width:14px}.ChevronIcon-module__open___niD1n{transform:rotate(-180deg)}.ChevronIcon-module__disable___8n-xg{stroke:rgba(var(--text-color-hex),.1)}.UI-module__base___wThyQ{align-items:center;border-radius:15px;display:flex;flex-direction:column;justify-content:center;position:relative}.UI-module__betForm___hQkYd{background-color:rgba(var(--play-panel-bg),.5);bottom:var(--play-bottom);display:flex;flex-direction:column;height:148px;left:50%;padding:12px;position:absolute;transform:translate(-50%);width:294px}.UI-module__disabled___dnZJX{opacity:.1}.UI-module__auto___5peb8{align-items:center;background:hsla(0,0%,100%,.15);border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;font-family:Inter;font-size:15px;font-weight:700;height:35px;justify-content:center;padding:0 9px;position:relative;width:100%}.DifficultySelector-module__base___lDaQ-{align-items:center;display:flex;gap:9px;width:100%}.Selector-module__base___-q0yf{align-items:center;color:rgba(var(--text-color-hex),1);display:flex;font-weight:400;gap:5px;justify-items:center;width:88px}.Selector-module__label___JJdbd{color:rgba(var(--text-color-hex),1);font-size:10px;font-weight:700;letter-spacing:.5px}.Selector-module__button___MeRoC{align-items:center;background-color:rgba(var(--play-dropdown-bg),1);border-radius:9px;display:flex;font-size:12px;font-weight:600;height:26px;justify-content:space-between;padding:0 11px;position:relative;text-align:left;transition:all .7s;width:88px}.Selector-module__menu___P0ROg{cursor:pointer;width:88px}.Selector-module__menuItems___chFk2{background-color:rgba(var(--play-dropdown-bg),1);border-radius:6px;cursor:pointer;overflow-y:auto;padding:4px 0;width:100%;width:88px}.Selector-module__menuItems___chFk2:focus-visible{border:none;outline:none}.Selector-module__menuItem___isa4c{align-items:center;background-color:rgba(var(--play-dropdown-bg),1);color:rgba(var(--text-color-hex),1);display:flex;font-size:12px;font-weight:600;gap:6px;padding:2px 12px}.Selector-module__menuItem___isa4c:hover{background:rgba(var(--bg-color-rgb),.16);color:rgba(var(--text-color-hex),1)}.Selector-module__selected___nUJtR{position:relative}.Selector-module__selected___nUJtR:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' d='M20.53 6.47a.75.75 0 0 1 0 1.06l-10 10a.75.75 0 0 1-1.06 0l-5-5a.75.75 0 1 1 1.06-1.06L10 15.94l9.47-9.47a.75.75 0 0 1 1.06 0Z' clip-rule='evenodd' fill='%23FFF'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain;content:"";height:16px;position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px}.Selector-module__disabled___f1qGJ{background-color:rgba(var(--play-dropdown-bg),.5);cursor:not-allowed}.Selector-module__disabled___f1qGJ svg{opacity:.1}*,html{--bet-bottom:15px;--bet-panel-bg:8,30,100;--play-dropdown-bg:16,36,63;--bg-color-rgb:255,255,255;--text-color-hex:255,255,255;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*,.InputWithSwitch-module__base___vjLoh,html{font-family:Inter;font-size:15px;font-style:normal;font-weight:700}.InputWithSwitch-module__base___vjLoh{align-items:center;border-radius:10px;color:rgba(var(--text-color-hex),1);display:flex;gap:7px;height:35px;position:relative;width:100%;z-index:1}.InputWithSwitch-module__icon___upeAL{display:block;font-family:Inter;font-size:15px;font-style:normal;font-weight:700}.InputWithSwitch-module__input___K6RCD,.InputWithSwitch-module__label___tEjpj{background:transparent;color:rgba(var(--text-color-hex),1);max-width:90px;padding:0;text-align:center}.InputWithSwitch-module__label___tEjpj{font-size:10px;position:absolute;top:2px}.InputWithSwitch-module__gold___MO4qj{color:#d4af26}.InputWithSwitch-module__sweeps___jvyQd{color:#10be68}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Currency, PlayLimits } from "@enigma-lake/zoot-platform-sdk";
|
|
2
|
+
import { RiskTypes } from "../components/base/DifficultySelector/types";
|
|
3
|
+
export type StylingProps = {
|
|
4
|
+
panel: {
|
|
5
|
+
bottom: string;
|
|
6
|
+
bgColorHex: string;
|
|
7
|
+
};
|
|
8
|
+
dropdown: {
|
|
9
|
+
bgColorHex: string;
|
|
10
|
+
riskColorConfig: {
|
|
11
|
+
[RiskTypes.LOW]: string;
|
|
12
|
+
[RiskTypes.MEDIUM]: string;
|
|
13
|
+
[RiskTypes.HIGH]: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type CurrencyProps = {
|
|
18
|
+
currentCurrency: Currency;
|
|
19
|
+
currencies: Currency[];
|
|
20
|
+
winText: string;
|
|
21
|
+
};
|
|
22
|
+
export type ActionsProps = {
|
|
23
|
+
onPlay: () => void;
|
|
24
|
+
onAutoPlay: (selection: number[], next: () => void, stop: () => void) => void;
|
|
25
|
+
onCashout: () => void;
|
|
26
|
+
};
|
|
27
|
+
export type PlaySettingsProps = {
|
|
28
|
+
isPlaying: boolean;
|
|
29
|
+
canCashout: boolean;
|
|
30
|
+
disabledController: boolean;
|
|
31
|
+
risks: RiskTypes[];
|
|
32
|
+
currentRisk: RiskTypes;
|
|
33
|
+
onRiskChange: (risk: RiskTypes) => void;
|
|
34
|
+
disabledMenu: boolean;
|
|
35
|
+
displayController: boolean;
|
|
36
|
+
disableInput: boolean;
|
|
37
|
+
showAutoPlayToast: (props: {
|
|
38
|
+
type: "success" | "error" | "warning" | "info";
|
|
39
|
+
message: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
playHook: () => {
|
|
42
|
+
playLimits?: PlayLimits;
|
|
43
|
+
playAmount: number;
|
|
44
|
+
setPlayAmount: (value: number) => void;
|
|
45
|
+
};
|
|
46
|
+
autoPlayDelay?: number;
|
|
47
|
+
};
|
|
48
|
+
export type PlayControllerProps = StylingProps & ActionsProps & {
|
|
49
|
+
currencyOptions: CurrencyProps;
|
|
50
|
+
playOptions: PlaySettingsProps;
|
|
51
|
+
};
|
|
52
|
+
export declare const PLAY_HALVE = 0.5;
|
|
53
|
+
export declare const PLAY_DOUBLE = 2;
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@enigma-lake/tower-play-controller-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A React component library for building gameplay interfaces",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"style": "dist/style.css",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc && rollup -c --bundleConfigAsCjs",
|
|
15
|
+
"start": "webpack serve --mode development --open",
|
|
16
|
+
"eslint": "eslint --cache --fix .",
|
|
17
|
+
"eslint:check": "eslint .",
|
|
18
|
+
"prettier": "prettier --write .",
|
|
19
|
+
"prettier:check": "prettier --check ."
|
|
20
|
+
},
|
|
21
|
+
"keywords": [],
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "ISC",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"dist/style.css",
|
|
27
|
+
"dist/index.js",
|
|
28
|
+
"dist/index.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@enigma-lake/zoot-platform-sdk": "^1.0.21",
|
|
32
|
+
"@headlessui/react": "^2.2.0",
|
|
33
|
+
"@types/react": "^19.0.7",
|
|
34
|
+
"@types/react-dom": "^19.0.3",
|
|
35
|
+
"react": "18.2.0",
|
|
36
|
+
"react-dom": "18.2.0",
|
|
37
|
+
"use-debounce": "^10.0.4"
|
|
38
|
+
},
|
|
39
|
+
"resolutions": {
|
|
40
|
+
"react": "18.2.0",
|
|
41
|
+
"react-dom": "18.2.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@babel/core": "^7.26.0",
|
|
45
|
+
"@babel/preset-env": "^7.26.0",
|
|
46
|
+
"@babel/preset-react": "^7.26.3",
|
|
47
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
48
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
49
|
+
"@rollup/plugin-inject": "^5.0.5",
|
|
50
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
51
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
52
|
+
"@types/node": "^22.10.6",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
54
|
+
"@typescript-eslint/parser": "^8.20.0",
|
|
55
|
+
"babel-loader": "^9.2.1",
|
|
56
|
+
"classnames": "^2.5.1",
|
|
57
|
+
"css-loader": "^7.1.2",
|
|
58
|
+
"eslint": "^9.18.0",
|
|
59
|
+
"eslint-config-prettier": "^10.0.1",
|
|
60
|
+
"eslint-plugin-import": "^2.31.0",
|
|
61
|
+
"eslint-plugin-prettier": "^5.2.2",
|
|
62
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
63
|
+
"eslint-plugin-react": "^7.37.4",
|
|
64
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
65
|
+
"eslint-plugin-storybook": "^0.11.2",
|
|
66
|
+
"mini-css-extract-plugin": "^2.9.2",
|
|
67
|
+
"prettier": "^3.4.2",
|
|
68
|
+
"react-switch": "^7.1.0",
|
|
69
|
+
"rollup": "^4.30.1",
|
|
70
|
+
"rollup-plugin-delete": "^2.1.0",
|
|
71
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
72
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
73
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
74
|
+
"rollup-plugin-sass": "^1.15.0",
|
|
75
|
+
"sass": "^1.83.4",
|
|
76
|
+
"sass-loader": "^16.0.4",
|
|
77
|
+
"style-loader": "^4.0.0",
|
|
78
|
+
"ts-loader": "^9.5.2",
|
|
79
|
+
"typescript": "^5.7.3",
|
|
80
|
+
"webpack": "^5.97.1",
|
|
81
|
+
"webpack-cli": "^6.0.1",
|
|
82
|
+
"webpack-dev-server": "^5.2.0"
|
|
83
|
+
}
|
|
84
|
+
}
|