@homebound/beam 2.352.0 → 2.354.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/dist/Css.d.ts +109 -133
- package/dist/Css.js +109 -133
- package/dist/components/Accordion.js +2 -2
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/Avatar/AvatarGroup.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/ButtonGroup.js +2 -2
- package/dist/components/Chip.js +1 -1
- package/dist/components/DnDGrid/DnDGridItemHandle.js +2 -2
- package/dist/components/Filters/FilterModal.js +1 -1
- package/dist/components/IconButton.js +2 -2
- package/dist/components/Label.js +1 -1
- package/dist/components/Layout/PreventBrowserScroll.js +1 -1
- package/dist/components/Layout/RightPaneLayout/RightPaneLayout.js +2 -2
- package/dist/components/Layout/ScrollableContent.d.ts +1 -1
- package/dist/components/Layout/ScrollableContent.js +1 -1
- package/dist/components/Layout/ScrollableParent.js +2 -2
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Pagination.js +1 -1
- package/dist/components/ScrollShadows.js +2 -2
- package/dist/components/Stepper.js +1 -1
- package/dist/components/SuperDrawer/SuperDrawer.js +2 -2
- package/dist/components/SuperDrawer/SuperDrawerContent.js +2 -2
- package/dist/components/SuperDrawer/components/SuperDrawerHeader.js +1 -1
- package/dist/components/Table/TableStyles.js +9 -9
- package/dist/components/Table/components/ExpandableHeader.js +1 -1
- package/dist/components/Table/components/Row.js +4 -4
- package/dist/components/Table/components/SortHeader.js +1 -1
- package/dist/components/Table/components/cell.js +2 -2
- package/dist/components/Tabs.js +4 -4
- package/dist/components/Tag.js +1 -1
- package/dist/components/ToggleChip.js +1 -1
- package/dist/components/internal/CompoundField.js +4 -4
- package/dist/components/internal/ContextualModal.js +1 -1
- package/dist/components/internal/DatePicker/Day.js +2 -2
- package/dist/components/internal/Menu.js +1 -1
- package/dist/components/internal/MenuSection.js +1 -1
- package/dist/forms/StepperFormApp.js +3 -3
- package/dist/inputs/CheckboxBase.js +5 -5
- package/dist/inputs/ChipSelectField.js +3 -3
- package/dist/inputs/IconCard.js +3 -3
- package/dist/inputs/NumberField.js +1 -1
- package/dist/inputs/RadioGroupField.js +4 -4
- package/dist/inputs/RichTextField.js +4 -4
- package/dist/inputs/Switch.js +1 -1
- package/dist/inputs/TextFieldBase.js +7 -7
- package/dist/inputs/ToggleButton.js +2 -2
- package/dist/inputs/internal/ListBox.js +1 -1
- package/dist/inputs/internal/ListBoxChip.js +1 -1
- package/dist/inputs/internal/ListBoxSection.js +1 -1
- package/dist/inputs/internal/Option.js +1 -1
- package/package.json +2 -2
|
@@ -85,7 +85,7 @@ const variantStyles = (contrast) => ({
|
|
|
85
85
|
focusStyles: Css_1.Css.bshFocus.if(contrast).boxShadow(`0 0 0 2px ${Css_1.Palette.White}`).$,
|
|
86
86
|
},
|
|
87
87
|
secondary: {
|
|
88
|
-
baseStyles: Css_1.Css.bgWhite.
|
|
88
|
+
baseStyles: Css_1.Css.bgWhite.bcGray300.bw1.ba.gray800.$,
|
|
89
89
|
hoverStyles: Css_1.Css.bgGray100.if(contrast).bgGray300.$,
|
|
90
90
|
pressedStyles: Css_1.Css.bgGray200.if(contrast).bgGray100.$,
|
|
91
91
|
disabledStyles: Css_1.Css.bgWhite.gray400.$,
|
|
@@ -32,7 +32,7 @@ function GroupButton(props) {
|
|
|
32
32
|
placement: "top",
|
|
33
33
|
children: ((0, jsx_runtime_1.jsxs)("button", { ref: ref, ...buttonProps, ...focusProps, ...hoverProps, css: {
|
|
34
34
|
...Css_1.Css.buttonBase.px2.br0.h100.$,
|
|
35
|
-
"&:disabled": Css_1.Css.gray400.cursorNotAllowed.
|
|
35
|
+
"&:disabled": Css_1.Css.gray400.cursorNotAllowed.bcGray300.$,
|
|
36
36
|
...(isFocusVisible ? defaultFocusRingStyles : {}),
|
|
37
37
|
...(active ? activeStyles : {}),
|
|
38
38
|
...(isPressed ? pressedStyles : isHovered ? hoverStyles : {}),
|
|
@@ -46,7 +46,7 @@ const hoverStyles = Css_1.Css.bgGray100.$;
|
|
|
46
46
|
const defaultFocusRingStyles = Css_1.Css.relative.z2.bshFocus.$;
|
|
47
47
|
function getButtonStyles() {
|
|
48
48
|
return {
|
|
49
|
-
...Css_1.Css.z1.bgWhite.
|
|
49
|
+
...Css_1.Css.z1.bgWhite.bcGray300.bw1.ba.gray900.br0.oh.$,
|
|
50
50
|
// Our first button should have a rounded left border
|
|
51
51
|
"&:first-of-type": Css_1.Css.add("borderRadius", "4px 0 0 4px").$,
|
|
52
52
|
// Our last button should have a rounded right border
|
package/dist/components/Chip.js
CHANGED
|
@@ -30,7 +30,7 @@ function Chip({ type = exports.ChipTypes.neutral, ...props }) {
|
|
|
30
30
|
...Css_1.Css[compact ? "xs" : "sm"].dif.aic.gapPx(4).br16.pl1.px1.pyPx(2).gray900.$,
|
|
31
31
|
...typeStyles[type],
|
|
32
32
|
...xss,
|
|
33
|
-
}, ...tid, children: [icon && (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: icon, inc: 2, xss: Css_1.Css.fs0.$ }), (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.lineClamp1.
|
|
33
|
+
}, ...tid, children: [icon && (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: icon, inc: 2, xss: Css_1.Css.fs0.$ }), (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.lineClamp1.wbba.$, children: text })] })),
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
exports.Chip = Chip;
|
|
@@ -14,8 +14,8 @@ function DnDGridItemHandle(props) {
|
|
|
14
14
|
const iconButtonCompact = src_1.Css.hPx(18).wPx(18).br4.bw1.$;
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)("button", { css: {
|
|
16
16
|
...(compact ? iconButtonCompact : iconButtonNormal),
|
|
17
|
-
...src_1.Css.cursor("grab").
|
|
18
|
-
.
|
|
17
|
+
...src_1.Css.cursor("grab").bcTransparent.bss.bgTransparent.outline0.dif.aic.jcc.transition.if(isFocusVisible)
|
|
18
|
+
.bcBlue700.$,
|
|
19
19
|
...(isHovered && src_1.Css.bgGray200.$),
|
|
20
20
|
}, ...(0, react_aria_1.mergeProps)(dragHandleProps, focusProps, hoverProps), ...tid, children: (0, jsx_runtime_1.jsx)(src_1.Icon, { icon: icon, inc: compact ? 2 : undefined, color: color }) }));
|
|
21
21
|
}
|
|
@@ -24,6 +24,6 @@ function FilterModal(props) {
|
|
|
24
24
|
exports.FilterModal = FilterModal;
|
|
25
25
|
// Wraps a filter component to be displayed in the Filter Modal
|
|
26
26
|
function ModalFilterItem({ label, children }) {
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.mb4.if(!label).bt.
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.mb4.if(!label).bt.bcGray200.$, children: [label && (0, jsx_runtime_1.jsx)("h2", { css: Css_1.Css.baseMd.mb2.$, children: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.if(!label).pt3.$, children: children })] }));
|
|
28
28
|
}
|
|
29
29
|
exports.ModalFilterItem = ModalFilterItem;
|
|
@@ -55,10 +55,10 @@ function IconButton(props) {
|
|
|
55
55
|
exports.IconButton = IconButton;
|
|
56
56
|
const defaultIconColor = Css_1.Palette.Gray900;
|
|
57
57
|
const contrastIconColor = Css_1.Palette.White;
|
|
58
|
-
const iconButtonStylesReset = Css_1.Css.
|
|
58
|
+
const iconButtonStylesReset = Css_1.Css.bcTransparent.bss.bgTransparent.cursorPointer.outline0.dif.aic.jcc.transition.$;
|
|
59
59
|
const iconButtonNormal = Css_1.Css.hPx(28).wPx(28).br8.bw2.$;
|
|
60
60
|
const iconButtonCompact = Css_1.Css.hPx(18).wPx(18).br4.bw1.$;
|
|
61
61
|
exports.iconButtonStylesHover = Css_1.Css.bgGray200.$;
|
|
62
62
|
exports.iconButtonContrastStylesHover = Css_1.Css.bgGray700.$;
|
|
63
|
-
const iconButtonStylesFocus = Css_1.Css.
|
|
63
|
+
const iconButtonStylesFocus = Css_1.Css.bcBlue700.$;
|
|
64
64
|
const iconButtonStylesDisabled = Css_1.Css.cursorNotAllowed.$;
|
package/dist/components/Label.js
CHANGED
|
@@ -24,6 +24,6 @@ function LabelComponent(props) {
|
|
|
24
24
|
exports.Label = react_1.default.memo(LabelComponent);
|
|
25
25
|
/** Used for showing labels within text fields. */
|
|
26
26
|
function InlineLabel({ labelProps, label, contrast, multiline = false, ...others }) {
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)("label", { ...labelProps, ...others, css: Css_1.Css.smMd.
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("label", { ...labelProps, ...others, css: Css_1.Css.smMd.wsnw.gray900.prPx(4).add("color", "currentColor").asc.if(multiline).asfs.pt1.$, children: [label, ":"] }));
|
|
28
28
|
}
|
|
29
29
|
exports.InlineLabel = InlineLabel;
|
|
@@ -9,6 +9,6 @@ function PreventBrowserScroll({ children }) {
|
|
|
9
9
|
// Take over the full viewport and hide any overflown content.
|
|
10
10
|
// Using `-webkit-fill-available`, otherwise `height: 100vh` includes the app bars in mobile Safari. See https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/
|
|
11
11
|
// Setting the multiple "(min|max-)height" properties is necessary, as Truss will turn this into an object and there can only be one `height` property.
|
|
12
|
-
(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.
|
|
12
|
+
(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.oh.vh100.mh("-webkit-fill-available").maxh("-webkit-fill-available").$, children: (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.h100.df.fdc.mh0.oa.$, children: children }) }));
|
|
13
13
|
}
|
|
14
14
|
exports.PreventBrowserScroll = PreventBrowserScroll;
|
|
@@ -11,8 +11,8 @@ function RightPaneLayout(props) {
|
|
|
11
11
|
const { isRightPaneOpen, rightPaneContent, clearPane, closePane } = (0, RightPaneContext_1.useRightPaneContext)();
|
|
12
12
|
// Close pane on page unmount because otherwise the next page that has a right pane will show our stale content
|
|
13
13
|
(0, react_1.useEffect)(() => closePane, [closePane]);
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.h100.df.
|
|
15
|
-
...Css_1.Css.w(`calc(100% - ${paneWidth + 24}px)`).add("transition", "width .2s linear").h100.mr3.
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.h100.df.oxh.$, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { css: {
|
|
15
|
+
...Css_1.Css.w(`calc(100% - ${paneWidth + 24}px)`).add("transition", "width .2s linear").h100.mr3.oxa.$,
|
|
16
16
|
...Css_1.Css.if(!isRightPaneOpen).w100.mr0.$,
|
|
17
17
|
...Css_1.Css.if(!!defaultPaneContent).w(`calc(100% - ${paneWidth + 24}px)`).mr3.$,
|
|
18
18
|
}, children: children }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.relative.if(!!defaultPaneContent).wPx(paneWidth).$, children: [defaultPaneContent && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.h100
|
|
@@ -11,7 +11,7 @@ interface ScrollableContentProps {
|
|
|
11
11
|
*
|
|
12
12
|
* See the docs on `ScrollableParent.
|
|
13
13
|
*
|
|
14
|
-
* Note that you should not use this "just to get a scrollbar", instead just use `Css.
|
|
14
|
+
* Note that you should not use this "just to get a scrollbar", instead just use `Css.oa.$`
|
|
15
15
|
* or what not; this is only for implementing page-level patterns that need multiple stickied
|
|
16
16
|
* components (page header, tab bar, table filter & actions).
|
|
17
17
|
*/
|
|
@@ -11,7 +11,7 @@ const Css_1 = require("../../Css");
|
|
|
11
11
|
*
|
|
12
12
|
* See the docs on `ScrollableParent.
|
|
13
13
|
*
|
|
14
|
-
* Note that you should not use this "just to get a scrollbar", instead just use `Css.
|
|
14
|
+
* Note that you should not use this "just to get a scrollbar", instead just use `Css.oa.$`
|
|
15
15
|
* or what not; this is only for implementing page-level patterns that need multiple stickied
|
|
16
16
|
* components (page header, tab bar, table filter & actions).
|
|
17
17
|
*/
|
|
@@ -57,8 +57,8 @@ function ScrollableParent(props) {
|
|
|
57
57
|
}, [scrollableEl]);
|
|
58
58
|
return ((0, jsx_runtime_1.jsx)(ScrollableParentContext.Provider, { value: context, children: (0, jsx_runtime_1.jsxs)(Tag, { css: { ...Css_1.Css.mh0.mw0.fg1.df.fdc.$, ...otherXss }, children: [(0, jsx_runtime_1.jsx)("div", { css: {
|
|
59
59
|
...Css_1.Css.pl(context.pl).pr(context.pr).$,
|
|
60
|
-
...(!hasScrollableContent ? { ...Css_1.Css.
|
|
61
|
-
}, children: children }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fg1.
|
|
60
|
+
...(!hasScrollableContent ? { ...Css_1.Css.oa.h100.$, ...exports.scrollContainerBottomPadding } : undefined),
|
|
61
|
+
}, children: children }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fg1.oa.$, ref: scrollableRef })] }) }));
|
|
62
62
|
}
|
|
63
63
|
exports.ScrollableParent = ScrollableParent;
|
|
64
64
|
function useScrollableParent() {
|
|
@@ -70,7 +70,7 @@ function Modal(props) {
|
|
|
70
70
|
// TODO: validate this eslint-disable. It was automatically ignored as part of https://app.shortcut.com/homebound-team/story/40033/enable-react-hooks-exhaustive-deps-for-react-projects
|
|
71
71
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
72
|
[modalBodyRef, modalFooterRef, modalHeaderRef]);
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(ModalContext_1.ModalProvider, { children: (0, jsx_runtime_1.jsx)(react_aria_1.OverlayContainer, { children: (0, jsx_runtime_1.jsx)(components_1.AutoSaveStatusProvider, { children: (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.underlay.z4.$, ...underlayProps, ...testId.underlay, children: (0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.br24.bgWhite.bshModal.
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(ModalContext_1.ModalProvider, { children: (0, jsx_runtime_1.jsx)(react_aria_1.OverlayContainer, { children: (0, jsx_runtime_1.jsx)(components_1.AutoSaveStatusProvider, { children: (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.underlay.z4.$, ...underlayProps, ...testId.underlay, children: (0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.br24.bgWhite.bshModal.oh
|
|
74
74
|
.maxh("90vh")
|
|
75
75
|
.df.fdc.wPx(width)
|
|
76
76
|
.mhPx(defaultMinHeight)
|
|
@@ -79,7 +79,7 @@ function Modal(props) {
|
|
|
79
79
|
.if(sm)
|
|
80
80
|
.add("height", "100dvh")
|
|
81
81
|
.add("width", "100dvw")
|
|
82
|
-
.maxh("none").br0.$, ref: ref, ...overlayProps, ...dialogProps, ...modalProps, ...testId, children: [(0, jsx_runtime_1.jsxs)("header", { css: Css_1.Css.df.p3.fs0.if(drawHeaderBorder).bb.
|
|
82
|
+
.maxh("none").br0.$, ref: ref, ...overlayProps, ...dialogProps, ...modalProps, ...testId, children: [(0, jsx_runtime_1.jsxs)("header", { css: Css_1.Css.df.fdrr.p3.fs0.if(drawHeaderBorder).bb.bcGray200.$, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.pl1.$, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { icon: "x", onClick: closeModal, ...testId.titleClose }) }), (0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.fg1.xl2Sb.gray900.$, ref: modalHeaderRef, ...titleProps, ...testId.title })] }), (0, jsx_runtime_1.jsx)("main", { ref: modalBodyRef, css: Css_1.Css.fg1.oya.if(hasScroll).bb.bcGray200.if(!!forceScrolling).oys.$, children: content }), (0, jsx_runtime_1.jsx)("footer", { css: Css_1.Css.fs0.$, children: (0, jsx_runtime_1.jsx)("div", { ref: modalFooterRef }) })] }) }) }) }) }) }));
|
|
83
83
|
}
|
|
84
84
|
exports.Modal = Modal;
|
|
85
85
|
function ModalHeader({ children }) {
|
|
@@ -93,7 +93,7 @@ function ModalBody({ children, virtualized = false, }) {
|
|
|
93
93
|
const testId = (0, utils_2.useTestIds)({}, testIdPrefix);
|
|
94
94
|
return (0, react_dom_1.createPortal)(
|
|
95
95
|
// If `virtualized`, then we are expecting the `children` will handle their own scrollbar, so have the overflow hidden and adjust padding
|
|
96
|
-
(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.h100.if(virtualized).
|
|
96
|
+
(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.h100.if(virtualized).oh.pl3.else.px3.$, ...testId.content, children: children }), modalBodyDiv);
|
|
97
97
|
}
|
|
98
98
|
exports.ModalBody = ModalBody;
|
|
99
99
|
/** Provides consistent styling for modal footers, i.e. where actions are placed. */
|
|
@@ -30,7 +30,7 @@ function Pagination(props) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
const tid = (0, utils_1.useTestIds)(props, "pagination");
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.bcGray200.bt.xs.gray500.px2.pt2.$, ...tid, children: [(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.mya.mr2.$, ...tid.pageSizeLabel, children: "Page size:" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.wPx(78).$, children: (0, jsx_runtime_1.jsx)(inputs_1.SelectField, { compact: true, label: "Page Size", labelStyle: "hidden", options: pageOptions, value: pageSize, onSelect: (val) => set({ pageNumber: 1, pageSize: val }), ...tid.pageSize }) }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.mla.mya.df.$, children: [(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.mya.mr2.$, ...tid.pageInfoLabel, children: [first, " ", showLast ? `- ${last}` : "", " of ", totalCount] }), (0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "chevronLeft", color: hasPrevPage ? Css_1.Palette.Blue700 : Css_1.Palette.Gray200, onClick: () => set({ pageNumber: pageNumber - 1, pageSize }), disabled: !hasPrevPage, ...tid.previousIcon }), (0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "chevronRight", color: hasNextPage ? Css_1.Palette.Blue700 : Css_1.Palette.Gray200, onClick: () => set({ pageNumber: pageNumber + 1, pageSize }), disabled: !hasNextPage, ...tid.nextIcon })] })] }));
|
|
34
34
|
}
|
|
35
35
|
exports.Pagination = Pagination;
|
|
36
36
|
function toLimitAndOffset(page) {
|
|
@@ -47,12 +47,12 @@ function ScrollShadows(props) {
|
|
|
47
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
48
|
const onResize = (0, react_1.useCallback)(() => scrollRef.current && updateScrollProps(scrollRef.current), []);
|
|
49
49
|
(0, utils_1.useResizeObserver)({ ref: scrollRef, onResize });
|
|
50
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: src_1.Css.relative.
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: src_1.Css.relative.oh
|
|
51
51
|
.h(height)
|
|
52
52
|
.w(width)
|
|
53
53
|
.df.fd(!horizontal ? "column" : "row").$, ...tid, children: [showStartShadow && (0, jsx_runtime_1.jsx)("div", { css: startShadowStyles }), showEndShadow && (0, jsx_runtime_1.jsx)("div", { css: endShadowStyles }), (0, jsx_runtime_1.jsx)("div", { css: {
|
|
54
54
|
...xss,
|
|
55
|
-
...src_1.Css.
|
|
55
|
+
...src_1.Css.oa.fg1.addIn("&::-webkit-scrollbar", { display: "none" }).add("scrollbarWidth", "none").$,
|
|
56
56
|
}, onScroll: (e) => updateScrollProps(e.currentTarget), ref: scrollRef, children: children })] }));
|
|
57
57
|
}
|
|
58
58
|
exports.ScrollShadows = ScrollShadows;
|
|
@@ -40,7 +40,7 @@ function StepButton(props) {
|
|
|
40
40
|
const tid = (0, utils_1.useTestIds)(props, "stepButton");
|
|
41
41
|
return ((0, jsx_runtime_1.jsxs)("button", { ref: ref, ...buttonProps, ...focusProps, ...hoverProps, css: {
|
|
42
42
|
...Css_1.Css.buttonBase.$,
|
|
43
|
-
...Css_1.Css.
|
|
43
|
+
...Css_1.Css.tal.w100.h100.sm.gray700.add("whiteSpace", "initial").if(state === "error").red600.$,
|
|
44
44
|
...(isCurrent ? Css_1.Css.blue700.if(state === "error").red800.$ : {}),
|
|
45
45
|
...(isHovered && !isPressed ? Css_1.Css.blue800.if(state === "error").red500.$ : {}),
|
|
46
46
|
...(isPressed ? Css_1.Css.blue500.if(state === "error").red900.$ : {}),
|
|
@@ -55,7 +55,7 @@ function SuperDrawer() {
|
|
|
55
55
|
// TODO: validate this eslint-disable. It was automatically ignored as part of https://app.shortcut.com/homebound-team/story/40033/enable-react-hooks-exhaustive-deps-for-react-projects
|
|
56
56
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
57
|
[headerRef, content]);
|
|
58
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: content && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Global, { styles: { body: Css_1.Css.
|
|
58
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: content && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Global, { styles: { body: Css_1.Css.oh.$ } }), (0, react_1.createElement)(framer_motion_1.motion.div, { ...testId,
|
|
59
59
|
// Key is required for framer-motion animations
|
|
60
60
|
key: "superDrawer",
|
|
61
61
|
// TODO: Should this color be part of the Palette?
|
|
@@ -74,6 +74,6 @@ function SuperDrawer() {
|
|
|
74
74
|
// Custom transitions settings for the translateX animation
|
|
75
75
|
transition: { ease: "linear", duration: 0.2, delay: 0.2 }, exit: { transition: { ease: "linear", duration: 0.2 }, x: width },
|
|
76
76
|
// Preventing clicks from triggering parent onClick
|
|
77
|
-
onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsxs)(components_1.AutoSaveStatusProvider, { children: [(0, jsx_runtime_1.jsxs)("header", { css: Css_1.Css.p3.bb.
|
|
77
|
+
onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsxs)(components_1.AutoSaveStatusProvider, { children: [(0, jsx_runtime_1.jsxs)("header", { css: Css_1.Css.p3.bb.bcGray200.df.aic.jcsb.gap3.$, children: [(0, jsx_runtime_1.jsx)("div", { ref: headerRef, css: Css_1.Css.gray900.fg1.addIn("h1", Css_1.Css.xl2Sb.$).$ }), (0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "x", onClick: closeDrawer, ...testId.close })] }), content] }) }, "superDrawerContainer"))] })) }), document.body);
|
|
78
78
|
}
|
|
79
79
|
exports.SuperDrawer = SuperDrawer;
|
|
@@ -25,7 +25,7 @@ const SuperDrawerContent = ({ children, actions }) => {
|
|
|
25
25
|
const { width = utils_1.SuperDrawerWidth.Normal } = firstContent !== null && firstContent !== void 0 ? firstContent : {};
|
|
26
26
|
function wrapWithMotionAndMaybeBack(children) {
|
|
27
27
|
if (kind === "open") {
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { css: Css_1.Css.p3.fg1.
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { css: Css_1.Css.p3.fg1.oa.$, children: children }, "content"));
|
|
29
29
|
}
|
|
30
30
|
else if (kind === "detail") {
|
|
31
31
|
return ((0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { css: Css_1.Css.px3.pt2.pb3.fg1.$, animate: { overflow: "auto" }, transition: { overflow: { delay: 0.3 } }, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { label: "Back", icon: "chevronLeft", variant: "tertiary", onClick: closeDrawerDetail }), (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { x: width, opacity: 0 }, animate: { x: 0, opacity: 1 }, transition: { ease: "linear", duration: 0.3, opacity: { delay: 0.15 } }, exit: { x: width, opacity: 0 }, css: Css_1.Css.pt2.$, children: children })] }, "content"));
|
|
@@ -37,6 +37,6 @@ const SuperDrawerContent = ({ children, actions }) => {
|
|
|
37
37
|
return (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { css: Css_1.Css.p3.fg1.$, style: { overflow: "auto" } }, "content");
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [wrapWithMotionAndMaybeBack(children), actions && ((0, jsx_runtime_1.jsx)("footer", { css: Css_1.Css.bt.
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [wrapWithMotionAndMaybeBack(children), actions && ((0, jsx_runtime_1.jsx)("footer", { css: Css_1.Css.bt.bcGray200.p3.df.aic.jcfe.$, children: (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.gap1.$, children: actions.map((buttonProps, i) => ((0, jsx_runtime_1.jsx)(Button_1.Button, { ...buttonProps }, i))) }) }))] }));
|
|
41
41
|
};
|
|
42
42
|
exports.SuperDrawerContent = SuperDrawerContent;
|
|
@@ -16,7 +16,7 @@ function SuperDrawerHeader(props) {
|
|
|
16
16
|
const currentContent = (_b = contentStack.current[contentStack.current.length - 1]) === null || _b === void 0 ? void 0 : _b.opts;
|
|
17
17
|
const isDetail = currentContent !== firstContent;
|
|
18
18
|
const tid = (0, utils_1.useTestIds)({}, "superDrawerHeader");
|
|
19
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.aic.jcsb.gap3.$, ...tid, children: [isStructuredProps(props) ? ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.aic.gap2.fg1.$, children: [(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.fg1.df.aic.gap2.$, children: [(0, jsx_runtime_1.jsx)("h1", { children: props.title }), props.left] }), props.right && (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.$, children: props.right })] })) : ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fg1.$, children: props.children })), !hideControls && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.if(isDetail).
|
|
19
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.aic.jcsb.gap3.$, ...tid, children: [isStructuredProps(props) ? ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.aic.gap2.fg1.$, children: [(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.fg1.df.aic.gap2.$, children: [(0, jsx_runtime_1.jsx)("h1", { children: props.title }), props.left] }), props.right && (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.$, children: props.right })] })) : ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fg1.$, children: props.children })), !hideControls && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.if(isDetail).vh.$, children: (0, jsx_runtime_1.jsx)(ButtonGroup_1.ButtonGroup, { buttons: [
|
|
20
20
|
{ icon: "chevronLeft", onClick: () => onPrevClick && onPrevClick(), disabled: !onPrevClick },
|
|
21
21
|
{ icon: "chevronRight", onClick: () => onNextClick && onNextClick(), disabled: !onNextClick },
|
|
22
22
|
], ...tid.actions }) }))] }), sdHeaderDiv);
|
|
@@ -30,9 +30,9 @@ function memoizedTableStyles() {
|
|
|
30
30
|
cache[key] = {
|
|
31
31
|
emptyCell: "-",
|
|
32
32
|
firstRowMessageCss: {
|
|
33
|
-
...Css_1.Css.
|
|
33
|
+
...Css_1.Css.tac.py3.$,
|
|
34
34
|
...(allWhite && Css_1.Css.bgWhite.$),
|
|
35
|
-
...(bordered && Css_1.Css.bl.br.
|
|
35
|
+
...(bordered && Css_1.Css.bl.br.bcGray200.$),
|
|
36
36
|
},
|
|
37
37
|
headerCellCss: {
|
|
38
38
|
// We want to support headers having two lines of wrapped text, and could add a `lineClamp2` here, but
|
|
@@ -43,7 +43,7 @@ function memoizedTableStyles() {
|
|
|
43
43
|
...(allWhite && Css_1.Css.bgWhite.$),
|
|
44
44
|
},
|
|
45
45
|
totalsCellCss: Css_1.Css.bgWhite.gray700.bgGray100.xsMd.hPx(exports.totalsRowHeight).pPx(12).$,
|
|
46
|
-
expandableHeaderCss: Css_1.Css.bgWhite.gray900.xsMd.
|
|
46
|
+
expandableHeaderCss: Css_1.Css.bgWhite.gray900.xsMd.wsn
|
|
47
47
|
.hPx(exports.expandableHeaderRowHeight)
|
|
48
48
|
.pxPx(12)
|
|
49
49
|
.py0.boxShadow(`inset 0 -1px 0 ${Css_1.Palette.Gray200}`)
|
|
@@ -51,13 +51,13 @@ function memoizedTableStyles() {
|
|
|
51
51
|
cellCss: {
|
|
52
52
|
...Css_1.Css[cellTypography].gray900.bgWhite.ai(alignItems).pxPx(12).boxShadow(`inset 0 -1px 0 ${Css_1.Palette.Gray200}`)
|
|
53
53
|
.$,
|
|
54
|
-
...(rowHeight === "flexible" ? Css_1.Css.pyPx(12).$ : Css_1.Css.
|
|
54
|
+
...(rowHeight === "flexible" ? Css_1.Css.pyPx(12).$ : Css_1.Css.wsnw.hPx(inlineEditing ? 48 : 36).$),
|
|
55
55
|
...(cellHighlight ? { "&:hover": Css_1.Css.bgGray100.$ } : {}),
|
|
56
|
-
...(bordered && { "&:first-child": Css_1.Css.bl.
|
|
56
|
+
...(bordered && { "&:first-child": Css_1.Css.bl.bcGray200.$, "&:last-child": Css_1.Css.br.bcGray200.$ }),
|
|
57
57
|
},
|
|
58
58
|
firstRowCss: {
|
|
59
59
|
...Css_1.Css.addIn("& > *:first-of-type", Css_1.Css.borderRadius("8px 0 0 0 ").$).addIn("& > *:last-of-type", Css_1.Css.borderRadius("0 8px 0 0").$).$,
|
|
60
|
-
...(bordered && Css_1.Css.addIn("& > *", Css_1.Css.bt.
|
|
60
|
+
...(bordered && Css_1.Css.addIn("& > *", Css_1.Css.bt.bcGray200.$).$),
|
|
61
61
|
},
|
|
62
62
|
// Only apply border radius styles to the last row when using the `bordered` style table.
|
|
63
63
|
lastRowCss: bordered
|
|
@@ -92,8 +92,8 @@ exports.condensedStyle = {
|
|
|
92
92
|
exports.cardStyle = {
|
|
93
93
|
...exports.defaultStyle,
|
|
94
94
|
betweenRowsCss: {},
|
|
95
|
-
nonHeaderRowCss: Css_1.Css.br4.
|
|
96
|
-
firstRowCss: Css_1.Css.bl.br.
|
|
95
|
+
nonHeaderRowCss: Css_1.Css.br4.oh.ba.bcGray400.mt2.add("transition", "all 240ms").$,
|
|
96
|
+
firstRowCss: Css_1.Css.bl.br.bcGray200.borderRadius("8px 8px 0 0").oh.$,
|
|
97
97
|
cellCss: Css_1.Css.p2.$,
|
|
98
98
|
// Undo the card look & feel for the header
|
|
99
99
|
headerCellCss: {
|
|
@@ -101,7 +101,7 @@ exports.cardStyle = {
|
|
|
101
101
|
...Css_1.Css.p1.m0.xsMd.gray700.$,
|
|
102
102
|
},
|
|
103
103
|
rowHoverColor: "none",
|
|
104
|
-
nonHeaderRowHoverCss: Css_1.Css.bshHover.
|
|
104
|
+
nonHeaderRowHoverCss: Css_1.Css.bshHover.bcGray700.$,
|
|
105
105
|
levels: {
|
|
106
106
|
1: { rowIndent: 24 },
|
|
107
107
|
2: { rowIndent: 48 },
|
|
@@ -31,6 +31,6 @@ function ExpandableHeader(props) {
|
|
|
31
31
|
.if(applyStickyStyles)
|
|
32
32
|
.sticky.leftPx(minStickyLeftOffset + 12)
|
|
33
33
|
.pr2.mr2.bgWhite.z(utils_1.zIndices.expandableHeaderTitle)
|
|
34
|
-
.if(isHovered).bgGray100.$, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.
|
|
34
|
+
.if(isHovered).bgGray100.$, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.tal.lineClamp2.$, children: title }), tooltipEl] }), (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.if(applyStickyStyles).sticky.rightPx(12).z(utils_1.zIndices.expandableHeaderIcon).$, children: isLoading ? (0, jsx_runtime_1.jsx)(Loader_1.Loader, { size: "xs" }) : (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: isExpanded ? "chevronLeft" : "chevronRight", inc: 2 }) })] }));
|
|
35
35
|
}
|
|
36
36
|
exports.ExpandableHeader = ExpandableHeader;
|
|
@@ -51,14 +51,14 @@ function RowImpl(props) {
|
|
|
51
51
|
":hover": { ...style.nonHeaderRowHoverCss },
|
|
52
52
|
}),
|
|
53
53
|
...(levelIndent && Css_1.Css.mlPx(levelIndent).$),
|
|
54
|
-
// For virtual tables use `display: flex` to keep all cells on the same row. For each cell in the row use `
|
|
55
|
-
...(as === "table" ? {} : Css_1.Css.relative.df.fg1.fs1.addIn("&>*", Css_1.Css.
|
|
54
|
+
// For virtual tables use `display: flex` to keep all cells on the same row. For each cell in the row use `fn` to ensure they stay their defined widths
|
|
55
|
+
...(as === "table" ? {} : Css_1.Css.relative.df.fg1.fs1.addIn("&>*", Css_1.Css.fn.$).$),
|
|
56
56
|
// Apply `cursorPointer` to the row if it has a link or `onClick` value.
|
|
57
57
|
...(((rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowLink) || (rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.onClick)) && { "&:hover": Css_1.Css.cursorPointer.$ }),
|
|
58
58
|
...(0, utils_1.maybeApplyFunction)(row, rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowCss),
|
|
59
59
|
...{
|
|
60
|
-
[` > .${revealOnRowHoverClass} > *`]: Css_1.Css.
|
|
61
|
-
[`:hover > .${revealOnRowHoverClass} > *`]: Css_1.Css.
|
|
60
|
+
[` > .${revealOnRowHoverClass} > *`]: Css_1.Css.vh.$,
|
|
61
|
+
[`:hover > .${revealOnRowHoverClass} > *`]: Css_1.Css.vh.$,
|
|
62
62
|
},
|
|
63
63
|
...(isLastKeptRow && Css_1.Css.addIn("&>*", style.keptLastRowCss).$),
|
|
64
64
|
};
|
|
@@ -33,6 +33,6 @@ function SortHeader(props) {
|
|
|
33
33
|
.if(isHovered || sorted !== undefined)
|
|
34
34
|
.visibility("visible").$,
|
|
35
35
|
}, inc: 2, ...tid.icon }) }));
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...tid, css: { ...Css_1.Css.df.aic.h100.cursorPointer.
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...tid, css: { ...Css_1.Css.df.aic.h100.cursorPointer.usn.$, ...xss }, ...hoverProps, onClick: toggleSort, children: [iconOnLeft && icon, (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.lineClamp2.$, children: content }), tooltipEl, !iconOnLeft && icon] }));
|
|
37
37
|
}
|
|
38
38
|
exports.SortHeader = SortHeader;
|
|
@@ -24,9 +24,9 @@ exports.headerRenderFn = headerRenderFn;
|
|
|
24
24
|
const rowLinkRenderFn = (as, colSpan) => (key, css, content, row, rowStyle, classNames, onClick, tooltip) => {
|
|
25
25
|
const to = rowStyle.rowLink(row);
|
|
26
26
|
if (as === "table") {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)("td", { css: { ...css }, className: classNames, colSpan: colSpan, children: (0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: to, css: Css_1.Css.
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)("td", { css: { ...css }, className: classNames, colSpan: colSpan, children: (0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: to, css: Css_1.Css.tdn.color("unset").db.$, className: CssReset_1.navLink, children: content }) }, key));
|
|
28
28
|
}
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: to, css: { ...Css_1.Css.
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: to, css: { ...Css_1.Css.tdn.color("unset").$, ...css }, className: `${CssReset_1.navLink} ${classNames}`, children: content }, key));
|
|
30
30
|
};
|
|
31
31
|
exports.rowLinkRenderFn = rowLinkRenderFn;
|
|
32
32
|
/** Renders a cell that will fire the RowStyle.onClick. */
|
package/dist/components/Tabs.js
CHANGED
|
@@ -80,7 +80,7 @@ function Tabs(props) {
|
|
|
80
80
|
setActive(selected);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: { ...Css_1.Css.df.aic.
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: { ...Css_1.Css.df.aic.oa.wsnw.gap1.$, ...(includeBottomBorder ? { ...Css_1.Css.bb.bcGray200.$ } : {}) }, 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) => {
|
|
84
84
|
const uniqueValue = uniqueTabValue(tab);
|
|
85
85
|
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));
|
|
86
86
|
}) })), right && (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mla.df.aic.gap1.pb1.$, children: right })] }));
|
|
@@ -132,11 +132,11 @@ function getTabStyles() {
|
|
|
132
132
|
return {
|
|
133
133
|
baseStyles: Css_1.Css.df.aic.hPx(32).pyPx(verticalPaddingPx).px1.outline0.gray700.add("width", "fit-content")
|
|
134
134
|
.cursorPointer.sm.$,
|
|
135
|
-
activeStyles: Css_1.Css.add(borderBottomStyles).
|
|
135
|
+
activeStyles: Css_1.Css.add(borderBottomStyles).bcBlue700.smMd.gray900.$,
|
|
136
136
|
disabledStyles: Css_1.Css.gray400.cursorNotAllowed.$,
|
|
137
137
|
focusRingStyles: Css_1.Css.bgBlue50.bshFocus.$,
|
|
138
|
-
hoverStyles: Css_1.Css.add(borderBottomStyles).
|
|
139
|
-
activeHoverStyles: Css_1.Css.bgBlue50.add(borderBottomStyles).
|
|
138
|
+
hoverStyles: Css_1.Css.add(borderBottomStyles).bcGray400.$,
|
|
139
|
+
activeHoverStyles: Css_1.Css.bgBlue50.add(borderBottomStyles).bcBlue700.$,
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
exports.getTabStyles = getTabStyles;
|
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", { ...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.
|
|
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.wbba.$, children: text })] }));
|
|
13
13
|
}
|
|
14
14
|
exports.Tag = Tag;
|
|
15
15
|
function getStyles(type) {
|
|
@@ -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, ...tid, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.prPx(6).
|
|
25
|
+
}, disabled: disabled, onClick: onClick, ...tid, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.prPx(6).tal.lineClamp1.wbba.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,7 +9,7 @@ function CompoundField({ children }) {
|
|
|
9
9
|
if ((children === null || children === void 0 ? void 0 : children.length) !== 2) {
|
|
10
10
|
throw global.Error("CompoundField requires two children components");
|
|
11
11
|
}
|
|
12
|
-
const commonStyles = Css_1.Css.df.aic.fs1.maxwPx(550).bt.bb.
|
|
12
|
+
const commonStyles = Css_1.Css.df.aic.fs1.maxwPx(550).bt.bb.bcGray300.$;
|
|
13
13
|
const internalProps = { compound: true };
|
|
14
14
|
return ((0, jsx_runtime_1.jsxs)("div", { css: {
|
|
15
15
|
...Css_1.Css.df.$,
|
|
@@ -17,13 +17,13 @@ function CompoundField({ children }) {
|
|
|
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
|
-
"&:focus-within": Css_1.Css.
|
|
20
|
+
"&:focus-within": Css_1.Css.bcBlue700.$,
|
|
21
21
|
}, children: (0, react_1.cloneElement)(children[0], {
|
|
22
22
|
internalProps,
|
|
23
|
-
}) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.wPx(1).
|
|
23
|
+
}) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.wPx(1).fn.bgGray300.$ }), (0, jsx_runtime_1.jsx)("div", { css: {
|
|
24
24
|
...commonStyles,
|
|
25
25
|
...Css_1.Css.fg1.br.borderRadius("0 4px 4px 0").$,
|
|
26
|
-
"&:focus-within": Css_1.Css.
|
|
26
|
+
"&:focus-within": Css_1.Css.bcBlue700.$,
|
|
27
27
|
}, children: (0, react_1.cloneElement)(children[1], {
|
|
28
28
|
internalProps,
|
|
29
29
|
}) })] }));
|
|
@@ -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, { restoreFocus: true, autoFocus: true, children: (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.p3.df.fdc.gap3.bgWhite.bshModal.br4.maxh("inherit").
|
|
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").oa.$, ...tid, children: [title && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.lg.tac.$, ...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;
|
|
@@ -32,14 +32,14 @@ function Day(props) {
|
|
|
32
32
|
"&:hover:not(:active) > div": Css_1.Css.bgGray100.$,
|
|
33
33
|
}),
|
|
34
34
|
...(!disabled && { "&:active > div": Css_1.Css.bgGray400.gray900.$ }),
|
|
35
|
-
"&:focus:not(:active) > div": Css_1.Css.ba.
|
|
35
|
+
"&:focus:not(:active) > div": Css_1.Css.ba.bcBlue700.if(selected).bcBlue900.$,
|
|
36
36
|
...(showRangeStyles &&
|
|
37
37
|
range_start &&
|
|
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
|
-
...Css_1.Css.
|
|
42
|
+
...Css_1.Css.oh.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.bgBlue700.$),
|
|
45
45
|
...(disabled && Css_1.Css.gray500.$),
|
|
@@ -65,7 +65,7 @@ function Menu(props) {
|
|
|
65
65
|
return ((0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, { children: (0, jsx_runtime_1.jsxs)("div", {
|
|
66
66
|
// 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
|
|
67
67
|
css: {
|
|
68
|
-
...Css_1.Css.df.fdc.myPx(4).bgWhite.outline0.br4.bshBasic.maxh("inherit").
|
|
68
|
+
...Css_1.Css.df.fdc.myPx(4).bgWhite.outline0.br4.bshBasic.maxh("inherit").oa.if(contrast).bgGray900.$,
|
|
69
69
|
"&:hover": Css_1.Css.bshHover.$,
|
|
70
70
|
}, children: [searchable && ((0, jsx_runtime_1.jsx)(MenuSearchField_1.MenuSearchField, { label: "", value: search, placeholder: "Search...", labelStyle: "inline", 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, contrast: contrast, ...tid }, item.key))) })] }) }));
|
|
71
71
|
}
|
|
@@ -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", { ...separatorProps, css: Css_1.Css.bt.
|
|
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.bcGray200.$ }), (0, jsx_runtime_1.jsx)("li", { ...itemProps, css: Css_1.Css.gray900.if(!isPersistentSection).oa.if(contrast).white.$, 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, contrast: contrast, ...tid }, item.key))) }) })] }));
|
|
16
16
|
}
|
|
17
17
|
exports.MenuSectionImpl = MenuSectionImpl;
|
|
@@ -67,12 +67,12 @@ function StepperForm({ formState }) {
|
|
|
67
67
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Stepper_1.Stepper, { steps: steps, currentStep: currentStep, onChange: setActiveStep }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.mt2.$, children: [currentStep === "author" && (0, jsx_runtime_1.jsx)(AuthorDetails, { formState: formState, onNext: onNext }), currentStep === "books" && (0, jsx_runtime_1.jsx)(BookList, { formState: formState, onNext: onNext, onBack: onBack }), currentStep === "misc" && (0, jsx_runtime_1.jsx)(MiscAuthorDetails, { formState: formState, onBack: onBack })] })] }));
|
|
68
68
|
}
|
|
69
69
|
function AuthorDetails({ formState, onNext }) {
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(mobx_react_1.Observer, { children: () => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.mb1.$, children: "Author Details" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundTextField_1.BoundTextField, { field: formState.firstName, helperText: "Required to enable next step" }) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundTextField_1.BoundTextField, { field: formState.lastName, helperText: "Required to enable next step" }) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.jcfe.bt.
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(mobx_react_1.Observer, { children: () => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.mb1.$, children: "Author Details" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundTextField_1.BoundTextField, { field: formState.firstName, helperText: "Required to enable next step" }) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundTextField_1.BoundTextField, { field: formState.lastName, helperText: "Required to enable next step" }) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.jcfe.bt.bcGray300.py1.mt2.$, children: (0, jsx_runtime_1.jsx)(components_1.Button, { label: "Continue to Books", disabled: !formState.firstName.valid || !formState.lastName.valid, onClick: onNext }) })] })) }));
|
|
71
71
|
}
|
|
72
72
|
function BookList({ formState, onNext, onBack }) {
|
|
73
73
|
const columns = (0, react_1.useMemo)(() => createColumns(formState), [formState]);
|
|
74
74
|
const rows = (0, hooks_1.useComputed)(() => [components_1.simpleHeader, ...formState.books.rows.map((data) => ({ kind: "data", id: data.id.value, data }))], []);
|
|
75
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h1", { css: Css_1.Css.df.aic.$, children: ["Books", (0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "plus", onClick: () => { var _a; return formState.books.add({ id: String(((_a = formState.books.value) === null || _a === void 0 ? void 0 : _a.length) || 1) }); } })] }), (0, jsx_runtime_1.jsx)(components_1.GridTable, { columns: columns, rows: rows }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.bt.
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h1", { css: Css_1.Css.df.aic.$, children: ["Books", (0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "plus", onClick: () => { var _a; return formState.books.add({ id: String(((_a = formState.books.value) === null || _a === void 0 ? void 0 : _a.length) || 1) }); } })] }), (0, jsx_runtime_1.jsx)(components_1.GridTable, { columns: columns, rows: rows }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.bt.bcGray300.py1.mt2.$, children: [(0, jsx_runtime_1.jsx)(components_1.Button, { variant: "tertiary", label: "Back", onClick: onBack }), (0, jsx_runtime_1.jsx)(components_1.Button, { label: "Continue to Misc.", disabled: !formState.books.valid, onClick: onNext })] })] }));
|
|
76
76
|
}
|
|
77
77
|
function createColumns(formState) {
|
|
78
78
|
return [
|
|
@@ -91,7 +91,7 @@ function MiscAuthorDetails({ formState, onBack }) {
|
|
|
91
91
|
const [showFormData, setShowFormData] = (0, react_1.useState)(false);
|
|
92
92
|
return ((0, jsx_runtime_1.jsx)(mobx_react_1.Observer, { children: () => {
|
|
93
93
|
var _a, _b;
|
|
94
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.mb1.$, children: "Author Details" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundDateField_1.BoundDateField, { field: formState.birthday, helperText: "Required" }) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundNumberField_1.BoundNumberField, { field: formState.heightInInches }) }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.bt.
|
|
94
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { css: Css_1.Css.mb1.$, children: "Author Details" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundDateField_1.BoundDateField, { field: formState.birthday, helperText: "Required" }) }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mb2.$, children: (0, jsx_runtime_1.jsx)(BoundNumberField_1.BoundNumberField, { field: formState.heightInInches }) }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.bt.bcGray300.py1.mt2.$, children: [(0, jsx_runtime_1.jsx)(components_1.Button, { variant: "tertiary", label: "Back", onClick: onBack }), (0, jsx_runtime_1.jsx)(components_1.Button, { disabled: !formState.valid, onClick: () => {
|
|
95
95
|
if (formState.canSave()) {
|
|
96
96
|
formState.commitChanges();
|
|
97
97
|
setShowFormData(true);
|
|
@@ -28,14 +28,14 @@ function CheckboxBase(props) {
|
|
|
28
28
|
(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.ml1.mtPx(-2).$, children: [label && (0, jsx_runtime_1.jsx)("div", { css: { ...labelStyles, ...(isDisabled && disabledColor) }, children: label }), description && (0, jsx_runtime_1.jsx)("div", { css: { ...descStyles, ...(isDisabled && disabledColor) }, children: description }), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { errorMsg: errorMsg, ...tid.errorMsg }), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText, ...tid.helperText })] }))] }));
|
|
29
29
|
}
|
|
30
30
|
exports.CheckboxBase = CheckboxBase;
|
|
31
|
-
const baseStyles = Css_1.Css.hPx(16).mw((0, Css_1.px)(16)).relative.ba.
|
|
32
|
-
const filledBoxStyles = Css_1.Css.
|
|
31
|
+
const baseStyles = Css_1.Css.hPx(16).mw((0, Css_1.px)(16)).relative.ba.bcGray300.br4.bgWhite.transition.$;
|
|
32
|
+
const filledBoxStyles = Css_1.Css.bcBlue700.bgBlue700.$;
|
|
33
33
|
const filledBoxHoverStyles = Css_1.Css.bgBlue900.$;
|
|
34
|
-
const disabledBoxStyles = Css_1.Css.bgGray50.
|
|
35
|
-
const disabledSelectedBoxStyles = Css_1.Css.bgGray400.
|
|
34
|
+
const disabledBoxStyles = Css_1.Css.bgGray50.bcGray100.$;
|
|
35
|
+
const disabledSelectedBoxStyles = Css_1.Css.bgGray400.bcGray400.$;
|
|
36
36
|
const disabledColor = Css_1.Css.gray300.$;
|
|
37
37
|
const focusRingStyles = Css_1.Css.bshFocus.$;
|
|
38
|
-
const hoverBorderStyles = Css_1.Css.
|
|
38
|
+
const hoverBorderStyles = Css_1.Css.bcBlue900.$;
|
|
39
39
|
const markStyles = { svg: Css_1.Css.absolute.topPx(-1).leftPx(-1).$ };
|
|
40
40
|
const labelStyles = Css_1.Css.smMd.$;
|
|
41
41
|
const descStyles = Css_1.Css.sm.gray700.$;
|
|
@@ -28,7 +28,7 @@ function ChipSelectField(props) {
|
|
|
28
28
|
const typeScale = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.typeScale) !== null && _a !== void 0 ? _a : "sm";
|
|
29
29
|
const isDisabled = !!disabled;
|
|
30
30
|
const showClearButton = !disabled && clearable && !!value;
|
|
31
|
-
const chipStyles = (0, react_1.useMemo)(() => Css_1.Css[typeScale].
|
|
31
|
+
const chipStyles = (0, react_1.useMemo)(() => Css_1.Css[typeScale].tal.bgGray300.gray900.br16.pxPx(10).pyPx(2).$, [typeScale]);
|
|
32
32
|
// Controls showing the focus border styles.
|
|
33
33
|
const [visualFocus, setVisualFocus] = (0, react_1.useState)(false);
|
|
34
34
|
const [isClearFocused, setIsClearFocused] = (0, react_1.useState)(false);
|
|
@@ -165,10 +165,10 @@ function ChipSelectField(props) {
|
|
|
165
165
|
...(visualFocus ? Css_1.Css.bshFocus.$ : {}),
|
|
166
166
|
...(showInput ? Css_1.Css.dn.$ : {}),
|
|
167
167
|
}, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, labelProps: labelProps, hidden: true, ...tid.label }), (0, jsx_runtime_1.jsx)("button", { ...(0, react_aria_1.mergeProps)(focusProps, buttonProps), ref: buttonRef, css: {
|
|
168
|
-
...Css_1.Css.
|
|
168
|
+
...Css_1.Css.tal.br16.pxPx(10).pyPx(2).outline0.if(showClearButton).prPx(4).borderRadius("16px 0 0 16px").$,
|
|
169
169
|
...(isDisabled ? Css_1.Css.cursorNotAllowed.gray700.$ : {}),
|
|
170
170
|
"&:hover:not(:disabled)": Css_1.Css.bgGray400.if(!value).bgGray300.$,
|
|
171
|
-
}, title: state.selectedItem ? state.selectedItem.textValue : placeholder, ...tid, children: (0, jsx_runtime_1.jsx)("span", { ...valueProps, css: Css_1.Css.lineClamp1.
|
|
171
|
+
}, title: state.selectedItem ? state.selectedItem.textValue : placeholder, ...tid, children: (0, jsx_runtime_1.jsx)("span", { ...valueProps, css: Css_1.Css.lineClamp1.wbba.$, children: state.selectedItem ? state.selectedItem.textValue : placeholder }) }), showClearButton && ((0, jsx_runtime_1.jsx)("button", { ...clearFocusProps, css: {
|
|
172
172
|
...Css_1.Css.prPx(4).borderRadius("0 16px 16px 0").outline0.$,
|
|
173
173
|
"&:hover": Css_1.Css.bgGray400.$,
|
|
174
174
|
...(isClearFocused ? Css_1.Css.boxShadow(`0px 0px 0px 2px rgba(3,105,161,1)`).$ : {}),
|