@spaced-out/ui-design-system 0.1.27 β†’ 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.
@@ -18,6 +18,7 @@ fontawesome
18
18
  framename
19
19
  Gaurav
20
20
  innerref
21
+ interdimensional
21
22
  Lipsey
22
23
  Neue
23
24
  Nishant
@@ -28,14 +29,17 @@ noopener
28
29
  noreferrer
29
30
  OPACITYS
30
31
  partialformat
32
+ pocus
31
33
  premajor
32
34
  preminor
33
35
  prepatch
34
36
  rgba
35
37
  sbdocs
36
38
  Stapleton
39
+ storysource
37
40
  superrover
38
41
  systemjs
42
+ tablist
39
43
  tabout
40
44
  testid
41
45
  tnum
@@ -22,6 +22,36 @@ module.exports = {
22
22
  '@storybook/testing-react',
23
23
  // 'storybook-vscode-component/register', This is not supported in storybook 7
24
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
+ },
25
55
  ],
26
56
  babel: async (options) => ({
27
57
  ...options,
@@ -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"
@@ -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';
@@ -136,5 +140,18 @@
136
140
 
137
141
  code {
138
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;
139
156
  }
140
157
  </style>
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
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
+
5
24
  ### [0.1.27](https://github.com/spaced-out/ui-design-system/compare/v0.1.26...v0.1.27) (2023-05-17)
6
25
 
7
26
 
@@ -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}
@@ -3,7 +3,72 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSortedTokenNames = void 0;
6
+ exports.getSortedTokenNames = exports.getRandomDataVariation = exports.filterTableDataBySearchText = exports.dataVariations = void 0;
7
+
8
+ const dataVariations = [{
9
+ title: 'The Great HTML Escape 🎩🌐',
10
+ description: 'Watch out! Our HTML has escaped and is running wild on the web. It\'s causing mischief, adding tags and styles wherever it pleases! <div>πŸ™ˆ</div>'
11
+ }, {
12
+ title: 'The CSS Enigma πŸ”πŸ’‘',
13
+ description: 'Behold the CSS enigma! Our styles have tangled themselves into a web of complexity. Can you decipher the mystery and bring order to the chaos? πŸ’»πŸŽ¨'
14
+ }, {
15
+ title: 'The Missing Dependency πŸ˜±πŸ“¦',
16
+ description: 'Uh-oh! It seems like a crucial frontend dependency went on a vacation and forgot to come back. Without it, our application feels a bit incomplete. We\'re on the lookout for its grand return! πŸ–οΈπŸŒ΄'
17
+ }, {
18
+ title: 'The Vanishing CSS Rule πŸ™€πŸŽ©',
19
+ description: 'Hocus pocus! A CSS rule vanished into thin air, leaving our styles in a state of bewilderment. We\'re summoning all our magical powers to bring it back. Abracadabra, where did it go? πŸ§™β€β™‚οΈβœ¨'
20
+ }, {
21
+ title: 'The Mysterious JavaScript Bug πŸžβ“',
22
+ description: 'We\'ve encountered a puzzling JavaScript bug that seems to have hidden itself in the shadows of our codebase. It\'s playing hide-and-seek, but fear not! We\'ll track it down and restore order to our application. πŸ”πŸ”¦'
23
+ }, {
24
+ title: 'The Lost Code Snippet πŸ§πŸ”',
25
+ description: 'Oh no! It appears that a valuable code snippet has gone missing, leaving us scratching our heads. We\'re combing through the archives and retracing our steps to recover it. We won\'t stop until it\'s back where it belongs! πŸ•΅οΈβ€β™‚οΈπŸ”Ž'
26
+ }, {
27
+ title: 'The Hidden API Endpoint πŸ•΅οΈβ€β™€οΈπŸ”',
28
+ description: 'We\'re on a mission to find an elusive API endpoint that seems to have vanished into the depths of the backend. We\'re following the clues, decoding cryptic messages, and hacking our way through the digital maze. Stay tuned for its triumphant rediscovery! πŸš€πŸŒ'
29
+ }, {
30
+ title: 'The Ghostly UI Element πŸ‘»πŸ‘οΈ',
31
+ description: 'Beware of the ghostly UI element! It has mysteriously disappeared from our interface, leaving behind an empty void. We\'ve dispatched our best designers to investigate and resurrect it. Soon, it\'ll return to haunt the pixels once again! πŸŽƒπŸ’»'
32
+ }, {
33
+ title: 'The Evaporating Stylesheet πŸ’¦πŸŽ¨',
34
+ description: 'Uh-oh! It seems like our stylesheet got caught in a cosmic evaporation event, and now our carefully crafted styles are floating in the digital ether. We\'re working on a rescue mission to bring them back to the realm of the browser. βœ¨πŸš€'
35
+ }, {
36
+ title: 'The Missing Feature Fairy 🧚✨',
37
+ description: 'We\'ve sent out an APB (All Points Bulletin) for the missing feature fairy. She\'s known for sprinkling delightful functionalities into our applications, but it seems she took a detour. We\'re patiently waiting for her magical return! πŸŒŸπŸ§šβ€β™€οΈ'
38
+ }, {
39
+ title: 'The Invisible DOM Element πŸ™ˆπŸŒ',
40
+ description: 'Something peculiar has happened! A DOM element has turned invisible, playing tricks on our frontend. We\'ve called in our best detectives to investigate this optical illusion and restore its rightful visibility. Stay tuned for the grand unveiling! πŸ‘€βœ¨'
41
+ }, {
42
+ title: 'The Elusive Frontend Bug πŸ›β“',
43
+ description: 'Our frontend bug seems to have gained a PhD in camouflage and disappeared into the code jungle. We\'re conducting bug-hunting expeditions, armed with magnifying glasses and a good sense of humor. It won\'t escape our watchful eyes for long! πŸ•΅οΈβ€β™€οΈπŸ”'
44
+ }, {
45
+ title: 'The Abducted Animation πŸŒͺ️πŸŽ₯',
46
+ description: 'Alert! An animation has been abducted from our frontend, leaving us with static screens. We suspect interdimensional interference. We\'re assembling a rescue team armed with keyframes and transition effects. Together, we\'ll bring motion back to our digital world! ⚑️🎬'
47
+ }, {
48
+ title: 'The Disappearing Click Event πŸ™€πŸ–±οΈ',
49
+ description: 'In a twist of events, a click event has mysteriously vanished, eluding our attempts to capture it. We\'ve set up mouse traps and deployed debugging tools to solve this enigma. Don\'t worry, we\'ll catch that sneaky click and restore its functionality! πŸ”πŸ”§'
50
+ }, {
51
+ title: 'The Phantom Mobile Responsiveness πŸ‘»πŸ“±',
52
+ description: 'Beware of the phantom mobile responsiveness! It likes to hide in the shadows, making our web pages look like a ghost town on small screens. We\'re summoning our media queries and responsive design tactics to banish this spectral issue. Soon, our pages will be mobile-friendly once more! πŸ“²πŸ’ͺ'
53
+ }, {
54
+ title: 'The Misplaced UI Element πŸ§­πŸ”„',
55
+ description: 'Oops! It seems like a UI element lost its way and ended up in the wrong place. We\'re guiding it back to its rightful position with pixel-perfect precision. Soon, order will be restored, and our interface will be back in balance! πŸ—ΊοΈπŸ”€'
56
+ }, {
57
+ title: 'The Cryptic JavaScript Error πŸ”β“',
58
+ description: 'We\'ve stumbled upon a cryptic JavaScript error that speaks in riddles, leaving us scratching our heads. Fear not, our code sorcerers are deciphering the error message, searching for the hidden clues to resolve this enigmatic mystery. βœ¨πŸ”'
59
+ }, {
60
+ title: 'The Broken CSS Grid πŸ“πŸ”©',
61
+ description: 'Oh no! Our CSS grid has sprung a leak and lost its structure. We\'re patching it up with grid areas and grid-template-areas to bring order back to the layout. Soon, the grid will stand strong and proud! πŸ§°πŸ”§'
62
+ }, {
63
+ title: 'The Disappearing Web Fonts πŸ™ˆπŸ–ŠοΈ',
64
+ description: 'Web fonts have vanished without a trace, leaving our text looking plain and dull. We\'re calling in the font detectives to investigate this typographic disappearance. We won\'t rest until our words are dressed in style once again! πŸ‘“πŸ”Ž'
65
+ }, {
66
+ title: 'The Forgotten Vendor Prefixes πŸ€”πŸ”',
67
+ description: 'Oops! It seems that some vendor prefixes got lost in the shuffle, leaving our CSS properties puzzled. We\'re on a mission to rediscover these elusive prefixes and ensure our styles are cross-browser compatible. Together, we\'ll navigate the prefix labyrinth and emerge victorious! πŸ’ͺπŸš€'
68
+ }, {
69
+ title: 'The Invisible API Response πŸ™ˆπŸ“‘',
70
+ description: 'We\'re experiencing an API response that\'s mastered the art of invisibility. It\'s hiding behind layers of middleware and network protocols. We\'ve enlisted our finest backend wizards to conjure it back into visibility. Be patient, and soon the data will reappear like magic! πŸ§™β€β™‚οΈβœ¨'
71
+ }];
7
72
 
8
73
  /**
9
74
  *
@@ -23,6 +88,7 @@ exports.getSortedTokenNames = void 0;
23
88
  * based on their numerical values.
24
89
  *
25
90
  */
91
+ exports.dataVariations = dataVariations;
26
92
  const getSortedTokenNames = function (obj) {
27
93
  let order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'asc';
28
94
  let sortBy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'value';
@@ -71,4 +137,18 @@ const getSortedTokenNames = function (obj) {
71
137
  });
72
138
  return sortedTokens;
73
139
  };
74
- exports.getSortedTokenNames = getSortedTokenNames;
140
+ exports.getSortedTokenNames = getSortedTokenNames;
141
+ const filterTableDataBySearchText = (TABLE_DATA, searchText) => {
142
+ const filteredData = TABLE_DATA.filter(item => {
143
+ const nameMatch = item.name.toLowerCase().includes(searchText.toLowerCase());
144
+ const valueMatch = item.value.toLowerCase().includes(searchText.toLowerCase());
145
+ return nameMatch || valueMatch;
146
+ });
147
+ return filteredData;
148
+ };
149
+ exports.filterTableDataBySearchText = filterTableDataBySearchText;
150
+ const getRandomDataVariation = () => {
151
+ const randomIndex = Math.floor(Math.random() * dataVariations.length);
152
+ return dataVariations[randomIndex];
153
+ };
154
+ exports.getRandomDataVariation = getRandomDataVariation;
@@ -1,9 +1,133 @@
1
1
  // @flow strict
2
2
 
3
3
  type TokenObject = {[key: string]: string};
4
+
4
5
  export type SortOrder = 'asc' | 'desc';
6
+
5
7
  export type SortBy = 'name' | 'value';
6
8
 
9
+ export type TableDataItem = {
10
+ id: string | number,
11
+ name: string,
12
+ value: string,
13
+ demo: string,
14
+ };
15
+
16
+ export type TableData = Array<TableDataItem>;
17
+
18
+ export type DataVariation = {
19
+ title: string,
20
+ description: string,
21
+ };
22
+
23
+ export const dataVariations: Array<DataVariation> = [
24
+ {
25
+ title: 'The Great HTML Escape 🎩🌐',
26
+ description:
27
+ 'Watch out! Our HTML has escaped and is running wild on the web. It\'s causing mischief, adding tags and styles wherever it pleases! <div>πŸ™ˆ</div>',
28
+ },
29
+ {
30
+ title: 'The CSS Enigma πŸ”πŸ’‘',
31
+ description:
32
+ 'Behold the CSS enigma! Our styles have tangled themselves into a web of complexity. Can you decipher the mystery and bring order to the chaos? πŸ’»πŸŽ¨',
33
+ },
34
+ {
35
+ title: 'The Missing Dependency πŸ˜±πŸ“¦',
36
+ description:
37
+ 'Uh-oh! It seems like a crucial frontend dependency went on a vacation and forgot to come back. Without it, our application feels a bit incomplete. We\'re on the lookout for its grand return! πŸ–οΈπŸŒ΄',
38
+ },
39
+ {
40
+ title: 'The Vanishing CSS Rule πŸ™€πŸŽ©',
41
+ description:
42
+ 'Hocus pocus! A CSS rule vanished into thin air, leaving our styles in a state of bewilderment. We\'re summoning all our magical powers to bring it back. Abracadabra, where did it go? πŸ§™β€β™‚οΈβœ¨',
43
+ },
44
+ {
45
+ title: 'The Mysterious JavaScript Bug πŸžβ“',
46
+ description:
47
+ 'We\'ve encountered a puzzling JavaScript bug that seems to have hidden itself in the shadows of our codebase. It\'s playing hide-and-seek, but fear not! We\'ll track it down and restore order to our application. πŸ”πŸ”¦',
48
+ },
49
+ {
50
+ title: 'The Lost Code Snippet πŸ§πŸ”',
51
+ description:
52
+ 'Oh no! It appears that a valuable code snippet has gone missing, leaving us scratching our heads. We\'re combing through the archives and retracing our steps to recover it. We won\'t stop until it\'s back where it belongs! πŸ•΅οΈβ€β™‚οΈπŸ”Ž',
53
+ },
54
+ {
55
+ title: 'The Hidden API Endpoint πŸ•΅οΈβ€β™€οΈπŸ”',
56
+ description:
57
+ 'We\'re on a mission to find an elusive API endpoint that seems to have vanished into the depths of the backend. We\'re following the clues, decoding cryptic messages, and hacking our way through the digital maze. Stay tuned for its triumphant rediscovery! πŸš€πŸŒ',
58
+ },
59
+ {
60
+ title: 'The Ghostly UI Element πŸ‘»πŸ‘οΈ',
61
+ description:
62
+ 'Beware of the ghostly UI element! It has mysteriously disappeared from our interface, leaving behind an empty void. We\'ve dispatched our best designers to investigate and resurrect it. Soon, it\'ll return to haunt the pixels once again! πŸŽƒπŸ’»',
63
+ },
64
+ {
65
+ title: 'The Evaporating Stylesheet πŸ’¦πŸŽ¨',
66
+ description:
67
+ 'Uh-oh! It seems like our stylesheet got caught in a cosmic evaporation event, and now our carefully crafted styles are floating in the digital ether. We\'re working on a rescue mission to bring them back to the realm of the browser. βœ¨πŸš€',
68
+ },
69
+ {
70
+ title: 'The Missing Feature Fairy 🧚✨',
71
+ description:
72
+ 'We\'ve sent out an APB (All Points Bulletin) for the missing feature fairy. She\'s known for sprinkling delightful functionalities into our applications, but it seems she took a detour. We\'re patiently waiting for her magical return! πŸŒŸπŸ§šβ€β™€οΈ',
73
+ },
74
+ {
75
+ title: 'The Invisible DOM Element πŸ™ˆπŸŒ',
76
+ description:
77
+ 'Something peculiar has happened! A DOM element has turned invisible, playing tricks on our frontend. We\'ve called in our best detectives to investigate this optical illusion and restore its rightful visibility. Stay tuned for the grand unveiling! πŸ‘€βœ¨',
78
+ },
79
+ {
80
+ title: 'The Elusive Frontend Bug πŸ›β“',
81
+ description:
82
+ 'Our frontend bug seems to have gained a PhD in camouflage and disappeared into the code jungle. We\'re conducting bug-hunting expeditions, armed with magnifying glasses and a good sense of humor. It won\'t escape our watchful eyes for long! πŸ•΅οΈβ€β™€οΈπŸ”',
83
+ },
84
+ {
85
+ title: 'The Abducted Animation πŸŒͺ️πŸŽ₯',
86
+ description:
87
+ 'Alert! An animation has been abducted from our frontend, leaving us with static screens. We suspect interdimensional interference. We\'re assembling a rescue team armed with keyframes and transition effects. Together, we\'ll bring motion back to our digital world! ⚑️🎬',
88
+ },
89
+ {
90
+ title: 'The Disappearing Click Event πŸ™€πŸ–±οΈ',
91
+ description:
92
+ 'In a twist of events, a click event has mysteriously vanished, eluding our attempts to capture it. We\'ve set up mouse traps and deployed debugging tools to solve this enigma. Don\'t worry, we\'ll catch that sneaky click and restore its functionality! πŸ”πŸ”§',
93
+ },
94
+ {
95
+ title: 'The Phantom Mobile Responsiveness πŸ‘»πŸ“±',
96
+ description:
97
+ 'Beware of the phantom mobile responsiveness! It likes to hide in the shadows, making our web pages look like a ghost town on small screens. We\'re summoning our media queries and responsive design tactics to banish this spectral issue. Soon, our pages will be mobile-friendly once more! πŸ“²πŸ’ͺ',
98
+ },
99
+ {
100
+ title: 'The Misplaced UI Element πŸ§­πŸ”„',
101
+ description:
102
+ 'Oops! It seems like a UI element lost its way and ended up in the wrong place. We\'re guiding it back to its rightful position with pixel-perfect precision. Soon, order will be restored, and our interface will be back in balance! πŸ—ΊοΈπŸ”€',
103
+ },
104
+ {
105
+ title: 'The Cryptic JavaScript Error πŸ”β“',
106
+ description:
107
+ 'We\'ve stumbled upon a cryptic JavaScript error that speaks in riddles, leaving us scratching our heads. Fear not, our code sorcerers are deciphering the error message, searching for the hidden clues to resolve this enigmatic mystery. βœ¨πŸ”',
108
+ },
109
+ {
110
+ title: 'The Broken CSS Grid πŸ“πŸ”©',
111
+ description:
112
+ 'Oh no! Our CSS grid has sprung a leak and lost its structure. We\'re patching it up with grid areas and grid-template-areas to bring order back to the layout. Soon, the grid will stand strong and proud! πŸ§°πŸ”§',
113
+ },
114
+ {
115
+ title: 'The Disappearing Web Fonts πŸ™ˆπŸ–ŠοΈ',
116
+ description:
117
+ 'Web fonts have vanished without a trace, leaving our text looking plain and dull. We\'re calling in the font detectives to investigate this typographic disappearance. We won\'t rest until our words are dressed in style once again! πŸ‘“πŸ”Ž',
118
+ },
119
+ {
120
+ title: 'The Forgotten Vendor Prefixes πŸ€”πŸ”',
121
+ description:
122
+ 'Oops! It seems that some vendor prefixes got lost in the shuffle, leaving our CSS properties puzzled. We\'re on a mission to rediscover these elusive prefixes and ensure our styles are cross-browser compatible. Together, we\'ll navigate the prefix labyrinth and emerge victorious! πŸ’ͺπŸš€',
123
+ },
124
+ {
125
+ title: 'The Invisible API Response πŸ™ˆπŸ“‘',
126
+ description:
127
+ 'We\'re experiencing an API response that\'s mastered the art of invisibility. It\'s hiding behind layers of middleware and network protocols. We\'ve enlisted our finest backend wizards to conjure it back into visibility. Be patient, and soon the data will reappear like magic! πŸ§™β€β™‚οΈβœ¨',
128
+ },
129
+ ];
130
+
7
131
  /**
8
132
  *
9
133
  * This function takes in an object containing key-value pairs of tokens,
@@ -80,3 +204,25 @@ export const getSortedTokenNames = (
80
204
 
81
205
  return sortedTokens;
82
206
  };
207
+
208
+ export const filterTableDataBySearchText = (
209
+ TABLE_DATA: TableData,
210
+ searchText: string,
211
+ ): TableData => {
212
+ const filteredData: TableData = TABLE_DATA.filter((item) => {
213
+ const nameMatch: boolean = item.name
214
+ .toLowerCase()
215
+ .includes(searchText.toLowerCase());
216
+ const valueMatch: boolean = item.value
217
+ .toLowerCase()
218
+ .includes(searchText.toLowerCase());
219
+ return nameMatch || valueMatch;
220
+ });
221
+
222
+ return filteredData;
223
+ };
224
+
225
+ export const getRandomDataVariation = (): DataVariation => {
226
+ const randomIndex: number = Math.floor(Math.random() * dataVariations.length);
227
+ return dataVariations[randomIndex];
228
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {
@@ -61,6 +61,7 @@
61
61
  "@storybook/addon-a11y": "^7.0.8",
62
62
  "@storybook/addon-essentials": "^7.0.8",
63
63
  "@storybook/addon-mdx-gfm": "^7.0.8",
64
+ "@storybook/addon-storysource": "^7.0.12",
64
65
  "@storybook/addons": "^7.0.8",
65
66
  "@storybook/react": "^7.0.8",
66
67
  "@storybook/react-webpack5": "^7.0.8",