@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
package/README.md
CHANGED
|
@@ -20,10 +20,12 @@ import "@thewrong/ui/styles.css";
|
|
|
20
20
|
import { Button, Modal, PaginatedTable, SearchBox } from "@thewrong/ui";
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
TypeScript 선언은 ESM용이다. `moduleResolution: "bundler"` 또는 `"nodenext"`의 ESM에서 사용한다. CJS 런타임의 `require`는 지원하며, 타입 사용에는 `nodenext` ESM을 권장한다 (`node16` CJS에서 일반 `import`는 TS1479, `import x = require()`는 TS1471이 발생한다).
|
|
24
|
+
|
|
23
25
|
## 특징
|
|
24
26
|
|
|
25
27
|
- **CSS 자체포함** — `styles.css` 한 줄이면 끝. Tailwind 설정 불필요.
|
|
26
|
-
-
|
|
28
|
+
- **토큰 2계층** — 프리미티브(`--p-*`) → 시맨틱(역할). 시맨틱 CSS Variable을 덮어쓰면 테마가 바뀐다. 다크는 `.dark` 클래스 하나.
|
|
27
29
|
- **가벼운 코어** — 무거운 의존(motion, floating-ui, dnd-kit, react-virtual, date-fns, react-hot-toast)은 **optional peerDependency**. 해당 기능을 쓰는 컴포넌트만 그 패키지를 함께 설치하면 된다.
|
|
28
30
|
- **React 19**, TypeScript, Vite(lib mode).
|
|
29
31
|
|
|
@@ -38,17 +40,36 @@ import { Button, Modal, PaginatedTable, SearchBox } from "@thewrong/ui";
|
|
|
38
40
|
| 레이아웃 | TablePageLayout · TableCard · Toolbar · PageTitle |
|
|
39
41
|
| 모션/유틸 | AnimatedHeight · Collapsible · LoadingSpinner · cn |
|
|
40
42
|
|
|
41
|
-
## 테마
|
|
43
|
+
## 테마 · 토큰
|
|
44
|
+
|
|
45
|
+
- **층**: 프리미티브(`--p-*`, 원료 — 직접 쓰지 않는다) → 시맨틱(`--color-bg-surface`, `--radius-control-medium` 같은 역할). 변수명이 곧 Tailwind 유틸 이름이다(`bg-bg-surface`, `rounded-control-medium`).
|
|
46
|
+
- **다크**: 시맨틱 토큰은 조상 요소의 `.dark`를 따른다. Modal·Drawer·Tooltip·Popover·Select·DatePicker 등 body로 portal되는 컴포넌트에도 적용하고 `:root` 오버라이드와 함께 쓰려면 `<html>`에 붙인다. `<body>`에 붙여도 포털은 덮지만 `:root` 값이 body의 다크 선언보다 우선하지는 않는다. `styles.css`의 `dark:` 유틸도 `.dark`를 따르며 OS 설정은 따르지 않는다.
|
|
47
|
+
- **테마**: `styles.css`와 `tokens.css`에 포함된 `quiet`, `high-contrast`는 `data-theme`으로 선택하며 `.dark`와 조합할 수 있다. 한 서브트리에는 한 테마만 쓴다 — 서로 다른 테마 중첩이나 `data-theme="default"`로 상위 테마 해제는 소스 순서와 상속이 섞여 지원하지 않는다. `<html>` 또는 겹치지 않는 형제 서브트리에 지정한다. Modal·Toast·Popover 등 body 포털에도 적용하려면 `<html>`에 지정한다.
|
|
48
|
+
- **오버라이드**: 시맨틱 변수를 덮는다. 아래 예시는 별도 오버라이드 CSS에 두고 항상 `styles.css` 뒤에 로드하며, 다크 값은 `.dark` 블록에 따로 적는다. 테마 활성 시 `.dark[data-theme="quiet"]`의 특이도(0,2,0)가 `.dark`(0,1,0)보다 높으므로, 테마 위에서 다크 값을 바꾸려면 배치에 맞는 같은 테마 선택자로 재선언한다.
|
|
49
|
+
- **구형 브라우저**: Chrome 111 미만, Safari 16.2 미만, Firefox 113 미만은 `color-mix`를 지원하지 않아 배포 CSS의 `high-contrast` 보조 버튼 상태·입력 지우기 링에 기본 테마 폴백 색이 적용된다(avocado와 같은 구조). `--color-icon-button-primary-active`에는 정적 폴백이 없으므로 지원 브라우저를 쓰거나 명시적 색을 덮어쓴다.
|
|
50
|
+
- **그림자**: `shadow-control` 등 그림자 유틸의 값은 `--shadow-control-src` 같은 `--shadow-*-src` 변수를 덮어 조절한다.
|
|
42
51
|
|
|
43
52
|
```css
|
|
44
53
|
:root {
|
|
45
|
-
--color-primary
|
|
54
|
+
--color-primary: #2563eb;
|
|
46
55
|
}
|
|
47
56
|
.dark {
|
|
48
|
-
|
|
57
|
+
--color-bg-surface: #0b1220;
|
|
49
58
|
}
|
|
50
59
|
```
|
|
51
60
|
|
|
61
|
+
- **내 Tailwind에서 토큰 유틸 쓰기** (Tailwind v4):
|
|
62
|
+
|
|
63
|
+
```css
|
|
64
|
+
@import "tailwindcss";
|
|
65
|
+
@import "@thewrong/ui/tokens.css"; /* bg-bg-surface, rounded-control-medium, z-floating … 생성 */
|
|
66
|
+
@custom-variant dark (&:where(.dark, .dark *)); /* 소비자 dark:도 .dark를 따르게 할 때 */
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`tokens.css`를 컴파일한 소비자 CSS와 `styles.css`를 함께 쓸 수 있다. 별도 사용자 오버라이드 CSS는 둘 다 로드한 뒤에 둔다.
|
|
70
|
+
|
|
71
|
+
`tokens.css`는 소비자의 variant를 강제하지 않으므로 `@custom-variant dark`를 포함하지 않는다. 위 선언이 없으면 소비자 Tailwind의 기본 `dark:`는 `prefers-color-scheme`을 따른다.
|
|
72
|
+
|
|
52
73
|
## 개발
|
|
53
74
|
|
|
54
75
|
```bash
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={mini:`text-control-mini`,small:`text-control-small`,medium:`text-control-medium`,large:`text-control-large`},t={mini:`h-slot-icon-mini w-slot-icon-mini`,small:`h-slot-icon-small w-slot-icon-small`,medium:`h-slot-icon-medium w-slot-icon-medium`,large:`h-slot-icon-large w-slot-icon-large`},n={mini:`h-slot-icon-mini w-slot-icon-mini`,small:`h-slot-icon-small w-slot-icon-small`,medium:`h-slot-icon-medium w-slot-icon-medium`,large:`h-slot-icon-large w-slot-icon-large`},r={mini:`[&>svg]:h-slot-icon-mini [&>svg]:w-slot-icon-mini`,small:`[&>svg]:h-slot-icon-small [&>svg]:w-slot-icon-small`,medium:`[&>svg]:h-slot-icon-medium [&>svg]:w-slot-icon-medium`,large:`[&>svg]:h-slot-icon-large [&>svg]:w-slot-icon-large`},i={mini:`text-slot-badge-mini`,small:`text-slot-badge-small`,medium:`text-slot-badge-medium`,large:`text-slot-badge-large`},a={mini:`gap-slot-mini`,small:`gap-slot-small`,medium:`gap-slot-medium`,large:`gap-slot-large`};exports.CHEVRON_SIZE_CLASS=n,exports.CONTROL_TEXT_CLASS=e,exports.SLOT_BADGE_TEXT_CLASS=i,exports.SLOT_CHILD_ICON_CLASS=r,exports.SLOT_GAP_CLASS=a,exports.SLOT_ICON_SIZE_CLASS=t;
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* Button/Input/Select/Textarea의 size 토큰 정렬을 단일 출처로 관리한다.
|
|
5
5
|
*/
|
|
6
6
|
export type FormFieldSize = "mini" | "small" | "medium" | "large";
|
|
7
|
+
/** 필드 텍스트의 크기와 줄 높이. */
|
|
8
|
+
export declare const CONTROL_TEXT_CLASS: Record<FormFieldSize, string>;
|
|
7
9
|
/** 빌트인 clearable의 X 아이콘과 호출부 trailingIcon의 svg에 적용할 height/width 클래스. */
|
|
8
10
|
export declare const SLOT_ICON_SIZE_CLASS: Record<FormFieldSize, string>;
|
|
9
11
|
/** Select의 chevron 전용 사이즈 — 일반 슬롯 아이콘과 동일 비율. */
|
|
10
12
|
export declare const CHEVRON_SIZE_CLASS: Record<FormFieldSize, string>;
|
|
11
13
|
/** trailingIcon/badge wrapper에 깔아 안의 svg가 자동으로 따라가게 하는 arbitrary selector. */
|
|
12
14
|
export declare const SLOT_CHILD_ICON_CLASS: Record<FormFieldSize, string>;
|
|
13
|
-
/** badge wrapper
|
|
15
|
+
/** badge wrapper의 텍스트 크기와 줄 높이. */
|
|
14
16
|
export declare const SLOT_BADGE_TEXT_CLASS: Record<FormFieldSize, string>;
|
|
15
17
|
/** 슬롯 간 gap — 디자인 시안 medium 기준 12px. */
|
|
16
18
|
export declare const SLOT_GAP_CLASS: Record<FormFieldSize, string>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/components/_shared/form-size-tokens.ts
|
|
2
|
+
var e = {
|
|
3
|
+
mini: "text-control-mini",
|
|
4
|
+
small: "text-control-small",
|
|
5
|
+
medium: "text-control-medium",
|
|
6
|
+
large: "text-control-large"
|
|
7
|
+
}, t = {
|
|
8
|
+
mini: "h-slot-icon-mini w-slot-icon-mini",
|
|
9
|
+
small: "h-slot-icon-small w-slot-icon-small",
|
|
10
|
+
medium: "h-slot-icon-medium w-slot-icon-medium",
|
|
11
|
+
large: "h-slot-icon-large w-slot-icon-large"
|
|
12
|
+
}, n = {
|
|
13
|
+
mini: "h-slot-icon-mini w-slot-icon-mini",
|
|
14
|
+
small: "h-slot-icon-small w-slot-icon-small",
|
|
15
|
+
medium: "h-slot-icon-medium w-slot-icon-medium",
|
|
16
|
+
large: "h-slot-icon-large w-slot-icon-large"
|
|
17
|
+
}, r = {
|
|
18
|
+
mini: "[&>svg]:h-slot-icon-mini [&>svg]:w-slot-icon-mini",
|
|
19
|
+
small: "[&>svg]:h-slot-icon-small [&>svg]:w-slot-icon-small",
|
|
20
|
+
medium: "[&>svg]:h-slot-icon-medium [&>svg]:w-slot-icon-medium",
|
|
21
|
+
large: "[&>svg]:h-slot-icon-large [&>svg]:w-slot-icon-large"
|
|
22
|
+
}, i = {
|
|
23
|
+
mini: "text-slot-badge-mini",
|
|
24
|
+
small: "text-slot-badge-small",
|
|
25
|
+
medium: "text-slot-badge-medium",
|
|
26
|
+
large: "text-slot-badge-large"
|
|
27
|
+
}, a = {
|
|
28
|
+
mini: "gap-slot-mini",
|
|
29
|
+
small: "gap-slot-small",
|
|
30
|
+
medium: "gap-slot-medium",
|
|
31
|
+
large: "gap-slot-large"
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { n as CHEVRON_SIZE_CLASS, e as CONTROL_TEXT_CLASS, i as SLOT_BADGE_TEXT_CLASS, r as SLOT_CHILD_ICON_CLASS, a as SLOT_GAP_CLASS, t as SLOT_ICON_SIZE_CLASS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../button/Button.cjs"),r=require("../../node_modules/lucide-react/dist/esm/icons/circle-x.cjs"),i=require("../../node_modules/lucide-react/dist/esm/icons/info.cjs"),a=require("../../node_modules/lucide-react/dist/esm/icons/triangle-alert.cjs"),o=require("../input/Input.cjs"),s=require("../textarea/Textarea.cjs"),c=require("../../hooks/useMediaQuery.cjs"),l=require("../../lib/overlay-stack.cjs");let u=require("react"),d=require("react/jsx-runtime"),f=require("motion/react"),p=require("react-hot-toast");p=e.__toESM(p,1);let m=require("react-dom");var h=`action-toast-singleton`;function g(e){_=e,e?l.overlayStack.push(l.ACTION_TOAST_OVERLAY_ID,l.ACTION_TOAST_PRIORITY):l.overlayStack.pop(l.ACTION_TOAST_OVERLAY_ID)}var _=!1,v=0;function y({message:e,actions:t,tone:n=`warning`,icon:r,input:i,duration:a=1/0,widthPx:o,backdrop:s=!0,className:c}){let l=++v;return g(!0),p.default.custom(a=>(0,d.jsx)(T,{toastInstance:a,generation:l,message:e,actions:t,tone:n,icon:r,input:i,widthPx:o,backdrop:s,className:c}),{id:h,duration:a})}function b(){p.default.dismiss(h),g(!1)}function x(){return _}function S(e){if(e===`tertiary`)return`bg-bg-toast-tertiary hover:bg-bg-toast-tertiary-hover active:bg-bg-toast-tertiary-active text-fg-toast`}var C={warning:`text-toast-tone-warning`,info:`text-toast-tone-info`,danger:`text-toast-tone-danger`};function w(e,n){let r=t.cn(n,`shrink-0`,C[e]);return e===`info`?(0,d.jsx)(i.Info,{className:r,strokeWidth:2,"aria-hidden":!0}):(0,d.jsx)(a.TriangleAlert,{className:r,strokeWidth:2,"aria-hidden":!0})}function T({toastInstance:e,generation:i,message:a,actions:h,tone:_,icon:y,input:b,widthPx:x=680,backdrop:C,className:T}){let E=c.useIsMobile(),D=(0,f.useReducedMotion)(),O=E?`h-4 w-4`:`h-4.5 w-4.5`,k=E?`text-xs`:`text-sm`,A=E?`mini`:`small`,j=E?`px-3 py-2.5`:`px-4 py-3`,M=E?`px-3 py-3`:`px-4 py-3.5`,N=E?`gap-2`:`gap-3`,P=y===void 0?w(_,O):y,[F,I]=(0,u.useState)(b?.defaultValue??``),L=(0,u.useRef)(null),R=(0,u.useRef)(null);(0,u.useEffect)(()=>{!e.visible||!b||(b.type===`text`?L.current:R.current)?.focus({preventScroll:!0})},[b,e.visible]),(0,u.useEffect)(()=>{i===v&&g(e.visible)},[i,e.visible]),(0,u.useEffect)(()=>()=>{i===v&&g(!1)},[i]),(0,u.useEffect)(()=>{let t=t=>{t.key===`Escape`&&l.overlayStack.isTop(`action-toast-overlay`)&&(p.default.dismiss(e.id),g(!1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.id]);let z=(0,u.useRef)(null),[B,V]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=z.current;if(!e)return;let t=()=>{let t=window.getComputedStyle(e),n=parseFloat(t.lineHeight);!Number.isFinite(n)||n<=0||V(e.scrollHeight>n+1.5)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[a]);let H=E&&B&&!b;(0,u.useEffect)(()=>{I(b?.defaultValue??``)},[b?.defaultValue,b?.type]);let U=t=>{(t.closeOnClick??!0)&&(p.default.dismiss(e.id),g(!1)),t.onClick(F)},W=C?null:(0,d.jsx)(`button`,{type:`button`,onClick:()=>{p.default.dismiss(e.id),g(!1)},className:`ml-1 shrink-0 text-fg-toast-muted hover:text-fg-toast-hover transition-colors cursor-pointer`,"aria-label":`닫기`,children:(0,d.jsx)(r.CircleX,{className:O,fill:`currentColor`,stroke:`var(--color-bg-toast)`,strokeWidth:2})}),G=(e,t=!1)=>h.length>0&&(0,d.jsx)(`div`,{className:e,children:h.map((e,r)=>(0,d.jsx)(n.Button,{variant:e.variant,appearance:e.appearance,size:e.size??A,leadingIcon:e.leadingIcon,trailingIcon:e.trailingIcon,"aria-label":e.ariaLabel,disabled:t?void 0:e.disabled,onClick:t?void 0:()=>U(e),tabIndex:t?-1:void 0,className:t?void 0:S(e.variant),children:e.label},r))});return(0,d.jsxs)(d.Fragment,{children:[C&&(0,m.createPortal)((0,d.jsx)(f.motion.div,{initial:D?!1:{opacity:0},animate:{opacity:+!!e.visible},transition:{duration:D?0:.18},onClick:()=>{p.default.dismiss(e.id),g(!1)},className:t.cn(`fixed inset-0 z-toast-backdrop bg-bg-toast-backdrop`,!e.visible&&`pointer-events-none`),"aria-hidden":!0}),document.body),(0,d.jsx)(f.motion.div,{initial:D?!1:{opacity:0,scale:.98},animate:e.visible?{opacity:1,scale:1}:{opacity:0,scale:.98},transition:{duration:D?0:.22,ease:[.16,1,.3,1]},className:t.cn(`dark relative rounded-toast bg-bg-toast text-fg-toast shadow-overlay`,e.visible?``:`pointer-events-none`,T),style:{width:`min(${x}px, calc(100vw - 32px))`},role:`alertdialog`,"data-ui-action-toast":``,"aria-modal":C?`true`:void 0,"aria-label":`확인이 필요한 알림`,children:b?(0,d.jsxs)(`div`,{className:`flex flex-col gap-2.5 ${M}`,children:[(0,d.jsxs)(`div`,{className:`flex items-start ${N}`,children:[P,(0,d.jsx)(`div`,{className:`min-w-0 flex-1 ${k} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,children:a}),W]}),b.type===`text`?(0,d.jsx)(o.Input,{ref:L,variant:`box`,inputSize:E?`mini`:`small`,value:F,onChange:e=>I(e.target.value),onKeyDown:e=>{if(e.key!==`Enter`||e.nativeEvent.isComposing)return;let t=h[h.length-1];!t||t.disabled||(e.preventDefault(),U(t))},placeholder:b.placeholder}):(0,d.jsx)(s.Textarea,{ref:R,textareaSize:E?`mini`:`small`,rows:b.rows??3,value:F,onChange:e=>I(e.target.value),placeholder:b.placeholder}),G(`flex justify-end gap-1.5`)]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{"aria-hidden":!0,className:`invisible pointer-events-none absolute inset-0 flex items-center ${N} ${j}`,children:[(0,d.jsx)(`span`,{className:`${O} shrink-0`}),(0,d.jsx)(`div`,{ref:z,className:`min-w-0 flex-1 ${k} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,children:a}),G(`flex shrink-0 gap-1.5`,!0)]}),H?(0,d.jsxs)(`div`,{className:`relative flex flex-col ${N} ${M}`,children:[W&&(0,d.jsx)(`div`,{className:`absolute right-3 top-3`,children:W}),(0,d.jsx)(`div`,{className:`flex justify-center`,children:P}),(0,d.jsx)(`div`,{className:`${k} leading-relaxed text-center whitespace-pre-line break-keep wrap-break-word`,children:a}),G(`flex justify-end gap-1.5`)]}):(0,d.jsxs)(`div`,{className:`flex items-center ${N} ${j}`,children:[P,(0,d.jsx)(`div`,{className:`min-w-0 flex-1 ${k} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,children:a}),G(`flex shrink-0 gap-1.5`),W]})]})})]})}exports.dismissActionToast=b,exports.isActionToastActive=x,exports.showActionToast=y;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
-
import { Button } from '
|
|
2
|
+
import { Button } from '../button/index.js';
|
|
3
3
|
type ButtonVisualProps = Partial<Pick<ComponentProps<typeof Button>, "variant" | "appearance" | "size" | "leadingIcon" | "trailingIcon">>;
|
|
4
4
|
export interface ActionToastButton extends ButtonVisualProps {
|
|
5
5
|
label: ReactNode;
|
|
6
|
+
/** 화면에 보이는 라벨 대신 스크린 리더에 전달할 버튼 이름. */
|
|
7
|
+
ariaLabel?: string;
|
|
6
8
|
/**
|
|
7
9
|
* 클릭 시 호출. 호출 후 토스트는 자동으로 닫힌다.
|
|
8
10
|
* 닫지 않고 유지하려면 `closeOnClick: false`.
|
|
@@ -24,6 +26,11 @@ export type ActionToastInput = {
|
|
|
24
26
|
rows?: number;
|
|
25
27
|
};
|
|
26
28
|
interface ShowActionToastArgs {
|
|
29
|
+
/**
|
|
30
|
+
* 본문. ReactNode를 받지만 Select·MultiSelect·Popover·Tooltip·DatePicker 같은 부유 패널은 넣지 않는다 —
|
|
31
|
+
* 토스트(z-toast 150)가 부유 패널(z-floating 100)보다 위라, 패널이 열리면 시트 아래로 깔린다.
|
|
32
|
+
* 선택이 필요하면 토스트 대신 Modal을 쓴다. `icon`·액션 `label`도 같다.
|
|
33
|
+
*/
|
|
27
34
|
message: ReactNode;
|
|
28
35
|
actions: ActionToastButton[];
|
|
29
36
|
/** 톤. 좌측 아이콘 색상에만 반영(배경/텍스트는 일반 토스트와 동일한 다크 그레이). */
|
|
@@ -31,6 +38,8 @@ interface ShowActionToastArgs {
|
|
|
31
38
|
/** 좌측 아이콘 커스텀. 미지정 시 톤별 기본 아이콘. null이면 아이콘 숨김. */
|
|
32
39
|
icon?: ReactNode | null;
|
|
33
40
|
input?: ActionToastInput;
|
|
41
|
+
/** 자동으로 닫힐 때까지의 시간(ms). 기본값은 자동으로 닫히지 않는 Infinity. @default Infinity */
|
|
42
|
+
duration?: number;
|
|
34
43
|
/** 토스트 폭(px) 커스텀. 기본 680(일반 토스트와 동일). 모바일은 viewport-32px로 자동 fit. */
|
|
35
44
|
widthPx?: number;
|
|
36
45
|
/**
|
|
@@ -39,9 +48,14 @@ interface ShowActionToastArgs {
|
|
|
39
48
|
* false면 클릭-아웃 dismiss도 비활성.
|
|
40
49
|
*/
|
|
41
50
|
backdrop?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 시트(카드) 루트에 병합되는 클래스. `cn`(tailwind-merge)으로 병합된다. 백드롭에는 적용 안 됨.
|
|
53
|
+
* 폭은 `widthPx`로 고정하는 것이 정책이므로 너비 클래스 대신 `widthPx`를 우선 쓸 것.
|
|
54
|
+
*/
|
|
55
|
+
className?: string;
|
|
42
56
|
}
|
|
43
57
|
/**
|
|
44
|
-
* 사용자 결정이 필요한 액션 토스트. 자동
|
|
58
|
+
* 사용자 결정이 필요한 액션 토스트. 기본적으로 자동 닫힘이 없으며, `duration`을 지정하면 해당 시간이 지난 뒤 닫힌다.
|
|
45
59
|
* 위치는 전역 Toaster를 따름(데스크탑=bottom-center, 모바일=top-center).
|
|
46
60
|
* 한 번에 최대 1개만 노출(같은 id로 덮어쓰기).
|
|
47
61
|
*
|
|
@@ -50,7 +64,7 @@ interface ShowActionToastArgs {
|
|
|
50
64
|
*
|
|
51
65
|
* 사용 전 앱 루트에 `react-hot-toast`의 `<Toaster />`가 마운트돼 있어야 한다.
|
|
52
66
|
*/
|
|
53
|
-
export declare function showActionToast({ message, actions, tone, icon, input, widthPx, backdrop, }: ShowActionToastArgs): string;
|
|
67
|
+
export declare function showActionToast({ message, actions, tone, icon, input, duration, widthPx, backdrop, className, }: ShowActionToastArgs): string;
|
|
54
68
|
export declare function dismissActionToast(): void;
|
|
55
69
|
export declare function isActionToastActive(): boolean;
|
|
56
70
|
export {};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { Button as t } from "../button/Button.esm.js";
|
|
3
|
+
import { CircleX as n } from "../../node_modules/lucide-react/dist/esm/icons/circle-x.esm.js";
|
|
4
|
+
import { Info as r } from "../../node_modules/lucide-react/dist/esm/icons/info.esm.js";
|
|
5
|
+
import { TriangleAlert as i } from "../../node_modules/lucide-react/dist/esm/icons/triangle-alert.esm.js";
|
|
6
|
+
import { Input as a } from "../input/Input.esm.js";
|
|
7
|
+
import { Textarea as o } from "../textarea/Textarea.esm.js";
|
|
8
|
+
import { useIsMobile as s } from "../../hooks/useMediaQuery.esm.js";
|
|
9
|
+
import { ACTION_TOAST_OVERLAY_ID as c, ACTION_TOAST_PRIORITY as l, overlayStack as u } from "../../lib/overlay-stack.esm.js";
|
|
10
|
+
import { useEffect as d, useRef as f, useState as p } from "react";
|
|
11
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { motion as _, useReducedMotion as v } from "motion/react";
|
|
13
|
+
import y from "react-hot-toast";
|
|
14
|
+
import { createPortal as b } from "react-dom";
|
|
15
|
+
//#region src/components/action-toast/ActionToast.tsx
|
|
16
|
+
var x = "action-toast-singleton";
|
|
17
|
+
function S(e) {
|
|
18
|
+
C = e, e ? u.push(c, l) : u.pop(c);
|
|
19
|
+
}
|
|
20
|
+
var C = !1, w = 0;
|
|
21
|
+
function T({ message: e, actions: t, tone: n = "warning", icon: r, input: i, duration: a = Infinity, widthPx: o, backdrop: s = !0, className: c }) {
|
|
22
|
+
let l = ++w;
|
|
23
|
+
return S(!0), y.custom((a) => /* @__PURE__ */ h(j, {
|
|
24
|
+
toastInstance: a,
|
|
25
|
+
generation: l,
|
|
26
|
+
message: e,
|
|
27
|
+
actions: t,
|
|
28
|
+
tone: n,
|
|
29
|
+
icon: r,
|
|
30
|
+
input: i,
|
|
31
|
+
widthPx: o,
|
|
32
|
+
backdrop: s,
|
|
33
|
+
className: c
|
|
34
|
+
}), {
|
|
35
|
+
id: x,
|
|
36
|
+
duration: a
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function E() {
|
|
40
|
+
y.dismiss(x), S(!1);
|
|
41
|
+
}
|
|
42
|
+
function D() {
|
|
43
|
+
return C;
|
|
44
|
+
}
|
|
45
|
+
function O(e) {
|
|
46
|
+
if (e === "tertiary") return "bg-bg-toast-tertiary hover:bg-bg-toast-tertiary-hover active:bg-bg-toast-tertiary-active text-fg-toast";
|
|
47
|
+
}
|
|
48
|
+
var k = {
|
|
49
|
+
warning: "text-toast-tone-warning",
|
|
50
|
+
info: "text-toast-tone-info",
|
|
51
|
+
danger: "text-toast-tone-danger"
|
|
52
|
+
};
|
|
53
|
+
function A(t, n) {
|
|
54
|
+
let a = e(n, "shrink-0", k[t]);
|
|
55
|
+
return h(t === "info" ? r : i, {
|
|
56
|
+
className: a,
|
|
57
|
+
strokeWidth: 2,
|
|
58
|
+
"aria-hidden": !0
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function j({ toastInstance: r, generation: i, message: c, actions: l, tone: x, icon: C, input: T, widthPx: E = 680, backdrop: D, className: k }) {
|
|
62
|
+
let j = s(), M = v(), N = j ? "h-4 w-4" : "h-4.5 w-4.5", P = j ? "text-xs" : "text-sm", F = j ? "mini" : "small", I = j ? "px-3 py-2.5" : "px-4 py-3", L = j ? "px-3 py-3" : "px-4 py-3.5", R = j ? "gap-2" : "gap-3", z = C === void 0 ? A(x, N) : C, [B, V] = p(T?.defaultValue ?? ""), H = f(null), U = f(null);
|
|
63
|
+
d(() => {
|
|
64
|
+
!r.visible || !T || (T.type === "text" ? H.current : U.current)?.focus({ preventScroll: !0 });
|
|
65
|
+
}, [T, r.visible]), d(() => {
|
|
66
|
+
i === w && S(r.visible);
|
|
67
|
+
}, [i, r.visible]), d(() => () => {
|
|
68
|
+
i === w && S(!1);
|
|
69
|
+
}, [i]), d(() => {
|
|
70
|
+
let e = (e) => {
|
|
71
|
+
e.key === "Escape" && u.isTop("action-toast-overlay") && (y.dismiss(r.id), S(!1));
|
|
72
|
+
};
|
|
73
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
74
|
+
}, [r.id]);
|
|
75
|
+
let W = f(null), [G, K] = p(!1);
|
|
76
|
+
d(() => {
|
|
77
|
+
let e = W.current;
|
|
78
|
+
if (!e) return;
|
|
79
|
+
let t = () => {
|
|
80
|
+
let t = window.getComputedStyle(e), n = parseFloat(t.lineHeight);
|
|
81
|
+
!Number.isFinite(n) || n <= 0 || K(e.scrollHeight > n + 1.5);
|
|
82
|
+
};
|
|
83
|
+
t();
|
|
84
|
+
let n = new ResizeObserver(t);
|
|
85
|
+
return n.observe(e), () => n.disconnect();
|
|
86
|
+
}, [c]);
|
|
87
|
+
let q = j && G && !T;
|
|
88
|
+
d(() => {
|
|
89
|
+
V(T?.defaultValue ?? "");
|
|
90
|
+
}, [T?.defaultValue, T?.type]);
|
|
91
|
+
let J = (e) => {
|
|
92
|
+
(e.closeOnClick ?? !0) && (y.dismiss(r.id), S(!1)), e.onClick(B);
|
|
93
|
+
}, Y = D ? null : /* @__PURE__ */ h("button", {
|
|
94
|
+
type: "button",
|
|
95
|
+
onClick: () => {
|
|
96
|
+
y.dismiss(r.id), S(!1);
|
|
97
|
+
},
|
|
98
|
+
className: "ml-1 shrink-0 text-fg-toast-muted hover:text-fg-toast-hover transition-colors cursor-pointer",
|
|
99
|
+
"aria-label": "닫기",
|
|
100
|
+
children: /* @__PURE__ */ h(n, {
|
|
101
|
+
className: N,
|
|
102
|
+
fill: "currentColor",
|
|
103
|
+
stroke: "var(--color-bg-toast)",
|
|
104
|
+
strokeWidth: 2
|
|
105
|
+
})
|
|
106
|
+
}), X = (e, n = !1) => l.length > 0 && /* @__PURE__ */ h("div", {
|
|
107
|
+
className: e,
|
|
108
|
+
children: l.map((e, r) => /* @__PURE__ */ h(t, {
|
|
109
|
+
variant: e.variant,
|
|
110
|
+
appearance: e.appearance,
|
|
111
|
+
size: e.size ?? F,
|
|
112
|
+
leadingIcon: e.leadingIcon,
|
|
113
|
+
trailingIcon: e.trailingIcon,
|
|
114
|
+
"aria-label": e.ariaLabel,
|
|
115
|
+
disabled: n ? void 0 : e.disabled,
|
|
116
|
+
onClick: n ? void 0 : () => J(e),
|
|
117
|
+
tabIndex: n ? -1 : void 0,
|
|
118
|
+
className: n ? void 0 : O(e.variant),
|
|
119
|
+
children: e.label
|
|
120
|
+
}, r))
|
|
121
|
+
});
|
|
122
|
+
return /* @__PURE__ */ g(m, { children: [D && b(/* @__PURE__ */ h(_.div, {
|
|
123
|
+
initial: M ? !1 : { opacity: 0 },
|
|
124
|
+
animate: { opacity: +!!r.visible },
|
|
125
|
+
transition: { duration: M ? 0 : .18 },
|
|
126
|
+
onClick: () => {
|
|
127
|
+
y.dismiss(r.id), S(!1);
|
|
128
|
+
},
|
|
129
|
+
className: e("fixed inset-0 z-toast-backdrop bg-bg-toast-backdrop", !r.visible && "pointer-events-none"),
|
|
130
|
+
"aria-hidden": !0
|
|
131
|
+
}), document.body), /* @__PURE__ */ h(_.div, {
|
|
132
|
+
initial: M ? !1 : {
|
|
133
|
+
opacity: 0,
|
|
134
|
+
scale: .98
|
|
135
|
+
},
|
|
136
|
+
animate: r.visible ? {
|
|
137
|
+
opacity: 1,
|
|
138
|
+
scale: 1
|
|
139
|
+
} : {
|
|
140
|
+
opacity: 0,
|
|
141
|
+
scale: .98
|
|
142
|
+
},
|
|
143
|
+
transition: {
|
|
144
|
+
duration: M ? 0 : .22,
|
|
145
|
+
ease: [
|
|
146
|
+
.16,
|
|
147
|
+
1,
|
|
148
|
+
.3,
|
|
149
|
+
1
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
className: e("dark relative rounded-toast bg-bg-toast text-fg-toast shadow-overlay", r.visible ? "" : "pointer-events-none", k),
|
|
153
|
+
style: { width: `min(${E}px, calc(100vw - 32px))` },
|
|
154
|
+
role: "alertdialog",
|
|
155
|
+
"data-ui-action-toast": "",
|
|
156
|
+
"aria-modal": D ? "true" : void 0,
|
|
157
|
+
"aria-label": "확인이 필요한 알림",
|
|
158
|
+
children: T ? /* @__PURE__ */ g("div", {
|
|
159
|
+
className: `flex flex-col gap-2.5 ${L}`,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ g("div", {
|
|
162
|
+
className: `flex items-start ${R}`,
|
|
163
|
+
children: [
|
|
164
|
+
z,
|
|
165
|
+
/* @__PURE__ */ h("div", {
|
|
166
|
+
className: `min-w-0 flex-1 ${P} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
|
|
167
|
+
children: c
|
|
168
|
+
}),
|
|
169
|
+
Y
|
|
170
|
+
]
|
|
171
|
+
}),
|
|
172
|
+
T.type === "text" ? /* @__PURE__ */ h(a, {
|
|
173
|
+
ref: H,
|
|
174
|
+
variant: "box",
|
|
175
|
+
inputSize: j ? "mini" : "small",
|
|
176
|
+
value: B,
|
|
177
|
+
onChange: (e) => V(e.target.value),
|
|
178
|
+
onKeyDown: (e) => {
|
|
179
|
+
if (e.key !== "Enter" || e.nativeEvent.isComposing) return;
|
|
180
|
+
let t = l[l.length - 1];
|
|
181
|
+
!t || t.disabled || (e.preventDefault(), J(t));
|
|
182
|
+
},
|
|
183
|
+
placeholder: T.placeholder
|
|
184
|
+
}) : /* @__PURE__ */ h(o, {
|
|
185
|
+
ref: U,
|
|
186
|
+
textareaSize: j ? "mini" : "small",
|
|
187
|
+
rows: T.rows ?? 3,
|
|
188
|
+
value: B,
|
|
189
|
+
onChange: (e) => V(e.target.value),
|
|
190
|
+
placeholder: T.placeholder
|
|
191
|
+
}),
|
|
192
|
+
X("flex justify-end gap-1.5")
|
|
193
|
+
]
|
|
194
|
+
}) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
|
|
195
|
+
"aria-hidden": !0,
|
|
196
|
+
className: `invisible pointer-events-none absolute inset-0 flex items-center ${R} ${I}`,
|
|
197
|
+
children: [
|
|
198
|
+
/* @__PURE__ */ h("span", { className: `${N} shrink-0` }),
|
|
199
|
+
/* @__PURE__ */ h("div", {
|
|
200
|
+
ref: W,
|
|
201
|
+
className: `min-w-0 flex-1 ${P} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
|
|
202
|
+
children: c
|
|
203
|
+
}),
|
|
204
|
+
X("flex shrink-0 gap-1.5", !0)
|
|
205
|
+
]
|
|
206
|
+
}), q ? /* @__PURE__ */ g("div", {
|
|
207
|
+
className: `relative flex flex-col ${R} ${L}`,
|
|
208
|
+
children: [
|
|
209
|
+
Y && /* @__PURE__ */ h("div", {
|
|
210
|
+
className: "absolute right-3 top-3",
|
|
211
|
+
children: Y
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ h("div", {
|
|
214
|
+
className: "flex justify-center",
|
|
215
|
+
children: z
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ h("div", {
|
|
218
|
+
className: `${P} leading-relaxed text-center whitespace-pre-line break-keep wrap-break-word`,
|
|
219
|
+
children: c
|
|
220
|
+
}),
|
|
221
|
+
X("flex justify-end gap-1.5")
|
|
222
|
+
]
|
|
223
|
+
}) : /* @__PURE__ */ g("div", {
|
|
224
|
+
className: `flex items-center ${R} ${I}`,
|
|
225
|
+
children: [
|
|
226
|
+
z,
|
|
227
|
+
/* @__PURE__ */ h("div", {
|
|
228
|
+
className: `min-w-0 flex-1 ${P} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
|
|
229
|
+
children: c
|
|
230
|
+
}),
|
|
231
|
+
X("flex shrink-0 gap-1.5"),
|
|
232
|
+
Y
|
|
233
|
+
]
|
|
234
|
+
})] })
|
|
235
|
+
})] });
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
export { E as dismissActionToast, D as isActionToastActive, T as showActionToast };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { showActionToast, dismissActionToast, isActionToastActive, } from './ActionToast';
|
|
2
|
-
export type { ActionToastButton, ActionToastInput } from './ActionToast';
|
|
1
|
+
export { showActionToast, dismissActionToast, isActionToastActive, } from './ActionToast.js';
|
|
2
|
+
export type { ActionToastButton, ActionToastInput } from './ActionToast.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("react"),t=require("react/jsx-runtime"),n=require("motion/react");function r({children:r,durationMs:i=220,ease:a=[.16,1,.3,1],className:o=``}){let s=(0,n.useReducedMotion)(),c=(0,e.useRef)(null),[l,u]=(0,e.useState)(`auto`),d=(0,e.useRef)(!0),[f,p]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(([e])=>{if(!e)return;let t=e.contentRect.height;u(t),d.current&&(d.current=!1,requestAnimationFrame(()=>p(!0)))});return t.observe(e),()=>t.disconnect()},[]),(0,t.jsx)(n.motion.div,{animate:{height:l},transition:f&&!s?{duration:i/1e3,ease:a}:{duration:0},style:{overflow:`hidden`},className:o,children:(0,t.jsx)(`div`,{ref:c,children:r})})}exports.AnimatedHeight=r;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { motion as i, useReducedMotion as a } from "motion/react";
|
|
4
|
+
//#region src/components/animated-height/AnimatedHeight.tsx
|
|
5
|
+
function o({ children: o, durationMs: s = 220, ease: c = [
|
|
6
|
+
.16,
|
|
7
|
+
1,
|
|
8
|
+
.3,
|
|
9
|
+
1
|
|
10
|
+
], className: l = "" }) {
|
|
11
|
+
let u = a(), d = t(null), [f, p] = n("auto"), m = t(!0), [h, g] = n(!1);
|
|
12
|
+
return e(() => {
|
|
13
|
+
let e = d.current;
|
|
14
|
+
if (!e) return;
|
|
15
|
+
let t = new ResizeObserver(([e]) => {
|
|
16
|
+
if (!e) return;
|
|
17
|
+
let t = e.contentRect.height;
|
|
18
|
+
p(t), m.current && (m.current = !1, requestAnimationFrame(() => g(!0)));
|
|
19
|
+
});
|
|
20
|
+
return t.observe(e), () => t.disconnect();
|
|
21
|
+
}, []), /* @__PURE__ */ r(i.div, {
|
|
22
|
+
animate: { height: f },
|
|
23
|
+
transition: h && !u ? {
|
|
24
|
+
duration: s / 1e3,
|
|
25
|
+
ease: c
|
|
26
|
+
} : { duration: 0 },
|
|
27
|
+
style: { overflow: "hidden" },
|
|
28
|
+
className: l,
|
|
29
|
+
children: /* @__PURE__ */ r("div", {
|
|
30
|
+
ref: d,
|
|
31
|
+
children: o
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { o as AnimatedHeight };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs"),t=require("./utils.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)((n,i)=>{let{size:a=`medium`,variant:o=`fill`,color:s=`neutral`,className:c=``,children:l,...u}=n,d=e.cn(t.getBadgeBaseClasses(),t.getBadgeColorClasses(s,o),t.getBadgeSizeClasses(a),c);if(`as`in n&&n.as===`div`){let{as:e,...t}=u;return(0,r.jsx)(`div`,{ref:i,className:d,...t,children:l})}return(0,r.jsx)(`span`,{ref:i,className:d,...u,children:l})});i.displayName=`Badge`,exports.Badge=i;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BadgeProps } from './types';
|
|
1
|
+
import { BadgeProps } from './types.js';
|
|
2
2
|
export declare const Badge: import('react').ForwardRefExoticComponent<BadgeProps & import('react').RefAttributes<HTMLDivElement | HTMLSpanElement>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { getBadgeBaseClasses as t, getBadgeColorClasses as n, getBadgeSizeClasses as r } from "./utils.esm.js";
|
|
3
|
+
import { forwardRef as i } from "react";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/badge/Badge.tsx
|
|
6
|
+
var o = i((i, o) => {
|
|
7
|
+
let { size: s = "medium", variant: c = "fill", color: l = "neutral", className: u = "", children: d, ...f } = i, p = e(t(), n(l, c), r(s), u);
|
|
8
|
+
if ("as" in i && i.as === "div") {
|
|
9
|
+
let { as: e, ...t } = f;
|
|
10
|
+
return /* @__PURE__ */ a("div", {
|
|
11
|
+
ref: o,
|
|
12
|
+
className: p,
|
|
13
|
+
...t,
|
|
14
|
+
children: d
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ a("span", {
|
|
18
|
+
ref: o,
|
|
19
|
+
className: p,
|
|
20
|
+
...f,
|
|
21
|
+
children: d
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
o.displayName = "Badge";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { o as Badge };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=(e=`neutral`,t=`fill`)=>({primary:{fill:`bg-primary text-fg-inverse`,weak:`bg-primary-subtle text-primary-fg border border-primary-border`},secondary:{fill:`bg-neutral-fill text-fg-inverse`,weak:`bg-neutral-subtle text-neutral-fg border border-neutral-border`},success:{fill:`bg-success text-fg-inverse`,weak:`bg-success-subtle text-success-fg border border-success-border`},error:{fill:`bg-error text-fg-inverse`,weak:`bg-error-subtle text-error-fg border border-error-border`},warning:{fill:`bg-warning text-fg-inverse`,weak:`bg-warning-subtle text-warning-fg border border-warning-border`},info:{fill:`bg-info text-fg-inverse`,weak:`bg-info-subtle text-info-fg border border-info-border`},neutral:{fill:`bg-neutral-fill text-fg-inverse`,weak:`bg-neutral-subtle text-neutral-fg border border-neutral-border`}})[e][t],t=(e=`medium`)=>({xsmall:`px-1.5 py-0.5 text-xs`,small:`px-2 py-1 text-xs`,medium:`px-2.5 py-1 text-sm`,large:`px-3 py-1.5 text-base`})[e],n=()=>`inline-flex items-center justify-center font-medium rounded-badge whitespace-nowrap`;exports.getBadgeBaseClasses=n,exports.getBadgeColorClasses=e,exports.getBadgeSizeClasses=t;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/components/badge/utils.ts
|
|
2
|
+
var e = (e = "neutral", t = "fill") => ({
|
|
3
|
+
primary: {
|
|
4
|
+
fill: "bg-primary text-fg-inverse",
|
|
5
|
+
weak: "bg-primary-subtle text-primary-fg border border-primary-border"
|
|
6
|
+
},
|
|
7
|
+
secondary: {
|
|
8
|
+
fill: "bg-neutral-fill text-fg-inverse",
|
|
9
|
+
weak: "bg-neutral-subtle text-neutral-fg border border-neutral-border"
|
|
10
|
+
},
|
|
11
|
+
success: {
|
|
12
|
+
fill: "bg-success text-fg-inverse",
|
|
13
|
+
weak: "bg-success-subtle text-success-fg border border-success-border"
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
fill: "bg-error text-fg-inverse",
|
|
17
|
+
weak: "bg-error-subtle text-error-fg border border-error-border"
|
|
18
|
+
},
|
|
19
|
+
warning: {
|
|
20
|
+
fill: "bg-warning text-fg-inverse",
|
|
21
|
+
weak: "bg-warning-subtle text-warning-fg border border-warning-border"
|
|
22
|
+
},
|
|
23
|
+
info: {
|
|
24
|
+
fill: "bg-info text-fg-inverse",
|
|
25
|
+
weak: "bg-info-subtle text-info-fg border border-info-border"
|
|
26
|
+
},
|
|
27
|
+
neutral: {
|
|
28
|
+
fill: "bg-neutral-fill text-fg-inverse",
|
|
29
|
+
weak: "bg-neutral-subtle text-neutral-fg border border-neutral-border"
|
|
30
|
+
}
|
|
31
|
+
})[e][t], t = (e = "medium") => ({
|
|
32
|
+
xsmall: "px-1.5 py-0.5 text-xs",
|
|
33
|
+
small: "px-2 py-1 text-xs",
|
|
34
|
+
medium: "px-2.5 py-1 text-sm",
|
|
35
|
+
large: "px-3 py-1.5 text-base"
|
|
36
|
+
})[e], n = () => "inline-flex items-center justify-center font-medium rounded-badge whitespace-nowrap";
|
|
37
|
+
//#endregion
|
|
38
|
+
export { n as getBadgeBaseClasses, e as getBadgeColorClasses, t as getBadgeSizeClasses };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs"),t=require("./utils.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=()=>(0,r.jsxs)(`svg`,{className:`animate-button-spinner size-button-spinner-small`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,r.jsx)(`circle`,{className:`opacity-button-spinner-track`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,r.jsx)(`path`,{className:`opacity-button-spinner-head`,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`})]}),a=(0,n.forwardRef)((a,o)=>{let{variant:s=`primary`,appearance:c=`filled`,size:l=`medium`,display:u=`inline`,loading:d=!1,clickThrottleMs:f=0,leadingIcon:p,trailingIcon:m,className:h=``,children:g,..._}=a,[v,y]=(0,n.useState)(!1),b=(0,n.useRef)(null),x=()=>{f&&(y(!0),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{y(!1),b.current=null},f))};(0,n.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let S=`as`in a&&a.as===`a`,C=(`disabled`in a?a.disabled:!1)||d||v,w=e.cn(t.getButtonBaseClasses(),t.getButtonColorClasses(s,c),t.getButtonSizeClasses(l),t.getButtonDisplayClasses(u),t.getButtonFocusRing(s),d&&`opacity-70 cursor-wait`,S&&C&&`pointer-events-none`,S&&C&&!d&&`opacity-button-disabled`,h);if(S){let e=_,t=t=>{if(C){t.preventDefault();return}x(),e.onClick?.(t)};return(0,r.jsxs)(`a`,{ref:o,className:w,"aria-disabled":C,tabIndex:C?-1:e.tabIndex,...e,onClick:t,children:[d?(0,r.jsx)(i,{}):p,g,!d&&m]})}let T=_,E=e=>{if(C){e.preventDefault();return}x(),T.onClick?.(e)};return(0,r.jsxs)(`button`,{ref:o,className:w,disabled:C,...T,onClick:E,children:[d?(0,r.jsx)(i,{}):p,g,!d&&m]})});a.displayName=`Button`,exports.Button=a;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonBaseProps, ButtonLinkProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 버튼. `variant`(primary/secondary/tertiary/danger) × `appearance`(filled/outlined/transparent)
|
|
4
|
+
* × `size`(mini/small/medium/large) 조합으로 표현한다.
|
|
5
|
+
*
|
|
6
|
+
* - 저장·정산·전송 같은 **비가역 async 액션**에는 `clickThrottleMs`로 더블클릭을 막는다.
|
|
7
|
+
* - 모달 푸터·모바일 등 부모 폭을 채워야 하면 `display="block"`.
|
|
8
|
+
* - 시각은 버튼이지만 실제 이동이 필요하면 `as="a"` + `href`(링크로 렌더, loading/disabled 동일 동작).
|
|
9
|
+
* - 크기와 색상은 `className`으로 덮어쓸 수 있다.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Button onClick={save}>저장</Button>
|
|
14
|
+
* <Button variant="danger" appearance="outlined" onClick={remove}>삭제</Button>
|
|
15
|
+
* <Button display="block" loading={isSaving} clickThrottleMs={1000} onClick={submit}>제출</Button>
|
|
16
|
+
* <Button as="a" href="/list">목록으로</Button>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const Button: import('react').ForwardRefExoticComponent<(ButtonBaseProps | ButtonLinkProps) & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|