@mohasinac/appkit 2.7.57 → 2.7.59
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/_internal/client/features/layout/DashboardLayoutClient.d.ts +7 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +8 -2
- package/dist/_internal/server/features/scams/og.js +1 -1
- package/dist/_internal/shared/actions/bulk-helpers.d.ts +3 -0
- package/dist/_internal/shared/actions/bulk-helpers.js +19 -0
- package/dist/_internal/shared/config/schema.d.ts +4 -4
- package/dist/client.d.ts +4 -1
- package/dist/client.js +3 -1
- package/dist/configs/next.js +11 -0
- package/dist/configs/tailwind.d.ts +16 -3
- package/dist/configs/tailwind.js +18 -5
- package/dist/features/account/components/AddressBook.js +1 -1
- package/dist/features/account/components/AddressesIndexListing.js +3 -4
- package/dist/features/account/components/BuyerAccountGuideView.js +7 -7
- package/dist/features/account/components/BuyerAuctionsGuideView.js +7 -7
- package/dist/features/account/components/BuyerOrdersGuideView.js +6 -6
- package/dist/features/account/components/BuyerShoppingGuideView.js +7 -7
- package/dist/features/account/components/UserOffersPanel.js +1 -1
- package/dist/features/account/components/UserSidebar.js +14 -10
- package/dist/features/account/components/UserSupportView.js +4 -4
- package/dist/features/admin/components/AdminAdsView.js +1 -1
- package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -10
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +3 -3
- package/dist/features/admin/components/AdminBidsView.js +3 -9
- package/dist/features/admin/components/AdminBlogView.js +4 -9
- package/dist/features/admin/components/AdminBrandEditorView.js +14 -17
- package/dist/features/admin/components/AdminBrandsView.js +4 -9
- package/dist/features/admin/components/AdminBundlesView.js +40 -59
- package/dist/features/admin/components/AdminCarouselView.js +8 -21
- package/dist/features/admin/components/AdminCartsView.js +3 -4
- package/dist/features/admin/components/AdminCatalogGuideView.js +5 -5
- package/dist/features/admin/components/AdminCategoriesView.js +4 -9
- package/dist/features/admin/components/AdminCategoryEditorView.js +1 -5
- package/dist/features/admin/components/AdminContactEditorView.js +2 -2
- package/dist/features/admin/components/AdminContactView.js +7 -25
- package/dist/features/admin/components/AdminContentGuideView.js +6 -6
- package/dist/features/admin/components/AdminCouponEditorView.js +14 -17
- package/dist/features/admin/components/AdminCouponsView.js +8 -16
- package/dist/features/admin/components/AdminFaqEditorView.js +14 -17
- package/dist/features/admin/components/AdminFaqsView.js +18 -69
- package/dist/features/admin/components/AdminFeatureEditorView.js +7 -9
- package/dist/features/admin/components/AdminFeatureFlagsView.js +1 -1
- package/dist/features/admin/components/AdminFeaturesView.js +1 -1
- package/dist/features/admin/components/AdminGuideHubView.js +1 -1
- package/dist/features/admin/components/AdminHistoryView.js +1 -1
- package/dist/features/admin/components/AdminListingScaffold.js +1 -1
- package/dist/features/admin/components/AdminNewsletterView.js +5 -15
- package/dist/features/admin/components/AdminNotificationsView.js +3 -9
- package/dist/features/admin/components/AdminOrdersGuideView.js +5 -5
- package/dist/features/admin/components/AdminOrdersView.js +3 -9
- package/dist/features/admin/components/AdminPayoutsView.js +3 -9
- package/dist/features/admin/components/AdminPrizeDrawsView.js +4 -9
- package/dist/features/admin/components/AdminProductEditorView.js +1 -5
- package/dist/features/admin/components/AdminProductsView.js +5 -10
- package/dist/features/admin/components/AdminReturnRequestsView.js +1 -1
- package/dist/features/admin/components/AdminReviewsView.js +3 -9
- package/dist/features/admin/components/AdminScammerEditorView.js +3 -3
- package/dist/features/admin/components/AdminScammersView.js +6 -12
- package/dist/features/admin/components/AdminSectionsView.js +1 -1
- package/dist/features/admin/components/AdminSessionsView.js +3 -9
- package/dist/features/admin/components/AdminSiteSettingsView.js +1 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +1 -1
- package/dist/features/admin/components/AdminStoresGuideView.js +6 -6
- package/dist/features/admin/components/AdminStoresView.js +3 -9
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +3 -7
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +17 -20
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +4 -4
- package/dist/features/admin/components/AdminSupportTicketsView.js +9 -15
- package/dist/features/admin/components/AdminTeamGuideView.js +4 -4
- package/dist/features/admin/components/AdminTeamView.js +6 -15
- package/dist/features/admin/components/AdminTrustGuideView.js +5 -5
- package/dist/features/admin/components/AdminUserEditorView.js +1 -1
- package/dist/features/admin/components/AdminUsersGuideView.js +5 -5
- package/dist/features/admin/components/AdminUsersView.js +3 -9
- package/dist/features/admin/components/AdminViewCards.js +1 -1
- package/dist/features/admin/components/AdminWishlistsView.js +1 -1
- package/dist/features/admin/components/DataTable.js +1 -1
- package/dist/features/admin/hooks/useAdminListing.d.ts +58 -0
- package/dist/features/admin/hooks/useAdminListing.js +71 -0
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +2 -2
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +2 -2
- package/dist/features/auctions/components/PlaceBidFormClient.js +1 -1
- package/dist/features/auth/components/VerifyEmailView.js +1 -1
- package/dist/features/auth/schemas/firestore.d.ts +1 -0
- package/dist/features/blog/components/BlogIndexListing.js +3 -6
- package/dist/features/blog/components/BlogListView.js +1 -1
- package/dist/features/blog/components/BlogPostView.js +1 -1
- package/dist/features/cart/components/CartDrawer.js +1 -1
- package/dist/features/categories/components/CategoriesIndexListing.js +3 -6
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
- package/dist/features/checkout/components/CheckoutStepper.js +1 -1
- package/dist/features/collections/components/CollectionCard.js +1 -1
- package/dist/features/copilot/components/AdminCopilotView.js +2 -2
- package/dist/features/events/components/AdminEventsView.js +4 -4
- package/dist/features/events/components/EventPollWidget.js +2 -2
- package/dist/features/events/components/EventStatusBadge.js +4 -4
- package/dist/features/events/components/EventsIndexListing.js +3 -4
- package/dist/features/events/components/SpinWheelView.js +1 -1
- package/dist/features/faq/components/FAQAccordion.js +2 -2
- package/dist/features/forms/Input.js +3 -3
- package/dist/features/forms/Select.js +2 -2
- package/dist/features/forms/Textarea.js +2 -2
- package/dist/features/forms/utils.d.ts +1 -1
- package/dist/features/forms/utils.js +1 -1
- package/dist/features/homepage/components/AnnouncementBar.d.ts +4 -1
- package/dist/features/homepage/components/AnnouncementBar.js +51 -4
- package/dist/features/homepage/components/CharacterHotspotForm.js +2 -2
- package/dist/features/homepage/components/MarketplaceHomepageView.d.ts +3 -1
- package/dist/features/homepage/components/MarketplaceHomepageView.js +2 -2
- package/dist/features/homepage/components/index.d.ts +1 -1
- package/dist/features/homepage/components/index.js +1 -1
- package/dist/features/homepage/lib/section-renderer.d.ts +2 -2
- package/dist/features/homepage/lib/section-renderer.js +2 -2
- package/dist/features/layout/BottomActions.js +2 -2
- package/dist/features/layout/ListingLayout.js +3 -3
- package/dist/features/layout/TitleBarLayout.js +1 -1
- package/dist/features/media/index.d.ts +2 -0
- package/dist/features/media/index.js +1 -0
- package/dist/features/media/modals/ImageCropModal.js +1 -1
- package/dist/features/media/modals/ImageEditor.d.ts +12 -0
- package/dist/features/media/modals/ImageEditor.js +73 -0
- package/dist/features/media/upload/ImageUpload.d.ts +5 -1
- package/dist/features/media/upload/ImageUpload.js +33 -8
- package/dist/features/media/upload/MediaUploadField.d.ts +5 -1
- package/dist/features/media/upload/MediaUploadField.js +26 -12
- package/dist/features/orders/components/OrdersList.js +7 -7
- package/dist/features/orders/components/RefundHistoryTable.js +2 -2
- package/dist/features/orders/components/RefundRequestView.js +3 -3
- package/dist/features/orders/repository/orders.repository.d.ts +0 -1
- package/dist/features/orders/repository/orders.repository.js +0 -1
- package/dist/features/orders/server.d.ts +1 -1
- package/dist/features/orders/server.js +1 -1
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +1 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +4 -4
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -1
- package/dist/features/pre-orders/components/PreorderCard.js +2 -2
- package/dist/features/products/components/CustomSectionsEditor.js +1 -1
- package/dist/features/products/components/GroupSettingsPanel.js +64 -48
- package/dist/features/products/components/MakeOfferButton.js +2 -2
- package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +3 -3
- package/dist/features/products/components/PrizeRevealModal.js +3 -3
- package/dist/features/products/components/ProductDetailPageView.js +4 -4
- package/dist/features/products/components/ProductFeaturesSelector.js +1 -1
- package/dist/features/products/components/ProductGrid.js +3 -3
- package/dist/features/products/repository/products.repository.d.ts +0 -2
- package/dist/features/products/repository/products.repository.js +0 -2
- package/dist/features/products/server.d.ts +1 -1
- package/dist/features/products/server.js +1 -1
- package/dist/features/promotions/components/CouponCard.js +7 -7
- package/dist/features/promotions/components/CouponsIndexListing.js +3 -2
- package/dist/features/promotions/components/PromotionsView.js +1 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +2 -2
- package/dist/features/reviews/components/ReviewsIndexListing.js +3 -4
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/reviews/repository/reviews.repository.d.ts +0 -1
- package/dist/features/reviews/repository/reviews.repository.js +0 -1
- package/dist/features/reviews/server.d.ts +1 -1
- package/dist/features/reviews/server.js +1 -1
- package/dist/features/seller/components/SellerAddressesView.js +11 -21
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +14 -23
- package/dist/features/seller/components/SellerBidsView.js +6 -6
- package/dist/features/seller/components/SellerBundlesView.js +13 -21
- package/dist/features/seller/components/SellerClassifiedView.js +14 -22
- package/dist/features/seller/components/SellerCouponEditorView.js +2 -2
- package/dist/features/seller/components/SellerCouponsView.js +14 -20
- package/dist/features/seller/components/SellerDigitalCodesView.js +13 -21
- package/dist/features/seller/components/SellerFeaturesView.js +1 -1
- package/dist/features/seller/components/SellerGroupedListingsView.js +6 -10
- package/dist/features/seller/components/SellerLiveView.js +15 -23
- package/dist/features/seller/components/SellerOffersPanel.js +2 -2
- package/dist/features/seller/components/SellerOffersView.js +4 -5
- package/dist/features/seller/components/SellerOrdersView.js +9 -23
- package/dist/features/seller/components/SellerPayoutMethodsView.js +13 -25
- package/dist/features/seller/components/SellerPayoutsView.js +4 -5
- package/dist/features/seller/components/SellerPreOrdersView.js +13 -22
- package/dist/features/seller/components/SellerPrizeDrawsView.js +13 -22
- package/dist/features/seller/components/SellerProductsCards.js +1 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +3 -6
- package/dist/features/seller/components/SellerProductsView.js +10 -23
- package/dist/features/seller/components/SellerReviewsView.js +1 -1
- package/dist/features/seller/components/SellerShippingConfigsView.js +14 -26
- package/dist/features/seller/components/SellerStoreCategoriesView.js +16 -35
- package/dist/features/seller/components/SellerTemplatesView.js +27 -43
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
- package/dist/features/stores/components/StoreFinanceGuideView.js +2 -2
- package/dist/features/stores/components/StoreHeader.js +1 -1
- package/dist/features/stores/components/StoreListingsGuideView.js +3 -3
- package/dist/features/stores/components/StoreOrdersGuideView.js +4 -4
- package/dist/features/stores/components/StoreReviewsListing.js +3 -4
- package/dist/features/stores/components/StoreSettingsGuideView.js +2 -2
- package/dist/features/stores/components/StoresIndexListing.js +3 -4
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +4 -4
- package/dist/features/wishlist/components/WishlistPage.js +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.js +6 -12
- package/dist/react/contexts/SessionContext.d.ts +2 -0
- package/dist/react/contexts/SessionContext.js +2 -0
- package/dist/react/hooks/useEntityDelete.d.ts +15 -0
- package/dist/react/hooks/useEntityDelete.js +39 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/repositories/index.d.ts +3 -3
- package/dist/repositories/index.js +3 -3
- package/dist/styles.css +286 -3
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/motion.d.ts +162 -0
- package/dist/tokens/motion.js +89 -0
- package/dist/ui/DataTable.js +3 -2
- package/dist/ui/components/Accordion.js +2 -1
- package/dist/ui/components/Card.d.ts +5 -2
- package/dist/ui/components/Card.js +29 -11
- package/dist/ui/components/Div.d.ts +2 -16
- package/dist/ui/components/Div.js +2 -16
- package/dist/ui/components/Layout.d.ts +9 -19
- package/dist/ui/components/Layout.js +9 -7
- package/dist/ui/components/ListingFilterDrawer.d.ts +10 -0
- package/dist/ui/components/ListingFilterDrawer.js +8 -0
- package/dist/ui/components/Modal.js +7 -4
- package/dist/ui/components/Motion.d.ts +75 -0
- package/dist/ui/components/Motion.js +122 -0
- package/dist/ui/components/Semantic.d.ts +81 -14
- package/dist/ui/components/Semantic.js +75 -10
- package/dist/ui/components/Semantic.style.css +261 -2
- package/dist/ui/components/SideDrawer.d.ts +1 -1
- package/dist/ui/components/SideDrawer.js +8 -6
- package/dist/ui/components/SideModal.d.ts +1 -1
- package/dist/ui/components/SideModal.js +11 -9
- package/dist/ui/components/StackedViewShell.js +6 -1
- package/dist/ui/components/Toast.js +5 -2
- package/dist/ui/components/Typography.d.ts +44 -3
- package/dist/ui/components/Typography.js +15 -30
- package/dist/ui/components/Typography.style.css +24 -0
- package/dist/ui/components/VacationBanner.js +2 -1
- package/dist/ui/components/surface-tokens.d.ts +70 -0
- package/dist/ui/components/surface-tokens.js +68 -0
- package/dist/ui/forms/FormShell.d.ts +6 -1
- package/dist/ui/forms/FormShell.js +32 -4
- package/dist/ui/index.d.ts +11 -2
- package/dist/ui/index.js +5 -2
- package/dist/validation/schemas.d.ts +28 -28
- package/package.json +3 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion presets — reusable animation configs for motion/react components.
|
|
3
|
+
*
|
|
4
|
+
* All presets respect `prefers-reduced-motion` via the `useReducedMotion` hook
|
|
5
|
+
* in the consuming component wrappers (Motion.tsx).
|
|
6
|
+
*/
|
|
7
|
+
import type { Transition } from "motion/react";
|
|
8
|
+
export declare const SPRING_SNAPPY: Transition;
|
|
9
|
+
export declare const SPRING_GENTLE: Transition;
|
|
10
|
+
export declare const EASE_OUT: Transition;
|
|
11
|
+
export declare const MOTION_PRESETS: {
|
|
12
|
+
readonly fadeIn: {
|
|
13
|
+
readonly initial: {
|
|
14
|
+
readonly opacity: 0;
|
|
15
|
+
};
|
|
16
|
+
readonly animate: {
|
|
17
|
+
readonly opacity: 1;
|
|
18
|
+
};
|
|
19
|
+
readonly exit: {
|
|
20
|
+
readonly opacity: 0;
|
|
21
|
+
};
|
|
22
|
+
readonly transition: {
|
|
23
|
+
readonly duration: 0.2;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly fadeInUp: {
|
|
27
|
+
readonly initial: {
|
|
28
|
+
readonly opacity: 0;
|
|
29
|
+
readonly y: 16;
|
|
30
|
+
};
|
|
31
|
+
readonly animate: {
|
|
32
|
+
readonly opacity: 1;
|
|
33
|
+
readonly y: 0;
|
|
34
|
+
};
|
|
35
|
+
readonly exit: {
|
|
36
|
+
readonly opacity: 0;
|
|
37
|
+
readonly y: 16;
|
|
38
|
+
};
|
|
39
|
+
readonly transition: Transition;
|
|
40
|
+
};
|
|
41
|
+
readonly fadeInDown: {
|
|
42
|
+
readonly initial: {
|
|
43
|
+
readonly opacity: 0;
|
|
44
|
+
readonly y: -16;
|
|
45
|
+
};
|
|
46
|
+
readonly animate: {
|
|
47
|
+
readonly opacity: 1;
|
|
48
|
+
readonly y: 0;
|
|
49
|
+
};
|
|
50
|
+
readonly exit: {
|
|
51
|
+
readonly opacity: 0;
|
|
52
|
+
readonly y: -16;
|
|
53
|
+
};
|
|
54
|
+
readonly transition: Transition;
|
|
55
|
+
};
|
|
56
|
+
readonly slideUp: {
|
|
57
|
+
readonly initial: {
|
|
58
|
+
readonly opacity: 0;
|
|
59
|
+
readonly y: 20;
|
|
60
|
+
};
|
|
61
|
+
readonly animate: {
|
|
62
|
+
readonly opacity: 1;
|
|
63
|
+
readonly y: 0;
|
|
64
|
+
};
|
|
65
|
+
readonly exit: {
|
|
66
|
+
readonly opacity: 0;
|
|
67
|
+
readonly y: 20;
|
|
68
|
+
};
|
|
69
|
+
readonly transition: Transition;
|
|
70
|
+
};
|
|
71
|
+
readonly slideDown: {
|
|
72
|
+
readonly initial: {
|
|
73
|
+
readonly opacity: 0;
|
|
74
|
+
readonly y: -20;
|
|
75
|
+
};
|
|
76
|
+
readonly animate: {
|
|
77
|
+
readonly opacity: 1;
|
|
78
|
+
readonly y: 0;
|
|
79
|
+
};
|
|
80
|
+
readonly exit: {
|
|
81
|
+
readonly opacity: 0;
|
|
82
|
+
readonly y: -20;
|
|
83
|
+
};
|
|
84
|
+
readonly transition: Transition;
|
|
85
|
+
};
|
|
86
|
+
readonly slideInLeft: {
|
|
87
|
+
readonly initial: {
|
|
88
|
+
readonly opacity: 0;
|
|
89
|
+
readonly x: -24;
|
|
90
|
+
};
|
|
91
|
+
readonly animate: {
|
|
92
|
+
readonly opacity: 1;
|
|
93
|
+
readonly x: 0;
|
|
94
|
+
};
|
|
95
|
+
readonly exit: {
|
|
96
|
+
readonly opacity: 0;
|
|
97
|
+
readonly x: -24;
|
|
98
|
+
};
|
|
99
|
+
readonly transition: Transition;
|
|
100
|
+
};
|
|
101
|
+
readonly slideInRight: {
|
|
102
|
+
readonly initial: {
|
|
103
|
+
readonly opacity: 0;
|
|
104
|
+
readonly x: 24;
|
|
105
|
+
};
|
|
106
|
+
readonly animate: {
|
|
107
|
+
readonly opacity: 1;
|
|
108
|
+
readonly x: 0;
|
|
109
|
+
};
|
|
110
|
+
readonly exit: {
|
|
111
|
+
readonly opacity: 0;
|
|
112
|
+
readonly x: 24;
|
|
113
|
+
};
|
|
114
|
+
readonly transition: Transition;
|
|
115
|
+
};
|
|
116
|
+
readonly scaleIn: {
|
|
117
|
+
readonly initial: {
|
|
118
|
+
readonly opacity: 0;
|
|
119
|
+
readonly scale: 0.95;
|
|
120
|
+
};
|
|
121
|
+
readonly animate: {
|
|
122
|
+
readonly opacity: 1;
|
|
123
|
+
readonly scale: 1;
|
|
124
|
+
};
|
|
125
|
+
readonly exit: {
|
|
126
|
+
readonly opacity: 0;
|
|
127
|
+
readonly scale: 0.95;
|
|
128
|
+
};
|
|
129
|
+
readonly transition: Transition;
|
|
130
|
+
};
|
|
131
|
+
readonly pressScale: {
|
|
132
|
+
readonly whileTap: {
|
|
133
|
+
readonly scale: 0.97;
|
|
134
|
+
};
|
|
135
|
+
readonly transition: {
|
|
136
|
+
readonly duration: 0.1;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
readonly hoverLift: {
|
|
140
|
+
readonly whileHover: {
|
|
141
|
+
readonly y: -2;
|
|
142
|
+
};
|
|
143
|
+
readonly transition: Transition;
|
|
144
|
+
};
|
|
145
|
+
readonly hoverScale: {
|
|
146
|
+
readonly whileHover: {
|
|
147
|
+
readonly scale: 1.02;
|
|
148
|
+
};
|
|
149
|
+
readonly transition: Transition;
|
|
150
|
+
};
|
|
151
|
+
readonly stagger: {
|
|
152
|
+
readonly transition: {
|
|
153
|
+
readonly staggerChildren: 0.05;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
readonly staggerSlow: {
|
|
157
|
+
readonly transition: {
|
|
158
|
+
readonly staggerChildren: 0.1;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
export type MotionPreset = keyof typeof MOTION_PRESETS;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion presets — reusable animation configs for motion/react components.
|
|
3
|
+
*
|
|
4
|
+
* All presets respect `prefers-reduced-motion` via the `useReducedMotion` hook
|
|
5
|
+
* in the consuming component wrappers (Motion.tsx).
|
|
6
|
+
*/
|
|
7
|
+
export const SPRING_SNAPPY = {
|
|
8
|
+
type: "spring",
|
|
9
|
+
stiffness: 400,
|
|
10
|
+
damping: 30,
|
|
11
|
+
};
|
|
12
|
+
export const SPRING_GENTLE = {
|
|
13
|
+
type: "spring",
|
|
14
|
+
stiffness: 200,
|
|
15
|
+
damping: 25,
|
|
16
|
+
};
|
|
17
|
+
export const EASE_OUT = {
|
|
18
|
+
type: "tween",
|
|
19
|
+
ease: [0.25, 0.46, 0.45, 0.94],
|
|
20
|
+
duration: 0.3,
|
|
21
|
+
};
|
|
22
|
+
export const MOTION_PRESETS = {
|
|
23
|
+
fadeIn: {
|
|
24
|
+
initial: { opacity: 0 },
|
|
25
|
+
animate: { opacity: 1 },
|
|
26
|
+
exit: { opacity: 0 },
|
|
27
|
+
transition: { duration: 0.2 },
|
|
28
|
+
},
|
|
29
|
+
fadeInUp: {
|
|
30
|
+
initial: { opacity: 0, y: 16 },
|
|
31
|
+
animate: { opacity: 1, y: 0 },
|
|
32
|
+
exit: { opacity: 0, y: 16 },
|
|
33
|
+
transition: EASE_OUT,
|
|
34
|
+
},
|
|
35
|
+
fadeInDown: {
|
|
36
|
+
initial: { opacity: 0, y: -16 },
|
|
37
|
+
animate: { opacity: 1, y: 0 },
|
|
38
|
+
exit: { opacity: 0, y: -16 },
|
|
39
|
+
transition: EASE_OUT,
|
|
40
|
+
},
|
|
41
|
+
slideUp: {
|
|
42
|
+
initial: { opacity: 0, y: 20 },
|
|
43
|
+
animate: { opacity: 1, y: 0 },
|
|
44
|
+
exit: { opacity: 0, y: 20 },
|
|
45
|
+
transition: SPRING_SNAPPY,
|
|
46
|
+
},
|
|
47
|
+
slideDown: {
|
|
48
|
+
initial: { opacity: 0, y: -20 },
|
|
49
|
+
animate: { opacity: 1, y: 0 },
|
|
50
|
+
exit: { opacity: 0, y: -20 },
|
|
51
|
+
transition: SPRING_SNAPPY,
|
|
52
|
+
},
|
|
53
|
+
slideInLeft: {
|
|
54
|
+
initial: { opacity: 0, x: -24 },
|
|
55
|
+
animate: { opacity: 1, x: 0 },
|
|
56
|
+
exit: { opacity: 0, x: -24 },
|
|
57
|
+
transition: SPRING_SNAPPY,
|
|
58
|
+
},
|
|
59
|
+
slideInRight: {
|
|
60
|
+
initial: { opacity: 0, x: 24 },
|
|
61
|
+
animate: { opacity: 1, x: 0 },
|
|
62
|
+
exit: { opacity: 0, x: 24 },
|
|
63
|
+
transition: SPRING_SNAPPY,
|
|
64
|
+
},
|
|
65
|
+
scaleIn: {
|
|
66
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
67
|
+
animate: { opacity: 1, scale: 1 },
|
|
68
|
+
exit: { opacity: 0, scale: 0.95 },
|
|
69
|
+
transition: SPRING_GENTLE,
|
|
70
|
+
},
|
|
71
|
+
pressScale: {
|
|
72
|
+
whileTap: { scale: 0.97 },
|
|
73
|
+
transition: { duration: 0.1 },
|
|
74
|
+
},
|
|
75
|
+
hoverLift: {
|
|
76
|
+
whileHover: { y: -2 },
|
|
77
|
+
transition: SPRING_SNAPPY,
|
|
78
|
+
},
|
|
79
|
+
hoverScale: {
|
|
80
|
+
whileHover: { scale: 1.02 },
|
|
81
|
+
transition: SPRING_SNAPPY,
|
|
82
|
+
},
|
|
83
|
+
stagger: {
|
|
84
|
+
transition: { staggerChildren: 0.05 },
|
|
85
|
+
},
|
|
86
|
+
staggerSlow: {
|
|
87
|
+
transition: { staggerChildren: 0.1 },
|
|
88
|
+
},
|
|
89
|
+
};
|
package/dist/ui/DataTable.js
CHANGED
|
@@ -6,6 +6,7 @@ import { Button } from "./components/Button";
|
|
|
6
6
|
import { Spinner } from "./components/Spinner";
|
|
7
7
|
import { Pagination } from "./components/Pagination";
|
|
8
8
|
import { Text } from "./components/Typography";
|
|
9
|
+
import { AnimatedList } from "./components/Motion";
|
|
9
10
|
import { GRID_MAP } from "./components/Layout";
|
|
10
11
|
import { Row } from "./components/Layout";
|
|
11
12
|
import { mergeTableConfig, DEFAULT_PAGINATION_CONFIG } from "../contracts";
|
|
@@ -109,9 +110,9 @@ pageSize: pageSizeProp, stickyHeader: stickyHeaderProp, striped: stripedProp, sh
|
|
|
109
110
|
const renderCardGrid = (mode) => {
|
|
110
111
|
if (!mobileCardRender)
|
|
111
112
|
return null;
|
|
112
|
-
return (_jsx(
|
|
113
|
+
return (_jsx(AnimatedList, { className: mode === "grid"
|
|
113
114
|
? `${GRID_MAP[gridCols]} gap-6`
|
|
114
|
-
: "flex flex-col gap-4", "data-section": "datatable-div-636", children: paginatedData.map((item) => (_jsx(SelectableCard, { id: keyExtractor(item), selectable: selectable, selected: selectedIds.includes(keyExtractor(item)), listMode: mode === "list", onToggle: (id, checked) => onSelectionChange?.(checked
|
|
115
|
+
: "flex flex-col gap-4", staggerDelay: 0.03, "data-section": "datatable-div-636", children: paginatedData.map((item) => (_jsx(SelectableCard, { id: keyExtractor(item), selectable: selectable, selected: selectedIds.includes(keyExtractor(item)), listMode: mode === "list", onToggle: (id, checked) => onSelectionChange?.(checked
|
|
115
116
|
? [...selectedIds, id]
|
|
116
117
|
: selectedIds.filter((s) => s !== id)), children: mobileCardRender(item) }, keyExtractor(item)))) }));
|
|
117
118
|
};
|
|
@@ -4,6 +4,7 @@ import { createContext, useContext, useMemo, useState } from "react";
|
|
|
4
4
|
import { Button } from "./Button";
|
|
5
5
|
import { Div } from "./Div";
|
|
6
6
|
import { Span } from "./Typography";
|
|
7
|
+
import { Collapse } from "./Motion";
|
|
7
8
|
const AccordionContext = createContext(null);
|
|
8
9
|
function toArray(value) {
|
|
9
10
|
if (!value)
|
|
@@ -53,5 +54,5 @@ export function AccordionItem({ value, title, disabled = false, className = "",
|
|
|
53
54
|
throw new Error("AccordionItem must be used within Accordion.");
|
|
54
55
|
}
|
|
55
56
|
const isOpen = ctx.openValues.includes(value);
|
|
56
|
-
return (_jsxs(Div, { className: `appkit-accordion__item ${className}`, children: [_jsxs(Button, { type: "button", disabled: disabled, "aria-expanded": isOpen, onClick: () => ctx.toggle(value), className: "appkit-accordion__trigger", children: [_jsx(Span, { children: title }), _jsx(Span, { className: `appkit-accordion__item-chevron ${isOpen ? "appkit-accordion__item-chevron--open" : ""}`, children: "\u25BE" })] }), isOpen
|
|
57
|
+
return (_jsxs(Div, { className: `appkit-accordion__item ${className}`, children: [_jsxs(Button, { type: "button", disabled: disabled, "aria-expanded": isOpen, onClick: () => ctx.toggle(value), className: "appkit-accordion__trigger", children: [_jsx(Span, { children: title }), _jsx(Span, { className: `appkit-accordion__item-chevron ${isOpen ? "appkit-accordion__item-chevron--open" : ""}`, children: "\u25BE" })] }), _jsx(Collapse, { isOpen: isOpen, children: _jsx(Div, { className: "appkit-accordion__panel", children: children }) })] }));
|
|
57
58
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { SurfaceProps } from "./surface-tokens";
|
|
3
|
+
type CardAnimate = "hoverLift" | "pressScale" | "hoverScale" | "both";
|
|
2
4
|
type CardVariant = "flat" | "outlined" | "elevated" | "default" | "primary" | "bordered" | "interactive" | "glass" | "gradient-indigo" | "gradient-teal" | "gradient-amber" | "gradient-rose" | "stat-indigo" | "stat-teal" | "stat-amber" | "stat-rose" | "stat-emerald";
|
|
3
5
|
type CardPadding = "none" | "sm" | "md" | "lg";
|
|
4
|
-
export interface CardProps {
|
|
6
|
+
export interface CardProps extends SurfaceProps {
|
|
5
7
|
children: React.ReactNode;
|
|
6
8
|
variant?: CardVariant;
|
|
7
9
|
padding?: CardPadding;
|
|
8
10
|
hover?: boolean;
|
|
11
|
+
animate?: CardAnimate;
|
|
9
12
|
className?: string;
|
|
10
13
|
style?: React.CSSProperties;
|
|
11
14
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
12
15
|
}
|
|
13
|
-
export declare function Card({ children, variant, padding, hover, className, style, onClick, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function Card({ children, variant, padding, hover, animate, surface, rounded, border, shadow, className, style, onClick, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
export interface CardSectionProps {
|
|
15
18
|
children: React.ReactNode;
|
|
16
19
|
className?: string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
4
|
+
import { buildSurfaceClasses } from "./surface-tokens";
|
|
5
|
+
import { SPRING_SNAPPY } from "../../tokens/motion";
|
|
2
6
|
const UI_CARD = {
|
|
3
7
|
base: "appkit-card",
|
|
4
8
|
variants: {
|
|
@@ -27,17 +31,31 @@ const UI_CARD = {
|
|
|
27
31
|
lg: "appkit-card--pad-lg",
|
|
28
32
|
},
|
|
29
33
|
};
|
|
30
|
-
export function Card({ children, variant = "flat", padding = "md", hover = false, className = "", style, onClick, }) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
export function Card({ children, variant = "flat", padding = "md", hover = false, animate, surface, rounded, border, shadow, className = "", style, onClick, }) {
|
|
35
|
+
const reduced = useReducedMotion();
|
|
36
|
+
const cls = [
|
|
37
|
+
UI_CARD.base,
|
|
38
|
+
UI_CARD.variants[variant],
|
|
39
|
+
UI_CARD.padding[padding],
|
|
40
|
+
hover ? "appkit-card--hoverable" : "",
|
|
41
|
+
onClick ? "appkit-card--clickable" : "",
|
|
42
|
+
buildSurfaceClasses({ surface, rounded, border, shadow }),
|
|
43
|
+
className,
|
|
44
|
+
]
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
.join(" ");
|
|
47
|
+
if (animate && !reduced) {
|
|
48
|
+
const whileHover = animate === "hoverLift" || animate === "both"
|
|
49
|
+
? { y: -2 }
|
|
50
|
+
: animate === "hoverScale"
|
|
51
|
+
? { scale: 1.02 }
|
|
52
|
+
: undefined;
|
|
53
|
+
const whileTap = animate === "pressScale" || animate === "both"
|
|
54
|
+
? { scale: 0.97 }
|
|
55
|
+
: undefined;
|
|
56
|
+
return (_jsx(motion.div, { className: cls, style: style, onClick: onClick, whileHover: whileHover, whileTap: whileTap, transition: SPRING_SNAPPY, "data-section": "card-div-463", children: children }));
|
|
57
|
+
}
|
|
58
|
+
return (_jsx("div", { className: cls, style: style, onClick: onClick, "data-section": "card-div-463", children: children }));
|
|
41
59
|
}
|
|
42
60
|
export function CardHeader({ children, className = "" }) {
|
|
43
61
|
return (_jsx("div", { className: ["appkit-card__header", className].filter(Boolean).join(" "), "data-section": "card-div-464", children: children }));
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import type { SurfaceProps } from "./surface-tokens";
|
|
3
|
+
export interface DivProps extends React.HTMLAttributes<HTMLDivElement>, SurfaceProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
}
|
|
5
|
-
/**
|
|
6
|
-
* Semantic `<div data-section="div-div-477">` wrapper for general-purpose layout containers.
|
|
7
|
-
*
|
|
8
|
-
* Use when no more specific semantic element applies
|
|
9
|
-
* (`<Section>`, `<Article>`, `<Main>`, `<Aside>` etc). Enables
|
|
10
|
-
* future one-place theming and consistent import from `@mohasinac/appkit/ui`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* <Div className="flex items-center gap-4">
|
|
15
|
-
* <Badge>New</Badge>
|
|
16
|
-
* <Text>Product title</Text>
|
|
17
|
-
* </Div>
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
6
|
export declare const Div: React.ForwardRefExoticComponent<DivProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* Use when no more specific semantic element applies
|
|
7
|
-
* (`<Section>`, `<Article>`, `<Main>`, `<Aside>` etc). Enables
|
|
8
|
-
* future one-place theming and consistent import from `@mohasinac/appkit/ui`.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <Div className="flex items-center gap-4">
|
|
13
|
-
* <Badge>New</Badge>
|
|
14
|
-
* <Text>Product title</Text>
|
|
15
|
-
* </Div>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export const Div = React.forwardRef(({ className = "", children, ...props }, ref) => (_jsx("div", { ref: ref, className: className, ...props, "data-section": "div-div-478", children: children })));
|
|
3
|
+
import { buildSurfaceClasses } from "./surface-tokens";
|
|
4
|
+
export const Div = React.forwardRef(({ className = "", surface, padding, rounded, border, shadow, children, ...props }, ref) => (_jsx("div", { ref: ref, className: [buildSurfaceClasses({ surface, padding, rounded, border, shadow }), className].filter(Boolean).join(" "), ...props, children: children })));
|
|
19
5
|
Div.displayName = "Div";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { SurfaceProps } from "./surface-tokens";
|
|
2
3
|
/**
|
|
3
4
|
* Layout Primitives — Container, Stack, Row, Grid
|
|
4
5
|
*
|
|
@@ -167,24 +168,13 @@ type JustifyContent = keyof typeof JUSTIFY_MAP;
|
|
|
167
168
|
* <Container size="full" as="main">...</Container>
|
|
168
169
|
* ```
|
|
169
170
|
*/
|
|
170
|
-
export interface ContainerProps extends React.HTMLAttributes<HTMLElement
|
|
171
|
-
/**
|
|
172
|
-
* Max-width breakpoint preset.
|
|
173
|
-
* - `sm` → `max-w-3xl` (blog / policy)
|
|
174
|
-
* - `md` → `max-w-4xl` (contact / about)
|
|
175
|
-
* - `lg` → `max-w-5xl` (checkout / help)
|
|
176
|
-
* - `xl` → `max-w-6xl` (product detail / cart)
|
|
177
|
-
* - `2xl` → `max-w-7xl` (main content grids — **default**)
|
|
178
|
-
* - `full` → `max-w-screen-2xl` (full-bleed)
|
|
179
|
-
* - `wide` → `max-w-screen-2xl` (compact px, no lg step)
|
|
180
|
-
* - `ultra` → `max-w-[1920px]` (ultra-wide / 4K displays)
|
|
181
|
-
*/
|
|
171
|
+
export interface ContainerProps extends React.HTMLAttributes<HTMLElement>, SurfaceProps {
|
|
182
172
|
size?: ContainerSize;
|
|
183
173
|
/** Render as a different element (e.g. `"main"`, `"section"`). Defaults to `"div"`. */
|
|
184
174
|
as?: React.ElementType;
|
|
185
175
|
children?: React.ReactNode;
|
|
186
176
|
}
|
|
187
|
-
export declare function Container({ size, as, className, children, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
177
|
+
export declare function Container({ size, as, surface, padding, rounded, border, shadow, className, children, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
188
178
|
/**
|
|
189
179
|
* Vertical flex column. Use instead of `<div className="flex flex-col gap-4" data-section="layout-div-535">`.
|
|
190
180
|
*
|
|
@@ -201,7 +191,7 @@ export declare function Container({ size, as, className, children, ...props }: C
|
|
|
201
191
|
* </Stack>
|
|
202
192
|
* ```
|
|
203
193
|
*/
|
|
204
|
-
export interface StackProps extends React.HTMLAttributes<HTMLElement
|
|
194
|
+
export interface StackProps extends React.HTMLAttributes<HTMLElement>, SurfaceProps {
|
|
205
195
|
/** Space between children. Defaults to `"md"` (`gap-4`). */
|
|
206
196
|
gap?: GapKey;
|
|
207
197
|
/** Centers children on both axes (`items-center justify-center`). */
|
|
@@ -212,7 +202,7 @@ export interface StackProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
212
202
|
as?: React.ElementType;
|
|
213
203
|
children?: React.ReactNode;
|
|
214
204
|
}
|
|
215
|
-
export declare function Stack({ gap, centered, align, as, className, children, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
205
|
+
export declare function Stack({ gap, centered, align, as, surface, padding, rounded, border, shadow, className, children, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
216
206
|
/**
|
|
217
207
|
* Horizontal flex row. Use instead of `<div className="flex items-center gap-3" data-section="layout-div-536">`.
|
|
218
208
|
*
|
|
@@ -229,7 +219,7 @@ export declare function Stack({ gap, centered, align, as, className, children, .
|
|
|
229
219
|
* </Row>
|
|
230
220
|
* ```
|
|
231
221
|
*/
|
|
232
|
-
export interface RowProps extends React.HTMLAttributes<HTMLElement
|
|
222
|
+
export interface RowProps extends React.HTMLAttributes<HTMLElement>, SurfaceProps {
|
|
233
223
|
/** Space between children. Defaults to `"md"` (`gap-4`). */
|
|
234
224
|
gap?: GapKey;
|
|
235
225
|
/** Centers children on both axes (`items-center justify-center`). */
|
|
@@ -244,7 +234,7 @@ export interface RowProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
244
234
|
as?: React.ElementType;
|
|
245
235
|
children?: React.ReactNode;
|
|
246
236
|
}
|
|
247
|
-
export declare function Row({ gap, centered, align, justify, wrap, as, className, children, ...props }: RowProps): import("react/jsx-runtime").JSX.Element;
|
|
237
|
+
export declare function Row({ gap, centered, align, justify, wrap, as, surface, padding, rounded, border, shadow, className, children, ...props }: RowProps): import("react/jsx-runtime").JSX.Element;
|
|
248
238
|
/**
|
|
249
239
|
* Responsive CSS grid. Use instead of `<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4" data-section="layout-div-537">`.
|
|
250
240
|
*
|
|
@@ -261,7 +251,7 @@ export declare function Row({ gap, centered, align, justify, wrap, as, className
|
|
|
261
251
|
* </Grid>
|
|
262
252
|
* ```
|
|
263
253
|
*/
|
|
264
|
-
export interface GridProps extends React.HTMLAttributes<HTMLElement
|
|
254
|
+
export interface GridProps extends React.HTMLAttributes<HTMLElement>, SurfaceProps {
|
|
265
255
|
/**
|
|
266
256
|
* Column preset.
|
|
267
257
|
* - Numbers `1`–`6` → mobile-first responsive stacks
|
|
@@ -280,5 +270,5 @@ export interface GridProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
280
270
|
as?: React.ElementType;
|
|
281
271
|
children?: React.ReactNode;
|
|
282
272
|
}
|
|
283
|
-
export declare function Grid({ cols, gap, as, className, children, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
273
|
+
export declare function Grid({ cols, gap, as, surface, padding, rounded, border, shadow, className, children, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
284
274
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { buildSurfaceClasses } from "./surface-tokens";
|
|
2
3
|
/**
|
|
3
4
|
* Layout Primitives — Container, Stack, Row, Grid
|
|
4
5
|
*
|
|
@@ -142,26 +143,27 @@ const JUSTIFY_MAP = {
|
|
|
142
143
|
around: "appkit-justify--around",
|
|
143
144
|
evenly: "appkit-justify--evenly",
|
|
144
145
|
};
|
|
145
|
-
export function Container({ size = "2xl", as, className = "", children, ...props }) {
|
|
146
|
+
export function Container({ size = "2xl", as, surface, padding, rounded, border, shadow, className = "", children, ...props }) {
|
|
146
147
|
const Tag = (as ?? "div");
|
|
147
|
-
return (_jsx(Tag, { className: ["appkit-container", CONTAINER_MAP[size], className]
|
|
148
|
+
return (_jsx(Tag, { className: ["appkit-container", CONTAINER_MAP[size], buildSurfaceClasses({ surface, padding, rounded, border, shadow }), className]
|
|
148
149
|
.filter(Boolean)
|
|
149
150
|
.join(" "), ...props, children: children }));
|
|
150
151
|
}
|
|
151
|
-
export function Stack({ gap = "md", centered = false, align = "stretch", as, className = "", children, ...props }) {
|
|
152
|
+
export function Stack({ gap = "md", centered = false, align = "stretch", as, surface, padding, rounded, border, shadow, className = "", children, ...props }) {
|
|
152
153
|
const Tag = (as ?? "div");
|
|
153
154
|
const classes = [
|
|
154
155
|
"appkit-stack",
|
|
155
156
|
GAP_MAP[gap],
|
|
156
157
|
centered ? "appkit-stack--centered" : "",
|
|
157
158
|
!centered && align !== "stretch" ? ITEMS_MAP[align] : "",
|
|
159
|
+
buildSurfaceClasses({ surface, padding, rounded, border, shadow }),
|
|
158
160
|
className,
|
|
159
161
|
]
|
|
160
162
|
.filter(Boolean)
|
|
161
163
|
.join(" ");
|
|
162
164
|
return (_jsx(Tag, { className: classes, ...props, children: children }));
|
|
163
165
|
}
|
|
164
|
-
export function Row({ gap = "md", centered = false, align = "center", justify = "start", wrap = false, as, className = "", children, ...props }) {
|
|
166
|
+
export function Row({ gap = "md", centered = false, align = "center", justify = "start", wrap = false, as, surface, padding, rounded, border, shadow, className = "", children, ...props }) {
|
|
165
167
|
const Tag = (as ?? "div");
|
|
166
168
|
const classes = [
|
|
167
169
|
"appkit-row",
|
|
@@ -169,17 +171,17 @@ export function Row({ gap = "md", centered = false, align = "center", justify =
|
|
|
169
171
|
!centered && justify !== "start" ? JUSTIFY_MAP[justify] : "",
|
|
170
172
|
GAP_MAP[gap],
|
|
171
173
|
wrap ? "appkit-row--wrap" : "",
|
|
174
|
+
buildSurfaceClasses({ surface, padding, rounded, border, shadow }),
|
|
172
175
|
className,
|
|
173
176
|
]
|
|
174
177
|
.filter(Boolean)
|
|
175
178
|
.join(" ");
|
|
176
179
|
return (_jsx(Tag, { className: classes, ...props, children: children }));
|
|
177
180
|
}
|
|
178
|
-
export function Grid({ cols, gap = "md", as, className = "", children, ...props }) {
|
|
181
|
+
export function Grid({ cols, gap = "md", as, surface, padding, rounded, border, shadow, className = "", children, ...props }) {
|
|
179
182
|
const Tag = (as ?? "div");
|
|
180
|
-
// When cols is omitted callers supply grid-cols-* themselves via className.
|
|
181
183
|
const baseClass = cols !== undefined ? GRID_MAP[cols] : "appkit-grid";
|
|
182
|
-
const classes = [baseClass, GAP_MAP[gap], className]
|
|
184
|
+
const classes = [baseClass, GAP_MAP[gap], buildSurfaceClasses({ surface, padding, rounded, border, shadow }), className]
|
|
183
185
|
.filter(Boolean)
|
|
184
186
|
.join(" ");
|
|
185
187
|
return (_jsx(Tag, { className: classes, ...props, children: children }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ListingFilterDrawerProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onApply: () => void;
|
|
6
|
+
onClear: () => void;
|
|
7
|
+
activeCount: number;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function ListingFilterDrawer({ open, onClose, onApply, onClear, activeCount, children, }: ListingFilterDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
export function ListingFilterDrawer({ open, onClose, onApply, onClear, activeCount, children, }) {
|
|
5
|
+
if (!open)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: onClose }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeCount > 0 && (_jsx("button", { type: "button", onClick: onClear, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: children }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: onApply, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeCount > 0 ? ` (${activeCount})` : ""] }) })] })] }));
|
|
8
|
+
}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
|
+
import { motion, AnimatePresence, useReducedMotion } from "motion/react";
|
|
5
6
|
import { Heading } from "./Typography";
|
|
6
7
|
import { Button } from "./Button";
|
|
8
|
+
import { SPRING_GENTLE } from "../../tokens/motion";
|
|
7
9
|
const SIZE_CLASSES = {
|
|
8
10
|
sm: "appkit-modal__panel--sm",
|
|
9
11
|
md: "appkit-modal__panel--md",
|
|
@@ -61,12 +63,13 @@ export function Modal({ isOpen, open, onClose, title, children, size = "md", sho
|
|
|
61
63
|
first.focus();
|
|
62
64
|
}
|
|
63
65
|
};
|
|
64
|
-
|
|
66
|
+
const reduced = useReducedMotion();
|
|
67
|
+
if (typeof document === "undefined") {
|
|
65
68
|
return null;
|
|
66
69
|
}
|
|
67
|
-
return createPortal(_jsxs(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
return createPortal(_jsx(AnimatePresence, { children: visible && (_jsxs(motion.div, { className: "appkit-modal", role: "dialog", "aria-modal": "true", "aria-labelledby": title ? titleId : undefined, onKeyDown: handleKeyDown, initial: reduced ? false : { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.15 }, "data-section": "modal-div-561", children: [_jsx("div", { className: "appkit-modal__backdrop", "aria-hidden": "true", onClick: onClose }), _jsxs(motion.div, { ref: panelRef, tabIndex: -1, className: ["appkit-modal__panel", SIZE_CLASSES[size], className]
|
|
71
|
+
.filter(Boolean)
|
|
72
|
+
.join(" "), initial: reduced ? false : { opacity: 0, scale: 0.95, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, exit: { opacity: 0, scale: 0.95, y: 8 }, transition: SPRING_GENTLE, "data-section": "modal-div-562", children: [(title || showCloseButton) && (_jsxs("div", { className: "appkit-modal__header", "data-section": "modal-div-563", children: [title ? (_jsx(Heading, { level: 2, id: titleId, className: "appkit-modal__title", children: title })) : (_jsx("span", {})), showCloseButton ? (_jsx(Button, { variant: "ghost", size: "sm", type: "button", onClick: onClose, className: "appkit-modal__close", "aria-label": "Close", children: _jsx("span", { className: "appkit-modal__close-icon", "aria-hidden": "true", children: "\u00D7" }) })) : null] })), _jsx("div", { className: "appkit-modal__body", "data-section": "modal-div-564", children: children }), actions ? _jsx(ModalFooter, { children: actions }) : null] })] })) }), document.body);
|
|
70
73
|
}
|
|
71
74
|
export function ModalFooter({ children, className = "", }) {
|
|
72
75
|
return (_jsx("div", { className: [
|