@mage-ui/components 1.0.17 → 1.0.19
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/components/buttons/button/Button.d.mts +2 -2
- package/dist/components/buttons/button-action/ButtonAction.d.mts +5 -4
- package/dist/components/buttons/button-action/ButtonAction.d.mts.map +1 -1
- package/dist/components/buttons/button-action/ButtonAction.mjs +1 -1
- package/dist/components/buttons/button-action/ButtonAction.mjs.map +1 -1
- package/dist/components/buttons/button-action/ButtonActionContext.mjs +2 -0
- package/dist/components/buttons/button-action/ButtonActionContext.mjs.map +1 -0
- package/dist/components/buttons/button-action/ButtonLoader.d.mts +11 -0
- package/dist/components/buttons/button-action/ButtonLoader.d.mts.map +1 -0
- package/dist/components/buttons/button-action/ButtonLoader.mjs +2 -0
- package/dist/components/buttons/button-action/ButtonLoader.mjs.map +1 -0
- package/dist/components/buttons/button-icon/ButtonIcon.d.mts +2 -2
- package/dist/components/buttons/button-icon/ButtonIcon.mjs.map +1 -1
- package/dist/components/buttons/button-icon-visual/ButtonIconVisual.d.mts +2 -2
- package/dist/components/buttons/button-visual/ButtonVisual.d.mts +2 -2
- package/dist/components/buttons/index.d.mts +1 -0
- package/dist/components/controls/autocomplete/Autocomplete.d.mts +2 -2
- package/dist/components/controls/autocomplete/Autocomplete.d.mts.map +1 -1
- package/dist/components/controls/autocomplete/Autocomplete.mjs +1 -1
- package/dist/components/controls/autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/components/controls/checkbox/Checkbox.d.mts +2 -14
- package/dist/components/controls/checkbox/Checkbox.d.mts.map +1 -1
- package/dist/components/controls/checkbox/Checkbox.mjs +1 -1
- package/dist/components/controls/checkbox/Checkbox.mjs.map +1 -1
- package/dist/components/controls/checkbox-group/CheckboxGroup.mjs.map +1 -1
- package/dist/components/controls/combobox/Combobox.d.mts +2 -2
- package/dist/components/controls/combobox/Combobox.d.mts.map +1 -1
- package/dist/components/controls/combobox/Combobox.mjs.map +1 -1
- package/dist/components/controls/date-picker/DatePicker.d.mts.map +1 -1
- package/dist/components/controls/date-picker/DatePicker.mjs.map +1 -1
- package/dist/components/controls/dropdown/Dropdown.d.mts.map +1 -1
- package/dist/components/controls/dropdown/Dropdown.mjs.map +1 -1
- package/dist/components/controls/dropzone/Dropzone.d.mts +2 -2
- package/dist/components/controls/dropzone/Dropzone.d.mts.map +1 -1
- package/dist/components/controls/dropzone/Dropzone.mjs.map +1 -1
- package/dist/components/controls/dropzone/use-dropzone-state.mjs.map +1 -1
- package/dist/components/controls/dropzone-files/DropzoneFiles.d.mts +3 -6
- package/dist/components/controls/dropzone-files/DropzoneFiles.d.mts.map +1 -1
- package/dist/components/controls/dropzone-files/DropzoneFiles.mjs +1 -1
- package/dist/components/controls/dropzone-files/DropzoneFiles.mjs.map +1 -1
- package/dist/components/controls/file-input/BaseFileInput.d.mts.map +1 -1
- package/dist/components/controls/file-input/BaseFileInput.mjs.map +1 -1
- package/dist/components/controls/file-input/FileInput.d.mts +2 -2
- package/dist/components/controls/file-input/FileInput.mjs.map +1 -1
- package/dist/components/controls/file-input/FileInputMultiple.d.mts +2 -2
- package/dist/components/controls/file-input/FileInputMultiple.d.mts.map +1 -1
- package/dist/components/controls/file-input/FileInputMultiple.mjs.map +1 -1
- package/dist/components/controls/index.d.mts +15 -13
- package/dist/components/controls/multi-select/MultiSelect.d.mts +2 -2
- package/dist/components/controls/multi-select/MultiSelect.mjs.map +1 -1
- package/dist/components/controls/multi-select/MultiSelectTags.d.mts +2 -2
- package/dist/components/controls/multi-select/MultiSelectTags.mjs +1 -1
- package/dist/components/controls/multi-select/MultiSelectTags.mjs.map +1 -1
- package/dist/components/controls/password-input/PasswordInput.d.mts +8 -26
- package/dist/components/controls/password-input/PasswordInput.d.mts.map +1 -1
- package/dist/components/controls/password-input/PasswordInput.mjs +1 -1
- package/dist/components/controls/password-input/PasswordInput.mjs.map +1 -1
- package/dist/components/controls/password-input/PasswordStrengthInput.d.mts +11 -0
- package/dist/components/controls/password-input/PasswordStrengthInput.d.mts.map +1 -0
- package/dist/components/controls/password-input/PasswordStrengthInput.mjs +2 -0
- package/dist/components/controls/password-input/PasswordStrengthInput.mjs.map +1 -0
- package/dist/components/controls/password-input/usePasswordRules.d.mts +11 -0
- package/dist/components/controls/password-input/usePasswordRules.d.mts.map +1 -0
- package/dist/components/controls/password-input/usePasswordRules.mjs +2 -0
- package/dist/components/controls/password-input/usePasswordRules.mjs.map +1 -0
- package/dist/components/controls/password-input-strength/{PasswordInputStrength.d.mts → oldPasswordInputStrength.d.mts} +4 -4
- package/dist/components/controls/password-input-strength/oldPasswordInputStrength.d.mts.map +1 -0
- package/dist/components/controls/password-input-strength/{PasswordInputStrength.mjs → oldPasswordInputStrength.mjs} +2 -2
- package/dist/components/controls/password-input-strength/oldPasswordInputStrength.mjs.map +1 -0
- package/dist/components/controls/radio/Radio.d.mts.map +1 -1
- package/dist/components/controls/radio/Radio.mjs.map +1 -1
- package/dist/components/controls/radio-group/RadioGroup.mjs.map +1 -1
- package/dist/components/controls/select/Select.d.mts +2 -2
- package/dist/components/controls/select/Select.d.mts.map +1 -1
- package/dist/components/controls/select/Select.mjs.map +1 -1
- package/dist/components/controls/text-input/TextInput.d.mts +3 -16
- package/dist/components/controls/text-input/TextInput.d.mts.map +1 -1
- package/dist/components/controls/text-input/TextInput.mjs +1 -1
- package/dist/components/controls/text-input/TextInput.mjs.map +1 -1
- package/dist/components/controls/textarea/Textarea.d.mts +2 -2
- package/dist/components/controls/utils/chevron/Chevron.d.mts +27 -1
- package/dist/components/controls/utils/chevron/Chevron.d.mts.map +1 -0
- package/dist/components/controls/utils/chevron/Chevron.mjs.map +1 -1
- package/dist/components/controls/utils/clear-button/ClearButton.d.mts +26 -1
- package/dist/components/controls/utils/clear-button/ClearButton.d.mts.map +1 -0
- package/dist/components/controls/utils/clear-button/ClearButton.mjs.map +1 -1
- package/dist/components/controls/utils/index.d.mts +2 -2
- package/dist/components/data-display/assigned-user/AssignedUser.d.mts +37 -0
- package/dist/components/data-display/assigned-user/AssignedUser.d.mts.map +1 -0
- package/dist/components/data-display/assigned-user/AssignedUser.mjs +2 -0
- package/dist/components/data-display/assigned-user/AssignedUser.mjs.map +1 -0
- package/dist/components/data-display/avatar/Avatar.d.mts +2 -2
- package/dist/components/data-display/badge/Badge.d.mts +2 -2
- package/dist/components/data-display/calendar/Calendar.d.mts +4 -4
- package/dist/components/data-display/calendar/Calendar.d.mts.map +1 -1
- package/dist/components/data-display/calendar/Calendar.mjs.map +1 -1
- package/dist/components/data-display/icons/icon/Icon.d.mts +2 -4
- package/dist/components/data-display/icons/icon/Icon.d.mts.map +1 -1
- package/dist/components/data-display/icons/icon/Icon.mjs +1 -1
- package/dist/components/data-display/icons/icon/Icon.mjs.map +1 -1
- package/dist/components/data-display/icons/icon-raw/IconRaw.d.mts.map +1 -1
- package/dist/components/data-display/icons/icon-raw/IconRaw.mjs.map +1 -1
- package/dist/components/data-display/icons/icon-svg/IconSvg.d.mts +24 -0
- package/dist/components/data-display/icons/icon-svg/IconSvg.d.mts.map +1 -0
- package/dist/components/data-display/icons/icon-svg/IconSvg.mjs +2 -0
- package/dist/components/data-display/icons/icon-svg/IconSvg.mjs.map +1 -0
- package/dist/components/data-display/index.d.mts +9 -5
- package/dist/components/data-display/indicator/Indicator.d.mts.map +1 -1
- package/dist/components/data-display/indicator/Indicator.mjs.map +1 -1
- package/dist/components/data-display/loader-dot/LoaderDot.d.mts +2 -2
- package/dist/components/data-display/loader-dot/LoaderDot.d.mts.map +1 -1
- package/dist/components/data-display/loader-dot/LoaderDot.mjs.map +1 -1
- package/dist/components/data-display/loader-oval/LoaderOval.d.mts +2 -2
- package/dist/components/data-display/logos/logo-image/LogoImage.d.mts.map +1 -1
- package/dist/components/data-display/logos/logo-image/LogoImage.mjs.map +1 -1
- package/dist/components/data-display/logos/logo-svg/LogoSvg.d.mts.map +1 -1
- package/dist/components/data-display/logos/logo-svg/LogoSvg.mjs.map +1 -1
- package/dist/components/data-display/removable-item/RemovableItem.d.mts +29 -0
- package/dist/components/data-display/removable-item/RemovableItem.d.mts.map +1 -0
- package/dist/components/data-display/removable-item/RemovableItem.mjs +2 -0
- package/dist/components/data-display/removable-item/RemovableItem.mjs.map +1 -0
- package/dist/components/data-display/tag/Tag.d.mts +3 -3
- package/dist/components/data-display/tag/Tag.mjs.map +1 -1
- package/dist/components/data-display/tag-group/TagGroup.d.mts +2 -2
- package/dist/components/data-display/tag-group/TagGroup.mjs.map +1 -1
- package/dist/components/data-display/uploaded-file/UploadedFile.d.mts +17 -19
- package/dist/components/data-display/uploaded-file/UploadedFile.d.mts.map +1 -1
- package/dist/components/data-display/uploaded-file/UploadedFile.mjs +1 -1
- package/dist/components/data-display/uploaded-file/UploadedFile.mjs.map +1 -1
- package/dist/components/data-display/uploaded-file/UploadedFileDetails.d.mts +23 -0
- package/dist/components/data-display/uploaded-file/UploadedFileDetails.d.mts.map +1 -0
- package/dist/components/data-display/uploaded-file/UploadedFileDetails.mjs +2 -0
- package/dist/components/data-display/uploaded-file/UploadedFileDetails.mjs.map +1 -0
- package/dist/components/data-display/uploaded-file/UploadedFileIcon.mjs +2 -0
- package/dist/components/data-display/uploaded-file/UploadedFileIcon.mjs.map +1 -0
- package/dist/components/forms/Form.d.mts +111 -0
- package/dist/components/forms/Form.d.mts.map +1 -0
- package/dist/components/forms/Form.mjs +2 -0
- package/dist/components/forms/Form.mjs.map +1 -0
- package/dist/components/forms/FormBase.mjs +2 -0
- package/dist/components/forms/FormBase.mjs.map +1 -0
- package/dist/components/forms/FormErrorBox.mjs +2 -0
- package/dist/components/forms/FormErrorBox.mjs.map +1 -0
- package/dist/components/forms/controls/FormCheckbox.d.mts +13 -0
- package/dist/components/forms/controls/FormCheckbox.d.mts.map +1 -0
- package/dist/components/forms/controls/FormCheckbox.mjs +2 -0
- package/dist/components/forms/controls/FormCheckbox.mjs.map +1 -0
- package/dist/components/forms/controls/FormHidden.mjs +2 -0
- package/dist/components/forms/controls/FormHidden.mjs.map +1 -0
- package/dist/components/forms/controls/FormPassword.mjs +2 -0
- package/dist/components/forms/controls/FormPassword.mjs.map +1 -0
- package/dist/components/forms/controls/FormSubmit.d.mts +9 -0
- package/dist/components/forms/controls/FormSubmit.d.mts.map +1 -0
- package/dist/components/forms/controls/FormSubmit.mjs +2 -0
- package/dist/components/forms/controls/FormSubmit.mjs.map +1 -0
- package/dist/components/forms/controls/FormTextInput.mjs +2 -0
- package/dist/components/forms/controls/FormTextInput.mjs.map +1 -0
- package/dist/components/forms/controls/find-form-components.mjs +2 -0
- package/dist/components/forms/controls/find-form-components.mjs.map +1 -0
- package/dist/components/forms/controls/index.mjs +2 -0
- package/dist/components/forms/controls/index.mjs.map +1 -0
- package/dist/components/forms/controls/register-components.mjs +2 -0
- package/dist/components/forms/controls/register-components.mjs.map +1 -0
- package/dist/components/forms/index.d.mts +3 -0
- package/dist/components/forms/rules/confirmed.mjs +2 -0
- package/dist/components/forms/rules/confirmed.mjs.map +1 -0
- package/dist/components/forms/rules/create-rule.d.mts +1 -0
- package/dist/components/forms/rules/create-rule.mjs +2 -0
- package/dist/components/forms/rules/create-rule.mjs.map +1 -0
- package/dist/components/forms/rules/extract-form-rules.mjs +2 -0
- package/dist/components/forms/rules/extract-form-rules.mjs.map +1 -0
- package/dist/components/forms/rules/in.mjs +2 -0
- package/dist/components/forms/rules/in.mjs.map +1 -0
- package/dist/components/forms/rules/index.mjs +2 -0
- package/dist/components/forms/rules/index.mjs.map +1 -0
- package/dist/components/forms/rules/numeric.mjs +2 -0
- package/dist/components/forms/rules/numeric.mjs.map +1 -0
- package/dist/components/forms/rules/password-rules.d.mts +7 -0
- package/dist/components/forms/rules/password-rules.d.mts.map +1 -0
- package/dist/components/forms/rules/password-rules.mjs +2 -0
- package/dist/components/forms/rules/password-rules.mjs.map +1 -0
- package/dist/components/forms/rules/password.mjs +2 -0
- package/dist/components/forms/rules/password.mjs.map +1 -0
- package/dist/components/forms/rules/required.mjs +2 -0
- package/dist/components/forms/rules/required.mjs.map +1 -0
- package/dist/components/forms/rules/zod.d.mts +298 -0
- package/dist/components/forms/rules/zod.d.mts.map +1 -0
- package/dist/components/forms/rules/zod.mjs +2 -0
- package/dist/components/forms/rules/zod.mjs.map +1 -0
- package/dist/components/index.d.mts +37 -26
- package/dist/components/layouts/top-bar/TopBar.d.mts +2 -2
- package/dist/components/layouts/top-bar/TopBar.d.mts.map +1 -1
- package/dist/components/layouts/top-bar/TopBar.mjs.map +1 -1
- package/dist/components/misc/horizontal-divider/HorizontalDivider.d.mts +2 -2
- package/dist/components/misc/horizontal-divider/HorizontalDivider.d.mts.map +1 -1
- package/dist/components/misc/scroll-area/ScrollArea.d.mts +1 -1
- package/dist/components/misc/scroll-area/ScrollArea.mjs.map +1 -1
- package/dist/components/misc/scroll-area-autosize/ScrollAreaAutosize.d.mts.map +1 -1
- package/dist/components/misc/scroll-area-autosize/ScrollAreaAutosize.mjs.map +1 -1
- package/dist/components/misc/visually-hidden/VisuallyHidden.d.mts +2 -2
- package/dist/components/misc/visually-hidden/VisuallyHidden.d.mts.map +1 -1
- package/dist/components/navigations/breadcrumbs/Breadcrumbs.d.mts +2 -2
- package/dist/components/navigations/breadcrumbs/Breadcrumbs.d.mts.map +1 -1
- package/dist/components/navigations/menu/Menu.d.mts +4 -4
- package/dist/components/navigations/menu/Menu.d.mts.map +1 -1
- package/dist/components/navigations/menu/Menu.mjs.map +1 -1
- package/dist/components/overlays/index.d.mts +9 -9
- package/dist/components/overlays/modal/Modal.d.mts +11 -11
- package/dist/components/overlays/modal/Modal.d.mts.map +1 -1
- package/dist/components/overlays/modal/Modal.mjs.map +1 -1
- package/dist/components/overlays/modal/ModalContext.mjs +1 -1
- package/dist/components/overlays/modal/ModalContext.mjs.map +1 -1
- package/dist/components/overlays/modals/ModalsProvider.d.mts +3 -3
- package/dist/components/overlays/modals/ModalsProvider.d.mts.map +1 -1
- package/dist/components/overlays/modals/ModalsProvider.mjs.map +1 -1
- package/dist/components/overlays/modals/alert/ModalAlert.d.mts +2 -2
- package/dist/components/overlays/modals/alert/ModalAlert.d.mts.map +1 -1
- package/dist/components/overlays/modals/alert/ModalAlert.mjs +1 -1
- package/dist/components/overlays/modals/alert/ModalAlert.mjs.map +1 -1
- package/dist/components/overlays/modals/alert/alert.d.mts.map +1 -1
- package/dist/components/overlays/modals/alert/alert.mjs.map +1 -1
- package/dist/components/overlays/modals/confirm/ModalConfirm.d.mts +2 -2
- package/dist/components/overlays/modals/confirm/ModalConfirm.d.mts.map +1 -1
- package/dist/components/overlays/modals/confirm/ModalConfirm.mjs +1 -1
- package/dist/components/overlays/modals/confirm/ModalConfirm.mjs.map +1 -1
- package/dist/components/overlays/modals/confirm/confirm.d.mts.map +1 -1
- package/dist/components/overlays/modals/confirm/confirm.mjs.map +1 -1
- package/dist/components/overlays/modals/registry/createModal.d.mts +1 -1
- package/dist/components/overlays/modals/registry/createModal.d.mts.map +1 -1
- package/dist/components/overlays/modals/registry/createModal.mjs.map +1 -1
- package/dist/components/overlays/modals/registry/openModalById.d.mts.map +1 -1
- package/dist/components/overlays/modals/registry/openModalById.mjs.map +1 -1
- package/dist/components/overlays/modals/registry/registerModal.d.mts.map +1 -1
- package/dist/components/overlays/modals/registry/registerModal.mjs.map +1 -1
- package/dist/components/overlays/tooltip/Tooltip.d.mts +2 -2
- package/dist/components/overlays/tooltip/Tooltip.d.mts.map +1 -1
- package/dist/components/overlays/tooltip/Tooltip.mjs.map +1 -1
- package/dist/index.d.mts +40 -30
- package/dist/index.mjs +1 -1
- package/dist/semedlab/components/data-display/index.d.mts +2 -2
- package/dist/semedlab/components/data-display/notification/Notification.d.mts.map +1 -1
- package/dist/semedlab/components/data-display/notification/Notification.mjs.map +1 -1
- package/dist/semedlab/components/data-display/user-group-preview/UserGroupPreview.d.mts +2 -2
- package/dist/semedlab/components/data-display/user-group-preview/UserGroupPreview.d.mts.map +1 -1
- package/dist/semedlab/components/data-display/user-group-preview/UserGroupPreview.mjs.map +1 -1
- package/dist/semedlab/components/data-display/user-profile/UserProfile.d.mts +0 -2
- package/dist/semedlab/components/data-display/user-profile/UserProfile.d.mts.map +1 -1
- package/dist/semedlab/components/data-display/user-profile/UserProfile.mjs +1 -1
- package/dist/semedlab/components/data-display/user-profile/UserProfile.mjs.map +1 -1
- package/dist/semedlab/components/index.d.mts +3 -3
- package/dist/semedlab/components/navigations/backoffice-top-bar/BackofficeTopBar.d.mts +2 -2
- package/dist/semedlab/components/navigations/backoffice-top-bar/BackofficeTopBar.d.mts.map +1 -1
- package/dist/semedlab/components/navigations/backoffice-top-bar/BackofficeTopBar.mjs.map +1 -1
- package/dist/semedlab/components/navigations/breadcrumbs-bar/BreadcrumbsBar.d.mts.map +1 -1
- package/dist/semedlab/components/navigations/breadcrumbs-bar/BreadcrumbsBar.mjs.map +1 -1
- package/dist/semedlab/components/navigations/index.d.mts +3 -3
- package/dist/semedlab/components/navigations/notification-list/NotificationList.d.mts +2 -2
- package/dist/semedlab/components/navigations/notification-list/NotificationList.d.mts.map +1 -1
- package/dist/semedlab/components/navigations/notification-list/NotificationList.mjs.map +1 -1
- package/dist/semedlab/components/navigations/notification-menu/NotificationMenu.d.mts +2 -2
- package/dist/semedlab/components/navigations/notification-menu/NotificationMenu.d.mts.map +1 -1
- package/dist/semedlab/components/navigations/notification-menu/NotificationMenu.mjs.map +1 -1
- package/dist/semedlab/components/navigations/profile-menu/ProfileMenu.d.mts +2 -2
- package/dist/semedlab/components/navigations/profile-menu/ProfileMenu.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/components/controls/password-input-strength/PasswordInputStrength.d.mts.map +0 -1
- package/dist/components/controls/password-input-strength/PasswordInputStrength.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonVariantProps } from "@mage-ui/styled-system/recipes";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime32 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/buttons/button/Button.d.ts
|
|
@@ -21,7 +21,7 @@ declare const Button: ({
|
|
|
21
21
|
startSlot,
|
|
22
22
|
endSlot,
|
|
23
23
|
...props
|
|
24
|
-
}: ButtonProps) =>
|
|
24
|
+
}: ButtonProps) => react_jsx_runtime32.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { Button, ButtonProps };
|
|
27
27
|
//# sourceMappingURL=Button.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonProps } from "../button/Button.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime33 from "react/jsx-runtime";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/buttons/button-action/ButtonAction.d.ts
|
|
@@ -8,8 +8,8 @@ type ButtonActionProps = Omit<ButtonProps, 'classNames'> & {
|
|
|
8
8
|
buttonAction?: string;
|
|
9
9
|
loader?: string;
|
|
10
10
|
};
|
|
11
|
-
loading: boolean;
|
|
12
11
|
loader?: ReactNode;
|
|
12
|
+
loading: boolean;
|
|
13
13
|
loadingText?: string;
|
|
14
14
|
successText?: string;
|
|
15
15
|
successDuration?: number;
|
|
@@ -19,13 +19,14 @@ declare const ButtonAction: ({
|
|
|
19
19
|
startSlot,
|
|
20
20
|
endSlot,
|
|
21
21
|
children,
|
|
22
|
-
loading,
|
|
23
22
|
loader,
|
|
23
|
+
loading,
|
|
24
24
|
loadingText,
|
|
25
25
|
successText,
|
|
26
26
|
successDuration,
|
|
27
|
+
disabled,
|
|
27
28
|
...props
|
|
28
|
-
}: ButtonActionProps) =>
|
|
29
|
+
}: ButtonActionProps) => react_jsx_runtime33.JSX.Element;
|
|
29
30
|
//#endregion
|
|
30
31
|
export { ButtonAction, ButtonActionProps };
|
|
31
32
|
//# sourceMappingURL=ButtonAction.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonAction.d.mts","names":[],"sources":["../../../../src/components/buttons/button-action/ButtonAction.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"ButtonAction.d.mts","names":[],"sources":["../../../../src/components/buttons/button-action/ButtonAction.tsx"],"mappings":";;;;;KAiBY,iBAAA,GAAoB,IAAA,CAAK,WAAA;EACnC,UAAA,GAAa,IAAA,CAAK,WAAA,CAAY,WAAA;IAC5B,YAAA;IACA,MAAA;EAAA;EAEF,MAAA,GAAS,SAAA;EACT,OAAA;EACA,WAAA;EACA,WAAA;EACA,eAAA;AAAA;AAAA,cAiCW,YAAA;EAAgB,UAAA;EAAA,SAAA;EAAA,OAAA;EAAA,QAAA;EAAA,MAAA;EAAA,OAAA;EAAA,WAAA;EAAA,WAAA;EAAA,eAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAY1B,iBAAA,KAAiB,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{VisuallyHidden as e}from"../../misc/visually-hidden/VisuallyHidden.mjs";import{
|
|
1
|
+
import{VisuallyHidden as e}from"../../misc/visually-hidden/VisuallyHidden.mjs";import{ButtonActionProvider as t}from"./ButtonActionContext.mjs";import{cx as n}from"@mage-ui/styled-system/css";import{buttonAction as r,buttonActionInner as i,buttonActionLabel as a,buttonActionLoader as o,buttonActionRoot as s,buttonActionSection as c}from"@mage-ui/styled-system/recipes";import{Button as l}from"@mantine/core";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useEffect as f,useRef as p,useState as m}from"react";const h=({loading:e,successText:t,successDuration:n=2e3})=>{let[r,i]=m(!1),a=p(e);return f(()=>{if(a.current&&!e&&t){i(!0);let e=setTimeout(()=>{i(!1)},n);return()=>clearTimeout(e)}a.current=e},[e,t,n]),e?`loading`:r?`success`:`idle`},g=({classNames:f,startSlot:p,endSlot:m,children:g,loader:_,loading:v,loadingText:y,successText:b,successDuration:x,disabled:S,...C})=>{let w=h({loading:v,successText:b,successDuration:x}),T=w===`loading`,E=w===`success`,D=()=>T&&y?y:E&&b?b:g,O=T||E||S;return d(l,{classNames:{inner:f?.inner??i(),label:f?.label??a(),root:n(f?.buttonAction??r(),f?.root??s()),loader:f?.loader??o(),section:f?.section??c()},leftSection:p,rightSection:m,loading:T,disabled:O,"aria-busy":O,...C,children:[_&&u(t,{value:{isLoading:T,isSuccess:E},children:_}),D(),u(e,{"aria-live":`polite`,children:D()})]})};export{g as ButtonAction};
|
|
2
2
|
//# sourceMappingURL=ButtonAction.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonAction.mjs","names":["MantineButton","VisuallyHidden"],"sources":["../../../../src/components/buttons/button-action/ButtonAction.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ButtonAction.mjs","names":["MantineButton","VisuallyHidden"],"sources":["../../../../src/components/buttons/button-action/ButtonAction.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useRef, useState } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n buttonAction,\n buttonActionInner,\n buttonActionLabel,\n buttonActionLoader,\n buttonActionRoot,\n buttonActionSection,\n} from '@mage-ui/styled-system/recipes';\nimport { Button as MantineButton } from '@mantine/core';\nimport type { ButtonProps } from '@/components/buttons/button/Button';\nimport { VisuallyHidden } from '@/components/misc/visually-hidden/VisuallyHidden';\n\nimport { ButtonActionProvider } from './ButtonActionContext';\n\nexport type ButtonActionProps = Omit<ButtonProps, 'classNames'> & {\n classNames?: Omit<NonNullable<ButtonProps['classNames']>, 'button'> & {\n buttonAction?: string;\n loader?: string;\n };\n loader?: ReactNode;\n loading: boolean;\n loadingText?: string;\n successText?: string;\n successDuration?: number;\n};\n\ntype ButtonActionStatus = 'idle' | 'loading' | 'success' | 'error';\n\nconst useButtonActionState = ({\n loading,\n successText,\n successDuration = 2000,\n}: {\n loading: boolean;\n successText?: string;\n successDuration?: number;\n}): ButtonActionStatus => {\n const [showSuccess, setShowSuccess] = useState(false);\n const prevLoadingRef = useRef(loading);\n\n useEffect(() => {\n if (prevLoadingRef.current && !loading) {\n if (successText) {\n setShowSuccess(true);\n const timer = setTimeout(() => {\n setShowSuccess(false);\n }, successDuration);\n return () => clearTimeout(timer);\n }\n }\n prevLoadingRef.current = loading;\n }, [loading, successText, successDuration]);\n\n return loading ? 'loading' : showSuccess ? 'success' : 'idle';\n};\n\nexport const ButtonAction = ({\n classNames,\n startSlot,\n endSlot,\n children,\n loader,\n loading,\n loadingText,\n successText,\n successDuration,\n disabled,\n ...props\n}: ButtonActionProps) => {\n const status = useButtonActionState({\n loading,\n successText,\n successDuration,\n });\n\n const isLoading = status === 'loading';\n const isSuccess = status === 'success';\n\n const getLabelContent = () => {\n if (isLoading && loadingText) return loadingText;\n if (isSuccess && successText) return successText;\n return children;\n };\n\n const isDisabled = isLoading || isSuccess || disabled;\n\n return (\n <MantineButton\n classNames={{\n inner: classNames?.inner ?? buttonActionInner(),\n label: classNames?.label ?? buttonActionLabel(),\n root: cx(\n classNames?.buttonAction ?? buttonAction(),\n classNames?.root ?? buttonActionRoot(),\n ),\n loader: classNames?.loader ?? buttonActionLoader(),\n section: classNames?.section ?? buttonActionSection(),\n }}\n leftSection={startSlot}\n rightSection={endSlot}\n loading={isLoading}\n disabled={isDisabled}\n aria-busy={isDisabled}\n {...props}\n >\n {loader && (\n <ButtonActionProvider value={{ isLoading, isSuccess }}>\n {loader}\n </ButtonActionProvider>\n )}\n {getLabelContent()}\n\n <VisuallyHidden aria-live='polite'>{getLabelContent()}</VisuallyHidden>\n </MantineButton>\n );\n};\n"],"mappings":"wgBA+BA,MAAM,GAAwB,CAC5B,UACA,cACA,kBAAkB,OAKM,CACxB,GAAM,CAAC,EAAa,GAAkB,EAAS,GAAM,CAC/C,EAAiB,EAAO,EAAQ,CAetC,OAbA,MAAgB,CACd,GAAI,EAAe,SAAW,CAAC,GACzB,EAAa,CACf,EAAe,GAAK,CACpB,IAAM,EAAQ,eAAiB,CAC7B,EAAe,GAAM,EACpB,EAAgB,CACnB,UAAa,aAAa,EAAM,CAGpC,EAAe,QAAU,GACxB,CAAC,EAAS,EAAa,EAAgB,CAAC,CAEpC,EAAU,UAAY,EAAc,UAAY,QAG5C,GAAgB,CAC3B,aACA,YACA,UACA,WACA,SACA,UACA,cACA,cACA,kBACA,WACA,GAAG,KACoB,CACvB,IAAM,EAAS,EAAqB,CAClC,UACA,cACA,kBACD,CAAC,CAEI,EAAY,IAAW,UACvB,EAAY,IAAW,UAEvB,MACA,GAAa,EAAoB,EACjC,GAAa,EAAoB,EAC9B,EAGH,EAAa,GAAa,GAAa,EAE7C,OACE,EAACA,EAAAA,CACC,WAAY,CACV,MAAO,GAAY,OAAS,GAAmB,CAC/C,MAAO,GAAY,OAAS,GAAmB,CAC/C,KAAM,EACJ,GAAY,cAAgB,GAAc,CAC1C,GAAY,MAAQ,GAAkB,CACvC,CACD,OAAQ,GAAY,QAAU,GAAoB,CAClD,QAAS,GAAY,SAAW,GAAqB,CACtD,CACD,YAAa,EACb,aAAc,EACd,QAAS,EACT,SAAU,EACV,YAAW,EACX,GAAI,YAEH,GACC,EAAC,EAAA,CAAqB,MAAO,CAAE,YAAW,YAAW,UAClD,GACoB,CAExB,GAAiB,CAElB,EAACC,EAAAA,CAAe,YAAU,kBAAU,GAAiB,EAAkB,GACzD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{createContext as t,useContext as n}from"react";const r=t(null),i=({children:t,value:n})=>e(r.Provider,{value:n,children:t}),a=()=>n(r)||{isLoading:!1,isSuccess:!1};export{i as ButtonActionProvider,a as useButtonActionContext};
|
|
2
|
+
//# sourceMappingURL=ButtonActionContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonActionContext.mjs","names":[],"sources":["../../../../src/components/buttons/button-action/ButtonActionContext.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext } from 'react';\n\nexport interface ButtonActionContextValue {\n isLoading: boolean;\n isSuccess: boolean;\n}\n\nconst ButtonActionContext = createContext<ButtonActionContextValue | null>(\n null,\n);\n\nexport const ButtonActionProvider = ({\n children,\n value,\n}: {\n children: ReactNode;\n value: ButtonActionContextValue;\n}) => {\n return (\n <ButtonActionContext.Provider value={value}>\n {children}\n </ButtonActionContext.Provider>\n );\n};\n\nexport const useButtonActionContext = (): ButtonActionContextValue => {\n const context = useContext(ButtonActionContext);\n if (!context) {\n return { isLoading: false, isSuccess: false };\n }\n return context;\n};\n"],"mappings":"8FAOA,MAAM,EAAsB,EAC1B,KACD,CAEY,GAAwB,CACnC,WACA,WAME,EAAC,EAAoB,SAAA,CAAgB,QAClC,YAC4B,CAItB,MACK,EAAW,EAAoB,EAEtC,CAAE,UAAW,GAAO,UAAW,GAAO"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime34 from "react/jsx-runtime";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/buttons/button-action/ButtonLoader.d.ts
|
|
5
|
+
declare const ButtonLoader: ({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: ComponentProps<"span">) => react_jsx_runtime34.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ButtonLoader };
|
|
11
|
+
//# sourceMappingURL=ButtonLoader.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonLoader.d.mts","names":[],"sources":["../../../../src/components/buttons/button-action/ButtonLoader.tsx"],"mappings":";;;;cAOa,YAAA;EAAgB,SAAA;EAAA,GAAA;AAAA,GAG1B,cAAA,aAAsB,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useButtonActionContext as e}from"./ButtonActionContext.mjs";import{cx as t}from"@mage-ui/styled-system/css";import{buttonActionLoader as n}from"@mage-ui/styled-system/recipes";import{jsx as r}from"react/jsx-runtime";const i=({className:i,...a})=>{let{isLoading:o}=e();return r(`span`,{className:t(n(),i),"data-loading":o,"aria-hidden":`true`,...a})};export{i as ButtonLoader};
|
|
2
|
+
//# sourceMappingURL=ButtonLoader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonLoader.mjs","names":[],"sources":["../../../../src/components/buttons/button-action/ButtonLoader.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport { buttonActionLoader } from '@mage-ui/styled-system/recipes';\n\nimport { useButtonActionContext } from './ButtonActionContext';\n\nexport const ButtonLoader = ({\n className,\n ...props\n}: ComponentProps<'span'>) => {\n const { isLoading } = useButtonActionContext();\n\n return (\n <span\n className={cx(buttonActionLoader(), className)}\n data-loading={isLoading}\n aria-hidden='true'\n {...props}\n />\n );\n};\n"],"mappings":"+NAOA,MAAa,GAAgB,CAC3B,YACA,GAAG,KACyB,CAC5B,GAAM,CAAE,aAAc,GAAwB,CAE9C,OACE,EAAC,OAAA,CACC,UAAW,EAAG,GAAoB,CAAE,EAAU,CAC9C,eAAc,EACd,cAAY,OACZ,GAAI,GACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime35 from "react/jsx-runtime";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/buttons/button-icon/ButtonIcon.d.ts
|
|
@@ -23,7 +23,7 @@ declare const ButtonIcon: ({
|
|
|
23
23
|
onClick,
|
|
24
24
|
disabled,
|
|
25
25
|
classNames
|
|
26
|
-
}: ButtonIconProps) =>
|
|
26
|
+
}: ButtonIconProps) => react_jsx_runtime35.JSX.Element;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { ButtonIcon, ButtonIconProps };
|
|
29
29
|
//# sourceMappingURL=ButtonIcon.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.mjs","names":["VisuallyHidden"],"sources":["../../../../src/components/buttons/button-icon/ButtonIcon.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ButtonIcon.mjs","names":["VisuallyHidden"],"sources":["../../../../src/components/buttons/button-icon/ButtonIcon.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n buttonIcon,\n buttonIconIcon,\n buttonIconIconRaw,\n buttonIconIconRawRoot,\n buttonIconRoot,\n} from '@mage-ui/styled-system/recipes';\nimport { ActionIcon } from '@mantine/core';\nimport { IconRaw } from '@/components/data-display';\nimport { VisuallyHidden } from '@/components/misc';\n\nexport type ButtonIconProps = ComponentProps<'button'> & {\n name: string;\n path: string;\n label: string;\n classNames?: {\n buttonIcon?: string;\n root?: string;\n icon?: string;\n iconRaw?: {\n iconRaw?: string;\n root?: string;\n };\n };\n};\n\nexport const ButtonIcon = ({\n label,\n name,\n path,\n onClick,\n disabled,\n classNames,\n}: ButtonIconProps) => {\n return (\n <ActionIcon\n classNames={{\n root: cx(\n classNames?.buttonIcon ?? buttonIcon(),\n classNames?.root ?? buttonIconRoot(),\n ),\n icon: classNames?.icon ?? buttonIconIcon(),\n }}\n onClick={onClick}\n disabled={disabled}\n >\n <IconRaw\n path={path}\n name={name}\n classNames={{\n iconRaw: classNames?.iconRaw?.iconRaw ?? buttonIconIconRaw(),\n root: classNames?.iconRaw?.root ?? buttonIconIconRawRoot(),\n }}\n />\n <VisuallyHidden>{label}</VisuallyHidden>\n </ActionIcon>\n );\n};\n"],"mappings":"0bA6BA,MAAa,GAAc,CACzB,QACA,OACA,OACA,UACA,WACA,gBAGE,EAAC,EAAA,CACC,WAAY,CACV,KAAM,EACJ,GAAY,YAAc,GAAY,CACtC,GAAY,MAAQ,GAAgB,CACrC,CACD,KAAM,GAAY,MAAQ,GAAgB,CAC3C,CACQ,UACC,qBAEV,EAAC,EAAA,CACO,OACA,OACN,WAAY,CACV,QAAS,GAAY,SAAS,SAAW,GAAmB,CAC5D,KAAM,GAAY,SAAS,MAAQ,GAAuB,CAC3D,EACD,CACF,EAACA,EAAAA,CAAAA,SAAgB,EAAA,CAAuB,CAAA,EAC7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime36 from "react/jsx-runtime";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/buttons/button-icon-visual/ButtonIconVisual.d.ts
|
|
@@ -22,7 +22,7 @@ declare const ButtonIconVisual: ({
|
|
|
22
22
|
name,
|
|
23
23
|
path,
|
|
24
24
|
disabled
|
|
25
|
-
}: ButtonIconVisualProps) =>
|
|
25
|
+
}: ButtonIconVisualProps) => react_jsx_runtime36.JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { ButtonIconVisual, ButtonIconVisualProps };
|
|
28
28
|
//# sourceMappingURL=ButtonIconVisual.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/buttons/button-visual/ButtonVisual.d.ts
|
|
@@ -21,7 +21,7 @@ declare const ButtonVisual: ({
|
|
|
21
21
|
endSlot,
|
|
22
22
|
children,
|
|
23
23
|
disabled
|
|
24
|
-
}: ButtonVisualProps) =>
|
|
24
|
+
}: ButtonVisualProps) => react_jsx_runtime31.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { ButtonVisual, ButtonVisualProps };
|
|
27
27
|
//# sourceMappingURL=ButtonVisual.d.mts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Button, ButtonProps } from "./button/Button.mjs";
|
|
2
2
|
import { ButtonAction, ButtonActionProps } from "./button-action/ButtonAction.mjs";
|
|
3
|
+
import { ButtonLoader } from "./button-action/ButtonLoader.mjs";
|
|
3
4
|
import { ButtonIcon, ButtonIconProps } from "./button-icon/ButtonIcon.mjs";
|
|
4
5
|
import { ButtonIconVisual, ButtonIconVisualProps } from "./button-icon-visual/ButtonIconVisual.mjs";
|
|
5
6
|
import { ButtonVisual, ButtonVisualProps } from "./button-visual/ButtonVisual.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComboboxProps } from "../combobox/Combobox.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/controls/autocomplete/Autocomplete.d.ts
|
|
@@ -29,7 +29,7 @@ declare const Autocomplete: ({
|
|
|
29
29
|
emptyMessage,
|
|
30
30
|
minLength,
|
|
31
31
|
classNames
|
|
32
|
-
}: AutocompleteProps) =>
|
|
32
|
+
}: AutocompleteProps) => react_jsx_runtime18.JSX.Element;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { Autocomplete, AutocompleteProps, OptionProps };
|
|
35
35
|
//# sourceMappingURL=Autocomplete.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.mts","names":[],"sources":["../../../../src/components/controls/autocomplete/Autocomplete.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.mts","names":[],"sources":["../../../../src/components/controls/autocomplete/Autocomplete.tsx"],"mappings":";;;;;KA+BY,WAAA;EACV,EAAA;EACA,KAAA;AAAA;AAAA,KAGU,iBAAA,GAAoB,IAAA,CAC9B,aAAA;EASA,GAAA;EACA,WAAA,GAAc,SAAA;EACd,SAAA;EACA,UAAA,GAAa,IAAA,CACX,WAAA,CAAY,aAAA;IAGZ,YAAA;EAAA;AAAA;AAAA,cAGS,YAAA;EAAgB,GAAA;EAAA,IAAA;EAAA,KAAA;EAAA,WAAA;EAAA,KAAA;EAAA,QAAA;EAAA,WAAA;EAAA,YAAA;EAAA,SAAA;EAAA,WAAA;EAAA,YAAA;EAAA,SAAA;EAAA;AAAA,GAc1B,iBAAA,KAAiB,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{LoaderDot as e}from"../../data-display/loader-dot/LoaderDot.mjs";import{Combobox as t}from"../combobox/Combobox.mjs";import{cx as n}from"@mage-ui/styled-system/css";import{autocomplete as r,autocompleteClearButton as i,autocompleteClearButtonIcon as a,autocompleteClearButtonIconRaw as o,autocompleteClearButtonIconRawRoot as s,autocompleteClearButtonRoot as c,autocompleteEmpty as l,autocompleteOption as u,autocompleteOptions as d,autocompleteRoot as f,autocompleteScrollAreaAutosize as p,autocompleteTextInput as m,autocompleteTextInputDescription as h,autocompleteTextInputError as g,autocompleteTextInputInput as _,autocompleteTextInputLabel as v,autocompleteTextInputRequired as y,autocompleteTextInputRoot as b,autocompleteTextInputSection as x,autocompleteTextInputWrapper as S}from"@mage-ui/styled-system/recipes";import{jsx as C}from"react/jsx-runtime";import{useState as w}from"react";import{
|
|
1
|
+
import{LoaderDot as e}from"../../data-display/loader-dot/LoaderDot.mjs";import{Combobox as t}from"../combobox/Combobox.mjs";import{cx as n}from"@mage-ui/styled-system/css";import{autocomplete as r,autocompleteClearButton as i,autocompleteClearButtonIcon as a,autocompleteClearButtonIconRaw as o,autocompleteClearButtonIconRawRoot as s,autocompleteClearButtonRoot as c,autocompleteEmpty as l,autocompleteOption as u,autocompleteOptions as d,autocompleteRoot as f,autocompleteScrollAreaAutosize as p,autocompleteTextInput as m,autocompleteTextInputDescription as h,autocompleteTextInputError as g,autocompleteTextInputInput as _,autocompleteTextInputLabel as v,autocompleteTextInputRequired as y,autocompleteTextInputRoot as b,autocompleteTextInputSection as x,autocompleteTextInputWrapper as S}from"@mage-ui/styled-system/recipes";import{jsx as C}from"react/jsx-runtime";import{useState as w}from"react";import{useDebouncedCallback as T}from"@mantine/hooks";import{useQuery as E}from"@tanstack/react-query";const D=({url:D,name:O,label:k,description:A,error:j,disabled:M,placeholder:N,withinPortal:P,startSlot:F,loadingSlot:I,emptyMessage:L,minLength:R=3,classNames:z})=>{let[B,V]=w(``),{data:H,isFetching:U,isLoading:W}=E({queryKey:[D,B],queryFn:async()=>{try{return await(await fetch(D)).json()}catch{return{data:[]}}},enabled:B.length>=R}),G=T(e=>{V(e)},500);return C(t,{name:O,label:k,description:A,placeholder:N,error:j,disabled:M,withinPortal:P,keepMounted:!1,clearable:!0,options:Array.isArray(H)?H.filter(e=>e.value.toLowerCase().includes(B.toLowerCase())):[],startSlot:F,endSlot:W||U?I||C(e,{}):void 0,onChange:e=>{G(e??``)},empty:H===void 0?null:L||`No results`,classNames:{combobox:z?.autocomplete??r(),root:z?.root??H===void 0?``:f(),options:z?.options??d(),option:z?.option??u(),empty:z?.empty??l(),scrollArea:{scrollArea:z?.scrollArea?.scrollArea??p()},textInput:{root:z?.textInput?.root??n(m(),b()),label:z?.textInput?.label??v(),description:z?.textInput?.description??h(),error:z?.textInput?.error??g(),wrapper:z?.textInput?.wrapper??S(),input:z?.textInput?.input??_(),section:z?.textInput?.section??x(),required:z?.textInput?.required??y(),endSlot:{clearButton:{buttonIcon:z?.textInput?.endSlot?.clearButton?.buttonIcon??i(),root:z?.textInput?.endSlot?.clearButton?.root??c(),icon:z?.textInput?.endSlot?.clearButton?.icon??a(),iconRaw:{iconRaw:z?.textInput?.endSlot?.clearButton?.iconRaw?.iconRaw??o(),root:z?.textInput?.endSlot?.clearButton?.iconRaw?.root??s()}}}}}})};export{D as Autocomplete};
|
|
2
2
|
//# sourceMappingURL=Autocomplete.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.mjs","names":[],"sources":["../../../../src/components/controls/autocomplete/Autocomplete.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Autocomplete.mjs","names":[],"sources":["../../../../src/components/controls/autocomplete/Autocomplete.tsx"],"sourcesContent":["import { type ReactNode, useState } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n autocomplete,\n autocompleteClearButton,\n autocompleteClearButtonIcon,\n autocompleteClearButtonIconRaw,\n autocompleteClearButtonIconRawRoot,\n autocompleteClearButtonRoot,\n autocompleteEmpty,\n autocompleteOption,\n autocompleteOptions,\n autocompleteRoot,\n autocompleteScrollAreaAutosize,\n autocompleteTextInput,\n autocompleteTextInputDescription,\n autocompleteTextInputError,\n autocompleteTextInputInput,\n autocompleteTextInputLabel,\n autocompleteTextInputRequired,\n autocompleteTextInputRoot,\n autocompleteTextInputSection,\n autocompleteTextInputWrapper,\n} from '@mage-ui/styled-system/recipes';\nimport { useDebouncedCallback } from '@mantine/hooks';\nimport { useQuery } from '@tanstack/react-query';\nimport { LoaderDot } from '@/components/data-display';\n\nimport { Combobox, type ComboboxProps } from '../combobox/Combobox';\n\nexport type OptionProps = {\n id: string | number;\n value: string;\n};\n\nexport type AutocompleteProps = Omit<\n ComboboxProps,\n | 'classNames'\n | 'endSlot'\n | 'options'\n | 'createNewItem'\n | 'chevron'\n | 'keepMounted'\n | 'clearable'\n> & {\n url: string;\n loadingSlot?: ReactNode;\n minLength?: number;\n classNames?: Omit<\n NonNullable<ComboboxProps['classNames']>,\n 'combobox' | 'create' | 'createIcon'\n > & {\n autocomplete?: string;\n };\n};\nexport const Autocomplete = ({\n url,\n name,\n label,\n description,\n error,\n disabled,\n placeholder,\n withinPortal,\n startSlot,\n loadingSlot,\n emptyMessage,\n minLength = 3,\n classNames,\n}: AutocompleteProps) => {\n const [query, setQuery] = useState('');\n\n const { data, isFetching, isLoading } = useQuery<OptionProps[]>({\n queryKey: [url, query],\n // queryFn: async () => {\n // try {\n // const response = await fetch(url, {\n // method: 'POST',\n // headers: { 'Content-Type': 'application/json' },\n // body: JSON.stringify({ query }),\n // });\n // return await response.json();\n // } catch (_error) {\n // return { data: [] };\n // }\n // },\n queryFn: async () => {\n try {\n const response = await fetch(url);\n return await response.json();\n } catch (_error) {\n return { data: [] };\n }\n },\n enabled: query.length >= minLength,\n });\n\n const debounced = useDebouncedCallback((value: string) => {\n setQuery(value);\n }, 500);\n\n const list: OptionProps[] = Array.isArray(data)\n ? data.filter((itemList) =>\n itemList.value.toLowerCase().includes(query.toLowerCase()),\n )\n : [];\n\n return (\n <Combobox\n name={name}\n label={label}\n description={description}\n placeholder={placeholder}\n error={error}\n disabled={disabled}\n withinPortal={withinPortal}\n keepMounted={false}\n clearable={true}\n options={list}\n startSlot={startSlot}\n endSlot={\n isLoading || isFetching ? loadingSlot || <LoaderDot /> : undefined\n }\n onChange={(value) => {\n debounced(value ?? '');\n }}\n empty={data === undefined ? null : emptyMessage || 'No results'}\n classNames={{\n combobox: classNames?.autocomplete ?? autocomplete(),\n root:\n (classNames?.root ?? data === undefined) ? '' : autocompleteRoot(),\n options: classNames?.options ?? autocompleteOptions(),\n option: classNames?.option ?? autocompleteOption(),\n empty: classNames?.empty ?? autocompleteEmpty(),\n scrollArea: {\n scrollArea:\n classNames?.scrollArea?.scrollArea ??\n autocompleteScrollAreaAutosize(),\n },\n textInput: {\n root:\n classNames?.textInput?.root ??\n cx(autocompleteTextInput(), autocompleteTextInputRoot()),\n label: classNames?.textInput?.label ?? autocompleteTextInputLabel(),\n description:\n classNames?.textInput?.description ??\n autocompleteTextInputDescription(),\n error: classNames?.textInput?.error ?? autocompleteTextInputError(),\n wrapper:\n classNames?.textInput?.wrapper ?? autocompleteTextInputWrapper(),\n input: classNames?.textInput?.input ?? autocompleteTextInputInput(),\n section:\n classNames?.textInput?.section ?? autocompleteTextInputSection(),\n required:\n classNames?.textInput?.required ?? autocompleteTextInputRequired(),\n endSlot: {\n clearButton: {\n buttonIcon:\n classNames?.textInput?.endSlot?.clearButton?.buttonIcon ??\n autocompleteClearButton(),\n root:\n classNames?.textInput?.endSlot?.clearButton?.root ??\n autocompleteClearButtonRoot(),\n icon:\n classNames?.textInput?.endSlot?.clearButton?.icon ??\n autocompleteClearButtonIcon(),\n iconRaw: {\n iconRaw:\n classNames?.textInput?.endSlot?.clearButton?.iconRaw\n ?.iconRaw ?? autocompleteClearButtonIconRaw(),\n root:\n classNames?.textInput?.endSlot?.clearButton?.iconRaw?.root ??\n autocompleteClearButtonIconRawRoot(),\n },\n },\n },\n },\n }}\n />\n );\n};\n"],"mappings":"8+BAwDA,MAAa,GAAgB,CAC3B,MACA,OACA,QACA,cACA,QACA,WACA,cACA,eACA,YACA,cACA,eACA,YAAY,EACZ,gBACuB,CACvB,GAAM,CAAC,EAAO,GAAY,EAAS,GAAG,CAEhC,CAAE,OAAM,aAAY,aAAc,EAAwB,CAC9D,SAAU,CAAC,EAAK,EAAM,CAatB,QAAS,SAAY,CACnB,GAAI,CAEF,OAAO,MADU,MAAM,MAAM,EAAI,EACX,MAAM,MACb,CACf,MAAO,CAAE,KAAM,EAAE,CAAE,GAGvB,QAAS,EAAM,QAAU,EAC1B,CAAC,CAEI,EAAY,EAAsB,GAAkB,CACxD,EAAS,EAAM,EACd,IAAI,CAQP,OACE,EAAC,EAAA,CACO,OACC,QACM,cACA,cACN,QACG,WACI,eACd,YAAa,GACb,UAAW,GACX,QAjBwB,MAAM,QAAQ,EAAK,CAC3C,EAAK,OAAQ,GACX,EAAS,MAAM,aAAa,CAAC,SAAS,EAAM,aAAa,CAAC,CAC3D,CACD,EAAE,CAcS,YACX,QACE,GAAa,EAAa,GAAe,EAAC,EAAA,EAAA,CAAY,CAAG,IAAA,GAE3D,SAAW,GAAU,CACnB,EAAU,GAAS,GAAG,EAExB,MAAO,IAAS,IAAA,GAAY,KAAO,GAAgB,aACnD,WAAY,CACV,SAAU,GAAY,cAAgB,GAAc,CACpD,KACG,GAAY,MAAQ,IAAS,IAAA,GAAa,GAAK,GAAkB,CACpE,QAAS,GAAY,SAAW,GAAqB,CACrD,OAAQ,GAAY,QAAU,GAAoB,CAClD,MAAO,GAAY,OAAS,GAAmB,CAC/C,WAAY,CACV,WACE,GAAY,YAAY,YACxB,GAAgC,CACnC,CACD,UAAW,CACT,KACE,GAAY,WAAW,MACvB,EAAG,GAAuB,CAAE,GAA2B,CAAC,CAC1D,MAAO,GAAY,WAAW,OAAS,GAA4B,CACnE,YACE,GAAY,WAAW,aACvB,GAAkC,CACpC,MAAO,GAAY,WAAW,OAAS,GAA4B,CACnE,QACE,GAAY,WAAW,SAAW,GAA8B,CAClE,MAAO,GAAY,WAAW,OAAS,GAA4B,CACnE,QACE,GAAY,WAAW,SAAW,GAA8B,CAClE,SACE,GAAY,WAAW,UAAY,GAA+B,CACpE,QAAS,CACP,YAAa,CACX,WACE,GAAY,WAAW,SAAS,aAAa,YAC7C,GAAyB,CAC3B,KACE,GAAY,WAAW,SAAS,aAAa,MAC7C,GAA6B,CAC/B,KACE,GAAY,WAAW,SAAS,aAAa,MAC7C,GAA6B,CAC/B,QAAS,CACP,QACE,GAAY,WAAW,SAAS,aAAa,SACzC,SAAW,GAAgC,CACjD,KACE,GAAY,WAAW,SAAS,aAAa,SAAS,MACtD,GAAoC,CACvC,CACF,CACF,CACF,CACF,EACD"}
|
|
@@ -3,12 +3,8 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
3
3
|
|
|
4
4
|
//#region src/components/controls/checkbox/Checkbox.d.ts
|
|
5
5
|
type CheckboxProps = Omit<ComponentProps<'input'>, 'size'> & {
|
|
6
|
-
checked?: boolean;
|
|
7
6
|
label?: ReactNode;
|
|
8
|
-
description?: string;
|
|
9
7
|
error?: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
8
|
classNames?: {
|
|
13
9
|
checkbox?: string;
|
|
14
10
|
root?: string;
|
|
@@ -23,25 +19,17 @@ type CheckboxProps = Omit<ComponentProps<'input'>, 'size'> & {
|
|
|
23
19
|
description?: string;
|
|
24
20
|
error?: string;
|
|
25
21
|
};
|
|
26
|
-
indeterminate?: boolean;
|
|
27
22
|
hiddenLabel?: boolean;
|
|
28
23
|
};
|
|
29
24
|
declare const Checkbox: {
|
|
30
25
|
({
|
|
31
26
|
classNames,
|
|
32
|
-
name,
|
|
33
27
|
label,
|
|
34
28
|
hiddenLabel,
|
|
35
|
-
description,
|
|
36
29
|
error,
|
|
37
|
-
onChange,
|
|
38
|
-
value,
|
|
39
|
-
id,
|
|
40
|
-
disabled,
|
|
41
|
-
readOnly,
|
|
42
30
|
required,
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
value,
|
|
32
|
+
...props
|
|
45
33
|
}: CheckboxProps): ReactNode;
|
|
46
34
|
displayName: string;
|
|
47
35
|
Group: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.mts","names":[],"sources":["../../../../src/components/controls/checkbox/Checkbox.tsx"],"mappings":";;;;KAsBY,aAAA,GAAgB,IAAA,CAAK,cAAA;EAC/B,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.mts","names":[],"sources":["../../../../src/components/controls/checkbox/Checkbox.tsx"],"mappings":";;;;KAsBY,aAAA,GAAgB,IAAA,CAAK,cAAA;EAC/B,KAAA,GAAQ,SAAA;EACR,KAAA;EACA,UAAA;IACE,QAAA;IACA,IAAA;IACA,KAAA;IACA,IAAA;IACA,KAAA;IACA,IAAA;IACA,SAAA;IACA,YAAA;IACA,aAAA;IACA,KAAA;IACA,WAAA;IACA,KAAA;EAAA;EAEF,WAAA;AAAA;AAAA,cAGW,QAAA;EAAA;;;;;;;;KAQV,aAAA,GAAgB,SAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CheckboxGroup as e}from"../checkbox-group/CheckboxGroup.mjs";import{cx as t}from"@mage-ui/styled-system/css";import{checkbox as n,checkboxBody as r,checkboxBodyError as i,checkboxDescription as a,checkboxError as o,checkboxIcon as s,checkboxInner as c,checkboxInput as l,checkboxLabel as u,checkboxLabelRequired as d,checkboxLabelWrapper as f,checkboxRoot as p}from"@mage-ui/styled-system/recipes";import{Checkbox as m}from"@mantine/core";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{visuallyHidden as v}from"@mage-ui/styled-system/patterns";const y=({classNames:e,
|
|
1
|
+
import{CheckboxGroup as e}from"../checkbox-group/CheckboxGroup.mjs";import{cx as t}from"@mage-ui/styled-system/css";import{checkbox as n,checkboxBody as r,checkboxBodyError as i,checkboxDescription as a,checkboxError as o,checkboxIcon as s,checkboxInner as c,checkboxInput as l,checkboxLabel as u,checkboxLabelRequired as d,checkboxLabelWrapper as f,checkboxRoot as p}from"@mage-ui/styled-system/recipes";import{Checkbox as m}from"@mantine/core";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{visuallyHidden as v}from"@mage-ui/styled-system/patterns";const y=({classNames:e,label:y,hiddenLabel:b,error:x,required:S,value:C,...w})=>g(m,{classNames:{root:t(e?.checkbox??n(),e?.root??p()),input:t(e?.input??l(),`peer`),icon:e?.icon??s(),inner:e?.inner??c(),body:t(e?.body??r(),x&&(e?.bodyError??i())),labelWrapper:e?.labelWrapper??f(),label:t(e?.label??u(),b&&v()),description:e?.description??a(),error:e?.error??o()},label:_(h,{children:[y,g(()=>S?_(`span`,{className:e?.labelRequired??d(),children:[` `,`*`]}):null,{})]}),checked:!!C,...w});y.displayName=`Checkbox`,y.Group=e;export{y as Checkbox};
|
|
2
2
|
//# sourceMappingURL=Checkbox.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.mjs","names":["Checkbox","MantineCheckbox"],"sources":["../../../../src/components/controls/checkbox/Checkbox.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n checkbox,\n checkboxBody,\n checkboxBodyError,\n
|
|
1
|
+
{"version":3,"file":"Checkbox.mjs","names":["Checkbox","MantineCheckbox"],"sources":["../../../../src/components/controls/checkbox/Checkbox.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport { visuallyHidden } from '@mage-ui/styled-system/patterns';\nimport {\n checkbox,\n checkboxBody,\n checkboxBodyError,\n checkboxDescription,\n checkboxError,\n checkboxIcon,\n checkboxInner,\n checkboxInput,\n checkboxLabel,\n checkboxLabelRequired,\n checkboxLabelWrapper,\n checkboxRoot,\n} from '@mage-ui/styled-system/recipes';\nimport { Checkbox as MantineCheckbox } from '@mantine/core';\n\nimport { CheckboxGroup } from '../checkbox-group/CheckboxGroup';\n\nexport type CheckboxProps = Omit<ComponentProps<'input'>, 'size'> & {\n label?: ReactNode;\n error?: string;\n classNames?: {\n checkbox?: string;\n root?: string;\n input?: string;\n icon?: string;\n inner?: string;\n body?: string;\n bodyError?: string;\n labelWrapper?: string;\n labelRequired?: string;\n label?: string;\n description?: string;\n error?: string;\n };\n hiddenLabel?: boolean;\n};\n\nexport const Checkbox = ({\n classNames,\n label,\n hiddenLabel,\n error,\n required,\n value,\n ...props\n}: CheckboxProps): ReactNode => {\n const RequiredAsterisk = () =>\n required ? (\n <span className={classNames?.labelRequired ?? checkboxLabelRequired()}>\n {' '}\n *\n </span>\n ) : null;\n\n return (\n <MantineCheckbox\n classNames={{\n root: cx(\n classNames?.checkbox ?? checkbox(),\n classNames?.root ?? checkboxRoot(),\n ),\n input: cx(classNames?.input ?? checkboxInput(), 'peer'),\n icon: classNames?.icon ?? checkboxIcon(),\n inner: classNames?.inner ?? checkboxInner(),\n body: cx(\n classNames?.body ?? checkboxBody(),\n error && (classNames?.bodyError ?? checkboxBodyError()),\n ),\n labelWrapper: classNames?.labelWrapper ?? checkboxLabelWrapper(),\n label: cx(\n classNames?.label ?? checkboxLabel(),\n hiddenLabel && visuallyHidden(),\n ),\n description: classNames?.description ?? checkboxDescription(),\n error: classNames?.error ?? checkboxError(),\n }}\n label={\n <>\n {label}\n <RequiredAsterisk />\n </>\n }\n checked={!!value}\n {...props}\n />\n );\n};\n\nCheckbox.displayName = 'Checkbox';\nCheckbox.Group = CheckboxGroup;\n"],"mappings":"+jBA0CA,MAAaA,GAAY,CACvB,aACA,QACA,cACA,QACA,WACA,QACA,GAAG,KAWD,EAACC,EAAAA,CACC,WAAY,CACV,KAAM,EACJ,GAAY,UAAY,GAAU,CAClC,GAAY,MAAQ,GAAc,CACnC,CACD,MAAO,EAAG,GAAY,OAAS,GAAe,CAAE,OAAO,CACvD,KAAM,GAAY,MAAQ,GAAc,CACxC,MAAO,GAAY,OAAS,GAAe,CAC3C,KAAM,EACJ,GAAY,MAAQ,GAAc,CAClC,IAAU,GAAY,WAAa,GAAmB,EACvD,CACD,aAAc,GAAY,cAAgB,GAAsB,CAChE,MAAO,EACL,GAAY,OAAS,GAAe,CACpC,GAAe,GAAgB,CAChC,CACD,YAAa,GAAY,aAAe,GAAqB,CAC7D,MAAO,GAAY,OAAS,GAAe,CAC5C,CACD,MACE,EAAA,EAAA,CAAA,SAAA,CACG,EACD,MAhCN,EACE,EAAC,OAAA,CAAK,UAAW,GAAY,eAAiB,GAAuB,WAClE,IAAI,IAAA,EAEA,CACL,KA2BG,EAAA,CAAmB,CAAA,CAAA,CACnB,CAEL,QAAS,CAAC,CAAC,EACX,GAAI,GACJ,CAIN,EAAS,YAAc,WACvB,EAAS,MAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.mjs","names":["CheckboxMantine"],"sources":["../../../../src/components/controls/checkbox-group/CheckboxGroup.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n checkboxGroup,\n checkboxGroupDescription,\n checkboxGroupError,\n
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.mjs","names":["CheckboxMantine"],"sources":["../../../../src/components/controls/checkbox-group/CheckboxGroup.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n checkboxGroup,\n checkboxGroupDescription,\n checkboxGroupError,\n checkboxGroupGroup,\n checkboxGroupLabel,\n checkboxGroupRequired,\n checkboxGroupRoot,\n} from '@mage-ui/styled-system/recipes';\nimport { Checkbox as CheckboxMantine } from '@mantine/core';\n\nexport type CheckboxGroupProps = {\n label?: ReactNode;\n error?: ReactNode;\n description?: ReactNode;\n children?: ReactNode;\n value?: string[];\n onChange?: (value: string[]) => void;\n withAsterisk?: boolean;\n required?: boolean;\n disabled?: boolean;\n classNames?: {\n checkboxGroup?: string;\n root?: string;\n label?: string;\n required?: string;\n description?: string;\n error?: string;\n list?: string;\n };\n};\n\nexport const CheckboxGroup = ({\n label,\n error,\n description,\n children,\n value,\n onChange,\n withAsterisk,\n required,\n disabled,\n classNames,\n}: CheckboxGroupProps): ReactNode => {\n return (\n <CheckboxMantine.Group\n classNames={{\n root: cx(\n classNames?.checkboxGroup ?? checkboxGroup(),\n classNames?.root ?? checkboxGroupRoot(),\n ),\n label: classNames?.label ?? checkboxGroupLabel(),\n required: classNames?.required ?? checkboxGroupRequired(),\n description: classNames?.description ?? checkboxGroupDescription(),\n error: classNames?.error ?? checkboxGroupError(),\n }}\n label={label}\n description={description}\n error={error}\n value={value}\n onChange={onChange}\n disabled={disabled}\n required={required}\n withAsterisk={withAsterisk}\n //TODO: withAsterisk={required}? - jo no lligaría la prop required amb withAsterisk, withAsterisk ha de ser independent per a certos casos, sustitueix el required i li treu l'atribut al input\n >\n <div className={classNames?.list ?? checkboxGroupGroup()}>{children}</div>\n </CheckboxMantine.Group>\n );\n};\n\nCheckboxGroup.displayName = 'Checkbox.Group';\n"],"mappings":"wVAmCA,MAAa,GAAiB,CAC5B,QACA,QACA,cACA,WACA,QACA,WACA,eACA,WACA,WACA,gBAGE,EAACA,EAAgB,MAAA,CACf,WAAY,CACV,KAAM,EACJ,GAAY,eAAiB,GAAe,CAC5C,GAAY,MAAQ,GAAmB,CACxC,CACD,MAAO,GAAY,OAAS,GAAoB,CAChD,SAAU,GAAY,UAAY,GAAuB,CACzD,YAAa,GAAY,aAAe,GAA0B,CAClE,MAAO,GAAY,OAAS,GAAoB,CACjD,CACM,QACM,cACN,QACA,QACG,WACA,WACA,WACI,wBAGd,EAAC,MAAA,CAAI,UAAW,GAAY,MAAQ,GAAoB,CAAG,YAAe,EACpD,CAI5B,EAAc,YAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropdownProps } from "../dropdown/Dropdown.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/controls/combobox/Combobox.d.ts
|
|
5
5
|
type ComboboxProps = Omit<DropdownProps, 'classNames' | 'onChange' | 'onBlur' | 'onFocus' | 'onClick' | 'setValue' | 'children'> & {
|
|
@@ -52,7 +52,7 @@ declare const Combobox: ({
|
|
|
52
52
|
btnClearLabel,
|
|
53
53
|
onChange,
|
|
54
54
|
classNames
|
|
55
|
-
}: ComboboxProps) =>
|
|
55
|
+
}: ComboboxProps) => react_jsx_runtime19.JSX.Element;
|
|
56
56
|
//#endregion
|
|
57
57
|
export { Combobox, ComboboxProps };
|
|
58
58
|
//# sourceMappingURL=Combobox.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.mts","names":[],"sources":["../../../../src/components/controls/combobox/Combobox.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"Combobox.d.mts","names":[],"sources":["../../../../src/components/controls/combobox/Combobox.tsx"],"mappings":";;;;KAwCY,aAAA,GAAgB,IAAA,CAC1B,aAAA;EASA,QAAA,IAAY,KAAA;EACZ,SAAA;EACA,OAAA;IACE,EAAA;IACA,KAAA;EAAA;EAEF,KAAA;EACA,YAAA;EACA,aAAA;EACA,UAAA,GAAa,IAAA,CACX,WAAA,CAAY,aAAA;IAGZ,QAAA;IACA,MAAA;IACA,UAAA;MACE,UAAA;MACA,IAAA;MACA,IAAA;MACA,OAAA;QACE,OAAA;QACA,IAAA;MAAA;IAAA;IAGJ,MAAA;IACA,MAAA;IACA,KAAA;IACA,UAAA;EAAA;AAAA;AAAA,cAIS,QAAA;EAAY,IAAA;EAAA,KAAA;EAAA,WAAA;EAAA,KAAA;EAAA,QAAA;EAAA,WAAA;EAAA,YAAA;EAAA,WAAA;EAAA,SAAA;EAAA,SAAA;EAAA,OAAA;EAAA,SAAA;EAAA,OAAA;EAAA,OAAA;EAAA,QAAA;EAAA,KAAA;EAAA,YAAA;EAAA,aAAA;EAAA,aAAA;EAAA,QAAA;EAAA;AAAA,GAsBtB,aAAA,KAAa,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.mjs","names":["combobox"],"sources":["../../../../src/components/controls/combobox/Combobox.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n comboboxOptions,\n comboboxOption,\n comboboxEmpty,\n comboboxRoot,\n comboboxOptionCreateIcon,\n comboboxOptionCreateIconRoot,\n comboboxOptionCreateIconIconRaw,\n comboboxOptionCreateIconIconRawRoot,\n combobox,\n comboboxOptionCreate,\n comboboxOptionCreateCreate,\n comboboxTextInput,\n comboboxTextInputRoot,\n comboboxTextInputLabel,\n comboboxTextInputDescription,\n comboboxTextInputError,\n comboboxTextInputWrapper,\n comboboxTextInputInput,\n comboboxTextInputSection,\n comboboxTextInputRequired,\n comboboxChevron,\n comboboxChevronRoot,\n comboboxChevronIcon,\n comboboxChevronIconRoot,\n comboboxClearButton,\n comboboxClearButtonRoot,\n comboboxClearButtonIcon,\n comboboxClearButtonIconRaw,\n comboboxClearButtonIconRawRoot,\n comboboxScrollAreaAutosize,\n} from '@mage-ui/styled-system/recipes';\nimport { Dropdown } from '../dropdown/Dropdown';\nimport { Icon } from '@/components/data-display';\nimport type { DropdownProps } from '../dropdown/Dropdown';\n\nexport type ComboboxProps = Omit<\n DropdownProps,\n | 'classNames'\n | 'onChange'\n | 'onBlur'\n | 'onFocus'\n | 'onClick'\n | 'setValue'\n | 'children'\n> & {\n onChange?: (value?: string) => void;\n creatable?: boolean;\n options: {\n id: string | number;\n value: string;\n }[];\n empty?: string | null;\n emptyMessage?: string;\n createNewItem?: string;\n classNames?: Omit<\n NonNullable<DropdownProps['classNames']>,\n 'dropdown' | 'search'\n > & {\n combobox?: string;\n create?: string;\n createIcon?: {\n createIcon?: string;\n root?: string;\n icon?: string;\n iconRaw?: {\n iconRaw?: string;\n root?: string;\n };\n };\n header?: string;\n footer?: string;\n group?: string;\n groupLabel?: string;\n };\n};\n\nexport const Combobox = ({\n name,\n label,\n description,\n error,\n disabled,\n placeholder,\n withinPortal,\n keepMounted,\n clearable,\n creatable,\n chevron,\n startSlot,\n endSlot,\n options,\n readOnly,\n empty,\n emptyMessage,\n createNewItem,\n btnClearLabel,\n onChange,\n classNames,\n}: ComboboxProps) => {\n const [value, setValue] = useState<{ id: string | number; value: string }>({\n id: '',\n value: '',\n });\n const [search, setSearch] = useState('');\n\n const shouldFilterOptions = options.every((item) => item.value !== search);\n const exactOptionMatch = options.some(\n (item) => item.value.toLowerCase() === search.toLowerCase().trim(),\n );\n\n const filteredOptions = shouldFilterOptions\n ? options.filter((item) =>\n item.value.toLowerCase().includes(search.toLowerCase().trim()),\n )\n : options;\n\n const optionsList = filteredOptions.map(\n (item: { id: string | number; value: string }) => (\n <Dropdown.Option value={item.value} key={item.id}>\n {item.value}\n </Dropdown.Option>\n ),\n );\n\n const isEmpty = !(search.length > 0);\n\n return (\n <Dropdown\n name={name}\n label={label}\n description={description}\n placeholder={placeholder}\n disabled={disabled}\n error={error}\n withinPortal={withinPortal}\n keepMounted={keepMounted}\n clearable={clearable}\n chevron={chevron}\n readOnly={readOnly}\n btnClearLabel={btnClearLabel}\n setValue={(val, combobox) => {\n const option = options.find((option) => option.value === val);\n\n if (val === '$create') {\n setValue({ id: '', value: search });\n setSearch(search);\n combobox.closeDropdown();\n return;\n }\n if (val === undefined) {\n setValue({ id: '', value: '' });\n setSearch('');\n return;\n }\n\n setValue(option ?? { id: '', value: '' });\n setSearch(val);\n combobox.closeDropdown();\n }}\n value={value?.value}\n search={search}\n startSlot={startSlot}\n endSlot={endSlot}\n onChange={(combobox, value) => {\n combobox.openDropdown();\n combobox.updateSelectedOptionIndex();\n setSearch(value ?? '');\n onChange?.(value ?? '');\n }}\n onClick={(combobox) => {\n combobox.openDropdown();\n }}\n onFocus={(combobox) => combobox.openDropdown()}\n onBlur={(combobox) => {\n combobox.closeDropdown();\n setSearch(isEmpty ? '' : value?.value);\n if (isEmpty) {\n setValue({\n id: '',\n value: '',\n });\n }\n }}\n classNames={{\n dropdown: classNames?.combobox ?? combobox(),\n root: classNames?.root ?? comboboxRoot(),\n options: classNames?.options ?? comboboxOptions(),\n option: classNames?.option ?? comboboxOption(),\n empty: classNames?.empty ?? comboboxEmpty(),\n scrollArea: {\n scrollArea:\n classNames?.scrollArea?.scrollArea ?? comboboxScrollAreaAutosize(),\n },\n textInput: {\n root:\n classNames?.textInput?.root ??\n cx(comboboxTextInput(), comboboxTextInputRoot()),\n label: classNames?.textInput?.label ?? comboboxTextInputLabel(),\n description:\n classNames?.textInput?.description ??\n comboboxTextInputDescription(),\n error: classNames?.textInput?.error ?? comboboxTextInputError(),\n wrapper: classNames?.textInput?.wrapper ?? comboboxTextInputWrapper(),\n input: classNames?.textInput?.input ?? comboboxTextInputInput(),\n section: classNames?.textInput?.section ?? comboboxTextInputSection(),\n required:\n classNames?.textInput?.required ?? comboboxTextInputRequired(),\n endSlot: {\n chevron: {\n iconWrapped:\n classNames?.textInput?.endSlot?.chevron?.iconWrapped ??\n comboboxChevron(),\n root:\n classNames?.textInput?.endSlot?.chevron?.root ??\n comboboxChevronRoot(),\n open: {\n iconRaw:\n classNames?.textInput?.endSlot?.chevron?.open?.iconRaw ??\n comboboxChevronIcon(),\n root:\n classNames?.textInput?.endSlot?.chevron?.open?.root ??\n comboboxChevronIconRoot(),\n },\n close: {\n iconRaw:\n classNames?.textInput?.endSlot?.chevron?.close?.iconRaw ??\n comboboxChevronIcon(),\n root:\n classNames?.textInput?.endSlot?.chevron?.close?.root ??\n comboboxChevronIconRoot({ invert: true }),\n },\n },\n clearButton: {\n buttonIcon:\n classNames?.textInput?.endSlot?.clearButton?.buttonIcon ??\n comboboxClearButton(),\n root:\n classNames?.textInput?.endSlot?.clearButton?.root ??\n comboboxClearButtonRoot(),\n icon:\n classNames?.textInput?.endSlot?.clearButton?.icon ??\n comboboxClearButtonIcon(),\n iconRaw: {\n iconRaw:\n classNames?.textInput?.endSlot?.clearButton?.iconRaw\n ?.iconRaw ?? comboboxClearButtonIconRaw(),\n root:\n classNames?.textInput?.endSlot?.clearButton?.iconRaw?.root ??\n comboboxClearButtonIconRawRoot(),\n },\n },\n },\n },\n }}\n >\n <Dropdown.Options>\n {optionsList.length > 0\n ? optionsList\n : creatable\n ? !exactOptionMatch &&\n search.trim().length > 0 && (\n <Dropdown.Option\n classNames={{\n option: cx(\n classNames?.create ?? comboboxOptionCreate(),\n comboboxOptionCreateCreate(),\n ),\n }}\n value='$create'\n >\n <Icon\n path='/icons/sprite-mage.svg'\n name='mage-combobox-plus'\n classNames={{\n icon:\n classNames?.createIcon?.createIcon ??\n comboboxOptionCreateIcon(),\n\n root:\n classNames?.createIcon?.root ??\n comboboxOptionCreateIconRoot(),\n iconRaw: {\n iconRaw:\n classNames?.createIcon?.iconRaw?.iconRaw ??\n comboboxOptionCreateIconIconRaw(),\n root:\n classNames?.createIcon?.iconRaw?.root ??\n comboboxOptionCreateIconIconRawRoot(),\n },\n }}\n />\n {createNewItem ?? 'Create'} {search}\n </Dropdown.Option>\n )\n : empty !== null && (\n <Dropdown.Empty\n classNames={{ empty: classNames?.empty ?? comboboxEmpty() }}\n >\n {empty ?? (emptyMessage || 'No results')}\n </Dropdown.Empty>\n )}\n </Dropdown.Options>\n </Dropdown>\n );\n};\n"],"mappings":"2mCA+EA,MAAa,GAAY,CACvB,OACA,QACA,cACA,QACA,WACA,cACA,eACA,cACA,YACA,YACA,UACA,YACA,UACA,UACA,WACA,QACA,eACA,gBACA,gBACA,YACA,gBACmB,CACnB,GAAM,CAAC,EAAO,GAAY,EAAiD,CACzE,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,SAAS,MACtD,GAAgC,CACnC,CACF,CACF,CACF,CACF,UAED,EAAC,EAAS,QAAA,CAAA,SACP,EAAY,OAAS,EAClB,EACA,EACA,CAAC,IACD,EAAO,MAAM,CAAC,OAAS,GACrB,EAAC,EAAS,OAAA,CACR,WAAY,CACV,OAAQ,EACN,GAAY,QAAU,IAAsB,CAC5C,IAA4B,CAC7B,CACF,CACD,MAAM,oBAEN,EAAC,EAAA,CACC,KAAK,yBACL,KAAK,qBACL,WAAY,CACV,KACE,GAAY,YAAY,YACxB,IAA0B,CAE5B,KACE,GAAY,YAAY,MACxB,GAA8B,CAChC,QAAS,CACP,QACE,GAAY,YAAY,SAAS,SACjC,IAAiC,CACnC,KACE,GAAY,YAAY,SAAS,MACjC,GAAqC,CACxC,CACF,EACD,CACD,GAAiB,SAAS,IAAE,IACb,CAEpB,IAAU,MACR,EAAC,EAAS,MAAA,CACR,WAAY,CAAE,MAAO,GAAY,OAAS,GAAe,CAAE,UAE1D,IAAU,GAAgB,eACZ,CAAA,CAEN,EACV"}
|
|
1
|
+
{"version":3,"file":"Combobox.mjs","names":["combobox"],"sources":["../../../../src/components/controls/combobox/Combobox.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n combobox,\n comboboxChevron,\n comboboxChevronIcon,\n comboboxChevronIconRoot,\n comboboxChevronRoot,\n comboboxClearButton,\n comboboxClearButtonIcon,\n comboboxClearButtonIconRaw,\n comboboxClearButtonIconRawRoot,\n comboboxClearButtonRoot,\n comboboxEmpty,\n comboboxOption,\n comboboxOptionCreate,\n comboboxOptionCreateCreate,\n comboboxOptionCreateIcon,\n comboboxOptionCreateIconIconRaw,\n comboboxOptionCreateIconIconRawRoot,\n comboboxOptionCreateIconRoot,\n comboboxOptions,\n comboboxRoot,\n comboboxScrollAreaAutosize,\n comboboxTextInput,\n comboboxTextInputDescription,\n comboboxTextInputError,\n comboboxTextInputInput,\n comboboxTextInputLabel,\n comboboxTextInputRequired,\n comboboxTextInputRoot,\n comboboxTextInputSection,\n comboboxTextInputWrapper,\n} from '@mage-ui/styled-system/recipes';\nimport { Icon } from '@/components/data-display';\n\nimport type { DropdownProps } from '../dropdown/Dropdown';\nimport { Dropdown } from '../dropdown/Dropdown';\n\nexport type ComboboxProps = Omit<\n DropdownProps,\n | 'classNames'\n | 'onChange'\n | 'onBlur'\n | 'onFocus'\n | 'onClick'\n | 'setValue'\n | 'children'\n> & {\n onChange?: (value?: string) => void;\n creatable?: boolean;\n options: {\n id: string | number;\n value: string;\n }[];\n empty?: string | null;\n emptyMessage?: string;\n createNewItem?: string;\n classNames?: Omit<\n NonNullable<DropdownProps['classNames']>,\n 'dropdown' | 'search'\n > & {\n combobox?: string;\n create?: string;\n createIcon?: {\n createIcon?: string;\n root?: string;\n icon?: string;\n iconRaw?: {\n iconRaw?: string;\n root?: string;\n };\n };\n header?: string;\n footer?: string;\n group?: string;\n groupLabel?: string;\n };\n};\n\nexport const Combobox = ({\n name,\n label,\n description,\n error,\n disabled,\n placeholder,\n withinPortal,\n keepMounted,\n clearable,\n creatable,\n chevron,\n startSlot,\n endSlot,\n options,\n readOnly,\n empty,\n emptyMessage,\n createNewItem,\n btnClearLabel,\n onChange,\n classNames,\n}: ComboboxProps) => {\n const [value, setValue] = useState<{ id: string | number; value: string }>({\n id: '',\n value: '',\n });\n const [search, setSearch] = useState('');\n\n const shouldFilterOptions = options.every((item) => item.value !== search);\n const exactOptionMatch = options.some(\n (item) => item.value.toLowerCase() === search.toLowerCase().trim(),\n );\n\n const filteredOptions = shouldFilterOptions\n ? options.filter((item) =>\n item.value.toLowerCase().includes(search.toLowerCase().trim()),\n )\n : options;\n\n const optionsList = filteredOptions.map(\n (item: { id: string | number; value: string }) => (\n <Dropdown.Option value={item.value} key={item.id}>\n {item.value}\n </Dropdown.Option>\n ),\n );\n\n const isEmpty = !(search.length > 0);\n\n return (\n <Dropdown\n name={name}\n label={label}\n description={description}\n placeholder={placeholder}\n disabled={disabled}\n error={error}\n withinPortal={withinPortal}\n keepMounted={keepMounted}\n clearable={clearable}\n chevron={chevron}\n readOnly={readOnly}\n btnClearLabel={btnClearLabel}\n setValue={(val, combobox) => {\n const option = options.find((option) => option.value === val);\n\n if (val === '$create') {\n setValue({ id: '', value: search });\n setSearch(search);\n combobox.closeDropdown();\n return;\n }\n if (val === undefined) {\n setValue({ id: '', value: '' });\n setSearch('');\n return;\n }\n\n setValue(option ?? { id: '', value: '' });\n setSearch(val);\n combobox.closeDropdown();\n }}\n value={value?.value}\n search={search}\n startSlot={startSlot}\n endSlot={endSlot}\n onChange={(combobox, value) => {\n combobox.openDropdown();\n combobox.updateSelectedOptionIndex();\n setSearch(value ?? '');\n onChange?.(value ?? '');\n }}\n onClick={(combobox) => {\n combobox.openDropdown();\n }}\n onFocus={(combobox) => combobox.openDropdown()}\n onBlur={(combobox) => {\n combobox.closeDropdown();\n setSearch(isEmpty ? '' : value?.value);\n if (isEmpty) {\n setValue({\n id: '',\n value: '',\n });\n }\n }}\n classNames={{\n dropdown: classNames?.combobox ?? combobox(),\n root: classNames?.root ?? comboboxRoot(),\n options: classNames?.options ?? comboboxOptions(),\n option: classNames?.option ?? comboboxOption(),\n empty: classNames?.empty ?? comboboxEmpty(),\n scrollArea: {\n scrollArea:\n classNames?.scrollArea?.scrollArea ?? comboboxScrollAreaAutosize(),\n },\n textInput: {\n root:\n classNames?.textInput?.root ??\n cx(comboboxTextInput(), comboboxTextInputRoot()),\n label: classNames?.textInput?.label ?? comboboxTextInputLabel(),\n description:\n classNames?.textInput?.description ??\n comboboxTextInputDescription(),\n error: classNames?.textInput?.error ?? comboboxTextInputError(),\n wrapper: classNames?.textInput?.wrapper ?? comboboxTextInputWrapper(),\n input: classNames?.textInput?.input ?? comboboxTextInputInput(),\n section: classNames?.textInput?.section ?? comboboxTextInputSection(),\n required:\n classNames?.textInput?.required ?? comboboxTextInputRequired(),\n endSlot: {\n chevron: {\n iconWrapped:\n classNames?.textInput?.endSlot?.chevron?.iconWrapped ??\n comboboxChevron(),\n root:\n classNames?.textInput?.endSlot?.chevron?.root ??\n comboboxChevronRoot(),\n open: {\n iconRaw:\n classNames?.textInput?.endSlot?.chevron?.open?.iconRaw ??\n comboboxChevronIcon(),\n root:\n classNames?.textInput?.endSlot?.chevron?.open?.root ??\n comboboxChevronIconRoot(),\n },\n close: {\n iconRaw:\n classNames?.textInput?.endSlot?.chevron?.close?.iconRaw ??\n comboboxChevronIcon(),\n root:\n classNames?.textInput?.endSlot?.chevron?.close?.root ??\n comboboxChevronIconRoot({ invert: true }),\n },\n },\n clearButton: {\n buttonIcon:\n classNames?.textInput?.endSlot?.clearButton?.buttonIcon ??\n comboboxClearButton(),\n root:\n classNames?.textInput?.endSlot?.clearButton?.root ??\n comboboxClearButtonRoot(),\n icon:\n classNames?.textInput?.endSlot?.clearButton?.icon ??\n comboboxClearButtonIcon(),\n iconRaw: {\n iconRaw:\n classNames?.textInput?.endSlot?.clearButton?.iconRaw\n ?.iconRaw ?? comboboxClearButtonIconRaw(),\n root:\n classNames?.textInput?.endSlot?.clearButton?.iconRaw?.root ??\n comboboxClearButtonIconRawRoot(),\n },\n },\n },\n },\n }}\n >\n <Dropdown.Options>\n {optionsList.length > 0\n ? optionsList\n : creatable\n ? !exactOptionMatch &&\n search.trim().length > 0 && (\n <Dropdown.Option\n classNames={{\n option: cx(\n classNames?.create ?? comboboxOptionCreate(),\n comboboxOptionCreateCreate(),\n ),\n }}\n value='$create'\n >\n <Icon\n path='/icons/sprite-mage.svg'\n name='mage-combobox-plus'\n classNames={{\n icon:\n classNames?.createIcon?.createIcon ??\n comboboxOptionCreateIcon(),\n\n root:\n classNames?.createIcon?.root ??\n comboboxOptionCreateIconRoot(),\n iconRaw: {\n iconRaw:\n classNames?.createIcon?.iconRaw?.iconRaw ??\n comboboxOptionCreateIconIconRaw(),\n root:\n classNames?.createIcon?.iconRaw?.root ??\n comboboxOptionCreateIconIconRawRoot(),\n },\n }}\n />\n {createNewItem ?? 'Create'} {search}\n </Dropdown.Option>\n )\n : empty !== null && (\n <Dropdown.Empty\n classNames={{ empty: classNames?.empty ?? comboboxEmpty() }}\n >\n {empty ?? (emptyMessage || 'No results')}\n </Dropdown.Empty>\n )}\n </Dropdown.Options>\n </Dropdown>\n );\n};\n"],"mappings":"2mCAiFA,MAAa,GAAY,CACvB,OACA,QACA,cACA,QACA,WACA,cACA,eACA,cACA,YACA,YACA,UACA,YACA,UACA,UACA,WACA,QACA,eACA,gBACA,gBACA,YACA,gBACmB,CACnB,GAAM,CAAC,EAAO,GAAY,EAAiD,CACzE,GAAI,GACJ,MAAO,GACR,CAAC,CACI,CAAC,EAAQ,GAAa,EAAS,GAAG,CAElC,GAAsB,EAAQ,MAAO,GAAS,EAAK,QAAU,EAAO,CACpE,GAAmB,EAAQ,KAC9B,GAAS,EAAK,MAAM,aAAa,GAAK,EAAO,aAAa,CAAC,MAAM,CACnE,CAQK,GANkB,GACpB,EAAQ,OAAQ,GACd,EAAK,MAAM,aAAa,CAAC,SAAS,EAAO,aAAa,CAAC,MAAM,CAAC,CAC/D,CACD,GAEgC,IACjC,GACC,EAAC,EAAS,OAAA,CAAO,MAAO,EAAK,eAC1B,EAAK,OADiC,EAAK,GAE5B,CAErB,CAEK,EAAU,EAAE,EAAO,OAAS,GAElC,OACE,EAAC,EAAA,CACO,OACC,QACM,cACA,cACH,WACH,QACO,eACD,cACF,YACF,UACC,WACK,gBACf,UAAW,EAAK,IAAa,CAC3B,IAAM,EAAS,EAAQ,KAAM,GAAW,EAAO,QAAU,EAAI,CAE7D,GAAI,IAAQ,UAAW,CACrB,EAAS,CAAE,GAAI,GAAI,MAAO,EAAQ,CAAC,CACnC,EAAU,EAAO,CACjB,EAAS,eAAe,CACxB,OAEF,GAAI,IAAQ,IAAA,GAAW,CACrB,EAAS,CAAE,GAAI,GAAI,MAAO,GAAI,CAAC,CAC/B,EAAU,GAAG,CACb,OAGF,EAAS,GAAU,CAAE,GAAI,GAAI,MAAO,GAAI,CAAC,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,GAAqB,CACvB,KACE,GAAY,WAAW,SAAS,SAAS,OAAO,MAChD,EAAwB,CAAE,OAAQ,GAAM,CAAC,CAC5C,CACF,CACD,YAAa,CACX,WACE,GAAY,WAAW,SAAS,aAAa,YAC7C,GAAqB,CACvB,KACE,GAAY,WAAW,SAAS,aAAa,MAC7C,IAAyB,CAC3B,KACE,GAAY,WAAW,SAAS,aAAa,MAC7C,IAAyB,CAC3B,QAAS,CACP,QACE,GAAY,WAAW,SAAS,aAAa,SACzC,SAAW,GAA4B,CAC7C,KACE,GAAY,WAAW,SAAS,aAAa,SAAS,MACtD,GAAgC,CACnC,CACF,CACF,CACF,CACF,UAED,EAAC,EAAS,QAAA,CAAA,SACP,EAAY,OAAS,EAClB,EACA,EACE,CAAC,IACD,EAAO,MAAM,CAAC,OAAS,GACrB,EAAC,EAAS,OAAA,CACR,WAAY,CACV,OAAQ,EACN,GAAY,QAAU,IAAsB,CAC5C,IAA4B,CAC7B,CACF,CACD,MAAM,oBAEN,EAAC,EAAA,CACC,KAAK,yBACL,KAAK,qBACL,WAAY,CACV,KACE,GAAY,YAAY,YACxB,IAA0B,CAE5B,KACE,GAAY,YAAY,MACxB,GAA8B,CAChC,QAAS,CACP,QACE,GAAY,YAAY,SAAS,SACjC,IAAiC,CACnC,KACE,GAAY,YAAY,SAAS,MACjC,GAAqC,CACxC,CACF,EACD,CACD,GAAiB,SAAS,IAAE,IACb,CAEpB,IAAU,MACR,EAAC,EAAS,MAAA,CACR,WAAY,CAAE,MAAO,GAAY,OAAS,GAAe,CAAE,UAE1D,IAAU,GAAgB,eACZ,CAAA,CAER,EACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.mts","names":[],"sources":["../../../../src/components/controls/date-picker/DatePicker.tsx"],"mappings":";;;;KAoDY,eAAA,GAAkB,IAAA,
|
|
1
|
+
{"version":3,"file":"DatePicker.d.mts","names":[],"sources":["../../../../src/components/controls/date-picker/DatePicker.tsx"],"mappings":";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AAA;AAAA;AAAA,KAeG,qBAAA;EACH,QAAA;EACA,KAAA;EACA,OAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.mjs","names":[],"sources":["../../../../src/components/controls/date-picker/DatePicker.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n datePicker,\n datePickerArrow,\n datePickerButtonIcon,\n datePickerButtonIconRoot,\n datePickerCalendarHeader,\n datePickerCalendarHeaderControl,\n datePickerCalendarHeaderControlIcon,\n datePickerCalendarHeaderLevel,\n datePickerDatePickerRoot,\n datePickerDay,\n datePickerDescription,\n datePickerDropdown,\n datePickerError,\n datePickerIconIcon,\n datePickerIconIconRaw,\n datePickerIconIconRawRoot,\n datePickerIconRoot,\n datePickerInput,\n datePickerLabel,\n datePickerLevelsGroup,\n datePickerMonth,\n datePickerMonthCell,\n datePickerMonthRow,\n datePickerMonthsList,\n datePickerMonthsListCell,\n datePickerMonthsListControl,\n datePickerMonthsListRow,\n datePickerMonthTbody,\n datePickerMonthThead,\n datePickerOverlay,\n datePickerPlaceholder,\n datePickerPresetButton,\n datePickerPresetsList,\n datePickerRequired,\n datePickerRoot,\n datePickerSection,\n datePickerWeekday,\n datePickerWeekdaysRow,\n datePickerWeekNumber,\n datePickerWrapper,\n datePickerYearsList,\n datePickerYearsListCell,\n datePickerYearsListControl,\n datePickerYearsListRow,\n} from '@mage-ui/styled-system/recipes';\nimport { DatePickerInput, type DateValue } from '@mantine/dates';\nimport { Icon, type IconProps } from '@/components/data-display';\n\nexport type DatePickerProps = Omit<ComponentProps<'input'>, 'size' | 'value' | 'onChange'> & {\n label?: ReactNode;\n description?: ReactNode;\n error?: ReactNode;\n classNames?: DatePickerClassNames;\n value?: DateValue;\n onChange?: (date: Date | string | null) => void;\n locale?: string;\n valueFormat?: string;\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n minDate?: Date;\n maxDate?: Date;\n clearable?: boolean;\n};\n\nexport const DatePicker = ({\n classNames,\n name,\n label,\n placeholder,\n description,\n error,\n required,\n value,\n onChange,\n locale,\n valueFormat,\n firstDayOfWeek,\n minDate,\n maxDate,\n clearable,\n}: DatePickerProps): ReactNode => {\n return (\n <DatePickerInput\n name={name}\n label={label}\n placeholder={placeholder}\n description={description}\n error={error}\n withAsterisk={required}\n value={value}\n onChange={onChange}\n locale={locale}\n valueFormat={valueFormat}\n firstDayOfWeek={firstDayOfWeek}\n minDate={minDate}\n maxDate={maxDate}\n clearable={clearable}\n classNames={datePickerClassNames(classNames)}\n popoverProps={{\n classNames: popoverClassNames(classNames),\n }}\n leftSection={\n <Icon\n path='/icons/sprite-mage.svg'\n name='mage-date-picker-calendar'\n classNames={iconClassNames(classNames)}\n />\n }\n clearButtonProps={{\n className: buttonIconClassNames(),\n }}\n />\n );\n};\n\ntype DatePickerClassNames =\n InputClassNamesType &\n CalendarClassNamesType &\n CalendarHeaderClassNamesType &\n CalendarDayClassNamesType &\n CalendarWeekClassNamesType &\n CalendarMonthClassNamesType &\n CalendarMonthsListClassNamesType &\n CalendarYearsListClassNamesType &\n PopoverClassNamesType;\n\ntype InputClassNamesType = {\n datePicker?: string;\n root?: string;\n wrapper?: string;\n input?: string;\n label?: string;\n error?: string;\n description?: string;\n placeholder?: string;\n section?: string;\n required?: string;\n datePickerRoot?: string;\n};\n\nconst inputClassNames = (classNames?: InputClassNamesType) => {\n return {\n root: cx(\n classNames?.datePicker ?? datePicker(),\n classNames?.root ?? datePickerRoot(),\n ),\n wrapper: classNames?.wrapper ?? datePickerWrapper(),\n input: cx(classNames?.input ?? datePickerInput(), 'peer'),\n label: classNames?.label ?? datePickerLabel(),\n error: classNames?.error ?? datePickerError(),\n description: classNames?.description ?? datePickerDescription(),\n placeholder: classNames?.placeholder ?? datePickerPlaceholder(),\n section: cx(classNames?.section ?? datePickerSection(), 'group'),\n required: classNames?.required ?? datePickerRequired(),\n datePickerRoot: classNames?.datePickerRoot ?? datePickerDatePickerRoot(),\n };\n};\n\ntype IconClassNamesType = IconProps['classNames'];\n\nconst iconClassNames = (classNames?: IconClassNamesType) => {\n return {\n icon: classNames?.icon ?? datePickerIconIcon(),\n root: classNames?.root ?? datePickerIconRoot(),\n iconRaw: {\n iconRaw: classNames?.iconRaw?.iconRaw ?? datePickerIconIconRaw(),\n root: classNames?.iconRaw?.root ?? datePickerIconIconRawRoot(),\n },\n };\n}\n\ntype ButtonIconClassNamesType = {\n buttonIcon?: string;\n buttonIconRoot?: string;\n}\n\nconst buttonIconClassNames = (classNames?: ButtonIconClassNamesType) => {\n return cx(\n classNames?.buttonIcon ?? datePickerButtonIcon(), \n classNames?.buttonIconRoot ?? datePickerButtonIconRoot(),\n );\n}\n\n\ntype CalendarHeaderClassNamesType = {\n calendarHeaderControl?: string;\n calendarHeader?: string;\n calendarHeaderLevel?: string;\n calendarHeaderControlIcon?: string;\n};\n\nconst calendarHeaderClassNames = (\n classNames?: CalendarHeaderClassNamesType,\n) => {\n return {\n calendarHeader:\n classNames?.calendarHeader ?? datePickerCalendarHeader(),\n calendarHeaderControl:\n classNames?.calendarHeaderControl ?? datePickerCalendarHeaderControl(),\n calendarHeaderLevel:\n classNames?.calendarHeaderLevel ?? datePickerCalendarHeaderLevel(),\n calendarHeaderControlIcon:\n classNames?.calendarHeaderControlIcon ??\n datePickerCalendarHeaderControlIcon(),\n };\n};\n\ntype CalendarClassNamesType = {\n levelsGroup?: string;\n presetsList?: string;\n presetButton?: string;\n};\n\nconst calendarClassNames = (classNames?: CalendarClassNamesType) => {\n return {\n levelsGroup: classNames?.levelsGroup ?? datePickerLevelsGroup(),\n presetsList: classNames?.presetsList ?? datePickerPresetsList(),\n presetButton: classNames?.presetButton ?? datePickerPresetButton(),\n };\n}\n\ntype CalendarDayClassNamesType = {\n day?: string;\n};\n\nconst calendarDayClassNames = (classNames?: CalendarDayClassNamesType) => {\n return {\n day: classNames?.day ?? datePickerDay(),\n };\n}\n\ntype CalendarWeekClassNamesType = {\n weekDaysRow?: string;\n weekDay?: string;\n weekNumber?: string;\n};\n\nconst calendarWeekClassNames = (classNames?: CalendarWeekClassNamesType) => {\n return {\n weekdaysRow: classNames?.weekDaysRow ?? datePickerWeekdaysRow(),\n weekday: classNames?.weekDay ?? datePickerWeekday(),\n weekNumber: classNames?.weekNumber ?? datePickerWeekNumber(),\n };\n}\n\ntype CalendarMonthClassNamesType = {\n month?: string;\n monthRow?: string;\n monthCell?: string;\n monthThead?: string;\n monthTbody?: string;\n};\n\nconst calendarMonthClassNames = (classNames?: CalendarMonthClassNamesType) => {\n return {\n month: classNames?.month ?? datePickerMonth(),\n monthRow: classNames?.monthRow ?? datePickerMonthRow(),\n monthThead: classNames?.monthThead ?? datePickerMonthThead(),\n monthTbody: classNames?.monthTbody ?? datePickerMonthTbody(),\n monthCell: classNames?.monthCell ?? datePickerMonthCell(),\n };\n};\n\ntype CalendarMonthsListClassNamesType = {\n monthsList?: string;\n monthsListRow?: string;\n monthsListCell?: string;\n monthsListControl?: string;\n};\n\nconst calendarMonthsListClassNames = (\n classNames?: CalendarMonthsListClassNamesType,\n) => {\n return {\n monthsList: classNames?.monthsList ?? datePickerMonthsList(),\n monthsListRow: classNames?.monthsListRow ?? datePickerMonthsListRow(),\n monthsListCell: classNames?.monthsListCell ?? datePickerMonthsListCell(),\n monthsListControl:\n classNames?.monthsListControl ?? datePickerMonthsListControl(),\n };\n};\n\ntype CalendarYearsListClassNamesType = {\n yearsList?: string;\n yearsListRow?: string;\n yearsListCell?: string;\n yearsListControl?: string;\n};\n\nconst calendarYearsListClassNames = (\n classNames?: CalendarYearsListClassNamesType,\n) => {\n return {\n yearsList: classNames?.yearsList ?? datePickerYearsList(),\n yearsListRow: classNames?.yearsListRow ?? datePickerYearsListRow(),\n yearsListCell: classNames?.yearsListCell ?? datePickerYearsListCell(),\n yearsListControl:\n classNames?.yearsListControl ?? datePickerYearsListControl(),\n };\n};\n\ntype PopoverClassNamesType = {\n dropdown?: string;\n arrow?: string;\n overlay?: string;\n};\n\nconst popoverClassNames = (classNames?: PopoverClassNamesType) => {\n return {\n dropdown: classNames?.dropdown ?? datePickerDropdown(),\n arrow: classNames?.arrow ?? datePickerArrow(),\n overlay: classNames?.overlay ?? datePickerOverlay(),\n };\n};\n\nconst datePickerClassNames = (classNames?: DatePickerClassNames) => {\n return {\n ...inputClassNames(classNames),\n ...calendarClassNames(classNames),\n ...calendarHeaderClassNames(classNames),\n ...calendarDayClassNames(classNames),\n ...calendarWeekClassNames(classNames),\n ...calendarMonthClassNames(classNames),\n ...calendarMonthsListClassNames(classNames),\n ...calendarYearsListClassNames(classNames),\n };\n};\n"],"mappings":"y3CAmEA,MAAa,GAAc,CACzB,aACA,OACA,QACA,cACA,cACA,QACA,WACA,QACA,WACA,SACA,cACA,iBACA,UACA,UACA,eAGE,EAAC,EAAA,CACO,OACC,QACM,cACA,cACN,QACP,aAAc,EACP,QACG,WACF,SACK,cACG,iBACP,UACA,UACE,YACX,WAAY,GAAqB,EAAW,CAC5C,aAAc,CACZ,WAAY,GAAkB,EAAW,CAC1C,CACD,YACE,EAAC,EAAA,CACC,KAAK,yBACL,KAAK,4BACL,WAAY,EAAe,EAAW,EACtC,CAEJ,iBAAkB,CAChB,UAAW,GAAsB,CAClC,EACD,CA6BA,EAAmB,IAChB,CACL,KAAM,EACJ,GAAY,YAAc,GAAY,CACtC,GAAY,MAAQ,GAAgB,CACrC,CACD,QAAS,GAAY,SAAW,GAAmB,CACnD,MAAO,EAAG,GAAY,OAAS,GAAiB,CAAE,OAAO,CACzD,MAAO,GAAY,OAAS,GAAiB,CAC7C,MAAO,GAAY,OAAS,GAAiB,CAC7C,YAAa,GAAY,aAAe,GAAuB,CAC/D,YAAa,GAAY,aAAe,GAAuB,CAC/D,QAAS,EAAG,GAAY,SAAW,GAAmB,CAAE,QAAQ,CAChE,SAAU,GAAY,UAAY,GAAoB,CACtD,eAAgB,GAAY,gBAAkB,GAA0B,CACzE,EAKG,EAA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AAY,GAAoB,CACtD,MAAO,GAAY,OAAS,GAAiB,CAC7C,QAAS,GAAY,SAAW,GAAmB,CACpD,EAGG,GAAwB,IACrB,CACL,GAAG,EAAgB,EAAW,CAC9B,GAAG,EAAmB,EAAW,CACjC,GAAG,EAAyB,EAAW,CACvC,GAAG,EAAsB,EAAW,CACpC,GAAG,GAAuB,EAAW,CACrC,GAAG,GAAwB,EAAW,CACtC,GAAG,GAA6B,EAAW,CAC3C,GAAG,GAA4B,EAAW,CAC3C"}
|
|
1
|
+
{"version":3,"file":"DatePicker.mjs","names":[],"sources":["../../../../src/components/controls/date-picker/DatePicker.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n datePicker,\n datePickerArrow,\n datePickerButtonIcon,\n datePickerButtonIconRoot,\n datePickerCalendarHeader,\n datePickerCalendarHeaderControl,\n datePickerCalendarHeaderControlIcon,\n datePickerCalendarHeaderLevel,\n datePickerDatePickerRoot,\n datePickerDay,\n datePickerDescription,\n datePickerDropdown,\n datePickerError,\n datePickerIconIcon,\n datePickerIconIconRaw,\n datePickerIconIconRawRoot,\n datePickerIconRoot,\n datePickerInput,\n datePickerLabel,\n datePickerLevelsGroup,\n datePickerMonth,\n datePickerMonthCell,\n datePickerMonthRow,\n datePickerMonthsList,\n datePickerMonthsListCell,\n datePickerMonthsListControl,\n datePickerMonthsListRow,\n datePickerMonthTbody,\n datePickerMonthThead,\n datePickerOverlay,\n datePickerPlaceholder,\n datePickerPresetButton,\n datePickerPresetsList,\n datePickerRequired,\n datePickerRoot,\n datePickerSection,\n datePickerWeekday,\n datePickerWeekdaysRow,\n datePickerWeekNumber,\n datePickerWrapper,\n datePickerYearsList,\n datePickerYearsListCell,\n datePickerYearsListControl,\n datePickerYearsListRow,\n} from '@mage-ui/styled-system/recipes';\nimport { DatePickerInput, type DateValue } from '@mantine/dates';\nimport { Icon, type IconProps } from '@/components/data-display';\n\nexport type DatePickerProps = Omit<\n ComponentProps<'input'>,\n 'size' | 'value' | 'onChange'\n> & {\n label?: ReactNode;\n description?: ReactNode;\n error?: ReactNode;\n classNames?: DatePickerClassNames;\n value?: DateValue;\n onChange?: (date: Date | string | null) => void;\n locale?: string;\n valueFormat?: string;\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n minDate?: Date;\n maxDate?: Date;\n clearable?: boolean;\n};\n\nexport const DatePicker = ({\n classNames,\n name,\n label,\n placeholder,\n description,\n error,\n required,\n value,\n onChange,\n locale,\n valueFormat,\n firstDayOfWeek,\n minDate,\n maxDate,\n clearable,\n}: DatePickerProps): ReactNode => {\n return (\n <DatePickerInput\n name={name}\n label={label}\n placeholder={placeholder}\n description={description}\n error={error}\n withAsterisk={required}\n value={value}\n onChange={onChange}\n locale={locale}\n valueFormat={valueFormat}\n firstDayOfWeek={firstDayOfWeek}\n minDate={minDate}\n maxDate={maxDate}\n clearable={clearable}\n classNames={datePickerClassNames(classNames)}\n popoverProps={{\n classNames: popoverClassNames(classNames),\n }}\n leftSection={\n <Icon\n path='/icons/sprite-mage.svg'\n name='mage-date-picker-calendar'\n classNames={iconClassNames(classNames)}\n />\n }\n clearButtonProps={{\n className: buttonIconClassNames(),\n }}\n />\n );\n};\n\ntype DatePickerClassNames = InputClassNamesType &\n CalendarClassNamesType &\n CalendarHeaderClassNamesType &\n CalendarDayClassNamesType &\n CalendarWeekClassNamesType &\n CalendarMonthClassNamesType &\n CalendarMonthsListClassNamesType &\n CalendarYearsListClassNamesType &\n PopoverClassNamesType;\n\ntype InputClassNamesType = {\n datePicker?: string;\n root?: string;\n wrapper?: string;\n input?: string;\n label?: string;\n error?: string;\n description?: string;\n placeholder?: string;\n section?: string;\n required?: string;\n datePickerRoot?: string;\n};\n\nconst inputClassNames = (classNames?: InputClassNamesType) => {\n return {\n root: cx(\n classNames?.datePicker ?? datePicker(),\n classNames?.root ?? datePickerRoot(),\n ),\n wrapper: classNames?.wrapper ?? datePickerWrapper(),\n input: cx(classNames?.input ?? datePickerInput(), 'peer'),\n label: classNames?.label ?? datePickerLabel(),\n error: classNames?.error ?? datePickerError(),\n description: classNames?.description ?? datePickerDescription(),\n placeholder: classNames?.placeholder ?? datePickerPlaceholder(),\n section: cx(classNames?.section ?? datePickerSection(), 'group'),\n required: classNames?.required ?? datePickerRequired(),\n datePickerRoot: classNames?.datePickerRoot ?? datePickerDatePickerRoot(),\n };\n};\n\ntype IconClassNamesType = IconProps['classNames'];\n\nconst iconClassNames = (classNames?: IconClassNamesType) => {\n return {\n icon: classNames?.icon ?? datePickerIconIcon(),\n root: classNames?.root ?? datePickerIconRoot(),\n iconRaw: {\n iconRaw: classNames?.iconRaw?.iconRaw ?? datePickerIconIconRaw(),\n root: classNames?.iconRaw?.root ?? datePickerIconIconRawRoot(),\n },\n };\n};\n\ntype ButtonIconClassNamesType = {\n buttonIcon?: string;\n buttonIconRoot?: string;\n};\n\nconst buttonIconClassNames = (classNames?: ButtonIconClassNamesType) => {\n return cx(\n classNames?.buttonIcon ?? datePickerButtonIcon(),\n classNames?.buttonIconRoot ?? datePickerButtonIconRoot(),\n );\n};\n\ntype CalendarHeaderClassNamesType = {\n calendarHeaderControl?: string;\n calendarHeader?: string;\n calendarHeaderLevel?: string;\n calendarHeaderControlIcon?: string;\n};\n\nconst calendarHeaderClassNames = (\n classNames?: CalendarHeaderClassNamesType,\n) => {\n return {\n calendarHeader: classNames?.calendarHeader ?? datePickerCalendarHeader(),\n calendarHeaderControl:\n classNames?.calendarHeaderControl ?? datePickerCalendarHeaderControl(),\n calendarHeaderLevel:\n classNames?.calendarHeaderLevel ?? datePickerCalendarHeaderLevel(),\n calendarHeaderControlIcon:\n classNames?.calendarHeaderControlIcon ??\n datePickerCalendarHeaderControlIcon(),\n };\n};\n\ntype CalendarClassNamesType = {\n levelsGroup?: string;\n presetsList?: string;\n presetButton?: string;\n};\n\nconst calendarClassNames = (classNames?: CalendarClassNamesType) => {\n return {\n levelsGroup: classNames?.levelsGroup ?? datePickerLevelsGroup(),\n presetsList: classNames?.presetsList ?? datePickerPresetsList(),\n presetButton: classNames?.presetButton ?? datePickerPresetButton(),\n };\n};\n\ntype CalendarDayClassNamesType = {\n day?: string;\n};\n\nconst calendarDayClassNames = (classNames?: CalendarDayClassNamesType) => {\n return {\n day: classNames?.day ?? datePickerDay(),\n };\n};\n\ntype CalendarWeekClassNamesType = {\n weekDaysRow?: string;\n weekDay?: string;\n weekNumber?: string;\n};\n\nconst calendarWeekClassNames = (classNames?: CalendarWeekClassNamesType) => {\n return {\n weekdaysRow: classNames?.weekDaysRow ?? datePickerWeekdaysRow(),\n weekday: classNames?.weekDay ?? datePickerWeekday(),\n weekNumber: classNames?.weekNumber ?? datePickerWeekNumber(),\n };\n};\n\ntype CalendarMonthClassNamesType = {\n month?: string;\n monthRow?: string;\n monthCell?: string;\n monthThead?: string;\n monthTbody?: string;\n};\n\nconst calendarMonthClassNames = (classNames?: CalendarMonthClassNamesType) => {\n return {\n month: classNames?.month ?? datePickerMonth(),\n monthRow: classNames?.monthRow ?? datePickerMonthRow(),\n monthThead: classNames?.monthThead ?? datePickerMonthThead(),\n monthTbody: classNames?.monthTbody ?? datePickerMonthTbody(),\n monthCell: classNames?.monthCell ?? datePickerMonthCell(),\n };\n};\n\ntype CalendarMonthsListClassNamesType = {\n monthsList?: string;\n monthsListRow?: string;\n monthsListCell?: string;\n monthsListControl?: string;\n};\n\nconst calendarMonthsListClassNames = (\n classNames?: CalendarMonthsListClassNamesType,\n) => {\n return {\n monthsList: classNames?.monthsList ?? datePickerMonthsList(),\n monthsListRow: classNames?.monthsListRow ?? datePickerMonthsListRow(),\n monthsListCell: classNames?.monthsListCell ?? datePickerMonthsListCell(),\n monthsListControl:\n classNames?.monthsListControl ?? datePickerMonthsListControl(),\n };\n};\n\ntype CalendarYearsListClassNamesType = {\n yearsList?: string;\n yearsListRow?: string;\n yearsListCell?: string;\n yearsListControl?: string;\n};\n\nconst calendarYearsListClassNames = (\n classNames?: CalendarYearsListClassNamesType,\n) => {\n return {\n yearsList: classNames?.yearsList ?? datePickerYearsList(),\n yearsListRow: classNames?.yearsListRow ?? datePickerYearsListRow(),\n yearsListCell: classNames?.yearsListCell ?? datePickerYearsListCell(),\n yearsListControl:\n classNames?.yearsListControl ?? datePickerYearsListControl(),\n };\n};\n\ntype PopoverClassNamesType = {\n dropdown?: string;\n arrow?: string;\n overlay?: string;\n};\n\nconst popoverClassNames = (classNames?: PopoverClassNamesType) => {\n return {\n dropdown: classNames?.dropdown ?? datePickerDropdown(),\n arrow: classNames?.arrow ?? datePickerArrow(),\n overlay: classNames?.overlay ?? datePickerOverlay(),\n };\n};\n\nconst datePickerClassNames = (classNames?: DatePickerClassNames) => {\n return {\n ...inputClassNames(classNames),\n ...calendarClassNames(classNames),\n ...calendarHeaderClassNames(classNames),\n ...calendarDayClassNames(classNames),\n ...calendarWeekClassNames(classNames),\n ...calendarMonthClassNames(classNames),\n ...calendarMonthsListClassNames(classNames),\n ...calendarYearsListClassNames(classNames),\n };\n};\n"],"mappings":"y3CAsEA,MAAa,GAAc,CACzB,aACA,OACA,QACA,cACA,cACA,QACA,WACA,QACA,WACA,SACA,cACA,iBACA,UACA,UACA,eAGE,EAAC,EAAA,CACO,OACC,QACM,cACA,cACN,QACP,aAAc,EACP,QACG,WACF,SACK,cACG,iBACP,UACA,UACE,YACX,WAAY,GAAqB,EAAW,CAC5C,aAAc,CACZ,WAAY,GAAkB,EAAW,CAC1C,CACD,YACE,EAAC,EAAA,CACC,KAAK,yBACL,KAAK,4BACL,WAAY,EAAe,EAAW,EACtC,CAEJ,iBAAkB,CAChB,UAAW,GAAsB,CAClC,EACD,CA4BA,EAAmB,IAChB,CACL,KAAM,EACJ,GAAY,YAAc,GAAY,CACtC,GAAY,MAAQ,GAAgB,CACrC,CACD,QAAS,GAAY,SAAW,GAAmB,CACnD,MAAO,EAAG,GAAY,OAAS,GAAiB,CAAE,OAAO,CACzD,MAAO,GAAY,OAAS,GAAiB,CAC7C,MA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BACE,GAAY,mBAAqB,GAA6B,CACjE,EAUG,GACJ,IAEO,CACL,UAAW,GAAY,WAAa,GAAqB,CACzD,aAAc,GAAY,cAAgB,GAAwB,CAClE,cAAe,GAAY,eAAiB,GAAyB,CACrE,iBACE,GAAY,kBAAoB,GAA4B,CAC/D,EASG,GAAqB,IAClB,CACL,SAAU,GAAY,UAAY,GAAoB,CACtD,MAAO,GAAY,OAAS,GAAiB,CAC7C,QAAS,GAAY,SAAW,GAAmB,CACpD,EAGG,GAAwB,IACrB,CACL,GAAG,EAAgB,EAAW,CAC9B,GAAG,EAAmB,EAAW,CACjC,GAAG,EAAyB,EAAW,CACvC,GAAG,EAAsB,EAAW,CACpC,GAAG,GAAuB,EAAW,CACrC,GAAG,GAAwB,EAAW,CACtC,GAAG,GAA6B,EAAW,CAC3C,GAAG,GAA4B,EAAW,CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.mts","names":[],"sources":["../../../../src/components/controls/dropdown/Dropdown.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Dropdown.d.mts","names":[],"sources":["../../../../src/components/controls/dropdown/Dropdown.tsx"],"mappings":";;;;;KAuCY,wBAAA;EACV,OAAA;IACE,WAAA;IACA,IAAA;IACA,IAAA;MACE,OAAA;MACA,IAAA;IAAA;IAEF,KAAA;MACE,OAAA;MACA,IAAA;IAAA;EAAA;EAGJ,WAAA;IACE,UAAA;IACA,IAAA;IACA,IAAA;IACA,OAAA;MACE,OAAA;MACA,IAAA;IAAA;EAAA;AAAA;AAAA,KAKM,2BAAA;EACV,SAAA;EACA,IAAA;EACA,KAAA;EACA,WAAA;EACA,KAAA;EACA,OAAA;EACA,KAAA;EACA,OAAA;EACA,QAAA;EACA,OAAA,GAAU,wBAAA;AAAA;AAAA,KAGA,aAAA;EACV,QAAA,GAAW,KAAA,EAAO,aAAA,EAAe,KAAA;EACjC,OAAA,GAAU,KAAA,EAAO,aAAA;EACjB,MAAA,GAAS,KAAA,EAAO,aAAA;EAChB,OAAA,GAAU,KAAA,EAAO,aAAA;EACjB,QAAA,EAAU,SAAA;EACV,SAAA,GAAY,SAAA;EACZ,OAAA,GAAU,SAAA;EACV,QAAA;EACA,IAAA;EACA,KAAA,GAAQ,SAAA;EACR,WAAA,GAAc,SAAA;EACd,KAAA,GAAQ,SAAA;EACR,QAAA;EACA,WAAA;EACA,YAAA;EACA,WAAA;EACA,SAAA;EACA,OAAA;EACA,MAAA;EACA,UAAA;IACE,QAAA;IACA,IAAA;IACA,OAAA;IACA,MAAA;IACA,KAAA;IACA,MAAA;IACA,SAAA,GAAY,2BAAA;IACZ,UAAA;MACE,UAAA;IAAA;EAAA;EAGJ,KAAA;EACA,MAAA;EACA,QAAA,GAAW,KAAA,sBAA2B,QAAA,EAAU,aAAA;EAChD,KAAA,GAAQ,aAAA;EACR,MAAA,GAAS,SAAA;EACT,aAAA;EACA,cAAA;AAAA"}
|