@sqlrooms/ui 0.27.0-rc.5 → 0.27.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/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +2 -2
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/copy-button.d.ts +2 -1
- package/dist/components/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button.js +9 -6
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/table.js +2 -2
- package/dist/components/table.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export { Checkbox };
|
|
5
5
|
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,QAAQ,iKAkBZ,CAAC;AAGH,OAAO,EAAC,QAAQ,EAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
4
|
import { Check } from 'lucide-react';
|
|
5
|
+
import * as React from 'react';
|
|
6
6
|
import { cn } from '../lib/utils';
|
|
7
|
-
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn('border-primary focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border shadow focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn('flex items-center justify-center text-current'), children: _jsx(Check, { className: "h-
|
|
7
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn('border-primary focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border p-0 align-middle leading-none shadow focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn('flex items-center justify-center text-current'), children: _jsx(Check, { className: "h-3.5 w-3.5" }) }) })));
|
|
8
8
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
9
9
|
export { Checkbox };
|
|
10
10
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,KAAC,iBAAiB,CAAC,IAAI,IACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,kSAAkS,EAClS,SAAS,CACV,KACG,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,IAC1B,SAAS,EAAE,EAAE,CAAC,+CAA+C,CAAC,YAE9D,KAAC,KAAK,IAAC,SAAS,EAAC,aAAa,GAAG,GACL,GACP,CAC1B,CAAC,CAAC;AACH,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC;AAE1D,OAAO,EAAC,QAAQ,EAAC,CAAC","sourcesContent":["'use client';\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport {Check} from 'lucide-react';\nimport * as React from 'react';\n\nimport {cn} from '../lib/utils';\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({className, ...props}, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'border-primary focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border p-0 align-middle leading-none shadow focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn('flex items-center justify-center text-current')}\n >\n <Check className=\"h-3.5 w-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport {Checkbox};\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ButtonProps } from './button';
|
|
3
3
|
export interface CopyButtonProps {
|
|
4
|
-
text: string;
|
|
4
|
+
text: string | (() => string);
|
|
5
5
|
variant?: ButtonProps['variant'];
|
|
6
6
|
size?: ButtonProps['size'];
|
|
7
7
|
className?: string;
|
|
8
|
+
tooltipLabel?: string;
|
|
8
9
|
ariaLabel?: string;
|
|
9
10
|
durationMs?: number;
|
|
10
11
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../src/components/copy-button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../src/components/copy-button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,UAAU,CAAC;AAGlD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsEhD,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, CopyIcon } from 'lucide-react';
|
|
3
4
|
import * as React from 'react';
|
|
4
|
-
import { Button } from './button';
|
|
5
|
-
import { ClipboardIcon, CheckIcon } from 'lucide-react';
|
|
6
5
|
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
6
|
+
import { Button } from './button';
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip';
|
|
8
|
+
export const CopyButton = ({ text, variant = 'ghost', size = 'icon', className, tooltipLabel = 'Copy to clipboard', ariaLabel: ariaLabelProp, durationMs = 1500, disabled = false, onCopied, }) => {
|
|
9
|
+
const ariaLabel = ariaLabelProp ?? tooltipLabel;
|
|
8
10
|
const [copied, setCopied] = React.useState(false);
|
|
9
11
|
const timeoutRef = React.useRef(null);
|
|
10
12
|
React.useEffect(() => {
|
|
@@ -16,7 +18,8 @@ export const CopyButton = ({ text, variant = 'ghost', size = 'icon', className,
|
|
|
16
18
|
}, []);
|
|
17
19
|
const handleClick = async () => {
|
|
18
20
|
try {
|
|
19
|
-
|
|
21
|
+
const textToCopy = typeof text === 'function' ? text() : text;
|
|
22
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
20
23
|
setCopied(true);
|
|
21
24
|
if (typeof onCopied === 'function')
|
|
22
25
|
onCopied();
|
|
@@ -26,6 +29,6 @@ export const CopyButton = ({ text, variant = 'ghost', size = 'icon', className,
|
|
|
26
29
|
// no-op
|
|
27
30
|
}
|
|
28
31
|
};
|
|
29
|
-
return (_jsx(Button, { variant: variant, size: size, className: className, "aria-label": ariaLabel, type: "button", disabled: disabled, onClick: handleClick, children: _jsx("span", { className: cn('inline-flex items-center justify-center transition-all duration-150', copied ? 'scale-110 opacity-100' : 'opacity-90'), children: copied ? (_jsx(CheckIcon, { className: "h-4 w-4 text-green-500" })) : (_jsx(
|
|
32
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: variant, size: size, className: cn('text-muted-foreground hover:text-foreground transition-text h-8 w-8 duration-200', className), "aria-label": ariaLabel, type: "button", disabled: disabled, onClick: handleClick, children: _jsx("span", { className: cn('inline-flex items-center justify-center transition-all duration-150', copied ? 'scale-110 opacity-100' : 'opacity-90'), children: copied ? (_jsx(CheckIcon, { className: "h-4 w-4 text-green-500" })) : (_jsx(CopyIcon, { className: "h-4 w-4" })) }) }) }), _jsx(TooltipContent, { children: tooltipLabel })] }));
|
|
30
33
|
};
|
|
31
34
|
//# sourceMappingURL=copy-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button.js","sourceRoot":"","sources":["../../src/components/copy-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"copy-button.js","sourceRoot":"","sources":["../../src/components/copy-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,MAAM,EAAmB,MAAM,UAAU,CAAC;AAClD,OAAO,EAAC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AAclE,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,IAAI,EACJ,OAAO,GAAG,OAAO,EACjB,IAAI,GAAG,MAAM,EACb,SAAS,EACT,YAAY,GAAG,mBAAmB,EAClC,SAAS,EAAE,aAAa,EACxB,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,aAAa,IAAI,YAAY,CAAC;IAChD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,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,CAAC,YAAY,CAChD,YAEA,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,SAAS,IAAC,SAAS,EAAC,wBAAwB,GAAG,CACjD,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,SAAS,EAAC,SAAS,GAAG,CACjC,GACI,GACA,GACM,EACjB,KAAC,cAAc,cAAE,YAAY,GAAkB,IACvC,CACX,CAAC;AACJ,CAAC,CAAC","sourcesContent":["'use client';\n\nimport {CheckIcon, CopyIcon} from 'lucide-react';\nimport * as React from 'react';\nimport {cn} from '../lib/utils';\nimport {Button, type ButtonProps} from './button';\nimport {Tooltip, TooltipContent, TooltipTrigger} from './tooltip';\n\nexport interface CopyButtonProps {\n text: string | (() => string);\n variant?: ButtonProps['variant'];\n size?: ButtonProps['size'];\n className?: string;\n tooltipLabel?: string;\n ariaLabel?: string;\n durationMs?: number;\n disabled?: boolean;\n onCopied?: () => void;\n}\n\nexport const CopyButton: React.FC<CopyButtonProps> = ({\n text,\n variant = 'ghost',\n size = 'icon',\n className,\n tooltipLabel = 'Copy to clipboard',\n ariaLabel: ariaLabelProp,\n durationMs = 1500,\n disabled = false,\n onCopied,\n}) => {\n const ariaLabel = ariaLabelProp ?? tooltipLabel;\n const [copied, setCopied] = React.useState(false);\n const timeoutRef = React.useRef<number | null>(null);\n\n React.useEffect(() => {\n return () => {\n if (timeoutRef.current !== null) {\n window.clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n const handleClick = async () => {\n try {\n const textToCopy = typeof text === 'function' ? text() : text;\n await navigator.clipboard.writeText(textToCopy);\n setCopied(true);\n if (typeof onCopied === 'function') onCopied();\n timeoutRef.current = window.setTimeout(\n () => setCopied(false),\n durationMs,\n );\n } catch (e) {\n // no-op\n }\n };\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant={variant}\n size={size}\n className={cn(\n 'text-muted-foreground hover:text-foreground transition-text h-8 w-8 duration-200',\n className,\n )}\n aria-label={ariaLabel}\n type=\"button\"\n disabled={disabled}\n onClick={handleClick}\n >\n <span\n className={cn(\n 'inline-flex items-center justify-center transition-all duration-150',\n copied ? 'scale-110 opacity-100' : 'opacity-90',\n )}\n >\n {copied ? (\n <CheckIcon className=\"h-4 w-4 text-green-500\" />\n ) : (\n <CopyIcon className=\"h-4 w-4\" />\n )}\n </span>\n </Button>\n </TooltipTrigger>\n <TooltipContent>{tooltipLabel}</TooltipContent>\n </Tooltip>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACjE;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,KAAK,qFAiBV,CAAC;AAGF,QAAA,MAAM,WAAW,+HAKf,CAAC;AAGH,QAAA,MAAM,SAAS,+HASb,CAAC;AAGH,QAAA,MAAM,WAAW,+HAYf,CAAC;AAGH,QAAA,MAAM,QAAQ,uHAYZ,CAAC;AAGH,QAAA,MAAM,SAAS,2HAYb,CAAC;AAGH,QAAA,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACjE;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,KAAK,qFAiBV,CAAC;AAGF,QAAA,MAAM,WAAW,+HAKf,CAAC;AAGH,QAAA,MAAM,SAAS,+HASb,CAAC;AAGH,QAAA,MAAM,WAAW,+HAYf,CAAC;AAGH,QAAA,MAAM,QAAQ,uHAYZ,CAAC;AAGH,QAAA,MAAM,SAAS,2HAYb,CAAC;AAGH,QAAA,MAAM,SAAS,2HASb,CAAC;AAGH,QAAA,MAAM,YAAY,+HAShB,CAAC;AAGH,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,CAAC"}
|
package/dist/components/table.js
CHANGED
|
@@ -11,9 +11,9 @@ const TableFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("tf
|
|
|
11
11
|
TableFooter.displayName = 'TableFooter';
|
|
12
12
|
const TableRow = React.forwardRef(({ className, ...props }, ref) => (_jsx("tr", { ref: ref, className: cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors', className), ...props })));
|
|
13
13
|
TableRow.displayName = 'TableRow';
|
|
14
|
-
const TableHead = React.forwardRef(({ className, ...props }, ref) => (_jsx("th", { ref: ref, className: cn('text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0
|
|
14
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => (_jsx("th", { ref: ref, className: cn('text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has(>[role=checkbox])]:pr-0', className), ...props })));
|
|
15
15
|
TableHead.displayName = 'TableHead';
|
|
16
|
-
const TableCell = React.forwardRef(({ className, ...props }, ref) => (_jsx("td", { ref: ref, className: cn('p-2 align-middle [&:has([role=checkbox])]:pr-0
|
|
16
|
+
const TableCell = React.forwardRef(({ className, ...props }, ref) => (_jsx("td", { ref: ref, className: cn('p-2 align-middle [&:has(>[role=checkbox])]:pr-0', className), ...props })));
|
|
17
17
|
TableCell.displayName = 'TableCell';
|
|
18
18
|
const TableCaption = React.forwardRef(({ className, ...props }, ref) => (_jsx("caption", { ref: ref, className: cn('text-muted-foreground mt-4 text-sm', className), ...props })));
|
|
19
19
|
TableCaption.displayName = 'TableCaption';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot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AElC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,aACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,mGAAmG,EACnG,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,aACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,iDAAiD,EAAE,SAAS,CAAC,KACvE,KAAK,GACT,CACH,CAAC,CAAC;AACH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAGnC,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,kBACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {cn} from '../lib/utils';\n\ninterface TableProps extends React.HTMLAttributes<HTMLTableElement> {\n /**\n * The overflow-auto in shadcn's Table component is there to handle tables that might be wider\n * than their container - it's a common pattern to ensure wide tables can be scrolled horizontally\n * without breaking the layout. This prop allows you to disable this behavior, because it might\n * cause issues with sticky headers.\n */\n disableWrapper?: boolean;\n}\n\nconst Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({className, disableWrapper, ...props}, ref) =>\n disableWrapper ? (\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm', className)}\n {...props}\n />\n ) : (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm', className)}\n {...props}\n />\n </div>\n ),\n);\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({className, ...props}, ref) => (\n <thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({className, ...props}, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({className, ...props}, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'bg-muted/50 border-t font-medium [&>tr]:last:border-b-0',\n className,\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({className, ...props}, ref) => (\n <tr\n ref={ref}\n className={cn(\n 'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors',\n className,\n )}\n {...props}\n />\n));\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({className, ...props}, ref) => (\n <th\n ref={ref}\n className={cn(\n 'text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has(>[role=checkbox])]:pr-0',\n className,\n )}\n {...props}\n />\n));\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({className, ...props}, ref) => (\n <td\n ref={ref}\n className={cn('p-2 align-middle [&:has(>[role=checkbox])]:pr-0', className)}\n {...props}\n />\n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({className, ...props}, ref) => (\n <caption\n ref={ref}\n className={cn('text-muted-foreground mt-4 text-sm', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/ui",
|
|
3
|
-
"version": "0.27.0
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"author": "SQLRooms Contributors",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"autoprefixer": "^10.4.20",
|
|
72
72
|
"tailwindcss": "^3.4.17"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "f215995ab4adeac4c58171739261a15cbba9e82b"
|
|
75
75
|
}
|