@spaced-out/ui-design-system 0.5.0 → 0.5.2

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 (86) hide show
  1. package/.cspell/custom-words.txt +9 -7
  2. package/.storybook/{SenseTheme.js → SenseTheme.ts} +4 -2
  3. package/.storybook/{main.js → main.ts} +24 -24
  4. package/.storybook/manager-head.html +4 -0
  5. package/.storybook/{manager.js → manager.ts} +0 -3
  6. package/.storybook/paths-macro.d.ts +6 -0
  7. package/.storybook/preview.ts +67 -0
  8. package/.storybook/tsconfig.json +14 -0
  9. package/CHANGELOG.md +28 -0
  10. package/lib/components/Charts/ChartTooltip/index.d.ts +2 -2
  11. package/lib/components/Charts/ChartTooltip/index.d.ts.map +1 -1
  12. package/lib/components/Charts/ColumnChart/ColumnChart.d.ts +2 -1
  13. package/lib/components/Charts/ColumnChart/ColumnChart.d.ts.map +1 -1
  14. package/lib/components/Charts/DonutChart/DonutChart.d.ts +3 -2
  15. package/lib/components/Charts/DonutChart/DonutChart.d.ts.map +1 -1
  16. package/lib/components/Charts/FunnelChart/FunnelChart.d.ts +2 -1
  17. package/lib/components/Charts/FunnelChart/FunnelChart.d.ts.map +1 -1
  18. package/lib/components/Charts/LineChart/LineChart.d.ts +2 -1
  19. package/lib/components/Charts/LineChart/LineChart.d.ts.map +1 -1
  20. package/lib/components/Charts/SpiderChart/SpiderChart.d.ts +2 -1
  21. package/lib/components/Charts/SpiderChart/SpiderChart.d.ts.map +1 -1
  22. package/lib/components/Charts/index.d.ts.map +1 -1
  23. package/lib/components/ChatBubble/ChatBubble.d.ts +2 -1
  24. package/lib/components/ChatBubble/ChatBubble.d.ts.map +1 -1
  25. package/lib/components/FileUpload/FileBlock/FileBlock.d.ts +1 -0
  26. package/lib/components/FileUpload/FileBlock/FileBlock.d.ts.map +1 -1
  27. package/lib/components/FileUpload/FileBlock/FileBlock.js +3 -2
  28. package/lib/components/FileUpload/FileBlock/FileBlock.stories.d.ts +14 -0
  29. package/lib/components/FileUpload/FileBlock/FileBlock.stories.d.ts.map +1 -1
  30. package/lib/components/InContextAlert/InContextAlert.d.ts +9 -0
  31. package/lib/components/InContextAlert/InContextAlert.d.ts.map +1 -1
  32. package/lib/components/InContextAlert/InContextAlert.js +4 -2
  33. package/lib/components/InContextAlert/InContextAlert.stories.d.ts +17 -0
  34. package/lib/components/InContextAlert/InContextAlert.stories.d.ts.map +1 -1
  35. package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts +12 -0
  36. package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts.map +1 -0
  37. package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.js +78 -0
  38. package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.module.css +91 -0
  39. package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.stories.d.ts +249 -0
  40. package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.stories.d.ts.map +1 -0
  41. package/lib/components/InContextAlertWithMultipleActions/index.d.ts +2 -0
  42. package/lib/components/InContextAlertWithMultipleActions/index.d.ts.map +1 -0
  43. package/lib/components/InContextAlertWithMultipleActions/index.js +16 -0
  44. package/lib/components/OptionButton/SimpleOptionButton.d.ts +0 -1
  45. package/lib/components/OptionButton/SimpleOptionButton.d.ts.map +1 -1
  46. package/lib/components/ScoreBar/ScoreBar.d.ts +2 -1
  47. package/lib/components/ScoreBar/ScoreBar.d.ts.map +1 -1
  48. package/lib/components/Table/StaticTable.d.ts.map +1 -1
  49. package/lib/components/Table/Table.d.ts +2 -2
  50. package/lib/components/Table/Table.d.ts.map +1 -1
  51. package/lib/components/index.d.ts.map +1 -1
  52. package/lib/index.d.ts.map +1 -1
  53. package/lib/types/charts.d.ts +19 -10
  54. package/lib/types/charts.d.ts.map +1 -1
  55. package/lib/utils/charts/charts.d.ts.map +1 -1
  56. package/lib/utils/charts/charts.js +0 -4
  57. package/lib/utils/charts/columnChart.d.ts.map +1 -1
  58. package/lib/utils/charts/columnChart.js +0 -1
  59. package/lib/utils/charts/donutChart.d.ts.map +1 -1
  60. package/lib/utils/charts/donutChart.js +1 -7
  61. package/lib/utils/charts/funnelChart.d.ts.map +1 -1
  62. package/lib/utils/charts/funnelChart.js +0 -3
  63. package/lib/utils/charts/lineChart.d.ts.map +1 -1
  64. package/lib/utils/charts/lineChart.js +0 -1
  65. package/lib/utils/classify/index.d.ts.map +1 -1
  66. package/lib/utils/classify/index.js +4 -2
  67. package/lib/utils/click-away/click-away.d.ts +9 -13
  68. package/lib/utils/click-away/click-away.d.ts.map +1 -1
  69. package/lib/utils/click-away/click-away.js +6 -18
  70. package/lib/utils/date-range-picker/date-range-picker.d.ts +12 -11
  71. package/lib/utils/date-range-picker/date-range-picker.d.ts.map +1 -1
  72. package/lib/utils/date-range-picker/date-range-picker.js +12 -34
  73. package/lib/utils/date-range-picker/timezones.d.ts +1 -254
  74. package/lib/utils/date-range-picker/timezones.d.ts.map +1 -1
  75. package/lib/utils/dom/dom.d.ts +5 -13
  76. package/lib/utils/dom/dom.d.ts.map +1 -1
  77. package/lib/utils/dom/dom.js +21 -20
  78. package/lib/utils/makeClassNameComponent/makeClassNameComponent.d.ts +17 -5
  79. package/lib/utils/makeClassNameComponent/makeClassNameComponent.d.ts.map +1 -1
  80. package/lib/utils/makeClassNameComponent/makeClassNameComponent.js +28 -47
  81. package/lib/utils/merge-refs/merge-refs.d.ts +1 -1
  82. package/lib/utils/merge-refs/merge-refs.d.ts.map +1 -1
  83. package/lib/utils/merge-refs/merge-refs.js +0 -1
  84. package/package.json +32 -26
  85. package/tsconfig.json +3 -5
  86. package/.storybook/preview.js +0 -124
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Sense UI components library",
5
5
  "author": {
6
6
  "name": "Spaced Out"
@@ -13,7 +13,7 @@
13
13
  "build:style-variables": "rimraf src/styles/variables && style-dictionary build --config ./config.js",
14
14
  "build:types": "tsc --project tsconfig.declaration.json && cp src/types/flow-to-typescript-codemod.d.ts lib/ ",
15
15
  "prebuild": "rimraf lib",
16
- "storybook": "yarn build:style-variables && storybook dev --host genesis.proxysense.co --port 6006",
16
+ "storybook": "yarn build:style-variables && rimraf node_modules/.cache/storybook && storybook dev --host genesis.proxysense.co --port 6006",
17
17
  "storybook:export": "yarn build:style-variables && rimraf storybook-static && storybook build",
18
18
  "build-storybook": "yarn build:style-variables && rimraf storybook-static && storybook build",
19
19
  "generate": "node ./scripts/create-component",
@@ -23,6 +23,7 @@
23
23
  "build:changelog": "standard-version",
24
24
  "build:no-bump-changelog": "standard-version --skip.bump --skip.commit --skip.tag",
25
25
  "flow": "tsc --noEmit",
26
+ "flow:storybook": "tsc --project .storybook/tsconfig.json --noEmit",
26
27
  "flow:all": "tsc --noEmit --listFiles",
27
28
  "flow:json": "tsc --noEmit --pretty",
28
29
  "flow:version": "tsc --version",
@@ -71,28 +72,46 @@
71
72
  "@babel/core": "^7.18.13",
72
73
  "@babel/eslint-parser": "^7.28.0",
73
74
  "@babel/eslint-plugin": "^7.25.9",
74
- "@babel/preset-env": "^7.18.10",
75
+ "@babel/preset-env": "^7.28.3",
76
+ "@babel/preset-react": "^7.27.1",
75
77
  "@babel/preset-typescript": "^7.27.1",
76
- "@babel/preset-react": "^7.18.6",
78
+ "@chromatic-com/storybook": "^4.1.0",
77
79
  "@commitlint/cli": "^17.1.2",
78
80
  "@commitlint/config-conventional": "^17.1.0",
79
- "@storybook/addon-a11y": "^9.0.10",
80
- "@storybook/addon-docs": "^9.0.10",
81
+ "@regrapes/babel-plugin-add-react-memo-displayname": "^1.0.0",
82
+ "@storybook/addon-a11y": "^9.1.2",
83
+ "@storybook/addon-docs": "^9.1.2",
81
84
  "@storybook/addon-webpack5-compiler-babel": "^3.0.6",
82
- "@storybook/react-webpack5": "^9.0.10",
85
+ "@storybook/react-webpack5": "^9.1.2",
83
86
  "@storybook/test-runner": "^0.23.0",
84
87
  "@testing-library/react": "^11.2.7",
88
+ "@types/babel-plugin-macros": "~3.1.3",
89
+ "@types/babel__core": "~7.20.5",
90
+ "@types/babel__preset-env": "~7.10.0",
91
+ "@types/eslint": "~9.6.1",
92
+ "@types/gulp": "~4.0.17",
93
+ "@types/gulp-babel": "~6.1.33",
94
+ "@types/gulp-rename": "~2.0.6",
95
+ "@types/invariant": "~2.2.37",
96
+ "@types/lint-staged": "~13.3.0",
97
+ "@types/lodash": "^4.17.20",
98
+ "@types/moment": "^2.13.0",
99
+ "@types/moment-timezone": "^0.5.30",
100
+ "@types/react": "~19.1.9",
101
+ "@types/react-dom": "~19.1.7",
102
+ "@types/react-window": "^1.8.8",
103
+ "@types/standard-version": "~7.1.3",
85
104
  "all-contributors-cli": "^6.20.0",
86
105
  "babel-eslint": "^10.1.0",
87
106
  "babel-jest": "^28.1.3",
88
- "babel-loader": "^8.2.5",
107
+ "babel-loader": "^10.0.0",
89
108
  "babel-plugin-macros": "^3.1.0",
109
+ "babel-plugin-react-anonymous-display-name": "^0.1.0",
90
110
  "babel-preset-react-app": "^10.0.0",
91
111
  "chalk": "^5.0.1",
92
112
  "chromatic": "^6.11.4",
93
113
  "cspell": "^9.1.2",
94
114
  "eslint": "^9.9.0",
95
- "typescript-eslint": "^8.8.0",
96
115
  "eslint-plugin-ft-flow": "^3.0.11",
97
116
  "eslint-plugin-import": "^2.32.0",
98
117
  "eslint-plugin-jest": "^29.0.1",
@@ -118,25 +137,12 @@
118
137
  "rimraf": "^3.0.2",
119
138
  "simple-git": "^3.12.0",
120
139
  "standard-version": "^9.5.0",
121
- "storybook": "^9.0.10",
140
+ "storybook": "^9.1.2",
122
141
  "storybook-css-modules": "^1.0.8",
123
142
  "storybook-vscode-component": "^1.0.9",
124
143
  "style-dictionary": "^3.7.1",
125
- "@types/babel-plugin-macros": "~3.1.3",
126
- "@types/babel__core": "~7.20.5",
127
- "@types/babel__preset-env": "~7.10.0",
128
- "@types/eslint": "~9.6.1",
129
- "@types/gulp": "~4.0.17",
130
- "@types/gulp-babel": "~6.1.33",
131
- "@types/gulp-rename": "~2.0.6",
132
- "@types/invariant": "~2.2.37",
133
- "@types/lint-staged": "~13.3.0",
134
- "@types/lodash": "~4.17.20",
135
- "@types/react": "~19.1.9",
136
- "@types/react-dom": "~19.1.7",
137
- "@types/react-window": "~1.8.8",
138
- "@types/standard-version": "~7.1.3",
139
- "typescript": "^5.9.2"
144
+ "typescript": "^5.9.2",
145
+ "typescript-eslint": "^8.8.0"
140
146
  },
141
147
  "homepage": "https://spaced-out.github.io/ui-design-system",
142
148
  "repository": {
@@ -148,7 +154,7 @@
148
154
  },
149
155
  "husky": {
150
156
  "hooks": {
151
- "pre-commit": "lint-staged && yarn flow",
157
+ "pre-commit": "lint-staged && yarn flow && yarn flow:storybook",
152
158
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
153
159
  }
154
160
  },
package/tsconfig.json CHANGED
@@ -27,11 +27,9 @@
27
27
  "noUnusedLocals": true,
28
28
  "noUnusedParameters": true,
29
29
  "skipLibCheck": true,
30
- "allowImportingTsExtensions":true,
30
+ "allowImportingTsExtensions": true,
31
31
  "typeRoots": ["./src/types/**/*", "./node_modules/@types"]
32
32
  },
33
- "include": ["src/**/*.ts", "src/**/*.tsx","src/types/**/*"],
34
- "exclude": [
35
- "**/__tests__/**",
36
- ]
33
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/types/**/*"],
34
+ "exclude": ["**/__tests__/**"]
37
35
  }
@@ -1,124 +0,0 @@
1
- /**
2
- * Read https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
3
- * for more information about the purpose of this file.
4
- *
5
- * Use preview.js for global code (such as CSS imports or JavaScript mocks)
6
- * that applies to all stories. For example, `import thirdPartyCss.css`.
7
- *
8
- * This file can have three exports:
9
- * - decorators - an array of global decorators
10
- * - parameters - an object of global parameters
11
- * - globalTypes - definition of globalTypes
12
- */
13
-
14
- /**
15
- * Decorators
16
- *
17
- * A decorator is a way to wrap a story in extra “rendering” functionality.
18
- *
19
- * Example:
20
- *
21
- * import React from 'react';
22
- * export const decorators = [(Story) => <div style={{ margin: '3em' }}><Story/></div>];
23
- *
24
- * Each story throughout the library will be wrapped in a div with a margin of 3
25
- */
26
-
27
- /**
28
- * Parameters
29
- *
30
- * Most Storybook addons are configured via a parameter-based API.
31
- * You can set global parameters in this file
32
- **/
33
-
34
- import {themes} from 'storybook/theming';
35
- import {wd} from 'paths.macro';
36
-
37
- export const parameters = {
38
- // Note(Nishant): This is a workaround to disable the a11y checks for the storybook.
39
- // This is because the storybook is not a web application and does not have a viewport.
40
- a11y: {
41
- config: {
42
- rules: [
43
- {
44
- id: 'landmark-one-main',
45
- enabled: false,
46
- },
47
- {
48
- id: 'meta-viewport',
49
- enabled: false,
50
- },
51
- {
52
- id: 'page-has-heading-one',
53
- enabled: false,
54
- },
55
- ],
56
- },
57
- },
58
- controls: {
59
- disableSaveFromUI: true,
60
- },
61
- backgrounds: {
62
- values: [
63
- {name: 'Dark', value: '#000'},
64
- {name: 'Light', value: '#fff'},
65
- ],
66
- },
67
- docs: {
68
- theme: themes.light,
69
- codePanel: true,
70
- },
71
- Canvas: {
72
- theme: themes.light,
73
- },
74
- storySource: {
75
- repository: 'https://github.com/Spaced-Out/ui-design-system',
76
- workingDir: wd,
77
- branch: 'master',
78
- },
79
- options: {
80
- storySort: {
81
- method: 'alphabetical',
82
- order: [
83
- 'Introduction',
84
- 'Changelog',
85
- 'Usage',
86
- 'Contribution',
87
- 'Design Tokens',
88
- 'Tokens',
89
- 'Components',
90
- 'Form Components',
91
- '*',
92
- ],
93
- locales: 'en-US',
94
- },
95
- },
96
- };
97
- /**
98
- * With backgrounds, you configure the list of backgrounds that every story can render in.
99
- */
100
-
101
- /**
102
- * Global Types
103
- *
104
- * Global Types allow you to add your own toolbars by creating
105
- * globalTypes with a toolbar annotation:
106
- *
107
- * For example:
108
- **/
109
- export const globalTypes = {
110
- theme: {
111
- name: 'Theme',
112
- description: 'Global theme for components',
113
- defaultValue: 'dark',
114
- toolbar: {
115
- icon: 'circlehollow',
116
- // array of plain string values or MenuItem shape
117
- items: ['light', 'dark'],
118
- },
119
- },
120
- };
121
- /**
122
- *
123
- * Will add a new dropdown in your toolbar with options light and dark.
124
- **/