@homebound/beam 2.226.0 → 2.227.1
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/dist/Css.d.ts +9 -9
- package/dist/components/Accordion.d.ts +1 -1
- package/dist/components/Accordion.js +4 -4
- package/dist/components/AccordionList.js +1 -1
- package/dist/components/AutoSaveIndicator.js +5 -5
- package/dist/components/Avatar.d.ts +1 -1
- package/dist/components/Avatar.js +2 -2
- package/dist/components/AvatarButton.js +1 -1
- package/dist/components/BeamContext.js +1 -1
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Button.js +1 -1
- package/dist/components/ButtonDatePicker.js +2 -2
- package/dist/components/ButtonGroup.d.ts +2 -2
- package/dist/components/ButtonGroup.js +6 -6
- package/dist/components/ButtonMenu.d.ts +5 -5
- package/dist/components/ButtonMenu.js +1 -1
- package/dist/components/ButtonModal.js +1 -1
- package/dist/components/Chip.d.ts +1 -1
- package/dist/components/Chip.js +2 -2
- package/dist/components/Chips.d.ts +1 -1
- package/dist/components/Chips.js +3 -3
- package/dist/components/Copy.js +2 -2
- package/dist/components/CssReset.js +1 -1
- package/dist/components/Filters/BooleanFilter.d.ts +1 -1
- package/dist/components/Filters/BooleanFilter.js +2 -2
- package/dist/components/Filters/DateFilter.d.ts +2 -2
- package/dist/components/Filters/DateFilter.js +2 -2
- package/dist/components/Filters/DateRangeFilter.d.ts +2 -2
- package/dist/components/Filters/DateRangeFilter.js +2 -2
- package/dist/components/Filters/FilterModal.js +4 -4
- package/dist/components/Filters/Filters.d.ts +4 -2
- package/dist/components/Filters/Filters.js +12 -13
- package/dist/components/Filters/MultiFilter.d.ts +1 -1
- package/dist/components/Filters/MultiFilter.js +4 -4
- package/dist/components/Filters/NumberRangeFilter.d.ts +2 -2
- package/dist/components/Filters/NumberRangeFilter.js +5 -5
- package/dist/components/Filters/SingleFilter.d.ts +1 -1
- package/dist/components/Filters/SingleFilter.js +1 -1
- package/dist/components/Filters/ToggleFilter.d.ts +1 -1
- package/dist/components/Filters/ToggleFilter.js +2 -2
- package/dist/components/Filters/index.js +5 -1
- package/dist/components/Filters/testDomain.d.ts +9 -9
- package/dist/components/Filters/types.d.ts +2 -2
- package/dist/components/HbLoadingSpinner.js +9 -5
- package/dist/components/HelperText.js +1 -1
- package/dist/components/Icon.d.ts +1 -1
- package/dist/components/Icon.js +97 -97
- package/dist/components/IconButton.js +1 -1
- package/dist/components/Label.js +3 -3
- package/dist/components/Layout/PreventBrowserScroll.js +1 -1
- package/dist/components/Layout/RightPaneLayout/RightPaneContext.d.ts +1 -1
- package/dist/components/Layout/RightPaneLayout/RightPaneContext.js +6 -2
- package/dist/components/Layout/RightPaneLayout/RightPaneLayout.js +3 -3
- package/dist/components/Layout/RightPaneLayout/index.js +5 -1
- package/dist/components/Layout/ScrollableContent.js +3 -3
- package/dist/components/Layout/ScrollableParent.js +2 -2
- package/dist/components/Layout/index.js +5 -1
- package/dist/components/Loader.js +1 -1
- package/dist/components/LoadingSkeleton.d.ts +2 -2
- package/dist/components/LoadingSkeleton.js +1 -1
- package/dist/components/Modal/Modal.d.ts +3 -3
- package/dist/components/Modal/Modal.js +5 -5
- package/dist/components/Modal/OpenModal.js +2 -2
- package/dist/components/Modal/TestModalContent.js +3 -3
- package/dist/components/Modal/index.js +5 -1
- package/dist/components/NavLink.d.ts +1 -1
- package/dist/components/NavLink.js +2 -2
- package/dist/components/PresentationContext.d.ts +2 -2
- package/dist/components/PresentationContext.js +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/components/Snackbar/Snackbar.js +1 -1
- package/dist/components/Snackbar/SnackbarContext.d.ts +1 -1
- package/dist/components/Snackbar/SnackbarContext.js +1 -1
- package/dist/components/Snackbar/SnackbarNotice.d.ts +1 -1
- package/dist/components/Snackbar/SnackbarNotice.js +1 -1
- package/dist/components/Stepper.js +11 -11
- package/dist/components/SuperDrawer/ConfirmCloseModal.js +2 -2
- package/dist/components/SuperDrawer/SuperDrawer.js +3 -3
- package/dist/components/SuperDrawer/SuperDrawerContent.js +3 -3
- package/dist/components/SuperDrawer/components/SuperDrawerHeader.js +2 -2
- package/dist/components/SuperDrawer/index.js +5 -1
- package/dist/components/SuperDrawer/useSuperDrawer.d.ts +1 -1
- package/dist/components/SuperDrawer/useSuperDrawer.js +2 -2
- package/dist/components/Table/GridTable.d.ts +1 -1
- package/dist/components/Table/GridTable.js +33 -29
- package/dist/components/Table/GridTableApi.d.ts +1 -1
- package/dist/components/Table/TableActions.d.ts +1 -1
- package/dist/components/Table/TableActions.js +1 -1
- package/dist/components/Table/TableStyles.d.ts +1 -1
- package/dist/components/Table/components/CollapseToggle.js +1 -1
- package/dist/components/Table/components/EditColumnsButton.js +2 -2
- package/dist/components/Table/components/ExpandableHeader.js +2 -2
- package/dist/components/Table/components/Row.d.ts +2 -2
- package/dist/components/Table/components/Row.js +7 -3
- package/dist/components/Table/components/SelectToggle.js +1 -1
- package/dist/components/Table/components/SortHeader.js +3 -3
- package/dist/components/Table/components/cell.d.ts +2 -2
- package/dist/components/Table/components/cell.js +6 -6
- package/dist/components/Table/index.js +5 -1
- package/dist/components/Table/types.d.ts +13 -13
- package/dist/components/Table/utils/TableState.d.ts +4 -4
- package/dist/components/Table/utils/columns.js +2 -2
- package/dist/components/Table/utils/simpleHelpers.d.ts +1 -1
- package/dist/components/Table/utils/utils.js +5 -5
- package/dist/components/Tabs.d.ts +1 -1
- package/dist/components/Tabs.js +7 -7
- package/dist/components/Tag.d.ts +2 -2
- package/dist/components/Tag.js +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/ToastContext.d.ts +1 -1
- package/dist/components/Toast/ToastContext.js +1 -1
- package/dist/components/ToggleChip.d.ts +1 -1
- package/dist/components/ToggleChip.js +2 -2
- package/dist/components/ToggleChips.d.ts +1 -1
- package/dist/components/ToggleChips.js +1 -1
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip.js +9 -5
- package/dist/components/index.js +5 -1
- package/dist/components/internal/CompoundField.js +6 -6
- package/dist/components/internal/ContextualModal.js +1 -1
- package/dist/components/internal/DatePicker/DatePicker.js +2 -2
- package/dist/components/internal/DatePicker/DatePickerOverlay.js +1 -1
- package/dist/components/internal/DatePicker/DateRangePicker.js +2 -2
- package/dist/components/internal/DatePicker/Day.js +6 -6
- package/dist/components/internal/DatePicker/Header.js +2 -2
- package/dist/components/internal/DatePicker/WeekHeader.js +1 -1
- package/dist/components/internal/DatePicker/index.js +5 -1
- package/dist/components/internal/Menu.js +3 -3
- package/dist/components/internal/MenuItem.js +6 -6
- package/dist/components/internal/MenuSection.js +1 -1
- package/dist/components/internal/OverlayTrigger.js +1 -1
- package/dist/components/internal/Popover.js +1 -1
- package/dist/components/internal/index.js +5 -1
- package/dist/components/testData.d.ts +1 -1
- package/dist/components/testData.js +5 -5
- package/dist/forms/BoundCheckboxField.d.ts +1 -1
- package/dist/forms/BoundCheckboxField.js +3 -3
- package/dist/forms/BoundCheckboxGroupField.d.ts +1 -1
- package/dist/forms/BoundCheckboxGroupField.js +2 -2
- package/dist/forms/BoundChipSelectField.js +3 -3
- package/dist/forms/BoundDateField.d.ts +1 -1
- package/dist/forms/BoundDateField.js +2 -2
- package/dist/forms/BoundDateRangeField.d.ts +1 -1
- package/dist/forms/BoundDateRangeField.js +2 -2
- package/dist/forms/BoundMultiSelectField.d.ts +1 -1
- package/dist/forms/BoundMultiSelectField.js +3 -3
- package/dist/forms/BoundNumberField.d.ts +1 -1
- package/dist/forms/BoundNumberField.js +2 -2
- package/dist/forms/BoundRadioGroupField.d.ts +1 -1
- package/dist/forms/BoundRadioGroupField.js +2 -2
- package/dist/forms/BoundRichTextField.d.ts +1 -1
- package/dist/forms/BoundRichTextField.js +2 -2
- package/dist/forms/BoundSelectAndTextField.d.ts +2 -2
- package/dist/forms/BoundSelectAndTextField.js +1 -1
- package/dist/forms/BoundSelectField.d.ts +1 -1
- package/dist/forms/BoundSelectField.js +3 -3
- package/dist/forms/BoundSwitchField.d.ts +1 -1
- package/dist/forms/BoundSwitchField.js +3 -3
- package/dist/forms/BoundTextAreaField.d.ts +1 -1
- package/dist/forms/BoundTextAreaField.js +2 -2
- package/dist/forms/BoundTextField.d.ts +1 -1
- package/dist/forms/BoundTextField.js +2 -2
- package/dist/forms/BoundToggleChipGroupField.d.ts +1 -1
- package/dist/forms/BoundToggleChipGroupField.js +1 -1
- package/dist/forms/FormHeading.js +2 -2
- package/dist/forms/FormLines.d.ts +1 -1
- package/dist/forms/FormLines.js +5 -5
- package/dist/forms/FormStateApp.js +5 -5
- package/dist/forms/StaticField.js +1 -1
- package/dist/forms/StepperFormApp.js +10 -10
- package/dist/forms/index.js +5 -1
- package/dist/hooks/index.js +5 -1
- package/dist/hooks/useBreakpoint.d.ts +1 -1
- package/dist/hooks/useQueryState.d.ts +1 -1
- package/dist/hooks/useSessionStorage.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/inputs/Checkbox.js +1 -1
- package/dist/inputs/CheckboxBase.js +6 -6
- package/dist/inputs/CheckboxGroup.js +2 -2
- package/dist/inputs/ChipSelectField.d.ts +2 -2
- package/dist/inputs/ChipSelectField.js +14 -14
- package/dist/inputs/ChipTextField.js +3 -3
- package/dist/inputs/DateFields/DateField.js +1 -1
- package/dist/inputs/DateFields/DateField.mock.js +2 -2
- package/dist/inputs/DateFields/DateFieldBase.js +7 -7
- package/dist/inputs/DateFields/DateRangeField.js +1 -1
- package/dist/inputs/DateFields/index.js +5 -1
- package/dist/inputs/DateFields/utils.d.ts +2 -2
- package/dist/inputs/ErrorMessage.js +2 -2
- package/dist/inputs/MultiSelectField.js +2 -2
- package/dist/inputs/MultiSelectField.mock.js +4 -4
- package/dist/inputs/NumberField.d.ts +1 -1
- package/dist/inputs/NumberField.js +4 -4
- package/dist/inputs/RadioGroupField.js +3 -3
- package/dist/inputs/RichTextField.js +3 -3
- package/dist/inputs/RichTextField.mock.js +2 -2
- package/dist/inputs/SelectField.js +2 -2
- package/dist/inputs/SelectField.mock.js +4 -4
- package/dist/inputs/Switch.js +5 -5
- package/dist/inputs/SwitchGroup.d.ts +1 -1
- package/dist/inputs/SwitchGroup.js +1 -1
- package/dist/inputs/TextAreaField.js +1 -1
- package/dist/inputs/TextField.d.ts +1 -1
- package/dist/inputs/TextField.js +1 -1
- package/dist/inputs/TextFieldBase.js +10 -10
- package/dist/inputs/ToggleButton.js +1 -1
- package/dist/inputs/ToggleChipGroup.d.ts +1 -1
- package/dist/inputs/ToggleChipGroup.js +3 -3
- package/dist/inputs/Value.d.ts +1 -1
- package/dist/inputs/index.js +5 -1
- package/dist/inputs/internal/ListBox.js +3 -3
- package/dist/inputs/internal/ListBoxChip.js +1 -1
- package/dist/inputs/internal/ListBoxSection.js +1 -1
- package/dist/inputs/internal/ListBoxToggleChip.js +2 -2
- package/dist/inputs/internal/LoadingDots.js +2 -2
- package/dist/inputs/internal/MenuSearchField.js +1 -1
- package/dist/inputs/internal/Option.js +3 -3
- package/dist/inputs/internal/SelectFieldBase.d.ts +1 -1
- package/dist/inputs/internal/SelectFieldBase.js +2 -2
- package/dist/inputs/internal/SelectFieldInput.js +4 -4
- package/dist/inputs/internal/VirtualizedOptions.js +2 -2
- package/dist/interfaces.d.ts +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/utils/getInteractiveElement.js +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +5 -1
- package/dist/utils/rtl.js +1 -1
- package/dist/utils/sb.d.ts +2 -2
- package/dist/utils/sb.js +4 -4
- package/dist/utils/useTestIds.d.ts +1 -1
- package/package.json +4 -4
package/dist/components/Tabs.js
CHANGED
|
@@ -24,7 +24,7 @@ const Icon_1 = require("./Icon");
|
|
|
24
24
|
function TabsWithContent(props) {
|
|
25
25
|
// Do not apply default top padding styles if the tabs are being hidden. This avoids unnecessary white space being added
|
|
26
26
|
const styles = hideTabs(props) ? {} : Css_1.Css.pt3.$;
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Tabs,
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Tabs, { ...props }), (0, jsx_runtime_1.jsx)(TabContent, { ...props, contentXss: { ...styles, ...props.contentXss } })] }));
|
|
28
28
|
}
|
|
29
29
|
exports.TabsWithContent = TabsWithContent;
|
|
30
30
|
function TabContent(props) {
|
|
@@ -40,7 +40,7 @@ function TabContent(props) {
|
|
|
40
40
|
const uniqueValue = uniqueTabValue(selectedTab);
|
|
41
41
|
return (
|
|
42
42
|
// Using FullBleed to allow the tab's bgColor to extend to the edges of the <ScrollableContent /> element.
|
|
43
|
-
(0, jsx_runtime_1.jsx)(components_1.FullBleed, { children: (0, jsx_runtime_1.jsx)("div",
|
|
43
|
+
(0, jsx_runtime_1.jsx)(components_1.FullBleed, { children: (0, jsx_runtime_1.jsx)("div", { "aria-labelledby": `${uniqueValue}-tab`, id: `${uniqueValue}-tabPanel`, role: "tabpanel", tabIndex: 0, ...tid.panel, css: contentXss, children: isRouteTab(selectedTab) ? (0, jsx_runtime_1.jsx)(react_router_1.Route, { path: selectedTab.path, render: selectedTab.render }) : selectedTab.render() }) }));
|
|
44
44
|
}
|
|
45
45
|
exports.TabContent = TabContent;
|
|
46
46
|
/** The top list of tabs. */
|
|
@@ -79,10 +79,10 @@ function Tabs(props) {
|
|
|
79
79
|
setActive(selected);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: { ...Css_1.Css.df.aic.$, ...(includeBottomBorder ? { ...Css_1.Css.bb.bGray200.$ } : {}) }, children: [!hideTabs(props) && ((0, jsx_runtime_1.jsx)("div", { ref: ref, css: Css_1.Css.dif.gap1.asfe.$, "aria-label": ariaLabel, role: "tablist", ...tid, children: tabs.map((tab) => {
|
|
83
83
|
const uniqueValue = uniqueTabValue(tab);
|
|
84
|
-
return ((0, jsx_runtime_1.jsx)(TabImpl,
|
|
85
|
-
}) })
|
|
84
|
+
return ((0, jsx_runtime_1.jsx)(TabImpl, { active: active === uniqueValue, focusProps: focusProps, isFocusVisible: isFocusVisible, onClick: onClick, onKeyUp: onKeyUp, onBlur: onBlur, tab: tab, ...tid[(0, defaultTestId_1.defaultTestId)(uniqueValue)] }, uniqueValue));
|
|
85
|
+
}) })), right && (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.ml("auto").df.aic.gap1.pb1.$, children: right })] }));
|
|
86
86
|
}
|
|
87
87
|
exports.Tabs = Tabs;
|
|
88
88
|
function TabImpl(props) {
|
|
@@ -113,8 +113,8 @@ function TabImpl(props) {
|
|
|
113
113
|
onBlur,
|
|
114
114
|
...(isRouteTab(tab) ? {} : { onClick: () => onClick(tab.value) }),
|
|
115
115
|
});
|
|
116
|
-
const tabLabel = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label, (icon || endAdornment) && (0, jsx_runtime_1.jsx)("span",
|
|
117
|
-
return isDisabled ? ((0, jsx_runtime_1.jsx)("div",
|
|
116
|
+
const tabLabel = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label, (icon || endAdornment) && (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.ml1.$, children: icon ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: icon }) : endAdornment })] }));
|
|
117
|
+
return isDisabled ? ((0, jsx_runtime_1.jsx)("div", { ...tabProps, children: tabLabel })) : isRouteTab(tab) ? ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { ...{ ...tabProps, ...interactiveProps }, className: "navLink", to: tab.href, children: tabLabel })) : ((0, jsx_runtime_1.jsx)("button", { ...{ ...tabProps, ...interactiveProps }, children: tabLabel }));
|
|
118
118
|
}
|
|
119
119
|
function getTabStyles() {
|
|
120
120
|
const borderBottomWidthPx = 4;
|
package/dist/components/Tag.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IconKey } from "./";
|
|
2
2
|
import { Margin, Only, Xss } from "../Css";
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
type TagXss = Margin;
|
|
4
|
+
export type TagType = "info" | "caution" | "warning" | "success" | "neutral";
|
|
5
5
|
interface TagProps<X> {
|
|
6
6
|
text: string;
|
|
7
7
|
type?: TagType;
|
package/dist/components/Tag.js
CHANGED
|
@@ -9,7 +9,7 @@ const utils_1 = require("../utils");
|
|
|
9
9
|
function Tag({ text, type, xss, ...otherProps }) {
|
|
10
10
|
const typeStyles = getStyles(type);
|
|
11
11
|
const tid = (0, utils_1.useTestIds)(otherProps);
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)("span",
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("span", { ...tid, css: { ...Css_1.Css.dif.tinySb.ttu.aic.gapPx(4).pxPx(6).pyPx(2).gray900.br4.$, ...typeStyles, ...xss }, title: text, children: [otherProps.icon && ((0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.$, children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: otherProps.icon, inc: 1.5 }) })), (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.lineClamp1.breakAll.$, children: text })] }));
|
|
13
13
|
}
|
|
14
14
|
exports.Tag = Tag;
|
|
15
15
|
function getStyles(type) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function Toast(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
-
export
|
|
2
|
+
export type ToastTypes = "error" | "warning" | "success" | "info" | "alert";
|
|
@@ -10,7 +10,7 @@ const ToastContext_1 = require("./ToastContext");
|
|
|
10
10
|
function Toast() {
|
|
11
11
|
const { setNotice, notice } = (0, ToastContext_1.useToastContext)();
|
|
12
12
|
const tid = (0, utils_1.useTestIds)({}, "toast");
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: notice && ((0, jsx_runtime_1.jsxs)("div",
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: notice && ((0, jsx_runtime_1.jsxs)("div", { css: { ...variantStyles[notice.type], ...Css_1.Css.df.aic.w100.gap1.p2.gray900.base.bshBasic.$ }, ...tid, role: "alert", children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.$, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: typeToIcon[notice.type], ...tid.type, color: Css_1.Palette.Gray900 }) }), (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fg1.$, ...tid.message, children: notice.message }), (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.lh(0).$, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { icon: "x", onClick: () => setNotice(undefined), ...tid.close, color: Css_1.Palette.Gray900 }) })] })) }));
|
|
14
14
|
}
|
|
15
15
|
exports.Toast = Toast;
|
|
16
16
|
const typeToIcon = {
|
|
@@ -4,7 +4,7 @@ export interface ToastNoticeProps {
|
|
|
4
4
|
type: ToastTypes;
|
|
5
5
|
message: ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type ToastContextProps = {
|
|
8
8
|
notice: ToastNoticeProps | undefined;
|
|
9
9
|
setNotice: React.Dispatch<React.SetStateAction<ToastNoticeProps | undefined>>;
|
|
10
10
|
};
|
|
@@ -12,7 +12,7 @@ exports.ToastContext = (0, react_1.createContext)({
|
|
|
12
12
|
function ToastProvider(props) {
|
|
13
13
|
const [notice, setNotice] = (0, react_1.useState)();
|
|
14
14
|
const contextValue = (0, react_1.useMemo)(() => ({ setNotice, notice }), [setNotice, notice]);
|
|
15
|
-
return (0, jsx_runtime_1.jsx)(exports.ToastContext.Provider,
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(exports.ToastContext.Provider, { value: contextValue, children: props.children });
|
|
16
16
|
}
|
|
17
17
|
exports.ToastProvider = ToastProvider;
|
|
18
18
|
function useToastContext() {
|
|
@@ -12,7 +12,7 @@ function ToggleChip(props) {
|
|
|
12
12
|
// If compact, then use a smaller type scale
|
|
13
13
|
const compact = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.compact;
|
|
14
14
|
const tid = (0, useTestIds_1.useTestIds)(props, "chip");
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)("button",
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", css: {
|
|
16
16
|
...Css_1.Css[compact ? "xs" : "sm"].dif.aic.br16.pl1
|
|
17
17
|
// Use a lower right-padding to get closer to the `X` circle when not disabled
|
|
18
18
|
.prPx(2)
|
|
@@ -22,6 +22,6 @@ function ToggleChip(props) {
|
|
|
22
22
|
":hover:not(:disabled)": Css_1.Css.bgGray300.$,
|
|
23
23
|
":disabled": Css_1.Css.cursorNotAllowed.$,
|
|
24
24
|
...xss,
|
|
25
|
-
}, disabled: disabled, onClick: onClick
|
|
25
|
+
}, disabled: disabled, onClick: onClick, ...tid, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.prPx(6).tl.lineClamp1.breakAll.if(disabled).pr0.$, title: text, children: text }), !disabled && ((0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.br16.bgGray400.$, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "x", color: Css_1.Palette.Gray700, inc: compact ? 2 : undefined }) }))] }));
|
|
26
26
|
}
|
|
27
27
|
exports.ToggleChip = ToggleChip;
|
|
@@ -9,6 +9,6 @@ const useTestIds_1 = require("../utils/useTestIds");
|
|
|
9
9
|
function ToggleChips(props) {
|
|
10
10
|
const { values, getLabel, onRemove, xss } = props;
|
|
11
11
|
const tid = (0, useTestIds_1.useTestIds)(props, "toggleChips");
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)("div",
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: { ...Css_1.Css.df.add("flexWrap", "wrap").gap1.$, ...xss }, ...tid, children: values.map((value) => ((0, jsx_runtime_1.jsx)(ToggleChip_1.ToggleChip, { text: getLabel(value), onClick: () => onRemove(value), ...tid.chip }, getLabel(value)))) }));
|
|
13
13
|
}
|
|
14
14
|
exports.ToggleChips = ToggleChips;
|
|
@@ -8,7 +8,7 @@ interface TooltipProps {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare function Tooltip(props: TooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
export
|
|
11
|
+
export type Placement = "top" | "bottom" | "left" | "right" | "auto";
|
|
12
12
|
export declare function maybeTooltip(props: Omit<TooltipProps, "children"> & {
|
|
13
13
|
children: ReactElement;
|
|
14
14
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -35,12 +39,12 @@ function Tooltip(props) {
|
|
|
35
39
|
const { triggerProps, tooltipProps: _tooltipProps } = (0, react_aria_1.useTooltipTrigger)({ isDisabled: disabled }, state, triggerRef);
|
|
36
40
|
const { tooltipProps } = (0, react_aria_1.useTooltip)(_tooltipProps, state);
|
|
37
41
|
const tid = (0, utils_1.useTestIds)(props, "tooltip");
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span",
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { ref: triggerRef, ...triggerProps, ...(!state.isOpen && typeof title === "string" ? { title } : {}), ...tid,
|
|
39
43
|
// Adding `draggable` as a hack to allow focus to continue through this element and into its children.
|
|
40
44
|
// This is due to some code in React-Aria that prevents default due ot mobile browser inconsistencies,
|
|
41
45
|
// and the only way they don't prevent default is if the element is draggable.
|
|
42
46
|
// See https://github.com/adobe/react-spectrum/discussions/3058 for discussion related to this issue.
|
|
43
|
-
draggable: true, onDragStart: (e) => e.preventDefault()
|
|
47
|
+
draggable: true, onDragStart: (e) => e.preventDefault(), children: children }), state.isOpen && ((0, jsx_runtime_1.jsx)(Popper, { ...(0, react_aria_1.mergeProps)(_tooltipProps, tooltipProps), triggerRef: triggerRef, content: title, placement: placement }))] }));
|
|
44
48
|
}
|
|
45
49
|
exports.Tooltip = Tooltip;
|
|
46
50
|
function Popper({ triggerRef, content, placement = "auto" }) {
|
|
@@ -53,12 +57,12 @@ function Popper({ triggerRef, content, placement = "auto" }) {
|
|
|
53
57
|
],
|
|
54
58
|
placement,
|
|
55
59
|
});
|
|
56
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div",
|
|
60
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { ref: popperRef, style: styles.popper, ...attributes.popper, css: Css_1.Css.maxw("320px").bgGray900.white.px1.py("4px").br4.xs.add("zIndex", 999999).$, children: [(0, jsx_runtime_1.jsx)("div", { ref: setArrowRef, style: { ...styles.arrow }, id: "arrow" }), content] }), document.body);
|
|
57
61
|
}
|
|
58
62
|
// Helper function to conditionally wrap component with Tooltip if necessary.
|
|
59
63
|
// `maybeTooltip` requires that the `children` prop be a ReactElement, even though <Tooltip /> allows for ReactNode.
|
|
60
64
|
function maybeTooltip(props) {
|
|
61
|
-
return props.title ? (0, jsx_runtime_1.jsx)(Tooltip,
|
|
65
|
+
return props.title ? (0, jsx_runtime_1.jsx)(Tooltip, { ...props }) : props.children;
|
|
62
66
|
}
|
|
63
67
|
exports.maybeTooltip = maybeTooltip;
|
|
64
68
|
// Helper function for resolving showing the Tooltip text via a 'disabled' prop, or the 'tooltip' prop.
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,21 +11,21 @@ function CompoundField({ children }) {
|
|
|
11
11
|
}
|
|
12
12
|
const commonStyles = Css_1.Css.df.aic.fs1.maxwPx(550).bt.bb.bGray300.$;
|
|
13
13
|
const internalProps = { compound: true };
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: {
|
|
15
15
|
...Css_1.Css.df.$,
|
|
16
16
|
"&:focus-within > div:nth-of-type(2)": Css_1.Css.bgLightBlue700.$, // Separation line when inputs are focused
|
|
17
|
-
}
|
|
17
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { css: {
|
|
18
18
|
...commonStyles,
|
|
19
19
|
...Css_1.Css.bl.borderRadius("4px 0 0 4px").$,
|
|
20
20
|
"&:focus-within": Css_1.Css.bLightBlue700.$,
|
|
21
|
-
}
|
|
21
|
+
}, children: (0, react_1.cloneElement)(children[0], {
|
|
22
22
|
internalProps,
|
|
23
|
-
}) }),
|
|
23
|
+
}) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.wPx(1).flexNone.bgGray300.$ }), (0, jsx_runtime_1.jsx)("div", { css: {
|
|
24
24
|
...commonStyles,
|
|
25
25
|
...Css_1.Css.fg1.br.borderRadius("0 4px 4px 0").$,
|
|
26
26
|
"&:focus-within": Css_1.Css.bLightBlue700.$,
|
|
27
|
-
}
|
|
27
|
+
}, children: (0, react_1.cloneElement)(children[1], {
|
|
28
28
|
internalProps,
|
|
29
|
-
}) })
|
|
29
|
+
}) })] }));
|
|
30
30
|
}
|
|
31
31
|
exports.CompoundField = CompoundField;
|
|
@@ -8,6 +8,6 @@ const utils_1 = require("../../utils");
|
|
|
8
8
|
function ContextualModal(props) {
|
|
9
9
|
const { content, title, close } = props;
|
|
10
10
|
const tid = (0, utils_1.useTestIds)(props, "popup");
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(react_aria_1.FocusScope,
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, { restoreFocus: true, autoFocus: true, children: (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.p3.df.fdc.gap3.bgWhite.bshModal.br4.maxh("inherit").overflowAuto.$, ...tid, children: [title && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.lg.tc.$, ...tid.title, children: title })), (0, jsx_runtime_1.jsx)("div", { ...tid.content, children: typeof content === "function" ? content(close) : content })] }) }));
|
|
12
12
|
}
|
|
13
13
|
exports.ContextualModal = ContextualModal;
|
|
@@ -12,13 +12,13 @@ require("./DatePicker.css");
|
|
|
12
12
|
function DatePicker(props) {
|
|
13
13
|
const { value, onSelect, disabledDays, dottedDays } = props;
|
|
14
14
|
const tid = (0, utils_1.useTestIds)(props, "datePicker");
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)("div",
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.dib.bgWhite.xs.$, ...tid, children: (0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { components: { Caption: Header_1.Header, Head: WeekHeader_1.WeekHeader, Day: Day_1.Day },
|
|
16
16
|
// DatePicker only allows for a single date to be `selected` (per our props) though DayPicker expects an array of dates
|
|
17
17
|
selected: value ? [value] : [], defaultMonth: value !== null && value !== void 0 ? value : new Date(), onDayClick: (day, modifiers) => {
|
|
18
18
|
if (modifiers.disabled)
|
|
19
19
|
return;
|
|
20
20
|
// Set the day value
|
|
21
21
|
onSelect(day);
|
|
22
|
-
}, disabled: disabledDays, modifiers: { indicatorDot: dottedDays !== null && dottedDays !== void 0 ? dottedDays : [] } }
|
|
22
|
+
}, disabled: disabledDays, modifiers: { indicatorDot: dottedDays !== null && dottedDays !== void 0 ? dottedDays : [] } }) }));
|
|
23
23
|
}
|
|
24
24
|
exports.DatePicker = DatePicker;
|
|
@@ -8,6 +8,6 @@ function DatePickerOverlay({ overlayProps, children }) {
|
|
|
8
8
|
return (
|
|
9
9
|
// Adds `tabIndex` so clicking within the DatePicker will provide a `e.relatedTarget` on blur and focus events.
|
|
10
10
|
// This allows for components such as the DateField to conditionally trigger their 'onBlur' prop. E.g. If the user leaves the field to interact with the DatePicker, then don't call onBlur
|
|
11
|
-
(0, jsx_runtime_1.jsx)("div",
|
|
11
|
+
(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.br4.bshModal.$, ...overlayProps, tabIndex: 0, children: children }));
|
|
12
12
|
}
|
|
13
13
|
exports.DatePickerOverlay = DatePickerOverlay;
|
|
@@ -13,11 +13,11 @@ function DateRangePicker(props) {
|
|
|
13
13
|
var _a;
|
|
14
14
|
const { range, onSelect, disabledDays, dottedDays, useYearPicker } = props;
|
|
15
15
|
const tid = (0, utils_1.useTestIds)(props, "datePicker");
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)("div",
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.dib.bgWhite.xs.$, ...tid, children: (0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { mode: "range", selected: range, components: { Caption: useYearPicker ? Header_1.YearSkipHeader : Header_1.Header, Head: WeekHeader_1.WeekHeader, Day: Day_1.Day }, defaultMonth: (_a = range === null || range === void 0 ? void 0 : range.to) !== null && _a !== void 0 ? _a : new Date(), onSelect: (selection, day, activeModifiers) => {
|
|
17
17
|
// Disallow returning disabled dates.
|
|
18
18
|
if (activeModifiers.disabled)
|
|
19
19
|
return;
|
|
20
20
|
onSelect(selection);
|
|
21
|
-
}, disabled: disabledDays, modifiers: { indicatorDot: dottedDays !== null && dottedDays !== void 0 ? dottedDays : [] } }
|
|
21
|
+
}, disabled: disabledDays, modifiers: { indicatorDot: dottedDays !== null && dottedDays !== void 0 ? dottedDays : [] } }) }));
|
|
22
22
|
}
|
|
23
23
|
exports.DateRangePicker = DateRangePicker;
|
|
@@ -13,10 +13,10 @@ function Day(props) {
|
|
|
13
13
|
const buttonRef = (0, react_1.useRef)(null);
|
|
14
14
|
const { isHidden, isButton, activeModifiers, buttonProps, divProps } = (0, react_day_picker_1.useDayRender)(props.date, props.displayMonth, buttonRef);
|
|
15
15
|
if (isHidden) {
|
|
16
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}
|
|
16
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
17
17
|
}
|
|
18
18
|
if (!isButton) {
|
|
19
|
-
return (0, jsx_runtime_1.jsx)("div",
|
|
19
|
+
return (0, jsx_runtime_1.jsx)("div", { ...divProps });
|
|
20
20
|
}
|
|
21
21
|
const { className, children, ...otherProps } = buttonProps;
|
|
22
22
|
const { selected = false, indicatorDot = false, disabled = false, today = false, range_middle = false, range_start = false, range_end = false, } = activeModifiers;
|
|
@@ -24,7 +24,7 @@ function Day(props) {
|
|
|
24
24
|
// When this happens, do not show styling as if there is an existing range.
|
|
25
25
|
const showRangeStyles = !(range_end === true && range_start === true);
|
|
26
26
|
const showActiveStyles = !disabled;
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)("button",
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)("button", { ...otherProps, ref: buttonRef, type: "button", css: {
|
|
28
28
|
...Css_1.Css.relative.pbPx(4).outline0.if(disabled).cursorNotAllowed.$,
|
|
29
29
|
// Do not apply interaction styles for disabled or already selected days.
|
|
30
30
|
...(!selected &&
|
|
@@ -38,18 +38,18 @@ function Day(props) {
|
|
|
38
38
|
Css_1.Css.addIn(":after", { ...rangeBaseStyles, ...Css_1.Css.rightPx(-2).wPx(8).$ }).$),
|
|
39
39
|
...(showRangeStyles && range_end && Css_1.Css.addIn(":after", { ...rangeBaseStyles, ...Css_1.Css.wPx(8).leftPx(-2).$ }).$),
|
|
40
40
|
...(showRangeStyles && range_middle && Css_1.Css.addIn(":after", { ...rangeBaseStyles, ...Css_1.Css.leftPx(-2).$ }).$),
|
|
41
|
-
}
|
|
41
|
+
}, ...tid, children: (0, jsx_runtime_1.jsxs)("div", { css: {
|
|
42
42
|
...Css_1.Css.overflowHidden.gray900.relative.z1.br4.df.aic.jcc.wPx(28).hPx(30).mtPx(2).br4.$,
|
|
43
43
|
...(today && !range_middle && Css_1.Css.bgGray100.$),
|
|
44
44
|
...(selected && !range_middle && Css_1.Css.white.bgLightBlue700.$),
|
|
45
45
|
...(disabled && Css_1.Css.gray500.$),
|
|
46
|
-
}
|
|
46
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mtPx(-2).$, children: children }), indicatorDot && ((0, jsx_runtime_1.jsx)("div", {
|
|
47
47
|
// Using `absolute` position as to not change the placement of the day's number when this is introduced
|
|
48
48
|
css: Css_1.Css.absolute
|
|
49
49
|
.bottomPx(4)
|
|
50
50
|
.wPx(4)
|
|
51
51
|
.hPx(4)
|
|
52
|
-
.bgLightBlue700.br4.if(selected && !range_middle).bgWhite
|
|
52
|
+
.bgLightBlue700.br4.if(selected && !range_middle).bgWhite.$, ...tid.indicatorDot }))] }) }));
|
|
53
53
|
}
|
|
54
54
|
exports.Day = Day;
|
|
55
55
|
const rangeBaseStyles = Css_1.Css.absolute.topPx(2).contentEmpty.hPx(30).wPx(32).bgLightBlue100.$;
|
|
@@ -9,13 +9,13 @@ const Css_1 = require("../../../Css");
|
|
|
9
9
|
function Header(props) {
|
|
10
10
|
const { displayMonth } = props;
|
|
11
11
|
const { goToMonth } = (0, react_day_picker_1.useNavigation)();
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.aic.mlPx(12).mrPx(2).hPx(32).$, children: [(0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.base.$, children: (0, date_fns_1.format)(displayMonth, "MMMM yyyy") }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { color: Css_1.Palette.Gray700, icon: "chevronLeft", onClick: () => goToMonth((0, date_fns_1.addMonths)(displayMonth, -1)) }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { color: Css_1.Palette.Gray700, icon: "chevronRight", onClick: () => goToMonth((0, date_fns_1.addMonths)(displayMonth, 1)) })] })] }));
|
|
13
13
|
}
|
|
14
14
|
exports.Header = Header;
|
|
15
15
|
// Header with year skip option
|
|
16
16
|
function YearSkipHeader(props) {
|
|
17
17
|
const { displayMonth } = props;
|
|
18
18
|
const { goToMonth } = (0, react_day_picker_1.useNavigation)();
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.aic.mlPx(12).mrPx(12).hPx(32).$, children: [(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.fdr.jcsb.$, children: [(0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { color: Css_1.Palette.Gray700, icon: "chevronLeft", onClick: () => goToMonth((0, date_fns_1.addMonths)(displayMonth, -1)) }), (0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.base.$, children: (0, date_fns_1.format)(displayMonth, "MMM") }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { color: Css_1.Palette.Gray700, icon: "chevronRight", onClick: () => goToMonth((0, date_fns_1.addMonths)(displayMonth, 1)) })] }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.fdr.jcsb.$, children: [(0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { color: Css_1.Palette.Gray700, icon: "chevronLeft", onClick: () => goToMonth((0, date_fns_1.addYears)(displayMonth, -1)) }), (0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.base.$, children: (0, date_fns_1.format)(displayMonth, "yyyy") }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { color: Css_1.Palette.Gray700, icon: "chevronRight", onClick: () => goToMonth((0, date_fns_1.addYears)(displayMonth, 1)) })] })] }));
|
|
20
20
|
}
|
|
21
21
|
exports.YearSkipHeader = YearSkipHeader;
|
|
@@ -11,6 +11,6 @@ function WeekHeader() {
|
|
|
11
11
|
days.push((0, date_fns_1.addDays)(start, i));
|
|
12
12
|
}
|
|
13
13
|
// Copies the existing structure and classes defined by React-Day-Picker. Adds in Beam styling and formatting.
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)("thead",
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("thead", { className: "rdp-head", children: (0, jsx_runtime_1.jsx)("tr", { className: "rdp-head_row", children: days.map((day) => ((0, jsx_runtime_1.jsxs)("th", { scope: "col", css: Css_1.Css.p1.pbPx(12).xs.gray400.$, children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", children: (0, date_fns_1.format)(day, "EEEEE") }), (0, jsx_runtime_1.jsx)("span", { className: "rdp-vhidden", children: (0, date_fns_1.format)(day, "EEEE") })] }, (0, date_fns_1.format)(day, "EEEE")))) }) }));
|
|
15
15
|
}
|
|
16
16
|
exports.WeekHeader = WeekHeader;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -44,7 +44,7 @@ function Menu(props) {
|
|
|
44
44
|
}
|
|
45
45
|
}, [tree, search, contains]);
|
|
46
46
|
const menuChildren = (0, react_1.useMemo)(() => {
|
|
47
|
-
return filteredTree.items.map(({ value: s }) => ((0, jsx_runtime_1.jsx)(react_stately_1.Section,
|
|
47
|
+
return filteredTree.items.map(({ value: s }) => ((0, jsx_runtime_1.jsx)(react_stately_1.Section, { title: s.label, items: s.items, children: (item) => (0, jsx_runtime_1.jsx)(react_stately_1.Item, { children: item.label }, item.label.replace(/"/g, "")) }, s.label.replace(/"/g, ""))));
|
|
48
48
|
}, [filteredTree]);
|
|
49
49
|
const state = (0, react_stately_1.useTreeState)({
|
|
50
50
|
children: menuChildren,
|
|
@@ -57,11 +57,11 @@ function Menu(props) {
|
|
|
57
57
|
// Bulk updates of MenuItems below. If we find this to be of sluggish performance, then we can change to be more surgical in our updating.
|
|
58
58
|
// If our list of items change, update the "items" menu section. (key is based on label in `getKey` above)
|
|
59
59
|
(0, react_1.useEffect)(() => filteredTree.update("items", { label: "items", items }), [items]);
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, { children: (0, jsx_runtime_1.jsxs)("div",
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, { children: (0, jsx_runtime_1.jsxs)("div", {
|
|
61
61
|
// Using `max-height: inherit` allows us to take advantage of the height set on the overlay container, which updates based on the available space for the overlay within the viewport
|
|
62
62
|
css: {
|
|
63
63
|
...Css_1.Css.df.fdc.myPx(4).bgWhite.outline0.br4.bshBasic.maxh("inherit").overflowAuto.$,
|
|
64
64
|
"&:hover": Css_1.Css.bshHover.$,
|
|
65
|
-
}
|
|
65
|
+
}, children: [searchable && ((0, jsx_runtime_1.jsx)(MenuSearchField_1.MenuSearchField, { label: "", value: search, placeholder: "Search...", inlineLabel: true, onChange: setSearch, ...tid })), (0, jsx_runtime_1.jsx)("ul", { css: Css_1.Css.listReset.$, ...menuProps, ref: menuRef, ...tid.menu, children: [...state.collection].map((item) => ((0, jsx_runtime_1.jsx)(MenuSection_1.MenuSectionImpl, { section: item, state: state, onClose: onClose, ...tid }, item.key))) })] }) }));
|
|
66
66
|
}
|
|
67
67
|
exports.Menu = Menu;
|
|
@@ -44,28 +44,28 @@ function MenuItemImpl(props) {
|
|
|
44
44
|
},
|
|
45
45
|
onClose,
|
|
46
46
|
}, state, ref);
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)("li",
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)("li", { ...menuItemProps, ...hoverProps, ref: ref, css: {
|
|
48
48
|
...Css_1.Css.df.aic.py1.px2.cursorPointer.outline0.mh("42px").$,
|
|
49
49
|
...(!isDisabled && isHovered ? Css_1.Css.bgGray100.$ : {}),
|
|
50
50
|
...(isFocused ? Css_1.Css.add("boxShadow", `inset 0 0 0 1px ${Css_1.Palette.LightBlue700}`).$ : {}),
|
|
51
51
|
...(isDisabled ? Css_1.Css.gray500.cursorNotAllowed.$ : {}),
|
|
52
52
|
...(destructive ? Css_1.Css.red600.$ : {}),
|
|
53
|
-
}
|
|
53
|
+
}, ...tid[(0, defaultTestId_1.defaultTestId)(menuItem.label)], children: maybeWrapInLink(onClick, isIconMenuItem(menuItem) ? ((0, jsx_runtime_1.jsx)(IconMenuItem, { ...menuItem })) : isImageMenuItem(menuItem) ? ((0, jsx_runtime_1.jsx)(ImageMenuItem, { ...menuItem })) : (label), isDisabled) }));
|
|
54
54
|
}
|
|
55
55
|
exports.MenuItemImpl = MenuItemImpl;
|
|
56
56
|
function ImageMenuItem(item) {
|
|
57
57
|
const { src, size = 24, label, isAvatar = false } = item;
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span",
|
|
58
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.mr2.$, children: isAvatar ? ((0, jsx_runtime_1.jsx)(Avatar_1.Avatar, { src: src, name: label, size: size === 24 ? "sm" : "lg" })) : ((0, jsx_runtime_1.jsx)("img", { width: size, src: src, css: Css_1.Css.br4.$, alt: label })) }), label] }));
|
|
59
59
|
}
|
|
60
60
|
function IconMenuItem(item) {
|
|
61
61
|
const { icon, label } = item;
|
|
62
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span",
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.mr2.$, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: icon }) }), label] }));
|
|
63
63
|
}
|
|
64
64
|
function maybeWrapInLink(onClick, content, disabled) {
|
|
65
65
|
if (disabled || typeof onClick !== "string") {
|
|
66
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: content }
|
|
66
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: content });
|
|
67
67
|
}
|
|
68
|
-
return (0, utils_1.isAbsoluteUrl)(onClick) ? ((0, jsx_runtime_1.jsxs)("a",
|
|
68
|
+
return (0, utils_1.isAbsoluteUrl)(onClick) ? ((0, jsx_runtime_1.jsxs)("a", { href: onClick, target: "_blank", rel: "noopener noreferrer", className: "navLink", css: Css_1.Css.df.jcsb.w100.$, children: [content, (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.ml2.$, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "linkExternal" }) })] })) : ((0, jsx_runtime_1.jsx)(react_router_dom_1.NavLink, { to: onClick, className: "navLink", children: content }));
|
|
69
69
|
}
|
|
70
70
|
function isIconMenuItem(item) {
|
|
71
71
|
return item && typeof item === "object" && "icon" in item;
|
|
@@ -12,6 +12,6 @@ function MenuSectionImpl(props) {
|
|
|
12
12
|
const { separatorProps } = (0, react_aria_1.useSeparator)({ elementType: "li" });
|
|
13
13
|
const isPersistentSection = section.key !== state.collection.getFirstKey();
|
|
14
14
|
const tid = (0, utils_1.useTestIds)(props);
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isPersistentSection && (0, jsx_runtime_1.jsx)("li",
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isPersistentSection && (0, jsx_runtime_1.jsx)("li", { ...separatorProps, css: Css_1.Css.bt.bGray200.$ }), (0, jsx_runtime_1.jsx)("li", { ...itemProps, css: Css_1.Css.if(!isPersistentSection).overflowAuto.$, children: (0, jsx_runtime_1.jsx)("ul", { css: Css_1.Css.listReset.$, ...groupProps, ...tid[isPersistentSection ? "persistentItems" : "menuItems"], children: [...section.childNodes].map((item) => ((0, jsx_runtime_1.jsx)(internal_1.MenuItemImpl, { item: item, state: state, onClose: onClose, ...tid }, item.key))) }) })] }));
|
|
16
16
|
}
|
|
17
17
|
exports.MenuSectionImpl = MenuSectionImpl;
|
|
@@ -25,7 +25,7 @@ function OverlayTrigger(props) {
|
|
|
25
25
|
offset: showActiveBorder ? 4 : undefined,
|
|
26
26
|
});
|
|
27
27
|
const tid = (0, utils_1.useTestIds)(props, isTextButton(trigger) ? (0, defaultTestId_1.defaultTestId)(trigger.label) : isIconButton(trigger) ? trigger.icon : trigger.name);
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.relative.dib.$, children: [isTextButton(trigger) ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: variant ? variant : "secondary", ...trigger, menuTriggerProps: menuTriggerProps, buttonRef: buttonRef, endAdornment: !hideEndAdornment ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: state.isOpen ? "chevronUp" : "chevronDown" }) : null, disabled: disabled, tooltip: tooltip, onClick: utils_1.noop, forceFocusStyles: showActiveBorder && state.isOpen, ...tid })) : isIconButton(trigger) ? ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { ...trigger, menuTriggerProps: menuTriggerProps, buttonRef: buttonRef, ...tid, disabled: disabled, tooltip: tooltip, onClick: utils_1.noop, forceFocusStyles: showActiveBorder && state.isOpen })) : ((0, jsx_runtime_1.jsx)(AvatarButton_1.AvatarButton, { ...trigger, menuTriggerProps: menuTriggerProps, buttonRef: buttonRef, ...tid, disabled: disabled, tooltip: tooltip, onClick: utils_1.noop, forceFocusStyles: showActiveBorder && state.isOpen })), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, { triggerRef: buttonRef, popoverRef: popoverRef, positionProps: positionProps, onClose: () => state.close(), isOpen: state.isOpen, children: children }))] }));
|
|
29
29
|
}
|
|
30
30
|
exports.OverlayTrigger = OverlayTrigger;
|
|
31
31
|
function isTextButton(trigger) {
|
|
@@ -26,6 +26,6 @@ function Popover(props) {
|
|
|
26
26
|
},
|
|
27
27
|
...others,
|
|
28
28
|
}, popoverRef);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(react_aria_1.OverlayContainer, { children: (0, jsx_runtime_1.jsxs)("div",
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_1.OverlayContainer, { children: (0, jsx_runtime_1.jsxs)("div", { ...{ ...overlayProps, ...positionProps }, ref: popoverRef, children: [children, (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: () => onClose() })] }) }));
|
|
30
30
|
}
|
|
31
31
|
exports.Popover = Popover;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { TabWithContent } from "./Tabs";
|
|
3
|
-
export
|
|
3
|
+
export type TabValue = "tab1" | "tab2" | "tab3" | "tab4";
|
|
4
4
|
export declare const testTabs: TabWithContent<TabValue>[];
|
|
5
5
|
export declare function TestTabContent({ content }: {
|
|
6
6
|
content: ReactNode;
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TestTabContent = exports.testTabs = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
exports.testTabs = [
|
|
6
|
-
{ name: "Tab 1", value: "tab1", render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 1 Content" }
|
|
7
|
-
{ name: "Tab 2", value: "tab2", render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 2 Content" }
|
|
8
|
-
{ name: "Tab 3", value: "tab3", disabled: true, render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 3 Content" }
|
|
9
|
-
{ name: "Tab 4", value: "tab4", render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 4 Content" }
|
|
6
|
+
{ name: "Tab 1", value: "tab1", render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 1 Content" }) },
|
|
7
|
+
{ name: "Tab 2", value: "tab2", render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 2 Content" }) },
|
|
8
|
+
{ name: "Tab 3", value: "tab3", disabled: true, render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 3 Content" }) },
|
|
9
|
+
{ name: "Tab 4", value: "tab4", render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 4 Content" }) },
|
|
10
10
|
];
|
|
11
11
|
function TestTabContent({ content }) {
|
|
12
|
-
return (0, jsx_runtime_1.jsx)("div", { children: content }
|
|
12
|
+
return (0, jsx_runtime_1.jsx)("div", { children: content });
|
|
13
13
|
}
|
|
14
14
|
exports.TestTabContent = TestTabContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldState } from "@homebound/form-state";
|
|
2
2
|
import { CheckboxProps } from "../inputs";
|
|
3
|
-
export
|
|
3
|
+
export type BoundCheckboxFieldProps = Omit<CheckboxProps, "selected" | "onChange" | "label"> & {
|
|
4
4
|
field: FieldState<any, boolean | null | undefined>;
|
|
5
5
|
/** Make optional so that callers can override if they want to. */
|
|
6
6
|
onChange?: (values: boolean) => void;
|
|
@@ -12,7 +12,7 @@ function BoundCheckboxField(props) {
|
|
|
12
12
|
const testId = (0, utils_1.useTestIds)(props, field.key);
|
|
13
13
|
return ((0, jsx_runtime_1.jsx)(mobx_react_1.Observer, { children: () => {
|
|
14
14
|
var _a;
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(inputs_1.Checkbox,
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(inputs_1.Checkbox, { label: label, selected: (_a = field.value) !== null && _a !== void 0 ? _a : false, onChange: (selected) => {
|
|
16
16
|
// We are triggering blur manually for checkbox fields due to its transactional nature
|
|
17
17
|
onChange(selected);
|
|
18
18
|
field.maybeAutoSave();
|
|
@@ -22,7 +22,7 @@ function BoundCheckboxField(props) {
|
|
|
22
22
|
}, onBlur: () => {
|
|
23
23
|
field.blur();
|
|
24
24
|
(0, utils_1.maybeCall)(onBlur);
|
|
25
|
-
}, disabled: disabled || field.readOnly
|
|
26
|
-
} }
|
|
25
|
+
}, disabled: disabled || field.readOnly, ...testId, ...others }));
|
|
26
|
+
} }));
|
|
27
27
|
}
|
|
28
28
|
exports.BoundCheckboxField = BoundCheckboxField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldState } from "@homebound/form-state";
|
|
2
2
|
import { CheckboxGroupProps } from "../inputs";
|
|
3
|
-
export
|
|
3
|
+
export type BoundCheckboxGroupFieldProps = Omit<CheckboxGroupProps, "values" | "onChange" | "label"> & {
|
|
4
4
|
field: FieldState<any, string[] | null | undefined>;
|
|
5
5
|
/** Make optional so that callers can override if they want to. */
|
|
6
6
|
onChange?: (values: string[]) => void;
|