@sqlrooms/ui 0.29.0-rc.10 → 0.29.0-rc.11
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.
|
@@ -14,7 +14,7 @@ const CommandInput = React.forwardRef(({ className, ...props }, ref) => (_jsxs("
|
|
|
14
14
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
15
15
|
const CommandList = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.List, { ref: ref, className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props })));
|
|
16
16
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
17
|
-
const CommandEmpty = React.forwardRef((props, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className:
|
|
17
|
+
const CommandEmpty = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className: cn('py-6 text-center text-sm', className), ...props })));
|
|
18
18
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
19
19
|
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Group, { ref: ref, className: cn('text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium', className), ...props })));
|
|
20
20
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,MAAM,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CA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":["'use client';\n\nimport * as React from 'react';\nimport {type DialogProps} from '@radix-ui/react-dialog';\nimport {Command as CommandPrimitive} from 'cmdk';\nimport {Search} from 'lucide-react';\n\nimport {cn} from '../lib/utils';\nimport {Dialog, DialogContent} from './dialog';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({className, ...props}, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\nconst CommandDialog = ({children, ...props}: DialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <Command className=\"**:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({className, ...props}, ref) => (\n <div\n className=\"flex items-center border-b px-3\"\n // eslint-disable-next-line react/no-unknown-property\n cmdk-input-wrapper=\"\"\n >\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({className, ...props}, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>(({className, ...props}, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className={cn('py-6 text-center text-sm', className)}\n {...props}\n />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({className, ...props}, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({className, ...props}, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({className, ...props}, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n 'text-muted-foreground ml-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n"]}
|
|
@@ -30,12 +30,12 @@ export function useAspectRatioDimensions({ width, height, aspectRatio, container
|
|
|
30
30
|
box: 'border-box',
|
|
31
31
|
});
|
|
32
32
|
return useMemo(() => {
|
|
33
|
-
if (!aspectRatio) {
|
|
34
|
-
return { width: containerWidth, height: containerHeight };
|
|
35
|
-
}
|
|
36
33
|
if (width !== 'auto' && height !== 'auto') {
|
|
37
34
|
return { width, height };
|
|
38
35
|
}
|
|
36
|
+
if (!aspectRatio) {
|
|
37
|
+
return { width: containerWidth, height: containerHeight };
|
|
38
|
+
}
|
|
39
39
|
if (width !== 'auto') {
|
|
40
40
|
return { width, height: width / aspectRatio };
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAspectRatioDimensions.js","sourceRoot":"","sources":["../../src/hooks/useAspectRatioDimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,OAAO,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC;AA4B9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,wBA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M,EAAE,CAAC;YACtB,OAAO,EAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,MAAM,EAAC,CAAC;QAC/C,CAAC;QACD,MAAM,UAAU,GAAG,cAAc,CAAC;QAClC,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;QAC7C,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAC,CAAC;IAClD,CAAC,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import {RefObject, useMemo} from 'react';\nimport {useResizeObserver} from 'usehooks-ts';\n\n/**\n * Represents the dimensions of an element\n * @interface Dimensions\n * @property {number} width - The width in pixels\n * @property {number} height - The height in pixels\n */\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\n/**\n * Props for the useAspectRatioDimensions hook\n * @interface UseAspectRatioDimensionsProps\n * @property {number | 'auto'} width - The explicitly provided width, or 'auto' for container-based width\n * @property {number | 'auto'} height - The explicitly provided height, or 'auto' for aspect ratio-based height\n * @property {number} aspectRatio - The desired width-to-height ratio when dimensions are auto-calculated\n * @property {React.RefObject<HTMLElement>} containerRef - Reference to the container element\n */\nexport interface UseAspectRatioDimensionsProps {\n width: number | 'auto';\n height: number | 'auto';\n aspectRatio?: number;\n containerRef: React.RefObject<HTMLElement | null>;\n}\n\n/**\n * A hook that calculates element dimensions based on provided values and container size\n *\n * This hook handles various combinations of width/height specifications:\n * - If both width and height are provided, uses those exact dimensions\n * - If only width is provided, calculates height using the aspect ratio\n * - If only height is provided, calculates width using the aspect ratio\n * - If both are 'auto', uses container width and calculates height using the aspect ratio\n *\n * @param {UseAspectRatioDimensionsProps} props - The input parameters for dimension calculation\n * @returns {Dimensions} The calculated width and height\n *\n * @example\n * ```tsx\n * const containerRef = useRef<HTMLDivElement>(null);\n * const {width, height} = useAspectRatioDimensions({\n * width: 'auto',\n * height: 'auto',\n * aspectRatio: 16/9,\n * containerRef\n * });\n * // Returns dimensions based on container size\n * ```\n */\nexport function useAspectRatioDimensions({\n width,\n height,\n aspectRatio,\n containerRef,\n}: UseAspectRatioDimensionsProps): Dimensions {\n const {width: containerWidth = 0, height: containerHeight = 0} =\n useResizeObserver({\n ref: containerRef as RefObject<HTMLElement>,\n box: 'border-box',\n });\n\n return useMemo(() => {\n if (width !== 'auto' && height !== 'auto') {\n return {width, height};\n }\n if (!aspectRatio) {\n return {width: containerWidth, height: containerHeight};\n }\n if (width !== 'auto') {\n return {width, height: width / aspectRatio};\n }\n if (height !== 'auto') {\n return {width: height * aspectRatio, height};\n }\n const finalWidth = containerWidth;\n const finalHeight = finalWidth / aspectRatio;\n return {width: finalWidth, height: finalHeight};\n }, [containerWidth, containerHeight, aspectRatio, width, height]);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/ui",
|
|
3
|
-
"version": "0.29.0-rc.
|
|
3
|
+
"version": "0.29.0-rc.11",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/sqlrooms/sqlrooms.git"
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"build": "tsc",
|
|
21
21
|
"dev": "tsc -w",
|
|
22
22
|
"lint": "eslint .",
|
|
23
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
|
|
24
|
+
"test:watch": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --watch",
|
|
23
25
|
"typecheck": "tsc --noEmit",
|
|
24
26
|
"typedoc": "typedoc"
|
|
25
27
|
},
|
|
@@ -58,18 +60,21 @@
|
|
|
58
60
|
"lucide-react": "^0.556.0",
|
|
59
61
|
"react-day-picker": "^8.10.1",
|
|
60
62
|
"react-hook-form": "^7.63.0",
|
|
61
|
-
"react-resizable-panels": "^4.
|
|
63
|
+
"react-resizable-panels": "^4.12.1",
|
|
62
64
|
"sonner": "^2.0.7",
|
|
63
65
|
"tailwind-merge": "^2.6.0",
|
|
64
66
|
"tailwindcss-animate": "^1.0.7",
|
|
65
67
|
"usehooks-ts": "^3.1.1",
|
|
66
68
|
"vaul": "^1.1.2"
|
|
67
69
|
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"ts-jest": "^29.4.4"
|
|
72
|
+
},
|
|
68
73
|
"peerDependencies": {
|
|
69
74
|
"tailwindcss": "^4.1.18"
|
|
70
75
|
},
|
|
71
76
|
"publishConfig": {
|
|
72
77
|
"access": "public"
|
|
73
78
|
},
|
|
74
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "e451e434c67f59d16a45493689f092af134b207c"
|
|
75
80
|
}
|