shinkansen-cogs 2.1.14 → 2.1.16

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/index.d.mts CHANGED
@@ -111,7 +111,7 @@ declare global {
111
111
  export interface CheckProps extends Super.Components.Field.FieldProps {
112
112
  checked?: boolean
113
113
  defaultChecked?: boolean
114
- onClick: OnEventType
114
+ onClick?: OnEventType
115
115
  }
116
116
 
117
117
  export namespace Checkbox {
@@ -192,7 +192,7 @@ declare global {
192
192
  export interface CheckProps extends Super.Cogs.CogProps {
193
193
  checked?: boolean
194
194
  defaultChecked?: boolean
195
- onClick: OnEventType
195
+ onClick?: OnEventType
196
196
  }
197
197
 
198
198
  export namespace Checkbox {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shinkansen-cogs",
3
- "version": "2.1.14",
3
+ "version": "2.1.16",
4
4
  "description": "Shinkansen Cogs",
5
5
  "keywords": [
6
6
  "Shinkansen",
@@ -61,16 +61,17 @@
61
61
  "@babel/preset-react": "^7.26.3",
62
62
  "@babel/register": "^7.25.9",
63
63
  "@modernpoacher/design-system": "2.0.2",
64
- "@sequencemedia/eslint-config-standard": "^0.2.46",
65
- "@sequencemedia/eslint-config-typescript": "^0.1.67",
66
- "@storybook/addon-actions": "^8.6.9",
67
- "@storybook/addon-essentials": "^8.6.9",
68
- "@storybook/addon-links": "^8.6.9",
64
+ "@sequencemedia/eslint-config-standard": "^0.2.47",
65
+ "@sequencemedia/eslint-config-typescript": "^0.1.68",
66
+ "@storybook/addon-actions": "^8.6.10",
67
+ "@storybook/addon-essentials": "^8.6.10",
68
+ "@storybook/addon-links": "^8.6.10",
69
69
  "@storybook/addon-webpack5-compiler-babel": "^3.0.5",
70
- "@storybook/manager-api": "^8.6.9",
71
- "@storybook/react": "^8.6.9",
72
- "@storybook/react-webpack5": "^8.6.9",
73
- "@storybook/theming": "^8.6.9",
70
+ "@storybook/manager-api": "^8.6.10",
71
+ "@storybook/react": "^8.6.10",
72
+ "@storybook/react-webpack5": "^8.6.10",
73
+ "@storybook/test": "^8.6.10",
74
+ "@storybook/theming": "^8.6.10",
74
75
  "@testing-library/jest-dom": "^6.6.3",
75
76
  "@testing-library/react": "^16.2.0",
76
77
  "@types/babel__register": "^7.17.3",
@@ -107,13 +108,13 @@
107
108
  "prop-types": "^15.8.1",
108
109
  "react": "^19.0.0",
109
110
  "react-component-instance": "^0.0.15",
110
- "react-component-snapshot": "^0.0.14",
111
+ "react-component-snapshot": "^0.0.15",
111
112
  "react-dom": "^19.0.0",
112
113
  "remove-files-webpack-plugin": "^1.5.0",
113
114
  "sass": "^1.86.0",
114
115
  "sass-loader": "^16.0.5",
115
- "storybook": "^8.6.9",
116
- "stylelint": "^16.16.0",
116
+ "storybook": "^8.6.10",
117
+ "stylelint": "^16.17.0",
117
118
  "stylelint-config-recommended-scss": "^14.1.0",
118
119
  "stylelint-scss": "^6.11.1",
119
120
  "webpack": "^5.98.0",
@@ -1 +1,5 @@
1
- export * from '#cogs/cogs'
1
+ export {
2
+ ValueCog,
3
+ CheckCog,
4
+ toInputValue
5
+ } from '#cogs/cogs'
@@ -12,8 +12,14 @@ declare module '#cogs/cogs' {
12
12
  export class CheckCog<P extends CheckProps> extends Cog<P> {
13
13
  shouldComponentUpdate (props: CheckProps): boolean
14
14
  }
15
+
16
+ export function toInputValue (value: unknown): string
15
17
  }
16
18
 
17
19
  declare module 'shinkansen-cogs/cogs' {
18
- export * from '#cogs/cogs'
20
+ export {
21
+ ValueCog,
22
+ CheckCog,
23
+ toInputValue
24
+ } from '#cogs/cogs'
19
25
  }
@@ -6,7 +6,8 @@
6
6
  */
7
7
 
8
8
  /**
9
- * Cog component
9
+ * ValueCog component
10
+ * CheckCog component
10
11
  */
11
12
  import React from 'react'
12
13
  import PropTypes from 'prop-types'
@@ -24,8 +24,8 @@ function DEFAULT_HANDLE_EVENT () {
24
24
  }
25
25
 
26
26
  /**
27
- * @param {HTMLOptionElement[]} selectedOptions
28
- * @returns {string[]}
27
+ * @param {HTMLOptionElement[]} selectedOptions
28
+ * @returns {string[]}
29
29
  */
30
30
  function fromSelectedOptions (selectedOptions) {
31
31
  return (
@@ -11,10 +11,10 @@ const log = debug('shinkansen-cogs/components/common/text-content')
11
11
  log('`shinkansen` is awake')
12
12
 
13
13
  const {
14
- default: TextComponent
14
+ default: TextContent
15
15
  } = require('./index.jsx')
16
16
 
17
17
  /**
18
18
  * Exports only default
19
19
  */
20
- module.exports = TextComponent
20
+ module.exports = TextContent
@@ -25,5 +25,5 @@ export default function TextContent ({ textContent }) {
25
25
  }
26
26
 
27
27
  TextContent.propTypes = {
28
- textContent: PropTypes.string.isRequired
28
+ textContent: PropTypes.string
29
29
  }
@@ -1,15 +1,6 @@
1
1
  declare module '#cogs/components/description' {
2
- import React from 'react'
3
-
4
- export type DescriptionProps = CogsTypes.Super.Components.Description.DescriptionProps
5
-
6
- export default class Description extends React.Component<DescriptionProps> {
7
- static propTypes: object
8
-
9
- getClassName (): string
10
-
11
- shouldComponentUpdate (props: DescriptionProps): boolean
12
- }
2
+ export { default } from '#cogs/super/components/description'
3
+ export * from '#cogs/super/components/description'
13
4
  }
14
5
 
15
6
  declare module 'shinkansen-cogs/components/description' {
@@ -20,8 +20,8 @@ function DEFAULT_HANDLE_EVENT () {
20
20
  }
21
21
 
22
22
  /**
23
- * @param {unknown} value
24
- * @returns {string}
23
+ * @param {unknown} value
24
+ * @returns {string}
25
25
  */
26
26
  export function toInputValue (value) {
27
27
  return (value === undefined) ? '' : String(value)
@@ -94,7 +94,6 @@ export class CheckField extends Field {
94
94
 
95
95
  CheckField.propTypes = {
96
96
  ...Field.propTypes,
97
- value: PropTypes.string,
98
97
  checked: PropTypes.bool,
99
98
  defaultChecked: PropTypes.bool,
100
99
  onClick: PropTypes.func
@@ -28,11 +28,11 @@ const {
28
28
  default: Title
29
29
  } = require('./title/index.jsx')
30
30
 
31
- module.exports.Description = Description // require('./description/index.cjs')
32
- module.exports.ErrorMessage = ErrorMessage // require('./error-message/index.cjs')
31
+ module.exports.Description = Description
32
+ module.exports.ErrorMessage = ErrorMessage
33
33
  module.exports.Field = {
34
34
  ValueField,
35
35
  CheckField,
36
36
  toInputValue
37
- } // require('./field/index.cjs')
38
- module.exports.Title = Title // require('./title/index.cjs')
37
+ }
38
+ module.exports.Title = Title
@@ -17,4 +17,4 @@ const {
17
17
  /**
18
18
  * Exports only default
19
19
  */
20
- module.exports = Cog // = require('./index.jsx')
20
+ module.exports = Cog
@@ -17,4 +17,4 @@ const {
17
17
  /**
18
18
  * Exports only default
19
19
  */
20
- module.exports = Field // require('./index.jsx') // component
20
+ module.exports = Field
@@ -26,7 +26,7 @@ const {
26
26
  default: Title
27
27
  } = require('./title/index.jsx')
28
28
 
29
- module.exports.Description = Description // require('./description/index.cjs')
30
- module.exports.ErrorMessage = ErrorMessage // require('./error-message/index.cjs')
31
- module.exports.Field = Field // require('./field/index.cjs')
32
- module.exports.Title = Title // require('./title/index.cjs')
29
+ module.exports.Description = Description
30
+ module.exports.ErrorMessage = ErrorMessage
31
+ module.exports.Field = Field
32
+ module.exports.Title = Title
@@ -16,7 +16,7 @@ declare module '#cogs/super/components/title' {
16
16
 
17
17
  shouldComponentUpdate (props: TitleProps): boolean
18
18
 
19
- renderTextContent (textContent: string) : React.JSX.Element
19
+ renderTextContent (textContent: string): React.JSX.Element
20
20
 
21
21
  renderIsRequired (): React.JSX.Element | null
22
22
 
@@ -61,8 +61,8 @@ export default class Title extends Component {
61
61
  }
62
62
 
63
63
  /**
64
- * @param {string} textContent
65
- * @returns {React.JSX.Element}
64
+ * @param {string} textContent
65
+ * @returns {React.JSX.Element}
66
66
  */
67
67
  renderTextContent (textContent) {
68
68
  return (
@@ -39,8 +39,7 @@
39
39
  .description {
40
40
  @include typography.secondary-text;
41
41
 
42
- // stylelint-disable-next-line no-duplicate-selectors
43
- & {
42
+ & /* stylelint-disable-line no-duplicate-selectors */ {
44
43
  display: block;
45
44
  padding: 0;
46
45
  margin: 0 0 0.25rem 0;
@@ -50,8 +49,7 @@
50
49
  .error-message {
51
50
  @include typography.error-standard;
52
51
 
53
- // stylelint-disable-next-line no-duplicate-selectors
54
- & {
52
+ & /* stylelint-disable-line no-duplicate-selectors */ {
55
53
  display: block;
56
54
  padding: 0;
57
55
  margin: 0 0 0.25rem 0;
@@ -76,8 +76,7 @@
76
76
  }
77
77
  }
78
78
 
79
- // stylelint-disable-next-line no-descending-specificity
80
- input + label::before {
79
+ input + label::before /* stylelint-disable-line no-descending-specificity */ {
81
80
  border-color: palette.$disabled;
82
81
  }
83
82
  }
@@ -19,13 +19,11 @@
19
19
  &.checkbox {
20
20
  padding-left: 4rem;
21
21
 
22
- // stylelint-disable-next-line no-descending-specificity
23
- input {
22
+ input /* stylelint-disable-line no-descending-specificity */ {
24
23
  left: 1.5rem;
25
24
  }
26
25
 
27
- // stylelint-disable-next-line no-descending-specificity
28
- label:before {
26
+ label:before /* stylelint-disable-line no-descending-specificity */ {
29
27
  left: 1rem;
30
28
 
31
29
  border: 2px solid palette.$error-standard;
@@ -81,8 +81,7 @@
81
81
  border-color: palette.$disabled;
82
82
  }
83
83
 
84
- // stylelint-disable-next-line no-descending-specificity
85
- &::after {
84
+ &::after /* stylelint-disable-line no-descending-specificity */ {
86
85
  background-color: palette.$disabled;
87
86
  }
88
87
  }