@lessly/ui 0.25.0 → 0.26.1
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/index.d.ts +35 -1
- package/dist/index.js +130 -48
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1650,6 +1650,40 @@ interface OrganizationCreateScreenProps extends Omit<React$1.HTMLAttributes<HTML
|
|
|
1650
1650
|
*/
|
|
1651
1651
|
declare function OrganizationCreateScreen({ requireSanctionsFields, onSubmit, defaultValues, submitting, serverError, violations, countries, submitLabel, onCancel, logo, themeToggle, title, description, footer, ...props }: OrganizationCreateScreenProps): React$1.JSX.Element;
|
|
1652
1652
|
|
|
1653
|
+
interface OrganizationUnderReviewScreenProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1654
|
+
/** The only always-present action: the user cannot go anywhere else from this screen. */
|
|
1655
|
+
onLogout: () => void;
|
|
1656
|
+
/** Renders the secondary "Send feedback" button when provided. */
|
|
1657
|
+
onFeedback?: () => void;
|
|
1658
|
+
logoutLabel?: string;
|
|
1659
|
+
feedbackLabel?: string;
|
|
1660
|
+
/** Brand mark above the headline. */
|
|
1661
|
+
logo?: React$1.ReactNode;
|
|
1662
|
+
/** Rendered top-right. Defaults to the kit's own `ThemeToggle`; pass your own node to
|
|
1663
|
+
* replace it, or `null` to drop it. */
|
|
1664
|
+
themeToggle?: React$1.ReactNode;
|
|
1665
|
+
title?: React$1.ReactNode;
|
|
1666
|
+
description?: React$1.ReactNode;
|
|
1667
|
+
/** Muted footer signature. Absent by default; pass a node to render one. */
|
|
1668
|
+
footer?: React$1.ReactNode;
|
|
1669
|
+
/** Extra content between the header copy and the actions — a support link, a reference
|
|
1670
|
+
* number, whatever the product needs to add. */
|
|
1671
|
+
children?: React$1.ReactNode;
|
|
1672
|
+
}
|
|
1673
|
+
/**
|
|
1674
|
+
* The waiting room of the org-first onboarding flow: the screen a user lands on once their
|
|
1675
|
+
* organization has been submitted and is not usable yet. Same login-card format as
|
|
1676
|
+
* `OrganizationCreateScreen`.
|
|
1677
|
+
*
|
|
1678
|
+
* The copy is deliberately neutral — it states that a review is in progress and how long it
|
|
1679
|
+
* usually takes, and nothing about why or against what. Keep it that way; the reason for the
|
|
1680
|
+
* wait is never the user-facing story here.
|
|
1681
|
+
*
|
|
1682
|
+
* Presentational and self-contained: it never calls an API and never navigates; the caller
|
|
1683
|
+
* handles `onLogout` and `onFeedback`.
|
|
1684
|
+
*/
|
|
1685
|
+
declare function OrganizationUnderReviewScreen({ onLogout, onFeedback, logoutLabel, feedbackLabel, logo, themeToggle, title, description, footer, children, ...props }: OrganizationUnderReviewScreenProps): React$1.JSX.Element;
|
|
1686
|
+
|
|
1653
1687
|
/** One organization the user can create the product in. */
|
|
1654
1688
|
interface ProductCreateScreenOrganization {
|
|
1655
1689
|
id: string;
|
|
@@ -1715,4 +1749,4 @@ interface ProductCreateScreenProps extends Omit<React$1.HTMLAttributes<HTMLDivEl
|
|
|
1715
1749
|
*/
|
|
1716
1750
|
declare function ProductCreateScreen({ organizationName: _organizationName, organizations, selectedOrganizationId, onOrganizationChange, productsLoading, onSubmit, defaultName, submitting, serverError, existingProducts, onOpenProduct, existingProductsLabel, submitLabel, onCancel, logo, themeToggle, title, description, footer, ...props }: ProductCreateScreenProps): React$1.JSX.Element;
|
|
1717
1751
|
|
|
1718
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, type AppShellProps, AppSidebar, type AppSidebarProps, AspectRatio, AuthenticatedLayout, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, type BeneficialOwnerPayload, BetaGateScreen, type BetaGateScreenProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, COUNTRY_OPTIONS, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, Checkbox, Code, CodeBlock, type CodeBlockProps, type CodeLang, type CodeProps, Col, type ColProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, type ConfirmDialogProps, type ConnectionAuth, ConnectionCard, type ConnectionCardProps, type ConnectionScope, type ConnectionStatus, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, type CreateProductSubmit, CreateProductWindow, type CreateProductWindowOrganization, type CreateProductWindowProduct, type CreateProductWindowProps, DatePicker, type DatePickerProps, type DeltaDirection, type DeltaTone, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocsLink, type DocsLinkProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ExtensionIcon, type ExtensionIconProps, ExtensionLink, type ExtensionLinkProps, type ExtensionLinkUiMode, FeedbackButton, type FeedbackButtonLabels, type FeedbackButtonProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Grid, GridOverlay, type GridOverlayProps, type GridProps, HoverCard, HoverCardContent, HoverCardTrigger, InlineError, type InlineErrorProps, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, MenuDivider, MenuPopup, type MenuPopupProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, type NavItem, type NavLinkComponent, NavRow, type NavRowProps, type NavRowVariant, NavSectionLabel, type NavSectionLabelProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, type NotifClass, type NotificationAction, NotificationBell, type NotificationBellProps, NotificationCenter, type NotificationCenterProps, type NotificationClass, type NotificationDeepLink, type NotificationItem, type NotificationMute, type NotificationPreferences, type NotificationProduct, NotificationSettings, type NotificationSettingsProps, type NotificationSeverity, type NotificationSubscription, type NotificationThreshold, NotificationToast, type NotificationToastDwell, type NotificationToastProps, NotificationToaster, type NotificationToasterPosition, type NotificationToasterProps, OrgProductSwitcher, type OrgProductSwitcherAction, type OrgProductSwitcherItem, type OrgProductSwitcherProps, OrganizationCreateScreen, type OrganizationCreateScreenProps, type OrganizationOnboardingDefaults, OrganizationOnboardingForm, type OrganizationOnboardingFormProps, type OrganizationOnboardingPayload, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProductCreateScreen, type ProductCreateScreenOrganization, type ProductCreateScreenProduct, type ProductCreateScreenProps, type ProductCreateScreenSubmit, Progress, RadioGroup, RadioGroupItem, RequestRow, type RequestRowProps, type RequestState, type RequestSurface, type ResolvedTheme, type Responsive, ScrollArea, ScrollBar, SectionIntro, type SectionIntroProps, SegmentChip, type SegmentChipProps, Select, type SelectOption, type SelectProps, Separator, type Severity, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarBackHeader, type SidebarBackHeaderProps, SidebarNav, SidebarNavLink, type SidebarNavLinkProps, type SidebarNavProps, SidebarProductHeader, type SidebarProductHeaderProps, SignupScreen, type SignupScreenProps, type SignupScreenSubmit, Skeleton, Slider, StatCard, type StatCardProps, StatusDot, type StatusDotProps, Switch, type SwitchProps, TOAST_DWELL, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type Theme, ThemeToggle, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSidebarOptions, type UseSidebarResult, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, alertVariants, badgeVariants, buttonVariants, cn, formatRelativeAge, isKnownExtensionIcon, isNotificationSettled, navigationMenuTriggerStyle, segmentChipVariants, severityBadgeVariant, severityLabels, statusDotVariants, toggleVariants, useCarousel, useFormField, useIsMobile, useSidebar, useTheme };
|
|
1752
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, type AppShellProps, AppSidebar, type AppSidebarProps, AspectRatio, AuthenticatedLayout, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, type BeneficialOwnerPayload, BetaGateScreen, type BetaGateScreenProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, COUNTRY_OPTIONS, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, Checkbox, Code, CodeBlock, type CodeBlockProps, type CodeLang, type CodeProps, Col, type ColProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, type ConfirmDialogProps, type ConnectionAuth, ConnectionCard, type ConnectionCardProps, type ConnectionScope, type ConnectionStatus, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, type CreateProductSubmit, CreateProductWindow, type CreateProductWindowOrganization, type CreateProductWindowProduct, type CreateProductWindowProps, DatePicker, type DatePickerProps, type DeltaDirection, type DeltaTone, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocsLink, type DocsLinkProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ExtensionIcon, type ExtensionIconProps, ExtensionLink, type ExtensionLinkProps, type ExtensionLinkUiMode, FeedbackButton, type FeedbackButtonLabels, type FeedbackButtonProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Grid, GridOverlay, type GridOverlayProps, type GridProps, HoverCard, HoverCardContent, HoverCardTrigger, InlineError, type InlineErrorProps, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, MenuDivider, MenuPopup, type MenuPopupProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, type NavItem, type NavLinkComponent, NavRow, type NavRowProps, type NavRowVariant, NavSectionLabel, type NavSectionLabelProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, type NotifClass, type NotificationAction, NotificationBell, type NotificationBellProps, NotificationCenter, type NotificationCenterProps, type NotificationClass, type NotificationDeepLink, type NotificationItem, type NotificationMute, type NotificationPreferences, type NotificationProduct, NotificationSettings, type NotificationSettingsProps, type NotificationSeverity, type NotificationSubscription, type NotificationThreshold, NotificationToast, type NotificationToastDwell, type NotificationToastProps, NotificationToaster, type NotificationToasterPosition, type NotificationToasterProps, OrgProductSwitcher, type OrgProductSwitcherAction, type OrgProductSwitcherItem, type OrgProductSwitcherProps, OrganizationCreateScreen, type OrganizationCreateScreenProps, type OrganizationOnboardingDefaults, OrganizationOnboardingForm, type OrganizationOnboardingFormProps, type OrganizationOnboardingPayload, OrganizationUnderReviewScreen, type OrganizationUnderReviewScreenProps, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProductCreateScreen, type ProductCreateScreenOrganization, type ProductCreateScreenProduct, type ProductCreateScreenProps, type ProductCreateScreenSubmit, Progress, RadioGroup, RadioGroupItem, RequestRow, type RequestRowProps, type RequestState, type RequestSurface, type ResolvedTheme, type Responsive, ScrollArea, ScrollBar, SectionIntro, type SectionIntroProps, SegmentChip, type SegmentChipProps, Select, type SelectOption, type SelectProps, Separator, type Severity, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarBackHeader, type SidebarBackHeaderProps, SidebarNav, SidebarNavLink, type SidebarNavLinkProps, type SidebarNavProps, SidebarProductHeader, type SidebarProductHeaderProps, SignupScreen, type SignupScreenProps, type SignupScreenSubmit, Skeleton, Slider, StatCard, type StatCardProps, StatusDot, type StatusDotProps, Switch, type SwitchProps, TOAST_DWELL, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type Theme, ThemeToggle, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSidebarOptions, type UseSidebarResult, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, alertVariants, badgeVariants, buttonVariants, cn, formatRelativeAge, isKnownExtensionIcon, isNotificationSettled, navigationMenuTriggerStyle, segmentChipVariants, severityBadgeVariant, severityLabels, statusDotVariants, toggleVariants, useCarousel, useFormField, useIsMobile, useSidebar, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -2696,7 +2696,7 @@ function UserMenu({ user, items, collapsed = false, align = "start" }) {
|
|
|
2696
2696
|
{
|
|
2697
2697
|
align,
|
|
2698
2698
|
sideOffset: 6,
|
|
2699
|
-
className: "flex w-56 flex-col gap-px rounded-xl border-border-subtle bg-[var(--menu-bg)] p-1 shadow-(--menu-shadow)",
|
|
2699
|
+
className: "flex w-[var(--radix-dropdown-menu-trigger-width)] min-w-56 flex-col gap-px rounded-xl border-border-subtle bg-[var(--menu-bg)] p-1 shadow-(--menu-shadow)",
|
|
2700
2700
|
children: [
|
|
2701
2701
|
/* @__PURE__ */ jsxs26(DropdownMenuLabel, { className: "px-2 pt-1.5 pb-1 text-xs font-medium text-text-tertiary", children: [
|
|
2702
2702
|
/* @__PURE__ */ jsx53("span", { className: "block truncate text-sm font-medium text-text-primary", children: user.name }),
|
|
@@ -3191,7 +3191,7 @@ function OrgProductSwitcher({
|
|
|
3191
3191
|
{
|
|
3192
3192
|
align: "start",
|
|
3193
3193
|
sideOffset: 6,
|
|
3194
|
-
className: "flex w-
|
|
3194
|
+
className: "flex w-[var(--radix-dropdown-menu-trigger-width)] min-w-56 flex-col gap-px rounded-xl border-border-subtle bg-[var(--menu-bg)] p-1 shadow-(--menu-shadow)",
|
|
3195
3195
|
children: [
|
|
3196
3196
|
/* @__PURE__ */ jsx62(DropdownMenuLabel, { className: sectionLabel, children: "Organizations" }),
|
|
3197
3197
|
organizations.map((o) => /* @__PURE__ */ jsxs32(DropdownMenuItem, { className: menuItem, onSelect: () => onOrgSelect(o.id), children: [
|
|
@@ -5557,6 +5557,10 @@ import * as React67 from "react";
|
|
|
5557
5557
|
import { jsx as jsx83, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5558
5558
|
var CONTROLLER_SHARE_PCT = 50;
|
|
5559
5559
|
var MAX_BENEFICIAL_OWNERS = 50;
|
|
5560
|
+
var OWNERSHIP_CONFIRMATION_MESSAGE = "Please confirm the ownership details by ticking the box";
|
|
5561
|
+
function isOwnershipViolation(violation) {
|
|
5562
|
+
return /ownership[_\s-]?confirmed/i.test(violation);
|
|
5563
|
+
}
|
|
5560
5564
|
function parseShare(raw) {
|
|
5561
5565
|
if (!/^\d{1,3}$/.test(raw.trim())) return null;
|
|
5562
5566
|
const n = Number(raw);
|
|
@@ -5598,6 +5602,7 @@ function OrganizationOnboardingForm({
|
|
|
5598
5602
|
() => initialRows(defaultValues?.beneficial_owners)
|
|
5599
5603
|
);
|
|
5600
5604
|
const [ownershipConfirmed, setOwnershipConfirmed] = React67.useState(false);
|
|
5605
|
+
const [confirmationAttempted, setConfirmationAttempted] = React67.useState(false);
|
|
5601
5606
|
const nextKeyRef = React67.useRef(owners.length);
|
|
5602
5607
|
const submittingRef = React67.useRef(false);
|
|
5603
5608
|
const trimmed = name.trim();
|
|
@@ -5613,7 +5618,12 @@ function OrganizationOnboardingForm({
|
|
|
5613
5618
|
const needsOwnershipConfirmation = !hasController;
|
|
5614
5619
|
const missingCountry = requireSanctionsFields && countryOfIncorporation === "";
|
|
5615
5620
|
const missingConfirmation = needsOwnershipConfirmation && !ownershipConfirmed;
|
|
5616
|
-
const canSubmit = trimmed !== "" && ownersValid && !missingCountry && !
|
|
5621
|
+
const canSubmit = trimmed !== "" && ownersValid && !missingCountry && !submitting;
|
|
5622
|
+
const ownershipViolations = needsOwnershipConfirmation ? (violations ?? []).filter(isOwnershipViolation) : [];
|
|
5623
|
+
const otherViolations = (violations ?? []).filter(
|
|
5624
|
+
(violation) => !ownershipViolations.includes(violation)
|
|
5625
|
+
);
|
|
5626
|
+
const showConfirmationError = confirmationAttempted && missingConfirmation || needsOwnershipConfirmation && ownershipViolations.length > 0;
|
|
5617
5627
|
const addOwner = () => {
|
|
5618
5628
|
if (owners.length >= MAX_BENEFICIAL_OWNERS) return;
|
|
5619
5629
|
nextKeyRef.current += 1;
|
|
@@ -5627,6 +5637,10 @@ function OrganizationOnboardingForm({
|
|
|
5627
5637
|
const handleSubmit = (event) => {
|
|
5628
5638
|
event.preventDefault();
|
|
5629
5639
|
if (!canSubmit || submittingRef.current) return;
|
|
5640
|
+
if (missingConfirmation) {
|
|
5641
|
+
setConfirmationAttempted(true);
|
|
5642
|
+
return;
|
|
5643
|
+
}
|
|
5630
5644
|
submittingRef.current = true;
|
|
5631
5645
|
const beneficialOwners = filledOwners.map((row, i) => ({
|
|
5632
5646
|
name: row.name,
|
|
@@ -5814,31 +5828,43 @@ function OrganizationOnboardingForm({
|
|
|
5814
5828
|
"%, which is more than 100%."
|
|
5815
5829
|
] })
|
|
5816
5830
|
] }),
|
|
5817
|
-
needsOwnershipConfirmation && /* @__PURE__ */ jsxs49("div", { className: "
|
|
5818
|
-
/* @__PURE__ */
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5831
|
+
needsOwnershipConfirmation && /* @__PURE__ */ jsxs49("div", { className: "space-y-1", children: [
|
|
5832
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-start gap-2", children: [
|
|
5833
|
+
/* @__PURE__ */ jsx83(
|
|
5834
|
+
Checkbox,
|
|
5835
|
+
{
|
|
5836
|
+
id: "create-org-ownership-confirmed",
|
|
5837
|
+
"data-testid": "create-org-ownership-confirmed",
|
|
5838
|
+
checked: ownershipConfirmed,
|
|
5839
|
+
"aria-describedby": showConfirmationError ? "create-org-ownership-error" : void 0,
|
|
5840
|
+
onCheckedChange: (value) => setOwnershipConfirmed(value === true)
|
|
5841
|
+
}
|
|
5842
|
+
),
|
|
5843
|
+
/* @__PURE__ */ jsxs49(
|
|
5844
|
+
Label2,
|
|
5845
|
+
{
|
|
5846
|
+
htmlFor: "create-org-ownership-confirmed",
|
|
5847
|
+
className: "text-xs font-normal leading-snug",
|
|
5848
|
+
children: [
|
|
5849
|
+
"I confirm the ownership structure above is complete and correct",
|
|
5850
|
+
/* @__PURE__ */ jsx83("span", { className: "text-text-danger", children: " *" })
|
|
5851
|
+
]
|
|
5852
|
+
}
|
|
5853
|
+
)
|
|
5854
|
+
] }),
|
|
5855
|
+
showConfirmationError && /* @__PURE__ */ jsx83(
|
|
5856
|
+
"p",
|
|
5829
5857
|
{
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
/* @__PURE__ */ jsx83("span", { className: "text-text-danger", children: " *" })
|
|
5835
|
-
]
|
|
5858
|
+
id: "create-org-ownership-error",
|
|
5859
|
+
"data-testid": "create-org-ownership-error",
|
|
5860
|
+
className: "text-xs text-text-danger",
|
|
5861
|
+
children: OWNERSHIP_CONFIRMATION_MESSAGE
|
|
5836
5862
|
}
|
|
5837
5863
|
)
|
|
5838
5864
|
] }),
|
|
5839
|
-
(serverError ||
|
|
5865
|
+
(serverError || otherViolations.length > 0) && /* @__PURE__ */ jsxs49(InlineError, { children: [
|
|
5840
5866
|
serverError,
|
|
5841
|
-
|
|
5867
|
+
otherViolations.length > 0 && /* @__PURE__ */ jsx83("ul", { "data-testid": "create-org-violations", className: "mt-1 list-disc pl-4", children: otherViolations.map((violation) => /* @__PURE__ */ jsx83("li", { children: violation }, violation)) })
|
|
5842
5868
|
] }),
|
|
5843
5869
|
/* @__PURE__ */ jsxs49("div", { className: "space-y-2 pt-1", children: [
|
|
5844
5870
|
/* @__PURE__ */ jsx83(
|
|
@@ -5904,9 +5930,64 @@ function OrganizationCreateScreen({
|
|
|
5904
5930
|
);
|
|
5905
5931
|
}
|
|
5906
5932
|
|
|
5933
|
+
// src/components/organization-under-review-screen.tsx
|
|
5934
|
+
import { jsx as jsx85, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5935
|
+
function OrganizationUnderReviewScreen({
|
|
5936
|
+
onLogout,
|
|
5937
|
+
onFeedback,
|
|
5938
|
+
logoutLabel = "Log out",
|
|
5939
|
+
feedbackLabel = "Send feedback",
|
|
5940
|
+
logo,
|
|
5941
|
+
themeToggle,
|
|
5942
|
+
title = "Your organization is under review",
|
|
5943
|
+
description = "We are reviewing your registration details. This usually takes up to one business day. We will email you when it is done.",
|
|
5944
|
+
footer,
|
|
5945
|
+
children,
|
|
5946
|
+
...props
|
|
5947
|
+
}) {
|
|
5948
|
+
return /* @__PURE__ */ jsxs50(
|
|
5949
|
+
OnboardingScreenShell,
|
|
5950
|
+
{
|
|
5951
|
+
logo,
|
|
5952
|
+
themeToggle,
|
|
5953
|
+
title,
|
|
5954
|
+
description,
|
|
5955
|
+
footer,
|
|
5956
|
+
width: "md",
|
|
5957
|
+
...props,
|
|
5958
|
+
children: [
|
|
5959
|
+
children,
|
|
5960
|
+
/* @__PURE__ */ jsxs50("div", { className: "space-y-2 pt-1", children: [
|
|
5961
|
+
/* @__PURE__ */ jsx85(
|
|
5962
|
+
"button",
|
|
5963
|
+
{
|
|
5964
|
+
type: "button",
|
|
5965
|
+
"data-testid": "under-review-logout",
|
|
5966
|
+
onClick: onLogout,
|
|
5967
|
+
className: AUTH_FILLED_BUTTON,
|
|
5968
|
+
style: { boxShadow: AUTH_BUTTON_SHADOW },
|
|
5969
|
+
children: logoutLabel
|
|
5970
|
+
}
|
|
5971
|
+
),
|
|
5972
|
+
onFeedback && /* @__PURE__ */ jsx85(
|
|
5973
|
+
"button",
|
|
5974
|
+
{
|
|
5975
|
+
type: "button",
|
|
5976
|
+
"data-testid": "under-review-feedback",
|
|
5977
|
+
onClick: onFeedback,
|
|
5978
|
+
className: AUTH_QUIET_BUTTON,
|
|
5979
|
+
children: feedbackLabel
|
|
5980
|
+
}
|
|
5981
|
+
)
|
|
5982
|
+
] })
|
|
5983
|
+
]
|
|
5984
|
+
}
|
|
5985
|
+
);
|
|
5986
|
+
}
|
|
5987
|
+
|
|
5907
5988
|
// src/components/product-create-screen.tsx
|
|
5908
5989
|
import * as React68 from "react";
|
|
5909
|
-
import { jsx as
|
|
5990
|
+
import { jsx as jsx86, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5910
5991
|
var productRow = "flex w-full items-center justify-between rounded-md border border-border-default bg-bg-primary px-3 py-2 text-left text-sm text-text-primary";
|
|
5911
5992
|
function ProductCreateScreen({
|
|
5912
5993
|
// Destructured only to keep it out of `...props`, which is spread onto a <div>.
|
|
@@ -5948,7 +6029,7 @@ function ProductCreateScreen({
|
|
|
5948
6029
|
const products = existingProducts ?? [];
|
|
5949
6030
|
const orgs = organizations ?? [];
|
|
5950
6031
|
const pickerLayout = orgs.length > 0;
|
|
5951
|
-
const productList = /* @__PURE__ */
|
|
6032
|
+
const productList = /* @__PURE__ */ jsx86("ul", { className: "flex flex-col gap-1", children: products.map((product) => /* @__PURE__ */ jsx86("li", { children: onOpenProduct ? /* @__PURE__ */ jsxs51(
|
|
5952
6033
|
"button",
|
|
5953
6034
|
{
|
|
5954
6035
|
type: "button",
|
|
@@ -5959,15 +6040,15 @@ function ProductCreateScreen({
|
|
|
5959
6040
|
"hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus"
|
|
5960
6041
|
),
|
|
5961
6042
|
children: [
|
|
5962
|
-
/* @__PURE__ */
|
|
5963
|
-
product.slug && /* @__PURE__ */
|
|
6043
|
+
/* @__PURE__ */ jsx86("span", { className: "truncate", children: product.name }),
|
|
6044
|
+
product.slug && /* @__PURE__ */ jsx86("span", { className: "ml-2 truncate text-text-tertiary", children: product.slug })
|
|
5964
6045
|
]
|
|
5965
6046
|
}
|
|
5966
|
-
) : /* @__PURE__ */
|
|
5967
|
-
/* @__PURE__ */
|
|
5968
|
-
product.slug && /* @__PURE__ */
|
|
6047
|
+
) : /* @__PURE__ */ jsxs51("div", { className: productRow, children: [
|
|
6048
|
+
/* @__PURE__ */ jsx86("span", { className: "truncate", children: product.name }),
|
|
6049
|
+
product.slug && /* @__PURE__ */ jsx86("span", { className: "ml-2 truncate text-text-tertiary", children: product.slug })
|
|
5969
6050
|
] }) }, product.id)) });
|
|
5970
|
-
return /* @__PURE__ */
|
|
6051
|
+
return /* @__PURE__ */ jsxs51(
|
|
5971
6052
|
OnboardingScreenShell,
|
|
5972
6053
|
{
|
|
5973
6054
|
logo,
|
|
@@ -5977,10 +6058,10 @@ function ProductCreateScreen({
|
|
|
5977
6058
|
footer,
|
|
5978
6059
|
...props,
|
|
5979
6060
|
children: [
|
|
5980
|
-
pickerLayout && /* @__PURE__ */
|
|
5981
|
-
/* @__PURE__ */
|
|
5982
|
-
/* @__PURE__ */
|
|
5983
|
-
/* @__PURE__ */
|
|
6061
|
+
pickerLayout && /* @__PURE__ */ jsxs51("div", { className: "mb-4 space-y-4", children: [
|
|
6062
|
+
/* @__PURE__ */ jsxs51("div", { className: "space-y-1.5", children: [
|
|
6063
|
+
/* @__PURE__ */ jsx86(Label2, { htmlFor: "create-product-org-select", children: "Organization" }),
|
|
6064
|
+
/* @__PURE__ */ jsx86(
|
|
5984
6065
|
Select,
|
|
5985
6066
|
{
|
|
5986
6067
|
id: "create-product-org-select",
|
|
@@ -5994,15 +6075,15 @@ function ProductCreateScreen({
|
|
|
5994
6075
|
}
|
|
5995
6076
|
)
|
|
5996
6077
|
] }),
|
|
5997
|
-
/* @__PURE__ */
|
|
5998
|
-
/* @__PURE__ */
|
|
5999
|
-
productsLoading ? /* @__PURE__ */
|
|
6078
|
+
/* @__PURE__ */ jsxs51("div", { "data-testid": "existing-products", className: "space-y-1.5", children: [
|
|
6079
|
+
/* @__PURE__ */ jsx86(Label2, { children: existingProductsLabel }),
|
|
6080
|
+
productsLoading ? /* @__PURE__ */ jsx86("p", { className: "text-sm text-text-tertiary", children: "Loading products\u2026" }) : products.length === 0 ? /* @__PURE__ */ jsx86("p", { className: "text-sm text-text-tertiary", children: "No products yet." }) : productList
|
|
6000
6081
|
] })
|
|
6001
6082
|
] }),
|
|
6002
|
-
/* @__PURE__ */
|
|
6003
|
-
/* @__PURE__ */
|
|
6004
|
-
/* @__PURE__ */
|
|
6005
|
-
/* @__PURE__ */
|
|
6083
|
+
/* @__PURE__ */ jsxs51("form", { onSubmit: handleSubmit, className: "space-y-4", noValidate: true, children: [
|
|
6084
|
+
/* @__PURE__ */ jsxs51("div", { className: "space-y-1.5", children: [
|
|
6085
|
+
/* @__PURE__ */ jsx86(Label2, { htmlFor: "create-product-name", children: "Product name" }),
|
|
6086
|
+
/* @__PURE__ */ jsx86(
|
|
6006
6087
|
Input,
|
|
6007
6088
|
{
|
|
6008
6089
|
id: "create-product-name",
|
|
@@ -6013,9 +6094,9 @@ function ProductCreateScreen({
|
|
|
6013
6094
|
}
|
|
6014
6095
|
)
|
|
6015
6096
|
] }),
|
|
6016
|
-
serverError && /* @__PURE__ */
|
|
6017
|
-
/* @__PURE__ */
|
|
6018
|
-
/* @__PURE__ */
|
|
6097
|
+
serverError && /* @__PURE__ */ jsx86(InlineError, { children: serverError }),
|
|
6098
|
+
/* @__PURE__ */ jsxs51("div", { className: "space-y-2 pt-1", children: [
|
|
6099
|
+
/* @__PURE__ */ jsx86(
|
|
6019
6100
|
"button",
|
|
6020
6101
|
{
|
|
6021
6102
|
type: "submit",
|
|
@@ -6026,16 +6107,16 @@ function ProductCreateScreen({
|
|
|
6026
6107
|
children: submitting ? "Creating\u2026" : submitLabel
|
|
6027
6108
|
}
|
|
6028
6109
|
),
|
|
6029
|
-
onCancel && /* @__PURE__ */
|
|
6110
|
+
onCancel && /* @__PURE__ */ jsx86("button", { type: "button", onClick: onCancel, className: AUTH_QUIET_BUTTON, children: "Cancel" })
|
|
6030
6111
|
] })
|
|
6031
6112
|
] }),
|
|
6032
|
-
!pickerLayout && products.length > 0 && /* @__PURE__ */
|
|
6113
|
+
!pickerLayout && products.length > 0 && /* @__PURE__ */ jsxs51(
|
|
6033
6114
|
"div",
|
|
6034
6115
|
{
|
|
6035
6116
|
"data-testid": "existing-products",
|
|
6036
6117
|
className: "mt-6 space-y-2 border-t border-border-default pt-5",
|
|
6037
6118
|
children: [
|
|
6038
|
-
/* @__PURE__ */
|
|
6119
|
+
/* @__PURE__ */ jsx86(Label2, { children: existingProductsLabel }),
|
|
6039
6120
|
productList
|
|
6040
6121
|
]
|
|
6041
6122
|
}
|
|
@@ -6224,6 +6305,7 @@ export {
|
|
|
6224
6305
|
OrgProductSwitcher,
|
|
6225
6306
|
OrganizationCreateScreen,
|
|
6226
6307
|
OrganizationOnboardingForm,
|
|
6308
|
+
OrganizationUnderReviewScreen,
|
|
6227
6309
|
PageHeader,
|
|
6228
6310
|
Pagination,
|
|
6229
6311
|
PaginationContent,
|