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

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 (75) hide show
  1. package/.storybook/main.js +1 -1
  2. package/.storybook/preview-head.html +6 -1
  3. package/CHANGELOG.md +24 -0
  4. package/design-tokens/index.js +5 -3
  5. package/lib/components/Badge/Badge.js +3 -1
  6. package/lib/components/Badge/Badge.js.flow +2 -2
  7. package/lib/components/Pagination/Pagination.js +2 -2
  8. package/lib/components/Pagination/Pagination.js.flow +1 -1
  9. package/lib/components/Textarea/Textarea.module.css +4 -0
  10. package/lib/hooks/useCopyToClipboard/index.js +16 -0
  11. package/lib/hooks/useCopyToClipboard/index.js.flow +3 -0
  12. package/lib/hooks/useInputState/index.js +16 -0
  13. package/lib/hooks/useInputState/index.js.flow +3 -0
  14. package/lib/hooks/useLockedBody/index.js +16 -0
  15. package/lib/hooks/useLockedBody/index.js.flow +3 -0
  16. package/lib/hooks/usePagination/index.js +16 -0
  17. package/lib/hooks/usePagination/index.js.flow +3 -0
  18. package/lib/hooks/{usePagination.js → usePagination/usePagination.js} +5 -4
  19. package/lib/hooks/{usePagination.js.flow → usePagination/usePagination.js.flow} +7 -5
  20. package/lib/hooks/useToastPortal/index.js +16 -0
  21. package/lib/hooks/useToastPortal/index.js.flow +3 -0
  22. package/lib/hooks/{useToastPortal.js → useToastPortal/useToastPortal.js} +2 -2
  23. package/lib/hooks/{useToastPortal.js.flow → useToastPortal/useToastPortal.js.flow} +2 -2
  24. package/lib/hooks/useToggle/index.js +16 -0
  25. package/lib/hooks/useToggle/index.js.flow +3 -0
  26. package/lib/hooks/useWindowSize/index.js +16 -0
  27. package/lib/hooks/useWindowSize/index.js.flow +3 -0
  28. package/lib/utils/{click-away.js → click-away/click-away.js} +1 -1
  29. package/lib/utils/{click-away.js.flow → click-away/click-away.js.flow} +1 -1
  30. package/lib/utils/click-away/index.js +16 -0
  31. package/lib/utils/click-away/index.js.flow +3 -0
  32. package/lib/utils/dom/index.js +16 -0
  33. package/lib/utils/dom/index.js.flow +3 -0
  34. package/lib/utils/helpers/index.js +16 -0
  35. package/lib/utils/helpers/index.js.flow +3 -0
  36. package/lib/utils/makeClassNameComponent/index.js +16 -0
  37. package/lib/utils/makeClassNameComponent/index.js.flow +3 -0
  38. package/lib/utils/{makeClassNameComponent.js → makeClassNameComponent/makeClassNameComponent.js} +1 -1
  39. package/lib/utils/{makeClassNameComponent.js.flow → makeClassNameComponent/makeClassNameComponent.js.flow} +1 -2
  40. package/lib/utils/menu/index.js +16 -0
  41. package/lib/utils/menu/index.js.flow +3 -0
  42. package/lib/utils/{menu.js → menu/menu.js} +1 -1
  43. package/lib/utils/{menu.js.flow → menu/menu.js.flow} +2 -3
  44. package/lib/utils/merge-refs/index.js +16 -0
  45. package/lib/utils/merge-refs/index.js.flow +3 -0
  46. package/lib/utils/string/index.js +16 -0
  47. package/lib/utils/string/index.js.flow +3 -0
  48. package/lib/utils/tokens/index.js +16 -0
  49. package/lib/utils/tokens/index.js.flow +3 -0
  50. package/lib/utils/{tokens.js → tokens/tokens.js} +16 -2
  51. package/lib/utils/{tokens.js.flow → tokens/tokens.js.flow} +18 -0
  52. package/package.json +1 -1
  53. /package/design-tokens/motion/{app.motion.json → app-motion.json} +0 -0
  54. /package/lib/hooks/{useCopyToClipboard.js → useCopyToClipboard/useCopyToClipboard.js} +0 -0
  55. /package/lib/hooks/{useCopyToClipboard.js.flow → useCopyToClipboard/useCopyToClipboard.js.flow} +0 -0
  56. /package/lib/hooks/{useInputState.js → useInputState/useInputState.js} +0 -0
  57. /package/lib/hooks/{useInputState.js.flow → useInputState/useInputState.js.flow} +0 -0
  58. /package/lib/hooks/{useLockedBody.js → useLockedBody/useLockedBody.js} +0 -0
  59. /package/lib/hooks/{useLockedBody.js.flow → useLockedBody/useLockedBody.js.flow} +0 -0
  60. /package/lib/hooks/{useMountTransition.js → useMountTransition/index.js} +0 -0
  61. /package/lib/hooks/{useMountTransition.js.flow → useMountTransition/index.js.flow} +0 -0
  62. /package/lib/hooks/{useToggle.js → useToggle/useToggle.js} +0 -0
  63. /package/lib/hooks/{useToggle.js.flow → useToggle/useToggle.js.flow} +0 -0
  64. /package/lib/hooks/{useWindowSize.js → useWindowSize/useWindowSize.js} +0 -0
  65. /package/lib/hooks/{useWindowSize.js.flow → useWindowSize/useWindowSize.js.flow} +0 -0
  66. /package/lib/utils/{classify.js → classify/index.js} +0 -0
  67. /package/lib/utils/{classify.js.flow → classify/index.js.flow} +0 -0
  68. /package/lib/utils/{dom.js → dom/dom.js} +0 -0
  69. /package/lib/utils/{dom.js.flow → dom/dom.js.flow} +0 -0
  70. /package/lib/utils/{helpers.js → helpers/helpers.js} +0 -0
  71. /package/lib/utils/{helpers.js.flow → helpers/helpers.js.flow} +0 -0
  72. /package/lib/utils/{merge-refs.js → merge-refs/merge-refs.js} +0 -0
  73. /package/lib/utils/{merge-refs.js.flow → merge-refs/merge-refs.js.flow} +0 -0
  74. /package/lib/utils/{string.js → string/string.js} +0 -0
  75. /package/lib/utils/{string.js.flow → string/string.js.flow} +0 -0
@@ -108,7 +108,7 @@ module.exports = {
108
108
  config.resolve.extensions.push('.js', '.jsx');
109
109
  return config;
110
110
  },
111
- staticDirs: ['public'],
111
+ staticDirs: ['public', '../design-tokens'],
112
112
  framework: {
113
113
  name: '@storybook/react-webpack5',
114
114
  options: {},
@@ -113,7 +113,7 @@
113
113
  font-family: 'Centra No 2';
114
114
  }
115
115
 
116
- .sbdocs *:not(i) {
116
+ .sbdocs *:not(i):not(pre span) {
117
117
  font-family: 'Centra No 2' !important;
118
118
  }
119
119
 
@@ -149,6 +149,11 @@
149
149
  background-color: #f1f1f5 !important;
150
150
  box-shadow: none !important;
151
151
  border-color: #d3d2e0 !important;
152
+ font-family: 'Monaco' !important;
153
+ }
154
+
155
+ pre span {
156
+ font-family: 'Monaco' !important;
152
157
  }
153
158
 
154
159
  a.sbdocs {
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
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.30](https://github.com/spaced-out/ui-design-system/compare/v0.1.29...v0.1.30) (2023-06-06)
6
+
7
+
8
+ ### Features
9
+
10
+ * 🛸 download tokens textarea placeholder fixes 🛸 ([763829a](https://github.com/spaced-out/ui-design-system/commit/763829a08a3355613b50133288bb89b98745e88b))
11
+ * hooks and utils stories ([74e22fa](https://github.com/spaced-out/ui-design-system/commit/74e22fa1c315eb7d415501e8da39aa93ef968167))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * added import docs for utils and hooks ([2f8d3a8](https://github.com/spaced-out/ui-design-system/commit/2f8d3a8e0fe99d37c9f6f00a681affaaf9938efa))
17
+ * stories fixes ([62fa978](https://github.com/spaced-out/ui-design-system/commit/62fa97803eb8250b0d1b227b68cf68f50a1ebc19))
18
+ * typo fixes ([29c50ad](https://github.com/spaced-out/ui-design-system/commit/29c50ad526996f4d9f95e575ee5d239ad68e6c5c))
19
+
20
+ ### [0.1.29](https://github.com/spaced-out/ui-design-system/compare/v0.1.28...v0.1.29) (2023-06-01)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * add classnames support for text in badge ([#119](https://github.com/spaced-out/ui-design-system/issues/119)) ([f044fb6](https://github.com/spaced-out/ui-design-system/commit/f044fb682079cb62d5fa82fea0d4884d5512995c))
26
+ * changed folder structure for hooks and utils ([6bc1693](https://github.com/spaced-out/ui-design-system/commit/6bc1693cbe338ee7ad3f0ffe82e5caaf7ff2ef28))
27
+ * changed position of hooks ([a3f14a4](https://github.com/spaced-out/ui-design-system/commit/a3f14a478999a4124eb08a7052031b9fa2891363))
28
+
5
29
  ### [0.1.28](https://github.com/spaced-out/ui-design-system/compare/v0.1.27...v0.1.28) (2023-05-26)
6
30
 
7
31
 
@@ -1,5 +1,7 @@
1
- const { readdirSync, statSync } = require("fs");
2
- const { join } = require("path");
1
+ const {readdirSync, statSync} = require('fs');
2
+ const {join} = require('path');
3
+
4
+
3
5
  const dirs = (p) =>
4
6
  readdirSync(p).filter((f) => statSync(join(p, f)).isDirectory());
5
- module.exports = dirs(__dirname);
7
+ module.exports = dirs(__dirname);
@@ -37,6 +37,8 @@ const Badge = /*#__PURE__*/React.forwardRef((_ref, ref) => {
37
37
  backgroundColor: BADGE_COLOR[fill]
38
38
  },
39
39
  ref: ref
40
- }, /*#__PURE__*/React.createElement(_Text.ButtonTextSmall, null, text));
40
+ }, /*#__PURE__*/React.createElement(_Text.ButtonTextSmall, {
41
+ className: classNames?.text
42
+ }, text));
41
43
  });
42
44
  exports.Badge = Badge;
@@ -16,7 +16,7 @@ import {ButtonTextSmall} from '../Text/Text';
16
16
  import css from './Badge.module.css';
17
17
 
18
18
 
19
- type ClassNames = $ReadOnly<{wrapper?: string}>;
19
+ type ClassNames = $ReadOnly<{wrapper?: string, text?: string}>;
20
20
 
21
21
  export const BADGE_COLOR = Object.freeze({
22
22
  gray: colorGrayLightest,
@@ -52,7 +52,7 @@ export const Badge: React$AbstractComponent<BadgeProps, HTMLDivElement> =
52
52
  }}
53
53
  ref={ref}
54
54
  >
55
- <ButtonTextSmall>{text}</ButtonTextSmall>
55
+ <ButtonTextSmall className={classNames?.text}>{text}</ButtonTextSmall>
56
56
  </div>
57
57
  ),
58
58
  );
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Pagination = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _usePagination = _interopRequireDefault(require("../../hooks/usePagination"));
8
+ var _usePagination = require("../../hooks/usePagination");
9
9
  var _classify = _interopRequireDefault(require("../../utils/classify"));
10
10
  var _helpers = require("../../utils/helpers");
11
11
  var _Dropdown = require("../Dropdown");
@@ -30,7 +30,7 @@ const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
30
30
  } = props;
31
31
  const {
32
32
  items
33
- } = (0, _usePagination.default)({
33
+ } = (0, _usePagination.usePagination)({
34
34
  style,
35
35
  showFirstButton,
36
36
  showLastButton,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
 
5
- import usePagination from '../../hooks/usePagination';
5
+ import {usePagination} from '../../hooks/usePagination';
6
6
  import classify from '../../utils/classify';
7
7
  import {range} from '../../utils/helpers';
8
8
  import {Dropdown} from '../Dropdown';
@@ -94,6 +94,10 @@
94
94
  background-color: colorFillDisabled;
95
95
  }
96
96
 
97
+ textarea::placeholder {
98
+ color: colorTextSecondary;
99
+ }
100
+
97
101
  .inputDisabled textarea::placeholder {
98
102
  color: inherit;
99
103
  }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useCopyToClipboard = require("./useCopyToClipboard");
7
+ Object.keys(_useCopyToClipboard).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useCopyToClipboard[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useCopyToClipboard[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './useCopyToClipboard';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useInputState = require("./useInputState");
7
+ Object.keys(_useInputState).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useInputState[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useInputState[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './useInputState';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useLockedBody = require("./useLockedBody");
7
+ Object.keys(_useLockedBody).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useLockedBody[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useLockedBody[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './useLockedBody';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _usePagination = require("./usePagination");
7
+ Object.keys(_usePagination).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _usePagination[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _usePagination[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './usePagination';
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = usePagination;
7
- var _helpers = require("../utils/helpers");
6
+ exports.usePagination = void 0;
7
+ var _helpers = require("../../utils/helpers");
8
8
 
9
- function usePagination(props) {
9
+ const usePagination = props => {
10
10
  const {
11
11
  boundaryCount = 1,
12
12
  totalPages = 1,
@@ -99,4 +99,5 @@ function usePagination(props) {
99
99
  return {
100
100
  items
101
101
  };
102
- }
102
+ };
103
+ exports.usePagination = usePagination;
@@ -3,13 +3,15 @@
3
3
  import type {
4
4
  PaginationBaseProps,
5
5
  PaginationItemProps,
6
- } from '../components/Pagination';
7
- import {range} from '../utils/helpers';
6
+ } from '../../components/Pagination';
7
+ import {range} from '../../utils/helpers';
8
8
 
9
9
 
10
- export default function usePagination(props: PaginationBaseProps): {
10
+ export const usePagination = (
11
+ props: PaginationBaseProps,
12
+ ): {
11
13
  items: ?(PaginationItemProps[]),
12
- } {
14
+ } => {
13
15
  const {
14
16
  boundaryCount = 1,
15
17
  totalPages = 1,
@@ -150,4 +152,4 @@ export default function usePagination(props: PaginationBaseProps): {
150
152
  return {
151
153
  items,
152
154
  };
153
- }
155
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useToastPortal = require("./useToastPortal");
7
+ Object.keys(_useToastPortal).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useToastPortal[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useToastPortal[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './useToastPortal';
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useToastPortal = void 0;
7
7
  var _react = require("react");
8
- var _elevation = require("../styles/variables/_elevation");
9
- var _space = require("../styles/variables/_space");
8
+ var _elevation = require("../../styles/variables/_elevation");
9
+ var _space = require("../../styles/variables/_space");
10
10
 
11
11
  const useToastPortal = _ref => {
12
12
  let {
@@ -1,8 +1,8 @@
1
1
  // @flow strict
2
2
  import {useEffect, useState} from 'react';
3
3
 
4
- import {elevationToast} from '../styles/variables/_elevation';
5
- import {spaceMedium} from '../styles/variables/_space';
4
+ import {elevationToast} from '../../styles/variables/_elevation';
5
+ import {spaceMedium} from '../../styles/variables/_space';
6
6
 
7
7
 
8
8
  type UseToastPortal = {
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useToggle = require("./useToggle");
7
+ Object.keys(_useToggle).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useToggle[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useToggle[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './useToggle';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useWindowSize = require("./useWindowSize");
7
+ Object.keys(_useWindowSize).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useWindowSize[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useWindowSize[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './useWindowSize';
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ClickAway = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _invariant = _interopRequireDefault(require("invariant"));
9
- var _dom = require("./dom");
9
+ var _dom = require("../dom");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -3,7 +3,7 @@
3
3
  import * as React from 'react';
4
4
  import invariant from 'invariant';
5
5
 
6
- import {pageHeight} from './dom';
6
+ import {pageHeight} from '../dom';
7
7
 
8
8
 
9
9
  export type ChildProps = {
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _clickAway = require("./click-away");
7
+ Object.keys(_clickAway).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _clickAway[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _clickAway[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './click-away';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _dom = require("./dom");
7
+ Object.keys(_dom).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _dom[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _dom[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './dom';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _helpers = require("./helpers");
7
+ Object.keys(_helpers).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _helpers[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _helpers[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './helpers';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _makeClassNameComponent = require("./makeClassNameComponent");
7
+ Object.keys(_makeClassNameComponent).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _makeClassNameComponent[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _makeClassNameComponent[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './makeClassNameComponent';
@@ -7,7 +7,7 @@ exports.makeClassNameComponent = makeClassNameComponent;
7
7
  exports.makeClassNameComponentCustom = makeClassNameComponentCustom;
8
8
  exports.nameHoc = nameHoc;
9
9
  var React = _interopRequireWildcard(require("react"));
10
- var _classify = _interopRequireDefault(require("./classify"));
10
+ var _classify = _interopRequireDefault(require("../classify"));
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -1,8 +1,7 @@
1
1
  // @flow strict
2
-
3
2
  import * as React from 'react';
4
3
 
5
- import classify from './classify';
4
+ import classify from '../classify';
6
5
 
7
6
 
8
7
  export function nameHoc<C, T: React.ComponentType<C>, C2>(
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _menu = require("./menu");
7
+ Object.keys(_menu).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _menu[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _menu[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './menu';
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getTextLabelFromSelectedKeys = exports.getSelectedKeysFromSelectedOption = exports.getOptionsFromKeys = exports.getOptionFromKey = exports.getFilteredOptionsResultText = exports.getFilteredOptionsFromSearchText = exports.getFilteredGroupTitleOptionsResultText = exports.getFilteredGroupTitleOptionsFromSearchText = exports.getFilteredComposeOptionsResultText = exports.getFilteredComposeOptionsFromSearchText = exports.getButtonLabelFromSelectedKeys = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _string = require("./string");
8
+ var _string = require("../string");
9
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
11
 
@@ -1,9 +1,8 @@
1
1
  // @flow strict
2
2
  import * as React from 'react';
3
3
 
4
- import type {MenuGroupTitleOption, MenuOption} from '../components/Menu';
5
-
6
- import {formatWord} from './string';
4
+ import type {MenuGroupTitleOption, MenuOption} from '../../components/Menu';
5
+ import {formatWord} from '../string';
7
6
 
8
7
 
9
8
  export const getSelectedKeysFromSelectedOption = (
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _mergeRefs = require("./merge-refs");
7
+ Object.keys(_mergeRefs).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _mergeRefs[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _mergeRefs[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './merge-refs';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _string = require("./string");
7
+ Object.keys(_string).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _string[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _string[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './string';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _tokens = require("./tokens");
7
+ Object.keys(_tokens).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _tokens[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _tokens[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './tokens';
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSortedTokenNames = exports.getRandomDataVariation = exports.filterTableDataBySearchText = exports.dataVariations = void 0;
6
+ exports.handleDownload = exports.getSortedTokenNames = exports.getRandomDataVariation = exports.filterTableDataBySearchText = exports.dataVariations = void 0;
7
7
 
8
8
  const dataVariations = [{
9
9
  title: 'The Great HTML Escape 🎩🌐',
@@ -151,4 +151,18 @@ const getRandomDataVariation = () => {
151
151
  const randomIndex = Math.floor(Math.random() * dataVariations.length);
152
152
  return dataVariations[randomIndex];
153
153
  };
154
- exports.getRandomDataVariation = getRandomDataVariation;
154
+ exports.getRandomDataVariation = getRandomDataVariation;
155
+ const handleDownload = (path, fileName) => {
156
+ const filePath = `../../../${path}`;
157
+ fetch(filePath).then(response => response.blob()).then(blob => {
158
+ const url = URL.createObjectURL(blob);
159
+ const link = document.createElement('a');
160
+ link.href = url;
161
+ link.download = fileName;
162
+ link.click();
163
+ URL.revokeObjectURL(url);
164
+ }).catch(error => {
165
+ console.error('Error downloading the JSON file:', error);
166
+ });
167
+ };
168
+ exports.handleDownload = handleDownload;
@@ -226,3 +226,21 @@ export const getRandomDataVariation = (): DataVariation => {
226
226
  const randomIndex: number = Math.floor(Math.random() * dataVariations.length);
227
227
  return dataVariations[randomIndex];
228
228
  };
229
+
230
+ export const handleDownload = (path: string, fileName: string) => {
231
+ const filePath = `../../../${path}`;
232
+
233
+ fetch(filePath)
234
+ .then((response) => response.blob())
235
+ .then((blob) => {
236
+ const url = URL.createObjectURL(blob);
237
+ const link = document.createElement('a');
238
+ link.href = url;
239
+ link.download = fileName;
240
+ link.click();
241
+ URL.revokeObjectURL(url);
242
+ })
243
+ .catch((error) => {
244
+ console.error('Error downloading the JSON file:', error);
245
+ });
246
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {
File without changes
File without changes
File without changes
File without changes
File without changes