@seamly/web-ui 21.0.2-beta.4 → 21.0.2-beta.5
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/build/dist/lib/components.js +10 -4
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/index.debug.js +3 -3
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +11 -5
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +11 -5
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +12 -6
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles-default-implementation.js +1 -1
- package/build/dist/lib/styles.js +1 -1
- package/build/dist/lib/utils.js +11 -5
- package/build/dist/lib/utils.min.js +1 -1
- package/package.json +7 -6
- package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +20 -19
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +2 -0
- package/src/javascripts/style-guide/components/view.js +2 -2
- package/src/stylesheets/5-components/_translation-options.scss +23 -35
- package/src/stylesheets/6-default-implementation/_hover.scss +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamly/web-ui",
|
|
3
|
-
"version": "21.0.2-beta.
|
|
3
|
+
"version": "21.0.2-beta.5",
|
|
4
4
|
"main": "build/dist/lib/index.js",
|
|
5
5
|
"types": "build/src/javascripts/index.d.ts",
|
|
6
6
|
"module": "",
|
|
@@ -58,22 +58,23 @@
|
|
|
58
58
|
"babel-loader": "^9.0.1",
|
|
59
59
|
"babel-plugin-react-remove-properties": "^0.3.0",
|
|
60
60
|
"copy-webpack-plugin": "^11.0.0",
|
|
61
|
+
"cypress": "^10.11.0",
|
|
61
62
|
"cypress-file-upload": "^5.0.8",
|
|
63
|
+
"cypress-plugin-tab": "^1.0.5",
|
|
62
64
|
"cypress-wait-until": "^1.7.2",
|
|
63
|
-
"cypress": "^10.11.0",
|
|
64
65
|
"debug": "^4.3.4",
|
|
66
|
+
"eslint": "^8.27.0",
|
|
65
67
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
66
68
|
"eslint-import-resolver-typescript": "^3.5.2",
|
|
67
69
|
"eslint-plugin-cypress": "^2.12.1",
|
|
68
70
|
"eslint-plugin-import": "^2.26.0",
|
|
69
71
|
"eslint-plugin-jest": "^27.1.3",
|
|
70
|
-
"eslint": "^8.27.0",
|
|
71
72
|
"file-loader": "^6.2.0",
|
|
72
73
|
"glob": "^8.0.3",
|
|
73
74
|
"husky": "^8.0.1",
|
|
74
75
|
"ignore-loader": "^0.1.2",
|
|
75
|
-
"jest-environment-jsdom": "^27.5.1",
|
|
76
76
|
"jest": "^27.5.1",
|
|
77
|
+
"jest-environment-jsdom": "^27.5.1",
|
|
77
78
|
"mini-css-extract-plugin": "^2.6.1",
|
|
78
79
|
"postcss": "8",
|
|
79
80
|
"preact": "^10.11.2",
|
|
@@ -86,11 +87,11 @@
|
|
|
86
87
|
"ts-loader": "^9.4.1",
|
|
87
88
|
"typescript": "^4.8.4",
|
|
88
89
|
"url-loader": "^4.1.1",
|
|
90
|
+
"webpack": "^5.74.0",
|
|
89
91
|
"webpack-bundle-analyzer": "^4.7.0",
|
|
90
92
|
"webpack-cli": "^4.10.0",
|
|
91
93
|
"webpack-dev-server": "^4.11.1",
|
|
92
|
-
"webpack-merge": "^5.8.0"
|
|
93
|
-
"webpack": "^5.74.0"
|
|
94
|
+
"webpack-merge": "^5.8.0"
|
|
94
95
|
},
|
|
95
96
|
"peerDependencies": {
|
|
96
97
|
"preact": "^10.11.2"
|
package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx
CHANGED
|
@@ -16,27 +16,28 @@ const TranslationOption: FC<TranslationOptionProps> = ({
|
|
|
16
16
|
description,
|
|
17
17
|
onChange,
|
|
18
18
|
id,
|
|
19
|
-
}) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
id={id}
|
|
27
|
-
type="radio"
|
|
28
|
-
value={label}
|
|
29
|
-
checked={checked}
|
|
30
|
-
className={className('visually-hidden')}
|
|
31
|
-
onChange={onChange}
|
|
32
|
-
name="language"
|
|
33
|
-
/>
|
|
19
|
+
}) => {
|
|
20
|
+
const onKeyDown = (e: KeyboardEvent) => {
|
|
21
|
+
if (e.code === 'Space' || e.code === 'Enter') {
|
|
22
|
+
e.preventDefault()
|
|
23
|
+
onChange()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
34
26
|
|
|
35
|
-
|
|
27
|
+
return (
|
|
28
|
+
<li
|
|
29
|
+
className={className('translation-options__item')}
|
|
30
|
+
aria-selected={checked}
|
|
31
|
+
role="option"
|
|
32
|
+
tabIndex={0}
|
|
33
|
+
onClick={onChange}
|
|
34
|
+
onKeyDown={onKeyDown}
|
|
35
|
+
id={id}
|
|
36
|
+
>
|
|
36
37
|
<Icon alt="" name="check" size="16" />
|
|
37
38
|
{label} {description && <span>({description})</span>}
|
|
38
|
-
</
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
</li>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
41
42
|
|
|
42
43
|
export default TranslationOption
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { View } from '@seamly/web-ui'
|
|
1
2
|
import { useEffect, useState } from 'preact/hooks'
|
|
2
|
-
import View from 'ui/components/view'
|
|
3
3
|
import { timeout } from 'ui/hooks/focus-helper-hooks'
|
|
4
|
-
import StyleGuideStaticCore from '
|
|
4
|
+
import StyleGuideStaticCore from 'style-guide/components/static-core'
|
|
5
5
|
|
|
6
6
|
const StyleGuideView = ({
|
|
7
7
|
state,
|
|
@@ -2,44 +2,27 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
margin: 0;
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
padding:
|
|
5
|
+
// Top padding needed for the outline focus ring
|
|
6
|
+
padding: $spacer * 0.05 0 0;
|
|
7
7
|
list-style: none;
|
|
8
|
+
}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Only show a ring when we have focused via keyboard
|
|
25
|
-
&:focus-within:has(input:focus-visible) {
|
|
26
|
-
outline: -webkit-focus-ring-color auto 1px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
> span {
|
|
30
|
-
margin-left: 0.5em;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.#{$n}-icon {
|
|
35
|
-
opacity: 0;
|
|
36
|
-
}
|
|
10
|
+
.#{$n}-translation-options__item {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
padding: calc($spacer * 0.25) 0;
|
|
15
|
+
color: $brand3;
|
|
16
|
+
font-size: $fontsize-small;
|
|
17
|
+
font-weight: $fontweight-bold;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
|
|
20
|
+
&:focus-visible {
|
|
21
|
+
outline: -webkit-focus-ring-color auto 1px;
|
|
22
|
+
}
|
|
37
23
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
opacity: 1;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
24
|
+
> span {
|
|
25
|
+
margin-left: 0.5em;
|
|
43
26
|
}
|
|
44
27
|
|
|
45
28
|
.#{$n}-icon {
|
|
@@ -47,5 +30,10 @@
|
|
|
47
30
|
width: $iconsize-small;
|
|
48
31
|
height: $iconsize-small;
|
|
49
32
|
margin-right: calc($spacer / 2);
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[aria-selected='true'] .#{$n}-icon {
|
|
37
|
+
opacity: 1;
|
|
50
38
|
}
|
|
51
39
|
}
|