@loadsmart/loadsmart-ui 5.15.2 → 5.16.1

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 (82) hide show
  1. package/dist/DragDropFile.context-0f0ede42.js +2 -0
  2. package/dist/DragDropFile.context-0f0ede42.js.map +1 -0
  3. package/dist/common/BackButton/BackButton.d.ts +0 -1
  4. package/dist/common/CloseButton/CloseButton.d.ts +0 -1
  5. package/dist/components/Accordion/Accordion.stories.d.ts +0 -1
  6. package/dist/components/Banner/Banner.stories.d.ts +0 -1
  7. package/dist/components/Button/Button.stories.d.ts +0 -1
  8. package/dist/components/Calendar/Calendar.d.ts +0 -1
  9. package/dist/components/Calendar/Calendar.stories.d.ts +0 -1
  10. package/dist/components/Calendar/PickerModeToggle.d.ts +0 -1
  11. package/dist/components/Calendar/Pickers/DayPicker.d.ts +0 -1
  12. package/dist/components/Calendar/Pickers/MonthPicker.d.ts +0 -1
  13. package/dist/components/Calendar/Pickers/YearPicker.d.ts +0 -1
  14. package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -1
  15. package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -1
  16. package/dist/components/DatePicker/DateRangePicker.d.ts +0 -1
  17. package/dist/components/DatePicker/DateRangePicker.stories.d.ts +0 -1
  18. package/dist/components/DatePicker/useDatePicker.d.ts +0 -2
  19. package/dist/components/DatePicker/useDateRangePicker.d.ts +0 -3
  20. package/dist/components/Dialog/Dialog.stories.d.ts +0 -1
  21. package/dist/components/DragDropFile/DragDropFile.d.ts +0 -1
  22. package/dist/components/DragDropFile/DragDropFile.stories.d.ts +0 -1
  23. package/dist/components/DragDropFile/components/Wrapper.d.ts +0 -1
  24. package/dist/components/DragDropFile/styles.d.ts +0 -1
  25. package/dist/components/EmptyState/EmptyState.stories.d.ts +0 -1
  26. package/dist/components/ErrorMessage/ErrorMessage.d.ts +0 -1
  27. package/dist/components/ErrorMessage/ErrorMessage.stories.d.ts +0 -1
  28. package/dist/components/Icon/Icon.d.ts +0 -1
  29. package/dist/components/IconFactory/IconFactory.d.ts +0 -1
  30. package/dist/components/Label/Label.stories.d.ts +0 -1
  31. package/dist/components/Layout/Layout.stories.d.ts +0 -1
  32. package/dist/components/Link/Link.stories.d.ts +0 -1
  33. package/dist/components/Loaders/LoadingDots.d.ts +0 -1
  34. package/dist/components/Loaders/Spinner.d.ts +0 -1
  35. package/dist/components/Modal/Modal.stories.d.ts +0 -1
  36. package/dist/components/Pagination/Pagination.d.ts +0 -1
  37. package/dist/components/Pagination/PaginationItem.d.ts +0 -1
  38. package/dist/components/ProgressBar/ProgressBar.stories.d.ts +0 -1
  39. package/dist/components/Radio/Radio.stories.d.ts +0 -1
  40. package/dist/components/Section/Sections.stories.d.ts +0 -1
  41. package/dist/components/Select/SelectCreatableOption.d.ts +0 -1
  42. package/dist/components/Select/SelectEmpty.d.ts +0 -1
  43. package/dist/components/Select/SelectOption.d.ts +0 -1
  44. package/dist/components/SideNavigation/Separator/Separator.d.ts +0 -1
  45. package/dist/components/SideNavigation/SideNavigation.stories.d.ts +0 -1
  46. package/dist/components/Steps/ProgressSteps/ProgressSteps.d.ts +0 -1
  47. package/dist/components/Table/Table.d.ts +0 -1
  48. package/dist/components/Table/Table.stories.d.ts +0 -1
  49. package/dist/components/Table/TableSortHandle.d.ts +0 -1
  50. package/dist/components/TablePagination/RowsPerPage.d.ts +0 -1
  51. package/dist/components/TablePagination/TablePagination.d.ts +0 -1
  52. package/dist/components/TablePagination/TablePaginationActions.d.ts +0 -1
  53. package/dist/components/Tabs/Tabs.stories.d.ts +0 -1
  54. package/dist/components/Tag/Tag.stories.d.ts +0 -1
  55. package/dist/components/TextField/TextField.stories.d.ts +0 -1
  56. package/dist/components/Textarea/Textarea.stories.d.ts +0 -1
  57. package/dist/components/Toast/Toast.stories.d.ts +0 -1
  58. package/dist/components/ToggleGroup/Toggle.d.ts +0 -1
  59. package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -1
  60. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -1
  61. package/dist/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.d.ts +0 -1
  62. package/dist/components/TopNavigation/TopNavigation.stories.d.ts +0 -1
  63. package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts +0 -2
  64. package/dist/index.js +448 -448
  65. package/dist/index.js.map +1 -1
  66. package/dist/miranda-compatibility.theme-4cecc6cf.js +1 -1
  67. package/dist/miranda-compatibility.theme-4cecc6cf.js.map +1 -1
  68. package/dist/prop-a330029f.js.map +1 -1
  69. package/dist/testing/index.js +1 -1
  70. package/dist/testing/index.js.map +1 -1
  71. package/dist/testing/renderWithDragDropFileProvider/renderWithDragDropFileProvider.d.ts +2 -1
  72. package/dist/theming/index.js.map +1 -1
  73. package/dist/toArray-b56541b4.js.map +1 -1
  74. package/dist/utils/toolset/highlightMatch.d.ts +0 -1
  75. package/package.json +218 -207
  76. package/src/components/Dropdown/Dropdown.test.tsx +4 -2
  77. package/src/components/Table/Table.test.tsx +2 -2
  78. package/src/components/TablePagination/TablePagination.test.tsx +2 -2
  79. package/src/testing/renderWithDragDropFileProvider/renderWithDragDropFileProvider.tsx +2 -1
  80. package/dist/DragDropFile.context-cf460901.js +0 -16
  81. package/dist/DragDropFile.context-cf460901.js.map +0 -1
  82. package/dist/addons/Theme/register.d.ts +0 -1
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import type { RenderResult } from '@testing-library/react';
2
3
  import type { DragDropFileContextValue } from '../../components/DragDropFile/types';
3
- declare const renderWithDragDropFileProvider: (ui: ReactNode, customContext?: Partial<DragDropFileContextValue> | undefined) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement>;
4
+ declare const renderWithDragDropFileProvider: (ui: ReactNode, customContext?: Partial<DragDropFileContextValue> | undefined) => RenderResult;
4
5
  export default renderWithDragDropFileProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/theming/index.ts"],"sourcesContent":["import { isFunction } from '@loadsmart/utils-function'\n\nimport type { ThemeProps } from 'styled-components'\nimport type ThemeAlice from './themes/alice.theme'\n\nexport type ThemeToken = keyof typeof ThemeAlice\nexport type ThemeTokenValue = string | number\n\nexport type CustomTheme = Record<ThemeToken, ThemeTokenValue>\nexport type ThemedProps = ThemeProps<CustomTheme>\n\ntype TokenLike<P extends ThemedProps = ThemedProps> = ThemeToken | ((props: P) => ThemeToken)\n\nfunction getTokenFromTheme<P extends ThemedProps>(token: TokenLike<P>, props: P): ThemeTokenValue {\n const tokenName = isFunction(token) ? token(props) : token\n return props.theme[tokenName]\n}\n\n/**\n * Return a design token value for the current theme.\n * @param {string} token - Token whose value should be returned.\n * @param {[ThemedStyledProps]} props - Component props.\n * @returns {ThemeTokenValue} Token value or `undefined` if the token was not found for the current theme.\n */\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>\n): (props: TProps) => ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>,\n props: TProps\n): ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(token: any, props?: any): any {\n if (props === undefined) {\n return (props: TProps) => getTokenFromTheme(token, props)\n }\n\n return getTokenFromTheme(token, props)\n}\n\nexport * as Themes from './themes'\n"],"names":["getTokenFromTheme","token","props","tokenName","isFunction","theme","undefined"],"mappings":"8QAaA,SAASA,EAAyCC,EAAqBC,GACrE,MAAMC,EAAYC,aAAWH,GAASA,EAAMC,GAASD,EACrD,OAAOC,EAAMG,MAAMF,8CAkBgCF,EAAYC,GAC/D,YAAcI,IAAVJ,EACMA,GAAkBF,EAAkBC,EAAOC,GAG9CF,EAAkBC,EAAOC"}
1
+ {"version":3,"file":"index.js","sources":["../../src/theming/index.ts"],"sourcesContent":["import { isFunction } from '@loadsmart/utils-function'\n\nimport type { ThemeProps } from 'styled-components'\nimport type ThemeAlice from './themes/alice.theme'\n\nexport type ThemeToken = keyof typeof ThemeAlice\nexport type ThemeTokenValue = string | number\n\nexport type CustomTheme = Record<ThemeToken, ThemeTokenValue>\nexport type ThemedProps = ThemeProps<CustomTheme>\n\ntype TokenLike<P extends ThemedProps = ThemedProps> = ThemeToken | ((props: P) => ThemeToken)\n\nfunction getTokenFromTheme<P extends ThemedProps>(token: TokenLike<P>, props: P): ThemeTokenValue {\n const tokenName = isFunction(token) ? token(props) : token\n return props.theme[tokenName]\n}\n\n/**\n * Return a design token value for the current theme.\n * @param {string} token - Token whose value should be returned.\n * @param {[ThemedStyledProps]} props - Component props.\n * @returns {ThemeTokenValue} Token value or `undefined` if the token was not found for the current theme.\n */\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>\n): (props: TProps) => ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>,\n props: TProps\n): ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(token: any, props?: any): any {\n if (props === undefined) {\n return (props: TProps) => getTokenFromTheme(token, props)\n }\n\n return getTokenFromTheme(token, props)\n}\n\nexport * as Themes from './themes'\n"],"names":["getTokenFromTheme","token","props","tokenName","isFunction","theme","undefined"],"mappings":"8QAaA,SAASA,EAAyCC,EAAqBC,GACrE,MAAMC,EAAYC,EAAAA,WAAWH,GAASA,EAAMC,GAASD,EACrD,OAAOC,EAAMG,MAAMF,EACrB,mCAiBgB,SAAqCF,EAAYC,GAC/D,YAAcI,IAAVJ,EACMA,GAAkBF,EAAkBC,EAAOC,GAG9CF,EAAkBC,EAAOC,EAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"toArray-b56541b4.js","sources":["../node_modules/@loadsmart/utils-object/lib/isNil.js","../node_modules/@loadsmart/utils-object/lib/isObject.js","../node_modules/@loadsmart/utils-object/lib/index.js","../src/utils/toolset/toArray.ts"],"sourcesContent":["'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nfunction isNil(value) {\n return value == null\n}\nexports.default = isNil\n//# sourceMappingURL=isNil.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nvar isNil_1 = require('./isNil')\nfunction isObject(value) {\n var type = typeof value\n return !isNil_1.default(value) && ['object', 'function'].includes(type)\n}\nexports.default = isObject\n//# sourceMappingURL=isObject.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nexports.isObject = exports.isNil = void 0\nvar isNil_1 = require('./isNil')\nexports.isNil = isNil_1.default\nvar isObject_1 = require('./isObject')\nexports.isObject = isObject_1.default\n//# sourceMappingURL=index.js.map\n","import { isNil } from '@loadsmart/utils-object'\n\n// TODO: add this helper to @loadsmart/utils\nfunction toArray<T>(value: T | T[]): T[] {\n if (isNil(value)) {\n return []\n }\n\n if (Array.isArray(value)) {\n return value\n }\n\n return [value]\n}\n\nexport default toArray\n"],"names":["Object","defineProperty","isNil_1","value","isObject_1","require$$0","type","default","includes","lib","isNil","require$$1","isObject","Array","isArray"],"mappings":"2BACAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,cACtD,SAAeA,GACb,OAAgB,MAATA,YCFTH,OAAOC,eAAeG,EAAS,aAAc,CAAED,OAAO,IACtD,IAAID,EAAUG,YACd,SAAkBF,GAChB,IAAIG,SAAcH,EAClB,OAAQD,EAAQK,QAAQJ,IAAU,CAAC,SAAU,YAAYK,SAASF,ICJpEN,OAAOC,eAAeQ,EAAS,aAAc,CAAEN,OAAO,gCACnCO,2BAAgB,EACnC,IAAIR,EAAUG,wBACEH,EAAQK,QACxB,IAAIH,EAAaO,EACjBC,4BAAmBR,EAAWG,wBCH9B,SAAoBJ,GAClB,OAAIO,cAAMP,GACD,GAGLU,MAAMC,QAAQX,GACTA,EAGF,CAACA"}
1
+ {"version":3,"file":"toArray-b56541b4.js","sources":["../node_modules/@loadsmart/utils-object/lib/isNil.js","../node_modules/@loadsmart/utils-object/lib/isObject.js","../node_modules/@loadsmart/utils-object/lib/index.js","../src/utils/toolset/toArray.ts"],"sourcesContent":["'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nfunction isNil(value) {\n return value == null\n}\nexports.default = isNil\n//# sourceMappingURL=isNil.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nvar isNil_1 = require('./isNil')\nfunction isObject(value) {\n var type = typeof value\n return !isNil_1.default(value) && ['object', 'function'].includes(type)\n}\nexports.default = isObject\n//# sourceMappingURL=isObject.js.map\n","'use strict'\nObject.defineProperty(exports, '__esModule', { value: true })\nexports.isObject = exports.isNil = void 0\nvar isNil_1 = require('./isNil')\nexports.isNil = isNil_1.default\nvar isObject_1 = require('./isObject')\nexports.isObject = isObject_1.default\n//# sourceMappingURL=index.js.map\n","import { isNil } from '@loadsmart/utils-object'\n\n// TODO: add this helper to @loadsmart/utils\nfunction toArray<T>(value: T | T[]): T[] {\n if (isNil(value)) {\n return []\n }\n\n if (Array.isArray(value)) {\n return value\n }\n\n return [value]\n}\n\nexport default toArray\n"],"names":["Object","defineProperty","isNil_1","value","default","isObject_1","require$$0","type","includes","lib","isObject","isNil","require$$1","Array","isArray"],"mappings":"2BACAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IAItDD,EAAAE,QAHA,SAAeD,GACb,OAAgB,MAATA,CACT,WCHAH,OAAOC,eAAeI,EAAS,aAAc,CAAEF,OAAO,IACtD,IAAID,EAAUI,EAKdD,EAAAD,QAJA,SAAkBD,GAChB,IAAII,SAAcJ,EAClB,OAAQD,EAAQE,QAAQD,IAAU,CAAC,SAAU,YAAYK,SAASD,EACpE,ECLAP,OAAOC,eAAeQ,EAAS,aAAc,CAAEN,OAAO,IACtDO,QAAAA,SAAAD,EAAAC,SAAmBC,QAAAA,MAAAF,EAAAE,WAAgB,EACnC,IAAIT,EAAUI,EACDK,QAAAA,MAAAF,EAAAE,MAAGT,EAAQE,QACxB,IAAIC,EAAaO,EACjBF,QAAAA,SAAgBD,EAAAC,SAAGL,EAAWD,wBCH9B,SAAoBD,GAClB,OAAIQ,QAAAA,MAAMR,GACD,GAGLU,MAAMC,QAAQX,GACTA,EAGF,CAACA,EACV"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * A function that wraps a match into `mark` element to be highlighted.
4
3
  * @example
package/package.json CHANGED
@@ -1,209 +1,220 @@
1
1
  {
2
- "name": "@loadsmart/loadsmart-ui",
3
- "version": "5.15.2",
4
- "description": "Miranda UI, a React UI library",
5
- "main": "dist",
6
- "files": [
7
- "src",
8
- "dist",
9
- "README.md"
10
- ],
11
- "types": "dist/index.d.ts",
12
- "scripts": {
13
- "start": "yarn dev",
14
- "dev": "npm-run-all --parallel watch-tailwind storybook",
15
- "lint": "eslint --ext .js,.ts,.tsx src/",
16
- "test": "TZ=UTC jest --clearMocks",
17
- "test-watch": "yarn test --watch",
18
- "storybook": "start-storybook -p 6006 -s ./public --no-dll",
19
- "build": "rollup -c --environment BUILD:prod",
20
- "watch-tailwind": "postcss ./tailwind.css -o ./.storybook/globals.css --watch",
21
- "build-storybook": "rm -rf docs && build-storybook -s ./public -o ./docs --no-dll",
22
- "deploy-storybook": "yarn build-storybook && storybook-to-ghpages --existing-output-dir=docs",
23
- "release": "semantic-release",
24
- "prepare": "husky install"
25
- },
26
- "storybook-deployer": {
27
- "commitMessage": "chore(docs): deploy storybook to GitHub pages [skip ci]"
28
- },
29
- "jest": {
30
- "globals": {
31
- "window": true
32
- },
33
- "verbose": true,
34
- "coverageDirectory": "./coverage/",
35
- "collectCoverage": false,
36
- "setupFiles": [
37
- "./tests/jestsetup.tsx"
38
- ],
39
- "collectCoverageFrom": [
40
- "src/components/**/*.{js,tsx}",
41
- "!src/**/**/*.test.{js,tsx}"
42
- ],
43
- "coverageReporters": [
44
- "text",
45
- "lcov"
46
- ],
47
- "moduleDirectories": [
48
- "node_modules",
49
- "src"
50
- ],
51
- "moduleFileExtensions": [
52
- "ts",
53
- "tsx",
54
- "js",
55
- "json"
56
- ],
57
- "testMatch": [
58
- "**/__tests__/**/*.[jt]s?(x)",
59
- "**/?(*.)+(jest|test).[jt]s?(x)"
60
- ]
61
- },
62
- "lint-staged": {
63
- "src/**/*.{js,ts,jsx,tsx,json}": [
64
- "eslint --fix",
65
- "prettier --write"
66
- ],
67
- "src/{common,components,styles}/**/*.{js,ts,jsx,tsx}": [
68
- "eslint --fix",
69
- "prettier --write",
70
- "stylelint --fix"
71
- ]
72
- },
73
- "devDependencies": {
74
- "@babel/cli": "7.13.16",
75
- "@babel/core": "7.14.0",
76
- "@babel/preset-env": "7.14.1",
77
- "@babel/preset-react": "7.13.13",
78
- "@babel/preset-typescript": "7.13.0",
79
- "@commitlint/cli": "16.0.2",
80
- "@commitlint/config-conventional": "16.0.0",
81
- "@loadsmart/miranda-tokens": "1.3.0",
82
- "@loadsmart/stylelint-config": "0.0.3",
83
- "@rollup/plugin-babel": "5.3.0",
84
- "@rollup/plugin-commonjs": "19.0.0",
85
- "@rollup/plugin-json": "4.1.0",
86
- "@rollup/plugin-node-resolve": "13.0.0",
87
- "@semantic-release/git": "9.0.0",
88
- "@storybook/addon-a11y": "6.4.22",
89
- "@storybook/addon-actions": "6.4.22",
90
- "@storybook/addon-essentials": "6.4.22",
91
- "@storybook/addon-links": "6.4.22",
92
- "@storybook/cli": "6.4.22",
93
- "@storybook/react": "6.4.22",
94
- "@storybook/storybook-deployer": "2.8.11",
95
- "@storybook/testing-react": "1.2.4",
96
- "@storybook/theming": "6.4.22",
97
- "@svgr/rollup": "5.5.0",
98
- "@svgr/webpack": "5.5.0",
99
- "@tailwindcss/postcss7-compat": "2.1.2",
100
- "@testing-library/jest-dom": "5.16.5",
101
- "@testing-library/react": "^11.2.7",
102
- "@testing-library/react-hooks": "^5.1.3",
103
- "@testing-library/user-event": "^13.5.0",
104
- "@types/chance": "1.1.1",
105
- "@types/jest": "26.0.23",
106
- "@types/lodash.debounce": "4.0.6",
107
- "@types/lodash.flatten": "4.4.6",
108
- "@types/lodash.get": "4.4.6",
109
- "@types/lodash.isempty": "4.4.6",
110
- "@types/lodash.omit": "4.5.6",
111
- "@types/lodash.range": "3.2.6",
112
- "@types/mdx": "^2.0.2",
113
- "@types/react": "17.0.5",
114
- "@types/react-dom": "17.0.3",
115
- "@types/react-test-renderer": "17.0.1",
116
- "@types/styled-components": "5.1.9",
117
- "@typescript-eslint/eslint-plugin": "4.22.1",
118
- "@typescript-eslint/parser": "4.22.1",
119
- "@zerollup/ts-transform-paths": "1.7.18",
120
- "autoprefixer": "9",
121
- "babel-jest": "26.6.3",
122
- "babel-loader": "8.2.2",
123
- "babel-plugin-react-remove-properties": "0.3.0",
124
- "babel-plugin-styled-components": "1.12.0",
125
- "babel-plugin-transform-inline-environment-variables": "0.4.3",
126
- "babel-preset-react-app": "10.0.0",
127
- "chance": "1.1.8",
128
- "commitizen": "4.2.4",
129
- "cross-env": "7.0.3",
130
- "cz-conventional-changelog": "3.3.0",
131
- "eslint": "7.26.0",
132
- "eslint-config-prettier": "8.3.0",
133
- "eslint-plugin-jest-dom": "3.8.1",
134
- "eslint-plugin-jsx-a11y": "6.4.1",
135
- "eslint-plugin-prettier": "3.4.0",
136
- "eslint-plugin-react": "7.23.2",
137
- "eslint-plugin-react-hooks": "4.2.0",
138
- "eslint-plugin-storybook": "^0.5.11",
139
- "eslint-plugin-testing-library": "^5.9.1",
140
- "fork-ts-checker-webpack-plugin": "6.2.6",
141
- "husky": "7.0.4",
142
- "identity-obj-proxy": "3.0.0",
143
- "jest": "26.6.3",
144
- "jest-svg-transformer": "1.0.0",
145
- "lint-staged": "11.0.0",
146
- "npm-run-all": "4.1.5",
147
- "postcss": "7",
148
- "postcss-cli": "7",
149
- "prettier": "2.2.1",
150
- "prop-types": "15.7.2",
151
- "react": "17.0.2",
152
- "react-dom": "17.0.2",
153
- "react-is": "17.0.2",
154
- "rollup": "2.47.0",
155
- "rollup-plugin-delete": "2.0.0",
156
- "rollup-plugin-peer-deps-external": "^2.2.4",
157
- "rollup-plugin-terser": "^7.0.2",
158
- "rollup-plugin-typescript2": "0.30.0",
159
- "rollup-plugin-visualizer": "^5.5.2",
160
- "semantic-release": "17.4.2",
161
- "styled-components": "5.3.0",
162
- "stylelint": "13.13.1",
163
- "stylelint-config-prettier": "8.0.2",
164
- "stylelint-config-rational-order": "0.1.2",
165
- "stylelint-config-recommended": "5.0.0",
166
- "stylelint-no-unsupported-browser-features": "5.0.1",
167
- "stylelint-order": "4.1.0",
168
- "tailwindcss": "npm:@tailwindcss/postcss7-compat",
169
- "ts-jest": "26.5.6",
170
- "ts-toolbelt": "^9.6.0",
171
- "ttypescript": "^1.5.13",
172
- "typescript": "4.2.4",
173
- "typescript-plugin-styled-components": "1.5.0"
174
- },
175
- "peerDependencies": {
176
- "@loadsmart/miranda-tokens": "1.3.0",
177
- "@testing-library/dom": ">=5.12.0",
178
- "@testing-library/react": ">=11.2.6",
179
- "prop-types": ">=15.7.2",
180
- "react-dom": ">=16.8.0",
181
- "react": ">=16.8.0",
182
- "styled-components": ">=5.3.0"
183
- },
184
- "dependencies": {
185
- "@loadsmart/utils-function": "0.3.1",
186
- "@loadsmart/utils-object": "0.3.1",
187
- "@loadsmart/utils-string": "0.3.1",
188
- "clsx": "1.1.1",
189
- "lodash.debounce": "4.0.8",
190
- "lodash.flatten": "4.4.0",
191
- "lodash.get": "4.4.2",
192
- "lodash.isempty": "4.4.0",
193
- "lodash.omit": "4.5.0",
194
- "lodash.range": "3.2.0"
195
- },
196
- "repository": {
197
- "type": "git",
198
- "url": "https://github.com/loadsmart/miranda.git"
199
- },
200
- "license": "MIT",
201
- "publishConfig": {
202
- "access": "public"
203
- },
204
- "config": {
205
- "commitizen": {
206
- "path": "./node_modules/cz-conventional-changelog"
207
- }
208
- }
2
+ "name": "@loadsmart/loadsmart-ui",
3
+ "version": "5.16.1",
4
+ "description": "Miranda UI, a React UI library",
5
+ "main": "dist",
6
+ "files": [
7
+ "src",
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "types": "dist/index.d.ts",
12
+ "scripts": {
13
+ "start": "yarn dev",
14
+ "dev": "npm-run-all --parallel watch-tailwind storybook",
15
+ "lint": "eslint --ext .js,.ts,.tsx src/",
16
+ "test": "TZ=UTC jest --clearMocks",
17
+ "test-watch": "yarn test --watch",
18
+ "storybook": "start-storybook -p 6006 --no-dll",
19
+ "build": "rollup -c --environment BUILD:prod",
20
+ "watch-tailwind": "postcss ./tailwind.css -o ./.storybook/globals.css --watch",
21
+ "build-storybook": "rm -rf docs && build-storybook -o ./docs --no-dll",
22
+ "deploy-storybook": "yarn build-storybook && storybook-to-ghpages --existing-output-dir=docs",
23
+ "release": "semantic-release",
24
+ "prepare": "husky install"
25
+ },
26
+ "storybook-deployer": {
27
+ "commitMessage": "chore(docs): deploy storybook to GitHub pages [skip ci]"
28
+ },
29
+ "jest": {
30
+ "globals": {
31
+ "window": true
32
+ },
33
+ "verbose": true,
34
+ "coverageDirectory": "./coverage/",
35
+ "collectCoverage": false,
36
+ "setupFiles": [
37
+ "./tests/jestsetup.tsx"
38
+ ],
39
+ "collectCoverageFrom": [
40
+ "src/components/**/*.{js,tsx}",
41
+ "!src/**/**/*.test.{js,tsx}"
42
+ ],
43
+ "coverageReporters": [
44
+ "text",
45
+ "lcov"
46
+ ],
47
+ "moduleDirectories": [
48
+ "node_modules",
49
+ "src"
50
+ ],
51
+ "moduleFileExtensions": [
52
+ "ts",
53
+ "tsx",
54
+ "js",
55
+ "json"
56
+ ],
57
+ "testMatch": [
58
+ "**/__tests__/**/*.[jt]s?(x)",
59
+ "**/?(*.)+(jest|test).[jt]s?(x)"
60
+ ]
61
+ },
62
+ "lint-staged": {
63
+ "src/**/*.{js,ts,jsx,tsx,json}": [
64
+ "eslint --fix",
65
+ "prettier --write"
66
+ ],
67
+ "src/{common,components,styles}/**/*.{js,ts,jsx,tsx}": [
68
+ "eslint --fix",
69
+ "prettier --write",
70
+ "stylelint --fix"
71
+ ]
72
+ },
73
+ "devDependencies": {
74
+ "@babel/cli": "7.13.16",
75
+ "@babel/core": "7.14.0",
76
+ "@babel/preset-env": "7.14.1",
77
+ "@babel/preset-react": "7.13.13",
78
+ "@babel/preset-typescript": "7.13.0",
79
+ "@commitlint/cli": "16.0.2",
80
+ "@commitlint/config-conventional": "16.0.0",
81
+ "@loadsmart/miranda-tokens": "1.3.0",
82
+ "@loadsmart/stylelint-config": "0.0.3",
83
+ "@rollup/plugin-babel": "5.3.0",
84
+ "@rollup/plugin-commonjs": "19.0.0",
85
+ "@rollup/plugin-json": "4.1.0",
86
+ "@rollup/plugin-node-resolve": "13.0.0",
87
+ "@semantic-release/git": "9.0.0",
88
+ "@storybook/addon-a11y": "^6.5.15",
89
+ "@storybook/addon-actions": "^6.5.15",
90
+ "@storybook/addon-essentials": "^6.5.15",
91
+ "@storybook/addon-links": "^6.5.15",
92
+ "@storybook/addon-postcss": "^2.0.0",
93
+ "@storybook/addons": "^6.5.15",
94
+ "@storybook/builder-webpack5": "^6.5.15",
95
+ "@storybook/cli": "^6.5.15",
96
+ "@storybook/client-api": "^6.5.15",
97
+ "@storybook/manager-webpack5": "^6.5.15",
98
+ "@storybook/preview-web": "^6.5.15",
99
+ "@storybook/react": "^6.5.15",
100
+ "@storybook/storybook-deployer": "^2.8.16",
101
+ "@storybook/testing-react": "^1.3.0",
102
+ "@storybook/theming": "^6.5.15",
103
+ "@svgr/rollup": "^6.5.1",
104
+ "@svgr/webpack": "^6.5.1",
105
+ "@tailwindcss/postcss7-compat": "2.1.2",
106
+ "@testing-library/dom": "^8.20.0",
107
+ "@testing-library/jest-dom": "5.16.5",
108
+ "@testing-library/react": "^11.2.7",
109
+ "@testing-library/react-hooks": "^5.1.3",
110
+ "@testing-library/user-event": "^13.5.0",
111
+ "@types/chance": "1.1.1",
112
+ "@types/jest": "26.0.23",
113
+ "@types/lodash.debounce": "4.0.6",
114
+ "@types/lodash.flatten": "4.4.6",
115
+ "@types/lodash.get": "4.4.6",
116
+ "@types/lodash.isempty": "4.4.6",
117
+ "@types/lodash.omit": "4.5.6",
118
+ "@types/lodash.range": "3.2.6",
119
+ "@types/mdx": "^2.0.2",
120
+ "@types/node": "^18.11.18",
121
+ "@types/react": "17.0.5",
122
+ "@types/react-dom": "17.0.3",
123
+ "@types/react-test-renderer": "17.0.1",
124
+ "@types/styled-components": "5.1.9",
125
+ "@typescript-eslint/eslint-plugin": "4.22.1",
126
+ "@typescript-eslint/parser": "4.22.1",
127
+ "@zerollup/ts-transform-paths": "1.7.18",
128
+ "autoprefixer": "9",
129
+ "babel-jest": "26.6.3",
130
+ "babel-loader": "8.2.2",
131
+ "babel-plugin-react-remove-properties": "0.3.0",
132
+ "babel-plugin-styled-components": "1.12.0",
133
+ "babel-plugin-transform-inline-environment-variables": "0.4.3",
134
+ "babel-preset-react-app": "10.0.0",
135
+ "chance": "1.1.8",
136
+ "commitizen": "4.2.4",
137
+ "cross-env": "7.0.3",
138
+ "cz-conventional-changelog": "3.3.0",
139
+ "eslint": "7.26.0",
140
+ "eslint-config-prettier": "8.3.0",
141
+ "eslint-plugin-jest-dom": "3.8.1",
142
+ "eslint-plugin-jsx-a11y": "6.4.1",
143
+ "eslint-plugin-prettier": "3.4.0",
144
+ "eslint-plugin-react": "7.23.2",
145
+ "eslint-plugin-react-hooks": "4.2.0",
146
+ "eslint-plugin-storybook": "^0.6.10",
147
+ "eslint-plugin-testing-library": "^5.9.1",
148
+ "husky": "7.0.4",
149
+ "identity-obj-proxy": "3.0.0",
150
+ "jest": "26.6.3",
151
+ "jest-svg-transformer": "1.0.0",
152
+ "lint-staged": "11.0.0",
153
+ "npm-run-all": "4.1.5",
154
+ "postcss": "^7.0.39",
155
+ "postcss-cli": "^7.1.2",
156
+ "prettier": "2.2.1",
157
+ "prop-types": "15.7.2",
158
+ "react": "17.0.2",
159
+ "react-dom": "17.0.2",
160
+ "react-is": "17.0.2",
161
+ "react-syntax-highlighter": "^15.5.0",
162
+ "require-from-string": "^2.0.2",
163
+ "rollup": "^2.79.1",
164
+ "rollup-plugin-delete": "2.0.0",
165
+ "rollup-plugin-peer-deps-external": "^2.2.4",
166
+ "rollup-plugin-terser": "^7.0.2",
167
+ "rollup-plugin-typescript2": "^0.34.1",
168
+ "rollup-plugin-visualizer": "^5.5.2",
169
+ "semantic-release": "17.4.2",
170
+ "styled-components": "5.3.0",
171
+ "stylelint": "13.13.1",
172
+ "stylelint-config-prettier": "8.0.2",
173
+ "stylelint-config-rational-order": "0.1.2",
174
+ "stylelint-config-recommended": "5.0.0",
175
+ "stylelint-no-unsupported-browser-features": "5.0.1",
176
+ "stylelint-order": "4.1.0",
177
+ "tailwindcss": "npm:@tailwindcss/postcss7-compat",
178
+ "ts-jest": "26.5.6",
179
+ "ts-node": "^10.9.1",
180
+ "ts-toolbelt": "^9.6.0",
181
+ "ttypescript": "^1.5.13",
182
+ "typescript": "4.4.4",
183
+ "typescript-plugin-styled-components": "1.5.0",
184
+ "webpack": "^5.75.0"
185
+ },
186
+ "peerDependencies": {
187
+ "@loadsmart/miranda-tokens": "1.3.0",
188
+ "@testing-library/dom": ">=5.12.0",
189
+ "@testing-library/react": ">=11.2.6",
190
+ "prop-types": ">=15.7.2",
191
+ "react": ">=16.8.0",
192
+ "react-dom": ">=16.8.0",
193
+ "styled-components": ">=5.3.0"
194
+ },
195
+ "dependencies": {
196
+ "@loadsmart/utils-function": "0.3.1",
197
+ "@loadsmart/utils-object": "0.3.1",
198
+ "@loadsmart/utils-string": "0.3.1",
199
+ "clsx": "1.1.1",
200
+ "lodash.debounce": "4.0.8",
201
+ "lodash.flatten": "4.4.0",
202
+ "lodash.get": "4.4.2",
203
+ "lodash.isempty": "4.4.0",
204
+ "lodash.omit": "4.5.0",
205
+ "lodash.range": "3.2.0"
206
+ },
207
+ "repository": {
208
+ "type": "git",
209
+ "url": "https://github.com/loadsmart/miranda.git"
210
+ },
211
+ "license": "MIT",
212
+ "publishConfig": {
213
+ "access": "public"
214
+ },
215
+ "config": {
216
+ "commitizen": {
217
+ "path": "./node_modules/cz-conventional-changelog"
218
+ }
219
+ }
209
220
  }
@@ -23,12 +23,14 @@ describe('Dropdown', () => {
23
23
  }
24
24
  })
25
25
 
26
- it('renders all options when expanded', () => {
26
+ it('renders all options when expanded', async () => {
27
27
  setup()
28
28
 
29
29
  user.click(screen.getByText('Actions'))
30
30
 
31
- for (let i = 0; i < ACTIONS.length; i++) {
31
+ expect(await screen.findByText(ACTIONS[0].label)).toBeInTheDocument()
32
+
33
+ for (let i = 1; i < ACTIONS.length; i++) {
32
34
  expect(screen.getByText(ACTIONS[i].label)).toBeInTheDocument()
33
35
  }
34
36
  })
@@ -53,7 +53,7 @@ describe('<Table />', () => {
53
53
  })
54
54
 
55
55
  describe('Column Picker', () => {
56
- it('should pick columns', () => {
56
+ it('should pick columns', async () => {
57
57
  const onChange = jest.fn()
58
58
  const OPTION_1 = { title: 'Title1', option: 'Option1', key: 'key1' }
59
59
  const OPTION_2 = { title: 'Title2', option: 'Option2', key: 'Key2' }
@@ -71,7 +71,7 @@ describe('<Table />', () => {
71
71
 
72
72
  user.click(screen.getByRole('button', { name: 'Pick a column' }))
73
73
 
74
- expect(screen.getAllByRole('option')).toHaveLength(2)
74
+ expect(await screen.findAllByRole('option')).toHaveLength(2)
75
75
 
76
76
  expect(screen.getByRole('option', { selected: true })).toHaveTextContent('Option1')
77
77
 
@@ -58,7 +58,7 @@ describe('TablePagination', () => {
58
58
  expect(onPageChange).toHaveBeenLastCalledWith(4)
59
59
  })
60
60
 
61
- it('calls the onRowsPerPageChange with the selected option', () => {
61
+ it('calls the onRowsPerPageChange with the selected option', async () => {
62
62
  const onPageChange = jest.fn()
63
63
  const onRowsPerPageChange = jest.fn()
64
64
  setup({
@@ -67,7 +67,7 @@ describe('TablePagination', () => {
67
67
  onRowsPerPageChange,
68
68
  })
69
69
  userEvent.click(screen.getByTestId('rows-per-page-button'))
70
- userEvent.click(screen.getByText(/50 per page/i))
70
+ userEvent.click(await screen.findByText(/50 per page/i))
71
71
 
72
72
  expect(onRowsPerPageChange).toHaveBeenLastCalledWith(50)
73
73
  })
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode } from 'react'
2
2
  import { render } from '@testing-library/react'
3
+ import type { RenderResult } from '@testing-library/react'
3
4
 
4
5
  import type { DragDropFileContextValue } from '../../components/DragDropFile/types'
5
6
  import { DragDropFileContext } from '../../components/DragDropFile/DragDropFile.context'
@@ -14,7 +15,7 @@ const defaultContextValueMock: DragDropFileContextValue = {
14
15
  const renderWithDragDropFileProvider = (
15
16
  ui: ReactNode,
16
17
  customContext?: Partial<DragDropFileContextValue>
17
- ) => {
18
+ ): RenderResult => {
18
19
  const contextValue = { ...defaultContextValueMock, ...customContext }
19
20
 
20
21
  const renderedUi = (children: ReactNode) => (
@@ -1,16 +0,0 @@
1
- "use strict";var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e){return this instanceof o?(this.v=e,this):new o(e)}const i=e.createContext(void 0);exports.DragDropFileContext=i,exports.DragDropFileProvider=({fileList:t,onFilesAdded:r,onFileRemoved:o,onRetryUpload:a,children:u})=>{const c=e.useCallback(((e,n)=>{o([...t.slice(0,n),...t.slice(n+1)],e,n)}),[t]),l=e.useMemo((()=>({fileList:t,onFilesAdded:r,onRemoveFile:c,onRetryUpload:a})),[t,r,c,a]);return n.default.createElement(i.Provider,{value:l},u)},exports.__asyncGenerator=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||c(e,t)}))})}function c(e,t){try{(n=i[e](t)).value instanceof o?Promise.resolve(n.value.v).then(l,s):f(a[0][2],n)}catch(e){f(a[0][3],e)}var n}function l(e){c("next",e)}function s(e){c("throw",e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}},exports.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=r(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},exports.__await=o,exports.__awaiter=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},exports.__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},exports.useDragDropFileContext=()=>{const t=e.useContext(i);if(!t)throw new Error("useDragDropFileContext must be used within an DragDropFileProvider");return t};
16
- //# sourceMappingURL=DragDropFile.context-cf460901.js.map