@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,67 @@
|
|
|
1
|
+
import { VuiAccordion } from "./accordion/Accordion";
|
|
2
|
+
import { VuiAccountMenu } from "./accountMenu/AccountMenu";
|
|
3
|
+
import { VuiAppContent } from "./app/AppContent";
|
|
4
|
+
import { VuiAppHeader } from "./app/AppHeader";
|
|
5
|
+
import { VuiAppLayout } from "./app/AppLayout";
|
|
6
|
+
import { VuiAppSideNav } from "./app/appSideNav/AppSideNav";
|
|
7
|
+
import { BADGE_COLOR, VuiBadge } from "./badge/Badge";
|
|
8
|
+
import { BUTTON_COLOR, BUTTON_SIZE } from "./button/types";
|
|
9
|
+
import { VuiButtonPrimary } from "./button/ButtonPrimary";
|
|
10
|
+
import { VuiButtonSecondary } from "./button/ButtonSecondary";
|
|
11
|
+
import { VuiButtonTertiary } from "./button/ButtonTertiary";
|
|
12
|
+
import { VuiIconButton } from "./button/IconButton";
|
|
13
|
+
import { VuiCallout } from "./callout/Callout";
|
|
14
|
+
import { VuiCard } from "./card/Card";
|
|
15
|
+
import { CALLOUT_COLOR, CALLOUT_SIZE } from "./callout/types";
|
|
16
|
+
import { VuiChat } from "./chat/Chat";
|
|
17
|
+
import { VuiCode } from "./code/Code";
|
|
18
|
+
import { VuiContextProvider } from "./context/Context";
|
|
19
|
+
import { VuiCopyButton } from "./copyButton/CopyButton";
|
|
20
|
+
import { VuiDrawer } from "./drawer/Drawer";
|
|
21
|
+
import { VuiFlexContainer } from "./flex/FlexContainer";
|
|
22
|
+
import { VuiFlexItem } from "./flex/FlexItem";
|
|
23
|
+
import { VuiCheckbox, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
|
|
24
|
+
import { VuiFormGroup } from "./formGroup/FormGroup";
|
|
25
|
+
import { VuiGrid } from "./grid/Grid";
|
|
26
|
+
import { VuiHorizontalRule } from "./horizontalRule/HorizontalRule";
|
|
27
|
+
import { VuiIcon } from "./icon/Icon";
|
|
28
|
+
import { ICON_COLOR, ICON_SIZE } from "./icon/types";
|
|
29
|
+
import { VuiInfoTable } from "./infoTable/InfoTable";
|
|
30
|
+
import { VuiLink, VuiLinkInternal } from "./link/Link";
|
|
31
|
+
import { VuiList } from "./list/List";
|
|
32
|
+
import { VuiMenu } from "./menu/Menu";
|
|
33
|
+
import { VuiMenuItem } from "./menu/MenuItem";
|
|
34
|
+
import { VuiModal } from "./modal/Modal";
|
|
35
|
+
import { VuiNotifications } from "./notification/Notifications";
|
|
36
|
+
import { VuiOptionsButton } from "./optionsButton/OptionsButton";
|
|
37
|
+
import { VuiOptionsList } from "./optionsList/OptionsList";
|
|
38
|
+
import { VuiOptionsListItem } from "./optionsList/OptionsListItem";
|
|
39
|
+
import { VuiPopover } from "./popover/Popover";
|
|
40
|
+
import { VuiPortal } from "./portal/Portal";
|
|
41
|
+
import { PROGRESS_BAR_COLOR, VuiProgressBar } from "./progressBar/ProgressBar";
|
|
42
|
+
import { VuiPrompt } from "./prompt/Prompt";
|
|
43
|
+
import { VuiScreenBlock } from "./screenBlock/ScreenBlock";
|
|
44
|
+
import { VuiSearchInput } from "./searchInput/SearchInput";
|
|
45
|
+
import { VuiSearchResult } from "./searchResult/SearchResult";
|
|
46
|
+
import { VuiSearchSelect } from "./searchSelect/SearchSelect";
|
|
47
|
+
import { VuiSetting } from "./setting/Setting";
|
|
48
|
+
import { VuiSpacer } from "./spacer/Spacer";
|
|
49
|
+
import { SPACER_SIZE } from "./spacer/types";
|
|
50
|
+
import { VuiSpinner } from "./spinner/Spinner";
|
|
51
|
+
import { SPINNER_COLOR, SPINNER_SIZE } from "./spinner/types";
|
|
52
|
+
import { VuiStatList } from "./statList/StatList";
|
|
53
|
+
import { VuiStatus } from "./status/Status";
|
|
54
|
+
import { VuiSummary } from "./summary/Summary";
|
|
55
|
+
import { VuiSummaryCitation } from "./summary/SummaryCitation";
|
|
56
|
+
import { VuiTable } from "./table/Table";
|
|
57
|
+
import { VuiTab } from "./tabs/Tab";
|
|
58
|
+
import { VuiTabbedRoutes } from "./tabs/TabbedRoutes";
|
|
59
|
+
import { VuiTabs } from "./tabs/Tabs";
|
|
60
|
+
import { TAB_SIZE } from "./tabs/types";
|
|
61
|
+
import { VuiText } from "./typography/Text";
|
|
62
|
+
import { VuiTextColor } from "./typography/TextColor";
|
|
63
|
+
import { TEXT_COLOR, TEXT_SIZE, TITLE_SIZE } from "./typography/types";
|
|
64
|
+
import { VuiTitle } from "./typography/Title";
|
|
65
|
+
import { VuiToggle } from "./toggle/Toggle";
|
|
66
|
+
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
67
|
+
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, VuiAccordion, VuiAccountMenu, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiContextProvider, VuiCopyButton, VuiDrawer, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiHorizontalRule, VuiIcon, VuiInfoTable, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStatList, VuiStatus, VuiSummary, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTitle, VuiToggle, VuiTopicButton };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const PADDING: readonly ["xxs", "xs", "s"];
|
|
2
|
+
export type InfoTableColumnAlign = "left" | "right";
|
|
3
|
+
type Column = {
|
|
4
|
+
name: string;
|
|
5
|
+
render?: React.ReactNode;
|
|
6
|
+
width?: string;
|
|
7
|
+
align?: InfoTableColumnAlign;
|
|
8
|
+
};
|
|
9
|
+
export type InfoTableRowType = "sectionHeader" | "footer";
|
|
10
|
+
export type InfoTableRow = {
|
|
11
|
+
type?: InfoTableRowType;
|
|
12
|
+
values: Record<string, {
|
|
13
|
+
render: React.ReactNode;
|
|
14
|
+
colSpan?: number;
|
|
15
|
+
} | undefined>;
|
|
16
|
+
};
|
|
17
|
+
type Props = {
|
|
18
|
+
columns: Column[];
|
|
19
|
+
rows: InfoTableRow[];
|
|
20
|
+
isHeaderVisible?: boolean;
|
|
21
|
+
padding?: (typeof PADDING)[number];
|
|
22
|
+
};
|
|
23
|
+
export declare const VuiInfoTable: ({ columns, rows, isHeaderVisible, padding }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
const PADDING = ["xxs", "xs", "s"];
|
|
4
|
+
const paddingToClassMap = {
|
|
5
|
+
xxs: "vuiInfoTable--paddingXxs",
|
|
6
|
+
xs: "vuiInfoTable--paddingXs",
|
|
7
|
+
s: "vuiInfoTable--paddingS"
|
|
8
|
+
};
|
|
9
|
+
const typeToRowClassMap = {
|
|
10
|
+
sectionHeader: "vuiInfoTableRow--sectionHeader",
|
|
11
|
+
footer: "vuiInfoTableRow--footer"
|
|
12
|
+
};
|
|
13
|
+
export const VuiInfoTable = ({ columns, rows, isHeaderVisible, padding = "xs" }) => {
|
|
14
|
+
const classes = classNames("vuiInfoTable", paddingToClassMap[padding]);
|
|
15
|
+
return (_jsxs("table", Object.assign({ className: classes }, { children: [isHeaderVisible && (_jsx("thead", { children: _jsx("tr", { children: columns.map(({ name, render, width, align }) => (_jsx("th", Object.assign({ style: { width, textAlign: align !== null && align !== void 0 ? align : "left" } }, { children: render }), name))) }) })), _jsx("tbody", { children: rows.map(({ values, type }, index) => {
|
|
16
|
+
const rowClasses = type && typeToRowClassMap[type];
|
|
17
|
+
return (_jsx("tr", Object.assign({ className: rowClasses }, { children: columns.map(({ name, width, align }) => {
|
|
18
|
+
const value = values[name];
|
|
19
|
+
if (value !== undefined) {
|
|
20
|
+
return (_jsx("td", Object.assign({ style: { width, textAlign: align !== null && align !== void 0 ? align : "left" }, colSpan: value.colSpan }, { children: value.render }), name));
|
|
21
|
+
}
|
|
22
|
+
}) }), index));
|
|
23
|
+
}) })] })));
|
|
24
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.vuiInfoTable {
|
|
2
|
+
width: 100%;
|
|
3
|
+
table-layout: fixed;
|
|
4
|
+
border: 1px solid $borderColorLight;
|
|
5
|
+
|
|
6
|
+
thead {
|
|
7
|
+
background-color: $colorLightShade;
|
|
8
|
+
border-bottom: 1px solid $borderColorLight;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
tbody tr {
|
|
12
|
+
border-bottom: 1px solid $borderColorLight;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
th {
|
|
16
|
+
font-size: $fontSizeSmall;
|
|
17
|
+
font-weight: $fontWeightBold;
|
|
18
|
+
padding: $sizeXs $sizeS;
|
|
19
|
+
text-align: left;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
td {
|
|
23
|
+
font-size: $fontSizeStandard;
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.vuiInfoTable--paddingXxs {
|
|
29
|
+
td {
|
|
30
|
+
padding: $sizeXxs $sizeS;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.vuiInfoTable--paddingXs {
|
|
35
|
+
td {
|
|
36
|
+
padding: $sizeXs $sizeS;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.vuiInfoTable--paddingS {
|
|
41
|
+
td {
|
|
42
|
+
padding: $sizeS $sizeS;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.vuiInfoTableRow--sectionHeader {
|
|
47
|
+
background-color: $colorLightShade;
|
|
48
|
+
border-bottom: none !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.vuiInfoTableRow--footer {
|
|
52
|
+
background-color: $colorLightShade;
|
|
53
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LinkProps } from "./types";
|
|
2
|
+
export declare const VuiLinkInternal: ({ ...rest }: LinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const VuiLink: ({ children, href, target, onClick, className, track, isAnchor, ...rest }: LinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 VuiLinkInternal = (_a) => {
|
|
17
|
+
var rest = __rest(_a, []);
|
|
18
|
+
return _jsx(VuiLink, Object.assign({}, rest, { track: true }));
|
|
19
|
+
};
|
|
20
|
+
export const VuiLink = (_a) => {
|
|
21
|
+
var { children, href, target, onClick, className, track, isAnchor } = _a, rest = __rest(_a, ["children", "href", "target", "onClick", "className", "track", "isAnchor"]);
|
|
22
|
+
const { createLink } = useVuiContext();
|
|
23
|
+
if (!href) {
|
|
24
|
+
return (_jsx("button", Object.assign({ className: classNames("vuiLink", "vuiLink--button", className), onClick: onClick }, rest, { children: children })));
|
|
25
|
+
}
|
|
26
|
+
const props = Object.assign(Object.assign({}, rest), getTrackingProps(track));
|
|
27
|
+
if (target === "_blank") {
|
|
28
|
+
props.target = target;
|
|
29
|
+
}
|
|
30
|
+
if (isAnchor) {
|
|
31
|
+
return (_jsx("a", Object.assign({ className: classNames("vuiLink", className), href: href, onClick: onClick }, props, { children: children })));
|
|
32
|
+
}
|
|
33
|
+
return createLink(Object.assign({ className: classNames("vuiLink", className), href,
|
|
34
|
+
onClick,
|
|
35
|
+
children }, props));
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MemoryRouter } from "react-router-dom";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { VuiLink } from "./Link";
|
|
5
|
+
import { renderWithContext } from "../context/Context.test.util";
|
|
6
|
+
describe("VuiLink", () => {
|
|
7
|
+
describe("track", () => {
|
|
8
|
+
it("allows referrer information when true", () => {
|
|
9
|
+
const { asFragment } = renderWithContext(_jsx(VuiLink, Object.assign({ href: "https://www.vectara.com", track: true }, { children: "Link" })), { wrapper: MemoryRouter });
|
|
10
|
+
expect(asFragment()).toMatchInlineSnapshot(`
|
|
11
|
+
<DocumentFragment>
|
|
12
|
+
<a
|
|
13
|
+
class="vuiLink"
|
|
14
|
+
href="https://www.vectara.com"
|
|
15
|
+
referrerpolicy="no-referrer-when-downgrade"
|
|
16
|
+
rel="noopener"
|
|
17
|
+
>
|
|
18
|
+
Link
|
|
19
|
+
</a>
|
|
20
|
+
</DocumentFragment>
|
|
21
|
+
`);
|
|
22
|
+
});
|
|
23
|
+
it("disallows referrer information when false (default)", () => {
|
|
24
|
+
const { asFragment } = renderWithContext(_jsx(VuiLink, Object.assign({ href: "https://www.vectara.com" }, { children: "Link" })), {
|
|
25
|
+
wrapper: MemoryRouter
|
|
26
|
+
});
|
|
27
|
+
expect(asFragment()).toMatchInlineSnapshot(`
|
|
28
|
+
<DocumentFragment>
|
|
29
|
+
<a
|
|
30
|
+
class="vuiLink"
|
|
31
|
+
href="https://www.vectara.com"
|
|
32
|
+
rel="noopener"
|
|
33
|
+
>
|
|
34
|
+
Link
|
|
35
|
+
</a>
|
|
36
|
+
</DocumentFragment>
|
|
37
|
+
`);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.vuiLink {
|
|
2
|
+
color: $colorPrimary !important;
|
|
3
|
+
text-decoration: none;
|
|
4
|
+
|
|
5
|
+
&:hover {
|
|
6
|
+
text-decoration: underline;
|
|
7
|
+
|
|
8
|
+
// This is needed when wrapping an element that has display: inline-flex.
|
|
9
|
+
& * {
|
|
10
|
+
text-decoration: underline;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.vuiLink--button {
|
|
16
|
+
display: inline;
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export type LinkProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
href?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
target?: "_blank";
|
|
7
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
8
|
+
track?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
isAnchor?: boolean;
|
|
13
|
+
tabIndex?: number;
|
|
14
|
+
"data-testid"?: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type ListItem = {
|
|
2
|
+
key: string;
|
|
3
|
+
isComplete: boolean;
|
|
4
|
+
render: () => React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
type Props = {
|
|
7
|
+
items: ListItem[];
|
|
8
|
+
size?: "s" | "m";
|
|
9
|
+
alignItems?: "start" | "center" | "end";
|
|
10
|
+
};
|
|
11
|
+
export declare const VuiList: ({ items, size, alignItems }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { VuiFlexContainer } from "../flex/FlexContainer";
|
|
4
|
+
import { VuiFlexItem } from "../flex/FlexItem";
|
|
5
|
+
import { VuiSpacer } from "../spacer/Spacer";
|
|
6
|
+
import { Fragment } from "react";
|
|
7
|
+
export const VuiList = ({ items, size = "m", alignItems = "center" }) => {
|
|
8
|
+
return (_jsx(_Fragment, { children: items.map((item, index) => {
|
|
9
|
+
const humanizedStep = index + 1;
|
|
10
|
+
const numberClasses = classNames("vuiListNumber", `vuiListNumber--${size}`, {
|
|
11
|
+
"vuiListNumber-isComplete": item.isComplete
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs(Fragment, { children: [_jsxs(VuiFlexContainer, Object.assign({ alignItems: alignItems, spacing: size }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx("div", Object.assign({ className: numberClasses, "aria-label": `Step ${humanizedStep}` }, { children: humanizedStep })) })), _jsx(VuiFlexItem, Object.assign({ grow: 1, alignItems: "start" }, { children: item.render() }))] })), index < items.length - 1 && _jsx(VuiSpacer, { size: "s" })] }, item.key));
|
|
14
|
+
}) }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.vuiListNumber {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
border-radius: $sizeL;
|
|
5
|
+
background-color: $colorLightShade;
|
|
6
|
+
color: $colorSubdued;
|
|
7
|
+
font-weight: $fontWeightBold;
|
|
8
|
+
line-height: 0;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.vuiListNumber--m {
|
|
13
|
+
width: $sizeM;
|
|
14
|
+
height: $sizeM;
|
|
15
|
+
padding: $sizeM;
|
|
16
|
+
font-size: $fontSizeMedium;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.vuiListNumber--s {
|
|
20
|
+
width: $sizeS;
|
|
21
|
+
height: $sizeS;
|
|
22
|
+
padding: $sizeS;
|
|
23
|
+
font-size: $fontSizeSmall;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.vuiListNumber-isComplete {
|
|
27
|
+
background-color: $colorAccentLightShade;
|
|
28
|
+
color: $colorAccent;
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
export const VuiMenu = ({ children, noBorder }) => {
|
|
4
|
+
const classes = classNames("vuiMenu", { "vuiMenu--noBorder": noBorder });
|
|
5
|
+
return _jsx("div", Object.assign({ className: classes }, { children: children }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LinkProps } from "../link/types";
|
|
2
|
+
export type MenuItem = {
|
|
3
|
+
className?: string;
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
text?: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
href?: LinkProps["href"];
|
|
8
|
+
color?: "neutral" | "primary" | "danger";
|
|
9
|
+
};
|
|
10
|
+
export declare const VuiMenuItem: ({ className, title, text, onClick, href, color, ...rest }: MenuItem) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
import { VuiSpacer } from "../spacer/Spacer";
|
|
15
|
+
import { useVuiContext } from "../context/Context";
|
|
16
|
+
export const VuiMenuItem = (_a) => {
|
|
17
|
+
var { className, title, text, onClick, href, color = "neutral" } = _a, rest = __rest(_a, ["className", "title", "text", "onClick", "href", "color"]);
|
|
18
|
+
const { createLink } = useVuiContext();
|
|
19
|
+
const classes = classNames(className, "vuiMenuItem", `vuiMenuItem--${color}`, {
|
|
20
|
+
"vuiMenuItem--clickable": onClick || href
|
|
21
|
+
});
|
|
22
|
+
const props = Object.assign({ className: classes, onClick }, rest);
|
|
23
|
+
const content = (_jsxs(_Fragment, { children: [title && _jsx("div", Object.assign({ className: "vuiMenuItem__title" }, { children: title })), text && title && _jsx(VuiSpacer, { size: "xxs" }), text && _jsx("div", Object.assign({ className: "vuiMenuItem__text" }, { children: text }))] }));
|
|
24
|
+
if (href) {
|
|
25
|
+
return createLink(Object.assign(Object.assign({ href }, props), { children: content }));
|
|
26
|
+
}
|
|
27
|
+
if (onClick) {
|
|
28
|
+
return _jsx("button", Object.assign({}, props, { children: content }));
|
|
29
|
+
}
|
|
30
|
+
return _jsx("div", Object.assign({}, props, { children: content }));
|
|
31
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
.vuiMenu {
|
|
4
|
+
border: 1px solid $borderColor;
|
|
5
|
+
border-radius: $sizeXs;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.vuiMenuItem {
|
|
10
|
+
display: block;
|
|
11
|
+
width: 100%;
|
|
12
|
+
padding: $sizeS $sizeL;
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
text-align: left;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.vuiMenu--noBorder {
|
|
18
|
+
border: none;
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
|
|
21
|
+
.vuiMenuItem {
|
|
22
|
+
padding: $sizeS $sizeM;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.vuiMenuItem--clickable {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Color
|
|
31
|
+
$color: (
|
|
32
|
+
neutral: (
|
|
33
|
+
"color": $colorText,
|
|
34
|
+
"background-color": $colorPrimaryLighterShade,
|
|
35
|
+
"hover-color": $colorPrimary
|
|
36
|
+
),
|
|
37
|
+
primary: (
|
|
38
|
+
"color": $colorPrimary,
|
|
39
|
+
"background-color": $colorPrimaryLighterShade,
|
|
40
|
+
"hover-color": $colorPrimary
|
|
41
|
+
),
|
|
42
|
+
danger: (
|
|
43
|
+
"color": $colorDanger,
|
|
44
|
+
"background-color": $colorDangerLighterShade,
|
|
45
|
+
"hover-color": $colorDanger
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
@each $colorName, $colorValue in $color {
|
|
50
|
+
.vuiMenuItem--#{$colorName} {
|
|
51
|
+
color: #{map.get($colorValue, "color")};
|
|
52
|
+
|
|
53
|
+
&.vuiMenuItem--clickable {
|
|
54
|
+
&:hover {
|
|
55
|
+
background-color: #{map.get($colorValue, "background-color")};
|
|
56
|
+
|
|
57
|
+
.vuiMenuItem__title,
|
|
58
|
+
.vuiMenuItem__text {
|
|
59
|
+
color: #{map.get($colorValue, "hover-color")};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.vuiMenuItem__title {
|
|
67
|
+
font-size: $fontSizeMedium;
|
|
68
|
+
line-height: 1.4;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.vuiMenuItem__text {
|
|
72
|
+
color: $colorSubdued;
|
|
73
|
+
font-size: $fontSizeSmall;
|
|
74
|
+
line-height: 1.4;
|
|
75
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
declare const COLOR: readonly ["primary", "danger"];
|
|
3
|
+
type Props = {
|
|
4
|
+
className?: string;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
color?: (typeof COLOR)[number];
|
|
11
|
+
};
|
|
12
|
+
export declare const VuiModal: ({ className, color, title, icon, children, isOpen, onClose, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { useEffect, useRef } from "react";
|
|
14
|
+
import classNames from "classnames";
|
|
15
|
+
import { FocusOn } from "react-focus-on";
|
|
16
|
+
import { BiX } from "react-icons/bi";
|
|
17
|
+
import { VuiFlexContainer } from "../flex/FlexContainer";
|
|
18
|
+
import { VuiFlexItem } from "../flex/FlexItem";
|
|
19
|
+
import { VuiIconButton } from "../button/IconButton";
|
|
20
|
+
import { VuiIcon } from "../icon/Icon";
|
|
21
|
+
import { VuiPortal } from "../portal/Portal";
|
|
22
|
+
import { VuiScreenBlock } from "../screenBlock/ScreenBlock";
|
|
23
|
+
import { useVuiContext } from "../context/Context";
|
|
24
|
+
const COLOR = ["primary", "danger"];
|
|
25
|
+
export const VuiModal = (_a) => {
|
|
26
|
+
var { className, color = "primary", title, icon, children, isOpen, onClose } = _a, rest = __rest(_a, ["className", "color", "title", "icon", "children", "isOpen", "onClose"]);
|
|
27
|
+
const { DrawerTitle } = useVuiContext();
|
|
28
|
+
const returnFocusElRef = useRef(null);
|
|
29
|
+
// Return focus on unmount.
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
var _a;
|
|
32
|
+
if (isOpen) {
|
|
33
|
+
returnFocusElRef.current = document.activeElement;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
(_a = returnFocusElRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
37
|
+
returnFocusElRef.current = null;
|
|
38
|
+
}
|
|
39
|
+
}, [isOpen]);
|
|
40
|
+
// Allow contents to respond to blur events before unmounting.
|
|
41
|
+
const onCloseDelayed = () => {
|
|
42
|
+
window.setTimeout(() => {
|
|
43
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
44
|
+
}, 0);
|
|
45
|
+
};
|
|
46
|
+
const classes = classNames("vuiModal", `vuiModal--${color}`, className);
|
|
47
|
+
return (_jsx(VuiPortal, { children: isOpen && (_jsx(VuiScreenBlock, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: onCloseDelayed,
|
|
48
|
+
// Enable manual focus return to work.
|
|
49
|
+
returnFocus: false,
|
|
50
|
+
// Enable focus on contents when it's open,
|
|
51
|
+
// but enable manual focus return to work when it's closed.
|
|
52
|
+
autoFocus: isOpen }, { children: _jsx("div", Object.assign({ className: "vuiModalContainer" }, { children: _jsxs("div", Object.assign({ className: classes }, rest, { children: [_jsx("div", Object.assign({ className: "vuiModalHeader" }, { children: _jsxs(VuiFlexContainer, Object.assign({ justifyContent: "spaceBetween", alignItems: "center" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xs" }, { children: [icon && (_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIcon, Object.assign({ size: "l" }, { children: icon })) }))), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx("div", Object.assign({ className: "vuiModalHeader__title" }, { children: _jsx(DrawerTitle, { children: title }) })) }))] })) })), onClose && (_jsx(VuiFlexItem, { children: _jsx(VuiIconButton, { onClick: onCloseDelayed, color: "neutral", icon: _jsx(VuiIcon, Object.assign({ size: "m", color: "neutral" }, { children: _jsx(BiX, {}) })) }) }))] })) })), _jsx("div", Object.assign({ className: "vuiModalContent" }, { children: _jsx("div", Object.assign({ className: "vuiModalContent__inner" }, { children: children })) }))] })) })) })) })) }));
|
|
53
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
$modalWidth: 500px;
|
|
4
|
+
|
|
5
|
+
@keyframes modalIn {
|
|
6
|
+
0% {
|
|
7
|
+
transform: translateX(40px);
|
|
8
|
+
opacity: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
100% {
|
|
12
|
+
transform: translateX(0);
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.vuiModalContainer {
|
|
18
|
+
position: fixed;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
animation: modalIn $transitionSpeed cubic-bezier(0, 1, 1, 1);
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.vuiModal {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
width: 100%;
|
|
34
|
+
max-width: $modalWidth;
|
|
35
|
+
max-height: calc(100vh - 200px);
|
|
36
|
+
background-color: $colorEmptyShade;
|
|
37
|
+
border: 1px solid $borderColor;
|
|
38
|
+
z-index: $modalZIndex;
|
|
39
|
+
pointer-events: all;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.vuiModalHeader {
|
|
43
|
+
padding: $sizeM;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.vuiModalHeader__title {
|
|
47
|
+
font-size: $fontSizeXLarge;
|
|
48
|
+
font-weight: $fontWeightBold;
|
|
49
|
+
line-height: 1.2;
|
|
50
|
+
color: $colorText;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.vuiModalContent {
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
overscroll-behavior: contain;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.vuiModalContent__inner {
|
|
59
|
+
padding: $sizeL $sizeM $sizeXxl;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Color
|
|
63
|
+
$color: (
|
|
64
|
+
primary: (
|
|
65
|
+
"background-color": $colorPrimaryLightShade,
|
|
66
|
+
"color": $colorText
|
|
67
|
+
),
|
|
68
|
+
danger: (
|
|
69
|
+
"background-color": $colorDangerLightShade,
|
|
70
|
+
"color": $colorDanger
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
@each $colorName, $colorValue in $color {
|
|
75
|
+
.vuiModal--#{$colorName} {
|
|
76
|
+
.vuiModalHeader {
|
|
77
|
+
background-color: #{map.get($colorValue, "background-color")};
|
|
78
|
+
|
|
79
|
+
.vuiModalHeader__title,
|
|
80
|
+
.vuiIcon {
|
|
81
|
+
color: #{map.get($colorValue, "color")};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Notification = {
|
|
2
|
+
color: "primary" | "success" | "warning" | "danger";
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
type Props = {
|
|
6
|
+
notification: Notification;
|
|
7
|
+
onDismiss: (notification: Notification) => void;
|
|
8
|
+
notificationsCount: number;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const VuiNotification: ({ notification, onDismiss, notificationsCount, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|