midashand-uikit 0.0.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.
- package/README.md +76 -0
- package/dist/ResetCSS.d.ts +2 -0
- package/dist/components/Alert/Alert.d.ts +4 -0
- package/dist/components/Alert/index.d.ts +3 -0
- package/dist/components/Alert/theme.d.ts +3 -0
- package/dist/components/Alert/types.d.ts +17 -0
- package/dist/components/Box/Box.d.ts +3 -0
- package/dist/components/Box/Flex.d.ts +3 -0
- package/dist/components/Box/index.d.ts +3 -0
- package/dist/components/Box/types.d.ts +6 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/types.d.ts +5 -0
- package/dist/components/Button/Button.d.ts +13 -0
- package/dist/components/Button/IconButton.d.ts +3 -0
- package/dist/components/Button/StyledButton.d.ts +4 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/theme.d.ts +77 -0
- package/dist/components/Button/types.d.ts +42 -0
- package/dist/components/ButtonMenu/ButtonMenu.d.ts +4 -0
- package/dist/components/ButtonMenu/ButtonMenuItem.d.ts +4 -0
- package/dist/components/ButtonMenu/StyledButtonMenu.d.ts +6 -0
- package/dist/components/ButtonMenu/index.d.ts +3 -0
- package/dist/components/ButtonMenu/types.d.ts +12 -0
- package/dist/components/Card/Card.d.ts +4 -0
- package/dist/components/Card/CardBody.d.ts +4 -0
- package/dist/components/Card/CardFooter.d.ts +4 -0
- package/dist/components/Card/CardHeader.d.ts +4 -0
- package/dist/components/Card/CardRibbon.d.ts +4 -0
- package/dist/components/Card/StyledCard.d.ts +7 -0
- package/dist/components/Card/index.d.ts +6 -0
- package/dist/components/Card/theme.d.ts +3 -0
- package/dist/components/Card/types.d.ts +23 -0
- package/dist/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/types.d.ts +8 -0
- package/dist/components/Dropdown/Dropdown.d.ts +4 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Dropdown/types.d.ts +8 -0
- package/dist/components/FallingBunnies/FallingBunnies.d.ts +4 -0
- package/dist/components/FallingBunnies/index.d.ts +2 -0
- package/dist/components/FallingBunnies/types.d.ts +11 -0
- package/dist/components/Heading/Heading.d.ts +5 -0
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/Heading/types.d.ts +20 -0
- package/dist/components/Image/BackgroundImage.d.ts +4 -0
- package/dist/components/Image/Image.d.ts +4 -0
- package/dist/components/Image/Wrapper.d.ts +3 -0
- package/dist/components/Image/index.d.ts +2 -0
- package/dist/components/Image/options.d.ts +6 -0
- package/dist/components/Image/types.d.ts +10 -0
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/types.d.ts +12 -0
- package/dist/components/Layouts/BaseLayout.d.ts +2 -0
- package/dist/components/Layouts/CardsLayout.d.ts +2 -0
- package/dist/components/Layouts/index.d.ts +2 -0
- package/dist/components/Link/Link.d.ts +4 -0
- package/dist/components/Link/LinkExternal.d.ts +4 -0
- package/dist/components/Link/index.d.ts +3 -0
- package/dist/components/Link/types.d.ts +5 -0
- package/dist/components/NotificationDot/NotificationDot.d.ts +4 -0
- package/dist/components/NotificationDot/index.d.ts +2 -0
- package/dist/components/NotificationDot/types.d.ts +8 -0
- package/dist/components/Overlay/Overlay.d.ts +5 -0
- package/dist/components/Overlay/index.d.ts +2 -0
- package/dist/components/Overlay/types.d.ts +4 -0
- package/dist/components/Progress/Progress.d.ts +4 -0
- package/dist/components/Progress/ProgressBunnyWrapper.d.ts +2 -0
- package/dist/components/Progress/StyledProgress.d.ts +10 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/themes.d.ts +9 -0
- package/dist/components/Progress/types.d.ts +11 -0
- package/dist/components/Radio/Radio.d.ts +5 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/theme.d.ts +3 -0
- package/dist/components/Radio/types.d.ts +12 -0
- package/dist/components/Skeleton/Skeleton.d.ts +4 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/types.d.ts +15 -0
- package/dist/components/Slider/Slider.d.ts +4 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/styles.d.ts +18 -0
- package/dist/components/Slider/svg/BunnyButt.d.ts +4 -0
- package/dist/components/Slider/types.d.ts +8 -0
- package/dist/components/Spinner/PanIcon.d.ts +4 -0
- package/dist/components/Spinner/PancakeIcon.d.ts +4 -0
- package/dist/components/Spinner/Spinner.d.ts +4 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/types.d.ts +4 -0
- package/dist/components/Svg/Icons/Add.d.ts +4 -0
- package/dist/components/Svg/Icons/ArrowBack.d.ts +4 -0
- package/dist/components/Svg/Icons/ArrowDouble.d.ts +4 -0
- package/dist/components/Svg/Icons/ArrowDown.d.ts +4 -0
- package/dist/components/Svg/Icons/ArrowDropDown.d.ts +4 -0
- package/dist/components/Svg/Icons/ArrowDropUp.d.ts +4 -0
- package/dist/components/Svg/Icons/ArrowForward.d.ts +4 -0
- package/dist/components/Svg/Icons/ArrowUp.d.ts +4 -0
- package/dist/components/Svg/Icons/AutoRenew.d.ts +4 -0
- package/dist/components/Svg/Icons/Binance.d.ts +4 -0
- package/dist/components/Svg/Icons/Block.d.ts +4 -0
- package/dist/components/Svg/Icons/Bow.d.ts +4 -0
- package/dist/components/Svg/Icons/Bsc.d.ts +4 -0
- package/dist/components/Svg/Icons/BunnyPlaceholder.d.ts +4 -0
- package/dist/components/Svg/Icons/Calculate.d.ts +4 -0
- package/dist/components/Svg/Icons/CardView.d.ts +4 -0
- package/dist/components/Svg/Icons/Checkmark.d.ts +4 -0
- package/dist/components/Svg/Icons/CheckmarkCircle.d.ts +4 -0
- package/dist/components/Svg/Icons/ChevronDown.d.ts +4 -0
- package/dist/components/Svg/Icons/ChevronLeft.d.ts +4 -0
- package/dist/components/Svg/Icons/ChevronRight.d.ts +4 -0
- package/dist/components/Svg/Icons/ChevronUp.d.ts +4 -0
- package/dist/components/Svg/Icons/Close.d.ts +4 -0
- package/dist/components/Svg/Icons/Cog.d.ts +4 -0
- package/dist/components/Svg/Icons/Community.d.ts +4 -0
- package/dist/components/Svg/Icons/Copy.d.ts +4 -0
- package/dist/components/Svg/Icons/Error.d.ts +4 -0
- package/dist/components/Svg/Icons/Help.d.ts +4 -0
- package/dist/components/Svg/Icons/Info.d.ts +4 -0
- package/dist/components/Svg/Icons/ListView.d.ts +4 -0
- package/dist/components/Svg/Icons/Logo.d.ts +4 -0
- package/dist/components/Svg/Icons/LogoRound.d.ts +4 -0
- package/dist/components/Svg/Icons/Metamask.d.ts +4 -0
- package/dist/components/Svg/Icons/Minus.d.ts +4 -0
- package/dist/components/Svg/Icons/NoProfileAvatar.d.ts +4 -0
- package/dist/components/Svg/Icons/OpenNew.d.ts +4 -0
- package/dist/components/Svg/Icons/PancakeRound.d.ts +4 -0
- package/dist/components/Svg/Icons/Pancakes.d.ts +4 -0
- package/dist/components/Svg/Icons/PlayCircleOutline.d.ts +4 -0
- package/dist/components/Svg/Icons/Prize.d.ts +4 -0
- package/dist/components/Svg/Icons/ProgressBunny.d.ts +4 -0
- package/dist/components/Svg/Icons/Remove.d.ts +4 -0
- package/dist/components/Svg/Icons/Search.d.ts +4 -0
- package/dist/components/Svg/Icons/SwapVert.d.ts +4 -0
- package/dist/components/Svg/Icons/SyncAlt.d.ts +4 -0
- package/dist/components/Svg/Icons/Ticket.d.ts +4 -0
- package/dist/components/Svg/Icons/TicketRound.d.ts +4 -0
- package/dist/components/Svg/Icons/Timer.d.ts +4 -0
- package/dist/components/Svg/Icons/Verified.d.ts +4 -0
- package/dist/components/Svg/Icons/Wait.d.ts +4 -0
- package/dist/components/Svg/Icons/Warning.d.ts +4 -0
- package/dist/components/Svg/Icons/Won.d.ts +4 -0
- package/dist/components/Svg/Svg.d.ts +3 -0
- package/dist/components/Svg/index.d.ts +54 -0
- package/dist/components/Svg/types.d.ts +8 -0
- package/dist/components/Table/example/const.d.ts +28 -0
- package/dist/components/Table/example/header.d.ts +2 -0
- package/dist/components/Table/hooks.d.ts +7 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/types.d.ts +145 -0
- package/dist/components/Table/utils.d.ts +2 -0
- package/dist/components/Tag/StyledTag.d.ts +8 -0
- package/dist/components/Tag/Tag.d.ts +4 -0
- package/dist/components/Tag/index.d.ts +2 -0
- package/dist/components/Tag/theme.d.ts +38 -0
- package/dist/components/Tag/types.d.ts +25 -0
- package/dist/components/Text/Text.d.ts +4 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/types.d.ts +8 -0
- package/dist/components/Toggle/StyledToggle.d.ts +5 -0
- package/dist/components/Toggle/Toggle.d.ts +4 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Toggle/theme.d.ts +3 -0
- package/dist/components/Toggle/types.d.ts +29 -0
- package/dist/components/Tooltip/theme.d.ts +3 -0
- package/dist/components/Tooltip/types.d.ts +5 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/useIsMounted.d.ts +1 -0
- package/dist/hooks/useKonamiCheatCode.d.ts +2 -0
- package/dist/hooks/useMatchBreakpoints.d.ts +5 -0
- package/dist/hooks/useParticleBurst.d.ts +20 -0
- package/dist/index.cjs.js +3706 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.esm.js +3585 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/testHelpers.d.ts +3 -0
- package/dist/theme/base.d.ts +37 -0
- package/dist/theme/colors.d.ts +17 -0
- package/dist/theme/dark.d.ts +3 -0
- package/dist/theme/index.d.ts +30 -0
- package/dist/theme/light.d.ts +3 -0
- package/dist/theme/types.d.ts +71 -0
- package/dist/util/getColor.d.ts +3 -0
- package/dist/util/getExternalLinkProps.d.ts +5 -0
- package/dist/util/getThemeValue.d.ts +5 -0
- package/dist/widgets/Menu/Menu.d.ts +4 -0
- package/dist/widgets/Menu/components/Accordion.d.ts +12 -0
- package/dist/widgets/Menu/components/Avatar.d.ts +7 -0
- package/dist/widgets/Menu/components/CakePrice.d.ts +6 -0
- package/dist/widgets/Menu/components/LangSelector.d.ts +9 -0
- package/dist/widgets/Menu/components/Logo.d.ts +9 -0
- package/dist/widgets/Menu/components/MenuButton.d.ts +12 -0
- package/dist/widgets/Menu/components/MenuEntry.d.ts +12 -0
- package/dist/widgets/Menu/components/MenuLink.d.ts +3 -0
- package/dist/widgets/Menu/components/Panel.d.ts +9 -0
- package/dist/widgets/Menu/components/PanelBody.d.ts +7 -0
- package/dist/widgets/Menu/components/PanelFooter.d.ts +6 -0
- package/dist/widgets/Menu/components/SocialLinks.d.ts +3 -0
- package/dist/widgets/Menu/components/ThemeSwitcher.d.ts +7 -0
- package/dist/widgets/Menu/components/UserBlock.d.ts +9 -0
- package/dist/widgets/Menu/config.d.ts +52 -0
- package/dist/widgets/Menu/icons/Audit.d.ts +4 -0
- package/dist/widgets/Menu/icons/Bridge.d.ts +4 -0
- package/dist/widgets/Menu/icons/CreateToken.d.ts +4 -0
- package/dist/widgets/Menu/icons/Dice.d.ts +4 -0
- package/dist/widgets/Menu/icons/Discord.d.ts +4 -0
- package/dist/widgets/Menu/icons/Disperse.d.ts +4 -0
- package/dist/widgets/Menu/icons/Farm.d.ts +4 -0
- package/dist/widgets/Menu/icons/Feature.d.ts +4 -0
- package/dist/widgets/Menu/icons/Groups.d.ts +4 -0
- package/dist/widgets/Menu/icons/Hamburger.d.ts +4 -0
- package/dist/widgets/Menu/icons/HamburgerClose.d.ts +4 -0
- package/dist/widgets/Menu/icons/Home.d.ts +4 -0
- package/dist/widgets/Menu/icons/Hunt.d.ts +4 -0
- package/dist/widgets/Menu/icons/Ifo.d.ts +4 -0
- package/dist/widgets/Menu/icons/Info.d.ts +4 -0
- package/dist/widgets/Menu/icons/KyudoArcher.d.ts +4 -0
- package/dist/widgets/Menu/icons/Language.d.ts +4 -0
- package/dist/widgets/Menu/icons/Listing.d.ts +4 -0
- package/dist/widgets/Menu/icons/Logo.d.ts +7 -0
- package/dist/widgets/Menu/icons/Lottery.d.ts +4 -0
- package/dist/widgets/Menu/icons/Moon.d.ts +4 -0
- package/dist/widgets/Menu/icons/More.d.ts +4 -0
- package/dist/widgets/Menu/icons/Multisender.d.ts +4 -0
- package/dist/widgets/Menu/icons/Nft.d.ts +4 -0
- package/dist/widgets/Menu/icons/Partner.d.ts +4 -0
- package/dist/widgets/Menu/icons/Pool.d.ts +4 -0
- package/dist/widgets/Menu/icons/Referral.d.ts +4 -0
- package/dist/widgets/Menu/icons/Stacking.d.ts +4 -0
- package/dist/widgets/Menu/icons/Sun.d.ts +4 -0
- package/dist/widgets/Menu/icons/Team.d.ts +4 -0
- package/dist/widgets/Menu/icons/Telegram.d.ts +4 -0
- package/dist/widgets/Menu/icons/Ticket.d.ts +4 -0
- package/dist/widgets/Menu/icons/Trade.d.ts +4 -0
- package/dist/widgets/Menu/icons/Twitter.d.ts +4 -0
- package/dist/widgets/Menu/icons/Vault.d.ts +4 -0
- package/dist/widgets/Menu/icons/index.d.ts +30 -0
- package/dist/widgets/Menu/index.d.ts +3 -0
- package/dist/widgets/Menu/theme.d.ts +3 -0
- package/dist/widgets/Menu/types.d.ts +54 -0
- package/dist/widgets/Modal/Modal.d.ts +10 -0
- package/dist/widgets/Modal/ModalContext.d.ts +10 -0
- package/dist/widgets/Modal/index.d.ts +4 -0
- package/dist/widgets/Modal/theme.d.ts +3 -0
- package/dist/widgets/Modal/types.d.ts +7 -0
- package/dist/widgets/Modal/useModal.d.ts +3 -0
- package/dist/widgets/Toast/Toast.d.ts +4 -0
- package/dist/widgets/Toast/ToastAction.d.ts +7 -0
- package/dist/widgets/Toast/ToastContainer.d.ts +4 -0
- package/dist/widgets/Toast/index.d.ts +3 -0
- package/dist/widgets/Toast/types.d.ts +30 -0
- package/dist/widgets/WalletModal/AccountModal.d.ts +8 -0
- package/dist/widgets/WalletModal/ConnectModal.d.ts +8 -0
- package/dist/widgets/WalletModal/CopyToClipboard.d.ts +6 -0
- package/dist/widgets/WalletModal/WalletCard.d.ts +10 -0
- package/dist/widgets/WalletModal/config.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/BinanceChain.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/BitKeepWallet.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/MathWallet.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/Metamask.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/OkxWallet.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/OntoWallet.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/SafePalWallet.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/StarkeyWallet.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/TokenPocket.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/TrustWallet.d.ts +4 -0
- package/dist/widgets/WalletModal/icons/WalletConnect.d.ts +4 -0
- package/dist/widgets/WalletModal/index.d.ts +4 -0
- package/dist/widgets/WalletModal/types.d.ts +14 -0
- package/dist/widgets/WalletModal/useWalletModal.d.ts +7 -0
- package/package.json +89 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# midashand UIkit
|
|
2
|
+
|
|
3
|
+
midashand UIkit is a set of React components and hooks used to build pages on midashand's apps. It also contains a theme file for dark and light mode.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
`npm i midashand-uikit`
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Deployment Guide
|
|
11
|
+
|
|
12
|
+
### 1. Edit ONG token address
|
|
13
|
+
first go to `src/widgets/Menu/components/CakePrice.tsx`, find `PriceLink` tag and change the ONG token address to current mainnet address.
|
|
14
|
+
|
|
15
|
+
then go to `package.json` and increase version.
|
|
16
|
+
|
|
17
|
+
then run
|
|
18
|
+
```
|
|
19
|
+
npm run build
|
|
20
|
+
npm login
|
|
21
|
+
npm publish
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Setup
|
|
26
|
+
|
|
27
|
+
### Theme
|
|
28
|
+
|
|
29
|
+
Before using midashand UIkit, you need to provide the theme file to styled-component.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
import { ThemeProvider } from 'styled-components'
|
|
33
|
+
import { light, dark } from 'midashand-uikit'
|
|
34
|
+
...
|
|
35
|
+
<ThemeProvider theme={isDark}>...</ThemeProvider>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Reset
|
|
39
|
+
|
|
40
|
+
A reset CSS is available as a global styled component.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
import { ResetCSS } from 'midashand-uikit'
|
|
44
|
+
...
|
|
45
|
+
<ResetCSS />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Types
|
|
49
|
+
|
|
50
|
+
This project is built with Typescript and export all the relevant types.
|
|
51
|
+
|
|
52
|
+
## How to use the UIkit
|
|
53
|
+
|
|
54
|
+
If you want to use components from the UIkit, check the [Storybook documentation](https://midashand.github.io/pancake-uikit/)
|
|
55
|
+
|
|
56
|
+
## How to Customize UIkit
|
|
57
|
+
|
|
58
|
+
First clone this repo to local and then start editing the components, theme, etc.
|
|
59
|
+
|
|
60
|
+
When is finished the Customization of the UIkit build it using:
|
|
61
|
+
|
|
62
|
+
`npm run build`
|
|
63
|
+
|
|
64
|
+
Commit everything to the git repo and if you are using a diferent repo just change it in package.json.
|
|
65
|
+
|
|
66
|
+
If you have a commit error due to husky you can try:
|
|
67
|
+
|
|
68
|
+
`git commit -am 'commit' --no-verify`
|
|
69
|
+
|
|
70
|
+
That should solve the problem, then push to remote repo.
|
|
71
|
+
|
|
72
|
+
After this you need to [publish the npm packege](https://zellwk.com/blog/publish-to-npm/)
|
|
73
|
+
|
|
74
|
+
Be aware of the versions, If you make an update change the version in package.json so when you publish this's not gonna throw you an error.
|
|
75
|
+
|
|
76
|
+
Go to the npm package you create an you are ready to use it.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from "react";
|
|
2
|
+
export type AlertTheme = {
|
|
3
|
+
background: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const variants: {
|
|
6
|
+
readonly INFO: "info";
|
|
7
|
+
readonly DANGER: "danger";
|
|
8
|
+
readonly SUCCESS: "success";
|
|
9
|
+
readonly WARNING: "warning";
|
|
10
|
+
};
|
|
11
|
+
export type Variants = typeof variants[keyof typeof variants];
|
|
12
|
+
export interface AlertProps {
|
|
13
|
+
variant?: Variants;
|
|
14
|
+
title: string;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
onClick?: (evt: MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { BackgroundProps, BorderProps, FlexboxProps, LayoutProps, PositionProps, SpaceProps } from "styled-system";
|
|
3
|
+
export interface BoxProps extends BackgroundProps, BorderProps, LayoutProps, PositionProps, SpaceProps, HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
}
|
|
5
|
+
export interface FlexProps extends BoxProps, FlexboxProps {
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonProps } from "./types";
|
|
3
|
+
declare const Button: {
|
|
4
|
+
<E extends React.ElementType<any> = "button">(props: ButtonProps<E>): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
external: boolean;
|
|
8
|
+
variant: "primary";
|
|
9
|
+
scale: "md";
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default Button;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const scaleVariants: {
|
|
2
|
+
md: {
|
|
3
|
+
height: string;
|
|
4
|
+
padding: string;
|
|
5
|
+
};
|
|
6
|
+
sm: {
|
|
7
|
+
height: string;
|
|
8
|
+
padding: string;
|
|
9
|
+
};
|
|
10
|
+
xs: {
|
|
11
|
+
height: string;
|
|
12
|
+
fontSize: string;
|
|
13
|
+
padding: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const styleVariants: {
|
|
17
|
+
primary: {
|
|
18
|
+
background: string;
|
|
19
|
+
color: string;
|
|
20
|
+
":disabled": {
|
|
21
|
+
background: string;
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
secondary: {
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
border: string;
|
|
28
|
+
borderColor: string;
|
|
29
|
+
boxShadow: string;
|
|
30
|
+
color: string;
|
|
31
|
+
":disabled": {
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
tertiary: {
|
|
36
|
+
backgroundColor: string;
|
|
37
|
+
boxShadow: string;
|
|
38
|
+
color: string;
|
|
39
|
+
};
|
|
40
|
+
subtle: {
|
|
41
|
+
backgroundColor: string;
|
|
42
|
+
color: string;
|
|
43
|
+
};
|
|
44
|
+
danger: {
|
|
45
|
+
backgroundColor: string;
|
|
46
|
+
color: string;
|
|
47
|
+
};
|
|
48
|
+
success: {
|
|
49
|
+
backgroundColor: string;
|
|
50
|
+
color: string;
|
|
51
|
+
};
|
|
52
|
+
text: {
|
|
53
|
+
backgroundColor: string;
|
|
54
|
+
color: string;
|
|
55
|
+
boxShadow: string;
|
|
56
|
+
};
|
|
57
|
+
switch: {
|
|
58
|
+
backgroundColor: string;
|
|
59
|
+
color: string;
|
|
60
|
+
boxShadow: string;
|
|
61
|
+
};
|
|
62
|
+
tradeprimary: {
|
|
63
|
+
backgroundColor: string;
|
|
64
|
+
color: string;
|
|
65
|
+
boxShadow: string;
|
|
66
|
+
};
|
|
67
|
+
tradesecondary: {
|
|
68
|
+
backgroundColor: string;
|
|
69
|
+
border: string;
|
|
70
|
+
borderColor: string;
|
|
71
|
+
boxShadow: string;
|
|
72
|
+
color: string;
|
|
73
|
+
":disabled": {
|
|
74
|
+
backgroundColor: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentProps, ElementType, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { LayoutProps, SpaceProps } from "styled-system";
|
|
4
|
+
export declare const scales: {
|
|
5
|
+
readonly MD: "md";
|
|
6
|
+
readonly SM: "sm";
|
|
7
|
+
readonly XS: "xs";
|
|
8
|
+
};
|
|
9
|
+
export declare const variants: {
|
|
10
|
+
readonly PRIMARY: "primary";
|
|
11
|
+
readonly SECONDARY: "secondary";
|
|
12
|
+
readonly TERTIARY: "tertiary";
|
|
13
|
+
readonly TEXT: "text";
|
|
14
|
+
readonly DANGER: "danger";
|
|
15
|
+
readonly SUBTLE: "subtle";
|
|
16
|
+
readonly SUCCESS: "success";
|
|
17
|
+
readonly SWITCH: "switch";
|
|
18
|
+
readonly TRADEPRIMARY: "tradeprimary";
|
|
19
|
+
readonly TRADESECONDARY: "tradesecondary";
|
|
20
|
+
};
|
|
21
|
+
export type Scale = typeof scales[keyof typeof scales];
|
|
22
|
+
export type Variant = typeof variants[keyof typeof variants];
|
|
23
|
+
/**
|
|
24
|
+
* @see https://www.benmvp.com/blog/polymorphic-react-components-typescript/
|
|
25
|
+
*/
|
|
26
|
+
export type AsProps<E extends ElementType = ElementType> = {
|
|
27
|
+
as?: E;
|
|
28
|
+
};
|
|
29
|
+
export type MergeProps<E extends ElementType> = AsProps<E> & Omit<ComponentProps<E>, keyof AsProps>;
|
|
30
|
+
export type PolymorphicComponentProps<E extends ElementType, P> = P & MergeProps<E>;
|
|
31
|
+
export type PolymorphicComponent<P, D extends ElementType = "button"> = <E extends ElementType = D>(props: PolymorphicComponentProps<E, P>) => ReactElement | null;
|
|
32
|
+
export interface BaseButtonProps extends LayoutProps, SpaceProps {
|
|
33
|
+
as?: "a" | "button" | typeof Link;
|
|
34
|
+
external?: boolean;
|
|
35
|
+
isLoading?: boolean;
|
|
36
|
+
scale?: Scale;
|
|
37
|
+
variant?: Variant;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
startIcon?: ReactNode;
|
|
40
|
+
endIcon?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
export type ButtonProps<P extends ElementType = "button"> = PolymorphicComponentProps<P, BaseButtonProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseButtonProps, Scale, variants } from "../Button/types";
|
|
3
|
+
export interface ButtonMenuItemProps extends BaseButtonProps {
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ButtonMenuProps {
|
|
7
|
+
variant?: typeof variants.PRIMARY | typeof variants.SUBTLE;
|
|
8
|
+
activeIndex?: number;
|
|
9
|
+
onItemClick?: (index: number) => void;
|
|
10
|
+
scale?: Scale;
|
|
11
|
+
children: React.ReactElement[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DefaultTheme } from "styled-components";
|
|
2
|
+
import { CardProps } from "./types";
|
|
3
|
+
interface StyledCardProps extends CardProps {
|
|
4
|
+
theme: DefaultTheme;
|
|
5
|
+
}
|
|
6
|
+
declare const StyledCard: import("styled-components").StyledComponent<"div", DefaultTheme, StyledCardProps, never>;
|
|
7
|
+
export default StyledCard;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Card } from "./Card";
|
|
2
|
+
export { default as CardBody } from "./CardBody";
|
|
3
|
+
export { default as CardHeader } from "./CardHeader";
|
|
4
|
+
export { default as CardFooter } from "./CardFooter";
|
|
5
|
+
export { default as CardRibbon } from "./CardRibbon";
|
|
6
|
+
export type { CardProps, CardRibbonProps } from "./types";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
|
+
import { Colors } from "../../theme/types";
|
|
4
|
+
export interface CardRibbonProps {
|
|
5
|
+
variantColor?: keyof Colors;
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
export type CardTheme = {
|
|
9
|
+
background: string;
|
|
10
|
+
boxShadow: string;
|
|
11
|
+
boxShadowActive: string;
|
|
12
|
+
boxShadowSuccess: string;
|
|
13
|
+
boxShadowWarning: string;
|
|
14
|
+
cardHeaderBackground: string;
|
|
15
|
+
dropShadow: string;
|
|
16
|
+
};
|
|
17
|
+
export interface CardProps extends SpaceProps, HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
isSuccess?: boolean;
|
|
20
|
+
isWarning?: boolean;
|
|
21
|
+
isDisabled?: boolean;
|
|
22
|
+
ribbon?: React.ReactNode;
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const tags: {
|
|
2
|
+
H1: string;
|
|
3
|
+
H2: string;
|
|
4
|
+
H3: string;
|
|
5
|
+
H4: string;
|
|
6
|
+
H5: string;
|
|
7
|
+
H6: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const sizes: {
|
|
10
|
+
readonly MD: "md";
|
|
11
|
+
readonly LG: "lg";
|
|
12
|
+
readonly XL: "xl";
|
|
13
|
+
readonly XXL: "xxl";
|
|
14
|
+
};
|
|
15
|
+
export type Tags = typeof tags[keyof typeof tags];
|
|
16
|
+
export type Sizes = typeof sizes[keyof typeof sizes];
|
|
17
|
+
export interface HeadingProps {
|
|
18
|
+
as?: Tags;
|
|
19
|
+
size?: Sizes;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SpaceProps } from "styled-system";
|
|
2
|
+
export declare const scales: {
|
|
3
|
+
readonly SM: "sm";
|
|
4
|
+
readonly MD: "md";
|
|
5
|
+
readonly LG: "lg";
|
|
6
|
+
};
|
|
7
|
+
export type Scales = typeof scales[keyof typeof scales];
|
|
8
|
+
export interface InputProps extends SpaceProps {
|
|
9
|
+
scale?: Scales;
|
|
10
|
+
isSuccess?: boolean;
|
|
11
|
+
isWarning?: boolean;
|
|
12
|
+
}
|