@deweb.id/ui-kit 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +90 -2
- package/css/ui-kit.css +901 -0
- package/dist/chunk-028rzptn.js +253 -0
- package/dist/chunk-028rzptn.js.map +10 -0
- package/dist/chunk-0x0et52k.js +82 -0
- package/dist/chunk-0x0et52k.js.map +10 -0
- package/dist/chunk-17gmkyd1.js +195 -0
- package/dist/chunk-17gmkyd1.js.map +10 -0
- package/dist/chunk-19jsevr8.js +17 -0
- package/dist/chunk-19jsevr8.js.map +10 -0
- package/dist/chunk-1t1fbbme.js +171 -0
- package/dist/chunk-1t1fbbme.js.map +10 -0
- package/dist/chunk-26ban96z.js +151 -0
- package/dist/chunk-26ban96z.js.map +10 -0
- package/dist/chunk-39hey5ns.js +2034 -0
- package/dist/chunk-39hey5ns.js.map +19 -0
- package/dist/chunk-3f0bjycv.js +481 -0
- package/dist/chunk-3f0bjycv.js.map +10 -0
- package/dist/chunk-3zpf64v4.js +108 -0
- package/dist/chunk-3zpf64v4.js.map +10 -0
- package/dist/chunk-4jrq15v9.js +919 -0
- package/dist/chunk-4jrq15v9.js.map +10 -0
- package/dist/chunk-8dacesjp.js +289 -0
- package/dist/chunk-8dacesjp.js.map +10 -0
- package/dist/chunk-8een770x.js +2546 -0
- package/dist/chunk-8een770x.js.map +29 -0
- package/dist/chunk-8jv2g2ne.js +371 -0
- package/dist/chunk-8jv2g2ne.js.map +10 -0
- package/dist/chunk-abdqb4e5.js +156 -0
- package/dist/chunk-abdqb4e5.js.map +10 -0
- package/dist/chunk-af27xdf2.js +891 -0
- package/dist/chunk-af27xdf2.js.map +11 -0
- package/dist/chunk-amsyqyh9.js +23 -0
- package/dist/chunk-amsyqyh9.js.map +9 -0
- package/dist/chunk-czbcw9e1.js +503 -0
- package/dist/chunk-czbcw9e1.js.map +11 -0
- package/dist/chunk-dar8mz91.js +73 -0
- package/dist/chunk-dar8mz91.js.map +10 -0
- package/dist/chunk-dsddmmdk.js +136 -0
- package/dist/chunk-dsddmmdk.js.map +10 -0
- package/dist/chunk-edx7tas6.js +89 -0
- package/dist/chunk-edx7tas6.js.map +10 -0
- package/dist/chunk-es4tgmvr.js +1686 -0
- package/dist/chunk-es4tgmvr.js.map +12 -0
- package/dist/chunk-f2aqj672.js +240 -0
- package/dist/chunk-f2aqj672.js.map +11 -0
- package/dist/chunk-h6k57hyd.js +146 -0
- package/dist/chunk-h6k57hyd.js.map +10 -0
- package/dist/chunk-hkx78qgj.js +1548 -0
- package/dist/chunk-hkx78qgj.js.map +12 -0
- package/dist/chunk-hq57r97c.js +770 -0
- package/dist/chunk-hq57r97c.js.map +11 -0
- package/dist/chunk-jct2e2h1.js +139 -0
- package/dist/chunk-jct2e2h1.js.map +10 -0
- package/dist/chunk-je0j5sn4.js +246 -0
- package/dist/chunk-je0j5sn4.js.map +10 -0
- package/dist/chunk-k2b698v5.js +754 -0
- package/dist/chunk-k2b698v5.js.map +12 -0
- package/dist/chunk-kv58555q.js +267 -0
- package/dist/chunk-kv58555q.js.map +11 -0
- package/dist/chunk-m0msvrte.js +15 -0
- package/dist/chunk-m0msvrte.js.map +10 -0
- package/dist/chunk-m3t14v77.js +30 -0
- package/dist/chunk-m3t14v77.js.map +10 -0
- package/dist/chunk-mctp30cp.js +1466 -0
- package/dist/chunk-mctp30cp.js.map +10 -0
- package/dist/chunk-n37qb5m5.js +1408 -0
- package/dist/chunk-n37qb5m5.js.map +10 -0
- package/dist/chunk-nhhgsdt3.js +570 -0
- package/dist/chunk-nhhgsdt3.js.map +11 -0
- package/dist/chunk-pxydj130.js +28 -0
- package/dist/chunk-pxydj130.js.map +10 -0
- package/dist/chunk-qmbwp4k7.js +3275 -0
- package/dist/chunk-qmbwp4k7.js.map +13 -0
- package/dist/chunk-qzxf0aa2.js +149 -0
- package/dist/chunk-qzxf0aa2.js.map +10 -0
- package/dist/chunk-rbjyp9ff.js +47 -0
- package/dist/chunk-rbjyp9ff.js.map +10 -0
- package/dist/chunk-rbkc50xg.js +103 -0
- package/dist/chunk-rbkc50xg.js.map +10 -0
- package/dist/chunk-rn6f0s6x.js +66 -0
- package/dist/chunk-rn6f0s6x.js.map +9 -0
- package/dist/chunk-rswzbfa2.js +422 -0
- package/dist/chunk-rswzbfa2.js.map +10 -0
- package/dist/chunk-rzns0reg.js +157 -0
- package/dist/chunk-rzns0reg.js.map +10 -0
- package/dist/chunk-s851vtje.js +90 -0
- package/dist/chunk-s851vtje.js.map +10 -0
- package/dist/chunk-vak164kx.js +15 -0
- package/dist/chunk-vak164kx.js.map +9 -0
- package/dist/chunk-vpvnvegz.js +480 -0
- package/dist/chunk-vpvnvegz.js.map +10 -0
- package/dist/chunk-x4pk7vxm.js +10 -0
- package/dist/chunk-x4pk7vxm.js.map +10 -0
- package/dist/chunk-xd2fwgek.js +53 -0
- package/dist/chunk-xd2fwgek.js.map +10 -0
- package/dist/chunk-y71rd8qf.js +499 -0
- package/dist/chunk-y71rd8qf.js.map +10 -0
- package/dist/chunk-zjmt193s.js +34 -0
- package/dist/chunk-zjmt193s.js.map +9 -0
- package/dist/components/blocks/CustomHtmlBlock.d.ts +14 -0
- package/dist/components/blocks/LoginFormBlock.d.ts +16 -0
- package/dist/components/blocks/SidebarMenuBlock.d.ts +11 -0
- package/dist/components/blocks/SliderBlock.d.ts +13 -0
- package/dist/components/code/code-editor.d.ts +58 -0
- package/dist/components/code/code-preview.d.ts +18 -0
- package/dist/components/code/index.d.ts +4 -0
- package/dist/components/code/validator.d.ts +10 -0
- package/dist/components/code/vsc-themes.d.ts +6 -0
- package/dist/components/dashboard/compound/context.d.ts +14 -0
- package/dist/components/dashboard/compound/dashboard.d.ts +14 -0
- package/dist/components/dashboard/compound/index.d.ts +18 -0
- package/dist/components/dashboard/compound/main.d.ts +25 -0
- package/dist/components/dashboard/compound/sidebar.d.ts +5 -0
- package/dist/components/dashboard/dashboard-head-info.d.ts +38 -0
- package/dist/components/dashboard/dashboard-head.d.ts +19 -0
- package/dist/components/dashboard/dataview.d.ts +19 -0
- package/dist/components/dashboard/detailview.d.ts +1 -0
- package/dist/components/dashboard/formview.d.ts +265 -0
- package/dist/components/dashboard/pageformview.d.ts +79 -0
- package/dist/components/dashboard/styling/background-color-control.d.ts +34 -0
- package/dist/components/dashboard/styling/background-control.d.ts +45 -0
- package/dist/components/dashboard/styling/border-control.d.ts +14 -0
- package/dist/components/dashboard/styling/color-control.d.ts +22 -0
- package/dist/components/dashboard/styling/index.d.ts +7 -0
- package/dist/components/dashboard/styling/radius-control.d.ts +15 -0
- package/dist/components/dashboard/styling/spacing-control.d.ts +17 -0
- package/dist/components/dashboard/styling/types.d.ts +50 -0
- package/dist/components/document/index.d.ts +25 -0
- package/dist/components/ecommerce/commerce-cards.d.ts +37 -0
- package/dist/components/effect/action-animation.d.ts +14 -0
- package/dist/components/effect/element-animation.d.ts +41 -0
- package/dist/components/effect/page-transition.d.ts +10 -0
- package/dist/components/layout/BlockPalette.d.ts +14 -0
- package/dist/components/layout/DynamicLayout.d.ts +56 -0
- package/dist/components/layout/GridRow.d.ts +37 -0
- package/dist/components/layout/LayoutBuilder.d.ts +52 -0
- package/dist/components/layout/WidgetFieldsForm.d.ts +15 -0
- package/dist/components/ui/accordion.d.ts +36 -0
- package/dist/components/ui/action-bar.d.ts +46 -0
- package/dist/components/ui/alert.d.ts +25 -0
- package/dist/components/ui/animated.d.ts +41 -0
- package/dist/components/ui/app-shell.d.ts +53 -0
- package/dist/components/ui/avatar.d.ts +18 -0
- package/dist/components/ui/badge.d.ts +15 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/button-icon.d.ts +9 -0
- package/dist/components/ui/button.d.ts +37 -0
- package/dist/components/ui/calendar.d.ts +14 -0
- package/dist/components/ui/card-skeleton-aware.d.ts +2 -0
- package/dist/components/ui/card.d.ts +36 -0
- package/dist/components/ui/chart.d.ts +75 -0
- package/dist/components/ui/chat-bubble.d.ts +74 -0
- package/dist/components/ui/code.d.ts +85 -0
- package/dist/components/ui/code.js +21 -0
- package/dist/components/ui/code.js.map +9 -0
- package/dist/components/ui/collapsible.d.ts +25 -0
- package/dist/components/ui/control-group.d.ts +39 -0
- package/dist/components/ui/dashboard-grid/DashboardDropSlot.d.ts +10 -0
- package/dist/components/ui/dashboard-grid/DashboardGrid.d.ts +5 -0
- package/dist/components/ui/dashboard-grid/DashboardWidgetCard.d.ts +43 -0
- package/dist/components/ui/dashboard-grid/useDashboardDnd.d.ts +36 -0
- package/dist/components/ui/data-empty.d.ts +24 -0
- package/dist/components/ui/data-list.d.ts +16 -0
- package/dist/components/ui/data-table.d.ts +48 -0
- package/dist/components/ui/data-view/DataView.d.ts +46 -0
- package/dist/components/ui/data-view/DataViewCalendar.d.ts +18 -0
- package/dist/components/ui/data-view/DataViewContent.d.ts +5 -0
- package/dist/components/ui/data-view/DataViewFilter.d.ts +8 -0
- package/dist/components/ui/data-view/DataViewGrid.d.ts +32 -0
- package/dist/components/ui/data-view/DataViewHeader.d.ts +22 -0
- package/dist/components/ui/data-view/DataViewKanban.d.ts +16 -0
- package/dist/components/ui/data-view/DataViewPivot.d.ts +15 -0
- package/dist/components/ui/data-view/DataViewTable.d.ts +33 -0
- package/dist/components/ui/data-view/index.d.ts +9 -0
- package/dist/components/ui/date-time-picker.d.ts +205 -0
- package/dist/components/ui/drawer.d.ts +71 -0
- package/dist/components/ui/dropdown-animation.d.ts +7 -0
- package/dist/components/ui/dropdown.d.ts +71 -0
- package/dist/components/ui/error-state.d.ts +15 -0
- package/dist/components/ui/filter-bar.d.ts +50 -0
- package/dist/components/ui/filter-bar.js +19 -0
- package/dist/components/ui/filter-bar.js.map +9 -0
- package/dist/components/ui/font.d.ts +24 -0
- package/dist/components/ui/form-advanced.d.ts +198 -0
- package/dist/components/ui/form-compound.d.ts +58 -0
- package/dist/components/ui/form-context.d.ts +19 -0
- package/dist/components/ui/form.d.ts +451 -0
- package/dist/components/ui/format-currency.d.ts +10 -0
- package/dist/components/ui/format-date.d.ts +28 -0
- package/dist/components/ui/format-number.d.ts +22 -0
- package/dist/components/ui/format-time.d.ts +5 -0
- package/dist/components/ui/grid.d.ts +30 -0
- package/dist/components/ui/heading.d.ts +9 -0
- package/dist/components/ui/indicator.d.ts +17 -0
- package/dist/components/ui/initial-icon.d.ts +11 -0
- package/dist/components/ui/input-code.d.ts +27 -0
- package/dist/components/ui/input-grid.d.ts +54 -0
- package/dist/components/ui/input.d.ts +37 -0
- package/dist/components/ui/invoice-blocks.d.ts +124 -0
- package/dist/components/ui/invoice-document.d.ts +63 -0
- package/dist/components/ui/kanban.d.ts +16 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/lazy-load.d.ts +13 -0
- package/dist/components/ui/lightbox.d.ts +15 -0
- package/dist/components/ui/list.d.ts +33 -0
- package/dist/components/ui/loading.d.ts +79 -0
- package/dist/components/ui/media-card.d.ts +50 -0
- package/dist/components/ui/media-player.d.ts +47 -0
- package/dist/components/ui/menu.d.ts +24 -0
- package/dist/components/ui/modal.d.ts +233 -0
- package/dist/components/ui/page.d.ts +51 -0
- package/dist/components/ui/pagination.d.ts +16 -0
- package/dist/components/ui/print.d.ts +173 -0
- package/dist/components/ui/project-card.d.ts +43 -0
- package/dist/components/ui/radius-control.d.ts +36 -0
- package/dist/components/ui/rich-text-editor.d.ts +32 -0
- package/dist/components/ui/select-card.d.ts +56 -0
- package/dist/components/ui/sidebar-logo.d.ts +11 -0
- package/dist/components/ui/sidebar-menu.d.ts +82 -0
- package/dist/components/ui/sidebar-search.d.ts +7 -0
- package/dist/components/ui/skeletons.d.ts +46 -0
- package/dist/components/ui/surface.d.ts +13 -0
- package/dist/components/ui/table-pivot.d.ts +10 -0
- package/dist/components/ui/table.d.ts +258 -0
- package/dist/components/ui/tabs.d.ts +79 -0
- package/dist/components/ui/task-board.d.ts +29 -0
- package/dist/components/ui/terminal.d.ts +51 -0
- package/dist/components/ui/text-sensor.d.ts +9 -0
- package/dist/components/ui/theme-styler.d.ts +3 -0
- package/dist/components/ui/theme-toggle.d.ts +23 -0
- package/dist/components/ui/tooltip.d.ts +11 -0
- package/dist/components/website/account-banner.d.ts +11 -0
- package/dist/components/website/account-layout.d.ts +20 -0
- package/dist/components/website/account.d.ts +46 -0
- package/dist/components/website/ambient.d.ts +19 -0
- package/dist/components/website/auth.d.ts +35 -0
- package/dist/components/website/blog/blog-list-custom.d.ts +3 -0
- package/dist/components/website/blog/blog-list-gallery.d.ts +2 -0
- package/dist/components/website/blog/blog-list-grid.d.ts +2 -0
- package/dist/components/website/blog/blog-list-list.d.ts +2 -0
- package/dist/components/website/blog.d.ts +50 -0
- package/dist/components/website/carousel.d.ts +58 -0
- package/dist/components/website/cart.d.ts +31 -0
- package/dist/components/website/catalogue-view.d.ts +81 -0
- package/dist/components/website/catalogue.d.ts +96 -0
- package/dist/components/website/comment.d.ts +52 -0
- package/dist/components/website/eclipse.d.ts +15 -0
- package/dist/components/website/feature-grid.d.ts +58 -0
- package/dist/components/website/filter.d.ts +109 -0
- package/dist/components/website/hero.d.ts +89 -0
- package/dist/components/website/localize.d.ts +36 -0
- package/dist/components/website/logo.d.ts +24 -0
- package/dist/components/website/megamenu.d.ts +10 -0
- package/dist/components/website/navbar.d.ts +42 -0
- package/dist/components/website/notification.d.ts +58 -0
- package/dist/components/website/price.d.ts +26 -0
- package/dist/components/website/pricing.d.ts +21 -0
- package/dist/components/website/product.d.ts +32 -0
- package/dist/components/website/rating.d.ts +36 -0
- package/dist/components/website/review-form.d.ts +54 -0
- package/dist/components/website/reviews.d.ts +119 -0
- package/dist/components/website/search.d.ts +30 -0
- package/dist/entries/accordion.d.ts +1 -0
- package/dist/entries/accordion.js +9 -0
- package/dist/entries/accordion.js.map +9 -0
- package/dist/entries/alert.d.ts +1 -0
- package/dist/entries/alert.js +10 -0
- package/dist/entries/alert.js.map +9 -0
- package/dist/entries/badge.d.ts +1 -0
- package/dist/entries/badge.js +11 -0
- package/dist/entries/badge.js.map +9 -0
- package/dist/entries/breadcrumb.d.ts +1 -0
- package/dist/entries/breadcrumb.js +10 -0
- package/dist/entries/breadcrumb.js.map +9 -0
- package/dist/entries/button.d.ts +1 -0
- package/dist/entries/button.js +12 -0
- package/dist/entries/button.js.map +9 -0
- package/dist/entries/card.d.ts +1 -0
- package/dist/entries/card.js +25 -0
- package/dist/entries/card.js.map +9 -0
- package/dist/entries/chart.d.ts +1 -0
- package/dist/entries/chart.js +130 -0
- package/dist/entries/chart.js.map +10 -0
- package/dist/entries/components.d.ts +53 -0
- package/dist/entries/components.js +643 -0
- package/dist/entries/components.js.map +9 -0
- package/dist/entries/dashboard/dataview.d.ts +1 -0
- package/dist/entries/dashboard/dataview.js +82 -0
- package/dist/entries/dashboard/dataview.js.map +10 -0
- package/dist/entries/dashboard/pageformview.d.ts +1 -0
- package/dist/entries/dashboard/pageformview.js +34 -0
- package/dist/entries/dashboard/pageformview.js.map +9 -0
- package/dist/entries/data-table.d.ts +1 -0
- package/dist/entries/data-table.js +22 -0
- package/dist/entries/data-table.js.map +9 -0
- package/dist/entries/date-time-picker.d.ts +1 -0
- package/dist/entries/date-time-picker.js +28 -0
- package/dist/entries/date-time-picker.js.map +9 -0
- package/dist/entries/document.d.ts +1 -0
- package/dist/entries/document.js +69 -0
- package/dist/entries/document.js.map +10 -0
- package/dist/entries/drawer.d.ts +1 -0
- package/dist/entries/drawer.js +20 -0
- package/dist/entries/drawer.js.map +9 -0
- package/dist/entries/dropdown.d.ts +1 -0
- package/dist/entries/dropdown.js +29 -0
- package/dist/entries/dropdown.js.map +9 -0
- package/dist/entries/error-state.d.ts +1 -0
- package/dist/entries/error-state.js +14 -0
- package/dist/entries/error-state.js.map +9 -0
- package/dist/entries/favorite-button.d.ts +1 -0
- package/dist/entries/favorite-button.js +7 -0
- package/dist/entries/favorite-button.js.map +10 -0
- package/dist/entries/font.d.ts +1 -0
- package/dist/entries/font.js +10 -0
- package/dist/entries/font.js.map +9 -0
- package/dist/entries/form-advanced.d.ts +1 -0
- package/dist/entries/form-advanced.js +39 -0
- package/dist/entries/form-advanced.js.map +9 -0
- package/dist/entries/form.d.ts +1 -0
- package/dist/entries/form.js +74 -0
- package/dist/entries/form.js.map +9 -0
- package/dist/entries/heading.d.ts +1 -0
- package/dist/entries/heading.js +8 -0
- package/dist/entries/heading.js.map +9 -0
- package/dist/entries/input.d.ts +1 -0
- package/dist/entries/input.js +11 -0
- package/dist/entries/input.js.map +9 -0
- package/dist/entries/layout.d.ts +4 -0
- package/dist/entries/layout.js +101 -0
- package/dist/entries/layout.js.map +9 -0
- package/dist/entries/lazy-load.d.ts +1 -0
- package/dist/entries/lazy-load.js +9 -0
- package/dist/entries/lazy-load.js.map +9 -0
- package/dist/entries/list.d.ts +1 -0
- package/dist/entries/list.js +13 -0
- package/dist/entries/list.js.map +9 -0
- package/dist/entries/loading.d.ts +1 -0
- package/dist/entries/loading.js +18 -0
- package/dist/entries/loading.js.map +9 -0
- package/dist/entries/menu.d.ts +1 -0
- package/dist/entries/menu.js +17 -0
- package/dist/entries/menu.js.map +9 -0
- package/dist/entries/modal.d.ts +1 -0
- package/dist/entries/modal.js +33 -0
- package/dist/entries/modal.js.map +9 -0
- package/dist/entries/product.d.ts +2 -0
- package/dist/entries/product.js +10 -0
- package/dist/entries/product.js.map +9 -0
- package/dist/entries/select-card.d.ts +1 -0
- package/dist/entries/select-card.js +13 -0
- package/dist/entries/select-card.js.map +9 -0
- package/dist/entries/skeletons.d.ts +1 -0
- package/dist/entries/skeletons.js +35 -0
- package/dist/entries/skeletons.js.map +9 -0
- package/dist/entries/surface.d.ts +1 -0
- package/dist/entries/surface.js +10 -0
- package/dist/entries/surface.js.map +9 -0
- package/dist/entries/table.d.ts +1 -0
- package/dist/entries/table.js +65 -0
- package/dist/entries/table.js.map +9 -0
- package/dist/entries/tabs.d.ts +1 -0
- package/dist/entries/tabs.js +20 -0
- package/dist/entries/tabs.js.map +9 -0
- package/dist/entries/theme-styler.d.ts +1 -0
- package/dist/entries/theme-styler.js +26 -0
- package/dist/entries/theme-styler.js.map +9 -0
- package/dist/entries/toast.d.ts +1 -0
- package/dist/entries/toast.js +13 -0
- package/dist/entries/toast.js.map +9 -0
- package/dist/index.d.ts +163 -0
- package/dist/index.js +19864 -0
- package/dist/index.js.map +92 -0
- package/dist/lib/color/className.d.ts +14 -0
- package/dist/lib/color/config.d.ts +82 -0
- package/dist/lib/color/engine.d.ts +221 -0
- package/dist/lib/color/generator.d.ts +45 -0
- package/dist/lib/color/index.d.ts +5 -0
- package/dist/lib/color/safelist.d.ts +1 -0
- package/dist/lib/color/types.d.ts +12 -0
- package/dist/lib/font/config.d.ts +13 -0
- package/dist/lib/font/engine.d.ts +77 -0
- package/dist/lib/font/index.d.ts +3 -0
- package/dist/lib/font/types.d.ts +27 -0
- package/dist/lib/icon/config.d.ts +37 -0
- package/dist/lib/icon/engine.d.ts +84 -0
- package/dist/lib/icon/index.d.ts +3 -0
- package/dist/lib/icon/presets.d.ts +71 -0
- package/dist/lib/layout/config.d.ts +7 -0
- package/dist/lib/layout/engine.d.ts +224 -0
- package/dist/lib/layout/types.d.ts +151 -0
- package/dist/lib/layout/useActiveBreakpoint.d.ts +14 -0
- package/dist/lib/layout/useBlockDrag.d.ts +47 -0
- package/dist/lib/layout/useSectionDrag.d.ts +30 -0
- package/dist/lib/layout/useSpanResize.d.ts +31 -0
- package/dist/lib/localize/data.d.ts +9 -0
- package/dist/lib/product-utils.d.ts +7 -0
- package/dist/lib/sanitize/sanitizeHtml.d.ts +52 -0
- package/dist/lib/theme/motion.d.ts +27 -0
- package/dist/lib/theme/motion.js +12 -0
- package/dist/lib/theme/motion.js.map +9 -0
- package/dist/lib/theme/types.d.ts +133 -0
- package/dist/lib/useUndoRedo.d.ts +21 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/types/product.d.ts +27 -0
- package/package.json +442 -4
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fontStyle2
|
|
3
|
+
} from "./chunk-czbcw9e1.js";
|
|
4
|
+
|
|
5
|
+
// src/components/ui/loading.tsx
|
|
6
|
+
import { useEffect, useState } from "react";
|
|
7
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
8
|
+
function Spinner2({ className = "h-5 w-5", color = "text-loading" }) {
|
|
9
|
+
return /* @__PURE__ */ jsxDEV("svg", {
|
|
10
|
+
className: `animate-spin ${color} ${className}`,
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
fill: "none",
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsxDEV("circle", {
|
|
16
|
+
className: "opacity-25",
|
|
17
|
+
cx: "12",
|
|
18
|
+
cy: "12",
|
|
19
|
+
r: "10",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
strokeWidth: 4
|
|
22
|
+
}, undefined, false, undefined, this),
|
|
23
|
+
/* @__PURE__ */ jsxDEV("path", {
|
|
24
|
+
className: "opacity-75",
|
|
25
|
+
fill: "currentColor",
|
|
26
|
+
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"
|
|
27
|
+
}, undefined, false, undefined, this)
|
|
28
|
+
]
|
|
29
|
+
}, undefined, true, undefined, this);
|
|
30
|
+
}
|
|
31
|
+
function Skeleton2({ className = "" }) {
|
|
32
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
33
|
+
className: `animate-pulse rounded-md bg-[var(--color-muted)] ${className}`
|
|
34
|
+
}, undefined, false, undefined, this);
|
|
35
|
+
}
|
|
36
|
+
function ProgressBar2({ progress, className = "", color }) {
|
|
37
|
+
const colorClass = color === "danger" ? "bg-[color:var(--color-danger)]" : color === "warning" ? "bg-[color:var(--color-warning)]" : color === "success" ? "bg-[color:var(--color-success)]" : color === "primary" ? "bg-[color:var(--color-primary)]" : "bg-loading";
|
|
38
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
39
|
+
className: `h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-muted)] ${className}`,
|
|
40
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
|
41
|
+
className: `h-1.5 rounded-full ${color ? colorClass : "bg-loading"} transition-all duration-300 ease-out`,
|
|
42
|
+
style: { width: `${Math.min(100, Math.max(0, progress))}%` }
|
|
43
|
+
}, undefined, false, undefined, this)
|
|
44
|
+
}, undefined, false, undefined, this);
|
|
45
|
+
}
|
|
46
|
+
function CometTrail({
|
|
47
|
+
ballSize = 14,
|
|
48
|
+
trailLength = 28,
|
|
49
|
+
angleDeg = 0,
|
|
50
|
+
showBallBorder = true,
|
|
51
|
+
hideBall = false
|
|
52
|
+
}) {
|
|
53
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
54
|
+
className: "pointer-events-none absolute left-1/2",
|
|
55
|
+
style: {
|
|
56
|
+
width: trailLength,
|
|
57
|
+
height: trailLength,
|
|
58
|
+
marginLeft: -trailLength / 2,
|
|
59
|
+
top: "50%",
|
|
60
|
+
marginTop: -trailLength / 2,
|
|
61
|
+
transform: angleDeg ? `rotate(${angleDeg}deg)` : undefined
|
|
62
|
+
},
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
65
|
+
className: "absolute right-1/2 rounded-full opacity-70",
|
|
66
|
+
style: {
|
|
67
|
+
width: ballSize * 1.5,
|
|
68
|
+
height: ballSize * 0.95,
|
|
69
|
+
top: "50%",
|
|
70
|
+
marginTop: -(ballSize * 0.95) / 2,
|
|
71
|
+
background: "linear-gradient(to left, var(--color-loading), transparent)"
|
|
72
|
+
}
|
|
73
|
+
}, undefined, false, undefined, this),
|
|
74
|
+
!hideBall && /* @__PURE__ */ jsxDEV("div", {
|
|
75
|
+
className: `absolute left-1/2 rounded-full bg-loading shadow-sm ${showBallBorder ? "border border-white" : ""}`,
|
|
76
|
+
style: { width: ballSize, height: ballSize, top: "50%", marginLeft: -ballSize / 2, marginTop: -ballSize / 2 }
|
|
77
|
+
}, undefined, false, undefined, this),
|
|
78
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
79
|
+
className: "comet-particle h-[5px] w-[5px]",
|
|
80
|
+
style: { top: "calc(50% - 3px)", right: "50%", animationDelay: "0s", ["--comet-y"]: "-2px" }
|
|
81
|
+
}, undefined, false, undefined, this),
|
|
82
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
83
|
+
className: "comet-particle h-[4px] w-[4px]",
|
|
84
|
+
style: { top: "calc(50% + 2px)", right: "50%", animationDelay: "0.2s", ["--comet-y"]: "2px" }
|
|
85
|
+
}, undefined, false, undefined, this),
|
|
86
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
87
|
+
className: "comet-particle h-[3.5px] w-[3.5px]",
|
|
88
|
+
style: { top: "calc(50% - 1px)", right: "50%", animationDelay: "0.45s", ["--comet-y"]: "-3px" }
|
|
89
|
+
}, undefined, false, undefined, this),
|
|
90
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
91
|
+
className: "comet-particle h-[4px] w-[4px]",
|
|
92
|
+
style: { top: "calc(50% + 1px)", right: "50%", animationDelay: "0.65s", ["--comet-y"]: "3px" }
|
|
93
|
+
}, undefined, false, undefined, this)
|
|
94
|
+
]
|
|
95
|
+
}, undefined, true, undefined, this);
|
|
96
|
+
}
|
|
97
|
+
function SpinnerWithValue2({ progress, size = 56, strokeWidth = 5, className = "", animation = "comet" }) {
|
|
98
|
+
const clamped = Math.min(100, Math.max(0, progress));
|
|
99
|
+
const radius = (size - strokeWidth) / 2;
|
|
100
|
+
const circumference = 2 * Math.PI * radius;
|
|
101
|
+
const dashOffset = circumference * (1 - clamped / 100);
|
|
102
|
+
const angleRad = clamped / 100 * 2 * Math.PI - Math.PI / 2;
|
|
103
|
+
const dotX = size / 2 + radius * Math.cos(angleRad);
|
|
104
|
+
const dotY = size / 2 + radius * Math.sin(angleRad);
|
|
105
|
+
const cometAngleDeg = angleRad * 180 / Math.PI + 90;
|
|
106
|
+
const showDot = clamped > 0 && clamped < 100 && animation !== "spinning";
|
|
107
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
108
|
+
className: `relative inline-flex items-center justify-center ${className}`,
|
|
109
|
+
style: { width: size, height: size },
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsxDEV("svg", {
|
|
112
|
+
width: size,
|
|
113
|
+
height: size,
|
|
114
|
+
className: `-rotate-90 ${animation === "spinning" ? "animate-spin" : ""}`,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsxDEV("circle", {
|
|
117
|
+
cx: size / 2,
|
|
118
|
+
cy: size / 2,
|
|
119
|
+
r: radius,
|
|
120
|
+
fill: "none",
|
|
121
|
+
stroke: "currentColor",
|
|
122
|
+
strokeWidth,
|
|
123
|
+
className: "text-[color:var(--color-muted)]"
|
|
124
|
+
}, undefined, false, undefined, this),
|
|
125
|
+
/* @__PURE__ */ jsxDEV("circle", {
|
|
126
|
+
cx: size / 2,
|
|
127
|
+
cy: size / 2,
|
|
128
|
+
r: radius,
|
|
129
|
+
fill: "none",
|
|
130
|
+
stroke: "currentColor",
|
|
131
|
+
strokeWidth,
|
|
132
|
+
strokeLinecap: "round",
|
|
133
|
+
strokeDasharray: circumference,
|
|
134
|
+
strokeDashoffset: dashOffset,
|
|
135
|
+
className: "text-loading transition-[stroke-dashoffset] duration-300 ease-out"
|
|
136
|
+
}, undefined, false, undefined, this)
|
|
137
|
+
]
|
|
138
|
+
}, undefined, true, undefined, this),
|
|
139
|
+
showDot && animation === "comet" && /* @__PURE__ */ jsxDEV("div", {
|
|
140
|
+
className: "absolute h-0 w-0 transition-[left,top] duration-300 ease-out",
|
|
141
|
+
style: { left: dotX, top: dotY },
|
|
142
|
+
children: /* @__PURE__ */ jsxDEV(CometTrail, {
|
|
143
|
+
ballSize: 7,
|
|
144
|
+
trailLength: 16,
|
|
145
|
+
angleDeg: cometAngleDeg,
|
|
146
|
+
showBallBorder: false
|
|
147
|
+
}, undefined, false, undefined, this)
|
|
148
|
+
}, undefined, false, undefined, this),
|
|
149
|
+
showDot && (animation === "default" || animation === "pulse") && /* @__PURE__ */ jsxDEV("div", {
|
|
150
|
+
className: "absolute h-2 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-loading transition-[left,top] duration-300 ease-out",
|
|
151
|
+
style: { left: dotX, top: dotY },
|
|
152
|
+
children: animation === "pulse" && /* @__PURE__ */ jsxDEV("span", {
|
|
153
|
+
className: "absolute inset-0 animate-ping rounded-full bg-loading opacity-75"
|
|
154
|
+
}, undefined, false, undefined, this)
|
|
155
|
+
}, undefined, false, undefined, this),
|
|
156
|
+
animation !== "spinning" && /* @__PURE__ */ jsxDEV("span", {
|
|
157
|
+
className: "absolute text-[color:var(--color-background-foreground)]",
|
|
158
|
+
style: { ...fontStyle2("small-text"), fontWeight: 600 },
|
|
159
|
+
children: [
|
|
160
|
+
Math.round(clamped),
|
|
161
|
+
"%"
|
|
162
|
+
]
|
|
163
|
+
}, undefined, true, undefined, this)
|
|
164
|
+
]
|
|
165
|
+
}, undefined, true, undefined, this);
|
|
166
|
+
}
|
|
167
|
+
function SkeletonWithValue2({ progress, label = "Loading", className = "h-8 w-40", animation = "default" }) {
|
|
168
|
+
const [dotCount, setDotCount] = useState(1);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
const interval = setInterval(() => {
|
|
171
|
+
setDotCount((prev) => prev >= 3 ? 1 : prev + 1);
|
|
172
|
+
}, 400);
|
|
173
|
+
return () => clearInterval(interval);
|
|
174
|
+
}, []);
|
|
175
|
+
const suffix = progress === undefined ? "" : ` ${Math.round(Math.min(100, Math.max(0, progress)))}%`;
|
|
176
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
177
|
+
className: `relative flex items-center justify-center overflow-hidden rounded-md bg-[var(--color-skeleton)] ${animation === "pulse" ? "animate-pulse" : ""} ${className}`,
|
|
178
|
+
children: /* @__PURE__ */ jsxDEV("span", {
|
|
179
|
+
className: "text-[color:var(--color-skeleton-foreground)]",
|
|
180
|
+
style: fontStyle2("caption"),
|
|
181
|
+
children: [
|
|
182
|
+
label,
|
|
183
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
184
|
+
className: "inline-block w-3 text-left",
|
|
185
|
+
children: ".".repeat(dotCount)
|
|
186
|
+
}, undefined, false, undefined, this),
|
|
187
|
+
suffix
|
|
188
|
+
]
|
|
189
|
+
}, undefined, true, undefined, this)
|
|
190
|
+
}, undefined, false, undefined, this);
|
|
191
|
+
}
|
|
192
|
+
var COMET_BALL_SIZE = 10;
|
|
193
|
+
var COMET_BALL_HOVER_SCALE = 2.2;
|
|
194
|
+
function ProgressBarWithValue2({ progress, className = "", animation = "comet" }) {
|
|
195
|
+
const clamped = Math.min(100, Math.max(0, progress));
|
|
196
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
197
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
198
|
+
className: `relative w-full pt-5 ${className}`,
|
|
199
|
+
onMouseEnter: () => setIsHovering(true),
|
|
200
|
+
onMouseLeave: () => setIsHovering(false),
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
203
|
+
className: "h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-muted)]",
|
|
204
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
|
205
|
+
className: `relative h-1.5 overflow-hidden rounded-full bg-loading transition-all duration-300 ease-out ${animation === "spinning" ? "shimmer-sweep" : ""}`,
|
|
206
|
+
style: { width: `${clamped}%` }
|
|
207
|
+
}, undefined, false, undefined, this)
|
|
208
|
+
}, undefined, false, undefined, this),
|
|
209
|
+
(animation === "default" || animation === "pulse" || animation === "comet") && /* @__PURE__ */ jsxDEV("div", {
|
|
210
|
+
className: "absolute -translate-x-1/2 -translate-y-1/2 transition-[left,top] duration-300 ease-out",
|
|
211
|
+
style: { left: `${clamped}%`, top: 23 },
|
|
212
|
+
children: [
|
|
213
|
+
animation === "comet" && /* @__PURE__ */ jsxDEV("div", {
|
|
214
|
+
className: "relative h-3.5 w-3.5",
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ jsxDEV(CometTrail, {
|
|
217
|
+
ballSize: COMET_BALL_SIZE,
|
|
218
|
+
showBallBorder: false,
|
|
219
|
+
hideBall: true
|
|
220
|
+
}, undefined, false, undefined, this),
|
|
221
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
222
|
+
className: "absolute left-1/2 top-1/2 z-[2] flex cursor-default items-center justify-center overflow-hidden rounded-full bg-loading shadow-sm transition-transform duration-300",
|
|
223
|
+
style: {
|
|
224
|
+
width: COMET_BALL_SIZE,
|
|
225
|
+
height: COMET_BALL_SIZE,
|
|
226
|
+
marginLeft: -COMET_BALL_SIZE / 2,
|
|
227
|
+
marginTop: -COMET_BALL_SIZE / 2,
|
|
228
|
+
transform: isHovering ? `scale(${COMET_BALL_HOVER_SCALE})` : "scale(1)",
|
|
229
|
+
transitionTimingFunction: isHovering ? "cubic-bezier(0.34, 1.35, 0.64, 1)" : "ease-in"
|
|
230
|
+
},
|
|
231
|
+
children: /* @__PURE__ */ jsxDEV("span", {
|
|
232
|
+
className: "whitespace-nowrap text-[4.5px] font-bold leading-none text-white transition-opacity duration-150",
|
|
233
|
+
style: { opacity: isHovering ? 1 : 0, transitionDelay: isHovering ? "120ms" : "0ms", transform: "translateY(0.5px)" },
|
|
234
|
+
children: Math.round(clamped)
|
|
235
|
+
}, undefined, false, undefined, this)
|
|
236
|
+
}, undefined, false, undefined, this)
|
|
237
|
+
]
|
|
238
|
+
}, undefined, true, undefined, this),
|
|
239
|
+
(animation === "default" || animation === "pulse") && /* @__PURE__ */ jsxDEV("div", {
|
|
240
|
+
className: "relative h-2.5 w-2.5 rounded-full bg-loading",
|
|
241
|
+
children: animation === "pulse" && /* @__PURE__ */ jsxDEV("span", {
|
|
242
|
+
className: "absolute inset-0 animate-ping rounded-full bg-loading opacity-75"
|
|
243
|
+
}, undefined, false, undefined, this)
|
|
244
|
+
}, undefined, false, undefined, this)
|
|
245
|
+
]
|
|
246
|
+
}, undefined, true, undefined, this)
|
|
247
|
+
]
|
|
248
|
+
}, undefined, true, undefined, this);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export { Spinner2, Skeleton2, ProgressBar2, SpinnerWithValue2, SkeletonWithValue2, ProgressBarWithValue2 };
|
|
252
|
+
|
|
253
|
+
//# debugId=656F1C05E395340064756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/ui/loading.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/** Diadaptasi dari Cyclopedia-New/app/components/ui/Loading.tsx. */\nimport { useEffect, useState, type CSSProperties } from 'react'\nimport { fontStyle } from '../../lib/font'\n\nexport function Spinner({ className = 'h-5 w-5', color = 'text-loading' }: { className?: string; color?: string }) {\n return (\n <svg className={`animate-spin ${color} ${className}`} xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth={4} />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n 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\"\n />\n </svg>\n )\n}\n\nexport function Skeleton({ className = '' }: { className?: string }) {\n return <div className={`animate-pulse rounded-md bg-[var(--color-muted)] ${className}`} />\n}\n\nexport interface ProgressBarProps {\n progress: number\n className?: string\n color?: 'primary' | 'danger' | 'warning' | 'success' | string\n}\n\nexport function ProgressBar({ progress, className = '', color }: ProgressBarProps) {\n const colorClass = color === 'danger'\n ? 'bg-[color:var(--color-danger)]'\n : color === 'warning'\n ? 'bg-[color:var(--color-warning)]'\n : color === 'success'\n ? 'bg-[color:var(--color-success)]'\n : color === 'primary'\n ? 'bg-[color:var(--color-primary)]'\n : 'bg-loading'\n\n return (\n <div className={`h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-muted)] ${className}`}>\n <div\n className={`h-1.5 rounded-full ${color ? colorClass : 'bg-loading'} transition-all duration-300 ease-out`}\n style={{ width: `${Math.min(100, Math.max(0, progress))}%` }}\n />\n </div>\n )\n}\n\n/**\n * Efek komet reusable -- dipakai di ProgressBarWithValue (Line bar) dan SpinnerWithValue\n * (Circle). Positioning pakai top:50%/left:50% + margin negatif (BUKAN transform:translate)\n * -- request eksplisit \"pake margin-top aja\". Bola (kepala komet, posisi progress) TETAP\n * fill biru solid seperti semula -- border-putih/fill-putih itu punya .comet-particle\n * (serpihan), BUKAN bola (dikoreksi 2026-07-28, sempat salah taruh style itu di bola).\n * Partikel di-render SETELAH bola dalam DOM + z-index (lihat .comet-particle di\n * ui-kit.css) supaya SELALU tampak di depan bola, tidak pernah ketutup.\n */\nfunction CometTrail({\n ballSize = 14,\n trailLength = 28,\n angleDeg = 0,\n showBallBorder = true,\n hideBall = false,\n}: {\n ballSize?: number\n trailLength?: number\n angleDeg?: number\n /** Border putih di bola -- default true (Line bar). Circle minta dihilangkan (2026-07-28). */\n showBallBorder?: boolean\n /** Sembunyikan bola bawaan -- dipakai saat konsumen render bola sendiri terpisah (mis.\n * ProgressBarWithValue butuh bola hoverable+angka di dalamnya, ekor/partikel tetap dari\n * CometTrail supaya tidak terganggu animasi hover). Default false (bola tetap tampil). */\n hideBall?: boolean\n}) {\n // trailLength dulu FIXED 28px (h-7 w-7) di semua konteks -- di SpinnerWithValue (circle),\n // ekor sepanjang itu menjorok keluar dari lengkungan ring, kelihatan \"kepotong\"/nongol di\n // luar stroke (dilaporkan 2026-07-28). Line bar (lurus, banyak ruang datar) tetap pakai\n // ekor panjang; circle butuh ekor lebih pendek.\n // angleDeg -- dikembalikan (sempat dihapus total, ternyata Circle BUTUH ini supaya ekor\n // ikut kurva melingkar, dilaporkan 2026-07-28: \"arahnya tidak mengikuti circle yang\n // melingkar\"). Line bar pakai default 0 (ekor ke kiri, tidak perlu rotate).\n return (\n <div\n className=\"pointer-events-none absolute left-1/2\"\n style={{\n width: trailLength,\n height: trailLength,\n marginLeft: -trailLength / 2,\n top: '50%',\n marginTop: -trailLength / 2,\n transform: angleDeg ? `rotate(${angleDeg}deg)` : undefined,\n }}\n >\n {/* Tail dibalikin ke ukuran/opacity semula (width ballSize*1.5, height ballSize*0.95,\n opacity-70) -- request 2026-07-28 sebelumnya untuk kecilkan tail dibatalkan,\n sekarang yang dikecilkan cuma ballSize bola-nya sendiri (lihat pemanggilan\n CometTrail di Line bar/Circle). */}\n <div\n className=\"absolute right-1/2 rounded-full opacity-70\"\n style={{\n width: ballSize * 1.5,\n height: ballSize * 0.95,\n top: '50%',\n marginTop: -(ballSize * 0.95) / 2,\n background: 'linear-gradient(to left, var(--color-loading), transparent)',\n }}\n />\n {/* Bola -- kepala komet, fill biru solid, TIDAK ikut animasi/z-index khusus (default\n di belakang partikel, sesuai urutan DOM). Circle: border dihilangkan total\n (showBallBorder=false) -- request eksplisit 2026-07-28 \"untuk circle border di\n hilangkan aja\". Line bar tetap border-1 putih (default showBallBorder=true).\n hideBall -- skip render sepenuhnya kalau konsumen pakai bola custom sendiri. */}\n {!hideBall && (\n <div\n className={`absolute left-1/2 rounded-full bg-loading shadow-sm ${showBallBorder ? 'border border-white' : ''}`}\n style={{ width: ballSize, height: ballSize, top: '50%', marginLeft: -ballSize / 2, marginTop: -ballSize / 2 }}\n />\n )}\n {/* Partikel -- DI BAWAH JSX-nya bola supaya di DOM order lebih belakang (default\n stacking context render di atas), PLUS z-index eksplisit di .comet-particle\n (ui-kit.css) sebagai jaminan ganda supaya selalu di depan bola. */}\n {/* Ukuran partikel diperbesar (dari 2-3px jadi 4-5px) -- request eksplisit 2026-07-28\n \"besarin aja sparkle2 meteorid nya\". */}\n <span className=\"comet-particle h-[5px] w-[5px]\" style={{ top: 'calc(50% - 3px)', right: '50%', animationDelay: '0s', ['--comet-y' as string]: '-2px' } as CSSProperties} />\n <span className=\"comet-particle h-[4px] w-[4px]\" style={{ top: 'calc(50% + 2px)', right: '50%', animationDelay: '0.2s', ['--comet-y' as string]: '2px' } as CSSProperties} />\n <span className=\"comet-particle h-[3.5px] w-[3.5px]\" style={{ top: 'calc(50% - 1px)', right: '50%', animationDelay: '0.45s', ['--comet-y' as string]: '-3px' } as CSSProperties} />\n <span className=\"comet-particle h-[4px] w-[4px]\" style={{ top: 'calc(50% + 1px)', right: '50%', animationDelay: '0.65s', ['--comet-y' as string]: '3px' } as CSSProperties} />\n </div>\n )\n}\n\n/**\n * Progress ring -- keliling lingkarannya terisi sesuai persentase progress (pola donut\n * chart), dengan angka % di tengah. stroke-dasharray/dashoffset dihitung dari circumference\n * lingkaran (2*PI*r) -- satu-satunya cara native SVG untuk progress ring tanpa canvas/\n * library tambahan.\n *\n * 4 mode animation (2026-07-28):\n * - 'default': ring diam total, dot kecil statis di ujung progress (penanda posisi, tanpa\n * animasi apapun).\n * - 'pulse': dot di ujung ber-animate-ping (ripple menyebar-memudar, Tailwind built-in).\n * - 'comet': efek komet (ekor+partikel menyebar, implementasi sebelumnya) -- default lama,\n * sekarang jadi salah satu dari beberapa pilihan.\n * - 'spinning': SELURUH svg (bukan cuma arc progress) rotate continuous (animate-spin) --\n * ring donut penuh (track+isi) tetap kelihatan bentuknya, beda dari Spinner biasa yang\n * cuma arc pendek berputar.\n */\nexport interface SpinnerWithValueProps {\n /** 0-100. */\n progress: number\n size?: number\n strokeWidth?: number\n className?: string\n animation?: 'default' | 'pulse' | 'comet' | 'spinning'\n}\n\nexport function SpinnerWithValue({ progress, size = 56, strokeWidth = 5, className = '', animation = 'comet' }: SpinnerWithValueProps) {\n const clamped = Math.min(100, Math.max(0, progress))\n const radius = (size - strokeWidth) / 2\n const circumference = 2 * Math.PI * radius\n const dashOffset = circumference * (1 - clamped / 100)\n\n // Posisi dot di ujung stroke progress -- sudut dihitung dari jam 12 (bukan jam 3), karena\n // svg di-rotate -90deg supaya progress mulai dari atas (pola umum progress ring). 0% =\n // titik di jam 12 (tidak terlihat, dashoffset penuh), 100% = kembali ke jam 12 dari arah\n // berlawanan. Dipakai oleh mode default/pulse/comet -- TIDAK dipakai mode spinning (dot\n // tidak relevan saat seluruh ring berputar).\n const angleRad = (clamped / 100) * 2 * Math.PI - Math.PI / 2\n const dotX = size / 2 + radius * Math.cos(angleRad)\n const dotY = size / 2 + radius * Math.sin(angleRad)\n // Arah ekor komet = tangensial (tegak lurus radius, mengarah ke titik yang BARU DILEWATI\n // di sepanjang kurva, bukan menusuk lurus keluar/dalam) -- cuma dipakai mode 'comet'.\n const cometAngleDeg = (angleRad * 180) / Math.PI + 90\n\n const showDot = clamped > 0 && clamped < 100 && animation !== 'spinning'\n\n return (\n <div className={`relative inline-flex items-center justify-center ${className}`} style={{ width: size, height: size }}>\n <svg width={size} height={size} className={`-rotate-90 ${animation === 'spinning' ? 'animate-spin' : ''}`}>\n <circle cx={size / 2} cy={size / 2} r={radius} fill=\"none\" stroke=\"currentColor\" strokeWidth={strokeWidth} className=\"text-[color:var(--color-muted)]\" />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n className=\"text-loading transition-[stroke-dashoffset] duration-300 ease-out\"\n />\n </svg>\n {showDot && animation === 'comet' && (\n <div className=\"absolute h-0 w-0 transition-[left,top] duration-300 ease-out\" style={{ left: dotX, top: dotY }}>\n <CometTrail ballSize={7} trailLength={16} angleDeg={cometAngleDeg} showBallBorder={false} />\n </div>\n )}\n {showDot && (animation === 'default' || animation === 'pulse') && (\n <div\n className=\"absolute h-2 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-loading transition-[left,top] duration-300 ease-out\"\n style={{ left: dotX, top: dotY }}\n >\n {animation === 'pulse' && <span className=\"absolute inset-0 animate-ping rounded-full bg-loading opacity-75\" />}\n </div>\n )}\n {/* Angka % disembunyikan saat spinning -- ring-nya sendiri berputar terus, angka\n statis di tengah yang diam kontras aneh dengan ring yang muter (dan progress\n \"seberapa jauh\" jadi kurang relevan saat mode ini dipakai buat \"lagi proses\"\n generik, bukan progress presisi). */}\n {animation !== 'spinning' && (\n <span className=\"absolute text-[color:var(--color-background-foreground)]\" style={{...fontStyle('small-text'), fontWeight: 600}}>{Math.round(clamped)}%</span>\n )}\n </div>\n )\n}\n\n/**\n * Skeleton dengan teks \"Loading\" + titik animasi (1->3 berulang) di tengah -- progress\n * opsional, kalau diisi tampil \"Loading N%\". animation=\"default\": BG diam, cuma titik\n * \"...\" yang animasi. animation=\"pulse\": BG animate-pulse DITAMBAH titik animasi (teks\n * lain -- \"Loading\" dan angka % -- TIDAK ikut fade pulse, cuma BG-nya) -- request\n * eksplisit 2026-07-28: \"yang di animasikan cmn BG nya aja textnya jangan dianimasikan\n * secara pulsa, tapi dianimasikan titik '...' itu akan bergerak dari titik satu ke titik\n * tiga berulang\". Titik dihitung via useState+setInterval (bukan CSS keyframe) karena\n * butuh 4 STATE DISKRIT (0/1/2/3 titik), bukan interpolasi kontinyu yang jadi ranah CSS.\n */\nexport interface SkeletonWithValueProps {\n /** 0-100, opsional -- kalau diisi tampil \"Loading N%\", kalau tidak cuma \"Loading\". */\n progress?: number\n label?: string\n className?: string\n animation?: 'default' | 'pulse'\n}\n\nexport function SkeletonWithValue({ progress, label = 'Loading', className = 'h-8 w-40', animation = 'default' }: SkeletonWithValueProps) {\n const [dotCount, setDotCount] = useState(1)\n\n useEffect(() => {\n const interval = setInterval(() => {\n setDotCount((prev) => (prev >= 3 ? 1 : prev + 1))\n }, 400)\n return () => clearInterval(interval)\n }, [])\n\n const suffix = progress === undefined ? '' : ` ${Math.round(Math.min(100, Math.max(0, progress)))}%`\n\n return (\n <div className={`relative flex items-center justify-center overflow-hidden rounded-md bg-[var(--color-skeleton)] ${animation === 'pulse' ? 'animate-pulse' : ''} ${className}`}>\n <span className=\"text-[color:var(--color-skeleton-foreground)]\" style={fontStyle('caption')}>\n {label}\n {/* Lebar titik di-reserve pakai inline-block w-3 -- tanpa ini teks di sebelahnya\n (suffix %) ikut geser kiri-kanan setiap dotCount berubah, karena \"...\" vs \".\" vs\n \"..\" punya lebar beda. */}\n <span className=\"inline-block w-3 text-left\">{'.'.repeat(dotCount)}</span>\n {suffix}\n </span>\n </div>\n )\n}\n\n/**\n * Progress bar dengan handle bulat di ujung progress, angka % tampil di atas handle.\n * Beda dari ProgressBar biasa (bar polos tanpa indikator posisi) -- dipakai saat user perlu\n * lihat titik progress persis + nilainya, mirip slider yang \"jalan sendiri\" (bukan\n * draggable, murni display).\n */\n/**\n * 4 mode animation (2026-07-28), sama seperti SpinnerWithValue:\n * - 'default': dot statis di ujung progress, tanpa hover-zoom.\n * - 'pulse': dot dengan animate-ping (ripple).\n * - 'comet': efek komet lengkap (ekor+partikel+bola hoverable membesar dengan angka di\n * dalamnya) -- default lama, sekarang salah satu pilihan.\n * - 'spinning': track bar dapat border marching-ants (dashed bergerak), TIDAK ada dot/bola\n * sama sekali -- progress tetap keliatan dari lebar fill, tapi indikator \"sedang proses\"\n * dari border yang jalan, bukan dari titik di ujung.\n */\nexport interface ProgressBarWithValueProps {\n /** 0-100. */\n progress: number\n className?: string\n animation?: 'default' | 'pulse' | 'comet' | 'spinning'\n}\n\nconst COMET_BALL_SIZE = 10\n// Bola membesar 2.2x saat hover -- cukup besar supaya angka % di dalamnya kebaca (text-[9px]\n// muat di ballSize*2.2 = 22px), tidak berlebihan sampai nutup progress bar lain di sekitarnya.\nconst COMET_BALL_HOVER_SCALE = 2.2\n\nexport function ProgressBarWithValue({ progress, className = '', animation = 'comet' }: ProgressBarWithValueProps) {\n const clamped = Math.min(100, Math.max(0, progress))\n const [isHovering, setIsHovering] = useState(false)\n\n return (\n // pt-5 -- ruang untuk dot/bola di atas track bar (mode comet butuh headroom bola\n // membesar saat hover, mode lain juga dikasih ruang sama supaya posisi track konsisten\n // saat animation di-switch).\n // onMouseEnter/Leave di container ini -- cuma relevan untuk mode 'comet' (hover-zoom),\n // tidak berefek apapun di mode lain (isHovering tidak dibaca di luar comet).\n <div\n className={`relative w-full pt-5 ${className}`}\n onMouseEnter={() => setIsHovering(true)}\n onMouseLeave={() => setIsHovering(false)}\n >\n <div className=\"h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-muted)]\">\n <div\n className={`relative h-1.5 overflow-hidden rounded-full bg-loading transition-all duration-300 ease-out ${animation === 'spinning' ? 'shimmer-sweep' : ''}`}\n style={{ width: `${clamped}%` }}\n />\n </div>\n {(animation === 'default' || animation === 'pulse' || animation === 'comet') && (\n <div\n className=\"absolute -translate-x-1/2 -translate-y-1/2 transition-[left,top] duration-300 ease-out\"\n style={{ left: `${clamped}%`, top: 23 }}\n >\n {animation === 'comet' && (\n <div className=\"relative h-3.5 w-3.5\">\n <CometTrail ballSize={COMET_BALL_SIZE} showBallBorder={false} hideBall />\n {/* z-index: 2 -- .comet-particle (ui-kit.css) punya z-index:1, bola+angka\n HARUS di atasnya supaya sparkle tidak menutupi angka. */}\n <div\n className=\"absolute left-1/2 top-1/2 z-[2] flex cursor-default items-center justify-center overflow-hidden rounded-full bg-loading shadow-sm transition-transform duration-300\"\n style={{\n width: COMET_BALL_SIZE,\n height: COMET_BALL_SIZE,\n marginLeft: -COMET_BALL_SIZE / 2,\n marginTop: -COMET_BALL_SIZE / 2,\n transform: isHovering ? `scale(${COMET_BALL_HOVER_SCALE})` : 'scale(1)',\n // Bounce -- overshoot ringan (sama seperti Modal animation=\"bounce\").\n transitionTimingFunction: isHovering ? 'cubic-bezier(0.34, 1.35, 0.64, 1)' : 'ease-in',\n }}\n >\n <span\n className=\"whitespace-nowrap text-[4.5px] font-bold leading-none text-white transition-opacity duration-150\"\n style={{ opacity: isHovering ? 1 : 0, transitionDelay: isHovering ? '120ms' : '0ms', transform: 'translateY(0.5px)' }}\n >\n {Math.round(clamped)}\n </span>\n </div>\n </div>\n )}\n {(animation === 'default' || animation === 'pulse') && (\n <div className=\"relative h-2.5 w-2.5 rounded-full bg-loading\">\n {animation === 'pulse' && <span className=\"absolute inset-0 animate-ping rounded-full bg-loading opacity-75\" />}\n </div>\n )}\n </div>\n )}\n </div>\n )\n}\n\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;AACA;;AAGO,SAAS,QAAO,GAAG,YAAY,WAAW,QAAQ,kBAA0D;AAAA,EACjH,uBACE,OAAC,OAAD;AAAA,IAAK,WAAW,gBAAgB,SAAS;AAAA,IAAa,OAAM;AAAA,IAA6B,MAAK;AAAA,IAAO,SAAQ;AAAA,IAA7G,UAOE;AAAA,sBANA,OAAC,UAAD;AAAA,QAAQ,WAAU;AAAA,QAAa,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,QAAO;AAAA,QAAe,aAAa;AAAA,SAAzF,iCAA4F;AAAA,sBAC5F,OAAC,QAAD;AAAA,QACE,WAAU;AAAA,QACV,MAAK;AAAA,QACL,GAAE;AAAA,SAHJ,iCAIA;AAAA;AAAA,KANF,gCAOE;AAAA;AAIC,SAAS,SAAQ,GAAG,YAAY,MAA8B;AAAA,EACnE,uBAAO,OAAC,OAAD;AAAA,IAAK,WAAW,oDAAoD;AAAA,KAApE,iCAAiF;AAAA;AASnF,SAAS,YAAW,GAAG,UAAU,YAAY,IAAI,SAA2B;AAAA,EACjF,MAAM,aAAa,UAAU,WACzB,mCACA,UAAU,YACV,oCACA,UAAU,YACV,oCACA,UAAU,YACV,oCACA;AAAA,EAEJ,uBACE,OAAC,OAAD;AAAA,IAAK,WAAW,qEAAqE;AAAA,IAArF,0BACE,OAAC,OAAD;AAAA,MACE,WAAW,sBAAsB,QAAQ,aAAa;AAAA,MACtD,OAAO,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,QAAQ,CAAC,KAA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
|
9
|
+
};
|
|
10
|
+
var EASING_CSS_MAP = {
|
|
11
|
+
natural: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
12
|
+
spring: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
13
|
+
smooth: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
14
|
+
linear: "linear"
|
|
15
|
+
};
|
|
16
|
+
var PRESET_LEVEL_MAP = {
|
|
17
|
+
none: 0,
|
|
18
|
+
minimal: 2,
|
|
19
|
+
normal: 5,
|
|
20
|
+
expressive: 7,
|
|
21
|
+
playful: 10
|
|
22
|
+
};
|
|
23
|
+
function resolveMotion2(input = 5) {
|
|
24
|
+
let rawLevel = 5;
|
|
25
|
+
let customSpeed;
|
|
26
|
+
let customEasing;
|
|
27
|
+
let customAction;
|
|
28
|
+
if (typeof input === "number") {
|
|
29
|
+
rawLevel = Math.max(0, Math.min(10, Math.round(input)));
|
|
30
|
+
} else if (typeof input === "string") {
|
|
31
|
+
rawLevel = PRESET_LEVEL_MAP[input] ?? 5;
|
|
32
|
+
} else if (typeof input === "object" && input !== null) {
|
|
33
|
+
const intensity = input.intensity;
|
|
34
|
+
if (typeof intensity === "number") {
|
|
35
|
+
rawLevel = Math.max(0, Math.min(10, Math.round(intensity)));
|
|
36
|
+
} else if (typeof intensity === "string") {
|
|
37
|
+
rawLevel = PRESET_LEVEL_MAP[intensity] ?? 5;
|
|
38
|
+
}
|
|
39
|
+
customSpeed = input.speed;
|
|
40
|
+
customEasing = input.easing;
|
|
41
|
+
customAction = input.action_effect;
|
|
42
|
+
}
|
|
43
|
+
let preset = "normal";
|
|
44
|
+
if (rawLevel === 0)
|
|
45
|
+
preset = "none";
|
|
46
|
+
else if (rawLevel <= 3)
|
|
47
|
+
preset = "minimal";
|
|
48
|
+
else if (rawLevel <= 6)
|
|
49
|
+
preset = "normal";
|
|
50
|
+
else if (rawLevel <= 8)
|
|
51
|
+
preset = "expressive";
|
|
52
|
+
else
|
|
53
|
+
preset = "playful";
|
|
54
|
+
const defaultSpeed = rawLevel === 0 ? "none" : rawLevel <= 3 ? "fast" : rawLevel <= 6 ? "normal" : "slow";
|
|
55
|
+
const speed = customSpeed || defaultSpeed;
|
|
56
|
+
const durationMs = SPEED_DURATION_MAP[speed] ?? 250;
|
|
57
|
+
const easing = customEasing || "natural";
|
|
58
|
+
const easingCss = EASING_CSS_MAP[easing] ?? "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
59
|
+
const defaultAction = rawLevel <= 3 ? "tactile" : "ripple";
|
|
60
|
+
const action = customAction || defaultAction;
|
|
61
|
+
return {
|
|
62
|
+
level: rawLevel,
|
|
63
|
+
enabled: rawLevel > 0,
|
|
64
|
+
preset,
|
|
65
|
+
speed,
|
|
66
|
+
durationMs,
|
|
67
|
+
easing,
|
|
68
|
+
easingCss,
|
|
69
|
+
action,
|
|
70
|
+
hasDelight: rawLevel >= 8
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function getMotionDurationMs2(speed = "normal") {
|
|
74
|
+
return SPEED_DURATION_MAP[speed] ?? 250;
|
|
75
|
+
}
|
|
76
|
+
function getMotionEasingCss2(easing = "natural") {
|
|
77
|
+
return EASING_CSS_MAP[easing] ?? "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { resolveMotion2, getMotionDurationMs2, getMotionEasingCss2 };
|
|
81
|
+
|
|
82
|
+
//# debugId=0125239BF71C474D64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/theme/motion.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { \n DewebMotionSpeed, \n DewebMotionEasing, \n DewebMotionPreset, \n DewebMotionIntensity, \n ThemeMotionConfig, \n DewebMotionAction \n} from './types'\n\nexport interface ResolvedMotionSettings {\n level: number\n enabled: boolean\n preset: DewebMotionPreset\n speed: DewebMotionSpeed\n durationMs: number\n easing: DewebMotionEasing\n easingCss: string\n action: DewebMotionAction\n hasDelight: boolean\n}\n\nconst SPEED_DURATION_MAP: Record<DewebMotionSpeed, number> = {\n none: 0,\n instant: 75,\n fast: 150,\n normal: 250,\n slow: 450,\n gentle: 700,\n}\n\nconst EASING_CSS_MAP: Record<DewebMotionEasing, string> = {\n natural: 'cubic-bezier(0.16, 1, 0.3, 1)',\n spring: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n smooth: 'cubic-bezier(0.4, 0, 0.2, 1)',\n linear: 'linear',\n}\n\nconst PRESET_LEVEL_MAP: Record<DewebMotionPreset, number> = {\n none: 0,\n minimal: 2,\n normal: 5,\n expressive: 7,\n playful: 10,\n}\n\n/**\n * resolveMotion\n * Mengonversi input intensitas (angka 0-10 atau preset string) menjadi setting gerak konkret.\n */\nexport function resolveMotion(\n input: DewebMotionIntensity | DewebMotionPreset | ThemeMotionConfig | number | string = 5\n): ResolvedMotionSettings {\n let rawLevel = 5\n let customSpeed: DewebMotionSpeed | undefined\n let customEasing: DewebMotionEasing | undefined\n let customAction: DewebMotionAction | undefined\n\n if (typeof input === 'number') {\n rawLevel = Math.max(0, Math.min(10, Math.round(input)))\n } else if (typeof input === 'string') {\n rawLevel = PRESET_LEVEL_MAP[input as DewebMotionPreset] ?? 5\n } else if (typeof input === 'object' && input !== null) {\n const intensity = input.intensity\n if (typeof intensity === 'number') {\n rawLevel = Math.max(0, Math.min(10, Math.round(intensity)))\n } else if (typeof intensity === 'string') {\n rawLevel = PRESET_LEVEL_MAP[intensity as DewebMotionPreset] ?? 5\n }\n customSpeed = input.speed\n customEasing = input.easing\n customAction = input.action_effect\n }\n\n // Determine preset name from level\n let preset: DewebMotionPreset = 'normal'\n if (rawLevel === 0) preset = 'none'\n else if (rawLevel <= 3) preset = 'minimal'\n else if (rawLevel <= 6) preset = 'normal'\n else if (rawLevel <= 8) preset = 'expressive'\n else preset = 'playful'\n\n // Default speed from level\n const defaultSpeed: DewebMotionSpeed = \n rawLevel === 0 ? 'none' : rawLevel <= 3 ? 'fast' : rawLevel <= 6 ? 'normal' : 'slow'\n const speed = customSpeed || defaultSpeed\n const durationMs = SPEED_DURATION_MAP[speed] ?? 250\n\n const easing: DewebMotionEasing = customEasing || 'natural'\n const easingCss = EASING_CSS_MAP[easing] ?? 'cubic-bezier(0.16, 1, 0.3, 1)'\n\n const defaultAction: DewebMotionAction = rawLevel <= 3 ? 'tactile' : 'ripple'\n const action = customAction || defaultAction\n\n return {\n level: rawLevel,\n enabled: rawLevel > 0,\n preset,\n speed,\n durationMs,\n easing,\n easingCss,\n action,\n hasDelight: rawLevel >= 8,\n }\n}\n\n/**\n * getMotionDurationMs\n * Mengembalikan durasi waktu dalam milidetik dari token speed.\n */\nexport function getMotionDurationMs(speed: DewebMotionSpeed = 'normal'): number {\n return SPEED_DURATION_MAP[speed] ?? 250\n}\n\n/**\n * getMotionEasingCss\n * Mengembalikan fungsi kurva CSS dari token easing.\n */\nexport function getMotionEasingCss(easing: DewebMotionEasing = 'natural'): string {\n return EASING_CSS_MAP[easing] ?? 'cubic-bezier(0.16, 1, 0.3, 1)'\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAqBA,IAAM,qBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AACV;AAEA,IAAM,iBAAoD;AAAA,EACxD,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACV;AAEA,IAAM,mBAAsD;AAAA,EAC1D,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,SAAS;AACX;AAMO,SAAS,cAAa,CAC3B,QAAwF,GAChE;AAAA,EACxB,IAAI,WAAW;AAAA,EACf,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EAEJ,IAAI,OAAO,UAA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AAAA,IACA,YAAY,YAAY;AAAA,EAC1B;AAAA;AAOK,SAAS,oBAAmB,CAAC,QAA0B,UAAkB;AAAA,EAC9E,OAAO,mBAAmB,UAAU;AAAA;AAO/B,SAAS,mBAAkB,CAAC,SAA4B,WAAmB;AAAA,EAChF,OAAO,eAAe,WAAW;AAAA;",
|
|
8
|
+
"debugId": "0125239BF71C474D64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon2
|
|
3
|
+
} from "./chunk-k2b698v5.js";
|
|
4
|
+
import {
|
|
5
|
+
cn2
|
|
6
|
+
} from "./chunk-x4pk7vxm.js";
|
|
7
|
+
|
|
8
|
+
// src/components/ui/alert.tsx
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
11
|
+
var STYLES = {
|
|
12
|
+
default: { bg: "bg-[var(--color-muted)]/50", border: "border-[color:var(--color-border)]", iconKey: "info", iconColor: "text-[color:var(--color-muted-foreground)]", title: "text-[color:var(--color-foreground)]", body: "text-[color:var(--color-muted-foreground)]" },
|
|
13
|
+
primary: { bg: "bg-[var(--color-primary-dimmy)]", border: "border-[color:var(--color-primary-text)]/20", iconKey: "info", iconColor: "text-[color:var(--color-primary-text)]", title: "text-[color:var(--color-primary-text)]", body: "text-[color:var(--color-primary-text)]" },
|
|
14
|
+
secondary: { bg: "bg-[var(--color-secondary-dimmy)]", border: "border-[color:var(--color-secondary-text)]/20", iconKey: "info", iconColor: "text-[color:var(--color-secondary-text)]", title: "text-[color:var(--color-secondary-text)]", body: "text-[color:var(--color-secondary-text)]" },
|
|
15
|
+
accent: { bg: "bg-[var(--color-accent-dimmy)]", border: "border-[color:var(--color-accent-text)]/20", iconKey: "info", iconColor: "text-[color:var(--color-accent-text)]", title: "text-[color:var(--color-accent-text)]", body: "text-[color:var(--color-accent-text)]" },
|
|
16
|
+
success: { bg: "bg-[var(--color-success-dimmy)]", border: "border-[color:var(--color-success-text)]/20", iconKey: "statusSuccess", iconColor: "text-[color:var(--color-success-text)]", title: "text-[color:var(--color-success-text)]", body: "text-[color:var(--color-success-text)]" },
|
|
17
|
+
danger: { bg: "bg-[var(--color-danger-dimmy)]", border: "border-[color:var(--color-danger-text)]/20", iconKey: "statusError", iconColor: "text-[color:var(--color-danger-text)]", title: "text-[color:var(--color-danger-text)]", body: "text-[color:var(--color-danger-text)]" },
|
|
18
|
+
warning: { bg: "bg-[var(--color-warning-dimmy)]", border: "border-[color:var(--color-warning-text)]/40", iconKey: "statusWarning", iconColor: "text-[color:var(--color-warning-text)]", title: "text-[color:var(--color-warning-text)]", body: "text-[color:var(--color-warning-text)]" },
|
|
19
|
+
info: { bg: "bg-[var(--color-info-dimmy)]", border: "border-[color:var(--color-info-text)]/20", iconKey: "statusInfo", iconColor: "text-[color:var(--color-info-text)]", title: "text-[color:var(--color-info-text)]", body: "text-[color:var(--color-info-text)]" }
|
|
20
|
+
};
|
|
21
|
+
var MAP_COLOR = (col) => {
|
|
22
|
+
if (col === "error")
|
|
23
|
+
return "danger";
|
|
24
|
+
if (col in STYLES)
|
|
25
|
+
return col;
|
|
26
|
+
return "default";
|
|
27
|
+
};
|
|
28
|
+
function Alert2({
|
|
29
|
+
type,
|
|
30
|
+
color,
|
|
31
|
+
title,
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
onDismiss,
|
|
35
|
+
autoDismissMs,
|
|
36
|
+
variant = "soft",
|
|
37
|
+
radius,
|
|
38
|
+
shadow,
|
|
39
|
+
icon,
|
|
40
|
+
action,
|
|
41
|
+
size = "md"
|
|
42
|
+
}) {
|
|
43
|
+
const finalColor = MAP_COLOR(color || type || "default");
|
|
44
|
+
const style = STYLES[finalColor];
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (!autoDismissMs || !onDismiss)
|
|
47
|
+
return;
|
|
48
|
+
const timer = setTimeout(onDismiss, autoDismissMs);
|
|
49
|
+
return () => clearTimeout(timer);
|
|
50
|
+
}, [autoDismissMs, onDismiss]);
|
|
51
|
+
const radiusMap = {
|
|
52
|
+
none: "rounded-none",
|
|
53
|
+
sm: "rounded-sm",
|
|
54
|
+
md: "rounded-md",
|
|
55
|
+
lg: "rounded-lg",
|
|
56
|
+
full: "rounded-full"
|
|
57
|
+
};
|
|
58
|
+
const radiusClass = radius ? radiusMap[radius] : "rounded-md";
|
|
59
|
+
const shadowMap = {
|
|
60
|
+
none: "shadow-none",
|
|
61
|
+
sm: "shadow-sm",
|
|
62
|
+
md: "shadow-md",
|
|
63
|
+
lg: "shadow-lg",
|
|
64
|
+
xl: "shadow-xl"
|
|
65
|
+
};
|
|
66
|
+
const shadowClass = shadow ? shadowMap[shadow] : "";
|
|
67
|
+
const cName = finalColor === "default" ? "muted" : finalColor;
|
|
68
|
+
let containerVariant = "";
|
|
69
|
+
let titleVariant = style.title;
|
|
70
|
+
let bodyVariant = style.body;
|
|
71
|
+
let iconVariant = style.iconColor;
|
|
72
|
+
let containerStyle = undefined;
|
|
73
|
+
let titleStyle = undefined;
|
|
74
|
+
let bodyStyle = undefined;
|
|
75
|
+
let iconStyle = undefined;
|
|
76
|
+
if (variant === "solid") {
|
|
77
|
+
if (finalColor === "default") {
|
|
78
|
+
containerVariant = `border-transparent`;
|
|
79
|
+
containerStyle = {
|
|
80
|
+
backgroundColor: "var(--color-muted)",
|
|
81
|
+
color: "var(--color-text-color)"
|
|
82
|
+
};
|
|
83
|
+
titleVariant = "";
|
|
84
|
+
titleStyle = { color: "var(--color-text-color)" };
|
|
85
|
+
bodyVariant = "opacity-80";
|
|
86
|
+
bodyStyle = { color: "var(--color-text-color)" };
|
|
87
|
+
iconVariant = "";
|
|
88
|
+
iconStyle = { color: "var(--color-text-color)" };
|
|
89
|
+
} else {
|
|
90
|
+
containerVariant = `border-transparent`;
|
|
91
|
+
containerStyle = {
|
|
92
|
+
backgroundColor: `var(--color-${cName})`,
|
|
93
|
+
color: `var(--color-${cName}-foreground)`
|
|
94
|
+
};
|
|
95
|
+
titleVariant = "";
|
|
96
|
+
titleStyle = { color: `var(--color-${cName}-foreground)` };
|
|
97
|
+
bodyVariant = "opacity-90";
|
|
98
|
+
bodyStyle = { color: `var(--color-${cName}-foreground)` };
|
|
99
|
+
iconVariant = "";
|
|
100
|
+
iconStyle = { color: `var(--color-${cName}-foreground)` };
|
|
101
|
+
}
|
|
102
|
+
} else if (variant === "outline") {
|
|
103
|
+
if (finalColor === "default") {
|
|
104
|
+
containerVariant = `bg-transparent border-[color:var(--color-background-foreground)]/50`;
|
|
105
|
+
} else {
|
|
106
|
+
containerVariant = `bg-transparent`;
|
|
107
|
+
containerStyle = {
|
|
108
|
+
borderColor: `color-mix(in srgb, var(--color-${cName}-dark) 50%, transparent)`
|
|
109
|
+
};
|
|
110
|
+
titleVariant = "";
|
|
111
|
+
titleStyle = { color: `var(--color-${cName}-text)` };
|
|
112
|
+
bodyVariant = "opacity-90";
|
|
113
|
+
bodyStyle = { color: `var(--color-${cName}-text)` };
|
|
114
|
+
iconVariant = "";
|
|
115
|
+
iconStyle = { color: `var(--color-${cName}-text)` };
|
|
116
|
+
}
|
|
117
|
+
} else if (variant === "ghost") {
|
|
118
|
+
containerVariant = `bg-transparent border-transparent`;
|
|
119
|
+
} else {
|
|
120
|
+
containerVariant = `${style.bg} ${style.border}`;
|
|
121
|
+
if (finalColor !== "default") {
|
|
122
|
+
containerStyle = {
|
|
123
|
+
backgroundColor: `var(--color-${cName}-dimmy, color-mix(in srgb, var(--color-${cName}, currentColor) 8%, transparent))`,
|
|
124
|
+
borderColor: `color-mix(in srgb, var(--color-${cName}-dark, var(--color-${cName}, currentColor)) 25%, transparent)`,
|
|
125
|
+
...containerStyle
|
|
126
|
+
};
|
|
127
|
+
titleStyle = { color: `var(--color-${cName}-text, var(--color-${cName}, currentColor))`, ...titleStyle };
|
|
128
|
+
bodyStyle = { color: `var(--color-${cName}-text, var(--color-${cName}, currentColor))`, ...bodyStyle };
|
|
129
|
+
iconStyle = { color: `var(--color-${cName}-text, var(--color-${cName}, currentColor))`, ...iconStyle };
|
|
130
|
+
} else {
|
|
131
|
+
containerStyle = {
|
|
132
|
+
backgroundColor: `var(--color-muted, var(--color-secondary, color-mix(in srgb, var(--color-foreground, currentColor) 5%, var(--color-background, transparent))))`,
|
|
133
|
+
borderColor: `var(--color-border, color-mix(in srgb, var(--color-foreground, currentColor) 15%, transparent))`,
|
|
134
|
+
...containerStyle
|
|
135
|
+
};
|
|
136
|
+
titleStyle = { color: `var(--color-foreground, currentColor)`, ...titleStyle };
|
|
137
|
+
bodyStyle = { color: `var(--color-muted-foreground, currentColor)`, ...bodyStyle };
|
|
138
|
+
iconStyle = { color: `var(--color-muted-foreground, currentColor)`, ...iconStyle };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const iconName = icon !== undefined ? icon : style.iconKey;
|
|
142
|
+
const isXs = size === "xs";
|
|
143
|
+
const isSm = size === "sm" || isXs;
|
|
144
|
+
const isLg = size === "lg";
|
|
145
|
+
const paddingClass = isXs ? "py-1.5 px-2.5 gap-2 text-[11px]" : isSm ? "py-2 px-3 gap-2 text-xs" : isLg ? "p-5 gap-3.5 text-sm" : "p-4 gap-3 text-[13px]";
|
|
146
|
+
const iconSize = isXs ? 14 : isSm ? 15 : isLg ? 20 : 18;
|
|
147
|
+
const hasMultiLine = Boolean(title && children);
|
|
148
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
149
|
+
role: "alert",
|
|
150
|
+
style: containerStyle,
|
|
151
|
+
className: cn2("relative w-full border flex", hasMultiLine ? "items-start" : "items-center", paddingClass, radiusClass, shadowClass, containerVariant, className),
|
|
152
|
+
children: [
|
|
153
|
+
iconName && /* @__PURE__ */ jsxDEV(Icon2, {
|
|
154
|
+
name: iconName,
|
|
155
|
+
style: iconStyle,
|
|
156
|
+
className: cn2(hasMultiLine ? "mt-[2px] shrink-0" : "shrink-0", iconVariant),
|
|
157
|
+
size: iconSize
|
|
158
|
+
}, undefined, false, undefined, this),
|
|
159
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
160
|
+
className: "flex-1 flex flex-col gap-0.5 min-w-0",
|
|
161
|
+
children: [
|
|
162
|
+
title && /* @__PURE__ */ jsxDEV("h5", {
|
|
163
|
+
style: titleStyle,
|
|
164
|
+
className: cn2("font-semibold leading-tight", isXs ? "text-[11px]" : isSm ? "text-xs" : isLg ? "text-base" : "text-[13.5px]", titleVariant),
|
|
165
|
+
children: title
|
|
166
|
+
}, undefined, false, undefined, this),
|
|
167
|
+
children && /* @__PURE__ */ jsxDEV("div", {
|
|
168
|
+
style: bodyStyle,
|
|
169
|
+
className: cn2("leading-relaxed", isXs ? "text-[11px]" : isSm ? "text-xs" : isLg ? "text-sm" : "text-[13px]", bodyVariant),
|
|
170
|
+
children
|
|
171
|
+
}, undefined, false, undefined, this)
|
|
172
|
+
]
|
|
173
|
+
}, undefined, true, undefined, this),
|
|
174
|
+
action && /* @__PURE__ */ jsxDEV("div", {
|
|
175
|
+
className: "ml-auto shrink-0 flex items-center gap-2",
|
|
176
|
+
children: action
|
|
177
|
+
}, undefined, false, undefined, this),
|
|
178
|
+
onDismiss && /* @__PURE__ */ jsxDEV("button", {
|
|
179
|
+
type: "button",
|
|
180
|
+
"aria-label": "Tutup notifikasi",
|
|
181
|
+
onClick: onDismiss,
|
|
182
|
+
style: iconStyle,
|
|
183
|
+
className: cn2("rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 shrink-0 ml-1", iconVariant, finalColor === "default" ? "focus:ring-[var(--color-border)]" : `focus:ring-[var(--color-${cName}-text)]`),
|
|
184
|
+
children: /* @__PURE__ */ jsxDEV(Icon2, {
|
|
185
|
+
name: "close",
|
|
186
|
+
size: isSm ? 14 : 16
|
|
187
|
+
}, undefined, false, undefined, this)
|
|
188
|
+
}, undefined, false, undefined, this)
|
|
189
|
+
]
|
|
190
|
+
}, undefined, true, undefined, this);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export { Alert2 };
|
|
194
|
+
|
|
195
|
+
//# debugId=8A9325D32BF9028464756E2164756E21
|