@vectara/vectara-ui 0.0.2
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/.github/workflows/deploy-pages-site.yml +26 -0
- package/.github/workflows/deploy-pr-preview.yml +25 -0
- package/CHANGELOG.md +13 -0
- package/NO_LICENSE +3 -0
- package/lib/components/accordion/Accordion.d.ts +8 -0
- package/lib/components/accordion/Accordion.js +27 -0
- package/lib/components/accordion/_index.scss +23 -0
- package/lib/components/accountMenu/AccountMenu.d.ts +13 -0
- package/lib/components/accountMenu/AccountMenu.js +7 -0
- package/lib/components/accountMenu/_index.scss +20 -0
- package/lib/components/app/AppContent.d.ts +9 -0
- package/lib/components/app/AppContent.js +28 -0
- package/lib/components/app/AppHeader.d.ts +7 -0
- package/lib/components/app/AppHeader.js +18 -0
- package/lib/components/app/AppLayout.d.ts +9 -0
- package/lib/components/app/AppLayout.js +10 -0
- package/lib/components/app/_index.scss +4 -0
- package/lib/components/app/appContent.scss +26 -0
- package/lib/components/app/appHeader.scss +15 -0
- package/lib/components/app/appLayout.scss +23 -0
- package/lib/components/app/appSideNav/AppSideNav.d.ts +7 -0
- package/lib/components/app/appSideNav/AppSideNav.js +46 -0
- package/lib/components/app/appSideNav/AppSideNavLink.d.ts +4 -0
- package/lib/components/app/appSideNav/AppSideNavLink.js +26 -0
- package/lib/components/app/appSideNav/AppSideNavSections.d.ts +2 -0
- package/lib/components/app/appSideNav/AppSideNavSections.js +11 -0
- package/lib/components/app/appSideNav/AppSideNavTree.d.ts +2 -0
- package/lib/components/app/appSideNav/AppSideNavTree.js +38 -0
- package/lib/components/app/appSideNav/_index.scss +17 -0
- package/lib/components/app/appSideNav/appSideNav.scss +75 -0
- package/lib/components/app/appSideNav/appSideNavSections.scss +33 -0
- package/lib/components/app/appSideNav/appSideNavTree.scss +25 -0
- package/lib/components/app/types.d.ts +21 -0
- package/lib/components/app/types.js +1 -0
- package/lib/components/badge/Badge.d.ts +14 -0
- package/lib/components/badge/Badge.js +33 -0
- package/lib/components/badge/_index.scss +64 -0
- package/lib/components/button/BaseButton.d.ts +28 -0
- package/lib/components/button/BaseButton.js +65 -0
- package/lib/components/button/ButtonPrimary.d.ts +8 -0
- package/lib/components/button/ButtonPrimary.js +42 -0
- package/lib/components/button/ButtonSecondary.d.ts +10 -0
- package/lib/components/button/ButtonSecondary.js +43 -0
- package/lib/components/button/ButtonTertiary.d.ts +10 -0
- package/lib/components/button/ButtonTertiary.js +43 -0
- package/lib/components/button/IconButton.d.ts +16 -0
- package/lib/components/button/IconButton.js +29 -0
- package/lib/components/button/_index.scss +5 -0
- package/lib/components/button/baseButton.scss +94 -0
- package/lib/components/button/buttonPrimary.scss +51 -0
- package/lib/components/button/buttonSecondary.scss +54 -0
- package/lib/components/button/buttonTertiary.scss +56 -0
- package/lib/components/button/createButtonIcon.d.ts +3 -0
- package/lib/components/button/createButtonIcon.js +24 -0
- package/lib/components/button/iconButton.scss +44 -0
- package/lib/components/button/types.d.ts +3 -0
- package/lib/components/button/types.js +2 -0
- package/lib/components/callout/Callout.d.ts +13 -0
- package/lib/components/callout/Callout.js +40 -0
- package/lib/components/callout/_index.scss +49 -0
- package/lib/components/callout/types.d.ts +3 -0
- package/lib/components/callout/types.js +2 -0
- package/lib/components/card/Card.d.ts +14 -0
- package/lib/components/card/Card.js +29 -0
- package/lib/components/card/_index.scss +114 -0
- package/lib/components/chat/Chat.d.ts +17 -0
- package/lib/components/chat/Chat.js +130 -0
- package/lib/components/chat/ChatInspector.d.ts +7 -0
- package/lib/components/chat/ChatInspector.js +12 -0
- package/lib/components/chat/ChatPanel.d.ts +7 -0
- package/lib/components/chat/ChatPanel.js +11 -0
- package/lib/components/chat/ChatSearchResult.d.ts +16 -0
- package/lib/components/chat/ChatSearchResult.js +26 -0
- package/lib/components/chat/ChatTurn.d.ts +9 -0
- package/lib/components/chat/ChatTurn.js +19 -0
- package/lib/components/chat/_index.scss +150 -0
- package/lib/components/chat/chatTurn.scss +38 -0
- package/lib/components/chat/types.d.ts +17 -0
- package/lib/components/chat/types.js +19 -0
- package/lib/components/code/Code.d.ts +17 -0
- package/lib/components/code/Code.js +44 -0
- package/lib/components/code/_index.scss +33 -0
- package/lib/components/code/types.d.ts +1 -0
- package/lib/components/code/types.js +1 -0
- package/lib/components/context/Context.d.ts +18 -0
- package/lib/components/context/Context.js +34 -0
- package/lib/components/context/Context.test.util.d.ts +2 -0
- package/lib/components/context/Context.test.util.js +22 -0
- package/lib/components/copyButton/CopyButton.d.ts +10 -0
- package/lib/components/copyButton/CopyButton.js +50 -0
- package/lib/components/drawer/Drawer.d.ts +13 -0
- package/lib/components/drawer/Drawer.js +53 -0
- package/lib/components/drawer/_index.scss +73 -0
- package/lib/components/flex/FlexContainer.d.ts +36 -0
- package/lib/components/flex/FlexContainer.js +53 -0
- package/lib/components/flex/FlexItem.d.ts +22 -0
- package/lib/components/flex/FlexItem.js +36 -0
- package/lib/components/flex/_flexContainer.scss +79 -0
- package/lib/components/flex/_flexItem.scss +64 -0
- package/lib/components/flex/_index.scss +2 -0
- package/lib/components/flex/types.d.ts +2 -0
- package/lib/components/flex/types.js +1 -0
- package/lib/components/form/_index.scss +7 -0
- package/lib/components/form/checkbox/Checkbox.d.ts +8 -0
- package/lib/components/form/checkbox/Checkbox.js +24 -0
- package/lib/components/form/checkbox/_index.scss +3 -0
- package/lib/components/form/index.d.ts +10 -0
- package/lib/components/form/index.js +9 -0
- package/lib/components/form/input/BasicInput.d.ts +15 -0
- package/lib/components/form/input/BasicInput.js +30 -0
- package/lib/components/form/input/NumberInput.d.ts +8 -0
- package/lib/components/form/input/NumberInput.js +61 -0
- package/lib/components/form/input/PasswordInput.d.ts +7 -0
- package/lib/components/form/input/PasswordInput.js +21 -0
- package/lib/components/form/input/TextInput.d.ts +6 -0
- package/lib/components/form/input/TextInput.js +21 -0
- package/lib/components/form/input/_index.scss +24 -0
- package/lib/components/form/label/Label.d.ts +7 -0
- package/lib/components/form/label/Label.js +18 -0
- package/lib/components/form/label/_index.scss +5 -0
- package/lib/components/form/radioButton/RadioButton.d.ts +9 -0
- package/lib/components/form/radioButton/RadioButton.js +24 -0
- package/lib/components/form/radioButton/_index.scss +3 -0
- package/lib/components/form/select/Select.d.ts +17 -0
- package/lib/components/form/select/Select.js +34 -0
- package/lib/components/form/select/_index.scss +56 -0
- package/lib/components/form/superRadioGroup/SuperRadioButton.d.ts +7 -0
- package/lib/components/form/superRadioGroup/SuperRadioButton.js +22 -0
- package/lib/components/form/superRadioGroup/SuperRadioGroup.d.ts +8 -0
- package/lib/components/form/superRadioGroup/SuperRadioGroup.js +6 -0
- package/lib/components/form/superRadioGroup/_index.scss +31 -0
- package/lib/components/form/superRadioGroup/types.d.ts +8 -0
- package/lib/components/form/superRadioGroup/types.js +1 -0
- package/lib/components/form/textArea/TextArea.d.ts +12 -0
- package/lib/components/form/textArea/TextArea.js +21 -0
- package/lib/components/form/textArea/_index.scss +14 -0
- package/lib/components/formGroup/FormGroup.d.ts +10 -0
- package/lib/components/formGroup/FormGroup.js +27 -0
- package/lib/components/grid/Grid.d.ts +12 -0
- package/lib/components/grid/Grid.js +20 -0
- package/lib/components/grid/_index.scss +51 -0
- package/lib/components/horizontalRule/HorizontalRule.d.ts +6 -0
- package/lib/components/horizontalRule/HorizontalRule.js +4 -0
- package/lib/components/horizontalRule/_index.scss +40 -0
- package/lib/components/icon/Icon.d.ts +11 -0
- package/lib/components/icon/Icon.js +37 -0
- package/lib/components/icon/_index.scss +25 -0
- package/lib/components/icon/types.d.ts +2 -0
- package/lib/components/icon/types.js +12 -0
- package/lib/components/index.d.ts +75 -0
- package/lib/components/index.js +67 -0
- package/lib/components/infoTable/InfoTable.d.ts +24 -0
- package/lib/components/infoTable/InfoTable.js +24 -0
- package/lib/components/infoTable/_index.scss +53 -0
- package/lib/components/link/Link.d.ts +3 -0
- package/lib/components/link/Link.js +36 -0
- package/lib/components/link/Link.test.d.ts +1 -0
- package/lib/components/link/Link.test.js +40 -0
- package/lib/components/link/_index.scss +17 -0
- package/lib/components/link/types.d.ts +15 -0
- package/lib/components/link/types.js +1 -0
- package/lib/components/list/List.d.ts +12 -0
- package/lib/components/list/List.js +15 -0
- package/lib/components/list/_index.scss +29 -0
- package/lib/components/menu/Menu.d.ts +7 -0
- package/lib/components/menu/Menu.js +6 -0
- package/lib/components/menu/MenuItem.d.ts +10 -0
- package/lib/components/menu/MenuItem.js +31 -0
- package/lib/components/menu/_index.scss +75 -0
- package/lib/components/modal/Modal.d.ts +13 -0
- package/lib/components/modal/Modal.js +53 -0
- package/lib/components/modal/_index.scss +85 -0
- package/lib/components/notification/Notification.d.ts +12 -0
- package/lib/components/notification/Notification.js +23 -0
- package/lib/components/notification/Notifications.d.ts +10 -0
- package/lib/components/notification/Notifications.js +35 -0
- package/lib/components/notification/_index.scss +99 -0
- package/lib/components/optionsButton/OptionsButton.d.ts +7 -0
- package/lib/components/optionsButton/OptionsButton.js +25 -0
- package/lib/components/optionsButton/_index.scss +42 -0
- package/lib/components/optionsList/OptionsList.d.ts +13 -0
- package/lib/components/optionsList/OptionsList.js +31 -0
- package/lib/components/optionsList/OptionsListItem.d.ts +10 -0
- package/lib/components/optionsList/OptionsListItem.js +41 -0
- package/lib/components/optionsList/_index.scss +84 -0
- package/lib/components/optionsList/types.d.ts +13 -0
- package/lib/components/optionsList/types.js +1 -0
- package/lib/components/popover/Popover.d.ts +11 -0
- package/lib/components/popover/Popover.js +91 -0
- package/lib/components/popover/_index.scss +29 -0
- package/lib/components/portal/Portal.d.ts +6 -0
- package/lib/components/portal/Portal.js +16 -0
- package/lib/components/progressBar/ProgressBar.d.ts +9 -0
- package/lib/components/progressBar/ProgressBar.js +26 -0
- package/lib/components/progressBar/_index.scss +63 -0
- package/lib/components/prompt/Prompt.d.ts +20 -0
- package/lib/components/prompt/Prompt.js +19 -0
- package/lib/components/prompt/_index.scss +70 -0
- package/lib/components/screenBlock/ScreenBlock.d.ts +6 -0
- package/lib/components/screenBlock/ScreenBlock.js +4 -0
- package/lib/components/screenBlock/_index.scss +17 -0
- package/lib/components/searchInput/SearchInput.d.ts +13 -0
- package/lib/components/searchInput/SearchInput.js +19 -0
- package/lib/components/searchInput/_index.scss +49 -0
- package/lib/components/searchResult/SearchResult.d.ts +21 -0
- package/lib/components/searchResult/SearchResult.js +33 -0
- package/lib/components/searchResult/SearchResult.test.d.ts +1 -0
- package/lib/components/searchResult/SearchResult.test.js +280 -0
- package/lib/components/searchResult/_index.scss +29 -0
- package/lib/components/searchSelect/SearchSelect.d.ts +11 -0
- package/lib/components/searchSelect/SearchSelect.js +78 -0
- package/lib/components/searchSelect/_index.scss +13 -0
- package/lib/components/setting/Setting.d.ts +12 -0
- package/lib/components/setting/Setting.js +24 -0
- package/lib/components/spacer/Spacer.d.ts +6 -0
- package/lib/components/spacer/Spacer.js +6 -0
- package/lib/components/spacer/_index.scss +20 -0
- package/lib/components/spacer/types.d.ts +1 -0
- package/lib/components/spacer/types.js +1 -0
- package/lib/components/spinner/Spinner.d.ts +7 -0
- package/lib/components/spinner/Spinner.js +15 -0
- package/lib/components/spinner/_index.scss +52 -0
- package/lib/components/spinner/types.d.ts +3 -0
- package/lib/components/spinner/types.js +2 -0
- package/lib/components/statList/StatList.d.ts +9 -0
- package/lib/components/statList/StatList.js +15 -0
- package/lib/components/statList/_index.scss +3 -0
- package/lib/components/status/Status.d.ts +6 -0
- package/lib/components/status/Status.js +24 -0
- package/lib/components/summary/Summary.d.ts +7 -0
- package/lib/components/summary/Summary.js +43 -0
- package/lib/components/summary/Summary.test.d.ts +1 -0
- package/lib/components/summary/Summary.test.js +544 -0
- package/lib/components/summary/SummaryCitation.d.ts +8 -0
- package/lib/components/summary/SummaryCitation.js +20 -0
- package/lib/components/summary/_index.scss +29 -0
- package/lib/components/table/Table.d.ts +44 -0
- package/lib/components/table/Table.js +117 -0
- package/lib/components/table/TableBulkActions.d.ts +7 -0
- package/lib/components/table/TableBulkActions.js +34 -0
- package/lib/components/table/TableCell.d.ts +5 -0
- package/lib/components/table/TableCell.js +4 -0
- package/lib/components/table/TableContent.d.ts +6 -0
- package/lib/components/table/TableContent.js +6 -0
- package/lib/components/table/TableHeaderCell.d.ts +9 -0
- package/lib/components/table/TableHeaderCell.js +8 -0
- package/lib/components/table/TablePager.d.ts +9 -0
- package/lib/components/table/TablePager.js +9 -0
- package/lib/components/table/TablePagination.d.ts +10 -0
- package/lib/components/table/TablePagination.js +18 -0
- package/lib/components/table/TableRowActions.d.ts +15 -0
- package/lib/components/table/TableRowActions.js +29 -0
- package/lib/components/table/_index.scss +70 -0
- package/lib/components/table/createPagination.d.ts +4 -0
- package/lib/components/table/createPagination.js +44 -0
- package/lib/components/table/createPagination.test.d.ts +1 -0
- package/lib/components/table/createPagination.test.js +32 -0
- package/lib/components/table/types.d.ts +1 -0
- package/lib/components/table/types.js +1 -0
- package/lib/components/tabs/Tab.d.ts +9 -0
- package/lib/components/tabs/Tab.js +27 -0
- package/lib/components/tabs/TabbedRoutes.d.ts +15 -0
- package/lib/components/tabs/TabbedRoutes.js +15 -0
- package/lib/components/tabs/Tabs.d.ts +10 -0
- package/lib/components/tabs/Tabs.js +8 -0
- package/lib/components/tabs/_index.scss +103 -0
- package/lib/components/tabs/types.d.ts +2 -0
- package/lib/components/tabs/types.js +1 -0
- package/lib/components/toggle/Toggle.d.ts +8 -0
- package/lib/components/toggle/Toggle.js +25 -0
- package/lib/components/toggle/_index.scss +55 -0
- package/lib/components/topicButton/TopicButton.d.ts +10 -0
- package/lib/components/topicButton/TopicButton.js +30 -0
- package/lib/components/topicButton/_index.scss +21 -0
- package/lib/components/typography/Text.d.ts +13 -0
- package/lib/components/typography/Text.js +24 -0
- package/lib/components/typography/TextColor.d.ts +9 -0
- package/lib/components/typography/TextColor.js +6 -0
- package/lib/components/typography/Title.d.ts +11 -0
- package/lib/components/typography/Title.js +20 -0
- package/lib/components/typography/_index.scss +3 -0
- package/lib/components/typography/_text.scss +150 -0
- package/lib/components/typography/_textColor.scss +15 -0
- package/lib/components/typography/_title.scss +68 -0
- package/lib/components/typography/types.d.ts +4 -0
- package/lib/components/typography/types.js +3 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/sassUtils/_animation.scss +1 -0
- package/lib/sassUtils/_app.scss +1 -0
- package/lib/sassUtils/_borders.scss +2 -0
- package/lib/sassUtils/_colors.scss +24 -0
- package/lib/sassUtils/_depth.scss +8 -0
- package/lib/sassUtils/_mixins.scss +11 -0
- package/lib/sassUtils/_shadows.scss +5 -0
- package/lib/sassUtils/_sizes.scss +10 -0
- package/lib/sassUtils/_typography.scss +20 -0
- package/lib/sassUtils/index.scss +10 -0
- package/lib/styles/index.css +3229 -0
- package/lib/utils/citations/applyCitationOrder.d.ts +1 -0
- package/lib/utils/citations/applyCitationOrder.js +19 -0
- package/lib/utils/citations/applyCitationOrder.test.d.ts +1 -0
- package/lib/utils/citations/applyCitationOrder.test.js +65 -0
- package/lib/utils/citations/extractCitations.d.ts +4 -0
- package/lib/utils/citations/extractCitations.js +26 -0
- package/lib/utils/citations/extractCitations.test.d.ts +1 -0
- package/lib/utils/citations/extractCitations.test.js +40 -0
- package/lib/utils/citations/index.d.ts +5 -0
- package/lib/utils/citations/index.js +5 -0
- package/lib/utils/citations/removeCitations.d.ts +1 -0
- package/lib/utils/citations/removeCitations.js +2 -0
- package/lib/utils/citations/removeCitations.test.d.ts +1 -0
- package/lib/utils/citations/removeCitations.test.js +11 -0
- package/lib/utils/citations/reorderCitations.d.ts +1 -0
- package/lib/utils/citations/reorderCitations.js +9 -0
- package/lib/utils/citations/reorderCitations.test.d.ts +1 -0
- package/lib/utils/citations/reorderCitations.test.js +6 -0
- package/lib/utils/citations/sanitizeCitations.d.ts +1 -0
- package/lib/utils/citations/sanitizeCitations.js +30 -0
- package/lib/utils/citations/sanitizeCitations.test.d.ts +1 -0
- package/lib/utils/citations/sanitizeCitations.test.js +11 -0
- package/lib/utils/createId.d.ts +1 -0
- package/lib/utils/createId.js +10 -0
- package/lib/utils/getTrackingProps.d.ts +7 -0
- package/lib/utils/getTrackingProps.js +18 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/truncateString.d.ts +2 -0
- package/lib/utils/truncateString.js +20 -0
- package/lib/utils/truncateString.test.d.ts +1 -0
- package/lib/utils/truncateString.test.js +59 -0
- package/licenses.txt +9035 -0
- package/package.json +100 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const APP_CONTENT_PADDING: readonly ["none", "xs", "s", "m", "l", "xl"];
|
|
2
|
+
export type AppContentPadding = (typeof APP_CONTENT_PADDING)[number];
|
|
3
|
+
export type Tree = Array<TreeItem>;
|
|
4
|
+
export type TreeItem = {
|
|
5
|
+
name: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
pages?: Tree;
|
|
8
|
+
iconBefore?: React.ReactNode;
|
|
9
|
+
iconAfter?: React.ReactNode;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
"data-testid"?: string;
|
|
13
|
+
};
|
|
14
|
+
export type Sections = Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
pages: Array<SectionItem>;
|
|
17
|
+
}>;
|
|
18
|
+
export type SectionItem = {
|
|
19
|
+
name: string;
|
|
20
|
+
path: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const APP_CONTENT_PADDING = ["none", "xs", "s", "m", "l", "xl"];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MouseEvent } from "react";
|
|
2
|
+
import { LinkProps } from "../link/types";
|
|
3
|
+
export declare const BADGE_COLOR: readonly ["accent", "primary", "danger", "warning", "success", "neutral"];
|
|
4
|
+
type Props = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
color: (typeof BADGE_COLOR)[number];
|
|
8
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
href?: LinkProps["href"];
|
|
10
|
+
target?: LinkProps["target"];
|
|
11
|
+
track?: LinkProps["track"];
|
|
12
|
+
};
|
|
13
|
+
export declare const VuiBadge: ({ children, className, color, onClick, href, target, track, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
import { getTrackingProps } from "../../utils/getTrackingProps";
|
|
15
|
+
import { useVuiContext } from "../context/Context";
|
|
16
|
+
export const BADGE_COLOR = ["accent", "primary", "danger", "warning", "success", "neutral"];
|
|
17
|
+
export const VuiBadge = (_a) => {
|
|
18
|
+
var { children, className, color, onClick, href, target, track } = _a, rest = __rest(_a, ["children", "className", "color", "onClick", "href", "target", "track"]);
|
|
19
|
+
const { createLink } = useVuiContext();
|
|
20
|
+
const classes = classNames(className, "vuiBadge", `vuiBadge--${color}`, {
|
|
21
|
+
"vuiBadge--clickable": onClick !== null && onClick !== void 0 ? onClick : href
|
|
22
|
+
});
|
|
23
|
+
if (onClick) {
|
|
24
|
+
return (_jsx("button", Object.assign({ className: classes, onClick: onClick }, rest, { children: children })));
|
|
25
|
+
}
|
|
26
|
+
if (href) {
|
|
27
|
+
return createLink(Object.assign({ className: classes, href,
|
|
28
|
+
onClick,
|
|
29
|
+
children,
|
|
30
|
+
target }, getTrackingProps(track)));
|
|
31
|
+
}
|
|
32
|
+
return (_jsx("div", Object.assign({ className: classes }, rest, { children: children })));
|
|
33
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
.vuiBadge {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
font-size: $fontSizeSmall;
|
|
6
|
+
line-height: 1;
|
|
7
|
+
padding: $sizeXxs $sizeXs;
|
|
8
|
+
border-radius: $sizeS;
|
|
9
|
+
font-family: inherit;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.vuiBadge--clickable {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Color
|
|
19
|
+
$color: (
|
|
20
|
+
accent: (
|
|
21
|
+
"color": $colorAccent,
|
|
22
|
+
"background-color": transparentize($colorAccent, 0.9),
|
|
23
|
+
"border-color": transparentize($colorAccent, 0.9)
|
|
24
|
+
),
|
|
25
|
+
primary: (
|
|
26
|
+
"color": $colorPrimary,
|
|
27
|
+
"background-color": transparentize($colorPrimary, 0.9),
|
|
28
|
+
"border-color": transparentize($colorPrimary, 0.9)
|
|
29
|
+
),
|
|
30
|
+
success: (
|
|
31
|
+
"color": $colorSuccess,
|
|
32
|
+
"background-color": transparentize($colorSuccess, 0.9),
|
|
33
|
+
"border-color": transparentize($colorSuccess, 0.9)
|
|
34
|
+
),
|
|
35
|
+
warning: (
|
|
36
|
+
"color": $colorWarning,
|
|
37
|
+
"background-color": transparentize($colorWarning, 0.9),
|
|
38
|
+
"border-color": transparentize($colorWarning, 0.9)
|
|
39
|
+
),
|
|
40
|
+
danger: (
|
|
41
|
+
"color": $colorDanger,
|
|
42
|
+
"background-color": transparentize($colorDanger, 0.9),
|
|
43
|
+
"border-color": transparentize($colorDanger, 0.9)
|
|
44
|
+
),
|
|
45
|
+
neutral: (
|
|
46
|
+
"color": $colorText,
|
|
47
|
+
"background-color": $colorLightShade,
|
|
48
|
+
"border-color": transparentize($colorText, 0.9)
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
@each $colorName, $colorValue in $color {
|
|
53
|
+
.vuiBadge--#{$colorName} {
|
|
54
|
+
color: #{map.get($colorValue, "color")} !important;
|
|
55
|
+
background-color: #{map.get($colorValue, "background-color")};
|
|
56
|
+
border: 1px solid #{map.get($colorValue, "border-color")};
|
|
57
|
+
transition: all $transitionSpeed;
|
|
58
|
+
|
|
59
|
+
&.vuiBadge--clickable:hover {
|
|
60
|
+
border-color: #{map.get($colorValue, "color")};
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { BUTTON_SIZE } from "./types";
|
|
3
|
+
import { LinkProps } from "../link/types";
|
|
4
|
+
import { SPINNER_COLOR } from "../spinner/types";
|
|
5
|
+
export type BaseButtonProps = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
icon?: ReactElement | null;
|
|
8
|
+
iconSide?: "left" | "right";
|
|
9
|
+
align?: "left" | "center" | "right";
|
|
10
|
+
className?: string;
|
|
11
|
+
size?: (typeof BUTTON_SIZE)[number];
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
isSelected?: boolean;
|
|
14
|
+
isInert?: boolean;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
onClick?: (e: React.MouseEvent<HTMLAnchorElement | HTMLAnchorElement, MouseEvent>) => void;
|
|
17
|
+
href?: LinkProps["href"];
|
|
18
|
+
target?: LinkProps["target"];
|
|
19
|
+
track?: LinkProps["track"];
|
|
20
|
+
htmlFor?: string;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
title?: string;
|
|
23
|
+
isSubmit?: boolean;
|
|
24
|
+
isLoading?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const BaseButton: import("react").ForwardRefExoticComponent<BaseButtonProps & {
|
|
27
|
+
spinnerColor: (typeof SPINNER_COLOR)[number];
|
|
28
|
+
} & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from "react";
|
|
14
|
+
import classNames from "classnames";
|
|
15
|
+
import { getTrackingProps } from "../../utils/getTrackingProps";
|
|
16
|
+
import { useVuiContext } from "../context/Context";
|
|
17
|
+
import { VuiSpinner } from "../spinner/Spinner";
|
|
18
|
+
const alignToClassMap = {
|
|
19
|
+
left: "vuiBaseButton--alignLeft",
|
|
20
|
+
center: "vuiBaseButton--alignCenter",
|
|
21
|
+
right: "vuiBaseButton--alignRight"
|
|
22
|
+
};
|
|
23
|
+
const sizeToSpinnerSizeMap = {
|
|
24
|
+
xs: "xs",
|
|
25
|
+
s: "xs",
|
|
26
|
+
m: "s",
|
|
27
|
+
l: "m"
|
|
28
|
+
};
|
|
29
|
+
export const BaseButton = forwardRef((_a, ref) => {
|
|
30
|
+
var { children, icon, iconSide = "left", align = "center", className, size = "m", fullWidth, onClick, tabIndex, isInert, isDisabled, href, target, track, htmlFor, isSubmit, isLoading, spinnerColor } = _a, rest = __rest(_a, ["children", "icon", "iconSide", "align", "className", "size", "fullWidth", "onClick", "tabIndex", "isInert", "isDisabled", "href", "target", "track", "htmlFor", "isSubmit", "isLoading", "spinnerColor"]);
|
|
31
|
+
const { createLink } = useVuiContext();
|
|
32
|
+
const classes = classNames("vuiBaseButton", className, `vuiBaseButton--${size}`, alignToClassMap[align], {
|
|
33
|
+
"vuiBaseButton-isInert": isInert,
|
|
34
|
+
"vuiBaseButton-isDisabled": isDisabled,
|
|
35
|
+
"vuiBaseButton--fullWidth": fullWidth,
|
|
36
|
+
[`vuiBaseButton--${isLoading ? "left" : iconSide}`]: (Boolean(icon) || isLoading) && Boolean(children)
|
|
37
|
+
});
|
|
38
|
+
let iconContainer;
|
|
39
|
+
if (isLoading) {
|
|
40
|
+
iconContainer = (_jsx("span", Object.assign({ className: "vuiBaseButtonIconContainer" }, { children: _jsx(VuiSpinner, { color: spinnerColor, size: sizeToSpinnerSizeMap[size] }) })));
|
|
41
|
+
}
|
|
42
|
+
else if (icon) {
|
|
43
|
+
iconContainer = _jsx("span", Object.assign({ className: "vuiBaseButtonIconContainer" }, { children: icon }));
|
|
44
|
+
}
|
|
45
|
+
// This is useful for controlling other elements, e.g. creating an <input type="file" />
|
|
46
|
+
// for uploading files and adding a button to trigger it.
|
|
47
|
+
if (htmlFor) {
|
|
48
|
+
return (_jsxs("label", Object.assign({ htmlFor: htmlFor, className: classes, tabIndex: tabIndex }, rest, { children: [iconContainer, children] })));
|
|
49
|
+
}
|
|
50
|
+
if (href) {
|
|
51
|
+
const wrapperClasses = classNames("vuiBaseButtonLinkWrapper", {
|
|
52
|
+
"vuiBaseButtonLinkWrapper--fullWidth": fullWidth
|
|
53
|
+
});
|
|
54
|
+
return createLink(Object.assign(Object.assign({ className: wrapperClasses, href,
|
|
55
|
+
onClick, children: (
|
|
56
|
+
//* Wrap a button otherwise the flex layout breaks */}
|
|
57
|
+
_jsxs("button", Object.assign({ className: classes, tabIndex: -1, ref: ref }, { children: [iconContainer, children] }))), target,
|
|
58
|
+
tabIndex }, rest), getTrackingProps(track)));
|
|
59
|
+
}
|
|
60
|
+
const props = Object.assign({ onClick,
|
|
61
|
+
tabIndex, ["type"]: isSubmit ? "submit" : "button", disabled: isDisabled }, rest);
|
|
62
|
+
return (
|
|
63
|
+
// @ts-expect-error HTMLButtonElement conflict with HTMLAnchorElement
|
|
64
|
+
_jsxs("button", Object.assign({ className: classes }, props, { ref: ref }, { children: [iconContainer, children] })));
|
|
65
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseButtonProps } from "./BaseButton";
|
|
2
|
+
import { ButtonColor } from "./types";
|
|
3
|
+
export type Props = BaseButtonProps & {
|
|
4
|
+
color: ButtonColor;
|
|
5
|
+
};
|
|
6
|
+
export declare const VuiButtonPrimary: import("react").ForwardRefExoticComponent<BaseButtonProps & {
|
|
7
|
+
color: ButtonColor;
|
|
8
|
+
} & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from "react";
|
|
14
|
+
import classNames from "classnames";
|
|
15
|
+
import { BaseButton } from "./BaseButton";
|
|
16
|
+
import { createButtonIcon } from "./createButtonIcon";
|
|
17
|
+
const colorToIconColorMap = {
|
|
18
|
+
accent: "empty",
|
|
19
|
+
primary: "empty",
|
|
20
|
+
success: "empty",
|
|
21
|
+
danger: "empty",
|
|
22
|
+
warning: "empty",
|
|
23
|
+
neutral: "neutral",
|
|
24
|
+
subdued: "subdued"
|
|
25
|
+
};
|
|
26
|
+
const colorToSpinnerColorMap = {
|
|
27
|
+
accent: "empty",
|
|
28
|
+
primary: "empty",
|
|
29
|
+
success: "empty",
|
|
30
|
+
danger: "empty",
|
|
31
|
+
warning: "empty",
|
|
32
|
+
neutral: "dark",
|
|
33
|
+
subdued: "dark"
|
|
34
|
+
};
|
|
35
|
+
export const VuiButtonPrimary = forwardRef((_a, ref) => {
|
|
36
|
+
var { children, icon, color, size = "m", className, isSelected, isDisabled } = _a, rest = __rest(_a, ["children", "icon", "color", "size", "className", "isSelected", "isDisabled"]);
|
|
37
|
+
const classes = classNames(className, "vuiButtonPrimary", `vuiButtonPrimary--${color}`, {
|
|
38
|
+
"vuiButtonPrimary-isSelected": isSelected
|
|
39
|
+
});
|
|
40
|
+
const buttonIcon = createButtonIcon(icon, size, color, colorToIconColorMap);
|
|
41
|
+
return (_jsx(BaseButton, Object.assign({ ref: ref, className: classes, icon: buttonIcon, size: size, isDisabled: isDisabled, spinnerColor: colorToSpinnerColorMap[color] }, rest, { children: children })));
|
|
42
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseButtonProps } from "./BaseButton";
|
|
2
|
+
import { ButtonColor } from "./types";
|
|
3
|
+
export type Props = BaseButtonProps & {
|
|
4
|
+
color: ButtonColor;
|
|
5
|
+
solid?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const VuiButtonSecondary: import("react").ForwardRefExoticComponent<BaseButtonProps & {
|
|
8
|
+
color: ButtonColor;
|
|
9
|
+
solid?: boolean | undefined;
|
|
10
|
+
} & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from "react";
|
|
14
|
+
import classNames from "classnames";
|
|
15
|
+
import { BaseButton } from "./BaseButton";
|
|
16
|
+
import { createButtonIcon } from "./createButtonIcon";
|
|
17
|
+
const colorToIconColorMap = {
|
|
18
|
+
accent: "accent",
|
|
19
|
+
primary: "primary",
|
|
20
|
+
success: "success",
|
|
21
|
+
danger: "danger",
|
|
22
|
+
warning: "warning",
|
|
23
|
+
neutral: "neutral",
|
|
24
|
+
subdued: "subdued"
|
|
25
|
+
};
|
|
26
|
+
const colorToSpinnerColorMap = {
|
|
27
|
+
accent: "accent",
|
|
28
|
+
primary: "primary",
|
|
29
|
+
success: "success",
|
|
30
|
+
danger: "danger",
|
|
31
|
+
warning: "warning",
|
|
32
|
+
neutral: "dark",
|
|
33
|
+
subdued: "dark"
|
|
34
|
+
};
|
|
35
|
+
export const VuiButtonSecondary = forwardRef((_a, ref) => {
|
|
36
|
+
var { children, icon, color, size = "m", className, isSelected, isDisabled, solid } = _a, rest = __rest(_a, ["children", "icon", "color", "size", "className", "isSelected", "isDisabled", "solid"]);
|
|
37
|
+
const classes = classNames(className, "vuiButtonSecondary", `vuiButtonSecondary--${color}`, {
|
|
38
|
+
"vuiButtonSecondary-isSelected": isSelected,
|
|
39
|
+
"vuiButtonSecondary--solid": solid
|
|
40
|
+
});
|
|
41
|
+
const buttonIcon = createButtonIcon(icon, size, color, colorToIconColorMap);
|
|
42
|
+
return (_jsx(BaseButton, Object.assign({ ref: ref, className: classes, icon: buttonIcon, size: size, isDisabled: isDisabled, spinnerColor: colorToSpinnerColorMap[color] }, rest, { children: children })));
|
|
43
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseButtonProps } from "./BaseButton";
|
|
2
|
+
import { ButtonColor } from "./types";
|
|
3
|
+
export type Props = BaseButtonProps & {
|
|
4
|
+
color: ButtonColor;
|
|
5
|
+
noPadding?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const VuiButtonTertiary: import("react").ForwardRefExoticComponent<BaseButtonProps & {
|
|
8
|
+
color: ButtonColor;
|
|
9
|
+
noPadding?: boolean | undefined;
|
|
10
|
+
} & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from "react";
|
|
14
|
+
import classNames from "classnames";
|
|
15
|
+
import { BaseButton } from "./BaseButton";
|
|
16
|
+
import { createButtonIcon } from "./createButtonIcon";
|
|
17
|
+
const colorToIconColorMap = {
|
|
18
|
+
accent: "accent",
|
|
19
|
+
primary: "primary",
|
|
20
|
+
success: "success",
|
|
21
|
+
danger: "danger",
|
|
22
|
+
warning: "warning",
|
|
23
|
+
neutral: "neutral",
|
|
24
|
+
subdued: "subdued"
|
|
25
|
+
};
|
|
26
|
+
const colorToSpinnerColorMap = {
|
|
27
|
+
accent: "accent",
|
|
28
|
+
primary: "primary",
|
|
29
|
+
success: "success",
|
|
30
|
+
danger: "danger",
|
|
31
|
+
warning: "warning",
|
|
32
|
+
neutral: "dark",
|
|
33
|
+
subdued: "dark"
|
|
34
|
+
};
|
|
35
|
+
export const VuiButtonTertiary = forwardRef((_a, ref) => {
|
|
36
|
+
var { children, icon, color, size = "m", className, isSelected, isDisabled, noPadding } = _a, rest = __rest(_a, ["children", "icon", "color", "size", "className", "isSelected", "isDisabled", "noPadding"]);
|
|
37
|
+
const classes = classNames(className, "vuiButtonTertiary", `vuiButtonTertiary--${color}`, {
|
|
38
|
+
"vuiButtonTertiary-isSelected": isSelected,
|
|
39
|
+
"vuiButtonTertiary-noPadding": noPadding
|
|
40
|
+
});
|
|
41
|
+
const buttonIcon = createButtonIcon(icon, size, color, colorToIconColorMap);
|
|
42
|
+
return (_jsx(BaseButton, Object.assign({ ref: ref, className: classes, icon: buttonIcon, size: size, isDisabled: isDisabled, spinnerColor: colorToSpinnerColorMap[color] }, rest, { children: children })));
|
|
43
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { ButtonColor, BUTTON_SIZE } from "./types";
|
|
3
|
+
import { LinkProps } from "../link/types";
|
|
4
|
+
type Props = {
|
|
5
|
+
className?: string;
|
|
6
|
+
icon: ReactElement;
|
|
7
|
+
color?: ButtonColor;
|
|
8
|
+
size?: (typeof BUTTON_SIZE)[number];
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
href?: LinkProps["href"];
|
|
11
|
+
target?: LinkProps["target"];
|
|
12
|
+
track?: LinkProps["track"];
|
|
13
|
+
tabIndex?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const VuiIconButton: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
import { forwardRef } from "react";
|
|
15
|
+
import { getTrackingProps } from "../../utils/getTrackingProps";
|
|
16
|
+
import { createButtonIcon } from "./createButtonIcon";
|
|
17
|
+
import { useVuiContext } from "../context/Context";
|
|
18
|
+
export const VuiIconButton = forwardRef((_a, ref) => {
|
|
19
|
+
var { className, icon, color = "primary", size = "m", onClick, href, target, track, tabIndex } = _a, rest = __rest(_a, ["className", "icon", "color", "size", "onClick", "href", "target", "track", "tabIndex"]);
|
|
20
|
+
const { createLink } = useVuiContext();
|
|
21
|
+
const props = Object.assign({ className: classNames("vuiIconButton", className, `vuiIconButton--${color}`, `vuiIconButton--${size}`), onClick,
|
|
22
|
+
tabIndex }, rest);
|
|
23
|
+
const buttonIcon = createButtonIcon(icon, size, color);
|
|
24
|
+
if (href) {
|
|
25
|
+
return createLink(Object.assign(Object.assign(Object.assign({ href,
|
|
26
|
+
target }, props), getTrackingProps(track)), { children: _jsx("button", Object.assign({ ref: ref }, { children: buttonIcon })) }));
|
|
27
|
+
}
|
|
28
|
+
return (_jsx("button", Object.assign({}, props, { ref: ref }, { children: buttonIcon })));
|
|
29
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
.vuiBaseButtonIconContainer {
|
|
2
|
+
// Ensures custom icons and vertically centered.
|
|
3
|
+
line-height: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.vuiBaseButtonLinkWrapper {
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
|
|
9
|
+
&:hover {
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.vuiBaseButtonLinkWrapper--fullWidth {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.vuiBaseButton {
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
border-radius: $sizeXxs;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
box-shadow: $shadowSmallStart;
|
|
25
|
+
transition: all $transitionSpeed;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.vuiBaseButton--alignLeft {
|
|
31
|
+
justify-content: flex-start;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.vuiBaseButton--alignCenter {
|
|
35
|
+
justify-content: center;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.vuiBaseButton--alignRight {
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.vuiBaseButton-isInert,
|
|
43
|
+
.vuiBaseButton-isDisabled {
|
|
44
|
+
cursor: default;
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.vuiBaseButton-isDisabled {
|
|
49
|
+
opacity: 0.5;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.vuiBaseButton--left {
|
|
53
|
+
.vuiBaseButtonIconContainer {
|
|
54
|
+
margin-right: $sizeXs;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.vuiBaseButton--right {
|
|
59
|
+
flex-direction: row-reverse;
|
|
60
|
+
|
|
61
|
+
.vuiBaseButtonIconContainer {
|
|
62
|
+
margin-left: $sizeXs;
|
|
63
|
+
margin-right: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.vuiBaseButton--fullWidth {
|
|
68
|
+
width: 100%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Size
|
|
72
|
+
.vuiBaseButton--xs {
|
|
73
|
+
font-size: $fontSizeStandard;
|
|
74
|
+
padding: $sizeXxs $sizeXs;
|
|
75
|
+
height: 24px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.vuiBaseButton--s {
|
|
79
|
+
font-size: $fontSizeStandard;
|
|
80
|
+
padding: $sizeXs * 0.75 $sizeXs;
|
|
81
|
+
height: 28px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.vuiBaseButton--m {
|
|
85
|
+
font-size: $fontSizeMedium;
|
|
86
|
+
padding: $sizeXs $sizeM;
|
|
87
|
+
height: 34px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.vuiBaseButton--l {
|
|
91
|
+
font-size: $fontSizeMedium;
|
|
92
|
+
padding: $sizeS $sizeL;
|
|
93
|
+
height: 47px;
|
|
94
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
.vuiButtonPrimary {
|
|
4
|
+
&:hover {
|
|
5
|
+
box-shadow: $shadowSmallEnd;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Color
|
|
10
|
+
$color: (
|
|
11
|
+
accent: (
|
|
12
|
+
"color": #ffffff,
|
|
13
|
+
"background-color": $colorAccent
|
|
14
|
+
),
|
|
15
|
+
primary: (
|
|
16
|
+
"color": #ffffff,
|
|
17
|
+
"background-color": $colorPrimary
|
|
18
|
+
),
|
|
19
|
+
success: (
|
|
20
|
+
"color": #ffffff,
|
|
21
|
+
"background-color": $colorSuccess
|
|
22
|
+
),
|
|
23
|
+
danger: (
|
|
24
|
+
"color": #ffffff,
|
|
25
|
+
"background-color": $colorDanger
|
|
26
|
+
),
|
|
27
|
+
warning: (
|
|
28
|
+
"color": #ffffff,
|
|
29
|
+
"background-color": $colorWarning
|
|
30
|
+
),
|
|
31
|
+
neutral: (
|
|
32
|
+
"color": $colorText,
|
|
33
|
+
"background-color": transparentize($colorText, 0.9)
|
|
34
|
+
),
|
|
35
|
+
subdued: (
|
|
36
|
+
"color": $colorSubdued,
|
|
37
|
+
"background-color": transparentize($colorSubdued, 0.9)
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
@each $colorName, $colorValue in $color {
|
|
42
|
+
.vuiButtonPrimary--#{$colorName} {
|
|
43
|
+
color: #{map.get($colorValue, "color")};
|
|
44
|
+
background-color: #{map.get($colorValue, "background-color")};
|
|
45
|
+
border: 1px solid #{map.get($colorValue, "background-color")};
|
|
46
|
+
|
|
47
|
+
&.vuiButtonPrimary-isSelected {
|
|
48
|
+
box-shadow: inset rgba(50, 50, 93, 0.25) 0px 6px 8px -2px, inset rgba(0, 0, 0, 0.3) 0px 3px 4px -3px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
.vuiButtonSecondary {
|
|
4
|
+
&:hover {
|
|
5
|
+
box-shadow: $shadowSmallEnd;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.vuiButtonSecondary--solid {
|
|
10
|
+
background-color: $colorEmptyShade;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Color
|
|
14
|
+
$color: (
|
|
15
|
+
accent: (
|
|
16
|
+
"border-color": transparentize($colorAccent, 0.5),
|
|
17
|
+
"color": $colorAccent
|
|
18
|
+
),
|
|
19
|
+
primary: (
|
|
20
|
+
"border-color": transparentize($colorPrimary, 0.5),
|
|
21
|
+
"color": $colorPrimary
|
|
22
|
+
),
|
|
23
|
+
success: (
|
|
24
|
+
"border-color": transparentize($colorSuccess, 0.5),
|
|
25
|
+
"color": $colorSuccess
|
|
26
|
+
),
|
|
27
|
+
danger: (
|
|
28
|
+
"border-color": transparentize($colorDanger, 0.5),
|
|
29
|
+
"color": $colorDanger
|
|
30
|
+
),
|
|
31
|
+
warning: (
|
|
32
|
+
"border-color": transparentize($colorWarning, 0.5),
|
|
33
|
+
"color": $colorWarning
|
|
34
|
+
),
|
|
35
|
+
neutral: (
|
|
36
|
+
"border-color": $borderColor,
|
|
37
|
+
"color": $colorText
|
|
38
|
+
),
|
|
39
|
+
subdued: (
|
|
40
|
+
"border-color": $borderColorLight,
|
|
41
|
+
"color": $colorSubdued
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
@each $colorName, $colorValue in $color {
|
|
46
|
+
.vuiButtonSecondary--#{$colorName} {
|
|
47
|
+
border: 1px solid #{map.get($colorValue, "border-color")};
|
|
48
|
+
color: #{map.get($colorValue, "color")};
|
|
49
|
+
|
|
50
|
+
&.vuiButtonSecondary-isSelected {
|
|
51
|
+
box-shadow: inset rgba(0, 0, 0, 0.1) 0px 2px 2px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|