@ftdata/ui 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 +23 -0
- package/dist/assets/AddIcon.d.ts +3 -0
- package/dist/assets/AddIcon.js +35 -0
- package/dist/assets/ArrowLeftIcon.d.ts +2 -0
- package/dist/assets/ArrowLeftIcon.js +26 -0
- package/dist/assets/BackArrowIcon.d.ts +3 -0
- package/dist/assets/BackArrowIcon.js +35 -0
- package/dist/assets/BellIcon.d.ts +2 -0
- package/dist/assets/BellIcon.js +43 -0
- package/dist/assets/BuildingIcon.d.ts +2 -0
- package/dist/assets/BuildingIcon.js +15 -0
- package/dist/assets/BurgerMenu.d.ts +3 -0
- package/dist/assets/BurgerMenu.js +41 -0
- package/dist/assets/CancelSquareIcon.d.ts +3 -0
- package/dist/assets/CancelSquareIcon.js +36 -0
- package/dist/assets/CarretDownIcon.d.ts +3 -0
- package/dist/assets/CarretDownIcon.js +32 -0
- package/dist/assets/CavetDown.d.ts +2 -0
- package/dist/assets/CavetDown.js +18 -0
- package/dist/assets/CavetRight.d.ts +2 -0
- package/dist/assets/CavetRight.js +18 -0
- package/dist/assets/CavetUp.d.ts +2 -0
- package/dist/assets/CavetUp.js +18 -0
- package/dist/assets/CheckMarkIcon.d.ts +3 -0
- package/dist/assets/CheckMarkIcon.js +39 -0
- package/dist/assets/CheckmarkDone.d.ts +3 -0
- package/dist/assets/CheckmarkDone.js +27 -0
- package/dist/assets/CloseIcon.d.ts +2 -0
- package/dist/assets/CloseIcon.js +27 -0
- package/dist/assets/CommandIcon.d.ts +2 -0
- package/dist/assets/CommandIcon.js +77 -0
- package/dist/assets/DoneCircleIcon.d.ts +3 -0
- package/dist/assets/DoneCircleIcon.js +29 -0
- package/dist/assets/EmptyAlertDetail.d.ts +2 -0
- package/dist/assets/EmptyAlertDetail.js +451 -0
- package/dist/assets/EmptyPage.d.ts +3 -0
- package/dist/assets/EmptyPage.js +551 -0
- package/dist/assets/EyeIcon.d.ts +2 -0
- package/dist/assets/EyeIcon.js +35 -0
- package/dist/assets/FenceIcon.d.ts +2 -0
- package/dist/assets/FenceIcon.js +70 -0
- package/dist/assets/FolderCheckmark.d.ts +3 -0
- package/dist/assets/FolderCheckmark.js +44 -0
- package/dist/assets/FulltrackLogo.d.ts +3 -0
- package/dist/assets/FulltrackLogo.js +37 -0
- package/dist/assets/GlobeIcon.d.ts +2 -0
- package/dist/assets/GlobeIcon.js +61 -0
- package/dist/assets/GoogleIcon.d.ts +2 -0
- package/dist/assets/GoogleIcon.js +18 -0
- package/dist/assets/Group.js +2 -0
- package/dist/assets/MinusMarkIcon.d.ts +3 -0
- package/dist/assets/MinusMarkIcon.js +40 -0
- package/dist/assets/MosaicIcon.d.ts +3 -0
- package/dist/assets/MosaicIcon.js +41 -0
- package/dist/assets/NavLogo.d.ts +3 -0
- package/dist/assets/NavLogo.js +73 -0
- package/dist/assets/PinLocation.d.ts +2 -0
- package/dist/assets/PinLocation.js +31 -0
- package/dist/assets/PlusAddIcon.d.ts +2 -0
- package/dist/assets/PlusAddIcon.js +42 -0
- package/dist/assets/RefreshIcon.d.ts +2 -0
- package/dist/assets/RefreshIcon.js +16 -0
- package/dist/assets/SearchIcon.d.ts +3 -0
- package/dist/assets/SearchIcon.js +30 -0
- package/dist/assets/SendIcon.d.ts +3 -0
- package/dist/assets/SendIcon.js +20 -0
- package/dist/assets/StreetView.d.ts +2 -0
- package/dist/assets/StreetView.js +52 -0
- package/dist/assets/SwitchCheckMarkIcon.d.ts +3 -0
- package/dist/assets/SwitchCheckMarkIcon.js +40 -0
- package/dist/assets/WarningIcon.d.ts +2 -0
- package/dist/assets/WarningIcon.js +34 -0
- package/dist/assets/gif/how-to-use.js +2 -0
- package/dist/assets/iconMenu/SettingsIcon.d.ts +2 -0
- package/dist/assets/iconMenu/SettingsIcon.js +30 -0
- package/dist/assets/img/cover.js +2 -0
- package/dist/assets/img/map-sample.js +2 -0
- package/dist/assets/img/photo-goes-here.js +2 -0
- package/dist/assets/svg/chat.js +2 -0
- package/dist/assets/svg/colored-item.js +2 -0
- package/dist/assets/svg/mailbox-bro.js +2 -0
- package/dist/assets/svg/star-favorite.js +2 -0
- package/dist/assets/travolta.js +2 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +33 -0
- package/dist/components/Avatar/Avatar.stories.js +177 -0
- package/dist/components/Avatar/index.d.ts +7 -0
- package/dist/components/Avatar/index.js +28 -0
- package/dist/components/Avatar/styles.d.ts +4 -0
- package/dist/components/Avatar/styles.js +37 -0
- package/dist/components/Avatar/utils/getAvatarColors.d.ts +6 -0
- package/dist/components/Avatar/utils/getAvatarColors.js +48 -0
- package/dist/components/Breadcrumb/Breadcrumb.stories.d.ts +17 -0
- package/dist/components/Breadcrumb/Breadcrumb.stories.js +51 -0
- package/dist/components/Breadcrumb/index.d.ts +10 -0
- package/dist/components/Breadcrumb/index.js +34 -0
- package/dist/components/Breadcrumb/styles.d.ts +9 -0
- package/dist/components/Breadcrumb/styles.js +43 -0
- package/dist/components/Button/Button.stories.d.ts +58 -0
- package/dist/components/Button/Button.stories.js +284 -0
- package/dist/components/Button/index.d.ts +26 -0
- package/dist/components/Button/index.js +69 -0
- package/dist/components/Button/modifiers.d.ts +8 -0
- package/dist/components/Button/modifiers.js +41 -0
- package/dist/components/Button/styles.d.ts +25 -0
- package/dist/components/Button/styles.js +111 -0
- package/dist/components/Checkbox/CheckMarkIcon.d.ts +3 -0
- package/dist/components/Checkbox/CheckMarkIcon.js +38 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +35 -0
- package/dist/components/Checkbox/Checkbox.stories.js +101 -0
- package/dist/components/Checkbox/MinusMarkIcon.d.ts +3 -0
- package/dist/components/Checkbox/MinusMarkIcon.js +39 -0
- package/dist/components/Checkbox/index.d.ts +9 -0
- package/dist/components/Checkbox/index.js +40 -0
- package/dist/components/Checkbox/styles.d.ts +12 -0
- package/dist/components/Checkbox/styles.js +41 -0
- package/dist/components/Collapse/Colapse.stories.d.ts +10 -0
- package/dist/components/Collapse/Colapse.stories.js +108 -0
- package/dist/components/Collapse/index.d.ts +15 -0
- package/dist/components/Collapse/index.js +61 -0
- package/dist/components/Collapse/styles.d.ts +11 -0
- package/dist/components/Collapse/styles.js +23 -0
- package/dist/components/CustomSelect/CustomSelect.stories.d.ts +73 -0
- package/dist/components/CustomSelect/CustomSelect.stories.js +477 -0
- package/dist/components/CustomSelect/CustomSelectList/index.d.ts +10 -0
- package/dist/components/CustomSelect/CustomSelectList/index.js +66 -0
- package/dist/components/CustomSelect/CustomSelectList/style.d.ts +8 -0
- package/dist/components/CustomSelect/CustomSelectList/style.js +95 -0
- package/dist/components/CustomSelect/index.d.ts +30 -0
- package/dist/components/CustomSelect/index.js +193 -0
- package/dist/components/CustomSelect/styles.d.ts +22 -0
- package/dist/components/CustomSelect/styles.js +93 -0
- package/dist/components/DoubleList/DoubleList.stories.d.ts +13 -0
- package/dist/components/DoubleList/DoubleList.stories.js +82 -0
- package/dist/components/DoubleList/index.d.ts +9 -0
- package/dist/components/DoubleList/index.js +70 -0
- package/dist/components/DoubleList/style.d.ts +5 -0
- package/dist/components/DoubleList/style.js +92 -0
- package/dist/components/EmptyState/Empty.stories.d.ts +26 -0
- package/dist/components/EmptyState/Empty.stories.js +72 -0
- package/dist/components/EmptyState/index.d.ts +10 -0
- package/dist/components/EmptyState/index.js +48 -0
- package/dist/components/EmptyState/styles.d.ts +3 -0
- package/dist/components/EmptyState/styles.js +39 -0
- package/dist/components/Grid/Column/Column.stories.d.ts +26 -0
- package/dist/components/Grid/Column/Column.stories.js +335 -0
- package/dist/components/Grid/Column/index.d.ts +15 -0
- package/dist/components/Grid/Column/index.js +10 -0
- package/dist/components/Grid/Container/Container.stories.d.ts +11 -0
- package/dist/components/Grid/Container/Container.stories.js +114 -0
- package/dist/components/Grid/Container/index.d.ts +6 -0
- package/dist/components/Grid/Container/index.js +11 -0
- package/dist/components/Grid/Row/Row.stories.d.ts +22 -0
- package/dist/components/Grid/Row/Row.stories.js +248 -0
- package/dist/components/Grid/Row/index.d.ts +20 -0
- package/dist/components/Grid/Row/index.js +10 -0
- package/dist/components/Grid/index.d.ts +38 -0
- package/dist/components/Grid/index.js +121 -0
- package/dist/components/Grid/utils.d.ts +1 -0
- package/dist/components/Grid/utils.js +18 -0
- package/dist/components/Loading/Loading/index.d.ts +7 -0
- package/dist/components/Loading/Loading/index.js +9 -0
- package/dist/components/Loading/Loading.stories.d.ts +24 -0
- package/dist/components/Loading/Loading.stories.js +145 -0
- package/dist/components/Loading/index.d.ts +16 -0
- package/dist/components/Loading/index.js +98 -0
- package/dist/components/Menu/constants/icons.d.ts +17 -0
- package/dist/components/Menu/constants/icons.js +61 -0
- package/dist/components/Menu/helpers/createMenus.d.ts +2 -0
- package/dist/components/Menu/helpers/createMenus.js +20 -0
- package/dist/components/Menu/helpers/createSubMenus.d.ts +2 -0
- package/dist/components/Menu/helpers/createSubMenus.js +13 -0
- package/dist/components/Menu/helpers/generateColorScale.d.ts +1 -0
- package/dist/components/Menu/helpers/generateColorScale.js +62 -0
- package/dist/components/Menu/helpers/getLuminance.d.ts +1 -0
- package/dist/components/Menu/helpers/getLuminance.js +9 -0
- package/dist/components/Menu/index.d.ts +12 -0
- package/dist/components/Menu/index.js +108 -0
- package/dist/components/Menu/styles.d.ts +17 -0
- package/dist/components/Menu/styles.js +202 -0
- package/dist/components/Menu/types/IconKeysType.d.ts +2 -0
- package/dist/components/Menu/types/IconKeysType.js +0 -0
- package/dist/components/Menu/types/MenuItem.d.ts +26 -0
- package/dist/components/Menu/types/MenuItem.js +0 -0
- package/dist/components/MultiSelect/Badge/index.d.ts +6 -0
- package/dist/components/MultiSelect/Badge/index.js +31 -0
- package/dist/components/MultiSelect/Badge/styles.d.ts +1 -0
- package/dist/components/MultiSelect/Badge/styles.js +57 -0
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +61 -0
- package/dist/components/MultiSelect/MultiSelect.stories.js +336 -0
- package/dist/components/MultiSelect/MultiSelectList/index.d.ts +10 -0
- package/dist/components/MultiSelect/MultiSelectList/index.js +59 -0
- package/dist/components/MultiSelect/MultiSelectList/style.d.ts +3 -0
- package/dist/components/MultiSelect/MultiSelectList/style.js +82 -0
- package/dist/components/MultiSelect/calcTextSize.d.ts +1 -0
- package/dist/components/MultiSelect/calcTextSize.js +10 -0
- package/dist/components/MultiSelect/index.d.ts +24 -0
- package/dist/components/MultiSelect/index.js +284 -0
- package/dist/components/MultiSelect/styles.d.ts +24 -0
- package/dist/components/MultiSelect/styles.js +165 -0
- package/dist/components/Radio/Radio.stories.d.ts +18 -0
- package/dist/components/Radio/Radio.stories.js +30 -0
- package/dist/components/Radio/index.d.ts +7 -0
- package/dist/components/Radio/index.js +27 -0
- package/dist/components/Radio/story.d.ts +5 -0
- package/dist/components/Radio/story.js +47 -0
- package/dist/components/Radio/styles.d.ts +8 -0
- package/dist/components/Radio/styles.js +43 -0
- package/dist/components/StateAlert/StateAlert.stories.d.ts +46 -0
- package/dist/components/StateAlert/StateAlert.stories.js +189 -0
- package/dist/components/StateAlert/index.d.ts +22 -0
- package/dist/components/StateAlert/index.js +56 -0
- package/dist/components/StateAlert/styles.d.ts +7 -0
- package/dist/components/StateAlert/styles.js +124 -0
- package/dist/components/Switch/Switch.stories.d.ts +26 -0
- package/dist/components/Switch/Switch.stories.js +81 -0
- package/dist/components/Switch/index.d.ts +8 -0
- package/dist/components/Switch/index.js +26 -0
- package/dist/components/Switch/styles.d.ts +15 -0
- package/dist/components/Switch/styles.js +33 -0
- package/dist/components/Text/Paragraph/Paragraph.stories.d.ts +29 -0
- package/dist/components/Text/Paragraph/Paragraph.stories.js +124 -0
- package/dist/components/Text/Title/Title.stories.d.ts +41 -0
- package/dist/components/Text/Title/Title.stories.js +106 -0
- package/dist/components/Text/index.d.ts +3 -0
- package/dist/components/Text/index.js +17 -0
- package/dist/components/Text/styles.d.ts +23 -0
- package/dist/components/Text/styles.js +70 -0
- package/dist/components/TextArea/Textarea.stories.d.ts +33 -0
- package/dist/components/TextArea/Textarea.stories.js +65 -0
- package/dist/components/TextArea/index.d.ts +10 -0
- package/dist/components/TextArea/index.js +39 -0
- package/dist/components/TextArea/styles.d.ts +18 -0
- package/dist/components/TextArea/styles.js +88 -0
- package/dist/components/TooltipWrapper/Tooltip.stories.d.ts +21 -0
- package/dist/components/TooltipWrapper/Tooltip.stories.js +54 -0
- package/dist/components/TooltipWrapper/index.d.ts +20 -0
- package/dist/components/TooltipWrapper/index.js +56 -0
- package/dist/components/TooltipWrapper/styles.d.ts +6 -0
- package/dist/components/TooltipWrapper/styles.js +20 -0
- package/dist/components/Tooltips/Tooltips.stories.d.ts +25 -0
- package/dist/components/Tooltips/Tooltips.stories.js +139 -0
- package/dist/components/Tooltips/index.d.ts +8 -0
- package/dist/components/Tooltips/index.js +28 -0
- package/dist/components/Tooltips/styles.d.ts +5 -0
- package/dist/components/Tooltips/styles.js +37 -0
- package/dist/components/UserMenu/UserMenu.stories.d.ts +26 -0
- package/dist/components/UserMenu/UserMenu.stories.js +174 -0
- package/dist/components/UserMenu/index.d.ts +19 -0
- package/dist/components/UserMenu/index.js +64 -0
- package/dist/components/UserMenu/style.d.ts +2 -0
- package/dist/components/UserMenu/style.js +44 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/static/image/cover.png +0 -0
- package/dist/static/image/how-to-use.gif +0 -0
- package/dist/static/image/map-sample.png +0 -0
- package/dist/static/image/photo-goes-here.png +0 -0
- package/dist/static/image/travolta.jpg +0 -0
- package/dist/static/svg/Group.svg +5 -0
- package/dist/static/svg/chat.svg +10 -0
- package/dist/static/svg/colored-item.svg +9 -0
- package/dist/static/svg/mailbox-bro.svg +102 -0
- package/dist/static/svg/star-favorite.svg +3 -0
- package/dist/style/_reset.css +205 -0
- package/package.json +43 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Breadcrumb from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Breadcrumbs são usados para mostrar os níveis de navegação e sua hierarquia.
|
|
5
|
+
* Este componente também funciona com os atributos nativos de um HTML div element.
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof Breadcrumb>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
/**
|
|
11
|
+
* Variação padrão do breadcrumb.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Variação do breadcrumb quando a propriedade de cor é passada.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Color: Story;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import index from "./index.js";
|
|
2
|
+
const defaultItems = [
|
|
3
|
+
{
|
|
4
|
+
label: "Home",
|
|
5
|
+
redirect: ()=>null
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
label: "Configura\xe7\xf5es",
|
|
9
|
+
redirect: ()=>null
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: "Privacidade e Seguran\xe7a",
|
|
13
|
+
redirect: ()=>null
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "UI/Breadcrumb",
|
|
18
|
+
component: index,
|
|
19
|
+
tags: [
|
|
20
|
+
"autodocs"
|
|
21
|
+
],
|
|
22
|
+
parameters: {
|
|
23
|
+
layout: "centered"
|
|
24
|
+
},
|
|
25
|
+
argTypes: {
|
|
26
|
+
items: {
|
|
27
|
+
description: "Define o conte\xfado do breadcrumb e a fun\xe7\xe3o de callback para redirecionamento de cada n\xedvel.",
|
|
28
|
+
control: {
|
|
29
|
+
type: "object"
|
|
30
|
+
},
|
|
31
|
+
table: {
|
|
32
|
+
type: {
|
|
33
|
+
summary: " BreadcrumbNode - { label: string; redirect: function }[]"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const Breadcrumb_stories = meta;
|
|
40
|
+
const Default = {
|
|
41
|
+
args: {
|
|
42
|
+
items: defaultItems
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const Color = {
|
|
46
|
+
args: {
|
|
47
|
+
items: defaultItems,
|
|
48
|
+
color: "var(--color-brand)"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export { Color, Default, Breadcrumb_stories as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type BreadcrumbNode = {
|
|
2
|
+
label: string;
|
|
3
|
+
redirect: () => void;
|
|
4
|
+
};
|
|
5
|
+
type BreadcrumbProps = {
|
|
6
|
+
items: BreadcrumbNode[];
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
export default function Breadcrumb({ items, color }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BreadcrumbContainer, Item, LastItem, Wrapper, WrapperLast } from "./styles.js";
|
|
3
|
+
function Breadcrumb({ items, color }) {
|
|
4
|
+
const lastIndex = items.length - 1;
|
|
5
|
+
const lastItem = items[lastIndex];
|
|
6
|
+
const remainingItems = items.slice(0, lastIndex);
|
|
7
|
+
return /*#__PURE__*/ jsxs(BreadcrumbContainer, {
|
|
8
|
+
children: [
|
|
9
|
+
remainingItems.map((item, idx)=>/*#__PURE__*/ jsxs(Wrapper, {
|
|
10
|
+
onClick: item.redirect,
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx(Item, {
|
|
13
|
+
color: color,
|
|
14
|
+
children: item.label
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx(Item, {
|
|
17
|
+
className: "breadcrumb-dash",
|
|
18
|
+
color: color,
|
|
19
|
+
onClick: (event)=>event.stopPropagation(),
|
|
20
|
+
children: "/"
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
}, `__${item.label}${idx}`)),
|
|
24
|
+
/*#__PURE__*/ jsx(WrapperLast, {
|
|
25
|
+
onClick: ()=>null,
|
|
26
|
+
children: /*#__PURE__*/ jsx(LastItem, {
|
|
27
|
+
color: color,
|
|
28
|
+
children: lastItem.label
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export { Breadcrumb as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const BreadcrumbContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
interface DefaultItemProps {
|
|
3
|
+
color?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
export declare const WrapperLast: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
7
|
+
export declare const Item: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "color"> & DefaultItemProps, never>> & string;
|
|
8
|
+
export declare const LastItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "color"> & DefaultItemProps, never>> & string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import styled_components from "styled-components";
|
|
2
|
+
import { COLOR_NEUTRAL_DARKER, COLOR_NEUTRAL_DUSK, FONT_FAMILY_01, FONT_WEIGHT_MEDIUM } from "@ftdata/f-tokens";
|
|
3
|
+
const BreadcrumbContainer = styled_components.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
height: 2rem;
|
|
7
|
+
`;
|
|
8
|
+
const DefaultItem = styled_components.span`
|
|
9
|
+
font-family: ${FONT_FAMILY_01};
|
|
10
|
+
font-weight: ${FONT_WEIGHT_MEDIUM};
|
|
11
|
+
line-height: 1.125rem;
|
|
12
|
+
font-size: 0.75rem;
|
|
13
|
+
`;
|
|
14
|
+
const Wrapper = styled_components.div`
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
display: flex;
|
|
17
|
+
|
|
18
|
+
span {
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
display: flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.breadcrumb-dash {
|
|
24
|
+
cursor: default;
|
|
25
|
+
padding: 0 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
const WrapperLast = styled_components(Wrapper)`
|
|
29
|
+
cursor: text;
|
|
30
|
+
`;
|
|
31
|
+
const Item = styled_components(DefaultItem)`
|
|
32
|
+
color: ${({ color })=>color ? color : COLOR_NEUTRAL_DARKER};
|
|
33
|
+
transition: 0.2s ease color;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
opacity: ${({ color })=>color ? "0.8" : "1"};
|
|
36
|
+
`;
|
|
37
|
+
const LastItem = styled_components(DefaultItem)`
|
|
38
|
+
color: ${({ color })=>color ? color : COLOR_NEUTRAL_DUSK};
|
|
39
|
+
transition: 0.2s ease color;
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
`;
|
|
43
|
+
export { BreadcrumbContainer, Item, LastItem, Wrapper, WrapperLast };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Button from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Botões são usados para disparar ações dentro da aplicação.
|
|
5
|
+
* Este componente também funciona com os atributos nativos de um HTML button element.
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof Button>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
/**
|
|
11
|
+
* Variação padrão do Button quando apenas as propriedades obrigatórias são fornecidas.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Variante 'primary' do Button: Essa configuração altera o esquema de cores para destacar o Button como a principal chamada para ação.
|
|
16
|
+
* Botões primários são usados para chamar atenção e indicar a ação mais importante em uma página, incentivando os usuários a clicar.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Primary: Story;
|
|
19
|
+
/**
|
|
20
|
+
* Variante 'secondary' do Button: Essa configuração modifica o esquema de cores para identificar o Button como uma chamada para ação secundária.
|
|
21
|
+
* Botões secundários são usados para sinalizar a segunda ação mais importante em uma página,
|
|
22
|
+
* oferecendo uma opção alternativa aos usuários sem ofuscar a ação primária.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Secondary: Story;
|
|
25
|
+
/**
|
|
26
|
+
* Variante 'ghost' do Button: Geralmente utilizada para criar um ponto focal sem sobrecarregar o layout, mantendo a interface limpa e simples.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Ghost: Story;
|
|
29
|
+
/**
|
|
30
|
+
* Variante do Button quando está desativado para o usuário.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Disabled: Story;
|
|
33
|
+
/**
|
|
34
|
+
* Variante 'wide' do Button: Essa configuração habilita que o Button ocupe toda a largura disponível do seu componente pai.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Wide: Story;
|
|
37
|
+
/**
|
|
38
|
+
* Variante do Button com ícone personalizado à direita.
|
|
39
|
+
* ###### Observação: O ícone apresentado neste exemplo é utilizado apenas para fins ilustrativos e não representa necessariamente a funcionalidade ou o design final do componente.
|
|
40
|
+
*/
|
|
41
|
+
export declare const RightIcon: Story;
|
|
42
|
+
/**
|
|
43
|
+
* Variante do Button com ícone personalizado à esquerda.
|
|
44
|
+
* ###### Observação: O ícone apresentado neste exemplo é utilizado apenas para fins ilustrativos e não representa necessariamente a funcionalidade ou o design final do componente.
|
|
45
|
+
*/
|
|
46
|
+
export declare const LeftIcon: Story;
|
|
47
|
+
/**
|
|
48
|
+
* Variante do Button em carregamento.
|
|
49
|
+
*/
|
|
50
|
+
export declare const Loading: Story;
|
|
51
|
+
/**
|
|
52
|
+
* Variante do Button com múltiplas ações.
|
|
53
|
+
*/
|
|
54
|
+
export declare const Select: Story;
|
|
55
|
+
/**
|
|
56
|
+
* Essa variante define um tamanho menor para o Button, tornando-o ideal para espaços limitados.
|
|
57
|
+
*/
|
|
58
|
+
export declare const Small: Story;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import index from "./index.js";
|
|
3
|
+
import { SelectButton } from "./styles.js";
|
|
4
|
+
import { Icon } from "@ftdata/f-icons";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "DESIGN COMPONENTS/Button",
|
|
7
|
+
component: index,
|
|
8
|
+
tags: [
|
|
9
|
+
"autodocs"
|
|
10
|
+
],
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: "centered",
|
|
13
|
+
actions: {
|
|
14
|
+
handles: [
|
|
15
|
+
"mouseover",
|
|
16
|
+
"click .btn"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
decorators: [
|
|
21
|
+
(Story)=>/*#__PURE__*/ jsx("div", {
|
|
22
|
+
style: {
|
|
23
|
+
width: "300px",
|
|
24
|
+
display: "flex",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
alignItems: "center"
|
|
27
|
+
},
|
|
28
|
+
children: /*#__PURE__*/ jsx(Story, {})
|
|
29
|
+
})
|
|
30
|
+
],
|
|
31
|
+
args: {
|
|
32
|
+
onClick: ()=>"click - clicou no bot\xe3o"
|
|
33
|
+
},
|
|
34
|
+
argTypes: {
|
|
35
|
+
children: {
|
|
36
|
+
control: {
|
|
37
|
+
type: "text"
|
|
38
|
+
},
|
|
39
|
+
description: `Aceita conte\xfado personalizado dentro do Button, como texto, \xedcones ou outros elementos visuais.
|
|
40
|
+
Especifica o que ser\xe1 exibido ao usu\xe1rio no Button.`,
|
|
41
|
+
mapping: {
|
|
42
|
+
text: "label"
|
|
43
|
+
},
|
|
44
|
+
table: {
|
|
45
|
+
type: {
|
|
46
|
+
summary: "ReactNode"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
options: [
|
|
50
|
+
"text"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
CustomDropdown: {
|
|
54
|
+
control: {
|
|
55
|
+
type: "select"
|
|
56
|
+
},
|
|
57
|
+
description: "Children personalizado para o dropdown, quando a propriedade 'select' \xe9 verdadeira.",
|
|
58
|
+
options: [
|
|
59
|
+
"none",
|
|
60
|
+
"text"
|
|
61
|
+
],
|
|
62
|
+
mapping: {
|
|
63
|
+
none: null,
|
|
64
|
+
text: ()=>/*#__PURE__*/ jsxs(Fragment, {
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ jsx(SelectButton, {
|
|
67
|
+
onClick: ()=>console.log("action 1"),
|
|
68
|
+
children: "Action 1"
|
|
69
|
+
}, 1),
|
|
70
|
+
/*#__PURE__*/ jsx(SelectButton, {
|
|
71
|
+
onClick: ()=>console.log("action 2"),
|
|
72
|
+
children: "Action 2"
|
|
73
|
+
}, 2)
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
},
|
|
77
|
+
table: {
|
|
78
|
+
type: {
|
|
79
|
+
summary: "ReactFunctionComponent"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
variant: {
|
|
84
|
+
control: "inline-radio",
|
|
85
|
+
description: "Define a varia\xe7\xe3o de tema de de cores do Button.",
|
|
86
|
+
table: {
|
|
87
|
+
type: {
|
|
88
|
+
summary: '"primary" | "secondary" | "ghost"'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
disabled: {
|
|
93
|
+
description: "Define se o Button est\xe1 desabilitado.",
|
|
94
|
+
table: {
|
|
95
|
+
defaultValue: {
|
|
96
|
+
summary: "false"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
onClick: {
|
|
101
|
+
control: false,
|
|
102
|
+
description: "Aceita uma fun\xe7\xe3o que \xe9 disparada quando o Button \xe9 clicado.",
|
|
103
|
+
table: {
|
|
104
|
+
type: {
|
|
105
|
+
summary: "() => any"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
wide: {
|
|
110
|
+
description: "Faz com que o Button ocupe toda a largura dispon\xedvel dentro do seu cont\xeainer pai.",
|
|
111
|
+
table: {
|
|
112
|
+
defaultValue: {
|
|
113
|
+
summary: "false"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
LeftIcon: {
|
|
118
|
+
control: {
|
|
119
|
+
type: "select"
|
|
120
|
+
},
|
|
121
|
+
description: "Define o \xedcone do Button \xe0 esquerda.",
|
|
122
|
+
mapping: {
|
|
123
|
+
none: null,
|
|
124
|
+
"example 1": /*#__PURE__*/ jsx(Icon, {
|
|
125
|
+
name: "nav pin-location"
|
|
126
|
+
}),
|
|
127
|
+
"example 2": /*#__PURE__*/ jsx(Icon, {
|
|
128
|
+
name: "arw caret-right"
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
options: [
|
|
132
|
+
"none",
|
|
133
|
+
"example 1",
|
|
134
|
+
"example 2"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
RightIcon: {
|
|
138
|
+
control: {
|
|
139
|
+
type: "select"
|
|
140
|
+
},
|
|
141
|
+
description: "Define o \xedcone do Button \xe0 direita. ArrowDown Icon \xe9 definido por padr\xe3o, caso o dropdown menu estiver habilitado.",
|
|
142
|
+
mapping: {
|
|
143
|
+
none: null,
|
|
144
|
+
"example 1": /*#__PURE__*/ jsx(Icon, {
|
|
145
|
+
name: "nav pin-location"
|
|
146
|
+
}),
|
|
147
|
+
"example 2": /*#__PURE__*/ jsx(Icon, {
|
|
148
|
+
name: "arw caret-right"
|
|
149
|
+
})
|
|
150
|
+
},
|
|
151
|
+
options: [
|
|
152
|
+
"none",
|
|
153
|
+
"example 1",
|
|
154
|
+
"example 2"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
loading: {
|
|
158
|
+
description: "Define se o Button est\xe1 carregando."
|
|
159
|
+
},
|
|
160
|
+
options: {
|
|
161
|
+
description: "Define os bot\xf5es do dropdown menu."
|
|
162
|
+
},
|
|
163
|
+
select: {
|
|
164
|
+
description: "Define se o Button \xe9 um bot\xe3o de dropdown menu."
|
|
165
|
+
},
|
|
166
|
+
small: {
|
|
167
|
+
description: "Reduz o tamanho do Button, incluindo o texto e o \xedcone, caso estejam presentes."
|
|
168
|
+
},
|
|
169
|
+
type: {
|
|
170
|
+
control: "inline-radio",
|
|
171
|
+
description: "Define o tipo do Button.",
|
|
172
|
+
table: {
|
|
173
|
+
type: {
|
|
174
|
+
summary: '"button" | "submit" | "reset"'
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const Button_stories = meta;
|
|
181
|
+
const Default = {
|
|
182
|
+
args: {
|
|
183
|
+
variant: "primary",
|
|
184
|
+
children: "Default"
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const Primary = {
|
|
188
|
+
args: {
|
|
189
|
+
variant: "primary",
|
|
190
|
+
children: "Primary"
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
const Secondary = {
|
|
194
|
+
args: {
|
|
195
|
+
variant: "secondary",
|
|
196
|
+
children: "Secondary"
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const Ghost = {
|
|
200
|
+
args: {
|
|
201
|
+
variant: "ghost",
|
|
202
|
+
children: "Ghost"
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const Disabled = {
|
|
206
|
+
args: {
|
|
207
|
+
variant: "primary",
|
|
208
|
+
children: "Disabled",
|
|
209
|
+
disabled: true
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const Wide = {
|
|
213
|
+
args: {
|
|
214
|
+
variant: "primary",
|
|
215
|
+
children: "Wide",
|
|
216
|
+
wide: true
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
const RightIcon = {
|
|
220
|
+
args: {
|
|
221
|
+
variant: "primary",
|
|
222
|
+
children: "Right Icon",
|
|
223
|
+
RightIcon: ()=>/*#__PURE__*/ jsx(Icon, {
|
|
224
|
+
name: "nav pin-location"
|
|
225
|
+
})
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const LeftIcon = {
|
|
229
|
+
args: {
|
|
230
|
+
variant: "primary",
|
|
231
|
+
children: "Left Icon",
|
|
232
|
+
LeftIcon: ()=>/*#__PURE__*/ jsx(Icon, {
|
|
233
|
+
name: "nav pin-location"
|
|
234
|
+
})
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
const Loading = {
|
|
238
|
+
args: {
|
|
239
|
+
variant: "primary",
|
|
240
|
+
children: "Loading",
|
|
241
|
+
loading: true
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
const Select = {
|
|
245
|
+
args: {
|
|
246
|
+
variant: "primary",
|
|
247
|
+
children: "Select",
|
|
248
|
+
options: [
|
|
249
|
+
{
|
|
250
|
+
label: "A\xe7\xe3o 1",
|
|
251
|
+
action: ()=>"click - clicou na a\xe7\xe3o 1"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
label: "A\xe7\xe3o 2",
|
|
255
|
+
action: ()=>"click - clicou na a\xe7\xe3o 2"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
label: "A\xe7\xe3o 3",
|
|
259
|
+
action: ()=>"click - clicou na a\xe7\xe3o 3"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
label: "A\xe7\xe3o 4",
|
|
263
|
+
action: ()=>"click - clicou na a\xe7\xe3o 4"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
select: true
|
|
267
|
+
},
|
|
268
|
+
decorators: [
|
|
269
|
+
(Story)=>/*#__PURE__*/ jsx("div", {
|
|
270
|
+
style: {
|
|
271
|
+
height: "200px"
|
|
272
|
+
},
|
|
273
|
+
children: /*#__PURE__*/ jsx(Story, {})
|
|
274
|
+
})
|
|
275
|
+
]
|
|
276
|
+
};
|
|
277
|
+
const Small = {
|
|
278
|
+
args: {
|
|
279
|
+
variant: "primary",
|
|
280
|
+
children: "Small",
|
|
281
|
+
small: true
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
export { Default, Disabled, Ghost, LeftIcon, Loading, Primary, RightIcon, Secondary, Select, Small, Wide, Button_stories as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MouseEventHandler as ReactMouseEventHandler, JSX } from "react";
|
|
2
|
+
type DropdownOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
action: ReactMouseEventHandler<HTMLDivElement>;
|
|
5
|
+
};
|
|
6
|
+
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
CustomDropdown?: () => JSX.Element;
|
|
9
|
+
variant: "primary" | "secondary" | "ghost";
|
|
10
|
+
wide?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
LeftIcon?: React.FunctionComponent<React.SVGProps<SVGSVGElement> & {
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
RightIcon?: React.FunctionComponent<React.SVGProps<SVGSVGElement> & {
|
|
16
|
+
title?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
onClick?: ReactMouseEventHandler<HTMLButtonElement>;
|
|
20
|
+
options?: Array<DropdownOption>;
|
|
21
|
+
select?: boolean;
|
|
22
|
+
small?: boolean;
|
|
23
|
+
type?: "button" | "submit" | "reset";
|
|
24
|
+
}
|
|
25
|
+
declare const Button: React.FC<ButtonProps>;
|
|
26
|
+
export default Button;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { ButtonWrapper, Dropdown, SelectButton, Spinner } from "./styles.js";
|
|
4
|
+
import { Icon } from "@ftdata/f-icons";
|
|
5
|
+
const Button = ({ children, CustomDropdown, disabled, variant, wide, LeftIcon, RightIcon, loading, onClick: buttonAction, options, select, small, type, ...rest })=>{
|
|
6
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
+
const buttonRef = useRef(null);
|
|
8
|
+
useLayoutEffect(()=>{
|
|
9
|
+
const handleClickOutside = (e)=>{
|
|
10
|
+
if (buttonRef.current && !buttonRef.current.contains(e.target)) setIsOpen(false);
|
|
11
|
+
};
|
|
12
|
+
document.addEventListener("click", handleClickOutside);
|
|
13
|
+
return ()=>{
|
|
14
|
+
document.removeEventListener("click", handleClickOutside);
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
const buttonHandler = (e)=>{
|
|
18
|
+
if (disabled || loading) return;
|
|
19
|
+
if (select) return void setIsOpen(!isOpen);
|
|
20
|
+
if (buttonAction) buttonAction(e);
|
|
21
|
+
};
|
|
22
|
+
const LoadingTheme = {
|
|
23
|
+
primary: "dark",
|
|
24
|
+
secondary: "light",
|
|
25
|
+
ghost: "light"
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/ jsxs(ButtonWrapper, {
|
|
28
|
+
disabled: disabled,
|
|
29
|
+
open: isOpen,
|
|
30
|
+
onClick: buttonHandler,
|
|
31
|
+
ref: buttonRef,
|
|
32
|
+
small: small,
|
|
33
|
+
variant: variant,
|
|
34
|
+
wide: wide,
|
|
35
|
+
type: type,
|
|
36
|
+
...rest,
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ jsxs(Fragment, {
|
|
39
|
+
children: [
|
|
40
|
+
LeftIcon && /*#__PURE__*/ jsx(LeftIcon, {
|
|
41
|
+
viewBox: "0 0 24 24"
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ jsx("span", {
|
|
44
|
+
children: children
|
|
45
|
+
}),
|
|
46
|
+
select && !RightIcon && /*#__PURE__*/ jsx(Icon, {
|
|
47
|
+
name: "arw caret-down"
|
|
48
|
+
}),
|
|
49
|
+
RightIcon && /*#__PURE__*/ jsx(RightIcon, {}),
|
|
50
|
+
select && isOpen && !CustomDropdown && /*#__PURE__*/ jsx(Dropdown, {
|
|
51
|
+
children: options && options.map(({ action, label }, index)=>/*#__PURE__*/ jsx(SelectButton, {
|
|
52
|
+
onClick: action,
|
|
53
|
+
children: label
|
|
54
|
+
}, index))
|
|
55
|
+
}),
|
|
56
|
+
select && isOpen && CustomDropdown && /*#__PURE__*/ jsx(Dropdown, {
|
|
57
|
+
children: /*#__PURE__*/ jsx(CustomDropdown, {})
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
}),
|
|
61
|
+
loading && /*#__PURE__*/ jsx(Spinner, {
|
|
62
|
+
size: "sm",
|
|
63
|
+
variant: LoadingTheme[variant]
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const components_Button = Button;
|
|
69
|
+
export { components_Button as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { COLOR_BRAND_MEDIUM, COLOR_NEUTRAL_DARKER, COLOR_NEUTRAL_DAY, COLOR_NEUTRAL_LIGHTER, COLOR_NEUTRAL_MEDIUM, FONT_SIZE_SM, IC_SIZE_SMALL, LINE_HEIGHT_TIGHT, OPACITY_LEVEL_MEDIUM } from "@ftdata/f-tokens";
|
|
2
|
+
const BUTTON_MODIFIERS = {
|
|
3
|
+
primary: `
|
|
4
|
+
background-color: ${COLOR_BRAND_MEDIUM};
|
|
5
|
+
color: ${COLOR_NEUTRAL_DAY};
|
|
6
|
+
|
|
7
|
+
&:disabled {
|
|
8
|
+
opacity: ${OPACITY_LEVEL_MEDIUM};
|
|
9
|
+
}
|
|
10
|
+
`,
|
|
11
|
+
secondary: `
|
|
12
|
+
background-color: ${COLOR_NEUTRAL_LIGHTER};
|
|
13
|
+
color: ${COLOR_NEUTRAL_DARKER};
|
|
14
|
+
|
|
15
|
+
&:disabled {
|
|
16
|
+
color: ${COLOR_NEUTRAL_MEDIUM};
|
|
17
|
+
}
|
|
18
|
+
`,
|
|
19
|
+
ghost: `
|
|
20
|
+
background-color: transparent;
|
|
21
|
+
color: ${COLOR_NEUTRAL_DARKER};
|
|
22
|
+
|
|
23
|
+
&:disabled {
|
|
24
|
+
color: ${COLOR_NEUTRAL_MEDIUM};
|
|
25
|
+
}
|
|
26
|
+
`,
|
|
27
|
+
wide: `
|
|
28
|
+
flex: 1;
|
|
29
|
+
width: 100%;
|
|
30
|
+
`,
|
|
31
|
+
small: `
|
|
32
|
+
font-size: ${FONT_SIZE_SM};
|
|
33
|
+
line-height: ${LINE_HEIGHT_TIGHT};
|
|
34
|
+
|
|
35
|
+
svg {
|
|
36
|
+
height: ${IC_SIZE_SMALL};
|
|
37
|
+
width: ${IC_SIZE_SMALL};
|
|
38
|
+
}
|
|
39
|
+
`
|
|
40
|
+
};
|
|
41
|
+
export { BUTTON_MODIFIERS };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MouseEventHandler } from "react";
|
|
2
|
+
type ButtonProps = {
|
|
3
|
+
variant: "primary" | "secondary" | "ghost";
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
wide?: boolean;
|
|
7
|
+
small?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const ButtonWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, ButtonProps>> & string;
|
|
10
|
+
export declare const Dropdown: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
type SelectButtonProps = {
|
|
12
|
+
onClick: MouseEventHandler<HTMLDivElement>;
|
|
13
|
+
};
|
|
14
|
+
export declare const SelectButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, SelectButtonProps>> & string;
|
|
15
|
+
type SpinnerProps = {
|
|
16
|
+
variant: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const Spinner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement> | keyof {
|
|
19
|
+
variant: "dark" | "light";
|
|
20
|
+
size: "sm" | "md" | "lg" | "xl";
|
|
21
|
+
}> & {
|
|
22
|
+
variant: "dark" | "light";
|
|
23
|
+
size: "sm" | "md" | "lg" | "xl";
|
|
24
|
+
} & import("react").HTMLAttributes<HTMLDivElement>, SpinnerProps>> & string;
|
|
25
|
+
export {};
|