@licklist/design 0.78.5-dev.106 → 0.78.5-dev.107
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/.vscode/settings.json +3 -0
- package/bitbucket-pipelines.yml +13 -4
- package/dist/Maintenance/Maintenance.scss.js +1 -1
- package/dist/product-set/form/ProductsControl.d.ts +2 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +0 -24
- package/dist/v2/components/ActionMenu/ActionMenu.scss.js +1 -1
- package/dist/v2/components/Badge/Badge.scss.js +1 -1
- package/dist/v2/components/Button/Button.scss.js +1 -1
- package/dist/v2/components/Button/GhostButton.scss.js +1 -1
- package/dist/v2/components/Checkbox/Checkbox.scss.js +1 -1
- package/dist/v2/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/v2/components/DataTable/DataTable.js +86 -2
- package/dist/v2/components/IconButton/IconButton.scss.js +1 -1
- package/dist/v2/components/Modal/DeleteModal.d.ts.map +1 -1
- package/dist/v2/components/Modal/DeleteModal.js +13 -11
- package/dist/v2/components/Modal/DeleteModal.scss.js +1 -1
- package/dist/v2/components/NPSScore/NPSScore.scss.js +1 -1
- package/dist/v2/components/NewTabs/NewTabs.scss.js +1 -1
- package/dist/v2/components/Select/Select.scss.js +1 -1
- package/dist/v2/components/StatusBadge/StatusBadge.scss.js +1 -1
- package/dist/v2/components/StepIndicator/StepIndicator.scss.js +1 -1
- package/dist/v2/components/Tabs/Tabs.scss.js +1 -1
- package/dist/v2/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/v2/components/Toggle/Toggle.js +8 -5
- package/dist/v2/components/Tooltip/Tooltip.scss.js +1 -1
- package/dist/v2/components/UserAvatar/UserAvatar.scss.js +1 -1
- package/dist/v2/components/UserPanel/UserPanel.scss.js +1 -1
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +1 -1
- package/dist/v2/components/ZoneCard/ZoneCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/chart/Chart.scss.js +1 -1
- package/dist/v2/dashboard-analytics/metric-card/MetricCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/venue-card/VenueCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss.js +1 -1
- package/dist/v2/icons/index.js +1 -16
- package/dist/v2/index.d.ts +0 -4
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/AdminSidebar.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/TopNavigation.scss.js +1 -1
- package/dist/v2/pages/Settings/SettingsTabs.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarCustomisation.js +0 -3
- package/dist/v2/pages/Settings/components/SidebarCustomisation.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarNavItem.js +0 -3
- package/dist/v2/pages/auth/AuthLayout/AuthLayout.scss.js +1 -1
- package/dist/v2/styles/form/NewInput.scss.js +1 -1
- package/package.json +6 -6
- package/rollup.config.js +16 -2
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +1 -1
- package/src/product-set/form/ProductsControl.tsx +2 -1
- package/src/v2/components/DataTable/DataTable.tsx +23 -1
- package/src/v2/components/Modal/DeleteModal.tsx +12 -20
- package/src/v2/components/Toggle/Toggle.tsx +6 -5
- package/src/v2/index.ts +0 -73
- package/dist/v2/shadcn/components/ui/accordion.d.ts +0 -8
- package/dist/v2/shadcn/components/ui/accordion.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/alert-dialog.d.ts +0 -21
- package/dist/v2/shadcn/components/ui/alert-dialog.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/alert.d.ts +0 -9
- package/dist/v2/shadcn/components/ui/alert.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts +0 -4
- package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/avatar.d.ts +0 -7
- package/dist/v2/shadcn/components/ui/avatar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/badge.d.ts +0 -10
- package/dist/v2/shadcn/components/ui/badge.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/breadcrumb.d.ts +0 -20
- package/dist/v2/shadcn/components/ui/breadcrumb.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/button.d.ts +0 -14
- package/dist/v2/shadcn/components/ui/button.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/calendar.d.ts +0 -9
- package/dist/v2/shadcn/components/ui/calendar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/card.d.ts +0 -9
- package/dist/v2/shadcn/components/ui/card.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/carousel.d.ts +0 -19
- package/dist/v2/shadcn/components/ui/carousel.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/checkbox.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/checkbox.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/checkbox.js +0 -115
- package/dist/v2/shadcn/components/ui/checkbox.scss.js +0 -6
- package/dist/v2/shadcn/components/ui/collapsible.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/collapsible.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/command.d.ts +0 -83
- package/dist/v2/shadcn/components/ui/command.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/context-menu.d.ts +0 -28
- package/dist/v2/shadcn/components/ui/context-menu.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/dialog.d.ts +0 -20
- package/dist/v2/shadcn/components/ui/dialog.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/dialog.js +0 -169
- package/dist/v2/shadcn/components/ui/drawer.d.ts +0 -23
- package/dist/v2/shadcn/components/ui/drawer.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts +0 -28
- package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/form.d.ts +0 -24
- package/dist/v2/shadcn/components/ui/form.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/hover-card.d.ts +0 -7
- package/dist/v2/shadcn/components/ui/hover-card.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/input-otp.d.ts +0 -35
- package/dist/v2/shadcn/components/ui/input-otp.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/input.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/input.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/label.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/label.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/menubar.d.ts +0 -34
- package/dist/v2/shadcn/components/ui/menubar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/navigation-menu.d.ts +0 -13
- package/dist/v2/shadcn/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/pagination.d.ts +0 -29
- package/dist/v2/shadcn/components/ui/pagination.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/popover.d.ts +0 -7
- package/dist/v2/shadcn/components/ui/popover.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/progress.d.ts +0 -5
- package/dist/v2/shadcn/components/ui/progress.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/radio-card.d.ts +0 -12
- package/dist/v2/shadcn/components/ui/radio-card.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/radio-group.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/radio-group.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/scroll-area.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/select.d.ts +0 -14
- package/dist/v2/shadcn/components/ui/select.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/separator.d.ts +0 -5
- package/dist/v2/shadcn/components/ui/separator.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/sheet.d.ts +0 -26
- package/dist/v2/shadcn/components/ui/sheet.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/sidebar.d.ts +0 -67
- package/dist/v2/shadcn/components/ui/sidebar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/skeleton.d.ts +0 -3
- package/dist/v2/shadcn/components/ui/skeleton.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/slider.d.ts +0 -5
- package/dist/v2/shadcn/components/ui/slider.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/switch.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/switch.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/switch.js +0 -115
- package/dist/v2/shadcn/components/ui/switch.scss.js +0 -6
- package/dist/v2/shadcn/components/ui/table-pagination.d.ts +0 -11
- package/dist/v2/shadcn/components/ui/table-pagination.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/table.d.ts +0 -11
- package/dist/v2/shadcn/components/ui/table.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/tabs.d.ts +0 -8
- package/dist/v2/shadcn/components/ui/tabs.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/textarea.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/textarea.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toast.d.ts +0 -16
- package/dist/v2/shadcn/components/ui/toast.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toaster.d.ts +0 -2
- package/dist/v2/shadcn/components/ui/toaster.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toggle-group.d.ts +0 -13
- package/dist/v2/shadcn/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toggle.d.ts +0 -13
- package/dist/v2/shadcn/components/ui/toggle.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/tooltip.d.ts +0 -8
- package/dist/v2/shadcn/components/ui/tooltip.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/use-toast.d.ts +0 -3
- package/dist/v2/shadcn/components/ui/use-toast.d.ts.map +0 -1
- package/dist/v2/shadcn/hooks/use-mobile.d.ts +0 -2
- package/dist/v2/shadcn/hooks/use-mobile.d.ts.map +0 -1
- package/dist/v2/shadcn/hooks/use-toast.d.ts +0 -45
- package/dist/v2/shadcn/hooks/use-toast.d.ts.map +0 -1
- package/dist/v2/shadcn/index.d.ts +0 -20
- package/dist/v2/shadcn/index.d.ts.map +0 -1
- package/dist/v2/shadcn/lib/utils.d.ts +0 -3
- package/dist/v2/shadcn/lib/utils.d.ts.map +0 -1
- package/dist/v2/shadcn/lib/utils.js +0 -11
- package/dist/v2/shadcn/styles/globals.css +0 -112
- package/src/v2/shadcn/_reference/AccountManagerCard.tsx +0 -45
- package/src/v2/shadcn/_reference/AffiliatesTable.tsx +0 -178
- package/src/v2/shadcn/_reference/AuditArchive.tsx +0 -165
- package/src/v2/shadcn/_reference/AuditContent.tsx +0 -270
- package/src/v2/shadcn/_reference/AutomationsGeneralSettings.tsx +0 -251
- package/src/v2/shadcn/_reference/AvatarUpload.tsx +0 -150
- package/src/v2/shadcn/_reference/BookingsSummaryCard.tsx +0 -268
- package/src/v2/shadcn/_reference/CodeCleanUpAudit.tsx +0 -274
- package/src/v2/shadcn/_reference/CompaniesTable.tsx +0 -387
- package/src/v2/shadcn/_reference/ComponentAudit.tsx +0 -239
- package/src/v2/shadcn/_reference/ConfigureSettingsCard.tsx +0 -95
- package/src/v2/shadcn/_reference/CustomerCard.tsx +0 -155
- package/src/v2/shadcn/_reference/DashboardCards.tsx +0 -50
- package/src/v2/shadcn/_reference/DashboardFooter.tsx +0 -18
- package/src/v2/shadcn/_reference/DiarySettings.tsx +0 -187
- package/src/v2/shadcn/_reference/DiaryView.tsx +0 -998
- package/src/v2/shadcn/_reference/EmptyState.tsx +0 -76
- package/src/v2/shadcn/_reference/EntityInfoCard.tsx +0 -48
- package/src/v2/shadcn/_reference/ExistingUserAssignments.tsx +0 -131
- package/src/v2/shadcn/_reference/FeatureToggle.tsx +0 -72
- package/src/v2/shadcn/_reference/FlowCard.tsx +0 -170
- package/src/v2/shadcn/_reference/FlowsContent.tsx +0 -688
- package/src/v2/shadcn/_reference/FlowsGeneralSettings.tsx +0 -27
- package/src/v2/shadcn/_reference/GeneralSettings.tsx +0 -33
- package/src/v2/shadcn/_reference/InventoryGeneralSettings.tsx +0 -82
- package/src/v2/shadcn/_reference/LanguageSelector.tsx +0 -97
- package/src/v2/shadcn/_reference/LoadingScreen.tsx +0 -25
- package/src/v2/shadcn/_reference/LoadingSpinner.tsx +0 -41
- package/src/v2/shadcn/_reference/ManagedClientsList.tsx +0 -121
- package/src/v2/shadcn/_reference/NPSScore.tsx +0 -379
- package/src/v2/shadcn/_reference/NPSSummaryCard.tsx +0 -181
- package/src/v2/shadcn/_reference/NotificationBanner.tsx +0 -129
- package/src/v2/shadcn/_reference/NotificationPanel.tsx +0 -208
- package/src/v2/shadcn/_reference/OnlineUsersCard.tsx +0 -73
- package/src/v2/shadcn/_reference/ProtectedRoute.tsx +0 -39
- package/src/v2/shadcn/_reference/ProvidersTable.tsx +0 -353
- package/src/v2/shadcn/_reference/QuickAddPanel.tsx +0 -1057
- package/src/v2/shadcn/_reference/QuickFilters.tsx +0 -112
- package/src/v2/shadcn/_reference/ScheduleView.tsx +0 -410
- package/src/v2/shadcn/_reference/ScrollToTop.tsx +0 -14
- package/src/v2/shadcn/_reference/SecondaryNav.tsx +0 -50
- package/src/v2/shadcn/_reference/SecuritySettings.tsx +0 -258
- package/src/v2/shadcn/_reference/SessionDetailView.tsx +0 -294
- package/src/v2/shadcn/_reference/Sidebar.tsx +0 -14
- package/src/v2/shadcn/_reference/SidebarAwareLayout.tsx +0 -30
- package/src/v2/shadcn/_reference/SidebarLabelCustomization.tsx +0 -285
- package/src/v2/shadcn/_reference/SimulationBanner.tsx +0 -57
- package/src/v2/shadcn/_reference/SortControls.tsx +0 -65
- package/src/v2/shadcn/_reference/StatusBadge.tsx +0 -49
- package/src/v2/shadcn/_reference/StyleGuideContent.tsx +0 -331
- package/src/v2/shadcn/_reference/TableActionMenu.tsx +0 -126
- package/src/v2/shadcn/_reference/ThemeProvider.tsx +0 -119
- package/src/v2/shadcn/_reference/ThemeSettings.tsx +0 -73
- package/src/v2/shadcn/_reference/TopNavigation.tsx +0 -332
- package/src/v2/shadcn/_reference/UserActivityHistory.tsx +0 -209
- package/src/v2/shadcn/_reference/UserLanguageSettings.tsx +0 -94
- package/src/v2/shadcn/_reference/UserPanel.tsx +0 -472
- package/src/v2/shadcn/_reference/UsersTable.tsx +0 -1023
- package/src/v2/shadcn/_reference/WaiverForm.tsx +0 -301
- package/src/v2/shadcn/_reference/WaiversGeneralSettings.tsx +0 -46
- package/src/v2/shadcn/_reference/WaiversTable.tsx +0 -290
- package/src/v2/shadcn/_reference/WaiversTemplatesSettings.tsx +0 -416
- package/src/v2/shadcn/_reference/ai/AIChatPanel.tsx +0 -313
- package/src/v2/shadcn/_reference/ai/AIChatSearchBar.tsx +0 -36
- package/src/v2/shadcn/_reference/ai/ChatInteractiveBlock.tsx +0 -298
- package/src/v2/shadcn/_reference/ai/ChatMessageContent.tsx +0 -40
- package/src/v2/shadcn/_reference/ai/parseInteractiveBlocks.ts +0 -142
- package/src/v2/shadcn/_reference/auth/AuthLayout.tsx +0 -55
- package/src/v2/shadcn/_reference/auth/CreatePasswordForm.tsx +0 -285
- package/src/v2/shadcn/_reference/auth/CreatePasswordPanel.tsx +0 -20
- package/src/v2/shadcn/_reference/auth/LoginFooter.tsx +0 -14
- package/src/v2/shadcn/_reference/auth/LoginForm.tsx +0 -205
- package/src/v2/shadcn/_reference/auth/LoginPanel.tsx +0 -41
- package/src/v2/shadcn/_reference/auth/ResetPasswordForm.tsx +0 -102
- package/src/v2/shadcn/_reference/auth/ResetPasswordPanel.tsx +0 -20
- package/src/v2/shadcn/_reference/auth/VerifyEmailForm.tsx +0 -95
- package/src/v2/shadcn/_reference/auth/VerifyEmailPanel.tsx +0 -20
- package/src/v2/shadcn/_reference/email/EmailAttachment.tsx +0 -119
- package/src/v2/shadcn/_reference/email/EmailAutomation.tsx +0 -92
- package/src/v2/shadcn/_reference/email/EmailPlaceholders.tsx +0 -64
- package/src/v2/shadcn/_reference/email/UnlayerEmailEditor.tsx +0 -41
- package/src/v2/shadcn/_reference/email/emailTemplateData.ts +0 -53
- package/src/v2/shadcn/_reference/emptyStateIcons.tsx +0 -103
- package/src/v2/shadcn/_reference/games/MazeGame.tsx +0 -394
- package/src/v2/shadcn/_reference/games/RunnerGame.tsx +0 -497
- package/src/v2/shadcn/_reference/logos/BookedLogoFull.tsx +0 -36
- package/src/v2/shadcn/_reference/logos/BookedLogoMark.tsx +0 -31
- package/src/v2/shadcn/_reference/logos/BookedLogoNew.tsx +0 -36
- package/src/v2/shadcn/_reference/pricing/DynamicPricingRulesEditor.tsx +0 -401
- package/src/v2/shadcn/_reference/pricing/DynamicPricingTierCard.tsx +0 -77
- package/src/v2/shadcn/_reference/pricing/DynamicPricingTiersList.tsx +0 -218
- package/src/v2/shadcn/_reference/pricing/PricingCalendar.tsx +0 -810
- package/src/v2/shadcn/_reference/pricing/PricingPeriodCard.tsx +0 -152
- package/src/v2/shadcn/_reference/pricing/PricingPeriodForm.tsx +0 -377
- package/src/v2/shadcn/_reference/pricing/PricingPeriodsList.tsx +0 -213
- package/src/v2/shadcn/_reference/pricing/getRuleSummary.ts +0 -39
- package/src/v2/shadcn/_reference/products/AvailabilityRulesSection.tsx +0 -184
- package/src/v2/shadcn/_reference/products/AvailabilitySection.tsx +0 -677
- package/src/v2/shadcn/_reference/products/BookingTypeConfigOptions.tsx +0 -40
- package/src/v2/shadcn/_reference/products/CapacityPeriodsSection.tsx +0 -238
- package/src/v2/shadcn/_reference/products/DynamicPricingTiersSection.tsx +0 -131
- package/src/v2/shadcn/_reference/products/GiftCardOrdersTab.tsx +0 -192
- package/src/v2/shadcn/_reference/products/GiftCardSettings.tsx +0 -342
- package/src/v2/shadcn/_reference/products/PackageProductsSection.tsx +0 -322
- package/src/v2/shadcn/_reference/products/PricingSection.tsx +0 -173
- package/src/v2/shadcn/_reference/products/ProductTypeFields.tsx +0 -353
- package/src/v2/shadcn/_reference/products/ProductTypeIcon.tsx +0 -95
- package/src/v2/shadcn/_reference/products/VariablePricingSection.tsx +0 -140
- package/src/v2/shadcn/_reference/products/productTypeConfig.ts +0 -182
- package/src/v2/shadcn/_reference/shared/BackButton.tsx +0 -50
- package/src/v2/shadcn/_reference/shared/CancelConfirmationDialog.tsx +0 -18
- package/src/v2/shadcn/_reference/shared/ConfirmationDialog.tsx +0 -136
- package/src/v2/shadcn/_reference/shared/DeleteConfirmationDialog.tsx +0 -18
- package/src/v2/shadcn/_reference/shared/DeleteEntityPage.tsx +0 -221
- package/src/v2/shadcn/_reference/shared/SidebarIcons.tsx +0 -108
- package/src/v2/shadcn/_reference/shared/UnifiedSidebar.tsx +0 -722
- package/src/v2/shadcn/_reference/tables/BulkActionsBar.tsx +0 -68
- package/src/v2/shadcn/_reference/tables/DataTable.tsx +0 -221
- package/src/v2/shadcn/_reference/tables/TableControls.tsx +0 -94
- package/src/v2/shadcn/_reference/tables/index.ts +0 -3
- package/src/v2/shadcn/_reference/tables/types.ts +0 -79
- package/src/v2/shadcn/_reference/zones/LegacyZoneSettings.tsx +0 -299
- package/src/v2/shadcn/components/ui/accordion.stories.tsx +0 -63
- package/src/v2/shadcn/components/ui/accordion.tsx +0 -52
- package/src/v2/shadcn/components/ui/alert-dialog.stories.tsx +0 -44
- package/src/v2/shadcn/components/ui/alert-dialog.tsx +0 -104
- package/src/v2/shadcn/components/ui/alert.stories.tsx +0 -44
- package/src/v2/shadcn/components/ui/alert.tsx +0 -43
- package/src/v2/shadcn/components/ui/aspect-ratio.stories.tsx +0 -46
- package/src/v2/shadcn/components/ui/aspect-ratio.tsx +0 -5
- package/src/v2/shadcn/components/ui/avatar.stories.tsx +0 -39
- package/src/v2/shadcn/components/ui/avatar.tsx +0 -38
- package/src/v2/shadcn/components/ui/badge.stories.tsx +0 -17
- package/src/v2/shadcn/components/ui/badge.tsx +0 -30
- package/src/v2/shadcn/components/ui/breadcrumb.stories.tsx +0 -91
- package/src/v2/shadcn/components/ui/breadcrumb.tsx +0 -90
- package/src/v2/shadcn/components/ui/button.stories.tsx +0 -20
- package/src/v2/shadcn/components/ui/button.tsx +0 -60
- package/src/v2/shadcn/components/ui/calendar.stories.tsx +0 -61
- package/src/v2/shadcn/components/ui/calendar.tsx +0 -54
- package/src/v2/shadcn/components/ui/card.stories.tsx +0 -37
- package/src/v2/shadcn/components/ui/card.tsx +0 -43
- package/src/v2/shadcn/components/ui/carousel.stories.tsx +0 -92
- package/src/v2/shadcn/components/ui/carousel.tsx +0 -224
- package/src/v2/shadcn/components/ui/checkbox.scss +0 -38
- package/src/v2/shadcn/components/ui/checkbox.stories.tsx +0 -23
- package/src/v2/shadcn/components/ui/checkbox.tsx +0 -24
- package/src/v2/shadcn/components/ui/collapsible.stories.tsx +0 -59
- package/src/v2/shadcn/components/ui/collapsible.tsx +0 -9
- package/src/v2/shadcn/components/ui/command.stories.tsx +0 -70
- package/src/v2/shadcn/components/ui/command.tsx +0 -132
- package/src/v2/shadcn/components/ui/context-menu.stories.tsx +0 -72
- package/src/v2/shadcn/components/ui/context-menu.tsx +0 -178
- package/src/v2/shadcn/components/ui/dialog.stories.tsx +0 -67
- package/src/v2/shadcn/components/ui/dialog.tsx +0 -95
- package/src/v2/shadcn/components/ui/drawer.stories.tsx +0 -50
- package/src/v2/shadcn/components/ui/drawer.tsx +0 -87
- package/src/v2/shadcn/components/ui/dropdown-menu.stories.tsx +0 -73
- package/src/v2/shadcn/components/ui/dropdown-menu.tsx +0 -179
- package/src/v2/shadcn/components/ui/form.stories.tsx +0 -105
- package/src/v2/shadcn/components/ui/form.tsx +0 -129
- package/src/v2/shadcn/components/ui/hover-card.stories.tsx +0 -35
- package/src/v2/shadcn/components/ui/hover-card.tsx +0 -27
- package/src/v2/shadcn/components/ui/input-otp.stories.tsx +0 -72
- package/src/v2/shadcn/components/ui/input-otp.tsx +0 -61
- package/src/v2/shadcn/components/ui/input.stories.tsx +0 -16
- package/src/v2/shadcn/components/ui/input.tsx +0 -25
- package/src/v2/shadcn/components/ui/label.stories.tsx +0 -13
- package/src/v2/shadcn/components/ui/label.tsx +0 -17
- package/src/v2/shadcn/components/ui/menubar.stories.tsx +0 -86
- package/src/v2/shadcn/components/ui/menubar.tsx +0 -207
- package/src/v2/shadcn/components/ui/navigation-menu.stories.tsx +0 -68
- package/src/v2/shadcn/components/ui/navigation-menu.tsx +0 -120
- package/src/v2/shadcn/components/ui/pagination.stories.tsx +0 -78
- package/src/v2/shadcn/components/ui/pagination.tsx +0 -81
- package/src/v2/shadcn/components/ui/popover.stories.tsx +0 -44
- package/src/v2/shadcn/components/ui/popover.tsx +0 -29
- package/src/v2/shadcn/components/ui/progress.stories.tsx +0 -17
- package/src/v2/shadcn/components/ui/progress.tsx +0 -23
- package/src/v2/shadcn/components/ui/radio-card.stories.tsx +0 -68
- package/src/v2/shadcn/components/ui/radio-card.tsx +0 -52
- package/src/v2/shadcn/components/ui/radio-group.stories.tsx +0 -77
- package/src/v2/shadcn/components/ui/radio-group.tsx +0 -35
- package/src/v2/shadcn/components/ui/scroll-area.stories.tsx +0 -56
- package/src/v2/shadcn/components/ui/scroll-area.tsx +0 -38
- package/src/v2/shadcn/components/ui/select.stories.tsx +0 -60
- package/src/v2/shadcn/components/ui/select.tsx +0 -148
- package/src/v2/shadcn/components/ui/separator.stories.tsx +0 -30
- package/src/v2/shadcn/components/ui/separator.tsx +0 -20
- package/src/v2/shadcn/components/ui/sheet.stories.tsx +0 -115
- package/src/v2/shadcn/components/ui/sheet.tsx +0 -107
- package/src/v2/shadcn/components/ui/sidebar.stories.tsx +0 -167
- package/src/v2/shadcn/components/ui/sidebar.tsx +0 -637
- package/src/v2/shadcn/components/ui/skeleton.stories.tsx +0 -36
- package/src/v2/shadcn/components/ui/skeleton.tsx +0 -7
- package/src/v2/shadcn/components/ui/slider.stories.tsx +0 -16
- package/src/v2/shadcn/components/ui/slider.tsx +0 -23
- package/src/v2/shadcn/components/ui/switch.scss +0 -63
- package/src/v2/shadcn/components/ui/switch.stories.tsx +0 -23
- package/src/v2/shadcn/components/ui/switch.tsx +0 -24
- package/src/v2/shadcn/components/ui/table-pagination.stories.tsx +0 -81
- package/src/v2/shadcn/components/ui/table-pagination.tsx +0 -61
- package/src/v2/shadcn/components/ui/table.stories.tsx +0 -40
- package/src/v2/shadcn/components/ui/table.tsx +0 -72
- package/src/v2/shadcn/components/ui/tabs.stories.tsx +0 -85
- package/src/v2/shadcn/components/ui/tabs.tsx +0 -53
- package/src/v2/shadcn/components/ui/textarea.stories.tsx +0 -15
- package/src/v2/shadcn/components/ui/textarea.tsx +0 -21
- package/src/v2/shadcn/components/ui/toast.stories.tsx +0 -77
- package/src/v2/shadcn/components/ui/toast.tsx +0 -111
- package/src/v2/shadcn/components/ui/toaster.stories.tsx +0 -46
- package/src/v2/shadcn/components/ui/toaster.tsx +0 -24
- package/src/v2/shadcn/components/ui/toggle-group.stories.tsx +0 -95
- package/src/v2/shadcn/components/ui/toggle-group.tsx +0 -49
- package/src/v2/shadcn/components/ui/toggle.stories.tsx +0 -18
- package/src/v2/shadcn/components/ui/toggle.tsx +0 -37
- package/src/v2/shadcn/components/ui/tooltip.stories.tsx +0 -57
- package/src/v2/shadcn/components/ui/tooltip.tsx +0 -28
- package/src/v2/shadcn/components/ui/use-toast.ts +0 -3
- package/src/v2/shadcn/hooks/use-mobile.tsx +0 -19
- package/src/v2/shadcn/hooks/use-toast.ts +0 -184
- package/src/v2/shadcn/index.ts +0 -76
- package/src/v2/shadcn/lib/utils.ts +0 -6
- package/src/v2/shadcn/styles/globals.css +0 -112
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
-
import { IconChevronRight, IconTick, IconRing } from "../../../icons";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
12
|
-
|
|
13
|
-
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
14
|
-
|
|
15
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
16
|
-
|
|
17
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
18
|
-
|
|
19
|
-
const DropdownMenuSubTrigger = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
-
inset?: boolean;
|
|
23
|
-
}
|
|
24
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
25
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-surface-primary-hover focus:bg-surface-primary-hover",
|
|
29
|
-
inset && "pl-8",
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
<IconChevronRight className="ml-auto h-4 w-4 fill-fill-primary" />
|
|
36
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
37
|
-
));
|
|
38
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
39
|
-
|
|
40
|
-
const DropdownMenuSubContent = React.forwardRef<
|
|
41
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
42
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
43
|
-
>(({ className, ...props }, ref) => (
|
|
44
|
-
<DropdownMenuPrimitive.SubContent
|
|
45
|
-
ref={ref}
|
|
46
|
-
className={cn(
|
|
47
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-primary bg-surface-primary p-1 text-label-primary shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
48
|
-
className,
|
|
49
|
-
)}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
));
|
|
53
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
54
|
-
|
|
55
|
-
const DropdownMenuContent = React.forwardRef<
|
|
56
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
57
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
58
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
59
|
-
<DropdownMenuPrimitive.Portal>
|
|
60
|
-
<DropdownMenuPrimitive.Content
|
|
61
|
-
ref={ref}
|
|
62
|
-
sideOffset={sideOffset}
|
|
63
|
-
className={cn(
|
|
64
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-primary bg-surface-primary p-1 text-label-primary shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
{...props}
|
|
68
|
-
/>
|
|
69
|
-
</DropdownMenuPrimitive.Portal>
|
|
70
|
-
));
|
|
71
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
72
|
-
|
|
73
|
-
const DropdownMenuItem = React.forwardRef<
|
|
74
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
75
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
76
|
-
inset?: boolean;
|
|
77
|
-
}
|
|
78
|
-
>(({ className, inset, ...props }, ref) => (
|
|
79
|
-
<DropdownMenuPrimitive.Item
|
|
80
|
-
ref={ref}
|
|
81
|
-
className={cn(
|
|
82
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-surface-primary-hover focus:text-label-primary",
|
|
83
|
-
inset && "pl-8",
|
|
84
|
-
className,
|
|
85
|
-
)}
|
|
86
|
-
{...props}
|
|
87
|
-
/>
|
|
88
|
-
));
|
|
89
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
90
|
-
|
|
91
|
-
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
92
|
-
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
93
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
94
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
95
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
96
|
-
ref={ref}
|
|
97
|
-
className={cn(
|
|
98
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-surface-primary-hover focus:text-label-primary",
|
|
99
|
-
className,
|
|
100
|
-
)}
|
|
101
|
-
checked={checked}
|
|
102
|
-
{...props}
|
|
103
|
-
>
|
|
104
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
105
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
106
|
-
<IconTick className="h-4 w-4 fill-fill-primary" />
|
|
107
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
108
|
-
</span>
|
|
109
|
-
{children}
|
|
110
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
111
|
-
));
|
|
112
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
113
|
-
|
|
114
|
-
const DropdownMenuRadioItem = React.forwardRef<
|
|
115
|
-
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
116
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
117
|
-
>(({ className, children, ...props }, ref) => (
|
|
118
|
-
<DropdownMenuPrimitive.RadioItem
|
|
119
|
-
ref={ref}
|
|
120
|
-
className={cn(
|
|
121
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-surface-primary-hover focus:text-label-primary",
|
|
122
|
-
className,
|
|
123
|
-
)}
|
|
124
|
-
{...props}
|
|
125
|
-
>
|
|
126
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
127
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
128
|
-
<IconRing className="h-2 w-2 fill-current" />
|
|
129
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
130
|
-
</span>
|
|
131
|
-
{children}
|
|
132
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
133
|
-
));
|
|
134
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
135
|
-
|
|
136
|
-
const DropdownMenuLabel = React.forwardRef<
|
|
137
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
138
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
139
|
-
inset?: boolean;
|
|
140
|
-
}
|
|
141
|
-
>(({ className, inset, ...props }, ref) => (
|
|
142
|
-
<DropdownMenuPrimitive.Label
|
|
143
|
-
ref={ref}
|
|
144
|
-
className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
|
|
145
|
-
{...props}
|
|
146
|
-
/>
|
|
147
|
-
));
|
|
148
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
149
|
-
|
|
150
|
-
const DropdownMenuSeparator = React.forwardRef<
|
|
151
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
152
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
153
|
-
>(({ className, ...props }, ref) => (
|
|
154
|
-
<DropdownMenuPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-border-primary", className)} {...props} />
|
|
155
|
-
));
|
|
156
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
157
|
-
|
|
158
|
-
const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
159
|
-
return <span className={cn("ml-auto text-xs tracking-widest opacity-60", className)} {...props} />;
|
|
160
|
-
};
|
|
161
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
162
|
-
|
|
163
|
-
export {
|
|
164
|
-
DropdownMenu,
|
|
165
|
-
DropdownMenuTrigger,
|
|
166
|
-
DropdownMenuContent,
|
|
167
|
-
DropdownMenuItem,
|
|
168
|
-
DropdownMenuCheckboxItem,
|
|
169
|
-
DropdownMenuRadioItem,
|
|
170
|
-
DropdownMenuLabel,
|
|
171
|
-
DropdownMenuSeparator,
|
|
172
|
-
DropdownMenuShortcut,
|
|
173
|
-
DropdownMenuGroup,
|
|
174
|
-
DropdownMenuPortal,
|
|
175
|
-
DropdownMenuSub,
|
|
176
|
-
DropdownMenuSubContent,
|
|
177
|
-
DropdownMenuSubTrigger,
|
|
178
|
-
DropdownMenuRadioGroup,
|
|
179
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { useForm } from 'react-hook-form'
|
|
4
|
-
import { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage } from './form'
|
|
5
|
-
import { Input } from './input'
|
|
6
|
-
import { Button } from './button'
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'v2/Shadcn/Form',
|
|
10
|
-
component: Form,
|
|
11
|
-
parameters: { layout: 'padded' },
|
|
12
|
-
} as Meta<typeof Form>
|
|
13
|
-
|
|
14
|
-
type Story = StoryObj<typeof Form>
|
|
15
|
-
|
|
16
|
-
function BasicFormExample() {
|
|
17
|
-
const form = useForm({
|
|
18
|
-
defaultValues: {
|
|
19
|
-
username: '',
|
|
20
|
-
email: '',
|
|
21
|
-
},
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const onSubmit = (data: any) => {
|
|
25
|
-
alert(JSON.stringify(data, null, 2))
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Form {...form}>
|
|
30
|
-
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6 max-w-sm">
|
|
31
|
-
<FormField
|
|
32
|
-
control={form.control}
|
|
33
|
-
name="username"
|
|
34
|
-
rules={{ required: 'Username is required' }}
|
|
35
|
-
render={({ field }) => (
|
|
36
|
-
<FormItem>
|
|
37
|
-
<FormLabel>Username</FormLabel>
|
|
38
|
-
<FormControl>
|
|
39
|
-
<Input placeholder="Enter username" {...field} />
|
|
40
|
-
</FormControl>
|
|
41
|
-
<FormDescription>This is your public display name.</FormDescription>
|
|
42
|
-
<FormMessage />
|
|
43
|
-
</FormItem>
|
|
44
|
-
)}
|
|
45
|
-
/>
|
|
46
|
-
<FormField
|
|
47
|
-
control={form.control}
|
|
48
|
-
name="email"
|
|
49
|
-
rules={{ required: 'Email is required' }}
|
|
50
|
-
render={({ field }) => (
|
|
51
|
-
<FormItem>
|
|
52
|
-
<FormLabel>Email</FormLabel>
|
|
53
|
-
<FormControl>
|
|
54
|
-
<Input type="email" placeholder="Enter email" {...field} />
|
|
55
|
-
</FormControl>
|
|
56
|
-
<FormDescription>We will never share your email.</FormDescription>
|
|
57
|
-
<FormMessage />
|
|
58
|
-
</FormItem>
|
|
59
|
-
)}
|
|
60
|
-
/>
|
|
61
|
-
<Button type="submit">Submit</Button>
|
|
62
|
-
</form>
|
|
63
|
-
</Form>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export const Default: Story = {
|
|
68
|
-
render: () => <BasicFormExample />,
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function FormWithErrorsExample() {
|
|
72
|
-
const form = useForm({
|
|
73
|
-
defaultValues: {
|
|
74
|
-
name: '',
|
|
75
|
-
},
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
React.useEffect(() => {
|
|
79
|
-
form.setError('name', { type: 'manual', message: 'This field has an error' })
|
|
80
|
-
}, [form])
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<Form {...form}>
|
|
84
|
-
<form className="space-y-6 max-w-sm">
|
|
85
|
-
<FormField
|
|
86
|
-
control={form.control}
|
|
87
|
-
name="name"
|
|
88
|
-
render={({ field }) => (
|
|
89
|
-
<FormItem>
|
|
90
|
-
<FormLabel>Name</FormLabel>
|
|
91
|
-
<FormControl>
|
|
92
|
-
<Input placeholder="Enter name" {...field} />
|
|
93
|
-
</FormControl>
|
|
94
|
-
<FormMessage />
|
|
95
|
-
</FormItem>
|
|
96
|
-
)}
|
|
97
|
-
/>
|
|
98
|
-
</form>
|
|
99
|
-
</Form>
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export const WithErrors: Story = {
|
|
104
|
-
render: () => <FormWithErrorsExample />,
|
|
105
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
-
import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from "react-hook-form";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils";
|
|
7
|
-
import { Label } from "./label";
|
|
8
|
-
|
|
9
|
-
const Form = FormProvider;
|
|
10
|
-
|
|
11
|
-
type FormFieldContextValue<
|
|
12
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
13
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
14
|
-
> = {
|
|
15
|
-
name: TName;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);
|
|
19
|
-
|
|
20
|
-
const FormField = <
|
|
21
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
22
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
23
|
-
>({
|
|
24
|
-
...props
|
|
25
|
-
}: ControllerProps<TFieldValues, TName>) => {
|
|
26
|
-
return (
|
|
27
|
-
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
28
|
-
<Controller {...props} />
|
|
29
|
-
</FormFieldContext.Provider>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const useFormField = () => {
|
|
34
|
-
const fieldContext = React.useContext(FormFieldContext);
|
|
35
|
-
const itemContext = React.useContext(FormItemContext);
|
|
36
|
-
const { getFieldState, formState } = useFormContext();
|
|
37
|
-
|
|
38
|
-
const fieldState = getFieldState(fieldContext.name, formState);
|
|
39
|
-
|
|
40
|
-
if (!fieldContext) {
|
|
41
|
-
throw new Error("useFormField should be used within <FormField>");
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const { id } = itemContext;
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
id,
|
|
48
|
-
name: fieldContext.name,
|
|
49
|
-
formItemId: `${id}-form-item`,
|
|
50
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
51
|
-
formMessageId: `${id}-form-item-message`,
|
|
52
|
-
...fieldState,
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
type FormItemContextValue = {
|
|
57
|
-
id: string;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);
|
|
61
|
-
|
|
62
|
-
const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
63
|
-
({ className, ...props }, ref) => {
|
|
64
|
-
const id = React.useId();
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<FormItemContext.Provider value={{ id }}>
|
|
68
|
-
<div ref={ref} className={cn("space-y-2", className)} {...props} />
|
|
69
|
-
</FormItemContext.Provider>
|
|
70
|
-
);
|
|
71
|
-
},
|
|
72
|
-
);
|
|
73
|
-
FormItem.displayName = "FormItem";
|
|
74
|
-
|
|
75
|
-
const FormLabel = React.forwardRef<
|
|
76
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
77
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
78
|
-
>(({ className, ...props }, ref) => {
|
|
79
|
-
const { error, formItemId } = useFormField();
|
|
80
|
-
|
|
81
|
-
return <Label ref={ref} className={cn(error && "text-danger-dark", className)} htmlFor={formItemId} {...props} />;
|
|
82
|
-
});
|
|
83
|
-
FormLabel.displayName = "FormLabel";
|
|
84
|
-
|
|
85
|
-
const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(
|
|
86
|
-
({ ...props }, ref) => {
|
|
87
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<Slot
|
|
91
|
-
ref={ref}
|
|
92
|
-
id={formItemId}
|
|
93
|
-
aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
|
|
94
|
-
aria-invalid={!!error}
|
|
95
|
-
{...props}
|
|
96
|
-
/>
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
);
|
|
100
|
-
FormControl.displayName = "FormControl";
|
|
101
|
-
|
|
102
|
-
const FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
103
|
-
({ className, ...props }, ref) => {
|
|
104
|
-
const { formDescriptionId } = useFormField();
|
|
105
|
-
|
|
106
|
-
return <p ref={ref} id={formDescriptionId} className={cn("text-sm text-label-secondary", className)} {...props} />;
|
|
107
|
-
},
|
|
108
|
-
);
|
|
109
|
-
FormDescription.displayName = "FormDescription";
|
|
110
|
-
|
|
111
|
-
const FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
112
|
-
({ className, children, ...props }, ref) => {
|
|
113
|
-
const { error, formMessageId } = useFormField();
|
|
114
|
-
const body = error ? String(error?.message) : children;
|
|
115
|
-
|
|
116
|
-
if (!body) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<p ref={ref} id={formMessageId} className={cn("text-sm font-medium text-danger-dark", className)} {...props}>
|
|
122
|
-
{body}
|
|
123
|
-
</p>
|
|
124
|
-
);
|
|
125
|
-
},
|
|
126
|
-
);
|
|
127
|
-
FormMessage.displayName = "FormMessage";
|
|
128
|
-
|
|
129
|
-
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { HoverCard, HoverCardTrigger, HoverCardContent } from './hover-card'
|
|
4
|
-
import { Button } from './button'
|
|
5
|
-
|
|
6
|
-
function HoverCardDefault() {
|
|
7
|
-
return (
|
|
8
|
-
<HoverCard>
|
|
9
|
-
<HoverCardTrigger asChild>
|
|
10
|
-
<Button variant="link">@nextjs</Button>
|
|
11
|
-
</HoverCardTrigger>
|
|
12
|
-
<HoverCardContent className="w-80">
|
|
13
|
-
<div className="space-y-1">
|
|
14
|
-
<h4 className="text-sm font-semibold">@nextjs</h4>
|
|
15
|
-
<p className="text-sm text-label-secondary">The React Framework — created and maintained by @vercel.</p>
|
|
16
|
-
<div className="flex items-center pt-2">
|
|
17
|
-
<span className="text-xs text-label-secondary">Joined December 2021</span>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</HoverCardContent>
|
|
21
|
-
</HoverCard>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
title: 'v2/Shadcn/HoverCard',
|
|
27
|
-
component: HoverCard,
|
|
28
|
-
parameters: { layout: 'centered' },
|
|
29
|
-
} as Meta<typeof HoverCard>
|
|
30
|
-
|
|
31
|
-
type Story = StoryObj<typeof HoverCard>
|
|
32
|
-
|
|
33
|
-
export const Default: Story = {
|
|
34
|
-
render: () => React.createElement(HoverCardDefault),
|
|
35
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const HoverCard = HoverCardPrimitive.Root;
|
|
7
|
-
|
|
8
|
-
const HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
9
|
-
|
|
10
|
-
const HoverCardContent = React.forwardRef<
|
|
11
|
-
React.ElementRef<typeof HoverCardPrimitive.Content>,
|
|
12
|
-
React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
|
|
13
|
-
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
14
|
-
<HoverCardPrimitive.Content
|
|
15
|
-
ref={ref}
|
|
16
|
-
align={align}
|
|
17
|
-
sideOffset={sideOffset}
|
|
18
|
-
className={cn(
|
|
19
|
-
"z-50 w-64 rounded-md border border-border-primary bg-surface-primary p-4 text-label-primary shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
20
|
-
className,
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
));
|
|
25
|
-
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
26
|
-
|
|
27
|
-
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from './input-otp'
|
|
4
|
-
|
|
5
|
-
function InputOTPDefault() {
|
|
6
|
-
return (
|
|
7
|
-
<InputOTP maxLength={6}>
|
|
8
|
-
<InputOTPGroup>
|
|
9
|
-
<InputOTPSlot index={0} />
|
|
10
|
-
<InputOTPSlot index={1} />
|
|
11
|
-
<InputOTPSlot index={2} />
|
|
12
|
-
</InputOTPGroup>
|
|
13
|
-
<InputOTPSeparator />
|
|
14
|
-
<InputOTPGroup>
|
|
15
|
-
<InputOTPSlot index={3} />
|
|
16
|
-
<InputOTPSlot index={4} />
|
|
17
|
-
<InputOTPSlot index={5} />
|
|
18
|
-
</InputOTPGroup>
|
|
19
|
-
</InputOTP>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function InputOTPFourDigits() {
|
|
24
|
-
return (
|
|
25
|
-
<InputOTP maxLength={4}>
|
|
26
|
-
<InputOTPGroup>
|
|
27
|
-
<InputOTPSlot index={0} />
|
|
28
|
-
<InputOTPSlot index={1} />
|
|
29
|
-
<InputOTPSlot index={2} />
|
|
30
|
-
<InputOTPSlot index={3} />
|
|
31
|
-
</InputOTPGroup>
|
|
32
|
-
</InputOTP>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function InputOTPDisabled() {
|
|
37
|
-
return (
|
|
38
|
-
<InputOTP maxLength={6} disabled>
|
|
39
|
-
<InputOTPGroup>
|
|
40
|
-
<InputOTPSlot index={0} />
|
|
41
|
-
<InputOTPSlot index={1} />
|
|
42
|
-
<InputOTPSlot index={2} />
|
|
43
|
-
</InputOTPGroup>
|
|
44
|
-
<InputOTPSeparator />
|
|
45
|
-
<InputOTPGroup>
|
|
46
|
-
<InputOTPSlot index={3} />
|
|
47
|
-
<InputOTPSlot index={4} />
|
|
48
|
-
<InputOTPSlot index={5} />
|
|
49
|
-
</InputOTPGroup>
|
|
50
|
-
</InputOTP>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default {
|
|
55
|
-
title: 'v2/Shadcn/InputOTP',
|
|
56
|
-
component: InputOTP,
|
|
57
|
-
parameters: { layout: 'centered' },
|
|
58
|
-
} as Meta<typeof InputOTP>
|
|
59
|
-
|
|
60
|
-
type Story = StoryObj<typeof InputOTP>
|
|
61
|
-
|
|
62
|
-
export const Default: Story = {
|
|
63
|
-
render: () => React.createElement(InputOTPDefault),
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const FourDigits: Story = {
|
|
67
|
-
render: () => React.createElement(InputOTPFourDigits),
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const Disabled: Story = {
|
|
71
|
-
render: () => React.createElement(InputOTPDisabled),
|
|
72
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { OTPInput, OTPInputContext } from "input-otp";
|
|
3
|
-
import { IconDot } from "../../../icons";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const InputOTP = React.forwardRef<React.ElementRef<typeof OTPInput>, React.ComponentPropsWithoutRef<typeof OTPInput>>(
|
|
8
|
-
({ className, containerClassName, ...props }, ref) => (
|
|
9
|
-
<OTPInput
|
|
10
|
-
ref={ref}
|
|
11
|
-
containerClassName={cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName)}
|
|
12
|
-
className={cn("disabled:cursor-not-allowed", className)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
),
|
|
16
|
-
);
|
|
17
|
-
InputOTP.displayName = "InputOTP";
|
|
18
|
-
|
|
19
|
-
const InputOTPGroup = React.forwardRef<React.ElementRef<"div">, React.ComponentPropsWithoutRef<"div">>(
|
|
20
|
-
({ className, ...props }, ref) => <div ref={ref} className={cn("flex items-center", className)} {...props} />,
|
|
21
|
-
);
|
|
22
|
-
InputOTPGroup.displayName = "InputOTPGroup";
|
|
23
|
-
|
|
24
|
-
const InputOTPSlot = React.forwardRef<
|
|
25
|
-
React.ElementRef<"div">,
|
|
26
|
-
React.ComponentPropsWithoutRef<"div"> & { index: number }
|
|
27
|
-
>(({ index, className, ...props }, ref) => {
|
|
28
|
-
const inputOTPContext = React.useContext(OTPInputContext);
|
|
29
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div
|
|
33
|
-
ref={ref}
|
|
34
|
-
className={cn(
|
|
35
|
-
"relative flex h-10 w-10 items-center justify-center border-y border-r border-border-primary text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
|
|
36
|
-
isActive && "z-10 ring-2 ring-actions-regular ring-offset-surface-primary",
|
|
37
|
-
className,
|
|
38
|
-
)}
|
|
39
|
-
{...props}
|
|
40
|
-
>
|
|
41
|
-
{char}
|
|
42
|
-
{hasFakeCaret && (
|
|
43
|
-
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
44
|
-
<div className="animate-caret-blink h-4 w-px bg-label-primary duration-1000" />
|
|
45
|
-
</div>
|
|
46
|
-
)}
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
InputOTPSlot.displayName = "InputOTPSlot";
|
|
51
|
-
|
|
52
|
-
const InputOTPSeparator = React.forwardRef<React.ElementRef<"div">, React.ComponentPropsWithoutRef<"div">>(
|
|
53
|
-
({ ...props }, ref) => (
|
|
54
|
-
<div ref={ref} role="separator" {...props}>
|
|
55
|
-
<IconDot className="w-4 h-4 fill-fill-primary" />
|
|
56
|
-
</div>
|
|
57
|
-
),
|
|
58
|
-
);
|
|
59
|
-
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
60
|
-
|
|
61
|
-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import { Input } from './input'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'v2/Shadcn/Input',
|
|
6
|
-
component: Input,
|
|
7
|
-
parameters: { layout: 'padded' },
|
|
8
|
-
} as Meta<typeof Input>
|
|
9
|
-
|
|
10
|
-
type Story = StoryObj<typeof Input>
|
|
11
|
-
|
|
12
|
-
export const Default: Story = { args: { placeholder: 'Enter text...' } }
|
|
13
|
-
export const Email: Story = { args: { type: 'email', placeholder: 'you@example.com' } }
|
|
14
|
-
export const Password: Story = { args: { type: 'password', placeholder: 'Password' } }
|
|
15
|
-
export const Disabled: Story = { args: { placeholder: 'Disabled', disabled: true } }
|
|
16
|
-
export const WithValue: Story = { args: { defaultValue: 'Hello world', readOnly: true } }
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
6
|
-
({ className, type, ...props }, ref) => {
|
|
7
|
-
return (
|
|
8
|
-
<input
|
|
9
|
-
type={type}
|
|
10
|
-
className={cn(
|
|
11
|
-
"flex h-10 w-full rounded-md border border-border-primary bg-surface-primary px-3 py-2 text-base text-label-primary placeholder:text-label-secondary focus-visible:outline-none focus-visible:border-border-selected disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
-
className,
|
|
13
|
-
)}
|
|
14
|
-
ref={ref}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
},
|
|
19
|
-
);
|
|
20
|
-
Input.displayName = "Input";
|
|
21
|
-
|
|
22
|
-
type InputProps = React.ComponentProps<"input">;
|
|
23
|
-
|
|
24
|
-
export { Input };
|
|
25
|
-
export type { InputProps };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import { Label } from './label'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'v2/Shadcn/Label',
|
|
6
|
-
component: Label,
|
|
7
|
-
parameters: { layout: 'padded' },
|
|
8
|
-
} as Meta<typeof Label>
|
|
9
|
-
|
|
10
|
-
type Story = StoryObj<typeof Label>
|
|
11
|
-
|
|
12
|
-
export const Default: Story = { args: { children: 'Email address' } }
|
|
13
|
-
export const Disabled: Story = { args: { children: 'Disabled field', className: 'opacity-50 cursor-not-allowed' } }
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const labelVariants = cva("text-sm font-medium leading-none text-label-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
8
|
-
|
|
9
|
-
const Label = React.forwardRef<
|
|
10
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
11
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
|
|
12
|
-
>(({ className, ...props }, ref) => (
|
|
13
|
-
<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
|
|
14
|
-
));
|
|
15
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
16
|
-
|
|
17
|
-
export { Label };
|