@cryptofi/core-ui 0.24.0 → 0.26.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +45 -10
- package/package.json +20 -21
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ButtonGroupProps, ButtonProps, CardProps, CheckboxProps, FlexProps, InputProps, ModalProps, SelectProps, TagProps, UseToastOptions, ChakraComponent } from '@chakra-ui/react';
|
|
2
3
|
import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import { SVGProps, Dispatch, SetStateAction } from 'react';
|
|
5
6
|
import { CurveType } from 'recharts/types/shape/Curve';
|
|
6
|
-
import {
|
|
7
|
-
import { FieldValues, UseFormRegister } from 'react-hook-form';
|
|
7
|
+
import { FieldValues, UseFormRegister, Control } from 'react-hook-form';
|
|
8
8
|
|
|
9
9
|
declare const SvgIconAlert: _chakra_ui_system_dist_system_types.ChakraComponent<(props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element, {}>;
|
|
10
10
|
//# sourceMappingURL=IconAlert.d.ts.map
|
|
@@ -159,6 +159,9 @@ declare const SvgIconUpload: _chakra_ui_system_dist_system_types.ChakraComponent
|
|
|
159
159
|
declare const SvgIconUser: _chakra_ui_system_dist_system_types.ChakraComponent<(props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element, {}>;
|
|
160
160
|
//# sourceMappingURL=IconUser.d.ts.map
|
|
161
161
|
|
|
162
|
+
declare const SvgIconRefresh: _chakra_ui_system_dist_system_types.ChakraComponent<(props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element, {}>;
|
|
163
|
+
//# sourceMappingURL=IconRefresh.d.ts.map
|
|
164
|
+
|
|
162
165
|
declare const SvgIconAvax: _chakra_ui_system_dist_system_types.ChakraComponent<(props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element, {}>;
|
|
163
166
|
//# sourceMappingURL=IconAvax.d.ts.map
|
|
164
167
|
|
|
@@ -197,11 +200,11 @@ declare const exportedTheme: {
|
|
|
197
200
|
declare const aggregateAmounts: (amounts: number[]) => number;
|
|
198
201
|
//# sourceMappingURL=aggregateAmounts.d.ts.map
|
|
199
202
|
|
|
200
|
-
declare const
|
|
203
|
+
declare const dateToTimestamp: ({ timeString, toEndDate }: {
|
|
201
204
|
timeString: string;
|
|
202
205
|
toEndDate?: boolean | undefined;
|
|
203
206
|
}) => string;
|
|
204
|
-
//# sourceMappingURL=
|
|
207
|
+
//# sourceMappingURL=dateToTimestamp.d.ts.map
|
|
205
208
|
|
|
206
209
|
type SignDisplay = 'auto' | 'always' | 'exceptZero' | 'never';
|
|
207
210
|
/**
|
|
@@ -248,6 +251,10 @@ declare const getDelta: ({ data, dataKey }: {
|
|
|
248
251
|
};
|
|
249
252
|
//# sourceMappingURL=getDelta.d.ts.map
|
|
250
253
|
|
|
254
|
+
/**
|
|
255
|
+
* @description An object with predefined UI colors, implemented as functions with optional alpha values.
|
|
256
|
+
* Color names are assigned using https://colornamer.robertcooper.me/.
|
|
257
|
+
*/
|
|
251
258
|
declare const uiColors: {
|
|
252
259
|
redRemains(alpha?: number): string;
|
|
253
260
|
heroicRed(alpha?: number): string;
|
|
@@ -273,6 +280,10 @@ declare const CfAreaChart: ({ data, dataKey, width, height, areaType, showToolti
|
|
|
273
280
|
}) => react_jsx_runtime.JSX.Element;
|
|
274
281
|
//# sourceMappingURL=AreaChart.d.ts.map
|
|
275
282
|
|
|
283
|
+
/**
|
|
284
|
+
*
|
|
285
|
+
* @description use this component to visualize Chakra's breakpoints for debugging responsive styles.
|
|
286
|
+
*/
|
|
276
287
|
declare const CfBreakpointDebugger: () => react_jsx_runtime.JSX.Element;
|
|
277
288
|
//# sourceMappingURL=BreakpointDebugger.d.ts.map
|
|
278
289
|
|
|
@@ -295,17 +306,40 @@ interface CfCheckboxProps extends CheckboxProps {
|
|
|
295
306
|
}
|
|
296
307
|
declare const CfCheckbox: (props: CfCheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
297
308
|
|
|
309
|
+
interface Props$2 extends FlexProps {
|
|
310
|
+
onSubmit: (event: React.FormEvent) => void;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
*
|
|
314
|
+
* @description A form component with flex layout, for use with or without React Hook Form.
|
|
315
|
+
*/
|
|
316
|
+
declare const CfForm: ({ children, onSubmit, ...rest }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
317
|
+
//# sourceMappingURL=Form.d.ts.map
|
|
318
|
+
|
|
298
319
|
interface CfInputProps<T extends FieldValues> extends InputProps {
|
|
299
320
|
register?: UseFormRegister<T>;
|
|
300
321
|
errorMessage?: string;
|
|
301
322
|
helperText?: string;
|
|
302
323
|
label?: string;
|
|
303
|
-
|
|
304
|
-
|
|
324
|
+
leftAddon?: React.ReactElement;
|
|
325
|
+
leftElement?: React.ReactElement;
|
|
326
|
+
rightElement?: React.ReactElement;
|
|
327
|
+
rightAddon?: React.ReactElement;
|
|
305
328
|
name: string;
|
|
306
329
|
}
|
|
307
330
|
declare const CfInput: <T extends FieldValues>(props: CfInputProps<T>) => react_jsx_runtime.JSX.Element;
|
|
308
331
|
|
|
332
|
+
type Props$1<T extends FieldValues> = {
|
|
333
|
+
name: string;
|
|
334
|
+
control: Control;
|
|
335
|
+
register: UseFormRegister<T>;
|
|
336
|
+
defaultValues: FieldValues;
|
|
337
|
+
onArrayAppend?: (appendValues: FieldValues) => void;
|
|
338
|
+
onArrayRemove?: (remove: number) => void;
|
|
339
|
+
};
|
|
340
|
+
declare const CfInputArray: <T extends FieldValues>({ name, control, register, defaultValues, onArrayAppend, onArrayRemove, }: Props$1<T>) => react_jsx_runtime.JSX.Element;
|
|
341
|
+
//# sourceMappingURL=InputArray.d.ts.map
|
|
342
|
+
|
|
309
343
|
declare const CfLineChart: ({ data, dataKey, width, height, lineType, showTooltip, isAnimated, formatter, }: {
|
|
310
344
|
data: any[] | undefined;
|
|
311
345
|
dataKey: string;
|
|
@@ -357,16 +391,17 @@ declare const CfSelect: <T extends FieldValues>(props: CfSelectProps<T>) => reac
|
|
|
357
391
|
interface CfTagProps extends TagProps {
|
|
358
392
|
label: string;
|
|
359
393
|
onClose?: () => void;
|
|
360
|
-
|
|
361
|
-
|
|
394
|
+
leftIcon?: SVGIcon;
|
|
395
|
+
rightIcon?: SVGIcon;
|
|
362
396
|
}
|
|
363
397
|
declare const CfTag: (props: CfTagProps) => react_jsx_runtime.JSX.Element | null;
|
|
364
398
|
|
|
365
399
|
interface CfToastProps extends UseToastOptions {
|
|
366
400
|
onClose?: () => void;
|
|
367
401
|
}
|
|
368
|
-
declare const CfToast: (
|
|
402
|
+
declare const CfToast: ({ description, title, onClose, isClosable, status }: CfToastProps) => react_jsx_runtime.JSX.Element;
|
|
369
403
|
|
|
404
|
+
type SVGIcon = ChakraComponent<'svg', object>;
|
|
370
405
|
declare const layoutMinWidth = "22rem";
|
|
371
406
|
|
|
372
|
-
export { CfAreaChart, CfBreakpointDebugger, CfButtonGroup, CfButtonGroupButton, CfCard, CfCheckbox, type CfCheckboxProps, CfInput, type CfInputProps, CfLineChart, CfModal, CfPagination, CfSelect, type CfSelectOption, type CfSelectProps, CfTag, type CfTagProps, CfToast, SvgIconAlert as IconAlert, SvgIconArrowDown as IconArrowDown, SvgIconArrowUp as IconArrowUp, SvgIconAvax as IconAvax, SvgIconBank as IconBank, SvgIconBarChart as IconBarChart, SvgIconBch as IconBch, SvgIconBtc as IconBtc, SvgIconCalendar as IconCalendar, SvgIconCaretDown as IconCaretDown, SvgIconCaretLeft as IconCaretLeft, SvgIconCaretRight as IconCaretRight, SvgIconCaretUp as IconCaretUp, SvgIconCent as IconCent, SvgIconCheck as IconCheck, SvgIconChecking as IconChecking, SvgIconClose as IconClose, SvgIconConnect as IconConnect, SvgIconCopy as IconCopy, SvgIconDollar as IconDollar, SvgIconDownload as IconDownload, SvgIconEdit as IconEdit, SvgIconEnter as IconEnter, SvgIconEnterInverted as IconEnterInverted, SvgIconEth as IconEth, SvgIconExchange as IconExchange, SvgIconFilter as IconFilter, SvgIconHelp as IconHelp, SvgIconHistory as IconHistory, SvgIconHome as IconHome, SvgIconIndicatorDown as IconIndicatorDown, SvgIconIndicatorUp as IconIndicatorUp, SvgIconInfo as IconInfo, SvgIconLink as IconLink, SvgIconLtc as IconLtc, SvgIconMail as IconMail, SvgIconMenu as IconMenu, SvgIconMore as IconMore, SvgIconNotification as IconNotification, SvgIconOverview as IconOverview, SvgIconPercent as IconPercent, SvgIconPieChart as IconPieChart, SvgIconPlus as IconPlus, SvgIconReports as IconReports, SvgIconReservesSuccess as IconReservesSuccess, SvgIconReservesWarning as IconReservesWarning, SvgIconSearch as IconSearch, SvgIconSettings as IconSettings, SvgIconSettlement as IconSettlement, SvgIconSignIn as IconSignIn, SvgIconSignOut as IconSignOut, SvgIconSort as IconSort, SvgIconSpinner as IconSpinner, SvgIconSupport as IconSupport, SvgIconTrash as IconTrash, SvgIconUpload as IconUpload, SvgIconUser as IconUser, SvgIconXlm as IconXlm,
|
|
407
|
+
export { CfAreaChart, CfBreakpointDebugger, CfButtonGroup, CfButtonGroupButton, CfCard, CfCheckbox, type CfCheckboxProps, CfForm, CfInput, CfInputArray, type CfInputProps, CfLineChart, CfModal, CfPagination, CfSelect, type CfSelectOption, type CfSelectProps, CfTag, type CfTagProps, CfToast, SvgIconAlert as IconAlert, SvgIconArrowDown as IconArrowDown, SvgIconArrowUp as IconArrowUp, SvgIconAvax as IconAvax, SvgIconBank as IconBank, SvgIconBarChart as IconBarChart, SvgIconBch as IconBch, SvgIconBtc as IconBtc, SvgIconCalendar as IconCalendar, SvgIconCaretDown as IconCaretDown, SvgIconCaretLeft as IconCaretLeft, SvgIconCaretRight as IconCaretRight, SvgIconCaretUp as IconCaretUp, SvgIconCent as IconCent, SvgIconCheck as IconCheck, SvgIconChecking as IconChecking, SvgIconClose as IconClose, SvgIconConnect as IconConnect, SvgIconCopy as IconCopy, SvgIconDollar as IconDollar, SvgIconDownload as IconDownload, SvgIconEdit as IconEdit, SvgIconEnter as IconEnter, SvgIconEnterInverted as IconEnterInverted, SvgIconEth as IconEth, SvgIconExchange as IconExchange, SvgIconFilter as IconFilter, SvgIconHelp as IconHelp, SvgIconHistory as IconHistory, SvgIconHome as IconHome, SvgIconIndicatorDown as IconIndicatorDown, SvgIconIndicatorUp as IconIndicatorUp, SvgIconInfo as IconInfo, SvgIconLink as IconLink, SvgIconLtc as IconLtc, SvgIconMail as IconMail, SvgIconMenu as IconMenu, SvgIconMore as IconMore, SvgIconNotification as IconNotification, SvgIconOverview as IconOverview, SvgIconPercent as IconPercent, SvgIconPieChart as IconPieChart, SvgIconPlus as IconPlus, SvgIconRefresh as IconRefresh, SvgIconReports as IconReports, SvgIconReservesSuccess as IconReservesSuccess, SvgIconReservesWarning as IconReservesWarning, SvgIconSearch as IconSearch, SvgIconSettings as IconSettings, SvgIconSettlement as IconSettlement, SvgIconSignIn as IconSignIn, SvgIconSignOut as IconSignOut, SvgIconSort as IconSort, SvgIconSpinner as IconSpinner, SvgIconSupport as IconSupport, SvgIconTrash as IconTrash, SvgIconUpload as IconUpload, SvgIconUser as IconUser, SvgIconXlm as IconXlm, type SVGIcon, aggregateAmounts, exportedTheme as coreTheme, dateToTimestamp as dateToTimeStamp, formatPercentage, formatUSD, getDelta, layoutMinWidth, uiColors };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptofi/core-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "CryptoFi"
|
|
6
6
|
},
|
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "rm -rf ./dist && rollup -c",
|
|
14
|
-
"build-storybook": "storybook build",
|
|
15
|
-
"chromatic": "dotenv cross-var npx chromatic --project-token=%CHROMATIC_PROJECT_TOKEN%",
|
|
14
|
+
"build-storybook": "storybook build -o dist",
|
|
16
15
|
"dev": "yarn storybook",
|
|
17
16
|
"format": "prettier --config ./.prettierrc -w '**/*.{tsx,ts,js,cjs,json,yml}' && git update-index --again",
|
|
18
17
|
"icons:gen": "yarn icons:clean && yarn icons:prefix && npx @svgr/cli --out-dir ./src/icons -- ./svg-icons",
|
|
19
|
-
"icons:clean": "npx rimraf '**/Icon*.tsx' ./src/icons/index.ts",
|
|
18
|
+
"icons:clean": "npx rimraf '**/Icon!(*.stories).tsx' ./src/icons/index.ts",
|
|
20
19
|
"icons:prefix": "node scripts/prefixIcons.cjs",
|
|
21
20
|
"lint": "eslint src --ext .tsx --ext .ts",
|
|
22
21
|
"lint:fix": "yarn lint --fix",
|
|
@@ -24,10 +23,10 @@
|
|
|
24
23
|
"pretest": "yarn lint:fix",
|
|
25
24
|
"publish:local": "yarn build && npx yalc publish --push",
|
|
26
25
|
"publish:notifier": "dotenv cross-var node scripts/npmPublishNotifier.cjs %SLACK_WEBHOOK_URL%",
|
|
27
|
-
"publish:npm": "yarn build && npm publish --access public && yarn publish:notifier
|
|
28
|
-
"publish:storybook": "yarn chromatic",
|
|
26
|
+
"publish:npm": "yarn build && npm publish --access public && yarn publish:notifier",
|
|
29
27
|
"storybook": "storybook dev -p 6006",
|
|
30
28
|
"test": "jest --colors --passWithNoTests",
|
|
29
|
+
"test:one": "yarn test src/__tests/\"$@\".test.ts",
|
|
31
30
|
"test:watch": "yarn test --collectCoverage=false --watch"
|
|
32
31
|
},
|
|
33
32
|
"module": "dist/index.js",
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
"@chakra-ui/react": "^2.4.9",
|
|
41
40
|
"@emotion/react": "^11.11.1",
|
|
42
41
|
"@emotion/styled": "^11.11.0",
|
|
43
|
-
"framer-motion": "^
|
|
42
|
+
"framer-motion": "^10.16.4",
|
|
44
43
|
"react": "^18.2.0",
|
|
45
44
|
"react-dom": "^18.2.0"
|
|
46
45
|
},
|
|
@@ -64,18 +63,18 @@
|
|
|
64
63
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
65
64
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
66
65
|
"@rollup/plugin-terser": "^0.4.4",
|
|
67
|
-
"@storybook/addon-essentials": "^7.
|
|
68
|
-
"@storybook/addon-interactions": "^7.
|
|
69
|
-
"@storybook/addon-links": "^7.
|
|
66
|
+
"@storybook/addon-essentials": "^7.6.14",
|
|
67
|
+
"@storybook/addon-interactions": "^7.6.14",
|
|
68
|
+
"@storybook/addon-links": "^7.6.14",
|
|
70
69
|
"@storybook/addon-onboarding": "^1.0.8",
|
|
71
|
-
"@storybook/blocks": "^7.6.
|
|
72
|
-
"@storybook/components": "^7.
|
|
73
|
-
"@storybook/manager-api": "^7.6.
|
|
74
|
-
"@storybook/preview-api": "^7.
|
|
75
|
-
"@storybook/react": "^7.
|
|
76
|
-
"@storybook/react-vite": "^7.
|
|
70
|
+
"@storybook/blocks": "^7.6.14",
|
|
71
|
+
"@storybook/components": "^7.6.14",
|
|
72
|
+
"@storybook/manager-api": "^7.6.14",
|
|
73
|
+
"@storybook/preview-api": "^7.6.14",
|
|
74
|
+
"@storybook/react": "^7.6.14",
|
|
75
|
+
"@storybook/react-vite": "^7.6.14",
|
|
77
76
|
"@storybook/testing-library": "^0.2.2",
|
|
78
|
-
"@storybook/types": "^7.
|
|
77
|
+
"@storybook/types": "^7.6.14",
|
|
79
78
|
"@svgr/cli": "^8.1.0",
|
|
80
79
|
"@svgr/core": "^8.1.0",
|
|
81
80
|
"@svgr/plugin-jsx": "^8.1.0",
|
|
@@ -86,8 +85,8 @@
|
|
|
86
85
|
"@types/jest": "^29.2.6",
|
|
87
86
|
"@types/lodash.isempty": "^4",
|
|
88
87
|
"@types/prop-types": "^15",
|
|
89
|
-
"@types/react": "^18.
|
|
90
|
-
"@types/react-dom": "^18.
|
|
88
|
+
"@types/react": "^18.2.55",
|
|
89
|
+
"@types/react-dom": "^18.2.19",
|
|
91
90
|
"@types/rollup-plugin-peer-deps-external": "^2",
|
|
92
91
|
"@types/stringify-object": "^4.0.4",
|
|
93
92
|
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
|
@@ -107,7 +106,7 @@
|
|
|
107
106
|
"eslint-plugin-simple-import-sort": "^9.0.0",
|
|
108
107
|
"eslint-plugin-storybook": "^0.6.15",
|
|
109
108
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
110
|
-
"framer-motion": "^
|
|
109
|
+
"framer-motion": "^10.16.4",
|
|
111
110
|
"identity-obj-proxy": "^3.0.0",
|
|
112
111
|
"jest": "^29.4.0",
|
|
113
112
|
"lodash.isempty": "^4.4.0",
|
|
@@ -128,5 +127,5 @@
|
|
|
128
127
|
"typescript": "^5.3.3",
|
|
129
128
|
"vite": "^4.5.0"
|
|
130
129
|
},
|
|
131
|
-
"packageManager": "yarn@4.0
|
|
130
|
+
"packageManager": "yarn@4.1.0"
|
|
132
131
|
}
|