@newhighsco/chipset 6.17.5 → 6.18.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/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": "6.17.5",
4
+ "version": "6.18.0",
5
5
  "author": "New High Score",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -28,6 +28,7 @@
28
28
  "test": "jest --runInBand",
29
29
  "test:list": "jest --listTests",
30
30
  "snapshot": "chromatic --storybook-build-dir build --auto-accept-changes main --exit-once-uploaded --only-changed",
31
+ "analyze": "omlet analyze",
31
32
  "lint": "concurrently yarn:lint:*",
32
33
  "lint:js": "eslint --cache --ignore-path .gitignore .",
33
34
  "lint:css": "stylelint --cache --ignore-path .gitignore '**/*.?(s)css'",
@@ -49,38 +50,39 @@
49
50
  "@newhighsco/browserslist-config": "2.0.0",
50
51
  "@newhighsco/commitlint-config": "1.1.46",
51
52
  "@newhighsco/editor-config": "1.2.0",
52
- "@newhighsco/eslint-config": "4.1.39",
53
- "@newhighsco/postcss-config": "3.5.339",
53
+ "@newhighsco/eslint-config": "4.1.43",
54
+ "@newhighsco/postcss-config": "3.5.341",
54
55
  "@newhighsco/prettier-config": "2.1.32",
55
56
  "@newhighsco/release-config": "1.4.6",
56
- "@newhighsco/storybook-preset": "7.0.145",
57
+ "@newhighsco/storybook-preset": "7.1.1",
57
58
  "@newhighsco/stylelint-config": "4.0.17",
59
+ "@omlet/cli": "2.0.0",
58
60
  "@storybook/react-webpack5": "8.6.14",
59
- "@testing-library/dom": "10.4.0",
60
- "@testing-library/jest-dom": "6.6.3",
61
+ "@testing-library/dom": "10.4.1",
62
+ "@testing-library/jest-dom": "6.6.4",
61
63
  "@testing-library/react": "16.3.0",
62
64
  "babel-loader": "10.0.0",
63
- "chromatic": "13.1.2",
65
+ "chromatic": "13.1.3",
64
66
  "concurrently": "9.2.0",
65
67
  "eslint": "8.57.1",
66
68
  "husky": "9.1.7",
67
69
  "identity-obj-proxy": "3.0.0",
68
- "jest": "30.0.4",
69
- "jest-environment-jsdom": "30.0.4",
70
+ "jest": "30.0.5",
71
+ "jest-environment-jsdom": "30.0.5",
70
72
  "jest-junit": "16.0.0",
71
73
  "postcss": "8.5.6",
72
74
  "prettier": "3.6.2",
73
- "react": "19.1.0",
74
- "react-dom": "19.1.0",
75
+ "react": "19.1.1",
76
+ "react-dom": "19.1.1",
75
77
  "sass-true": "9.0.0",
76
78
  "semantic-release": "24.2.7",
77
79
  "storybook": "8.6.14",
78
- "stylelint": "16.21.1",
79
- "webpack": "5.100.2"
80
+ "stylelint": "16.23.1",
81
+ "webpack": "5.101.0"
80
82
  },
81
83
  "peerDependencies": {
82
- "react": "19.1.0",
83
- "react-dom": "19.1.0"
84
+ "react": "19.1.1",
85
+ "react-dom": "19.1.1"
84
86
  },
85
87
  "browserslist": [
86
88
  "extends @newhighsco/browserslist-config"
@@ -95,6 +97,14 @@
95
97
  "@newhighsco/eslint-config"
96
98
  ]
97
99
  },
100
+ "omlet": {
101
+ "exports": {
102
+ ".": "src/index.js"
103
+ },
104
+ "ignore": [
105
+ "example/**"
106
+ ]
107
+ },
98
108
  "prettier": "@newhighsco/prettier-config",
99
109
  "release": {
100
110
  "extends": "@newhighsco/release-config",
@@ -1,7 +1,7 @@
1
- import classNames from 'classnames'
2
1
  import { node, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
5
  import Element from '../Element'
6
6
  import styles from './Backdrop.module.scss'
7
7
 
@@ -1,7 +1,7 @@
1
- import classNames from 'classnames'
2
1
  import { bool, func, node, object, oneOfType, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
5
  import SmartLink from '../SmartLink'
6
6
 
7
7
  const Button = ({ active, children, theme, className, setRef, ...rest }) => {
@@ -1,7 +1,8 @@
1
- import classNames from 'classnames'
2
1
  import { node, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
+
5
6
  const ButtonGroup = ({ children, theme, className }) => {
6
7
  if (!children) return null
7
8
 
@@ -1,4 +1,3 @@
1
- import classNames from 'classnames'
2
1
  import {
3
2
  func,
4
3
  node,
@@ -10,6 +9,7 @@ import {
10
9
  } from 'prop-types'
11
10
  import React from 'react'
12
11
 
12
+ import { classNames } from '../../utils'
13
13
  import CardHeading from './CardHeading'
14
14
  import CardImage from './CardImage'
15
15
 
@@ -1,7 +1,7 @@
1
- import classNames from 'classnames'
2
1
  import { bool, node, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
5
  import Element from '../Element'
6
6
 
7
7
  /**
@@ -8,7 +8,6 @@
8
8
  .logo {
9
9
  $credit-content-margin: functions.spacing(1);
10
10
 
11
- fill: currentColor;
12
11
  margin-right: $credit-content-margin;
13
12
  vertical-align: top;
14
13
  width: 50px;
@@ -1,7 +1,8 @@
1
- import classNames from 'classnames'
2
1
  import { bool, node, oneOf, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
+
5
6
  /**
6
7
  * `Grid` provides a simple `inline-block` based responsive grid
7
8
  */
@@ -1,7 +1,8 @@
1
- import classNames from 'classnames'
2
1
  import { arrayOf, node, oneOf, oneOfType, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
+
5
6
  const GridItem = ({ sizes, children, theme, className, ...rest }) => {
6
7
  if (!children) return null
7
8
 
@@ -1,7 +1,7 @@
1
- import classNames from 'classnames'
2
1
  import { node, number, oneOfType, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
5
  import VisuallyHidden from '../VisuallyHidden'
6
6
 
7
7
  /**
@@ -1,5 +1,6 @@
1
1
  .root {
2
2
  display: inline-block;
3
+ fill: currentColor;
3
4
  vertical-align: middle;
4
5
  font-style: normal;
5
6
  width: 1em;
@@ -1,7 +1,7 @@
1
- import classNames from 'classnames'
2
1
  import { bool, node, oneOf, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
5
  import Element from '../Element'
6
6
 
7
7
  const List = ({
@@ -1,7 +1,7 @@
1
- import classNames from 'classnames'
2
1
  import { bool, shape, string } from 'prop-types'
3
2
  import React, { useEffect, useState } from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
5
  import Grid from '../Grid'
6
6
  import ResponsiveMedia from '../ResponsiveMedia'
7
7
  import VisuallyHidden from '../VisuallyHidden'
@@ -1,8 +1,8 @@
1
- import classNames from 'classnames'
2
1
  import { array, bool, func, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
5
- import { useToggle } from '../../hooks'
4
+ import { useIds, useToggle } from '../../hooks'
5
+ import { classNames } from '../../utils'
6
6
  import Button from '../Button'
7
7
  import Icon from '../Icon'
8
8
  import List from '../List'
@@ -22,6 +22,7 @@ const Navigation = ({
22
22
  className
23
23
  }) => {
24
24
  const [visible, setVisibility] = useToggle(!toggle)
25
+ const [titleId, menuId] = useIds(['title', 'menu'])
25
26
 
26
27
  if (!links.length) return null
27
28
 
@@ -31,11 +32,18 @@ const Navigation = ({
31
32
  }
32
33
 
33
34
  return (
34
- <nav role="navigation" className={classNames(theme?.root, className)}>
35
- <VisuallyHidden as="h2">{title}</VisuallyHidden>
35
+ <nav
36
+ aria-labelledby={titleId}
37
+ role="navigation"
38
+ className={classNames(theme?.root, className)}
39
+ >
40
+ <VisuallyHidden as="h2" id={titleId}>
41
+ {title}
42
+ </VisuallyHidden>
36
43
  {toggle && (
37
44
  <Button
38
45
  active={visible}
46
+ aria-controls={menuId}
39
47
  aria-expanded={visible}
40
48
  onClick={toggleVisibility}
41
49
  theme={{ root: theme?.toggle, active: theme?.toggleActive }}
@@ -49,6 +57,7 @@ const Navigation = ({
49
57
  </Button>
50
58
  )}
51
59
  <List
60
+ id={menuId}
52
61
  role="menubar"
53
62
  unstyled
54
63
  inline={inline}
@@ -1,7 +1,8 @@
1
- import classNames from 'classnames'
2
1
  import { node, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
+
5
6
  const Prose = ({ html, children, theme, className, ...rest }) => {
6
7
  if (!html && !children) return null
7
8
 
@@ -1,7 +1,7 @@
1
- import classNames from 'classnames'
2
1
  import { node, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
4
+ import { classNames } from '../../utils'
5
5
  import Element from '../Element'
6
6
 
7
7
  /**
@@ -1,8 +1,8 @@
1
- import classNames from 'classnames'
2
1
  import { bool, node, oneOf, shape, string } from 'prop-types'
3
2
  import React from 'react'
4
3
 
5
4
  import { useToggle } from '../../hooks'
5
+ import { classNames } from '../../utils'
6
6
  import SmartLink from '../SmartLink'
7
7
 
8
8
  /**
@@ -1 +1,2 @@
1
+ export { useIds } from './use-ids'
1
2
  export { useToggle } from './use-toggle'
@@ -0,0 +1,7 @@
1
+ import { useId } from 'react'
2
+
3
+ export const useIds = (elements = []) => {
4
+ const id = useId()
5
+
6
+ return elements.map(element => [id, element].join('-'))
7
+ }
@@ -0,0 +1,6 @@
1
+ import classnames from 'classnames/dedupe'
2
+
3
+ export const classNames = (...args) =>
4
+ classnames(...args)
5
+ .replace(undefined, '')
6
+ .trim()
@@ -1 +1,2 @@
1
1
  export { absoluteUrl } from './absolute-url'
2
+ export { classNames } from './class-names'