zaravand-ui 5.1.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/Accordion/Accordion.cjs +1 -0
- package/dist/components/Accordion/Accordion.d.cts +8 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.interface.d.cts +103 -0
- package/dist/components/Accordion/Accordion.interface.d.ts +8 -0
- package/dist/components/Accordion/Accordion.js +361 -0
- package/dist/components/Accordion/Accordion.variant.cjs +1 -0
- package/dist/components/Accordion/Accordion.variant.d.cts +16 -0
- package/dist/components/Accordion/Accordion.variant.d.ts +1 -4
- package/dist/components/Accordion/Accordion.variant.js +17 -0
- package/dist/components/Avatar/Avatar.cjs +1 -0
- package/dist/components/Avatar/Avatar.d.cts +6 -0
- package/dist/components/Avatar/Avatar.d.ts +4 -3
- package/dist/components/Avatar/Avatar.interface.d.cts +65 -0
- package/dist/components/Avatar/Avatar.interface.d.ts +2 -2
- package/dist/components/Avatar/Avatar.js +244 -0
- package/dist/components/Avatar/Avatar.utils.cjs +1 -0
- package/dist/components/Avatar/Avatar.utils.d.cts +6 -0
- package/dist/components/Avatar/Avatar.utils.js +8 -0
- package/dist/components/Avatar/Avatar.variant.cjs +1 -0
- package/dist/components/Avatar/Avatar.variant.d.cts +22 -0
- package/dist/components/Avatar/Avatar.variant.d.ts +2 -2
- package/dist/components/Avatar/Avatar.variant.js +54 -0
- package/dist/components/Button/Button.cjs +1 -0
- package/dist/components/Button/Button.d.cts +3 -0
- package/dist/components/Button/Button.d.ts +1 -2
- package/dist/components/Button/Button.interface.d.cts +21 -0
- package/dist/components/Button/Button.interface.d.ts +9 -2
- package/dist/components/Button/Button.js +69 -0
- package/dist/components/Button/Button.variant.cjs +1 -0
- package/dist/components/Button/Button.variant.d.cts +7 -0
- package/dist/components/Button/Button.variant.d.ts +6 -11
- package/dist/components/Button/Button.variant.js +64 -0
- package/dist/components/Checkbox/Checkbox.cjs +1 -0
- package/dist/components/Checkbox/Checkbox.d.cts +4 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.interface.d.cts +35 -0
- package/dist/components/Checkbox/Checkbox.interface.d.ts +19 -3
- package/dist/components/Checkbox/Checkbox.js +71 -0
- package/dist/components/Checkbox/Checkbox.variant.cjs +1 -0
- package/dist/components/Checkbox/Checkbox.variant.d.cts +13 -0
- package/dist/components/Checkbox/Checkbox.variant.d.ts +9 -4
- package/dist/components/Checkbox/Checkbox.variant.js +32 -0
- package/dist/components/DatePicker/DatePicker.cjs +1 -0
- package/dist/components/DatePicker/DatePicker.d.cts +6 -0
- package/dist/components/DatePicker/DatePicker.d.ts +5 -7
- package/dist/components/DatePicker/DatePicker.interface.d.cts +83 -0
- package/dist/components/DatePicker/DatePicker.interface.d.ts +35 -7
- package/dist/components/DatePicker/DatePicker.js +721 -0
- package/dist/components/DatePicker/DatePicker.utils.cjs +1 -0
- package/dist/components/DatePicker/DatePicker.utils.d.cts +73 -0
- package/dist/components/DatePicker/DatePicker.utils.d.ts +73 -0
- package/dist/components/DatePicker/DatePicker.utils.js +263 -0
- package/dist/components/DatePicker/DatePicker.variant.cjs +1 -0
- package/dist/components/DatePicker/DatePicker.variant.d.cts +18 -0
- package/dist/components/DatePicker/DatePicker.variant.d.ts +1 -3
- package/dist/components/DatePicker/DatePicker.variant.js +25 -0
- package/dist/components/DatePicker/DatePickerMonthSlider.cjs +1 -0
- package/dist/components/DatePicker/DatePickerMonthSlider.d.cts +25 -0
- package/dist/components/DatePicker/DatePickerMonthSlider.d.ts +25 -0
- package/dist/components/DatePicker/DatePickerMonthSlider.js +98 -0
- package/dist/components/DatePicker/DatePickerWheel.cjs +1 -0
- package/dist/components/DatePicker/DatePickerWheel.d.cts +30 -0
- package/dist/components/DatePicker/DatePickerWheel.d.ts +30 -0
- package/dist/components/DatePicker/DatePickerWheel.js +156 -0
- package/dist/components/Dialog/Dialog.cjs +1 -0
- package/dist/components/Dialog/Dialog.d.cts +4 -0
- package/dist/components/Dialog/Dialog.d.ts +3 -2
- package/dist/components/Dialog/Dialog.interface.d.cts +37 -0
- package/dist/components/Dialog/Dialog.interface.d.ts +16 -0
- package/dist/components/Dialog/Dialog.js +92 -0
- package/dist/components/Dialog/Dialog.variant.cjs +1 -0
- package/dist/components/Dialog/Dialog.variant.d.cts +7 -0
- package/dist/components/Dialog/Dialog.variant.js +6 -0
- package/dist/components/Dialog/DialogDragHandle.cjs +1 -0
- package/dist/components/Dialog/DialogDragHandle.d.cts +11 -0
- package/dist/components/Dialog/DialogDragHandle.d.ts +11 -0
- package/dist/components/Dialog/DialogDragHandle.js +55 -0
- package/dist/components/Input/Input.cjs +1 -0
- package/dist/components/Input/Input.d.cts +4 -0
- package/dist/components/Input/Input.d.ts +3 -2
- package/dist/components/Input/Input.formatting.cjs +1 -0
- package/dist/components/Input/Input.formatting.d.cts +40 -0
- package/dist/components/Input/Input.formatting.d.ts +40 -0
- package/dist/components/Input/Input.formatting.js +203 -0
- package/dist/components/Input/Input.interface.d.cts +37 -0
- package/dist/components/Input/Input.interface.d.ts +10 -2
- package/dist/components/Input/Input.js +153 -0
- package/dist/components/Input/Input.variant.cjs +1 -0
- package/dist/components/Input/Input.variant.d.cts +2 -0
- package/dist/components/Input/Input.variant.d.ts +1 -3
- package/dist/components/Input/Input.variant.js +11 -0
- package/dist/components/Pagination/Pagination.cjs +1 -0
- package/dist/components/Pagination/Pagination.d.cts +4 -0
- package/dist/components/Pagination/Pagination.d.ts +3 -2
- package/dist/components/Pagination/Pagination.interface.d.cts +12 -0
- package/dist/components/Pagination/Pagination.js +156 -0
- package/dist/components/Pagination/Pagination.variant.cjs +1 -0
- package/dist/components/Pagination/Pagination.variant.d.cts +13 -0
- package/dist/components/Pagination/Pagination.variant.d.ts +3 -1
- package/dist/components/Pagination/Pagination.variant.js +26 -0
- package/dist/components/RadioGroup/RadioGroup.cjs +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.cts +6 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.interface.d.cts +34 -0
- package/dist/components/RadioGroup/RadioGroup.interface.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +98 -0
- package/dist/components/RadioGroup/RadioGroup.variant.cjs +1 -0
- package/dist/components/RadioGroup/RadioGroup.variant.d.cts +20 -0
- package/dist/components/RadioGroup/RadioGroup.variant.d.ts +4 -5
- package/dist/components/RadioGroup/RadioGroup.variant.js +53 -0
- package/dist/components/Select/Select.cjs +1 -0
- package/dist/components/Select/Select.d.cts +12 -0
- package/dist/components/Select/Select.d.ts +8 -16
- package/dist/components/Select/Select.interface.d.cts +110 -0
- package/dist/components/Select/Select.interface.d.ts +93 -35
- package/dist/components/Select/Select.js +936 -0
- package/dist/components/Select/Select.variant.cjs +1 -0
- package/dist/components/Select/Select.variant.d.cts +14 -0
- package/dist/components/Select/Select.variant.d.ts +8 -7
- package/dist/components/Select/Select.variant.js +19 -0
- package/dist/components/Sheet/Sheet.cjs +1 -0
- package/dist/components/Sheet/Sheet.d.cts +4 -0
- package/dist/components/Sheet/Sheet.d.ts +3 -2
- package/dist/components/Sheet/Sheet.interface.d.cts +32 -0
- package/dist/components/Sheet/Sheet.interface.d.ts +9 -0
- package/dist/components/Sheet/Sheet.js +82 -0
- package/dist/components/Sheet/Sheet.variant.cjs +1 -0
- package/dist/components/Sheet/Sheet.variant.d.cts +10 -0
- package/dist/components/Sheet/Sheet.variant.js +14 -0
- package/dist/components/Skeleton/Skeleton.cjs +1 -0
- package/dist/components/Skeleton/Skeleton.d.cts +4 -0
- package/dist/components/Skeleton/Skeleton.d.ts +3 -2
- package/dist/components/Skeleton/Skeleton.interface.d.cts +5 -0
- package/dist/components/Skeleton/Skeleton.interface.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.js +16 -0
- package/dist/components/Skeleton/Skeleton.variant.cjs +1 -0
- package/dist/components/Skeleton/Skeleton.variant.d.cts +2 -0
- package/dist/components/Skeleton/Skeleton.variant.js +5 -0
- package/dist/components/Spinner/Spinner.cjs +1 -0
- package/dist/components/Spinner/Spinner.d.cts +4 -0
- package/dist/components/Spinner/Spinner.d.ts +3 -2
- package/dist/components/Spinner/Spinner.interface.d.cts +13 -0
- package/dist/components/Spinner/Spinner.interface.d.ts +8 -1
- package/dist/components/Spinner/Spinner.js +28 -0
- package/dist/components/Spinner/Spinner.variant.cjs +1 -0
- package/dist/components/Spinner/Spinner.variant.d.cts +5 -0
- package/dist/components/Spinner/Spinner.variant.d.ts +4 -9
- package/dist/components/Spinner/Spinner.variant.js +29 -0
- package/dist/components/Switch/Switch.cjs +1 -0
- package/dist/components/Switch/Switch.d.cts +4 -0
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.interface.d.cts +32 -0
- package/dist/components/Switch/Switch.interface.d.ts +18 -4
- package/dist/components/Switch/Switch.js +67 -0
- package/dist/components/Switch/Switch.variant.cjs +1 -0
- package/dist/components/Switch/Switch.variant.d.cts +11 -0
- package/dist/components/Switch/Switch.variant.d.ts +9 -5
- package/dist/components/Switch/Switch.variant.js +26 -0
- package/dist/components/Table/Table.cjs +1 -0
- package/dist/components/Table/Table.constants.cjs +1 -0
- package/dist/components/Table/Table.constants.d.cts +18 -0
- package/dist/components/Table/Table.constants.d.ts +2 -29
- package/dist/components/Table/Table.constants.js +4 -0
- package/dist/components/Table/Table.d.cts +6 -0
- package/dist/components/Table/Table.d.ts +4 -34
- package/dist/components/Table/Table.interface.d.cts +278 -0
- package/dist/components/Table/Table.interface.d.ts +34 -26
- package/dist/components/Table/Table.js +578 -0
- package/dist/components/Table/Table.utils.cjs +1 -0
- package/dist/components/Table/Table.utils.d.cts +39 -0
- package/dist/components/Table/Table.utils.d.ts +12 -6
- package/dist/components/Table/Table.utils.js +186 -0
- package/dist/components/Table/Table.variant.cjs +1 -0
- package/dist/components/Table/Table.variant.d.cts +19 -0
- package/dist/components/Table/Table.variant.d.ts +0 -3
- package/dist/components/Table/Table.variant.js +38 -0
- package/dist/components/Table/TableEmptyState.cjs +1 -0
- package/dist/components/Table/TableEmptyState.d.cts +2 -0
- package/dist/components/Table/TableEmptyState.d.ts +1 -1
- package/dist/components/Table/TableEmptyState.js +19 -0
- package/dist/components/Table/TablePaginationControls.cjs +1 -0
- package/dist/components/Table/TablePaginationControls.d.cts +2 -0
- package/dist/components/Table/TablePaginationControls.d.ts +1 -1
- package/dist/components/Table/TablePaginationControls.js +38 -0
- package/dist/components/Table/TableParts.cjs +1 -0
- package/dist/components/Table/TableParts.d.cts +16 -0
- package/dist/components/Table/TableParts.d.ts +16 -0
- package/dist/components/Table/TableParts.js +54 -0
- package/dist/components/Table/TableSkeletonRows.cjs +1 -0
- package/dist/components/Table/TableSkeletonRows.d.cts +13 -0
- package/dist/components/Table/TableSkeletonRows.d.ts +13 -0
- package/dist/components/Table/TableSkeletonRows.js +40 -0
- package/dist/components/Table/TableSortToggle.cjs +1 -0
- package/dist/components/Table/TableSortToggle.d.cts +2 -0
- package/dist/components/Table/TableSortToggle.d.ts +2 -2
- package/dist/components/Table/TableSortToggle.js +45 -0
- package/dist/components/Table/hooks/useTableCardLabels.cjs +1 -0
- package/dist/components/Table/hooks/useTableCardLabels.d.cts +9 -0
- package/dist/components/Table/hooks/useTableCardLabels.d.ts +9 -0
- package/dist/components/Table/hooks/useTableCardLabels.js +34 -0
- package/dist/components/Table/hooks/useTablePagination.cjs +1 -0
- package/dist/components/Table/hooks/useTablePagination.d.cts +34 -0
- package/dist/components/Table/hooks/useTablePagination.d.ts +2 -6
- package/dist/components/Table/hooks/useTablePagination.js +204 -0
- package/dist/components/Table/hooks/useTableSearch.cjs +1 -0
- package/dist/components/Table/hooks/useTableSearch.d.cts +20 -0
- package/dist/components/Table/hooks/useTableSearch.d.ts +5 -3
- package/dist/components/Table/hooks/useTableSearch.js +53 -0
- package/dist/components/Table/hooks/useTableSort.cjs +1 -0
- package/dist/components/Table/hooks/useTableSort.d.cts +16 -0
- package/dist/components/Table/hooks/useTableSort.d.ts +3 -1
- package/dist/components/Table/hooks/useTableSort.js +50 -0
- package/dist/components/Tabs/Tabs.cjs +1 -0
- package/dist/components/Tabs/Tabs.d.cts +8 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.interface.d.cts +32 -0
- package/dist/components/Tabs/Tabs.interface.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +193 -0
- package/dist/components/Tabs/Tabs.variant.cjs +1 -0
- package/dist/components/Tabs/Tabs.variant.d.cts +18 -0
- package/dist/components/Tabs/Tabs.variant.d.ts +2 -2
- package/dist/components/Tabs/Tabs.variant.js +107 -0
- package/dist/components/Textarea/Textarea.cjs +1 -0
- package/dist/components/Textarea/Textarea.d.cts +4 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -2
- package/dist/components/Textarea/Textarea.interface.d.cts +34 -0
- package/dist/components/Textarea/Textarea.interface.d.ts +8 -2
- package/dist/components/Textarea/Textarea.js +115 -0
- package/dist/components/Textarea/Textarea.variant.cjs +1 -0
- package/dist/components/Textarea/Textarea.variant.d.cts +4 -0
- package/dist/components/Textarea/Textarea.variant.js +14 -0
- package/dist/components/TimePicker/TimePicker.cjs +1 -0
- package/dist/components/TimePicker/TimePicker.d.cts +6 -0
- package/dist/components/TimePicker/TimePicker.d.ts +6 -0
- package/dist/components/TimePicker/TimePicker.interface.d.cts +105 -0
- package/dist/components/TimePicker/TimePicker.interface.d.ts +105 -0
- package/dist/components/TimePicker/TimePicker.js +208 -0
- package/dist/components/TimePicker/TimePicker.utils.cjs +1 -0
- package/dist/components/TimePicker/TimePicker.utils.d.cts +57 -0
- package/dist/components/TimePicker/TimePicker.utils.d.ts +57 -0
- package/dist/components/TimePicker/TimePicker.utils.js +171 -0
- package/dist/components/TimePicker/TimePicker.variant.cjs +1 -0
- package/dist/components/TimePicker/TimePicker.variant.d.cts +46 -0
- package/dist/components/TimePicker/TimePicker.variant.d.ts +46 -0
- package/dist/components/TimePicker/TimePicker.variant.js +93 -0
- package/dist/components/TimePicker/TimePickerPanel.cjs +1 -0
- package/dist/components/TimePicker/TimePickerPanel.d.cts +25 -0
- package/dist/components/TimePicker/TimePickerPanel.d.ts +25 -0
- package/dist/components/TimePicker/TimePickerPanel.js +464 -0
- package/dist/components/TimePicker/TimePickerWheel.cjs +1 -0
- package/dist/components/TimePicker/TimePickerWheel.d.cts +27 -0
- package/dist/components/TimePicker/TimePickerWheel.d.ts +27 -0
- package/dist/components/TimePicker/TimePickerWheel.js +205 -0
- package/dist/components/Toast/Toast.cjs +1 -0
- package/dist/components/Toast/Toast.d.cts +13 -0
- package/dist/components/Toast/Toast.d.ts +3 -3
- package/dist/components/Toast/Toast.interface.d.cts +6 -0
- package/dist/components/Toast/Toast.interface.d.ts +1 -1
- package/dist/components/Toast/Toast.js +98 -0
- package/dist/components/Toast/Toast.variant.cjs +1 -0
- package/dist/components/Toast/Toast.variant.d.cts +9 -0
- package/dist/components/Toast/Toast.variant.d.ts +1 -1
- package/dist/components/Toast/Toast.variant.js +16 -0
- package/dist/components/Toast/ToastHost.cjs +1 -0
- package/dist/components/Toast/ToastHost.d.cts +2 -0
- package/dist/components/Toast/ToastHost.js +96 -0
- package/dist/components/Toast/function/showToast.cjs +1 -0
- package/dist/components/Toast/function/showToast.d.cts +33 -0
- package/dist/components/Toast/function/showToast.d.ts +19 -3
- package/dist/components/Toast/function/showToast.js +42 -0
- package/dist/components/Toast/function/toastHaptics.cjs +1 -0
- package/dist/components/Toast/function/toastHaptics.d.cts +11 -0
- package/dist/components/Toast/function/toastHaptics.d.ts +11 -0
- package/dist/components/Toast/function/toastHaptics.js +6 -0
- package/dist/components/Toast/function/toastVisual.cjs +1 -0
- package/dist/components/Toast/function/toastVisual.d.cts +10 -0
- package/dist/components/Toast/function/toastVisual.d.ts +1 -1
- package/dist/components/Toast/function/toastVisual.js +29 -0
- package/dist/components/Toggle/Toggle.cjs +1 -0
- package/dist/components/Toggle/Toggle.d.cts +4 -0
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.interface.d.cts +13 -0
- package/dist/components/Toggle/Toggle.interface.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +31 -0
- package/dist/components/Toggle/Toggle.variant.cjs +1 -0
- package/dist/components/Toggle/Toggle.variant.d.cts +5 -0
- package/dist/components/Toggle/Toggle.variant.js +22 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.d.cts +10 -0
- package/dist/components/Tooltip/Tooltip.d.ts +9 -2
- package/dist/components/Tooltip/Tooltip.interface.d.cts +16 -0
- package/dist/components/Tooltip/Tooltip.interface.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.js +48 -0
- package/dist/components/Tooltip/Tooltip.variant.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.variant.d.cts +2 -0
- package/dist/components/Tooltip/Tooltip.variant.js +5 -0
- package/dist/components/Uploader/Uploader.cjs +2 -0
- package/dist/components/Uploader/Uploader.d.cts +4 -0
- package/dist/components/Uploader/Uploader.d.ts +3 -2
- package/dist/components/Uploader/Uploader.interface.d.cts +78 -0
- package/dist/components/Uploader/Uploader.interface.d.ts +2 -2
- package/dist/components/Uploader/Uploader.js +488 -0
- package/dist/components/Uploader/Uploader.utils.cjs +1 -0
- package/dist/components/Uploader/Uploader.utils.d.cts +21 -0
- package/dist/components/Uploader/Uploader.utils.d.ts +9 -5
- package/dist/components/Uploader/Uploader.utils.js +75 -0
- package/dist/components/Uploader/Uploader.variant.cjs +1 -0
- package/dist/components/Uploader/Uploader.variant.d.cts +6 -0
- package/dist/components/Uploader/Uploader.variant.d.ts +1 -3
- package/dist/components/Uploader/Uploader.variant.js +6 -0
- package/dist/components/shared/ActionSheet.cjs +1 -0
- package/dist/components/shared/ActionSheet.d.cts +26 -0
- package/dist/components/shared/ActionSheet.d.ts +26 -0
- package/dist/components/shared/ActionSheet.js +51 -0
- package/dist/components/shared/FieldClearButton.cjs +1 -0
- package/dist/components/shared/FieldClearButton.d.cts +17 -0
- package/dist/components/shared/FieldClearButton.d.ts +17 -0
- package/dist/components/shared/FieldClearButton.js +34 -0
- package/dist/components/shared/FieldLabel.cjs +1 -0
- package/dist/components/shared/FieldLabel.d.cts +23 -0
- package/dist/components/shared/FieldLabel.d.ts +23 -0
- package/dist/components/shared/FieldLabel.js +48 -0
- package/dist/components/shared/IconActionButton.cjs +1 -0
- package/dist/components/shared/IconActionButton.d.cts +44 -0
- package/dist/components/shared/IconActionButton.d.ts +44 -0
- package/dist/components/shared/IconActionButton.js +70 -0
- package/dist/components/shared/RequiredValidationInput.cjs +1 -0
- package/dist/components/shared/RequiredValidationInput.d.cts +15 -0
- package/dist/components/shared/RequiredValidationInput.d.ts +15 -0
- package/dist/components/shared/RequiredValidationInput.js +22 -0
- package/dist/components/shared/WheelColumn.cjs +1 -0
- package/dist/components/shared/WheelColumn.d.cts +29 -0
- package/dist/components/shared/WheelColumn.d.ts +29 -0
- package/dist/components/shared/WheelColumn.js +116 -0
- package/dist/components/shared/fieldStyles.cjs +1 -0
- package/dist/components/shared/fieldStyles.d.cts +4 -0
- package/dist/components/shared/fieldStyles.js +14 -0
- package/dist/components/shared/haptics.cjs +1 -0
- package/dist/components/shared/haptics.d.cts +6 -0
- package/dist/components/shared/haptics.d.ts +6 -0
- package/dist/components/shared/haptics.js +8 -0
- package/dist/components/shared/overlay.cjs +1 -0
- package/dist/components/shared/overlay.d.cts +25 -0
- package/dist/components/shared/overlay.d.ts +25 -0
- package/dist/components/shared/overlay.js +45 -0
- package/dist/components/shared/overlay.utils.cjs +1 -0
- package/dist/components/shared/overlay.utils.d.cts +6 -0
- package/dist/components/shared/overlay.utils.d.ts +6 -0
- package/dist/components/shared/overlay.utils.js +7 -0
- package/dist/components/shared/responsiveScale.cjs +1 -0
- package/dist/components/shared/responsiveScale.d.cts +29 -0
- package/dist/components/shared/responsiveScale.d.ts +18 -26
- package/dist/components/shared/responsiveScale.js +4 -0
- package/dist/components/shared/useBubbleInputInvalid.cjs +1 -0
- package/dist/components/shared/useBubbleInputInvalid.d.cts +8 -0
- package/dist/components/shared/useBubbleInputInvalid.d.ts +8 -0
- package/dist/components/shared/useBubbleInputInvalid.js +40 -0
- package/dist/components/shared/useControllableState.cjs +1 -0
- package/dist/components/shared/useControllableState.d.cts +16 -0
- package/dist/components/shared/useControllableState.d.ts +16 -0
- package/dist/components/shared/useControllableState.js +14 -0
- package/dist/components/shared/useExclusiveAction.cjs +1 -0
- package/dist/components/shared/useExclusiveAction.d.cts +9 -0
- package/dist/components/shared/useExclusiveAction.d.ts +9 -0
- package/dist/components/shared/useExclusiveAction.js +17 -0
- package/dist/components/shared/useInvalidState.cjs +1 -0
- package/dist/components/shared/useInvalidState.d.cts +11 -0
- package/dist/components/shared/useInvalidState.d.ts +11 -0
- package/dist/components/shared/useInvalidState.js +14 -0
- package/dist/components/shared/useIsomorphicLayoutEffect.cjs +1 -0
- package/dist/components/shared/useIsomorphicLayoutEffect.d.cts +6 -0
- package/dist/components/shared/useIsomorphicLayoutEffect.d.ts +6 -0
- package/dist/components/shared/useIsomorphicLayoutEffect.js +5 -0
- package/dist/components/shared/useStickyToolbar.cjs +1 -0
- package/dist/components/shared/useStickyToolbar.d.cts +17 -0
- package/dist/components/shared/useStickyToolbar.d.ts +17 -0
- package/dist/components/shared/useStickyToolbar.js +39 -0
- package/dist/components/shared/useWheelSize.cjs +1 -0
- package/dist/components/shared/useWheelSize.d.cts +10 -0
- package/dist/components/shared/useWheelSize.d.ts +10 -0
- package/dist/components/shared/useWheelSize.js +14 -0
- package/dist/components/shared/viewport.cjs +1 -0
- package/dist/components/shared/viewport.d.cts +17 -0
- package/dist/components/shared/viewport.d.ts +17 -0
- package/dist/components/shared/viewport.js +32 -0
- package/dist/config/ZuiConfigContext.cjs +1 -0
- package/dist/config/ZuiConfigContext.d.cts +13 -0
- package/dist/config/ZuiConfigContext.d.ts +13 -0
- package/dist/config/ZuiConfigContext.js +11 -0
- package/dist/config/ZuiConfigProvider.cjs +1 -0
- package/dist/config/ZuiConfigProvider.d.cts +19 -0
- package/dist/config/ZuiConfigProvider.d.ts +19 -0
- package/dist/config/ZuiConfigProvider.js +24 -0
- package/dist/config/messages.cjs +1 -0
- package/dist/config/messages.d.cts +167 -0
- package/dist/config/messages.d.ts +167 -0
- package/dist/config/messages.js +309 -0
- package/dist/config/useZuiConfig.cjs +1 -0
- package/dist/config/useZuiConfig.d.cts +3 -0
- package/dist/config/useZuiConfig.d.ts +3 -0
- package/dist/config/useZuiConfig.js +9 -0
- package/dist/index.cjs +1 -51
- package/dist/index.css +1 -1
- package/dist/index.d.cts +65 -0
- package/dist/index.d.ts +65 -55
- package/dist/index.js +34 -20983
- package/dist/lib/utils.cjs +1 -0
- package/dist/lib/utils.d.cts +4 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +16 -0
- package/dist/services/convertToEnglishDigits/convertToEnglishDigits.cjs +1 -0
- package/dist/services/convertToEnglishDigits/convertToEnglishDigits.d.cts +5 -0
- package/dist/services/convertToEnglishDigits/convertToEnglishDigits.d.ts +1 -1
- package/dist/services/convertToEnglishDigits/convertToEnglishDigits.js +10 -0
- package/dist/services/convertToPersianDigits/convertToPersianDigits.cjs +1 -0
- package/dist/services/convertToPersianDigits/convertToPersianDigits.d.cts +5 -0
- package/dist/services/convertToPersianDigits/convertToPersianDigits.d.ts +1 -1
- package/dist/services/convertToPersianDigits/convertToPersianDigits.js +18 -0
- package/dist/services/localizeDigits/localizeDigits.cjs +1 -0
- package/dist/services/localizeDigits/localizeDigits.d.cts +3 -0
- package/dist/services/localizeDigits/localizeDigits.d.ts +3 -0
- package/dist/services/localizeDigits/localizeDigits.js +8 -0
- package/dist/shared/scale.cjs +1 -0
- package/dist/shared/scale.d.cts +12 -0
- package/dist/shared/scale.d.ts +3 -23
- package/dist/shared/scale.js +8 -0
- package/dist/shared/theme.cjs +1 -0
- package/dist/shared/theme.d.cts +26 -0
- package/dist/shared/theme.d.ts +10 -11
- package/dist/shared/theme.js +37 -0
- package/dist/shared/theme.json.cjs +1 -0
- package/dist/shared/theme.json.js +14 -0
- package/package.json +38 -13
- package/dist/components/Accordion/Accordion.constants.d.ts +0 -4
- package/dist/styles.cjs +0 -0
- package/dist/styles.js +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { InputProps } from "./Input.interface.js";
|
|
3
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
3
4
|
export default Input;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../services/convertToEnglishDigits/convertToEnglishDigits.cjs`),t=require(`../../services/convertToPersianDigits/convertToPersianDigits.cjs`);var n=11;function r(t){return e.convertToEnglishDigits({value:t})}function i(e){return r(e).replace(/\D/g,``)}function a(e){return e.replace(/^0+(?=\d)/,``)}function o(e){return e.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)}function s(e){let t=a(e);if(t===``)return t;let n=Number(t);return Number.isNaN(n)?t:n>100?`100`:String(n)}function c(e){let t=!1,n=``;for(let i of r(e).replace(/٫/g,`.`))/\d/.test(i)?n+=i:i===`.`&&!t&&(n+=i,t=!0);return n}function l(e){return e===``?``:(e[0]===`0`?e:`0${e}`).slice(0,n)}function u(e,t){let n=[],r=0;for(let i of t)n.push(e.slice(r,r+i)),r+=i;return n.filter(Boolean).join(`-`)}function d(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)/[0-9]/.test(e[r])&&(n+=1);return n}function f(e,t){let n=0,r=!1;for(let i=0;i<t&&i<e.length;i+=1){let t=e[i];/\d/.test(t)?n+=1:t===`.`&&!r&&(n+=1,r=!0)}return n}function p(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r+=1)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function m(e){return(t,n)=>{let i=r(t),a=e(i);return{value:a,caret:Math.min(d(i,n),a.length)}}}function h(e){return(t,n)=>{let i=r(t),a=d(i,n),o=i.replace(/\D/g,``),s=l(o),c=+(o!==``&&o[0]!==`0`),f=u(s,e);return{value:f,caret:p(f,Math.min(a+c,s.length))}}}var g={normalize:e=>e,isFormatted:!1,isCentered:!1},_={text:g,search:g,username:{...g,isCentered:!0},password:{...g,isCentered:!0},number:{normalize:i,format:m(i),inputMode:`numeric`,isFormatted:!0,isCentered:!0},year:{normalize:e=>i(e).slice(0,4),format:m(e=>i(e).slice(0,4)),inputMode:`numeric`,maxLength:4,isFormatted:!0,isCentered:!0},money:{normalize:e=>o(a(i(e))),format:(e,t)=>{let n=r(e),i=d(n,t),s=n.replace(/\D/g,``),c=a(s),l=Math.min(s.length-c.length,i),u=o(c);return{value:u,caret:p(u,i-l)}},inputMode:`numeric`,isFormatted:!0,isCentered:!0},percent:{normalize:e=>s(i(e)),format:m(e=>s(i(e))),displayPrefix:`%`,inputMode:`numeric`,isFormatted:!0,isCentered:!0},decimal:{normalize:c,format:(e,t)=>{let n=r(e).replace(/٫/g,`.`),i=c(n);return{value:i,caret:Math.min(f(n,t),i.length)}},inputMode:`decimal`,isFormatted:!0,isCentered:!0},phone:{normalize:e=>u(l(i(e)),[4,3,4]),format:h([4,3,4]),inputMode:`numeric`,maxLength:13,isFormatted:!0,isCentered:!0},landline:{normalize:e=>u(l(i(e)),[3,4,4]),format:h([3,4,4]),inputMode:`numeric`,maxLength:13,isFormatted:!0,isCentered:!0}};function v(e){return _[e]??g}function y(e){return e==null?``:Array.isArray(e)?e.join(`, `):String(e)}function b(e,t){return v(t).normalize(y(e))}function x(e,n,r){let i=v(n).displayPrefix,a=i&&e!==``?`${i}${e}`:e;return r?t.convertToPersianDigits({value:a}):a}function S(e,n,i,a,o){let s=v(e);if(!s.format){let e=i===null?null:[i,a??i];return{asciiValue:r(n),asciiSelection:e,displayValue:o?t.convertToPersianDigits({value:r(n)}):null,displaySelection:o?e:null}}let{value:c,caret:l}=s.format(n,i??r(n).length),u=l+(s.displayPrefix&&c!==``?s.displayPrefix.length:0);return{asciiValue:c,asciiSelection:[l,l],displayValue:o?x(c,e,!0):null,displaySelection:o?[u,u]:null}}exports.applyInputChange=S,exports.resolveAsciiValue=b,exports.resolveDisplayValue=x,exports.resolveInputTypeStrategy=v;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { InputProps } from "./Input.interface.cjs";
|
|
2
|
+
type InputType = NonNullable<InputProps["type"]>;
|
|
3
|
+
/** How one `type` normalizes, formats and places the caret; `format` is absent for free text. */
|
|
4
|
+
type InputTypeStrategy = {
|
|
5
|
+
/** The ASCII text the field holds for any given (possibly formatted/localized) value. */
|
|
6
|
+
normalize: (text: string) => string;
|
|
7
|
+
/** Re-formats the raw DOM text on every keystroke and maps the caret into the result. */
|
|
8
|
+
format?: (rawText: string, caret: number) => {
|
|
9
|
+
value: string;
|
|
10
|
+
caret: number;
|
|
11
|
+
};
|
|
12
|
+
/** Shown before the value (percent's `%`); the caret is shifted past it. */
|
|
13
|
+
displayPrefix?: string;
|
|
14
|
+
inputMode?: "numeric" | "decimal";
|
|
15
|
+
maxLength?: number;
|
|
16
|
+
/** Formatted fields jump the caret to the end on a plain click. */
|
|
17
|
+
isFormatted: boolean;
|
|
18
|
+
isCentered: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare function resolveInputTypeStrategy(type: InputType): InputTypeStrategy;
|
|
21
|
+
declare function stringifyInputValue(value: unknown): string;
|
|
22
|
+
/** The ASCII text a `value`/`defaultValue` prop stands for in the given `type`. */
|
|
23
|
+
declare function resolveAsciiValue(rawValue: unknown, type: InputType): string;
|
|
24
|
+
/** What the input shows for an ASCII value: the prefix, then Persian digits unless disabled. */
|
|
25
|
+
declare function resolveDisplayValue(asciiValue: string, type: InputType, showPersianDigits: boolean): string;
|
|
26
|
+
type Selection = [start: number, end: number];
|
|
27
|
+
export type InputChangeResult = {
|
|
28
|
+
/** Written to the input before `onChange` fires, so consumers always read ASCII. */
|
|
29
|
+
asciiValue: string;
|
|
30
|
+
asciiSelection: Selection | null;
|
|
31
|
+
/** Written after `onChange`; `null` leaves the ASCII text in place (e.g. a hidden password). */
|
|
32
|
+
displayValue: string | null;
|
|
33
|
+
displaySelection: Selection | null;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* What a keystroke does to the input, as pure data: the raw DOM text and selection in, the
|
|
37
|
+
* ASCII value (+ caret) for `onChange` and the localized text (+ caret) to show out.
|
|
38
|
+
*/
|
|
39
|
+
declare function applyInputChange(type: InputType, rawText: string, selectionStart: number | null, selectionEnd: number | null, showPersianDigits: boolean): InputChangeResult;
|
|
40
|
+
export { applyInputChange, resolveAsciiValue, resolveDisplayValue, resolveInputTypeStrategy, stringifyInputValue, };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { InputProps } from "./Input.interface.js";
|
|
2
|
+
type InputType = NonNullable<InputProps["type"]>;
|
|
3
|
+
/** How one `type` normalizes, formats and places the caret; `format` is absent for free text. */
|
|
4
|
+
type InputTypeStrategy = {
|
|
5
|
+
/** The ASCII text the field holds for any given (possibly formatted/localized) value. */
|
|
6
|
+
normalize: (text: string) => string;
|
|
7
|
+
/** Re-formats the raw DOM text on every keystroke and maps the caret into the result. */
|
|
8
|
+
format?: (rawText: string, caret: number) => {
|
|
9
|
+
value: string;
|
|
10
|
+
caret: number;
|
|
11
|
+
};
|
|
12
|
+
/** Shown before the value (percent's `%`); the caret is shifted past it. */
|
|
13
|
+
displayPrefix?: string;
|
|
14
|
+
inputMode?: "numeric" | "decimal";
|
|
15
|
+
maxLength?: number;
|
|
16
|
+
/** Formatted fields jump the caret to the end on a plain click. */
|
|
17
|
+
isFormatted: boolean;
|
|
18
|
+
isCentered: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare function resolveInputTypeStrategy(type: InputType): InputTypeStrategy;
|
|
21
|
+
declare function stringifyInputValue(value: unknown): string;
|
|
22
|
+
/** The ASCII text a `value`/`defaultValue` prop stands for in the given `type`. */
|
|
23
|
+
declare function resolveAsciiValue(rawValue: unknown, type: InputType): string;
|
|
24
|
+
/** What the input shows for an ASCII value: the prefix, then Persian digits unless disabled. */
|
|
25
|
+
declare function resolveDisplayValue(asciiValue: string, type: InputType, showPersianDigits: boolean): string;
|
|
26
|
+
type Selection = [start: number, end: number];
|
|
27
|
+
export type InputChangeResult = {
|
|
28
|
+
/** Written to the input before `onChange` fires, so consumers always read ASCII. */
|
|
29
|
+
asciiValue: string;
|
|
30
|
+
asciiSelection: Selection | null;
|
|
31
|
+
/** Written after `onChange`; `null` leaves the ASCII text in place (e.g. a hidden password). */
|
|
32
|
+
displayValue: string | null;
|
|
33
|
+
displaySelection: Selection | null;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* What a keystroke does to the input, as pure data: the raw DOM text and selection in, the
|
|
37
|
+
* ASCII value (+ caret) for `onChange` and the localized text (+ caret) to show out.
|
|
38
|
+
*/
|
|
39
|
+
declare function applyInputChange(type: InputType, rawText: string, selectionStart: number | null, selectionEnd: number | null, showPersianDigits: boolean): InputChangeResult;
|
|
40
|
+
export { applyInputChange, resolveAsciiValue, resolveDisplayValue, resolveInputTypeStrategy, stringifyInputValue, };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { convertToEnglishDigits as e } from "../../services/convertToEnglishDigits/convertToEnglishDigits.js";
|
|
2
|
+
import { convertToPersianDigits as t } from "../../services/convertToPersianDigits/convertToPersianDigits.js";
|
|
3
|
+
//#region src/components/Input/Input.formatting.ts
|
|
4
|
+
var n = 11;
|
|
5
|
+
function r(t) {
|
|
6
|
+
return e({ value: t });
|
|
7
|
+
}
|
|
8
|
+
function i(e) {
|
|
9
|
+
return r(e).replace(/\D/g, "");
|
|
10
|
+
}
|
|
11
|
+
function a(e) {
|
|
12
|
+
return e.replace(/^0+(?=\d)/, "");
|
|
13
|
+
}
|
|
14
|
+
function o(e) {
|
|
15
|
+
return e.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
16
|
+
}
|
|
17
|
+
function s(e) {
|
|
18
|
+
let t = a(e);
|
|
19
|
+
if (t === "") return t;
|
|
20
|
+
let n = Number(t);
|
|
21
|
+
return Number.isNaN(n) ? t : n > 100 ? "100" : String(n);
|
|
22
|
+
}
|
|
23
|
+
function c(e) {
|
|
24
|
+
let t = !1, n = "";
|
|
25
|
+
for (let i of r(e).replace(/٫/g, ".")) /\d/.test(i) ? n += i : i === "." && !t && (n += i, t = !0);
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
function l(e) {
|
|
29
|
+
return e === "" ? "" : (e[0] === "0" ? e : `0${e}`).slice(0, n);
|
|
30
|
+
}
|
|
31
|
+
function u(e, t) {
|
|
32
|
+
let n = [], r = 0;
|
|
33
|
+
for (let i of t) n.push(e.slice(r, r + i)), r += i;
|
|
34
|
+
return n.filter(Boolean).join("-");
|
|
35
|
+
}
|
|
36
|
+
function d(e, t) {
|
|
37
|
+
let n = 0;
|
|
38
|
+
for (let r = 0; r < t && r < e.length; r += 1) /[0-9]/.test(e[r]) && (n += 1);
|
|
39
|
+
return n;
|
|
40
|
+
}
|
|
41
|
+
function f(e, t) {
|
|
42
|
+
let n = 0, r = !1;
|
|
43
|
+
for (let i = 0; i < t && i < e.length; i += 1) {
|
|
44
|
+
let t = e[i];
|
|
45
|
+
/\d/.test(t) ? n += 1 : t === "." && !r && (n += 1, r = !0);
|
|
46
|
+
}
|
|
47
|
+
return n;
|
|
48
|
+
}
|
|
49
|
+
function p(e, t) {
|
|
50
|
+
if (t <= 0) return 0;
|
|
51
|
+
let n = 0;
|
|
52
|
+
for (let r = 0; r < e.length; r += 1) if (/[0-9]/.test(e[r]) && (n += 1, n === t)) return r + 1;
|
|
53
|
+
return e.length;
|
|
54
|
+
}
|
|
55
|
+
function m(e) {
|
|
56
|
+
return (t, n) => {
|
|
57
|
+
let i = r(t), a = e(i);
|
|
58
|
+
return {
|
|
59
|
+
value: a,
|
|
60
|
+
caret: Math.min(d(i, n), a.length)
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function h(e) {
|
|
65
|
+
return (t, n) => {
|
|
66
|
+
let i = r(t), a = d(i, n), o = i.replace(/\D/g, ""), s = l(o), c = +(o !== "" && o[0] !== "0"), f = u(s, e);
|
|
67
|
+
return {
|
|
68
|
+
value: f,
|
|
69
|
+
caret: p(f, Math.min(a + c, s.length))
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var g = {
|
|
74
|
+
normalize: (e) => e,
|
|
75
|
+
isFormatted: !1,
|
|
76
|
+
isCentered: !1
|
|
77
|
+
}, _ = {
|
|
78
|
+
text: g,
|
|
79
|
+
search: g,
|
|
80
|
+
username: {
|
|
81
|
+
...g,
|
|
82
|
+
isCentered: !0
|
|
83
|
+
},
|
|
84
|
+
password: {
|
|
85
|
+
...g,
|
|
86
|
+
isCentered: !0
|
|
87
|
+
},
|
|
88
|
+
number: {
|
|
89
|
+
normalize: i,
|
|
90
|
+
format: m(i),
|
|
91
|
+
inputMode: "numeric",
|
|
92
|
+
isFormatted: !0,
|
|
93
|
+
isCentered: !0
|
|
94
|
+
},
|
|
95
|
+
year: {
|
|
96
|
+
normalize: (e) => i(e).slice(0, 4),
|
|
97
|
+
format: m((e) => i(e).slice(0, 4)),
|
|
98
|
+
inputMode: "numeric",
|
|
99
|
+
maxLength: 4,
|
|
100
|
+
isFormatted: !0,
|
|
101
|
+
isCentered: !0
|
|
102
|
+
},
|
|
103
|
+
money: {
|
|
104
|
+
normalize: (e) => o(a(i(e))),
|
|
105
|
+
format: (e, t) => {
|
|
106
|
+
let n = r(e), i = d(n, t), s = n.replace(/\D/g, ""), c = a(s), l = Math.min(s.length - c.length, i), u = o(c);
|
|
107
|
+
return {
|
|
108
|
+
value: u,
|
|
109
|
+
caret: p(u, i - l)
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
inputMode: "numeric",
|
|
113
|
+
isFormatted: !0,
|
|
114
|
+
isCentered: !0
|
|
115
|
+
},
|
|
116
|
+
percent: {
|
|
117
|
+
normalize: (e) => s(i(e)),
|
|
118
|
+
format: m((e) => s(i(e))),
|
|
119
|
+
displayPrefix: "%",
|
|
120
|
+
inputMode: "numeric",
|
|
121
|
+
isFormatted: !0,
|
|
122
|
+
isCentered: !0
|
|
123
|
+
},
|
|
124
|
+
decimal: {
|
|
125
|
+
normalize: c,
|
|
126
|
+
format: (e, t) => {
|
|
127
|
+
let n = r(e).replace(/٫/g, "."), i = c(n);
|
|
128
|
+
return {
|
|
129
|
+
value: i,
|
|
130
|
+
caret: Math.min(f(n, t), i.length)
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
inputMode: "decimal",
|
|
134
|
+
isFormatted: !0,
|
|
135
|
+
isCentered: !0
|
|
136
|
+
},
|
|
137
|
+
phone: {
|
|
138
|
+
normalize: (e) => u(l(i(e)), [
|
|
139
|
+
4,
|
|
140
|
+
3,
|
|
141
|
+
4
|
|
142
|
+
]),
|
|
143
|
+
format: h([
|
|
144
|
+
4,
|
|
145
|
+
3,
|
|
146
|
+
4
|
|
147
|
+
]),
|
|
148
|
+
inputMode: "numeric",
|
|
149
|
+
maxLength: 13,
|
|
150
|
+
isFormatted: !0,
|
|
151
|
+
isCentered: !0
|
|
152
|
+
},
|
|
153
|
+
landline: {
|
|
154
|
+
normalize: (e) => u(l(i(e)), [
|
|
155
|
+
3,
|
|
156
|
+
4,
|
|
157
|
+
4
|
|
158
|
+
]),
|
|
159
|
+
format: h([
|
|
160
|
+
3,
|
|
161
|
+
4,
|
|
162
|
+
4
|
|
163
|
+
]),
|
|
164
|
+
inputMode: "numeric",
|
|
165
|
+
maxLength: 13,
|
|
166
|
+
isFormatted: !0,
|
|
167
|
+
isCentered: !0
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
function v(e) {
|
|
171
|
+
return _[e] ?? g;
|
|
172
|
+
}
|
|
173
|
+
function y(e) {
|
|
174
|
+
return e == null ? "" : Array.isArray(e) ? e.join(", ") : String(e);
|
|
175
|
+
}
|
|
176
|
+
function b(e, t) {
|
|
177
|
+
return v(t).normalize(y(e));
|
|
178
|
+
}
|
|
179
|
+
function x(e, n, r) {
|
|
180
|
+
let i = v(n).displayPrefix, a = i && e !== "" ? `${i}${e}` : e;
|
|
181
|
+
return r ? t({ value: a }) : a;
|
|
182
|
+
}
|
|
183
|
+
function S(e, n, i, a, o) {
|
|
184
|
+
let s = v(e);
|
|
185
|
+
if (!s.format) {
|
|
186
|
+
let e = i === null ? null : [i, a ?? i];
|
|
187
|
+
return {
|
|
188
|
+
asciiValue: r(n),
|
|
189
|
+
asciiSelection: e,
|
|
190
|
+
displayValue: o ? t({ value: r(n) }) : null,
|
|
191
|
+
displaySelection: o ? e : null
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
let { value: c, caret: l } = s.format(n, i ?? r(n).length), u = l + (s.displayPrefix && c !== "" ? s.displayPrefix.length : 0);
|
|
195
|
+
return {
|
|
196
|
+
asciiValue: c,
|
|
197
|
+
asciiSelection: [l, l],
|
|
198
|
+
displayValue: o ? x(c, e, !0) : null,
|
|
199
|
+
displaySelection: o ? [u, u] : null
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
export { S as applyInputChange, b as resolveAsciiValue, x as resolveDisplayValue, v as resolveInputTypeStrategy };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { inputVariants } from "./Input.variant.cjs";
|
|
4
|
+
/** Native `<input>` attributes that are passed straight through to the input element. */
|
|
5
|
+
type InputNativeProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "title" | "value" | "defaultValue" | "children" | "dangerouslySetInnerHTML">;
|
|
6
|
+
export interface InputProps extends InputNativeProps, VariantProps<typeof inputVariants> {
|
|
7
|
+
type?: "number" | "password" | "text" | "search" | "money" | "username" | "percent" | "decimal" | "year" | "phone" | "landline";
|
|
8
|
+
/** Label rendered above the input (not the native `title` tooltip). */
|
|
9
|
+
title?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* When true and `required` is true, shows a "این فیلد اجباری است" hint next to the required star.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
showRequiredMessage?: boolean;
|
|
16
|
+
/** @deprecated Use `maxLength`. */
|
|
17
|
+
characterLimit?: number;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
autoComplete?: string;
|
|
24
|
+
/** Applied to the `<input>` element. */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Applied to the outer field wrapper (label + input). */
|
|
27
|
+
wrapperClassName?: string;
|
|
28
|
+
value?: string | number | readonly string[];
|
|
29
|
+
defaultValue?: string | number | readonly string[];
|
|
30
|
+
maxLength?: number;
|
|
31
|
+
"aria-label"?: string;
|
|
32
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
33
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
34
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
35
|
+
onInvalid?: React.FormEventHandler<HTMLInputElement>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import type { VariantProps } from "class-variance-authority";
|
|
3
|
-
import { inputVariants } from "./Input.variant";
|
|
4
|
-
|
|
3
|
+
import { inputVariants } from "./Input.variant.js";
|
|
4
|
+
/** Native `<input>` attributes that are passed straight through to the input element. */
|
|
5
|
+
type InputNativeProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "title" | "value" | "defaultValue" | "children" | "dangerouslySetInnerHTML">;
|
|
6
|
+
export interface InputProps extends InputNativeProps, VariantProps<typeof inputVariants> {
|
|
5
7
|
type?: "number" | "password" | "text" | "search" | "money" | "username" | "percent" | "decimal" | "year" | "phone" | "landline";
|
|
8
|
+
/** Label rendered above the input (not the native `title` tooltip). */
|
|
6
9
|
title?: string;
|
|
7
10
|
required?: boolean;
|
|
8
11
|
/**
|
|
@@ -10,6 +13,7 @@ export interface InputProps extends VariantProps<typeof inputVariants> {
|
|
|
10
13
|
* @default false
|
|
11
14
|
*/
|
|
12
15
|
showRequiredMessage?: boolean;
|
|
16
|
+
/** @deprecated Use `maxLength`. */
|
|
13
17
|
characterLimit?: number;
|
|
14
18
|
placeholder?: string;
|
|
15
19
|
id?: string;
|
|
@@ -17,7 +21,10 @@ export interface InputProps extends VariantProps<typeof inputVariants> {
|
|
|
17
21
|
disabled?: boolean;
|
|
18
22
|
readOnly?: boolean;
|
|
19
23
|
autoComplete?: string;
|
|
24
|
+
/** Applied to the `<input>` element. */
|
|
20
25
|
className?: string;
|
|
26
|
+
/** Applied to the outer field wrapper (label + input). */
|
|
27
|
+
wrapperClassName?: string;
|
|
21
28
|
value?: string | number | readonly string[];
|
|
22
29
|
defaultValue?: string | number | readonly string[];
|
|
23
30
|
maxLength?: number;
|
|
@@ -27,3 +34,4 @@ export interface InputProps extends VariantProps<typeof inputVariants> {
|
|
|
27
34
|
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
28
35
|
onInvalid?: React.FormEventHandler<HTMLInputElement>;
|
|
29
36
|
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useZuiConfig as e } from "../../config/useZuiConfig.js";
|
|
3
|
+
import { convertToEnglishDigits as t } from "../../services/convertToEnglishDigits/convertToEnglishDigits.js";
|
|
4
|
+
import { cn as n, mergeRefs as ee } from "../../lib/utils.js";
|
|
5
|
+
import r from "../Tooltip/Tooltip.js";
|
|
6
|
+
import { CLEAR_ICON_CLASS as i } from "../shared/FieldClearButton.js";
|
|
7
|
+
import { FieldLabel as te, RequiredMark as ne } from "../shared/FieldLabel.js";
|
|
8
|
+
import { useInvalidState as re } from "../shared/useInvalidState.js";
|
|
9
|
+
import { applyInputChange as a, resolveAsciiValue as o, resolveDisplayValue as s, resolveInputTypeStrategy as ie } from "./Input.formatting.js";
|
|
10
|
+
import { inputVariants as ae } from "./Input.variant.js";
|
|
11
|
+
import * as c from "react";
|
|
12
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
13
|
+
import { Eye as oe, EyeOff as d, Search as f, X as p } from "lucide-react";
|
|
14
|
+
//#region src/components/Input/Input.tsx
|
|
15
|
+
function m(e) {
|
|
16
|
+
return e == null ? !1 : typeof e == "string" || Array.isArray(e) ? e.length > 0 : typeof e == "number";
|
|
17
|
+
}
|
|
18
|
+
function h() {
|
|
19
|
+
let e = new Intl.DateTimeFormat("en-US-u-ca-persian", { year: "numeric" }).format(/* @__PURE__ */ new Date());
|
|
20
|
+
return Number.parseInt(e, 10);
|
|
21
|
+
}
|
|
22
|
+
var g = c.forwardRef(function({ className: g, wrapperClassName: _, type: v = "text", title: y, required: b = !1, showRequiredMessage: x = !1, characterLimit: se, placeholder: ce, onChange: S, onBlur: C, onFocus: le, onInvalid: ue, id: de, name: fe, disabled: w = !1, readOnly: T = !1, autoComplete: E, "aria-label": D, value: O, defaultValue: k, maxLength: A, inputMode: j, onMouseUp: M, ...N }, P) {
|
|
23
|
+
let { messages: F, digits: I, dir: L } = e(), [R, z] = c.useState(!1), { isInvalid: B, setIsInvalid: V, handleInvalid: pe } = re(ue), [H, U] = c.useState(() => o(k, v)), me = c.useId(), W = de ?? me, G = c.useRef(null), he = c.useMemo(() => ee(G, P), [P]), K = ie(v), q = v === "search", J = v === "password", Y = v === "year", X = I === "persian" && !(J && !R), ge = J ? R ? "text" : "password" : q ? "search" : "text", Z = O !== void 0, Q = Z ? m(O) : H.length > 0, _e = Z ? s(o(O, v), v, X) : void 0, ve = k === void 0 ? void 0 : s(o(k, v), v, X), $ = c.useMemo(() => {
|
|
24
|
+
if (!Y) return null;
|
|
25
|
+
let e = h();
|
|
26
|
+
return {
|
|
27
|
+
min: e - 100,
|
|
28
|
+
max: e + 50
|
|
29
|
+
};
|
|
30
|
+
}, [Y]);
|
|
31
|
+
c.useEffect(() => {
|
|
32
|
+
let e = G.current;
|
|
33
|
+
if (Z || !e) return;
|
|
34
|
+
let t = s(H, v, X);
|
|
35
|
+
e.value !== t && (e.value = t);
|
|
36
|
+
}, [
|
|
37
|
+
Z,
|
|
38
|
+
H,
|
|
39
|
+
X,
|
|
40
|
+
v
|
|
41
|
+
]);
|
|
42
|
+
let ye = c.useCallback((e) => {
|
|
43
|
+
let t = e.target, n = a(v, t.value, t.selectionStart, t.selectionEnd, X);
|
|
44
|
+
t.value = n.asciiValue, n.asciiSelection && t.setSelectionRange(...n.asciiSelection), Z || U(n.asciiValue), V(!1), S?.(e), n.displayValue !== null && (t.value = n.displayValue, n.displaySelection && t.setSelectionRange(...n.displaySelection));
|
|
45
|
+
}, [
|
|
46
|
+
Z,
|
|
47
|
+
S,
|
|
48
|
+
V,
|
|
49
|
+
X,
|
|
50
|
+
v
|
|
51
|
+
]), be = c.useCallback((e) => {
|
|
52
|
+
M?.(e);
|
|
53
|
+
let t = e.currentTarget;
|
|
54
|
+
if (!K.isFormatted || e.defaultPrevented || e.detail > 1 || t.value.length === 0 || t.selectionStart !== t.selectionEnd) return;
|
|
55
|
+
let n = t.value.length;
|
|
56
|
+
t.setSelectionRange(n, n);
|
|
57
|
+
}, [M, K.isFormatted]), xe = c.useCallback((e) => {
|
|
58
|
+
if (Z || U(o(e.target.value, v)), $) {
|
|
59
|
+
let n = t({ value: e.target.value });
|
|
60
|
+
if (n.length === 4) {
|
|
61
|
+
let e = Number.parseInt(n, 10);
|
|
62
|
+
(e < $.min || e > $.max) && V(!0);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
C?.(e);
|
|
66
|
+
}, [
|
|
67
|
+
Z,
|
|
68
|
+
C,
|
|
69
|
+
V,
|
|
70
|
+
v,
|
|
71
|
+
$
|
|
72
|
+
]), Se = c.useCallback(() => {
|
|
73
|
+
let e = G.current;
|
|
74
|
+
if (!e) return;
|
|
75
|
+
let t = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
76
|
+
t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus();
|
|
77
|
+
}, []), Ce = n(ae(), K.isCentered ? "zui:text-center" : "zui:text-start", q ? "zui-input-search-cancel zui:ps-10 zui:pe-10" : J ? "zui:pe-16" : "zui:pe-10");
|
|
78
|
+
return /* @__PURE__ */ u("div", {
|
|
79
|
+
"data-slot": "input-field",
|
|
80
|
+
dir: L,
|
|
81
|
+
className: n("zui:w-full zui:space-y-1.5 zui:text-start", _),
|
|
82
|
+
children: [/* @__PURE__ */ l(te, {
|
|
83
|
+
title: y,
|
|
84
|
+
htmlFor: W,
|
|
85
|
+
required: b,
|
|
86
|
+
showRequiredMessage: x
|
|
87
|
+
}), /* @__PURE__ */ u("div", {
|
|
88
|
+
className: "zui:relative",
|
|
89
|
+
children: [
|
|
90
|
+
!y && b && !x ? /* @__PURE__ */ l(ne, {}) : null,
|
|
91
|
+
q ? /* @__PURE__ */ l(f, {
|
|
92
|
+
className: "zui:pointer-events-none zui:absolute zui:start-3 zui:top-1/2 zui:size-4 zui:-translate-y-1/2 zui:text-[var(--zui-color-text)]",
|
|
93
|
+
"aria-hidden": "true"
|
|
94
|
+
}) : null,
|
|
95
|
+
/* @__PURE__ */ l("input", {
|
|
96
|
+
...N,
|
|
97
|
+
ref: he,
|
|
98
|
+
id: W,
|
|
99
|
+
"data-slot": "input",
|
|
100
|
+
type: ge,
|
|
101
|
+
inputMode: K.inputMode ?? j,
|
|
102
|
+
maxLength: K.maxLength ?? se ?? A,
|
|
103
|
+
required: b,
|
|
104
|
+
"aria-invalid": B || void 0,
|
|
105
|
+
"data-has-value": Q,
|
|
106
|
+
placeholder: ce,
|
|
107
|
+
name: fe,
|
|
108
|
+
disabled: w,
|
|
109
|
+
readOnly: T,
|
|
110
|
+
autoComplete: E,
|
|
111
|
+
"aria-label": D,
|
|
112
|
+
onChange: ye,
|
|
113
|
+
onBlur: xe,
|
|
114
|
+
onFocus: le,
|
|
115
|
+
onMouseUp: be,
|
|
116
|
+
onInvalid: pe,
|
|
117
|
+
value: _e,
|
|
118
|
+
defaultValue: ve,
|
|
119
|
+
className: n(Ce, g)
|
|
120
|
+
}),
|
|
121
|
+
Q && !w ? /* @__PURE__ */ l(r, {
|
|
122
|
+
text: F.common.clear,
|
|
123
|
+
position: "top",
|
|
124
|
+
disabled: T,
|
|
125
|
+
trigger: /* @__PURE__ */ l("button", {
|
|
126
|
+
type: "button",
|
|
127
|
+
onClick: Se,
|
|
128
|
+
disabled: T,
|
|
129
|
+
tabIndex: -1,
|
|
130
|
+
className: n("zui:group/clear-input zui:absolute zui:top-1/2 zui:inline-flex zui:-translate-y-1/2 zui:items-center zui:justify-center zui:cursor-pointer zui:border-0 zui:bg-transparent zui:p-0 zui:leading-none zui:text-[var(--zui-color-text)] zui:outline-none zui:transition-opacity zui:duration-200 zui:ease-out zui:hover:opacity-80 zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:opacity-50", J ? "zui:end-9 zui:mobile:end-10" : "zui:end-3"),
|
|
131
|
+
"aria-label": F.common.clear,
|
|
132
|
+
children: /* @__PURE__ */ l(p, {
|
|
133
|
+
className: `${i} zui:text-[var(--zui-color-text)] zui:transition-transform zui:duration-200 zui:ease-out zui:group-hover/clear-input:scale-110`,
|
|
134
|
+
"aria-hidden": "true"
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}) : null,
|
|
138
|
+
J ? /* @__PURE__ */ l("button", {
|
|
139
|
+
type: "button",
|
|
140
|
+
onClick: () => z((e) => !e),
|
|
141
|
+
className: "zui:absolute zui:end-3 zui:top-1/2 zui:-translate-y-1/2 zui:cursor-pointer zui:text-[var(--zui-color-text)] zui:transition-opacity zui:hover:opacity-80 zui:focus-visible:outline-none",
|
|
142
|
+
"aria-label": R ? F.input.hidePassword : F.input.showPassword,
|
|
143
|
+
children: l(R ? d : oe, {
|
|
144
|
+
className: i,
|
|
145
|
+
"aria-hidden": "true"
|
|
146
|
+
})
|
|
147
|
+
}) : null
|
|
148
|
+
]
|
|
149
|
+
})]
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
//#endregion
|
|
153
|
+
export { g as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../shared/responsiveScale.cjs`),t=require(`../shared/fieldStyles.cjs`);var n=(0,require(`class-variance-authority`).cva)([`zui:file:text-[var(--zui-color-text)] zui:placeholder:text-[var(--zui-theme-text-muted)] zui:mobile:placeholder:text-sm zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:flex zui:w-full zui:min-w-0 zui-radius-xs zui:border zui:border-[var(--zui-color-border)] zui:bg-transparent ${e.CONTROL_PADDING_X} zui:py-2 zui:text-base ${e.FIELD_TEXT_MOBILE} zui:text-[var(--zui-color-text)] zui:outline-none zui:file:inline-flex zui:file:h-7 zui:file:border-0 zui:file:bg-transparent zui:file:text-sm zui:file:font-medium zui:data-[has-value=true]:border-[var(--zui-theme-action-primary)] zui:[&:not(:focus):not(:focus-visible):not([data-has-value=true])]:border-[var(--zui-color-border)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:bg-[var(--zui-color-muted-surface)] zui:disabled:opacity-50 zui:md:text-sm`,t.fieldInteractionClassName,e.CONTROL_HEIGHT_DEFAULT].join(` `));exports.inputVariants=n;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const inputVariants: (props?: (
|
|
2
|
-
size?: "sm" | "default" | "lg" | null | undefined;
|
|
3
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
1
|
+
declare const inputVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
2
|
export { inputVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CONTROL_HEIGHT_DEFAULT as e, CONTROL_PADDING_X as t, FIELD_TEXT_MOBILE as n } from "../shared/responsiveScale.js";
|
|
2
|
+
import { fieldInteractionClassName as r } from "../shared/fieldStyles.js";
|
|
3
|
+
import { cva as i } from "class-variance-authority";
|
|
4
|
+
//#region src/components/Input/Input.variant.ts
|
|
5
|
+
var a = i([
|
|
6
|
+
`zui:file:text-[var(--zui-color-text)] zui:placeholder:text-[var(--zui-theme-text-muted)] zui:mobile:placeholder:text-sm zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:flex zui:w-full zui:min-w-0 zui-radius-xs zui:border zui:border-[var(--zui-color-border)] zui:bg-transparent ${t} zui:py-2 zui:text-base ${n} zui:text-[var(--zui-color-text)] zui:outline-none zui:file:inline-flex zui:file:h-7 zui:file:border-0 zui:file:bg-transparent zui:file:text-sm zui:file:font-medium zui:data-[has-value=true]:border-[var(--zui-theme-action-primary)] zui:[&:not(:focus):not(:focus-visible):not([data-has-value=true])]:border-[var(--zui-color-border)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:bg-[var(--zui-color-muted-surface)] zui:disabled:opacity-50 zui:md:text-sm`,
|
|
7
|
+
r,
|
|
8
|
+
e
|
|
9
|
+
].join(" "));
|
|
10
|
+
//#endregion
|
|
11
|
+
export { a as inputVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/useZuiConfig.cjs`),n=require(`../../services/localizeDigits/localizeDigits.cjs`),r=require(`../../lib/utils.cjs`),i=require(`../shared/useControllableState.cjs`),a=require(`../shared/viewport.cjs`),o=require(`./Pagination.variant.cjs`);let s=require(`react`);s=e.__toESM(s,1);let c=require(`react/jsx-runtime`),l=require(`lucide-react`);function u(e,t){if(typeof e!=`number`||!Number.isFinite(e))return t;let n=Math.floor(e);return n>=1?n:t}function d(e,t){return Math.min(Math.max(e,1),t)}function f({currentPage:e,totalPages:t,siblingCount:n}){if(t<=1)return[1];if(t<=n*2+5)return Array.from({length:t},(e,t)=>t+1);let r=Math.max(e-n,2),i=Math.min(e+n,t-1),a=r>2,o=i<t-1,s=[1];if(a)s.push(`ellipsis`);else for(let e=2;e<r;e+=1)s.push(e);for(let e=r;e<=i;e+=1)s.push(e);if(o)s.push(`ellipsis`);else for(let e=i+1;e<t;e+=1)s.push(e);return s.push(t),s}var p=4;function m(e,t){if(t<=p)return Array.from({length:t},(e,t)=>t+1);let n=new Set([1,t,e]);e===1?n.add(2):e===t&&n.add(t-1);let r=Array.from(n).sort((e,t)=>e-t),i=[];return r.forEach((e,t)=>{let n=r[t-1];n!==void 0&&e-n-1>0&&i.push(`ellipsis`),i.push(e)}),i}function h({totalPages:e=1,page:p,defaultPage:h=1,siblingCount:g=1,showControls:_=!0,previousLabel:v,nextLabel:y,dir:b,className:x,onPageChange:S},C){let{messages:w,digits:T,dir:E}=t.useZuiConfig(),D=a.useIsMobileViewport(),O=b??E,k=v??w.pagination.previous,A=y??w.pagination.next,j=e=>n.localizeDigits(String(e),T),M=u(e,1),N=d(u(h,1),M),[P,F]=i.useControllableState({value:p===void 0?void 0:u(p,1),defaultValue:N,onChange:S}),I=d(P,M),L=Math.max(0,Math.floor(g)),R=s.useMemo(()=>D?m(I,M):f({currentPage:I,totalPages:M,siblingCount:L}),[I,D,L,M]),z=s.useCallback(e=>{let t=d(e,M);t!==I&&F(t)},[I,F,M]),B=I>1,V=I<M,H=O===`rtl`?l.ChevronRight:l.ChevronLeft,U=O===`rtl`?l.ChevronLeft:l.ChevronRight;return(0,c.jsx)(`nav`,{ref:C,role:`navigation`,"aria-label":w.pagination.ariaLabel,dir:O,"data-slot":`pagination`,className:r.cn(o.paginationVariants(),x),children:(0,c.jsxs)(`ul`,{"data-slot":`pagination-content`,className:o.paginationContentVariants(),children:[_?(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants(),children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`pagination-previous`,"aria-label":k,disabled:!B,onClick:()=>z(I-1),className:r.cn(o.paginationLinkVariants({size:`default`}),o.paginationPreviousVariants()),children:[(0,c.jsx)(H,{className:`zui:size-4`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`zui:hidden zui:desktop:inline`,children:k})]})}):null,R.map((e,t)=>{if(e===`ellipsis`)return(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants({kind:`ellipsis`}),children:(0,c.jsxs)(`span`,{"data-slot":`pagination-ellipsis`,"aria-hidden":`true`,className:o.paginationEllipsisVariants(),children:[(0,c.jsx)(l.MoreHorizontal,{className:`zui:size-4`}),(0,c.jsx)(`span`,{className:`zui:sr-only`,children:w.pagination.morePages})]})},`ellipsis-${t}`);let n=e===I;return(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants(),children:(0,c.jsx)(`button`,{type:`button`,"data-slot":`pagination-link`,"aria-label":w.pagination.page(j(e)),"aria-current":n?`page`:void 0,onClick:()=>z(e),className:o.paginationLinkVariants({size:`icon`,active:n}),children:j(e)})},`page-${e}`)}),_?(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants(),children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`pagination-next`,"aria-label":A,disabled:!V,onClick:()=>z(I+1),className:r.cn(o.paginationLinkVariants({size:`default`}),o.paginationNextVariants()),children:[(0,c.jsx)(`span`,{className:`zui:hidden zui:desktop:inline`,children:A}),(0,c.jsx)(U,{className:`zui:size-4`,"aria-hidden":`true`})]})}):null]})})}var g=s.forwardRef(h);g.displayName=`Pagination`,exports.default=g;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PaginationProps } from "./Pagination.interface.js";
|
|
3
|
+
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
3
4
|
export default Pagination;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
totalPages?: number;
|
|
3
|
+
page?: number;
|
|
4
|
+
defaultPage?: number;
|
|
5
|
+
siblingCount?: number;
|
|
6
|
+
showControls?: boolean;
|
|
7
|
+
previousLabel?: string;
|
|
8
|
+
nextLabel?: string;
|
|
9
|
+
dir?: "rtl" | "ltr";
|
|
10
|
+
className?: string;
|
|
11
|
+
onPageChange?: (page: number) => void;
|
|
12
|
+
}
|