@homebound/beam 2.369.3 → 2.369.5
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.js +7 -7
- package/dist/components/Accordion.js +1 -2
- package/dist/components/AccordionList.js +1 -2
- package/dist/components/AutoSaveIndicator.js +1 -2
- package/dist/components/AutoSaveStatus/AutoSaveStatusProvider.js +3 -3
- package/dist/components/AutoSaveStatus/useAutoSaveStatus.js +1 -2
- package/dist/components/Avatar/Avatar.js +1 -2
- package/dist/components/Avatar/AvatarButton.js +2 -2
- package/dist/components/Avatar/AvatarGroup.js +1 -2
- package/dist/components/Banner.js +1 -2
- package/dist/components/BeamContext.js +3 -3
- package/dist/components/Button.js +1 -2
- package/dist/components/ButtonDatePicker.js +1 -2
- package/dist/components/ButtonGroup.js +1 -2
- package/dist/components/ButtonMenu.js +1 -2
- package/dist/components/ButtonModal.js +1 -2
- package/dist/components/Chip.d.ts +1 -1
- package/dist/components/Chip.js +3 -3
- package/dist/components/Chips.js +1 -2
- package/dist/components/Copy.js +1 -2
- package/dist/components/CssReset.js +2 -2
- package/dist/components/DnDGrid/DnDGrid.js +2 -2
- package/dist/components/DnDGrid/DnDGridContext.js +2 -2
- package/dist/components/DnDGrid/DnDGridItemHandle.js +1 -2
- package/dist/components/DnDGrid/useDnDGridItem.js +1 -2
- package/dist/components/Filters/BooleanFilter.js +1 -2
- package/dist/components/Filters/CheckboxFilter.js +1 -2
- package/dist/components/Filters/DateFilter.js +1 -2
- package/dist/components/Filters/DateRangeFilter.js +1 -2
- package/dist/components/Filters/FilterModal.js +2 -3
- package/dist/components/Filters/MultiFilter.js +1 -2
- package/dist/components/Filters/NumberRangeFilter.js +1 -2
- package/dist/components/Filters/SingleFilter.js +2 -3
- package/dist/components/Filters/ToggleFilter.js +1 -2
- package/dist/components/Filters/TreeFilter.js +1 -2
- package/dist/components/Filters/index.d.ts +1 -1
- package/dist/components/Filters/index.js +3 -3
- package/dist/components/Filters/testDomain.js +3 -3
- package/dist/components/Filters/types.d.ts +0 -1
- package/dist/components/Filters/utils.js +2 -2
- package/dist/components/Grid/ResponsiveGrid.js +1 -2
- package/dist/components/Grid/ResponsiveGridItem.js +1 -2
- package/dist/components/Grid/useResponsiveGrid.js +1 -2
- package/dist/components/Grid/useResponsiveGridItem.js +1 -2
- package/dist/components/HbLoadingSpinner.js +3 -3
- package/dist/components/HelperText.js +1 -2
- package/dist/components/IconButton.js +2 -2
- package/dist/components/Label.js +3 -3
- package/dist/components/Layout/FullBleed.js +1 -2
- package/dist/components/Layout/PreventBrowserScroll.js +1 -2
- package/dist/components/Layout/RightPaneLayout/RightPaneContext.js +3 -3
- package/dist/components/Layout/RightPaneLayout/RightPaneLayout.js +1 -2
- package/dist/components/Layout/RightPaneLayout/useRightPane.js +1 -2
- package/dist/components/Layout/ScrollableContent.js +1 -2
- package/dist/components/Layout/ScrollableParent.js +3 -3
- package/dist/components/Loader.js +1 -2
- package/dist/components/LoadingSkeleton.js +1 -2
- package/dist/components/MaxLines.js +3 -4
- package/dist/components/Modal/Modal.js +5 -6
- package/dist/components/Modal/ModalContext.js +3 -3
- package/dist/components/Modal/OpenModal.d.ts +0 -1
- package/dist/components/Modal/OpenModal.js +1 -2
- package/dist/components/Modal/TestModalContent.js +3 -4
- package/dist/components/Modal/useModal.js +1 -2
- package/dist/components/NavLink.js +2 -3
- package/dist/components/Pagination.js +4 -4
- package/dist/components/PresentationContext.js +3 -3
- package/dist/components/ScrollShadows.js +1 -2
- package/dist/components/Snackbar/Snackbar.js +1 -2
- package/dist/components/Snackbar/SnackbarContext.js +3 -3
- package/dist/components/Snackbar/SnackbarNotice.js +1 -2
- package/dist/components/Snackbar/useSnackbar.js +1 -2
- package/dist/components/Stepper.js +1 -2
- package/dist/components/SuperDrawer/ConfirmCloseModal.js +1 -2
- package/dist/components/SuperDrawer/SuperDrawer.js +1 -2
- package/dist/components/SuperDrawer/components/SuperDrawerHeader.js +1 -2
- package/dist/components/SuperDrawer/useSuperDrawer.js +1 -2
- package/dist/components/SuperDrawer/utils.js +1 -1
- package/dist/components/Table/GridTable.js +13 -16
- package/dist/components/Table/GridTableApi.js +3 -3
- package/dist/components/Table/TableActions.js +1 -2
- package/dist/components/Table/TableStyles.js +2 -2
- package/dist/components/Table/components/CollapseToggle.js +1 -2
- package/dist/components/Table/components/EditColumnsButton.js +1 -2
- package/dist/components/Table/components/ExpandableHeader.js +1 -2
- package/dist/components/Table/components/KeptGroupRow.js +1 -2
- package/dist/components/Table/components/SelectToggle.js +1 -2
- package/dist/components/Table/components/SortHeader.js +1 -2
- package/dist/components/Table/components/cell.js +1 -1
- package/dist/components/Table/hooks/useSetupColumnSizes.js +1 -2
- package/dist/components/Table/utils/ColumnState.js +1 -1
- package/dist/components/Table/utils/GridRowLookup.js +2 -3
- package/dist/components/Table/utils/RowState.d.ts +1 -1
- package/dist/components/Table/utils/RowState.js +1 -1
- package/dist/components/Table/utils/TableState.js +2 -2
- package/dist/components/Table/utils/columns.js +12 -12
- package/dist/components/Table/utils/simpleHelpers.js +2 -2
- package/dist/components/Table/utils/sortRows.js +4 -5
- package/dist/components/Table/utils/utils.js +15 -15
- package/dist/components/Table/utils/visitor.js +1 -2
- package/dist/components/Tabs.js +6 -7
- package/dist/components/Tag.d.ts +1 -1
- package/dist/components/Tag.js +6 -7
- package/dist/components/Toast/Toast.js +1 -2
- package/dist/components/Toast/ToastContext.js +3 -3
- package/dist/components/Toast/useToast.js +1 -2
- package/dist/components/ToggleChip.js +1 -2
- package/dist/components/ToggleChips.js +1 -2
- package/dist/components/Tooltip.js +7 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +4 -4
- package/dist/components/internal/CompoundField.d.ts +0 -1
- package/dist/components/internal/CompoundField.js +1 -2
- package/dist/components/internal/ContextualModal.js +1 -2
- package/dist/components/internal/DatePicker/DatePicker.js +1 -2
- package/dist/components/internal/DatePicker/DatePickerOverlay.js +1 -2
- package/dist/components/internal/DatePicker/DateRangePicker.js +1 -2
- package/dist/components/internal/DatePicker/Day.js +1 -2
- package/dist/components/internal/DatePicker/Header.js +2 -3
- package/dist/components/internal/DatePicker/WeekHeader.js +1 -2
- package/dist/components/internal/Menu.js +1 -2
- package/dist/components/internal/MenuItem.js +1 -2
- package/dist/components/internal/MenuSection.js +1 -2
- package/dist/components/internal/OverlayTrigger.js +5 -6
- package/dist/components/internal/Popover.js +2 -3
- package/dist/components/testData.js +2 -2
- package/dist/forms/BoundCheckboxField.js +1 -2
- package/dist/forms/BoundCheckboxGroupField.js +1 -2
- package/dist/forms/BoundChipSelectField.d.ts +0 -1
- package/dist/forms/BoundChipSelectField.js +1 -2
- package/dist/forms/BoundDateField.js +1 -2
- package/dist/forms/BoundDateRangeField.js +1 -2
- package/dist/forms/BoundIconCardField.d.ts +1 -1
- package/dist/forms/BoundIconCardField.js +3 -4
- package/dist/forms/BoundIconCardGroupField.d.ts +1 -1
- package/dist/forms/BoundIconCardGroupField.js +1 -2
- package/dist/forms/BoundMultiLineSelectField.d.ts +0 -1
- package/dist/forms/BoundMultiLineSelectField.js +1 -2
- package/dist/forms/BoundMultiSelectField.d.ts +0 -1
- package/dist/forms/BoundMultiSelectField.js +1 -2
- package/dist/forms/BoundNumberField.js +1 -2
- package/dist/forms/BoundRadioGroupField.js +1 -2
- package/dist/forms/BoundRichTextField.js +1 -2
- package/dist/forms/BoundSelectAndTextField.d.ts +0 -1
- package/dist/forms/BoundSelectAndTextField.js +1 -2
- package/dist/forms/BoundSelectField.d.ts +0 -1
- package/dist/forms/BoundSelectField.js +2 -3
- package/dist/forms/BoundSwitchField.js +1 -2
- package/dist/forms/BoundTextAreaField.js +1 -2
- package/dist/forms/BoundTextField.js +1 -2
- package/dist/forms/BoundToggleChipGroupField.js +1 -2
- package/dist/forms/BoundTreeSelectField.d.ts +0 -1
- package/dist/forms/BoundTreeSelectField.js +1 -2
- package/dist/forms/FormHeading.js +1 -2
- package/dist/forms/FormLines.js +4 -5
- package/dist/forms/FormStateApp.js +3 -3
- package/dist/forms/StaticField.js +1 -2
- package/dist/forms/StepperFormApp.js +1 -2
- package/dist/forms/SubmitButton.js +1 -2
- package/dist/forms/formStateDomain.js +1 -1
- package/dist/forms/index.d.ts +2 -2
- package/dist/forms/index.js +2 -2
- package/dist/forms/labelUtils.js +1 -2
- package/dist/hooks/useBreakpoint.js +1 -2
- package/dist/hooks/useComputed.d.ts +42 -1
- package/dist/hooks/useComputed.js +43 -3
- package/dist/hooks/useFilter.js +1 -2
- package/dist/hooks/useGroupBy.js +1 -2
- package/dist/hooks/useHover.js +1 -2
- package/dist/hooks/usePersistedFilter.js +2 -3
- package/dist/hooks/useQueryState.js +1 -2
- package/dist/hooks/useRenderCount.js +1 -2
- package/dist/hooks/useSessionStorage.js +1 -2
- package/dist/inputs/Autocomplete.js +1 -2
- package/dist/inputs/Checkbox.js +1 -2
- package/dist/inputs/CheckboxBase.js +2 -3
- package/dist/inputs/CheckboxGroup.js +1 -2
- package/dist/inputs/ChipSelectField.js +5 -5
- package/dist/inputs/ChipTextField.js +1 -2
- package/dist/inputs/DateFields/DateField.js +1 -2
- package/dist/inputs/DateFields/DateField.mock.js +1 -2
- package/dist/inputs/DateFields/DateFieldBase.js +2 -3
- package/dist/inputs/DateFields/DateRangeField.js +1 -2
- package/dist/inputs/DateFields/utils.js +7 -7
- package/dist/inputs/ErrorMessage.js +1 -2
- package/dist/inputs/IconCard.js +2 -2
- package/dist/inputs/IconCardGroup.js +5 -6
- package/dist/inputs/MultiLineSelectField.d.ts +0 -1
- package/dist/inputs/MultiLineSelectField.js +1 -2
- package/dist/inputs/MultiSelectField.js +1 -2
- package/dist/inputs/NumberField.js +2 -3
- package/dist/inputs/RadioGroupField.js +2 -2
- package/dist/inputs/RichTextField.d.ts +1 -1
- package/dist/inputs/RichTextField.js +2 -3
- package/dist/inputs/RichTextField.mock.js +1 -2
- package/dist/inputs/SelectField.d.ts +0 -1
- package/dist/inputs/SelectField.js +1 -2
- package/dist/inputs/Switch.js +3 -3
- package/dist/inputs/SwitchGroup.js +1 -2
- package/dist/inputs/TextAreaField.js +1 -2
- package/dist/inputs/TextField.js +1 -2
- package/dist/inputs/TextFieldBase.js +2 -3
- package/dist/inputs/ToggleButton.js +2 -2
- package/dist/inputs/ToggleChipGroup.d.ts +1 -1
- package/dist/inputs/ToggleChipGroup.js +2 -3
- package/dist/inputs/TreeSelectField/TreeOption.js +1 -2
- package/dist/inputs/TreeSelectField/TreeSelectField.js +5 -5
- package/dist/inputs/TreeSelectField/utils.js +5 -6
- package/dist/inputs/Value.js +2 -3
- package/dist/inputs/hooks/useGrowingTextField.js +1 -2
- package/dist/inputs/index.d.ts +1 -1
- package/dist/inputs/index.js +1 -1
- package/dist/inputs/internal/ComboBoxBase.js +6 -6
- package/dist/inputs/internal/ComboBoxInput.js +2 -3
- package/dist/inputs/internal/ListBox.js +1 -2
- package/dist/inputs/internal/ListBoxChip.js +1 -2
- package/dist/inputs/internal/ListBoxSection.js +1 -2
- package/dist/inputs/internal/ListBoxToggleChip.js +1 -2
- package/dist/inputs/internal/LoadingDots.js +1 -2
- package/dist/inputs/internal/MenuSearchField.js +1 -2
- package/dist/inputs/internal/Option.js +1 -2
- package/dist/inputs/internal/VirtualizedOptions.d.ts +0 -1
- package/dist/inputs/internal/VirtualizedOptions.js +2 -4
- package/dist/inputs/utils.js +1 -2
- package/dist/types.js +1 -2
- package/dist/utils/defaultLabel.js +1 -2
- package/dist/utils/defaultTestId.js +1 -2
- package/dist/utils/getInteractiveElement.js +1 -2
- package/dist/utils/index.js +12 -12
- package/dist/utils/options.js +2 -3
- package/dist/utils/rtl.d.ts +2 -3
- package/dist/utils/rtl.js +13 -13
- package/dist/utils/sb.d.ts +3 -3
- package/dist/utils/sb.js +7 -7
- package/dist/utils/shallowEqual.js +1 -2
- package/dist/utils/useTestIds.js +2 -3
- package/package.json +38 -45
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.zIndices = exports.reservedRowKinds = exports.KEPT_GROUP = exports.EXPANDABLE_HEADER = exports.TOTALS = exports.HEADER = exports.emptyCell = exports.DESC = exports.ASC = void 0;
|
|
4
|
+
exports.toContent = toContent;
|
|
5
|
+
exports.isGridCellContent = isGridCellContent;
|
|
6
|
+
exports.applyRowFn = applyRowFn;
|
|
7
|
+
exports.getFirstOrLastCellCss = getFirstOrLastCellCss;
|
|
8
|
+
exports.isJSX = isJSX;
|
|
9
|
+
exports.getAlignment = getAlignment;
|
|
10
|
+
exports.getJustification = getJustification;
|
|
11
|
+
exports.maybeApplyFunction = maybeApplyFunction;
|
|
12
|
+
exports.matchesFilter = matchesFilter;
|
|
13
|
+
exports.loadArrayOrUndefined = loadArrayOrUndefined;
|
|
14
|
+
exports.insertAtIndex = insertAtIndex;
|
|
15
|
+
exports.isCursorBelowMidpoint = isCursorBelowMidpoint;
|
|
16
|
+
exports.recursivelyGetContainingRow = recursivelyGetContainingRow;
|
|
17
|
+
exports.getTableRefWidthStyles = getTableRefWidthStyles;
|
|
4
18
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
19
|
const Icon_1 = require("../../Icon");
|
|
6
20
|
const ExpandableHeader_1 = require("../components/ExpandableHeader");
|
|
@@ -62,11 +76,9 @@ function toContent(maybeContent, isHeader, canSortColumn, isClientSideSorting, s
|
|
|
62
76
|
}
|
|
63
77
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [content, tooltipEl] }));
|
|
64
78
|
}
|
|
65
|
-
exports.toContent = toContent;
|
|
66
79
|
function isGridCellContent(content) {
|
|
67
80
|
return typeof content === "object" && !!content && "content" in content;
|
|
68
81
|
}
|
|
69
|
-
exports.isGridCellContent = isGridCellContent;
|
|
70
82
|
const emptyValues = ["", null, undefined];
|
|
71
83
|
function isContentEmpty(content) {
|
|
72
84
|
return emptyValues.includes(content);
|
|
@@ -83,7 +95,6 @@ function applyRowFn(column, row, api, level, expanded, dragData) {
|
|
|
83
95
|
return maybeContent;
|
|
84
96
|
}
|
|
85
97
|
}
|
|
86
|
-
exports.applyRowFn = applyRowFn;
|
|
87
98
|
exports.ASC = "ASC";
|
|
88
99
|
exports.DESC = "DESC";
|
|
89
100
|
exports.emptyCell = { content: () => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), value: "" };
|
|
@@ -93,12 +104,10 @@ function getFirstOrLastCellCss(style, columnIndex, columns) {
|
|
|
93
104
|
...(columnIndex === columns.length - 1 ? style.lastCellCss : {}),
|
|
94
105
|
};
|
|
95
106
|
}
|
|
96
|
-
exports.getFirstOrLastCellCss = getFirstOrLastCellCss;
|
|
97
107
|
/** A heuristic to detect the result of `React.createElement` / i.e. JSX. */
|
|
98
108
|
function isJSX(content) {
|
|
99
109
|
return typeof content === "object" && content && "type" in content && "props" in content;
|
|
100
110
|
}
|
|
101
|
-
exports.isJSX = isJSX;
|
|
102
111
|
const alignmentToJustify = {
|
|
103
112
|
left: "flex-start",
|
|
104
113
|
center: "center",
|
|
@@ -112,7 +121,6 @@ const alignmentToTextAlign = {
|
|
|
112
121
|
function getAlignment(column, maybeContent) {
|
|
113
122
|
return (isGridCellContent(maybeContent) && maybeContent.alignment) || column.align || "left";
|
|
114
123
|
}
|
|
115
|
-
exports.getAlignment = getAlignment;
|
|
116
124
|
// For alignment, use: 1) cell def, else 2) column def, else 3) left.
|
|
117
125
|
function getJustification(column, maybeContent, as, alignment) {
|
|
118
126
|
// Always apply text alignment.
|
|
@@ -122,7 +130,6 @@ function getJustification(column, maybeContent, as, alignment) {
|
|
|
122
130
|
}
|
|
123
131
|
return { ...Css_1.Css.jc(alignmentToJustify[alignment]).$, ...textAlign };
|
|
124
132
|
}
|
|
125
|
-
exports.getJustification = getJustification;
|
|
126
133
|
/** Look at a row and get its filter value. */
|
|
127
134
|
function filterValue(value) {
|
|
128
135
|
let maybeFn = value;
|
|
@@ -143,7 +150,6 @@ function filterValue(value) {
|
|
|
143
150
|
function maybeApplyFunction(row, maybeFn) {
|
|
144
151
|
return typeof maybeFn === "function" ? maybeFn(row) : maybeFn;
|
|
145
152
|
}
|
|
146
|
-
exports.maybeApplyFunction = maybeApplyFunction;
|
|
147
153
|
function matchesFilter(maybeContent, filter) {
|
|
148
154
|
const value = filterValue(maybeContent);
|
|
149
155
|
if (typeof value === "string") {
|
|
@@ -154,7 +160,6 @@ function matchesFilter(maybeContent, filter) {
|
|
|
154
160
|
}
|
|
155
161
|
return false;
|
|
156
162
|
}
|
|
157
|
-
exports.matchesFilter = matchesFilter;
|
|
158
163
|
exports.HEADER = "header";
|
|
159
164
|
exports.TOTALS = "totals";
|
|
160
165
|
/** Tables expandable columns get an extra header. */
|
|
@@ -172,11 +177,9 @@ function loadArrayOrUndefined(key) {
|
|
|
172
177
|
const ids = sessionStorage.getItem(key);
|
|
173
178
|
return ids ? JSON.parse(ids) : undefined;
|
|
174
179
|
}
|
|
175
|
-
exports.loadArrayOrUndefined = loadArrayOrUndefined;
|
|
176
180
|
function insertAtIndex(array, element, index) {
|
|
177
181
|
return [...array.slice(0, index), element, ...array.slice(index, array.length)];
|
|
178
182
|
}
|
|
179
|
-
exports.insertAtIndex = insertAtIndex;
|
|
180
183
|
function isCursorBelowMidpoint(target, clientY) {
|
|
181
184
|
const style = window.getComputedStyle(target);
|
|
182
185
|
const rect = target.getBoundingClientRect();
|
|
@@ -184,7 +187,6 @@ function isCursorBelowMidpoint(target, clientY) {
|
|
|
184
187
|
const pb = parseFloat(style.getPropertyValue("padding-bottom"));
|
|
185
188
|
return clientY > rect.top + pt + (rect.height - pb) / 2;
|
|
186
189
|
}
|
|
187
|
-
exports.isCursorBelowMidpoint = isCursorBelowMidpoint;
|
|
188
190
|
function recursivelyGetContainingRow(rowId, rowArray, parent) {
|
|
189
191
|
if (rowArray.some((row) => row.id === rowId)) {
|
|
190
192
|
return { array: rowArray, parent };
|
|
@@ -200,10 +202,8 @@ function recursivelyGetContainingRow(rowId, rowArray, parent) {
|
|
|
200
202
|
}
|
|
201
203
|
return undefined;
|
|
202
204
|
}
|
|
203
|
-
exports.recursivelyGetContainingRow = recursivelyGetContainingRow;
|
|
204
205
|
function getTableRefWidthStyles(isVirtual) {
|
|
205
206
|
// If virtualized take some pixels off the width to accommodate when virtuoso's scrollbar is introduced.
|
|
206
207
|
// Otherwise a horizontal scrollbar will _always_ appear once the vertical scrollbar is needed
|
|
207
208
|
return Css_1.Css.w100.if(isVirtual).w("calc(100% - 20px)").$;
|
|
208
209
|
}
|
|
209
|
-
exports.getTableRefWidthStyles = getTableRefWidthStyles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.visit =
|
|
3
|
+
exports.visit = visit;
|
|
4
4
|
function visit(rows, fn) {
|
|
5
5
|
const todo = [...rows];
|
|
6
6
|
while (todo.length > 0) {
|
|
@@ -11,4 +11,3 @@ function visit(rows, fn) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
exports.visit = visit;
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TabsWithContent = TabsWithContent;
|
|
4
|
+
exports.TabContent = TabContent;
|
|
5
|
+
exports.Tabs = Tabs;
|
|
6
|
+
exports.getTabStyles = getTabStyles;
|
|
7
|
+
exports.getNextTabValue = getNextTabValue;
|
|
4
8
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
9
|
const change_case_1 = require("change-case");
|
|
6
10
|
const react_1 = require("react");
|
|
@@ -26,7 +30,6 @@ function TabsWithContent(props) {
|
|
|
26
30
|
const styles = hideTabs(props) ? {} : Css_1.Css.pt3.$;
|
|
27
31
|
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
32
|
}
|
|
29
|
-
exports.TabsWithContent = TabsWithContent;
|
|
30
33
|
function TabContent(props) {
|
|
31
34
|
const tid = (0, utils_1.useTestIds)(props, "tab");
|
|
32
35
|
const { tabs, contentXss = {} } = props;
|
|
@@ -43,7 +46,6 @@ function TabContent(props) {
|
|
|
43
46
|
// Omit the padding from `FullBleed` if the caller passes in the `paddingLeft/Right` styles.
|
|
44
47
|
(0, jsx_runtime_1.jsx)(components_1.FullBleed, { omitPadding: "paddingLeft" in contentXss || "paddingRight" in contentXss, 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() }) }));
|
|
45
48
|
}
|
|
46
|
-
exports.TabContent = TabContent;
|
|
47
49
|
/** The top list of tabs. */
|
|
48
50
|
function Tabs(props) {
|
|
49
51
|
const { ariaLabel, tabs, includeBottomBorder, right, ...others } = props;
|
|
@@ -85,7 +87,6 @@ function Tabs(props) {
|
|
|
85
87
|
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
88
|
}) })), right && (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mla.df.aic.gap1.pb1.$, children: right })] }));
|
|
87
89
|
}
|
|
88
|
-
exports.Tabs = Tabs;
|
|
89
90
|
function TabImpl(props) {
|
|
90
91
|
const { tab, onClick, active, onKeyUp, onBlur, focusProps, isFocusVisible = false, ...others } = props;
|
|
91
92
|
const { disabled = false, name: label, icon, endAdornment } = tab;
|
|
@@ -120,7 +121,7 @@ function TabImpl(props) {
|
|
|
120
121
|
title: (0, components_1.resolveTooltip)(disabled),
|
|
121
122
|
placement: "top",
|
|
122
123
|
children: (0, jsx_runtime_1.jsx)("div", { ...tabProps, children: tabLabel }),
|
|
123
|
-
})) : isRouteTab(tab) ? ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { ...
|
|
124
|
+
})) : 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 }));
|
|
124
125
|
}
|
|
125
126
|
function getTabStyles() {
|
|
126
127
|
const borderBottomWidthPx = 4;
|
|
@@ -139,7 +140,6 @@ function getTabStyles() {
|
|
|
139
140
|
activeHoverStyles: Css_1.Css.bgBlue50.add(borderBottomStyles).bcBlue700.$,
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
|
-
exports.getTabStyles = getTabStyles;
|
|
143
143
|
function getNextTabValue(selected, key, tabs) {
|
|
144
144
|
const enabledTabs = tabs.filter((tab) => tab.disabled !== true);
|
|
145
145
|
const tabsToScan = key === "ArrowRight" ? enabledTabs : enabledTabs.reverse();
|
|
@@ -147,7 +147,6 @@ function getNextTabValue(selected, key, tabs) {
|
|
|
147
147
|
const nextIndex = currentIndex === tabsToScan.length - 1 ? 0 : currentIndex + 1;
|
|
148
148
|
return uniqueTabValue(tabsToScan[nextIndex]);
|
|
149
149
|
}
|
|
150
|
-
exports.getNextTabValue = getNextTabValue;
|
|
151
150
|
function isRouteTabs(props) {
|
|
152
151
|
const { tabs } = props;
|
|
153
152
|
return tabs.length > 0 && isRouteTab(tabs[0]);
|
package/dist/components/Tag.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { IconKey } from "./";
|
|
2
3
|
import { Margin, Only, Xss } from "../Css";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
4
|
type TagXss = Margin | "backgroundColor" | "color";
|
|
5
5
|
export type TagType = "info" | "caution" | "warning" | "success" | "neutral";
|
|
6
6
|
interface TagProps<X> {
|
package/dist/components/Tag.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Tag =
|
|
3
|
+
exports.Tag = Tag;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
const utils_1 = require("@react-aria/utils");
|
|
6
|
+
const react_1 = require("react");
|
|
5
7
|
const components_1 = require("./");
|
|
6
8
|
const Css_1 = require("../Css");
|
|
7
|
-
const
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const utils_2 = require("@react-aria/utils");
|
|
9
|
+
const utils_2 = require("../utils");
|
|
10
10
|
/** Tag used for indicating a status */
|
|
11
11
|
function Tag(props) {
|
|
12
12
|
const { text, type, xss, preventTooltip = false, ...otherProps } = props;
|
|
13
13
|
const typeStyles = getStyles(type);
|
|
14
|
-
const tid = (0,
|
|
14
|
+
const tid = (0, utils_2.useTestIds)(otherProps);
|
|
15
15
|
const [showTooltip, setShowTooltip] = (0, react_1.useState)(false);
|
|
16
16
|
const ref = (0, react_1.useRef)(null);
|
|
17
|
-
(0,
|
|
17
|
+
(0, utils_1.useResizeObserver)({
|
|
18
18
|
ref,
|
|
19
19
|
onResize: () => {
|
|
20
20
|
if (ref.current) {
|
|
@@ -27,7 +27,6 @@ function Tag(props) {
|
|
|
27
27
|
children: ((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 }, 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", { ref: ref, css: Css_1.Css.lineClamp1.wbba.$, children: text })] })),
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
exports.Tag = Tag;
|
|
31
30
|
function getStyles(type) {
|
|
32
31
|
switch (type) {
|
|
33
32
|
case "info":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Toast =
|
|
3
|
+
exports.Toast = Toast;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const components_1 = require("..");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
@@ -10,4 +10,3 @@ function Toast() {
|
|
|
10
10
|
const tid = (0, utils_1.useTestIds)({}, "toast");
|
|
11
11
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: notice && (0, jsx_runtime_1.jsx)(components_1.Banner, { ...notice, ...tid, onClose: () => setNotice(undefined) }) });
|
|
12
12
|
}
|
|
13
|
-
exports.Toast = Toast;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ToastContext = void 0;
|
|
4
|
+
exports.ToastProvider = ToastProvider;
|
|
5
|
+
exports.useToastContext = useToastContext;
|
|
4
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
7
|
const react_1 = require("react");
|
|
6
8
|
exports.ToastContext = (0, react_1.createContext)({
|
|
@@ -16,8 +18,6 @@ function ToastProvider(props) {
|
|
|
16
18
|
const contextValue = (0, react_1.useMemo)(() => ({ setNotice, notice, clear }), [notice, clear]);
|
|
17
19
|
return (0, jsx_runtime_1.jsx)(exports.ToastContext.Provider, { value: contextValue, children: props.children });
|
|
18
20
|
}
|
|
19
|
-
exports.ToastProvider = ToastProvider;
|
|
20
21
|
function useToastContext() {
|
|
21
22
|
return (0, react_1.useContext)(exports.ToastContext);
|
|
22
23
|
}
|
|
23
|
-
exports.useToastContext = useToastContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useToast =
|
|
3
|
+
exports.useToast = useToast;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const ToastContext_1 = require("./ToastContext");
|
|
6
6
|
function useToast() {
|
|
@@ -8,4 +8,3 @@ function useToast() {
|
|
|
8
8
|
const showToast = (0, react_1.useCallback)((props) => setNotice(props), [setNotice]);
|
|
9
9
|
return { showToast, clear };
|
|
10
10
|
}
|
|
11
|
-
exports.useToast = useToast;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToggleChip =
|
|
3
|
+
exports.ToggleChip = ToggleChip;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const Icon_1 = require("./Icon");
|
|
6
6
|
const PresentationContext_1 = require("./PresentationContext");
|
|
@@ -24,4 +24,3 @@ function ToggleChip(props) {
|
|
|
24
24
|
...xss,
|
|
25
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
|
-
exports.ToggleChip = ToggleChip;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToggleChips =
|
|
3
|
+
exports.ToggleChips = ToggleChips;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const ToggleChip_1 = require("./ToggleChip");
|
|
6
6
|
const Css_1 = require("../Css");
|
|
@@ -11,4 +11,3 @@ function ToggleChips(props) {
|
|
|
11
11
|
const tid = (0, useTestIds_1.useTestIds)(props, "toggleChips");
|
|
12
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
|
-
exports.ToggleChips = ToggleChips;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Tooltip = Tooltip;
|
|
4
|
+
exports.maybeTooltip = maybeTooltip;
|
|
5
|
+
exports.resolveTooltip = resolveTooltip;
|
|
4
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
7
|
const react_1 = require("react");
|
|
6
8
|
const react_aria_1 = require("react-aria");
|
|
@@ -26,7 +28,6 @@ function Tooltip(props) {
|
|
|
26
28
|
// See https://github.com/adobe/react-spectrum/discussions/3058 for discussion related to this issue.
|
|
27
29
|
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, bgColor: bgColor }))] }));
|
|
28
30
|
}
|
|
29
|
-
exports.Tooltip = Tooltip;
|
|
30
31
|
function Popper({ triggerRef, content, placement = "auto", bgColor = Css_1.Palette.Gray900 }) {
|
|
31
32
|
var _a;
|
|
32
33
|
const popperRef = (0, react_1.useRef)(null);
|
|
@@ -34,7 +35,9 @@ function Popper({ triggerRef, content, placement = "auto", bgColor = Css_1.Palet
|
|
|
34
35
|
// Since we use `display: contents;` on the `triggerRef`, then the element.offsetTop/Left/etc all equal `0`. This would make
|
|
35
36
|
// the tooltip show in the top left of the document. So instead, we target either the first child, if available, or the parent element as the tooltip target.
|
|
36
37
|
// It is possible there are no children if the element only has text content, which is the reasoning for the parentElement fallback.
|
|
37
|
-
const targetElement = triggerRef.current
|
|
38
|
+
const targetElement = triggerRef.current
|
|
39
|
+
? ((_a = triggerRef.current.children[0]) !== null && _a !== void 0 ? _a : triggerRef.current.parentElement)
|
|
40
|
+
: null;
|
|
38
41
|
const { styles, attributes } = (0, react_popper_1.usePopper)(targetElement, popperRef.current, {
|
|
39
42
|
modifiers: [
|
|
40
43
|
{ name: "arrow", options: { element: arrowRef } },
|
|
@@ -48,7 +51,6 @@ function Popper({ triggerRef, content, placement = "auto", bgColor = Css_1.Palet
|
|
|
48
51
|
function maybeTooltip(props) {
|
|
49
52
|
return props.title ? (0, jsx_runtime_1.jsx)(Tooltip, { ...props }) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props.children });
|
|
50
53
|
}
|
|
51
|
-
exports.maybeTooltip = maybeTooltip;
|
|
52
54
|
// Helper function for resolving showing the Tooltip text via a 'disabled' prop, or the 'tooltip' prop.
|
|
53
55
|
function resolveTooltip(disabled, tooltip, readOnly) {
|
|
54
56
|
// If `disabled` is a ReactNode, then return that. Otherwise, return `tooltip`
|
|
@@ -56,6 +58,5 @@ function resolveTooltip(disabled, tooltip, readOnly) {
|
|
|
56
58
|
? disabled
|
|
57
59
|
: typeof readOnly !== "boolean" && readOnly
|
|
58
60
|
? readOnly
|
|
59
|
-
: tooltip !== null && tooltip !== void 0 ? tooltip : undefined;
|
|
61
|
+
: (tooltip !== null && tooltip !== void 0 ? tooltip : undefined);
|
|
60
62
|
}
|
|
61
|
-
exports.resolveTooltip = resolveTooltip;
|
|
@@ -21,8 +21,8 @@ export * from "./CssReset";
|
|
|
21
21
|
export * from "./DnDGrid";
|
|
22
22
|
export * from "./Filters";
|
|
23
23
|
export * from "./Grid";
|
|
24
|
+
export { HB_QUIPS_FLAVOR, HB_QUIPS_MISSION, HbLoadingSpinner, HbSpinnerProvider } from "./HbLoadingSpinner";
|
|
24
25
|
export * from "./HelperText";
|
|
25
|
-
export { HbLoadingSpinner, HbSpinnerProvider, HB_QUIPS_FLAVOR, HB_QUIPS_MISSION } from "./HbLoadingSpinner";
|
|
26
26
|
export * from "./Icon";
|
|
27
27
|
export * from "./IconButton";
|
|
28
28
|
export * from "./Layout";
|
package/dist/components/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useToast = exports.TabsWithContent = exports.Tabs = exports.TabContent = exports.PresentationProvider = exports.NavLink = exports.
|
|
17
|
+
exports.useToast = exports.TabsWithContent = exports.Tabs = exports.TabContent = exports.PresentationProvider = exports.NavLink = exports.HbSpinnerProvider = exports.HbLoadingSpinner = exports.HB_QUIPS_MISSION = exports.HB_QUIPS_FLAVOR = exports.BeamProvider = void 0;
|
|
18
18
|
__exportStar(require("./AutoSaveStatus"), exports);
|
|
19
19
|
__exportStar(require("./Chip"), exports);
|
|
20
20
|
__exportStar(require("./Chips"), exports);
|
|
@@ -38,12 +38,12 @@ __exportStar(require("./CssReset"), exports);
|
|
|
38
38
|
__exportStar(require("./DnDGrid"), exports);
|
|
39
39
|
__exportStar(require("./Filters"), exports);
|
|
40
40
|
__exportStar(require("./Grid"), exports);
|
|
41
|
-
__exportStar(require("./HelperText"), exports);
|
|
42
41
|
var HbLoadingSpinner_1 = require("./HbLoadingSpinner");
|
|
43
|
-
Object.defineProperty(exports, "HbLoadingSpinner", { enumerable: true, get: function () { return HbLoadingSpinner_1.HbLoadingSpinner; } });
|
|
44
|
-
Object.defineProperty(exports, "HbSpinnerProvider", { enumerable: true, get: function () { return HbLoadingSpinner_1.HbSpinnerProvider; } });
|
|
45
42
|
Object.defineProperty(exports, "HB_QUIPS_FLAVOR", { enumerable: true, get: function () { return HbLoadingSpinner_1.HB_QUIPS_FLAVOR; } });
|
|
46
43
|
Object.defineProperty(exports, "HB_QUIPS_MISSION", { enumerable: true, get: function () { return HbLoadingSpinner_1.HB_QUIPS_MISSION; } });
|
|
44
|
+
Object.defineProperty(exports, "HbLoadingSpinner", { enumerable: true, get: function () { return HbLoadingSpinner_1.HbLoadingSpinner; } });
|
|
45
|
+
Object.defineProperty(exports, "HbSpinnerProvider", { enumerable: true, get: function () { return HbLoadingSpinner_1.HbSpinnerProvider; } });
|
|
46
|
+
__exportStar(require("./HelperText"), exports);
|
|
47
47
|
__exportStar(require("./Icon"), exports);
|
|
48
48
|
__exportStar(require("./IconButton"), exports);
|
|
49
49
|
__exportStar(require("./Layout"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompoundField =
|
|
3
|
+
exports.CompoundField = CompoundField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Css_1 = require("../../Css");
|
|
@@ -28,4 +28,3 @@ function CompoundField({ children }) {
|
|
|
28
28
|
internalProps,
|
|
29
29
|
}) })] }));
|
|
30
30
|
}
|
|
31
|
-
exports.CompoundField = CompoundField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContextualModal =
|
|
3
|
+
exports.ContextualModal = ContextualModal;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_aria_1 = require("react-aria");
|
|
6
6
|
const Css_1 = require("../../Css");
|
|
@@ -10,4 +10,3 @@ function ContextualModal(props) {
|
|
|
10
10
|
const tid = (0, utils_1.useTestIds)(props, "popup");
|
|
11
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
|
-
exports.ContextualModal = ContextualModal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatePicker =
|
|
3
|
+
exports.DatePicker = DatePicker;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_day_picker_1 = require("react-day-picker");
|
|
6
6
|
const Day_1 = require("./Day");
|
|
@@ -21,4 +21,3 @@ function DatePicker(props) {
|
|
|
21
21
|
onSelect(day);
|
|
22
22
|
}, disabled: disabledDays, modifiers: { indicatorDot: dottedDays !== null && dottedDays !== void 0 ? dottedDays : [] } }) }));
|
|
23
23
|
}
|
|
24
|
-
exports.DatePicker = DatePicker;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatePickerOverlay =
|
|
3
|
+
exports.DatePickerOverlay = DatePickerOverlay;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const Css_1 = require("../../../Css");
|
|
6
6
|
// Small wrapper around DatePicker to provide necessary styling and state handling when displayed as an overlay.
|
|
7
7
|
function DatePickerOverlay({ overlayProps, children }) {
|
|
8
8
|
return ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.br4.bshModal.$, ...overlayProps, children: children }));
|
|
9
9
|
}
|
|
10
|
-
exports.DatePickerOverlay = DatePickerOverlay;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateRangePicker =
|
|
3
|
+
exports.DateRangePicker = DateRangePicker;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_day_picker_1 = require("react-day-picker");
|
|
6
6
|
const Day_1 = require("./Day");
|
|
@@ -20,4 +20,3 @@ function DateRangePicker(props) {
|
|
|
20
20
|
onSelect(selection);
|
|
21
21
|
}, disabled: disabledDays, modifiers: { indicatorDot: dottedDays !== null && dottedDays !== void 0 ? dottedDays : [] } }) }));
|
|
22
22
|
}
|
|
23
|
-
exports.DateRangePicker = DateRangePicker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Day =
|
|
3
|
+
exports.Day = Day;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_day_picker_1 = require("react-day-picker");
|
|
@@ -51,5 +51,4 @@ function Day(props) {
|
|
|
51
51
|
.hPx(4)
|
|
52
52
|
.bgBlue700.br4.if(selected && !range_middle).bgWhite.$, ...tid.indicatorDot }))] }) }));
|
|
53
53
|
}
|
|
54
|
-
exports.Day = Day;
|
|
55
54
|
const rangeBaseStyles = Css_1.Css.absolute.topPx(2).contentEmpty.hPx(30).wPx(32).bgBlue100.$;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Header = Header;
|
|
4
|
+
exports.YearSkipHeader = YearSkipHeader;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
const date_fns_1 = require("date-fns");
|
|
6
7
|
const react_day_picker_1 = require("react-day-picker");
|
|
@@ -11,11 +12,9 @@ function Header(props) {
|
|
|
11
12
|
const { goToMonth } = (0, react_day_picker_1.useNavigation)();
|
|
12
13
|
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
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
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
|
-
exports.YearSkipHeader = YearSkipHeader;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WeekHeader =
|
|
3
|
+
exports.WeekHeader = WeekHeader;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const date_fns_1 = require("date-fns");
|
|
6
6
|
const Css_1 = require("../../../Css");
|
|
@@ -13,4 +13,3 @@ function WeekHeader() {
|
|
|
13
13
|
// Copies the existing structure and classes defined by React-Day-Picker. Adds in Beam styling and formatting.
|
|
14
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
|
-
exports.WeekHeader = WeekHeader;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Menu =
|
|
3
|
+
exports.Menu = Menu;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const change_case_1 = require("change-case");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -69,4 +69,3 @@ function Menu(props) {
|
|
|
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
|
}
|
|
72
|
-
exports.Menu = Menu;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuItemImpl =
|
|
3
|
+
exports.MenuItemImpl = MenuItemImpl;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_aria_1 = require("react-aria");
|
|
@@ -74,7 +74,6 @@ function MenuItemImpl(props) {
|
|
|
74
74
|
children: renderMenuItem(menuItem, isSelected, isDisabled, contrast),
|
|
75
75
|
}) }));
|
|
76
76
|
}
|
|
77
|
-
exports.MenuItemImpl = MenuItemImpl;
|
|
78
77
|
function renderMenuItem(menuItem, isSelected, isDisabled, contrast) {
|
|
79
78
|
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.w100.aic.jcsb.gap2.$, children: [(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.aic.$, children: maybeWrapInLink(menuItem.onClick, isIconMenuItem(menuItem) ? ((0, jsx_runtime_1.jsx)(IconMenuItem, { ...menuItem })) : isImageMenuItem(menuItem) ? ((0, jsx_runtime_1.jsx)(ImageMenuItem, { ...menuItem })) : (menuItem.label), isDisabled) }), isSelected && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "check", color: !contrast ? (isDisabled ? Css_1.Palette.Gray400 : Css_1.Palette.Blue700) : isDisabled ? Css_1.Palette.Gray500 : Css_1.Palette.White }))] }));
|
|
80
79
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuSectionImpl =
|
|
3
|
+
exports.MenuSectionImpl = MenuSectionImpl;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_aria_1 = require("react-aria");
|
|
6
6
|
const internal_1 = require("./");
|
|
@@ -14,4 +14,3 @@ function MenuSectionImpl(props) {
|
|
|
14
14
|
const tid = (0, utils_1.useTestIds)(props);
|
|
15
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
|
-
exports.MenuSectionImpl = MenuSectionImpl;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.OverlayTrigger = OverlayTrigger;
|
|
4
|
+
exports.isTextButton = isTextButton;
|
|
5
|
+
exports.isIconButton = isIconButton;
|
|
6
|
+
exports.isNavLinkButton = isNavLinkButton;
|
|
7
|
+
exports.labelOr = labelOr;
|
|
4
8
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
9
|
const react_1 = require("react");
|
|
6
10
|
const react_aria_1 = require("react-aria");
|
|
@@ -37,20 +41,15 @@ function OverlayTrigger(props) {
|
|
|
37
41
|
// Add `line-height: 0` to prevent the Icon button and Avatar buttons from inheriting the line-height, causing them to be taller than they should.
|
|
38
42
|
(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.dib.add("lineHeight", 0).$, children: [isTextButton(trigger) ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: variant ? variant : "secondary", contrast: contrast, ...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: (_a = menuTriggerProps.onPress) !== null && _a !== void 0 ? _a : utils_1.noop, forceFocusStyles: showActiveBorder && state.isOpen, ...tid })) : isNavLinkButton(trigger) ? ((0, jsx_runtime_1.jsx)(NavLink_1.NavLink, { ...trigger, label: trigger.navLabel, disabled: !!disabled, contrast: contrast, menuTriggerProps: menuTriggerProps, buttonRef: buttonRef, ...tid })) : isIconButton(trigger) ? ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { ...trigger, menuTriggerProps: menuTriggerProps, buttonRef: buttonRef, ...tid, disabled: disabled, tooltip: tooltip, onClick: (_b = menuTriggerProps.onPress) !== null && _b !== void 0 ? _b : 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: (_c = menuTriggerProps.onPress) !== null && _c !== void 0 ? _c : 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 }))] }));
|
|
39
43
|
}
|
|
40
|
-
exports.OverlayTrigger = OverlayTrigger;
|
|
41
44
|
function isTextButton(trigger) {
|
|
42
45
|
return trigger && typeof trigger === "object" && "label" in trigger;
|
|
43
46
|
}
|
|
44
|
-
exports.isTextButton = isTextButton;
|
|
45
47
|
function isIconButton(trigger) {
|
|
46
48
|
return trigger && typeof trigger === "object" && "icon" in trigger;
|
|
47
49
|
}
|
|
48
|
-
exports.isIconButton = isIconButton;
|
|
49
50
|
function isNavLinkButton(trigger) {
|
|
50
51
|
return trigger && typeof trigger === "object" && "navLabel" in trigger;
|
|
51
52
|
}
|
|
52
|
-
exports.isNavLinkButton = isNavLinkButton;
|
|
53
53
|
function labelOr(trigger, fallback) {
|
|
54
54
|
return typeof trigger.label === "string" ? trigger.label : fallback;
|
|
55
55
|
}
|
|
56
|
-
exports.labelOr = labelOr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Popover =
|
|
3
|
+
exports.Popover = Popover;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_aria_1 = require("react-aria");
|
|
6
6
|
/** Popover is used for generating menus and list-boxes */
|
|
@@ -26,6 +26,5 @@ 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
|
-
exports.Popover = Popover;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.testTabs = void 0;
|
|
4
|
+
exports.TestTabContent = TestTabContent;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
exports.testTabs = [
|
|
6
7
|
{ name: "Tab 1", value: "tab1", render: () => (0, jsx_runtime_1.jsx)(TestTabContent, { content: "Tab 1 Content" }) },
|
|
@@ -11,4 +12,3 @@ exports.testTabs = [
|
|
|
11
12
|
function TestTabContent({ content }) {
|
|
12
13
|
return (0, jsx_runtime_1.jsx)("div", { children: content });
|
|
13
14
|
}
|
|
14
|
-
exports.TestTabContent = TestTabContent;
|