@gridui/resizable 0.0.0 → 1.0.2

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
@@ -25,6 +25,7 @@ var keyboardSize = (key, size, step, horizontal, reverse, min, max) => {
25
25
 
26
26
  // src/resizable/resizable.tsx
27
27
  import { isComposingKeyEvent, listenForDragCancellation } from "@gridui/interaction";
28
+ import { useInteractionOutline } from "@gridui/overlay";
28
29
  import { cn } from "@gridui/style-utils";
29
30
  import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
30
31
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -51,6 +52,8 @@ var Resizable = (props) => {
51
52
  ] = useState(defaultSize);
52
53
  const drag = useRef(null);
53
54
  const separator = useRef(null);
55
+ const firstRef = useInteractionOutline({});
56
+ const secondRef = useInteractionOutline({});
54
57
  const firstId = useId();
55
58
  const secondId = useId();
56
59
  const current = constrainSize(size ?? local, minSize, maxSize);
@@ -115,6 +118,7 @@ var Resizable = (props) => {
115
118
  "div",
116
119
  {
117
120
  id: firstId,
121
+ ref: firstRef,
118
122
  className: "gridui-resizable-panel",
119
123
  children: first
120
124
  }
@@ -201,6 +205,7 @@ var Resizable = (props) => {
201
205
  "div",
202
206
  {
203
207
  id: secondId,
208
+ ref: secondRef,
204
209
  className: "gridui-resizable-panel",
205
210
  children: second
206
211
  }
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/resizable/size.ts", "../src/resizable/resizable.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Resizable\n * @namespace Resizable\n * @description Size\n */\n\nexport const constrainSize = (size: number, min: number, max: number): number => {\n if (!Number.isFinite(size) || !Number.isFinite(min) || !Number.isFinite(max) || min < 0 || max > 100 || min > max) {\n throw new RangeError(\"Resizable requires finite percentages and 0 <= minSize <= maxSize <= 100.\");\n }\n return Math.min(max, Math.max(min, size));\n};\n\nexport const pointerSize = (size: number, delta: number, extent: number, reverse: boolean, min: number, max: number): number => {\n return constrainSize(extent > 0 ? size + delta / extent * 100 * (reverse ? -1 : 1) : size, min, max);\n};\n\nexport const keyboardSize = (key: string, size: number, step: number, horizontal: boolean, reverse: boolean, min: number, max: number): number | null => {\n if (key === \"Home\") {\n return min;\n }\n if (key === \"End\") {\n return max;\n }\n const positive = horizontal ? \"ArrowRight\" : \"ArrowDown\";\n const negative = horizontal ? \"ArrowLeft\" : \"ArrowUp\";\n if (key !== positive && key !== negative) {\n return null;\n }\n return constrainSize(size + (key === positive ? 1 : -1) * (horizontal && reverse ? -1 : 1) * step, min, max);\n};\n", "/**\n * @author WMXPY\n * @package Resizable\n * @namespace Resizable\n * @description Resizable\n */\n\nimport { constrainSize, keyboardSize, pointerSize } from \"./size\";\nimport { isComposingKeyEvent, listenForDragCancellation } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode, useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\n\nexport type ResizableProps = Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"onChange\"> & {\n readonly first: ReactNode;\n readonly second: ReactNode;\n readonly label: string;\n readonly orientation?: \"horizontal\" | \"vertical\";\n readonly size?: number;\n readonly defaultSize?: number;\n readonly minSize?: number;\n readonly maxSize?: number;\n readonly step?: number;\n readonly disabled?: boolean;\n readonly onSizeChange?: (size: number) => void;\n};\n\ntype Drag = {\n readonly pointerId: number;\n readonly start: number;\n readonly size: number;\n readonly extent: number;\n readonly reverse: boolean;\n readonly horizontal: boolean;\n readonly element: HTMLDivElement;\n readonly cleanup: () => void;\n};\n\nexport const Resizable: FC<ResizableProps> = (props: ResizableProps) => {\n const { first, second, label, orientation = \"horizontal\", size, defaultSize = 50, minSize = 10, maxSize = 90,\n step = 1, disabled = false, onSizeChange, className, style, ...restProps } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultSize);\n const drag = useRef<Drag | null>(null);\n const separator = useRef<HTMLDivElement>(null);\n const firstId = useId();\n const secondId = useId();\n const current = constrainSize(size ?? local, minSize, maxSize);\n if (!Number.isFinite(step) || step <= 0) {\n throw new RangeError(\"Resizable step must be a positive finite percentage.\");\n }\n const horizontal = orientation === \"horizontal\";\n const update = (next: number) => {\n if (disabled) {\n return;\n }\n if (size === undefined) {\n setLocal(next);\n }\n if (next !== current) {\n onSizeChange?.(next);\n }\n };\n const cancel = () => {\n const active = drag.current;\n if (!active) {\n return;\n }\n drag.current = null;\n active.cleanup();\n const next = constrainSize(active.size, minSize, maxSize);\n if (size === undefined) {\n setLocal(next);\n }\n if (next !== current) {\n onSizeChange?.(next);\n }\n if (active.element.hasPointerCapture(active.pointerId)) {\n active.element.releasePointerCapture(active.pointerId);\n }\n };\n const cancelRef = useRef(cancel);\n cancelRef.current = cancel;\n useEffect(() => {\n return () => {\n cancelRef.current();\n };\n }, []);\n useLayoutEffect(() => {\n if (disabled || (drag.current && drag.current.horizontal !== horizontal)) {\n cancel();\n }\n });\n const tracks = `minmax(0, ${current}fr) var(--gridui-resizable-handle-size, 12px) minmax(0, ${100 - current}fr)`;\n return (<div\n {...restProps}\n className={cn(\"gridui-resizable\", className)}\n data-orientation={orientation}\n style={{\n ...style,\n ...(horizontal ? { gridTemplateColumns: tracks } : { gridTemplateRows: tracks }),\n }}\n >\n <div\n id={firstId}\n className=\"gridui-resizable-panel\"\n >\n {first}\n </div>\n <div\n ref={separator}\n role=\"separator\"\n aria-label={label}\n aria-controls={`${firstId} ${secondId}`}\n aria-orientation={horizontal ? \"vertical\" : \"horizontal\"}\n aria-valuemin={minSize}\n aria-valuemax={maxSize}\n aria-valuenow={Math.round(current * 100) / 100}\n aria-valuetext={`${Math.round(current)}%`}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : 0}\n className=\"gridui-resizable-handle\"\n onKeyDown={(event) => {\n if (disabled || event.defaultPrevented || isComposingKeyEvent(event.nativeEvent)) {\n return;\n }\n const reverse = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const next = keyboardSize(event.key, current, step * (event.shiftKey ? 10 : 1), horizontal, reverse, minSize, maxSize);\n if (next !== null) {\n event.preventDefault();\n update(next);\n }\n }}\n onPointerDown={(event) => {\n if (disabled || event.button !== 0 || !event.isPrimary || drag.current) {\n return;\n }\n const handle = event.currentTarget;\n const bounds = handle.parentElement?.getBoundingClientRect();\n if (!bounds) {\n return;\n }\n const handleBounds = handle.getBoundingClientRect();\n drag.current = {\n pointerId: event.pointerId,\n start: horizontal ? event.clientX : event.clientY,\n size: current,\n extent: horizontal ? bounds.width - handleBounds.width : bounds.height - handleBounds.height,\n reverse: horizontal && getComputedStyle(handle).direction === \"rtl\",\n horizontal,\n element: handle,\n cleanup: listenForDragCancellation(handle, () => {\n cancelRef.current();\n }),\n };\n handle.focus();\n handle.setPointerCapture(event.pointerId);\n event.preventDefault();\n }}\n onPointerMove={(event) => {\n const active = drag.current;\n if (!active || active.pointerId !== event.pointerId) {\n return;\n }\n const coordinate = horizontal ? event.clientX : event.clientY;\n update(pointerSize(active.size, coordinate - active.start, active.extent, active.reverse, minSize, maxSize));\n }}\n onPointerUp={(event) => {\n if (drag.current?.pointerId === event.pointerId) {\n const active = drag.current;\n drag.current = null;\n active.cleanup();\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }\n }}\n onPointerCancel={(event) => {\n if (drag.current?.pointerId === event.pointerId) {\n cancel();\n }\n }}\n onLostPointerCapture={cancel}\n />\n <div\n id={secondId}\n className=\"gridui-resizable-panel\"\n >\n {second}\n </div>\n </div>);\n};\n"],
5
- "mappings": ";AAOO,IAAM,gBAAgB,CAAC,MAAc,KAAa,QAAwB;AAC7E,MAAI,CAAC,OAAO,SAAS,IAAI,KAAK,CAAC,OAAO,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,GAAG,KAAK,MAAM,KAAK,MAAM,OAAO,MAAM,KAAK;AAC/G,UAA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,gBACN,QAAQ,aAAa,OAAO,QAAQ,aAAa,QAAQ,OAAO,SAAS,aAAa;AAAA,gBACtF,SAAS,cAAc,iBAAiB,MAAM,EAAE,cAAc;AAAA,gBAC9D;AAAA,gBACA,SAAS;AAAA,gBACT,SAAS,0BAA0B,QAAQ,MAAM;AAC7C,4BAAU,QAAQ;AAAA,gBACtB,CAAC;AAAA,cACL;AACA,qBAAO,MAAM;AACb,qBAAO,kBAAkB,MAAM,SAAS;AACxC,oBAAM,eAAe;AAAA,YACzB;AAAA,YACA,eAAe,CAAC,UAAU;AACtB,oBAAM,SAAS,KAAK;AACpB,kBAAI,CAAC,UAAU,OAAO,cAAc,MAAM,WAAW;AACjD;AAAA,cACJ;AACA,oBAAM,aAAa,aAAa,MAAM,UAAU,MAAM;AACtD,qBAAO,YAAY,OAAO,MAAM,aAAa,OAAO,OAAO,OAAO,QAAQ,OAAO,SAAS,SAAS,OAAO,CAAC;AAAA,YAC/G;AAAA,YACA,aAAa,CAAC,UAAU;AACpB,kBAAI,KAAK,SAAS,cAAc,MAAM,WAAW;AAC7C,sBAAM,SAAS,KAAK;AACpB,qBAAK,UAAU;AACf,uBAAO,QAAQ;AACf,oBAAI,MAAM,cAAc,kBAAkB,MAAM,SAAS,GAAG;AACxD,wBAAM,cAAc,sBAAsB,MAAM,SAAS;AAAA,gBAC7D;AAAA,cACJ;AAAA,YACJ;AAAA,YACA,iBAAiB,CAAC,UAAU;AACxB,kBAAI,KAAK,SAAS,cAAc,MAAM,WAAW;AAC7C,uBAAO;AAAA,cACX;AAAA,YACJ;AAAA,YACA,sBAAsB;AAAA;AAAA,QAC1B;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACG,IAAI;AAAA,YACJ,WAAU;AAAA,YAET;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Resizable\n * @namespace Resizable\n * @description Size\n */\n\nexport const constrainSize = (size: number, min: number, max: number): number => {\n if (!Number.isFinite(size) || !Number.isFinite(min) || !Number.isFinite(max) || min < 0 || max > 100 || min > max) {\n throw new RangeError(\"Resizable requires finite percentages and 0 <= minSize <= maxSize <= 100.\");\n }\n return Math.min(max, Math.max(min, size));\n};\n\nexport const pointerSize = (size: number, delta: number, extent: number, reverse: boolean, min: number, max: number): number => {\n return constrainSize(extent > 0 ? size + delta / extent * 100 * (reverse ? -1 : 1) : size, min, max);\n};\n\nexport const keyboardSize = (key: string, size: number, step: number, horizontal: boolean, reverse: boolean, min: number, max: number): number | null => {\n if (key === \"Home\") {\n return min;\n }\n if (key === \"End\") {\n return max;\n }\n const positive = horizontal ? \"ArrowRight\" : \"ArrowDown\";\n const negative = horizontal ? \"ArrowLeft\" : \"ArrowUp\";\n if (key !== positive && key !== negative) {\n return null;\n }\n return constrainSize(size + (key === positive ? 1 : -1) * (horizontal && reverse ? -1 : 1) * step, min, max);\n};\n", "/**\n * @author WMXPY\n * @package Resizable\n * @namespace Resizable\n * @description Resizable\n */\n\nimport { constrainSize, keyboardSize, pointerSize } from \"./size\";\nimport { isComposingKeyEvent, listenForDragCancellation } from \"@gridui/interaction\";\nimport { useInteractionOutline } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode, useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\n\nexport type ResizableProps = Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"onChange\"> & {\n readonly first: ReactNode;\n readonly second: ReactNode;\n readonly label: string;\n readonly orientation?: \"horizontal\" | \"vertical\";\n readonly size?: number;\n readonly defaultSize?: number;\n readonly minSize?: number;\n readonly maxSize?: number;\n readonly step?: number;\n readonly disabled?: boolean;\n readonly onSizeChange?: (size: number) => void;\n};\n\ntype Drag = {\n readonly pointerId: number;\n readonly start: number;\n readonly size: number;\n readonly extent: number;\n readonly reverse: boolean;\n readonly horizontal: boolean;\n readonly element: HTMLDivElement;\n readonly cleanup: () => void;\n};\n\nexport const Resizable: FC<ResizableProps> = (props: ResizableProps) => {\n const { first, second, label, orientation = \"horizontal\", size, defaultSize = 50, minSize = 10, maxSize = 90,\n step = 1, disabled = false, onSizeChange, className, style, ...restProps } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultSize);\n const drag = useRef<Drag | null>(null);\n const separator = useRef<HTMLDivElement>(null);\n const firstRef = useInteractionOutline<HTMLDivElement>({});\n const secondRef = useInteractionOutline<HTMLDivElement>({});\n const firstId = useId();\n const secondId = useId();\n const current = constrainSize(size ?? local, minSize, maxSize);\n if (!Number.isFinite(step) || step <= 0) {\n throw new RangeError(\"Resizable step must be a positive finite percentage.\");\n }\n const horizontal = orientation === \"horizontal\";\n const update = (next: number) => {\n if (disabled) {\n return;\n }\n if (size === undefined) {\n setLocal(next);\n }\n if (next !== current) {\n onSizeChange?.(next);\n }\n };\n const cancel = () => {\n const active = drag.current;\n if (!active) {\n return;\n }\n drag.current = null;\n active.cleanup();\n const next = constrainSize(active.size, minSize, maxSize);\n if (size === undefined) {\n setLocal(next);\n }\n if (next !== current) {\n onSizeChange?.(next);\n }\n if (active.element.hasPointerCapture(active.pointerId)) {\n active.element.releasePointerCapture(active.pointerId);\n }\n };\n const cancelRef = useRef(cancel);\n cancelRef.current = cancel;\n useEffect(() => {\n return () => {\n cancelRef.current();\n };\n }, []);\n useLayoutEffect(() => {\n if (disabled || (drag.current && drag.current.horizontal !== horizontal)) {\n cancel();\n }\n });\n const tracks = `minmax(0, ${current}fr) var(--gridui-resizable-handle-size, 12px) minmax(0, ${100 - current}fr)`;\n return (<div\n {...restProps}\n className={cn(\"gridui-resizable\", className)}\n data-orientation={orientation}\n style={{\n ...style,\n ...(horizontal ? { gridTemplateColumns: tracks } : { gridTemplateRows: tracks }),\n }}\n >\n <div\n id={firstId}\n ref={firstRef}\n className=\"gridui-resizable-panel\"\n >\n {first}\n </div>\n <div\n ref={separator}\n role=\"separator\"\n aria-label={label}\n aria-controls={`${firstId} ${secondId}`}\n aria-orientation={horizontal ? \"vertical\" : \"horizontal\"}\n aria-valuemin={minSize}\n aria-valuemax={maxSize}\n aria-valuenow={Math.round(current * 100) / 100}\n aria-valuetext={`${Math.round(current)}%`}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : 0}\n className=\"gridui-resizable-handle\"\n onKeyDown={(event) => {\n if (disabled || event.defaultPrevented || isComposingKeyEvent(event.nativeEvent)) {\n return;\n }\n const reverse = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const next = keyboardSize(event.key, current, step * (event.shiftKey ? 10 : 1), horizontal, reverse, minSize, maxSize);\n if (next !== null) {\n event.preventDefault();\n update(next);\n }\n }}\n onPointerDown={(event) => {\n if (disabled || event.button !== 0 || !event.isPrimary || drag.current) {\n return;\n }\n const handle = event.currentTarget;\n const bounds = handle.parentElement?.getBoundingClientRect();\n if (!bounds) {\n return;\n }\n const handleBounds = handle.getBoundingClientRect();\n drag.current = {\n pointerId: event.pointerId,\n start: horizontal ? event.clientX : event.clientY,\n size: current,\n extent: horizontal ? bounds.width - handleBounds.width : bounds.height - handleBounds.height,\n reverse: horizontal && getComputedStyle(handle).direction === \"rtl\",\n horizontal,\n element: handle,\n cleanup: listenForDragCancellation(handle, () => {\n cancelRef.current();\n }),\n };\n handle.focus();\n handle.setPointerCapture(event.pointerId);\n event.preventDefault();\n }}\n onPointerMove={(event) => {\n const active = drag.current;\n if (!active || active.pointerId !== event.pointerId) {\n return;\n }\n const coordinate = horizontal ? event.clientX : event.clientY;\n update(pointerSize(active.size, coordinate - active.start, active.extent, active.reverse, minSize, maxSize));\n }}\n onPointerUp={(event) => {\n if (drag.current?.pointerId === event.pointerId) {\n const active = drag.current;\n drag.current = null;\n active.cleanup();\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }\n }}\n onPointerCancel={(event) => {\n if (drag.current?.pointerId === event.pointerId) {\n cancel();\n }\n }}\n onLostPointerCapture={cancel}\n />\n <div\n id={sec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A,cACJ;AAAA,YACJ;AAAA,YACA,iBAAiB,CAAC,UAAU;AACxB,kBAAI,KAAK,SAAS,cAAc,MAAM,WAAW;AAC7C,uBAAO;AAAA,cACX;AAAA,YACJ;AAAA,YACA,sBAAsB;AAAA;AAAA,QAC1B;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACG,IAAI;AAAA,YACJ,KAAK;AAAA,YACL,WAAU;AAAA,YAET;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
6
6
  "names": []
7
7
  }
package/dist/styles.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
2
  @layer theme, base, components, utilities;
3
3
  @layer utilities;
4
4
  @layer components {
package/docs/catalog.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/resizable",
4
- "version": "0.0.0",
4
+ "version": "1.0.2",
5
5
  "category": "layout",
6
6
  "description": "GridUI React resizable",
7
7
  "usage": "Two independently scrolling regions separated by a keyboard and pointer resizer. Resizable owns its separator; surrounding Grid regions continue to own outer seams.",
@@ -22,6 +22,7 @@
22
22
  ],
23
23
  "styles": [
24
24
  "@gridui/theme/styles.css",
25
+ "@gridui/overlay/styles.css",
25
26
  "@gridui/resizable/styles.css"
26
27
  ],
27
28
  "examples": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/resizable",
3
- "version": "0.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "GridUI React resizable",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,14 +27,15 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/interaction": "^1.1.2",
31
- "@gridui/style-utils": "^2.2.0",
32
- "@gridui/theme": "^2.5.1"
30
+ "@gridui/interaction": "^1.2.1",
31
+ "@gridui/overlay": "^2.0.0",
32
+ "@gridui/style-utils": "^3.0.0",
33
+ "@gridui/theme": "^2.5.3"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@gridui-internal/configuration": "0.0.0-internal",
36
37
  "@jest/globals": "30.5.2",
37
- "@storybook/react-vite": "10.6.5",
38
+ "@storybook/react-vite": "10.6.6",
38
39
  "@types/jest": "30.0.0",
39
40
  "@types/node": "26.6.6",
40
41
  "@types/react": "19.3.0",