@digigov/react-experimental 2.0.0-a7ffb5dc → 2.0.0-aefd0709

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 (79) hide show
  1. package/FloatingButton/index.d.ts +1 -1
  2. package/FloatingButton/index.js +23 -23
  3. package/FloatingButton/index.js.map +7 -0
  4. package/Kitchensink/AllComponents/index.js +8 -0
  5. package/{FloatingButton/index.test → Kitchensink/AllComponents}/package.json +1 -1
  6. package/Kitchensink/AllComponents.d.ts +2 -0
  7. package/Kitchensink/AllComponents.js.map +7 -0
  8. package/Kitchensink/KitchensinkByCategory/index.js +44 -0
  9. package/Kitchensink/KitchensinkByCategory/package.json +6 -0
  10. package/Kitchensink/KitchensinkByCategory.d.ts +6 -0
  11. package/Kitchensink/KitchensinkByCategory.js.map +7 -0
  12. package/Kitchensink/KitchensinkByLetter/index.js +27 -0
  13. package/{OptionButtonSteps/index.test → Kitchensink/KitchensinkByLetter}/package.json +1 -1
  14. package/Kitchensink/KitchensinkByLetter.d.ts +6 -0
  15. package/Kitchensink/KitchensinkByLetter.js.map +7 -0
  16. package/Kitchensink/KitchensinkComponent/index.js +32 -0
  17. package/Kitchensink/KitchensinkComponent/package.json +6 -0
  18. package/Kitchensink/KitchensinkComponent.d.ts +10 -0
  19. package/Kitchensink/KitchensinkComponent.js.map +7 -0
  20. package/Kitchensink/KitchensinkDashboard/index.js +45 -0
  21. package/Kitchensink/KitchensinkDashboard/package.json +6 -0
  22. package/Kitchensink/KitchensinkDashboard.d.ts +5 -0
  23. package/Kitchensink/KitchensinkDashboard.js.map +7 -0
  24. package/Kitchensink/index.d.ts +5 -0
  25. package/Kitchensink/index.js +6 -0
  26. package/Kitchensink/index.js.map +7 -0
  27. package/{OptionButtonBase/index.test → Kitchensink}/package.json +1 -1
  28. package/OptionButtonBase/index.d.ts +5 -5
  29. package/OptionButtonBase/index.js +24 -23
  30. package/OptionButtonBase/index.js.map +7 -0
  31. package/OptionButtonSteps/index.d.ts +10 -10
  32. package/OptionButtonSteps/index.js +34 -29
  33. package/OptionButtonSteps/index.js.map +7 -0
  34. package/cjs/FloatingButton/index.js +55 -29
  35. package/cjs/FloatingButton/index.js.map +7 -0
  36. package/cjs/Kitchensink/AllComponents/index.js +41 -0
  37. package/cjs/Kitchensink/AllComponents.js.map +7 -0
  38. package/cjs/Kitchensink/KitchensinkByCategory/index.js +77 -0
  39. package/cjs/Kitchensink/KitchensinkByCategory.js.map +7 -0
  40. package/cjs/Kitchensink/KitchensinkByLetter/index.js +60 -0
  41. package/cjs/Kitchensink/KitchensinkByLetter.js.map +7 -0
  42. package/cjs/Kitchensink/KitchensinkComponent/index.js +62 -0
  43. package/cjs/Kitchensink/KitchensinkComponent.js.map +7 -0
  44. package/cjs/Kitchensink/KitchensinkDashboard/index.js +78 -0
  45. package/cjs/Kitchensink/KitchensinkDashboard.js.map +7 -0
  46. package/cjs/Kitchensink/index.js +30 -0
  47. package/cjs/Kitchensink/index.js.map +7 -0
  48. package/cjs/OptionButtonBase/index.js +56 -29
  49. package/cjs/OptionButtonBase/index.js.map +7 -0
  50. package/cjs/OptionButtonSteps/index.js +66 -35
  51. package/cjs/OptionButtonSteps/index.js.map +7 -0
  52. package/cjs/index.js +27 -37
  53. package/cjs/index.js.map +7 -0
  54. package/index.d.ts +1 -0
  55. package/index.js +6 -4
  56. package/index.js.map +7 -0
  57. package/package.json +7 -9
  58. package/src/FloatingButton/__snapshots__/index.test.tsx.snap +37 -0
  59. package/src/FloatingButton/index.test.tsx +11 -5
  60. package/src/FloatingButton/index.tsx +1 -1
  61. package/src/Kitchensink/AllComponents.tsx +6 -0
  62. package/src/Kitchensink/KitchensinkByCategory.tsx +54 -0
  63. package/src/Kitchensink/KitchensinkByLetter.tsx +35 -0
  64. package/src/Kitchensink/KitchensinkComponent.tsx +70 -0
  65. package/src/Kitchensink/KitchensinkDashboard.tsx +56 -0
  66. package/src/Kitchensink/index.ts +5 -0
  67. package/src/OptionButtonBase/__snapshots__/index.test.tsx.snap +37 -0
  68. package/src/OptionButtonBase/index.test.tsx +11 -5
  69. package/src/OptionButtonBase/index.tsx +8 -9
  70. package/src/OptionButtonSteps/__snapshots__/index.test.tsx.snap +84 -0
  71. package/src/OptionButtonSteps/index.test.tsx +21 -7
  72. package/src/OptionButtonSteps/index.tsx +10 -11
  73. package/src/index.ts +1 -0
  74. package/FloatingButton/index.test/index.js +0 -19
  75. package/OptionButtonBase/index.test/index.js +0 -19
  76. package/OptionButtonSteps/index.test/index.js +0 -32
  77. package/cjs/FloatingButton/index.test/index.js +0 -22
  78. package/cjs/OptionButtonBase/index.test/index.js +0 -22
  79. package/cjs/OptionButtonSteps/index.test/index.js +0 -35
@@ -0,0 +1,5 @@
1
+ export * from '@digigov/react-experimental/Kitchensink/AllComponents';
2
+ export * from '@digigov/react-experimental/Kitchensink/KitchensinkByCategory';
3
+ export * from '@digigov/react-experimental/Kitchensink/KitchensinkByLetter';
4
+ export * from '@digigov/react-experimental/Kitchensink/KitchensinkComponent';
5
+ export * from '@digigov/react-experimental/Kitchensink/KitchensinkDashboard';
@@ -0,0 +1,37 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`renders the OptionButtonBase with selected=false 1`] = `
4
+ <body>
5
+ <div>
6
+ <button
7
+ class="ds-btn ds-option-btn"
8
+ >
9
+ +
10
+ </button>
11
+ </div>
12
+ </body>
13
+ `;
14
+
15
+ exports[`renders the OptionButtonBase with selected=true 1`] = `
16
+ <body>
17
+ <div>
18
+ <button
19
+ class="ds-btn ds-option-btn ds-option-btn--selected"
20
+ >
21
+ +
22
+ </button>
23
+ </div>
24
+ </body>
25
+ `;
26
+
27
+ exports[`renders the OptionButtonBase with no props 1`] = `
28
+ <body>
29
+ <div>
30
+ <button
31
+ class="ds-btn ds-option-btn"
32
+ >
33
+ +
34
+ </button>
35
+ </div>
36
+ </body>
37
+ `;
@@ -1,14 +1,20 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render } from '@testing-library/react';
3
3
 
4
4
  import OptionButtonBase from '@digigov/react-experimental/OptionButtonBase';
5
5
 
6
6
  it('renders the OptionButtonBase with no props', () => {
7
- expect(mount(<OptionButtonBase>+</OptionButtonBase>)).toMatchSnapshot();
7
+ expect(
8
+ render(<OptionButtonBase>+</OptionButtonBase>).baseElement
9
+ ).toMatchSnapshot();
8
10
  });
9
11
  it('renders the OptionButtonBase with selected=true', () => {
10
- expect(mount(<OptionButtonBase selected={true}>+</OptionButtonBase>)).toMatchSnapshot();
12
+ expect(
13
+ render(<OptionButtonBase selected={true}>+</OptionButtonBase>).baseElement
14
+ ).toMatchSnapshot();
11
15
  });
12
16
  it('renders the OptionButtonBase with selected=false', () => {
13
- expect(mount(<OptionButtonBase selected={false}>+</OptionButtonBase>)).toMatchSnapshot();
14
- });
17
+ expect(
18
+ render(<OptionButtonBase selected={false}>+</OptionButtonBase>).baseElement
19
+ ).toMatchSnapshot();
20
+ });
@@ -2,16 +2,15 @@ import React from 'react';
2
2
  import clsx from 'clsx';
3
3
  import Base, { BaseProps } from '@digigov/react-core/Base';
4
4
 
5
- export interface OptionButtonBaseProps
6
- extends BaseProps<'button'> {
5
+ export interface OptionButtonBaseProps extends BaseProps<'button'> {
7
6
  /**
8
- * selected is optional.
7
+ * selected is optional.
9
8
  * Use selected prop to set selected styling.
10
- * @value true
11
- * @value false
12
- * @default false
13
- */
14
- selected?: boolean
9
+ * @value true
10
+ * @value false
11
+ * @default false
12
+ */
13
+ selected?: boolean;
15
14
  }
16
15
  /**
17
16
  *
@@ -41,4 +40,4 @@ export const OptionButtonBase = React.forwardRef<
41
40
  );
42
41
  });
43
42
 
44
- export default OptionButtonBase;
43
+ export default OptionButtonBase;
@@ -0,0 +1,84 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`renders the OptionButtonSteps with activeStep=1 1`] = `
4
+ <body>
5
+ <div>
6
+ <div
7
+ class="ds-option-btn__steps"
8
+ />
9
+ </div>
10
+ </body>
11
+ `;
12
+
13
+ exports[`renders the OptionButtonSteps with no props 1`] = `
14
+ <body>
15
+ <div>
16
+ <div
17
+ class="ds-option-btn__steps"
18
+ />
19
+ </div>
20
+ </body>
21
+ `;
22
+
23
+ exports[`renders the OptionButtonSteps with steps="3" 1`] = `
24
+ <body>
25
+ <div>
26
+ <div
27
+ class="ds-option-btn__steps"
28
+ >
29
+ <div
30
+ class="ds-option-btn__step"
31
+ />
32
+ <div
33
+ class="ds-option-btn__step"
34
+ />
35
+ <div
36
+ class="ds-option-btn__step"
37
+ />
38
+ </div>
39
+ </div>
40
+ </body>
41
+ `;
42
+
43
+ exports[`renders the OptionButtonSteps with steps=3 activeStep=1 1`] = `
44
+ <body>
45
+ <div>
46
+ <div
47
+ class="ds-option-btn__steps"
48
+ >
49
+ <div
50
+ class="ds-option-btn__step ds-option-btn__step--active"
51
+ />
52
+ <div
53
+ class="ds-option-btn__step"
54
+ />
55
+ <div
56
+ class="ds-option-btn__step"
57
+ />
58
+ </div>
59
+ </div>
60
+ </body>
61
+ `;
62
+
63
+ exports[`renders the OptionButtonSteps with steps=4 1`] = `
64
+ <body>
65
+ <div>
66
+ <div
67
+ class="ds-option-btn__steps"
68
+ >
69
+ <div
70
+ class="ds-option-btn__step"
71
+ />
72
+ <div
73
+ class="ds-option-btn__step"
74
+ />
75
+ <div
76
+ class="ds-option-btn__step"
77
+ />
78
+ <div
79
+ class="ds-option-btn__step"
80
+ />
81
+ </div>
82
+ </div>
83
+ </body>
84
+ `;
@@ -1,20 +1,34 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render } from '@testing-library/react';
3
3
 
4
4
  import OptionButtonSteps from '@digigov/react-experimental/OptionButtonSteps';
5
5
 
6
6
  it('renders the OptionButtonSteps with no props', () => {
7
- expect(mount(<OptionButtonSteps>+</OptionButtonSteps>)).toMatchSnapshot();
7
+ expect(
8
+ render(<OptionButtonSteps>+</OptionButtonSteps>).baseElement
9
+ ).toMatchSnapshot();
8
10
  });
9
11
  it('renders the OptionButtonSteps with steps="3"', () => {
10
- expect(mount(<OptionButtonSteps steps={3}>+</OptionButtonSteps>)).toMatchSnapshot();
12
+ expect(
13
+ render(<OptionButtonSteps steps={3}>+</OptionButtonSteps>).baseElement
14
+ ).toMatchSnapshot();
11
15
  });
12
16
  it('renders the OptionButtonSteps with steps=4', () => {
13
- expect(mount(<OptionButtonSteps steps={4}>+</OptionButtonSteps>)).toMatchSnapshot();
17
+ expect(
18
+ render(<OptionButtonSteps steps={4}>+</OptionButtonSteps>).baseElement
19
+ ).toMatchSnapshot();
14
20
  });
15
21
  it('renders the OptionButtonSteps with activeStep=1', () => {
16
- expect(mount(<OptionButtonSteps activeStep={1}>+</OptionButtonSteps>)).toMatchSnapshot();
22
+ expect(
23
+ render(<OptionButtonSteps activeStep={1}>+</OptionButtonSteps>).baseElement
24
+ ).toMatchSnapshot();
17
25
  });
18
26
  it('renders the OptionButtonSteps with steps=3 activeStep=1', () => {
19
- expect(mount(<OptionButtonSteps steps={3} activeStep={1}>+</OptionButtonSteps>)).toMatchSnapshot();
20
- });
27
+ expect(
28
+ render(
29
+ <OptionButtonSteps steps={3} activeStep={1}>
30
+ +
31
+ </OptionButtonSteps>
32
+ ).baseElement
33
+ ).toMatchSnapshot();
34
+ });
@@ -4,17 +4,17 @@ import Base, { BaseProps } from '@digigov/react-core/Base';
4
4
 
5
5
  export interface OptionButtonStepsProps extends BaseProps<'div'> {
6
6
  /**
7
- * @value 0
8
- * @value 1
9
- * @value 2
10
- * @value 3
11
- * @value 4
12
- * @default 0
13
- */
7
+ * @value 0
8
+ * @value 1
9
+ * @value 2
10
+ * @value 3
11
+ * @value 4
12
+ * @default 0
13
+ */
14
14
  steps?: stepsProps;
15
15
  /**
16
- * @default 0
17
- */
16
+ * @default 0
17
+ */
18
18
  activeStep?: number;
19
19
  }
20
20
 
@@ -31,7 +31,6 @@ export const OptionButtonSteps = React.forwardRef<
31
31
  { steps = 0, activeStep = 0, className, ...props },
32
32
  ref
33
33
  ) {
34
-
35
34
  const renderStep = (step: number) => (
36
35
  <Base
37
36
  as="div"
@@ -59,4 +58,4 @@ export const OptionButtonSteps = React.forwardRef<
59
58
  );
60
59
  });
61
60
 
62
- export default OptionButtonSteps;
61
+ export default OptionButtonSteps;
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from '@digigov/react-experimental/FloatingButton';
2
2
  export * from '@digigov/react-experimental/OptionButtonBase';
3
3
  export * from '@digigov/react-experimental/OptionButtonSteps';
4
+ export * from '@digigov/react-experimental/Kitchensink';
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import FloatingButton from '@digigov/react-experimental/FloatingButton';
4
- var _ref = /*#__PURE__*/React.createElement(FloatingButton, null, "+");
5
- it('renders the FloatingButton with no props', function () {
6
- expect(mount(_ref)).toMatchSnapshot();
7
- });
8
- var _ref2 = /*#__PURE__*/React.createElement(FloatingButton, {
9
- direction: "right"
10
- }, "+");
11
- it('renders the FloatingButton with direction="right"', function () {
12
- expect(mount(_ref2)).toMatchSnapshot();
13
- });
14
- var _ref3 = /*#__PURE__*/React.createElement(FloatingButton, {
15
- direction: "left"
16
- }, "+");
17
- it('renders the FloatingButton with direction="left"', function () {
18
- expect(mount(_ref3)).toMatchSnapshot();
19
- });
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import OptionButtonBase from '@digigov/react-experimental/OptionButtonBase';
4
- var _ref = /*#__PURE__*/React.createElement(OptionButtonBase, null, "+");
5
- it('renders the OptionButtonBase with no props', function () {
6
- expect(mount(_ref)).toMatchSnapshot();
7
- });
8
- var _ref2 = /*#__PURE__*/React.createElement(OptionButtonBase, {
9
- selected: true
10
- }, "+");
11
- it('renders the OptionButtonBase with selected=true', function () {
12
- expect(mount(_ref2)).toMatchSnapshot();
13
- });
14
- var _ref3 = /*#__PURE__*/React.createElement(OptionButtonBase, {
15
- selected: false
16
- }, "+");
17
- it('renders the OptionButtonBase with selected=false', function () {
18
- expect(mount(_ref3)).toMatchSnapshot();
19
- });
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import OptionButtonSteps from '@digigov/react-experimental/OptionButtonSteps';
4
- var _ref = /*#__PURE__*/React.createElement(OptionButtonSteps, null, "+");
5
- it('renders the OptionButtonSteps with no props', function () {
6
- expect(mount(_ref)).toMatchSnapshot();
7
- });
8
- var _ref2 = /*#__PURE__*/React.createElement(OptionButtonSteps, {
9
- steps: 3
10
- }, "+");
11
- it('renders the OptionButtonSteps with steps="3"', function () {
12
- expect(mount(_ref2)).toMatchSnapshot();
13
- });
14
- var _ref3 = /*#__PURE__*/React.createElement(OptionButtonSteps, {
15
- steps: 4
16
- }, "+");
17
- it('renders the OptionButtonSteps with steps=4', function () {
18
- expect(mount(_ref3)).toMatchSnapshot();
19
- });
20
- var _ref4 = /*#__PURE__*/React.createElement(OptionButtonSteps, {
21
- activeStep: 1
22
- }, "+");
23
- it('renders the OptionButtonSteps with activeStep=1', function () {
24
- expect(mount(_ref4)).toMatchSnapshot();
25
- });
26
- var _ref5 = /*#__PURE__*/React.createElement(OptionButtonSteps, {
27
- steps: 3,
28
- activeStep: 1
29
- }, "+");
30
- it('renders the OptionButtonSteps with steps=3 activeStep=1', function () {
31
- expect(mount(_ref5)).toMatchSnapshot();
32
- });
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _react = _interopRequireDefault(require("react"));
5
- var _enzyme = require("enzyme");
6
- var _FloatingButton = _interopRequireDefault(require("@digigov/react-experimental/FloatingButton"));
7
- var _ref = /*#__PURE__*/_react["default"].createElement(_FloatingButton["default"], null, "+");
8
- it('renders the FloatingButton with no props', function () {
9
- expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
10
- });
11
- var _ref2 = /*#__PURE__*/_react["default"].createElement(_FloatingButton["default"], {
12
- direction: "right"
13
- }, "+");
14
- it('renders the FloatingButton with direction="right"', function () {
15
- expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
16
- });
17
- var _ref3 = /*#__PURE__*/_react["default"].createElement(_FloatingButton["default"], {
18
- direction: "left"
19
- }, "+");
20
- it('renders the FloatingButton with direction="left"', function () {
21
- expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
22
- });
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _react = _interopRequireDefault(require("react"));
5
- var _enzyme = require("enzyme");
6
- var _OptionButtonBase = _interopRequireDefault(require("@digigov/react-experimental/OptionButtonBase"));
7
- var _ref = /*#__PURE__*/_react["default"].createElement(_OptionButtonBase["default"], null, "+");
8
- it('renders the OptionButtonBase with no props', function () {
9
- expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
10
- });
11
- var _ref2 = /*#__PURE__*/_react["default"].createElement(_OptionButtonBase["default"], {
12
- selected: true
13
- }, "+");
14
- it('renders the OptionButtonBase with selected=true', function () {
15
- expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
16
- });
17
- var _ref3 = /*#__PURE__*/_react["default"].createElement(_OptionButtonBase["default"], {
18
- selected: false
19
- }, "+");
20
- it('renders the OptionButtonBase with selected=false', function () {
21
- expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
22
- });
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _react = _interopRequireDefault(require("react"));
5
- var _enzyme = require("enzyme");
6
- var _OptionButtonSteps = _interopRequireDefault(require("@digigov/react-experimental/OptionButtonSteps"));
7
- var _ref = /*#__PURE__*/_react["default"].createElement(_OptionButtonSteps["default"], null, "+");
8
- it('renders the OptionButtonSteps with no props', function () {
9
- expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
10
- });
11
- var _ref2 = /*#__PURE__*/_react["default"].createElement(_OptionButtonSteps["default"], {
12
- steps: 3
13
- }, "+");
14
- it('renders the OptionButtonSteps with steps="3"', function () {
15
- expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
16
- });
17
- var _ref3 = /*#__PURE__*/_react["default"].createElement(_OptionButtonSteps["default"], {
18
- steps: 4
19
- }, "+");
20
- it('renders the OptionButtonSteps with steps=4', function () {
21
- expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
22
- });
23
- var _ref4 = /*#__PURE__*/_react["default"].createElement(_OptionButtonSteps["default"], {
24
- activeStep: 1
25
- }, "+");
26
- it('renders the OptionButtonSteps with activeStep=1', function () {
27
- expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
28
- });
29
- var _ref5 = /*#__PURE__*/_react["default"].createElement(_OptionButtonSteps["default"], {
30
- steps: 3,
31
- activeStep: 1
32
- }, "+");
33
- it('renders the OptionButtonSteps with steps=3 activeStep=1', function () {
34
- expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
35
- });