@wheelhouse/ui 0.2.10 → 0.2.12

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.
@@ -25,7 +25,7 @@ function ComboboxInput({ className, children, disabled = false, showTrigger = tr
25
25
  return (_jsxs(InputGroup, { className: cn('w-auto', className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, {}), "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent", disabled: disabled })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
26
26
  }
27
27
  function ComboboxContent({ className, side = 'bottom', sideOffset = 6, align = 'start', alignOffset = 0, anchor, ...props }) {
28
- return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn('group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props }) }) }));
28
+ return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn('group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props }) }) }));
29
29
  }
30
30
  function ComboboxList({ className, ...props }) {
31
31
  return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", className: cn('no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0', className), ...props }));
@@ -13,7 +13,7 @@ function CommandDialog({ title = 'Command Palette', description = 'Search for a
13
13
  return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0', className), showCloseButton: showCloseButton, children: children })] }));
14
14
  }
15
15
  function CommandInput({ className, ...props }) {
16
- return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className), ...props }), _jsx(InputGroupAddon, { children: _jsx(Search, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
16
+ return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className), ...props }), _jsx(InputGroupAddon, { children: _jsx(Search, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
17
17
  }
18
18
  function CommandList({ className, ...props }) {
19
19
  return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn('no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none', className), ...props }));
@@ -117,7 +117,7 @@ function FilterInput({ field, onBlur, onKeyDown, className, ...props }) {
117
117
  // Call the original onKeyDown if provided
118
118
  onKeyDown?.(e);
119
119
  };
120
- return (_jsxs(InputGroup, { className: cn('w-36', context.size == 'sm' && 'h-7!', context.size == 'default' && 'h-8!', context.size == 'lg' && 'h-9!', className), children: [field?.prefix && (_jsx(InputGroupAddon, { children: _jsx(InputGroupText, { children: field.prefix }) })), _jsx(InputGroupInput, { ref: inputRef, size: context.size, "aria-invalid": !isValid, "aria-describedby": !isValid && validationMessage ? `${field?.key || 'input'}-error` : undefined, onBlur: handleBlur, onKeyDown: handleKeyDown, ...props }), !isValid && validationMessage && (_jsx(InputGroupAddon, { align: "inline-end", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx(InputGroupButton, { size: "icon-xs" }), children: _jsx(AlertCircle, { className: "size-3.5 text-destructive" }) }), _jsx(TooltipContent, { children: _jsx("p", { className: "text-sm", children: validationMessage }) })] }) })), field?.suffix && (_jsx(InputGroupAddon, { align: "inline-end", children: _jsx(InputGroupText, { children: field.suffix }) }))] }));
120
+ return (_jsxs(InputGroup, { size: context.size, className: cn('w-36', className), children: [field?.prefix && (_jsx(InputGroupAddon, { children: _jsx(InputGroupText, { children: field.prefix }) })), _jsx(InputGroupInput, { ref: inputRef, size: context.size, "aria-invalid": !isValid, "aria-describedby": !isValid && validationMessage ? `${field?.key || 'input'}-error` : undefined, onBlur: handleBlur, onKeyDown: handleKeyDown, ...props }), !isValid && validationMessage && (_jsx(InputGroupAddon, { align: "inline-end", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx(InputGroupButton, { size: "icon-xs" }), children: _jsx(AlertCircle, { className: "size-3.5 text-destructive" }) }), _jsx(TooltipContent, { children: _jsx("p", { className: "text-sm", children: validationMessage }) })] }) })), field?.suffix && (_jsx(InputGroupAddon, { align: "inline-end", children: _jsx(InputGroupText, { children: field.suffix }) }))] }));
121
121
  }
122
122
  function FilterRemoveButton({ className, icon = _jsx(X, {}), ...props }) {
123
123
  const context = useFilterContext();
@@ -52,6 +52,7 @@ export * from './spinner';
52
52
  export * from './status-indicator';
53
53
  export * from './switch';
54
54
  export * from './tabs';
55
+ export * from './table';
55
56
  export * from './text';
56
57
  export * from './textarea';
57
58
  export * from './tooltip';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,c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C5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
@@ -52,6 +52,7 @@ export * from './spinner';
52
52
  export * from './status-indicator';
53
53
  export * from './switch';
54
54
  export * from './tabs';
55
+ export * from './table';
55
56
  export * from './text';
56
57
  export * from './textarea';
57
58
  export * from './tooltip';
@@ -1,3 +1,3 @@
1
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupAddonAlignKeys, inputGroupButtonSizeKeys, } from './input-group';
1
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupAddonAlignKeys, inputGroupButtonSizeKeys, inputGroupSizeKeys, inputGroupVariants, } from './input-group';
2
2
  export type { InputGroupProps, InputGroupAddonProps, InputGroupButtonProps, InputGroupTextProps, InputGroupInputProps, InputGroupTextareaProps, } from './input-group';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/input-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GAC3B,MAAM,eAAe,CAAC;AACvB,YAAY,EACR,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GAC1B,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/input-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EACR,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GAC1B,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupAddonAlignKeys, inputGroupButtonSizeKeys, } from './input-group';
1
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupAddonAlignKeys, inputGroupButtonSizeKeys, inputGroupSizeKeys, inputGroupVariants, } from './input-group';
@@ -3,8 +3,12 @@ import { type VariantProps } from 'class-variance-authority';
3
3
  import { Button } from '../button';
4
4
  import type { InputProps } from '../input';
5
5
  import type { TextareaProps } from '../textarea';
6
+ export declare const inputGroupSizeKeys: readonly ["sm", "default", "lg"];
7
+ declare const inputGroupVariants: (props?: ({
8
+ size?: "default" | "sm" | "lg" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
10
  /** Props for `InputGroup`. */
7
- export type InputGroupProps = React.ComponentProps<'div'>;
11
+ export type InputGroupProps = React.ComponentProps<'div'> & VariantProps<typeof inputGroupVariants>;
8
12
  declare const inputGroupAddonVariants: (props?: ({
9
13
  align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
10
14
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -27,8 +31,9 @@ export type InputGroupInputProps = InputProps;
27
31
  export type InputGroupTextareaProps = TextareaProps;
28
32
  /**
29
33
  * Wraps a control and addons in a single bordered, focus-styled shell. Set `data-disabled` on the root when the field is disabled.
34
+ * `size` sets shell height (`sm` = 28px, `default` = 32px, `lg` = 36px) and is inherited by `InputGroupInput` unless overridden there.
30
35
  */
31
- declare function InputGroup({ className, ...props }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
36
+ declare function InputGroup({ className, size, ...props }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
32
37
  /**
33
38
  * Static prefix or suffix (text, `Kbd`, icon, or `InputGroupButton`). Clicking the addon focuses the nested input unless the click target is a button.
34
39
  */
@@ -37,8 +42,8 @@ declare function InputGroupButton({ className, type, variant, size, ...props }:
37
42
  /** Muted inline label text inside an addon. */
38
43
  declare function InputGroupText({ className, ...props }: InputGroupTextProps): import("react/jsx-runtime").JSX.Element;
39
44
  /** Single-line control that shares the group border and focus ring. */
40
- declare function InputGroupInput({ className, ...props }: InputGroupInputProps): import("react/jsx-runtime").JSX.Element;
45
+ declare function InputGroupInput({ className, size: sizeProp, ...props }: InputGroupInputProps): import("react/jsx-runtime").JSX.Element;
41
46
  /** Multi-line control that shares the group border and focus ring. */
42
47
  declare function InputGroupTextarea({ className, ...props }: InputGroupTextareaProps): import("react/jsx-runtime").JSX.Element;
43
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, };
48
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants, };
44
49
  //# sourceMappingURL=input-group.d.ts.map
@@ -1 +1 @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uEAAuE;AACvE,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,2CAerF;AAED,sEAAsE;AACtE,iBAAS,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,2CAW3E;AAED,OAAO,EACH,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,GACrB,CAAC"}
@@ -4,9 +4,23 @@ import * as React from 'react';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { cn } from '../../lib/utils';
6
6
  import { Button } from '../button';
7
- import { Input } from '../input';
7
+ import { Input, inputSizeKeys } from '../input';
8
8
  import { Textarea } from '../textarea';
9
- const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
9
+ export const inputGroupSizeKeys = inputSizeKeys;
10
+ const InputGroupSizeContext = React.createContext(undefined);
11
+ const inputGroupVariants = cva('group/input-group relative flex w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5', {
12
+ variants: {
13
+ size: {
14
+ sm: 'h-7 rounded-[min(var(--radius-md),12px)]',
15
+ default: 'h-8',
16
+ lg: 'h-9',
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ size: 'default',
21
+ },
22
+ });
23
+ const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 group-data-[size=lg]/input-group:py-2 group-data-[size=sm]/input-group:py-1 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 group-data-[size=sm]/input-group:[&>svg:not([class*='size-'])]:size-3.5", {
10
24
  variants: {
11
25
  align: {
12
26
  'inline-start': 'order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]',
@@ -36,9 +50,11 @@ const inputGroupButtonVariants = cva('flex items-center gap-2 text-sm shadow-non
36
50
  export const inputGroupButtonSizeKeys = ['xs', 'sm', 'icon-xs', 'icon-sm'];
37
51
  /**
38
52
  * Wraps a control and addons in a single bordered, focus-styled shell. Set `data-disabled` on the root when the field is disabled.
53
+ * `size` sets shell height (`sm` = 28px, `default` = 32px, `lg` = 36px) and is inherited by `InputGroupInput` unless overridden there.
39
54
  */
40
- function InputGroup({ className, ...props }) {
41
- return (_jsx("div", { "data-slot": "input-group", role: "group", className: cn('group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5', className), ...props }));
55
+ function InputGroup({ className, size = 'default', ...props }) {
56
+ const resolvedSize = size ?? 'default';
57
+ return (_jsx(InputGroupSizeContext.Provider, { value: resolvedSize, children: _jsx("div", { "data-slot": "input-group", "data-size": resolvedSize, role: "group", className: cn(inputGroupVariants({ size: resolvedSize }), className), ...props }) }));
42
58
  }
43
59
  /**
44
60
  * Static prefix or suffix (text, `Kbd`, icon, or `InputGroupButton`). Clicking the addon focuses the nested input unless the click target is a button.
@@ -62,11 +78,13 @@ function InputGroupText({ className, ...props }) {
62
78
  return (_jsx("span", { className: cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className), ...props }));
63
79
  }
64
80
  /** Single-line control that shares the group border and focus ring. */
65
- function InputGroupInput({ className, ...props }) {
66
- return (_jsx(Input, { "data-slot": "input-group-control", className: cn('flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent', className), ...props }));
81
+ function InputGroupInput({ className, size: sizeProp, ...props }) {
82
+ const groupSize = React.useContext(InputGroupSizeContext);
83
+ const size = sizeProp ?? groupSize ?? 'default';
84
+ return (_jsx(Input, { "data-slot": "input-group-control", size: size, className: cn('h-full min-h-0 flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent', className), ...props }));
67
85
  }
68
86
  /** Multi-line control that shares the group border and focus ring. */
69
87
  function InputGroupTextarea({ className, ...props }) {
70
88
  return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn('flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent', className), ...props }));
71
89
  }
72
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, };
90
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants, };
@@ -7,10 +7,23 @@ declare const meta: {
7
7
  parameters: {
8
8
  layout: string;
9
9
  };
10
+ args: {
11
+ size: "default";
12
+ };
13
+ argTypes: {
14
+ size: {
15
+ control: "select";
16
+ options: readonly ["sm", "default", "lg"];
17
+ };
18
+ className: {
19
+ control: false;
20
+ };
21
+ };
10
22
  };
11
23
  export default meta;
12
24
  type Story = StoryObj<typeof meta>;
13
25
  export declare const Default: Story;
26
+ export declare const Sizes: Story;
14
27
  export declare const WithTrailingButton: Story;
15
28
  export declare const WithKbd: Story;
16
29
  export declare const Textarea: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.stories.d.ts","sourceRoot":"","sources":["../../../src/components/input-group/input-group.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,UAAU,EAA0F,MAAM,GAAG,CAAC;AAEvH,QAAA,MAAM,IAAI;;;;;;;CAOyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAahC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAmCrB,CAAC"}
1
+ {"version":3,"file":"input-group.stories.d.ts","sourceRoot":"","sources":["../../../src/components/input-group/input-group.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,UAAU,EAA8G,MAAM,GAAG,CAAC;AAE3I,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;CAcyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAuBnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAahC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAmCrB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Search } from 'lucide-react';
3
3
  import { Kbd } from '../kbd';
4
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from '.';
4
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, inputGroupSizeKeys, InputGroupText, InputGroupTextarea } from '.';
5
5
  const meta = {
6
6
  title: 'Components/InputGroup',
7
7
  component: InputGroup,
@@ -9,13 +9,23 @@ const meta = {
9
9
  parameters: {
10
10
  layout: 'centered',
11
11
  },
12
+ args: {
13
+ size: 'default',
14
+ },
15
+ argTypes: {
16
+ size: { control: 'select', options: inputGroupSizeKeys },
17
+ className: { control: false },
18
+ },
12
19
  };
13
20
  export default meta;
14
21
  export const Default = {
15
22
  render: () => (_jsx("div", { className: "w-80", children: _jsxs(InputGroup, { children: [_jsx(InputGroupAddon, { children: _jsx(InputGroupText, { children: "https://" }) }), _jsx(InputGroupInput, { placeholder: "example.com" })] }) })),
16
23
  };
24
+ export const Sizes = {
25
+ render: () => (_jsxs("div", { className: "flex w-80 flex-col gap-2", children: [_jsxs(InputGroup, { size: "sm", children: [_jsx(InputGroupAddon, { children: _jsx(InputGroupText, { children: "https://" }) }), _jsx(InputGroupInput, { placeholder: "Small (h-7)" })] }), _jsxs(InputGroup, { size: "default", children: [_jsx(InputGroupAddon, { children: _jsx(InputGroupText, { children: "https://" }) }), _jsx(InputGroupInput, { placeholder: "Default (h-8)" })] }), _jsxs(InputGroup, { size: "lg", children: [_jsx(InputGroupAddon, { children: _jsx(InputGroupText, { children: "https://" }) }), _jsx(InputGroupInput, { placeholder: "Large (h-9)" })] })] })),
26
+ };
17
27
  export const WithTrailingButton = {
18
- render: () => (_jsx("div", { className: "w-80", children: _jsxs(InputGroup, { children: [_jsx(InputGroupInput, { placeholder: "Search\u2026" }), _jsx(InputGroupAddon, { align: "inline-end", children: _jsx(InputGroupButton, { type: "button", "aria-label": "Search", children: _jsx(Search, { className: "size-4" }) }) })] }) })),
28
+ render: () => (_jsx("div", { className: "w-80", children: _jsxs(InputGroup, { children: [_jsx(InputGroupInput, { placeholder: "Search it all\u2026" }), _jsx(InputGroupAddon, { align: "inline-end", children: _jsx(InputGroupButton, { type: "button", "aria-label": "Search", children: _jsx(Search, { className: "size-4" }) }) })] }) })),
19
29
  };
20
30
  export const WithKbd = {
21
31
  render: () => (_jsx("div", { className: "w-80", children: _jsxs(InputGroup, { children: [_jsx(InputGroupInput, { placeholder: "Command\u2026" }), _jsxs(InputGroupAddon, { align: "inline-end", children: [_jsx(Kbd, { children: "\u2318" }), _jsx(Kbd, { children: "K" })] })] }) })),
@@ -0,0 +1,2 @@
1
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption } from './table';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption } from './table';
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ declare function Table({ className, ...props }: React.ComponentProps<'table'>): import("react/jsx-runtime").JSX.Element;
3
+ declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): import("react/jsx-runtime").JSX.Element;
4
+ declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): import("react/jsx-runtime").JSX.Element;
7
+ declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): import("react/jsx-runtime").JSX.Element;
8
+ declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): import("react/jsx-runtime").JSX.Element;
9
+ declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): import("react/jsx-runtime").JSX.Element;
10
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
11
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAMpE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAE1E;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAExE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAE1E;AAED,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAQpE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAQrE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAErE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,2CAE7E;AAED,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { cn } from '../../lib/utils';
4
+ function Table({ className, ...props }) {
5
+ return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn('w-full caption-bottom text-sm', className), ...props }) }));
6
+ }
7
+ function TableHeader({ className, ...props }) {
8
+ return _jsx("thead", { "data-slot": "table-header", className: cn('[&_tr]:border-b', className), ...props });
9
+ }
10
+ function TableBody({ className, ...props }) {
11
+ return _jsx("tbody", { "data-slot": "table-body", className: cn('[&_tr:last-child]:border-0', className), ...props });
12
+ }
13
+ function TableFooter({ className, ...props }) {
14
+ return _jsx("tfoot", { "data-slot": "table-footer", className: cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className), ...props });
15
+ }
16
+ function TableRow({ className, ...props }) {
17
+ return (_jsx("tr", { "data-slot": "table-row", className: cn('border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted', className), ...props }));
18
+ }
19
+ function TableHead({ className, ...props }) {
20
+ return (_jsx("th", { "data-slot": "table-head", className: cn('h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0', className), ...props }));
21
+ }
22
+ function TableCell({ className, ...props }) {
23
+ return _jsx("td", { "data-slot": "table-cell", className: cn('p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0', className), ...props });
24
+ }
25
+ function TableCaption({ className, ...props }) {
26
+ return _jsx("caption", { "data-slot": "table-caption", className: cn('mt-4 text-sm text-muted-foreground', className), ...props });
27
+ }
28
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { Table } from '.';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Table;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ argTypes: {
11
+ className: {
12
+ control: false;
13
+ };
14
+ };
15
+ };
16
+ export default meta;
17
+ type Story = StoryObj<typeof meta>;
18
+ export declare const Default: Story;
19
+ export declare const WithCaption: Story;
20
+ export declare const WithFooter: Story;
21
+ export declare const SelectedRow: Story;
22
+ export declare const Gallery: Story;
23
+ //# sourceMappingURL=table.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.stories.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAqF,MAAM,GAAG,CAAC;AA4C7G,QAAA,MAAM,IAAI;;;;;;;;;;;;CAUoB,CAAC;AAE/B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAMzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA2BzB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAuCrB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from '.';
3
+ const invoices = [
4
+ { invoice: 'INV001', status: 'Paid', method: 'Credit Card', amount: '$250.00' },
5
+ { invoice: 'INV002', status: 'Pending', method: 'PayPal', amount: '$150.00' },
6
+ { invoice: 'INV003', status: 'Unpaid', method: 'Bank Transfer', amount: '$350.00' },
7
+ { invoice: 'INV004', status: 'Paid', method: 'Credit Card', amount: '$450.00' },
8
+ { invoice: 'INV005', status: 'Paid', method: 'PayPal', amount: '$550.00' },
9
+ ];
10
+ function InvoiceTable({ showFooter = false, showCaption = false }) {
11
+ return (_jsxs(Table, { children: [showCaption && _jsx(TableCaption, { children: "A list of your recent invoices." }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-[100px]", children: "Invoice" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { children: "Method" }), _jsx(TableHead, { className: "text-right", children: "Amount" })] }) }), _jsx(TableBody, { children: invoices.map((invoice) => (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-medium", children: invoice.invoice }), _jsx(TableCell, { children: invoice.status }), _jsx(TableCell, { children: invoice.method }), _jsx(TableCell, { className: "text-right", children: invoice.amount })] }, invoice.invoice))) }), showFooter && (_jsx(TableFooter, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { colSpan: 3, children: "Total" }), _jsx(TableCell, { className: "text-right", children: "$1,750.00" })] }) }))] }));
12
+ }
13
+ const meta = {
14
+ title: 'Components/Table',
15
+ component: Table,
16
+ tags: ['autodocs'],
17
+ parameters: {
18
+ layout: 'padded',
19
+ },
20
+ argTypes: {
21
+ className: { control: false },
22
+ },
23
+ };
24
+ export default meta;
25
+ export const Default = {
26
+ render: () => (_jsx("div", { className: "w-full max-w-2xl", children: _jsx(InvoiceTable, {}) })),
27
+ };
28
+ export const WithCaption = {
29
+ render: () => (_jsx("div", { className: "w-full max-w-2xl", children: _jsx(InvoiceTable, { showCaption: true }) })),
30
+ };
31
+ export const WithFooter = {
32
+ render: () => (_jsx("div", { className: "w-full max-w-2xl", children: _jsx(InvoiceTable, { showFooter: true }) })),
33
+ };
34
+ export const SelectedRow = {
35
+ render: () => (_jsx("div", { className: "w-full max-w-2xl", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Name" }), _jsx(TableHead, { children: "Email" })] }) }), _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableCell, { children: "Ada Lovelace" }), _jsx(TableCell, { children: "ada@example.com" })] }), _jsxs(TableRow, { "data-state": "selected", children: [_jsx(TableCell, { children: "Alan Turing" }), _jsx(TableCell, { children: "alan@example.com" })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Grace Hopper" }), _jsx(TableCell, { children: "grace@example.com" })] })] })] }) })),
36
+ };
37
+ export const Gallery = {
38
+ parameters: { controls: { disable: true } },
39
+ render: () => (_jsxs("div", { className: "flex max-w-2xl flex-col gap-10", children: [_jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("p", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "Default" }), _jsx(InvoiceTable, {})] }), _jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("p", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "With caption" }), _jsx(InvoiceTable, { showCaption: true })] }), _jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("p", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "With footer" }), _jsx(InvoiceTable, { showFooter: true })] }), _jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("p", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "Selected row" }), _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Name" }), _jsx(TableHead, { children: "Role" })] }) }), _jsxs(TableBody, { children: [_jsxs(TableRow, { "data-state": "selected", children: [_jsx(TableCell, { children: "Selected row" }), _jsx(TableCell, { children: "Highlighted via data-state" })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Default row" }), _jsx(TableCell, { children: "Standard hover styles" })] })] })] })] })] })),
40
+ };
@@ -16,6 +16,6 @@ function TooltipTrigger({ ...props }) {
16
16
  return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
17
17
  }
18
18
  function TooltipContent({ className, side = 'top', sideOffset = 4, align = 'center', alignOffset = 0, showArrow = false, children, ...props }) {
19
- return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: cn('z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props, children: [children, showArrow && (_jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" }))] }) }) }));
19
+ return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: cn('z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-2 py-1 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props, children: [children, showArrow && (_jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" }))] }) }) }));
20
20
  }
21
21
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };