@loadsmart/loadsmart-ui 5.16.0 → 5.17.0
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.
- package/dist/DragDropFile.context-0f0ede42.js +2 -0
- package/dist/DragDropFile.context-0f0ede42.js.map +1 -0
- package/dist/common/BackButton/BackButton.d.ts +0 -1
- package/dist/common/CloseButton/CloseButton.d.ts +0 -1
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -1
- package/dist/components/Banner/Banner.stories.d.ts +0 -1
- package/dist/components/Button/Button.stories.d.ts +0 -1
- package/dist/components/Calendar/Calendar.d.ts +0 -1
- package/dist/components/Calendar/Calendar.stories.d.ts +0 -1
- package/dist/components/Calendar/DateFormat.helper.d.ts +4 -2
- package/dist/components/Calendar/PickerModeToggle.d.ts +0 -1
- package/dist/components/Calendar/Pickers/DayPicker.d.ts +0 -1
- package/dist/components/Calendar/Pickers/MonthPicker.d.ts +0 -1
- package/dist/components/Calendar/Pickers/YearPicker.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -1
- package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -1
- package/dist/components/DatePicker/DateRangePicker.d.ts +0 -1
- package/dist/components/DatePicker/DateRangePicker.stories.d.ts +0 -1
- package/dist/components/DatePicker/useDatePicker.d.ts +0 -2
- package/dist/components/DatePicker/useDateRangePicker.d.ts +0 -3
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -1
- package/dist/components/DragDropFile/DragDropFile.d.ts +0 -1
- package/dist/components/DragDropFile/DragDropFile.stories.d.ts +0 -1
- package/dist/components/DragDropFile/components/Wrapper.d.ts +0 -1
- package/dist/components/DragDropFile/styles.d.ts +0 -1
- package/dist/components/EmptyState/EmptyState.stories.d.ts +0 -1
- package/dist/components/ErrorMessage/ErrorMessage.d.ts +0 -1
- package/dist/components/ErrorMessage/ErrorMessage.stories.d.ts +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -1
- package/dist/components/IconFactory/IconFactory.d.ts +0 -1
- package/dist/components/Label/Label.stories.d.ts +0 -1
- package/dist/components/Layout/Layout.stories.d.ts +0 -1
- package/dist/components/Link/Link.stories.d.ts +0 -1
- package/dist/components/Loaders/LoadingDots.d.ts +0 -1
- package/dist/components/Loaders/Spinner.d.ts +0 -1
- package/dist/components/Modal/Modal.stories.d.ts +0 -1
- package/dist/components/Pagination/Pagination.d.ts +0 -1
- package/dist/components/Pagination/PaginationItem.d.ts +0 -1
- package/dist/components/ProgressBar/ProgressBar.stories.d.ts +0 -1
- package/dist/components/Radio/Radio.stories.d.ts +0 -1
- package/dist/components/Section/Sections.stories.d.ts +0 -1
- package/dist/components/Select/SelectCreatableOption.d.ts +0 -1
- package/dist/components/Select/SelectEmpty.d.ts +0 -1
- package/dist/components/Select/SelectOption.d.ts +0 -1
- package/dist/components/SideNavigation/Separator/Separator.d.ts +0 -1
- package/dist/components/SideNavigation/SideNavigation.stories.d.ts +0 -1
- package/dist/components/Steps/ProgressSteps/ProgressSteps.d.ts +0 -1
- package/dist/components/Table/Table.d.ts +0 -1
- package/dist/components/Table/Table.stories.d.ts +0 -1
- package/dist/components/Table/TableSortHandle.d.ts +0 -1
- package/dist/components/TablePagination/RowsPerPage.d.ts +0 -1
- package/dist/components/TablePagination/TablePagination.d.ts +0 -1
- package/dist/components/TablePagination/TablePaginationActions.d.ts +0 -1
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -1
- package/dist/components/Tag/Tag.stories.d.ts +0 -1
- package/dist/components/TextField/TextField.stories.d.ts +0 -1
- package/dist/components/Textarea/Textarea.stories.d.ts +0 -1
- package/dist/components/Toast/Toast.stories.d.ts +0 -1
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -1
- package/dist/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.d.ts +0 -1
- package/dist/components/TopNavigation/TopNavigation.stories.d.ts +0 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts +0 -2
- package/dist/index.js +448 -448
- package/dist/index.js.map +1 -1
- package/dist/miranda-compatibility.theme-4cecc6cf.js +1 -1
- package/dist/miranda-compatibility.theme-4cecc6cf.js.map +1 -1
- package/dist/prop-a330029f.js.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/renderWithDragDropFileProvider/renderWithDragDropFileProvider.d.ts +2 -1
- package/dist/theming/index.js.map +1 -1
- package/dist/toArray-b56541b4.js.map +1 -1
- package/dist/utils/toolset/getOrdinalSuffix.d.ts +1 -0
- package/dist/{addons/Theme/register.d.ts → utils/toolset/getOrdinalSuffix.test.d.ts} +0 -0
- package/dist/utils/toolset/highlightMatch.d.ts +0 -1
- package/package.json +218 -207
- package/src/components/Calendar/DateFormat.helper.test.ts +27 -0
- package/src/components/Calendar/DateFormat.helper.ts +41 -9
- package/src/components/Dropdown/Dropdown.test.tsx +4 -2
- package/src/components/Table/Table.test.tsx +2 -2
- package/src/components/TablePagination/TablePagination.test.tsx +2 -2
- package/src/testing/renderWithDragDropFileProvider/renderWithDragDropFileProvider.tsx +2 -1
- package/src/utils/toolset/getOrdinalSuffix.test.ts +27 -0
- package/src/utils/toolset/getOrdinalSuffix.ts +15 -0
- package/dist/DragDropFile.context-cf460901.js +0 -16
- package/dist/DragDropFile.context-cf460901.js.map +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) =>
|
|
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,
|
|
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","
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getOrdinalSuffix: (number: number) => 'st' | 'nd' | 'rd' | 'th';
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,209 +1,220 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
2
|
+
"name": "@loadsmart/loadsmart-ui",
|
|
3
|
+
"version": "5.17.0",
|
|
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
|
}
|
|
@@ -134,5 +134,32 @@ describe('DateFormatHelper', () => {
|
|
|
134
134
|
)
|
|
135
135
|
).toBe('02/01/2022 11:22:33')
|
|
136
136
|
})
|
|
137
|
+
|
|
138
|
+
it('formats compound tokens', () => {
|
|
139
|
+
expect(
|
|
140
|
+
DateFormatHelper('ddd, Do, MMM').format(
|
|
141
|
+
DateHelper('2021-05-04T04:00:00Z', {
|
|
142
|
+
normalize: false,
|
|
143
|
+
})
|
|
144
|
+
)
|
|
145
|
+
).toBe('Tue, 4th, May')
|
|
146
|
+
expect(
|
|
147
|
+
DateFormatHelper('ddd, DDo, MMM').format(
|
|
148
|
+
DateHelper('2021-05-05T04:00:00Z', {
|
|
149
|
+
normalize: false,
|
|
150
|
+
})
|
|
151
|
+
)
|
|
152
|
+
).toBe('Wed, 05th, May')
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
it('does not formats a compound token when the previous token is invalid', () => {
|
|
156
|
+
expect(
|
|
157
|
+
DateFormatHelper('ddd, YYYYo, MMM').format(
|
|
158
|
+
DateHelper('2021-05-10T04:00:00Z', {
|
|
159
|
+
normalize: false,
|
|
160
|
+
})
|
|
161
|
+
)
|
|
162
|
+
).toBe('Mon, 2021o, May')
|
|
163
|
+
})
|
|
137
164
|
})
|
|
138
165
|
})
|