@vectara/vectara-ui 3.5.0 → 9.1.0
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/CODEOWNERS +3 -0
- package/lib/components/accordion/Accordion.js +1 -1
- package/lib/components/accordion/_index.scss +17 -5
- package/lib/components/accountButton/AccountButton.d.ts +10 -0
- package/lib/components/accountButton/AccountButton.js +36 -0
- package/lib/components/accountButton/_index.scss +48 -0
- package/lib/components/app/AppHeader.d.ts +12 -2
- package/lib/components/app/AppHeader.js +4 -2
- package/lib/components/app/AppLayout.d.ts +1 -0
- package/lib/components/app/AppLayout.js +15 -3
- package/lib/components/app/appSideNav/AppSideNav.d.ts +4 -2
- package/lib/components/app/appSideNav/AppSideNav.js +9 -6
- package/lib/components/app/appSideNav/AppSideNavLink.d.ts +3 -3
- package/lib/components/app/appSideNav/AppSideNavLink.js +6 -5
- package/lib/components/app/appSideNav/AppSideNavTree.js +5 -5
- package/lib/components/app/appSideNav/_index.scss +10 -5
- package/lib/components/app/appSideNav/appSideNav.scss +26 -6
- package/lib/components/app/appSideNav/appSideNavTree.scss +14 -2
- package/lib/components/app/types.d.ts +1 -1
- package/lib/components/badge/Badge.d.ts +2 -1
- package/lib/components/badge/Badge.js +14 -7
- package/lib/components/badge/_index.scss +5 -0
- package/lib/components/button/BaseButton.d.ts +1 -2
- package/lib/components/button/BaseButton.js +3 -1
- package/lib/components/button/IconButton.d.ts +1 -0
- package/lib/components/button/IconButton.js +11 -4
- package/lib/components/button/baseButton.scss +4 -2
- package/lib/components/button/createButtonIcon.d.ts +2 -1
- package/lib/components/button/createButtonIcon.js +17 -6
- package/lib/components/button/iconButton.scss +5 -1
- package/lib/components/callout/Callout.js +2 -1
- package/lib/components/callout/_index.scss +13 -5
- package/lib/components/card/_index.scss +2 -2
- package/lib/components/chat/_index.scss +2 -2
- package/lib/components/code/Code.js +16 -6
- package/lib/components/context/Context.js +1 -1
- package/lib/components/copyButton/CopyButton.js +29 -6
- package/lib/components/datePicker/Calendar.d.ts +22 -0
- package/lib/components/datePicker/Calendar.js +37 -0
- package/lib/components/datePicker/DatePicker.d.ts +29 -0
- package/lib/components/datePicker/DatePicker.js +55 -0
- package/lib/components/datePicker/DateRangePicker.d.ts +14 -0
- package/lib/components/datePicker/DateRangePicker.js +58 -0
- package/lib/components/datePicker/_index.scss +103 -0
- package/lib/components/drawer/_index.scss +1 -2
- package/lib/components/form/_index.scss +1 -0
- package/lib/components/form/checkbox/Checkbox.d.ts +1 -4
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/form/index.js +1 -0
- package/lib/components/form/input/BasicInput.d.ts +9 -8
- package/lib/components/form/input/BasicInput.js +4 -3
- package/lib/components/form/input/NumberInput.d.ts +1 -1
- package/lib/components/form/input/NumberInput.js +1 -1
- package/lib/components/form/input/PasswordInput.d.ts +7 -2
- package/lib/components/form/input/TextInput.d.ts +9 -3
- package/lib/components/form/input/_index.scss +5 -0
- package/lib/components/form/itemsInput/ItemsInput.d.ts +12 -0
- package/lib/components/form/itemsInput/ItemsInput.js +30 -0
- package/lib/components/form/itemsInput/_index.scss +14 -0
- package/lib/components/form/radioButton/RadioButton.d.ts +3 -6
- package/lib/components/form/radioButton/RadioButton.js +2 -2
- package/lib/components/form/select/Select.d.ts +2 -7
- package/lib/components/form/superRadioGroup/_index.scss +0 -2
- package/lib/components/form/textArea/TextArea.d.ts +2 -9
- package/lib/components/form/textArea/TextArea.js +2 -2
- package/lib/components/grid/Grid.d.ts +1 -1
- package/lib/components/grid/Grid.js +1 -1
- package/lib/components/grid/_index.scss +18 -0
- package/lib/components/icon/Icon.d.ts +4 -2
- package/lib/components/icon/Icon.js +3 -5
- package/lib/components/icon/_index.scss +93 -3
- package/lib/components/icon/types.d.ts +1 -0
- package/lib/components/icon/types.js +1 -0
- package/lib/components/index.d.ts +13 -5
- package/lib/components/index.js +12 -3
- package/lib/components/link/Link.d.ts +1 -1
- package/lib/components/link/Link.js +3 -3
- package/lib/components/link/_index.scss +2 -0
- package/lib/components/link/types.d.ts +2 -1
- package/lib/components/list/_index.scss +1 -1
- package/lib/components/modal/Modal.d.ts +2 -1
- package/lib/components/modal/Modal.js +2 -2
- package/lib/components/modal/_index.scss +5 -5
- package/lib/components/notification/Notification.d.ts +5 -7
- package/lib/components/notification/Notification.js +28 -13
- package/lib/components/notification/Notifications.d.ts +2 -10
- package/lib/components/notification/Notifications.js +5 -34
- package/lib/components/notification/_index.scss +0 -90
- package/lib/components/optionsButton/OptionsButton.d.ts +2 -2
- package/lib/components/optionsButton/OptionsButton.js +2 -2
- package/lib/components/optionsList/OptionsListItem.js +2 -2
- package/lib/components/optionsList/_index.scss +9 -4
- package/lib/components/panel/Panel.d.ts +12 -0
- package/lib/components/panel/Panel.js +12 -0
- package/lib/components/panel/_index.scss +63 -0
- package/lib/components/popover/Popover.d.ts +3 -2
- package/lib/components/popover/Popover.js +57 -18
- package/lib/components/popover/_index.scss +18 -0
- package/lib/components/portal/Portal.d.ts +1 -1
- package/lib/components/portal/Portal.js +5 -6
- package/lib/components/prompt/_index.scss +2 -2
- package/lib/components/searchInput/SearchInput.d.ts +8 -1
- package/lib/components/searchInput/SearchInput.js +9 -3
- package/lib/components/searchInput/_index.scss +14 -0
- package/lib/components/searchSelect/SearchSelect.d.ts +3 -2
- package/lib/components/searchSelect/SearchSelect.js +26 -3
- package/lib/components/statList/_index.scss +1 -0
- package/lib/components/steps/Step.d.ts +18 -0
- package/lib/components/steps/Step.js +46 -0
- package/lib/components/steps/Steps.d.ts +9 -0
- package/lib/components/steps/Steps.js +46 -0
- package/lib/components/steps/_index.scss +191 -0
- package/lib/components/steps/types.d.ts +2 -0
- package/lib/components/steps/types.js +1 -0
- package/lib/components/summary/_index.scss +1 -1
- package/lib/components/table/Table.d.ts +6 -11
- package/lib/components/table/Table.js +17 -12
- package/lib/components/table/TableCell.d.ts +4 -2
- package/lib/components/table/TableCell.js +5 -3
- package/lib/components/table/TableHeaderCell.d.ts +5 -8
- package/lib/components/table/TableHeaderCell.js +3 -2
- package/lib/components/table/_index.scss +127 -8
- package/lib/components/table/types.d.ts +13 -0
- package/lib/components/tabs/Tabs.d.ts +3 -1
- package/lib/components/tabs/Tabs.js +2 -2
- package/lib/components/tabs/_enclosed.scss +42 -0
- package/lib/components/tabs/_index.scss +4 -23
- package/lib/components/tabs/_open.scss +44 -0
- package/lib/components/tooltip/Tooltip.d.ts +6 -0
- package/lib/components/tooltip/Tooltip.js +35 -0
- package/lib/components/tooltip/_index.scss +8 -0
- package/lib/components/topicButton/TopicButton.d.ts +5 -2
- package/lib/components/topicButton/TopicButton.js +4 -3
- package/lib/components/typography/_text.scss +7 -7
- package/lib/components/typography/_title.scss +5 -5
- package/lib/sassUtils/_app.scss +3 -0
- package/lib/sassUtils/_colors.scss +25 -18
- package/lib/sassUtils/_depth.scss +1 -0
- package/lib/sassUtils/_typography.scss +1 -0
- package/lib/sassUtils/index.scss +1 -1
- package/lib/styles/index.css +1970 -539
- package/lib/utils/copyToClipboard.d.ts +1 -0
- package/lib/utils/copyToClipboard.js +27 -0
- package/lib/utils/formatDate.d.ts +1 -0
- package/lib/utils/formatDate.js +15 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +16 -11
|
@@ -23,5 +23,5 @@ export const VuiAccordion = (_a) => {
|
|
|
23
23
|
const classes = classNames("vuiAccordionHeader", {
|
|
24
24
|
"vuiAccordionHeader--isOpen": isOpen
|
|
25
25
|
});
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsx("button", Object.assign({ className: classes, onClick: () => setIsOpen(!isOpen), id: buttonId, "aria-controls": contentId, "aria-expanded": isOpen }, rest, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", justifyContent: "start", spacing: "xxs" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIcon, Object.assign({ size: "m", color: "neutral" }, { children: isOpen ? _jsx(BiChevronDown, {}) : _jsx(BiChevronRight, {}) })) })), _jsx(VuiFlexItem, Object.assign({ className: "vuiAccordionHeader__title", grow: 1 }, { children: header }))] })) })), isOpen && (_jsx("div", Object.assign({ id: contentId, "aria-labelledby": buttonId }, { children: children })))] }));
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", Object.assign({ className: classes, onClick: () => setIsOpen(!isOpen), id: buttonId, "aria-controls": contentId, "aria-expanded": isOpen }, rest, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", justifyContent: "start", spacing: "xxs" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIcon, Object.assign({ size: "m", color: "neutral" }, { children: isOpen ? _jsx(BiChevronDown, {}) : _jsx(BiChevronRight, {}) })) })), _jsx(VuiFlexItem, Object.assign({ className: "vuiAccordionHeader__title", grow: 1 }, { children: header }))] })) })), isOpen && (_jsx("div", Object.assign({ className: "vuiAccordionBody", id: contentId, "aria-labelledby": buttonId }, { children: children })))] }));
|
|
27
27
|
};
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
.vuiAccordionHeader {
|
|
2
|
-
font-size: $
|
|
3
|
-
|
|
2
|
+
font-size: $fontSizeSmall;
|
|
3
|
+
font-weight: $fontWeightBold;
|
|
4
|
+
padding: $sizeXs $sizeS;
|
|
5
|
+
background-color: $colorEmptyShade;
|
|
6
|
+
border: 1px solid $borderColorLight;
|
|
4
7
|
width: 100%;
|
|
5
|
-
|
|
6
|
-
color: $colorSubdued;
|
|
8
|
+
border-radius: $sizeXxs;
|
|
7
9
|
|
|
8
10
|
&:hover {
|
|
9
11
|
color: $colorPrimary;
|
|
10
12
|
background-color: $colorPrimaryLighterShade;
|
|
13
|
+
border-color: transparentize($colorPrimary, 0.5);
|
|
11
14
|
text-decoration: underline;
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.vuiAccordionHeader--isOpen {
|
|
16
19
|
color: $colorText;
|
|
17
|
-
border-bottom-color: $borderColor;
|
|
18
20
|
font-weight: $fontWeightBold;
|
|
21
|
+
border-bottom-right-radius: 0;
|
|
22
|
+
border-bottom-left-radius: 0;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
.vuiAccordionHeader__title {
|
|
22
26
|
text-align: left;
|
|
23
27
|
}
|
|
28
|
+
|
|
29
|
+
.vuiAccordionBody {
|
|
30
|
+
border: 1px solid $borderColorLight;
|
|
31
|
+
border-top: none;
|
|
32
|
+
padding: $sizeM $sizeL;
|
|
33
|
+
border-bottom-right-radius: $sizeXxs;
|
|
34
|
+
border-bottom-left-radius: $sizeXxs;
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OptionListItem } from "../optionsList/types";
|
|
2
|
+
import { InfoListType } from "../infoList/InfoList";
|
|
3
|
+
type Props = {
|
|
4
|
+
userName: string;
|
|
5
|
+
email: string;
|
|
6
|
+
info?: InfoListType;
|
|
7
|
+
options?: OptionListItem<string>[];
|
|
8
|
+
};
|
|
9
|
+
export declare const VuiAccountButton: ({ userName, email, info, options, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef, useState } from "react";
|
|
14
|
+
import { BiExpandVertical } from "react-icons/bi";
|
|
15
|
+
import classNames from "classnames";
|
|
16
|
+
import { VuiIcon } from "../icon/Icon";
|
|
17
|
+
import { VuiInfoMenu } from "../infoMenu/InfoMenu";
|
|
18
|
+
import { VuiOptionsList } from "../optionsList/OptionsList";
|
|
19
|
+
const Button = forwardRef((_a, ref) => {
|
|
20
|
+
var { children, isSelected } = _a, rest = __rest(_a, ["children", "isSelected"]);
|
|
21
|
+
const classes = classNames("vuiAccountButton", {
|
|
22
|
+
"vuiAccountButton-isActive": isSelected
|
|
23
|
+
});
|
|
24
|
+
return (_jsx("button", Object.assign({ className: classes }, rest, { ref: ref, "aria-expanded": isSelected, "aria-haspopup": "menu" }, { children: children })));
|
|
25
|
+
});
|
|
26
|
+
export const VuiAccountButton = (_a) => {
|
|
27
|
+
var { userName, email, info, options } = _a, rest = __rest(_a, ["userName", "email", "info", "options"]);
|
|
28
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
29
|
+
const areUnique = userName && email && userName !== email;
|
|
30
|
+
const primaryLabel = areUnique ? userName : email;
|
|
31
|
+
const secondaryLabel = areUnique ? email : null;
|
|
32
|
+
const button = (_jsxs(Button, Object.assign({ isSelected: isOpen }, rest, { children: [_jsxs("div", Object.assign({ className: "vuiAccountButton__labels" }, { children: [_jsx("div", Object.assign({ className: "vuiAccountButton__primaryLabel" }, { children: primaryLabel })), secondaryLabel && _jsx("div", Object.assign({ className: "vuiAccountButton__secondaryLabel" }, { children: secondaryLabel }))] })), _jsx(VuiIcon, Object.assign({ size: "s", color: "neutral", className: "vuiAccountButton__icon" }, { children: _jsx(BiExpandVertical, {}) }))] })));
|
|
33
|
+
return (_jsx(VuiInfoMenu, Object.assign({ isOpen: isOpen, setIsOpen: setIsOpen, button: button, info: info, anchorSide: "rightUp" }, { children: options && (_jsx(VuiOptionsList, { size: "l", onSelectOption: () => {
|
|
34
|
+
setIsOpen(false);
|
|
35
|
+
}, options: options })) })));
|
|
36
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.vuiAccountButton {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: $sizeM;
|
|
6
|
+
border-radius: $sizeXs;
|
|
7
|
+
border: 1px solid transparent;
|
|
8
|
+
padding: $sizeXs $sizeM;
|
|
9
|
+
width: 100%;
|
|
10
|
+
max-width: 280px;
|
|
11
|
+
|
|
12
|
+
&:hover,
|
|
13
|
+
&.vuiAccountButton-isActive {
|
|
14
|
+
border-color: $colorMediumShade;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.vuiAccountButton__primaryLabel,
|
|
19
|
+
.vuiAccountButton__secondaryLabel {
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.vuiAccountButton__primaryLabel {
|
|
26
|
+
font-size: $fontSizeStandard;
|
|
27
|
+
color: $colorFullShade;
|
|
28
|
+
font-weight: $fontWeightBold;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.vuiAccountButton__secondaryLabel {
|
|
32
|
+
margin-top: $sizeXxs;
|
|
33
|
+
font-size: $fontSizeSmall;
|
|
34
|
+
color: $colorDarkShade;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.vuiAccountButton__labels {
|
|
38
|
+
text-align: left;
|
|
39
|
+
flex-shrink: 1;
|
|
40
|
+
min-width: 0; /* Important for text truncation in flex containers */
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
text-overflow: ellipsis;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.vuiAccountButton__icon {
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
type
|
|
1
|
+
type SidedProps = {
|
|
2
2
|
left?: React.ReactNode;
|
|
3
3
|
right?: React.ReactNode;
|
|
4
4
|
growRight?: boolean;
|
|
5
|
+
content?: never;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
+
type ContentProps = {
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
left?: never;
|
|
10
|
+
right?: never;
|
|
11
|
+
growRight?: never;
|
|
12
|
+
};
|
|
13
|
+
type Props = (SidedProps | ContentProps) & {
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const VuiAppHeader: ({ left, right, content, growRight, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
17
|
export {};
|
|
@@ -10,9 +10,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
13
14
|
import { VuiFlexContainer } from "../flex/FlexContainer";
|
|
14
15
|
import { VuiFlexItem } from "../flex/FlexItem";
|
|
15
16
|
export const VuiAppHeader = (_a) => {
|
|
16
|
-
var { left, right, growRight } = _a, rest = __rest(_a, ["left", "right", "growRight"]);
|
|
17
|
-
|
|
17
|
+
var { left, right, content, growRight, className } = _a, rest = __rest(_a, ["left", "right", "content", "growRight", "className"]);
|
|
18
|
+
const classes = classNames("vuiAppHeader", className);
|
|
19
|
+
return (_jsx("div", Object.assign({ className: classes }, rest, { children: content ? (content) : (_jsxs(VuiFlexContainer, Object.assign({ className: "vuiAppHeader__inner", justifyContent: "spaceBetween", alignItems: "center" }, { children: [Boolean(left) && (_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: left }))), Boolean(right) && (_jsx(VuiFlexItem, Object.assign({ grow: growRight ? 1 : false, shrink: false }, { children: right })))] }))) })));
|
|
18
20
|
};
|
|
@@ -4,6 +4,7 @@ type Props = {
|
|
|
4
4
|
navItems?: VuiAppSideNavProps["items"];
|
|
5
5
|
navContent?: React.ReactNode;
|
|
6
6
|
full?: boolean;
|
|
7
|
+
className?: string;
|
|
7
8
|
};
|
|
8
9
|
export declare const VuiAppLayout: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
10
|
export {};
|
|
@@ -1,10 +1,22 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { forwardRef } from "react";
|
|
3
14
|
import classNames from "classnames";
|
|
4
15
|
import { VuiAppSideNav } from "./appSideNav/AppSideNav";
|
|
5
|
-
export const VuiAppLayout = forwardRef((
|
|
6
|
-
|
|
16
|
+
export const VuiAppLayout = forwardRef((_a, ref) => {
|
|
17
|
+
var { children, navItems, navContent, full, className } = _a, rest = __rest(_a, ["children", "navItems", "navContent", "full", "className"]);
|
|
18
|
+
const classes = classNames("vuiAppLayout", className, {
|
|
7
19
|
"vuiAppLayout--full": full
|
|
8
20
|
});
|
|
9
|
-
return (_jsxs("div", Object.assign({ className: classes }, { children: [(navItems || navContent) && (_jsx("div", Object.assign({ className: "vuiAppLayout__sideNav" }, { children: _jsx(VuiAppSideNav, { items: navItems, content: navContent }) }))), _jsx("div", Object.assign({ className: "vuiAppLayout__content", ref: ref }, { children: children }))] })));
|
|
21
|
+
return (_jsxs("div", Object.assign({ className: classes }, rest, { children: [(navItems || navContent) && (_jsx("div", Object.assign({ className: "vuiAppLayout__sideNav" }, { children: _jsx(VuiAppSideNav, { items: navItems, content: navContent }) }))), _jsx("div", Object.assign({ className: "vuiAppLayout__content", ref: ref }, { children: children }))] })));
|
|
10
22
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Sections, Tree } from "../types";
|
|
2
|
-
export declare const buildSideNavItems: (items: Sections | Tree) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const buildSideNavItems: (items: Sections | Tree) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export type Props = {
|
|
4
|
+
size?: "m" | "l";
|
|
5
|
+
canCollapseSelf?: boolean;
|
|
4
6
|
items?: Sections | Tree;
|
|
5
7
|
content?: React.ReactNode;
|
|
6
8
|
};
|
|
7
|
-
export declare const VuiAppSideNav: ({ items, content }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const VuiAppSideNav: ({ size, items, content, canCollapseSelf }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,13 +9,15 @@ import { buildTree } from "./AppSideNavTree";
|
|
|
9
9
|
import { VuiFlexContainer } from "../../flex/FlexContainer";
|
|
10
10
|
import { VuiFlexItem } from "../../flex/FlexItem";
|
|
11
11
|
export const buildSideNavItems = (items) => {
|
|
12
|
+
if (items.length === 0)
|
|
13
|
+
return null;
|
|
12
14
|
return isTree(items) ? buildTree(items) : buildSections(items);
|
|
13
15
|
};
|
|
14
16
|
// Type guard to determine if we have a Tree or Sections.
|
|
15
17
|
const isTree = (items) => {
|
|
16
18
|
return items.findIndex((item) => item.path) !== -1;
|
|
17
19
|
};
|
|
18
|
-
export const VuiAppSideNav = ({ items = [], content }) => {
|
|
20
|
+
export const VuiAppSideNav = ({ size = "m", items = [], content, canCollapseSelf = true }) => {
|
|
19
21
|
const [isTouched, setIsTouched] = useState(false);
|
|
20
22
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
21
23
|
const collapseButtonRef = useRef(null);
|
|
@@ -32,15 +34,16 @@ export const VuiAppSideNav = ({ items = [], content }) => {
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
}, [isTouched, isCollapsed]);
|
|
35
|
-
const classes = classNames("vuiAppSideNav", {
|
|
37
|
+
const classes = classNames("vuiAppSideNav", `vuiAppSideNav--${size}`, {
|
|
36
38
|
"vuiAppSideNav-isCollapsed": isCollapsed
|
|
37
39
|
});
|
|
38
40
|
const contentClasses = classNames("vuiAppSideNavContent", {
|
|
39
41
|
"vuiAppSideNavContent-isHidden": isCollapsed
|
|
40
42
|
});
|
|
41
43
|
const navItems = buildSideNavItems(items);
|
|
42
|
-
return (_jsx("div", Object.assign({ className: classes }, { children: _jsxs("div", Object.assign({ className: "vuiAppSideNav__inner" }, { children: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
return (_jsx("div", Object.assign({ className: classes }, { children: _jsxs("div", Object.assign({ className: "vuiAppSideNav__inner" }, { children: [canCollapseSelf &&
|
|
45
|
+
(isCollapsed ? (_jsx(VuiIconButton, { ref: expandButtonRef, "aria-label": "Show nav", onClick: () => setIsCollapsed(false), className: "vuiAppSideNavExpandButton", color: "neutral", icon: _jsx(VuiIcon, { children: _jsx(BiChevronRight, {}) }) })) : (_jsx(_Fragment, { children: _jsx("button", Object.assign({ ref: collapseButtonRef, className: "vuiAppSideNavCollapseButton", onClick: () => {
|
|
46
|
+
setIsTouched(true);
|
|
47
|
+
setIsCollapsed(true);
|
|
48
|
+
} }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xxs" }, { children: [_jsx(VuiFlexItem, Object.assign({ shrink: false, grow: false }, { children: _jsx(VuiIcon, { children: _jsx(BiChevronLeft, {}) }) })), _jsx(VuiFlexItem, Object.assign({ shrink: false, grow: false }, { children: "Collapse nav" }))] })) })) }))), _jsxs("div", Object.assign({ className: contentClasses, inert: isCollapsed ? "" : null }, { children: [navItems, content] }))] })) })));
|
|
46
49
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TreeItem } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare const VuiAppSideNavLink: import("react").ForwardRefExoticComponent<Pick<TreeItem, "className" | "name" | "path" | "isSelected" | "iconBefore" | "iconAfter"> & {
|
|
3
|
+
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
4
|
+
} & import("react").RefAttributes<HTMLAnchorElement | null>>;
|
|
@@ -15,12 +15,13 @@ import { VuiFlexContainer } from "../../flex/FlexContainer";
|
|
|
15
15
|
import { VuiFlexItem } from "../../flex/FlexItem";
|
|
16
16
|
import { VuiIcon } from "../../icon/Icon";
|
|
17
17
|
import { useVuiContext } from "../../context/Context";
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
import { forwardRef } from "react";
|
|
19
|
+
export const VuiAppSideNavLink = forwardRef((_a, ref) => {
|
|
20
|
+
var { path, onClick, name, iconBefore, iconAfter, isSelected, className } = _a, rest = __rest(_a, ["path", "onClick", "name", "iconBefore", "iconAfter", "isSelected", "className"]);
|
|
20
21
|
const { createLink, getPath } = useVuiContext();
|
|
21
22
|
const classes = classNames("vuiAppSideNavLink", {
|
|
22
|
-
"vuiAppSideNavLink--active":
|
|
23
|
+
"vuiAppSideNavLink--active": isSelected !== null && isSelected !== void 0 ? isSelected : path === getPath()
|
|
23
24
|
}, className);
|
|
24
25
|
const content = iconBefore || iconAfter ? (_jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xxs" }, { children: [iconBefore && (_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIcon, Object.assign({ size: "s" }, { children: iconBefore })) }))), _jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: name })), iconAfter && (_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIcon, Object.assign({ size: "s" }, { children: iconAfter })) })))] }))) : (name);
|
|
25
|
-
return createLink(Object.assign({ className: classes, children: content, href: path
|
|
26
|
-
};
|
|
26
|
+
return createLink(Object.assign({ ref, className: classes, children: content, href: path, onClick }, rest));
|
|
27
|
+
});
|
|
@@ -20,19 +20,19 @@ export const buildTree = (items) => {
|
|
|
20
20
|
};
|
|
21
21
|
const buildTreeItems = (items) => {
|
|
22
22
|
return items.map((_a) => {
|
|
23
|
-
var { name, pages, path, iconBefore, iconAfter,
|
|
23
|
+
var { name, pages, path, iconBefore, iconAfter, isSelected } = _a, rest = __rest(_a, ["name", "pages", "path", "iconBefore", "iconAfter", "isSelected"]);
|
|
24
24
|
if (path) {
|
|
25
25
|
if (pages) {
|
|
26
26
|
const childPages = buildTreeItems(pages);
|
|
27
|
-
return (_jsx(AppSideNavTreeSection, Object.assign({ path: path, name: name, iconBefore: iconBefore, iconAfter: iconAfter,
|
|
27
|
+
return (_jsx(AppSideNavTreeSection, Object.assign({ path: path, name: name, iconBefore: iconBefore, iconAfter: iconAfter, isSelected: isSelected }, rest, { children: childPages }), path !== null && path !== void 0 ? path : name));
|
|
28
28
|
}
|
|
29
|
-
return (_jsx(VuiAppSideNavLink, Object.assign({ path: path, name: name, iconBefore: iconBefore, iconAfter: iconAfter,
|
|
29
|
+
return (_jsx(VuiAppSideNavLink, Object.assign({ path: path, name: name, iconBefore: iconBefore, iconAfter: iconAfter, isSelected: isSelected }, rest), path !== null && path !== void 0 ? path : name));
|
|
30
30
|
}
|
|
31
31
|
return (_jsx("div", Object.assign({ className: "vuiAppSideNavTreeSection__subTitle" }, rest, { children: name }), name));
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
const AppSideNavTreeSection = (_a) => {
|
|
35
|
-
var { name, path, children, iconBefore, iconAfter,
|
|
35
|
+
var { name, path, children, iconBefore, iconAfter, isSelected } = _a, rest = __rest(_a, ["name", "path", "children", "iconBefore", "iconAfter", "isSelected"]);
|
|
36
36
|
const [isOpen, setIsOpen] = useState(true);
|
|
37
|
-
return (_jsxs("div", Object.assign({ className: "vuiAppSideNavTreeSection" }, { children: [_jsx(VuiAppSideNavLink, Object.assign({ path: path !== null && path !== void 0 ? path : "/", name: name, iconBefore: iconBefore, iconAfter: iconAfter,
|
|
37
|
+
return (_jsxs("div", Object.assign({ className: "vuiAppSideNavTreeSection" }, { children: [_jsx(VuiAppSideNavLink, Object.assign({ path: path !== null && path !== void 0 ? path : "/", name: name, iconBefore: iconBefore, iconAfter: iconAfter, isSelected: isSelected }, rest)), _jsx(VuiIconButton, { "aria-label": isOpen ? "Hide section" : "Show section", size: "s", className: "vuiAppSideNavTreeToggleButton", onClick: () => setIsOpen(!isOpen), color: "neutral", icon: _jsx(VuiIcon, { children: isOpen ? _jsx(BiChevronUp, {}) : _jsx(BiChevronDown, {}) }) }), isOpen && _jsx("div", Object.assign({ className: "vuiAppSideNavTreeChildren" }, { children: children }))] })));
|
|
38
38
|
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
$appSideNavWidthCollapsed: 60px;
|
|
3
|
-
$appSideNavLinkSpacing: $sizeXxs + 2px;
|
|
4
|
-
|
|
5
|
-
@mixin appSideNavItem {
|
|
1
|
+
@mixin appSideNavItem--m {
|
|
6
2
|
display: block;
|
|
7
3
|
color: $colorText;
|
|
8
4
|
font-size: $fontSizeStandard;
|
|
@@ -12,6 +8,15 @@ $appSideNavLinkSpacing: $sizeXxs + 2px;
|
|
|
12
8
|
padding-bottom: $appSideNavLinkSpacing;
|
|
13
9
|
}
|
|
14
10
|
|
|
11
|
+
@mixin appSideNavItem--l {
|
|
12
|
+
display: block;
|
|
13
|
+
color: $colorText;
|
|
14
|
+
font-size: $fontSizeMedium;
|
|
15
|
+
padding: 0 $sizeM;
|
|
16
|
+
padding-top: $appSideNavLinkSpacing + 2px;
|
|
17
|
+
padding-bottom: $appSideNavLinkSpacing + 2px;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
@import "./appSideNav";
|
|
16
21
|
@import "./appSideNavSections";
|
|
17
22
|
@import "./appSideNavTree";
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
.vuiAppSideNav__inner {
|
|
9
9
|
// Prevent content from being squished as nav collapses.
|
|
10
10
|
width: $appSideNavWidth;
|
|
11
|
-
padding: 28px 32px 32px 33px;
|
|
12
11
|
margin-bottom: $sizeXxl * 4;
|
|
13
12
|
transition: all $transitionSpeed;
|
|
14
13
|
}
|
|
@@ -58,18 +57,39 @@
|
|
|
58
57
|
|
|
59
58
|
.vuiAppSideNavLink {
|
|
60
59
|
@include truncateText;
|
|
61
|
-
@include appSideNavItem;
|
|
62
60
|
text-decoration: none;
|
|
61
|
+
border-radius: $sizeXxs;
|
|
62
|
+
line-height: 1.1;
|
|
63
|
+
border-top: 1px solid $colorEmptyShade;
|
|
64
|
+
border-bottom: 1px solid $colorEmptyShade;
|
|
63
65
|
|
|
64
66
|
&:hover {
|
|
65
|
-
background-color: $
|
|
66
|
-
border-radius: $sizeM;
|
|
67
|
+
background-color: $colorLightShade;
|
|
67
68
|
color: $colorPrimary;
|
|
68
69
|
text-decoration: underline;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
.vuiAppSideNavLink--active {
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
background-color: $colorLightShade;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.vuiAppSideNav--m {
|
|
78
|
+
.vuiAppSideNav__inner {
|
|
79
|
+
padding: 28px 32px 32px 33px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.vuiAppSideNavLink {
|
|
83
|
+
@include appSideNavItem--m;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.vuiAppSideNav--l {
|
|
88
|
+
.vuiAppSideNav__inner {
|
|
89
|
+
padding: 20px 12px 32px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.vuiAppSideNavLink {
|
|
93
|
+
@include appSideNavItem--l;
|
|
94
|
+
}
|
|
75
95
|
}
|
|
@@ -18,8 +18,20 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.vuiAppSideNavTreeSection__subTitle {
|
|
21
|
-
@include appSideNavItem;
|
|
22
|
-
font-size: $fontSizeSmall;
|
|
23
21
|
font-weight: $fontWeightBold;
|
|
24
22
|
color: $colorDarkShade;
|
|
25
23
|
}
|
|
24
|
+
|
|
25
|
+
.vuiAppSideNav--m {
|
|
26
|
+
.vuiAppSideNavTreeSection__subTitle {
|
|
27
|
+
@include appSideNavItem--m;
|
|
28
|
+
font-size: $fontSizeSmall;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.vuiAppSideNav--l {
|
|
33
|
+
.vuiAppSideNavTreeSection__subTitle {
|
|
34
|
+
@include appSideNavItem--l;
|
|
35
|
+
font-size: $fontSizeStandard;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -6,9 +6,10 @@ type Props = {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
color: (typeof BADGE_COLOR)[number];
|
|
8
8
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
onClose?: () => void;
|
|
9
10
|
href?: LinkProps["href"];
|
|
10
11
|
target?: LinkProps["target"];
|
|
11
12
|
track?: LinkProps["track"];
|
|
12
13
|
};
|
|
13
|
-
export declare const VuiBadge: ({ children, className, color, onClick, href, target, track, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const VuiBadge: ({ children, className, color, onClick, onClose, href, target, track, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -9,25 +9,32 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import classNames from "classnames";
|
|
14
|
+
import { BiX } from "react-icons/bi";
|
|
14
15
|
import { getTrackingProps } from "../../utils/getTrackingProps";
|
|
15
16
|
import { useVuiContext } from "../context/Context";
|
|
17
|
+
import { VuiIconButton } from "../button/IconButton";
|
|
18
|
+
import { VuiIcon } from "../icon/Icon";
|
|
19
|
+
import { VuiFlexContainer } from "../flex/FlexContainer";
|
|
20
|
+
import { VuiFlexItem } from "../flex/FlexItem";
|
|
16
21
|
export const BADGE_COLOR = ["accent", "primary", "danger", "warning", "success", "neutral"];
|
|
17
22
|
export const VuiBadge = (_a) => {
|
|
18
|
-
var { children, className, color, onClick, href, target, track } = _a, rest = __rest(_a, ["children", "className", "color", "onClick", "href", "target", "track"]);
|
|
23
|
+
var { children, className, color, onClick, onClose, href, target, track } = _a, rest = __rest(_a, ["children", "className", "color", "onClick", "onClose", "href", "target", "track"]);
|
|
19
24
|
const { createLink } = useVuiContext();
|
|
20
25
|
const classes = classNames(className, "vuiBadge", `vuiBadge--${color}`, {
|
|
21
26
|
"vuiBadge--clickable": onClick !== null && onClick !== void 0 ? onClick : href
|
|
22
27
|
});
|
|
28
|
+
const content = onClose ? (_jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xxs" }, { children: [_jsx(VuiFlexItem, { children: children }), _jsx(VuiFlexItem, { children: _jsx(VuiIconButton, { "aria-label": "Remove", size: "xs", color: "subdued", className: "vuiBadge__closeButton", onClick: (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
31
|
+
}, icon: _jsx(VuiIcon, Object.assign({ size: "s" }, { children: _jsx(BiX, {}) })) }) })] }))) : (children);
|
|
23
32
|
if (onClick) {
|
|
24
|
-
return (_jsx("button", Object.assign({ className: classes, onClick: onClick }, rest, { children:
|
|
33
|
+
return (_jsx("button", Object.assign({ className: classes, onClick: onClick }, rest, { children: content })));
|
|
25
34
|
}
|
|
26
35
|
if (href) {
|
|
27
36
|
return createLink(Object.assign({ className: classes, href,
|
|
28
|
-
onClick,
|
|
29
|
-
children,
|
|
30
|
-
target }, getTrackingProps(track)));
|
|
37
|
+
onClick, children: content, target }, getTrackingProps(track)));
|
|
31
38
|
}
|
|
32
|
-
return (_jsx("div", Object.assign({ className: classes }, rest, { children:
|
|
39
|
+
return (_jsx("div", Object.assign({ className: classes }, rest, { children: content })));
|
|
33
40
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { BUTTON_SIZE } from "./types";
|
|
3
3
|
import { LinkProps } from "../link/types";
|
|
4
|
-
import { SPINNER_COLOR } from "../spinner/types";
|
|
5
4
|
export type BaseButtonProps = {
|
|
6
5
|
children?: ReactNode;
|
|
7
6
|
icon?: ReactElement | null;
|
|
@@ -27,5 +26,5 @@ export type BaseButtonProps = {
|
|
|
27
26
|
isLoading?: boolean;
|
|
28
27
|
};
|
|
29
28
|
export declare const BaseButton: import("react").ForwardRefExoticComponent<BaseButtonProps & {
|
|
30
|
-
spinnerColor
|
|
29
|
+
spinnerColor?: "accent" | "primary" | "success" | "warning" | "danger" | "empty" | "dark" | undefined;
|
|
31
30
|
} & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
@@ -47,7 +47,9 @@ export const BaseButton = forwardRef((_a, ref) => {
|
|
|
47
47
|
if (htmlFor) {
|
|
48
48
|
return (_jsxs("label", Object.assign({ htmlFor: htmlFor, className: classes, tabIndex: tabIndex }, rest, { children: [iconContainer, children] })));
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
// Anchor tags can't be disabled, so we'll just render a button instead
|
|
51
|
+
// if isDisabled is true.
|
|
52
|
+
if (href && !isDisabled) {
|
|
51
53
|
const wrapperClasses = classNames("vuiBaseButtonLinkWrapper", {
|
|
52
54
|
"vuiBaseButtonLinkWrapper--fullWidth": fullWidth
|
|
53
55
|
});
|
|
@@ -15,6 +15,7 @@ type Props = {
|
|
|
15
15
|
target?: LinkProps["target"];
|
|
16
16
|
track?: LinkProps["track"];
|
|
17
17
|
tabIndex?: number;
|
|
18
|
+
isSelected?: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare const VuiIconButton: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
20
21
|
export {};
|
|
@@ -15,18 +15,25 @@ import { forwardRef } from "react";
|
|
|
15
15
|
import { getTrackingProps } from "../../utils/getTrackingProps";
|
|
16
16
|
import { createButtonIcon } from "./createButtonIcon";
|
|
17
17
|
import { useVuiContext } from "../context/Context";
|
|
18
|
+
import { VuiTooltip } from "../tooltip/Tooltip";
|
|
18
19
|
export const VuiIconButton = forwardRef((_a, ref) => {
|
|
19
|
-
var { className, icon, color = "primary", size = "m", onClick, onMouseOver, onMouseOut, onMouseMove, href, target, track, tabIndex } = _a, rest = __rest(_a, ["className", "icon", "color", "size", "onClick", "onMouseOver", "onMouseOut", "onMouseMove", "href", "target", "track", "tabIndex"]);
|
|
20
|
+
var { className, icon, color = "primary", size = "m", onClick, onMouseOver, onMouseOut, onMouseMove, href, target, track, tabIndex, isSelected = false } = _a, rest = __rest(_a, ["className", "icon", "color", "size", "onClick", "onMouseOver", "onMouseOut", "onMouseMove", "href", "target", "track", "tabIndex", "isSelected"]);
|
|
20
21
|
const { createLink } = useVuiContext();
|
|
21
|
-
const props = Object.assign({ className: classNames("vuiIconButton", className, `vuiIconButton--${color}`, `vuiIconButton--${size}
|
|
22
|
+
const props = Object.assign({ className: classNames("vuiIconButton", className, `vuiIconButton--${color}`, `vuiIconButton--${size}`, {
|
|
23
|
+
[`vuiIconButton--${color}-isSelected`]: isSelected
|
|
24
|
+
}), onClick,
|
|
22
25
|
onMouseOver,
|
|
23
26
|
onMouseOut,
|
|
24
27
|
onMouseMove,
|
|
25
28
|
tabIndex }, rest);
|
|
26
29
|
const buttonIcon = createButtonIcon(icon, size, color);
|
|
30
|
+
let iconButton;
|
|
27
31
|
if (href) {
|
|
28
|
-
|
|
32
|
+
iconButton = createLink(Object.assign(Object.assign(Object.assign({ href,
|
|
29
33
|
target }, props), getTrackingProps(track)), { children: _jsx("button", Object.assign({ ref: ref }, { children: buttonIcon })) }));
|
|
30
34
|
}
|
|
31
|
-
|
|
35
|
+
else {
|
|
36
|
+
iconButton = (_jsx("button", Object.assign({}, props, { ref: ref }, { children: buttonIcon })));
|
|
37
|
+
}
|
|
38
|
+
return _jsx(VuiTooltip, Object.assign({ tip: rest["aria-label"] }, { children: iconButton }));
|
|
32
39
|
});
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.vuiBaseButtonLinkWrapper {
|
|
7
|
+
// Ensure containing element is the same size as the child.
|
|
8
|
+
display: inline-block;
|
|
7
9
|
text-decoration: none;
|
|
8
10
|
|
|
9
11
|
&:hover {
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
|
|
71
73
|
// Size
|
|
72
74
|
.vuiBaseButton--xs {
|
|
73
|
-
font-size: $
|
|
75
|
+
font-size: $fontSizeSmall;
|
|
74
76
|
padding: $sizeXxs $sizeXs;
|
|
75
77
|
height: 24px;
|
|
76
78
|
}
|
|
@@ -82,7 +84,7 @@
|
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
.vuiBaseButton--m {
|
|
85
|
-
font-size: $
|
|
87
|
+
font-size: $fontSizeStandard;
|
|
86
88
|
padding: $sizeXs $sizeM;
|
|
87
89
|
height: 34px;
|
|
88
90
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
1
2
|
import { BaseButtonProps } from "./BaseButton";
|
|
2
3
|
import { ButtonColor } from "./types";
|
|
3
|
-
export declare const createButtonIcon: (icon: BaseButtonProps["icon"], size: BaseButtonProps["size"], color: ButtonColor, colorToIconColorMap?: Record<ButtonColor, string>) =>
|
|
4
|
+
export declare const createButtonIcon: (icon: BaseButtonProps["icon"], size: BaseButtonProps["size"], color: ButtonColor, colorToIconColorMap?: Record<ButtonColor, string>) => ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|