@gridui/input 4.0.0 → 4.0.1

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/index.js CHANGED
@@ -32,6 +32,17 @@ var controlVariants = cva(controlStyles(), {
32
32
  defaultVariants: { size: "standard" }
33
33
  });
34
34
 
35
+ // src/input/style.ts
36
+ import { cva as cva2 } from "class-variance-authority";
37
+ var inputStyles = cva2("", {
38
+ variants: {
39
+ grouped: {
40
+ true: "gridui-u-input--flex-1 gridui-u-input--w-0 gridui-u-input--border-0 gridui-u-input--bg-transparent",
41
+ false: ""
42
+ }
43
+ }
44
+ });
45
+
35
46
  // src/input/input.tsx
36
47
  import { cn as cn2 } from "@gridui/style-utils";
37
48
  import { jsx } from "react/jsx-runtime";
@@ -54,7 +65,7 @@ var Input = (props) => {
54
65
  onChange?.(event);
55
66
  onValueChange?.(event.currentTarget.value);
56
67
  },
57
- className: cn2(controlVariants({ size: controlSize }), groupSize && "gridui-u-input--flex-1 gridui-u-input--w-0 gridui-u-input--border-0 gridui-u-input--bg-transparent", className)
68
+ className: cn2(controlVariants({ size: controlSize }), inputStyles({ grouped: groupSize !== null }), className)
58
69
  }
59
70
  );
60
71
  };
@@ -117,12 +128,12 @@ var InputGroupButton = (props) => {
117
128
 
118
129
  // src/label/style.ts
119
130
  import { cn as cn6 } from "@gridui/style-utils";
120
- import { cva as cva2 } from "class-variance-authority";
121
- var labelStyles = cva2(cn6(
131
+ import { cva as cva3 } from "class-variance-authority";
132
+ var labelStyles = cva3(cn6(
122
133
  "gridui-label",
123
134
  "gridui-u-input--inline-flex gridui-u-input--items-center gridui-u-input--gap-gridui-4 gridui-u-input--type-ui"
124
135
  ));
125
- var labelIconStyles = cva2("gridui-u-input--inline-flex gridui-u-input--shrink-0 gridui-u-input--text-foreground gridui-u-input--[&>svg]:size-gridui-16");
136
+ var labelIconStyles = cva3("gridui-u-input--inline-flex gridui-u-input--shrink-0 gridui-u-input--text-foreground gridui-u-input--[&>svg]:size-gridui-16");
126
137
 
127
138
  // src/label/label.tsx
128
139
  import { cn as cn7 } from "@gridui/style-utils";
@@ -333,6 +344,21 @@ var ResizeHandle = (props) => {
333
344
  );
334
345
  };
335
346
 
347
+ // src/textarea/style.ts
348
+ import { cva as cva4 } from "class-variance-authority";
349
+ var textareaStyles = cva4(controlStyles(), {
350
+ variants: {
351
+ invalid: {
352
+ true: "gridui-u-input--border-danger-foreground",
353
+ false: ""
354
+ },
355
+ grouped: {
356
+ true: "gridui-u-input--border-0 gridui-u-input--border-inherit gridui-u-input--bg-transparent",
357
+ false: ""
358
+ }
359
+ }
360
+ });
361
+
336
362
  // src/textarea/use-textarea-footer-height.ts
337
363
  import { useLayoutEffect, useRef as useRef2, useState as useState2 } from "react";
338
364
  var useTextareaFooterHeight = (visible) => {
@@ -614,7 +640,10 @@ var Textarea = (props) => {
614
640
  hidden: restProps.hidden,
615
641
  inert: restProps.inert,
616
642
  style: sizing,
617
- className: cn8(controlStyles(), "gridui-textarea-frame", restProps["aria-invalid"] && restProps["aria-invalid"] !== "false" && "gridui-u-input--border-danger-foreground", groupSize && "gridui-u-input--border-0 gridui-u-input--border-inherit gridui-u-input--bg-transparent", className),
643
+ className: cn8(textareaStyles({
644
+ invalid: Boolean(restProps["aria-invalid"]) && restProps["aria-invalid"] !== "false",
645
+ grouped: groupSize !== null
646
+ }), "gridui-textarea-frame", className),
618
647
  "data-gridui-outline-target": groupSize === null ? "" : void 0,
619
648
  "data-control-size": controlSize,
620
649
  "data-grouped": groupSize !== null || void 0,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/shared/input-group-context.ts", "../src/shared/style.ts", "../src/input/input.tsx", "../src/input-group/input-group.tsx", "../src/input-group-addon/input-group-addon.tsx", "../src/input-group-button/input-group-button.tsx", "../src/label/style.ts", "../src/label/label.tsx", "../src/password-input/password-input.tsx", "../src/search-input/search-input.tsx", "../src/textarea/resize-handle.tsx", "../src/textarea/use-textarea-footer-height.ts", "../src/textarea/use-textarea-resize.ts", "../src/textarea/textarea.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Input\n * @namespace Shared\n * @description Input Group Context\n */\n\nimport { createContext, useContext } from \"react\";\n\nexport const inputGroupContext = createContext<\"standard\" | \"small\" | null>(null);\nexport const useInputGroupSize = () => {\n return useContext(inputGroupContext);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Shared\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const controlStyles = cva(cn(\n \"gridui-control\",\n \"gridui-u-input--min-w-0 gridui-u-input--w-full gridui-u-input--box-border gridui-u-input--border gridui-u-input--border-solid gridui-u-input--border-border gridui-u-input--rounded-control gridui-u-input--text-foreground gridui-u-input--bg-background gridui-u-input--type-input\",\n \"gridui-u-input--disabled:opacity-50 gridui-u-input--disabled:cursor-not-allowed\",\n \"gridui-u-input--aria-invalid:border-danger-foreground\",\n));\n\nexport const controlStandardStyles = cva(cn(\n \"gridui-control-standard\",\n \"gridui-u-input--p-gridui-8 gridui-u-input--min-h-gridui-control\",\n));\n\nexport const controlSmallStyles = cva(cn(\n \"gridui-control-small\",\n \"gridui-u-input--py-gridui-4 gridui-u-input--px-gridui-8 gridui-u-input--min-h-gridui-control-small\",\n));\n\nexport const controlVariants = cva(controlStyles(), {\n variants: {\n size: {\n standard: controlStandardStyles(),\n small: controlSmallStyles(),\n },\n },\n defaultVariants: { size: \"standard\" },\n});\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Input\n * @description Input\n */\n\nimport { useInputGroupSize } from \"../shared/input-group-context\";\nimport { controlVariants } from \"../shared/style\";\nimport type { TextControlOptions } from \"../shared/text-control-options\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type InputProps = ComponentPropsWithRef<\"input\"> & TextControlOptions;\n\nexport const Input: FC<InputProps> = (props: InputProps) => {\n const groupSize = useInputGroupSize();\n const {\n size,\n controlSize = groupSize ?? \"standard\",\n className,\n onChange,\n onValueChange,\n ...restProps\n } = props;\n return (<input\n {...restProps}\n size={size}\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n className={cn(controlVariants({ size: controlSize }), groupSize && \"gridui-u-input--flex-1 gridui-u-input--w-0 gridui-u-input--border-0 gridui-u-input--bg-transparent\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace InputGroup\n * @description Input Group\n */\n\nimport { inputGroupContext } from \"../shared/input-group-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type InputGroupProps = ComponentPropsWithRef<\"div\"> & {\n readonly controlSize?: \"standard\" | \"small\";\n};\nexport const InputGroup: FC<InputGroupProps> = (props: InputGroupProps) => {\n const { controlSize = \"standard\", className, children, ...restProps } = props;\n return (<inputGroupContext.Provider\n value={controlSize}\n >\n <div\n {...restProps}\n data-control-size={controlSize}\n data-gridui-outline-target=\"\"\n className={cn(\"gridui-input-group\", className)}\n >\n {children}\n </div>\n </inputGroupContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace InputGroupAddon\n * @description Input Group Addon\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type InputGroupAddonProps = ComponentPropsWithRef<\"div\"> & {\n readonly align?: \"inline-start\" | \"inline-end\" | \"block-start\" | \"block-end\";\n};\nexport const InputGroupAddon: FC<InputGroupAddonProps> = (props: InputGroupAddonProps) => {\n const { align = \"inline-start\", className, ...restProps } = props;\n return (<div\n {...restProps}\n data-align={align}\n className={cn(\"gridui-input-group-addon\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace InputGroupButton\n * @description Input Group Button\n */\n\nimport { useInputGroupSize } from \"../shared/input-group-context\";\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type InputGroupButtonProps = ButtonProps;\nexport const InputGroupButton: FC<InputGroupButtonProps> = (props: InputGroupButtonProps) => {\n const size = useInputGroupSize() ?? \"standard\";\n const { className, ...restProps } = props;\n return (<Button\n variant=\"quiet\"\n size={size}\n {...restProps}\n className={cn(\"gridui-input-group-button\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Label\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const labelStyles = cva(cn(\n \"gridui-label\",\n \"gridui-u-input--inline-flex gridui-u-input--items-center gridui-u-input--gap-gridui-4 gridui-u-input--type-ui\",\n));\n\nexport const labelIconStyles = cva(\"gridui-u-input--inline-flex gridui-u-input--shrink-0 gridui-u-input--text-foreground gridui-u-input--[&>svg]:size-gridui-16\");\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Label\n * @description Label\n */\n\nimport { labelIconStyles, labelStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type LabelProps = ComponentPropsWithRef<\"label\"> & {\n readonly icon?: ReactNode;\n};\n\nexport const Label: FC<LabelProps> = (props: LabelProps) => {\n const { icon, children, className, ...restProps } = props;\n return (<label\n {...restProps}\n className={cn(labelStyles(), className)}\n >\n {icon && (<span\n aria-hidden=\"true\"\n className={labelIconStyles()}\n >\n {icon}\n </span>)}\n {children}\n </label>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace PasswordInput\n * @description Password Input\n */\n\nimport { Input, type InputProps } from \"../input/input\";\nimport { InputGroup } from \"../input-group/input-group\";\nimport { InputGroupAddon } from \"../input-group-addon/input-group-addon\";\nimport { InputGroupButton } from \"../input-group-button/input-group-button\";\nimport { Eye, EyeOff } from \"lucide-react\";\nimport { type FC, useState } from \"react\";\n\nexport type PasswordInputProps = Omit<InputProps, \"type\"> & {\n readonly showLabel: string;\n readonly hideLabel: string;\n readonly rootClassName?: string;\n};\nexport const PasswordInput: FC<PasswordInputProps> = (props: PasswordInputProps) => {\n const { showLabel, hideLabel, rootClassName, controlSize = \"standard\", ...restProps } = props;\n const [\n visible,\n setVisible,\n ] = useState(false);\n return (<InputGroup\n controlSize={controlSize}\n dir={restProps.dir}\n className={rootClassName}\n >\n <Input\n {...restProps}\n type={visible ? \"text\" : \"password\"}\n />\n <InputGroupAddon\n align=\"inline-end\"\n >\n <InputGroupButton\n layout=\"icon\"\n aria-label={visible ? hideLabel : showLabel}\n disabled={restProps.disabled}\n onClick={() => {\n setVisible(current => {\n return !current;\n });\n }}\n >\n {visible ? (<EyeOff\n aria-hidden=\"true\"\n />) : (<Eye\n aria-hidden=\"true\"\n />)}\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace SearchInput\n * @description Search Input\n */\n\nimport { Input, type InputProps } from \"../input/input\";\nimport { InputGroup } from \"../input-group/input-group\";\nimport { InputGroupAddon } from \"../input-group-addon/input-group-addon\";\nimport { InputGroupButton } from \"../input-group-button/input-group-button\";\nimport { Search, X } from \"lucide-react\";\nimport { type FC, useImperativeHandle, useRef } from \"react\";\n\nexport type SearchInputProps = Omit<InputProps, \"type\"> & {\n readonly clearLabel: string;\n readonly loading?: boolean;\n readonly loadingLabel?: string;\n readonly rootClassName?: string;\n};\nexport const SearchInput: FC<SearchInputProps> = (props: SearchInputProps) => {\n const { clearLabel, loading = false, loadingLabel, rootClassName, controlSize = \"standard\", ref,\n onValueChange, ...restProps } = props;\n const input = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => {\n return input.current!;\n });\n return (<InputGroup\n controlSize={controlSize}\n dir={restProps.dir}\n className={rootClassName}\n >\n <Input\n {...restProps}\n ref={input}\n type=\"search\"\n aria-busy={loading || restProps[\"aria-busy\"]}\n onValueChange={(next) => {\n onValueChange?.(next);\n }}\n />\n <InputGroupAddon\n aria-hidden=\"true\"\n >\n <Search\n size={16}\n />\n </InputGroupAddon>\n <InputGroupAddon\n align=\"inline-end\"\n >\n {loading && (<span\n role=\"status\"\n >\n {loadingLabel}\n </span>)}\n <InputGroupButton\n layout=\"icon\"\n aria-label={clearLabel}\n disabled={restProps.disabled || restProps.readOnly}\n onClick={() => {\n const element = input.current;\n if (!element || element.matches(\":disabled\") || element.readOnly) {\n return;\n }\n if (element.value !== \"\") {\n if (restProps.value === undefined) {\n element.value = \"\";\n }\n onValueChange?.(\"\");\n }\n element.focus();\n }}\n >\n <X\n aria-hidden=\"true\"\n />\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Resize Handle\n */\n\nimport { GripHorizontal, MoveVertical } from \"lucide-react\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ResizeHandleProps = ComponentPropsWithRef<\"button\"> & {\n readonly variant: \"corner\" | \"edge\" | \"footer\";\n readonly label: string;\n readonly controlId: string;\n readonly dragging: boolean;\n};\n\nexport const ResizeHandle: FC<ResizeHandleProps> = (props: ResizeHandleProps) => {\n const { variant, label, controlId, dragging, ...restProps } = props;\n const Icon = variant === \"edge\" ? GripHorizontal : MoveVertical;\n return (<button\n {...restProps}\n type=\"button\"\n className=\"gridui-textarea-resize-handle\"\n data-variant={variant}\n data-dragging={dragging || undefined}\n aria-label={label}\n aria-controls={controlId}\n aria-keyshortcuts=\"ArrowUp ArrowDown Home End Enter Space\"\n >\n <Icon\n size={16}\n aria-hidden=\"true\"\n />\n </button>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Use Textarea Footer Height\n */\n\nimport { useLayoutEffect, useRef, useState } from \"react\";\n\nexport const useTextareaFooterHeight = (visible: boolean) => {\n const ref = useRef<HTMLDivElement>(null);\n const [\n height,\n setHeight,\n ] = useState<number>();\n useLayoutEffect(() => {\n const footer = ref.current;\n if (!visible || !footer) {\n return;\n }\n const measure = () => {\n setHeight(parseFloat(footer.ownerDocument.defaultView!.getComputedStyle(footer).height));\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(footer);\n return () => {\n observer.disconnect();\n };\n }, [visible]);\n return {\n ref,\n height: visible ? height : undefined,\n };\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Use Textarea Resize\n */\n\nimport { isComposingKeyEvent, listenForDragCancellation } from \"@gridui/interaction\";\nimport { type ComponentPropsWithRef, type CSSProperties, type RefObject, useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\ntype ResizeOptions = {\n readonly frame: RefObject<HTMLDivElement | null>;\n readonly input: RefObject<HTMLTextAreaElement | null>;\n readonly enabled: boolean;\n readonly disabled: boolean;\n};\n\ntype Drag = {\n readonly pointerId: number;\n readonly startY: number;\n readonly startHeight: number;\n readonly previousHeight: CSSProperties[\"height\"];\n readonly scale: number;\n readonly handle: HTMLButtonElement;\n readonly cleanup: () => void;\n};\n\nconst getResizeGeometry = (frame: HTMLDivElement) => {\n const style = frame.ownerDocument.defaultView!.getComputedStyle(frame);\n return {\n height: parseFloat(style.height),\n maximum: style.maxHeight === \"none\" ? undefined : style.maxHeight,\n scale: frame.getBoundingClientRect().height / frame.offsetHeight || 1,\n };\n};\n\nconst releaseDrag = (drag: Drag): void => {\n drag.cleanup();\n if (drag.handle.hasPointerCapture(drag.pointerId)) {\n drag.handle.releasePointerCapture(drag.pointerId);\n }\n};\n\nexport const useTextareaResize = ({ frame, input, enabled, disabled }: ResizeOptions): {\n height: CSSProperties[\"height\"];\n dragging: boolean;\n handleProps: ComponentPropsWithRef<\"button\">;\n} => {\n const [\n height,\n setHeight,\n ] = useState<CSSProperties[\"height\"]>();\n const [\n dragging,\n setDragging,\n ] = useState(false);\n const drag = useRef<Drag | null>(null);\n const blocked = (): boolean => {\n return !enabled || disabled || !input.current || input.current.matches(\":disabled\") || input.current.inert;\n };\n const finish = (restore: boolean): void => {\n const active = drag.current;\n if (!active) {\n return;\n }\n drag.current = null;\n releaseDrag(active);\n if (restore) {\n setHeight(active.previousHeight);\n }\n setDragging(false);\n };\n const cancel = useRef(() => {\n return;\n });\n useLayoutEffect(() => {\n cancel.current = () => {\n finish(true);\n };\n if (blocked()) {\n finish(true);\n }\n });\n useLayoutEffect(() => {\n if (!enabled) {\n setHeight(undefined);\n }\n }, [enabled]);\n useEffect(() => {\n return () => {\n cancel.current();\n };\n }, []);\n const handleRef = useCallback((handle: HTMLButtonElement | null) => {\n if (!handle) {\n return;\n }\n return () => {\n if (handle.ownerDocument.activeElement === handle) {\n input.current?.focus({ preventScroll: true });\n }\n };\n }, [input]);\n const update = (next: CSSProperties[\"height\"]): void => {\n if (blocked() || !frame.current) {\n finish(true);\n return;\n }\n // CSS resolves constraints, including percentages and content-dependent minima.\n setHeight(typeof next === \"number\" ? Math.max(0, next) : next);\n };\n const reset = (): void => {\n if (!blocked()) {\n finish(false);\n setHeight(undefined);\n }\n };\n const handleProps: ComponentPropsWithRef<\"button\"> = {\n ref: handleRef,\n onPointerDown: (event) => {\n if (blocked() || event.button !== 0 || !event.isPrimary || drag.current || !frame.current) {\n return;\n }\n const bounds = getResizeGeometry(frame.current);\n const handle = event.currentTarget;\n event.preventDefault();\n handle.focus({ preventScroll: true });\n drag.current = {\n pointerId: event.pointerId,\n startY: event.clientY,\n startHeight: bounds.height,\n previousHeight: height,\n scale: bounds.scale,\n handle,\n cleanup: listenForDragCancellation(handle, () => {\n cancel.current();\n }),\n };\n handle.setPointerCapture(event.pointerId);\n setDragging(true);\n },\n onPointerMove: (event) => {\n const active = drag.current;\n if (active?.pointerId === event.pointerId) {\n update(active.startHeight + (event.clientY - active.startY) / active.scale);\n }\n },\n onPointerUp: (event) => {\n if (drag.current?.pointerId === event.pointerId) {\n finish(blocked());\n }\n },\n onPointerCancel: (event) => {\n if (drag.current?.pointerId === event.pointerId) {\n finish(true);\n }\n },\n onLostPointerCapture: (event) => {\n if (drag.current?.pointerId === event.pointerId) {\n finish(true);\n }\n },\n onKeyDown: (event) => {\n if (blocked() || drag.current || !frame.current || isComposingKeyEvent(event.nativeEvent)) {\n return;\n }\n const bounds = getResizeGeometry(frame.current);\n const step = event.shiftKey ? 64 : 16;\n let next: CSSProperties[\"height\"];\n switch (event.key) {\n case \"ArrowUp\": next = bounds.height - step; break;\n case \"ArrowDown\": next = bounds.height + step; break;\n case \"Home\": next = 0; break;\n case \"End\":\n if (bounds.maximum === undefined) {\n return;\n }\n next = bounds.maximum;\n break;\n default: return;\n }\n event.preventDefault();\n update(next);\n },\n onClick: (event) => {\n // Keyboard and assistive-technology activation restore the natural height.\n if (event.detail === 0) {\n reset();\n }\n },\n onDoubleClick: reset,\n };\n return {\n height,\n dragging,\n handleProps,\n };\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Textarea\n */\n\nimport { useInputGroupSize } from \"../shared/input-group-context\";\nimport { controlStyles } from \"../shared/style\";\nimport type { TextControlOptions } from \"../shared/text-control-options\";\nimport { ResizeHandle } from \"./resize-handle\";\nimport { useTextareaFooterHeight } from \"./use-textarea-footer-height\";\nimport { useTextareaResize } from \"./use-textarea-resize\";\nimport { useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type CSSProperties, type FC, type ReactNode, useId, useImperativeHandle, useRef } from \"react\";\n\nexport type TextareaProps = ComponentPropsWithRef<\"textarea\"> & TextControlOptions & {\n readonly autoSize?: boolean;\n readonly maxHeight?: number;\n readonly maxRows?: number;\n /** Manual resize affordance. Automatic sizing always hides it. */\n readonly resizeHandle?: \"corner\" | \"edge\" | \"footer\" | false;\n readonly resizeLabel?: string;\n /** Caller-owned footer content; footer handles share this row. */\n readonly footer?: ReactNode;\n};\nexport const Textarea: FC<TextareaProps> = (props: TextareaProps) => {\n const groupSize = useInputGroupSize();\n const { controlSize = groupSize ?? \"standard\", className, onChange, onValueChange, ref, autoSize = false,\n maxHeight, maxRows, rows = 2, style, resizeHandle = \"edge\", resizeLabel = \"Resize text area\", footer, ...restProps } = props;\n if (maxHeight !== undefined && (!Number.isFinite(maxHeight) || maxHeight <= 0)) {\n throw new RangeError(\"Textarea maxHeight must be finite and positive.\");\n }\n if (maxRows !== undefined && (!Number.isSafeInteger(maxRows) || maxRows < rows)) {\n throw new RangeError(\"Textarea maxRows must be an integer at least as large as rows.\");\n }\n if (maxHeight !== undefined && maxRows !== undefined) {\n throw new RangeError(\"Textarea accepts either maxRows or maxHeight, not both.\");\n }\n const frame = useRef<HTMLDivElement>(null);\n const input = useRef<HTMLTextAreaElement>(null);\n const generatedId = useId();\n const inputId = restProps.id ?? generatedId;\n useImperativeHandle(ref, () => {\n return input.current!;\n }, []);\n const scrollRef = useScrollbars<HTMLTextAreaElement>({ ref: input });\n const manual = !autoSize && resizeHandle !== false;\n const resize = useTextareaResize({\n frame,\n input,\n enabled: manual,\n disabled: Boolean(restProps.disabled),\n });\n const hasFooter = footer !== undefined && footer !== null && typeof footer !== \"boolean\";\n const showFooter = hasFooter || manual && resizeHandle === \"footer\";\n const footerLayout = useTextareaFooterHeight(showFooter);\n const handle = manual ? (<ResizeHandle\n {...resize.handleProps}\n variant={resizeHandle}\n label={resizeLabel}\n controlId={inputId}\n dragging={resize.dragging}\n disabled={restProps.disabled}\n />) : null;\n const sizing: CSSProperties & Record<`--${string}`, string | number | undefined> = {\n \"--_gridui-textarea-rows\": rows,\n \"--_gridui-textarea-max-rows\": maxRows,\n \"--_gridui-textarea-footer-height\": footerLayout.height === undefined ? undefined : `${footerLayout.height}px`,\n ...style,\n ...(maxHeight !== undefined ? { maxHeight } : {}),\n ...(manual && resize.height !== undefined ? { height: resize.height } : {}),\n };\n return (<div\n ref={frame}\n dir={restProps.dir}\n lang={restProps.lang}\n hidden={restProps.hidden}\n inert={restProps.inert}\n style={sizing}\n className={cn(controlStyles(), \"gridui-textarea-frame\", restProps[\"aria-invalid\"] && restProps[\"aria-invalid\"] !== \"false\" && \"gridui-u-input--border-danger-foreground\", groupSize && \"gridui-u-input--border-0 gridui-u-input--border-inherit gridui-u-input--bg-transparent\", className)}\n data-gridui-outline-target={groupSize === null ? \"\" : undefined}\n data-control-size={controlSize}\n data-grouped={groupSize !== null || undefined}\n data-autosize={autoSize || undefined}\n data-max-rows={maxRows !== undefined || undefined}\n data-resize-handle={manual ? resizeHandle : undefined}\n data-footer={hasFooter || undefined}\n >\n <textarea\n {...restProps}\n id={inputId}\n ref={scrollRef}\n rows={rows}\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n className=\"gridui-textarea\"\n />\n {manual && resizeHandle !== \"footer\" && (<div\n className=\"gridui-textarea-resize-row\"\n >\n {handle}\n </div>)}\n {showFooter && (<div\n ref={footerLayout.ref}\n className=\"gridui-textarea-footer\"\n >\n <div\n className=\"gridui-textarea-footer-content\"\n >\n {footer}\n </div>\n {resizeHandle === \"footer\" && handle}\n </div>)}\n </div>);\n};\n"],
5
- "mappings": ";AAOA,SAAS,eAAe,kBAAkB;AAEnC,IAAM,oBAAoB,cAA2C,IAAI;AACzE,IAAM,oBAAoB,MAAM;AACnC,SAAO,WAAW,iBAAiB;AACvC;;;ACLA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,gBAAgB,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,wBAAwB,IAAI;AAAA,EACrC;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,qBAAqB,IAAI;AAAA,EAClC;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,kBAAkB,IAAI,cAAc,GAAG;AAAA,EAChD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,UAAU,sBAAsB;AAAA,MAChC,OAAO,mBAAmB;AAAA,IAC9B;AAAA,EACJ;AAAA,EACA,iBAAiB,EAAE,MAAM,WAAW;AACxC,CAAC;;;ACzBD,SAAS,MAAAA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AA;AAAA,QAClC;AAAA;AAAA;AAAA,EACJ;AACJ;",
6
- "names": ["cn", "cn", "jsx", "cn", "jsx", "cn", "jsx", "cn", "cva", "cn", "jsx", "jsx", "jsxs", "jsx", "jsxs", "jsx", "useRef", "useState", "useLayoutEffect", "useRef", "useState", "cn", "useImperativeHandle", "useRef", "jsx", "jsxs"]
3
+ "sources": ["../src/shared/input-group-context.ts", "../src/shared/style.ts", "../src/input/style.ts", "../src/input/input.tsx", "../src/input-group/input-group.tsx", "../src/input-group-addon/input-group-addon.tsx", "../src/input-group-button/input-group-button.tsx", "../src/label/style.ts", "../src/label/label.tsx", "../src/password-input/password-input.tsx", "../src/search-input/search-input.tsx", "../src/textarea/resize-handle.tsx", "../src/textarea/style.ts", "../src/textarea/use-textarea-footer-height.ts", "../src/textarea/use-textarea-resize.ts", "../src/textarea/textarea.tsx"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Input\n * @namespace Shared\n * @description Input Group Context\n */\n\nimport { createContext, useContext } from \"react\";\n\nexport const inputGroupContext = createContext<\"standard\" | \"small\" | null>(null);\nexport const useInputGroupSize = () => {\n return useContext(inputGroupContext);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Shared\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const controlStyles = cva(cn(\n \"gridui-control\",\n \"gridui-u-input--min-w-0 gridui-u-input--w-full gridui-u-input--box-border gridui-u-input--border gridui-u-input--border-solid gridui-u-input--border-border gridui-u-input--rounded-control gridui-u-input--text-foreground gridui-u-input--bg-background gridui-u-input--type-input\",\n \"gridui-u-input--disabled:opacity-50 gridui-u-input--disabled:cursor-not-allowed\",\n \"gridui-u-input--aria-invalid:border-danger-foreground\",\n));\n\nexport const controlStandardStyles = cva(cn(\n \"gridui-control-standard\",\n \"gridui-u-input--p-gridui-8 gridui-u-input--min-h-gridui-control\",\n));\n\nexport const controlSmallStyles = cva(cn(\n \"gridui-control-small\",\n \"gridui-u-input--py-gridui-4 gridui-u-input--px-gridui-8 gridui-u-input--min-h-gridui-control-small\",\n));\n\nexport const controlVariants = cva(controlStyles(), {\n variants: {\n size: {\n standard: controlStandardStyles(),\n small: controlSmallStyles(),\n },\n },\n defaultVariants: { size: \"standard\" },\n});\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Input\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const inputStyles = cva(\"\", {\n variants: {\n grouped: {\n true: \"gridui-u-input--flex-1 gridui-u-input--w-0 gridui-u-input--border-0 gridui-u-input--bg-transparent\",\n false: \"\",\n },\n },\n});\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Input\n * @description Input\n */\n\nimport { useInputGroupSize } from \"../shared/input-group-context\";\nimport { controlVariants } from \"../shared/style\";\nimport type { TextControlOptions } from \"../shared/text-control-options\";\nimport { inputStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type InputProps = ComponentPropsWithRef<\"input\"> & TextControlOptions;\n\nexport const Input: FC<InputProps> = (props: InputProps) => {\n const groupSize = useInputGroupSize();\n const {\n size,\n controlSize = groupSize ?? \"standard\",\n className,\n onChange,\n onValueChange,\n ...restProps\n } = props;\n return (<input\n {...restProps}\n size={size}\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n className={cn(controlVariants({ size: controlSize }), inputStyles({ grouped: groupSize !== null }), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace InputGroup\n * @description Input Group\n */\n\nimport { inputGroupContext } from \"../shared/input-group-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type InputGroupProps = ComponentPropsWithRef<\"div\"> & {\n readonly controlSize?: \"standard\" | \"small\";\n};\nexport const InputGroup: FC<InputGroupProps> = (props: InputGroupProps) => {\n const { controlSize = \"standard\", className, children, ...restProps } = props;\n return (<inputGroupContext.Provider\n value={controlSize}\n >\n <div\n {...restProps}\n data-control-size={controlSize}\n data-gridui-outline-target=\"\"\n className={cn(\"gridui-input-group\", className)}\n >\n {children}\n </div>\n </inputGroupContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace InputGroupAddon\n * @description Input Group Addon\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type InputGroupAddonProps = ComponentPropsWithRef<\"div\"> & {\n readonly align?: \"inline-start\" | \"inline-end\" | \"block-start\" | \"block-end\";\n};\nexport const InputGroupAddon: FC<InputGroupAddonProps> = (props: InputGroupAddonProps) => {\n const { align = \"inline-start\", className, ...restProps } = props;\n return (<div\n {...restProps}\n data-align={align}\n className={cn(\"gridui-input-group-addon\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace InputGroupButton\n * @description Input Group Button\n */\n\nimport { useInputGroupSize } from \"../shared/input-group-context\";\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type InputGroupButtonProps = ButtonProps;\nexport const InputGroupButton: FC<InputGroupButtonProps> = (props: InputGroupButtonProps) => {\n const size = useInputGroupSize() ?? \"standard\";\n const { className, ...restProps } = props;\n return (<Button\n variant=\"quiet\"\n size={size}\n {...restProps}\n className={cn(\"gridui-input-group-button\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Label\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const labelStyles = cva(cn(\n \"gridui-label\",\n \"gridui-u-input--inline-flex gridui-u-input--items-center gridui-u-input--gap-gridui-4 gridui-u-input--type-ui\",\n));\n\nexport const labelIconStyles = cva(\"gridui-u-input--inline-flex gridui-u-input--shrink-0 gridui-u-input--text-foreground gridui-u-input--[&>svg]:size-gridui-16\");\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Label\n * @description Label\n */\n\nimport { labelIconStyles, labelStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type LabelProps = ComponentPropsWithRef<\"label\"> & {\n readonly icon?: ReactNode;\n};\n\nexport const Label: FC<LabelProps> = (props: LabelProps) => {\n const { icon, children, className, ...restProps } = props;\n return (<label\n {...restProps}\n className={cn(labelStyles(), className)}\n >\n {icon && (<span\n aria-hidden=\"true\"\n className={labelIconStyles()}\n >\n {icon}\n </span>)}\n {children}\n </label>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace PasswordInput\n * @description Password Input\n */\n\nimport { Input, type InputProps } from \"../input/input\";\nimport { InputGroup } from \"../input-group/input-group\";\nimport { InputGroupAddon } from \"../input-group-addon/input-group-addon\";\nimport { InputGroupButton } from \"../input-group-button/input-group-button\";\nimport { Eye, EyeOff } from \"lucide-react\";\nimport { type FC, useState } from \"react\";\n\nexport type PasswordInputProps = Omit<InputProps, \"type\"> & {\n readonly showLabel: string;\n readonly hideLabel: string;\n readonly rootClassName?: string;\n};\nexport const PasswordInput: FC<PasswordInputProps> = (props: PasswordInputProps) => {\n const { showLabel, hideLabel, rootClassName, controlSize = \"standard\", ...restProps } = props;\n const [\n visible,\n setVisible,\n ] = useState(false);\n return (<InputGroup\n controlSize={controlSize}\n dir={restProps.dir}\n className={rootClassName}\n >\n <Input\n {...restProps}\n type={visible ? \"text\" : \"password\"}\n />\n <InputGroupAddon\n align=\"inline-end\"\n >\n <InputGroupButton\n layout=\"icon\"\n aria-label={visible ? hideLabel : showLabel}\n disabled={restProps.disabled}\n onClick={() => {\n setVisible(current => {\n return !current;\n });\n }}\n >\n {visible ? (<EyeOff\n aria-hidden=\"true\"\n />) : (<Eye\n aria-hidden=\"true\"\n />)}\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace SearchInput\n * @description Search Input\n */\n\nimport { Input, type InputProps } from \"../input/input\";\nimport { InputGroup } from \"../input-group/input-group\";\nimport { InputGroupAddon } from \"../input-group-addon/input-group-addon\";\nimport { InputGroupButton } from \"../input-group-button/input-group-button\";\nimport { Search, X } from \"lucide-react\";\nimport { type FC, useImperativeHandle, useRef } from \"react\";\n\nexport type SearchInputProps = Omit<InputProps, \"type\"> & {\n readonly clearLabel: string;\n readonly loading?: boolean;\n readonly loadingLabel?: string;\n readonly rootClassName?: string;\n};\nexport const SearchInput: FC<SearchInputProps> = (props: SearchInputProps) => {\n const { clearLabel, loading = false, loadingLabel, rootClassName, controlSize = \"standard\", ref,\n onValueChange, ...restProps } = props;\n const input = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => {\n return input.current!;\n });\n return (<InputGroup\n controlSize={controlSize}\n dir={restProps.dir}\n className={rootClassName}\n >\n <Input\n {...restProps}\n ref={input}\n type=\"search\"\n aria-busy={loading || restProps[\"aria-busy\"]}\n onValueChange={(next) => {\n onValueChange?.(next);\n }}\n />\n <InputGroupAddon\n aria-hidden=\"true\"\n >\n <Search\n size={16}\n />\n </InputGroupAddon>\n <InputGroupAddon\n align=\"inline-end\"\n >\n {loading && (<span\n role=\"status\"\n >\n {loadingLabel}\n </span>)}\n <InputGroupButton\n layout=\"icon\"\n aria-label={clearLabel}\n disabled={restProps.disabled || restProps.readOnly}\n onClick={() => {\n const element = input.current;\n if (!element || element.matches(\":disabled\") || element.readOnly) {\n return;\n }\n if (element.value !== \"\") {\n if (restProps.value === undefined) {\n element.value = \"\";\n }\n onValueChange?.(\"\");\n }\n element.focus();\n }}\n >\n <X\n aria-hidden=\"true\"\n />\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Resize Handle\n */\n\nimport { GripHorizontal, MoveVertical } from \"lucide-react\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ResizeHandleProps = ComponentPropsWithRef<\"button\"> & {\n readonly variant: \"corner\" | \"edge\" | \"footer\";\n readonly label: string;\n readonly controlId: string;\n readonly dragging: boolean;\n};\n\nexport const ResizeHandle: FC<ResizeHandleProps> = (props: ResizeHandleProps) => {\n const { variant, label, controlId, dragging, ...restProps } = props;\n const Icon = variant === \"edge\" ? GripHorizontal : MoveVertical;\n return (<button\n {...restProps}\n type=\"button\"\n className=\"gridui-textarea-resize-handle\"\n data-variant={variant}\n data-dragging={dragging || undefined}\n aria-label={label}\n aria-controls={controlId}\n aria-keyshortcuts=\"ArrowUp ArrowDown Home End Enter Space\"\n >\n <Icon\n size={16}\n aria-hidden=\"true\"\n />\n </button>);\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Style\n */\n\nimport { controlStyles } from \"../shared/style\";\nimport { cva } from \"class-variance-authority\";\n\nexport const textareaStyles = cva(controlStyles(), {\n variants: {\n invalid: {\n true: \"gridui-u-input--border-danger-foreground\",\n false: \"\",\n },\n grouped: {\n true: \"gridui-u-input--border-0 gridui-u-input--border-inherit gridui-u-input--bg-transparent\",\n false: \"\",\n },\n },\n});\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Use Textarea Footer Height\n */\n\nimport { useLayoutEffect, useRef, useState } from \"react\";\n\nexport const useTextareaFooterHeight = (visible: boolean) => {\n const ref = useRef<HTMLDivElement>(null);\n const [\n height,\n setHeight,\n ] = useState<number>();\n useLayoutEffect(() => {\n const footer = ref.current;\n if (!visible || !footer) {\n return;\n }\n const measure = () => {\n setHeight(parseFloat(footer.ownerDocument.defaultView!.getComputedStyle(footer).height));\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(footer);\n return () => {\n observer.disconnect();\n };\n }, [visible]);\n return {\n ref,\n height: visible ? height : undefined,\n };\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Use Textarea Resize\n */\n\nimport { isComposingKeyEvent, listenForDragCancellation } from \"@gridui/interaction\";\nimport { type ComponentPropsWithRef, type CSSProperties, type RefObject, useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\ntype ResizeOptions = {\n readonly frame: RefObject<HTMLDivElement | null>;\n readonly input: RefObject<HTMLTextAreaElement | null>;\n readonly enabled: boolean;\n readonly disabled: boolean;\n};\n\ntype Drag = {\n readonly pointerId: number;\n readonly startY: number;\n readonly startHeight: number;\n readonly previousHeight: CSSProperties[\"height\"];\n readonly scale: number;\n readonly handle: HTMLButtonElement;\n readonly cleanup: () => void;\n};\n\nconst getResizeGeometry = (frame: HTMLDivElement) => {\n const style = frame.ownerDocument.defaultView!.getComputedStyle(frame);\n return {\n height: parseFloat(style.height),\n maximum: style.maxHeight === \"none\" ? undefined : style.maxHeight,\n scale: frame.getBoundingClientRect().height / frame.offsetHeight || 1,\n };\n};\n\nconst releaseDrag = (drag: Drag): void => {\n drag.cleanup();\n if (drag.handle.hasPointerCapture(drag.pointerId)) {\n drag.handle.releasePointerCapture(drag.pointerId);\n }\n};\n\nexport const useTextareaResize = ({ frame, input, enabled, disabled }: ResizeOptions): {\n height: CSSProperties[\"height\"];\n dragging: boolean;\n handleProps: ComponentPropsWithRef<\"button\">;\n} => {\n const [\n height,\n setHeight,\n ] = useState<CSSProperties[\"height\"]>();\n const [\n dragging,\n setDragging,\n ] = useState(false);\n const drag = useRef<Drag | null>(null);\n const blocked = (): boolean => {\n return !enabled || disabled || !input.current || input.current.matches(\":disabled\") || input.current.inert;\n };\n const finish = (restore: boolean): void => {\n const active = drag.current;\n if (!active) {\n return;\n }\n drag.current = null;\n releaseDrag(active);\n if (restore) {\n setHeight(active.previousHeight);\n }\n setDragging(false);\n };\n const cancel = useRef(() => {\n return;\n });\n useLayoutEffect(() => {\n cancel.current = () => {\n finish(true);\n };\n if (blocked()) {\n finish(true);\n }\n });\n useLayoutEffect(() => {\n if (!enabled) {\n setHeight(undefined);\n }\n }, [enabled]);\n useEffect(() => {\n return () => {\n cancel.current();\n };\n }, []);\n const handleRef = useCallback((handle: HTMLButtonElement | null) => {\n if (!handle) {\n return;\n }\n return () => {\n if (handle.ownerDocument.activeElement === handle) {\n input.current?.focus({ preventScroll: true });\n }\n };\n }, [input]);\n const update = (next: CSSProperties[\"height\"]): void => {\n if (blocked() || !frame.current) {\n finish(true);\n return;\n }\n // CSS resolves constraints, including percentages and content-dependent minima.\n setHeight(typeof next === \"number\" ? Math.max(0, next) : next);\n };\n const reset = (): void => {\n if (!blocked()) {\n finish(false);\n setHeight(undefined);\n }\n };\n const handleProps: ComponentPropsWithRef<\"button\"> = {\n ref: handleRef,\n onPointerDown: (event) => {\n if (blocked() || event.button !== 0 || !event.isPrimary || drag.current || !frame.current) {\n return;\n }\n const bounds = getResizeGeometry(frame.current);\n const handle = event.currentTarget;\n event.preventDefault();\n handle.focus({ preventScroll: true });\n drag.current = {\n pointerId: event.pointerId,\n startY: event.clientY,\n startHeight: bounds.height,\n previousHeight: height,\n scale: bounds.scale,\n handle,\n cleanup: listenForDragCancellation(handle, () => {\n cancel.current();\n }),\n };\n handle.setPointerCapture(event.pointerId);\n setDragging(true);\n },\n onPointerMove: (event) => {\n const active = drag.current;\n if (active?.pointerId === event.pointerId) {\n update(active.startHeight + (event.clientY - active.startY) / active.scale);\n }\n },\n onPointerUp: (event) => {\n if (drag.current?.pointerId === event.pointerId) {\n finish(blocked());\n }\n },\n onPointerCancel: (event) => {\n if (drag.current?.pointerId === event.pointerId) {\n finish(true);\n }\n },\n onLostPointerCapture: (event) => {\n if (drag.current?.pointerId === event.pointerId) {\n finish(true);\n }\n },\n onKeyDown: (event) => {\n if (blocked() || drag.current || !frame.current || isComposingKeyEvent(event.nativeEvent)) {\n return;\n }\n const bounds = getResizeGeometry(frame.current);\n const step = event.shiftKey ? 64 : 16;\n let next: CSSProperties[\"height\"];\n switch (event.key) {\n case \"ArrowUp\": next = bounds.height - step; break;\n case \"ArrowDown\": next = bounds.height + step; break;\n case \"Home\": next = 0; break;\n case \"End\":\n if (bounds.maximum === undefined) {\n return;\n }\n next = bounds.maximum;\n break;\n default: return;\n }\n event.preventDefault();\n update(next);\n },\n onClick: (event) => {\n // Keyboard and assistive-technology activation restore the natural height.\n if (event.detail === 0) {\n reset();\n }\n },\n onDoubleClick: reset,\n };\n return {\n height,\n dragging,\n handleProps,\n };\n};\n", "/**\n * @author WMXPY\n * @package Input\n * @namespace Textarea\n * @description Textarea\n */\n\nimport { useInputGroupSize } from \"../shared/input-group-context\";\nimport type { TextControlOptions } from \"../shared/text-control-options\";\nimport { ResizeHandle } from \"./resize-handle\";\nimport { textareaStyles } from \"./style\";\nimport { useTextareaFooterHeight } from \"./use-textarea-footer-height\";\nimport { useTextareaResize } from \"./use-textarea-resize\";\nimport { useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type CSSProperties, type FC, type ReactNode, useId, useImperativeHandle, useRef } from \"react\";\n\nexport type TextareaProps = ComponentPropsWithRef<\"textarea\"> & TextControlOptions & {\n readonly autoSize?: boolean;\n readonly maxHeight?: number;\n readonly maxRows?: number;\n /** Manual resize affordance. Automatic sizing always hides it. */\n readonly resizeHandle?: \"corner\" | \"edge\" | \"footer\" | false;\n readonly resizeLabel?: string;\n /** Caller-owned footer content; footer handles share this row. */\n readonly footer?: ReactNode;\n};\nexport const Textarea: FC<TextareaProps> = (props: TextareaProps) => {\n const groupSize = useInputGroupSize();\n const { controlSize = groupSize ?? \"standard\", className, onChange, onValueChange, ref, autoSize = false,\n maxHeight, maxRows, rows = 2, style, resizeHandle = \"edge\", resizeLabel = \"Resize text area\", footer, ...restProps } = props;\n if (maxHeight !== undefined && (!Number.isFinite(maxHeight) || maxHeight <= 0)) {\n throw new RangeError(\"Textarea maxHeight must be finite and positive.\");\n }\n if (maxRows !== undefined && (!Number.isSafeInteger(maxRows) || maxRows < rows)) {\n throw new RangeError(\"Textarea maxRows must be an integer at least as large as rows.\");\n }\n if (maxHeight !== undefined && maxRows !== undefined) {\n throw new RangeError(\"Textarea accepts either maxRows or maxHeight, not both.\");\n }\n const frame = useRef<HTMLDivElement>(null);\n const input = useRef<HTMLTextAreaElement>(null);\n const generatedId = useId();\n const inputId = restProps.id ?? generatedId;\n useImperativeHandle(ref, () => {\n return input.current!;\n }, []);\n const scrollRef = useScrollbars<HTMLTextAreaElement>({ ref: input });\n const manual = !autoSize && resizeHandle !== false;\n const resize = useTextareaResize({\n frame,\n input,\n enabled: manual,\n disabled: Boolean(restProps.disabled),\n });\n const hasFooter = footer !== undefined && footer !== null && typeof footer !== \"boolean\";\n const showFooter = hasFooter || manual && resizeHandle === \"footer\";\n const footerLayout = useTextareaFooterHeight(showFooter);\n const handle = manual ? (<ResizeHandle\n {...resize.handleProps}\n variant={resizeHandle}\n label={resizeLabel}\n controlId={inputId}\n dragging={resize.dragging}\n disabled={restProps.disabled}\n />) : null;\n const sizing: CSSProperties & Record<`--${string}`, string | number | undefined> = {\n \"--_gridui-textarea-rows\": rows,\n \"--_gridui-textarea-max-rows\": maxRows,\n \"--_gridui-textarea-footer-height\": footerLayout.height === undefined ? undefined : `${footerLayout.height}px`,\n ...style,\n ...(maxHeight !== undefined ? { maxHeight } : {}),\n ...(manual && resize.height !== undefined ? { height: resize.height } : {}),\n };\n return (<div\n ref={frame}\n dir={restProps.dir}\n lang={restProps.lang}\n hidden={restProps.hidden}\n inert={restProps.inert}\n style={sizing}\n className={cn(textareaStyles({\n invalid: Boolean(restProps[\"aria-invalid\"]) && restProps[\"aria-invalid\"] !== \"false\",\n grouped: groupSize !== null,\n }), \"gridui-textarea-frame\", className)}\n data-gridui-outline-target={groupSize === null ? \"\" : undefined}\n data-control-size={controlSize}\n data-grouped={groupSize !== null || undefined}\n data-autosize={autoSize || undefined}\n data-max-rows={maxRows !== undefined || undefined}\n data-resize-handle={manual ? resizeHandle : undefined}\n data-footer={hasFooter || undefined}\n >\n <textarea\n {...restProps}\n id={inputId}\n ref={scrollRef}\n rows={rows}\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n className=\"gridui-textarea\"\n />\n {manual && resizeHandle !== \"footer\" && (<div\n className=\"gridui-textarea-resize-row\"\n >\n {handle}\n </div>)}\n {showFooter && (<div\n ref={footerLayout.ref}\n className=\"gridui-textarea-footer\"\n >\n <div\n className=\"gridui-textarea-footer-content\"\n >\n {footer}\n </div>\n {resizeHandle === \"footer\" && handle}\n </div>)}\n </div>);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,eAAe,kBAAkB;AAEnC,IAAM,oBAAoB,cAA2C,IAAI;AACzE,IAAM,oBAAoB,MAAM;AACnC,SAAO,WAAW,iBAAiB;AACvC;;;ACLA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,gBAAgB,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,wBAAwB,IAAI;AAAA,EACrC;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,qBAAqB,IAAI;AAAA,EAClC;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,kBAAkB,IAAI,cAAc,GAAG;AAAA,EAChD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,UAAU,sBAAsB;AAAA,MAChC,OAAO,mBAAmB;AAAA,IAC9B;AAAA,EACJ;AAAA,EACA,iBAAiB,EAAE,MAAM,WAAW;AACxC,CAAC;;;AC5BD,SAAS,OAAAA,YAAW;AAEb,IAAM,cAAcA,KAAI,IAAI;AAAA,EAC/B,UAAU;AAAA,IACN,SAAS;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,EACJ;AACJ,CAAC;;;ACLD,SAAS,MAAAC,WAAU;AAeP;AAVL,IAAM,QAAwB,CAAC,UAAsB;AACxD,QAAM,YAAY,kBAAkB;AACpC,QAAM;AAAA,IACF;AAAA,IACA,cAAc,aAAa;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ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,8BAAAD;AAAA,gBAAC;AAAA;AAAA,kBACG,WAAU;AAAA,kBAET;AAAA;AAAA,cACL;AAAA,cACC,iBAAiB,YAAY;AAAA;AAAA;AAAA,QAClC;AAAA;AAAA;AAAA,EACJ;AACJ;",
6
+ "names": ["cva", "cn", "cn", "jsx", "cn", "jsx", "cn", "jsx", "cn", "cva", "cn", "jsx", "jsx", "jsxs", "jsx", "jsxs", "jsx", "cva", "useRef", "useState", "useLayoutEffect", "useRef", "useState", "cn", "useImperativeHandle", "useRef", "jsx", "jsxs"]
7
7
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Input
4
+ * @namespace Input
5
+ * @description Style
6
+ */
7
+ export declare const inputStyles: (props?: ({
8
+ grouped?: boolean | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
package/dist/styles.css CHANGED
@@ -190,8 +190,6 @@
190
190
  }
191
191
  &[data-grouped] {
192
192
  --_gridui-textarea-border: 0px;
193
- border: 0;
194
- background: transparent;
195
193
  }
196
194
  &[data-resize-handle="edge"] {
197
195
  --_gridui-textarea-resize-height: var(--gridui-space-24);
@@ -205,9 +203,6 @@
205
203
  &[data-max-rows] {
206
204
  max-height: calc(var(--_gridui-textarea-max-rows) * 1lh + 2 * var(--_gridui-textarea-padding) + var(--_gridui-textarea-chrome));
207
205
  }
208
- &:has(> textarea[aria-invalid="true"]) {
209
- border-color: var(--gridui-danger-foreground);
210
- }
211
206
  &:not([data-grouped]):has(> textarea:focus-visible) {
212
207
  outline: var(--gridui-focus-width) solid var(--gridui-focus-color);
213
208
  outline-offset: var(--gridui-focus-offset);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Input
4
+ * @namespace Textarea
5
+ * @description Style
6
+ */
7
+ export declare const textareaStyles: (props?: ({
8
+ invalid?: boolean | null | undefined;
9
+ grouped?: boolean | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
package/docs/catalog.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/input",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "category": "core",
6
6
  "description": "GridUI React input",
7
7
  "usage": "`Label` owns inline label alignment and an optional decorative `icon` slot. Icons use the standard 16px token size without an ancestor layout styling labels.",
@@ -118,6 +118,7 @@
118
118
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/multiline.mdx",
119
119
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/password-entry.mdx",
120
120
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/search-entry.mdx",
121
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/text-fields.mdx",
121
122
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/input-group.stories.tsx",
122
123
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/input.stories.tsx",
123
124
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/password-input.stories.tsx",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/input",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "GridUI React input",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,18 +27,18 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/button": "^5.0.0",
30
+ "@gridui/button": "^5.0.1",
31
31
  "@gridui/interaction": "^1.2.1",
32
- "@gridui/overlay": "^2.1.0",
32
+ "@gridui/overlay": "^2.2.0",
33
33
  "@gridui/style-utils": "^4.0.0",
34
- "@gridui/theme": "^2.5.4",
34
+ "@gridui/theme": "^2.6.0",
35
35
  "class-variance-authority": "0.7.1",
36
- "lucide-react": "1.70.0"
36
+ "lucide-react": "1.72.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@gridui-internal/configuration": "0.0.0-internal",
40
40
  "@jest/globals": "30.5.2",
41
- "@storybook/react-vite": "10.6.6",
41
+ "@storybook/react-vite": "10.6.7",
42
42
  "@types/jest": "30.0.0",
43
43
  "@types/node": "26.6.6",
44
44
  "@types/react": "19.3.0",
@@ -51,7 +51,6 @@
51
51
  "scripts": {
52
52
  "build": "node ../../scripts/compilation/package.ts",
53
53
  "compile": "tsc --project tsconfig.json",
54
- "test": "jest",
55
- "coverage": "jest --coverage"
54
+ "test": "jest"
56
55
  }
57
56
  }