@bizapps/design-system-testing 1.8.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/editor.cjs +12 -7
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +12 -7
- package/dist/editor.js.map +1 -1
- package/dist/main.cjs +244 -6
- package/dist/main.cjs.map +1 -1
- package/dist/main.css +1 -1
- package/dist/main.d.cts +132 -2
- package/dist/main.d.ts +132 -2
- package/dist/main.js +241 -9
- package/dist/main.js.map +1 -1
- package/package.json +4 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes, ReactNode, ComponentProps, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes } from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, ComponentProps, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes, Ref } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import { Avatar as Avatar$1, Label as Label$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Select as Select$1, Separator as Separator$1, Progress as Progress$1, Slider as Slider$1, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1, Popover as Popover$1, Dialog as Dialog$1, AlertDialog as AlertDialog$1, Accordion as Accordion$1, DropdownMenu as DropdownMenu$1, RadioGroup as RadioGroup$1, NavigationMenu as NavigationMenu$1, Checkbox as Checkbox$1 } from 'radix-ui';
|
|
@@ -1279,6 +1279,12 @@ type AnimationTokens = typeof animation;
|
|
|
1279
1279
|
|
|
1280
1280
|
declare function useAppForm<T extends ZodType>(schema: T, options?: Omit<UseFormProps<z.infer<T> & FieldValues>, 'resolver'>): react_hook_form.UseFormReturn<z.core.output<T> & FieldValues, any, z.core.output<T> & FieldValues>;
|
|
1281
1281
|
|
|
1282
|
+
/**
|
|
1283
|
+
* Brand logo assets served from the CDN.
|
|
1284
|
+
*
|
|
1285
|
+
* Keys are flat and prefixed by brand: unprefixed keys belong to Total Civil,
|
|
1286
|
+
* `millwork*` keys belong to Total Millwork.
|
|
1287
|
+
*/
|
|
1282
1288
|
declare const logos: {
|
|
1283
1289
|
readonly color: "https://dibt9vplwriap.cloudfront.net/logos/Logo_Total_Color.webp";
|
|
1284
1290
|
readonly colorAna: "https://dibt9vplwriap.cloudfront.net/logos/Logo_Total_Color-ANA.webp";
|
|
@@ -1288,9 +1294,51 @@ declare const logos: {
|
|
|
1288
1294
|
readonly grayScale: "https://dibt9vplwriap.cloudfront.net/logos/Logo_Total_gray_scale.webp";
|
|
1289
1295
|
readonly monochBlack: "https://dibt9vplwriap.cloudfront.net/logos/Logo_Total_monochB.webp";
|
|
1290
1296
|
readonly monochOrange: "https://dibt9vplwriap.cloudfront.net/logos/Logo_Total_monochO.webp";
|
|
1297
|
+
readonly isotype: "https://dibt9vplwriap.cloudfront.net/logos/Isotipo_Total_Color.webp";
|
|
1298
|
+
readonly millworkColor: "https://dibt9vplwriap.cloudfront.net/logos/Logo_Millwork_Color.webp";
|
|
1299
|
+
readonly millworkNegative: "https://dibt9vplwriap.cloudfront.net/logos/Logo_Millwork_Negative.webp";
|
|
1291
1300
|
};
|
|
1292
1301
|
type LogoKey = keyof typeof logos;
|
|
1293
1302
|
|
|
1303
|
+
/**
|
|
1304
|
+
* Brand palette for the celebration burst, resolved from the `--color-main-*`
|
|
1305
|
+
* tokens rather than referenced through them: the canvas is appended to the
|
|
1306
|
+
* body, outside the themed tree, so `var()` would resolve against the document
|
|
1307
|
+
* root and miss any scoped override anyway.
|
|
1308
|
+
*
|
|
1309
|
+
* `--color-main-white` is deliberately absent. The app paints its page ground
|
|
1310
|
+
* `--color-main-light-background` (#f1f5f7), which swallows white particles.
|
|
1311
|
+
*/
|
|
1312
|
+
declare const CONFETTI_COLORS: readonly ["#22205f", "#f66a24", "#faca4a", "#01d42f", "#d93235"];
|
|
1313
|
+
type FireConfettiOptions = {
|
|
1314
|
+
/** Particles per cannon. Two cannons fire, so the burst is twice this. */
|
|
1315
|
+
particleCount?: number;
|
|
1316
|
+
/** Vertical launch point: 0 is the top of the viewport, 1 the bottom. */
|
|
1317
|
+
originY?: number;
|
|
1318
|
+
/** Overrides the brand palette. Any CSS color string canvas can parse. */
|
|
1319
|
+
colors?: string[];
|
|
1320
|
+
};
|
|
1321
|
+
/**
|
|
1322
|
+
* Fires a celebration burst from two cannons angled inward at the lower corners
|
|
1323
|
+
* of the viewport.
|
|
1324
|
+
*
|
|
1325
|
+
* The geometry is the whole point. A single centred burst reads as a puff and
|
|
1326
|
+
* dies mid-screen; the crossfire covers the full width, which is what carries
|
|
1327
|
+
* the celebration. Launching from 0.7 rather than the centre reads as confetti
|
|
1328
|
+
* thrown upward instead of an explosion pushing outward.
|
|
1329
|
+
*
|
|
1330
|
+
* Resolves once the last particle has settled, so a caller can sequence on it.
|
|
1331
|
+
* Honours `prefers-reduced-motion`, in which case it resolves immediately
|
|
1332
|
+
* without drawing.
|
|
1333
|
+
*/
|
|
1334
|
+
declare function fireConfetti({ particleCount, originY, colors, }?: FireConfettiOptions): Promise<void>;
|
|
1335
|
+
/**
|
|
1336
|
+
* Clears every burst still in flight and removes the canvas.
|
|
1337
|
+
*
|
|
1338
|
+
* For a caller that unmounts, or navigates away, while particles are airborne.
|
|
1339
|
+
*/
|
|
1340
|
+
declare function resetConfetti(): void;
|
|
1341
|
+
|
|
1294
1342
|
declare function Table({ className, containerClassName, ...props }: ComponentProps<'table'> & {
|
|
1295
1343
|
/**
|
|
1296
1344
|
* Classes for the scroll container that wraps the table. Defaults to
|
|
@@ -1316,11 +1364,23 @@ type SortDirection = 'asc' | 'desc' | false;
|
|
|
1316
1364
|
type CellAlignment = 'left' | 'center' | 'right';
|
|
1317
1365
|
interface ColumnMeta {
|
|
1318
1366
|
align?: CellAlignment;
|
|
1367
|
+
/**
|
|
1368
|
+
* Per-column density override. This is NOT a width — use `width`, or the column
|
|
1369
|
+
* definition's top-level `size`, for that.
|
|
1370
|
+
*/
|
|
1319
1371
|
size?: TableCellSize;
|
|
1320
1372
|
sortable?: boolean;
|
|
1321
1373
|
filterable?: boolean;
|
|
1322
1374
|
ellipsis?: boolean;
|
|
1323
1375
|
variant?: 'default' | 'numeric';
|
|
1376
|
+
/**
|
|
1377
|
+
* Fixed column width, applied as both `width` and `min-width`. A number is treated as
|
|
1378
|
+
* pixels, a string as any CSS length (`'8rem'`, `'20%'`, `'100px'`).
|
|
1379
|
+
*
|
|
1380
|
+
* Authoritative only while `enableColumnResizing` is off. With resizing enabled the
|
|
1381
|
+
* rendered width comes from the column definition's top-level `size` / `minSize` /
|
|
1382
|
+
* `maxSize` and this value acts as a `min-width` floor only.
|
|
1383
|
+
*/
|
|
1324
1384
|
width?: string | number;
|
|
1325
1385
|
className?: string;
|
|
1326
1386
|
pinned?: 'left' | 'right' | false;
|
|
@@ -1452,6 +1512,31 @@ declare const TablePagination: react.MemoExoticComponent<typeof TablePaginationB
|
|
|
1452
1512
|
|
|
1453
1513
|
declare function useTableContext<T = unknown>(): TableContextType<T>;
|
|
1454
1514
|
|
|
1515
|
+
/**
|
|
1516
|
+
* TanStack Table v8 data table with sorting, filtering, global search, pagination, row
|
|
1517
|
+
* selection, column visibility, resizing, density control, sticky headers, column pinning
|
|
1518
|
+
* and an automatic mobile card layout.
|
|
1519
|
+
*
|
|
1520
|
+
* Per-column presentation belongs in `meta` (`ColumnMeta`) on each column definition rather
|
|
1521
|
+
* than in per-cell `className` strings: `align`, `size` (density override), `sortable`,
|
|
1522
|
+
* `filterable`, `ellipsis`, `variant`, `width`, `className`, `pinned`, `cardLabel`,
|
|
1523
|
+
* `hideInCard` and `resizable`.
|
|
1524
|
+
*
|
|
1525
|
+
* Column width has two authorities. With `enableColumnResizing` off (the default),
|
|
1526
|
+
* `meta.width` drives both `width` and `min-width` on the header and body cells; a number is
|
|
1527
|
+
* pixels and a string is any CSS length (`'8rem'`, `'20%'`, `'100px'`). With
|
|
1528
|
+
* `enableColumnResizing` on, the rendered width instead comes from TanStack's own top-level
|
|
1529
|
+
* `size` / `minSize` / `maxSize` on the column definition (`size` defaults to 150px) and
|
|
1530
|
+
* `meta.width` degrades to a `min-width` floor. Note that `meta.size` is cell density, not a
|
|
1531
|
+
* width — the pixel width is the top-level `size`.
|
|
1532
|
+
*
|
|
1533
|
+
* The table element is `w-full` under the browser's default `table-layout: auto`, so `width`
|
|
1534
|
+
* is only a hint and `min-width` is what actually holds. Pass
|
|
1535
|
+
* `classNames={{ table: 'table-fixed' }}` when exact widths must be honoured.
|
|
1536
|
+
*
|
|
1537
|
+
* Set `tableId` to persist column visibility, sizing and density to `localStorage` under
|
|
1538
|
+
* `tcce-table:{tableId}:*`.
|
|
1539
|
+
*/
|
|
1455
1540
|
declare function DataTable<T>({ data, columns, size, variant, isLoading, stickyHeader, maxHeight, sorting, defaultSorting, onSortingChange, enableSorting, manualSorting, columnFilters, defaultColumnFilters, onColumnFiltersChange, enableFiltering, manualFiltering, onRowClick, classNames, getUniqueValues, emptyState, rowSelection, defaultRowSelection, onRowSelectionChange, enableRowSelection, onSelectedRowsChange, responsiveBreakpoint, disableResponsive, skeletonRowCount, onTableReady, tableId, globalFilter, defaultGlobalFilter, onGlobalFilterChange, columnVisibility, defaultColumnVisibility, onColumnVisibilityChange, columnSizing, defaultColumnSizing, onColumnSizingChange, enableColumnResizing, onSizeChange, toolbar, }: DataTableProps<T>): react.JSX.Element;
|
|
1456
1541
|
|
|
1457
1542
|
interface FilterOptionProps {
|
|
@@ -2251,6 +2336,51 @@ declare function DrawerFooter({ className, ...props }: ComponentProps<'div'>): r
|
|
|
2251
2336
|
declare function DrawerTitle({ className, ...props }: ComponentProps<typeof Dialog$1.Title>): react.JSX.Element;
|
|
2252
2337
|
declare function DrawerDescription({ className, ...props }: ComponentProps<typeof Dialog$1.Description>): react.JSX.Element;
|
|
2253
2338
|
|
|
2339
|
+
interface SignaturePadHandle {
|
|
2340
|
+
/** Wipes the drawing and reports `onEmptyChange(true)` if something was drawn. */
|
|
2341
|
+
clear: () => void;
|
|
2342
|
+
isEmpty: () => boolean;
|
|
2343
|
+
/** The drawing as a PNG with a transparent background. Rejects if not mounted or the browser cannot encode it. */
|
|
2344
|
+
toBlob: () => Promise<Blob>;
|
|
2345
|
+
}
|
|
2346
|
+
interface SignaturePadProps {
|
|
2347
|
+
/** Accessible name of the drawing area. */
|
|
2348
|
+
'aria-label': string;
|
|
2349
|
+
/** Id of the element holding the instructions. */
|
|
2350
|
+
'aria-describedby'?: string;
|
|
2351
|
+
/** Called when the pad goes from empty to drawn (`false`) or back (`true`), never twice in a row. */
|
|
2352
|
+
onEmptyChange?: (empty: boolean) => void;
|
|
2353
|
+
/** Ignores pointer input while true. */
|
|
2354
|
+
disabled?: boolean;
|
|
2355
|
+
/** Height in px; the pad always fills the width of its container. */
|
|
2356
|
+
height?: number;
|
|
2357
|
+
/** Pen color. The exported PNG keeps this color on a transparent background. */
|
|
2358
|
+
penColor?: string;
|
|
2359
|
+
/** Minimum stroke width in px, reached at high pointer speed. */
|
|
2360
|
+
minWidth?: number;
|
|
2361
|
+
/** Maximum stroke width in px, reached at low pointer speed. */
|
|
2362
|
+
maxWidth?: number;
|
|
2363
|
+
/** Ignores pointer moves closer than this many px to the last point. Lower is smoother. */
|
|
2364
|
+
minDistance?: number;
|
|
2365
|
+
/** Minimum ms between processed pointer moves; `0` processes every event. */
|
|
2366
|
+
throttle?: number;
|
|
2367
|
+
/** 0–1 weight of the previous velocity when computing width. Higher evens out width changes. */
|
|
2368
|
+
velocityFilterWeight?: number;
|
|
2369
|
+
/** Accessible name of the built-in clear button. Pass a translated string from the app. */
|
|
2370
|
+
clearLabel: string;
|
|
2371
|
+
className?: string;
|
|
2372
|
+
/** Imperative handle with `clear`, `isEmpty` and `toBlob`. */
|
|
2373
|
+
ref?: Ref<SignaturePadHandle>;
|
|
2374
|
+
}
|
|
2375
|
+
/**
|
|
2376
|
+
* Freehand signature area for touch, pen and mouse. The drawing buffer follows the container size
|
|
2377
|
+
* and the device pixel ratio. Strokes live in a reference coordinate space; a resize scales them
|
|
2378
|
+
* uniformly to fit (never above 1), so a narrower pad, such as a rotated phone, never crops the
|
|
2379
|
+
* signature or its PNG, and growing back restores it. A stroke added while scaled down that falls
|
|
2380
|
+
* outside the reference area grows it, so everything still fits, at a smaller size.
|
|
2381
|
+
*/
|
|
2382
|
+
declare function SignaturePad({ 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, onEmptyChange, disabled, height, penColor, minWidth, maxWidth, minDistance, throttle, velocityFilterWeight, clearLabel, className, ref, }: SignaturePadProps): react.JSX.Element;
|
|
2383
|
+
|
|
2254
2384
|
interface TCCEProviderProps {
|
|
2255
2385
|
children: ReactNode;
|
|
2256
2386
|
permissions?: string[];
|
|
@@ -2259,4 +2389,4 @@ interface TCCEProviderProps {
|
|
|
2259
2389
|
}
|
|
2260
2390
|
declare function TCCEProvider({ children, permissions, toasterPosition, tooltipDelayDuration, }: TCCEProviderProps): react.JSX.Element;
|
|
2261
2391
|
|
|
2262
|
-
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, type AbilityStatus, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BottomNav, type BottomNavItem, BottomNavTabs, BottomNavTabsContent, type BottomNavTabsItem, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, type CanState, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxMatchMode, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerSide, type DrawerSize, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Permission, PhoneField, type PhoneFieldCountry, type PhoneFieldProps, PhoneFieldValidity, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAbilityStatus, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
|
|
2392
|
+
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, type AbilityStatus, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BottomNav, type BottomNavItem, BottomNavTabs, BottomNavTabsContent, type BottomNavTabsItem, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, CONFETTI_COLORS, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, type CanState, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxMatchMode, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerSide, type DrawerSize, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, type FireConfettiOptions, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Permission, PhoneField, type PhoneFieldCountry, type PhoneFieldProps, PhoneFieldValidity, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignaturePad, type SignaturePadHandle, type SignaturePadProps, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, fireConfetti, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, resetConfetti, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAbilityStatus, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { SearchIcon, BellIcon, CircleHelpIcon, ChevronDownIcon, ChevronLeftIcon, MoreHorizontalIcon, ChevronRightIcon, MinusIcon, CheckIcon, LoaderCircle, ChevronUpIcon, X, ChevronLeft, ChevronRight, ExternalLinkIcon, ChevronsUpDownIcon, XIcon, UploadIcon, Loader2Icon, LoaderIcon, PipetteIcon, CalendarIcon, MenuIcon, Pencil, Clock, Funnel, ArrowUp, ArrowDown, ArrowUpDown, Ellipsis, Rows2, Eye, Search, House, Plane, Wallet, LayoutDashboardIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, CircleCheckIcon } from 'lucide-react';
|
|
2
|
+
import { SearchIcon, BellIcon, CircleHelpIcon, ChevronDownIcon, ChevronLeftIcon, MoreHorizontalIcon, ChevronRightIcon, MinusIcon, CheckIcon, LoaderCircle, ChevronUpIcon, X, ChevronLeft, ChevronRight, ExternalLinkIcon, ChevronsUpDownIcon, XIcon, UploadIcon, Loader2Icon, LoaderIcon, PipetteIcon, CalendarIcon, MenuIcon, Pencil, Clock, Funnel, ArrowUp, ArrowDown, ArrowUpDown, Ellipsis, Rows2, Eye, Search, BrushCleaning, House, Plane, Wallet, LayoutDashboardIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, CircleCheckIcon } from 'lucide-react';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
7
|
-
import { createContext, memo, useRef, useState, useMemo, useCallback, useEffect, forwardRef, Fragment, useId, useContext, useLayoutEffect, isValidElement, cloneElement } from 'react';
|
|
7
|
+
import { createContext, memo, useRef, useState, useMemo, useCallback, useEffect, forwardRef, Fragment, useId, useContext, useLayoutEffect, isValidElement, useImperativeHandle, cloneElement } from 'react';
|
|
8
8
|
import { Avatar as Avatar$1, Checkbox as Checkbox$1, Slot, Select as Select$1, Label as Label$1, Popover as Popover$1, Toggle as Toggle$1, ToggleGroup, Separator as Separator$1, Progress as Progress$1, Slider as Slider$1, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1, Dialog as Dialog$1, AlertDialog as AlertDialog$1, Accordion as Accordion$1, DropdownMenu as DropdownMenu$1, RadioGroup as RadioGroup$1, NavigationMenu as NavigationMenu$1 } from 'radix-ui';
|
|
9
9
|
import { isSameDay, isToday, format, addDays } from 'date-fns';
|
|
10
10
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
@@ -25,8 +25,10 @@ import { Temporal } from 'temporal-polyfill';
|
|
|
25
25
|
import { useForm } from 'react-hook-form';
|
|
26
26
|
export { Controller, useFieldArray } from 'react-hook-form';
|
|
27
27
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
28
|
+
import confetti from 'canvas-confetti';
|
|
28
29
|
import { flexRender, useReactTable, getFilteredRowModel, getSortedRowModel, getCoreRowModel } from '@tanstack/react-table';
|
|
29
30
|
export { createColumnHelper } from '@tanstack/react-table';
|
|
31
|
+
import SignaturePadLib from 'signature_pad';
|
|
30
32
|
|
|
31
33
|
// src/components/ui/Alert/alert.tsx
|
|
32
34
|
function cn(...inputs) {
|
|
@@ -927,10 +929,11 @@ function Input({ className, type, ...props }) {
|
|
|
927
929
|
type,
|
|
928
930
|
"data-slot": "input",
|
|
929
931
|
className: cn(
|
|
930
|
-
"border-input
|
|
931
|
-
"placeholder:text-muted-foreground",
|
|
932
|
+
"border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[border-color,box-shadow] outline-hidden md:text-sm",
|
|
933
|
+
"placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground",
|
|
934
|
+
"file:text-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
932
935
|
"focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-3",
|
|
933
|
-
"disabled:
|
|
936
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
934
937
|
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3",
|
|
935
938
|
"dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
936
939
|
className
|
|
@@ -6162,10 +6165,10 @@ function Textarea({ className, ...props }) {
|
|
|
6162
6165
|
{
|
|
6163
6166
|
"data-slot": "textarea",
|
|
6164
6167
|
className: cn(
|
|
6165
|
-
"border-input flex min-h-[80px] w-full resize-y rounded-md border bg-transparent px-3 py-2 text-
|
|
6168
|
+
"border-input flex min-h-[80px] w-full resize-y rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[border-color,box-shadow] outline-hidden md:text-sm",
|
|
6166
6169
|
"placeholder:text-muted-foreground",
|
|
6167
6170
|
"focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-3",
|
|
6168
|
-
"disabled:
|
|
6171
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
6169
6172
|
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3",
|
|
6170
6173
|
"dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
6171
6174
|
className
|
|
@@ -7079,6 +7082,7 @@ function useAppForm(schema, options) {
|
|
|
7079
7082
|
// src/lib/cdn.ts
|
|
7080
7083
|
var CDN_BASE = "https://dibt9vplwriap.cloudfront.net";
|
|
7081
7084
|
var logos = {
|
|
7085
|
+
// Total Civil
|
|
7082
7086
|
color: `${CDN_BASE}/logos/Logo_Total_Color.webp`,
|
|
7083
7087
|
colorAna: `${CDN_BASE}/logos/Logo_Total_Color-ANA.webp`,
|
|
7084
7088
|
colorAnaa: `${CDN_BASE}/logos/Logo_Total_Color-ANAA.webp`,
|
|
@@ -7086,8 +7090,44 @@ var logos = {
|
|
|
7086
7090
|
positive: `${CDN_BASE}/logos/Logo_Total_Positive.webp`,
|
|
7087
7091
|
grayScale: `${CDN_BASE}/logos/Logo_Total_gray_scale.webp`,
|
|
7088
7092
|
monochBlack: `${CDN_BASE}/logos/Logo_Total_monochB.webp`,
|
|
7089
|
-
monochOrange: `${CDN_BASE}/logos/Logo_Total_monochO.webp
|
|
7093
|
+
monochOrange: `${CDN_BASE}/logos/Logo_Total_monochO.webp`,
|
|
7094
|
+
isotype: `${CDN_BASE}/logos/Isotipo_Total_Color.webp`,
|
|
7095
|
+
// Total Millwork
|
|
7096
|
+
millworkColor: `${CDN_BASE}/logos/Logo_Millwork_Color.webp`,
|
|
7097
|
+
millworkNegative: `${CDN_BASE}/logos/Logo_Millwork_Negative.webp`
|
|
7090
7098
|
};
|
|
7099
|
+
var CONFETTI_COLORS = [
|
|
7100
|
+
"#22205f",
|
|
7101
|
+
// --color-main-blue-primary
|
|
7102
|
+
"#f66a24",
|
|
7103
|
+
// --color-main-orange-primary
|
|
7104
|
+
"#faca4a",
|
|
7105
|
+
// --color-main-yellow-primary
|
|
7106
|
+
"#01d42f",
|
|
7107
|
+
// --color-main-positive-state
|
|
7108
|
+
"#d93235"
|
|
7109
|
+
// --color-main-warning-state
|
|
7110
|
+
];
|
|
7111
|
+
function fireConfetti({
|
|
7112
|
+
particleCount = 60,
|
|
7113
|
+
originY = 0.7,
|
|
7114
|
+
colors = [...CONFETTI_COLORS]
|
|
7115
|
+
} = {}) {
|
|
7116
|
+
const shared = {
|
|
7117
|
+
particleCount,
|
|
7118
|
+
colors,
|
|
7119
|
+
spread: 70,
|
|
7120
|
+
startVelocity: 55,
|
|
7121
|
+
disableForReducedMotion: true
|
|
7122
|
+
};
|
|
7123
|
+
return Promise.all([
|
|
7124
|
+
confetti({ ...shared, angle: 60, origin: { x: 0, y: originY } }),
|
|
7125
|
+
confetti({ ...shared, angle: 120, origin: { x: 1, y: originY } })
|
|
7126
|
+
]).then(() => void 0);
|
|
7127
|
+
}
|
|
7128
|
+
function resetConfetti() {
|
|
7129
|
+
confetti.reset();
|
|
7130
|
+
}
|
|
7091
7131
|
function Table({
|
|
7092
7132
|
className,
|
|
7093
7133
|
containerClassName = "overflow-x-auto",
|
|
@@ -9358,6 +9398,198 @@ function DrawerDescription({
|
|
|
9358
9398
|
}
|
|
9359
9399
|
);
|
|
9360
9400
|
}
|
|
9401
|
+
function SignaturePad({
|
|
9402
|
+
"aria-label": ariaLabel,
|
|
9403
|
+
"aria-describedby": ariaDescribedBy,
|
|
9404
|
+
onEmptyChange,
|
|
9405
|
+
disabled = false,
|
|
9406
|
+
height = 260,
|
|
9407
|
+
penColor = "black",
|
|
9408
|
+
// Smoother than the library defaults (0.5–2.5 px, 5 px, 16 ms), which drop points and turn
|
|
9409
|
+
// fast or small curves into visible straight segments.
|
|
9410
|
+
minWidth = 1,
|
|
9411
|
+
maxWidth = 3,
|
|
9412
|
+
minDistance = 1,
|
|
9413
|
+
throttle = 0,
|
|
9414
|
+
velocityFilterWeight,
|
|
9415
|
+
clearLabel,
|
|
9416
|
+
className,
|
|
9417
|
+
ref
|
|
9418
|
+
}) {
|
|
9419
|
+
const canvasRef = useRef(null);
|
|
9420
|
+
const padRef = useRef(null);
|
|
9421
|
+
const emptyRef = useRef(true);
|
|
9422
|
+
const [empty, setEmptyState] = useState(true);
|
|
9423
|
+
const onEmptyChangeRef = useRef(onEmptyChange);
|
|
9424
|
+
const drawnRef = useRef({
|
|
9425
|
+
data: [],
|
|
9426
|
+
width: 0,
|
|
9427
|
+
height: 0,
|
|
9428
|
+
scale: 1
|
|
9429
|
+
});
|
|
9430
|
+
const optionsRef = useRef({
|
|
9431
|
+
penColor,
|
|
9432
|
+
minWidth,
|
|
9433
|
+
maxWidth,
|
|
9434
|
+
minDistance,
|
|
9435
|
+
throttle,
|
|
9436
|
+
velocityFilterWeight
|
|
9437
|
+
});
|
|
9438
|
+
useEffect(() => {
|
|
9439
|
+
onEmptyChangeRef.current = onEmptyChange;
|
|
9440
|
+
}, [onEmptyChange]);
|
|
9441
|
+
const setEmpty = (next) => {
|
|
9442
|
+
if (emptyRef.current === next) return;
|
|
9443
|
+
emptyRef.current = next;
|
|
9444
|
+
setEmptyState(next);
|
|
9445
|
+
onEmptyChangeRef.current?.(next);
|
|
9446
|
+
};
|
|
9447
|
+
const clear = () => {
|
|
9448
|
+
padRef.current?.clear();
|
|
9449
|
+
drawnRef.current = { data: [], width: 0, height: 0, scale: 1 };
|
|
9450
|
+
setEmpty(true);
|
|
9451
|
+
};
|
|
9452
|
+
useEffect(() => {
|
|
9453
|
+
const canvas = canvasRef.current;
|
|
9454
|
+
if (!canvas) return;
|
|
9455
|
+
const pad = new SignaturePadLib(canvas, optionsRef.current);
|
|
9456
|
+
padRef.current = pad;
|
|
9457
|
+
let width = 0;
|
|
9458
|
+
let fittedHeight = 0;
|
|
9459
|
+
const redraw = () => {
|
|
9460
|
+
const drawn = drawnRef.current;
|
|
9461
|
+
drawn.scale = Math.min(width / drawn.width, fittedHeight / drawn.height, 1);
|
|
9462
|
+
pad.clear();
|
|
9463
|
+
pad.fromData(
|
|
9464
|
+
drawn.data.map((group) => ({
|
|
9465
|
+
...group,
|
|
9466
|
+
points: group.points.map((point) => ({
|
|
9467
|
+
...point,
|
|
9468
|
+
x: point.x * drawn.scale,
|
|
9469
|
+
y: point.y * drawn.scale
|
|
9470
|
+
}))
|
|
9471
|
+
}))
|
|
9472
|
+
);
|
|
9473
|
+
};
|
|
9474
|
+
const handleEnd = () => {
|
|
9475
|
+
const drawn = drawnRef.current;
|
|
9476
|
+
if (drawn.data.length === 0) {
|
|
9477
|
+
drawn.width = width;
|
|
9478
|
+
drawn.height = fittedHeight;
|
|
9479
|
+
drawn.scale = 1;
|
|
9480
|
+
}
|
|
9481
|
+
const newest = pad.toData().at(-1);
|
|
9482
|
+
if (newest) {
|
|
9483
|
+
const points = newest.points.map((point) => ({
|
|
9484
|
+
...point,
|
|
9485
|
+
x: point.x / drawn.scale,
|
|
9486
|
+
y: point.y / drawn.scale
|
|
9487
|
+
}));
|
|
9488
|
+
drawn.data = [...drawn.data, { ...newest, points }];
|
|
9489
|
+
const margin = newest.maxWidth ?? 0;
|
|
9490
|
+
const reach = (axis) => Math.max(...points.map((point) => point[axis])) + margin;
|
|
9491
|
+
drawn.width = Math.max(drawn.width, reach("x"));
|
|
9492
|
+
drawn.height = Math.max(drawn.height, reach("y"));
|
|
9493
|
+
const fitting = Math.min(width / drawn.width, fittedHeight / drawn.height, 1);
|
|
9494
|
+
if (fitting !== drawn.scale) redraw();
|
|
9495
|
+
}
|
|
9496
|
+
setEmpty(pad.isEmpty());
|
|
9497
|
+
};
|
|
9498
|
+
pad.addEventListener("endStroke", handleEnd);
|
|
9499
|
+
const fit = () => {
|
|
9500
|
+
const nextWidth = canvas.offsetWidth;
|
|
9501
|
+
const nextHeight = canvas.offsetHeight;
|
|
9502
|
+
if (!nextWidth || !nextHeight) return;
|
|
9503
|
+
if (nextWidth === width && nextHeight === fittedHeight) return;
|
|
9504
|
+
width = nextWidth;
|
|
9505
|
+
fittedHeight = nextHeight;
|
|
9506
|
+
const ratio = window.devicePixelRatio || 1;
|
|
9507
|
+
canvas.width = nextWidth * ratio;
|
|
9508
|
+
canvas.height = nextHeight * ratio;
|
|
9509
|
+
canvas.getContext("2d")?.scale(ratio, ratio);
|
|
9510
|
+
pad.clear();
|
|
9511
|
+
if (drawnRef.current.data.length > 0) redraw();
|
|
9512
|
+
};
|
|
9513
|
+
fit();
|
|
9514
|
+
const observer = new ResizeObserver(fit);
|
|
9515
|
+
observer.observe(canvas);
|
|
9516
|
+
return () => {
|
|
9517
|
+
observer.disconnect();
|
|
9518
|
+
pad.removeEventListener("endStroke", handleEnd);
|
|
9519
|
+
pad.off();
|
|
9520
|
+
padRef.current = null;
|
|
9521
|
+
};
|
|
9522
|
+
}, []);
|
|
9523
|
+
useEffect(() => {
|
|
9524
|
+
if (disabled) padRef.current?.off();
|
|
9525
|
+
else padRef.current?.on();
|
|
9526
|
+
}, [disabled]);
|
|
9527
|
+
useImperativeHandle(
|
|
9528
|
+
ref,
|
|
9529
|
+
() => ({
|
|
9530
|
+
clear,
|
|
9531
|
+
isEmpty: () => padRef.current?.isEmpty() ?? true,
|
|
9532
|
+
toBlob: () => new Promise((resolve, reject) => {
|
|
9533
|
+
const canvas = canvasRef.current;
|
|
9534
|
+
if (!canvas) return reject(new Error("The signature pad is not mounted"));
|
|
9535
|
+
canvas.toBlob((blob) => {
|
|
9536
|
+
if (blob) resolve(blob);
|
|
9537
|
+
else reject(new Error("The signature could not be encoded as PNG"));
|
|
9538
|
+
}, "image/png");
|
|
9539
|
+
})
|
|
9540
|
+
}),
|
|
9541
|
+
// `clear` only touches refs and state setters, so the handle is created once.
|
|
9542
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9543
|
+
[]
|
|
9544
|
+
);
|
|
9545
|
+
return /* @__PURE__ */ jsxs(
|
|
9546
|
+
"div",
|
|
9547
|
+
{
|
|
9548
|
+
"data-slot": "signature-pad",
|
|
9549
|
+
"data-disabled": disabled ? "" : void 0,
|
|
9550
|
+
className: cn(
|
|
9551
|
+
// Fixed light "paper": the pen is black and the PNG is read on white by others. The
|
|
9552
|
+
// primitive keeps the pad light for consumers that define a dark theme, where a themed
|
|
9553
|
+
// surface (`background`, `border`) would turn dark and hide the black ink.
|
|
9554
|
+
"bg-main-alternative-secondary border-dark-100 relative overflow-hidden rounded-xl border",
|
|
9555
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
9556
|
+
className
|
|
9557
|
+
),
|
|
9558
|
+
children: [
|
|
9559
|
+
/* @__PURE__ */ jsx(
|
|
9560
|
+
"canvas",
|
|
9561
|
+
{
|
|
9562
|
+
ref: canvasRef,
|
|
9563
|
+
"data-slot": "signature-pad-canvas",
|
|
9564
|
+
role: "img",
|
|
9565
|
+
"aria-label": ariaLabel,
|
|
9566
|
+
"aria-describedby": ariaDescribedBy,
|
|
9567
|
+
"aria-disabled": disabled || void 0,
|
|
9568
|
+
style: { height },
|
|
9569
|
+
className: "block w-full touch-none"
|
|
9570
|
+
}
|
|
9571
|
+
),
|
|
9572
|
+
/* @__PURE__ */ jsx(
|
|
9573
|
+
Button,
|
|
9574
|
+
{
|
|
9575
|
+
type: "button",
|
|
9576
|
+
variant: "ghost",
|
|
9577
|
+
size: "icon-sm",
|
|
9578
|
+
"data-slot": "signature-pad-clear",
|
|
9579
|
+
"aria-label": clearLabel,
|
|
9580
|
+
disabled,
|
|
9581
|
+
"aria-disabled": empty && !disabled ? true : void 0,
|
|
9582
|
+
onClick: () => {
|
|
9583
|
+
if (!emptyRef.current) clear();
|
|
9584
|
+
},
|
|
9585
|
+
className: "bg-main-white text-dark-600 border-dark-100 hover:bg-dark-100 hover:text-main-black aria-disabled:hover:bg-main-white absolute right-2 bottom-2 border border-solid aria-disabled:cursor-not-allowed aria-disabled:opacity-50",
|
|
9586
|
+
children: /* @__PURE__ */ jsx(BrushCleaning, { "aria-hidden": true, className: "size-4" })
|
|
9587
|
+
}
|
|
9588
|
+
)
|
|
9589
|
+
]
|
|
9590
|
+
}
|
|
9591
|
+
);
|
|
9592
|
+
}
|
|
9361
9593
|
function TCCEProvider({
|
|
9362
9594
|
children,
|
|
9363
9595
|
permissions,
|
|
@@ -9367,6 +9599,6 @@ function TCCEProvider({
|
|
|
9367
9599
|
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: tooltipDelayDuration, children: /* @__PURE__ */ jsx(AbilityProvider, { permissions, children: /* @__PURE__ */ jsx(Toaster, { position: toasterPosition, children }) }) });
|
|
9368
9600
|
}
|
|
9369
9601
|
|
|
9370
|
-
export { AbilityProvider, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge2 as Badge, BottomNav, BottomNavTabs, BottomNavTabsContent, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Can, CanNot, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, ColorPicker, ColorPickerAlpha, ColorPickerEyeDropper, ColorPickerFormat, ColorPickerHue, ColorPickerOutput, ColorPickerPresets, ColorPickerSelection, Combobox, DataTable, DataTableCardView, DataTableColumnFilter, DataTableFooter, DataTableHeaderCell, DataTableRowActions, DataTableSearch, DataTableSkeleton, DataTableToolbar, DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, DropzoneEmptyState, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, KNOWN_PERMISSIONS, Label, Link, Logo, MiniCalendar, MiniCalendarDay, MiniCalendarDays, MiniCalendarNavigation, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PhoneField, PinInput, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, SegmentedControl, SegmentedControlItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, SpinnerDots, SpinnerLoader, Status, StatusIndicator, StatusLabel, Switch, TCCEProvider, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, Toaster, Toggle, ToggleGroup2 as ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, animation, avatarVariants, badgeVariants2 as badgeVariants, buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, matchPermission, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAbilityStatus, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast, validatePhone };
|
|
9602
|
+
export { AbilityProvider, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge2 as Badge, BottomNav, BottomNavTabs, BottomNavTabsContent, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CONFETTI_COLORS, Can, CanNot, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, ColorPicker, ColorPickerAlpha, ColorPickerEyeDropper, ColorPickerFormat, ColorPickerHue, ColorPickerOutput, ColorPickerPresets, ColorPickerSelection, Combobox, DataTable, DataTableCardView, DataTableColumnFilter, DataTableFooter, DataTableHeaderCell, DataTableRowActions, DataTableSearch, DataTableSkeleton, DataTableToolbar, DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, DropzoneEmptyState, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, KNOWN_PERMISSIONS, Label, Link, Logo, MiniCalendar, MiniCalendarDay, MiniCalendarDays, MiniCalendarNavigation, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PhoneField, PinInput, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, SegmentedControl, SegmentedControlItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignaturePad, Skeleton, Slider, Spinner, SpinnerDots, SpinnerLoader, Status, StatusIndicator, StatusLabel, Switch, TCCEProvider, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, Toaster, Toggle, ToggleGroup2 as ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, animation, avatarVariants, badgeVariants2 as badgeVariants, buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, fireConfetti, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, matchPermission, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, resetConfetti, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAbilityStatus, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast, validatePhone };
|
|
9371
9603
|
//# sourceMappingURL=main.js.map
|
|
9372
9604
|
//# sourceMappingURL=main.js.map
|