@assure-one/design-system 1.50.0 → 1.52.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.
@@ -1,4 +1,4 @@
1
- import { stateAttributes, slot, chipAnatomy, Pressable, CONTROL_GAP_CLASSES, EN_MESSAGES, microInteractions, listItemClasses, groupHeadingClasses, useDsMessages, withPortalContainer, Backdrop, sheetAnatomy, deprecate, OverlaySurface, DismissButton, DEFAULT_OVERLAY_MESSAGES, DISMISS_GLYPH_CLASSES, OverlayBody, OverlayTitle, OverlayDescription, Input, Textarea, Select, FileUpload, FileChip, Button, Checkbox, Tooltip, TooltipTrigger, TooltipContent, useMergedRefs, TooltipProvider, sidebarAnatomy, Slot, Avatar, DropdownMenu, DropdownMenuTrigger, sidebarBrandSwitcherAnatomy, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, buttonBase, CONTROL_SIZE_CLASSES, useDsDirection, TooltipRoot, useFieldControl, useId as useId$1, useControllableState, Popover, PopoverAnchor, comboboxAnatomy, Spinner, IconButton, PopoverContent, LIST_SEPARATOR, listItemAttributes, optionElementId, FormBridge, useLinkComponent, useImageComponent, OverlayHeader, OverlayFooter, LIST_ITEM_INDICATOR_WELL } from './chunk-CRA6WJZ6.js';
1
+ import { stateAttributes, slot, chipAnatomy, Pressable, CONTROL_GAP_CLASSES, EN_MESSAGES, microInteractions, listItemClasses, groupHeadingClasses, useDsMessages, withPortalContainer, Backdrop, sheetAnatomy, deprecate, OverlaySurface, DismissButton, DEFAULT_OVERLAY_MESSAGES, DISMISS_GLYPH_CLASSES, OverlayBody, OverlayTitle, OverlayDescription, Input, Textarea, Select, FileUpload, FileChip, Button, Checkbox, Tooltip, TooltipTrigger, TooltipContent, useMergedRefs, TooltipProvider, sidebarAnatomy, Slot, useDsDirection, Popover, PopoverAnchor, PopoverContent, Avatar, DropdownMenu, DropdownMenuTrigger, sidebarBrandSwitcherAnatomy, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, buttonBase, CONTROL_SIZE_CLASSES, TooltipRoot, useFieldControl, useId as useId$1, useControllableState, comboboxAnatomy, Spinner, IconButton, LIST_SEPARATOR, listItemAttributes, optionElementId, FormBridge, useLinkComponent, useImageComponent, OverlayHeader, OverlayFooter, LIST_ITEM_INDICATOR_WELL } from './chunk-TL4NK3KN.js';
2
2
  import { cn, XIcon, CheckIcon, EyeIcon, DownloadIcon, PhoneIcon, MailIcon, GlobeIcon, HomeIcon, ChevronLeftIcon, ChevronRightIcon, ReceiptIcon, RotateCcwIcon, CreditCardIcon, LockIcon, FileTextIcon, PlayIcon, InfoIcon, ClockIcon, PenSignIcon, TrashIcon, PlusIcon, CheckCircleSolidIcon, HelpCircleIcon, MinusIcon, PanelLeftCloseIcon, PanelLeftIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronDownIcon } from './chunk-ARCWF2S3.js';
3
3
  import { parseHexColor, contrastRatio, WHITE, formatHexColor, darkenUntilContrast } from './chunk-EUHGZA6Q.js';
4
4
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -2045,8 +2045,11 @@ var AgreementViewer = forwardRef(
2045
2045
  "section",
2046
2046
  {
2047
2047
  "data-bleed": steps[current]?.bleed || void 0,
2048
+ "aria-label": steps[current]?.label,
2049
+ tabIndex: 0,
2048
2050
  className: cn(
2049
2051
  "ds:@container/pane ds:scrollbar-thin ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:overflow-y-auto",
2052
+ "ds:focus-visible:outline-2 ds:focus-visible:-outline-offset-2 ds:focus-visible:outline-[var(--focus-ring-border)]",
2050
2053
  // `bleed` steps own their own padding so a cover can reach the
2051
2054
  // card edges — this replaces the app-side
2052
2055
  // `*:has(> [data-esign-cover]) { padding: 0 }` global rule.
@@ -3714,6 +3717,7 @@ function SidebarProvider({
3714
3717
  }
3715
3718
  SidebarProvider.displayName = "SidebarProvider";
3716
3719
  var SidebarLabelsHiddenContext = React7.createContext(false);
3720
+ var SidebarVariantContext = React7.createContext("classic");
3717
3721
  function useCollapsedAttribute() {
3718
3722
  return React7.useContext(SidebarLabelsHiddenContext) ? { "data-collapsed": "true" } : {};
3719
3723
  }
@@ -3864,7 +3868,7 @@ var Sidebar = React7.forwardRef(function Sidebar2({
3864
3868
  className
3865
3869
  ),
3866
3870
  ...props,
3867
- children: /* @__PURE__ */ jsx(SidebarLabelsHiddenContext.Provider, { value: labelsHidden, children: collapsible ? /* @__PURE__ */ jsx(SidebarTooltipScopeContext.Provider, { value: true, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 200, skipDelayDuration: 400, children }) }) : children })
3871
+ children: /* @__PURE__ */ jsx(SidebarVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx(SidebarLabelsHiddenContext.Provider, { value: labelsHidden, children: collapsible ? /* @__PURE__ */ jsx(SidebarTooltipScopeContext.Provider, { value: true, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 200, skipDelayDuration: 400, children }) }) : children }) })
3868
3872
  }
3869
3873
  );
3870
3874
  });
@@ -4309,6 +4313,8 @@ var SidebarLinkGroup = React7.forwardRef(
4309
4313
  const reactId = React7.useId();
4310
4314
  const id = idProp ?? reactId;
4311
4315
  const scope = React7.useContext(SidebarGroupScopeContext);
4316
+ const variant = React7.useContext(SidebarVariantContext);
4317
+ const side = useDsDirection() === "rtl" ? "left" : "right";
4312
4318
  const [uncontrolledOpen, setUncontrolledOpen] = React7.useState(defaultOpen);
4313
4319
  const open = controlled ?? uncontrolledOpen;
4314
4320
  const setOpen = React7.useCallback(
@@ -4324,6 +4330,13 @@ var SidebarLinkGroup = React7.forwardRef(
4324
4330
  }
4325
4331
  }, [scope?.exclusiveId, id, open, setOpen]);
4326
4332
  const handleBodyClick = (e) => {
4333
+ if (flyoutEnabled && touchTap.current) {
4334
+ touchTap.current = false;
4335
+ e.preventDefault();
4336
+ clearTimeout(flyoutTimer.current);
4337
+ setFlyoutRequested(true);
4338
+ return;
4339
+ }
4327
4340
  onActivate?.(e);
4328
4341
  if (e.defaultPrevented) return;
4329
4342
  scope?.setExclusive(id);
@@ -4335,6 +4348,35 @@ var SidebarLinkGroup = React7.forwardRef(
4335
4348
  setOpen(!open);
4336
4349
  };
4337
4350
  const contentId = `${id}-content`;
4351
+ const flyoutId = `${id}-flyout`;
4352
+ const flyoutEnabled = labelsHidden && React7.Children.toArray(children).length > 0;
4353
+ const [flyoutRequested, setFlyoutRequested] = React7.useState(false);
4354
+ if (!flyoutEnabled && flyoutRequested) setFlyoutRequested(false);
4355
+ const flyoutOpen = flyoutEnabled && flyoutRequested;
4356
+ const linkRef = React7.useRef(null);
4357
+ const flyoutRef = React7.useRef(null);
4358
+ const flyoutTimer = React7.useRef(void 0);
4359
+ const touchTap = React7.useRef(false);
4360
+ const skipFocusOpen = React7.useRef(false);
4361
+ const setFlyoutSoon = (next, delay) => {
4362
+ clearTimeout(flyoutTimer.current);
4363
+ flyoutTimer.current = setTimeout(() => setFlyoutRequested(next), delay);
4364
+ };
4365
+ React7.useEffect(() => () => clearTimeout(flyoutTimer.current), []);
4366
+ const flyoutItems = () => Array.from(
4367
+ flyoutRef.current?.querySelectorAll(
4368
+ 'a[href],button:not([disabled]),[tabindex]:not([tabindex="-1"])'
4369
+ ) ?? []
4370
+ );
4371
+ const isTouch = (e) => e.pointerType === "touch";
4372
+ const flyoutHover = {
4373
+ onPointerEnter: (e) => {
4374
+ if (flyoutEnabled && !isTouch(e)) setFlyoutSoon(true, flyoutOpen ? 0 : 100);
4375
+ },
4376
+ onPointerLeave: (e) => {
4377
+ if (flyoutEnabled && !isTouch(e)) setFlyoutSoon(false, 200);
4378
+ }
4379
+ };
4338
4380
  const bodyClassName = cn(
4339
4381
  "ds:group/link ds:relative ds:flex ds:flex-1 ds:cursor-pointer ds:items-center ds:gap-2.5 ds:rounded-control ds:px-2.5 ds:py-1.5",
4340
4382
  "ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:px-0",
@@ -4377,14 +4419,35 @@ var SidebarLinkGroup = React7.forwardRef(
4377
4419
  }
4378
4420
  );
4379
4421
  const groupText = getTextContent(label) || void 0;
4422
+ const tree = /* @__PURE__ */ jsx("div", { className: "ds:border-rule ds:mt-px ds:ml-[18px] ds:border-l ds:pl-2", children });
4380
4423
  const bodyLink = /* @__PURE__ */ jsxs(
4381
4424
  "a",
4382
4425
  {
4426
+ ref: linkRef,
4383
4427
  href,
4384
4428
  "data-active": active || labelsHidden && activeDescendant ? "true" : void 0,
4385
4429
  "aria-current": active ? "page" : void 0,
4386
4430
  "aria-label": groupText,
4387
4431
  onClick: handleBodyClick,
4432
+ ...flyoutEnabled ? {
4433
+ "aria-expanded": flyoutOpen,
4434
+ "aria-controls": flyoutOpen ? flyoutId : void 0,
4435
+ ...flyoutHover,
4436
+ onPointerDown: (e) => {
4437
+ touchTap.current = e.pointerType !== "mouse" && !flyoutOpen;
4438
+ },
4439
+ onFocus: () => {
4440
+ if (skipFocusOpen.current) skipFocusOpen.current = false;
4441
+ else setFlyoutSoon(true, 0);
4442
+ },
4443
+ onKeyDown: (e) => {
4444
+ if (e.key !== "Tab" || e.shiftKey || !flyoutOpen) return;
4445
+ const first = flyoutItems()[0];
4446
+ if (!first) return;
4447
+ e.preventDefault();
4448
+ first.focus();
4449
+ }
4450
+ } : {},
4388
4451
  ...slot(sidebarAnatomy, "group-link"),
4389
4452
  className: bodyClassName,
4390
4453
  children: [
@@ -4402,32 +4465,99 @@ var SidebarLinkGroup = React7.forwardRef(
4402
4465
  className: cn("ds:mb-px", className),
4403
4466
  ...props,
4404
4467
  children: /* @__PURE__ */ jsxs(Collapsible, { open, onOpenChange: setOpen, children: [
4405
- /* @__PURE__ */ jsxs("div", { className: cn("ds:flex ds:items-stretch", classNames?.row), children: [
4406
- /* @__PURE__ */ jsx(SidebarRailTooltip, { label: groupText, children: bodyLink }),
4407
- /* @__PURE__ */ jsx(
4408
- "button",
4409
- {
4410
- type: "button",
4411
- "aria-expanded": open,
4412
- "aria-controls": contentId,
4413
- "aria-label": open ? messages.collapseSection : messages.expandSection,
4414
- onClick: handleChevronClick,
4415
- ...slot(sidebarAnatomy, "group-trigger"),
4416
- className: cn(
4417
- "ds:ml-px ds:inline-flex ds:size-7 ds:shrink-0 ds:cursor-pointer ds:items-center ds:justify-center ds:rounded-control",
4418
- "ds:text-fg-4 ds:hover:bg-bg-3 ds:hover:text-fg-2",
4419
- "ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none",
4420
- "ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none",
4421
- FORCED_COLORS_FOCUS,
4422
- "ds:[&_svg]:size-3.5 ds:[&_svg]:shrink-0 ds:[&_svg]:transition-transform ds:[&_svg]:duration-[var(--duration-fast)] ds:[&_svg]:ease-[var(--ease-out-quart)] ds:motion-reduce:[&_svg]:transition-none",
4423
- // Hide in rail — content tree is hidden too, so the
4424
- // affordance has nothing to control.
4425
- "ds:group-data-[labels=hide]/sidebar:hidden"
4426
- ),
4427
- children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: open ? "" : "ds:-rotate-90" })
4428
- }
4429
- )
4430
- ] }),
4468
+ /* @__PURE__ */ jsxs(
4469
+ Popover,
4470
+ {
4471
+ open: flyoutOpen,
4472
+ onOpenChange: (next) => {
4473
+ if (next) return;
4474
+ clearTimeout(flyoutTimer.current);
4475
+ setFlyoutRequested(false);
4476
+ },
4477
+ children: [
4478
+ /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: cn("ds:flex ds:items-stretch", classNames?.row), children: [
4479
+ /* @__PURE__ */ jsx(SidebarRailTooltip, { label: groupText, suppressed: flyoutEnabled, children: bodyLink }),
4480
+ /* @__PURE__ */ jsx(
4481
+ "button",
4482
+ {
4483
+ type: "button",
4484
+ "aria-expanded": open,
4485
+ "aria-controls": contentId,
4486
+ "aria-label": open ? messages.collapseSection : messages.expandSection,
4487
+ onClick: handleChevronClick,
4488
+ ...slot(sidebarAnatomy, "group-trigger"),
4489
+ className: cn(
4490
+ "ds:ml-px ds:inline-flex ds:size-7 ds:shrink-0 ds:cursor-pointer ds:items-center ds:justify-center ds:rounded-control",
4491
+ "ds:text-fg-4 ds:hover:bg-bg-3 ds:hover:text-fg-2",
4492
+ "ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none",
4493
+ "ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none",
4494
+ FORCED_COLORS_FOCUS,
4495
+ "ds:[&_svg]:size-3.5 ds:[&_svg]:shrink-0 ds:[&_svg]:transition-transform ds:[&_svg]:duration-[var(--duration-fast)] ds:[&_svg]:ease-[var(--ease-out-quart)] ds:motion-reduce:[&_svg]:transition-none",
4496
+ // Hide in rail — content tree is hidden too, so the
4497
+ // affordance has nothing to control.
4498
+ "ds:group-data-[labels=hide]/sidebar:hidden"
4499
+ ),
4500
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: open ? "" : "ds:-rotate-90" })
4501
+ }
4502
+ )
4503
+ ] }) }),
4504
+ flyoutOpen ? /* @__PURE__ */ jsx(
4505
+ PopoverContent,
4506
+ {
4507
+ ref: flyoutRef,
4508
+ id: flyoutId,
4509
+ role: "group",
4510
+ "aria-label": groupText,
4511
+ side,
4512
+ align: "start",
4513
+ sideOffset: 16,
4514
+ width: "auto",
4515
+ padding: "sm",
4516
+ className: "ds:min-w-48",
4517
+ ...flyoutHover,
4518
+ onOpenAutoFocus: (e) => e.preventDefault(),
4519
+ onCloseAutoFocus: (e) => e.preventDefault(),
4520
+ onFocusOutside: (e) => {
4521
+ if (e.target instanceof Node && linkRef.current?.contains(e.target)) e.preventDefault();
4522
+ },
4523
+ onPointerDownOutside: (e) => {
4524
+ if (e.target instanceof Node && linkRef.current?.contains(e.target)) e.preventDefault();
4525
+ },
4526
+ onEscapeKeyDown: () => {
4527
+ if (!flyoutRef.current?.contains(document.activeElement)) return;
4528
+ skipFocusOpen.current = true;
4529
+ linkRef.current?.focus();
4530
+ },
4531
+ onClickCapture: () => setFlyoutSoon(false, 0),
4532
+ onKeyDown: (e) => {
4533
+ if (e.key !== "Tab") return;
4534
+ const items = flyoutItems();
4535
+ const edge = e.shiftKey ? items[0] : items.at(-1);
4536
+ if (document.activeElement !== edge) return;
4537
+ if (e.shiftKey) e.preventDefault();
4538
+ linkRef.current?.focus();
4539
+ },
4540
+ children: /* @__PURE__ */ jsx(SidebarLabelsHiddenContext.Provider, { value: false, children: /* @__PURE__ */ jsxs("div", { "data-variant": variant, "data-labels": "show", "data-flyout": "true", className: "ds:group/sidebar group/sidebar", children: [
4541
+ /* @__PURE__ */ jsx(
4542
+ SidebarLink,
4543
+ {
4544
+ ...href !== void 0 && { href },
4545
+ active,
4546
+ onClick: (e) => onActivate?.(e),
4547
+ className: cn(
4548
+ "ds:mb-1 ds:min-h-0 ds:py-1 ds:text-overline ds:tracking-widest ds:text-fg-3 ds:uppercase",
4549
+ "ds:hover:bg-transparent ds:hover:text-fg ds:data-[active=true]:bg-transparent ds:data-[active=true]:text-brand"
4550
+ ),
4551
+ children: label
4552
+ }
4553
+ ),
4554
+ children
4555
+ ] }) })
4556
+ }
4557
+ ) : null
4558
+ ]
4559
+ }
4560
+ ),
4431
4561
  /* @__PURE__ */ jsx(
4432
4562
  CollapsibleContent,
4433
4563
  {
@@ -4440,7 +4570,7 @@ var SidebarLinkGroup = React7.forwardRef(
4440
4570
  // left edge.
4441
4571
  "ds:group-data-[labels=hide]/sidebar:hidden"
4442
4572
  ),
4443
- children: /* @__PURE__ */ jsx("div", { className: "ds:border-rule ds:mt-px ds:ml-[18px] ds:border-l ds:pl-2", children })
4573
+ children: tree
4444
4574
  }
4445
4575
  )
4446
4576
  ] })
@@ -4869,5 +4999,5 @@ var BrandScope = forwardRef(function BrandScope2({ product, children, ...props }
4869
4999
  BrandScope.displayName = "BrandScope";
4870
5000
 
4871
5001
  export { AgreementPaneHeading, AgreementViewer, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, BRAND_PRODUCTS, BrandScope, BrandScopeProvider, Chip, ClientSelect, CmdkCompatContext, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComingSoon, DEFAULT_COMBOBOX_MESSAGES, Grid, Logo, PlainLink, ProposalAddOn, ProposalBillingTerms, ProposalConsentGate, ProposalCustomPage, ProposalNote, ProposalPackageCard, ProposalPaymentCapture, ProposalPricingSummary, ProposalServiceRow, ProposalSignatureBlock, ProposalSignerList, QUESTION_TYPES, QUESTION_TYPE_CONTRACT_VERSION, Questions, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarBrand, SidebarBrandSwitcher, SidebarBrandSwitcherTile, SidebarBrandText, SidebarDrawer, SidebarFooter, SidebarLink, SidebarLinkAction, SidebarLinkBadge, SidebarLinkGroup, SidebarLinkLabel, SidebarPinButton, SidebarProvider, SidebarSection, SidebarTrigger, SidebarUser, TaxSoftwareLogo, assetPath, brandLabel, brandScope, chipVariants, getAssetBasePath, resolveChipStyle, setAssetBasePath, sidebarLinkBadgeVariants, useBrandScope, useSidebarPeekLock, useSidebarState };
4872
- //# sourceMappingURL=chunk-GT7A7HP4.js.map
4873
- //# sourceMappingURL=chunk-GT7A7HP4.js.map
5002
+ //# sourceMappingURL=chunk-KECAJHC5.js.map
5003
+ //# sourceMappingURL=chunk-KECAJHC5.js.map