@thewrong/ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs.js +1 -0
- package/dist/components/_shared/form-size-tokens.cjs.js +1 -0
- package/dist/components/_shared/form-size-tokens.esm.js +29 -0
- package/dist/components/action-toast/ActionToast.cjs.js +1 -0
- package/dist/components/action-toast/ActionToast.esm.js +228 -0
- package/dist/components/animated-height/AnimatedHeight.cjs.js +1 -0
- package/dist/components/animated-height/AnimatedHeight.esm.js +36 -0
- package/dist/components/badge/Badge.cjs.js +1 -0
- package/dist/components/badge/Badge.esm.js +30 -0
- package/dist/components/badge/utils.cjs.js +1 -0
- package/dist/components/badge/utils.esm.js +38 -0
- package/dist/components/button/Button.cjs.js +1 -0
- package/dist/components/button/Button.esm.js +84 -0
- package/dist/components/button/utils.cjs.js +1 -0
- package/dist/components/button/utils.esm.js +38 -0
- package/dist/components/checkbox/Checkbox.cjs.js +1 -0
- package/dist/components/checkbox/Checkbox.esm.js +68 -0
- package/dist/components/checkbox/utils.cjs.js +1 -0
- package/dist/components/checkbox/utils.esm.js +44 -0
- package/dist/components/collapsible/Collapsible.cjs.js +1 -0
- package/dist/components/collapsible/Collapsible.esm.js +19 -0
- package/dist/components/date-input/DateInput.cjs.js +1 -0
- package/dist/components/date-input/DateInput.esm.js +39 -0
- package/dist/components/date-picker/date-picker.cjs.js +1 -0
- package/dist/components/date-picker/date-picker.esm.js +231 -0
- package/dist/components/date-picker/date-range-picker.cjs.js +1 -0
- package/dist/components/date-picker/date-range-picker.esm.js +287 -0
- package/dist/components/date-picker/month-picker.cjs.js +1 -0
- package/dist/components/date-picker/month-picker.esm.js +147 -0
- package/dist/components/drawer/Drawer.cjs.js +1 -0
- package/dist/components/drawer/Drawer.esm.js +113 -0
- package/dist/components/info-tooltip/InfoTooltip.cjs.js +1 -0
- package/dist/components/info-tooltip/InfoTooltip.esm.js +24 -0
- package/dist/components/input/Input.cjs.js +1 -0
- package/dist/components/input/Input.esm.js +95 -0
- package/dist/components/input/PasswordInput.cjs.js +1 -0
- package/dist/components/input/PasswordInput.esm.js +29 -0
- package/dist/components/input/format.cjs.js +1 -0
- package/dist/components/input/format.esm.js +33 -0
- package/dist/components/input/utils.cjs.js +1 -0
- package/dist/components/input/utils.esm.js +23 -0
- package/dist/components/loading-spinner/LoadingSpinner.cjs.js +1 -0
- package/dist/components/loading-spinner/LoadingSpinner.esm.js +47 -0
- package/dist/components/modal/Modal.cjs.js +1 -0
- package/dist/components/modal/Modal.esm.js +137 -0
- package/dist/components/modal/ModalSubView.cjs.js +1 -0
- package/dist/components/modal/ModalSubView.esm.js +91 -0
- package/dist/components/modal/StandardModal.cjs.js +1 -0
- package/dist/components/modal/StandardModal.esm.js +54 -0
- package/dist/components/page-title/PageTitle.cjs.js +1 -0
- package/dist/components/page-title/PageTitle.esm.js +16 -0
- package/dist/components/popover/Popover.cjs.js +1 -0
- package/dist/components/popover/Popover.esm.js +57 -0
- package/dist/components/search-box/ExactMatchToggle.cjs.js +1 -0
- package/dist/components/search-box/ExactMatchToggle.esm.js +27 -0
- package/dist/components/search-box/SearchBox.cjs.js +1 -0
- package/dist/components/search-box/SearchBox.esm.js +154 -0
- package/dist/components/search-box/SearchBoxChips.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxChips.esm.js +36 -0
- package/dist/components/search-box/SearchBoxDateRange.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxDateRange.esm.js +57 -0
- package/dist/components/search-box/SearchBoxDateSingle.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxDateSingle.esm.js +37 -0
- package/dist/components/search-box/SearchBoxField.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxField.esm.js +48 -0
- package/dist/components/search-box/SearchBoxFloatingInput.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxFloatingInput.esm.js +38 -0
- package/dist/components/search-box/SearchBoxFloatingSelect.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxFloatingSelect.esm.js +74 -0
- package/dist/components/search-box/SearchBoxMonth.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxMonth.esm.js +35 -0
- package/dist/components/search-box/SearchBoxMultiSelect.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxMultiSelect.esm.js +78 -0
- package/dist/components/search-box/SearchBoxSheetContext.cjs.js +1 -0
- package/dist/components/search-box/SearchBoxSheetContext.esm.js +5 -0
- package/dist/components/search-box/dateRangePresets.cjs.js +1 -0
- package/dist/components/search-box/dateRangePresets.esm.js +59 -0
- package/dist/components/search-box/parseDateRange.cjs.js +1 -0
- package/dist/components/search-box/parseDateRange.esm.js +21 -0
- package/dist/components/search-box/parseSearchValues.cjs.js +1 -0
- package/dist/components/search-box/parseSearchValues.esm.js +15 -0
- package/dist/components/search-box/useSearchBoxState.cjs.js +1 -0
- package/dist/components/search-box/useSearchBoxState.esm.js +87 -0
- package/dist/components/select/MultiSelect.cjs.js +1 -0
- package/dist/components/select/MultiSelect.esm.js +277 -0
- package/dist/components/select/Select.cjs.js +1 -0
- package/dist/components/select/Select.esm.js +308 -0
- package/dist/components/select/loading-dots.cjs.js +1 -0
- package/dist/components/select/loading-dots.esm.js +23 -0
- package/dist/components/switch/Switch.cjs.js +1 -0
- package/dist/components/switch/Switch.esm.js +36 -0
- package/dist/components/switch/utils.cjs.js +1 -0
- package/dist/components/switch/utils.esm.js +39 -0
- package/dist/components/table/accordion-table.cjs.js +1 -0
- package/dist/components/table/accordion-table.esm.js +418 -0
- package/dist/components/table/column-group-utils.cjs.js +1 -0
- package/dist/components/table/column-group-utils.esm.js +53 -0
- package/dist/components/table/components/ColumnPresetSelector.cjs.js +1 -0
- package/dist/components/table/components/ColumnPresetSelector.esm.js +165 -0
- package/dist/components/table/components/ColumnSettingsTable.cjs.js +4 -0
- package/dist/components/table/components/ColumnSettingsTable.esm.js +196 -0
- package/dist/components/table/components/KeyboardNavButton.cjs.js +1 -0
- package/dist/components/table/components/KeyboardNavButton.esm.js +24 -0
- package/dist/components/table/components/PageJumpInput.cjs.js +1 -0
- package/dist/components/table/components/PageJumpInput.esm.js +53 -0
- package/dist/components/table/components/Pagination.cjs.js +1 -0
- package/dist/components/table/components/Pagination.esm.js +162 -0
- package/dist/components/table/components/PaginationFooter.cjs.js +1 -0
- package/dist/components/table/components/PaginationFooter.esm.js +80 -0
- package/dist/components/table/components/SortableHeaderCell.cjs.js +1 -0
- package/dist/components/table/components/SortableHeaderCell.esm.js +30 -0
- package/dist/components/table/hooks/useColumnPresets.cjs.js +1 -0
- package/dist/components/table/hooks/useColumnPresets.esm.js +165 -0
- package/dist/components/table/hooks/useColumnResize.cjs.js +1 -0
- package/dist/components/table/hooks/useColumnResize.esm.js +106 -0
- package/dist/components/table/hooks/useFillEmptyRows.cjs.js +1 -0
- package/dist/components/table/hooks/useFillEmptyRows.esm.js +49 -0
- package/dist/components/table/hooks/useInfiniteScroll.cjs.js +1 -0
- package/dist/components/table/hooks/useInfiniteScroll.esm.js +32 -0
- package/dist/components/table/hooks/useTableColumnState.cjs.js +1 -0
- package/dist/components/table/hooks/useTableColumnState.esm.js +46 -0
- package/dist/components/table/hooks/useTableDragSelection.cjs.js +1 -0
- package/dist/components/table/hooks/useTableDragSelection.esm.js +76 -0
- package/dist/components/table/hooks/useTableSort.cjs.js +1 -0
- package/dist/components/table/hooks/useTableSort.esm.js +30 -0
- package/dist/components/table/hooks/useVirtualTable.cjs.js +1 -0
- package/dist/components/table/hooks/useVirtualTable.esm.js +18 -0
- package/dist/components/table/mini-table.cjs.js +1 -0
- package/dist/components/table/mini-table.esm.js +126 -0
- package/dist/components/table/paginated-mini-table.cjs.js +1 -0
- package/dist/components/table/paginated-mini-table.esm.js +31 -0
- package/dist/components/table/paginated-table.cjs.js +1 -0
- package/dist/components/table/paginated-table.esm.js +31 -0
- package/dist/components/table/table.cjs.js +1 -0
- package/dist/components/table/table.esm.js +342 -0
- package/dist/components/table/utils.cjs.js +37 -0
- package/dist/components/table/utils.esm.js +16 -0
- package/dist/components/table-checkbox/TableCheckbox.cjs.js +1 -0
- package/dist/components/table-checkbox/TableCheckbox.esm.js +39 -0
- package/dist/components/table-page-layout/TablePageLayout.cjs.js +1 -0
- package/dist/components/table-page-layout/TablePageLayout.esm.js +37 -0
- package/dist/components/textarea/Textarea.cjs.js +1 -0
- package/dist/components/textarea/Textarea.esm.js +62 -0
- package/dist/components/toast/ToastProvider.cjs.js +1 -0
- package/dist/components/toast/ToastProvider.esm.js +82 -0
- package/dist/components/toast/index.esm.js +3 -0
- package/dist/components/toolbar/Toolbar.cjs.js +1 -0
- package/dist/components/toolbar/Toolbar.esm.js +148 -0
- package/dist/components/tooltip/Tooltip.cjs.js +1 -0
- package/dist/components/tooltip/Tooltip.esm.js +39 -0
- package/dist/hooks/useBottomSheetDrag.cjs.js +1 -0
- package/dist/hooks/useBottomSheetDrag.esm.js +17 -0
- package/dist/hooks/useClickOutside.cjs.js +1 -0
- package/dist/hooks/useClickOutside.esm.js +20 -0
- package/dist/hooks/useMediaQuery.cjs.js +1 -0
- package/dist/hooks/useMediaQuery.esm.js +15 -0
- package/dist/hooks/useScrollLock.cjs.js +1 -0
- package/dist/hooks/useScrollLock.esm.js +16 -0
- package/dist/hooks.cjs.js +1 -0
- package/dist/hooks.esm.js +5 -0
- package/dist/index.cjs.js +1 -40
- package/dist/index.esm.js +58 -0
- package/dist/lib/Portal.cjs.js +1 -0
- package/dist/lib/Portal.esm.js +11 -0
- package/dist/lib/column-preset-storage.cjs.js +1 -0
- package/dist/lib/column-preset-storage.esm.js +123 -0
- package/dist/lib/overlay-stack.cjs.js +1 -0
- package/dist/lib/overlay-stack.esm.js +28 -0
- package/dist/lib/utils.cjs.js +1 -0
- package/dist/lib/utils.esm.js +11 -0
- package/dist/node_modules/clsx/dist/clsx.cjs.js +1 -0
- package/dist/node_modules/clsx/dist/clsx.esm.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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/eye-off.cjs.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +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.js +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.esm.js +1714 -0
- package/dist/node_modules/use-debounce/dist/index.module.cjs.js +1 -0
- package/dist/node_modules/use-debounce/dist/index.module.esm.js +70 -0
- package/dist/src/components/action-toast/ActionToast.d.ts +6 -1
- package/dist/src/components/button/Button.d.ts +16 -0
- package/dist/src/components/drawer/Drawer.d.ts +6 -1
- package/dist/src/components/info-tooltip/InfoTooltip.d.ts +7 -0
- package/dist/src/components/loading-spinner/LoadingSpinner.d.ts +7 -0
- package/dist/src/components/modal/Modal.d.ts +7 -1
- package/dist/src/components/popover/Popover.d.ts +19 -1
- package/dist/src/components/tooltip/Tooltip.d.ts +10 -0
- package/dist/ui.css +1 -1
- package/llms.txt +91 -0
- package/package.json +10 -4
- package/dist/index.es.js +0 -8066
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.js"),t=require("../../node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.js"),n=require("../../lib/utils.cjs.js"),r=require("../../hooks/useMediaQuery.cjs.js"),i=require("../../hooks/useBottomSheetDrag.cjs.js"),a=require("../../hooks/useScrollLock.cjs.js");let o=require("react"),s=require("react/jsx-runtime"),c=require("motion/react"),l=require("@floating-ui/react");function u({children:e,value:t,onChange:n,disabled:u,disableMobileSheet:f=!1}){let[p,m]=(0,o.useState)(!1),h=r.useIsMobile()&&!f,{refs:g,floatingStyles:_,context:v}=(0,l.useFloating)({open:p,onOpenChange:e=>{u||m(e)},placement:`bottom-start`,whileElementsMounted:l.autoUpdate,middleware:[(0,l.offset)(8),(0,l.flip)({fallbackAxisSideDirection:`start`}),(0,l.shift)({padding:8})]}),{getReferenceProps:y,getFloatingProps:b}=(0,l.useInteractions)([(0,l.useClick)(v,{enabled:!u}),(0,l.useDismiss)(v),(0,l.useRole)(v,{role:`dialog`})]);a.useScrollLock(p&&h);let{dragControls:x,handleDragEnd:S,startDrag:C}=i.useBottomSheetDrag({onDismiss:()=>m(!1)}),w=e=>{n(e),m(!1)},T=new Date,[E,D]=(0,o.useState)(t?.year??T.getFullYear()),O=(0,s.jsx)(d,{year:E,onYearChange:D,selectedYear:t?.year,selectedMonth:t?.month,currentYear:T.getFullYear(),currentMonth:T.getMonth()+1,onSelect:e=>w({year:E,month:e})});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{ref:g.setReference,...y(),className:`inline-flex`,children:e}),(0,s.jsx)(l.FloatingPortal,{children:h?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.AnimatePresence,{children:p&&(0,s.jsx)(c.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:`fixed inset-0 z-50 bg-black/40`,onClick:()=>m(!1)},`month-picker-dimmer`)}),(0,s.jsx)(c.AnimatePresence,{children:p&&(0,s.jsxs)(c.motion.div,{ref:g.setFloating,...b(),initial:{y:`100%`},animate:{y:0},exit:{y:`100%`,transition:{duration:.2,ease:[.4,0,1,1]}},transition:{type:`spring`,damping:30,stiffness:320},drag:`y`,dragListener:!1,dragControls:x,dragConstraints:{top:0},dragElastic:{top:0,bottom:.4},onDragEnd:S,className:`fixed inset-x-0 bottom-0 z-50 flex flex-col gap-5 rounded-t-2xl bg-bg-card p-5 pb-[max(20px,env(safe-area-inset-bottom))] shadow-2xl`,children:[(0,s.jsx)(`div`,{className:`self-center h-1 w-10 rounded-full bg-bg-base-tertiary cursor-grab touch-none active:cursor-grabbing`,onPointerDown:C}),O]},`month-picker-sheet`)})]}):p&&(0,s.jsx)(`div`,{ref:g.setFloating,style:_,...b(),className:`z-9999 w-70 rounded-2xl border border-border-tertiary bg-bg-card p-5 shadow-md`,children:O})})]})}function d({year:e,onYearChange:t,selectedYear:r,selectedMonth:i,currentYear:a,currentMonth:o,onSelect:c}){let l=Array.from({length:12},(e,t)=>t+1);return(0,s.jsxs)(`div`,{className:`flex flex-col`,children:[(0,s.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,s.jsx)(f,{direction:`left`,onClick:()=>t(e-1)}),(0,s.jsxs)(`div`,{className:`flex-1 text-center text-sm font-semibold text-text-primary`,children:[e,`년`]}),(0,s.jsx)(f,{direction:`right`,onClick:()=>t(e+1)})]}),(0,s.jsx)(`div`,{className:`grid grid-cols-4 gap-2`,children:l.map(t=>{let l=r===e&&i===t;return(0,s.jsxs)(`button`,{type:`button`,onClick:()=>c(t),className:n.cn(`h-10 cursor-pointer rounded-lg text-sm transition-colors`,l?`bg-primary-500 font-bold text-white`:e===a&&t===o?`bg-bg-base-secondary font-semibold text-text-primary`:`text-text-primary hover:bg-bg-base-primary`),"aria-label":`${e}년 ${t}월`,"aria-pressed":l,children:[t,`월`]},t)})})]})}function f({direction:n,onClick:r}){return(0,s.jsx)(`button`,{type:`button`,onClick:r,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border-tertiary text-text-secondary transition-colors hover:bg-bg-base-primary`,"aria-label":n===`left`?`이전 해`:`다음 해`,children:(0,s.jsx)(n===`left`?e.ChevronLeft:t.ChevronRight,{className:`h-4 w-4`})})}exports.MonthPicker=u;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ChevronLeft as e } from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.esm.js";
|
|
2
|
+
import { ChevronRight as t } from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.esm.js";
|
|
3
|
+
import { cn as n } from "../../lib/utils.esm.js";
|
|
4
|
+
import { useIsMobile as r } from "../../hooks/useMediaQuery.esm.js";
|
|
5
|
+
import { useBottomSheetDrag as i } from "../../hooks/useBottomSheetDrag.esm.js";
|
|
6
|
+
import { useScrollLock as a } from "../../hooks/useScrollLock.esm.js";
|
|
7
|
+
import { useState as o } from "react";
|
|
8
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
import { AnimatePresence as u, motion as d } from "motion/react";
|
|
10
|
+
import { FloatingPortal as f, autoUpdate as p, flip as m, offset as h, shift as g, useClick as _, useDismiss as v, useFloating as y, useInteractions as b, useRole as x } from "@floating-ui/react";
|
|
11
|
+
//#region src/components/date-picker/month-picker.tsx
|
|
12
|
+
function S({ children: e, value: t, onChange: n, disabled: S, disableMobileSheet: w = !1 }) {
|
|
13
|
+
let [T, E] = o(!1), D = r() && !w, { refs: O, floatingStyles: k, context: A } = y({
|
|
14
|
+
open: T,
|
|
15
|
+
onOpenChange: (e) => {
|
|
16
|
+
S || E(e);
|
|
17
|
+
},
|
|
18
|
+
placement: "bottom-start",
|
|
19
|
+
whileElementsMounted: p,
|
|
20
|
+
middleware: [
|
|
21
|
+
h(8),
|
|
22
|
+
m({ fallbackAxisSideDirection: "start" }),
|
|
23
|
+
g({ padding: 8 })
|
|
24
|
+
]
|
|
25
|
+
}), { getReferenceProps: j, getFloatingProps: M } = b([
|
|
26
|
+
_(A, { enabled: !S }),
|
|
27
|
+
v(A),
|
|
28
|
+
x(A, { role: "dialog" })
|
|
29
|
+
]);
|
|
30
|
+
a(T && D);
|
|
31
|
+
let { dragControls: N, handleDragEnd: P, startDrag: F } = i({ onDismiss: () => E(!1) }), I = (e) => {
|
|
32
|
+
n(e), E(!1);
|
|
33
|
+
}, L = /* @__PURE__ */ new Date(), [R, z] = o(t?.year ?? L.getFullYear()), B = /* @__PURE__ */ c(C, {
|
|
34
|
+
year: R,
|
|
35
|
+
onYearChange: z,
|
|
36
|
+
selectedYear: t?.year,
|
|
37
|
+
selectedMonth: t?.month,
|
|
38
|
+
currentYear: L.getFullYear(),
|
|
39
|
+
currentMonth: L.getMonth() + 1,
|
|
40
|
+
onSelect: (e) => I({
|
|
41
|
+
year: R,
|
|
42
|
+
month: e
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
46
|
+
ref: O.setReference,
|
|
47
|
+
...j(),
|
|
48
|
+
className: "inline-flex",
|
|
49
|
+
children: e
|
|
50
|
+
}), /* @__PURE__ */ c(f, { children: D ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(u, { children: T && /* @__PURE__ */ c(d.div, {
|
|
51
|
+
initial: { opacity: 0 },
|
|
52
|
+
animate: { opacity: 1 },
|
|
53
|
+
exit: { opacity: 0 },
|
|
54
|
+
transition: { duration: .2 },
|
|
55
|
+
className: "fixed inset-0 z-50 bg-black/40",
|
|
56
|
+
onClick: () => E(!1)
|
|
57
|
+
}, "month-picker-dimmer") }), /* @__PURE__ */ c(u, { children: T && /* @__PURE__ */ l(d.div, {
|
|
58
|
+
ref: O.setFloating,
|
|
59
|
+
...M(),
|
|
60
|
+
initial: { y: "100%" },
|
|
61
|
+
animate: { y: 0 },
|
|
62
|
+
exit: {
|
|
63
|
+
y: "100%",
|
|
64
|
+
transition: {
|
|
65
|
+
duration: .2,
|
|
66
|
+
ease: [
|
|
67
|
+
.4,
|
|
68
|
+
0,
|
|
69
|
+
1,
|
|
70
|
+
1
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
transition: {
|
|
75
|
+
type: "spring",
|
|
76
|
+
damping: 30,
|
|
77
|
+
stiffness: 320
|
|
78
|
+
},
|
|
79
|
+
drag: "y",
|
|
80
|
+
dragListener: !1,
|
|
81
|
+
dragControls: N,
|
|
82
|
+
dragConstraints: { top: 0 },
|
|
83
|
+
dragElastic: {
|
|
84
|
+
top: 0,
|
|
85
|
+
bottom: .4
|
|
86
|
+
},
|
|
87
|
+
onDragEnd: P,
|
|
88
|
+
className: "fixed inset-x-0 bottom-0 z-50 flex flex-col gap-5 rounded-t-2xl bg-bg-card p-5 pb-[max(20px,env(safe-area-inset-bottom))] shadow-2xl",
|
|
89
|
+
children: [/* @__PURE__ */ c("div", {
|
|
90
|
+
className: "self-center h-1 w-10 rounded-full bg-bg-base-tertiary cursor-grab touch-none active:cursor-grabbing",
|
|
91
|
+
onPointerDown: F
|
|
92
|
+
}), B]
|
|
93
|
+
}, "month-picker-sheet") })] }) : T && /* @__PURE__ */ c("div", {
|
|
94
|
+
ref: O.setFloating,
|
|
95
|
+
style: k,
|
|
96
|
+
...M(),
|
|
97
|
+
className: "z-9999 w-70 rounded-2xl border border-border-tertiary bg-bg-card p-5 shadow-md",
|
|
98
|
+
children: B
|
|
99
|
+
}) })] });
|
|
100
|
+
}
|
|
101
|
+
function C({ year: e, onYearChange: t, selectedYear: r, selectedMonth: i, currentYear: a, currentMonth: o, onSelect: s }) {
|
|
102
|
+
let u = Array.from({ length: 12 }, (e, t) => t + 1);
|
|
103
|
+
return /* @__PURE__ */ l("div", {
|
|
104
|
+
className: "flex flex-col",
|
|
105
|
+
children: [/* @__PURE__ */ l("div", {
|
|
106
|
+
className: "mb-4 flex items-center justify-between",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ c(w, {
|
|
109
|
+
direction: "left",
|
|
110
|
+
onClick: () => t(e - 1)
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ l("div", {
|
|
113
|
+
className: "flex-1 text-center text-sm font-semibold text-text-primary",
|
|
114
|
+
children: [e, "년"]
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ c(w, {
|
|
117
|
+
direction: "right",
|
|
118
|
+
onClick: () => t(e + 1)
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
}), /* @__PURE__ */ c("div", {
|
|
122
|
+
className: "grid grid-cols-4 gap-2",
|
|
123
|
+
children: u.map((t) => {
|
|
124
|
+
let c = r === e && i === t;
|
|
125
|
+
return /* @__PURE__ */ l("button", {
|
|
126
|
+
type: "button",
|
|
127
|
+
onClick: () => s(t),
|
|
128
|
+
className: n("h-10 cursor-pointer rounded-lg text-sm transition-colors", c ? "bg-primary-500 font-bold text-white" : e === a && t === o ? "bg-bg-base-secondary font-semibold text-text-primary" : "text-text-primary hover:bg-bg-base-primary"),
|
|
129
|
+
"aria-label": `${e}년 ${t}월`,
|
|
130
|
+
"aria-pressed": c,
|
|
131
|
+
children: [t, "월"]
|
|
132
|
+
}, t);
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function w({ direction: n, onClick: r }) {
|
|
138
|
+
return /* @__PURE__ */ c("button", {
|
|
139
|
+
type: "button",
|
|
140
|
+
onClick: r,
|
|
141
|
+
className: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border-tertiary text-text-secondary transition-colors hover:bg-bg-base-primary",
|
|
142
|
+
"aria-label": n === "left" ? "이전 해" : "다음 해",
|
|
143
|
+
children: /* @__PURE__ */ c(n === "left" ? e : t, { className: "h-4 w-4" })
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
export { S as MonthPicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs.js"),t=require("../../hooks/useMediaQuery.cjs.js"),n=require("../../lib/overlay-stack.cjs.js"),r=require("../../lib/Portal.cjs.js");let i=require("react"),a=require("react/jsx-runtime"),o=require("motion/react");function s({open:s,onClose:c,title:l,widthPx:u=480,className:d,children:f}){let p=t.useIsMobile(),m={width:u,maxWidth:`100vw`},h=(0,i.useId)(),g=(0,o.useDragControls)();return(0,i.useEffect)(()=>{if(s)return n.overlayStack.push(h),document.body.style.overflow=`hidden`,()=>{n.overlayStack.pop(h),n.overlayStack.isEmpty()&&(document.body.style.overflow=``)}},[s,h]),(0,i.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n.overlayStack.isTop(h)&&c()};return s&&window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,c,h]),(0,a.jsxs)(r.Portal,{children:[(0,a.jsx)(o.AnimatePresence,{children:s&&(0,a.jsx)(o.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:()=>{n.overlayStack.isTop(h)&&c()},className:`fixed inset-0 z-50 bg-black/50`},`drawer-backdrop`)}),(0,a.jsx)(o.AnimatePresence,{children:s&&(0,a.jsxs)(o.motion.div,{initial:p?{y:`100%`}:{x:`100%`},animate:p?{y:0}:{x:0},exit:p?{y:`100%`,transition:{duration:.2,ease:[.4,0,1,1]}}:{x:`100%`},transition:p?{type:`spring`,damping:38,stiffness:320}:{type:`spring`,damping:30,stiffness:280},drag:p?`y`:!1,dragListener:!1,dragControls:g,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.4},onDragEnd:(e,t)=>{(t.offset.y>100||t.velocity.y>500)&&c()},className:e.cn(`fixed z-50 flex flex-col overflow-x-hidden bg-bg-white dark:bg-neutral-800 -bottom-8 left-0 right-0 max-h-[88vh] w-full rounded-t-2xl pb-8 sm:bottom-0 sm:left-auto sm:right-0 sm:top-0 sm:max-h-none sm:h-full sm:w-auto sm:rounded-none sm:pb-0`,d),style:p?void 0:m,children:[(0,a.jsx)(`div`,{className:`flex justify-center pt-2 pb-1 cursor-grab touch-none active:cursor-grabbing sm:hidden`,onPointerDown:e=>g.start(e),children:(0,a.jsx)(`div`,{className:`h-1 w-10 rounded-full bg-neutral-300 dark:bg-neutral-600`})}),l&&(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border-tertiary px-4 py-3 dark:border-neutral-700`,children:[(0,a.jsx)(`h3`,{className:`text-base font-semibold text-text-primary sm:text-lg dark:text-white`,children:l}),(0,a.jsx)(`button`,{onClick:c,className:`rounded p-1 text-text-tertiary hover:text-text-secondary dark:hover:text-neutral-300`,"aria-label":`닫기`,children:(0,a.jsx)(`svg`,{className:`h-5 w-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]}),(0,a.jsx)(`div`,{className:`flex-1 overflow-auto`,children:f})]},`drawer-sheet`)})]})}exports.Drawer=s;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.esm.js";
|
|
2
|
+
import { useIsMobile as t } from "../../hooks/useMediaQuery.esm.js";
|
|
3
|
+
import { overlayStack as n } from "../../lib/overlay-stack.esm.js";
|
|
4
|
+
import { Portal as r } from "../../lib/Portal.esm.js";
|
|
5
|
+
import { useEffect as i, useId as a } from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { AnimatePresence as c, motion as l, useDragControls as u } from "motion/react";
|
|
8
|
+
//#region src/components/drawer/Drawer.tsx
|
|
9
|
+
function d({ open: d, onClose: f, title: p, widthPx: m = 480, className: h, children: g }) {
|
|
10
|
+
let _ = t(), v = {
|
|
11
|
+
width: m,
|
|
12
|
+
maxWidth: "100vw"
|
|
13
|
+
}, y = a(), b = u();
|
|
14
|
+
return i(() => {
|
|
15
|
+
if (d) return n.push(y), document.body.style.overflow = "hidden", () => {
|
|
16
|
+
n.pop(y), n.isEmpty() && (document.body.style.overflow = "");
|
|
17
|
+
};
|
|
18
|
+
}, [d, y]), i(() => {
|
|
19
|
+
let e = (e) => {
|
|
20
|
+
e.key === "Escape" && n.isTop(y) && f();
|
|
21
|
+
};
|
|
22
|
+
return d && window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
23
|
+
}, [
|
|
24
|
+
d,
|
|
25
|
+
f,
|
|
26
|
+
y
|
|
27
|
+
]), /* @__PURE__ */ s(r, { children: [/* @__PURE__ */ o(c, { children: d && /* @__PURE__ */ o(l.div, {
|
|
28
|
+
initial: { opacity: 0 },
|
|
29
|
+
animate: { opacity: 1 },
|
|
30
|
+
exit: { opacity: 0 },
|
|
31
|
+
transition: { duration: .2 },
|
|
32
|
+
onClick: () => {
|
|
33
|
+
n.isTop(y) && f();
|
|
34
|
+
},
|
|
35
|
+
className: "fixed inset-0 z-50 bg-black/50"
|
|
36
|
+
}, "drawer-backdrop") }), /* @__PURE__ */ o(c, { children: d && /* @__PURE__ */ s(l.div, {
|
|
37
|
+
initial: _ ? { y: "100%" } : { x: "100%" },
|
|
38
|
+
animate: _ ? { y: 0 } : { x: 0 },
|
|
39
|
+
exit: _ ? {
|
|
40
|
+
y: "100%",
|
|
41
|
+
transition: {
|
|
42
|
+
duration: .2,
|
|
43
|
+
ease: [
|
|
44
|
+
.4,
|
|
45
|
+
0,
|
|
46
|
+
1,
|
|
47
|
+
1
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
} : { x: "100%" },
|
|
51
|
+
transition: _ ? {
|
|
52
|
+
type: "spring",
|
|
53
|
+
damping: 38,
|
|
54
|
+
stiffness: 320
|
|
55
|
+
} : {
|
|
56
|
+
type: "spring",
|
|
57
|
+
damping: 30,
|
|
58
|
+
stiffness: 280
|
|
59
|
+
},
|
|
60
|
+
drag: _ ? "y" : !1,
|
|
61
|
+
dragListener: !1,
|
|
62
|
+
dragControls: b,
|
|
63
|
+
dragConstraints: {
|
|
64
|
+
top: 0,
|
|
65
|
+
bottom: 0
|
|
66
|
+
},
|
|
67
|
+
dragElastic: {
|
|
68
|
+
top: 0,
|
|
69
|
+
bottom: .4
|
|
70
|
+
},
|
|
71
|
+
onDragEnd: (e, t) => {
|
|
72
|
+
(t.offset.y > 100 || t.velocity.y > 500) && f();
|
|
73
|
+
},
|
|
74
|
+
className: e("fixed z-50 flex flex-col overflow-x-hidden bg-bg-white dark:bg-neutral-800 -bottom-8 left-0 right-0 max-h-[88vh] w-full rounded-t-2xl pb-8 sm:bottom-0 sm:left-auto sm:right-0 sm:top-0 sm:max-h-none sm:h-full sm:w-auto sm:rounded-none sm:pb-0", h),
|
|
75
|
+
style: _ ? void 0 : v,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ o("div", {
|
|
78
|
+
className: "flex justify-center pt-2 pb-1 cursor-grab touch-none active:cursor-grabbing sm:hidden",
|
|
79
|
+
onPointerDown: (e) => b.start(e),
|
|
80
|
+
children: /* @__PURE__ */ o("div", { className: "h-1 w-10 rounded-full bg-neutral-300 dark:bg-neutral-600" })
|
|
81
|
+
}),
|
|
82
|
+
p && /* @__PURE__ */ s("div", {
|
|
83
|
+
className: "flex items-center justify-between border-b border-border-tertiary px-4 py-3 dark:border-neutral-700",
|
|
84
|
+
children: [/* @__PURE__ */ o("h3", {
|
|
85
|
+
className: "text-base font-semibold text-text-primary sm:text-lg dark:text-white",
|
|
86
|
+
children: p
|
|
87
|
+
}), /* @__PURE__ */ o("button", {
|
|
88
|
+
onClick: f,
|
|
89
|
+
className: "rounded p-1 text-text-tertiary hover:text-text-secondary dark:hover:text-neutral-300",
|
|
90
|
+
"aria-label": "닫기",
|
|
91
|
+
children: /* @__PURE__ */ o("svg", {
|
|
92
|
+
className: "h-5 w-5",
|
|
93
|
+
fill: "none",
|
|
94
|
+
stroke: "currentColor",
|
|
95
|
+
viewBox: "0 0 24 24",
|
|
96
|
+
children: /* @__PURE__ */ o("path", {
|
|
97
|
+
strokeLinecap: "round",
|
|
98
|
+
strokeLinejoin: "round",
|
|
99
|
+
strokeWidth: 2,
|
|
100
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})]
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ o("div", {
|
|
106
|
+
className: "flex-1 overflow-auto",
|
|
107
|
+
children: g
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
}, "drawer-sheet") })] });
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { d as Drawer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("react/jsx-runtime");function t({content:t,position:n=`top`}){return(0,e.jsxs)(`div`,{className:`relative inline-flex items-center group`,children:[(0,e.jsx)(`div`,{className:`w-3.5 h-3.5 rounded-full bg-primary-500 dark:bg-primary-600 flex items-center justify-center cursor-help hover:bg-primary-600 dark:hover:bg-primary-500 transition-colors`,children:(0,e.jsx)(`span`,{className:`text-[9px] font-bold text-white`,children:`?`})}),(0,e.jsxs)(`div`,{className:`absolute ${{top:`bottom-full left-1/2 -translate-x-1/2 mb-2`,bottom:`top-full left-1/2 -translate-x-1/2 mt-2`,left:`right-full top-1/2 -translate-y-1/2 mr-2`,right:`left-full top-1/2 -translate-y-1/2 ml-2`}[n]} z-50 px-3 py-2 bg-neutral-900 dark:bg-neutral-700 text-white text-xs rounded shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 pointer-events-none w-64 whitespace-normal`,children:[t,(0,e.jsx)(`div`,{className:`absolute w-2 h-2 bg-neutral-900 dark:bg-neutral-700 transform rotate-45 ${n===`top`?`bottom-[-4px] left-1/2 -translate-x-1/2`:n===`bottom`?`top-[-4px] left-1/2 -translate-x-1/2`:n===`left`?`right-[-4px] top-1/2 -translate-y-1/2`:`left-[-4px] top-1/2 -translate-y-1/2`}`})]})]})}exports.InfoTooltip=t;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/info-tooltip/InfoTooltip.tsx
|
|
3
|
+
function n({ content: n, position: r = "top" }) {
|
|
4
|
+
return /* @__PURE__ */ t("div", {
|
|
5
|
+
className: "relative inline-flex items-center group",
|
|
6
|
+
children: [/* @__PURE__ */ e("div", {
|
|
7
|
+
className: "w-3.5 h-3.5 rounded-full bg-primary-500 dark:bg-primary-600 flex items-center justify-center cursor-help hover:bg-primary-600 dark:hover:bg-primary-500 transition-colors",
|
|
8
|
+
children: /* @__PURE__ */ e("span", {
|
|
9
|
+
className: "text-[9px] font-bold text-white",
|
|
10
|
+
children: "?"
|
|
11
|
+
})
|
|
12
|
+
}), /* @__PURE__ */ t("div", {
|
|
13
|
+
className: `absolute ${{
|
|
14
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
15
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
16
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
17
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
18
|
+
}[r]} z-50 px-3 py-2 bg-neutral-900 dark:bg-neutral-700 text-white text-xs rounded shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 pointer-events-none w-64 whitespace-normal`,
|
|
19
|
+
children: [n, /* @__PURE__ */ e("div", { className: `absolute w-2 h-2 bg-neutral-900 dark:bg-neutral-700 transform rotate-45 ${r === "top" ? "bottom-[-4px] left-1/2 -translate-x-1/2" : r === "bottom" ? "top-[-4px] left-1/2 -translate-x-1/2" : r === "left" ? "right-[-4px] top-1/2 -translate-y-1/2" : "left-[-4px] top-1/2 -translate-y-1/2"}` })]
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n as InfoTooltip };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../node_modules/lucide-react/dist/esm/icons/circle-x.cjs.js"),t=require("../_shared/form-size-tokens.cjs.js"),n=require("./utils.cjs.js");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(({variant:a,inputSize:o=`medium`,label:s,labelOption:c=`appear`,help:l,hasError:u=!1,disabled:d=!1,prefix:f,suffix:p,trailingIcon:m,clearable:h=!1,badge:g,placeholder:_,format:v,containerProps:y,containerRef:b,value:x,defaultValue:S,onChange:C,onFocus:w,onBlur:T,className:E=``,...D},O)=>{let[k,A]=(0,r.useState)(!1),[j,M]=(0,r.useState)(()=>{let e=x??S??``;return v?v.transform(e).toString():e.toString()}),N=(0,r.useRef)(null),P=x!==void 0,F=P?x.toString():j,I=v?v.transform(F).toString():F,L=e=>{let t=e.target.value;if(v){let n=v.transform(t).toString(),r=v.reset?v.reset(n).toString():n;P||M(n),C?.({...e,target:{...e.target,value:r}})}else P||M(t),C?.(e)},R=e=>{A(!0),w?.(e)},z=e=>{A(!1),T?.(e)},B=D.ref,V=e=>{N.current=e,typeof O==`function`?O(e):O&&(O.current=e),typeof B==`function`?B(e):B&&`current`in B&&(B.current=e)},H=()=>{let e=N.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},U=I.length>0,W=n.getInputContainerClasses(),G=n.getInputVariantClasses(a,u,d,o),K=n.getInputClasses(a,u,d,U,o),q=n.getInputTrailingIconColor(u,d,U||k),J=c===`sustain`||c===`appear`&&!!I,Y=a===`box`,X=t.SLOT_GAP_CLASS[o],Z=t.SLOT_CHILD_ICON_CLASS[o],Q=t.SLOT_BADGE_TEXT_CLASS[o],$=t.SLOT_ICON_SIZE_CLASS[o],ee=(0,i.jsxs)(`div`,{className:Y?`${G} flex items-center ${X} ${E}`.trim().replace(/\s+/g,` `):`relative flex items-center text-sm`,children:[f&&(0,i.jsx)(`span`,{className:`whitespace-nowrap text-sm ${q}`,children:f}),(0,i.jsx)(`input`,{...D,ref:V,className:Y?K:`${K} ${G} ${u?`border-error-500 focus:border-error-500 focus:ring-error-500`:``} ${d?`opacity-50`:``} ${E}`.trim().replace(/\s+/g,` `),value:I,onChange:L,onFocus:R,onBlur:z,disabled:d,placeholder:_}),p&&(0,i.jsx)(`span`,{className:`whitespace-nowrap text-sm ${q}`,children:p}),m&&(0,i.jsx)(`span`,{className:`flex shrink-0 items-center ${q} ${Z}`,children:m}),h&&!d&&U&&(0,i.jsx)(`button`,{type:`button`,onClick:H,"aria-label":`입력 지우기`,className:`flex shrink-0 cursor-pointer items-center rounded ${q} hover:text-text-primary focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500/40`,children:(0,i.jsx)(e.CircleX,{className:$,strokeWidth:1.5,"aria-hidden":`true`})}),g&&(0,i.jsx)(`span`,{className:`flex shrink-0 items-center ${Z} ${Q}`,children:g})]});return(0,i.jsxs)(`div`,{ref:b,className:W,...y,children:[J&&s&&(0,i.jsx)(`label`,{className:n.getInputLabelClasses(a,u),htmlFor:D.id,children:s}),ee,l&&(0,i.jsx)(`div`,{className:n.getInputHelpClasses(u),children:l})]})});a.displayName=`Input`,exports.Input=a;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { CircleX as e } from "../../node_modules/lucide-react/dist/esm/icons/circle-x.esm.js";
|
|
2
|
+
import { SLOT_BADGE_TEXT_CLASS as t, SLOT_CHILD_ICON_CLASS as n, SLOT_GAP_CLASS as r, SLOT_ICON_SIZE_CLASS as i } from "../_shared/form-size-tokens.esm.js";
|
|
3
|
+
import { getInputClasses as ee, getInputContainerClasses as te, getInputHelpClasses as a, getInputLabelClasses as o, getInputTrailingIconColor as s, getInputVariantClasses as c } from "./utils.esm.js";
|
|
4
|
+
import { forwardRef as l, useRef as ne, useState as u } from "react";
|
|
5
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/input/Input.tsx
|
|
7
|
+
var p = l(({ variant: l, inputSize: p = "medium", label: m, labelOption: h = "appear", help: g, hasError: _ = !1, disabled: v = !1, prefix: y, suffix: b, trailingIcon: x, clearable: S = !1, badge: C, placeholder: w, format: T, containerProps: E, containerRef: D, value: O, defaultValue: k, onChange: A, onFocus: re, onBlur: ie, className: j = "", ...M }, N) => {
|
|
8
|
+
let [P, F] = u(!1), [I, L] = u(() => {
|
|
9
|
+
let e = O ?? k ?? "";
|
|
10
|
+
return T ? T.transform(e).toString() : e.toString();
|
|
11
|
+
}), R = ne(null), z = O !== void 0, B = z ? O.toString() : I, V = T ? T.transform(B).toString() : B, H = (e) => {
|
|
12
|
+
let t = e.target.value;
|
|
13
|
+
if (T) {
|
|
14
|
+
let n = T.transform(t).toString(), r = T.reset ? T.reset(n).toString() : n;
|
|
15
|
+
z || L(n), A?.({
|
|
16
|
+
...e,
|
|
17
|
+
target: {
|
|
18
|
+
...e.target,
|
|
19
|
+
value: r
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
} else z || L(t), A?.(e);
|
|
23
|
+
}, U = (e) => {
|
|
24
|
+
F(!0), re?.(e);
|
|
25
|
+
}, W = (e) => {
|
|
26
|
+
F(!1), ie?.(e);
|
|
27
|
+
}, G = M.ref, K = (e) => {
|
|
28
|
+
R.current = e, typeof N == "function" ? N(e) : N && (N.current = e), typeof G == "function" ? G(e) : G && "current" in G && (G.current = e);
|
|
29
|
+
}, q = () => {
|
|
30
|
+
let e = R.current;
|
|
31
|
+
e && ((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
|
|
32
|
+
}, J = V.length > 0, ae = te(), Y = c(l, _, v, p), X = ee(l, _, v, J, p), Z = s(_, v, J || P), oe = h === "sustain" || h === "appear" && !!V, Q = l === "box", se = r[p], $ = n[p], ce = t[p], le = i[p], ue = /* @__PURE__ */ f("div", {
|
|
33
|
+
className: Q ? `${Y} flex items-center ${se} ${j}`.trim().replace(/\s+/g, " ") : "relative flex items-center text-sm",
|
|
34
|
+
children: [
|
|
35
|
+
y && /* @__PURE__ */ d("span", {
|
|
36
|
+
className: `whitespace-nowrap text-sm ${Z}`,
|
|
37
|
+
children: y
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ d("input", {
|
|
40
|
+
...M,
|
|
41
|
+
ref: K,
|
|
42
|
+
className: Q ? X : `${X} ${Y} ${_ ? "border-error-500 focus:border-error-500 focus:ring-error-500" : ""} ${v ? "opacity-50" : ""} ${j}`.trim().replace(/\s+/g, " "),
|
|
43
|
+
value: V,
|
|
44
|
+
onChange: H,
|
|
45
|
+
onFocus: U,
|
|
46
|
+
onBlur: W,
|
|
47
|
+
disabled: v,
|
|
48
|
+
placeholder: w
|
|
49
|
+
}),
|
|
50
|
+
b && /* @__PURE__ */ d("span", {
|
|
51
|
+
className: `whitespace-nowrap text-sm ${Z}`,
|
|
52
|
+
children: b
|
|
53
|
+
}),
|
|
54
|
+
x && /* @__PURE__ */ d("span", {
|
|
55
|
+
className: `flex shrink-0 items-center ${Z} ${$}`,
|
|
56
|
+
children: x
|
|
57
|
+
}),
|
|
58
|
+
S && !v && J && /* @__PURE__ */ d("button", {
|
|
59
|
+
type: "button",
|
|
60
|
+
onClick: q,
|
|
61
|
+
"aria-label": "입력 지우기",
|
|
62
|
+
className: `flex shrink-0 cursor-pointer items-center rounded ${Z} hover:text-text-primary focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500/40`,
|
|
63
|
+
children: /* @__PURE__ */ d(e, {
|
|
64
|
+
className: le,
|
|
65
|
+
strokeWidth: 1.5,
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
C && /* @__PURE__ */ d("span", {
|
|
70
|
+
className: `flex shrink-0 items-center ${$} ${ce}`,
|
|
71
|
+
children: C
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
return /* @__PURE__ */ f("div", {
|
|
76
|
+
ref: D,
|
|
77
|
+
className: ae,
|
|
78
|
+
...E,
|
|
79
|
+
children: [
|
|
80
|
+
oe && m && /* @__PURE__ */ d("label", {
|
|
81
|
+
className: o(l, _),
|
|
82
|
+
htmlFor: M.id,
|
|
83
|
+
children: m
|
|
84
|
+
}),
|
|
85
|
+
ue,
|
|
86
|
+
g && /* @__PURE__ */ d("div", {
|
|
87
|
+
className: a(_),
|
|
88
|
+
children: g
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
p.displayName = "Input";
|
|
94
|
+
//#endregion
|
|
95
|
+
export { p as Input };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../node_modules/lucide-react/dist/esm/icons/eye-off.cjs.js"),t=require("../../node_modules/lucide-react/dist/esm/icons/eye.cjs.js"),n=require("./Input.cjs.js");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(({disabled:a,...o},s)=>{let[c,l]=(0,r.useState)(!1);return(0,i.jsx)(n.Input,{...o,ref:s,disabled:a,type:c?`text`:`password`,trailingIcon:(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),disabled:a,"aria-label":c?`비밀번호 숨기기`:`비밀번호 표시`,className:`flex items-center justify-center text-text-tertiary transition-colors hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-50`,children:c?(0,i.jsx)(e.EyeOff,{className:`h-4 w-4`,strokeWidth:1.5}):(0,i.jsx)(t.Eye,{className:`h-4 w-4`,strokeWidth:1.5})})})});a.displayName=`PasswordInput`,exports.PasswordInput=a;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EyeOff as e } from "../../node_modules/lucide-react/dist/esm/icons/eye-off.esm.js";
|
|
2
|
+
import { Eye as t } from "../../node_modules/lucide-react/dist/esm/icons/eye.esm.js";
|
|
3
|
+
import { Input as n } from "./Input.esm.js";
|
|
4
|
+
import { forwardRef as r, useState as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/input/PasswordInput.tsx
|
|
7
|
+
var o = r(({ disabled: r, ...o }, s) => {
|
|
8
|
+
let [c, l] = i(!1);
|
|
9
|
+
return /* @__PURE__ */ a(n, {
|
|
10
|
+
...o,
|
|
11
|
+
ref: s,
|
|
12
|
+
disabled: r,
|
|
13
|
+
type: c ? "text" : "password",
|
|
14
|
+
trailingIcon: /* @__PURE__ */ a("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
onClick: () => l((e) => !e),
|
|
17
|
+
disabled: r,
|
|
18
|
+
"aria-label": c ? "비밀번호 숨기기" : "비밀번호 표시",
|
|
19
|
+
className: "flex items-center justify-center text-text-tertiary transition-colors hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
children: a(c ? e : t, {
|
|
21
|
+
className: "h-4 w-4",
|
|
22
|
+
strokeWidth: 1.5
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
o.displayName = "PasswordInput";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { o as PasswordInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)}function t(e){return e.replace(/,/g,``)}function n(e){let t=e.toString().replace(/[^\d]/g,``);return t.length<=3?t:t.length<=7?`${t.slice(0,3)}-${t.slice(3)}`:t.length<=10?`${t.slice(0,3)}-${t.slice(3,7)}-${t.slice(7)}`:`${t.slice(0,3)}-${t.slice(3,7)}-${t.slice(7,11)}`}function r(e){return e.toString().replace(/-/g,``)}function i(t){let n=t.toString().replace(/[^\d]/g,``);return n?e(n):``}function a(e){return t(e.toString())}var o={phoneNumber:{transform:n,reset:r},price:{transform:i,reset:a}};exports.inputFormats=o;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/components/input/format.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return e.replace(/,/g, "");
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
let t = e.toString().replace(/[^\d]/g, "");
|
|
10
|
+
return t.length <= 3 ? t : t.length <= 7 ? `${t.slice(0, 3)}-${t.slice(3)}` : t.length <= 10 ? `${t.slice(0, 3)}-${t.slice(3, 7)}-${t.slice(7)}` : `${t.slice(0, 3)}-${t.slice(3, 7)}-${t.slice(7, 11)}`;
|
|
11
|
+
}
|
|
12
|
+
function r(e) {
|
|
13
|
+
return e.toString().replace(/-/g, "");
|
|
14
|
+
}
|
|
15
|
+
function i(t) {
|
|
16
|
+
let n = t.toString().replace(/[^\d]/g, "");
|
|
17
|
+
return n ? e(n) : "";
|
|
18
|
+
}
|
|
19
|
+
function a(e) {
|
|
20
|
+
return t(e.toString());
|
|
21
|
+
}
|
|
22
|
+
var o = {
|
|
23
|
+
phoneNumber: {
|
|
24
|
+
transform: n,
|
|
25
|
+
reset: r
|
|
26
|
+
},
|
|
27
|
+
price: {
|
|
28
|
+
transform: i,
|
|
29
|
+
reset: a
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { o as inputFormats };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={large:`h-12 rounded-xl border px-5 transition-colors focus-within:outline-hidden`,medium:`h-11 rounded-xl border px-3.5 transition-colors focus-within:outline-hidden`,small:`h-9 rounded-lg border px-3 transition-colors focus-within:outline-hidden`,mini:`h-7 rounded-md border px-2 transition-colors focus-within:outline-hidden`},t=(t,n,r,i=`medium`)=>{if(t===`box`){let t=e[i];return r?[t,`bg-bg-disabled border-border-tertiary dark:border-border-secondary`].join(` `):n?[t,`bg-bg-white border-border-danger`].join(` `):[t,`bg-bg-white border-border-tertiary dark:border-border-secondary focus-within:border-border-primary`].join(` `)}return{box:``,line:`border-b-2 border-neutral-300 dark:border-neutral-600 px-0 py-2 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-0`,big:`border-2 border-neutral-300 dark:border-neutral-600 rounded px-5 py-4 text-lg focus:border-primary-500 dark:focus:border-primary-400 focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-0 h-[52px]`,hero:`border-2 border-neutral-300 dark:border-neutral-600 rounded px-6 py-5 text-xl font-semibold focus:border-primary-500 dark:focus:border-primary-400 focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-0 h-[64px]`}[t]},n=(e,t,n,r,i=`medium`)=>{let a=`w-full bg-transparent ${i===`mini`?`text-xs`:i===`large`?`text-base`:`text-sm`} focus:outline-hidden disabled:cursor-not-allowed`;return e===`box`?n?[a,`text-text-disabled placeholder:text-text-disabled`].join(` `):t?[a,`text-text-danger placeholder:text-text-danger`].join(` `):r?[a,`text-text-primary placeholder:text-text-tertiary`].join(` `):[a,`text-text-tertiary placeholder:text-text-tertiary`].join(` `):[`w-full bg-white dark:bg-neutral-800 text-sm text-neutral-900 dark:text-white placeholder:text-neutral-400 transition-all duration-200 ease-out focus:outline-hidden disabled:bg-neutral-50 disabled:text-neutral-400 disabled:cursor-not-allowed disabled:border-neutral-200`].join(` `)},r=(e,t,n)=>t?`text-icon-disabled`:e?`text-icon-danger`:n?`text-icon-secondary`:`text-icon-tertiary`,i=()=>`w-full`,a=(e,t)=>[`block text-xs font-medium mb-2`,t?`text-text-danger`:`text-text-secondary`].join(` `),o=e=>[`mt-2 text-sm`,e?`text-text-danger`:`text-text-secondary`].join(` `);exports.getInputClasses=n,exports.getInputContainerClasses=i,exports.getInputHelpClasses=o,exports.getInputLabelClasses=a,exports.getInputTrailingIconColor=r,exports.getInputVariantClasses=t;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/components/input/utils.ts
|
|
2
|
+
var e = {
|
|
3
|
+
large: "h-12 rounded-xl border px-5 transition-colors focus-within:outline-hidden",
|
|
4
|
+
medium: "h-11 rounded-xl border px-3.5 transition-colors focus-within:outline-hidden",
|
|
5
|
+
small: "h-9 rounded-lg border px-3 transition-colors focus-within:outline-hidden",
|
|
6
|
+
mini: "h-7 rounded-md border px-2 transition-colors focus-within:outline-hidden"
|
|
7
|
+
}, t = (t, n, r, i = "medium") => {
|
|
8
|
+
if (t === "box") {
|
|
9
|
+
let t = e[i];
|
|
10
|
+
return r ? [t, "bg-bg-disabled border-border-tertiary dark:border-border-secondary"].join(" ") : n ? [t, "bg-bg-white border-border-danger"].join(" ") : [t, "bg-bg-white border-border-tertiary dark:border-border-secondary focus-within:border-border-primary"].join(" ");
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
box: "",
|
|
14
|
+
line: "border-b-2 border-neutral-300 dark:border-neutral-600 px-0 py-2 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-0",
|
|
15
|
+
big: "border-2 border-neutral-300 dark:border-neutral-600 rounded px-5 py-4 text-lg focus:border-primary-500 dark:focus:border-primary-400 focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-0 h-[52px]",
|
|
16
|
+
hero: "border-2 border-neutral-300 dark:border-neutral-600 rounded px-6 py-5 text-xl font-semibold focus:border-primary-500 dark:focus:border-primary-400 focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-0 h-[64px]"
|
|
17
|
+
}[t];
|
|
18
|
+
}, n = (e, t, n, r, i = "medium") => {
|
|
19
|
+
let a = `w-full bg-transparent ${i === "mini" ? "text-xs" : i === "large" ? "text-base" : "text-sm"} focus:outline-hidden disabled:cursor-not-allowed`;
|
|
20
|
+
return e === "box" ? n ? [a, "text-text-disabled placeholder:text-text-disabled"].join(" ") : t ? [a, "text-text-danger placeholder:text-text-danger"].join(" ") : r ? [a, "text-text-primary placeholder:text-text-tertiary"].join(" ") : [a, "text-text-tertiary placeholder:text-text-tertiary"].join(" ") : ["w-full bg-white dark:bg-neutral-800 text-sm text-neutral-900 dark:text-white placeholder:text-neutral-400 transition-all duration-200 ease-out focus:outline-hidden disabled:bg-neutral-50 disabled:text-neutral-400 disabled:cursor-not-allowed disabled:border-neutral-200"].join(" ");
|
|
21
|
+
}, r = (e, t, n) => t ? "text-icon-disabled" : e ? "text-icon-danger" : n ? "text-icon-secondary" : "text-icon-tertiary", i = () => "w-full", a = (e, t) => ["block text-xs font-medium mb-2", t ? "text-text-danger" : "text-text-secondary"].join(" "), o = (e) => ["mt-2 text-sm", e ? "text-text-danger" : "text-text-secondary"].join(" ");
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as getInputClasses, i as getInputContainerClasses, o as getInputHelpClasses, a as getInputLabelClasses, r as getInputTrailingIconColor, t as getInputVariantClasses };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("react/jsx-runtime");var t={sm:`h-4 w-4`,md:`h-6 w-6`,lg:`h-8 w-8`};function n({size:n=`md`}){return(0,e.jsxs)(`svg`,{className:`animate-spin ${t[n]} text-primary-500 dark:text-primary-400`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,e.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,e.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function r({message:t=`데이터를 불러오는 중이에요...`,size:r=`md`,className:i=``}){return(0,e.jsx)(`div`,{className:`flex items-center justify-center h-full min-h-[200px] ${i}`,children:(0,e.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,e.jsx)(n,{size:r}),t&&(0,e.jsx)(`span`,{className:`text-sm text-neutral-500 dark:text-neutral-400`,children:t})]})})}function i({size:t=`sm`}){return(0,e.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,e.jsx)(n,{size:t})})}exports.InlineSpinner=i,exports.LoadingSpinner=r,exports.Spinner=n;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/loading-spinner/LoadingSpinner.tsx
|
|
3
|
+
var n = {
|
|
4
|
+
sm: "h-4 w-4",
|
|
5
|
+
md: "h-6 w-6",
|
|
6
|
+
lg: "h-8 w-8"
|
|
7
|
+
};
|
|
8
|
+
function r({ size: r = "md" }) {
|
|
9
|
+
return /* @__PURE__ */ t("svg", {
|
|
10
|
+
className: `animate-spin ${n[r]} text-primary-500 dark:text-primary-400`,
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
fill: "none",
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
children: [/* @__PURE__ */ e("circle", {
|
|
15
|
+
className: "opacity-25",
|
|
16
|
+
cx: "12",
|
|
17
|
+
cy: "12",
|
|
18
|
+
r: "10",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: "4"
|
|
21
|
+
}), /* @__PURE__ */ e("path", {
|
|
22
|
+
className: "opacity-75",
|
|
23
|
+
fill: "currentColor",
|
|
24
|
+
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"
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function i({ message: n = "데이터를 불러오는 중이에요...", size: i = "md", className: a = "" }) {
|
|
29
|
+
return /* @__PURE__ */ e("div", {
|
|
30
|
+
className: `flex items-center justify-center h-full min-h-[200px] ${a}`,
|
|
31
|
+
children: /* @__PURE__ */ t("div", {
|
|
32
|
+
className: "flex flex-col items-center gap-2",
|
|
33
|
+
children: [/* @__PURE__ */ e(r, { size: i }), n && /* @__PURE__ */ e("span", {
|
|
34
|
+
className: "text-sm text-neutral-500 dark:text-neutral-400",
|
|
35
|
+
children: n
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function a({ size: t = "sm" }) {
|
|
41
|
+
return /* @__PURE__ */ e("div", {
|
|
42
|
+
className: "flex items-center justify-center py-3",
|
|
43
|
+
children: /* @__PURE__ */ e(r, { size: t })
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { a as InlineSpinner, i as LoadingSpinner, r as Spinner };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs.js"),t=require("../../hooks/useMediaQuery.cjs.js"),n=require("../../lib/overlay-stack.cjs.js"),r=require("../../lib/Portal.cjs.js");let i=require("react"),a=require("react/jsx-runtime"),o=require("motion/react");function s({isOpen:s,onClose:c,title:l,widthPx:u,footer:d,bodyPadded:f=!1,subView:p,className:m,children:h}){let g=t.useIsMobile(),_=(0,i.useId)(),v=(0,o.useDragControls)();return(0,i.useEffect)(()=>{if(s)return n.overlayStack.push(_),document.body.style.overflow=`hidden`,()=>{n.overlayStack.pop(_),n.overlayStack.isEmpty()&&(document.body.style.overflow=``)}},[s,_]),(0,i.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n.overlayStack.isTop(_)&&c()};return s&&window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,c,_]),(0,a.jsxs)(r.Portal,{children:[(0,a.jsx)(o.AnimatePresence,{children:s&&(0,a.jsx)(o.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:()=>{n.overlayStack.isTop(_)&&c()},className:`fixed inset-0 z-50 bg-black/50`},`modal-backdrop`)}),(0,a.jsx)(o.AnimatePresence,{children:s&&(0,a.jsxs)(o.motion.div,{initial:g?{y:`100%`}:{opacity:0,y:24,scale:.96},animate:g?{y:0}:{opacity:1,y:0,scale:1},exit:g?{y:`100%`,transition:{duration:.2,ease:[.4,0,1,1]}}:{opacity:0,y:24,scale:.96},transition:g?{type:`spring`,damping:38,stiffness:320}:{duration:.25,ease:[.32,.72,0,1]},drag:g?`y`:!1,dragListener:!1,dragControls:v,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.4},onDragEnd:(e,t)=>{(t.offset.y>100||t.velocity.y>500)&&c()},className:e.cn(`fixed -bottom-8 left-0 right-0 z-50 mx-auto flex max-h-[88vh] w-full flex-col overflow-hidden rounded-t-2xl bg-white pb-8 shadow-xl sm:bottom-auto sm:left-1/2 sm:right-auto sm:top-1/2 sm:max-h-[90vh] sm:w-auto sm:min-w-[320px] sm:max-w-[90vw] sm:rounded-lg sm:pb-0 dark:bg-neutral-800`,m),style:g?void 0:{translateX:`-50%`,translateY:`-50%`,...u?{width:u}:{}},children:[(0,a.jsx)(`div`,{className:`flex justify-center pt-2 pb-1 cursor-grab touch-none active:cursor-grabbing sm:hidden`,onPointerDown:e=>v.start(e),children:(0,a.jsx)(`div`,{className:`h-1 w-10 rounded-full bg-neutral-300 dark:bg-neutral-600`})}),l&&(0,a.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3`,children:[(0,a.jsx)(`h3`,{className:`text-base font-semibold text-neutral-900 sm:text-lg dark:text-white`,children:l}),(0,a.jsx)(`button`,{onClick:c,className:`rounded p-1 text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300`,"aria-label":`닫기`,children:(0,a.jsx)(`svg`,{className:`h-5 w-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]}),(0,a.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`transform-[translateZ(0)] flex-1 overflow-y-auto overflow-x-hidden${f?` mx-1 sm:mx-4`:``}`,children:h}),p]}),d&&(0,a.jsx)(`div`,{className:`shrink-0`,children:d})]},`modal-sheet`)})]})}exports.Modal=s;
|