@homebound/beam 2.369.3 → 2.369.4
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 +1 -2
- 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
package/dist/hooks/useFilter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFilter =
|
|
3
|
+
exports.useFilter = useFilter;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
function useFilter({ filterDefs }) {
|
|
@@ -9,4 +9,3 @@ function useFilter({ filterDefs }) {
|
|
|
9
9
|
.map(([key, def]) => [key, def(key).defaultValue])));
|
|
10
10
|
return { setFilter, filter };
|
|
11
11
|
}
|
|
12
|
-
exports.useFilter = useFilter;
|
package/dist/hooks/useGroupBy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGroupBy =
|
|
3
|
+
exports.useGroupBy = useGroupBy;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const useQueryState_1 = require("./useQueryState");
|
|
6
6
|
const index_1 = require("../utils/index");
|
|
@@ -11,4 +11,3 @@ function useGroupBy(opts) {
|
|
|
11
11
|
const [value, setValue] = (0, useQueryState_1.useQueryState)("groupBy", options[0].id);
|
|
12
12
|
return { value, setValue, options };
|
|
13
13
|
}
|
|
14
|
-
exports.useGroupBy = useGroupBy;
|
package/dist/hooks/useHover.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useHover =
|
|
3
|
+
exports.useHover = useHover;
|
|
4
4
|
const react_aria_1 = require("react-aria");
|
|
5
5
|
// Handles hover pointer interactions for an element.
|
|
6
6
|
function useHover(props) {
|
|
7
7
|
const { disabled: isDisabled, ...others } = props;
|
|
8
8
|
return (0, react_aria_1.useHover)({ isDisabled, ...others });
|
|
9
9
|
}
|
|
10
|
-
exports.useHover = useHover;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePersistedFilter =
|
|
3
|
+
exports.usePersistedFilter = usePersistedFilter;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const hooks_1 = require("./");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
@@ -18,7 +18,7 @@ function usePersistedFilter({ storageKey, filterDefs }) {
|
|
|
18
18
|
const [{ filter: queryParamsFilter }, setQueryParams] = (0, use_query_params_1.useQueryParams)({ filter: use_query_params_1.JsonParam });
|
|
19
19
|
const [storedFilter, setStoredFilter] = (0, hooks_1.useSessionStorage)(storageKey, queryParamsFilter !== null && queryParamsFilter !== void 0 ? queryParamsFilter : defaultFilter);
|
|
20
20
|
const isQueryParamFilterValid = hasValidFilterKeys(queryParamsFilter, filterKeys);
|
|
21
|
-
const filter = isQueryParamFilterValid ? queryParamsFilter : storedFilter !== null && storedFilter !== void 0 ? storedFilter : defaultFilter;
|
|
21
|
+
const filter = isQueryParamFilterValid ? queryParamsFilter : (storedFilter !== null && storedFilter !== void 0 ? storedFilter : defaultFilter);
|
|
22
22
|
const setFilter = (filter) => setQueryParams({ filter });
|
|
23
23
|
(0, react_1.useEffect)(() => {
|
|
24
24
|
if (queryParamsFilter === undefined) {
|
|
@@ -42,7 +42,6 @@ function usePersistedFilter({ storageKey, filterDefs }) {
|
|
|
42
42
|
[storedFilter, setStoredFilter, setQueryParams, queryParamsFilter]);
|
|
43
43
|
return { setFilter, filter };
|
|
44
44
|
}
|
|
45
|
-
exports.usePersistedFilter = usePersistedFilter;
|
|
46
45
|
// check for valid filter keys in the query params
|
|
47
46
|
function hasValidFilterKeys(queryParamsFilter, definedKeys) {
|
|
48
47
|
return queryParamsFilter && (0, utils_1.safeKeys)(queryParamsFilter).every((key) => definedKeys.includes(key));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useQueryState =
|
|
3
|
+
exports.useQueryState = useQueryState;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const use_query_params_1 = require("use-query-params");
|
|
6
6
|
/**
|
|
@@ -17,4 +17,3 @@ function useQueryState(name, initialValue) {
|
|
|
17
17
|
const setValue = (0, react_1.useCallback)((value) => setParams({ [name]: value }, "pushIn"), [name, setParams]);
|
|
18
18
|
return [value, setValue];
|
|
19
19
|
}
|
|
20
|
-
exports.useQueryState = useQueryState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useRenderCount =
|
|
3
|
+
exports.useRenderCount = useRenderCount;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
/**
|
|
6
6
|
* A hook to add `data-render=${count}` to an element.
|
|
@@ -25,4 +25,3 @@ function useRenderCount() {
|
|
|
25
25
|
}, []);
|
|
26
26
|
return { getCount };
|
|
27
27
|
}
|
|
28
|
-
exports.useRenderCount = useRenderCount;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSessionStorage =
|
|
3
|
+
exports.useSessionStorage = useSessionStorage;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
function useSessionStorage(key, defaultValue) {
|
|
6
6
|
let hasSessionStorage = false;
|
|
@@ -29,7 +29,6 @@ function useSessionStorage(key, defaultValue) {
|
|
|
29
29
|
}, [hasSessionStorage, key]);
|
|
30
30
|
return [state, setAndSave];
|
|
31
31
|
}
|
|
32
|
-
exports.useSessionStorage = useSessionStorage;
|
|
33
32
|
function getParsedStorage(key) {
|
|
34
33
|
try {
|
|
35
34
|
const storedString = sessionStorage.getItem(key);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Autocomplete =
|
|
3
|
+
exports.Autocomplete = Autocomplete;
|
|
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");
|
|
@@ -65,4 +65,3 @@ function Autocomplete(props) {
|
|
|
65
65
|
// Respect if caller to passes in `startAdornment={undefined}`
|
|
66
66
|
startAdornment: "startAdornment" in props ? props.startAdornment : (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "search" }), ...others }), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, { triggerRef: inputRef, popoverRef: popoverRef, positionProps: positionProps, onClose: () => state.close(), isOpen: state.isOpen, minWidth: 200, children: (0, jsx_runtime_1.jsx)(ListBox_1.ListBox, { ...listBoxProps, positionProps: positionProps, state: state, listBoxRef: listBoxRef, getOptionValue: (o) => (0, Value_1.valueToKey)(getOptionValue(o)), getOptionLabel: getOptionLabel, disabledOptionsWithReasons: disabledOptionsWithReasons }) }))] }));
|
|
67
67
|
}
|
|
68
|
-
exports.Autocomplete = Autocomplete;
|
package/dist/inputs/Checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Checkbox =
|
|
3
|
+
exports.Checkbox = Checkbox;
|
|
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");
|
|
@@ -18,4 +18,3 @@ function Checkbox(props) {
|
|
|
18
18
|
const { inputProps } = (0, react_aria_1.useCheckbox)(checkboxProps, toggleState, ref);
|
|
19
19
|
return ((0, jsx_runtime_1.jsx)(CheckboxBase_1.CheckboxBase, { ariaProps: ariaProps, isDisabled: isDisabled, isIndeterminate: isIndeterminate, isSelected: isSelected, inputProps: inputProps, label: label, ...otherProps }));
|
|
20
20
|
}
|
|
21
|
-
exports.Checkbox = Checkbox;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CheckboxBase = CheckboxBase;
|
|
4
|
+
exports.StyledCheckbox = StyledCheckbox;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const react_aria_1 = require("react-aria");
|
|
@@ -27,7 +28,6 @@ function CheckboxBase(props) {
|
|
|
27
28
|
// Not using align-items: center as the checkbox would align with all content below, where we really want it to stay only aligned with the label
|
|
28
29
|
(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
30
|
}
|
|
30
|
-
exports.CheckboxBase = CheckboxBase;
|
|
31
31
|
const baseStyles = Css_1.Css.hPx(16).mw((0, Css_1.px)(16)).relative.ba.bcGray300.br4.bgWhite.transition.$;
|
|
32
32
|
const filledBoxStyles = Css_1.Css.bcBlue700.bgBlue700.$;
|
|
33
33
|
const filledBoxHoverStyles = Css_1.Css.bgBlue900.$;
|
|
@@ -55,6 +55,5 @@ function StyledCheckbox(props) {
|
|
|
55
55
|
...markStyles,
|
|
56
56
|
}, "aria-hidden": "true", "data-checked": isSelected ? true : isIndeterminate ? "mixed" : false, ...tid.checkbox, children: markIcon }));
|
|
57
57
|
}
|
|
58
|
-
exports.StyledCheckbox = StyledCheckbox;
|
|
59
58
|
const checkmarkSmall = ((0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", children: (0, jsx_runtime_1.jsx)("path", { d: "M6.66669 10.3907L4.47135 8.19533L3.52869 9.138L6.66669 12.276L13.138 5.80467L12.1954 4.862L6.66669 10.3907Z", fill: Css_1.Palette.White }) }));
|
|
60
59
|
const dashSmall = ((0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", children: (0, jsx_runtime_1.jsx)("rect", { x: "4", y: "7.5", width: "8", height: "1.35", fill: Css_1.Palette.White }) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckboxGroup =
|
|
3
|
+
exports.CheckboxGroup = CheckboxGroup;
|
|
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");
|
|
@@ -21,7 +21,6 @@ function CheckboxGroup(props) {
|
|
|
21
21
|
const tid = (0, utils_1.useTestIds)(props);
|
|
22
22
|
return ((0, jsx_runtime_1.jsxs)("div", { ...groupProps, css: Css_1.Css.if(labelStyle === "left").df.fdr.$, onBlur: onBlur, onFocus: onFocus, ...tid, children: [labelStyle !== "hidden" && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.if(labelStyle === "left").w50.$, children: (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, ...labelProps, ...tid.label }) })), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.dg.gtc(`repeat(${columns}, auto)`).gap2.$, children: options.map((option) => ((0, jsx_runtime_1.jsx)(CheckboxGroupItem, { ...option, groupState: state, selected: state.value.includes(option.value) }, option.value))) }), 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 })] }));
|
|
23
23
|
}
|
|
24
|
-
exports.CheckboxGroup = CheckboxGroup;
|
|
25
24
|
function CheckboxGroupItem(props) {
|
|
26
25
|
const { label, indeterminate: isIndeterminate = false, disabled: isDisabled = false, description, selected: isSelected, groupState, value = "", ...otherProps } = props;
|
|
27
26
|
const ariaProps = { isSelected, isDisabled, isIndeterminate, value, ...otherProps };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.persistentItemPrefix = void 0;
|
|
4
|
+
exports.ChipSelectField = ChipSelectField;
|
|
5
|
+
exports.isPersistentItem = isPersistentItem;
|
|
6
|
+
exports.isPersistentKey = isPersistentKey;
|
|
7
|
+
exports.isListBoxSection = isListBoxSection;
|
|
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");
|
|
@@ -178,7 +182,6 @@ function ChipSelectField(props) {
|
|
|
178
182
|
}, "aria-label": "Remove", ...tid.clearButton, children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "x", inc: typeScale === "xs" ? 2 : undefined }) }))] })),
|
|
179
183
|
}), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, { triggerRef: buttonRef, popoverRef: popoverRef, positionProps: overlayProps, onClose: state.close, isOpen: state.isOpen, shouldCloseOnBlur: true, children: (0, jsx_runtime_1.jsx)(ListBox_1.ListBox, { ...menuProps, listBoxRef: listBoxRef, state: state, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, positionProps: overlayProps }) }))] }));
|
|
180
184
|
}
|
|
181
|
-
exports.ChipSelectField = ChipSelectField;
|
|
182
185
|
exports.persistentItemPrefix = "persistentItem:";
|
|
183
186
|
const createNewOpt = {
|
|
184
187
|
id: `${exports.persistentItemPrefix}createNew`,
|
|
@@ -187,15 +190,12 @@ const createNewOpt = {
|
|
|
187
190
|
function isPersistentItem(opt) {
|
|
188
191
|
return typeof opt === "object" && "id" in opt && isPersistentKey(opt.id);
|
|
189
192
|
}
|
|
190
|
-
exports.isPersistentItem = isPersistentItem;
|
|
191
193
|
function isPersistentKey(key) {
|
|
192
194
|
return typeof key === "string" && key.startsWith(exports.persistentItemPrefix);
|
|
193
195
|
}
|
|
194
|
-
exports.isPersistentKey = isPersistentKey;
|
|
195
196
|
function isListBoxSection(obj) {
|
|
196
197
|
return obj && typeof obj === "object" && "options" in obj;
|
|
197
198
|
}
|
|
198
|
-
exports.isListBoxSection = isListBoxSection;
|
|
199
199
|
// Wrapper for the ChipTextField used in the "Create New" flow on ChipSelectField
|
|
200
200
|
function CreateNewField(props) {
|
|
201
201
|
const { onBlur, onEnter } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChipTextField =
|
|
3
|
+
exports.ChipTextField = ChipTextField;
|
|
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");
|
|
@@ -64,4 +64,3 @@ function ChipTextField(props) {
|
|
|
64
64
|
...(isFocused ? Css_1.Css.bshFocus.$ : {}),
|
|
65
65
|
}, ...tid, children: valueRef.current }));
|
|
66
66
|
}
|
|
67
|
-
exports.ChipTextField = ChipTextField;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateField =
|
|
3
|
+
exports.DateField = DateField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const DateFieldBase_1 = require("./DateFieldBase");
|
|
6
6
|
function DateField(props) {
|
|
7
7
|
return (0, jsx_runtime_1.jsx)(DateFieldBase_1.DateFieldBase, { ...props, mode: "single" });
|
|
8
8
|
}
|
|
9
|
-
exports.DateField = DateField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateField =
|
|
3
|
+
exports.DateField = DateField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const date_fns_1 = require("date-fns");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -16,4 +16,3 @@ function DateField(props) {
|
|
|
16
16
|
onChange((0, date_fns_1.parse)(value, "MM/dd/yy", new Date()));
|
|
17
17
|
}, onBlur: () => (0, utils_1.maybeCall)(onBlur), onFocus: () => (0, utils_1.maybeCall)(onFocus), disabled: !!props.disabled, readOnly: !!props.readOnly, "data-disabled-days": JSON.stringify(props.disabledDays) }));
|
|
18
18
|
}
|
|
19
|
-
exports.DateField = DateField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateFieldBase =
|
|
3
|
+
exports.DateFieldBase = DateFieldBase;
|
|
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");
|
|
@@ -151,7 +151,7 @@ function DateFieldBase(props) {
|
|
|
151
151
|
} })) }));
|
|
152
152
|
const calendarButton = ((0, jsx_runtime_1.jsx)("button", { ref: buttonRef, ...buttonProps, disabled: isDisabled, css: Css_1.Css.if(isDisabled).cursorNotAllowed.$, ...tid.calendarButton, children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "calendar", color: isDisabled ? Css_1.Palette.Gray400 : Css_1.Palette.Gray700 }) }));
|
|
153
153
|
const EndFieldButtons = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRangeFilterField && clearButton, !hideCalendarIcon && calendarButton] }));
|
|
154
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { ...textFieldProps,
|
|
154
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { ...textFieldProps, internalProps: { forceFocus: state.isOpen }, errorMsg: errorMsg, helperText: helperText, required: required, labelProps: labelProps, inputProps: { ...inputProps, size: inputSize, onClick: state.open }, inputRef: inputRef, inputWrapRef: inputWrapRef, onChange: (v) => {
|
|
155
155
|
// hide the calendar if the user is manually entering the date
|
|
156
156
|
state.close();
|
|
157
157
|
if (v) {
|
|
@@ -176,7 +176,6 @@ function DateFieldBase(props) {
|
|
|
176
176
|
onChange(d);
|
|
177
177
|
}, useYearPicker: useYearPicker, ...tid.datePicker })) }) }) }))] }));
|
|
178
178
|
}
|
|
179
|
-
exports.DateFieldBase = DateFieldBase;
|
|
180
179
|
function isParsedDateValid(d) {
|
|
181
180
|
// Only consider a DateRange valid when both `from` and `to` values are valid dates
|
|
182
181
|
return d !== undefined && (!(0, react_day_picker_1.isDateRange)(d) || ((0, react_day_picker_1.isDateRange)(d) && (0, utils_1.isValidDate)(d.from) && (0, utils_1.isValidDate)(d.to)));
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateRangeField =
|
|
3
|
+
exports.DateRangeField = DateRangeField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const DateFieldBase_1 = require("./DateFieldBase");
|
|
6
6
|
function DateRangeField(props) {
|
|
7
7
|
return (0, jsx_runtime_1.jsx)(DateFieldBase_1.DateFieldBase, { ...props, mode: "range" });
|
|
8
8
|
}
|
|
9
|
-
exports.DateRangeField = DateRangeField;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.dateFormats = void 0;
|
|
4
|
+
exports.getDateFormat = getDateFormat;
|
|
5
|
+
exports.formatDate = formatDate;
|
|
6
|
+
exports.formatDateRange = formatDateRange;
|
|
7
|
+
exports.parseDate = parseDate;
|
|
8
|
+
exports.parseDateRange = parseDateRange;
|
|
9
|
+
exports.isValidDate = isValidDate;
|
|
4
10
|
const date_fns_1 = require("date-fns");
|
|
5
11
|
exports.dateFormats = {
|
|
6
12
|
short: "MM/dd/yy",
|
|
@@ -10,13 +16,11 @@ exports.dateFormats = {
|
|
|
10
16
|
function getDateFormat(format) {
|
|
11
17
|
return format ? exports.dateFormats[format] : exports.dateFormats.short;
|
|
12
18
|
}
|
|
13
|
-
exports.getDateFormat = getDateFormat;
|
|
14
19
|
function formatDate(date, format) {
|
|
15
20
|
if (!date)
|
|
16
21
|
return "";
|
|
17
22
|
return (0, date_fns_1.format)(date, format);
|
|
18
23
|
}
|
|
19
|
-
exports.formatDate = formatDate;
|
|
20
24
|
function formatDateRange(date, format) {
|
|
21
25
|
if (!date)
|
|
22
26
|
return "";
|
|
@@ -26,11 +30,9 @@ function formatDateRange(date, format) {
|
|
|
26
30
|
// return `undefined` if both dates are improperly formatted
|
|
27
31
|
return !fromFormatted && !toFormatted ? undefined : `${fromFormatted} - ${toFormatted}`;
|
|
28
32
|
}
|
|
29
|
-
exports.formatDateRange = formatDateRange;
|
|
30
33
|
function parseDate(str, format) {
|
|
31
34
|
return parseDateString(str, format);
|
|
32
35
|
}
|
|
33
|
-
exports.parseDate = parseDate;
|
|
34
36
|
function parseDateRange(str, format) {
|
|
35
37
|
const [from = "", to = ""] = str.split("-");
|
|
36
38
|
const fromDate = parseDateString(from.trim(), format);
|
|
@@ -45,7 +47,6 @@ function parseDateRange(str, format) {
|
|
|
45
47
|
}
|
|
46
48
|
return { from: fromDate, to: toDate };
|
|
47
49
|
}
|
|
48
|
-
exports.parseDateRange = parseDateRange;
|
|
49
50
|
function parseDateString(str, format) {
|
|
50
51
|
// Copy/pasted from react-day-picker so that typing "2/2/2" doesn't turn into "02/02/0002"
|
|
51
52
|
const split = str.split("/");
|
|
@@ -79,4 +80,3 @@ function parseDateString(str, format) {
|
|
|
79
80
|
function isValidDate(d) {
|
|
80
81
|
return d !== undefined && (0, date_fns_1.isDate)(d) && d.toString() !== "Invalid Date";
|
|
81
82
|
}
|
|
82
|
-
exports.isValidDate = isValidDate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorMessage =
|
|
3
|
+
exports.ErrorMessage = ErrorMessage;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_aria_1 = require("react-aria");
|
|
6
6
|
const components_1 = require("../components");
|
|
@@ -15,4 +15,3 @@ function ErrorMessage(props) {
|
|
|
15
15
|
const errorEl = errorMsg ? ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.red600.sm.df.mtPx(4).if(contrast).red400.$, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.$, children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "error" }) }), (0, jsx_runtime_1.jsx)("span", { id: id, css: Css_1.Css.ml1.mtPx(2).$, ...others, children: errorMsg })] })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}));
|
|
16
16
|
return hidden ? (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: errorEl }) : errorEl;
|
|
17
17
|
}
|
|
18
|
-
exports.ErrorMessage = ErrorMessage;
|
package/dist/inputs/IconCard.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.iconCardStylesHover = exports.selectedStyles =
|
|
3
|
+
exports.iconCardStylesHover = exports.selectedStyles = void 0;
|
|
4
|
+
exports.IconCard = IconCard;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const react_aria_1 = require("react-aria");
|
|
@@ -31,7 +32,6 @@ function IconCard(props) {
|
|
|
31
32
|
children: ((0, jsx_runtime_1.jsxs)("button", { css: styles, ...hoverProps, onClick: toggleState.toggle, disabled: isDisabled, ...tid, children: [(0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...inputProps, ...tid.value }) }), (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: icon, inc: 4, color: isDisabled ? Css_1.Palette.Gray300 : Css_1.Palette.Gray900 }), (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.xsMd.if(isDisabled).gray300.$, children: label })] })),
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
exports.IconCard = IconCard;
|
|
35
35
|
const baseStyles = Css_1.Css.df.fdc.aic.jcc.wPx(130).hPx(114).ba.br8.bcGray300.bgWhite.gap("12px").p2.tac.$;
|
|
36
36
|
exports.selectedStyles = Css_1.Css.bw2.bcBlue500.bgBlue50.$;
|
|
37
37
|
const disabledStyles = Css_1.Css.bcGray200.bgGray50.$;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IconCardGroup =
|
|
3
|
+
exports.IconCardGroup = IconCardGroup;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
6
|
+
const react_aria_1 = require("react-aria");
|
|
7
|
+
const HelperText_1 = require("../components/HelperText");
|
|
7
8
|
const Label_1 = require("../components/Label");
|
|
8
9
|
const PresentationContext_1 = require("../components/PresentationContext");
|
|
9
|
-
const
|
|
10
|
+
const Css_1 = require("../Css");
|
|
10
11
|
const IconCard_1 = require("./IconCard");
|
|
11
|
-
const
|
|
12
|
+
const utils_1 = require("../utils");
|
|
12
13
|
const ErrorMessage_1 = require("./ErrorMessage");
|
|
13
|
-
const react_aria_1 = require("react-aria");
|
|
14
14
|
function IconCardGroup(props) {
|
|
15
15
|
var _a;
|
|
16
16
|
const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
|
|
@@ -53,4 +53,3 @@ function IconCardGroup(props) {
|
|
|
53
53
|
return ((0, jsx_runtime_1.jsx)(IconCard_1.IconCard, { icon: icon, label: label, selected: isSelected, disabled: disabled, onChange: () => toggleValue(option.value), ...tid[option.label] }, option.label));
|
|
54
54
|
}) }), 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 })] }));
|
|
55
55
|
}
|
|
56
|
-
exports.IconCardGroup = IconCardGroup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MultiLineSelectField =
|
|
3
|
+
exports.MultiLineSelectField = MultiLineSelectField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Button_1 = require("../components/Button");
|
|
@@ -27,4 +27,3 @@ function MultiLineSelectField(props) {
|
|
|
27
27
|
setIsDisplayed(false);
|
|
28
28
|
}, options: currentOptions, disabled: otherProps.disabled }) })), (0, jsx_runtime_1.jsx)(Button_1.Button, { ...tid.addAnother, label: "Add Another", variant: "tertiary", onClick: () => setIsDisplayed(true), disabled: isDisplayed || currentOptions.length === 0 })] })] }));
|
|
29
29
|
}
|
|
30
|
-
exports.MultiLineSelectField = MultiLineSelectField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MultiSelectField =
|
|
3
|
+
exports.MultiSelectField = MultiSelectField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const ComboBoxBase_1 = require("./internal/ComboBoxBase");
|
|
6
6
|
function MultiSelectField(props) {
|
|
@@ -9,4 +9,3 @@ function MultiSelectField(props) {
|
|
|
9
9
|
...otherProps } = props;
|
|
10
10
|
return (0, jsx_runtime_1.jsx)(ComboBoxBase_1.ComboBoxBase, { multiselect: true, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, ...otherProps });
|
|
11
11
|
}
|
|
12
|
-
exports.MultiSelectField = MultiSelectField;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NumberField = NumberField;
|
|
4
|
+
exports.formatValue = formatValue;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
const number_1 = require("@internationalized/number");
|
|
6
7
|
const react_1 = require("react");
|
|
@@ -97,7 +98,6 @@ function NumberField(props) {
|
|
|
97
98
|
onChange(formatValue(parsedValue, factor, numFractionDigits, numIntegerDigits, positiveOnly));
|
|
98
99
|
}, inputRef: inputRef, onBlur: onBlur, onFocus: onFocus, errorMsg: errorMsg, helperText: helperText, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly), ...otherProps }));
|
|
99
100
|
}
|
|
100
|
-
exports.NumberField = NumberField;
|
|
101
101
|
function formatValue(value, factor, numFractionDigits, numIntegerDigits, positiveOnly = false) {
|
|
102
102
|
// We treat percents & cents as (mostly) integers, while useNumberField wants decimals, so
|
|
103
103
|
// undo that via `* factor` and `Math.round`, but also keep any specifically-requested `numFractionDigits`,
|
|
@@ -118,4 +118,3 @@ function formatValue(value, factor, numFractionDigits, numIntegerDigits, positiv
|
|
|
118
118
|
.slice(-1 * numIntegerDigits));
|
|
119
119
|
return (trimmedInteger + fractionalValue) * maybeNegate;
|
|
120
120
|
}
|
|
121
|
-
exports.formatValue = formatValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.radioDisabled = exports.radioHover = exports.radioFocus = exports.radioChecked = exports.radioUnchecked = exports.radioDefault = exports.radioReset =
|
|
3
|
+
exports.radioDisabled = exports.radioHover = exports.radioFocus = exports.radioChecked = exports.radioUnchecked = exports.radioDefault = exports.radioReset = void 0;
|
|
4
|
+
exports.RadioGroupField = RadioGroupField;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const react_aria_1 = require("react-aria");
|
|
@@ -46,7 +47,6 @@ function RadioGroupField(props) {
|
|
|
46
47
|
}) }, option.value));
|
|
47
48
|
}), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { errorMsg: errorMsg, ...tid.errorMsg }), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText })] })] }));
|
|
48
49
|
}
|
|
49
|
-
exports.RadioGroupField = RadioGroupField;
|
|
50
50
|
// Not meant to be standalone, but its own component so it can use hooks
|
|
51
51
|
function Radio(props) {
|
|
52
52
|
const { parentId, option: { description, label, value }, state, ...others } = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { PresentationFieldProps } from "../components/PresentationContext";
|
|
1
2
|
import "tributejs/dist/tribute.css";
|
|
2
3
|
import "trix/dist/trix";
|
|
3
4
|
import "trix/dist/trix.css";
|
|
4
|
-
import { PresentationFieldProps } from "../components/PresentationContext";
|
|
5
5
|
export interface RichTextFieldProps extends Pick<PresentationFieldProps, "fullWidth"> {
|
|
6
6
|
/** The initial html value to show in the trix editor. */
|
|
7
7
|
value: string | undefined;
|
|
@@ -3,19 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RichTextField =
|
|
6
|
+
exports.RichTextField = RichTextField;
|
|
7
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const dompurify_1 = __importDefault(require("dompurify"));
|
|
10
10
|
const react_2 = require("react");
|
|
11
11
|
const Label_1 = require("../components/Label");
|
|
12
|
+
const PresentationContext_1 = require("../components/PresentationContext");
|
|
12
13
|
const Css_1 = require("../Css");
|
|
13
14
|
const utils_1 = require("../utils");
|
|
14
15
|
const tributejs_1 = __importDefault(require("tributejs"));
|
|
15
16
|
require("tributejs/dist/tribute.css");
|
|
16
17
|
require("trix/dist/trix");
|
|
17
18
|
require("trix/dist/trix.css");
|
|
18
|
-
const PresentationContext_1 = require("../components/PresentationContext");
|
|
19
19
|
/**
|
|
20
20
|
* Provides a simple rich text editor based on trix.
|
|
21
21
|
*
|
|
@@ -111,7 +111,6 @@ function RichTextField(props) {
|
|
|
111
111
|
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w100.if(!fullWidth).maxw("550px").$, children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mh("120px").bgWhite.sm.gray900.bn.p1.br4.bcGray300.ba.$, dangerouslySetInnerHTML: { __html: dompurify_1.default.sanitize(value) || placeholder || "" }, "data-readonly": "true" })] }));
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
exports.RichTextField = RichTextField;
|
|
115
114
|
function attachTributeJs(mergeTags, editorElement) {
|
|
116
115
|
const values = mergeTags.map((value) => ({ value }));
|
|
117
116
|
const tribute = new tributejs_1.default({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RichTextField =
|
|
3
|
+
exports.RichTextField = RichTextField;
|
|
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");
|
|
@@ -16,7 +16,6 @@ function RichTextField(props) {
|
|
|
16
16
|
props.onChange(value, value, props.mergeTags || []);
|
|
17
17
|
}, onBlur: onBlur, onFocus: onFocus, readOnly: readOnly, ...tid }));
|
|
18
18
|
}
|
|
19
|
-
exports.RichTextField = RichTextField;
|
|
20
19
|
function defaultTestId(label) {
|
|
21
20
|
return (0, change_case_1.camelCase)(label);
|
|
22
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SelectField =
|
|
3
|
+
exports.SelectField = SelectField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const ComboBoxBase_1 = require("./internal/ComboBoxBase");
|
|
@@ -16,4 +16,3 @@ function SelectField(props) {
|
|
|
16
16
|
}
|
|
17
17
|
} }));
|
|
18
18
|
}
|
|
19
|
-
exports.SelectField = SelectField;
|
package/dist/inputs/Switch.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.switchSelectedHoverStyles = exports.switchFocusStyles = exports.switchHoverStyles =
|
|
3
|
+
exports.switchSelectedHoverStyles = exports.switchFocusStyles = exports.switchHoverStyles = void 0;
|
|
4
|
+
exports.Switch = Switch;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const react_aria_1 = require("react-aria");
|
|
7
8
|
const components_1 = require("../components");
|
|
8
9
|
const Label_1 = require("../components/Label");
|
|
10
|
+
const PresentationContext_1 = require("../components/PresentationContext");
|
|
9
11
|
const Css_1 = require("../Css");
|
|
10
12
|
const Icon_1 = require("../components/Icon");
|
|
11
13
|
const utils_1 = require("../utils");
|
|
12
|
-
const PresentationContext_1 = require("../components/PresentationContext");
|
|
13
14
|
function Switch(props) {
|
|
14
15
|
const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
|
|
15
16
|
const { labelLeftFieldWidth = "50%" } = fieldProps !== null && fieldProps !== void 0 ? fieldProps : {};
|
|
@@ -44,7 +45,6 @@ function Switch(props) {
|
|
|
44
45
|
...(isSelected && switchCircleSelectedStyles(compact)),
|
|
45
46
|
}, children: withIcon && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: isSelected ? "check" : "x", color: isSelected ? Css_1.Palette.Blue700 : Css_1.Palette.Gray400 })) }) }) }), labelStyle === "inline" && ((0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, tooltip: tooltip, inline: true, xss: Css_1.Css.smMd.gray900.if(compact).add("lineHeight", "1").$ })), (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...inputProps, ...focusProps, ...tid }) })] }));
|
|
46
47
|
}
|
|
47
|
-
exports.Switch = Switch;
|
|
48
48
|
/** Styles */
|
|
49
49
|
// Element sizes
|
|
50
50
|
const toggleHeight = (isCompact) => (isCompact ? 16 : 24);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwitchGroup =
|
|
3
|
+
exports.SwitchGroup = SwitchGroup;
|
|
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");
|
|
@@ -21,4 +21,3 @@ function SwitchGroup(props) {
|
|
|
21
21
|
const { isSelected, addValue, removeValue } = groupState;
|
|
22
22
|
return ((0, jsx_runtime_1.jsxs)("fieldset", { ...groupProps, children: [(0, jsx_runtime_1.jsx)("legend", { ...labelProps, css: Css_1.Css.sm.gray500.mb1.$, children: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.fdc.gap2.$, children: options.map(({ label, value }) => ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { compact: compact, label: label, onChange: (isSelected) => (isSelected ? addValue(value) : removeValue(value)), selected: isSelected(value), withIcon: withIcon }, value))) })] }));
|
|
23
23
|
}
|
|
24
|
-
exports.SwitchGroup = SwitchGroup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TextAreaField =
|
|
3
|
+
exports.TextAreaField = TextAreaField;
|
|
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");
|
|
@@ -41,4 +41,3 @@ function TextAreaField(props) {
|
|
|
41
41
|
}, inputRef);
|
|
42
42
|
return ((0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { ...(0, react_aria_1.mergeProps)(otherProps, { onBlur, onFocus }), multiline: true, labelProps: labelProps, inputProps: inputProps, inputRef: inputRef, inputWrapRef: inputWrapRef, textAreaMinHeight: preventNewLines ? 0 : undefined, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly) }));
|
|
43
43
|
}
|
|
44
|
-
exports.TextAreaField = TextAreaField;
|
package/dist/inputs/TextField.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TextField =
|
|
3
|
+
exports.TextField = TextField;
|
|
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");
|
|
@@ -42,4 +42,3 @@ function TextField(props) {
|
|
|
42
42
|
}
|
|
43
43
|
return ((0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { ...(0, react_aria_1.mergeProps)(textFieldProps, { onBlur, onFocus }), errorMsg: errorMsg, required: required, labelProps: labelProps, inputProps: inputProps, inputRef: inputRef, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly), hideErrorMessage: hideErrorMessage }));
|
|
44
44
|
}
|
|
45
|
-
exports.TextField = TextField;
|