@sqlrooms/ui 0.29.0-rc.10 → 0.29.0-rc.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.
- package/README.md +64 -0
- package/dist/components/command.js +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/scrollable-row.d.ts +16 -5
- package/dist/components/scrollable-row.d.ts.map +1 -1
- package/dist/components/scrollable-row.js +13 -4
- package/dist/components/scrollable-row.js.map +1 -1
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +1 -89
- package/dist/components/textarea.js.map +1 -1
- package/dist/hooks/useAspectRatioDimensions.js +3 -3
- package/dist/hooks/useAspectRatioDimensions.js.map +1 -1
- package/dist/hooks/useAutoResizeTextarea.d.ts +45 -0
- package/dist/hooks/useAutoResizeTextarea.d.ts.map +1 -0
- package/dist/hooks/useAutoResizeTextarea.js +99 -0
- package/dist/hooks/useAutoResizeTextarea.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +10 -3
- package/tailwind-preset.css +27 -0
package/README.md
CHANGED
|
@@ -181,6 +181,70 @@ function SettingsPanel({onClose}: {onClose: () => void}) {
|
|
|
181
181
|
- **Form Handling**: Integrated with React Hook Form for easy form management
|
|
182
182
|
- **Custom Styling**: Extend components with custom styles using Tailwind CSS
|
|
183
183
|
- **Animation**: Smooth transitions and animations for interactive elements
|
|
184
|
+
- **`ScrollableRow` forwards its ref and passes through extra props** (e.g.
|
|
185
|
+
`data-*`, `aria-*`, event handlers) to its outermost element, so it can be
|
|
186
|
+
wrapped by a slot component (such as Radix's `Slot`, re-exported from this
|
|
187
|
+
package) without silently losing the ref or those props. Note the two refs
|
|
188
|
+
point at different elements: the forwarded ref is the outer wrapper (the one
|
|
189
|
+
that also takes `className`), while `scrollRef` is the inner scrolling
|
|
190
|
+
container, for reading or setting `scrollLeft`.
|
|
191
|
+
|
|
192
|
+
## Auto-Resize for Textareas
|
|
193
|
+
|
|
194
|
+
`useAutoResizeTextarea` is the hook behind `Textarea`'s `autoResize` prop,
|
|
195
|
+
exported so it can be applied to a textarea element you did not render
|
|
196
|
+
yourself — for example one rendered by a host application's own text-input
|
|
197
|
+
component. Give it a ref to the textarea and it grows the element's height to
|
|
198
|
+
fit its content, tracks whether the content now exceeds the element's
|
|
199
|
+
`max-height`, and re-measures on container resize.
|
|
200
|
+
|
|
201
|
+
`resizeToFitContent` schedules the measurement on the next animation frame, so
|
|
202
|
+
the element's height is not yet updated when the call returns.
|
|
203
|
+
|
|
204
|
+
```tsx
|
|
205
|
+
import {useAutoResizeTextarea} from '@sqlrooms/ui';
|
|
206
|
+
import {useRef} from 'react';
|
|
207
|
+
|
|
208
|
+
function MyTextarea({
|
|
209
|
+
value,
|
|
210
|
+
onChange,
|
|
211
|
+
}: {
|
|
212
|
+
value: string;
|
|
213
|
+
onChange: (value: string) => void;
|
|
214
|
+
}) {
|
|
215
|
+
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
216
|
+
const {hasOverflow, resizeToFitContent} = useAutoResizeTextarea({
|
|
217
|
+
autoResize: true,
|
|
218
|
+
textareaRef,
|
|
219
|
+
value,
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
return (
|
|
223
|
+
<textarea
|
|
224
|
+
ref={textareaRef}
|
|
225
|
+
value={value}
|
|
226
|
+
onChange={(event) => onChange(event.currentTarget.value)}
|
|
227
|
+
onInput={() => resizeToFitContent()}
|
|
228
|
+
className={hasOverflow ? 'overflow-y-auto' : 'overflow-y-hidden'}
|
|
229
|
+
/>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
`Textarea` itself is unchanged: it still accepts `autoResize` and consumes
|
|
235
|
+
this hook internally.
|
|
236
|
+
|
|
237
|
+
## Native scrolling
|
|
238
|
+
|
|
239
|
+
Use the `scrollbar-thin` utility for simple native overflow containers that
|
|
240
|
+
should use a thin, theme-aware scrollbar:
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
<div className="scrollbar-thin overflow-y-auto">{/* content */}</div>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Use `ScrollArea` instead when a surface needs custom horizontal or
|
|
247
|
+
bidirectional scrollbar behavior.
|
|
184
248
|
|
|
185
249
|
## TabStrip
|
|
186
250
|
|
|
@@ -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,OAA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AEhD,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAC","sourcesContent":["'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"]}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A horizontally scrolling row with arrows that appear only where there is more
|
|
4
|
+
* content.
|
|
5
|
+
*
|
|
6
|
+
* The forwarded ref and `className` target the outer wrapper (so `Slot` or
|
|
7
|
+
* drop-target wrapping works); `scrollRef` targets the inner scrolling
|
|
8
|
+
* container.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ScrollableRow: React.ForwardRefExoticComponent<{
|
|
3
11
|
children: React.ReactNode;
|
|
4
12
|
className?: string;
|
|
5
13
|
scrollClassName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Ref to the inner scrolling container. Replaces the internal ref; the
|
|
16
|
+
* arrows keep working.
|
|
17
|
+
*/
|
|
6
18
|
scrollRef?: React.RefObject<HTMLDivElement>;
|
|
19
|
+
/** Pixels scrolled per arrow activation. Defaults to 200. */
|
|
7
20
|
scrollAmount?: number;
|
|
8
|
-
arrowVisibility?:
|
|
21
|
+
arrowVisibility?: "hover" | "always";
|
|
9
22
|
arrowClassName?: string;
|
|
10
23
|
arrowIconClassName?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function ScrollableRow({ children, className, scrollClassName, scrollRef, scrollAmount, arrowVisibility, arrowClassName, arrowIconClassName, }: ScrollableRowProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
24
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className" | "children"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
25
|
//# sourceMappingURL=scrollable-row.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollable-row.d.ts","sourceRoot":"","sources":["../../src/components/scrollable-row.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"scrollable-row.d.ts","sourceRoot":"","sources":["../../src/components/scrollable-row.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAmBzD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;cAvBd,KAAK,CAAC,SAAS;gBACb,MAAM;sBACA,MAAM;IACxB;;;OAGG;gBACS,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC3C,6DAA6D;mBAC9C,MAAM;sBACH,OAAO,GAAG,QAAQ;qBACnB,MAAM;yBACF,MAAM;qKA6H3B,CAAC"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { cn } from '../lib/utils';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A horizontally scrolling row with arrows that appear only where there is more
|
|
7
|
+
* content.
|
|
8
|
+
*
|
|
9
|
+
* The forwarded ref and `className` target the outer wrapper (so `Slot` or
|
|
10
|
+
* drop-target wrapping works); `scrollRef` targets the inner scrolling
|
|
11
|
+
* container.
|
|
12
|
+
*/
|
|
13
|
+
export const ScrollableRow = React.forwardRef(function ScrollableRow({ children, className, scrollClassName, scrollRef, scrollAmount = 200, arrowVisibility = 'hover', arrowClassName, arrowIconClassName, ...rest }, forwardedRef) {
|
|
6
14
|
const internalRef = useRef(null);
|
|
7
15
|
const containerRef = scrollRef ?? internalRef;
|
|
8
16
|
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
@@ -40,6 +48,7 @@ export function ScrollableRow({ children, className, scrollClassName, scrollRef,
|
|
|
40
48
|
const arrowBaseClass = cn('absolute top-0 z-10 flex h-full w-8 items-center backdrop-blur-md bg-background/50 transition-colors', arrowVisibility === 'hover'
|
|
41
49
|
? 'opacity-0 transition-opacity hover:opacity-100'
|
|
42
50
|
: 'opacity-100', arrowClassName);
|
|
43
|
-
return (_jsxs("div", { className: cn('relative', className), children: [_jsx("button", { type: "button", onClick: () => scrollBy('left'), disabled: !canScrollLeft, className: cn(arrowBaseClass, 'left-0 justify-start pl-1', 'from-background/90 via-background/60 group bg-gradient-to-r to-transparent', !canScrollLeft && 'pointer-events-none opacity-0'), "aria-label": "Scroll left", title: "Scroll left", children: _jsx(ChevronLeft, { className: cn('text-muted-foreground group-hover:text-foreground h-5 w-5 transition-colors', arrowIconClassName) }) }), _jsx("div", { ref: containerRef, className: scrollClassName, children: children }), _jsx("button", { type: "button", onClick: () => scrollBy('right'), disabled: !canScrollRight, className: cn(arrowBaseClass, 'right-0 justify-end pr-1', 'from-background/90 via-background/60 group bg-gradient-to-l to-transparent', !canScrollRight && 'pointer-events-none opacity-0'), "aria-label": "Scroll right", title: "Scroll right", children: _jsx(ChevronRight, { className: cn('text-muted-foreground group-hover:text-foreground h-5 w-5 transition-colors', arrowIconClassName) }) })] }));
|
|
44
|
-
}
|
|
51
|
+
return (_jsxs("div", { ref: forwardedRef, className: cn('relative', className), ...rest, children: [_jsx("button", { type: "button", onClick: () => scrollBy('left'), disabled: !canScrollLeft, className: cn(arrowBaseClass, 'left-0 justify-start pl-1', 'from-background/90 via-background/60 group bg-gradient-to-r to-transparent', !canScrollLeft && 'pointer-events-none opacity-0'), "aria-label": "Scroll left", title: "Scroll left", children: _jsx(ChevronLeft, { className: cn('text-muted-foreground group-hover:text-foreground h-5 w-5 transition-colors', arrowIconClassName) }) }), _jsx("div", { ref: containerRef, className: scrollClassName, children: children }), _jsx("button", { type: "button", onClick: () => scrollBy('right'), disabled: !canScrollRight, className: cn(arrowBaseClass, 'right-0 justify-end pr-1', 'from-background/90 via-background/60 group bg-gradient-to-l to-transparent', !canScrollRight && 'pointer-events-none opacity-0'), "aria-label": "Scroll right", title: "Scroll right", children: _jsx(ChevronRight, { className: cn('text-muted-foreground group-hover:text-foreground h-5 w-5 transition-colors', arrowIconClassName) }) })] }));
|
|
52
|
+
});
|
|
53
|
+
ScrollableRow.displayName = 'ScrollableRow';
|
|
45
54
|
//# sourceMappingURL=scrollable-row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollable-row.js","sourceRoot":"","sources":["../../src/components/scrollable-row.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AACvD,
|
|
1
|
+
{"version":3,"file":"scrollable-row.js","sourceRoot":"","sources":["../../src/components/scrollable-row.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAkBhC;;;;;;;GAOG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Q,EAAE,CAAC,cAAc,EACzB,SAAS,EAAE,EAAE,CACX,cAAc,EACd,0BAA0B,EAC1B,4EAA4E,EAC5E,CAAC,cAAc,IAAI,+BAA+B,CACnD,gBACU,cAAc,EACzB,KAAK,EAAC,cAAc,YAEpB,KAAC,YAAY,IACX,SAAS,EAAE,EAAE,CACX,6EAA6E,EAC7E,kBAAkB,CACnB,GACD,GACK,IACL,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {ChevronLeft, ChevronRight} from 'lucide-react';\nimport React, {useEffect, useRef, useState} from 'react';\nimport {cn} from '../lib/utils';\n\ntype ScrollableRowProps = {\n children: React.ReactNode;\n className?: string;\n scrollClassName?: string;\n /**\n * Ref to the inner scrolling container. Replaces the internal ref; the\n * arrows keep working.\n */\n scrollRef?: React.RefObject<HTMLDivElement>;\n /** Pixels scrolled per arrow activation. Defaults to 200. */\n scrollAmount?: number;\n arrowVisibility?: 'hover' | 'always';\n arrowClassName?: string;\n arrowIconClassName?: string;\n} & Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'className'>;\n\n/**\n * A horizontally scrolling row with arrows that appear only where there is more\n * content.\n *\n * The forwarded ref and `className` target the outer wrapper (so `Slot` or\n * drop-target wrapping works); `scrollRef` targets the inner scrolling\n * container.\n */\nexport const ScrollableRow = React.forwardRef<\n HTMLDivElement,\n ScrollableRowProps\n>(function ScrollableRow(\n {\n children,\n className,\n scrollClassName,\n scrollRef,\n scrollAmount = 200,\n arrowVisibility = 'hover',\n arrowClassName,\n arrowIconClassName,\n ...rest\n },\n forwardedRef,\n) {\n const internalRef = useRef<HTMLDivElement>(null);\n const containerRef = scrollRef ?? internalRef;\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(false);\n\n const scrollBy = (direction: 'left' | 'right') => {\n const container = containerRef.current;\n if (!container) return;\n\n container.scrollBy({\n left: direction === 'left' ? -scrollAmount : scrollAmount,\n behavior: 'smooth',\n });\n };\n\n useEffect(() => {\n const updateScrollState = () => {\n const container = containerRef.current;\n if (!container) return;\n\n const {scrollLeft, scrollWidth, clientWidth} = container;\n setCanScrollLeft(scrollLeft > 0);\n setCanScrollRight(scrollLeft + clientWidth < scrollWidth - 1);\n };\n\n const container = containerRef.current;\n if (!container) return;\n\n updateScrollState();\n\n container.addEventListener('scroll', updateScrollState);\n const resizeObserver = new ResizeObserver(updateScrollState);\n resizeObserver.observe(container);\n\n return () => {\n container.removeEventListener('scroll', updateScrollState);\n resizeObserver.disconnect();\n };\n }, [children, containerRef]);\n\n const arrowBaseClass = cn(\n 'absolute top-0 z-10 flex h-full w-8 items-center backdrop-blur-md bg-background/50 transition-colors',\n arrowVisibility === 'hover'\n ? 'opacity-0 transition-opacity hover:opacity-100'\n : 'opacity-100',\n arrowClassName,\n );\n\n return (\n <div ref={forwardedRef} className={cn('relative', className)} {...rest}>\n <button\n type=\"button\"\n onClick={() => scrollBy('left')}\n disabled={!canScrollLeft}\n className={cn(\n arrowBaseClass,\n 'left-0 justify-start pl-1',\n 'from-background/90 via-background/60 group bg-gradient-to-r to-transparent',\n !canScrollLeft && 'pointer-events-none opacity-0',\n )}\n aria-label=\"Scroll left\"\n title=\"Scroll left\"\n >\n <ChevronLeft\n className={cn(\n 'text-muted-foreground group-hover:text-foreground h-5 w-5 transition-colors',\n arrowIconClassName,\n )}\n />\n </button>\n\n <div ref={containerRef} className={scrollClassName}>\n {children}\n </div>\n\n <button\n type=\"button\"\n onClick={() => scrollBy('right')}\n disabled={!canScrollRight}\n className={cn(\n arrowBaseClass,\n 'right-0 justify-end pr-1',\n 'from-background/90 via-background/60 group bg-gradient-to-l to-transparent',\n !canScrollRight && 'pointer-events-none opacity-0',\n )}\n aria-label=\"Scroll right\"\n title=\"Scroll right\"\n >\n <ChevronRight\n className={cn(\n 'text-muted-foreground group-hover:text-foreground h-5 w-5 transition-colors',\n arrowIconClassName,\n )}\n />\n </button>\n </div>\n );\n});\n\nScrollableRow.displayName = 'ScrollableRow';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/components/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/components/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,QAAQ,wGAoDb,CAAC;AAGF,OAAO,EAAC,QAAQ,EAAC,CAAC"}
|
|
@@ -1,95 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { cn } from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
* Uses layout effect in the browser and falls back to effect during SSR.
|
|
6
|
-
*/
|
|
7
|
-
const useIsomorphicLayoutEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;
|
|
8
|
-
/**
|
|
9
|
-
* Keeps a textarea height synchronized with its content and container width.
|
|
10
|
-
*
|
|
11
|
-
* The resize path is intentionally triggered from multiple sources (input,
|
|
12
|
-
* value changes, and width changes) and then deduped per frame.
|
|
13
|
-
*/
|
|
14
|
-
function useAutoResizeTextarea({ autoResize, textareaRef, value, defaultValue, }) {
|
|
15
|
-
const [hasOverflow, setHasOverflow] = React.useState(false);
|
|
16
|
-
const lastMeasuredWidthRef = React.useRef(0);
|
|
17
|
-
const resizeFrameRef = React.useRef(null);
|
|
18
|
-
const applyResizeToFitContent = React.useCallback(() => {
|
|
19
|
-
const el = textareaRef.current;
|
|
20
|
-
if (!el || !autoResize || typeof window === 'undefined')
|
|
21
|
-
return;
|
|
22
|
-
el.style.height = 'auto';
|
|
23
|
-
el.style.height = `${el.scrollHeight}px`;
|
|
24
|
-
const computedStyle = window.getComputedStyle(el);
|
|
25
|
-
const maxHeight = computedStyle.maxHeight;
|
|
26
|
-
if (maxHeight && maxHeight !== 'none') {
|
|
27
|
-
const maxHeightValue = parseFloat(maxHeight);
|
|
28
|
-
setHasOverflow(el.scrollHeight > maxHeightValue);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
setHasOverflow(false);
|
|
32
|
-
}
|
|
33
|
-
}, [autoResize, textareaRef]);
|
|
34
|
-
const resizeToFitContent = React.useCallback(() => {
|
|
35
|
-
if (!autoResize || typeof window === 'undefined')
|
|
36
|
-
return;
|
|
37
|
-
// Keep input/effect-triggered resize paths for robustness, but collapse
|
|
38
|
-
// same-frame calls into one DOM measurement/write cycle.
|
|
39
|
-
if (resizeFrameRef.current !== null)
|
|
40
|
-
return;
|
|
41
|
-
resizeFrameRef.current = window.requestAnimationFrame(() => {
|
|
42
|
-
resizeFrameRef.current = null;
|
|
43
|
-
applyResizeToFitContent();
|
|
44
|
-
});
|
|
45
|
-
}, [autoResize, applyResizeToFitContent]);
|
|
46
|
-
useIsomorphicLayoutEffect(() => {
|
|
47
|
-
resizeToFitContent();
|
|
48
|
-
}, [resizeToFitContent, value, defaultValue]);
|
|
49
|
-
React.useEffect(() => {
|
|
50
|
-
if (!autoResize)
|
|
51
|
-
return;
|
|
52
|
-
const el = textareaRef.current;
|
|
53
|
-
if (!el || typeof window === 'undefined')
|
|
54
|
-
return;
|
|
55
|
-
// Re-measure after layout settles so hidden/collapsed mount states
|
|
56
|
-
// don't leave a stale oversized height.
|
|
57
|
-
resizeToFitContent();
|
|
58
|
-
if (typeof ResizeObserver === 'undefined') {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
lastMeasuredWidthRef.current = el.getBoundingClientRect().width;
|
|
62
|
-
const observer = new ResizeObserver((entries) => {
|
|
63
|
-
const entry = entries[0];
|
|
64
|
-
if (!entry)
|
|
65
|
-
return;
|
|
66
|
-
const nextWidth = entry.contentRect.width;
|
|
67
|
-
if (Math.abs(nextWidth - lastMeasuredWidthRef.current) < 1) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
lastMeasuredWidthRef.current = nextWidth;
|
|
71
|
-
resizeToFitContent();
|
|
72
|
-
});
|
|
73
|
-
observer.observe(el);
|
|
74
|
-
return () => {
|
|
75
|
-
observer.disconnect();
|
|
76
|
-
};
|
|
77
|
-
}, [autoResize, resizeToFitContent, textareaRef]);
|
|
78
|
-
React.useEffect(() => {
|
|
79
|
-
if (typeof window === 'undefined')
|
|
80
|
-
return;
|
|
81
|
-
return () => {
|
|
82
|
-
if (resizeFrameRef.current !== null) {
|
|
83
|
-
window.cancelAnimationFrame(resizeFrameRef.current);
|
|
84
|
-
resizeFrameRef.current = null;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}, []);
|
|
88
|
-
return {
|
|
89
|
-
hasOverflow,
|
|
90
|
-
resizeToFitContent,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
4
|
+
import { useAutoResizeTextarea } from '../hooks/useAutoResizeTextarea';
|
|
93
5
|
/**
|
|
94
6
|
* Textarea component with optional auto-resize behavior.
|
|
95
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/components/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/components/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;A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area} from '../hooks/useAutoResizeTextarea';\n\ntype TextareaProps = React.ComponentProps<'textarea'> & {\n autoResize?: boolean;\n};\n\n/**\n * Textarea component with optional auto-resize behavior.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n className,\n autoResize = false,\n onInput,\n value,\n defaultValue,\n rows,\n ...props\n },\n ref,\n ) => {\n const localRef = React.useRef<HTMLTextAreaElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => localRef.current as HTMLTextAreaElement,\n );\n\n const {hasOverflow, resizeToFitContent} = useAutoResizeTextarea({\n autoResize,\n textareaRef: localRef,\n value,\n defaultValue,\n });\n\n const handleInput = (e: React.FormEvent<HTMLTextAreaElement>) => {\n if (autoResize) resizeToFitContent();\n if (onInput) onInput(e);\n };\n\n return (\n <textarea\n className={cn(\n 'border-input placeholder:text-muted-foreground focus-visible:ring-ring flex min-h-[60px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-sm focus-visible:ring-1 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n autoResize\n ? hasOverflow\n ? 'overflow-y-auto'\n : 'overflow-y-hidden'\n : undefined,\n className,\n )}\n rows={rows ?? (autoResize ? 1 : undefined)}\n ref={localRef}\n onInput={handleInput}\n value={value}\n defaultValue={defaultValue}\n {...props}\n />\n );\n },\n);\nTextarea.displayName = 'Textarea';\n\nexport {Textarea};\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,wBAAwB,CAAC,EACvC,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,GACkB;IAC9B,MAAM,EAAC,KAAK,EAAE,cAAc,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,GAAG,CAAC,EAAC,GAC5D,iBAAiB,CAAC;QAChB,GAAG,EAAE,YAAsC;QAC3C,GAAG,EAAE,YAAY;KAClB,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,
|
|
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,wBAAwB,CAAC,EACvC,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,GACkB;IAC9B,MAAM,EAAC,KAAK,EAAE,cAAc,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,GAAG,CAAC,EAAC,GAC5D,iBAAiB,CAAC;QAChB,GAAG,EAAE,YAAsC;QAC3C,GAAG,EAAE,YAAY;KAClB,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,KAAK,KAAK,MAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC1C,OAAO,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC;QACzB,CAAC;QACD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO,EAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAC,CAAC;QAC1D,CAAC;QACD,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YACrB,OAAO,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,WAAW,EAAC,CAAC;QAC9C,CAAC;QACD,IAAI,MAAM,KAAK,MAAM,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"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link useAutoResizeTextarea}.
|
|
4
|
+
*/
|
|
5
|
+
export interface UseAutoResizeTextareaOptions {
|
|
6
|
+
/** Whether auto-resize is active. When false, the hook is a no-op. */
|
|
7
|
+
autoResize: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Ref to the textarea to measure and resize. May point to a textarea
|
|
10
|
+
* rendered by a component the caller does not own.
|
|
11
|
+
*/
|
|
12
|
+
textareaRef: React.RefObject<HTMLTextAreaElement | null>;
|
|
13
|
+
/** The textarea's current controlled value, if any. */
|
|
14
|
+
value?: React.ComponentProps<'textarea'>['value'];
|
|
15
|
+
/** The textarea's uncontrolled default value, if any. */
|
|
16
|
+
defaultValue?: React.ComponentProps<'textarea'>['defaultValue'];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Return value of {@link useAutoResizeTextarea}.
|
|
20
|
+
*/
|
|
21
|
+
export interface UseAutoResizeTextareaResult {
|
|
22
|
+
/** True when the content's height exceeds the element's `max-height`. */
|
|
23
|
+
hasOverflow: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Schedules a re-measure and height update on the next animation frame —
|
|
26
|
+
* the element's height is not yet updated when this returns.
|
|
27
|
+
*/
|
|
28
|
+
resizeToFitContent: () => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Keeps a textarea's height synchronized with its content and container
|
|
32
|
+
* width.
|
|
33
|
+
*
|
|
34
|
+
* Reads and writes only through the DOM node reached via `textareaRef`, so
|
|
35
|
+
* auto-grow can be layered onto a text input rendered by any component,
|
|
36
|
+
* including one that does not implement it itself.
|
|
37
|
+
*
|
|
38
|
+
* The resize path is triggered from several sources (input, value changes,
|
|
39
|
+
* width changes) and deduped per frame.
|
|
40
|
+
*
|
|
41
|
+
* @param options - See {@link UseAutoResizeTextareaOptions}.
|
|
42
|
+
* @returns See {@link UseAutoResizeTextareaResult}.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useAutoResizeTextarea({ autoResize, textareaRef, value, defaultValue, }: UseAutoResizeTextareaOptions): UseAutoResizeTextareaResult;
|
|
45
|
+
//# sourceMappingURL=useAutoResizeTextarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoResizeTextarea.d.ts","sourceRoot":"","sources":["../../src/hooks/useAutoResizeTextarea.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,sEAAsE;IACtE,UAAU,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACzD,uDAAuD;IACvD,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD,yDAAyD;IACzD,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,CAAC;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,yEAAyE;IACzE,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,WAAW,EACX,KAAK,EACL,YAAY,GACb,EAAE,4BAA4B,GAAG,2BAA2B,CAyF5D"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Uses layout effect in the browser and falls back to effect during SSR.
|
|
4
|
+
*/
|
|
5
|
+
const useIsomorphicLayoutEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;
|
|
6
|
+
/**
|
|
7
|
+
* Keeps a textarea's height synchronized with its content and container
|
|
8
|
+
* width.
|
|
9
|
+
*
|
|
10
|
+
* Reads and writes only through the DOM node reached via `textareaRef`, so
|
|
11
|
+
* auto-grow can be layered onto a text input rendered by any component,
|
|
12
|
+
* including one that does not implement it itself.
|
|
13
|
+
*
|
|
14
|
+
* The resize path is triggered from several sources (input, value changes,
|
|
15
|
+
* width changes) and deduped per frame.
|
|
16
|
+
*
|
|
17
|
+
* @param options - See {@link UseAutoResizeTextareaOptions}.
|
|
18
|
+
* @returns See {@link UseAutoResizeTextareaResult}.
|
|
19
|
+
*/
|
|
20
|
+
export function useAutoResizeTextarea({ autoResize, textareaRef, value, defaultValue, }) {
|
|
21
|
+
const [hasOverflow, setHasOverflow] = React.useState(false);
|
|
22
|
+
const lastMeasuredWidthRef = React.useRef(0);
|
|
23
|
+
const resizeFrameRef = React.useRef(null);
|
|
24
|
+
const applyResizeToFitContent = React.useCallback(() => {
|
|
25
|
+
const el = textareaRef.current;
|
|
26
|
+
if (!el || !autoResize || typeof window === 'undefined')
|
|
27
|
+
return;
|
|
28
|
+
el.style.height = 'auto';
|
|
29
|
+
el.style.height = `${el.scrollHeight}px`;
|
|
30
|
+
const computedStyle = window.getComputedStyle(el);
|
|
31
|
+
const maxHeight = computedStyle.maxHeight;
|
|
32
|
+
if (maxHeight && maxHeight !== 'none') {
|
|
33
|
+
const maxHeightValue = parseFloat(maxHeight);
|
|
34
|
+
setHasOverflow(el.scrollHeight > maxHeightValue);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
setHasOverflow(false);
|
|
38
|
+
}
|
|
39
|
+
}, [autoResize, textareaRef]);
|
|
40
|
+
const resizeToFitContent = React.useCallback(() => {
|
|
41
|
+
if (!autoResize || typeof window === 'undefined')
|
|
42
|
+
return;
|
|
43
|
+
// Keep input/effect-triggered resize paths for robustness, but collapse
|
|
44
|
+
// same-frame calls into one DOM measurement/write cycle.
|
|
45
|
+
if (resizeFrameRef.current !== null)
|
|
46
|
+
return;
|
|
47
|
+
resizeFrameRef.current = window.requestAnimationFrame(() => {
|
|
48
|
+
resizeFrameRef.current = null;
|
|
49
|
+
applyResizeToFitContent();
|
|
50
|
+
});
|
|
51
|
+
}, [autoResize, applyResizeToFitContent]);
|
|
52
|
+
useIsomorphicLayoutEffect(() => {
|
|
53
|
+
resizeToFitContent();
|
|
54
|
+
}, [resizeToFitContent, value, defaultValue]);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
if (!autoResize)
|
|
57
|
+
return;
|
|
58
|
+
const el = textareaRef.current;
|
|
59
|
+
if (!el || typeof window === 'undefined')
|
|
60
|
+
return;
|
|
61
|
+
// Re-measure after layout settles so hidden/collapsed mount states
|
|
62
|
+
// don't leave a stale oversized height.
|
|
63
|
+
resizeToFitContent();
|
|
64
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
lastMeasuredWidthRef.current = el.getBoundingClientRect().width;
|
|
68
|
+
const observer = new ResizeObserver((entries) => {
|
|
69
|
+
const entry = entries[0];
|
|
70
|
+
if (!entry)
|
|
71
|
+
return;
|
|
72
|
+
const nextWidth = entry.contentRect.width;
|
|
73
|
+
if (Math.abs(nextWidth - lastMeasuredWidthRef.current) < 1) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
lastMeasuredWidthRef.current = nextWidth;
|
|
77
|
+
resizeToFitContent();
|
|
78
|
+
});
|
|
79
|
+
observer.observe(el);
|
|
80
|
+
return () => {
|
|
81
|
+
observer.disconnect();
|
|
82
|
+
};
|
|
83
|
+
}, [autoResize, resizeToFitContent, textareaRef]);
|
|
84
|
+
React.useEffect(() => {
|
|
85
|
+
if (typeof window === 'undefined')
|
|
86
|
+
return;
|
|
87
|
+
return () => {
|
|
88
|
+
if (resizeFrameRef.current !== null) {
|
|
89
|
+
window.cancelAnimationFrame(resizeFrameRef.current);
|
|
90
|
+
resizeFrameRef.current = null;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}, []);
|
|
94
|
+
return {
|
|
95
|
+
hasOverflow,
|
|
96
|
+
resizeToFitContent,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=useAutoResizeTextarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoResizeTextarea.js","sourceRoot":"","sources":["../../src/hooks/useAutoResizeTextarea.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,yBAAyB,GAC7B,OAAO,MAAM,KAAK,WAAW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C;gBAC3D,OAAO;YACT,CAAC;YAED,oBAAoB,CAAC,OAAO,GAAG,SAAS,CAAC;YACzC,kBAAkB,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAErB,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC;IAElD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAE1C,OAAO,GAAG,EAAE;YACV,IAAI,cAAc,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;gBACpC,MAAM,CAAC,oBAAoB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACpD,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC;YAChC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,WAAW;QACX,kBAAkB;KACnB,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\n\n/**\n * Uses layout effect in the browser and falls back to effect during SSR.\n */\nconst useIsomorphicLayoutEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n\n/**\n * Options for {@link useAutoResizeTextarea}.\n */\nexport interface UseAutoResizeTextareaOptions {\n /** Whether auto-resize is active. When false, the hook is a no-op. */\n autoResize: boolean;\n /**\n * Ref to the textarea to measure and resize. May point to a textarea\n * rendered by a component the caller does not own.\n */\n textareaRef: React.RefObject<HTMLTextAreaElement | null>;\n /** The textarea's current controlled value, if any. */\n value?: React.ComponentProps<'textarea'>['value'];\n /** The textarea's uncontrolled default value, if any. */\n defaultValue?: React.ComponentProps<'textarea'>['defaultValue'];\n}\n\n/**\n * Return value of {@link useAutoResizeTextarea}.\n */\nexport interface UseAutoResizeTextareaResult {\n /** True when the content's height exceeds the element's `max-height`. */\n hasOverflow: boolean;\n /**\n * Schedules a re-measure and height update on the next animation frame —\n * the element's height is not yet updated when this returns.\n */\n resizeToFitContent: () => void;\n}\n\n/**\n * Keeps a textarea's height synchronized with its content and container\n * width.\n *\n * Reads and writes only through the DOM node reached via `textareaRef`, so\n * auto-grow can be layered onto a text input rendered by any component,\n * including one that does not implement it itself.\n *\n * The resize path is triggered from several sources (input, value changes,\n * width changes) and deduped per frame.\n *\n * @param options - See {@link UseAutoResizeTextareaOptions}.\n * @returns See {@link UseAutoResizeTextareaResult}.\n */\nexport function useAutoResizeTextarea({\n autoResize,\n textareaRef,\n value,\n defaultValue,\n}: UseAutoResizeTextareaOptions): UseAutoResizeTextareaResult {\n const [hasOverflow, setHasOverflow] = React.useState(false);\n const lastMeasuredWidthRef = React.useRef<number>(0);\n const resizeFrameRef = React.useRef<number | null>(null);\n\n const applyResizeToFitContent = React.useCallback(() => {\n const el = textareaRef.current;\n if (!el || !autoResize || typeof window === 'undefined') return;\n\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n\n const computedStyle = window.getComputedStyle(el);\n const maxHeight = computedStyle.maxHeight;\n if (maxHeight && maxHeight !== 'none') {\n const maxHeightValue = parseFloat(maxHeight);\n setHasOverflow(el.scrollHeight > maxHeightValue);\n } else {\n setHasOverflow(false);\n }\n }, [autoResize, textareaRef]);\n\n const resizeToFitContent = React.useCallback(() => {\n if (!autoResize || typeof window === 'undefined') return;\n\n // Keep input/effect-triggered resize paths for robustness, but collapse\n // same-frame calls into one DOM measurement/write cycle.\n if (resizeFrameRef.current !== null) return;\n\n resizeFrameRef.current = window.requestAnimationFrame(() => {\n resizeFrameRef.current = null;\n applyResizeToFitContent();\n });\n }, [autoResize, applyResizeToFitContent]);\n\n useIsomorphicLayoutEffect(() => {\n resizeToFitContent();\n }, [resizeToFitContent, value, defaultValue]);\n\n React.useEffect(() => {\n if (!autoResize) return;\n\n const el = textareaRef.current;\n if (!el || typeof window === 'undefined') return;\n\n // Re-measure after layout settles so hidden/collapsed mount states\n // don't leave a stale oversized height.\n resizeToFitContent();\n\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n\n lastMeasuredWidthRef.current = el.getBoundingClientRect().width;\n const observer = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n\n const nextWidth = entry.contentRect.width;\n if (Math.abs(nextWidth - lastMeasuredWidthRef.current) < 1) {\n return;\n }\n\n lastMeasuredWidthRef.current = nextWidth;\n resizeToFitContent();\n });\n\n observer.observe(el);\n\n return () => {\n observer.disconnect();\n };\n }, [autoResize, resizeToFitContent, textareaRef]);\n\n React.useEffect(() => {\n if (typeof window === 'undefined') return;\n\n return () => {\n if (resizeFrameRef.current !== null) {\n window.cancelAnimationFrame(resizeFrameRef.current);\n resizeFrameRef.current = null;\n }\n };\n }, []);\n\n return {\n hasOverflow,\n resizeToFitContent,\n };\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export { useDebouncedCallback } from './hooks/useDebouncedCallback';
|
|
|
66
66
|
export { useDebouncedValue } from './hooks/useDebouncedValue';
|
|
67
67
|
export { useIsMobile } from './hooks/use-mobile';
|
|
68
68
|
export { useRelativeCoordinates } from './hooks/useRelativeCoordinates';
|
|
69
|
+
export { useAutoResizeTextarea, type UseAutoResizeTextareaOptions, type UseAutoResizeTextareaResult, } from './hooks/useAutoResizeTextarea';
|
|
69
70
|
export { resolveFontSizeClass, type FontSizeToken } from './lib/fontSize';
|
|
70
71
|
export { cn } from './lib/utils';
|
|
71
72
|
export { DEFAULT_THEME, DEFAULT_THEME_STORAGE_KEY, getResolvedTheme, getTheme, getThemePreference, ThemeProvider, useTheme, type ResolvedTheme, type Theme, } from './theme/theme-provider';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAG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MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAC,KAAK,EAAE,KAAK,aAAa,EAAC,MAAM,QAAQ,CAAC;AAEjD,OAAO,EACL,wBAAwB,EACxB,KAAK,UAAU,EACf,KAAK,6BAA6B,GACnC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,aAAa,EACb,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EACL,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,GACjC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAC,oBAAoB,EAAE,KAAK,aAAa,EAAC,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AAG/B,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,KAAK,GACX,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAC,IAAI,EAAC,MAAM,sBAAsB,CAAC;AAE1C,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ export { useDebouncedCallback } from './hooks/useDebouncedCallback';
|
|
|
67
67
|
export { useDebouncedValue } from './hooks/useDebouncedValue';
|
|
68
68
|
export { useIsMobile } from './hooks/use-mobile';
|
|
69
69
|
export { useRelativeCoordinates } from './hooks/useRelativeCoordinates';
|
|
70
|
+
export { useAutoResizeTextarea, } from './hooks/useAutoResizeTextarea';
|
|
70
71
|
// Utilities
|
|
71
72
|
export { resolveFontSizeClass } from './lib/fontSize';
|
|
72
73
|
export { cn } from './lib/utils';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,aAAa;AACb,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAC,KAAK,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAC,MAAM,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAC,QAAQ,EAAqB,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EACL,QAAQ,GAKT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,GAGZ,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,OAAO,EACP,aAAa,EACb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ordionItem,\n AccordionTrigger,\n} from './components/accordion';\n\nexport {Alert, AlertDescription, AlertTitle} from './components/alert';\n\nexport {AspectRatio} from './components/aspect-ratio';\n\nexport {Badge, badgeVariants, type BadgeProps} from './components/badge';\n\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from './components/breadcrumb';\n\nexport {Button, buttonVariants, type ButtonProps} from './components/button';\n\nexport {Calendar, type CalendarProps} from './components/calendar';\n\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from './components/card';\n\nexport {Checkbox} from './components/checkbox';\n\nexport {\n Combobox,\n type ComboboxContentProps,\n type ComboboxItemProps,\n type ComboboxRootProps,\n type ComboboxTriggerProps,\n} from './components/combobox';\nexport {\n useCombobox,\n type UseComboboxOptions,\n type UseComboboxReturn,\n} from './hooks/useCombobox';\n\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from './components/collapsible';\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n} from './components/command';\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n} from './components/context-menu';\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from './components/dialog';\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHandle,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n} from './components/drawer';\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from './components/dropdown-menu';\n\nexport {EditableText} from './components/editable-text';\n\nexport {ErrorBoundary} from './components/error-boundary';\n\nexport {ErrorPane} from './components/error-pane';\n\nexport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n useFormField,\n} from './components/form';\n\nexport {Input} from './components/input';\n\nexport {\n SettingsPanelHeader,\n type SettingsPanelHeaderProps,\n} from './components/settings-panel-header';\n\nexport {Label} from './components/label';\n\nexport {\n ModifierScrollOverlay,\n type ModifierScrollOverlayProps,\n} from './components/modifier-scroll-overlay';\n\nexport {\n Menubar,\n MenubarCheckboxItem,\n MenubarContent,\n MenubarGroup,\n MenubarItem,\n MenubarLabel,\n MenubarMenu,\n MenubarPortal,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n} from './components/menu-bar';\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from './components/pagination';\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from './components/popover';\n\nexport {ProgressModal} from './components/progress-modal';\n\nexport {Progress} from './components/progress';\n\nexport {RadioGroup, RadioGroupItem} from './components/radio-group';\n\nexport {\n ResizableHandle,\n ResizablePanel,\n ResizablePanelGroup,\n} from './components/resizable';\nexport type {\n ResizablePanelOrientation,\n ResizablePanelHandle,\n} from './components/resizable';\n\nexport {RunButton, type RunButtonProps} from './components/run-button';\n\nexport {\n TabStrip,\n type TabDescriptor,\n type TabStripDndMode,\n type TabStripDragData,\n type TabStripProps,\n} from './components/tab-strip';\n\nexport {ScrollableRow} from './components/scrollable-row';\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from './components/select';\n\nexport {ScrollArea, ScrollBar} from './components/scroll-area';\n\nexport {Separator} from './components/separator';\n\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetTitle,\n SheetTrigger,\n} from './components/sheet';\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n} from './components/sidebar';\n\nexport {SkeletonPane} from './components/skeleton-pane';\n\nexport {Skeleton} from './components/skeleton';\n\nexport {Slider} from './components/slider';\n\nexport {SpinnerPane} from './components/spinner-pane';\n\nexport {Spinner} from './components/spinner';\n\nexport {Switch} from './components/switch';\n\nexport {\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n} from './components/table';\n\nexport {Tabs, TabsContent, TabsList, TabsTrigger} from './components/tabs';\n\nexport {Textarea} from './components/textarea';\n\nexport {ThemeSwitch} from './components/theme-switch';\n\nexport {ToggleGroup, ToggleGroupItem} from './components/toggle-group';\n\nexport {Toggle, toggleVariants} from './components/toggle';\n\nexport {CopyButton, type CopyButtonProps} from './components/copy-button';\n\nexport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from './components/tooltip';\n\nexport {Tree, type TreeNodeData} from './components/tree';\n\n// Hooks\nexport {toast, type ExternalToast} from 'sonner';\n\nexport {\n useAspectRatioDimensions,\n type Dimensions,\n type UseAspectRatioDimensionsProps,\n} from './hooks/useAspectRatioDimensions';\n\nexport {\n useDisclosure,\n type UseDisclosureReturnValue,\n} from './hooks/useDisclosure';\n\nexport {useDebounce} from './hooks/useDebounce';\nexport {useDebouncedCallback} from './hooks/useDebouncedCallback';\nexport {useDebouncedValue} from './hooks/useDebouncedValue';\n\nexport {useIsMobile} from './hooks/use-mobile';\nexport {useRelativeCoordinates} from './hooks/useRelativeCoordinates';\n\n// Utilities\nexport {resolveFontSizeClass, type FontSizeToken} from './lib/fontSize';\nexport {cn} from './lib/utils';\n\n// Theme\nexport {\n DEFAULT_THEME,\n DEFAULT_THEME_STORAGE_KEY,\n getResolvedTheme,\n getTheme,\n getThemePreference,\n ThemeProvider,\n useTheme,\n type ResolvedTheme,\n type Theme,\n} from './theme/theme-provider';\n\n// Re-export from Radix\nexport {Slot} from '@radix-ui/react-slot';\n\nexport {Toaster} from './components/sonner';\n\nexport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from './components/hover-card';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,aAAa;AACb,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAC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AC,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EACL,qBAAqB,GAGtB,MAAM,+BAA+B,CAAC;AAEvC,YAAY;AACZ,OAAO,EAAC,oBAAoB,EAAqB,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AAE/B,QAAQ;AACR,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,QAAQ,GAGT,MAAM,wBAAwB,CAAC;AAEhC,uBAAuB;AACvB,OAAO,EAAC,IAAI,EAAC,MAAM,sBAAsB,CAAC;AAE1C,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC","sourcesContent":["/**\n * {@include ../README.md}\n * @packageDocumentation\n */\n\n// Components\nexport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from './components/accordion';\n\nexport {Alert, AlertDescription, AlertTitle} from './components/alert';\n\nexport {AspectRatio} from './components/aspect-ratio';\n\nexport {Badge, badgeVariants, type BadgeProps} from './components/badge';\n\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from './components/breadcrumb';\n\nexport {Button, buttonVariants, type ButtonProps} from './components/button';\n\nexport {Calendar, type CalendarProps} from './components/calendar';\n\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from './components/card';\n\nexport {Checkbox} from './components/checkbox';\n\nexport {\n Combobox,\n type ComboboxContentProps,\n type ComboboxItemProps,\n type ComboboxRootProps,\n type ComboboxTriggerProps,\n} from './components/combobox';\nexport {\n useCombobox,\n type UseComboboxOptions,\n type UseComboboxReturn,\n} from './hooks/useCombobox';\n\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from './components/collapsible';\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n} from './components/command';\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n} from './components/context-menu';\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from './components/dialog';\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHandle,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n} from './components/drawer';\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from './components/dropdown-menu';\n\nexport {EditableText} from './components/editable-text';\n\nexport {ErrorBoundary} from './components/error-boundary';\n\nexport {ErrorPane} from './components/error-pane';\n\nexport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n useFormField,\n} from './components/form';\n\nexport {Input} from './components/input';\n\nexport {\n SettingsPanelHeader,\n type SettingsPanelHeaderProps,\n} from './components/settings-panel-header';\n\nexport {Label} from './components/label';\n\nexport {\n ModifierScrollOverlay,\n type ModifierScrollOverlayProps,\n} from './components/modifier-scroll-overlay';\n\nexport {\n Menubar,\n MenubarCheckboxItem,\n MenubarContent,\n MenubarGroup,\n MenubarItem,\n MenubarLabel,\n MenubarMenu,\n MenubarPortal,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n} from './components/menu-bar';\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from './components/pagination';\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from './components/popover';\n\nexport {ProgressModal} from './components/progress-modal';\n\nexport {Progress} from './components/progress';\n\nexport {RadioGroup, RadioGroupItem} from './components/radio-group';\n\nexport {\n ResizableHandle,\n ResizablePanel,\n ResizablePanelGroup,\n} from './components/resizable';\nexport type {\n ResizablePanelOrientation,\n ResizablePanelHandle,\n} from './components/resizable';\n\nexport {RunButton, type RunButtonProps} from './components/run-button';\n\nexport {\n TabStrip,\n type TabDescriptor,\n type TabStripDndMode,\n type TabStripDragData,\n type TabStripProps,\n} from './components/tab-strip';\n\nexport {ScrollableRow} from './components/scrollable-row';\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from './components/select';\n\nexport {ScrollArea, ScrollBar} from './components/scroll-area';\n\nexport {Separator} from './components/separator';\n\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetTitle,\n SheetTrigger,\n} from './components/sheet';\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n} from './components/sidebar';\n\nexport {SkeletonPane} from './components/skeleton-pane';\n\nexport {Skeleton} from './components/skeleton';\n\nexport {Slider} from './components/slider';\n\nexport {SpinnerPane} from './components/spinner-pane';\n\nexport {Spinner} from './components/spinner';\n\nexport {Switch} from './components/switch';\n\nexport {\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n} from './components/table';\n\nexport {Tabs, TabsContent, TabsList, TabsTrigger} from './components/tabs';\n\nexport {Textarea} from './components/textarea';\n\nexport {ThemeSwitch} from './components/theme-switch';\n\nexport {ToggleGroup, ToggleGroupItem} from './components/toggle-group';\n\nexport {Toggle, toggleVariants} from './components/toggle';\n\nexport {CopyButton, type CopyButtonProps} from './components/copy-button';\n\nexport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from './components/tooltip';\n\nexport {Tree, type TreeNodeData} from './components/tree';\n\n// Hooks\nexport {toast, type ExternalToast} from 'sonner';\n\nexport {\n useAspectRatioDimensions,\n type Dimensions,\n type UseAspectRatioDimensionsProps,\n} from './hooks/useAspectRatioDimensions';\n\nexport {\n useDisclosure,\n type UseDisclosureReturnValue,\n} from './hooks/useDisclosure';\n\nexport {useDebounce} from './hooks/useDebounce';\nexport {useDebouncedCallback} from './hooks/useDebouncedCallback';\nexport {useDebouncedValue} from './hooks/useDebouncedValue';\n\nexport {useIsMobile} from './hooks/use-mobile';\nexport {useRelativeCoordinates} from './hooks/useRelativeCoordinates';\n\nexport {\n useAutoResizeTextarea,\n type UseAutoResizeTextareaOptions,\n type UseAutoResizeTextareaResult,\n} from './hooks/useAutoResizeTextarea';\n\n// Utilities\nexport {resolveFontSizeClass, type FontSizeToken} from './lib/fontSize';\nexport {cn} from './lib/utils';\n\n// Theme\nexport {\n DEFAULT_THEME,\n DEFAULT_THEME_STORAGE_KEY,\n getResolvedTheme,\n getTheme,\n getThemePreference,\n ThemeProvider,\n useTheme,\n type ResolvedTheme,\n type Theme,\n} from './theme/theme-provider';\n\n// Re-export from Radix\nexport {Slot} from '@radix-ui/react-slot';\n\nexport {Toaster} from './components/sonner';\n\nexport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from './components/hover-card';\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.12",
|
|
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,23 @@
|
|
|
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
|
+
"@jest/globals": "^30.3.0",
|
|
72
|
+
"jsdom": "^29.1.1",
|
|
73
|
+
"ts-jest": "^29.4.4"
|
|
74
|
+
},
|
|
68
75
|
"peerDependencies": {
|
|
69
76
|
"tailwindcss": "^4.1.18"
|
|
70
77
|
},
|
|
71
78
|
"publishConfig": {
|
|
72
79
|
"access": "public"
|
|
73
80
|
},
|
|
74
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "f24a807aa57e52ce0a88207fc511849673a3fe03"
|
|
75
82
|
}
|
package/tailwind-preset.css
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
:root {
|
|
16
|
+
/* Native controls (color inputs, etc.): light UA chrome. */
|
|
17
|
+
color-scheme: light;
|
|
16
18
|
--background: 0 0% 100%;
|
|
17
19
|
--foreground: 240 10% 3.9%;
|
|
18
20
|
--card: 0 0% 100%;
|
|
@@ -67,7 +69,13 @@
|
|
|
67
69
|
--editor-lint-warning: 32 94% 48%;
|
|
68
70
|
}
|
|
69
71
|
|
|
72
|
+
.light {
|
|
73
|
+
color-scheme: light;
|
|
74
|
+
}
|
|
75
|
+
|
|
70
76
|
.dark {
|
|
77
|
+
/* Native controls: dark UA chrome. */
|
|
78
|
+
color-scheme: dark;
|
|
71
79
|
--background: 240 10% 3.9%;
|
|
72
80
|
--foreground: 0 0% 98%;
|
|
73
81
|
--card: 240 10% 3.9%;
|
|
@@ -214,6 +222,25 @@
|
|
|
214
222
|
appearance: none;
|
|
215
223
|
margin: 0;
|
|
216
224
|
}
|
|
225
|
+
|
|
226
|
+
.scrollbar-thin {
|
|
227
|
+
scrollbar-color: hsl(var(--border)) transparent;
|
|
228
|
+
scrollbar-width: thin;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.scrollbar-thin::-webkit-scrollbar {
|
|
232
|
+
width: 0.375rem;
|
|
233
|
+
height: 0.375rem;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.scrollbar-thin::-webkit-scrollbar-thumb {
|
|
237
|
+
background-color: hsl(var(--border));
|
|
238
|
+
border-radius: 9999px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.scrollbar-thin::-webkit-scrollbar-track {
|
|
242
|
+
background-color: transparent;
|
|
243
|
+
}
|
|
217
244
|
}
|
|
218
245
|
|
|
219
246
|
@layer components {
|