@newhighsco/chipset 6.27.3 → 7.0.1
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/package.json +34 -30
- package/src/components/Card/CardHeading.jsx +1 -1
- package/src/components/Icon/Icon.jsx +17 -7
- package/src/components/Icon/Icon.module.scss +1 -0
- package/src/components/LiveStream/LiveStream.jsx +0 -1
- package/src/components/Menubar/Menubar.jsx +14 -21
- package/src/components/Navigation/Navigation.jsx +3 -2
- package/src/components/SmartLink/SmartLink.jsx +0 -1
- package/src/components/Tooltip/Tooltip.jsx +10 -10
- package/src/hooks/use-ids.js +3 -1
- package/src/hooks/use-toggle.js +1 -1
- package/src/providers/ImageProvider/ImageProvider.jsx +0 -1
- package/src/providers/LinkProvider/LinkProvider.jsx +0 -1
- package/styles/mixins/_grid.scss +2 -6
- package/styles/mixins/_mq.scss +1 -3
- package/src/components/Menubar/images/arrow-down.svg +0 -1
- package/src/components/Menubar/images/arrow-up.svg +0 -1
- package/src/components/Menubar/images/close.svg +0 -1
- package/src/components/Menubar/images/menu.svg +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newhighsco/chipset",
|
|
3
3
|
"description": "Shareable, theme-able component library by New High Score",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.1",
|
|
5
5
|
"author": "New High Score",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"repository": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/newhighsco/chipset/issues"
|
|
14
14
|
},
|
|
15
|
+
"packageManager": "yarn@4.14.1",
|
|
15
16
|
"main": "src/index.js",
|
|
16
17
|
"files": [
|
|
17
18
|
"src",
|
|
@@ -22,67 +23,70 @@
|
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
25
|
"prepare": "husky",
|
|
25
|
-
"start": "storybook dev --port 49928
|
|
26
|
+
"start": "storybook dev --port 49928",
|
|
26
27
|
"build": "storybook build --output-dir build --docs --quiet --webpack-stats-json",
|
|
27
28
|
"pretest": "yarn lint",
|
|
28
29
|
"test": "jest --runInBand",
|
|
29
30
|
"test:list": "jest --listTests",
|
|
30
31
|
"snapshot": "chromatic --storybook-build-dir build --auto-accept-changes main --exit-once-uploaded --only-changed",
|
|
31
32
|
"analyze": "omlet analyze",
|
|
32
|
-
"lint": "concurrently yarn:lint:*",
|
|
33
|
+
"lint": "concurrently 'yarn:lint:*'",
|
|
33
34
|
"lint:js": "eslint --cache .",
|
|
34
35
|
"lint:css": "stylelint --cache --ignore-path .gitignore '**/*.?(s)css'",
|
|
35
|
-
"format": "concurrently yarn:format:*",
|
|
36
|
+
"format": "concurrently 'yarn:format:*'",
|
|
36
37
|
"format:js": "yarn lint:js --fix",
|
|
37
38
|
"format:css": "yarn lint:css --fix"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"@dr.pogodin/react-themes": "1.10.3",
|
|
42
|
+
"@iconify/react": "6.0.2",
|
|
41
43
|
"classnames": "2.5.1",
|
|
42
44
|
"react-device-detect": "2.2.3"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"@babel/core": "7.29.0",
|
|
46
|
-
"@babel/preset-env": "7.29.
|
|
48
|
+
"@babel/preset-env": "7.29.2",
|
|
47
49
|
"@babel/preset-react": "7.28.5",
|
|
48
|
-
"@commitlint/cli": "20.
|
|
50
|
+
"@commitlint/cli": "20.5.2",
|
|
49
51
|
"@newhighsco/browserslist-config": "2.0.0",
|
|
50
|
-
"@newhighsco/commitlint-config": "1.1.
|
|
52
|
+
"@newhighsco/commitlint-config": "1.1.53",
|
|
51
53
|
"@newhighsco/editor-config": "1.2.0",
|
|
52
|
-
"@newhighsco/eslint-config": "
|
|
53
|
-
"@newhighsco/postcss-config": "4.0.
|
|
54
|
-
"@newhighsco/prettier-config": "2.3.
|
|
55
|
-
"@newhighsco/release-config": "1.4.
|
|
56
|
-
"@newhighsco/storybook-preset": "10.2.
|
|
57
|
-
"@newhighsco/stylelint-config": "4.0.
|
|
54
|
+
"@newhighsco/eslint-config": "7.0.54",
|
|
55
|
+
"@newhighsco/postcss-config": "4.0.46",
|
|
56
|
+
"@newhighsco/prettier-config": "2.3.5",
|
|
57
|
+
"@newhighsco/release-config": "1.4.27",
|
|
58
|
+
"@newhighsco/storybook-preset": "10.2.36",
|
|
59
|
+
"@newhighsco/stylelint-config": "4.0.39",
|
|
58
60
|
"@newhighsco/svgr-config": "1.0.0",
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
+
"@newhighsco/yarn-plugin-preset": "1.1.3",
|
|
62
|
+
"@omlet/cli": "2.2.0",
|
|
63
|
+
"@storybook/react-webpack5": "10.3.5",
|
|
61
64
|
"@testing-library/dom": "10.4.1",
|
|
62
65
|
"@testing-library/jest-dom": "6.9.1",
|
|
63
66
|
"@testing-library/react": "16.3.2",
|
|
64
|
-
"babel-loader": "10.
|
|
65
|
-
"chromatic": "
|
|
67
|
+
"babel-loader": "10.1.1",
|
|
68
|
+
"chromatic": "16.6.1",
|
|
66
69
|
"concurrently": "9.2.1",
|
|
67
|
-
"eslint": "
|
|
70
|
+
"eslint": "10.2.1",
|
|
68
71
|
"husky": "9.1.7",
|
|
69
72
|
"identity-obj-proxy": "3.0.0",
|
|
70
|
-
"jest": "30.
|
|
71
|
-
"jest-environment-jsdom": "30.
|
|
72
|
-
"jest-junit": "
|
|
73
|
-
"postcss": "8.5.
|
|
74
|
-
"prettier": "3.8.
|
|
75
|
-
"react": "19.2.
|
|
76
|
-
"react-dom": "19.2.
|
|
73
|
+
"jest": "30.3.0",
|
|
74
|
+
"jest-environment-jsdom": "30.3.0",
|
|
75
|
+
"jest-junit": "17.0.0",
|
|
76
|
+
"postcss": "8.5.12",
|
|
77
|
+
"prettier": "3.8.3",
|
|
78
|
+
"react": "19.2.5",
|
|
79
|
+
"react-dom": "19.2.5",
|
|
77
80
|
"sass-true": "10.1.0",
|
|
78
81
|
"semantic-release": "25.0.3",
|
|
79
|
-
"storybook": "10.
|
|
80
|
-
"stylelint": "17.
|
|
81
|
-
"
|
|
82
|
+
"storybook": "10.3.5",
|
|
83
|
+
"stylelint": "17.9.1",
|
|
84
|
+
"typescript": "6.0.3",
|
|
85
|
+
"webpack": "5.106.2"
|
|
82
86
|
},
|
|
83
87
|
"peerDependencies": {
|
|
84
|
-
"react": "19.2.
|
|
85
|
-
"react-dom": "19.2.
|
|
88
|
+
"react": "19.2.5",
|
|
89
|
+
"react-dom": "19.2.5"
|
|
86
90
|
},
|
|
87
91
|
"browserslist": [
|
|
88
92
|
"extends @newhighsco/browserslist-config"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Icon as IconifyIcon } from '@iconify/react'
|
|
1
2
|
import { node, number, object, oneOfType, shape, string } from 'prop-types'
|
|
2
|
-
import { Children, cloneElement } from 'react'
|
|
3
|
+
import React, { Children, cloneElement } from 'react'
|
|
3
4
|
|
|
4
5
|
import { classNames } from '../../utils'
|
|
5
6
|
|
|
@@ -7,8 +8,9 @@ import { classNames } from '../../utils'
|
|
|
7
8
|
* Use `Icon` to wrap SVGs
|
|
8
9
|
*/
|
|
9
10
|
const Icon = ({
|
|
11
|
+
name,
|
|
10
12
|
width,
|
|
11
|
-
height,
|
|
13
|
+
height = width,
|
|
12
14
|
alt,
|
|
13
15
|
children,
|
|
14
16
|
theme,
|
|
@@ -16,19 +18,27 @@ const Icon = ({
|
|
|
16
18
|
style,
|
|
17
19
|
...rest
|
|
18
20
|
}) => {
|
|
19
|
-
if (!children) return null
|
|
21
|
+
if (!name && !children) return null
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
const props = {
|
|
24
|
+
'aria-hidden': alt ? null : true,
|
|
25
|
+
'aria-label': alt,
|
|
22
26
|
className: classNames(theme?.root, className),
|
|
23
|
-
|
|
24
|
-
...(!alt && { 'aria-hidden': true }),
|
|
27
|
+
role: alt ? 'img' : null,
|
|
25
28
|
style: { ...style, width, height },
|
|
26
29
|
...rest
|
|
27
|
-
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (children) {
|
|
33
|
+
return cloneElement(Children.only(children), props)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return <IconifyIcon icon={name} fallback={<span {...props} />} {...props} />
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
Icon.displayName = 'Icon'
|
|
31
40
|
Icon.propTypes = {
|
|
41
|
+
name: string,
|
|
32
42
|
height: oneOfType([number, string]),
|
|
33
43
|
width: oneOfType([number, string]),
|
|
34
44
|
alt: string,
|
|
@@ -6,12 +6,8 @@ import { classNames } from '../../utils'
|
|
|
6
6
|
import Button from '../Button'
|
|
7
7
|
import Icon from '../Icon'
|
|
8
8
|
import List from '../List'
|
|
9
|
-
import { ReactComponent as ArrowDownSvg } from './images/arrow-down.svg'
|
|
10
|
-
import { ReactComponent as ArrowUpSvg } from './images/arrow-up.svg'
|
|
11
|
-
import { ReactComponent as CloseSvg } from './images/close.svg'
|
|
12
|
-
import { ReactComponent as MenuSvg } from './images/menu.svg'
|
|
13
9
|
|
|
14
|
-
const ICONS = {
|
|
10
|
+
const ICONS = { false: 'material-symbols:menu', true: 'material-symbols:close' }
|
|
15
11
|
const LABELS = { false: 'Show', true: 'Hide' }
|
|
16
12
|
|
|
17
13
|
const Menubar = ({
|
|
@@ -24,15 +20,15 @@ const Menubar = ({
|
|
|
24
20
|
onToggle = () => {},
|
|
25
21
|
theme
|
|
26
22
|
}) => {
|
|
27
|
-
const [visible,
|
|
28
|
-
const
|
|
23
|
+
const [visible, toggleVisibility] = useToggle(!toggle)
|
|
24
|
+
const id = useIds()
|
|
29
25
|
|
|
30
26
|
if (!links.length) return null
|
|
31
27
|
|
|
32
28
|
const icons = toggle?.icons || ICONS
|
|
33
29
|
|
|
34
|
-
const
|
|
35
|
-
|
|
30
|
+
const handleToggle = () => {
|
|
31
|
+
toggleVisibility()
|
|
36
32
|
onToggle({ visible })
|
|
37
33
|
}
|
|
38
34
|
|
|
@@ -41,25 +37,19 @@ const Menubar = ({
|
|
|
41
37
|
{toggle && (
|
|
42
38
|
<Button
|
|
43
39
|
active={visible}
|
|
44
|
-
aria-controls={
|
|
40
|
+
aria-controls={id}
|
|
45
41
|
aria-expanded={visible}
|
|
46
|
-
aria-
|
|
42
|
+
aria-label={`${LABELS[visible]} ${title}`}
|
|
47
43
|
aria-haspopup
|
|
48
|
-
onClick={
|
|
44
|
+
onClick={handleToggle}
|
|
49
45
|
theme={{ root: theme?.toggle, active: theme?.toggleActive }}
|
|
50
46
|
>
|
|
51
47
|
{toggle.children}
|
|
52
|
-
<Icon
|
|
53
|
-
id={iconId}
|
|
54
|
-
theme={{ root: theme?.toggleIcon }}
|
|
55
|
-
alt={`${LABELS[visible]} ${title}`}
|
|
56
|
-
>
|
|
57
|
-
{icons[visible]}
|
|
58
|
-
</Icon>
|
|
48
|
+
<Icon theme={{ root: theme?.toggleIcon }} name={icons[visible]} />
|
|
59
49
|
</Button>
|
|
60
50
|
)}
|
|
61
51
|
<List
|
|
62
|
-
id={
|
|
52
|
+
id={id}
|
|
63
53
|
role={role}
|
|
64
54
|
unstyled
|
|
65
55
|
inline={inline}
|
|
@@ -83,7 +73,10 @@ const Menubar = ({
|
|
|
83
73
|
role="menu"
|
|
84
74
|
links={links}
|
|
85
75
|
toggle={{
|
|
86
|
-
icons: {
|
|
76
|
+
icons: {
|
|
77
|
+
false: 'material-symbols:arrow-drop-down',
|
|
78
|
+
true: 'material-symbols:arrow-drop-up'
|
|
79
|
+
},
|
|
87
80
|
...props
|
|
88
81
|
}}
|
|
89
82
|
theme={{ ...theme, toggle: theme?.link }}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { shape, string } from 'prop-types'
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react'
|
|
3
3
|
|
|
4
|
+
import { useIds } from '../../hooks'
|
|
4
5
|
import { classNames } from '../../utils'
|
|
5
6
|
import Menubar from '../Menubar'
|
|
6
7
|
import SmartLink from '../SmartLink'
|
|
@@ -16,7 +17,7 @@ const Navigation = ({
|
|
|
16
17
|
theme,
|
|
17
18
|
className
|
|
18
19
|
}) => {
|
|
19
|
-
const id =
|
|
20
|
+
const id = useIds()
|
|
20
21
|
|
|
21
22
|
if (!links.length) return null
|
|
22
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { bool, node, oneOf, shape, string } from 'prop-types'
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useToggle } from '../../hooks'
|
|
4
|
+
import { useIds, useToggle } from '../../hooks'
|
|
5
5
|
import { classNames } from '../../utils'
|
|
6
6
|
import SmartLink from '../SmartLink'
|
|
7
7
|
|
|
@@ -23,8 +23,8 @@ const Tooltip = ({
|
|
|
23
23
|
theme,
|
|
24
24
|
className
|
|
25
25
|
}) => {
|
|
26
|
-
const [visible, setVisibility] = useToggle(!hidden)
|
|
27
|
-
const id =
|
|
26
|
+
const [visible, toggleVisibility, setVisibility] = useToggle(!hidden)
|
|
27
|
+
const id = useIds()
|
|
28
28
|
|
|
29
29
|
if (!heading && !children) return null
|
|
30
30
|
|
|
@@ -34,11 +34,11 @@ const Tooltip = ({
|
|
|
34
34
|
aria-describedby={id}
|
|
35
35
|
className={classNames(theme?.root, className)}
|
|
36
36
|
{...(!manual && {
|
|
37
|
-
onMouseOver: setVisibility,
|
|
38
|
-
onMouseOut: setVisibility,
|
|
39
|
-
onFocus: setVisibility,
|
|
40
|
-
onBlur: setVisibility,
|
|
41
|
-
onTouchEnd: setVisibility
|
|
37
|
+
onMouseOver: () => setVisibility(true),
|
|
38
|
+
onMouseOut: () => setVisibility(false),
|
|
39
|
+
onFocus: () => setVisibility(true),
|
|
40
|
+
onBlur: () => setVisibility(false),
|
|
41
|
+
onTouchEnd: () => setVisibility(false)
|
|
42
42
|
})}
|
|
43
43
|
>
|
|
44
44
|
<SmartLink
|
|
@@ -47,7 +47,7 @@ const Tooltip = ({
|
|
|
47
47
|
target={target}
|
|
48
48
|
disabled={disabled}
|
|
49
49
|
aria-expanded={visible}
|
|
50
|
-
{...(manual && { onClick:
|
|
50
|
+
{...(manual && { onClick: toggleVisibility })}
|
|
51
51
|
>
|
|
52
52
|
{toggle}
|
|
53
53
|
</SmartLink>
|
package/src/hooks/use-ids.js
CHANGED
package/src/hooks/use-toggle.js
CHANGED
package/styles/mixins/_grid.scss
CHANGED
|
@@ -143,14 +143,10 @@ $fraction-names: whole half third quarter fifth sixth seventh eighth ninth tenth
|
|
|
143
143
|
@for $i from 1 through $columns-length {
|
|
144
144
|
$column: list.nth($columns, $i);
|
|
145
145
|
$grid: list.nth($fraction-names, $column);
|
|
146
|
-
$column-count: if(
|
|
147
|
-
sass($column == 1): 1; else: $column - 1
|
|
148
|
-
);
|
|
146
|
+
$column-count: if(sass($column == 1): 1; else: $column - 1);
|
|
149
147
|
|
|
150
148
|
@for $j from 1 through $column-count {
|
|
151
|
-
$plural: if(
|
|
152
|
-
sass($j == 1): '' ; else: 's'
|
|
153
|
-
);
|
|
149
|
+
$plural: if(sass($j == 1): '' ; else: 's');
|
|
154
150
|
$column-width: $j * math.div(100, $column);
|
|
155
151
|
$column-name: list.nth($count-names, $j);
|
|
156
152
|
|
package/styles/mixins/_mq.scss
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24"><path d="M7 10l5 5 5-5H7z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24"><path d="M7 14l5-5 5 5H7z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
|