@caratlogic/design-system 0.1.48 → 0.1.49
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/components/molecules/DropdownMenu/DropdownMenu.parts.d.ts +4 -0
- package/dist/components/molecules/DropdownMenu/DropdownMenu.parts.d.ts.map +1 -1
- package/dist/index.cjs.js +11 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +11 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
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"}
|
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
|
-
|
|
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 =
|