@caratlogic/design-system 0.1.48 → 0.1.50

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.
@@ -8,11 +8,15 @@ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubPro
8
8
  declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
9
  declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
10
  inset?: boolean;
11
+ /** Shown in a tooltip while `disabled`. */
12
+ disabledReason?: string;
11
13
  } & React.RefAttributes<HTMLDivElement>>;
12
14
  declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
15
  declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
16
  declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
17
  inset?: boolean;
18
+ /** Shown in a tooltip while `disabled`. */
19
+ disabledReason?: string;
16
20
  } & React.RefAttributes<HTMLDivElement>>;
17
21
  declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
22
  declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.parts.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/DropdownMenu/DropdownMenu.parts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAKvE,QAAA,MAAM,YAAY,mDAA6B,CAAC;AAChD,QAAA,MAAM,mBAAmB,0HAAgC,CAAC;AAC1D,QAAA,MAAM,iBAAiB,qHAA8B,CAAC;AACtD,QAAA,MAAM,kBAAkB,yDAA+B,CAAC;AACxD,QAAA,MAAM,eAAe,sDAA4B,CAAC;AAClD,QAAA,MAAM,sBAAsB,0HAAmC,CAAC;AAEhE,QAAA,MAAM,sBAAsB;YAGhB,OAAO;wCAejB,CAAC;AAIH,QAAA,MAAM,sBAAsB,6KAY1B,CAAC;AAIH,QAAA,MAAM,mBAAmB,0KAevB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGV,OAAO;wCAYjB,CAAC;AAGH,QAAA,MAAM,wBAAwB,+KAoB5B,CAAC;AAIH,QAAA,MAAM,qBAAqB,4KAmBzB,CAAC;AAGH,QAAA,MAAM,iBAAiB;YAGX,OAAO;wCAYjB,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KASzB,CAAC;AAGH,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAWzE,CAAC;AAGF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,CAAC"}
1
+ {"version":3,"file":"DropdownMenu.parts.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/DropdownMenu/DropdownMenu.parts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAWvE,QAAA,MAAM,YAAY,mDAA6B,CAAC;AAChD,QAAA,MAAM,mBAAmB,0HAAgC,CAAC;AAC1D,QAAA,MAAM,iBAAiB,qHAA8B,CAAC;AACtD,QAAA,MAAM,kBAAkB,yDAA+B,CAAC;AACxD,QAAA,MAAM,eAAe,sDAA4B,CAAC;AAClD,QAAA,MAAM,sBAAsB,0HAAmC,CAAC;AAwBhE,QAAA,MAAM,sBAAsB;YAGhB,OAAO;IACf,2CAA2C;qBAC1B,MAAM;wCAmB1B,CAAC;AAIF,QAAA,MAAM,sBAAsB,6KAY1B,CAAC;AAIH,QAAA,MAAM,mBAAmB,0KAevB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGV,OAAO;IACf,2CAA2C;qBAC1B,MAAM;wCAgB1B,CAAC;AAGF,QAAA,MAAM,wBAAwB,+KAoB5B,CAAC;AAIH,QAAA,MAAM,qBAAqB,4KAmBzB,CAAC;AAGH,QAAA,MAAM,iBAAiB;YAGX,OAAO;wCAYjB,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KASzB,CAAC;AAGH,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAWzE,CAAC;AAGF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","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EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAQxD;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAa7D;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAa/D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -42741,7 +42741,16 @@ const DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
42741
42741
  const DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
42742
42742
  const DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
42743
42743
  const DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
42744
- const DropdownMenuSubTrigger = React__namespace.forwardRef(({ className, inset, children, ...props }, ref) => (jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.SubTrigger, { ref: ref, className: cn('flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props, children: [children, jsxRuntime.jsx(ChevronRight, { className: "ml-auto", "aria-hidden": "true" })] })));
42744
+ /**
42745
+ * A disabled item ignores the pointer, so the tooltip hangs off a wrapper.
42746
+ * Without a reason, a greyed-out item reads as a bug.
42747
+ */
42748
+ function withDisabledReason(item, disabled, reason) {
42749
+ if (!disabled || !reason)
42750
+ return item;
42751
+ return (jsxRuntime.jsx(TooltipProvider, { children: jsxRuntime.jsxs(Tooltip, { children: [jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: jsxRuntime.jsx("div", { className: "cursor-not-allowed", children: item }) }), jsxRuntime.jsx(TooltipContent, { side: "left", children: reason })] }) }));
42752
+ }
42753
+ const DropdownMenuSubTrigger = React__namespace.forwardRef(({ className, inset, children, disabledReason, ...props }, ref) => withDisabledReason(jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.SubTrigger, { ref: ref, className: cn('flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props, children: [children, jsxRuntime.jsx(ChevronRight, { className: "ml-auto", "aria-hidden": "true" })] }), props.disabled, disabledReason));
42745
42754
  DropdownMenuSubTrigger.displayName =
42746
42755
  DropdownMenuPrimitive__namespace.SubTrigger.displayName;
42747
42756
  const DropdownMenuSubContent = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx(DropdownMenuPrimitive__namespace.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg flex flex-col gap-1 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props })));
@@ -42749,7 +42758,7 @@ DropdownMenuSubContent.displayName =
42749
42758
  DropdownMenuPrimitive__namespace.SubContent.displayName;
42750
42759
  const DropdownMenuContent = React__namespace.forwardRef(({ className, sideOffset = 8, ...props }, ref) => (jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[12rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md flex flex-col gap-1 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));
42751
42760
  DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
42752
- const DropdownMenuItem = React__namespace.forwardRef(({ className, inset, ...props }, ref) => (jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Item, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center gap-2 rounded-sm p-2 text-sm leading-5 outline-none transition-colors focus:bg-secondary dark:focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props })));
42761
+ const DropdownMenuItem = React__namespace.forwardRef(({ className, inset, disabledReason, ...props }, ref) => withDisabledReason(jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Item, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center gap-2 rounded-sm p-2 text-sm leading-5 outline-none transition-colors focus:bg-secondary dark:focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props }), props.disabled, disabledReason));
42753
42762
  DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
42754
42763
  const DropdownMenuCheckboxItem = React__namespace.forwardRef(({ className, children, checked, ...props }, ref) => (jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.CheckboxItem, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center gap-2 rounded-sm p-2 pl-8 text-sm leading-5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: jsxRuntime.jsx(Check, { className: "h-4 w-4", "aria-hidden": "true" }) }) }), children] })));
42755
42764
  DropdownMenuCheckboxItem.displayName =
@@ -42859,14 +42868,22 @@ searchPlaceholder = 'Search...', emptyMessage = 'No options available', ...props
42859
42868
  const searchCtx = useSelectSearchContext();
42860
42869
  const searchTerm = searchCtx?.searchTerm ?? '';
42861
42870
  const setSearchTerm = searchCtx?.setSearchTerm;
42871
+ const searchInputRef = React__namespace.useRef(null);
42862
42872
  // Clear search when the content unmounts (safety)
42863
42873
  React__namespace.useEffect(() => {
42864
42874
  return () => setSearchTerm?.('');
42865
42875
  }, [setSearchTerm]);
42866
42876
  return (jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: jsxRuntime.jsxs(SelectPrimitive__namespace.Content, { "data-slot": "select-content", className: cn('bg-card cursor-pointer text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border shadow-[0_10px_15px_-3px_rgba(0,0,0,0.10),0_4px_6px_-4px_rgba(0,0,0,0.10)]', position === 'popper' &&
42867
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [searchable && (jsxRuntime.jsx("div", { className: "p-2 pb-1", children: jsxRuntime.jsxs("div", { className: "flex h-9 w-full items-center gap-2 rounded-lg bg-secondary px-3", children: [jsxRuntime.jsx(Search, { className: "h-4 w-4 shrink-0 text-[#737373]", "aria-hidden": "true" }), jsxRuntime.jsx("input", { type: "search", className: "min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-placeholder", placeholder: searchPlaceholder, value: searchTerm, onChange: (e) => setSearchTerm?.(e.target.value),
42877
+ 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [searchable && (jsxRuntime.jsx("div", { className: "p-2 pb-1", children: jsxRuntime.jsxs("div", { className: "flex h-9 w-full items-center gap-2 rounded-lg bg-secondary px-3", children: [jsxRuntime.jsx(Search, { className: "h-4 w-4 shrink-0 text-[#737373]", "aria-hidden": "true" }), jsxRuntime.jsx("input", { ref: searchInputRef, type: "search", className: "min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-placeholder", placeholder: searchPlaceholder, value: searchTerm, onChange: (e) => setSearchTerm?.(e.target.value),
42868
42878
  // prevent keys from interfering with Radix keyboard nav
42869
- onKeyDown: (e) => e.stopPropagation() })] }) })), jsxRuntime.jsx(SelectScrollUpButton, {}), jsxRuntime.jsx(SelectPrimitive__namespace.Viewport, { "data-slot": "select-viewport", style: {
42879
+ onKeyDown: (e) => e.stopPropagation(),
42880
+ // When the search hides the selected item, Radix moves focus to
42881
+ // the list itself; keep it in the search box so typing goes on.
42882
+ onBlur: (e) => {
42883
+ if (e.relatedTarget?.getAttribute('role') === 'listbox') {
42884
+ searchInputRef.current?.focus();
42885
+ }
42886
+ } })] }) })), jsxRuntime.jsx(SelectScrollUpButton, {}), jsxRuntime.jsx(SelectPrimitive__namespace.Viewport, { "data-slot": "select-viewport", style: {
42870
42887
  '--select-empty-message': JSON.stringify(searchTerm ? 'No matching options' : emptyMessage),
42871
42888
  }, className: cn('p-1 max-h-[12.5rem] overflow-y-auto', 'empty:after:block empty:after:px-2 empty:after:py-4 empty:after:text-center empty:after:text-sm empty:after:text-muted-foreground empty:after:content-(--select-empty-message)', position === 'popper' &&
42872
42889
  'w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1'), children: children }), jsxRuntime.jsx(SelectScrollDownButton, {})] }) }));