asma-ui-core 3.44.0 → 3.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +2 -2
- package/dist/components/custom/module/module-title/StyledModuleTitle.module.js +1 -1
- package/dist/components/custom/widget/widget/StyledWidget.module.js +8 -8
- package/dist/components/custom/widget/widget-title/StyledWidgetTitle.module.js +1 -1
- package/dist/components/data-display/ai-disclosure/StyledAIDisclosure.js +7 -5
- package/dist/components/data-display/badge/StyledBadge.js +53 -23
- package/dist/components/data-display/chip/StyledChip.js +62 -59
- package/dist/components/data-display/chip/chipPadding.js +44 -0
- package/dist/components/data-display/form-label/components/StyledFormLabel.js +18 -10
- package/dist/components/data-display/form-label/styles/StyledFormLabel.module.js +4 -4
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +35 -39
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.module.js +4 -0
- package/dist/components/data-display/tooltip/StyledTooltip.js +51 -33
- package/dist/components/data-display/typography/StyledTypography.js +62 -4
- package/dist/components/feedback/dialog/StyledDialog.js +102 -39
- package/dist/components/feedback/dialog/StyledDialog.module.js +2 -9
- package/dist/components/feedback/dialog/StyledDialogActions.js +16 -16
- package/dist/components/feedback/dialog/StyledDialogContent.js +18 -14
- package/dist/components/feedback/dialog/StyledDialogTitle.js +18 -13
- package/dist/components/feedback/empty-page/StyledEmptyPage.js +4 -4
- package/dist/components/feedback/filtered-empty-state/StyledFilteredEmptyState.js +7 -7
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +123 -114
- package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +6 -5
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +13 -12
- package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +15 -13
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +67 -61
- package/dist/components/feedback/snack-bar/StyledAlert.js +95 -14
- package/dist/components/feedback/snack-bar/StyledSnackbar.js +34 -8
- package/dist/components/feedback/snack-bar/components/StyledDefaultSnackbar.js +32 -33
- package/dist/components/feedback/snack-bar/components/StyledDefaultSnackbar.module.js +16 -16
- package/dist/components/icons/check-icon/CheckIcon.js +8 -7
- package/dist/components/inputs/button/StyledButton.js +22 -18
- package/dist/components/inputs/button/StyledButton.module.js +5 -5
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +61 -55
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +12 -11
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +54 -50
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +107 -99
- package/dist/components/inputs/field-styles.js +8 -0
- package/dist/components/inputs/input-field/StyledInputField.js +188 -83
- package/dist/components/inputs/input-field/StyledInputField.module.js +10 -0
- package/dist/components/inputs/label/StyledLabel.js +19 -11
- package/dist/components/inputs/label/StyledLabel.module.js +1 -1
- package/dist/components/inputs/radio-button/base-ui/RadioGroupContext.js +6 -0
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +43 -28
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +7 -6
- package/dist/components/inputs/radio-button/base-ui/StyledRadioGroup.js +37 -24
- package/dist/components/inputs/search-field/StyledSearchField.js +49 -43
- package/dist/components/inputs/select/StyledSelect.js +170 -45
- package/dist/components/inputs/select/StyledSelectItem.js +19 -23
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +228 -150
- package/dist/components/inputs/slider/StyledSlider.js +100 -52
- package/dist/components/inputs/slider/StyledSlider.module.js +10 -0
- package/dist/components/inputs/switch/base-ui/StyledSwitch.js +45 -38
- package/dist/components/inputs/switch/base-ui/StyledSwitch.module.js +4 -4
- package/dist/components/inputs/textarea/StyledTextarea.js +44 -43
- package/dist/components/inputs/textarea/StyledTextarea.module.js +1 -1
- package/dist/components/miscellaneous/FormControlContext.js +6 -0
- package/dist/components/miscellaneous/StyledFormControl.js +42 -21
- package/dist/components/miscellaneous/StyledFormControlLabel.js +29 -15
- package/dist/components/miscellaneous/StyledFormGroup.js +16 -4
- package/dist/components/miscellaneous/StyledFormHelperText.js +12 -4
- package/dist/components/miscellaneous/StyledInputLabel.js +20 -4
- package/dist/components/mui-compat/Avatar.js +34 -0
- package/dist/components/mui-compat/ClickAwayListener.js +42 -0
- package/dist/components/mui-compat/Container.js +24 -0
- package/dist/components/mui-compat/Fade.js +29 -0
- package/dist/components/mui-compat/Fade.module.js +9 -0
- package/dist/components/mui-compat/FormLabel.js +22 -0
- package/dist/components/mui-compat/Paper.js +44 -0
- package/dist/components/mui-compat/Popper.js +35 -0
- package/dist/components/mui-compat/Skeleton.js +27 -0
- package/dist/components/mui-compat/Stack.js +24 -0
- package/dist/components/navigation/drawer/StyledDrawer.js +45 -4
- package/dist/components/navigation/link/StyledLink.module.js +5 -5
- package/dist/components/navigation/listbox/Listbox.js +7 -7
- package/dist/components/navigation/menu/StyledMenu.js +28 -11
- package/dist/components/navigation/menu/StyledMenuItem.js +21 -19
- package/dist/components/navigation/menu/StyledMenuList.js +34 -4
- package/dist/components/navigation/tabs/StyledTab.js +28 -13
- package/dist/components/navigation/tabs/StyledTabs.js +115 -66
- package/dist/components/navigation/tabs/TabsContext.js +6 -0
- package/dist/components/utils/accordion/base-ui/AccordionContext.js +10 -0
- package/dist/components/utils/accordion/base-ui/StyledAccordion.js +28 -21
- package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +7 -7
- package/dist/components/utils/accordion/base-ui/StyledAccordionDetails.js +28 -14
- package/dist/components/utils/accordion/base-ui/StyledAccordionSummary.js +34 -27
- package/dist/components/utils/copy-wrapper/CopyButton.js +8 -7
- package/dist/components/utils/copy-wrapper/CopyWrapper.js +23 -20
- package/dist/components/utils/filter-menu/StyledFilterButton.js +14 -13
- package/dist/components/utils/filter-menu/StyledFilterMenu.js +16 -15
- package/dist/components/utils/popover/StyledPopover.js +51 -15
- package/dist/components/utils/virtual-list/VirtualList.js +46 -0
- package/dist/datetime/components/date-picker/StyledDatePicker.js +17 -17
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +98 -99
- package/dist/datetime/components/date-picker/components/DatePickerButton.js +11 -9
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +11 -11
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.module.js +20 -20
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerCaption.js +8 -7
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerFooter.js +13 -14
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectMonth.js +17 -24
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectYear.js +7 -8
- package/dist/datetime/components/date-picker/components/StyledDayPicker.js +4 -5
- package/dist/datetime/components/date-picker/helpers.js +7 -7
- package/dist/datetime/components/date-picker/hooks/useDatePickerMask.js +3 -7
- package/dist/datetime/components/time-picker/StyledTimePicker.js +25 -25
- package/dist/datetime/components/time-picker/StyledTimePicker.module.js +6 -6
- package/dist/datetime/components/time-picker/TimePickerInput.js +56 -50
- package/dist/datetime/components/time-picker/TimePickerPopper.js +22 -19
- package/dist/datetime/components/time-picker/components/TimePickerColumn.js +12 -12
- package/dist/datetime/components/time-picker/helpers/getTimeFromValue.js +3 -3
- package/dist/datetime/helpers/cn.js +4 -5
- package/dist/datetime/hooks/useWindowWidthSize.hook.js +1 -1
- package/dist/helpers/arrays.js +4 -0
- package/dist/helpers/classOverride.js +12 -0
- package/dist/helpers/cn.js +4 -5
- package/dist/helpers/inputMask.js +58 -0
- package/dist/helpers/sx.js +46 -0
- package/dist/hooks/useFocusTrap.hook.js +34 -0
- package/dist/hooks/useTopLayer.hook.js +25 -0
- package/dist/index.js +185 -175
- package/dist/src/api-surface.test.d.ts +1 -0
- package/dist/src/components/custom/module/header-layout/DynamicToolbar.d.ts +10 -0
- package/dist/src/components/custom/module/module-title/StyledModuleTitle.d.ts +4 -0
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +8 -0
- package/dist/src/components/custom/widget/widget-header/StyledWidgetHeader.d.ts +4 -0
- package/dist/src/components/custom/widget/widget-title/StyledWidgetTitle.d.ts +4 -0
- package/dist/src/components/data-display/ai-disclosure/StyledAIDisclosure.d.ts +7 -0
- package/dist/src/components/data-display/badge/StyledBadge.d.ts +40 -2
- package/dist/src/components/data-display/chip/StyledChip.d.ts +74 -5
- package/dist/src/components/data-display/chip/chipPadding.d.ts +3 -0
- package/dist/src/components/data-display/form-label/types.d.ts +11 -0
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +22 -4
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +43 -1
- package/dist/src/components/data-display/typography/StyledTypography.d.ts +32 -1
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +60 -4
- package/dist/src/components/feedback/dialog/StyledDialogActions.d.ts +12 -2
- package/dist/src/components/feedback/dialog/StyledDialogContent.d.ts +12 -2
- package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +10 -2
- package/dist/src/components/feedback/empty-page/StyledEmptyPage.d.ts +6 -0
- package/dist/src/components/feedback/filtered-empty-state/StyledFilteredEmptyState.d.ts +7 -0
- package/dist/src/components/feedback/loading/StyledLoading.d.ts +9 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +13 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/useControlledProps.d.ts +4 -2
- package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +17 -12
- package/dist/src/components/feedback/snack-bar/SnackbarProvider.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/StyledAlert.d.ts +41 -2
- package/dist/src/components/feedback/snack-bar/StyledAlertSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/StyledSnackbar.d.ts +25 -2
- package/dist/src/components/feedback/snack-bar/components/StyledDefaultSnackbar.d.ts +10 -1
- package/dist/src/components/feedback/snack-bar/components/StyledInfoSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/components/types.d.ts +1 -1
- package/dist/src/components/inputs/button/StyledButton.d.ts +15 -1
- package/dist/src/components/inputs/checkbox/base-ui/StyledCheckbox.d.ts +33 -4
- package/dist/src/components/inputs/dynamic-select/StyledDynamicSelect.d.ts +16 -0
- package/dist/src/components/inputs/dynamic-select/types.d.ts +25 -14
- package/dist/src/components/inputs/field-styles.d.ts +27 -0
- package/dist/src/components/inputs/input-field/StyledInputField.d.ts +85 -10
- package/dist/src/components/inputs/input-field/index.d.ts +1 -1
- package/dist/src/components/inputs/label/StyledLabel.d.ts +13 -0
- package/dist/src/components/inputs/radio-button/base-ui/RadioGroupContext.d.ts +10 -0
- package/dist/src/components/inputs/radio-button/base-ui/StyledRadio.d.ts +60 -5
- package/dist/src/components/inputs/radio-button/base-ui/StyledRadioGroup.d.ts +30 -7
- package/dist/src/components/inputs/search-field/StyledSearchField.d.ts +9 -1
- package/dist/src/components/inputs/select/StyledSelect.d.ts +70 -16
- package/dist/src/components/inputs/select/StyledSelectItem.d.ts +14 -2
- package/dist/src/components/inputs/select/index.d.ts +0 -1
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +120 -17
- package/dist/src/components/inputs/slider/StyledSlider.d.ts +66 -3
- package/dist/src/components/inputs/switch/base-ui/StyledSwitch.d.ts +44 -4
- package/dist/src/components/inputs/textarea/StyledTextarea.d.ts +19 -0
- package/dist/src/components/miscellaneous/FormControlContext.d.ts +14 -0
- package/dist/src/components/miscellaneous/StyledFormControl.d.ts +27 -2
- package/dist/src/components/miscellaneous/StyledFormControlLabel.d.ts +21 -2
- package/dist/src/components/miscellaneous/StyledFormGroup.d.ts +11 -2
- package/dist/src/components/miscellaneous/StyledFormHelperText.d.ts +12 -2
- package/dist/src/components/miscellaneous/StyledInputLabel.d.ts +20 -2
- package/dist/src/components/mui-compat/Avatar.d.ts +6 -0
- package/dist/src/components/mui-compat/ClickAwayListener.d.ts +19 -0
- package/dist/src/components/mui-compat/Container.d.ts +6 -0
- package/dist/src/components/mui-compat/Fade.d.ts +21 -0
- package/dist/src/components/mui-compat/FormLabel.d.ts +6 -0
- package/dist/src/components/mui-compat/Paper.d.ts +6 -0
- package/dist/src/components/mui-compat/Popper.d.ts +29 -0
- package/dist/src/components/mui-compat/Skeleton.d.ts +7 -0
- package/dist/src/components/mui-compat/Stack.d.ts +7 -0
- package/dist/src/components/mui-compat/index.d.ts +9 -0
- package/dist/src/components/mui-compat/types.d.ts +46 -0
- package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +33 -2
- package/dist/src/components/navigation/link/StyledLink.d.ts +13 -0
- package/dist/src/components/navigation/menu/StyledMenu.d.ts +33 -2
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +35 -2
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +16 -2
- package/dist/src/components/navigation/menu/index.d.ts +0 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +27 -3
- package/dist/src/components/navigation/tabs/StyledTabs.d.ts +22 -7
- package/dist/src/components/navigation/tabs/TabsContext.d.ts +11 -0
- package/dist/src/components/utils/accordion/base-ui/AccordionContext.d.ts +10 -0
- package/dist/src/components/utils/accordion/base-ui/StyledAccordion.d.ts +9 -3
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionDetails.d.ts +5 -0
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionSummary.d.ts +16 -4
- package/dist/src/components/utils/copy-wrapper/CopyWrapper.d.ts +6 -1
- package/dist/src/components/utils/filter-menu/StyledFilterButton.d.ts +4 -0
- package/dist/src/components/utils/filter-menu/StyledFilterMenu.d.ts +8 -2
- package/dist/src/components/utils/popover/StyledPopover.d.ts +39 -2
- package/dist/src/components/utils/virtual-list/VirtualList.d.ts +32 -0
- package/dist/src/components/utils/virtual-list/index.d.ts +1 -0
- package/dist/src/datetime/components/date-picker/StyledDatePicker.d.ts +11 -0
- package/dist/src/datetime/components/date-picker/components/DatePickerButton.d.ts +2 -0
- package/dist/src/datetime/components/date-picker/components/StyledCalendarPicker.d.ts +1 -1
- package/dist/src/datetime/components/date-picker/components/StyledDayPicker.d.ts +1 -1
- package/dist/src/datetime/components/date-picker/hooks/useDatePickerMask.d.ts +1 -2
- package/dist/src/datetime/components/date-picker/hooks/useDatePickerValidation.d.ts +7 -5
- package/dist/src/datetime/components/time-picker/StyledTimePicker.d.ts +10 -0
- package/dist/src/datetime/components/time-picker/TimePickerInput.d.ts +1 -1
- package/dist/src/datetime/components/time-picker/TimePickerPopper.d.ts +1 -1
- package/dist/src/datetime/components/time-picker/types.d.ts +1 -2
- package/dist/src/datetime/hooks/useToggleMenuVisibility.hook.d.ts +6 -4
- package/dist/src/datetime/shared-components/StyledFormControl.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledInputField.d.ts +1 -12
- package/dist/src/datetime/shared-components/StyledSelect.d.ts +1 -16
- package/dist/src/datetime/shared-components/StyledSelectItem.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledTooltip.d.ts +1 -2
- package/dist/src/helpers/applyImportantPadding.d.ts +8 -0
- package/dist/src/helpers/arrays.d.ts +2 -0
- package/dist/src/helpers/arrays.test.d.ts +1 -0
- package/dist/src/helpers/classOverride.d.ts +21 -0
- package/dist/src/helpers/classOverride.test.d.ts +1 -0
- package/dist/src/helpers/inputMask.d.ts +40 -0
- package/dist/src/helpers/inputMask.test.d.ts +1 -0
- package/dist/src/helpers/sx.d.ts +2 -0
- package/dist/src/helpers/sx.test.d.ts +1 -0
- package/dist/src/hooks/useFocusTrap.hook.d.ts +10 -0
- package/dist/src/hooks/useTopLayer.hook.d.ts +49 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/table/components/columns/helpers/useElementHeightPx.d.ts +6 -3
- package/dist/src/table/components/columns/helpers/useProxyHorizontalScrollSync.d.ts +9 -6
- package/dist/src/table/hooks/useToggleMenuVisibility.hook.d.ts +6 -4
- package/dist/src/table/hooks/useTranslations.d.ts +15 -8
- package/dist/src/table/shared-components/StyledCheckbox.d.ts +7 -4
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +18 -2
- package/dist/src/table/shared-components/menu-item/index.d.ts +13 -2
- package/dist/src/table/shared-components/tooltip/index.d.ts +5 -1
- package/dist/src/table/types.d.ts +1 -1
- package/dist/table/components/Fetching.js +4 -4
- package/dist/table/components/StyledTable.module.js +48 -48
- package/dist/table/components/TableRow.js +7 -7
- package/dist/table/components/TableSkeleton.js +6 -6
- package/dist/table/components/columns/action-column/actionColumn.js +14 -11
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +52 -49
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +40 -36
- package/dist/table/components/columns/expandColumn.js +12 -9
- package/dist/table/components/table-footer/TablePagination.js +28 -25
- package/dist/table/components/table-footer/TableRowCountSelect.js +31 -28
- package/dist/table/components/table-header/TableHeaderCell.js +54 -45
- package/dist/table/custom-features/focus-rows/FocusRowsFeature.js +29 -25
- package/dist/table/helpers/cn.js +4 -5
- package/dist/table/hooks/useColumnVirtualizer.js +1 -1
- package/dist/table/hooks/usePersistedPageSize.js +6 -6
- package/dist/table/hooks/useTranslations.js +6 -4
- package/dist/table/hooks/useWindowWidthSize.hook.js +1 -1
- package/dist/table/shared-components/StyledCheckbox.js +54 -55
- package/dist/table/shared-components/StyledCheckbox.module.js +9 -9
- package/dist/table/shared-components/StyledMenuItem.js +14 -17
- package/dist/table/shared-components/button/StyledButton.module.js +8 -8
- package/dist/table/shared-components/menu-item/index.js +15 -16
- package/dist/table/shared-components/tooltip/index.js +4 -23
- package/package.json +9 -18
- package/src/styles/components-colors/inputVariables.css +59 -57
- package/src/styles/index.css +38 -0
- package/dist/components/feedback/dialog/StyledDialogActions.module.js +0 -8
- package/dist/components/feedback/dialog/StyledDialogContent.module.js +0 -4
- package/dist/components/feedback/dialog/StyledDialogTitle.module.js +0 -4
- package/dist/components/icons/arrow-expand/ArrowExpand.js +0 -18
- package/dist/components/icons/arrow-expand/index.js +0 -1
- package/dist/components/icons/arrow-shrink/ArrowShrink.js +0 -18
- package/dist/components/icons/arrow-shrink/index.js +0 -1
- package/dist/components/inputs/checkbox/StyledCheckbox.js +0 -20
- package/dist/components/inputs/radio-button/StyledRadio.js +0 -17
- package/dist/datetime/components/date-picker/components/HelperTextWithTooltip.js +0 -39
- package/dist/datetime/shared-components/ExpandIcon.js +0 -18
- package/dist/datetime/shared-components/StyledFormControl.js +0 -23
- package/dist/datetime/shared-components/StyledInputField.js +0 -47
- package/dist/datetime/shared-components/StyledSelect.js +0 -47
- package/dist/datetime/shared-components/StyledSelectItem.js +0 -13
- package/dist/datetime/shared-components/StyledTooltip.js +0 -32
- package/dist/src/components/icons/arrow-expand/ArrowExpand.d.ts +0 -2
- package/dist/src/components/icons/arrow-expand/index.d.ts +0 -1
- package/dist/src/components/icons/arrow-shrink/ArrowShrink.d.ts +0 -2
- package/dist/src/components/icons/arrow-shrink/index.d.ts +0 -1
- package/dist/src/components/inputs/checkbox/StyledCheckbox.d.ts +0 -4
- package/dist/src/components/inputs/radio-button/StyledRadio.d.ts +0 -4
- package/dist/src/components/inputs/radio-button/StyledRadioGroup.d.ts +0 -4
- package/dist/src/components/inputs/switch/StyledSwitch.d.ts +0 -5
- package/dist/src/components/utils/accordion/StyledAccordion.d.ts +0 -2
- package/dist/src/components/utils/accordion/StyledAccordionDetails.d.ts +0 -2
- package/dist/src/components/utils/accordion/StyledAccordionSummary.d.ts +0 -8
- package/dist/src/datetime/components/date-picker/components/HelperTextWithTooltip.d.ts +0 -5
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
mask: " / / ",
|
|
4
|
-
replacement: { " ": /\d/ },
|
|
5
|
-
showMask: !0
|
|
6
|
-
}) });
|
|
1
|
+
import { DATE_INPUT_MASK as e, useInputMask as r } from "../../../../helpers/inputMask.js";
|
|
2
|
+
var s = () => ({ maskRef: r(e) });
|
|
7
3
|
export {
|
|
8
|
-
|
|
4
|
+
s as useDatePickerMask
|
|
9
5
|
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PopupState as j } from "../../../hooks/usePopupState.js";
|
|
2
|
+
import { ClickAwayListener as D } from "../../../components/mui-compat/ClickAwayListener.js";
|
|
3
|
+
import { TimePickerPopper as E } from "./TimePickerPopper.js";
|
|
4
|
+
import { getTimeFromValue as P } from "./helpers/getTimeFromValue.js";
|
|
3
5
|
import { TimePickerInput as T } from "./TimePickerInput.js";
|
|
4
6
|
import { useState as h } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var J = (i) => {
|
|
10
|
-
const { value: a, onSelect: l, notBeforeTime: m } = i, V = a ? v(a, "HH:mm") : "", [x, s] = h(V), [w, t] = h(!1), [g, n] = h(!0), c = w ? x : V, u = (e) => !e || !m || !B(m) || !A(e, m), k = c.length === 5 ? H(c, a) : null, y = k ? u(k) : !0, P = (e) => {
|
|
7
|
+
import { jsx as o, jsxs as A } from "react/jsx-runtime";
|
|
8
|
+
import { format as v, isBefore as B, isValid as N } from "date-fns";
|
|
9
|
+
var J = (l) => {
|
|
10
|
+
const { value: a, onSelect: i, notBeforeTime: m } = l, V = a ? v(a, "HH:mm") : "", [x, s] = h(V), [w, t] = h(!1), [g, n] = h(!0), c = w ? x : V, u = (e) => !e || !m || !N(m) || !B(e, m), k = c.length === 5 ? P(c, a) : null, y = k ? u(k) : !0, C = (e) => {
|
|
11
11
|
const r = e.close;
|
|
12
12
|
r?.();
|
|
13
|
-
},
|
|
13
|
+
}, H = (e, r) => {
|
|
14
14
|
const d = e.target.value;
|
|
15
15
|
if (t(!0), s(d), d.length !== 5) {
|
|
16
16
|
n(!1);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const f =
|
|
19
|
+
const f = P(d, a);
|
|
20
20
|
if (!f) {
|
|
21
|
-
|
|
21
|
+
i(void 0), n(!1);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
n(!0), u(f) ? (
|
|
24
|
+
n(!0), u(f) ? (i(f), t(!1), C(r)) : i(void 0);
|
|
25
25
|
}, I = (e) => {
|
|
26
26
|
if (n(!0), u(e)) {
|
|
27
|
-
|
|
27
|
+
i(e), s(e ? v(e, "HH:mm") : ""), t(!1);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
i(void 0), s(e ? v(e, "HH:mm") : ""), t(!0);
|
|
31
31
|
}, L = () => {
|
|
32
|
-
|
|
32
|
+
i(void 0), s(""), t(!1), n(!0);
|
|
33
33
|
};
|
|
34
|
-
return /* @__PURE__ */ o(
|
|
34
|
+
return /* @__PURE__ */ o(j, {
|
|
35
35
|
variant: "popper",
|
|
36
36
|
popupId: "time-picker-popper",
|
|
37
|
-
children: (e) =>
|
|
38
|
-
...
|
|
37
|
+
children: (e) => l.disabled || l.readOnly ? /* @__PURE__ */ o(T, {
|
|
38
|
+
...l,
|
|
39
39
|
popupState: e,
|
|
40
40
|
localValue: c,
|
|
41
41
|
isValidTime: g,
|
|
42
42
|
isValidEndTime: y,
|
|
43
|
-
handleChange: (r) =>
|
|
43
|
+
handleChange: (r) => H(r, e)
|
|
44
44
|
}) : /* @__PURE__ */ o(D, {
|
|
45
45
|
mouseEvent: "onMouseDown",
|
|
46
|
-
onClickAway: () =>
|
|
47
|
-
children: /* @__PURE__ */
|
|
46
|
+
onClickAway: () => C(e),
|
|
47
|
+
children: /* @__PURE__ */ A("div", {
|
|
48
48
|
className: "relative h-auto w-auto",
|
|
49
49
|
children: [/* @__PURE__ */ o("div", {
|
|
50
50
|
className: "m-0 flex h-fit items-center justify-center p-0",
|
|
51
51
|
children: /* @__PURE__ */ o(T, {
|
|
52
|
-
...
|
|
52
|
+
...l,
|
|
53
53
|
popupState: e,
|
|
54
54
|
localValue: c,
|
|
55
55
|
isValidTime: g,
|
|
56
56
|
isValidEndTime: y,
|
|
57
|
-
handleChange: (r) =>
|
|
57
|
+
handleChange: (r) => H(r, e)
|
|
58
58
|
})
|
|
59
|
-
}), e.isOpen && /* @__PURE__ */ o(
|
|
60
|
-
...
|
|
59
|
+
}), e.isOpen && /* @__PURE__ */ o(E, {
|
|
60
|
+
...l,
|
|
61
61
|
popupState: e,
|
|
62
62
|
handleClear: L,
|
|
63
63
|
onSelect: (r) => I(r)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
"styled-time-picker-root": "_styled-time-picker-
|
|
3
|
-
"styled-time-picker-root_column": "_styled-time-picker-
|
|
4
|
-
"styled-time-picker-root_cell": "_styled-time-picker-
|
|
5
|
-
"styled-time-picker-root_cell__cell-now": "_styled-time-picker-root_cell__cell-
|
|
6
|
-
"styled-time-picker-root_cell__cell-selected": "_styled-time-picker-root_cell__cell-
|
|
7
|
-
"
|
|
2
|
+
"styled-time-picker-root": "_styled-time-picker-root_ck82a_1",
|
|
3
|
+
"styled-time-picker-root_column": "_styled-time-picker-root_column_ck82a_4",
|
|
4
|
+
"styled-time-picker-root_cell": "_styled-time-picker-root_cell_ck82a_7",
|
|
5
|
+
"styled-time-picker-root_cell__cell-now": "_styled-time-picker-root_cell__cell-now_ck82a_10",
|
|
6
|
+
"styled-time-picker-root_cell__cell-selected": "_styled-time-picker-root_cell__cell-selected_ck82a_13",
|
|
7
|
+
"time-picker-surface": "_time-picker-surface_ck82a_17"
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
10
|
e as default
|
|
@@ -1,66 +1,72 @@
|
|
|
1
|
-
import { StyledInputField as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { placeholder: f, disabled: r, inputClassName: h, dataTest: n, width: i, error: u, helperText: x, label: T, locale: k = "en", popupState: l, handleChange: C, isValidTime: s, isValidEndTime: p, localValue: b, title: m, readOnly: e } = c, g = M({
|
|
1
|
+
import { StyledInputField as E } from "../../../components/inputs/input-field/StyledInputField.js";
|
|
2
|
+
import { useInputMask as I } from "../../../helpers/inputMask.js";
|
|
3
|
+
import { HelperText as N } from "./components/HelperText.js";
|
|
4
|
+
import { ClockOutlineIcon as w } from "../../shared-components/ClockOutlineIcon.js";
|
|
5
|
+
import { useEffect as y, useRef as R } from "react";
|
|
6
|
+
import { jsx as r, jsxs as v } from "react/jsx-runtime";
|
|
7
|
+
var H = (x) => {
|
|
8
|
+
const { placeholder: c, disabled: e, inputClassName: f, dataTest: s, width: l, error: h, helperText: u, label: T, locale: g = "en", popupState: a, handleChange: k, isValidTime: p, isValidEndTime: m, localValue: C, title: d, readOnly: t } = x, b = I({
|
|
10
9
|
mask: "xx:xx",
|
|
11
|
-
|
|
10
|
+
maskChar: "x",
|
|
12
11
|
showMask: !1
|
|
13
|
-
}),
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
}, []), /* @__PURE__ */
|
|
17
|
-
style: { height:
|
|
18
|
-
children: [
|
|
12
|
+
}), i = !p || !m || !!h, n = R(null);
|
|
13
|
+
return y(() => {
|
|
14
|
+
n.current && a.setAnchorEl(n.current);
|
|
15
|
+
}, []), /* @__PURE__ */ v("div", {
|
|
16
|
+
style: { height: t ? "40px" : "75px" },
|
|
17
|
+
children: [d && /* @__PURE__ */ r("div", {
|
|
19
18
|
className: "pb-1 font-roboto font-semibold text-delta-800",
|
|
20
|
-
children:
|
|
21
|
-
}), /* @__PURE__ */
|
|
22
|
-
inputRef:
|
|
19
|
+
children: d
|
|
20
|
+
}), /* @__PURE__ */ r(E, {
|
|
21
|
+
inputRef: b,
|
|
23
22
|
autoComplete: "off",
|
|
24
23
|
type: "text",
|
|
25
|
-
dataTest:
|
|
26
|
-
"data-testid":
|
|
27
|
-
placeholder:
|
|
24
|
+
dataTest: s,
|
|
25
|
+
"data-testid": s,
|
|
26
|
+
placeholder: c,
|
|
28
27
|
size: "small",
|
|
29
|
-
error:
|
|
30
|
-
helperText: /* @__PURE__ */
|
|
31
|
-
isValidTime:
|
|
32
|
-
isValidEndTime:
|
|
33
|
-
error:
|
|
34
|
-
localization:
|
|
35
|
-
helperText:
|
|
28
|
+
error: i,
|
|
29
|
+
helperText: /* @__PURE__ */ r(N, {
|
|
30
|
+
isValidTime: p,
|
|
31
|
+
isValidEndTime: m,
|
|
32
|
+
error: i,
|
|
33
|
+
localization: g,
|
|
34
|
+
helperText: u
|
|
36
35
|
}),
|
|
37
|
-
onChange:
|
|
38
|
-
slotProps: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
onChange: k,
|
|
37
|
+
slotProps: {
|
|
38
|
+
input: {
|
|
39
|
+
ref: n,
|
|
40
|
+
onMouseDown: (o) => {
|
|
41
|
+
!e && !t && a.open(o);
|
|
42
|
+
},
|
|
43
|
+
endAdornment: /* @__PURE__ */ r(w, {
|
|
44
|
+
width: 24,
|
|
45
|
+
height: 24,
|
|
46
|
+
className: e ? "text-delta-300" : "text-delta-700",
|
|
47
|
+
onClick: (o) => {
|
|
48
|
+
o.stopPropagation(), !e && !t && a.open(o);
|
|
49
|
+
}
|
|
50
|
+
})
|
|
42
51
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
} },
|
|
51
|
-
value: b,
|
|
52
|
+
formHelperText: {
|
|
53
|
+
className: i ? "ml-0 mr-[14px] mt-1 leading-[23.24px]" : "mx-[14px] mt-1 leading-[23.24px]",
|
|
54
|
+
hideErrorIcon: !0
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
value: C,
|
|
52
58
|
sx: {
|
|
53
|
-
maxWidth:
|
|
54
|
-
width:
|
|
55
|
-
minWidth:
|
|
59
|
+
maxWidth: l ?? 130,
|
|
60
|
+
width: l,
|
|
61
|
+
minWidth: l
|
|
56
62
|
},
|
|
57
|
-
disabled:
|
|
58
|
-
readOnly:
|
|
59
|
-
className:
|
|
63
|
+
disabled: e,
|
|
64
|
+
readOnly: t,
|
|
65
|
+
className: f,
|
|
60
66
|
label: T
|
|
61
67
|
})]
|
|
62
68
|
});
|
|
63
69
|
};
|
|
64
70
|
export {
|
|
65
|
-
|
|
71
|
+
H as TimePickerInput
|
|
66
72
|
};
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { StyledButton as r } from "../../shared-components/button/StyledButton.js";
|
|
2
|
-
import s from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
2
|
+
import { bindPopper as s } from "../../../hooks/usePopupState.js";
|
|
3
|
+
import { Paper as l } from "../../../components/mui-compat/Paper.js";
|
|
4
|
+
import { Fade as c } from "../../../components/mui-compat/Fade.js";
|
|
5
|
+
import { Popper as f } from "../../../components/mui-compat/Popper.js";
|
|
6
|
+
import h from "./StyledTimePicker.module.js";
|
|
7
|
+
import { TimePickerBody as u } from "./components/TimePickerBody.js";
|
|
8
|
+
import { EraserIcon as x } from "../../shared-components/EraserIcon.js";
|
|
9
|
+
import { CheckIcon as k } from "../../shared-components/CheckIcon.js";
|
|
10
|
+
import y from "clsx";
|
|
8
11
|
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
...y(e),
|
|
14
|
-
className: f(s["shadow-mui"]),
|
|
12
|
+
var I = (m) => {
|
|
13
|
+
const { popupState: e, dataTest: a, value: i, onSelect: n, handleClear: p } = m;
|
|
14
|
+
return /* @__PURE__ */ t(f, {
|
|
15
|
+
...s(e),
|
|
15
16
|
transition: !0,
|
|
16
17
|
style: {
|
|
17
18
|
zIndex: "1300",
|
|
18
19
|
position: "absolute"
|
|
19
20
|
},
|
|
20
|
-
children: ({ TransitionProps: d }) => /* @__PURE__ */ t(
|
|
21
|
+
children: ({ TransitionProps: d }) => /* @__PURE__ */ t(c, {
|
|
21
22
|
...d,
|
|
22
23
|
timeout: 350,
|
|
23
|
-
children: /* @__PURE__ */ o(
|
|
24
|
+
children: /* @__PURE__ */ o(l, {
|
|
25
|
+
elevation: 0,
|
|
26
|
+
className: y(h["time-picker-surface"]),
|
|
24
27
|
style: { paddingBottom: "1px" },
|
|
25
|
-
children: [/* @__PURE__ */ t(
|
|
26
|
-
dataTest: `${
|
|
28
|
+
children: [/* @__PURE__ */ t(u, {
|
|
29
|
+
dataTest: `${a}-time-picker-body`,
|
|
27
30
|
value: i,
|
|
28
31
|
onSelect: n
|
|
29
32
|
}), /* @__PURE__ */ o("div", {
|
|
@@ -44,7 +47,7 @@ var j = (a) => {
|
|
|
44
47
|
minWidth: "40px",
|
|
45
48
|
marginLeft: "10px"
|
|
46
49
|
},
|
|
47
|
-
children: /* @__PURE__ */ t(
|
|
50
|
+
children: /* @__PURE__ */ t(x, {
|
|
48
51
|
width: 24,
|
|
49
52
|
height: 24
|
|
50
53
|
})
|
|
@@ -58,7 +61,7 @@ var j = (a) => {
|
|
|
58
61
|
minWidth: "40px",
|
|
59
62
|
marginRight: "16px"
|
|
60
63
|
},
|
|
61
|
-
children: /* @__PURE__ */ t(
|
|
64
|
+
children: /* @__PURE__ */ t(k, {
|
|
62
65
|
width: 20,
|
|
63
66
|
height: 20
|
|
64
67
|
})
|
|
@@ -69,5 +72,5 @@ var j = (a) => {
|
|
|
69
72
|
});
|
|
70
73
|
};
|
|
71
74
|
export {
|
|
72
|
-
|
|
75
|
+
I as TimePickerPopper
|
|
73
76
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import r from "../StyledTimePicker.module.js";
|
|
2
2
|
import _ from "clsx";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { getHours as a, getMinutes as k, set as
|
|
5
|
-
var
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */
|
|
3
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
4
|
+
import { getHours as a, getMinutes as k, set as y } from "date-fns";
|
|
5
|
+
var b = ({ type: l, value: o, onSelect: n }) => {
|
|
6
|
+
const s = /* @__PURE__ */ new Date(), t = l === "hours", m = t ? 24 : 12, u = t ? s.getHours() : s.getMinutes();
|
|
7
|
+
return /* @__PURE__ */ c("div", {
|
|
8
8
|
className: r["styled-time-picker-root_column"],
|
|
9
|
-
children: new Array(m).fill(null).map((
|
|
10
|
-
const e = t ?
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
className: _(r["styled-time-picker-root_cell"], p && r["styled-time-picker-root_cell__cell-now"],
|
|
9
|
+
children: new Array(m).fill(null).map((f, i) => {
|
|
10
|
+
const e = t ? i : i * 5, d = o && e === (t ? a(o) : k(o)), p = u == e;
|
|
11
|
+
return /* @__PURE__ */ c("button", {
|
|
12
|
+
type: "button",
|
|
13
|
+
className: _("border-0", r["styled-time-picker-root_cell"], p && r["styled-time-picker-root_cell__cell-now"], d && r["styled-time-picker-root_cell__cell-selected"]),
|
|
14
14
|
onClick: () => {
|
|
15
|
-
n(
|
|
15
|
+
n(y(o ?? /* @__PURE__ */ new Date(), t ? { hours: e } : { minutes: e }));
|
|
16
16
|
},
|
|
17
17
|
children: e.toString().padStart(2, "0")
|
|
18
18
|
}, e);
|
|
@@ -20,5 +20,5 @@ var x = ({ type: c, value: o, onSelect: n }) => {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
b as TimePickerColumn
|
|
24
24
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var u = (
|
|
2
|
-
const t =
|
|
1
|
+
var u = (s, o) => {
|
|
2
|
+
const t = s.split(":"), e = Number(t[0]), n = Number(t[1]);
|
|
3
3
|
if (t[0]?.length == 2 && t[1]?.length == 2 && e >= 0 && e <= 23 && n >= 0 && n <= 59) {
|
|
4
|
-
const r =
|
|
4
|
+
const r = o ?? /* @__PURE__ */ new Date();
|
|
5
5
|
return r.setHours(e), r.setMinutes(n), r;
|
|
6
6
|
}
|
|
7
7
|
return null;
|
|
@@ -3,7 +3,7 @@ function o() {
|
|
|
3
3
|
const [e, n] = t(window.innerWidth), i = () => {
|
|
4
4
|
n(window.innerWidth);
|
|
5
5
|
};
|
|
6
|
-
return r(() => (
|
|
6
|
+
return r(() => (window.addEventListener("resize", i), () => window.removeEventListener("resize", i)), []), e;
|
|
7
7
|
}
|
|
8
8
|
var w = (e) => e ? e <= 768 : window.innerWidth < 768;
|
|
9
9
|
function s() {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var n = {
|
|
2
|
+
padding: /(?:^|\s)!?p[xytrblse]?-/,
|
|
3
|
+
"padding-x": /(?:^|\s)!?p[xlrse]?-/,
|
|
4
|
+
"padding-y": /(?:^|\s)!?p[ytb]?-/,
|
|
5
|
+
margin: /(?:^|\s)!?-?m[xytrblse]?-/,
|
|
6
|
+
width: /(?:^|\s)!?w-/,
|
|
7
|
+
"max-width": /(?:^|\s)!?max-w-/,
|
|
8
|
+
display: /(?:^|\s)!?(?:block|inline-block|inline-flex|inline|flex|grid|contents|hidden|table)(?:\s|$)/
|
|
9
|
+
}, s = (i, e) => !!i && n[e].test(i);
|
|
10
|
+
export {
|
|
11
|
+
s as consumerOverrides
|
|
12
|
+
};
|
package/dist/helpers/cn.js
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useCallback as k, useRef as I } from "react";
|
|
2
|
+
var T = {
|
|
3
|
+
mask: " / / ",
|
|
4
|
+
maskChar: " ",
|
|
5
|
+
showMask: !0
|
|
6
|
+
}, E = "monospace", g = (n, a, v) => {
|
|
7
|
+
const { mask: l, maskChar: t, showMask: u } = v, p = [...l].filter((o) => o === t).length, r = n.replace(/\D/g, "").slice(0, p);
|
|
8
|
+
if (r.length === 0) return {
|
|
9
|
+
value: "",
|
|
10
|
+
caret: 0
|
|
11
|
+
};
|
|
12
|
+
const c = Math.min(n.slice(0, a).replace(/\D/g, "").length, r.length);
|
|
13
|
+
let e = "", i = 0, s = 0, f = "";
|
|
14
|
+
for (const o of l) {
|
|
15
|
+
if (o !== t) {
|
|
16
|
+
u ? e += o : f += o;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (s < r.length)
|
|
20
|
+
u || (e += f, f = ""), e += r[s], s += 1, s === c && (i = e.length);
|
|
21
|
+
else if (u) e += t;
|
|
22
|
+
else break;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
value: e,
|
|
26
|
+
caret: i
|
|
27
|
+
};
|
|
28
|
+
}, d = typeof HTMLInputElement < "u" ? Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set : void 0, h = (n, a) => {
|
|
29
|
+
d ? d.call(n, a) : n.value = a;
|
|
30
|
+
}, L = ({ mask: n, maskChar: a, showMask: v }) => {
|
|
31
|
+
const l = I(null);
|
|
32
|
+
return k((t) => {
|
|
33
|
+
if (l.current?.(), l.current = null, !t) return;
|
|
34
|
+
const u = {
|
|
35
|
+
mask: n,
|
|
36
|
+
maskChar: a,
|
|
37
|
+
showMask: v
|
|
38
|
+
};
|
|
39
|
+
(() => {
|
|
40
|
+
const { value: c, caret: e } = g(t.value, t.selectionStart ?? t.value.length, u);
|
|
41
|
+
t.value !== c && h(t, c), t.setSelectionRange(e, e);
|
|
42
|
+
})();
|
|
43
|
+
const r = (c) => {
|
|
44
|
+
const e = c.target, { value: i, caret: s } = g(e.value, e.selectionStart ?? e.value.length, u);
|
|
45
|
+
e.value !== i && h(e, i), e.setSelectionRange(s, s);
|
|
46
|
+
};
|
|
47
|
+
t.addEventListener("input", r), l.current = () => t.removeEventListener("input", r);
|
|
48
|
+
}, [
|
|
49
|
+
n,
|
|
50
|
+
a,
|
|
51
|
+
v
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
E as DATE_INPUT_FONT_FAMILY,
|
|
56
|
+
T as DATE_INPUT_MASK,
|
|
57
|
+
L as useInputMask
|
|
58
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var p = 8, d = {
|
|
2
|
+
m: ["margin"],
|
|
3
|
+
mt: ["marginTop"],
|
|
4
|
+
mr: ["marginRight"],
|
|
5
|
+
mb: ["marginBottom"],
|
|
6
|
+
ml: ["marginLeft"],
|
|
7
|
+
mx: ["marginLeft", "marginRight"],
|
|
8
|
+
my: ["marginTop", "marginBottom"],
|
|
9
|
+
p: ["padding"],
|
|
10
|
+
pt: ["paddingTop"],
|
|
11
|
+
pr: ["paddingRight"],
|
|
12
|
+
pb: ["paddingBottom"],
|
|
13
|
+
pl: ["paddingLeft"],
|
|
14
|
+
px: ["paddingLeft", "paddingRight"],
|
|
15
|
+
py: ["paddingTop", "paddingBottom"]
|
|
16
|
+
}, g = { bgcolor: "backgroundColor" }, c = (e) => {
|
|
17
|
+
if (typeof e == "number") return e * p;
|
|
18
|
+
if (typeof e == "string") return e;
|
|
19
|
+
}, f = (e, r) => {
|
|
20
|
+
for (const [o, n] of Object.entries(r)) {
|
|
21
|
+
if (n == null) continue;
|
|
22
|
+
if (o.includes("&") || o.startsWith(":") || typeof n == "object") {
|
|
23
|
+
console.warn(`resolveSx: unsupported nested/responsive sx key "${o}" dropped — use className instead.`);
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const t = d[o];
|
|
27
|
+
if (t) {
|
|
28
|
+
const i = c(n);
|
|
29
|
+
if (i !== void 0) for (const s of t) Object.assign(e, { [s]: i });
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const a = g[o];
|
|
33
|
+
Object.assign(e, { [a ?? o]: n });
|
|
34
|
+
}
|
|
35
|
+
}, m = (e) => {
|
|
36
|
+
const r = {};
|
|
37
|
+
if (!e) return r;
|
|
38
|
+
if (typeof e == "function")
|
|
39
|
+
return console.warn("resolveSx: theme-callback sx is not supported and was ignored — use className instead."), r;
|
|
40
|
+
const o = Array.isArray(e) ? e : [e];
|
|
41
|
+
for (const n of o) n && typeof n == "object" && f(r, n);
|
|
42
|
+
return r;
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
m as resolveSx
|
|
46
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useEffect as m } from "react";
|
|
2
|
+
var l = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])', E = (o, s, c) => {
|
|
3
|
+
m(() => {
|
|
4
|
+
if (!o) return;
|
|
5
|
+
const t = s.current;
|
|
6
|
+
if (!t) return;
|
|
7
|
+
const r = document.activeElement, d = requestAnimationFrame(() => {
|
|
8
|
+
(t.querySelector(l) ?? t).focus();
|
|
9
|
+
}), u = (e) => {
|
|
10
|
+
if (e.key === "Escape") {
|
|
11
|
+
c?.();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (e.key !== "Tab") return;
|
|
15
|
+
const n = Array.from(t.querySelectorAll(l));
|
|
16
|
+
if (n.length === 0) {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const i = n[0], a = n[n.length - 1], f = document.activeElement;
|
|
21
|
+
e.shiftKey && f === i ? (e.preventDefault(), a?.focus()) : !e.shiftKey && f === a && (e.preventDefault(), i?.focus());
|
|
22
|
+
};
|
|
23
|
+
return document.addEventListener("keydown", u), () => {
|
|
24
|
+
cancelAnimationFrame(d), document.removeEventListener("keydown", u), r && document.contains(r) && r.focus();
|
|
25
|
+
};
|
|
26
|
+
}, [
|
|
27
|
+
o,
|
|
28
|
+
s,
|
|
29
|
+
c
|
|
30
|
+
]);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
E as useFocusTrap
|
|
34
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useCallback as r } from "react";
|
|
2
|
+
var n = { popover: "manual" }, a = {
|
|
3
|
+
margin: 0,
|
|
4
|
+
inset: "auto"
|
|
5
|
+
};
|
|
6
|
+
function i(e) {
|
|
7
|
+
if (!(e instanceof Element)) return;
|
|
8
|
+
const o = e.closest("dialog");
|
|
9
|
+
return o instanceof HTMLDialogElement && o.open ? o : void 0;
|
|
10
|
+
}
|
|
11
|
+
function p(e) {
|
|
12
|
+
return r((o) => {
|
|
13
|
+
if (e(o), !!o)
|
|
14
|
+
try {
|
|
15
|
+
typeof o.showPopover == "function" && !o.matches(":popover-open") && o.showPopover();
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
}, [e]);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
n as TOP_LAYER_PROPS,
|
|
22
|
+
a as TOP_LAYER_RESET_STYLE,
|
|
23
|
+
i as getOpenModalDialogAncestor,
|
|
24
|
+
p as useTopLayerRef
|
|
25
|
+
};
|