@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,36 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { FlexSpacing } from "./types";
|
|
3
|
+
declare const alignItemsToClassNameMap: {
|
|
4
|
+
readonly baseline: "vuiFlexContainer--alignItemsBaseline";
|
|
5
|
+
readonly center: "vuiFlexContainer--alignItemsCenter";
|
|
6
|
+
readonly end: "vuiFlexContainer--alignItemsEnd";
|
|
7
|
+
readonly start: "vuiFlexContainer--alignItemsStart";
|
|
8
|
+
readonly stretch: "vuiFlexContainer--alignItemsStretch";
|
|
9
|
+
};
|
|
10
|
+
declare const directionToClassNameMap: {
|
|
11
|
+
readonly column: "vuiFlexContainer--directionColumn";
|
|
12
|
+
readonly columnReverse: "vuiFlexContainer--directionColumnReverse";
|
|
13
|
+
readonly row: "vuiFlexContainer--directionRow";
|
|
14
|
+
readonly rowReverse: "vuiFlexContainer--directionRowReverse";
|
|
15
|
+
};
|
|
16
|
+
declare const justifyContentToClassNameMap: {
|
|
17
|
+
readonly center: "vuiFlexContainer--justifyContentCenter";
|
|
18
|
+
readonly end: "vuiFlexContainer--justifyContentEnd";
|
|
19
|
+
readonly start: "vuiFlexContainer--justifyContentStart";
|
|
20
|
+
readonly spaceAround: "vuiFlexContainer--justifyContentSpaceAround";
|
|
21
|
+
readonly spaceBetween: "vuiFlexContainer--justifyContentSpaceBetween";
|
|
22
|
+
readonly spaceEvenly: "vuiFlexContainer--justifyContentSpaceEvenly";
|
|
23
|
+
};
|
|
24
|
+
export type Props = {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
alignItems?: keyof typeof alignItemsToClassNameMap;
|
|
27
|
+
direction?: keyof typeof directionToClassNameMap;
|
|
28
|
+
justifyContent?: keyof typeof justifyContentToClassNameMap;
|
|
29
|
+
spacing?: FlexSpacing;
|
|
30
|
+
wrap?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
fullWidth?: boolean;
|
|
33
|
+
inline?: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const VuiFlexContainer: ({ children, alignItems, direction, justifyContent, spacing, wrap, className, fullWidth, inline, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
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 } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
const alignItemsToClassNameMap = {
|
|
15
|
+
baseline: "vuiFlexContainer--alignItemsBaseline",
|
|
16
|
+
center: "vuiFlexContainer--alignItemsCenter",
|
|
17
|
+
end: "vuiFlexContainer--alignItemsEnd",
|
|
18
|
+
start: "vuiFlexContainer--alignItemsStart",
|
|
19
|
+
stretch: "vuiFlexContainer--alignItemsStretch"
|
|
20
|
+
};
|
|
21
|
+
const directionToClassNameMap = {
|
|
22
|
+
column: "vuiFlexContainer--directionColumn",
|
|
23
|
+
columnReverse: "vuiFlexContainer--directionColumnReverse",
|
|
24
|
+
row: "vuiFlexContainer--directionRow",
|
|
25
|
+
rowReverse: "vuiFlexContainer--directionRowReverse"
|
|
26
|
+
};
|
|
27
|
+
const justifyContentToClassNameMap = {
|
|
28
|
+
center: "vuiFlexContainer--justifyContentCenter",
|
|
29
|
+
end: "vuiFlexContainer--justifyContentEnd",
|
|
30
|
+
start: "vuiFlexContainer--justifyContentStart",
|
|
31
|
+
spaceAround: "vuiFlexContainer--justifyContentSpaceAround",
|
|
32
|
+
spaceBetween: "vuiFlexContainer--justifyContentSpaceBetween",
|
|
33
|
+
spaceEvenly: "vuiFlexContainer--justifyContentSpaceEvenly"
|
|
34
|
+
};
|
|
35
|
+
const spacingToClassNameMap = {
|
|
36
|
+
none: "vuiFlexContainer--spacingNone",
|
|
37
|
+
xxs: "vuiFlexContainer--spacingXxs",
|
|
38
|
+
xs: "vuiFlexContainer--spacingXs",
|
|
39
|
+
s: "vuiFlexContainer--spacingS",
|
|
40
|
+
m: "vuiFlexContainer--spacingM",
|
|
41
|
+
l: "vuiFlexContainer--spacingL",
|
|
42
|
+
xl: "vuiFlexContainer--spacingXl",
|
|
43
|
+
xxl: "vuiFlexContainer--spacingXxl"
|
|
44
|
+
};
|
|
45
|
+
export const VuiFlexContainer = (_a) => {
|
|
46
|
+
var { children, alignItems = "stretch", direction = "row", justifyContent = "start", spacing = "m", wrap, className, fullWidth, inline } = _a, rest = __rest(_a, ["children", "alignItems", "direction", "justifyContent", "spacing", "wrap", "className", "fullWidth", "inline"]);
|
|
47
|
+
const classes = classNames(className, "vuiFlexContainer", alignItemsToClassNameMap[alignItems], directionToClassNameMap[direction], justifyContentToClassNameMap[justifyContent], spacingToClassNameMap[spacing], {
|
|
48
|
+
"vuiFlexContainer--wrap": wrap,
|
|
49
|
+
"vuiFlexContainer--fullWidth": fullWidth,
|
|
50
|
+
"vuiFlexContainer--inline": inline
|
|
51
|
+
});
|
|
52
|
+
return (_jsx("div", Object.assign({ className: classes }, rest, { children: children })));
|
|
53
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
declare const GROW: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
3
|
+
declare const SHRINK: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
4
|
+
declare const BASIS: readonly ["auto", "content", "fill", "maxContent", "minContent", "none"];
|
|
5
|
+
declare const alignItemsToClassNameMap: {
|
|
6
|
+
readonly baseline: "vuiFlexItem--alignItemsBaseline";
|
|
7
|
+
readonly center: "vuiFlexItem--alignItemsCenter";
|
|
8
|
+
readonly end: "vuiFlexItem--alignItemsEnd";
|
|
9
|
+
readonly start: "vuiFlexItem--alignItemsStart";
|
|
10
|
+
readonly stretch: "vuiFlexItem--alignItemsStretch";
|
|
11
|
+
};
|
|
12
|
+
type Props = {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
grow?: (typeof GROW)[number] | boolean;
|
|
15
|
+
shrink?: (typeof SHRINK)[number] | boolean;
|
|
16
|
+
basis?: (typeof BASIS)[number];
|
|
17
|
+
alignItems?: keyof typeof alignItemsToClassNameMap;
|
|
18
|
+
className?: string;
|
|
19
|
+
truncate?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const VuiFlexItem: ({ children, grow, shrink, basis, alignItems, className, truncate, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -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
|
+
const GROW = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
15
|
+
const SHRINK = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
16
|
+
const BASIS = ["auto", "content", "fill", "maxContent", "minContent", "none"];
|
|
17
|
+
const alignItemsToClassNameMap = {
|
|
18
|
+
baseline: "vuiFlexItem--alignItemsBaseline",
|
|
19
|
+
center: "vuiFlexItem--alignItemsCenter",
|
|
20
|
+
end: "vuiFlexItem--alignItemsEnd",
|
|
21
|
+
start: "vuiFlexItem--alignItemsStart",
|
|
22
|
+
stretch: "vuiFlexItem--alignItemsStretch"
|
|
23
|
+
};
|
|
24
|
+
export const VuiFlexItem = (_a) => {
|
|
25
|
+
var { children, grow, shrink, basis = "auto", alignItems = "stretch", className, truncate } = _a, rest = __rest(_a, ["children", "grow", "shrink", "basis", "alignItems", "className", "truncate"]);
|
|
26
|
+
const isGrowNone = grow === false;
|
|
27
|
+
const isShrinkNone = shrink === false;
|
|
28
|
+
const classes = classNames("vuiFlexItem", `vuiFlexItem--${basis}`, alignItemsToClassNameMap[alignItems], {
|
|
29
|
+
[`vuiFlexItem--flexGrow${grow}`]: typeof grow === "number",
|
|
30
|
+
"vuiFlexItem--flexGrowNone": isGrowNone,
|
|
31
|
+
[`vuiFlexItem--flexShrink${shrink}`]: typeof shrink === "number",
|
|
32
|
+
"vuiFlexItem--flexShrinkNone": isShrinkNone,
|
|
33
|
+
"vuiFlexItem--truncate": truncate
|
|
34
|
+
}, className);
|
|
35
|
+
return (_jsx("div", Object.assign({ className: classes }, rest, { children: children })));
|
|
36
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.vuiFlexContainer {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: stretch;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.vuiFlexContainer--inline {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.vuiFlexContainer--fullWidth {
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.vuiFlexContainer--wrap {
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// alignItems
|
|
19
|
+
$alignItems: (
|
|
20
|
+
alignItemsBaseline: baseline,
|
|
21
|
+
alignItemsCenter: center,
|
|
22
|
+
alignItemsEnd: end,
|
|
23
|
+
alignItemsStart: start,
|
|
24
|
+
alignItemsStretch: stretch
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
@each $alignItemsName, $alignItemsValue in $alignItems {
|
|
28
|
+
.vuiFlexContainer--#{$alignItemsName} {
|
|
29
|
+
align-items: $alignItemsValue;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// direction
|
|
34
|
+
$direction: (
|
|
35
|
+
directionColumn: column,
|
|
36
|
+
directionColumnReverse: column-reverse,
|
|
37
|
+
directionRow: row,
|
|
38
|
+
directionRowReverse: row-reverse
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
@each $directionName, $directionValue in $direction {
|
|
42
|
+
.vuiFlexContainer--#{$directionName} {
|
|
43
|
+
flex-direction: $directionValue;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// justifyContent
|
|
48
|
+
$justifyContent: (
|
|
49
|
+
justifyContentCenter: center,
|
|
50
|
+
justifyContentEnd: end,
|
|
51
|
+
justifyContentStart: start,
|
|
52
|
+
justifyContentSpaceAround: space-around,
|
|
53
|
+
justifyContentSpaceBetween: space-between,
|
|
54
|
+
justifyContentSpaceEvenly: space-evenly
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
@each $justifyContentName, $justifyContentValue in $justifyContent {
|
|
58
|
+
.vuiFlexContainer--#{$justifyContentName} {
|
|
59
|
+
justify-content: $justifyContentValue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// spacing
|
|
64
|
+
$spacing: (
|
|
65
|
+
spacingNone: 0,
|
|
66
|
+
spacingXxs: $sizeXxs,
|
|
67
|
+
spacingXs: $sizeXs,
|
|
68
|
+
spacingS: $sizeS,
|
|
69
|
+
spacingM: $sizeM,
|
|
70
|
+
spacingL: $sizeL,
|
|
71
|
+
spacingXl: $sizeXl,
|
|
72
|
+
spacingXxl: $sizeXxl
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
@each $spacingName, $spacingValue in $spacing {
|
|
76
|
+
.vuiFlexContainer--#{$spacingName} {
|
|
77
|
+
gap: $spacingValue;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.vuiFlexItem {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.vuiFlexItem--truncate {
|
|
8
|
+
min-width: 40px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// alignItems
|
|
12
|
+
$alignItems: (
|
|
13
|
+
alignItemsBaseline: baseline,
|
|
14
|
+
alignItemsCenter: center,
|
|
15
|
+
alignItemsEnd: end,
|
|
16
|
+
alignItemsStart: start,
|
|
17
|
+
alignItemsStretch: stretch
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
@each $alignItemsName, $alignItemsValue in $alignItems {
|
|
21
|
+
.vuiFlexItem--#{$alignItemsName} {
|
|
22
|
+
align-items: $alignItemsValue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Grow
|
|
27
|
+
@for $i from 0 through 10 {
|
|
28
|
+
.vuiFlexItem--flexGrow#{$i} {
|
|
29
|
+
flex-grow: $i;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.vuiFlexItem--flexGrowNone {
|
|
34
|
+
flex-basis: auto;
|
|
35
|
+
flex-grow: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Shrink
|
|
39
|
+
@for $i from 0 through 10 {
|
|
40
|
+
.vuiFlexItem--flexShrink#{$i} {
|
|
41
|
+
flex-shrink: $i;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.vuiFlexItem--flexShrinkNone {
|
|
46
|
+
flex-basis: auto;
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Basis
|
|
51
|
+
$basis: (
|
|
52
|
+
auto: auto,
|
|
53
|
+
content: content,
|
|
54
|
+
fill: fill,
|
|
55
|
+
maxContent: max-content,
|
|
56
|
+
minContent: min-content,
|
|
57
|
+
none: 0
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
@each $basisName, $basisValue in $basis {
|
|
61
|
+
.vuiFlexItem--#{$basisName} {
|
|
62
|
+
flex-basis: $basisValue;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const FLEX_SPACING = ["none", "xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { createId } from "../../../utils/createId";
|
|
14
|
+
import { VuiFlexContainer } from "../../flex/FlexContainer";
|
|
15
|
+
import { VuiFlexItem } from "../../flex/FlexItem";
|
|
16
|
+
export const VuiCheckbox = (_a) => {
|
|
17
|
+
var { checked, onChange, label, disabled } = _a, rest = __rest(_a, ["checked", "onChange", "label", "disabled"]);
|
|
18
|
+
const id = createId();
|
|
19
|
+
const checkbox = (_jsx("input", Object.assign({ id: id, type: "checkbox", checked: checked, onChange: onChange, disabled: disabled }, rest)));
|
|
20
|
+
if (!label) {
|
|
21
|
+
return checkbox;
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs(VuiFlexContainer, Object.assign({ spacing: "xs", alignItems: "center" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: checkbox })), _jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx("label", Object.assign({ className: "vuiCheckboxLabel", htmlFor: id }, { children: label })) }))] })));
|
|
24
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { VuiCheckbox } from "./checkbox/Checkbox";
|
|
2
|
+
export { VuiLabel } from "./label/Label";
|
|
3
|
+
export { VuiNumberInput } from "./input/NumberInput";
|
|
4
|
+
export { VuiRadioButton } from "./radioButton/RadioButton";
|
|
5
|
+
export { VuiSelect } from "./select/Select";
|
|
6
|
+
export { VuiSuperRadioGroup } from "./superRadioGroup/SuperRadioGroup";
|
|
7
|
+
export { VuiTextInput } from "./input/TextInput";
|
|
8
|
+
export { VuiTextArea } from "./textArea/TextArea";
|
|
9
|
+
export { VuiPasswordInput } from "./input/PasswordInput";
|
|
10
|
+
export type { RadioButtonConfig } from "./superRadioGroup/types";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { VuiCheckbox } from "./checkbox/Checkbox";
|
|
2
|
+
export { VuiLabel } from "./label/Label";
|
|
3
|
+
export { VuiNumberInput } from "./input/NumberInput";
|
|
4
|
+
export { VuiRadioButton } from "./radioButton/RadioButton";
|
|
5
|
+
export { VuiSelect } from "./select/Select";
|
|
6
|
+
export { VuiSuperRadioGroup } from "./superRadioGroup/SuperRadioGroup";
|
|
7
|
+
export { VuiTextInput } from "./input/TextInput";
|
|
8
|
+
export { VuiTextArea } from "./textArea/TextArea";
|
|
9
|
+
export { VuiPasswordInput } from "./input/PasswordInput";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const SIZE: readonly ["m", "l"];
|
|
2
|
+
export type BasicInputProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
isInvalid?: boolean;
|
|
8
|
+
size?: (typeof SIZE)[number];
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
onSubmit?: () => void;
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
autoComplete?: boolean | string;
|
|
13
|
+
};
|
|
14
|
+
export declare const VuiBasicInput: import("react").ForwardRefExoticComponent<BasicInputProps & import("react").RefAttributes<HTMLInputElement | null>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
const SIZE = ["m", "l"];
|
|
16
|
+
export const VuiBasicInput = forwardRef((_a, ref) => {
|
|
17
|
+
var { className, id, name, placeholder, size = "m", fullWidth, onSubmit, isInvalid, autoFocus, autoComplete } = _a, rest = __rest(_a, ["className", "id", "name", "placeholder", "size", "fullWidth", "onSubmit", "isInvalid", "autoFocus", "autoComplete"]);
|
|
18
|
+
const classes = classNames("vuiInput", `vuiInput--${size}`, {
|
|
19
|
+
"vuiInput-isInvalid": isInvalid,
|
|
20
|
+
"vuiInput--fullWidth": fullWidth
|
|
21
|
+
}, className);
|
|
22
|
+
const handleKeyDown = (e) => {
|
|
23
|
+
if (e.key === "Enter") {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return (_jsx("input", Object.assign({ type: "text", autoComplete: autoComplete === true ? "on" : autoComplete === false ? "off" : autoComplete, autoFocus: autoFocus, ref: ref, className: classes, id: id, name: name, placeholder: placeholder, onKeyDown: handleKeyDown }, rest)));
|
|
30
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BasicInputProps } from "./BasicInput";
|
|
2
|
+
export declare const VuiNumberInput: import("react").ForwardRefExoticComponent<BasicInputProps & {
|
|
3
|
+
value?: number | undefined;
|
|
4
|
+
onChange: (value?: number) => void;
|
|
5
|
+
max?: number | undefined;
|
|
6
|
+
min?: number | undefined;
|
|
7
|
+
step?: number | undefined;
|
|
8
|
+
} & import("react").RefAttributes<HTMLInputElement | null>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
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, useEffect, useState } from "react";
|
|
14
|
+
import { VuiBasicInput } from "./BasicInput";
|
|
15
|
+
export const VuiNumberInput = forwardRef((_a, ref) => {
|
|
16
|
+
var { value, onChange, max, min, step } = _a, rest = __rest(_a, ["value", "onChange", "max", "min", "step"]);
|
|
17
|
+
const [localValue, setLocalValue] = useState(value);
|
|
18
|
+
// This is a hacky solution to the number input misbehaving on Firefox.
|
|
19
|
+
// If we were to apply the value and onChange values directly to the
|
|
20
|
+
// value and onChange props of the input, then a user who:
|
|
21
|
+
// 1. Selects all
|
|
22
|
+
// 2. Types 1.0
|
|
23
|
+
// will have the input show "0" as soon as they enter a decimal point.
|
|
24
|
+
// When that character is entered, onChange is called with undefined.
|
|
25
|
+
// This value gets stored in the value state, which resets the value to 0.
|
|
26
|
+
// For some reason, using a useState hook to store the value doesn't have
|
|
27
|
+
// this problem.
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
// Reflect the upstream value when it changes. Ignore 0
|
|
30
|
+
// because that indicates the user has entered a decimal point.
|
|
31
|
+
if (value !== 0) {
|
|
32
|
+
setLocalValue(value);
|
|
33
|
+
}
|
|
34
|
+
}, [value]);
|
|
35
|
+
// Part of the hacky solution above.
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
// Set value locally so an undefined value doesn't reset it to 0.
|
|
38
|
+
// Pass the value upstream, e.g. so it can be persisted.
|
|
39
|
+
onChange(localValue !== null && localValue !== void 0 ? localValue : 0);
|
|
40
|
+
}, [localValue]);
|
|
41
|
+
const onChangeValue = (e) => {
|
|
42
|
+
// Enable resetting the value to undefined.
|
|
43
|
+
if (e.target.value === "")
|
|
44
|
+
return setLocalValue(undefined);
|
|
45
|
+
const numberValue = Number(e.target.value);
|
|
46
|
+
if (isNaN(numberValue))
|
|
47
|
+
return setLocalValue(undefined);
|
|
48
|
+
setLocalValue(Number(e.target.value));
|
|
49
|
+
};
|
|
50
|
+
const onBlur = () => {
|
|
51
|
+
if (min !== undefined && value !== undefined && value < min)
|
|
52
|
+
onChange(min);
|
|
53
|
+
if (max !== undefined && value !== undefined && value > max)
|
|
54
|
+
onChange(max);
|
|
55
|
+
};
|
|
56
|
+
const props = Object.assign({ type: "number", value: localValue !== null && localValue !== void 0 ? localValue : "", onChange: onChangeValue, onBlur,
|
|
57
|
+
max,
|
|
58
|
+
min,
|
|
59
|
+
step }, rest);
|
|
60
|
+
return _jsx(VuiBasicInput, Object.assign({}, props));
|
|
61
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BasicInputProps } from "./BasicInput";
|
|
2
|
+
export declare const VuiPasswordInput: import("react").ForwardRefExoticComponent<BasicInputProps & {
|
|
3
|
+
value?: string | undefined;
|
|
4
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
+
maxLength?: number | undefined;
|
|
6
|
+
isPasswordVisible?: boolean | undefined;
|
|
7
|
+
} & import("react").RefAttributes<HTMLInputElement | null>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { VuiBasicInput } from "./BasicInput";
|
|
16
|
+
export const VuiPasswordInput = forwardRef((_a, ref) => {
|
|
17
|
+
var { className, isPasswordVisible } = _a, rest = __rest(_a, ["className", "isPasswordVisible"]);
|
|
18
|
+
const classes = classNames("vuiInput--text", className);
|
|
19
|
+
const props = Object.assign({ type: isPasswordVisible ? "text" : "password" }, rest);
|
|
20
|
+
return _jsx(VuiBasicInput, Object.assign({ className: classes, ref: ref }, props));
|
|
21
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BasicInputProps } from "./BasicInput";
|
|
2
|
+
export declare const VuiTextInput: import("react").ForwardRefExoticComponent<BasicInputProps & {
|
|
3
|
+
value?: string | undefined;
|
|
4
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
+
maxLength?: number | undefined;
|
|
6
|
+
} & import("react").RefAttributes<HTMLInputElement | null>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { VuiBasicInput } from "./BasicInput";
|
|
16
|
+
export const VuiTextInput = forwardRef((_a, ref) => {
|
|
17
|
+
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
18
|
+
const classes = classNames("vuiInput--text", className);
|
|
19
|
+
const props = Object.assign({ type: "text" }, rest);
|
|
20
|
+
return _jsx(VuiBasicInput, Object.assign({ className: classes, ref: ref }, props));
|
|
21
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.vuiInput {
|
|
2
|
+
appearance: none;
|
|
3
|
+
border-radius: $sizeXxs;
|
|
4
|
+
border: 1px solid $colorMediumShade;
|
|
5
|
+
background-color: $colorEmptyShade;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.vuiInput--m {
|
|
9
|
+
padding: $sizeXs $sizeM;
|
|
10
|
+
font-size: $fontSizeStandard;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.vuiInput--l {
|
|
14
|
+
padding: $sizeS $sizeM;
|
|
15
|
+
font-size: $fontSizeLarge;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.vuiInput--fullWidth {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.vuiInput-isInvalid {
|
|
23
|
+
border-color: $colorDanger;
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export const VuiLabel = (_a) => {
|
|
15
|
+
var { className, labelFor, children } = _a, rest = __rest(_a, ["className", "labelFor", "children"]);
|
|
16
|
+
const classes = classNames("vuiLabel", className);
|
|
17
|
+
return (_jsx("label", Object.assign({ className: classes, htmlFor: labelFor }, rest, { children: children })));
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
onChange: () => void;
|
|
4
|
+
groupName: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const VuiRadioButton: ({ checked, onChange, label, groupName, disabled, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { createId } from "../../../utils/createId";
|
|
14
|
+
import { VuiFlexContainer } from "../../flex/FlexContainer";
|
|
15
|
+
import { VuiFlexItem } from "../../flex/FlexItem";
|
|
16
|
+
export const VuiRadioButton = (_a) => {
|
|
17
|
+
var { checked, onChange, label, groupName, disabled } = _a, rest = __rest(_a, ["checked", "onChange", "label", "groupName", "disabled"]);
|
|
18
|
+
const id = createId();
|
|
19
|
+
const radioButton = (_jsx("input", Object.assign({ id: id, type: "radio", checked: checked, onChange: onChange, disabled: disabled }, rest)));
|
|
20
|
+
if (!label) {
|
|
21
|
+
return radioButton;
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs(VuiFlexContainer, Object.assign({ spacing: "xs", alignItems: "center" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: radioButton })), _jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx("label", Object.assign({ className: "vuiRadioButtonLabel", htmlFor: id }, { children: label })) }))] })));
|
|
24
|
+
};
|