@modernpoacher/sprockets 0.0.172 → 0.0.174

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/babel.config.cjs CHANGED
@@ -47,6 +47,7 @@ const plugins = [
47
47
  /**
48
48
  * Storybook
49
49
  */
50
+ '@modernpoacher/sprockets/common': './src/common/index.mjs',
50
51
  '@modernpoacher/sprockets/sprockets/check-answers/group/answer-item': './src/sprockets/check-answers/group/answer-item.jsx',
51
52
  '@modernpoacher/sprockets/sprockets/check-answers/group/answer-title': './src/sprockets/check-answers/group/answer-title.jsx',
52
53
  '@modernpoacher/sprockets/sprockets/check-answers/group/answer-value': './src/sprockets/check-answers/group/answer-value.jsx',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/sprockets",
3
- "version": "0.0.172",
3
+ "version": "0.0.174",
4
4
  "description": "Sprockets",
5
5
  "keywords": [
6
6
  "Sprockets",
@@ -52,11 +52,11 @@
52
52
  "@babel/register": "^7.24.6",
53
53
  "@modernpoacher/design-system": "1.0.113",
54
54
  "@modernpoacher/hooks": "^1.0.479",
55
- "@storybook/addon-actions": "^8.1.10",
56
- "@storybook/addon-essentials": "^8.1.10",
57
- "@storybook/addon-links": "^8.1.10",
58
- "@storybook/react": "^8.1.10",
59
- "@storybook/react-webpack5": "^8.1.10",
55
+ "@storybook/addon-actions": "7.6.20",
56
+ "@storybook/addon-essentials": "7.6.20",
57
+ "@storybook/addon-links": "7.6.20",
58
+ "@storybook/react": "7.6.20",
59
+ "@storybook/react-webpack5": "7.6.20",
60
60
  "@types/react": "^18.3.3",
61
61
  "@typescript-eslint/eslint-plugin": "^7.14.1",
62
62
  "@typescript-eslint/parser": "^7.14.1",
@@ -85,7 +85,7 @@
85
85
  "remove-files-webpack-plugin": "^1.5.0",
86
86
  "sass": "^1.77.6",
87
87
  "sass-loader": "^14.2.1",
88
- "storybook": "^8.1.10",
88
+ "storybook": "7.6.20",
89
89
  "webpack": "^5.92.1",
90
90
  "webpack-cli": "^5.1.4"
91
91
  },
@@ -97,6 +97,7 @@
97
97
  "require": "./src/index.cjs",
98
98
  "import": "./src/index.mjs"
99
99
  },
100
+ "./common": "./src/common/index.mjs",
100
101
  "./components/common/text-content": "./src/components/common/text-content/index.cjs",
101
102
  "./components/common/visually-hidden-text": "./src/components/common/visually-hidden-text/index.cjs",
102
103
  "./components/description": "./src/components/description/index.cjs",
@@ -0,0 +1,7 @@
1
+ export function DEFAULT_HANDLE_CHANGE () {
2
+ /* */
3
+ }
4
+
5
+ export function DEFAULT_HANDLE_CLICK () {
6
+ /* */
7
+ }
@@ -7,6 +7,10 @@
7
7
  import React, { Component } from 'react'
8
8
  import PropTypes from 'prop-types'
9
9
 
10
+ import {
11
+ DEFAULT_HANDLE_CHANGE
12
+ } from '@modernpoacher/sprockets/common'
13
+
10
14
  export default class Group extends Component {
11
15
  getClassName () {
12
16
  return 'group'
@@ -25,7 +29,7 @@ export default class Group extends Component {
25
29
 
26
30
  render () {
27
31
  const {
28
- onChange,
32
+ onChange = DEFAULT_HANDLE_CHANGE,
29
33
  groupRef,
30
34
  children
31
35
  } = this.props
@@ -10,6 +10,11 @@ import PropTypes from 'prop-types'
10
10
  import classnames from 'classnames'
11
11
 
12
12
  import Sprocket from '@modernpoacher/sprockets/sprockets'
13
+
14
+ import {
15
+ DEFAULT_HANDLE_CHANGE
16
+ } from '@modernpoacher/sprockets/common'
17
+
13
18
  import Title from './title/index.jsx'
14
19
  import Description from './description/index.jsx'
15
20
  import ErrorMessage from './error-message/index.jsx'
@@ -74,7 +79,7 @@ export default class FieldsetSprocket extends Sprocket {
74
79
 
75
80
  renderGroup () {
76
81
  const {
77
- onChange,
82
+ onChange = DEFAULT_HANDLE_CHANGE,
78
83
  children
79
84
  } = this.props
80
85
 
@@ -7,13 +7,13 @@
7
7
  import React, { Component } from 'react'
8
8
  import PropTypes from 'prop-types'
9
9
 
10
+ import {
11
+ DEFAULT_HANDLE_CHANGE
12
+ } from '@modernpoacher/sprockets/common'
13
+
10
14
  import Title from '@modernpoacher/sprockets/components/title'
11
15
  import Group from '@modernpoacher/sprockets/components/group'
12
16
 
13
- function onChange () {
14
- /* */
15
- }
16
-
17
17
  export default class Sprocket extends Component {
18
18
  getClassName () {
19
19
  return 'sprocket'
@@ -45,7 +45,7 @@ export default class Sprocket extends Component {
45
45
 
46
46
  renderGroup () {
47
47
  const {
48
- onChange,
48
+ onChange = DEFAULT_HANDLE_CHANGE,
49
49
  groupRef,
50
50
  children
51
51
  } = this.props
@@ -86,5 +86,5 @@ Sprocket.propTypes = {
86
86
  }
87
87
 
88
88
  Sprocket.defaultProps = {
89
- onChange
89
+ onChange: DEFAULT_HANDLE_CHANGE
90
90
  }