@spaced-out/ui-design-system 0.1.26 → 0.1.28

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.
Files changed (73) hide show
  1. package/.cspell/custom-words.txt +7 -0
  2. package/.storybook/main.js +70 -28
  3. package/.storybook/manager-head.html +4 -0
  4. package/.storybook/manager.js +0 -4
  5. package/.storybook/preview-head.html +32 -6
  6. package/.storybook/preview.js +0 -5
  7. package/CHANGELOG.md +41 -0
  8. package/babel.config.js +1 -0
  9. package/lib/components/Badge/Badge.module.css +1 -0
  10. package/lib/components/ButtonDropdown/ButtonDropdown.js +10 -9
  11. package/lib/components/ButtonDropdown/ButtonDropdown.js.flow +6 -4
  12. package/lib/components/Checkbox/Checkbox.js +3 -7
  13. package/lib/components/Checkbox/Checkbox.js.flow +3 -8
  14. package/lib/components/Chip/Chip.js +1 -1
  15. package/lib/components/Chip/Chip.js.flow +2 -2
  16. package/lib/components/CollapsibleCard/CollapsibleCard.js +3 -0
  17. package/lib/components/CollapsibleCard/CollapsibleCard.js.flow +4 -0
  18. package/lib/components/Dialog/Dialog.js +23 -2
  19. package/lib/components/Dialog/Dialog.js.flow +38 -0
  20. package/lib/components/Dropdown/Dropdown.js +10 -9
  21. package/lib/components/Dropdown/Dropdown.js.flow +6 -4
  22. package/lib/components/FocusManager/FocusManager.js +7 -5
  23. package/lib/components/FocusManager/FocusManager.js.flow +3 -3
  24. package/lib/components/InlineDropdown/InlineDropdown.js +10 -9
  25. package/lib/components/InlineDropdown/InlineDropdown.js.flow +6 -4
  26. package/lib/components/Menu/Menu.js +48 -12
  27. package/lib/components/Menu/Menu.js.flow +102 -9
  28. package/lib/components/Menu/Menu.module.css +10 -0
  29. package/lib/components/Menu/MenuOptionButton.js +21 -4
  30. package/lib/components/Menu/MenuOptionButton.js.flow +21 -0
  31. package/lib/components/Modal/Modal.js +35 -8
  32. package/lib/components/Modal/Modal.js.flow +52 -7
  33. package/lib/components/Modal/Modal.module.css +1 -3
  34. package/lib/components/Panel/Panel.js +21 -1
  35. package/lib/components/Panel/Panel.js.flow +30 -1
  36. package/lib/components/Panel/Panel.module.css +0 -1
  37. package/lib/components/Table/DefaultRow.js +5 -5
  38. package/lib/components/Table/DefaultRow.js.flow +14 -11
  39. package/lib/components/Table/StaticTable.js +5 -1
  40. package/lib/components/Table/StaticTable.js.flow +4 -0
  41. package/lib/components/Table/Table.js.flow +2 -0
  42. package/lib/components/Tabs/TabList/TabDropdown.js +10 -9
  43. package/lib/components/Tabs/TabList/TabDropdown.js.flow +6 -4
  44. package/lib/components/Toast/Toast.js +7 -5
  45. package/lib/components/Toast/Toast.js.flow +5 -3
  46. package/lib/components/Tooltip/Tooltip.js +22 -25
  47. package/lib/components/Tooltip/Tooltip.js.flow +25 -22
  48. package/lib/components/Typeahead/Typeahead.js +10 -9
  49. package/lib/components/Typeahead/Typeahead.js.flow +6 -4
  50. package/lib/hooks/index.js +55 -0
  51. package/lib/hooks/index.js.flow +5 -0
  52. package/lib/hooks/useCopyToClipboard.js +31 -0
  53. package/lib/hooks/useCopyToClipboard.js.flow +31 -0
  54. package/lib/hooks/useInputState.js +23 -0
  55. package/lib/hooks/useInputState.js.flow +28 -0
  56. package/lib/hooks/useLockedBody.js +54 -0
  57. package/lib/hooks/useLockedBody.js.flow +55 -0
  58. package/lib/hooks/useToggle.js +18 -0
  59. package/lib/hooks/useToggle.js.flow +17 -0
  60. package/lib/hooks/useWindowSize.js +32 -0
  61. package/lib/hooks/useWindowSize.js.flow +37 -0
  62. package/lib/styles/typography.module.css +1 -0
  63. package/lib/types/common.js +0 -1
  64. package/lib/utils/index.js +11 -0
  65. package/lib/utils/index.js.flow +1 -0
  66. package/lib/utils/menu.js +57 -2
  67. package/lib/utils/menu.js.flow +109 -1
  68. package/lib/utils/string.js +4 -2
  69. package/lib/utils/string.js.flow +3 -0
  70. package/lib/utils/tokens.js +154 -0
  71. package/lib/utils/tokens.js.flow +228 -0
  72. package/package.json +19 -16
  73. package/.storybook/public/favicon.svg +0 -6
@@ -1,5 +1,7 @@
1
1
  Anant
2
+ argstable
2
3
  atleast
4
+ autodocs
3
5
  circlehollow
4
6
  CODEOWNERS
5
7
  commitlint
@@ -16,6 +18,7 @@ fontawesome
16
18
  framename
17
19
  Gaurav
18
20
  innerref
21
+ interdimensional
19
22
  Lipsey
20
23
  Neue
21
24
  Nishant
@@ -26,14 +29,18 @@ noopener
26
29
  noreferrer
27
30
  OPACITYS
28
31
  partialformat
32
+ pocus
29
33
  premajor
30
34
  preminor
31
35
  prepatch
32
36
  rgba
33
37
  sbdocs
34
38
  Stapleton
39
+ storysource
35
40
  superrover
36
41
  systemjs
42
+ tablist
43
+ tabout
37
44
  testid
38
45
  tnum
39
46
  transclude
@@ -1,18 +1,12 @@
1
1
  const path = require('path');
2
-
3
2
  module.exports = {
4
3
  stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.jsx'],
5
- features: {buildStoriesJson: true},
4
+ features: {
5
+ buildStoriesJson: true,
6
+ storyStoreV7: false, // 👈 Opt out of on-demand story loading
7
+ },
6
8
  // Add any Storybook addons you want here: https://storybook.js.org/addons/
7
9
  addons: [
8
- {
9
- name: '@storybook/addon-postcss',
10
- options: {
11
- postcssLoaderOptions: {
12
- implementation: require('postcss'),
13
- },
14
- },
15
- },
16
10
  {
17
11
  name: '@storybook/addon-docs',
18
12
  options: {
@@ -26,8 +20,60 @@ module.exports = {
26
20
  '@storybook/addon-a11y',
27
21
  '@storybook/addon-essentials',
28
22
  '@storybook/testing-react',
29
- 'storybook-vscode-component/register',
23
+ // 'storybook-vscode-component/register', This is not supported in storybook 7
24
+ '@storybook/addon-mdx-gfm',
25
+ {
26
+ name: '@storybook/addon-storysource',
27
+ options: {
28
+ loaderOptions: {
29
+ injectStoryParameters: false,
30
+ prettierConfig: {
31
+ singleQuote: true,
32
+ trailingComma: 'all',
33
+ printWidth: 80,
34
+ tabWidth: 2,
35
+ bracketSpacing: false,
36
+ endOfLine: 'lf',
37
+ overrides: [
38
+ {
39
+ files: ['*.js', '*.jsx'],
40
+ options: {
41
+ parser: 'babel-flow',
42
+ },
43
+ },
44
+ {
45
+ files: ['*.css'],
46
+ options: {
47
+ parser: 'css',
48
+ },
49
+ },
50
+ ],
51
+ },
52
+ },
53
+ },
54
+ },
30
55
  ],
56
+ babel: async (options) => ({
57
+ ...options,
58
+ sourceType: 'unambiguous',
59
+ presets: [
60
+ [
61
+ '@babel/preset-env',
62
+ {
63
+ targets: [
64
+ 'last 2 Chrome versions',
65
+ 'last 2 Safari versions',
66
+ 'last 2 Firefox versions',
67
+ 'last 2 Edge versions',
68
+ 'last 3 iOS Major versions',
69
+ ],
70
+ },
71
+ ],
72
+ '@babel/preset-react',
73
+ '@babel/preset-flow',
74
+ ],
75
+ plugins: ['macros'],
76
+ }),
31
77
  webpackFinal: async (config) => {
32
78
  config.module.rules = config.module.rules.map((rule) => {
33
79
  if (rule.test && rule.test.toString().includes('woff')) {
@@ -38,37 +84,33 @@ module.exports = {
38
84
  }
39
85
  return rule;
40
86
  });
41
-
42
87
  config.module.rules.push({
43
88
  test: /\.scss$/,
44
89
  use: ['style-loader', 'css-loader?modules=true', 'sass-loader'],
45
90
  include: path.resolve(__dirname, '../'),
46
91
  });
47
-
48
92
  config.module.rules.push({
49
93
  test: /\.(js|jsx)$/,
50
94
  loader: require.resolve('babel-loader'),
51
95
  options: {
52
- presets: [['react-app', {flow: true, typescript: false}]],
96
+ presets: [
97
+ [
98
+ 'react-app',
99
+ {
100
+ flow: true,
101
+ typescript: false,
102
+ },
103
+ ],
104
+ ],
53
105
  },
54
106
  });
55
107
 
56
- // fonts
57
- config.module.rules.push({
58
- test: /\.(png|woff|woff2|eot|ttf|svg)$/,
59
- use: [
60
- {
61
- loader: 'file-loader',
62
- query: {
63
- name: '[name].[ext]',
64
- },
65
- },
66
- ],
67
- include: path.resolve(__dirname, '../'),
68
- });
69
108
  config.resolve.extensions.push('.js', '.jsx');
70
-
71
109
  return config;
72
110
  },
73
111
  staticDirs: ['public'],
112
+ framework: {
113
+ name: '@storybook/react-webpack5',
114
+ options: {},
115
+ },
74
116
  };
@@ -1,6 +1,10 @@
1
1
  <!--
2
2
  Override the default favicon used in the Storybook in the browser tab.
3
3
  -->
4
+ <meta
5
+ name="viewport"
6
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
7
+ />
4
8
  <link
5
9
  rel="icon"
6
10
  sizes="any"
@@ -7,8 +7,4 @@ import senseTheme from './SenseTheme';
7
7
 
8
8
  addons.setConfig({
9
9
  theme: senseTheme,
10
- previewTabs: {
11
- canvas: {title: 'Playground'},
12
- 'storybook/docs/panel': {title: 'Documentation', index: -1},
13
- },
14
10
  });
@@ -1,3 +1,7 @@
1
+ <meta
2
+ name="viewport"
3
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
4
+ />
1
5
  <style type="text/css">
2
6
  @font-face {
3
7
  font-family: 'Centra No 2';
@@ -30,7 +34,8 @@
30
34
  body {
31
35
  display: flex;
32
36
  width: 100%;
33
- height: 100%;
37
+ min-height: 100%;
38
+ height: auto;
34
39
  margin: 0px;
35
40
  padding: 0px;
36
41
  background: white;
@@ -108,11 +113,7 @@
108
113
  font-family: 'Centra No 2';
109
114
  }
110
115
 
111
- [class*='sbdocs'] {
112
- font-family: 'Centra No 2' !important;
113
- }
114
-
115
- [class*='docblock'] {
116
+ .sbdocs *:not(i) {
116
117
  font-family: 'Centra No 2' !important;
117
118
  }
118
119
 
@@ -128,4 +129,29 @@
128
129
  #root div {
129
130
  display: flex;
130
131
  }
132
+
133
+ div:has(> .docblock-argstable) {
134
+ overflow: auto !important;
135
+ }
136
+
137
+ .docblock-argstable {
138
+ max-width: 98%;
139
+ }
140
+
141
+ code {
142
+ white-space: pre-wrap !important;
143
+ background-color: #f1f1f5 !important;
144
+ border-color: #d3d2e0 !important;
145
+ color: #17172a !important;
146
+ }
147
+
148
+ .docblock-source {
149
+ background-color: #f1f1f5 !important;
150
+ box-shadow: none !important;
151
+ border-color: #d3d2e0 !important;
152
+ }
153
+
154
+ a.sbdocs {
155
+ color: #5c34cd !important;
156
+ }
131
157
  </style>
@@ -33,11 +33,6 @@
33
33
 
34
34
  import {themes} from '@storybook/theming';
35
35
  import {wd} from 'paths.macro';
36
- import {addParameters} from '@storybook/react';
37
-
38
- addParameters({
39
- viewMode: 'docs',
40
- });
41
36
 
42
37
  export const parameters = {
43
38
  backgrounds: {
package/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.28](https://github.com/spaced-out/ui-design-system/compare/v0.1.27...v0.1.28) (2023-05-26)
6
+
7
+
8
+ ### Features
9
+
10
+ * added @storybook/addon-storysource ([b25a7f7](https://github.com/spaced-out/ui-design-system/commit/b25a7f787fbfe366ba9ec7f96a48096cbcdb24f1))
11
+ * tokens page now support search ([bae8e7f](https://github.com/spaced-out/ui-design-system/commit/bae8e7fac06ee31cb0e4ea390e0709a4d51a171d))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * added fun entries missing messages ([eabe577](https://github.com/spaced-out/ui-design-system/commit/eabe5772da715d9066794ff99aa76b39a2e8f847))
17
+ * checkbox onChange getting triggered twice ([#118](https://github.com/spaced-out/ui-design-system/issues/118)) ([79f01fd](https://github.com/spaced-out/ui-design-system/commit/79f01fd80d11bc3c22280e3432dc05567c680830))
18
+ * fixed broken links in docs ([faf1301](https://github.com/spaced-out/ui-design-system/commit/faf1301dbc6285d49a1c3c5ead91fc493df47b96))
19
+ * no scaling on iPhones ([11556c0](https://github.com/spaced-out/ui-design-system/commit/11556c006e73c3d067e9c7187ac72d41617c3349))
20
+ * story style fixes ([3ef77e7](https://github.com/spaced-out/ui-design-system/commit/3ef77e77ca2fe2fcc0d08a6baf7ef079bc3c8dab))
21
+ * style fixes for sb ([14900e9](https://github.com/spaced-out/ui-design-system/commit/14900e995e43673fea0b744b22a1e064f81ae16d))
22
+ * style fixes for sb ([2672025](https://github.com/spaced-out/ui-design-system/commit/2672025e2bd214b035ae89eafbb004bd1663958f))
23
+
24
+ ### [0.1.27](https://github.com/spaced-out/ui-design-system/compare/v0.1.26...v0.1.27) (2023-05-17)
25
+
26
+
27
+ ### Features
28
+
29
+ * [@floating-ui](https://github.com/floating-ui) bump to `v0.24.0` ([#115](https://github.com/spaced-out/ui-design-system/issues/115)) ([3c44db3](https://github.com/spaced-out/ui-design-system/commit/3c44db3c0e12b8483fef08881fe6efc1e94ee721))
30
+ * **accessibility:** last tab out should close the menu for all composite components using menu ([#111](https://github.com/spaced-out/ui-design-system/issues/111)) ([b76a823](https://github.com/spaced-out/ui-design-system/commit/b76a82340478371de87b4cf02a58f9fdae30068f))
31
+ * floating ui migration ([#112](https://github.com/spaced-out/ui-design-system/issues/112)) ([85a1769](https://github.com/spaced-out/ui-design-system/commit/85a17695d4c54e091f8b77efbbd02b0b21444e60))
32
+ * moved [@floating-ui](https://github.com/floating-ui) to stable version 0.16.0 ([b287e6d](https://github.com/spaced-out/ui-design-system/commit/b287e6d526e9fe01e8e65702ccb79f6af1b3e230))
33
+ * storybook upgrade tokens revamp and menu changes to include search ([#114](https://github.com/spaced-out/ui-design-system/issues/114)) ([2e8a9df](https://github.com/spaced-out/ui-design-system/commit/2e8a9df5dd79eedc6490256083720dbbf2b56f6a))
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * add classnames support for tablerow and checkbox ([#116](https://github.com/spaced-out/ui-design-system/issues/116)) ([a159563](https://github.com/spaced-out/ui-design-system/commit/a159563a3c80e7244fb8240c5cf2ae2f0ce9fc37))
39
+ * changed modal styles ([892d328](https://github.com/spaced-out/ui-design-system/commit/892d3284dc2531df0744e9db95684f53a6740af1))
40
+ * chip icon external classnames support ([#113](https://github.com/spaced-out/ui-design-system/issues/113)) ([4ff43e4](https://github.com/spaced-out/ui-design-system/commit/4ff43e402e0937f9c137cb92ff6d3dba44998b63))
41
+ * collapsible card isopen bug ([#117](https://github.com/spaced-out/ui-design-system/issues/117)) ([0d31766](https://github.com/spaced-out/ui-design-system/commit/0d31766bb2164096e8d33985cb56acb5b2758ed9))
42
+ * tooltip fixes for [@floating-ui](https://github.com/floating-ui) bump ([7c16c44](https://github.com/spaced-out/ui-design-system/commit/7c16c44fd15fed26236da11007d678cabf58d1f0))
43
+ * updated docs ([3718bb8](https://github.com/spaced-out/ui-design-system/commit/3718bb8918549a194b941e85d4782ded75270451))
44
+ * updated dropdown docs ([4597dee](https://github.com/spaced-out/ui-design-system/commit/4597dee9a13cfd6f794871e83c69d7774bb0ad63))
45
+
5
46
  ### [0.1.26](https://github.com/spaced-out/ui-design-system/compare/v0.1.25...v0.1.26) (2023-05-03)
6
47
 
7
48
 
package/babel.config.js CHANGED
@@ -1,4 +1,5 @@
1
1
  module.exports = {
2
+ sourceType: 'unambiguous',
2
3
  presets: [
3
4
  [
4
5
  '@babel/preset-env',
@@ -8,6 +8,7 @@
8
8
  border-radius: size100;
9
9
  height: size22;
10
10
  padding: spaceNone spaceXSmall;
11
+ width: fit-content;
11
12
  }
12
13
 
13
14
  .fixedWidth {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ButtonDropdown = exports.ANCHOR_POSITION_TYPE = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _reactDom = require("@floating-ui/react-dom");
8
+ var _react2 = require("@floating-ui/react");
9
9
  var _size = require("../../styles/variables/_size");
10
10
  var _space = require("../../styles/variables/_space");
11
11
  var _classify = require("../../utils/classify");
@@ -51,14 +51,14 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
51
51
  const {
52
52
  x,
53
53
  y,
54
- reference,
55
- floating,
54
+ refs,
56
55
  strategy
57
- } = (0, _reactDom.useFloating)({
56
+ } = (0, _react2.useFloating)({
57
+ open: true,
58
58
  strategy: 'absolute',
59
59
  placement: anchorPosition,
60
- whileElementsMounted: _reactDom.autoUpdate,
61
- middleware: [(0, _reactDom.shift)(), (0, _reactDom.flip)(), (0, _reactDom.offset)(parseInt(_space.spaceXXSmall))]
60
+ whileElementsMounted: _react2.autoUpdate,
61
+ middleware: [(0, _react2.shift)(), (0, _react2.flip)(), (0, _react2.offset)(parseInt(_space.spaceXXSmall))]
62
62
  });
63
63
  const onMenuToggle = isOpen => {
64
64
  if (isOpen) {
@@ -94,7 +94,7 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
94
94
  iconRightType: iconRightType,
95
95
  disabled: disabled,
96
96
  size: size,
97
- ref: reference,
97
+ ref: refs.setReference,
98
98
  onClick: e => {
99
99
  e.stopPropagation();
100
100
  onOpen();
@@ -106,7 +106,7 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
106
106
  }
107
107
  }), children)), isOpen && menu && /*#__PURE__*/React.createElement("div", {
108
108
  onClickCapture: cancelNext,
109
- ref: floating,
109
+ ref: refs.setFloating,
110
110
  style: {
111
111
  display: 'flex',
112
112
  position: strategy,
@@ -123,7 +123,8 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
123
123
  clickAway();
124
124
  }
125
125
  },
126
- size: menu.size || size
126
+ size: menu.size || size,
127
+ onTabOut: clickAway
127
128
  }))));
128
129
  });
129
130
  });
@@ -12,7 +12,7 @@ import {
12
12
  shift,
13
13
  // $FlowFixMe[untyped-import]
14
14
  useFloating,
15
- } from '@floating-ui/react-dom';
15
+ } from '@floating-ui/react';
16
16
 
17
17
  import {sizeFluid} from '../../styles/variables/_size';
18
18
  import {spaceNone, spaceXXSmall} from '../../styles/variables/_space';
@@ -83,7 +83,8 @@ export const ButtonDropdown: React$AbstractComponent<
83
83
  const menuBtnRef = React.useRef(null);
84
84
  const [isMenuOpen, setIsMenuOpen] = React.useState(false);
85
85
  React.useImperativeHandle(forwardRef, () => menuBtnRef.current);
86
- const {x, y, reference, floating, strategy} = useFloating({
86
+ const {x, y, refs, strategy} = useFloating({
87
+ open: true,
87
88
  strategy: 'absolute',
88
89
  placement: anchorPosition,
89
90
  whileElementsMounted: autoUpdate,
@@ -135,7 +136,7 @@ export const ButtonDropdown: React$AbstractComponent<
135
136
  iconRightType={iconRightType}
136
137
  disabled={disabled}
137
138
  size={size}
138
- ref={reference}
139
+ ref={refs.setReference}
139
140
  onClick={(e) => {
140
141
  e.stopPropagation();
141
142
  onOpen();
@@ -153,7 +154,7 @@ export const ButtonDropdown: React$AbstractComponent<
153
154
  {isOpen && menu && (
154
155
  <div
155
156
  onClickCapture={cancelNext}
156
- ref={floating}
157
+ ref={refs.setFloating}
157
158
  style={{
158
159
  display: 'flex',
159
160
  position: strategy,
@@ -174,6 +175,7 @@ export const ButtonDropdown: React$AbstractComponent<
174
175
  }
175
176
  }}
176
177
  size={menu.size || size}
178
+ onTabOut={clickAway}
177
179
  />
178
180
  </div>
179
181
  )}
@@ -30,7 +30,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
30
30
  } = _ref;
31
31
  const checkboxInput = /*#__PURE__*/React.createRef();
32
32
  React.useImperativeHandle(forwardRef, () => checkboxInput.current);
33
- const handleOnChange = () => {
33
+ const handleOnClick = () => {
34
34
  if (!disabled) {
35
35
  onChange && onChange({
36
36
  value,
@@ -51,9 +51,6 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
51
51
  checkboxInput.current.indeterminate = false;
52
52
  }
53
53
  }, [indeterminate]);
54
- const onClickHandler = () => {
55
- checkboxInput.current?.click();
56
- };
57
54
  return /*#__PURE__*/React.createElement("div", {
58
55
  "data-testid": "checkbox",
59
56
  className: (0, _classify.default)(_CheckboxModule.default.checkboxContainer, {
@@ -61,7 +58,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
61
58
  [_CheckboxModule.default.horizontalCheckbox]: align === 'horizontal-fixed',
62
59
  [_CheckboxModule.default.fluidCheckbox]: align === 'horizontal-fluid'
63
60
  }, classNames?.wrapper),
64
- onClick: onClickHandler
61
+ onClick: handleOnClick
65
62
  }, /*#__PURE__*/React.createElement("span", {
66
63
  className: (0, _classify.default)(_CheckboxModule.default.checkboxSquare, {
67
64
  [_CheckboxModule.default.disabled]: disabled
@@ -69,10 +66,9 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
69
66
  }, /*#__PURE__*/React.createElement("input", {
70
67
  tabIndex: disabled ? -1 : tabIndex,
71
68
  type: "checkbox",
72
- value: value,
73
69
  checked: checked,
70
+ readOnly: true,
74
71
  ref: checkboxInput,
75
- onChange: handleOnChange,
76
72
  className: (0, _classify.default)(_CheckboxModule.default.inputCheckbox),
77
73
  disabled: disabled,
78
74
  name: name,
@@ -61,7 +61,7 @@ export const Checkbox: React$AbstractComponent<
61
61
  const checkboxInput = React.createRef<HTMLInputElement>();
62
62
  React.useImperativeHandle(forwardRef, () => checkboxInput.current);
63
63
 
64
- const handleOnChange = () => {
64
+ const handleOnClick = () => {
65
65
  if (!disabled) {
66
66
  onChange &&
67
67
  onChange({
@@ -86,10 +86,6 @@ export const Checkbox: React$AbstractComponent<
86
86
  }
87
87
  }, [indeterminate]);
88
88
 
89
- const onClickHandler = () => {
90
- checkboxInput.current?.click();
91
- };
92
-
93
89
  return (
94
90
  <div
95
91
  data-testid="checkbox"
@@ -102,7 +98,7 @@ export const Checkbox: React$AbstractComponent<
102
98
  },
103
99
  classNames?.wrapper,
104
100
  )}
105
- onClick={onClickHandler}
101
+ onClick={handleOnClick}
106
102
  >
107
103
  <span
108
104
  className={classify(
@@ -116,10 +112,9 @@ export const Checkbox: React$AbstractComponent<
116
112
  <input
117
113
  tabIndex={disabled ? -1 : tabIndex}
118
114
  type="checkbox"
119
- value={value}
120
115
  checked={checked}
116
+ readOnly
121
117
  ref={checkboxInput}
122
- onChange={handleOnChange}
123
118
  className={classify(css.inputCheckbox)}
124
119
  disabled={disabled}
125
120
  name={name}
@@ -55,7 +55,7 @@ const Chip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
55
55
  }, classNames?.wrapper),
56
56
  onClick: onClick
57
57
  }), iconName && size !== 'small' && /*#__PURE__*/React.createElement(_Icon.Icon, {
58
- className: _ChipModule.default.chipIcon,
58
+ className: (0, _classify.classify)(_ChipModule.default.chipIcon, classNames?.icon),
59
59
  name: iconName,
60
60
  type: iconType,
61
61
  size: "small"
@@ -10,7 +10,7 @@ import {Truncate} from '../Truncate';
10
10
  import css from './Chip.module.css';
11
11
 
12
12
 
13
- type ClassNames = $ReadOnly<{wrapper?: string}>;
13
+ type ClassNames = $ReadOnly<{wrapper?: string, icon?: string}>;
14
14
 
15
15
  export const CHIP_SEMANTIC = Object.freeze({
16
16
  primary: 'primary',
@@ -91,7 +91,7 @@ export const Chip: React$AbstractComponent<ChipProps, HTMLDivElement> =
91
91
  >
92
92
  {iconName && size !== 'small' && (
93
93
  <Icon
94
- className={css.chipIcon}
94
+ className={classify(css.chipIcon, classNames?.icon)}
95
95
  name={iconName}
96
96
  type={iconType}
97
97
  size="small"
@@ -55,6 +55,9 @@ const CollapsibleCard = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
55
55
  headerIconType = 'solid'
56
56
  } = _ref3;
57
57
  const [collapsibleCardIsOpen, setCollapsibleCardIsOpen] = React.useState(Boolean(isOpen));
58
+ React.useEffect(() => {
59
+ setCollapsibleCardIsOpen(Boolean(isOpen));
60
+ }, [isOpen]);
58
61
  return /*#__PURE__*/React.createElement("div", {
59
62
  "data-testid": "CollapsibleCard",
60
63
  className: (0, _classify.default)(_CollapsibleCardModule.default.wrapper, classNames?.wrapper),
@@ -91,6 +91,10 @@ export const CollapsibleCard: React$AbstractComponent<
91
91
  Boolean(isOpen),
92
92
  );
93
93
 
94
+ React.useEffect(() => {
95
+ setCollapsibleCardIsOpen(Boolean(isOpen));
96
+ }, [isOpen]);
97
+
94
98
  return (
95
99
  <div
96
100
  data-testid="CollapsibleCard"
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DialogHeader = exports.DialogFooter = exports.DialogBody = exports.Dialog = exports.DIALOG_SEMANTIC = void 0;
6
+ exports.DialogHeader = exports.DialogFooter = exports.DialogBody = exports.Dialog = exports.DIALOG_SEMANTIC = exports.BasicDialog = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _typography = require("../../types/typography");
9
9
  var _classify = _interopRequireDefault(require("../../utils/classify"));
10
+ var _Button = require("../Button");
10
11
  var _Icon = require("../Icon");
11
12
  var _Modal = require("../Modal");
12
13
  var _DialogModule = _interopRequireDefault(require("./Dialog.module.css"));
@@ -138,4 +139,24 @@ const Dialog = _ref5 => {
138
139
  iconName: iconName
139
140
  }))), children);
140
141
  };
141
- exports.Dialog = Dialog;
142
+ exports.Dialog = Dialog;
143
+ const BasicDialog = _ref6 => {
144
+ let {
145
+ heading,
146
+ body,
147
+ confirmText,
148
+ abortText,
149
+ handleConfirm,
150
+ handleAbort,
151
+ ...restDialogProps
152
+ } = _ref6;
153
+ return /*#__PURE__*/React.createElement(Dialog, restDialogProps, !!heading && /*#__PURE__*/React.createElement(DialogHeader, null, heading), !!body && /*#__PURE__*/React.createElement(DialogBody, null, body), /*#__PURE__*/React.createElement(DialogFooter, null, !!abortText && /*#__PURE__*/React.createElement(_Button.Button, {
154
+ isFluid: true,
155
+ type: "tertiary",
156
+ onClick: handleAbort
157
+ }, abortText), !!confirmText && /*#__PURE__*/React.createElement(_Button.Button, {
158
+ isFluid: true,
159
+ onClick: handleConfirm
160
+ }, confirmText)));
161
+ };
162
+ exports.BasicDialog = BasicDialog;
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
 
5
5
  import {TEXT_COLORS} from '../../types/typography';
6
6
  import classify from '../../utils/classify';
7
+ import {Button} from '../Button';
7
8
  import {Icon} from '../Icon';
8
9
  import type {ModalProps} from '../Modal';
9
10
  import {Modal} from '../Modal';
@@ -51,6 +52,16 @@ export type DialogProps = {
51
52
  iconName?: string,
52
53
  };
53
54
 
55
+ export type BasicDialogProps = {
56
+ ...DialogProps,
57
+ heading?: React.Node,
58
+ body?: React.Node,
59
+ confirmText?: string,
60
+ abortText?: string,
61
+ handleConfirm?: (event: SyntheticEvent<>) => mixed,
62
+ handleAbort?: (event: SyntheticEvent<>) => mixed,
63
+ };
64
+
54
65
  const DialogIcon = ({
55
66
  semantic,
56
67
  iconName,
@@ -188,3 +199,30 @@ export const Dialog = ({
188
199
  {children}
189
200
  </Modal>
190
201
  );
202
+
203
+ export const BasicDialog = ({
204
+ heading,
205
+ body,
206
+ confirmText,
207
+ abortText,
208
+ handleConfirm,
209
+ handleAbort,
210
+ ...restDialogProps
211
+ }: BasicDialogProps): React.Node => (
212
+ <Dialog {...restDialogProps}>
213
+ {!!heading && <DialogHeader>{heading}</DialogHeader>}
214
+ {!!body && <DialogBody>{body}</DialogBody>}
215
+ <DialogFooter>
216
+ {!!abortText && (
217
+ <Button isFluid type="tertiary" onClick={handleAbort}>
218
+ {abortText}
219
+ </Button>
220
+ )}
221
+ {!!confirmText && (
222
+ <Button isFluid onClick={handleConfirm}>
223
+ {confirmText}
224
+ </Button>
225
+ )}
226
+ </DialogFooter>
227
+ </Dialog>
228
+ );