@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,227 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { Button as t } from "../button/Button.esm.js";
|
|
3
|
+
import { ChevronLeft as n } from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.esm.js";
|
|
4
|
+
import { ChevronRight as r } from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.esm.js";
|
|
5
|
+
import { PickerSheet as i, usePickerMobile as a } from "../date-picker/PickerSheet.esm.js";
|
|
6
|
+
import { compareMonths as o, completeMonthRange as s, selectMonth as c, shiftMonth as l } from "./month-range-utils.esm.js";
|
|
7
|
+
import { cloneElement as u, useEffect as d, useRef as f, useState as p } from "react";
|
|
8
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import { autoUpdate as _, flip as v, offset as y, shift as b, useClick as x, useDismiss as S, useFloating as C, useInteractions as w, useRole as T } from "@floating-ui/react";
|
|
10
|
+
//#region src/components/month-range-picker/month-range-picker.tsx
|
|
11
|
+
function E({ year: t, from: i, to: a, onSelect: s, onYearChange: c, onMove: u, focusedMonth: p, onFocusMonth: m, focusOnMount: _, initialFocusRef: v, showPrev: y = !0, showNext: b = !0 }) {
|
|
12
|
+
let x = f([]), S = f({
|
|
13
|
+
focusedMonth: p,
|
|
14
|
+
year: t
|
|
15
|
+
}), C = f(!1);
|
|
16
|
+
d(() => {
|
|
17
|
+
if (!_ && !C.current) {
|
|
18
|
+
if (S.current.focusedMonth === p && S.current.year === t) return;
|
|
19
|
+
C.current = !0;
|
|
20
|
+
}
|
|
21
|
+
p.year === t && x.current[p.month - 1]?.focus();
|
|
22
|
+
}, [
|
|
23
|
+
_,
|
|
24
|
+
p,
|
|
25
|
+
t
|
|
26
|
+
]);
|
|
27
|
+
let w = (e) => {
|
|
28
|
+
u(l({
|
|
29
|
+
year: t,
|
|
30
|
+
month: 1
|
|
31
|
+
}, e - 1));
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("div", {
|
|
34
|
+
className: "mb-4 flex items-center justify-between",
|
|
35
|
+
children: [
|
|
36
|
+
y ? /* @__PURE__ */ h("button", {
|
|
37
|
+
type: "button",
|
|
38
|
+
"aria-label": "이전 해",
|
|
39
|
+
className: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border-subtle text-fg-muted transition-colors hover:bg-bg-subtle",
|
|
40
|
+
onClick: () => c(t - 1),
|
|
41
|
+
children: /* @__PURE__ */ h(n, { className: "h-4 w-4" })
|
|
42
|
+
}) : /* @__PURE__ */ h("span", { className: "w-8" }),
|
|
43
|
+
/* @__PURE__ */ g("div", {
|
|
44
|
+
className: "flex-1 text-center text-sm font-semibold text-fg-default",
|
|
45
|
+
children: [t, "년"]
|
|
46
|
+
}),
|
|
47
|
+
b ? /* @__PURE__ */ h("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
"aria-label": "다음 해",
|
|
50
|
+
className: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border-subtle text-fg-muted transition-colors hover:bg-bg-subtle",
|
|
51
|
+
onClick: () => c(t + 1),
|
|
52
|
+
children: /* @__PURE__ */ h(r, { className: "h-4 w-4" })
|
|
53
|
+
}) : /* @__PURE__ */ h("span", { className: "w-8" })
|
|
54
|
+
]
|
|
55
|
+
}), /* @__PURE__ */ h("div", {
|
|
56
|
+
className: "grid grid-cols-4 gap-2",
|
|
57
|
+
children: Array.from({ length: 12 }, (n, r) => {
|
|
58
|
+
let c = r + 1, l = {
|
|
59
|
+
year: t,
|
|
60
|
+
month: c
|
|
61
|
+
}, d = /* @__PURE__ */ new Date(), f = d.getFullYear() === t && d.getMonth() + 1 === c, h = !!(i && o(l, i) === 0 || a && o(l, a) === 0), _ = !!i && !!a && o(l, i) > 0 && o(l, a) < 0;
|
|
62
|
+
return /* @__PURE__ */ g("button", {
|
|
63
|
+
ref: (e) => {
|
|
64
|
+
x.current[c - 1] = e, v && p.year === t && c === p.month && (v.current = e);
|
|
65
|
+
},
|
|
66
|
+
type: "button",
|
|
67
|
+
tabIndex: p.year === t && c === p.month ? 0 : -1,
|
|
68
|
+
"aria-label": `${t}년 ${c}월`,
|
|
69
|
+
"aria-pressed": h,
|
|
70
|
+
className: e("h-10 cursor-pointer rounded-lg text-sm transition-colors", h ? "bg-primary font-bold text-fg-inverse" : _ ? "bg-bg-muted text-fg-default" : f ? "bg-bg-muted font-semibold text-fg-default" : "text-fg-default hover:bg-bg-subtle"),
|
|
71
|
+
onClick: () => {
|
|
72
|
+
s(l), m(l);
|
|
73
|
+
},
|
|
74
|
+
onKeyDown: (e) => {
|
|
75
|
+
let n = null;
|
|
76
|
+
if (e.key === "ArrowLeft" && (n = c - 1), e.key === "ArrowRight" && (n = c + 1), e.key === "ArrowUp" && (n = c - 4), e.key === "ArrowDown" && (n = c + 4), e.key === "Home" && (n = 1), e.key === "End" && (n = 12), e.key === "PageUp" || e.key === "PageDown") {
|
|
77
|
+
e.preventDefault(), u({
|
|
78
|
+
year: t + (e.key === "PageUp" ? -1 : 1),
|
|
79
|
+
month: c
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
n !== null && (e.preventDefault(), w(n));
|
|
84
|
+
},
|
|
85
|
+
children: [c, "월"]
|
|
86
|
+
}, c);
|
|
87
|
+
})
|
|
88
|
+
})] });
|
|
89
|
+
}
|
|
90
|
+
function D({ children: e, value: t, onApply: n, disabled: r = !1, disableMobileSheet: o }) {
|
|
91
|
+
let [s, c] = p(!1), l = f(null), d = r || !!e.props.disabled, { isMobile: E, useSheet: D } = a(o), { refs: k, floatingStyles: A, context: j } = C({
|
|
92
|
+
open: s,
|
|
93
|
+
onOpenChange: (e) => {
|
|
94
|
+
d || c(e);
|
|
95
|
+
},
|
|
96
|
+
placement: "bottom-start",
|
|
97
|
+
whileElementsMounted: _,
|
|
98
|
+
middleware: [
|
|
99
|
+
y(8),
|
|
100
|
+
v({ fallbackAxisSideDirection: "start" }),
|
|
101
|
+
b({ padding: 8 })
|
|
102
|
+
]
|
|
103
|
+
}), { getReferenceProps: M, getFloatingProps: N } = w([
|
|
104
|
+
x(j, { enabled: !d }),
|
|
105
|
+
S(j),
|
|
106
|
+
T(j, { role: "dialog" })
|
|
107
|
+
]), P = M(), F = typeof e.type != "string" || [
|
|
108
|
+
"button",
|
|
109
|
+
"input",
|
|
110
|
+
"select",
|
|
111
|
+
"textarea"
|
|
112
|
+
].includes(e.type), I = u(e, {
|
|
113
|
+
"aria-haspopup": "dialog",
|
|
114
|
+
"aria-expanded": s,
|
|
115
|
+
"aria-controls": typeof P["aria-controls"] == "string" ? P["aria-controls"] : void 0,
|
|
116
|
+
"aria-disabled": d || void 0,
|
|
117
|
+
...d && F ? { disabled: !0 } : {}
|
|
118
|
+
});
|
|
119
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
120
|
+
ref: k.setReference,
|
|
121
|
+
...P,
|
|
122
|
+
className: "inline-flex w-full",
|
|
123
|
+
children: I
|
|
124
|
+
}), /* @__PURE__ */ h(i, {
|
|
125
|
+
isOpen: s,
|
|
126
|
+
onClose: () => c(!1),
|
|
127
|
+
useSheet: D,
|
|
128
|
+
context: j,
|
|
129
|
+
setFloating: k.setFloating,
|
|
130
|
+
floatingStyles: A,
|
|
131
|
+
getFloatingProps: (e) => N({
|
|
132
|
+
...e,
|
|
133
|
+
"aria-label": "월 범위 선택"
|
|
134
|
+
}),
|
|
135
|
+
desktopClassName: "z-floating max-w-[calc(100vw-16px)] rounded-2xl border border-border-subtle bg-bg-surface text-fg-default p-5 shadow-tooltip",
|
|
136
|
+
initialFocus: l,
|
|
137
|
+
children: /* @__PURE__ */ h(O, {
|
|
138
|
+
value: t,
|
|
139
|
+
isMobile: E,
|
|
140
|
+
focusOnMount: D,
|
|
141
|
+
initialFocusRef: l,
|
|
142
|
+
onClose: () => c(!1),
|
|
143
|
+
onApply: (e) => {
|
|
144
|
+
n(e), c(!1);
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
})] });
|
|
148
|
+
}
|
|
149
|
+
function O({ value: n, isMobile: r, focusOnMount: i, initialFocusRef: a, onApply: l, onClose: u }) {
|
|
150
|
+
let d = n?.from ?? {
|
|
151
|
+
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
152
|
+
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
153
|
+
}, [f, _] = p(n?.from ?? null), [v, y] = p(n?.to ?? null), [b, x] = p(d.year), [S, C] = p(d), w = (e) => {
|
|
154
|
+
let t = c({
|
|
155
|
+
from: f,
|
|
156
|
+
to: v
|
|
157
|
+
}, e);
|
|
158
|
+
_(t.from), y(t.to);
|
|
159
|
+
}, T = () => {
|
|
160
|
+
let e = s({
|
|
161
|
+
from: f,
|
|
162
|
+
to: v
|
|
163
|
+
});
|
|
164
|
+
e ? l(e) : u();
|
|
165
|
+
}, D = (e) => {
|
|
166
|
+
if (C(e), r) {
|
|
167
|
+
x(e.year);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
o(e, {
|
|
171
|
+
year: b,
|
|
172
|
+
month: 1
|
|
173
|
+
}) < 0 ? x(e.year) : o(e, {
|
|
174
|
+
year: b + 1,
|
|
175
|
+
month: 12
|
|
176
|
+
}) > 0 && x(e.year - 1);
|
|
177
|
+
};
|
|
178
|
+
return /* @__PURE__ */ g("div", {
|
|
179
|
+
className: "min-w-60",
|
|
180
|
+
children: [/* @__PURE__ */ g("div", {
|
|
181
|
+
className: e(r ? "" : "grid grid-cols-[1fr_auto_1fr] gap-5"),
|
|
182
|
+
children: [/* @__PURE__ */ h(E, {
|
|
183
|
+
year: b,
|
|
184
|
+
from: f,
|
|
185
|
+
to: v,
|
|
186
|
+
onSelect: w,
|
|
187
|
+
onYearChange: x,
|
|
188
|
+
onMove: D,
|
|
189
|
+
focusedMonth: S,
|
|
190
|
+
onFocusMonth: C,
|
|
191
|
+
focusOnMount: i,
|
|
192
|
+
initialFocusRef: a,
|
|
193
|
+
showPrev: !0,
|
|
194
|
+
showNext: r
|
|
195
|
+
}), !r && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", { className: "w-px bg-border-subtle" }), /* @__PURE__ */ h(E, {
|
|
196
|
+
year: b + 1,
|
|
197
|
+
from: f,
|
|
198
|
+
to: v,
|
|
199
|
+
onSelect: w,
|
|
200
|
+
onYearChange: (e) => x(e - 1),
|
|
201
|
+
onMove: D,
|
|
202
|
+
focusedMonth: S,
|
|
203
|
+
onFocusMonth: C,
|
|
204
|
+
focusOnMount: i,
|
|
205
|
+
showPrev: !1,
|
|
206
|
+
showNext: !0
|
|
207
|
+
})] })]
|
|
208
|
+
}), /* @__PURE__ */ g("div", {
|
|
209
|
+
className: "mt-6 flex justify-end gap-2",
|
|
210
|
+
children: [/* @__PURE__ */ h(t, {
|
|
211
|
+
type: "button",
|
|
212
|
+
size: "small",
|
|
213
|
+
variant: "tertiary",
|
|
214
|
+
appearance: "transparent",
|
|
215
|
+
onClick: u,
|
|
216
|
+
children: "닫기"
|
|
217
|
+
}), /* @__PURE__ */ h(t, {
|
|
218
|
+
type: "button",
|
|
219
|
+
size: "small",
|
|
220
|
+
onClick: T,
|
|
221
|
+
children: "적용"
|
|
222
|
+
})]
|
|
223
|
+
})]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
export { D as MonthRangePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){return e.year*12+e.month-(t.year*12+t.month)}function t(e,t){let n=e.year*12+e.month-1+t,r=Math.floor(n/12);return{year:r,month:n-r*12+1}}function n(t,n){return!t.from||t.to||e(n,t.from)<0?{from:n,to:null}:{from:t.from,to:n}}function r(e){return e.from?{from:e.from,to:e.to??e.from}:null}exports.compareMonths=e,exports.completeMonthRange=r,exports.selectMonth=n,exports.shiftMonth=t;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MonthValue } from '../date-picker/index.js';
|
|
2
|
+
export interface MonthRange {
|
|
3
|
+
from: MonthValue | null;
|
|
4
|
+
to: MonthValue | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function compareMonths(a: MonthValue, b: MonthValue): number;
|
|
7
|
+
export declare function shiftMonth(value: MonthValue, amount: number): MonthValue;
|
|
8
|
+
export declare function selectMonth(range: MonthRange, next: MonthValue): MonthRange;
|
|
9
|
+
export declare function completeMonthRange(range: MonthRange): MonthRange | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/components/month-range-picker/month-range-utils.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
return e.year * 12 + e.month - (t.year * 12 + t.month);
|
|
4
|
+
}
|
|
5
|
+
function t(e, t) {
|
|
6
|
+
let n = e.year * 12 + e.month - 1 + t, r = Math.floor(n / 12);
|
|
7
|
+
return {
|
|
8
|
+
year: r,
|
|
9
|
+
month: n - r * 12 + 1
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function n(t, n) {
|
|
13
|
+
return !t.from || t.to || e(n, t.from) < 0 ? {
|
|
14
|
+
from: n,
|
|
15
|
+
to: null
|
|
16
|
+
} : {
|
|
17
|
+
from: t.from,
|
|
18
|
+
to: n
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function r(e) {
|
|
22
|
+
return e.from ? {
|
|
23
|
+
from: e.from,
|
|
24
|
+
to: e.to ?? e.from
|
|
25
|
+
} : null;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { e as compareMonths, r as completeMonthRange, n as selectMonth, t as shiftMonth };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("react/jsx-runtime");function n({title:n,subtitle:r,className:i=``}){return(0,t.jsxs)(`div`,{className:e.cn(`flex min-w-0 items-baseline gap-x-3`,i),children:[(0,t.jsx)(`h1`,{className:`min-w-0 shrink truncate text-base font-semibold text-fg-muted sm:text-lg`,children:n}),r&&(0,t.jsx)(`p`,{className:`min-w-0 shrink-3 truncate text-xs text-fg-subtle sm:text-sm`,children:r})]})}exports.PageTitle=n;
|
|
@@ -0,0 +1,17 @@
|
|
|
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/page-title/PageTitle.tsx
|
|
4
|
+
function r({ title: r, subtitle: i, className: a = "" }) {
|
|
5
|
+
return /* @__PURE__ */ n("div", {
|
|
6
|
+
className: e("flex min-w-0 items-baseline gap-x-3", a),
|
|
7
|
+
children: [/* @__PURE__ */ t("h1", {
|
|
8
|
+
className: "min-w-0 shrink truncate text-base font-semibold text-fg-muted sm:text-lg",
|
|
9
|
+
children: r
|
|
10
|
+
}), i && /* @__PURE__ */ t("p", {
|
|
11
|
+
className: "min-w-0 shrink-3 truncate text-xs text-fg-subtle sm:text-sm",
|
|
12
|
+
children: i
|
|
13
|
+
})]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as PageTitle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageTitle } from './PageTitle.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("react"),n=require("react/jsx-runtime"),r=require("motion/react"),i=require("@floating-ui/react");function a({trigger:a,content:o,placement:s=`bottom`,onOpenChange:c,className:l}){let[u,d]=(0,t.useState)(!1),f=e=>{d(e),c?.(e)},{refs:p,floatingStyles:m,context:h}=(0,i.useFloating)({open:u,onOpenChange:f,placement:s,whileElementsMounted:i.autoUpdate,middleware:[(0,i.offset)(8),(0,i.flip)({fallbackAxisSideDirection:`start`}),(0,i.shift)({padding:8})]}),{getReferenceProps:g,getFloatingProps:_}=(0,i.useInteractions)([(0,i.useClick)(h),(0,i.useDismiss)(h),(0,i.useRole)(h,{role:`dialog`})]),v=()=>f(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{ref:p.setReference,tabIndex:0,role:`button`,...g(),className:`inline-flex cursor-pointer select-none`,children:a}),(0,n.jsx)(i.FloatingPortal,{children:(0,n.jsx)(r.AnimatePresence,{children:u&&(0,n.jsx)(`div`,{ref:p.setFloating,style:m,..._(),className:`z-floating`,children:(0,n.jsx)(r.motion.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:e.cn(`bg-bg-surface text-fg-default rounded-surface shadow-tooltip border border-border-subtle p-4 min-w-60 max-w-[320px]`,l),children:typeof o==`function`?o(v):o})})})})]})}exports.Popover=a;
|
|
@@ -16,6 +16,11 @@ export interface PopoverProps {
|
|
|
16
16
|
placement?: "top" | "bottom" | "left" | "right";
|
|
17
17
|
/** 열림/닫힘 변화 콜백. 호출처가 open 상태에 따라 폴링 등을 제어할 때 사용. */
|
|
18
18
|
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
/**
|
|
20
|
+
* 팝오버 카드(콘텐츠 박스)에 병합되는 클래스. 배경·패딩·폭 등을 덮을 때 쓴다.
|
|
21
|
+
* `cn`(tailwind-merge)으로 병합된다. 위치를 잡는 바깥 wrapper(floating-ui 제어)에는 적용 안 됨.
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Popover — `@floating-ui/react` 기반.
|
|
@@ -24,5 +29,18 @@ export interface PopoverProps {
|
|
|
24
29
|
* - **자동 flip / shift**: 공간 부족하면 반대편으로, viewport 경계로 clamp
|
|
25
30
|
* - **스크롤/resize 자동 추적**(autoUpdate)
|
|
26
31
|
* - **Portal 렌더**: 부모 overflow:hidden에 잘리지 않음
|
|
32
|
+
*
|
|
33
|
+
* 클릭으로 여닫는 자유 콘텐츠(헤더 드롭다운·메뉴)에 쓴다. 짧은 텍스트 힌트는 `Tooltip`,
|
|
34
|
+
* 물음표 아이콘 도움말은 `InfoTooltip`을 쓸 것.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Popover
|
|
39
|
+
* trigger={<MoreIcon />}
|
|
40
|
+
* content={(close) => (
|
|
41
|
+
* <button onClick={() => { edit(); close(); }}>수정</button>
|
|
42
|
+
* )}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
27
45
|
*/
|
|
28
|
-
export declare function Popover({ trigger, content, placement, onOpenChange, }: PopoverProps): import("react").JSX.Element;
|
|
46
|
+
export declare function Popover({ trigger, content, placement, onOpenChange, className, }: PopoverProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { AnimatePresence as a, motion as o } from "motion/react";
|
|
5
|
+
import { FloatingPortal as s, autoUpdate as c, flip as l, offset as u, shift as d, useClick as f, useDismiss as p, useFloating as m, useInteractions as h, useRole as g } from "@floating-ui/react";
|
|
6
|
+
//#region src/components/popover/Popover.tsx
|
|
7
|
+
function _({ trigger: _, content: v, placement: y = "bottom", onOpenChange: b, className: x }) {
|
|
8
|
+
let [S, C] = t(!1), w = (e) => {
|
|
9
|
+
C(e), b?.(e);
|
|
10
|
+
}, { refs: T, floatingStyles: E, context: D } = m({
|
|
11
|
+
open: S,
|
|
12
|
+
onOpenChange: w,
|
|
13
|
+
placement: y,
|
|
14
|
+
whileElementsMounted: c,
|
|
15
|
+
middleware: [
|
|
16
|
+
u(8),
|
|
17
|
+
l({ fallbackAxisSideDirection: "start" }),
|
|
18
|
+
d({ padding: 8 })
|
|
19
|
+
]
|
|
20
|
+
}), { getReferenceProps: O, getFloatingProps: k } = h([
|
|
21
|
+
f(D),
|
|
22
|
+
p(D),
|
|
23
|
+
g(D, { role: "dialog" })
|
|
24
|
+
]), A = () => w(!1);
|
|
25
|
+
return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("span", {
|
|
26
|
+
ref: T.setReference,
|
|
27
|
+
tabIndex: 0,
|
|
28
|
+
role: "button",
|
|
29
|
+
...O(),
|
|
30
|
+
className: "inline-flex cursor-pointer select-none",
|
|
31
|
+
children: _
|
|
32
|
+
}), /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(a, { children: S && /* @__PURE__ */ r("div", {
|
|
33
|
+
ref: T.setFloating,
|
|
34
|
+
style: E,
|
|
35
|
+
...k(),
|
|
36
|
+
className: "z-floating",
|
|
37
|
+
children: /* @__PURE__ */ r(o.div, {
|
|
38
|
+
initial: {
|
|
39
|
+
opacity: 0,
|
|
40
|
+
scale: .95
|
|
41
|
+
},
|
|
42
|
+
animate: {
|
|
43
|
+
opacity: 1,
|
|
44
|
+
scale: 1
|
|
45
|
+
},
|
|
46
|
+
exit: {
|
|
47
|
+
opacity: 0,
|
|
48
|
+
scale: .95
|
|
49
|
+
},
|
|
50
|
+
transition: { duration: .15 },
|
|
51
|
+
className: e("bg-bg-surface text-fg-default rounded-surface shadow-tooltip border border-border-subtle p-4 min-w-60 max-w-[320px]", x),
|
|
52
|
+
children: typeof v == "function" ? v(A) : v
|
|
53
|
+
})
|
|
54
|
+
}) }) })] });
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { _ as Popover };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("react/jsx-runtime");var n={small:`h-1.5`,medium:`h-2.5`};function r({value:r,size:i=`medium`,className:a,...o}){let s=Math.min(100,Math.max(0,r));return(0,t.jsx)(`div`,{role:`progressbar`,"aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,className:e.cn(`w-full overflow-hidden rounded-full bg-bg-subtle`,n[i],a),...o,children:(0,t.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width] duration-200 ease-out motion-reduce:transition-none`,style:{width:`${s}%`}})})}exports.Progress=r;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ProgressProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Progress — 결정형(determinate) 진행률 바 원자.
|
|
4
|
+
*
|
|
5
|
+
* `value`는 0~100 스케일이다. 서버 계약이 0~1(비율)을 내려주는 도메인이
|
|
6
|
+
* 있더라도 이 컴포넌트에는 항상 0~100으로 변환해 넘긴다 — 컴포넌트가
|
|
7
|
+
* 스케일을 추측하지 않는다.
|
|
8
|
+
*
|
|
9
|
+
* 접근성: `role="progressbar"` + `aria-valuenow/min/max`. 시각 바는 트랙
|
|
10
|
+
* 위에 채움 막대를 폭(%)으로 표현하고, transition은 순수 시각 효과라
|
|
11
|
+
* `motion-reduce:transition-none`으로 감쇠한다.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Progress({ value, size, className, ...rest }: ProgressProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/progress/Progress.tsx
|
|
4
|
+
var n = {
|
|
5
|
+
small: "h-1.5",
|
|
6
|
+
medium: "h-2.5"
|
|
7
|
+
};
|
|
8
|
+
function r({ value: r, size: i = "medium", className: a, ...o }) {
|
|
9
|
+
let s = Math.min(100, Math.max(0, r));
|
|
10
|
+
return /* @__PURE__ */ t("div", {
|
|
11
|
+
role: "progressbar",
|
|
12
|
+
"aria-valuenow": s,
|
|
13
|
+
"aria-valuemin": 0,
|
|
14
|
+
"aria-valuemax": 100,
|
|
15
|
+
className: e("w-full overflow-hidden rounded-full bg-bg-subtle", n[i], a),
|
|
16
|
+
...o,
|
|
17
|
+
children: /* @__PURE__ */ t("div", {
|
|
18
|
+
className: "h-full rounded-full bg-primary transition-[width] duration-200 ease-out motion-reduce:transition-none",
|
|
19
|
+
style: { width: `${s}%` }
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as Progress };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/** Progress 컴포넌트의 크기 타입 — 트랙 높이만 바뀐다. */
|
|
3
|
+
export type ProgressSize = "small" | "medium";
|
|
4
|
+
export interface ProgressProps extends Omit<ComponentPropsWithoutRef<"div">, "role" | "aria-valuenow" | "aria-valuemin" | "aria-valuemax" | "children"> {
|
|
5
|
+
/**
|
|
6
|
+
* 진행률. **0~100 스케일이다(0~1 아님)** — 소비처는 백분율 값을 그대로
|
|
7
|
+
* 넘긴다. 컴포넌트 내부에서 곱셈·나눗셈으로 재해석하지 않는다.
|
|
8
|
+
*/
|
|
9
|
+
value: number;
|
|
10
|
+
size?: ProgressSize;
|
|
11
|
+
/** 접근성 이름. 시각적 라벨이 이미 화면에 있으면 소비처에서 함께 넘긴다. */
|
|
12
|
+
"aria-label"?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.createContext)(null);function i({equalizeLabelWidth:e=!1,className:i,style:a,children:o,...s}){let c=(0,t.useRef)(new Set),l=(0,t.useRef)(null),u=(0,t.useRef)(e),[d,f]=(0,t.useState)(null);u.current=e;let p=(0,t.useCallback)(()=>{if(!u.current)return;let e=Array.from(c.current,e=>e.getBoundingClientRect().width),t=e.length>0?Math.ceil(Math.max(...e)):null;f(e=>e===t?e:t)},[]),m=(0,t.useCallback)(e=>(c.current.add(e),u.current&&(l.current?.observe(e),p()),()=>{l.current?.unobserve(e),c.current.delete(e),p()}),[p]);(0,t.useLayoutEffect)(()=>{if(!e){f(null);return}if(typeof ResizeObserver>`u`){p();return}let t=new ResizeObserver(p);return l.current=t,c.current.forEach(e=>t.observe(e)),p(),()=>{t.disconnect(),l.current=null}},[e,p]);let h=(0,t.useMemo)(()=>({equalizeLabelWidth:e,registerLabel:m,maxLabelWidth:d}),[e,m,d]);return(0,n.jsx)(r.Provider,{value:h,children:(0,n.jsx)(`div`,{className:i,style:a,...s,children:o})})}var a=(0,t.forwardRef)(({children:i,leadingIcon:a,contentAlignment:o=`start`,className:s,disabled:c,onKeyDown:l,...u},d)=>{let f=(0,t.useContext)(r),p=f?.equalizeLabelWidth,m=f?.registerLabel,h=(0,t.useRef)(null),g=(0,t.useCallback)(e=>{h.current?.(),h.current=e&&p&&m?m(e):null},[p,m]);return(0,n.jsxs)(`label`,{className:e.cn(`relative block`,c?`cursor-not-allowed`:`cursor-pointer`,s),children:[(0,n.jsx)(`input`,{ref:d,type:`radio`,className:`peer sr-only`,disabled:c,onKeyDown:e=>{if(l?.(e),e.defaultPrevented)return;let t=e.key===`ArrowRight`||e.key===`ArrowDown`?1:e.key===`ArrowLeft`||e.key===`ArrowUp`?-1:0;if(t===0)return;let n=e.currentTarget,r=Array.from(n.ownerDocument.getElementsByName(n.name)).filter(e=>e instanceof HTMLInputElement&&e.type===`radio`&&e.form===n.form&&!e.disabled),i=r.indexOf(n);if(i<0||r.length<2)return;e.preventDefault();let a=r[(i+t+r.length)%r.length];a?.focus(),a?.click()},...u}),(0,n.jsxs)(`span`,{className:e.cn(`min-h-control-medium w-full items-center gap-slot-medium py-2 rounded-control-medium border-control border-border-subtle bg-bg-surface px-control-pad-medium text-fg-default outline-none transition-colors duration-control ease-control`,o===`center`?`grid grid-cols-[auto_minmax(0,1fr)_auto]`:`flex`,!c&&`hover:border-border-default hover:bg-bg-subtle`,`peer-checked:border-primary peer-checked:bg-primary-subtle`,`peer-checked:hover:bg-primary-subtle`,`peer-focus:ring-control peer-focus:ring-focus-primary peer-focus:ring-offset-2 peer-focus:ring-offset-bg-surface`,`peer-disabled:border-border-subtle peer-disabled:bg-bg-disabled peer-disabled:text-fg-disabled`,`peer-disabled:[&_[data-radio-indicator]]:border-border-default peer-disabled:[&_[data-radio-indicator]]:bg-bg-radio-disabled-indicator`,`peer-disabled:[&_[data-radio-dot]]:bg-icon-disabled peer-disabled:[&_[data-radio-leading]]:text-icon-disabled`,`peer-checked:[&_[data-radio-dot]]:scale-50 peer-checked:[&_[data-radio-indicator]]:border-primary`),children:[(0,n.jsx)(`span`,{"aria-hidden":`true`,"data-radio-indicator":!0,className:`flex h-slot-icon-medium w-slot-icon-medium shrink-0 items-center justify-center rounded-full border-2 border-border-default bg-bg-surface transition-colors duration-control ease-control`,children:(0,n.jsx)(`span`,{"data-radio-dot":!0,className:`h-slot-icon-medium w-slot-icon-medium scale-0 rounded-full bg-primary transition-transform duration-control ease-control`})}),(0,n.jsxs)(`span`,{"data-radio-content":!0,className:e.cn(`flex min-w-0 items-center gap-slot-medium`,o===`center`&&`justify-self-center`),children:[a?(0,n.jsx)(`span`,{"aria-hidden":`true`,"data-radio-leading":!0,className:`flex h-slot-icon-medium w-slot-icon-medium shrink-0 items-center justify-center text-icon-secondary [&>*]:h-slot-icon-medium [&>*]:w-slot-icon-medium`,children:a}):null,(0,n.jsx)(`span`,{"data-radio-label":!0,className:`min-w-0 text-left text-control-medium font-control-field`,style:f?.equalizeLabelWidth?{width:f.maxLabelWidth===null?void 0:`${f.maxLabelWidth}px`}:void 0,children:(0,n.jsx)(`span`,{ref:g,"data-radio-label-text":!0,className:`inline-block whitespace-nowrap`,children:i})})]}),o===`center`?(0,n.jsx)(`span`,{"aria-hidden":`true`,"data-radio-balance":!0,className:`h-slot-icon-medium w-slot-icon-medium`}):null]})]})});a.displayName=`Radio.Item`;var o={Group:i,Item:a};exports.Radio=o,exports.RadioGroup=i,exports.RadioItem=a;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RadioGroupProps, RadioItemProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Radio.Item의 배치만 담당하는 그룹입니다. 선택 semantics는 바깥 fieldset과 각
|
|
4
|
+
* Item의 동일한 name이 담당하므로 legend 등 도메인 마크업을 강제하지 않습니다.
|
|
5
|
+
*/
|
|
6
|
+
export declare function RadioGroup({ equalizeLabelWidth, className, style, children, ...props }: RadioGroupProps): import("react").JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* 전체 행을 클릭할 수 있는 네이티브 radio 항목.
|
|
9
|
+
*
|
|
10
|
+
* 선택 semantics는 `fieldset`/`legend`와 동일한 `name`으로 구성합니다.
|
|
11
|
+
* Radio.Group은 선택 동작을 바꾸지 않고 항목 간 레이아웃만 조율합니다.
|
|
12
|
+
* 라벨은 자연 너비 측정을 위해 기본적으로 줄바꿈하지 않습니다. 긴 문구는 폭과
|
|
13
|
+
* `whitespace-normal`을 지정한 자식으로 전달해 줄바꿈할 수 있습니다.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <fieldset>
|
|
18
|
+
* <legend>알림 방식</legend>
|
|
19
|
+
* <Radio.Group equalizeLabelWidth>
|
|
20
|
+
* <Radio.Item name="notification" value="email" checked={value === "email"}>
|
|
21
|
+
* E-mail
|
|
22
|
+
* </Radio.Item>
|
|
23
|
+
* </Radio.Group>
|
|
24
|
+
* </fieldset>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const RadioItem: import('react').ForwardRefExoticComponent<RadioItemProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
28
|
+
export declare const Radio: {
|
|
29
|
+
Group: typeof RadioGroup;
|
|
30
|
+
Item: import('react').ForwardRefExoticComponent<RadioItemProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { createContext as t, forwardRef as n, useCallback as r, useContext as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
3
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/radio/Radio.tsx
|
|
5
|
+
var d = t(null);
|
|
6
|
+
function f({ equalizeLabelWidth: e = !1, className: t, style: n, children: i, ...u }) {
|
|
7
|
+
let f = s(/* @__PURE__ */ new Set()), p = s(null), m = s(e), [h, g] = c(null);
|
|
8
|
+
m.current = e;
|
|
9
|
+
let _ = r(() => {
|
|
10
|
+
if (!m.current) return;
|
|
11
|
+
let e = Array.from(f.current, (e) => e.getBoundingClientRect().width), t = e.length > 0 ? Math.ceil(Math.max(...e)) : null;
|
|
12
|
+
g((e) => e === t ? e : t);
|
|
13
|
+
}, []), v = r((e) => (f.current.add(e), m.current && (p.current?.observe(e), _()), () => {
|
|
14
|
+
p.current?.unobserve(e), f.current.delete(e), _();
|
|
15
|
+
}), [_]);
|
|
16
|
+
a(() => {
|
|
17
|
+
if (!e) {
|
|
18
|
+
g(null);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (typeof ResizeObserver > "u") {
|
|
22
|
+
_();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
let t = new ResizeObserver(_);
|
|
26
|
+
return p.current = t, f.current.forEach((e) => t.observe(e)), _(), () => {
|
|
27
|
+
t.disconnect(), p.current = null;
|
|
28
|
+
};
|
|
29
|
+
}, [e, _]);
|
|
30
|
+
let y = o(() => ({
|
|
31
|
+
equalizeLabelWidth: e,
|
|
32
|
+
registerLabel: v,
|
|
33
|
+
maxLabelWidth: h
|
|
34
|
+
}), [
|
|
35
|
+
e,
|
|
36
|
+
v,
|
|
37
|
+
h
|
|
38
|
+
]);
|
|
39
|
+
return /* @__PURE__ */ l(d.Provider, {
|
|
40
|
+
value: y,
|
|
41
|
+
children: /* @__PURE__ */ l("div", {
|
|
42
|
+
className: t,
|
|
43
|
+
style: n,
|
|
44
|
+
...u,
|
|
45
|
+
children: i
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
var p = n(({ children: t, leadingIcon: n, contentAlignment: a = "start", className: o, disabled: c, onKeyDown: f, ...p }, m) => {
|
|
50
|
+
let h = i(d), g = h?.equalizeLabelWidth, _ = h?.registerLabel, v = s(null), y = r((e) => {
|
|
51
|
+
v.current?.(), v.current = e && g && _ ? _(e) : null;
|
|
52
|
+
}, [g, _]);
|
|
53
|
+
return /* @__PURE__ */ u("label", {
|
|
54
|
+
className: e("relative block", c ? "cursor-not-allowed" : "cursor-pointer", o),
|
|
55
|
+
children: [/* @__PURE__ */ l("input", {
|
|
56
|
+
ref: m,
|
|
57
|
+
type: "radio",
|
|
58
|
+
className: "peer sr-only",
|
|
59
|
+
disabled: c,
|
|
60
|
+
onKeyDown: (e) => {
|
|
61
|
+
if (f?.(e), e.defaultPrevented) return;
|
|
62
|
+
let t = e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 0;
|
|
63
|
+
if (t === 0) return;
|
|
64
|
+
let n = e.currentTarget, r = Array.from(n.ownerDocument.getElementsByName(n.name)).filter((e) => e instanceof HTMLInputElement && e.type === "radio" && e.form === n.form && !e.disabled), i = r.indexOf(n);
|
|
65
|
+
if (i < 0 || r.length < 2) return;
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
let a = r[(i + t + r.length) % r.length];
|
|
68
|
+
a?.focus(), a?.click();
|
|
69
|
+
},
|
|
70
|
+
...p
|
|
71
|
+
}), /* @__PURE__ */ u("span", {
|
|
72
|
+
className: e("min-h-control-medium w-full items-center gap-slot-medium py-2 rounded-control-medium border-control border-border-subtle bg-bg-surface px-control-pad-medium text-fg-default outline-none transition-colors duration-control ease-control", a === "center" ? "grid grid-cols-[auto_minmax(0,1fr)_auto]" : "flex", !c && "hover:border-border-default hover:bg-bg-subtle", "peer-checked:border-primary peer-checked:bg-primary-subtle", "peer-checked:hover:bg-primary-subtle", "peer-focus:ring-control peer-focus:ring-focus-primary peer-focus:ring-offset-2 peer-focus:ring-offset-bg-surface", "peer-disabled:border-border-subtle peer-disabled:bg-bg-disabled peer-disabled:text-fg-disabled", "peer-disabled:[&_[data-radio-indicator]]:border-border-default peer-disabled:[&_[data-radio-indicator]]:bg-bg-radio-disabled-indicator", "peer-disabled:[&_[data-radio-dot]]:bg-icon-disabled peer-disabled:[&_[data-radio-leading]]:text-icon-disabled", "peer-checked:[&_[data-radio-dot]]:scale-50 peer-checked:[&_[data-radio-indicator]]:border-primary"),
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ l("span", {
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
"data-radio-indicator": !0,
|
|
77
|
+
className: "flex h-slot-icon-medium w-slot-icon-medium shrink-0 items-center justify-center rounded-full border-2 border-border-default bg-bg-surface transition-colors duration-control ease-control",
|
|
78
|
+
children: /* @__PURE__ */ l("span", {
|
|
79
|
+
"data-radio-dot": !0,
|
|
80
|
+
className: "h-slot-icon-medium w-slot-icon-medium scale-0 rounded-full bg-primary transition-transform duration-control ease-control"
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ u("span", {
|
|
84
|
+
"data-radio-content": !0,
|
|
85
|
+
className: e("flex min-w-0 items-center gap-slot-medium", a === "center" && "justify-self-center"),
|
|
86
|
+
children: [n ? /* @__PURE__ */ l("span", {
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
"data-radio-leading": !0,
|
|
89
|
+
className: "flex h-slot-icon-medium w-slot-icon-medium shrink-0 items-center justify-center text-icon-secondary [&>*]:h-slot-icon-medium [&>*]:w-slot-icon-medium",
|
|
90
|
+
children: n
|
|
91
|
+
}) : null, /* @__PURE__ */ l("span", {
|
|
92
|
+
"data-radio-label": !0,
|
|
93
|
+
className: "min-w-0 text-left text-control-medium font-control-field",
|
|
94
|
+
style: h?.equalizeLabelWidth ? { width: h.maxLabelWidth === null ? void 0 : `${h.maxLabelWidth}px` } : void 0,
|
|
95
|
+
children: /* @__PURE__ */ l("span", {
|
|
96
|
+
ref: y,
|
|
97
|
+
"data-radio-label-text": !0,
|
|
98
|
+
className: "inline-block whitespace-nowrap",
|
|
99
|
+
children: t
|
|
100
|
+
})
|
|
101
|
+
})]
|
|
102
|
+
}),
|
|
103
|
+
a === "center" ? /* @__PURE__ */ l("span", {
|
|
104
|
+
"aria-hidden": "true",
|
|
105
|
+
"data-radio-balance": !0,
|
|
106
|
+
className: "h-slot-icon-medium w-slot-icon-medium"
|
|
107
|
+
}) : null
|
|
108
|
+
]
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
p.displayName = "Radio.Item";
|
|
113
|
+
var m = {
|
|
114
|
+
Group: f,
|
|
115
|
+
Item: p
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
export { m as Radio, f as RadioGroup, p as RadioItem };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type RadioContentAlignment = "start" | "center";
|
|
3
|
+
export interface RadioGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* 그룹 안 라벨의 자연 너비를 측정해 가장 긴 라벨과 동일한 슬롯 너비를 사용합니다.
|
|
6
|
+
* `contentAlignment="center"`인 Item과 조합하면 문구 길이가 달라도 콘텐츠 묶음의
|
|
7
|
+
* 시작점과 시각적 중심을 함께 유지할 수 있습니다.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
equalizeLabelWidth?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface RadioItemProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "className" | "type"> {
|
|
13
|
+
/** 행의 주 라벨. 전체 행을 클릭하면 이 radio가 선택됩니다. */
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/** 라벨 앞에 표시할 선택적 아이콘. */
|
|
16
|
+
leadingIcon?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* 선택 indicator를 왼쪽에 유지한 채 아이콘과 라벨 묶음의 정렬을 결정합니다.
|
|
19
|
+
* @default "start"
|
|
20
|
+
*/
|
|
21
|
+
contentAlignment?: RadioContentAlignment;
|
|
22
|
+
/** 행 컨테이너에 추가할 클래스. */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs"),t=require("../../node_modules/lucide-react/dist/esm/icons/check.cjs");let n=require("react/jsx-runtime");function r({value:r,onChange:i,size:a}){let o=a===`mini`,s=o?`text-xs`:`text-sm`;return(0,n.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1 select-none`,children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked),className:`peer sr-only`}),(0,n.jsx)(t.Check,{className:e.cn(o?`h-3.5 w-3.5`:`h-4 w-4`,`stroke-3 transition-colors peer-focus-visible:outline-2 peer-focus-visible:outline-focus-primary peer-focus-visible:outline-offset-1`,r?`text-primary-fg`:`text-icon-tertiary`),"aria-hidden":`true`}),(0,n.jsx)(`span`,{className:e.cn(s,`font-medium transition-colors`,r?`text-primary-fg`:`text-fg-subtle`),children:`완전일치`})]})}exports.ExactMatchToggle=r;
|