@vectara/vectara-ui 16.11.0 → 17.0.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/lib/components/datePicker/DateRangePicker.d.ts +3 -1
- package/lib/components/datePicker/DateRangePicker.js +3 -3
- package/lib/components/form/input/BasicInput.d.ts +2 -2
- package/lib/components/form/input/BasicInput.js +1 -1
- package/lib/components/form/input/PasswordInput.d.ts +1 -1
- package/lib/components/form/input/TextInput.d.ts +1 -1
- package/lib/components/form/input/_index.scss +5 -0
- package/lib/components/index.d.ts +2 -2
- package/lib/components/tabs/TabsNavigator.d.ts +4 -1
- package/lib/components/tabs/TabsNavigator.js +5 -7
- package/lib/styles/index.css +5 -0
- package/package.json +1 -1
- package/src/docs/components/Subsection.tsx +1 -1
- package/src/docs/pages/datePicker/DateRangePickerCustomInput.tsx +65 -0
- package/src/docs/pages/datePicker/index.tsx +7 -0
- package/src/docs/pages/input/Sizes.tsx +47 -0
- package/src/docs/pages/input/index.tsx +5 -5
- package/src/docs/pages/searchInput/index.tsx +1 -1
- package/src/docs/pages/tabs/TabsNavigator.tsx +7 -2
- package/src/docs/pages/input/Large.tsx +0 -18
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BasicProps as DatePickerProps } from "./DatePicker";
|
|
2
2
|
import { Props as PopoverProps } from "../popover/Popover";
|
|
3
|
+
import { JSXElementConstructor, ReactElement } from "react";
|
|
3
4
|
type DateProps = Pick<DatePickerProps, "placeholder" | "data-testid">;
|
|
4
5
|
type Props = Pick<PopoverProps, "isOpen" | "setIsOpen" | "anchorSide" | "header"> & {
|
|
5
6
|
startDate?: Date;
|
|
@@ -8,7 +9,8 @@ type Props = Pick<PopoverProps, "isOpen" | "setIsOpen" | "anchorSide" | "header"
|
|
|
8
9
|
dateRangeProps?: DateProps;
|
|
9
10
|
fullWidth?: boolean;
|
|
10
11
|
canClear?: boolean;
|
|
12
|
+
input?: ReactElement<any, string | JSXElementConstructor<any>>;
|
|
11
13
|
"data-testid"?: string;
|
|
12
14
|
};
|
|
13
|
-
export declare const VuiDateRangePicker: ({ setIsOpen, startDate, endDate, onChange, dateRangeProps, fullWidth, canClear, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const VuiDateRangePicker: ({ setIsOpen, startDate, endDate, onChange, dateRangeProps, fullWidth, canClear, input, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -16,7 +16,7 @@ import { formatDate } from "../../utils";
|
|
|
16
16
|
import { useEffect, useState } from "react";
|
|
17
17
|
import { VuiCalendar } from "./Calendar";
|
|
18
18
|
export const VuiDateRangePicker = (_a) => {
|
|
19
|
-
var { setIsOpen, startDate, endDate, onChange, dateRangeProps, fullWidth, canClear } = _a, rest = __rest(_a, ["setIsOpen", "startDate", "endDate", "onChange", "dateRangeProps", "fullWidth", "canClear"]);
|
|
19
|
+
var { setIsOpen, startDate, endDate, onChange, dateRangeProps, fullWidth, canClear, input } = _a, rest = __rest(_a, ["setIsOpen", "startDate", "endDate", "onChange", "dateRangeProps", "fullWidth", "canClear", "input"]);
|
|
20
20
|
const [initialStartDate, setInitialStartDate] = useState();
|
|
21
21
|
const [initialEndDate, setInitialEndDate] = useState();
|
|
22
22
|
// When the startDate or endDate props change, update the internal state.
|
|
@@ -42,7 +42,7 @@ export const VuiDateRangePicker = (_a) => {
|
|
|
42
42
|
const humanizedStartDate = initialStartDate ? formatDate(initialStartDate) : "Unselected start date";
|
|
43
43
|
const humanizedEndDate = initialEndDate ? formatDate(initialEndDate) : "unselected end date";
|
|
44
44
|
const { "data-testid": testId } = rest, restProps = __rest(rest, ["data-testid"]);
|
|
45
|
-
const
|
|
45
|
+
const inputEl = input !== null && input !== void 0 ? input : (_jsx(VuiTextInput, { className: "vuiDateRangePickerInput", value: !initialStartDate && !initialEndDate ? "Select date range" : `${humanizedStartDate} to ${humanizedEndDate}`, fullWidth: fullWidth, "data-testid": testId }));
|
|
46
46
|
return (_jsx(VuiPopover, Object.assign({ setIsOpen: (isOpen) => {
|
|
47
47
|
if (isOpen) {
|
|
48
48
|
// Set temporary internal state to the provided values when opening the popover.
|
|
@@ -54,5 +54,5 @@ export const VuiDateRangePicker = (_a) => {
|
|
|
54
54
|
onChange === null || onChange === void 0 ? void 0 : onChange(initialStartDate, initialEndDate);
|
|
55
55
|
}
|
|
56
56
|
setIsOpen(isOpen);
|
|
57
|
-
}, button:
|
|
57
|
+
}, button: inputEl }, restProps, { children: dateRangePicker })));
|
|
58
58
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const SIZE: readonly ["m", "l"];
|
|
1
|
+
declare const SIZE: readonly ["s", "m", "l"];
|
|
2
2
|
export type BasicInputProps = Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "size" | "autoComplete" | "ref"> & {
|
|
3
3
|
isInvalid?: boolean;
|
|
4
4
|
size?: (typeof SIZE)[number];
|
|
@@ -8,7 +8,7 @@ export type BasicInputProps = Omit<React.DetailedHTMLProps<React.InputHTMLAttrib
|
|
|
8
8
|
};
|
|
9
9
|
export declare const VuiBasicInput: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref" | "size" | "autoComplete"> & {
|
|
10
10
|
isInvalid?: boolean | undefined;
|
|
11
|
-
size?: "m" | "l" | undefined;
|
|
11
|
+
size?: "s" | "m" | "l" | undefined;
|
|
12
12
|
fullWidth?: boolean | undefined;
|
|
13
13
|
autoComplete?: string | boolean | undefined;
|
|
14
14
|
isSelected?: boolean | undefined;
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import { forwardRef } from "react";
|
|
15
|
-
const SIZE = ["m", "l"];
|
|
15
|
+
const SIZE = ["s", "m", "l"];
|
|
16
16
|
export const VuiBasicInput = forwardRef((_a, ref) => {
|
|
17
17
|
var { className, id, name, placeholder, size = "m", fullWidth, onSubmit, isInvalid, autoFocus, autoComplete, isSelected, onChange = () => undefined } = _a, rest = __rest(_a, ["className", "id", "name", "placeholder", "size", "fullWidth", "onSubmit", "isInvalid", "autoFocus", "autoComplete", "isSelected", "onChange"]);
|
|
18
18
|
const classes = classNames("vuiInput", `vuiInput--${size}`, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const VuiPasswordInput: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref" | "size" | "autoComplete"> & {
|
|
2
2
|
isInvalid?: boolean | undefined;
|
|
3
|
-
size?: "m" | "l" | undefined;
|
|
3
|
+
size?: "s" | "m" | "l" | undefined;
|
|
4
4
|
fullWidth?: boolean | undefined;
|
|
5
5
|
autoComplete?: string | boolean | undefined;
|
|
6
6
|
isSelected?: boolean | undefined;
|
|
@@ -6,7 +6,7 @@ export type Props = BasicInputProps & {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const VuiTextInput: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref" | "size" | "autoComplete"> & {
|
|
8
8
|
isInvalid?: boolean | undefined;
|
|
9
|
-
size?: "m" | "l" | undefined;
|
|
9
|
+
size?: "s" | "m" | "l" | undefined;
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
11
11
|
autoComplete?: string | boolean | undefined;
|
|
12
12
|
isSelected?: boolean | undefined;
|
|
@@ -87,7 +87,7 @@ import { SpansRow } from "./spans/types";
|
|
|
87
87
|
import { VuiTab } from "./tabs/Tab";
|
|
88
88
|
import { VuiTabbedRoutes } from "./tabs/TabbedRoutes";
|
|
89
89
|
import { VuiTabs } from "./tabs/Tabs";
|
|
90
|
-
import { VuiTabsNavigator } from "./tabs/TabsNavigator";
|
|
90
|
+
import { TabNavigatorRoute, VuiTabsNavigator } from "./tabs/TabsNavigator";
|
|
91
91
|
import { TAB_SIZE, TabSize } from "./tabs/types";
|
|
92
92
|
import { VuiText } from "./typography/Text";
|
|
93
93
|
import { VuiTextColor } from "./typography/TextColor";
|
|
@@ -100,5 +100,5 @@ import { VuiInfoTooltip } from "./tooltip/InfoTooltip";
|
|
|
100
100
|
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
101
101
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
102
102
|
import { toRgb, toRgba } from "./context/Theme";
|
|
103
|
-
export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CheckboxConfig, CodeEditorColorConfig, CodeEditorError, CodeLanguage, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, KvTableAlign, KvTableItem, KvTableItems, KvTablePadding, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, SpansRow, Stat, StepStatus, StepSize, Steps, StepsVertical, StepVerticalStatus, TabSize, Tree, TreeItem };
|
|
103
|
+
export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CheckboxConfig, CodeEditorColorConfig, CodeEditorError, CodeLanguage, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, KvTableAlign, KvTableItem, KvTableItems, KvTablePadding, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, SpansRow, Stat, StepStatus, StepSize, Steps, StepsVertical, StepVerticalStatus, TabNavigatorRoute, TabSize, Tree, TreeItem };
|
|
104
104
|
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiCodeEditor, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiDurationBar, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, VuiKvTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSimpleCard, VuiSimpleGrid, VuiSpacer, VuiSpans, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiStepsVertical, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiTabsNavigator, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Props as PopoverProps } from "../popover/Popover";
|
|
2
2
|
import { TabRoute } from "./types";
|
|
3
|
+
export type TabNavigatorRoute = Omit<TabRoute, "render"> & {
|
|
4
|
+
append?: React.ReactNode;
|
|
5
|
+
};
|
|
3
6
|
type Props = {
|
|
4
|
-
routes:
|
|
7
|
+
routes: TabNavigatorRoute[];
|
|
5
8
|
popover?: Omit<PopoverProps, "header" | "isOpen" | "setIsOpen" | "button" | "children" | "padding">;
|
|
6
9
|
"data-testid"?: string;
|
|
7
10
|
};
|
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useState } from "react";
|
|
14
14
|
import { VuiPopover } from "../popover/Popover";
|
|
15
15
|
import { VuiTab } from "./Tab";
|
|
@@ -17,6 +17,7 @@ import { VuiTabs } from "./Tabs";
|
|
|
17
17
|
import { useVuiContext } from "../context/Context";
|
|
18
18
|
import { VuiIcon } from "../icon/Icon";
|
|
19
19
|
import { BiDotsVertical } from "react-icons/bi";
|
|
20
|
+
import { VuiFlexContainer } from "../flex/FlexContainer";
|
|
20
21
|
export const VuiTabsNavigator = (_a) => {
|
|
21
22
|
var _b;
|
|
22
23
|
var { routes, popover } = _a, rest = __rest(_a, ["routes", "popover"]);
|
|
@@ -28,13 +29,10 @@ export const VuiTabsNavigator = (_a) => {
|
|
|
28
29
|
};
|
|
29
30
|
const activeRoute = routes.find((route) => isRouteActive(route));
|
|
30
31
|
return (_jsx(VuiPopover, Object.assign({}, popover, { isOpen: isOpen, setIsOpen: () => setIsOpen(!isOpen), button: _jsx("button", Object.assign({ className: "vuiTabsNavigatorButton" }, rest, { children: _jsxs("div", Object.assign({ className: "vuiTabsNavigatorButton__inner" }, { children: [_jsx(VuiIcon, Object.assign({ size: "xs" }, { children: _jsx(BiDotsVertical, {}) })), _jsx("div", { children: (_b = activeRoute === null || activeRoute === void 0 ? void 0 : activeRoute.title) !== null && _b !== void 0 ? _b : "No selection" })] })) })), padding: "none" }, { children: _jsx(VuiTabs, Object.assign({ size: "s", tabStyle: "enclosed", vertical: true }, { children: routes.map((route, index) => {
|
|
31
|
-
const { href, onClick, title,
|
|
32
|
-
|
|
32
|
+
const { href, onClick, title, testId, append } = route;
|
|
33
|
+
return (_jsx(VuiTab, Object.assign({ href: href, isActive: isRouteActive(route), "data-testid": testId, onClick: () => {
|
|
33
34
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
34
35
|
setIsOpen(false);
|
|
35
|
-
} }, { children: title }), index));
|
|
36
|
-
if (render)
|
|
37
|
-
return render(tabLink);
|
|
38
|
-
return tabLink;
|
|
36
|
+
} }, { children: _jsxs(VuiFlexContainer, Object.assign({ spacing: "s" }, { children: [title, append] })) }), index));
|
|
39
37
|
}) })) })));
|
|
40
38
|
};
|
package/lib/styles/index.css
CHANGED
|
@@ -2848,6 +2848,11 @@ h2.react-datepicker__current-month {
|
|
|
2848
2848
|
background-color: var(--vui-color-empty-shade);
|
|
2849
2849
|
}
|
|
2850
2850
|
|
|
2851
|
+
.vuiInput--s {
|
|
2852
|
+
padding: 6px 12px;
|
|
2853
|
+
font-size: 12px;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2851
2856
|
.vuiInput--m {
|
|
2852
2857
|
padding: 8px 16px;
|
|
2853
2858
|
font-size: 14px;
|
package/package.json
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { VuiButtonSecondary, VuiDateRangePicker, VuiSpacer, VuiText, VuiTextInput } from "../../../lib";
|
|
3
|
+
import { formatDate } from "../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
export const DateRangePickerCustomInput = () => {
|
|
6
|
+
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
7
|
+
const [startDate, setStartDate] = useState<Date | undefined>(
|
|
8
|
+
new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
|
|
9
|
+
);
|
|
10
|
+
const [endDate, setEndDate] = useState<Date | undefined>(undefined);
|
|
11
|
+
|
|
12
|
+
const humanizedStartDate = startDate ? formatDate(startDate) : "Unselected start date";
|
|
13
|
+
const humanizedEndDate = endDate ? formatDate(endDate) : "unselected end date";
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<VuiText>
|
|
18
|
+
<p>
|
|
19
|
+
From {startDate?.toUTCString() ?? "unknown"} to {endDate?.toUTCString() ?? "unknown"}
|
|
20
|
+
</p>
|
|
21
|
+
</VuiText>
|
|
22
|
+
|
|
23
|
+
<VuiSpacer size="s" />
|
|
24
|
+
|
|
25
|
+
<VuiButtonSecondary
|
|
26
|
+
color="neutral"
|
|
27
|
+
onClick={() => {
|
|
28
|
+
// Add one day to the end date.
|
|
29
|
+
setEndDate((prevEndDate) => {
|
|
30
|
+
if (!prevEndDate) return new Date();
|
|
31
|
+
const newEndDate = new Date(prevEndDate);
|
|
32
|
+
newEndDate.setDate(newEndDate.getDate() + 1);
|
|
33
|
+
return newEndDate;
|
|
34
|
+
});
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
Add day to verify external control
|
|
38
|
+
</VuiButtonSecondary>
|
|
39
|
+
|
|
40
|
+
<VuiSpacer size="s" />
|
|
41
|
+
|
|
42
|
+
<VuiDateRangePicker
|
|
43
|
+
header="Date filter"
|
|
44
|
+
startDate={startDate}
|
|
45
|
+
endDate={endDate}
|
|
46
|
+
onChange={(startDate, endDate) => {
|
|
47
|
+
setStartDate(startDate);
|
|
48
|
+
setEndDate(endDate);
|
|
49
|
+
}}
|
|
50
|
+
isOpen={isOpen}
|
|
51
|
+
setIsOpen={setIsOpen}
|
|
52
|
+
anchorSide="left"
|
|
53
|
+
data-testid="dateRangePickerButton"
|
|
54
|
+
dateRangeProps={{ "data-testid": "dateRangePicker" }}
|
|
55
|
+
canClear
|
|
56
|
+
input={
|
|
57
|
+
<VuiTextInput
|
|
58
|
+
size="s"
|
|
59
|
+
value={!startDate && !endDate ? "Select date range" : `${humanizedStartDate} to ${humanizedEndDate}`}
|
|
60
|
+
/>
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { DatePicker } from "./DatePicker";
|
|
2
2
|
import { Inline } from "./Inline";
|
|
3
3
|
import { DateRangePicker } from "./DateRangePicker";
|
|
4
|
+
import { DateRangePickerCustomInput } from "./DateRangePickerCustomInput";
|
|
4
5
|
import { WithTimeSelection } from "./WithTimeSelection";
|
|
5
6
|
|
|
6
7
|
const DatePickerSource = require("!!raw-loader!./DatePicker");
|
|
7
8
|
const InlineSource = require("!!raw-loader!./Inline");
|
|
8
9
|
const DateRangePickerSource = require("!!raw-loader!./DateRangePicker");
|
|
10
|
+
const DateRangePickerCustomInputSource = require("!!raw-loader!./DateRangePickerCustomInput");
|
|
9
11
|
const WithTimeSelectionSource = require("!!raw-loader!./WithTimeSelection");
|
|
10
12
|
|
|
11
13
|
export const datePicker = {
|
|
@@ -27,6 +29,11 @@ export const datePicker = {
|
|
|
27
29
|
component: <DateRangePicker />,
|
|
28
30
|
source: DateRangePickerSource.default.toString()
|
|
29
31
|
},
|
|
32
|
+
{
|
|
33
|
+
name: "Date range with custom input",
|
|
34
|
+
component: <DateRangePickerCustomInput />,
|
|
35
|
+
source: DateRangePickerCustomInputSource.default.toString()
|
|
36
|
+
},
|
|
30
37
|
{
|
|
31
38
|
name: "With time selection",
|
|
32
39
|
component: <WithTimeSelection />,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { VuiTextInput } from "../../../lib";
|
|
3
|
+
import { Subsection } from "../../components/Subsection";
|
|
4
|
+
|
|
5
|
+
export const Sizes = () => {
|
|
6
|
+
const [value, setValue] = useState<string | undefined>();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<Subsection title="Large">
|
|
11
|
+
<VuiTextInput
|
|
12
|
+
size="l"
|
|
13
|
+
id="textInput"
|
|
14
|
+
name="text"
|
|
15
|
+
placeholder="Type something…"
|
|
16
|
+
value={value}
|
|
17
|
+
onSubmit={() => alert("Submit")}
|
|
18
|
+
onChange={(event) => setValue(event.target.value)}
|
|
19
|
+
/>
|
|
20
|
+
</Subsection>
|
|
21
|
+
|
|
22
|
+
<Subsection title="Medium">
|
|
23
|
+
<VuiTextInput
|
|
24
|
+
size="m"
|
|
25
|
+
id="textInput"
|
|
26
|
+
name="text"
|
|
27
|
+
placeholder="Type something…"
|
|
28
|
+
value={value}
|
|
29
|
+
onSubmit={() => alert("Submit")}
|
|
30
|
+
onChange={(event) => setValue(event.target.value)}
|
|
31
|
+
/>
|
|
32
|
+
</Subsection>
|
|
33
|
+
|
|
34
|
+
<Subsection title="Small">
|
|
35
|
+
<VuiTextInput
|
|
36
|
+
size="s"
|
|
37
|
+
id="textInput"
|
|
38
|
+
name="text"
|
|
39
|
+
placeholder="Type something…"
|
|
40
|
+
value={value}
|
|
41
|
+
onSubmit={() => alert("Submit")}
|
|
42
|
+
onChange={(event) => setValue(event.target.value)}
|
|
43
|
+
/>
|
|
44
|
+
</Subsection>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -2,13 +2,13 @@ import { TextInput } from "./TextInput";
|
|
|
2
2
|
import { NumberInput } from "./NumberInput";
|
|
3
3
|
import { PasswordInput } from "./PasswordInput";
|
|
4
4
|
import { FullWidth } from "./FullWidth";
|
|
5
|
-
import {
|
|
5
|
+
import { Sizes } from "./Sizes";
|
|
6
6
|
|
|
7
7
|
const TextInputSource = require("!!raw-loader!./TextInput");
|
|
8
8
|
const NumberInputSource = require("!!raw-loader!./NumberInput");
|
|
9
9
|
const PasswordInputSource = require("!!raw-loader!./PasswordInput");
|
|
10
10
|
const FullWidthSource = require("!!raw-loader!./FullWidth");
|
|
11
|
-
const
|
|
11
|
+
const SizesSource = require("!!raw-loader!./Sizes");
|
|
12
12
|
|
|
13
13
|
export const input = {
|
|
14
14
|
name: "Input",
|
|
@@ -35,9 +35,9 @@ export const input = {
|
|
|
35
35
|
source: FullWidthSource.default.toString()
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
name: "
|
|
39
|
-
component: <
|
|
40
|
-
source:
|
|
38
|
+
name: "Sizes",
|
|
39
|
+
component: <Sizes />,
|
|
40
|
+
source: SizesSource.default.toString()
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
43
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLocation } from "react-router-dom";
|
|
2
|
-
import { VuiTabsNavigator } from "../../../lib";
|
|
2
|
+
import { VuiBadge, VuiTabsNavigator } from "../../../lib";
|
|
3
3
|
|
|
4
4
|
export const TabsNavigator = () => {
|
|
5
5
|
const { hash } = useLocation();
|
|
@@ -10,7 +10,12 @@ export const TabsNavigator = () => {
|
|
|
10
10
|
title: "Home",
|
|
11
11
|
testId: "home-tab",
|
|
12
12
|
isActive: hash.endsWith("#home"),
|
|
13
|
-
onClick: () => console.log("Home tab clicked")
|
|
13
|
+
onClick: () => console.log("Home tab clicked"),
|
|
14
|
+
append: (
|
|
15
|
+
<VuiBadge color="danger" size="s">
|
|
16
|
+
3
|
|
17
|
+
</VuiBadge>
|
|
18
|
+
)
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
21
|
href: "#profile",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { VuiTextInput } from "../../../lib";
|
|
3
|
-
|
|
4
|
-
export const Large = () => {
|
|
5
|
-
const [value, setValue] = useState<string | undefined>();
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<VuiTextInput
|
|
9
|
-
size="l"
|
|
10
|
-
id="textInput"
|
|
11
|
-
name="text"
|
|
12
|
-
placeholder="Type something…"
|
|
13
|
-
value={value}
|
|
14
|
-
onSubmit={() => alert("Submit")}
|
|
15
|
-
onChange={(event) => setValue(event.target.value)}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
};
|