@scrabble-solver/scrabble-solver 2.13.6 → 2.13.8
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +11 -11
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_8dgz12 +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/577.js +1 -1
- package/.next/server/chunks/807.js +1 -1
- package/.next/server/chunks/977.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/api/solve.js +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/index.js +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/7zESQYo9UAqNh9LV0b7Sd/_buildManifest.js +1 -0
- package/.next/static/chunks/{main-6e708370ad13b1f9.js → main-b5b360c6afb66b05.js} +1 -1
- package/.next/static/chunks/pages/{404-129e0943628b6fab.js → 404-63b972b24be99c62.js} +1 -1
- package/.next/static/chunks/pages/_app-a2848b7efa6bb6b0.js +17 -0
- package/.next/static/chunks/pages/index-7b73be2915cc7099.js +1 -0
- package/.next/static/css/6682db14f926d4c7.css +1 -0
- package/.next/static/css/b37850c8d5270d91.css +2 -0
- package/.next/trace +44 -44
- package/package.json +12 -13
- package/src/components/Alert/Alert.module.scss +3 -12
- package/src/components/Board/Board.module.scss +1 -4
- package/src/components/Board/BoardPure.tsx +1 -1
- package/src/components/Board/components/Actions/Actions.module.scss +7 -27
- package/src/components/Board/components/Cell/Cell.module.scss +5 -32
- package/src/components/Board/components/InputPrompt/InputPrompt.module.scss +4 -18
- package/src/components/Board/hooks/useBackgroundImage.tsx +15 -4
- package/src/components/Board/hooks/useGrid.ts +13 -5
- package/src/components/Board/lib/index.ts +0 -1
- package/src/components/Button/Button.module.scss +1 -8
- package/src/components/Button/Button.tsx +16 -17
- package/src/components/Button/Link.tsx +15 -16
- package/src/components/Dictionary/Dictionary.module.scss +1 -8
- package/src/components/IconButton/IconButton.tsx +8 -8
- package/src/components/IconButton/Link.tsx +8 -8
- package/src/components/Loading/Loading.module.scss +1 -4
- package/src/components/Modal/Modal.module.scss +2 -16
- package/src/components/Rack/Rack.module.scss +4 -18
- package/src/components/Rack/components/InputPrompt/InputPrompt.module.scss +1 -4
- package/src/components/Results/Cell.tsx +4 -5
- package/src/components/Results/HeaderButton.tsx +25 -22
- package/src/components/Results/Result.tsx +15 -3
- package/src/components/Results/Results.module.scss +31 -48
- package/src/components/Results/Results.tsx +1 -1
- package/src/components/Results/getCoordinatesColumn.ts +15 -0
- package/src/components/Results/getLocaleColumns.ts +7 -0
- package/src/components/Results/types.ts +1 -0
- package/src/components/Results/useColumns.ts +10 -7
- package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +9 -40
- package/src/components/Tile/Tile.module.scss +6 -26
- package/src/components/Tooltip/Tooltip.tsx +28 -0
- package/src/components/Tooltip/TooltipContent.tsx +53 -0
- package/src/components/Tooltip/TooltipTrigger.tsx +26 -0
- package/src/components/Tooltip/context.ts +17 -0
- package/src/components/Tooltip/index.ts +1 -1
- package/src/components/Tooltip/useTooltip.ts +54 -0
- package/src/components/index.ts +1 -2
- package/src/hooks/index.ts +0 -1
- package/src/i18n/languages/german.json +1 -1
- package/src/icons/index.ts +0 -2
- package/src/lib/getCoordinates.ts +18 -0
- package/src/lib/groupResults.ts +16 -11
- package/src/lib/index.ts +2 -1
- package/src/lib/sortResults.ts +1 -0
- package/src/modals/KeyMapModal/components/Mapping/Mapping.module.scss +2 -2
- package/src/modals/MenuModal/MenuModal.module.scss +2 -15
- package/src/modals/RemainingTilesModal/RemainingTilesModal.module.scss +1 -7
- package/src/modals/WordsModal/WordsModal.module.scss +2 -15
- package/src/pages/_app.tsx +5 -1
- package/src/parameters/index.ts +1 -0
- package/src/styles/mixins.scss +2 -5
- package/src/types/index.ts +1 -0
- package/.next/static/4GWIKe7khKxREyq3ZamDK/_buildManifest.js +0 -1
- package/.next/static/chunks/pages/_app-cccda36d00fa2328.js +0 -17
- package/.next/static/chunks/pages/index-caaf20b2488cb10e.js +0 -1
- package/.next/static/css/11366b7489cf90ac.css +0 -1
- package/.next/static/css/f549d7823f599b8d.css +0 -2
- package/src/components/Checkbox/Checkbox.module.scss +0 -45
- package/src/components/Checkbox/Checkbox.tsx +0 -38
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/Tooltip/useTooltip.tsx +0 -134
- package/src/hooks/usePortal.tsx +0 -47
- package/src/icons/CheckboxChecked.svg +0 -4
- package/src/icons/CheckboxEmpty.svg +0 -4
- package/src/lib/canUseDom.ts +0 -3
- /package/.next/static/{4GWIKe7khKxREyq3ZamDK → 7zESQYo9UAqNh9LV0b7Sd}/_ssgManifest.js +0 -0
- /package/src/{components/Board/lib → lib}/getCoordinate.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/scrabble-solver",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.8",
|
|
4
4
|
"description": "Scrabble Solver 2 - App",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16"
|
|
@@ -27,28 +27,27 @@
|
|
|
27
27
|
"start": "env-cmd next start -p 3333"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@floating-ui/react": "^0.26.
|
|
30
|
+
"@floating-ui/react": "^0.26.17",
|
|
31
31
|
"@kamilmielnik/trie": "^3.0.0",
|
|
32
32
|
"@reduxjs/toolkit": "^2.2.5",
|
|
33
|
-
"@scrabble-solver/configs": "^2.13.
|
|
34
|
-
"@scrabble-solver/constants": "^2.13.
|
|
35
|
-
"@scrabble-solver/dictionaries": "^2.13.
|
|
36
|
-
"@scrabble-solver/logger": "^2.13.
|
|
37
|
-
"@scrabble-solver/solver": "^2.13.
|
|
38
|
-
"@scrabble-solver/types": "^2.13.
|
|
39
|
-
"@scrabble-solver/word-definitions": "^2.13.
|
|
33
|
+
"@scrabble-solver/configs": "^2.13.8",
|
|
34
|
+
"@scrabble-solver/constants": "^2.13.8",
|
|
35
|
+
"@scrabble-solver/dictionaries": "^2.13.8",
|
|
36
|
+
"@scrabble-solver/logger": "^2.13.8",
|
|
37
|
+
"@scrabble-solver/solver": "^2.13.8",
|
|
38
|
+
"@scrabble-solver/types": "^2.13.8",
|
|
39
|
+
"@scrabble-solver/word-definitions": "^2.13.8",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"env-cmd": "^10.1.0",
|
|
42
42
|
"include-media": "^2.0.0",
|
|
43
43
|
"include-media-query-builder": "^1.1.0",
|
|
44
|
-
"next": "^14.2.
|
|
44
|
+
"next": "^14.2.4",
|
|
45
45
|
"normalize.css": "^8.0.1",
|
|
46
46
|
"react": "^18.3.1",
|
|
47
47
|
"react-cool-onclickoutside": "^1.7.0",
|
|
48
48
|
"react-dom": "^18.3.1",
|
|
49
49
|
"react-highlight-words": "^0.20.0",
|
|
50
50
|
"react-modal": "^3.16.1",
|
|
51
|
-
"react-portal": "^4.2.2",
|
|
52
51
|
"react-redux": "^9.1.2",
|
|
53
52
|
"react-window": "^1.8.10",
|
|
54
53
|
"redux-saga": "^1.3.0",
|
|
@@ -71,7 +70,7 @@
|
|
|
71
70
|
"@types/react-window": "^1.8.8",
|
|
72
71
|
"@types/redux": "^3.6.31",
|
|
73
72
|
"@types/redux-saga": "^0.10.5",
|
|
74
|
-
"sass": "^1.77.
|
|
73
|
+
"sass": "^1.77.5"
|
|
75
74
|
},
|
|
76
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "294a7a790843ef9d260be52a3144e323c8ac0641"
|
|
77
76
|
}
|
|
@@ -14,18 +14,9 @@
|
|
|
14
14
|
justify-content: center;
|
|
15
15
|
padding: var(--spacing--m);
|
|
16
16
|
color: var(--color--foreground--secondary);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
border-bottom-left-radius: var(--border--radius);
|
|
21
|
-
border-right: var(--border);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
[dir='rtl'] & {
|
|
25
|
-
border-top-right-radius: var(--border--radius);
|
|
26
|
-
border-bottom-right-radius: var(--border--radius);
|
|
27
|
-
border-left: var(--border);
|
|
28
|
-
}
|
|
17
|
+
border-start-start-radius: var(--border--radius);
|
|
18
|
+
border-end-start-radius: var(--border--radius);
|
|
19
|
+
border-inline-end: var(--border);
|
|
29
20
|
|
|
30
21
|
.error & {
|
|
31
22
|
background-color: var(--color--red--light);
|
|
@@ -46,10 +46,7 @@
|
|
|
46
46
|
.iconBackground,
|
|
47
47
|
.icon {
|
|
48
48
|
position: absolute;
|
|
49
|
-
|
|
50
|
-
right: calc((100% - var(--size)) / 2);
|
|
51
|
-
bottom: calc((100% - var(--size)) / 2);
|
|
52
|
-
left: calc((100% - var(--size)) / 2);
|
|
49
|
+
inset: calc((100% - var(--size)) / 2);
|
|
53
50
|
width: var(--size);
|
|
54
51
|
height: var(--size);
|
|
55
52
|
}
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
15
|
import { FlagFill } from 'icons';
|
|
16
|
+
import { getCoordinate } from 'lib';
|
|
16
17
|
import { BORDER_WIDTH } from 'parameters';
|
|
17
18
|
import { Point } from 'types';
|
|
18
19
|
|
|
19
20
|
import styles from './Board.module.scss';
|
|
20
21
|
import { Cell } from './components';
|
|
21
|
-
import { getCoordinate } from './lib';
|
|
22
22
|
|
|
23
23
|
interface Props {
|
|
24
24
|
className?: string;
|
|
@@ -18,36 +18,16 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
& + & {
|
|
21
|
-
|
|
22
|
-
border-left: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[dir='rtl'] & {
|
|
26
|
-
border-right: none;
|
|
27
|
-
}
|
|
21
|
+
border-inline-start: none;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border-bottom-right-radius: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:last-child {
|
|
37
|
-
border-top-left-radius: 0;
|
|
38
|
-
border-bottom-left-radius: 0;
|
|
39
|
-
}
|
|
24
|
+
&:first-child {
|
|
25
|
+
border-start-end-radius: 0;
|
|
26
|
+
border-end-end-radius: 0;
|
|
40
27
|
}
|
|
41
28
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
border-bottom-left-radius: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:last-child {
|
|
49
|
-
border-top-right-radius: 0;
|
|
50
|
-
border-bottom-right-radius: 0;
|
|
51
|
-
}
|
|
29
|
+
&:last-child {
|
|
30
|
+
border-start-start-radius: 0;
|
|
31
|
+
border-end-start-radius: 0;
|
|
52
32
|
}
|
|
53
33
|
}
|
|
@@ -7,10 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
input {
|
|
9
9
|
position: absolute;
|
|
10
|
-
|
|
11
|
-
right: -100%;
|
|
12
|
-
left: -100%;
|
|
13
|
-
bottom: -100%;
|
|
10
|
+
inset: -100%;
|
|
14
11
|
width: 300%;
|
|
15
12
|
height: 300%;
|
|
16
13
|
clip-path: inset((100% / 3));
|
|
@@ -55,43 +52,19 @@
|
|
|
55
52
|
@include lighthouse-input-size-hack;
|
|
56
53
|
|
|
57
54
|
&.sharpTopLeft {
|
|
58
|
-
|
|
59
|
-
border-top-left-radius: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
[dir='rtl'] & {
|
|
63
|
-
border-top-right-radius: 0;
|
|
64
|
-
}
|
|
55
|
+
border-start-start-radius: 0;
|
|
65
56
|
}
|
|
66
57
|
|
|
67
58
|
&.sharpTopRight {
|
|
68
|
-
|
|
69
|
-
border-top-right-radius: 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
[dir='rtl'] & {
|
|
73
|
-
border-top-left-radius: 0;
|
|
74
|
-
}
|
|
59
|
+
border-start-end-radius: 0;
|
|
75
60
|
}
|
|
76
61
|
|
|
77
62
|
&.sharpBottomLeft {
|
|
78
|
-
|
|
79
|
-
border-bottom-left-radius: 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
[dir='rtl'] & {
|
|
83
|
-
border-bottom-right-radius: 0;
|
|
84
|
-
}
|
|
63
|
+
border-end-start-radius: 0;
|
|
85
64
|
}
|
|
86
65
|
|
|
87
66
|
&.sharpBottomRight {
|
|
88
|
-
|
|
89
|
-
border-bottom-right-radius: 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
[dir='rtl'] & {
|
|
93
|
-
border-bottom-left-radius: 0;
|
|
94
|
-
}
|
|
67
|
+
border-end-end-radius: 0;
|
|
95
68
|
}
|
|
96
69
|
|
|
97
70
|
&:focus-within {
|
|
@@ -9,15 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.toggleDirection {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
border-bottom-right-radius: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
[dir='rtl'] & {
|
|
18
|
-
border-top-left-radius: 0;
|
|
19
|
-
border-bottom-left-radius: 0;
|
|
20
|
-
}
|
|
12
|
+
border-start-end-radius: 0;
|
|
13
|
+
border-end-end-radius: 0;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
.input {
|
|
@@ -32,15 +25,8 @@
|
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
.insert {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
border-bottom-left-radius: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[dir='rtl'] & {
|
|
41
|
-
border-top-right-radius: 0;
|
|
42
|
-
border-bottom-right-radius: 0;
|
|
43
|
-
}
|
|
28
|
+
border-start-start-radius: 0;
|
|
29
|
+
border-end-start-radius: 0;
|
|
44
30
|
}
|
|
45
31
|
|
|
46
32
|
.insertIcon {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable max-statements */
|
|
1
|
+
/* eslint-disable max-lines, max-statements */
|
|
2
2
|
|
|
3
3
|
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
|
|
4
4
|
import { useMemo } from 'react';
|
|
@@ -146,10 +146,21 @@ const useBackgroundImage = () => {
|
|
|
146
146
|
</symbol>
|
|
147
147
|
</defs>
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
{showCoordinates === 'hidden' && (
|
|
150
|
+
<rect fill="white" height={viewBoxHeight} rx={borderRadius} width={viewBoxWidth} x="0" y="0" />
|
|
151
|
+
)}
|
|
150
152
|
|
|
151
153
|
{showCoordinates !== 'hidden' && (
|
|
152
154
|
<>
|
|
155
|
+
<rect fill={COLOR_BACKGROUND} height={viewBoxHeight} rx={borderRadius} width={viewBoxWidth} x="0" y="0" />
|
|
156
|
+
<rect
|
|
157
|
+
fill="white"
|
|
158
|
+
height={viewBoxHeight - coordinatesSize}
|
|
159
|
+
width={viewBoxWidth - coordinatesSize}
|
|
160
|
+
x={direction === 'ltr' ? coordinatesSize : 0}
|
|
161
|
+
y={coordinatesSize}
|
|
162
|
+
/>
|
|
163
|
+
|
|
153
164
|
<rect fill={COLOR_BACKGROUND} height={coordinatesSize} rx={borderRadius} width={viewBoxWidth} x="0" y="0" />
|
|
154
165
|
<rect
|
|
155
166
|
fill={COLOR_BACKGROUND}
|
|
@@ -159,10 +170,10 @@ const useBackgroundImage = () => {
|
|
|
159
170
|
y="0"
|
|
160
171
|
width={coordinatesSize}
|
|
161
172
|
/>
|
|
162
|
-
<use href={`#${HORIZONTAL_LINE}`} y={coordinatesSize} />
|
|
173
|
+
<use href={`#${HORIZONTAL_LINE}`} y={coordinatesSize - BORDER_WIDTH} />
|
|
163
174
|
<use
|
|
164
175
|
href={`#${VERTICAL_LINE}`}
|
|
165
|
-
x={direction === 'ltr' ? coordinatesSize : viewBoxWidth - coordinatesSize - BORDER_WIDTH}
|
|
176
|
+
x={direction === 'ltr' ? coordinatesSize - BORDER_WIDTH : viewBoxWidth - coordinatesSize - BORDER_WIDTH}
|
|
166
177
|
/>
|
|
167
178
|
</>
|
|
168
179
|
)}
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
ChangeEvent,
|
|
7
7
|
ChangeEventHandler,
|
|
8
8
|
ClipboardEventHandler,
|
|
9
|
-
createRef,
|
|
10
9
|
KeyboardEventHandler,
|
|
11
10
|
RefObject,
|
|
11
|
+
createRef,
|
|
12
12
|
useCallback,
|
|
13
13
|
useMemo,
|
|
14
14
|
useState,
|
|
@@ -54,14 +54,22 @@ const useGrid = (rows: Cell[][]): [State, Actions] => {
|
|
|
54
54
|
const [direction, setLastDirection] = useState<Direction>('horizontal');
|
|
55
55
|
const directionRef = useLatest(direction);
|
|
56
56
|
|
|
57
|
+
const safeActiveIndex = useMemo(
|
|
58
|
+
() => ({
|
|
59
|
+
x: Math.min(activeIndex.x, width - 1),
|
|
60
|
+
y: Math.min(activeIndex.y, height - 1),
|
|
61
|
+
}),
|
|
62
|
+
[activeIndex, width, height],
|
|
63
|
+
);
|
|
64
|
+
|
|
57
65
|
const changeActiveIndex = useCallback(
|
|
58
66
|
(offsetX: number, offsetY: number) => {
|
|
59
|
-
const x = Math.min(Math.max(
|
|
60
|
-
const y = Math.min(Math.max(
|
|
67
|
+
const x = Math.min(Math.max(safeActiveIndex.x + offsetX, 0), width - 1);
|
|
68
|
+
const y = Math.min(Math.max(safeActiveIndex.y + offsetY, 0), height - 1);
|
|
61
69
|
setActiveIndex({ x, y });
|
|
62
70
|
inputRefs[y][x].current?.focus();
|
|
63
71
|
},
|
|
64
|
-
[
|
|
72
|
+
[safeActiveIndex, inputRefs],
|
|
65
73
|
);
|
|
66
74
|
|
|
67
75
|
const getInputRefPosition = useCallback(
|
|
@@ -358,7 +366,7 @@ const useGrid = (rows: Cell[][]): [State, Actions] => {
|
|
|
358
366
|
);
|
|
359
367
|
|
|
360
368
|
return [
|
|
361
|
-
{ activeIndex, direction, inputRefs },
|
|
369
|
+
{ activeIndex: safeActiveIndex, direction, inputRefs },
|
|
362
370
|
{ insertValue, onChange, onDirectionToggle, onFocus, onKeyDown, onPaste },
|
|
363
371
|
];
|
|
364
372
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ButtonHTMLAttributes, FunctionComponent, ReactNode, SVGAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Tooltip } from '../Tooltip';
|
|
5
5
|
|
|
6
6
|
import styles from './Button.module.scss';
|
|
7
7
|
import Link from './Link';
|
|
@@ -23,23 +23,22 @@ const Button: FunctionComponent<Props> = ({
|
|
|
23
23
|
variant = 'default',
|
|
24
24
|
...props
|
|
25
25
|
}) => {
|
|
26
|
-
const triggerProps = useTooltip(tooltip, props);
|
|
27
|
-
|
|
28
26
|
return (
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
<Tooltip tooltip={tooltip}>
|
|
28
|
+
<button
|
|
29
|
+
className={classNames(styles.button, className, {
|
|
30
|
+
[styles.default]: variant === 'default',
|
|
31
|
+
[styles.primary]: variant === 'primary',
|
|
32
|
+
})}
|
|
33
|
+
type="button"
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
<span className={styles.content}>
|
|
37
|
+
{Icon && <Icon className={classNames(styles.icon, iconClassName)} />}
|
|
38
|
+
{children && <span className={styles.label}>{children}</span>}
|
|
39
|
+
</span>
|
|
40
|
+
</button>
|
|
41
|
+
</Tooltip>
|
|
43
42
|
);
|
|
44
43
|
};
|
|
45
44
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { AnchorHTMLAttributes, FunctionComponent, ReactNode, SVGAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Tooltip } from '../Tooltip';
|
|
5
5
|
|
|
6
6
|
import styles from './Button.module.scss';
|
|
7
7
|
|
|
@@ -23,22 +23,21 @@ const Link: FunctionComponent<Props> = ({
|
|
|
23
23
|
variant = 'default',
|
|
24
24
|
...props
|
|
25
25
|
}) => {
|
|
26
|
-
const triggerProps = useTooltip(tooltip, props);
|
|
27
|
-
|
|
28
26
|
return (
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
<Tooltip tooltip={tooltip}>
|
|
28
|
+
<a
|
|
29
|
+
className={classNames(styles.button, className, {
|
|
30
|
+
[styles.default]: variant === 'default',
|
|
31
|
+
[styles.primary]: variant === 'primary',
|
|
32
|
+
})}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
<span className={styles.content}>
|
|
36
|
+
{Icon && <Icon className={classNames(styles.icon, iconClassName)} />}
|
|
37
|
+
{children && <span className={styles.label}>{children}</span>}
|
|
38
|
+
</span>
|
|
39
|
+
</a>
|
|
40
|
+
</Tooltip>
|
|
42
41
|
);
|
|
43
42
|
};
|
|
44
43
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { ButtonHTMLAttributes, FunctionComponent, MouseEventHandler, SVGAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Tooltip } from '../Tooltip';
|
|
5
5
|
|
|
6
6
|
import styles from './IconButton.module.scss';
|
|
7
7
|
import Link from './Link';
|
|
@@ -15,14 +15,14 @@ interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const IconButton: FunctionComponent<Props> = ({ className, Icon, tooltip, ...props }) => {
|
|
18
|
-
const triggerProps = useTooltip(tooltip, props);
|
|
19
|
-
|
|
20
18
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
<Tooltip tooltip={tooltip}>
|
|
20
|
+
<button className={classNames(styles.iconButton, className)} type="button" {...props}>
|
|
21
|
+
<span className={styles.content}>
|
|
22
|
+
<Icon className={styles.icon} />
|
|
23
|
+
</span>
|
|
24
|
+
</button>
|
|
25
|
+
</Tooltip>
|
|
26
26
|
);
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { AnchorHTMLAttributes, FunctionComponent, SVGAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Tooltip } from '../Tooltip';
|
|
5
5
|
|
|
6
6
|
import styles from './IconButton.module.scss';
|
|
7
7
|
|
|
@@ -14,14 +14,14 @@ interface Props extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const Link: FunctionComponent<Props> = ({ className, Icon, tooltip, ...props }) => {
|
|
17
|
-
const triggerProps = useTooltip(tooltip, props);
|
|
18
|
-
|
|
19
17
|
return (
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
<Tooltip tooltip={tooltip}>
|
|
19
|
+
<a className={classNames(styles.iconButton, className)} {...props}>
|
|
20
|
+
<span className={styles.content}>
|
|
21
|
+
<Icon className={styles.icon} />
|
|
22
|
+
</span>
|
|
23
|
+
</a>
|
|
24
|
+
</Tooltip>
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -3,14 +3,7 @@
|
|
|
3
3
|
.modal,
|
|
4
4
|
.closeButton {
|
|
5
5
|
top: 0;
|
|
6
|
-
|
|
7
|
-
[dir='ltr'] & {
|
|
8
|
-
right: 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
[dir='rtl'] & {
|
|
12
|
-
left: 0;
|
|
13
|
-
}
|
|
6
|
+
inset-inline-end: 0;
|
|
14
7
|
}
|
|
15
8
|
|
|
16
9
|
.modal {
|
|
@@ -92,14 +85,7 @@
|
|
|
92
85
|
.title {
|
|
93
86
|
font-size: var(--font--size--h1);
|
|
94
87
|
font-weight: 300;
|
|
95
|
-
|
|
96
|
-
[dir='ltr'] & {
|
|
97
|
-
padding-right: calc(var(--square-button--size) + var(--spacing--s));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
[dir='rtl'] & {
|
|
101
|
-
padding-left: calc(var(--square-button--size) + var(--spacing--s));
|
|
102
|
-
}
|
|
88
|
+
padding-inline-end: calc(var(--square-button--size) + var(--spacing--s));
|
|
103
89
|
}
|
|
104
90
|
|
|
105
91
|
.closeButton {
|
|
@@ -77,25 +77,11 @@
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.sharpLeft {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
border-bottom-left-radius: 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
[dir='rtl'] & {
|
|
86
|
-
border-top-right-radius: 0;
|
|
87
|
-
border-bottom-right-radius: 0;
|
|
88
|
-
}
|
|
80
|
+
border-start-start-radius: 0;
|
|
81
|
+
border-end-start-radius: 0;
|
|
89
82
|
}
|
|
90
83
|
|
|
91
84
|
.sharpRight {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
border-bottom-right-radius: 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
[dir='rtl'] & {
|
|
98
|
-
border-top-left-radius: 0;
|
|
99
|
-
border-bottom-left-radius: 0;
|
|
100
|
-
}
|
|
85
|
+
border-start-end-radius: 0;
|
|
86
|
+
border-end-end-radius: 0;
|
|
101
87
|
}
|
|
@@ -4,7 +4,7 @@ import { FunctionComponent, ReactNode } from 'react';
|
|
|
4
4
|
import { selectLocale, useTranslate, useTypedSelector } from 'state';
|
|
5
5
|
import { TranslationKey } from 'types';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Tooltip } from '../Tooltip';
|
|
8
8
|
|
|
9
9
|
import styles from './Results.module.scss';
|
|
10
10
|
|
|
@@ -20,12 +20,11 @@ const Cell: FunctionComponent<Props> = ({ children, className, translationKey, t
|
|
|
20
20
|
const translate = useTranslate();
|
|
21
21
|
const locale = useTypedSelector(selectLocale);
|
|
22
22
|
const formattedValue = value.toLocaleString(locale);
|
|
23
|
-
const triggerProps = useTooltip(`${translate(translationKey)}: ${tooltip || formattedValue}`);
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
|
-
<
|
|
27
|
-
{children || formattedValue}
|
|
28
|
-
</
|
|
25
|
+
<Tooltip tooltip={`${translate(translationKey)}: ${tooltip || formattedValue}`}>
|
|
26
|
+
<div className={classNames(styles.cell, className)}>{children || formattedValue}</div>
|
|
27
|
+
</Tooltip>
|
|
29
28
|
);
|
|
30
29
|
};
|
|
31
30
|
|