@thewrong/ui 0.1.0 → 0.3.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/README.md +25 -4
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/_shared/form-size-tokens.cjs +1 -0
- package/dist/{src/components → components}/_shared/form-size-tokens.d.ts +3 -1
- package/dist/components/_shared/form-size-tokens.esm.js +34 -0
- package/dist/components/action-toast/ActionToast.cjs +1 -0
- package/dist/{src/components → components}/action-toast/ActionToast.d.ts +17 -3
- package/dist/components/action-toast/ActionToast.esm.js +238 -0
- package/dist/{src/components → components}/action-toast/index.d.ts +2 -2
- package/dist/components/animated-height/AnimatedHeight.cjs +1 -0
- package/dist/components/animated-height/AnimatedHeight.esm.js +36 -0
- package/dist/components/animated-height/index.d.ts +2 -0
- package/dist/components/badge/Badge.cjs +1 -0
- package/dist/{src/components → components}/badge/Badge.d.ts +1 -1
- package/dist/components/badge/Badge.esm.js +26 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/utils.cjs +1 -0
- package/dist/{src/components → components}/badge/utils.d.ts +1 -1
- package/dist/components/badge/utils.esm.js +38 -0
- package/dist/components/button/Button.cjs +1 -0
- package/dist/components/button/Button.d.ts +19 -0
- package/dist/components/button/Button.esm.js +77 -0
- package/dist/{src/components → components}/button/index.d.ts +2 -2
- package/dist/components/button/utils.cjs +1 -0
- package/dist/{src/components → components}/button/utils.d.ts +1 -1
- package/dist/components/button/utils.esm.js +38 -0
- package/dist/components/checkbox/Checkbox.cjs +1 -0
- package/dist/{src/components → components}/checkbox/Checkbox.d.ts +1 -1
- package/dist/components/checkbox/Checkbox.esm.js +69 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/utils.cjs +1 -0
- package/dist/{src/components → components}/checkbox/utils.d.ts +1 -1
- package/dist/components/checkbox/utils.esm.js +44 -0
- package/dist/components/collapsible/Collapsible.cjs +1 -0
- package/dist/components/collapsible/Collapsible.esm.js +20 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/copyable-text/CopyableText.cjs +1 -0
- package/dist/components/copyable-text/CopyableText.d.ts +22 -0
- package/dist/components/copyable-text/CopyableText.esm.js +50 -0
- package/dist/components/copyable-text/index.d.ts +2 -0
- package/dist/components/date-input/DateInput.cjs +1 -0
- package/dist/{src/components → components}/date-input/DateInput.d.ts +1 -0
- package/dist/components/date-input/DateInput.esm.js +40 -0
- package/dist/components/date-input/index.d.ts +1 -0
- package/dist/components/date-picker/PickerSheet.cjs +1 -0
- package/dist/components/date-picker/PickerSheet.d.ts +22 -0
- package/dist/components/date-picker/PickerSheet.esm.js +77 -0
- package/dist/components/date-picker/date-picker.cjs +1 -0
- package/dist/{src/components → components}/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.esm.js +183 -0
- package/dist/components/date-picker/date-range-picker.cjs +1 -0
- package/dist/{src/components → components}/date-picker/date-range-picker.d.ts +3 -1
- package/dist/components/date-picker/date-range-picker.esm.js +238 -0
- package/dist/components/date-picker/index.d.ts +5 -0
- package/dist/components/date-picker/month-picker.cjs +1 -0
- package/dist/{src/components → components}/date-picker/month-picker.d.ts +1 -0
- package/dist/components/date-picker/month-picker.esm.js +103 -0
- package/dist/components/drawer/Drawer.cjs +1 -0
- package/dist/components/drawer/Drawer.d.ts +45 -0
- package/dist/components/drawer/Drawer.esm.js +143 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/error-boundary/ErrorBoundary.cjs +1 -0
- package/dist/components/error-boundary/ErrorBoundary.d.ts +23 -0
- package/dist/components/error-boundary/ErrorBoundary.esm.js +46 -0
- package/dist/components/error-boundary/chunk-reload.cjs +1 -0
- package/dist/components/error-boundary/chunk-reload.d.ts +77 -0
- package/dist/components/error-boundary/chunk-reload.esm.js +73 -0
- package/dist/components/error-boundary/index.d.ts +4 -0
- package/dist/components/error-boundary/types.d.ts +23 -0
- package/dist/components/field/Field.cjs +1 -0
- package/dist/components/field/Field.d.ts +16 -0
- package/dist/components/field/Field.esm.js +34 -0
- package/dist/components/field/FieldMessage.cjs +1 -0
- package/dist/components/field/FieldMessage.d.ts +19 -0
- package/dist/components/field/FieldMessage.esm.js +12 -0
- package/dist/components/field/index.d.ts +3 -0
- package/dist/components/field/types.d.ts +24 -0
- package/dist/components/info-tooltip/InfoTooltip.cjs +1 -0
- package/dist/{src/components → components}/info-tooltip/InfoTooltip.d.ts +7 -0
- package/dist/components/info-tooltip/InfoTooltip.esm.js +25 -0
- package/dist/components/info-tooltip/index.d.ts +2 -0
- package/dist/components/input/DecimalInput.cjs +1 -0
- package/dist/components/input/DecimalInput.d.ts +18 -0
- package/dist/components/input/DecimalInput.esm.js +40 -0
- package/dist/components/input/Input.cjs +1 -0
- package/dist/{src/components → components}/input/Input.d.ts +1 -1
- package/dist/components/input/Input.esm.js +89 -0
- package/dist/components/input/PasswordInput.cjs +1 -0
- package/dist/{src/components → components}/input/PasswordInput.d.ts +1 -1
- package/dist/components/input/PasswordInput.esm.js +29 -0
- package/dist/components/input/decimal-validation.cjs +1 -0
- package/dist/components/input/decimal-validation.d.ts +7 -0
- package/dist/components/input/decimal-validation.esm.js +66 -0
- package/dist/components/input/format.cjs +1 -0
- package/dist/{src/components → components}/input/format.d.ts +17 -1
- package/dist/components/input/format.esm.js +44 -0
- package/dist/components/input/index.d.ts +7 -0
- package/dist/{src/components → components}/input/types.d.ts +2 -2
- package/dist/components/input/use-input-format.cjs +1 -0
- package/dist/components/input/use-input-format.d.ts +43 -0
- package/dist/components/input/use-input-format.esm.js +75 -0
- package/dist/components/input/utils.cjs +1 -0
- package/dist/{src/components → components}/input/utils.d.ts +1 -1
- package/dist/components/input/utils.esm.js +24 -0
- package/dist/components/loading-spinner/LoadingSpinner.cjs +1 -0
- package/dist/{src/components → components}/loading-spinner/LoadingSpinner.d.ts +7 -0
- package/dist/components/loading-spinner/LoadingSpinner.esm.js +48 -0
- package/dist/components/loading-spinner/index.d.ts +2 -0
- package/dist/components/modal/Modal.cjs +1 -0
- package/dist/{src/components → components}/modal/Modal.d.ts +34 -2
- package/dist/components/modal/Modal.esm.js +167 -0
- package/dist/components/modal/ModalFocusTrapContext.cjs +1 -0
- package/dist/components/modal/ModalFocusTrapContext.d.ts +18 -0
- package/dist/components/modal/ModalFocusTrapContext.esm.js +36 -0
- package/dist/components/modal/ModalSubView.cjs +1 -0
- package/dist/{src/components → components}/modal/ModalSubView.d.ts +6 -1
- package/dist/components/modal/ModalSubView.esm.js +111 -0
- package/dist/components/modal/StandardModal.cjs +1 -0
- package/dist/{src/components → components}/modal/StandardModal.d.ts +8 -2
- package/dist/components/modal/StandardModal.esm.js +57 -0
- package/dist/components/modal/index.d.ts +6 -0
- package/dist/components/month-range-picker/index.d.ts +2 -0
- package/dist/components/month-range-picker/month-range-picker.cjs +1 -0
- package/dist/components/month-range-picker/month-range-picker.d.ts +16 -0
- package/dist/components/month-range-picker/month-range-picker.esm.js +227 -0
- package/dist/components/month-range-picker/month-range-utils.cjs +1 -0
- package/dist/components/month-range-picker/month-range-utils.d.ts +9 -0
- package/dist/components/month-range-picker/month-range-utils.esm.js +28 -0
- package/dist/components/page-title/PageTitle.cjs +1 -0
- package/dist/components/page-title/PageTitle.esm.js +17 -0
- package/dist/components/page-title/index.d.ts +1 -0
- package/dist/components/popover/Popover.cjs +1 -0
- package/dist/{src/components → components}/popover/Popover.d.ts +19 -1
- package/dist/components/popover/Popover.esm.js +57 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/progress/Progress.cjs +1 -0
- package/dist/components/progress/Progress.d.ts +13 -0
- package/dist/components/progress/Progress.esm.js +24 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/types.d.ts +13 -0
- package/dist/components/radio/Radio.cjs +1 -0
- package/dist/components/radio/Radio.d.ts +31 -0
- package/dist/components/radio/Radio.esm.js +118 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/types.d.ts +24 -0
- package/dist/components/search-box/ExactMatchToggle.cjs +1 -0
- package/dist/components/search-box/ExactMatchToggle.esm.js +28 -0
- package/dist/components/search-box/SearchBox.cjs +1 -0
- package/dist/{src/components → components}/search-box/SearchBox.d.ts +1 -1
- package/dist/components/search-box/SearchBox.esm.js +155 -0
- package/dist/components/search-box/SearchBoxChips.cjs +1 -0
- package/dist/components/search-box/SearchBoxChips.esm.js +36 -0
- package/dist/components/search-box/SearchBoxDateRange.cjs +1 -0
- package/dist/{src/components → components}/search-box/SearchBoxDateRange.d.ts +1 -1
- package/dist/components/search-box/SearchBoxDateRange.esm.js +60 -0
- package/dist/components/search-box/SearchBoxDateSingle.cjs +1 -0
- package/dist/{src/components → components}/search-box/SearchBoxDateSingle.d.ts +1 -1
- package/dist/components/search-box/SearchBoxDateSingle.esm.js +39 -0
- package/dist/components/search-box/SearchBoxField.cjs +1 -0
- package/dist/{src/components → components}/search-box/SearchBoxField.d.ts +1 -1
- package/dist/components/search-box/SearchBoxField.esm.js +48 -0
- package/dist/components/search-box/SearchBoxFloatingInput.cjs +1 -0
- package/dist/components/search-box/SearchBoxFloatingInput.esm.js +43 -0
- package/dist/components/search-box/SearchBoxFloatingSelect.cjs +1 -0
- package/dist/{src/components → components}/search-box/SearchBoxFloatingSelect.d.ts +1 -1
- package/dist/components/search-box/SearchBoxFloatingSelect.esm.js +79 -0
- package/dist/components/search-box/SearchBoxMonth.cjs +1 -0
- package/dist/components/search-box/SearchBoxMonth.esm.js +36 -0
- package/dist/components/search-box/SearchBoxMultiSelect.cjs +1 -0
- package/dist/{src/components → components}/search-box/SearchBoxMultiSelect.d.ts +2 -2
- package/dist/components/search-box/SearchBoxMultiSelect.esm.js +83 -0
- package/dist/components/search-box/SearchBoxSheetContext.cjs +1 -0
- package/dist/components/search-box/SearchBoxSheetContext.esm.js +5 -0
- package/dist/components/search-box/dateRangePresets.cjs +1 -0
- package/dist/{src/components → components}/search-box/dateRangePresets.d.ts +1 -1
- package/dist/components/search-box/dateRangePresets.esm.js +59 -0
- package/dist/{src/components → components}/search-box/index.d.ts +5 -5
- package/dist/components/search-box/parseDateRange.cjs +1 -0
- package/dist/components/search-box/parseDateRange.esm.js +21 -0
- package/dist/components/search-box/parseSearchValues.cjs +1 -0
- package/dist/{src/components → components}/search-box/parseSearchValues.d.ts +2 -2
- package/dist/components/search-box/parseSearchValues.esm.js +15 -0
- package/dist/{src/components → components}/search-box/types.d.ts +1 -1
- package/dist/components/search-box/useSearchBoxState.cjs +1 -0
- package/dist/{src/components → components}/search-box/useSearchBoxState.d.ts +1 -1
- package/dist/components/search-box/useSearchBoxState.esm.js +87 -0
- package/dist/components/segmented-code-input/SegmentedCodeInput.cjs +1 -0
- package/dist/components/segmented-code-input/SegmentedCodeInput.d.ts +49 -0
- package/dist/components/segmented-code-input/SegmentedCodeInput.esm.js +87 -0
- package/dist/components/segmented-code-input/code-utils.cjs +1 -0
- package/dist/components/segmented-code-input/code-utils.d.ts +4 -0
- package/dist/components/segmented-code-input/code-utils.esm.js +9 -0
- package/dist/components/segmented-code-input/index.d.ts +2 -0
- package/dist/components/segmented-control/SegmentedControl.cjs +1 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +27 -0
- package/dist/components/segmented-control/SegmentedControl.esm.js +84 -0
- package/dist/components/segmented-control/index.d.ts +2 -0
- package/dist/components/segmented-control/types.d.ts +30 -0
- package/dist/components/select/MultiSelect.cjs +1 -0
- package/dist/{src/components → components}/select/MultiSelect.d.ts +11 -3
- package/dist/components/select/MultiSelect.esm.js +279 -0
- package/dist/components/select/Select.cjs +1 -0
- package/dist/{src/components → components}/select/Select.d.ts +16 -2
- package/dist/components/select/Select.esm.js +320 -0
- package/dist/components/select/index.d.ts +4 -0
- package/dist/components/select/loading-dots.cjs +1 -0
- package/dist/components/select/loading-dots.d.ts +3 -0
- package/dist/components/select/loading-dots.esm.js +24 -0
- package/dist/components/select/panel-width.cjs +1 -0
- package/dist/components/select/panel-width.d.ts +2 -0
- package/dist/components/select/panel-width.esm.js +7 -0
- package/dist/{src/components → components}/select/utils.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.cjs +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +6 -0
- package/dist/components/skeleton/Skeleton.esm.js +12 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/types.d.ts +2 -0
- package/dist/components/stepper/Stepper.cjs +1 -0
- package/dist/components/stepper/Stepper.d.ts +51 -0
- package/dist/components/stepper/Stepper.esm.js +142 -0
- package/dist/components/stepper/index.d.ts +4 -0
- package/dist/components/stepper/use-stepper.cjs +1 -0
- package/dist/components/stepper/use-stepper.d.ts +43 -0
- package/dist/components/stepper/use-stepper.esm.js +57 -0
- package/dist/components/switch/Switch.cjs +1 -0
- package/dist/{src/components → components}/switch/Switch.d.ts +1 -1
- package/dist/components/switch/Switch.esm.js +37 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/utils.cjs +1 -0
- package/dist/{src/components → components}/switch/utils.d.ts +2 -2
- package/dist/components/switch/utils.esm.js +40 -0
- package/dist/components/table/accordion-table.cjs +1 -0
- package/dist/{src/components → components}/table/accordion-table.d.ts +1 -1
- package/dist/components/table/accordion-table.esm.js +418 -0
- package/dist/components/table/column-group-utils.cjs +1 -0
- package/dist/{src/components → components}/table/column-group-utils.d.ts +1 -1
- package/dist/components/table/column-group-utils.esm.js +53 -0
- package/dist/components/table/components/ColumnPresetSelector.cjs +1 -0
- package/dist/{src/components → components}/table/components/ColumnPresetSelector.d.ts +2 -2
- package/dist/components/table/components/ColumnPresetSelector.esm.js +166 -0
- package/dist/components/table/components/ColumnSettingsTable.cjs +1 -0
- package/dist/{src/components → components}/table/components/ColumnSettingsTable.d.ts +1 -1
- package/dist/components/table/components/ColumnSettingsTable.esm.js +194 -0
- package/dist/components/table/components/KeyboardNavButton.cjs +1 -0
- package/dist/components/table/components/KeyboardNavButton.esm.js +24 -0
- package/dist/components/table/components/PageJumpInput.cjs +1 -0
- package/dist/components/table/components/PageJumpInput.esm.js +54 -0
- package/dist/components/table/components/Pagination.cjs +1 -0
- package/dist/components/table/components/Pagination.esm.js +163 -0
- package/dist/components/table/components/PaginationFooter.cjs +1 -0
- package/dist/components/table/components/PaginationFooter.esm.js +80 -0
- package/dist/components/table/components/SortableHeaderCell.cjs +1 -0
- package/dist/components/table/components/SortableHeaderCell.esm.js +30 -0
- package/dist/components/table/hooks/useColumnPresets.cjs +1 -0
- package/dist/{src/components → components}/table/hooks/useColumnPresets.d.ts +2 -2
- package/dist/components/table/hooks/useColumnPresets.esm.js +165 -0
- package/dist/components/table/hooks/useColumnResize.cjs +1 -0
- package/dist/{src/components → components}/table/hooks/useColumnResize.d.ts +12 -0
- package/dist/components/table/hooks/useColumnResize.esm.js +118 -0
- package/dist/components/table/hooks/useFillEmptyRows.d.ts +2 -0
- package/dist/components/table/hooks/useInfiniteScroll.d.ts +2 -0
- package/dist/components/table/hooks/useTableColumnState.cjs +1 -0
- package/dist/{src/components → components}/table/hooks/useTableColumnState.d.ts +1 -1
- package/dist/components/table/hooks/useTableColumnState.esm.js +46 -0
- package/dist/components/table/hooks/useTableDragSelection.d.ts +2 -0
- package/dist/components/table/hooks/useTableSort.cjs +1 -0
- package/dist/{src/components → components}/table/hooks/useTableSort.d.ts +1 -1
- package/dist/components/table/hooks/useTableSort.esm.js +30 -0
- package/dist/components/table/hooks/useVirtualTable.cjs +1 -0
- package/dist/components/table/hooks/useVirtualTable.esm.js +18 -0
- package/dist/components/table/index.d.ts +27 -0
- package/dist/components/table/mini-table.cjs +1 -0
- package/dist/{src/components → components}/table/mini-table.d.ts +1 -1
- package/dist/components/table/mini-table.esm.js +127 -0
- package/dist/components/table/paginated-mini-table.cjs +1 -0
- package/dist/{src/components → components}/table/paginated-mini-table.d.ts +1 -1
- package/dist/components/table/paginated-mini-table.esm.js +31 -0
- package/dist/components/table/paginated-table.cjs +1 -0
- package/dist/{src/components → components}/table/paginated-table.d.ts +1 -1
- package/dist/components/table/paginated-table.esm.js +31 -0
- package/dist/components/table/table.cjs +1 -0
- package/dist/{src/components → components}/table/table.d.ts +2 -1
- package/dist/components/table/table.esm.js +343 -0
- package/dist/components/table/utils.cjs +35 -0
- package/dist/{src/components → components}/table/utils.d.ts +2 -2
- package/dist/components/table/utils.esm.js +16 -0
- package/dist/components/table-checkbox/TableCheckbox.cjs +1 -0
- package/dist/components/table-checkbox/TableCheckbox.esm.js +40 -0
- package/dist/components/table-checkbox/index.d.ts +1 -0
- package/dist/components/table-page-layout/TablePageLayout.cjs +1 -0
- package/dist/components/table-page-layout/TablePageLayout.esm.js +37 -0
- package/dist/{src/components → components}/table-page-layout/index.d.ts +1 -1
- package/dist/components/textarea/Textarea.cjs +1 -0
- package/dist/{src/components → components}/textarea/Textarea.d.ts +1 -1
- package/dist/components/textarea/Textarea.esm.js +64 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/time-picker.cjs +1 -0
- package/dist/components/time-picker/time-picker.d.ts +35 -0
- package/dist/components/time-picker/time-picker.esm.js +193 -0
- package/dist/components/time-picker/time-utils.cjs +1 -0
- package/dist/components/time-picker/time-utils.d.ts +12 -0
- package/dist/components/time-picker/time-utils.esm.js +56 -0
- package/dist/components/toast/ToastProvider.cjs +1 -0
- package/dist/{src/components → components}/toast/ToastProvider.d.ts +3 -0
- package/dist/components/toast/ToastProvider.esm.js +86 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/index.esm.js +3 -0
- package/dist/components/toolbar/Toolbar.cjs +1 -0
- package/dist/{src/components → components}/toolbar/Toolbar.d.ts +1 -1
- package/dist/components/toolbar/Toolbar.esm.js +149 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/tooltip/Tooltip.cjs +1 -0
- package/dist/{src/components → components}/tooltip/Tooltip.d.ts +10 -0
- package/dist/components/tooltip/Tooltip.esm.js +39 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/typewriter-text/TypewriterText.cjs +1 -0
- package/dist/components/typewriter-text/TypewriterText.d.ts +7 -0
- package/dist/components/typewriter-text/TypewriterText.esm.js +58 -0
- package/dist/components/typewriter-text/index.d.ts +2 -0
- package/dist/components/typewriter-text/types.d.ts +12 -0
- package/dist/components/typing-dots/TypingDots.cjs +1 -0
- package/dist/components/typing-dots/TypingDots.d.ts +10 -0
- package/dist/components/typing-dots/TypingDots.esm.js +37 -0
- package/dist/components/typing-dots/index.d.ts +2 -0
- package/dist/components/typing-dots/types.d.ts +4 -0
- package/dist/hooks/awaitableOverlayController.cjs +1 -0
- package/dist/hooks/awaitableOverlayController.d.ts +6 -0
- package/dist/hooks/awaitableOverlayController.esm.js +18 -0
- package/dist/hooks/index.d.ts +17 -0
- package/dist/hooks/useAwaitableOverlay.cjs +1 -0
- package/dist/hooks/useAwaitableOverlay.d.ts +16 -0
- package/dist/hooks/useAwaitableOverlay.esm.js +22 -0
- package/dist/hooks/useBottomSheetDrag.cjs +1 -0
- package/dist/hooks/useBottomSheetDrag.esm.js +17 -0
- package/dist/hooks/useClickOutside.cjs +1 -0
- package/dist/hooks/useClickOutside.esm.js +20 -0
- package/dist/hooks/useFillEmptyRows.cjs +1 -0
- package/dist/{src/components/table/hooks → hooks}/useFillEmptyRows.d.ts +10 -1
- package/dist/hooks/useFillEmptyRows.esm.js +60 -0
- package/dist/hooks/useFocusTrap.cjs +1 -0
- package/dist/hooks/useFocusTrap.d.ts +47 -0
- package/dist/hooks/useFocusTrap.esm.js +210 -0
- package/dist/hooks/useInfiniteScroll.cjs +1 -0
- package/dist/hooks/useInfiniteScroll.d.ts +36 -0
- package/dist/hooks/useInfiniteScroll.esm.js +31 -0
- package/dist/hooks/useMediaQuery.cjs +1 -0
- package/dist/hooks/useMediaQuery.esm.js +15 -0
- package/dist/hooks/useScrollLock.cjs +1 -0
- package/dist/hooks/useScrollLock.esm.js +16 -0
- package/dist/hooks/useTableDragSelection.cjs +1 -0
- package/dist/{src/components/table/hooks → hooks}/useTableDragSelection.d.ts +3 -4
- package/dist/hooks/useTableDragSelection.esm.js +79 -0
- package/dist/hooks/useVirtualRows.cjs +1 -0
- package/dist/hooks/useVirtualRows.d.ts +56 -0
- package/dist/hooks/useVirtualRows.esm.js +20 -0
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.esm.js +12 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.esm.js +81 -0
- package/dist/lib/Portal.cjs +1 -0
- package/dist/lib/Portal.esm.js +11 -0
- package/dist/lib/column-preset-storage.cjs +1 -0
- package/dist/lib/column-preset-storage.esm.js +123 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/overlay-stack.cjs +1 -0
- package/dist/lib/overlay-stack.esm.js +28 -0
- package/dist/lib/utils.cjs +1 -0
- package/dist/{src/lib → lib}/utils.d.ts +2 -1
- package/dist/lib/utils.esm.js +114 -0
- package/dist/node_modules/clsx/dist/clsx.cjs +1 -0
- package/dist/node_modules/clsx/dist/clsx.esm.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.esm.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/context.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/context.esm.js +6 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.esm.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.esm.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.esm.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar.esm.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-left.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-left.esm.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-right.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-right.esm.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.esm.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.esm.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/clock.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/clock.esm.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.esm.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.esm.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/eye.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/eye.esm.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-vertical.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-vertical.esm.js +41 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.esm.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/keyboard.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/keyboard.esm.js +45 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/list-filter.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/list-filter.esm.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minus.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minus.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.esm.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/save.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/save.esm.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/search.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/search.esm.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.esm.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.esm.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.esm.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.esm.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.esm.js +4 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.esm.js +4 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.esm.js +4 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.esm.js +8 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.esm.js +1723 -0
- package/dist/node_modules/use-debounce/dist/index.module.cjs +1 -0
- package/dist/node_modules/use-debounce/dist/index.module.esm.js +70 -0
- package/dist/tokens.css +1085 -0
- package/dist/ui.css +1 -1
- package/llms.txt +117 -0
- package/package.json +18 -9
- package/dist/index.cjs.js +0 -40
- package/dist/index.es.js +0 -8066
- package/dist/src/components/animated-height/index.d.ts +0 -2
- package/dist/src/components/badge/index.d.ts +0 -2
- package/dist/src/components/button/Button.d.ts +0 -2
- package/dist/src/components/checkbox/index.d.ts +0 -2
- package/dist/src/components/collapsible/index.d.ts +0 -2
- package/dist/src/components/date-input/index.d.ts +0 -1
- package/dist/src/components/date-picker/index.d.ts +0 -5
- package/dist/src/components/drawer/Drawer.d.ts +0 -18
- package/dist/src/components/drawer/index.d.ts +0 -2
- package/dist/src/components/info-tooltip/index.d.ts +0 -2
- package/dist/src/components/input/index.d.ts +0 -4
- package/dist/src/components/loading-spinner/index.d.ts +0 -2
- package/dist/src/components/modal/index.d.ts +0 -6
- package/dist/src/components/page-title/index.d.ts +0 -1
- package/dist/src/components/popover/index.d.ts +0 -2
- package/dist/src/components/select/index.d.ts +0 -4
- package/dist/src/components/select/loading-dots.d.ts +0 -9
- package/dist/src/components/switch/index.d.ts +0 -2
- package/dist/src/components/table/hooks/useInfiniteScroll.d.ts +0 -58
- package/dist/src/components/table/index.d.ts +0 -27
- package/dist/src/components/table-checkbox/index.d.ts +0 -1
- package/dist/src/components/textarea/index.d.ts +0 -2
- package/dist/src/components/toast/index.d.ts +0 -3
- package/dist/src/components/toolbar/index.d.ts +0 -2
- package/dist/src/components/tooltip/index.d.ts +0 -2
- package/dist/src/hooks/index.d.ts +0 -4
- package/dist/src/index.d.ts +0 -27
- package/dist/src/lib/index.d.ts +0 -6
- /package/dist/{src/components → components}/animated-height/AnimatedHeight.d.ts +0 -0
- /package/dist/{src/components → components}/badge/types.d.ts +0 -0
- /package/dist/{src/components → components}/button/types.d.ts +0 -0
- /package/dist/{src/components → components}/checkbox/types.d.ts +0 -0
- /package/dist/{src/components → components}/collapsible/Collapsible.d.ts +0 -0
- /package/dist/{src/components → components}/page-title/PageTitle.d.ts +0 -0
- /package/dist/{src/components → components}/search-box/ExactMatchToggle.d.ts +0 -0
- /package/dist/{src/components → components}/search-box/SearchBoxChips.d.ts +0 -0
- /package/dist/{src/components → components}/search-box/SearchBoxFloatingInput.d.ts +0 -0
- /package/dist/{src/components → components}/search-box/SearchBoxMonth.d.ts +0 -0
- /package/dist/{src/components → components}/search-box/SearchBoxSheetContext.d.ts +0 -0
- /package/dist/{src/components → components}/search-box/parseDateRange.d.ts +0 -0
- /package/dist/{src/components → components}/select/types.d.ts +0 -0
- /package/dist/{src/components → components}/switch/types.d.ts +0 -0
- /package/dist/{src/components → components}/table/components/KeyboardNavButton.d.ts +0 -0
- /package/dist/{src/components → components}/table/components/PageJumpInput.d.ts +0 -0
- /package/dist/{src/components → components}/table/components/Pagination.d.ts +0 -0
- /package/dist/{src/components → components}/table/components/PaginationFooter.d.ts +0 -0
- /package/dist/{src/components → components}/table/components/SortableHeaderCell.d.ts +0 -0
- /package/dist/{src/components → components}/table/hooks/useVirtualTable.d.ts +0 -0
- /package/dist/{src/components → components}/table/types.d.ts +0 -0
- /package/dist/{src/components → components}/table-checkbox/TableCheckbox.d.ts +0 -0
- /package/dist/{src/components → components}/table-page-layout/TablePageLayout.d.ts +0 -0
- /package/dist/{src/components → components}/textarea/types.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useBottomSheetDrag.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useClickOutside.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useMediaQuery.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useScrollLock.d.ts +0 -0
- /package/dist/{src/lib → lib}/Portal.d.ts +0 -0
- /package/dist/{src/lib → lib}/column-preset-storage.d.ts +0 -0
- /package/dist/{src/lib → lib}/overlay-stack.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs"),t=require("../../node_modules/lucide-react/dist/esm/icons/circle-x.cjs"),n=require("../_shared/form-size-tokens.cjs"),r=require("./use-input-format.cjs"),i=require("./utils.cjs");let a=require("react"),o=require("react/jsx-runtime");var s=(0,a.forwardRef)(({variant:s,inputSize:c=`medium`,label:l,labelOption:u=`appear`,help:d,hasError:f=!1,disabled:p=!1,prefix:m,suffix:h,trailingIcon:g,clearable:_=!1,badge:v,placeholder:y,format:b,containerProps:x,containerRef:S,value:C,defaultValue:w,onChange:T,onFocus:E,onBlur:D,className:O=``,...k},A)=>{let[j,M]=(0,a.useState)(!1),{displayValue:N,handleChange:P,handleCompositionStart:F,handleCompositionEnd:I,setMergedInputRef:L,handleClear:R}=r.useInputFormat({value:C,defaultValue:w,format:b,onChange:T,readOnly:k.readOnly}),z=e=>{M(!0),E?.(e)},B=e=>{M(!1),D?.(e)},V=k.ref,H=N.length>0,U=i.getInputContainerClasses(),W=i.getInputVariantClasses(s,f,p,c),G=i.getInputClasses(s,f,p,H,c),K=i.getInputTrailingIconColor(f,p,H||j),q=u===`sustain`||u===`appear`&&!!N,J=s===`box`,Y=n.SLOT_GAP_CLASS[c],X=n.SLOT_CHILD_ICON_CLASS[c],Z=n.SLOT_BADGE_TEXT_CLASS[c],Q=n.SLOT_ICON_SIZE_CLASS[c],$=(0,o.jsxs)(`div`,{className:J?e.cn(W,`flex items-center`,Y,O):`relative flex items-center text-sm`,children:[m&&(0,o.jsx)(`span`,{className:e.cn(`whitespace-nowrap text-sm`,K),children:m}),(0,o.jsx)(`input`,{...k,ref:L(A,V),className:J?G:e.cn(G,W,f&&`border-border-danger focus:border-border-danger focus:ring-focus-danger`,p&&`opacity-50`,O),value:N,onChange:P,onCompositionStart:e=>{F(e),k.onCompositionStart?.(e)},onCompositionEnd:e=>{I(e),k.onCompositionEnd?.(e)},onFocus:z,onBlur:B,disabled:p,placeholder:y}),h&&(0,o.jsx)(`span`,{className:e.cn(`whitespace-nowrap text-sm`,K),children:h}),g&&(0,o.jsx)(`span`,{className:e.cn(`flex shrink-0 items-center`,K,X),children:g}),_&&!p&&!k.readOnly&&H&&(0,o.jsx)(`button`,{type:`button`,onClick:R,"aria-label":`입력 지우기`,className:e.cn(`flex shrink-0 cursor-pointer items-center rounded`,K,`hover:text-fg-default focus:outline-hidden focus-visible:ring-input-clear focus-visible:ring-input-clear-ring`),children:(0,o.jsx)(t.CircleX,{className:Q,strokeWidth:1.5,"aria-hidden":`true`})}),v&&(0,o.jsx)(`span`,{className:e.cn(`flex shrink-0 items-center`,X,Z),children:v})]});return(0,o.jsxs)(`div`,{ref:S,className:U,...x,children:[q&&l&&(0,o.jsx)(`label`,{className:i.getInputLabelClasses(s,f),htmlFor:k.id,children:l}),$,d&&(0,o.jsx)(`div`,{className:i.getInputHelpClasses(f),children:d})]})});s.displayName=`Input`,exports.Input=s;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { CircleX as t } from "../../node_modules/lucide-react/dist/esm/icons/circle-x.esm.js";
|
|
3
|
+
import { SLOT_BADGE_TEXT_CLASS as ee, SLOT_CHILD_ICON_CLASS as n, SLOT_GAP_CLASS as r, SLOT_ICON_SIZE_CLASS as te } from "../_shared/form-size-tokens.esm.js";
|
|
4
|
+
import { useInputFormat as i } from "./use-input-format.esm.js";
|
|
5
|
+
import { getInputClasses as a, getInputContainerClasses as o, getInputHelpClasses as s, getInputLabelClasses as c, getInputTrailingIconColor as ne, getInputVariantClasses as re } from "./utils.esm.js";
|
|
6
|
+
import { forwardRef as l, useState as u } from "react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/input/Input.tsx
|
|
9
|
+
var p = l(({ variant: l, inputSize: p = "medium", label: m, labelOption: h = "appear", help: g, hasError: _ = !1, disabled: v = !1, prefix: y, suffix: b, trailingIcon: x, clearable: S = !1, badge: C, placeholder: w, format: T, containerProps: E, containerRef: D, value: O, defaultValue: k, onChange: A, onFocus: j, onBlur: M, className: N = "", ...P }, F) => {
|
|
10
|
+
let [I, L] = u(!1), { displayValue: R, handleChange: z, handleCompositionStart: B, handleCompositionEnd: V, setMergedInputRef: H, handleClear: U } = i({
|
|
11
|
+
value: O,
|
|
12
|
+
defaultValue: k,
|
|
13
|
+
format: T,
|
|
14
|
+
onChange: A,
|
|
15
|
+
readOnly: P.readOnly
|
|
16
|
+
}), W = (e) => {
|
|
17
|
+
L(!0), j?.(e);
|
|
18
|
+
}, G = (e) => {
|
|
19
|
+
L(!1), M?.(e);
|
|
20
|
+
}, K = P.ref, q = R.length > 0, J = o(), Y = re(l, _, v, p), X = a(l, _, v, q, p), Z = ne(_, v, q || I), ie = h === "sustain" || h === "appear" && !!R, Q = l === "box", ae = r[p], $ = n[p], oe = ee[p], se = te[p], ce = /* @__PURE__ */ f("div", {
|
|
21
|
+
className: Q ? e(Y, "flex items-center", ae, N) : "relative flex items-center text-sm",
|
|
22
|
+
children: [
|
|
23
|
+
y && /* @__PURE__ */ d("span", {
|
|
24
|
+
className: e("whitespace-nowrap text-sm", Z),
|
|
25
|
+
children: y
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ d("input", {
|
|
28
|
+
...P,
|
|
29
|
+
ref: H(F, K),
|
|
30
|
+
className: Q ? X : e(X, Y, _ && "border-border-danger focus:border-border-danger focus:ring-focus-danger", v && "opacity-50", N),
|
|
31
|
+
value: R,
|
|
32
|
+
onChange: z,
|
|
33
|
+
onCompositionStart: (e) => {
|
|
34
|
+
B(e), P.onCompositionStart?.(e);
|
|
35
|
+
},
|
|
36
|
+
onCompositionEnd: (e) => {
|
|
37
|
+
V(e), P.onCompositionEnd?.(e);
|
|
38
|
+
},
|
|
39
|
+
onFocus: W,
|
|
40
|
+
onBlur: G,
|
|
41
|
+
disabled: v,
|
|
42
|
+
placeholder: w
|
|
43
|
+
}),
|
|
44
|
+
b && /* @__PURE__ */ d("span", {
|
|
45
|
+
className: e("whitespace-nowrap text-sm", Z),
|
|
46
|
+
children: b
|
|
47
|
+
}),
|
|
48
|
+
x && /* @__PURE__ */ d("span", {
|
|
49
|
+
className: e("flex shrink-0 items-center", Z, $),
|
|
50
|
+
children: x
|
|
51
|
+
}),
|
|
52
|
+
S && !v && !P.readOnly && q && /* @__PURE__ */ d("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
onClick: U,
|
|
55
|
+
"aria-label": "입력 지우기",
|
|
56
|
+
className: e("flex shrink-0 cursor-pointer items-center rounded", Z, "hover:text-fg-default focus:outline-hidden focus-visible:ring-input-clear focus-visible:ring-input-clear-ring"),
|
|
57
|
+
children: /* @__PURE__ */ d(t, {
|
|
58
|
+
className: se,
|
|
59
|
+
strokeWidth: 1.5,
|
|
60
|
+
"aria-hidden": "true"
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
C && /* @__PURE__ */ d("span", {
|
|
64
|
+
className: e("flex shrink-0 items-center", $, oe),
|
|
65
|
+
children: C
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ f("div", {
|
|
70
|
+
ref: D,
|
|
71
|
+
className: J,
|
|
72
|
+
...E,
|
|
73
|
+
children: [
|
|
74
|
+
ie && m && /* @__PURE__ */ d("label", {
|
|
75
|
+
className: c(l, _),
|
|
76
|
+
htmlFor: P.id,
|
|
77
|
+
children: m
|
|
78
|
+
}),
|
|
79
|
+
ce,
|
|
80
|
+
g && /* @__PURE__ */ d("div", {
|
|
81
|
+
className: s(_),
|
|
82
|
+
children: g
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
p.displayName = "Input";
|
|
88
|
+
//#endregion
|
|
89
|
+
export { p as Input };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../node_modules/lucide-react/dist/esm/icons/eye-off.cjs"),t=require("../../node_modules/lucide-react/dist/esm/icons/eye.cjs"),n=require("./Input.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(({disabled:a,...o},s)=>{let[c,l]=(0,r.useState)(!1);return(0,i.jsx)(n.Input,{...o,ref:s,disabled:a,type:c?`text`:`password`,trailingIcon:(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),disabled:a,"aria-label":c?`비밀번호 숨기기`:`비밀번호 표시`,className:`flex items-center justify-center text-fg-subtle transition-colors hover:text-fg-default disabled:cursor-not-allowed disabled:opacity-50`,children:c?(0,i.jsx)(e.EyeOff,{className:`h-4 w-4`,strokeWidth:1.5}):(0,i.jsx)(t.Eye,{className:`h-4 w-4`,strokeWidth:1.5})})})});a.displayName=`PasswordInput`,exports.PasswordInput=a;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EyeOff as e } from "../../node_modules/lucide-react/dist/esm/icons/eye-off.esm.js";
|
|
2
|
+
import { Eye as t } from "../../node_modules/lucide-react/dist/esm/icons/eye.esm.js";
|
|
3
|
+
import { Input as n } from "./Input.esm.js";
|
|
4
|
+
import { forwardRef as r, useState as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/input/PasswordInput.tsx
|
|
7
|
+
var o = r(({ disabled: r, ...o }, s) => {
|
|
8
|
+
let [c, l] = i(!1);
|
|
9
|
+
return /* @__PURE__ */ a(n, {
|
|
10
|
+
...o,
|
|
11
|
+
ref: s,
|
|
12
|
+
disabled: r,
|
|
13
|
+
type: c ? "text" : "password",
|
|
14
|
+
trailingIcon: /* @__PURE__ */ a("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
onClick: () => l((e) => !e),
|
|
17
|
+
disabled: r,
|
|
18
|
+
"aria-label": c ? "비밀번호 숨기기" : "비밀번호 표시",
|
|
19
|
+
className: "flex items-center justify-center text-fg-subtle transition-colors hover:text-fg-default disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
children: a(c ? e : t, {
|
|
21
|
+
className: "h-4 w-4",
|
|
22
|
+
strokeWidth: 1.5
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
o.displayName = "PasswordInput";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { o as PasswordInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=e.startsWith(`-`),[n=``,r=``]=(t?e.slice(1):e).split(`.`);return{negative:t,integer:n||`0`,fraction:r}}function t(e){let[t=``,n]=e.toLowerCase().split(`e`);if(n===void 0)return e;let r=Number(n),i=t.startsWith(`-`),[a=``,o=``]=(i?t.slice(1):t).split(`.`),s=`${a}${o}`.replace(/^0+(?=\d)/,``),c=a.length+r,l=c<=0?`0.${`0`.repeat(-c)}${s}`:c>=s.length?`${s}${`0`.repeat(c-s.length)}`:`${s.slice(0,c)}.${s.slice(c)}`;return i?`-${l}`:l}function n(e){return 10n**BigInt(e)}function r(t,r){let{negative:i,integer:a,fraction:o}=e(t),s=n(r),c=BigInt(o.slice(0,r).padEnd(r,`0`)||`0`),l=BigInt(a)*s+c;return i?-l:l}function i(r,i,a){if(r===void 0||!Number.isFinite(r))return;let{negative:o,integer:s,fraction:c}=e(t(String(r))),l=n(i),u=BigInt(c.slice(0,i).padEnd(i,`0`)||`0`),d=BigInt(s)*l+u,f=/[1-9]/.test(c.slice(i));return o?a===`max`&&f?-(d+1n):-d:a===`min`&&f?d+1n:d}function a(e,t,n){return(t===void 0||e.max>=t)&&(n===void 0||e.min<=n)}function o(t,o,s,c){let{negative:l,integer:u,fraction:d}=e(t),f=t.includes(`.`)?d:void 0,p=o-d.length,m=r(t,o),h=n(Math.max(0,p))-1n,g=l?{min:m-h,max:m}:{min:m,max:m+h},_=i(s,o,`min`),v=i(c,o,`max`);if(a(g,_,v))return!0;if(f!==void 0||u===`0`)return!1;if(!l&&v===void 0||l&&_===void 0)return!0;let y=BigInt(u),b=n(o);for(let e=1;e<309;e+=1){let t=n(e),r=y*t,i=(y+1n)*t-1n;if(a(l?{min:-(i*b+(b-1n)),max:-(r*b)}:{min:r*b,max:i*b+(b-1n)},_,v))return!0;if(!l&&v!==void 0&&r*b>v||l&&_!==void 0&&-(r*b)<_)return!1}return!1}function s(e,{decimalPlaces:t,allowNegative:n,min:a,max:s}){let c=n?`-?`:``,l=Math.max(0,Math.floor(t)),u=l>0?`(?:\\.\\d{0,${l}})?`:``,d=l>0?`|\\.\\d{0,${l}}`:``,f=RegExp(`^${c}(?:(?:0|[1-9]\\d*)${u}${d})?$`);if(e!==``&&e!==`-`&&!f.test(e)||e===`-`&&!n)return`reject`;if(e===``)return`empty`;if(e===`-`)return`draft`;if(!Number.isFinite(Number(e))||!o(e,l,a,s))return`reject`;let p=r(e,l),m=i(a,l,`min`),h=i(s,l,`max`),g=(m===void 0||p>=m)&&(h===void 0||p<=h);return!e.endsWith(`.`)&&g?`value`:`draft`}exports.validateDecimalDraft=s;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** 입력 가능한 초안과 부모에 전달 가능한 숫자를 구분한다. */
|
|
2
|
+
export declare function validateDecimalDraft(next: string, { decimalPlaces, allowNegative, min, max, }: {
|
|
3
|
+
decimalPlaces: number;
|
|
4
|
+
allowNegative: boolean;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
}): "reject" | "draft" | "empty" | "value";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region src/components/input/decimal-validation.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = e.startsWith("-"), [n = "", r = ""] = (t ? e.slice(1) : e).split(".");
|
|
4
|
+
return {
|
|
5
|
+
negative: t,
|
|
6
|
+
integer: n || "0",
|
|
7
|
+
fraction: r
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function t(e) {
|
|
11
|
+
let [t = "", n] = e.toLowerCase().split("e");
|
|
12
|
+
if (n === void 0) return e;
|
|
13
|
+
let r = Number(n), i = t.startsWith("-"), [a = "", o = ""] = (i ? t.slice(1) : t).split("."), s = `${a}${o}`.replace(/^0+(?=\d)/, ""), c = a.length + r, l = c <= 0 ? `0.${"0".repeat(-c)}${s}` : c >= s.length ? `${s}${"0".repeat(c - s.length)}` : `${s.slice(0, c)}.${s.slice(c)}`;
|
|
14
|
+
return i ? `-${l}` : l;
|
|
15
|
+
}
|
|
16
|
+
function n(e) {
|
|
17
|
+
return 10n ** BigInt(e);
|
|
18
|
+
}
|
|
19
|
+
function r(t, r) {
|
|
20
|
+
let { negative: i, integer: a, fraction: o } = e(t), s = n(r), c = BigInt(o.slice(0, r).padEnd(r, "0") || "0"), l = BigInt(a) * s + c;
|
|
21
|
+
return i ? -l : l;
|
|
22
|
+
}
|
|
23
|
+
function i(r, i, a) {
|
|
24
|
+
if (r === void 0 || !Number.isFinite(r)) return;
|
|
25
|
+
let { negative: o, integer: s, fraction: c } = e(t(String(r))), l = n(i), u = BigInt(c.slice(0, i).padEnd(i, "0") || "0"), d = BigInt(s) * l + u, f = /[1-9]/.test(c.slice(i));
|
|
26
|
+
return o ? a === "max" && f ? -(d + 1n) : -d : a === "min" && f ? d + 1n : d;
|
|
27
|
+
}
|
|
28
|
+
function a(e, t, n) {
|
|
29
|
+
return (t === void 0 || e.max >= t) && (n === void 0 || e.min <= n);
|
|
30
|
+
}
|
|
31
|
+
function o(t, o, s, c) {
|
|
32
|
+
let { negative: l, integer: u, fraction: d } = e(t), f = t.includes(".") ? d : void 0, p = o - d.length, m = r(t, o), h = n(Math.max(0, p)) - 1n, g = l ? {
|
|
33
|
+
min: m - h,
|
|
34
|
+
max: m
|
|
35
|
+
} : {
|
|
36
|
+
min: m,
|
|
37
|
+
max: m + h
|
|
38
|
+
}, _ = i(s, o, "min"), v = i(c, o, "max");
|
|
39
|
+
if (a(g, _, v)) return !0;
|
|
40
|
+
if (f !== void 0 || u === "0") return !1;
|
|
41
|
+
if (!l && v === void 0 || l && _ === void 0) return !0;
|
|
42
|
+
let y = BigInt(u), b = n(o);
|
|
43
|
+
for (let e = 1; e < 309; e += 1) {
|
|
44
|
+
let t = n(e), r = y * t, i = (y + 1n) * t - 1n;
|
|
45
|
+
if (a(l ? {
|
|
46
|
+
min: -(i * b + (b - 1n)),
|
|
47
|
+
max: -(r * b)
|
|
48
|
+
} : {
|
|
49
|
+
min: r * b,
|
|
50
|
+
max: i * b + (b - 1n)
|
|
51
|
+
}, _, v)) return !0;
|
|
52
|
+
if (!l && v !== void 0 && r * b > v || l && _ !== void 0 && -(r * b) < _) return !1;
|
|
53
|
+
}
|
|
54
|
+
return !1;
|
|
55
|
+
}
|
|
56
|
+
function s(e, { decimalPlaces: t, allowNegative: n, min: a, max: s }) {
|
|
57
|
+
let c = n ? "-?" : "", l = Math.max(0, Math.floor(t)), u = l > 0 ? `(?:\\.\\d{0,${l}})?` : "", d = l > 0 ? `|\\.\\d{0,${l}}` : "", f = RegExp(`^${c}(?:(?:0|[1-9]\\d*)${u}${d})?$`);
|
|
58
|
+
if (e !== "" && e !== "-" && !f.test(e) || e === "-" && !n) return "reject";
|
|
59
|
+
if (e === "") return "empty";
|
|
60
|
+
if (e === "-") return "draft";
|
|
61
|
+
if (!Number.isFinite(Number(e)) || !o(e, l, a, s)) return "reject";
|
|
62
|
+
let p = r(e, l), m = i(a, l, "min"), h = i(s, l, "max"), g = (m === void 0 || p >= m) && (h === void 0 || p <= h);
|
|
63
|
+
return !e.endsWith(".") && g ? "value" : "draft";
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { s as validateDecimalDraft };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)}function t(e){return e.replace(/,/g,``)}function n(e){let t=e.toString().replace(/[^\d]/g,``);return t.length<=3?t:t.length<=7?`${t.slice(0,3)}-${t.slice(3)}`:t.length<=10?`${t.slice(0,3)}-${t.slice(3,7)}-${t.slice(7)}`:`${t.slice(0,3)}-${t.slice(3,7)}-${t.slice(7,11)}`}function r(e){return e.toString().replace(/-/g,``)}function i(e){let t=e.toString().replace(/[^\d]/g,``).slice(0,10);return t.length<=2?t:t.length<=5?`${t.slice(0,2)}-${t.slice(2)}`:`${t.slice(0,2)}-${t.slice(2,5)}-${t.slice(5)}`}function a(e){return e.toString().replace(/[^\d]/g,``).slice(0,10)}function o(t){let n=t.toString().replace(/[^\d]/g,``);return n?e(n):``}function s(e){return t(e.toString())}var c={phoneNumber:{transform:n,reset:r},businessNumber:{transform:i,reset:a},price:{transform:o,reset:s}};exports.inputFormats=c;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InputFormat, InputValue } from './types';
|
|
1
|
+
import { InputFormat, InputValue } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* 전화번호에 하이픈을 추가해요
|
|
4
4
|
* @example "01012345678" → "010-1234-5678"
|
|
@@ -9,6 +9,16 @@ export declare function transformToPhoneNumber(value: InputValue): string;
|
|
|
9
9
|
* @example "010-1234-5678" → "01012345678"
|
|
10
10
|
*/
|
|
11
11
|
export declare function resetFromPhoneNumber(value: InputValue): string;
|
|
12
|
+
/**
|
|
13
|
+
* 사업자등록번호에 하이픈을 추가해요
|
|
14
|
+
* @example "1234567890" → "12-345-67890"
|
|
15
|
+
*/
|
|
16
|
+
export declare function transformToBusinessNumber(value: InputValue): string;
|
|
17
|
+
/**
|
|
18
|
+
* 사업자등록번호에서 하이픈을 제거해요
|
|
19
|
+
* @example "12-345-67890" → "1234567890"
|
|
20
|
+
*/
|
|
21
|
+
export declare function resetFromBusinessNumber(value: InputValue): string;
|
|
12
22
|
/**
|
|
13
23
|
* 금액에 콤마를 추가해요
|
|
14
24
|
* @example "1000000" → "1,000,000"
|
|
@@ -29,6 +39,12 @@ export declare const inputFormats: {
|
|
|
29
39
|
* reset: "010-1234-5678" → "01012345678"
|
|
30
40
|
*/
|
|
31
41
|
readonly phoneNumber: InputFormat;
|
|
42
|
+
/**
|
|
43
|
+
* 사업자등록번호 포맷
|
|
44
|
+
* transform: "1234567890" → "12-345-67890"
|
|
45
|
+
* reset: "12-345-67890" → "1234567890"
|
|
46
|
+
*/
|
|
47
|
+
readonly businessNumber: InputFormat;
|
|
32
48
|
/**
|
|
33
49
|
* 금액 포맷
|
|
34
50
|
* transform: "1000000" → "1,000,000"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/components/input/format.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return e.replace(/,/g, "");
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
let t = e.toString().replace(/[^\d]/g, "");
|
|
10
|
+
return t.length <= 3 ? t : t.length <= 7 ? `${t.slice(0, 3)}-${t.slice(3)}` : t.length <= 10 ? `${t.slice(0, 3)}-${t.slice(3, 7)}-${t.slice(7)}` : `${t.slice(0, 3)}-${t.slice(3, 7)}-${t.slice(7, 11)}`;
|
|
11
|
+
}
|
|
12
|
+
function r(e) {
|
|
13
|
+
return e.toString().replace(/-/g, "");
|
|
14
|
+
}
|
|
15
|
+
function i(e) {
|
|
16
|
+
let t = e.toString().replace(/[^\d]/g, "").slice(0, 10);
|
|
17
|
+
return t.length <= 2 ? t : t.length <= 5 ? `${t.slice(0, 2)}-${t.slice(2)}` : `${t.slice(0, 2)}-${t.slice(2, 5)}-${t.slice(5)}`;
|
|
18
|
+
}
|
|
19
|
+
function a(e) {
|
|
20
|
+
return e.toString().replace(/[^\d]/g, "").slice(0, 10);
|
|
21
|
+
}
|
|
22
|
+
function o(t) {
|
|
23
|
+
let n = t.toString().replace(/[^\d]/g, "");
|
|
24
|
+
return n ? e(n) : "";
|
|
25
|
+
}
|
|
26
|
+
function s(e) {
|
|
27
|
+
return t(e.toString());
|
|
28
|
+
}
|
|
29
|
+
var c = {
|
|
30
|
+
phoneNumber: {
|
|
31
|
+
transform: n,
|
|
32
|
+
reset: r
|
|
33
|
+
},
|
|
34
|
+
businessNumber: {
|
|
35
|
+
transform: i,
|
|
36
|
+
reset: a
|
|
37
|
+
},
|
|
38
|
+
price: {
|
|
39
|
+
transform: o,
|
|
40
|
+
reset: s
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { c as inputFormats };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Input } from './Input.js';
|
|
2
|
+
export { PasswordInput } from './PasswordInput.js';
|
|
3
|
+
export { DecimalInput } from './DecimalInput.js';
|
|
4
|
+
export type { DecimalInputProps } from './DecimalInput.js';
|
|
5
|
+
export { useInputFormat } from './use-input-format.js';
|
|
6
|
+
export { inputFormats } from './format.js';
|
|
7
|
+
export type { InputProps, InputVariant, InputSize, InputLabelOption, InputValue, InputFormat, FormatTransform, FormatReset, } from './types.js';
|
|
@@ -22,7 +22,7 @@ export type InputValue = string | number;
|
|
|
22
22
|
/**
|
|
23
23
|
* Format 함수 타입
|
|
24
24
|
*/
|
|
25
|
-
export type FormatTransform = (value: InputValue) => InputValue;
|
|
25
|
+
export type FormatTransform = (value: InputValue, inputType?: string) => InputValue;
|
|
26
26
|
export type FormatReset = (formattedValue: InputValue) => InputValue;
|
|
27
27
|
/**
|
|
28
28
|
* Format 옵션
|
|
@@ -91,7 +91,7 @@ export interface InputCommonProps {
|
|
|
91
91
|
trailingIcon?: ReactNode;
|
|
92
92
|
/**
|
|
93
93
|
* 값이 있을 때 우측에 X 버튼(CircleX)을 노출. 클릭 시 onChange로 빈 값을 emit.
|
|
94
|
-
* disabled에서는 노출하지 않는다. trailingIcon 다음, badge 앞에 위치.
|
|
94
|
+
* disabled 또는 readOnly에서는 노출하지 않는다. trailingIcon 다음, badge 앞에 위치.
|
|
95
95
|
* @default false
|
|
96
96
|
*/
|
|
97
97
|
clearable?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("react");function t(e,t,n){let r=t.transform(e,n).toString();return{display:r,raw:t.reset?t.reset(r).toString():r}}function n(e,t,n){if(e===t)return Math.min(n,t.length);if(n>=e.length)return t.length;if(!/\d/.test(e)&&!/\d/.test(t))return Math.min(n,t.length);let r=(e.slice(0,n).match(/\d/g)??[]).length;if(r===0)return e.length===t.length?n:0;let i=0;for(let e=0;e<t.length;e++)if(/\d/.test(t[e])&&++i===r)return e+1;return t.length}function r(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`);n?.set&&n.set.bind(e)(t)}function i({value:i,defaultValue:a,format:o,onChange:s,readOnly:c=!1}){let[l,u]=(0,e.useState)(()=>{let e=i??a??``;return o?o.transform(e).toString():e.toString()}),[d,f]=(0,e.useState)(null),p=(0,e.useRef)(null),m=(0,e.useRef)(!1),h=(0,e.useRef)(!1),g=i!==void 0,_=g?i.toString():l;return{displayValue:o?d??o.transform(_).toString():_,handleChange:e=>{if(c)return;let i=e.target.value;if(o){let a=e.nativeEvent;if(m.current||a.isComposing){h.current=!0,f(i),g||u(i),s?.(e);return}let c=e.target,{selectionStart:l,selectionEnd:d,selectionDirection:p}=c,_=e.nativeEvent.inputType,{display:v,raw:y}=t(i,o,typeof _==`string`?_:void 0);g||u(v),r(c,y);try{s?.(e)}finally{c.value=i,l!==null&&d!==null&&c.setSelectionRange(l,d,p??void 0),v!==i&&(c.value=v,l!==null&&d!==null&&c.setSelectionRange(n(i,v,l),n(i,v,d),p??void 0))}}else g||u(i),s?.(e)},handleCompositionStart:e=>{o&&(m.current=!0,h.current=!1,f(e.currentTarget.value))},handleCompositionEnd:e=>{if(m.current=!1,f(null),!o||!h.current){h.current=!1;return}h.current=!1;let t=e.currentTarget,n=t.value,{selectionStart:i,selectionEnd:a,selectionDirection:s}=t;t.value=n===``?`0`:``,r(t,n),i!==null&&a!==null&&t.setSelectionRange(i,a,s??void 0),t.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`insertCompositionText`}))},setMergedInputRef:(e,t)=>n=>{p.current=n,typeof e==`function`?e(n):e!==null&&Object.assign(e,{current:n}),typeof t==`function`?t(n):t!=null&&`current`in t&&Object.assign(t,{current:n})},handleClear:()=>{if(c)return;let e=p.current;e&&(r(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())}}}exports.useInputFormat=i;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { InputFormat, InputValue } from './types.js';
|
|
2
|
+
/** 화면 값과 부모에게 전달할 원본 값을 계산한다. */
|
|
3
|
+
export declare function applyInputFormat(value: InputValue, format: InputFormat, inputType?: string): {
|
|
4
|
+
display: string;
|
|
5
|
+
raw: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* 포맷 변경 전 커서 앞의 숫자 개수를 포맷된 값에서도 유지한다.
|
|
9
|
+
* 커서 보존은 내장 price·phoneNumber·businessNumber처럼 숫자 기반 포맷을 전제로 한다.
|
|
10
|
+
* 다른 구분자나 문자의 위치까지 보존해야 하면 format 대신 제어 입력과 별도 커서 관리를 사용한다.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getFormattedCursorPosition(typedValue: string, formattedValue: string, position: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* Input 포맷 훅.
|
|
15
|
+
* controlled/uncontrolled 양쪽을 지원하며 format 변환을 일관되게 처리한다.
|
|
16
|
+
*
|
|
17
|
+
* ## RHF (react-hook-form) 호환
|
|
18
|
+
* format 적용 시 `e.target.value`를 네이티브 setter로 변경한 뒤 원본 이벤트를 전달.
|
|
19
|
+
* 이렇게 하면 `e.target`이 실제 DOM 엘리먼트라 `name`·`type` 등 모든 속성이 보존된다.
|
|
20
|
+
* `{ ...e.target, value }` 스프레드는 prototype 속성을 복사하지 않으므로 사용하지 않는다.
|
|
21
|
+
* 원본 값은 onChange 호출 중 읽어야 하며, 호출 직후에는 표시 값으로 돌아간다.
|
|
22
|
+
* format 사용 중 IME 조합 단계에서는 포맷하지 않은 입력 원문을 onChange로 전달하고,
|
|
23
|
+
* 조합 확정 시 변환 및 reset을 적용한 원본 값을 onChange로 한 번 더 전달한다.
|
|
24
|
+
*
|
|
25
|
+
* @returns displayValue — 화면에 표시할 포맷팅된 값
|
|
26
|
+
* @returns handleChange — onChange 핸들러 (format 적용 후 부모 onChange 호출)
|
|
27
|
+
* @returns setMergedInputRef — forwardRef + RHF register ref + 내부 inputRef 병합
|
|
28
|
+
* @returns handleClear — clearable 버튼 클릭 핸들러 (native value setter 경유)
|
|
29
|
+
*/
|
|
30
|
+
export declare function useInputFormat({ value, defaultValue, format, onChange, readOnly, }: {
|
|
31
|
+
value?: InputValue;
|
|
32
|
+
defaultValue?: InputValue;
|
|
33
|
+
format?: InputFormat;
|
|
34
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
35
|
+
readOnly?: boolean;
|
|
36
|
+
}): {
|
|
37
|
+
displayValue: string;
|
|
38
|
+
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
39
|
+
handleCompositionStart: (e: React.CompositionEvent<HTMLInputElement>) => void;
|
|
40
|
+
handleCompositionEnd: (e: React.CompositionEvent<HTMLInputElement>) => void;
|
|
41
|
+
setMergedInputRef: (externalRef: React.ForwardedRef<HTMLInputElement>, rhfRef?: React.Ref<HTMLInputElement>) => (node: HTMLInputElement | null) => void;
|
|
42
|
+
handleClear: () => void;
|
|
43
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useRef as e, useState as t } from "react";
|
|
2
|
+
//#region src/components/input/use-input-format.ts
|
|
3
|
+
function n(e, t, n) {
|
|
4
|
+
let r = t.transform(e, n).toString();
|
|
5
|
+
return {
|
|
6
|
+
display: r,
|
|
7
|
+
raw: t.reset ? t.reset(r).toString() : r
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function r(e, t, n) {
|
|
11
|
+
if (e === t) return Math.min(n, t.length);
|
|
12
|
+
if (n >= e.length) return t.length;
|
|
13
|
+
if (!/\d/.test(e) && !/\d/.test(t)) return Math.min(n, t.length);
|
|
14
|
+
let r = (e.slice(0, n).match(/\d/g) ?? []).length;
|
|
15
|
+
if (r === 0) return e.length === t.length ? n : 0;
|
|
16
|
+
let i = 0;
|
|
17
|
+
for (let e = 0; e < t.length; e++) if (/\d/.test(t[e]) && ++i === r) return e + 1;
|
|
18
|
+
return t.length;
|
|
19
|
+
}
|
|
20
|
+
function i(e, t) {
|
|
21
|
+
let n = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
|
|
22
|
+
n?.set && n.set.bind(e)(t);
|
|
23
|
+
}
|
|
24
|
+
function a({ value: a, defaultValue: o, format: s, onChange: c, readOnly: l = !1 }) {
|
|
25
|
+
let [u, d] = t(() => {
|
|
26
|
+
let e = a ?? o ?? "";
|
|
27
|
+
return s ? s.transform(e).toString() : e.toString();
|
|
28
|
+
}), [f, p] = t(null), m = e(null), h = e(!1), g = e(!1), _ = a !== void 0, v = _ ? a.toString() : u;
|
|
29
|
+
return {
|
|
30
|
+
displayValue: s ? f ?? s.transform(v).toString() : v,
|
|
31
|
+
handleChange: (e) => {
|
|
32
|
+
if (l) return;
|
|
33
|
+
let t = e.target.value;
|
|
34
|
+
if (s) {
|
|
35
|
+
let a = e.nativeEvent;
|
|
36
|
+
if (h.current || a.isComposing) {
|
|
37
|
+
g.current = !0, p(t), _ || d(t), c?.(e);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let o = e.target, { selectionStart: l, selectionEnd: u, selectionDirection: f } = o, m = e.nativeEvent.inputType, { display: v, raw: y } = n(t, s, typeof m == "string" ? m : void 0);
|
|
41
|
+
_ || d(v), i(o, y);
|
|
42
|
+
try {
|
|
43
|
+
c?.(e);
|
|
44
|
+
} finally {
|
|
45
|
+
o.value = t, l !== null && u !== null && o.setSelectionRange(l, u, f ?? void 0), v !== t && (o.value = v, l !== null && u !== null && o.setSelectionRange(r(t, v, l), r(t, v, u), f ?? void 0));
|
|
46
|
+
}
|
|
47
|
+
} else _ || d(t), c?.(e);
|
|
48
|
+
},
|
|
49
|
+
handleCompositionStart: (e) => {
|
|
50
|
+
s && (h.current = !0, g.current = !1, p(e.currentTarget.value));
|
|
51
|
+
},
|
|
52
|
+
handleCompositionEnd: (e) => {
|
|
53
|
+
if (h.current = !1, p(null), !s || !g.current) {
|
|
54
|
+
g.current = !1;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
g.current = !1;
|
|
58
|
+
let t = e.currentTarget, n = t.value, { selectionStart: r, selectionEnd: a, selectionDirection: o } = t;
|
|
59
|
+
t.value = n === "" ? "0" : "", i(t, n), r !== null && a !== null && t.setSelectionRange(r, a, o ?? void 0), t.dispatchEvent(new InputEvent("input", {
|
|
60
|
+
bubbles: !0,
|
|
61
|
+
inputType: "insertCompositionText"
|
|
62
|
+
}));
|
|
63
|
+
},
|
|
64
|
+
setMergedInputRef: (e, t) => (n) => {
|
|
65
|
+
m.current = n, typeof e == "function" ? e(n) : e !== null && Object.assign(e, { current: n }), typeof t == "function" ? t(n) : t != null && "current" in t && Object.assign(t, { current: n });
|
|
66
|
+
},
|
|
67
|
+
handleClear: () => {
|
|
68
|
+
if (l) return;
|
|
69
|
+
let e = m.current;
|
|
70
|
+
e && (i(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { a as useInputFormat };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../_shared/form-size-tokens.cjs");var t={large:`h-control-large rounded-control-large border-control px-control-pad-large transition-colors focus-within:outline-hidden`,medium:`h-control-medium rounded-control-medium border-control px-control-pad-medium transition-colors focus-within:outline-hidden`,small:`h-control-small rounded-control-small border-control px-control-pad-small transition-colors focus-within:outline-hidden`,mini:`h-control-mini rounded-control-mini border-control px-control-pad-mini transition-colors focus-within:outline-hidden`},n=(e,n,r,i=`medium`)=>{if(e===`box`){let e=t[i];return r?[e,`bg-bg-disabled border-border-subtle`].join(` `):n?[e,`bg-bg-surface border-border-danger`].join(` `):[e,`bg-bg-surface border-border-subtle focus-within:border-border-primary`].join(` `)}return{box:``,line:`border-b-2 border-border-subtle px-0 py-2 focus:border-primary focus:ring-0`,big:`border-2 border-border-subtle rounded px-5 py-4 text-lg focus:border-primary focus:ring-control focus:ring-primary focus:ring-offset-0 h-[52px]`,hero:`border-2 border-border-subtle rounded px-6 py-5 text-xl font-semibold focus:border-primary focus:ring-control focus:ring-primary focus:ring-offset-0 h-[64px]`}[e]},r=(t,n,r,i,a=`medium`)=>{let o=`w-full bg-transparent ${e.CONTROL_TEXT_CLASS[a]} focus:outline-hidden disabled:cursor-not-allowed`;return t===`box`?r?[o,`text-fg-disabled placeholder:text-fg-disabled`].join(` `):n?[o,`text-fg-danger placeholder:text-fg-danger-placeholder`].join(` `):i?[o,`text-fg-default placeholder:text-fg-subtle`].join(` `):[o,`text-fg-subtle placeholder:text-fg-subtle`].join(` `):[`w-full bg-bg-surface text-sm text-fg-default placeholder:text-fg-subtle transition-all duration-200 ease-out focus:outline-hidden disabled:bg-bg-disabled disabled:text-fg-disabled disabled:cursor-not-allowed disabled:border-border-subtle`].join(` `)},i=(e,t,n)=>t?`text-fg-disabled`:e?`text-fg-danger`:n?`text-fg-muted`:`text-fg-subtle`,a=()=>`w-full`,o=(e,t)=>[`block text-xs font-medium mb-2`,t?`text-fg-danger`:`text-fg-muted`].join(` `),s=e=>[`mt-2 text-sm`,e?`text-fg-danger`:`text-fg-muted`].join(` `);exports.getInputClasses=r,exports.getInputContainerClasses=a,exports.getInputHelpClasses=s,exports.getInputLabelClasses=o,exports.getInputTrailingIconColor=i,exports.getInputVariantClasses=n;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CONTROL_TEXT_CLASS as e } from "../_shared/form-size-tokens.esm.js";
|
|
2
|
+
//#region src/components/input/utils.ts
|
|
3
|
+
var t = {
|
|
4
|
+
large: "h-control-large rounded-control-large border-control px-control-pad-large transition-colors focus-within:outline-hidden",
|
|
5
|
+
medium: "h-control-medium rounded-control-medium border-control px-control-pad-medium transition-colors focus-within:outline-hidden",
|
|
6
|
+
small: "h-control-small rounded-control-small border-control px-control-pad-small transition-colors focus-within:outline-hidden",
|
|
7
|
+
mini: "h-control-mini rounded-control-mini border-control px-control-pad-mini transition-colors focus-within:outline-hidden"
|
|
8
|
+
}, n = (e, n, r, i = "medium") => {
|
|
9
|
+
if (e === "box") {
|
|
10
|
+
let e = t[i];
|
|
11
|
+
return r ? [e, "bg-bg-disabled border-border-subtle"].join(" ") : n ? [e, "bg-bg-surface border-border-danger"].join(" ") : [e, "bg-bg-surface border-border-subtle focus-within:border-border-primary"].join(" ");
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
box: "",
|
|
15
|
+
line: "border-b-2 border-border-subtle px-0 py-2 focus:border-primary focus:ring-0",
|
|
16
|
+
big: "border-2 border-border-subtle rounded px-5 py-4 text-lg focus:border-primary focus:ring-control focus:ring-primary focus:ring-offset-0 h-[52px]",
|
|
17
|
+
hero: "border-2 border-border-subtle rounded px-6 py-5 text-xl font-semibold focus:border-primary focus:ring-control focus:ring-primary focus:ring-offset-0 h-[64px]"
|
|
18
|
+
}[e];
|
|
19
|
+
}, r = (t, n, r, i, a = "medium") => {
|
|
20
|
+
let o = `w-full bg-transparent ${e[a]} focus:outline-hidden disabled:cursor-not-allowed`;
|
|
21
|
+
return t === "box" ? r ? [o, "text-fg-disabled placeholder:text-fg-disabled"].join(" ") : n ? [o, "text-fg-danger placeholder:text-fg-danger-placeholder"].join(" ") : i ? [o, "text-fg-default placeholder:text-fg-subtle"].join(" ") : [o, "text-fg-subtle placeholder:text-fg-subtle"].join(" ") : ["w-full bg-bg-surface text-sm text-fg-default placeholder:text-fg-subtle transition-all duration-200 ease-out focus:outline-hidden disabled:bg-bg-disabled disabled:text-fg-disabled disabled:cursor-not-allowed disabled:border-border-subtle"].join(" ");
|
|
22
|
+
}, i = (e, t, n) => t ? "text-fg-disabled" : e ? "text-fg-danger" : n ? "text-fg-muted" : "text-fg-subtle", a = () => "w-full", o = (e, t) => ["block text-xs font-medium mb-2", t ? "text-fg-danger" : "text-fg-muted"].join(" "), s = (e) => ["mt-2 text-sm", e ? "text-fg-danger" : "text-fg-muted"].join(" ");
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as getInputClasses, a as getInputContainerClasses, s as getInputHelpClasses, o as getInputLabelClasses, i as getInputTrailingIconColor, n as getInputVariantClasses };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("react/jsx-runtime");var n={sm:`h-4 w-4`,md:`h-6 w-6`,lg:`h-8 w-8`};function r({size:r=`md`}){return(0,t.jsxs)(`svg`,{className:e.cn(`animate-spin text-primary-fg`,n[r]),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,t.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,t.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function i({message:n=`데이터를 불러오는 중이에요...`,size:i=`md`,className:a=``}){return(0,t.jsx)(`div`,{className:e.cn(`flex items-center justify-center h-full min-h-[200px]`,a),children:(0,t.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,t.jsx)(r,{size:i}),n&&(0,t.jsx)(`span`,{className:`text-sm text-fg-muted`,children:n})]})})}function a({size:e=`sm`}){return(0,t.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,t.jsx)(r,{size:e})})}exports.InlineSpinner=a,exports.LoadingSpinner=i,exports.Spinner=r;
|
|
@@ -8,6 +8,13 @@ export declare function Spinner({ size }: {
|
|
|
8
8
|
}): import("react").JSX.Element;
|
|
9
9
|
/**
|
|
10
10
|
* 영역 중앙에 스피너 + 메시지를 표시하는 로딩 표시. 데이터 페칭 중 컨테이너에 채워 쓴다.
|
|
11
|
+
* 텍스트 줄 안에 인라인으로 넣을 작은 스피너는 `InlineSpinner`, 스피너 단독은 `Spinner`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* {isLoading ? <LoadingSpinner /> : <Table ... />}
|
|
16
|
+
* <LoadingSpinner message="정산 내역을 불러오는 중이에요..." size="lg" />
|
|
17
|
+
* ```
|
|
11
18
|
*/
|
|
12
19
|
export declare function LoadingSpinner({ message, size, className, }: LoadingSpinnerProps): import("react").JSX.Element;
|
|
13
20
|
/** 인라인(작은) 스피너 — 리스트 하단 더보기 로딩 등. */
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/loading-spinner/LoadingSpinner.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
sm: "h-4 w-4",
|
|
6
|
+
md: "h-6 w-6",
|
|
7
|
+
lg: "h-8 w-8"
|
|
8
|
+
};
|
|
9
|
+
function i({ size: i = "md" }) {
|
|
10
|
+
return /* @__PURE__ */ n("svg", {
|
|
11
|
+
className: e("animate-spin text-primary-fg", r[i]),
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
fill: "none",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
children: [/* @__PURE__ */ t("circle", {
|
|
16
|
+
className: "opacity-25",
|
|
17
|
+
cx: "12",
|
|
18
|
+
cy: "12",
|
|
19
|
+
r: "10",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
strokeWidth: "4"
|
|
22
|
+
}), /* @__PURE__ */ t("path", {
|
|
23
|
+
className: "opacity-75",
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function a({ message: r = "데이터를 불러오는 중이에요...", size: a = "md", className: o = "" }) {
|
|
30
|
+
return /* @__PURE__ */ t("div", {
|
|
31
|
+
className: e("flex items-center justify-center h-full min-h-[200px]", o),
|
|
32
|
+
children: /* @__PURE__ */ n("div", {
|
|
33
|
+
className: "flex flex-col items-center gap-2",
|
|
34
|
+
children: [/* @__PURE__ */ t(i, { size: a }), r && /* @__PURE__ */ t("span", {
|
|
35
|
+
className: "text-sm text-fg-muted",
|
|
36
|
+
children: r
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function o({ size: e = "sm" }) {
|
|
42
|
+
return /* @__PURE__ */ t("div", {
|
|
43
|
+
className: "flex items-center justify-center py-3",
|
|
44
|
+
children: /* @__PURE__ */ t(i, { size: e })
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { o as InlineSpinner, a as LoadingSpinner, i as Spinner };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs"),t=require("../../hooks/useMediaQuery.cjs"),n=require("../../hooks/useScrollLock.cjs"),r=require("../../hooks/useFocusTrap.cjs"),i=require("../../lib/overlay-stack.cjs"),a=require("../../lib/Portal.cjs"),o=require("./ModalFocusTrapContext.cjs");let s=require("react"),c=require("react/jsx-runtime"),l=require("motion/react");function u({isOpen:u,onClose:d,title:f,dismissible:p=!0,trapFocus:m=!0,onExitComplete:h,widthPx:g,footer:_,bodyPadded:v=!1,subView:y,className:b,children:x}){let S=t.useIsMobile(),C=(0,s.useId)(),w=(0,s.useId)(),T=(0,l.useDragControls)(),E=(0,l.useReducedMotion)(),[D,O]=(0,s.useState)(null),{context:k,isTop:A}=o.useModalSubViews(u,m,C);(0,s.useLayoutEffect)(()=>{D&&(D.inert=!u)},[D,u]);let j=(e,t)=>{p&&(t.offset.y>100||t.velocity.y>500)&&d()};(0,s.useEffect)(()=>{if(u)return i.overlayStack.push(C),()=>{i.overlayStack.pop(C)}},[u,C]),n.useScrollLock(u),r.useFocusTrap(D,{enabled:u,trapFocus:m,canTrap:A}),(0,s.useEffect)(()=>{let e=e=>{e.key!==`Escape`||!p||A()&&d()};return u&&window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u,d,p,A]);let M=(0,c.jsxs)(a.Portal,{children:[(0,c.jsx)(l.AnimatePresence,{children:u&&(0,c.jsx)(l.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:E?0:.2},onClick:()=>{!p||!A()||d()},className:`fixed inset-0 z-overlay bg-bg-overlay`},`modal-backdrop`)}),(0,c.jsx)(l.AnimatePresence,{onExitComplete:h,children:u&&(0,c.jsxs)(l.motion.div,{ref:O,role:`dialog`,"aria-modal":`true`,"aria-labelledby":f?w:void 0,tabIndex:-1,initial:S?{y:`100%`}:{opacity:0,y:24,scale:.96},animate:S?{y:0}:{opacity:1,y:0,scale:1},exit:S?{y:`100%`,transition:{duration:E?0:.2,ease:[.4,0,1,1]}}:{opacity:0,y:24,scale:.96},transition:E?{duration:0}:S?{type:`spring`,damping:38,stiffness:320}:{duration:.25,ease:[.32,.72,0,1]},drag:S&&p?`y`:!1,dragListener:!1,dragControls:T,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.4},onDragEnd:j,className:e.cn(`fixed -bottom-8 left-0 right-0 z-overlay mx-auto flex max-h-[88vh] w-full flex-col overflow-hidden rounded-t-sheet bg-bg-surface text-fg-default pb-8 shadow-overlay outline-none sm:bottom-auto sm:left-1/2 sm:right-auto sm:top-1/2 sm:max-h-[90vh] sm:w-auto sm:min-w-[320px] sm:max-w-[90vw] sm:rounded-surface sm:pb-0`,b),style:S?void 0:{translateX:`-50%`,translateY:`-50%`,...g?{width:g}:{}},children:[(0,c.jsx)(`div`,{className:e.cn(`flex justify-center pt-2 pb-1 cursor-grab touch-none active:cursor-grabbing sm:hidden`,!p&&`pointer-events-none opacity-0`),onPointerDown:e=>{p&&T.start(e)},children:(0,c.jsx)(`div`,{className:`h-1 w-10 rounded-full bg-bg-handle`})}),f&&(0,c.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3`,children:[(0,c.jsx)(`h3`,{id:w,className:`text-base font-semibold text-fg-default sm:text-lg`,children:f}),(0,c.jsx)(`button`,{type:`button`,onClick:d,disabled:!p,className:e.cn(`rounded-control-medium p-1 text-fg-muted hover:text-fg-default`,!p&&`pointer-events-none opacity-0`),"aria-label":`닫기`,children:(0,c.jsx)(`svg`,{className:`h-5 w-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,c.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]}),(0,c.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,c.jsx)(`div`,{className:e.cn(`transform-[translateZ(0)] flex-1 overflow-y-auto overflow-x-hidden`,v&&`mx-1 sm:mx-4`),children:x}),y]}),_&&(0,c.jsx)(`div`,{className:`shrink-0`,children:_})]},`modal-sheet`)})]});return(0,c.jsx)(o.ModalFocusTrapContext.Provider,{value:k,children:M})}exports.Modal=u;
|