@vectara/vectara-ui 15.0.1 → 15.0.3
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/button/iconButton.scss +34 -11
- package/lib/components/form/_index.scss +1 -0
- package/lib/components/form/index.d.ts +2 -0
- package/lib/components/form/index.js +1 -0
- package/lib/components/form/superCheckboxGroup/SuperCheckbox.d.ts +6 -0
- package/lib/components/form/superCheckboxGroup/SuperCheckbox.js +22 -0
- package/lib/components/form/superCheckboxGroup/SuperCheckboxGroup.d.ts +7 -0
- package/lib/components/form/superCheckboxGroup/SuperCheckboxGroup.js +5 -0
- package/lib/components/form/superCheckboxGroup/_index.scss +29 -0
- package/lib/components/form/superCheckboxGroup/types.d.ts +8 -0
- package/lib/components/form/superCheckboxGroup/types.js +1 -0
- package/lib/components/index.d.ts +3 -3
- package/lib/components/index.js +2 -2
- package/lib/components/searchInput/SearchInput.d.ts +3 -2
- package/lib/components/searchInput/SearchInput.js +5 -2
- package/lib/styles/index.css +42 -14
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
.vuiIconButton {
|
|
2
4
|
display: inline-block;
|
|
3
5
|
border-radius: $sizeXxs;
|
|
@@ -7,26 +9,47 @@
|
|
|
7
9
|
|
|
8
10
|
// Color
|
|
9
11
|
$color: (
|
|
10
|
-
accent:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
accent: (
|
|
13
|
+
"color": var(--vui-color-accent-shade-rgb),
|
|
14
|
+
"background-color": var(--vui-color-accent-shade-rgb)
|
|
15
|
+
),
|
|
16
|
+
primary: (
|
|
17
|
+
"color": var(--vui-color-primary-shade-rgb),
|
|
18
|
+
"background-color": var(--vui-color-primary-shade-rgb)
|
|
19
|
+
),
|
|
20
|
+
success: (
|
|
21
|
+
"color": var(--vui-color-success-shade-rgb),
|
|
22
|
+
"background-color": var(--vui-color-success-shade-rgb)
|
|
23
|
+
),
|
|
24
|
+
danger: (
|
|
25
|
+
"color": var(--vui-color-danger-shade-rgb),
|
|
26
|
+
"background-color": var(--vui-color-danger-shade-rgb)
|
|
27
|
+
),
|
|
28
|
+
warning: (
|
|
29
|
+
"color": var(--vui-color-warning-shade-rgb),
|
|
30
|
+
"background-color": var(--vui-color-warning-shade-rgb)
|
|
31
|
+
),
|
|
32
|
+
neutral: (
|
|
33
|
+
"color": var(--vui-color-darker-shade-rgb),
|
|
34
|
+
"background-color": var(--vui-color-subdued-shade-rgb)
|
|
35
|
+
),
|
|
36
|
+
subdued: (
|
|
37
|
+
"color": var(--vui-color-subdued-shade-rgb),
|
|
38
|
+
"background-color": var(--vui-color-subdued-shade-rgb)
|
|
39
|
+
)
|
|
17
40
|
);
|
|
18
41
|
|
|
19
42
|
@each $colorName, $colorValue in $color {
|
|
20
43
|
.vuiIconButton--#{$colorName} {
|
|
21
|
-
color: rgb($colorValue);
|
|
22
|
-
background-color: rgba($colorValue, 0);
|
|
44
|
+
color: rgb(#{map.get($colorValue, "color")});
|
|
45
|
+
background-color: rgba(#{map.get($colorValue, "background-color")}, 0);
|
|
23
46
|
|
|
24
47
|
&:hover {
|
|
25
|
-
background-color: rgba($colorValue, 0.1);
|
|
48
|
+
background-color: rgba(#{map.get($colorValue, "background-color")}, 0.1);
|
|
26
49
|
}
|
|
27
50
|
|
|
28
51
|
&-isSelected {
|
|
29
|
-
background-color: rgba($colorValue, 0.1);
|
|
52
|
+
background-color: rgba(#{map.get($colorValue, "background-color")}, 0.1);
|
|
30
53
|
}
|
|
31
54
|
}
|
|
32
55
|
}
|
|
@@ -6,10 +6,12 @@ export { VuiLabel } from "./label/Label";
|
|
|
6
6
|
export { VuiNumberInput } from "./input/NumberInput";
|
|
7
7
|
export { VuiRadioButton } from "./radioButton/RadioButton";
|
|
8
8
|
export { VuiSelect } from "./select/Select";
|
|
9
|
+
export { VuiSuperCheckboxGroup } from "./superCheckboxGroup/SuperCheckboxGroup";
|
|
9
10
|
export { VuiSuperRadioGroup } from "./superRadioGroup/SuperRadioGroup";
|
|
10
11
|
export { VuiTextInput } from "./input/TextInput";
|
|
11
12
|
export { VuiTextArea } from "./textArea/TextArea";
|
|
12
13
|
export { VuiPasswordInput } from "./input/PasswordInput";
|
|
13
14
|
export type { CodeEditorError, CodeEditorColorConfig } from "./codeEditor/CodeEditor";
|
|
14
15
|
export type { Props as TextInputProps } from "./input/TextInput";
|
|
16
|
+
export type { CheckboxConfig } from "./superCheckboxGroup/types";
|
|
15
17
|
export type { RadioButtonConfig } from "./superRadioGroup/types";
|
|
@@ -6,6 +6,7 @@ export { VuiLabel } from "./label/Label";
|
|
|
6
6
|
export { VuiNumberInput } from "./input/NumberInput";
|
|
7
7
|
export { VuiRadioButton } from "./radioButton/RadioButton";
|
|
8
8
|
export { VuiSelect } from "./select/Select";
|
|
9
|
+
export { VuiSuperCheckboxGroup } from "./superCheckboxGroup/SuperCheckboxGroup";
|
|
9
10
|
export { VuiSuperRadioGroup } from "./superRadioGroup/SuperRadioGroup";
|
|
10
11
|
export { VuiTextInput } from "./input/TextInput";
|
|
11
12
|
export { VuiTextArea } from "./textArea/TextArea";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CheckboxConfig } from "./types";
|
|
2
|
+
type Props<T> = CheckboxConfig<T> & {
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const VuiSuperCheckbox: <T extends string>({ label, description, value, checked, onChange, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +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
|
+
};
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, 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
|
+
import { VuiSpacer } from "../../spacer/Spacer";
|
|
17
|
+
import { VuiText } from "../../typography/Text";
|
|
18
|
+
export const VuiSuperCheckbox = (_a) => {
|
|
19
|
+
var { label, description, value, checked, onChange } = _a, rest = __rest(_a, ["label", "description", "value", "checked", "onChange"]);
|
|
20
|
+
const id = createId();
|
|
21
|
+
return (_jsx("label", Object.assign({ className: "vuiSuperCheckbox", htmlFor: id }, { children: _jsxs(VuiFlexContainer, Object.assign({ spacing: "l", alignItems: "center" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false, shrink: 0 }, { children: _jsx("input", Object.assign({ id: id, type: "checkbox", checked: checked, onChange: () => onChange(value) }, rest)) })), _jsxs(VuiFlexItem, Object.assign({ grow: false, shrink: 1 }, { children: [_jsx(VuiText, { children: _jsx("p", Object.assign({ className: "vuiSuperCheckbox__text" }, { children: label })) }), description && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "xxs" }), _jsx(VuiText, Object.assign({ size: "xs" }, { children: _jsx("p", Object.assign({ className: "vuiSuperCheckbox__text vuiSuperCheckbox__description" }, { children: description })) }))] }))] }))] })) })));
|
|
22
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CheckboxConfig } from "./types";
|
|
2
|
+
type Props<T> = {
|
|
3
|
+
group: CheckboxConfig<T>[];
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const VuiSuperCheckboxGroup: <T extends string>({ group, onChange }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { VuiSuperCheckbox } from "./SuperCheckbox";
|
|
3
|
+
export const VuiSuperCheckboxGroup = ({ group, onChange }) => {
|
|
4
|
+
return (_jsx("div", Object.assign({ className: "vuiSuperCheckboxGroup" }, { children: group.map((item) => (_jsx(VuiSuperCheckbox, Object.assign({}, item, { onChange: onChange }), item.value))) })));
|
|
5
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.vuiSuperCheckboxGroup {
|
|
2
|
+
display: grid;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.vuiSuperCheckbox {
|
|
6
|
+
display: block;
|
|
7
|
+
width: 100%;
|
|
8
|
+
border-radius: $sizeXs;
|
|
9
|
+
padding: $sizeS $sizeL;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
transition: all $transitionSpeed;
|
|
13
|
+
text-decoration-color: var(--vui-color-text);
|
|
14
|
+
text-align: left;
|
|
15
|
+
|
|
16
|
+
&:hover {
|
|
17
|
+
text-decoration: underline;
|
|
18
|
+
text-decoration-color: var(--vui-color-primary-shade);
|
|
19
|
+
background-color: var(--vui-color-primary-lighter-shade);
|
|
20
|
+
|
|
21
|
+
.vuiSuperCheckbox__text {
|
|
22
|
+
color: var(--vui-color-primary-shade) !important;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.vuiSuperCheckbox__description {
|
|
28
|
+
color: var(--vui-color-subdued-shade);
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -29,7 +29,7 @@ import { VuiDrawer } from "./drawer/Drawer";
|
|
|
29
29
|
import { VuiErrorBoundary } from "./errorBoundary/ErrorBoundary";
|
|
30
30
|
import { VuiFlexContainer } from "./flex/FlexContainer";
|
|
31
31
|
import { VuiFlexItem } from "./flex/FlexItem";
|
|
32
|
-
import { CodeEditorColorConfig, CodeEditorError, RadioButtonConfig, generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
|
|
32
|
+
import { CheckboxConfig, CodeEditorColorConfig, CodeEditorError, RadioButtonConfig, generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
|
|
33
33
|
import { VuiFormGroup } from "./formGroup/FormGroup";
|
|
34
34
|
import { VuiGrid, VuiGridItem, VuiSimpleGrid } from "./grid";
|
|
35
35
|
import { VuiHorizontalRule } from "./horizontalRule/HorizontalRule";
|
|
@@ -91,5 +91,5 @@ import { VuiTooltip } from "./tooltip/Tooltip";
|
|
|
91
91
|
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
92
92
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
93
93
|
import { toRgb, toRgba } from "./context/Theme";
|
|
94
|
-
export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CodeEditorColorConfig, CodeEditorError, CodeLanguage, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, Stat, StepStatus, StepSize, TabSize, Tree, TreeItem, VuiStepProps };
|
|
95
|
-
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, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, 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, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
94
|
+
export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CheckboxConfig, CodeEditorColorConfig, CodeEditorError, CodeLanguage, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, Stat, StepStatus, StepSize, TabSize, Tree, TreeItem, VuiStepProps };
|
|
95
|
+
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, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, 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, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
package/lib/components/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { VuiDrawer } from "./drawer/Drawer";
|
|
|
25
25
|
import { VuiErrorBoundary } from "./errorBoundary/ErrorBoundary";
|
|
26
26
|
import { VuiFlexContainer } from "./flex/FlexContainer";
|
|
27
27
|
import { VuiFlexItem } from "./flex/FlexItem";
|
|
28
|
-
import { generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
|
|
28
|
+
import { generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
|
|
29
29
|
import { VuiFormGroup } from "./formGroup/FormGroup";
|
|
30
30
|
import { VuiGrid, VuiGridItem, VuiSimpleGrid } from "./grid";
|
|
31
31
|
import { VuiHorizontalRule } from "./horizontalRule/HorizontalRule";
|
|
@@ -84,4 +84,4 @@ import { VuiTooltip } from "./tooltip/Tooltip";
|
|
|
84
84
|
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
85
85
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
86
86
|
import { toRgb, toRgba } from "./context/Theme";
|
|
87
|
-
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, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, 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, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
87
|
+
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, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, 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, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEventHandler, FormEventHandler } from "react";
|
|
1
|
+
import { ChangeEventHandler, FormEventHandler, KeyboardEventHandler } from "react";
|
|
2
2
|
import { SearchSuggestion } from "./types";
|
|
3
3
|
declare const SIZE: readonly ["m", "l"];
|
|
4
4
|
type Props = {
|
|
@@ -6,6 +6,7 @@ type Props = {
|
|
|
6
6
|
value?: string;
|
|
7
7
|
size?: (typeof SIZE)[number];
|
|
8
8
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
9
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
9
10
|
placeholder?: string;
|
|
10
11
|
autoFocus?: boolean;
|
|
11
12
|
onSubmit?: FormEventHandler;
|
|
@@ -19,5 +20,5 @@ type ClearableProps = {
|
|
|
19
20
|
isClearable?: false;
|
|
20
21
|
onClear?: never;
|
|
21
22
|
};
|
|
22
|
-
export declare const VuiSearchInput: ({ className, size, value, onChange, placeholder, autoFocus, onSubmit, isClearable, onClear, suggestions, isLoading, ...rest }: Props & ClearableProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const VuiSearchInput: ({ className, size, value, onChange, onKeyDown, placeholder, autoFocus, onSubmit, isClearable, onClear, suggestions, isLoading, ...rest }: Props & ClearableProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -20,7 +20,7 @@ import { createId } from "../../utils/createId";
|
|
|
20
20
|
import { VuiSpinner } from "../spinner/Spinner";
|
|
21
21
|
const SIZE = ["m", "l"];
|
|
22
22
|
export const VuiSearchInput = (_a) => {
|
|
23
|
-
var { className, size = "m", value, onChange, placeholder, autoFocus, onSubmit, isClearable, onClear, suggestions, isLoading } = _a, rest = __rest(_a, ["className", "size", "value", "onChange", "placeholder", "autoFocus", "onSubmit", "isClearable", "onClear", "suggestions", "isLoading"]);
|
|
23
|
+
var { className, size = "m", value, onChange, onKeyDown, placeholder, autoFocus, onSubmit, isClearable, onClear, suggestions, isLoading } = _a, rest = __rest(_a, ["className", "size", "value", "onChange", "onKeyDown", "placeholder", "autoFocus", "onSubmit", "isClearable", "onClear", "suggestions", "isLoading"]);
|
|
24
24
|
const classes = classNames("vuiSearchInput", `vuiSearchInput--${size}`, className);
|
|
25
25
|
const inputRef = useRef(null);
|
|
26
26
|
const containerRef = useRef(null);
|
|
@@ -139,7 +139,10 @@ export const VuiSearchInput = (_a) => {
|
|
|
139
139
|
const inputClasses = classNames("vuiSearchInput__input", {
|
|
140
140
|
"vuiSearchInput__input--hasSuggestions": hasSuggestions
|
|
141
141
|
});
|
|
142
|
-
return (_jsx("form", Object.assign({ onSubmit: onSubmit, role: "search" }, { children: _jsxs("div", Object.assign({ ref: containerRef, className: classes, "aria-live": "polite", "aria-atomic": "true", "aria-busy": isLoading ? "true" : "false" }, { children: [_jsx("input", Object.assign({ ref: inputRef, className: inputClasses, type: "text", autoComplete: "off", autoCapitalize: "off", spellCheck: "false", autoFocus: autoFocus, placeholder: placeholder, value: value, onChange: onChange, onFocus: handleInputFocus, onKeyDown:
|
|
142
|
+
return (_jsx("form", Object.assign({ onSubmit: onSubmit, role: "search" }, { children: _jsxs("div", Object.assign({ ref: containerRef, className: classes, "aria-live": "polite", "aria-atomic": "true", "aria-busy": isLoading ? "true" : "false" }, { children: [_jsx("input", Object.assign({ ref: inputRef, className: inputClasses, type: "text", autoComplete: "off", autoCapitalize: "off", spellCheck: "false", autoFocus: autoFocus, placeholder: placeholder, value: value, onChange: onChange, onFocus: handleInputFocus, onKeyDown: (e) => {
|
|
143
|
+
handleInputKeyDown(e);
|
|
144
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
145
|
+
}, "aria-autocomplete": "list", "aria-controls": hasSuggestions ? controlsId : undefined }, rest)), _jsx("div", Object.assign({ className: "vuiSearchInput__icon" }, { children: isLoading ? (_jsx(VuiSpinner, { size: size === "m" ? "s" : "m" })) : (_jsx(VuiIcon, Object.assign({ color: "subdued", size: size === "m" ? "s" : "m" }, { children: _jsx(BiSearch, {}) }))) })), isClearable && value && (_jsx(VuiIconButton, { "aria-label": "Clear input", className: "vuiSearchInput__clearButton", icon: _jsx(VuiIcon, { children: _jsx(BiX, {}) }), onClick: (e) => {
|
|
143
146
|
e.preventDefault();
|
|
144
147
|
onClear();
|
|
145
148
|
} })), hasSuggestions && (_jsx(VuiSearchInputSuggestions, { id: controlsId, suggestions: suggestions, onSuggestionKeyDown: handleSuggestionKeyDown, suggestionRefs: suggestionRefs }))] })) })));
|
package/lib/styles/index.css
CHANGED
|
@@ -1006,17 +1006,6 @@ fieldset {
|
|
|
1006
1006
|
background-color: rgba(var(--vui-color-success-shade-rgb), 0.1);
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
|
-
.vuiIconButton--warning {
|
|
1010
|
-
color: rgb(var(--vui-color-warning-shade-rgb));
|
|
1011
|
-
background-color: rgba(var(--vui-color-warning-shade-rgb), 0);
|
|
1012
|
-
}
|
|
1013
|
-
.vuiIconButton--warning:hover {
|
|
1014
|
-
background-color: rgba(var(--vui-color-warning-shade-rgb), 0.1);
|
|
1015
|
-
}
|
|
1016
|
-
.vuiIconButton--warning-isSelected {
|
|
1017
|
-
background-color: rgba(var(--vui-color-warning-shade-rgb), 0.1);
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
1009
|
.vuiIconButton--danger {
|
|
1021
1010
|
color: rgb(var(--vui-color-danger-shade-rgb));
|
|
1022
1011
|
background-color: rgba(var(--vui-color-danger-shade-rgb), 0);
|
|
@@ -1028,15 +1017,26 @@ fieldset {
|
|
|
1028
1017
|
background-color: rgba(var(--vui-color-danger-shade-rgb), 0.1);
|
|
1029
1018
|
}
|
|
1030
1019
|
|
|
1020
|
+
.vuiIconButton--warning {
|
|
1021
|
+
color: rgb(var(--vui-color-warning-shade-rgb));
|
|
1022
|
+
background-color: rgba(var(--vui-color-warning-shade-rgb), 0);
|
|
1023
|
+
}
|
|
1024
|
+
.vuiIconButton--warning:hover {
|
|
1025
|
+
background-color: rgba(var(--vui-color-warning-shade-rgb), 0.1);
|
|
1026
|
+
}
|
|
1027
|
+
.vuiIconButton--warning-isSelected {
|
|
1028
|
+
background-color: rgba(var(--vui-color-warning-shade-rgb), 0.1);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
1031
|
.vuiIconButton--neutral {
|
|
1032
1032
|
color: rgb(var(--vui-color-darker-shade-rgb));
|
|
1033
|
-
background-color: rgba(var(--vui-color-
|
|
1033
|
+
background-color: rgba(var(--vui-color-subdued-shade-rgb), 0);
|
|
1034
1034
|
}
|
|
1035
1035
|
.vuiIconButton--neutral:hover {
|
|
1036
|
-
background-color: rgba(var(--vui-color-
|
|
1036
|
+
background-color: rgba(var(--vui-color-subdued-shade-rgb), 0.1);
|
|
1037
1037
|
}
|
|
1038
1038
|
.vuiIconButton--neutral-isSelected {
|
|
1039
|
-
background-color: rgba(var(--vui-color-
|
|
1039
|
+
background-color: rgba(var(--vui-color-subdued-shade-rgb), 0.1);
|
|
1040
1040
|
}
|
|
1041
1041
|
|
|
1042
1042
|
.vuiIconButton--subdued {
|
|
@@ -2870,6 +2870,34 @@ h2.react-datepicker__current-month {
|
|
|
2870
2870
|
max-width: 100%;
|
|
2871
2871
|
}
|
|
2872
2872
|
|
|
2873
|
+
.vuiSuperCheckboxGroup {
|
|
2874
|
+
display: grid;
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
.vuiSuperCheckbox {
|
|
2878
|
+
display: block;
|
|
2879
|
+
width: 100%;
|
|
2880
|
+
border-radius: 8px;
|
|
2881
|
+
padding: 12px 24px;
|
|
2882
|
+
cursor: pointer;
|
|
2883
|
+
text-decoration: none;
|
|
2884
|
+
transition: all 0.2s;
|
|
2885
|
+
text-decoration-color: var(--vui-color-text);
|
|
2886
|
+
text-align: left;
|
|
2887
|
+
}
|
|
2888
|
+
.vuiSuperCheckbox:hover {
|
|
2889
|
+
text-decoration: underline;
|
|
2890
|
+
text-decoration-color: var(--vui-color-primary-shade);
|
|
2891
|
+
background-color: var(--vui-color-primary-lighter-shade);
|
|
2892
|
+
}
|
|
2893
|
+
.vuiSuperCheckbox:hover .vuiSuperCheckbox__text {
|
|
2894
|
+
color: var(--vui-color-primary-shade) !important;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
.vuiSuperCheckbox__description {
|
|
2898
|
+
color: var(--vui-color-subdued-shade);
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2873
2901
|
.vuiSuperRadioGroup {
|
|
2874
2902
|
display: grid;
|
|
2875
2903
|
}
|