@thewrong/ui 0.2.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/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 +26 -21
- package/dist/components/action-toast/ActionToast.cjs +1 -0
- package/dist/{src/components → components}/action-toast/ActionToast.d.ts +12 -3
- package/dist/components/action-toast/ActionToast.esm.js +133 -123
- 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 +14 -14
- 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 +19 -23
- 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 +15 -15
- package/dist/components/button/Button.cjs +1 -0
- package/dist/{src/components → components}/button/Button.d.ts +2 -1
- package/dist/components/button/Button.esm.js +38 -45
- 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 +21 -21
- 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 +36 -35
- 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 +11 -11
- package/dist/components/collapsible/Collapsible.cjs +1 -0
- package/dist/components/collapsible/Collapsible.esm.js +12 -11
- 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 +24 -23
- 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 +99 -147
- 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 +117 -166
- 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 +68 -112
- package/dist/components/drawer/Drawer.cjs +1 -0
- package/dist/components/drawer/Drawer.d.ts +45 -0
- package/dist/components/drawer/Drawer.esm.js +127 -97
- 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/components/info-tooltip/InfoTooltip.esm.js +13 -12
- 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 +47 -53
- 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 +1 -1
- 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 +16 -5
- 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 +19 -18
- package/dist/components/loading-spinner/LoadingSpinner.cjs +1 -0
- package/dist/components/loading-spinner/LoadingSpinner.esm.js +19 -18
- 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 +28 -2
- package/dist/components/modal/Modal.esm.js +148 -118
- 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 +65 -45
- 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 +18 -15
- 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 +11 -10
- package/dist/components/page-title/index.d.ts +1 -0
- package/dist/components/popover/Popover.cjs +1 -0
- package/dist/components/popover/Popover.esm.js +2 -2
- 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 +14 -13
- 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 +94 -93
- package/dist/components/search-box/SearchBoxChips.cjs +1 -0
- package/dist/components/search-box/SearchBoxChips.esm.js +3 -3
- 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 +39 -36
- 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 +29 -27
- 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/SearchBoxFloatingInput.cjs +1 -0
- package/dist/components/search-box/SearchBoxFloatingInput.esm.js +29 -24
- 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 +56 -51
- package/dist/components/search-box/SearchBoxMonth.cjs +1 -0
- package/dist/components/search-box/SearchBoxMonth.esm.js +21 -20
- 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 +60 -55
- package/dist/components/search-box/dateRangePresets.cjs +1 -0
- package/dist/{src/components → components}/search-box/dateRangePresets.d.ts +1 -1
- package/dist/{src/components → components}/search-box/index.d.ts +5 -5
- package/dist/components/search-box/parseSearchValues.cjs +1 -0
- package/dist/{src/components → components}/search-box/parseSearchValues.d.ts +2 -2
- 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/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 +179 -177
- 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 +176 -164
- 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 +8 -7
- 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 +21 -20
- 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 +9 -8
- 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 +204 -204
- package/dist/{src/components → components}/table/column-group-utils.d.ts +1 -1
- 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 +60 -59
- 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 +94 -96
- package/dist/components/table/components/KeyboardNavButton.cjs +1 -0
- package/dist/components/table/components/KeyboardNavButton.esm.js +1 -1
- package/dist/components/table/components/PageJumpInput.cjs +1 -0
- package/dist/components/table/components/PageJumpInput.esm.js +33 -32
- package/dist/components/table/components/Pagination.cjs +1 -0
- package/dist/components/table/components/Pagination.esm.js +80 -79
- package/dist/components/table/components/PaginationFooter.cjs +1 -0
- package/dist/components/table/components/PaginationFooter.esm.js +2 -2
- 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/useColumnResize.cjs +1 -0
- package/dist/{src/components → components}/table/hooks/useColumnResize.d.ts +12 -0
- package/dist/components/table/hooks/useColumnResize.esm.js +66 -54
- 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/useTableDragSelection.d.ts +2 -0
- package/dist/{src/components → components}/table/hooks/useTableSort.d.ts +1 -1
- package/dist/components/table/hooks/useVirtualTable.cjs +1 -0
- package/dist/components/table/hooks/useVirtualTable.esm.js +8 -8
- 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 +87 -86
- 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-table.cjs +1 -0
- package/dist/{src/components → components}/table/paginated-table.d.ts +1 -1
- 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 +190 -189
- 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 +2 -2
- package/dist/components/table-checkbox/TableCheckbox.cjs +1 -0
- package/dist/components/table-checkbox/TableCheckbox.esm.js +27 -26
- 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 +3 -3
- 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 +49 -47
- 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 +47 -43
- package/dist/components/toast/index.d.ts +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 +99 -98
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/tooltip/{Tooltip.cjs.js → Tooltip.cjs} +1 -1
- package/dist/components/tooltip/Tooltip.esm.js +1 -1
- 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/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/useTableDragSelection.cjs +1 -0
- package/dist/{src/components/table/hooks → hooks}/useTableDragSelection.d.ts +3 -4
- package/dist/{components/table/hooks → hooks}/useTableDragSelection.esm.js +9 -6
- 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 -5
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.esm.js +81 -58
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/utils.cjs +1 -0
- package/dist/{src/lib → lib}/utils.d.ts +2 -1
- package/dist/lib/utils.esm.js +108 -5
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -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-left.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +1 -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-right.cjs +1 -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-x.cjs +1 -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.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-vertical.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/keyboard.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/list-filter.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minus.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/save.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/search.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.esm.js +559 -550
- package/dist/tokens.css +1085 -0
- package/dist/ui.css +1 -1
- package/llms.txt +39 -13
- package/package.json +11 -8
- package/dist/components/_shared/form-size-tokens.cjs.js +0 -1
- package/dist/components/action-toast/ActionToast.cjs.js +0 -1
- package/dist/components/animated-height/AnimatedHeight.cjs.js +0 -1
- package/dist/components/badge/Badge.cjs.js +0 -1
- package/dist/components/badge/utils.cjs.js +0 -1
- package/dist/components/button/Button.cjs.js +0 -1
- package/dist/components/button/utils.cjs.js +0 -1
- package/dist/components/checkbox/Checkbox.cjs.js +0 -1
- package/dist/components/checkbox/utils.cjs.js +0 -1
- package/dist/components/collapsible/Collapsible.cjs.js +0 -1
- package/dist/components/date-input/DateInput.cjs.js +0 -1
- package/dist/components/date-picker/date-picker.cjs.js +0 -1
- package/dist/components/date-picker/date-range-picker.cjs.js +0 -1
- package/dist/components/date-picker/month-picker.cjs.js +0 -1
- package/dist/components/drawer/Drawer.cjs.js +0 -1
- package/dist/components/info-tooltip/InfoTooltip.cjs.js +0 -1
- package/dist/components/input/Input.cjs.js +0 -1
- package/dist/components/input/PasswordInput.cjs.js +0 -1
- package/dist/components/input/format.cjs.js +0 -1
- package/dist/components/input/utils.cjs.js +0 -1
- package/dist/components/loading-spinner/LoadingSpinner.cjs.js +0 -1
- package/dist/components/modal/Modal.cjs.js +0 -1
- package/dist/components/modal/ModalSubView.cjs.js +0 -1
- package/dist/components/modal/StandardModal.cjs.js +0 -1
- package/dist/components/page-title/PageTitle.cjs.js +0 -1
- package/dist/components/popover/Popover.cjs.js +0 -1
- package/dist/components/search-box/ExactMatchToggle.cjs.js +0 -1
- package/dist/components/search-box/SearchBox.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxChips.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxDateRange.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxDateSingle.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxField.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxFloatingInput.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxFloatingSelect.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxMonth.cjs.js +0 -1
- package/dist/components/search-box/SearchBoxMultiSelect.cjs.js +0 -1
- package/dist/components/search-box/dateRangePresets.cjs.js +0 -1
- package/dist/components/search-box/parseSearchValues.cjs.js +0 -1
- package/dist/components/search-box/useSearchBoxState.cjs.js +0 -1
- package/dist/components/select/MultiSelect.cjs.js +0 -1
- package/dist/components/select/Select.cjs.js +0 -1
- package/dist/components/select/loading-dots.cjs.js +0 -1
- package/dist/components/switch/Switch.cjs.js +0 -1
- package/dist/components/switch/utils.cjs.js +0 -1
- package/dist/components/table/accordion-table.cjs.js +0 -1
- package/dist/components/table/components/ColumnPresetSelector.cjs.js +0 -1
- package/dist/components/table/components/ColumnSettingsTable.cjs.js +0 -4
- package/dist/components/table/components/KeyboardNavButton.cjs.js +0 -1
- package/dist/components/table/components/PageJumpInput.cjs.js +0 -1
- package/dist/components/table/components/Pagination.cjs.js +0 -1
- package/dist/components/table/components/PaginationFooter.cjs.js +0 -1
- package/dist/components/table/hooks/useColumnPresets.cjs.js +0 -1
- package/dist/components/table/hooks/useColumnResize.cjs.js +0 -1
- package/dist/components/table/hooks/useFillEmptyRows.cjs.js +0 -1
- package/dist/components/table/hooks/useFillEmptyRows.esm.js +0 -49
- package/dist/components/table/hooks/useInfiniteScroll.cjs.js +0 -1
- package/dist/components/table/hooks/useInfiniteScroll.esm.js +0 -32
- package/dist/components/table/hooks/useTableColumnState.cjs.js +0 -1
- package/dist/components/table/hooks/useTableDragSelection.cjs.js +0 -1
- package/dist/components/table/hooks/useVirtualTable.cjs.js +0 -1
- package/dist/components/table/mini-table.cjs.js +0 -1
- package/dist/components/table/paginated-mini-table.cjs.js +0 -1
- package/dist/components/table/paginated-table.cjs.js +0 -1
- package/dist/components/table/table.cjs.js +0 -1
- package/dist/components/table/utils.cjs.js +0 -37
- package/dist/components/table-checkbox/TableCheckbox.cjs.js +0 -1
- package/dist/components/table-page-layout/TablePageLayout.cjs.js +0 -1
- package/dist/components/textarea/Textarea.cjs.js +0 -1
- package/dist/components/toast/ToastProvider.cjs.js +0 -1
- package/dist/components/toolbar/Toolbar.cjs.js +0 -1
- package/dist/hooks.cjs.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/lib/utils.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-left.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-right.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/eye.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-vertical.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/keyboard.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/list-filter.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/minus.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/save.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/search.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs.js +0 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.js +0 -1
- 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/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 -23
- 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/_virtual/_rolldown/{runtime.cjs.js → runtime.cjs} +0 -0
- /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}/info-tooltip/InfoTooltip.d.ts +0 -0
- /package/dist/{src/components → components}/loading-spinner/LoadingSpinner.d.ts +0 -0
- /package/dist/{src/components → components}/page-title/PageTitle.d.ts +0 -0
- /package/dist/{src/components → components}/popover/Popover.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/components/search-box/{SearchBoxSheetContext.cjs.js → SearchBoxSheetContext.cjs} +0 -0
- /package/dist/{src/components → components}/search-box/SearchBoxSheetContext.d.ts +0 -0
- /package/dist/components/search-box/{parseDateRange.cjs.js → parseDateRange.cjs} +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/components/table/{column-group-utils.cjs.js → column-group-utils.cjs} +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/components/table/components/{SortableHeaderCell.cjs.js → SortableHeaderCell.cjs} +0 -0
- /package/dist/{src/components → components}/table/components/SortableHeaderCell.d.ts +0 -0
- /package/dist/components/table/hooks/{useTableSort.cjs.js → useTableSort.cjs} +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/components → components}/tooltip/Tooltip.d.ts +0 -0
- /package/dist/hooks/{useBottomSheetDrag.cjs.js → useBottomSheetDrag.cjs} +0 -0
- /package/dist/{src/hooks → hooks}/useBottomSheetDrag.d.ts +0 -0
- /package/dist/hooks/{useClickOutside.cjs.js → useClickOutside.cjs} +0 -0
- /package/dist/{src/hooks → hooks}/useClickOutside.d.ts +0 -0
- /package/dist/hooks/{useMediaQuery.cjs.js → useMediaQuery.cjs} +0 -0
- /package/dist/{src/hooks → hooks}/useMediaQuery.d.ts +0 -0
- /package/dist/hooks/{useScrollLock.cjs.js → useScrollLock.cjs} +0 -0
- /package/dist/{src/hooks → hooks}/useScrollLock.d.ts +0 -0
- /package/dist/lib/{Portal.cjs.js → Portal.cjs} +0 -0
- /package/dist/{src/lib → lib}/Portal.d.ts +0 -0
- /package/dist/lib/{column-preset-storage.cjs.js → column-preset-storage.cjs} +0 -0
- /package/dist/{src/lib → lib}/column-preset-storage.d.ts +0 -0
- /package/dist/lib/{overlay-stack.cjs.js → overlay-stack.cjs} +0 -0
- /package/dist/{src/lib → lib}/overlay-stack.d.ts +0 -0
- /package/dist/node_modules/clsx/dist/{clsx.cjs.js → clsx.cjs} +0 -0
- /package/dist/node_modules/lucide-react/dist/esm/{context.cjs.js → context.cjs} +0 -0
- /package/dist/node_modules/lucide-react/dist/esm/{defaultAttributes.cjs.js → defaultAttributes.cjs} +0 -0
- /package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/{hasA11yProp.cjs.js → hasA11yProp.cjs} +0 -0
- /package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/{mergeClasses.cjs.js → mergeClasses.cjs} +0 -0
- /package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/{toCamelCase.cjs.js → toCamelCase.cjs} +0 -0
- /package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/{toKebabCase.cjs.js → toKebabCase.cjs} +0 -0
- /package/dist/node_modules/use-debounce/dist/{index.module.cjs.js → index.module.cjs} +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={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>;
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
//#region src/components/_shared/form-size-tokens.ts
|
|
2
2
|
var e = {
|
|
3
|
-
mini: "
|
|
4
|
-
small: "
|
|
5
|
-
medium: "
|
|
6
|
-
large: "
|
|
3
|
+
mini: "text-control-mini",
|
|
4
|
+
small: "text-control-small",
|
|
5
|
+
medium: "text-control-medium",
|
|
6
|
+
large: "text-control-large"
|
|
7
7
|
}, t = {
|
|
8
|
-
mini: "h-
|
|
9
|
-
small: "h-
|
|
10
|
-
medium: "h-
|
|
11
|
-
large: "h-
|
|
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
12
|
}, n = {
|
|
13
|
-
mini: "
|
|
14
|
-
small: "
|
|
15
|
-
medium: "
|
|
16
|
-
large: "
|
|
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
17
|
}, r = {
|
|
18
|
-
mini: "
|
|
19
|
-
small: "
|
|
20
|
-
medium: "
|
|
21
|
-
large: "
|
|
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
22
|
}, i = {
|
|
23
|
-
mini: "
|
|
24
|
-
small: "
|
|
25
|
-
medium: "
|
|
26
|
-
large: "
|
|
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"
|
|
27
32
|
};
|
|
28
33
|
//#endregion
|
|
29
|
-
export {
|
|
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
|
/**
|
|
@@ -46,7 +55,7 @@ interface ShowActionToastArgs {
|
|
|
46
55
|
className?: string;
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
49
|
-
* 사용자 결정이 필요한 액션 토스트. 자동
|
|
58
|
+
* 사용자 결정이 필요한 액션 토스트. 기본적으로 자동 닫힘이 없으며, `duration`을 지정하면 해당 시간이 지난 뒤 닫힌다.
|
|
50
59
|
* 위치는 전역 Toaster를 따름(데스크탑=bottom-center, 모바일=top-center).
|
|
51
60
|
* 한 번에 최대 1개만 노출(같은 id로 덮어쓰기).
|
|
52
61
|
*
|
|
@@ -55,7 +64,7 @@ interface ShowActionToastArgs {
|
|
|
55
64
|
*
|
|
56
65
|
* 사용 전 앱 루트에 `react-hot-toast`의 `<Toaster />`가 마운트돼 있어야 한다.
|
|
57
66
|
*/
|
|
58
|
-
export declare function showActionToast({ message, actions, tone, icon, input, widthPx, backdrop, className, }: ShowActionToastArgs): string;
|
|
67
|
+
export declare function showActionToast({ message, actions, tone, icon, input, duration, widthPx, backdrop, className, }: ShowActionToastArgs): string;
|
|
59
68
|
export declare function dismissActionToast(): void;
|
|
60
69
|
export declare function isActionToastActive(): boolean;
|
|
61
70
|
export {};
|
|
@@ -1,130 +1,139 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
8
|
import { useIsMobile as s } from "../../hooks/useMediaQuery.esm.js";
|
|
9
9
|
import { ACTION_TOAST_OVERLAY_ID as c, ACTION_TOAST_PRIORITY as l, overlayStack as u } from "../../lib/overlay-stack.esm.js";
|
|
10
10
|
import { useEffect as d, useRef as f, useState as p } from "react";
|
|
11
11
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
-
import { motion as _ } from "motion/react";
|
|
13
|
-
import
|
|
14
|
-
import { createPortal as
|
|
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
15
|
//#region src/components/action-toast/ActionToast.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
|
|
16
|
+
var x = "action-toast-singleton";
|
|
17
|
+
function S(e) {
|
|
18
|
+
C = e, e ? u.push(c, l) : u.pop(c);
|
|
19
19
|
}
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
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,
|
|
24
26
|
message: e,
|
|
25
27
|
actions: t,
|
|
26
28
|
tone: n,
|
|
27
29
|
icon: r,
|
|
28
30
|
input: i,
|
|
29
|
-
widthPx:
|
|
30
|
-
backdrop:
|
|
31
|
-
className:
|
|
31
|
+
widthPx: o,
|
|
32
|
+
backdrop: s,
|
|
33
|
+
className: c
|
|
32
34
|
}), {
|
|
33
|
-
id:
|
|
34
|
-
duration:
|
|
35
|
+
id: x,
|
|
36
|
+
duration: a
|
|
35
37
|
});
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
+
function E() {
|
|
40
|
+
y.dismiss(x), S(!1);
|
|
39
41
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
42
|
+
function D() {
|
|
43
|
+
return C;
|
|
42
44
|
}
|
|
43
|
-
function
|
|
44
|
-
if (e === "tertiary") return "
|
|
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";
|
|
45
47
|
}
|
|
46
|
-
var
|
|
47
|
-
warning: "text-
|
|
48
|
-
info: "text-
|
|
49
|
-
danger: "text-
|
|
48
|
+
var k = {
|
|
49
|
+
warning: "text-toast-tone-warning",
|
|
50
|
+
info: "text-toast-tone-info",
|
|
51
|
+
danger: "text-toast-tone-danger"
|
|
50
52
|
};
|
|
51
|
-
function
|
|
52
|
-
let
|
|
53
|
-
return h(
|
|
54
|
-
className:
|
|
53
|
+
function A(t, n) {
|
|
54
|
+
let a = e(n, "shrink-0", k[t]);
|
|
55
|
+
return h(t === "info" ? r : i, {
|
|
56
|
+
className: a,
|
|
55
57
|
strokeWidth: 2,
|
|
56
58
|
"aria-hidden": !0
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
|
-
function
|
|
60
|
-
let
|
|
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);
|
|
61
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(() => {
|
|
62
70
|
let e = (e) => {
|
|
63
|
-
e.key === "Escape" && u.isTop("action-toast-overlay") && (
|
|
71
|
+
e.key === "Escape" && u.isTop("action-toast-overlay") && (y.dismiss(r.id), S(!1));
|
|
64
72
|
};
|
|
65
73
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
66
|
-
}, [
|
|
67
|
-
let
|
|
74
|
+
}, [r.id]);
|
|
75
|
+
let W = f(null), [G, K] = p(!1);
|
|
68
76
|
d(() => {
|
|
69
|
-
let e =
|
|
77
|
+
let e = W.current;
|
|
70
78
|
if (!e) return;
|
|
71
79
|
let t = () => {
|
|
72
80
|
let t = window.getComputedStyle(e), n = parseFloat(t.lineHeight);
|
|
73
|
-
!Number.isFinite(n) || n <= 0 ||
|
|
81
|
+
!Number.isFinite(n) || n <= 0 || K(e.scrollHeight > n + 1.5);
|
|
74
82
|
};
|
|
75
83
|
t();
|
|
76
84
|
let n = new ResizeObserver(t);
|
|
77
85
|
return n.observe(e), () => n.disconnect();
|
|
78
|
-
}, [
|
|
79
|
-
let
|
|
86
|
+
}, [c]);
|
|
87
|
+
let q = j && G && !T;
|
|
80
88
|
d(() => {
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
let
|
|
84
|
-
(e.closeOnClick ?? !0) && (
|
|
85
|
-
},
|
|
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", {
|
|
86
94
|
type: "button",
|
|
87
95
|
onClick: () => {
|
|
88
|
-
|
|
96
|
+
y.dismiss(r.id), S(!1);
|
|
89
97
|
},
|
|
90
|
-
className: "ml-1 shrink-0 text-
|
|
98
|
+
className: "ml-1 shrink-0 text-fg-toast-muted hover:text-fg-toast-hover transition-colors cursor-pointer",
|
|
91
99
|
"aria-label": "닫기",
|
|
92
|
-
children: /* @__PURE__ */ h(
|
|
93
|
-
className:
|
|
100
|
+
children: /* @__PURE__ */ h(n, {
|
|
101
|
+
className: N,
|
|
94
102
|
fill: "currentColor",
|
|
95
|
-
stroke: "var(--color-
|
|
103
|
+
stroke: "var(--color-bg-toast)",
|
|
96
104
|
strokeWidth: 2
|
|
97
105
|
})
|
|
98
|
-
}),
|
|
99
|
-
className:
|
|
100
|
-
children:
|
|
101
|
-
variant:
|
|
102
|
-
appearance:
|
|
103
|
-
size:
|
|
104
|
-
leadingIcon:
|
|
105
|
-
trailingIcon:
|
|
106
|
-
|
|
107
|
-
|
|
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),
|
|
108
117
|
tabIndex: n ? -1 : void 0,
|
|
109
|
-
className: n ? void 0 :
|
|
110
|
-
children:
|
|
118
|
+
className: n ? void 0 : O(e.variant),
|
|
119
|
+
children: e.label
|
|
111
120
|
}, r))
|
|
112
121
|
});
|
|
113
|
-
return /* @__PURE__ */ g(m, { children: [
|
|
114
|
-
initial: { opacity: 0 },
|
|
115
|
-
animate: { opacity: +!!
|
|
116
|
-
transition: { duration: .18 },
|
|
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 },
|
|
117
126
|
onClick: () => {
|
|
118
|
-
|
|
127
|
+
y.dismiss(r.id), S(!1);
|
|
119
128
|
},
|
|
120
|
-
className:
|
|
129
|
+
className: e("fixed inset-0 z-toast-backdrop bg-bg-toast-backdrop", !r.visible && "pointer-events-none"),
|
|
121
130
|
"aria-hidden": !0
|
|
122
131
|
}), document.body), /* @__PURE__ */ h(_.div, {
|
|
123
|
-
initial: {
|
|
132
|
+
initial: M ? !1 : {
|
|
124
133
|
opacity: 0,
|
|
125
134
|
scale: .98
|
|
126
135
|
},
|
|
127
|
-
animate:
|
|
136
|
+
animate: r.visible ? {
|
|
128
137
|
opacity: 1,
|
|
129
138
|
scale: 1
|
|
130
139
|
} : {
|
|
@@ -132,7 +141,7 @@ function k({ toastInstance: n, message: r, actions: c, tone: l, icon: b, input:
|
|
|
132
141
|
scale: .98
|
|
133
142
|
},
|
|
134
143
|
transition: {
|
|
135
|
-
duration: .22,
|
|
144
|
+
duration: M ? 0 : .22,
|
|
136
145
|
ease: [
|
|
137
146
|
.16,
|
|
138
147
|
1,
|
|
@@ -140,89 +149,90 @@ function k({ toastInstance: n, message: r, actions: c, tone: l, icon: b, input:
|
|
|
140
149
|
1
|
|
141
150
|
]
|
|
142
151
|
},
|
|
143
|
-
className:
|
|
144
|
-
style: { width: `min(${
|
|
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))` },
|
|
145
154
|
role: "alertdialog",
|
|
146
|
-
"
|
|
155
|
+
"data-ui-action-toast": "",
|
|
156
|
+
"aria-modal": D ? "true" : void 0,
|
|
147
157
|
"aria-label": "확인이 필요한 알림",
|
|
148
|
-
children:
|
|
149
|
-
className: `flex flex-col gap-2.5 ${
|
|
158
|
+
children: T ? /* @__PURE__ */ g("div", {
|
|
159
|
+
className: `flex flex-col gap-2.5 ${L}`,
|
|
150
160
|
children: [
|
|
151
161
|
/* @__PURE__ */ g("div", {
|
|
152
|
-
className: `flex items-start ${
|
|
162
|
+
className: `flex items-start ${R}`,
|
|
153
163
|
children: [
|
|
154
|
-
|
|
164
|
+
z,
|
|
155
165
|
/* @__PURE__ */ h("div", {
|
|
156
|
-
className: `min-w-0 flex-1 ${
|
|
157
|
-
children:
|
|
166
|
+
className: `min-w-0 flex-1 ${P} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
|
|
167
|
+
children: c
|
|
158
168
|
}),
|
|
159
|
-
|
|
169
|
+
Y
|
|
160
170
|
]
|
|
161
171
|
}),
|
|
162
|
-
|
|
172
|
+
T.type === "text" ? /* @__PURE__ */ h(a, {
|
|
173
|
+
ref: H,
|
|
163
174
|
variant: "box",
|
|
164
|
-
inputSize:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
onChange: (e) => L(e.target.value),
|
|
175
|
+
inputSize: j ? "mini" : "small",
|
|
176
|
+
value: B,
|
|
177
|
+
onChange: (e) => V(e.target.value),
|
|
168
178
|
onKeyDown: (e) => {
|
|
169
179
|
if (e.key !== "Enter" || e.nativeEvent.isComposing) return;
|
|
170
|
-
let t =
|
|
171
|
-
!t || t.disabled || (e.preventDefault(),
|
|
180
|
+
let t = l[l.length - 1];
|
|
181
|
+
!t || t.disabled || (e.preventDefault(), J(t));
|
|
172
182
|
},
|
|
173
|
-
placeholder:
|
|
174
|
-
}) : /* @__PURE__ */ h(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
value:
|
|
179
|
-
onChange: (e) =>
|
|
180
|
-
placeholder:
|
|
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
|
|
181
191
|
}),
|
|
182
|
-
|
|
192
|
+
X("flex justify-end gap-1.5")
|
|
183
193
|
]
|
|
184
194
|
}) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
|
|
185
195
|
"aria-hidden": !0,
|
|
186
|
-
className: `invisible pointer-events-none absolute inset-0 flex items-center ${
|
|
196
|
+
className: `invisible pointer-events-none absolute inset-0 flex items-center ${R} ${I}`,
|
|
187
197
|
children: [
|
|
188
|
-
/* @__PURE__ */ h("span", { className: `${
|
|
198
|
+
/* @__PURE__ */ h("span", { className: `${N} shrink-0` }),
|
|
189
199
|
/* @__PURE__ */ h("div", {
|
|
190
|
-
ref:
|
|
191
|
-
className: `min-w-0 flex-1 ${
|
|
192
|
-
children:
|
|
200
|
+
ref: W,
|
|
201
|
+
className: `min-w-0 flex-1 ${P} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
|
|
202
|
+
children: c
|
|
193
203
|
}),
|
|
194
|
-
|
|
204
|
+
X("flex shrink-0 gap-1.5", !0)
|
|
195
205
|
]
|
|
196
|
-
}),
|
|
197
|
-
className: `relative flex flex-col ${
|
|
206
|
+
}), q ? /* @__PURE__ */ g("div", {
|
|
207
|
+
className: `relative flex flex-col ${R} ${L}`,
|
|
198
208
|
children: [
|
|
199
|
-
|
|
209
|
+
Y && /* @__PURE__ */ h("div", {
|
|
200
210
|
className: "absolute right-3 top-3",
|
|
201
|
-
children:
|
|
211
|
+
children: Y
|
|
202
212
|
}),
|
|
203
213
|
/* @__PURE__ */ h("div", {
|
|
204
214
|
className: "flex justify-center",
|
|
205
|
-
children:
|
|
215
|
+
children: z
|
|
206
216
|
}),
|
|
207
217
|
/* @__PURE__ */ h("div", {
|
|
208
|
-
className: `${
|
|
209
|
-
children:
|
|
218
|
+
className: `${P} leading-relaxed text-center whitespace-pre-line break-keep wrap-break-word`,
|
|
219
|
+
children: c
|
|
210
220
|
}),
|
|
211
|
-
|
|
221
|
+
X("flex justify-end gap-1.5")
|
|
212
222
|
]
|
|
213
223
|
}) : /* @__PURE__ */ g("div", {
|
|
214
|
-
className: `flex items-center ${
|
|
224
|
+
className: `flex items-center ${R} ${I}`,
|
|
215
225
|
children: [
|
|
216
|
-
|
|
226
|
+
z,
|
|
217
227
|
/* @__PURE__ */ h("div", {
|
|
218
|
-
className: `min-w-0 flex-1 ${
|
|
219
|
-
children:
|
|
228
|
+
className: `min-w-0 flex-1 ${P} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
|
|
229
|
+
children: c
|
|
220
230
|
}),
|
|
221
|
-
|
|
222
|
-
|
|
231
|
+
X("flex shrink-0 gap-1.5"),
|
|
232
|
+
Y
|
|
223
233
|
]
|
|
224
234
|
})] })
|
|
225
235
|
})] });
|
|
226
236
|
}
|
|
227
237
|
//#endregion
|
|
228
|
-
export {
|
|
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;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { motion as i } from "motion/react";
|
|
3
|
+
import { motion as i, useReducedMotion as a } from "motion/react";
|
|
4
4
|
//#region src/components/animated-height/AnimatedHeight.tsx
|
|
5
|
-
function
|
|
5
|
+
function o({ children: o, durationMs: s = 220, ease: c = [
|
|
6
6
|
.16,
|
|
7
7
|
1,
|
|
8
8
|
.3,
|
|
9
9
|
1
|
|
10
|
-
], className:
|
|
11
|
-
let
|
|
10
|
+
], className: l = "" }) {
|
|
11
|
+
let u = a(), d = t(null), [f, p] = n("auto"), m = t(!0), [h, g] = n(!1);
|
|
12
12
|
return e(() => {
|
|
13
|
-
let e =
|
|
13
|
+
let e = d.current;
|
|
14
14
|
if (!e) return;
|
|
15
15
|
let t = new ResizeObserver(([e]) => {
|
|
16
16
|
if (!e) return;
|
|
17
17
|
let t = e.contentRect.height;
|
|
18
|
-
|
|
18
|
+
p(t), m.current && (m.current = !1, requestAnimationFrame(() => g(!0)));
|
|
19
19
|
});
|
|
20
20
|
return t.observe(e), () => t.disconnect();
|
|
21
21
|
}, []), /* @__PURE__ */ r(i.div, {
|
|
22
|
-
animate: { height:
|
|
23
|
-
transition:
|
|
24
|
-
duration:
|
|
25
|
-
ease:
|
|
22
|
+
animate: { height: f },
|
|
23
|
+
transition: h && !u ? {
|
|
24
|
+
duration: s / 1e3,
|
|
25
|
+
ease: c
|
|
26
26
|
} : { duration: 0 },
|
|
27
27
|
style: { overflow: "hidden" },
|
|
28
|
-
className:
|
|
28
|
+
className: l,
|
|
29
29
|
children: /* @__PURE__ */ r("div", {
|
|
30
|
-
ref:
|
|
31
|
-
children:
|
|
30
|
+
ref: d,
|
|
31
|
+
children: o
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
//#endregion
|
|
36
|
-
export {
|
|
36
|
+
export { o as AnimatedHeight };
|