etudes 28.2.2 → 28.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ export type UseDragOptions = {
17
17
  *
18
18
  * @param startPosition The element that was dragged.
19
19
  */
20
- onDragStart?: (startPosition: Point) => void;
20
+ onDragStart?: (startPosition: Point.Point) => void;
21
21
  /**
22
22
  * Handler invoked when dragging.
23
23
  *
@@ -27,7 +27,7 @@ export type UseDragOptions = {
27
27
  * at.
28
28
  * @param startPosition The position (in pixels) where the drag started.
29
29
  */
30
- onDragMove?: (displacement: Point, currentPosition: Point, startPosition: Point) => void;
30
+ onDragMove?: (displacement: Point.Point, currentPosition: Point.Point, startPosition: Point.Point) => void;
31
31
  /**
32
32
  * Handler invoked when dragging ends.
33
33
  *
@@ -36,7 +36,7 @@ export type UseDragOptions = {
36
36
  * @param endPosition The position (in pixels) where the drag ended.
37
37
  * @param startPosition The position (in pixels) where the drag started.
38
38
  */
39
- onDragEnd?: (displacement: Point, endPosition: Point, startPosition: Point) => void;
39
+ onDragEnd?: (displacement: Point.Point, endPosition: Point.Point, startPosition: Point.Point) => void;
40
40
  };
41
41
  /**
42
42
  * Hook for adding dragging interaction to an element.
@@ -23,4 +23,4 @@ export type UseImageSizeOptions = {
23
23
  * @returns The actual size of the image if loading was successful, `undefined`
24
24
  * otherwise.
25
25
  */
26
- export declare function useImageSize({ sizes, src, srcSet, }: UseImageSizeParams, { preservesSizeBetweenLoads, onError, onLoad, onLoadStart, }?: UseImageSizeOptions): Size | undefined;
26
+ export declare function useImageSize({ sizes, src, srcSet, }: UseImageSizeParams, { preservesSizeBetweenLoads, onError, onLoad, onLoadStart, }?: UseImageSizeOptions): Size.Size | undefined;
@@ -12,7 +12,7 @@ export type UseInertiaDragOptions = {
12
12
  /**
13
13
  * Handler invoked when dragging starts.
14
14
  */
15
- onDragStart?: (startPosition: Point) => void;
15
+ onDragStart?: (startPosition: Point.Point) => void;
16
16
  /**
17
17
  * Handler invoked when dragging.
18
18
  *
@@ -22,14 +22,14 @@ export type UseInertiaDragOptions = {
22
22
  * currently at.
23
23
  * @param startPosition The position (in pixels) where the drag started.
24
24
  */
25
- onDragMove?: (displacement: Point, currentPosition: Point, startPosition: Point) => void;
25
+ onDragMove?: (displacement: Point.Point, currentPosition: Point.Point, startPosition: Point.Point) => void;
26
26
  /**
27
27
  * Handler invoked when dragging ends.
28
28
  *
29
29
  * @param endPosition The position (in pixels) where the drag ended.
30
30
  * @param startPosition The position (in pixels) where the drag started.
31
31
  */
32
- onDragEnd?: (endPosition: Point, startPosition: Point) => void;
32
+ onDragEnd?: (endPosition: Point.Point, startPosition: Point.Point) => void;
33
33
  } & Omit<InteractDraggableOptions, 'onend' | 'onmove' | 'onstart'>;
34
34
  /**
35
35
  * Hook for adding dragging interaction to an element.
@@ -6,6 +6,6 @@ import { Rect } from 'spase';
6
6
  *
7
7
  * @param target The target element or reference.
8
8
  *
9
- * @returns The most current {@link Rect} of the target element.
9
+ * @returns The most current rect of the target element.
10
10
  */
11
- export declare function useRect(target: HTMLElement | null | RefObject<HTMLElement> | RefObject<HTMLElement | null> | RefObject<HTMLElement | undefined> | undefined): Rect;
11
+ export declare function useRect(target: HTMLElement | null | RefObject<HTMLElement> | RefObject<HTMLElement | null> | RefObject<HTMLElement | undefined> | undefined): Rect.Rect;
@@ -1,10 +1,10 @@
1
1
  import { DependencyList, RefObject } from 'react';
2
2
  import { Point } from 'spase';
3
3
  export type ScrollPositionInfo = {
4
- current: Point;
5
- end: Point;
6
- progress: Point;
7
- start: Point;
4
+ current: Point.Point;
5
+ end: Point.Point;
6
+ progress: Point.Point;
7
+ start: Point.Point;
8
8
  };
9
9
  type Target = HTMLElement | null | RefObject<HTMLElement> | RefObject<HTMLElement | null> | RefObject<HTMLElement | undefined> | undefined;
10
10
  /**
@@ -5,6 +5,6 @@ import { Size } from 'spase';
5
5
  *
6
6
  * @param target Reference to the target element.
7
7
  *
8
- * @returns The most current {@link Size} of the target element.
8
+ * @returns The most current size of the target element.
9
9
  */
10
- export declare function useSize(target: HTMLElement | null | RefObject<HTMLElement> | RefObject<HTMLElement | null> | RefObject<HTMLElement | undefined> | undefined): Size;
10
+ export declare function useSize(target: HTMLElement | null | RefObject<HTMLElement> | RefObject<HTMLElement | null> | RefObject<HTMLElement | undefined> | undefined): Size.Size;
@@ -19,5 +19,5 @@ type UseVideoSizeOptions = {
19
19
  * @returns The actual size of the video if loading was successful, `undefined`
20
20
  * otherwise.
21
21
  */
22
- export declare function useVideoSize(src?: string, { preservesSizeBetweenLoads, onError, onLoad, onLoadStart, }?: UseVideoSizeOptions): Size | undefined;
22
+ export declare function useVideoSize(src?: string, { preservesSizeBetweenLoads, onError, onLoad, onLoadStart, }?: UseVideoSizeOptions): Size.Size | undefined;
23
23
  export {};
@@ -4,4 +4,4 @@ import { Size } from 'spase';
4
4
  *
5
5
  * @returns The most current viewport size.
6
6
  */
7
- export declare function useViewportSize(): Size;
7
+ export declare function useViewportSize(): Size.Size;
@@ -45,7 +45,7 @@ export declare namespace Image {
45
45
  *
46
46
  * @param size Size of the loaded image.
47
47
  */
48
- onSizeChange?: (size?: Size) => void;
48
+ onSizeChange?: (size?: Size.Size) => void;
49
49
  } & Omit<ImgHTMLAttributes<HTMLImageElement>, 'alt' | 'loading' | 'onError' | 'onLoad' | 'onLoadStart' | 'sizes' | 'src' | 'srcSet'>;
50
50
  }
51
51
  /**
@@ -77,7 +77,7 @@ export declare namespace Panorama {
77
77
  * @param size The actual size of the loaded image. If no images are loaded
78
78
  * yet, the size is `undefined`.
79
79
  */
80
- onImageSizeChange?: (size?: Size) => void;
80
+ onImageSizeChange?: (size?: Size.Size) => void;
81
81
  } & Omit<HTMLAttributes<HTMLDivElement>, 'aria-valuenow' | 'role'>;
82
82
  }
83
83
  /**
@@ -7,7 +7,7 @@ import { HTMLAttributes, Ref } from 'react';
7
7
  * @exports Select.Option Component for each option.
8
8
  * @exports Select.Toggle Component for the toggle.
9
9
  */
10
- export declare function Select<T extends string>({ id, ref, children, formatValue, name, options, placeholder, value, isRequired, onChange, ...props }: Select.Props<T>): import("react/jsx-runtime").JSX.Element;
10
+ export declare function Select<T extends string>({ id, ref, children, name, options, placeholder, value, isRequired, formatValue, onChange, ...props }: Select.Props<T>): import("react/jsx-runtime").JSX.Element;
11
11
  export declare namespace Select {
12
12
  var displayName: string;
13
13
  }
@@ -77,7 +77,7 @@ export declare namespace Video {
77
77
  *
78
78
  * @param size The new size of the video.
79
79
  */
80
- onSizeChange?: (size?: Size) => void;
80
+ onSizeChange?: (size?: Size.Size) => void;
81
81
  /**
82
82
  * Handler invoked when the video time updates.
83
83
  *
@@ -9,4 +9,4 @@ import { Size } from 'spase';
9
9
  * @returns The intrinsic size of the element, considering the max width
10
10
  * constraint if provided.
11
11
  */
12
- export declare function measureIntrinsicSize(element: HTMLElement, maxWidth?: number): Size;
12
+ export declare function measureIntrinsicSize(element: HTMLElement, maxWidth?: number): Size.Size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etudes",
3
- "version": "28.2.2",
3
+ "version": "28.3.0",
4
4
  "description": "A study of headless React components",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,7 +24,8 @@
24
24
  "prepages": "rimraf .gh-pages",
25
25
  "pages": "vite build -c demo/vite.config.ts",
26
26
  "dev": "concurrently \"vite build -w\" \"wait-on build && vite dev --host -c demo/vite.config.ts --port 8080\"",
27
- "test": "vitest run --coverage",
27
+ "test": "npm run test:unit",
28
+ "test:unit": "vitest run --coverage",
28
29
  "typecheck": "tsc --noEmit",
29
30
  "lint": "eslint",
30
31
  "lint:fix": "eslint --fix"
@@ -55,15 +56,15 @@
55
56
  "@vitejs/plugin-react": "^6.0.1",
56
57
  "@vitest/coverage-v8": "^4.1.4",
57
58
  "concurrently": "^9.2.1",
58
- "eslint": "^10.2.0",
59
- "eslint-plugin-perfectionist": "^5.8.0",
59
+ "eslint": "^10.2.1",
60
+ "eslint-plugin-perfectionist": "^5.9.0",
60
61
  "happy-dom": "^20.9.0",
61
62
  "react": "^19.2.5",
62
63
  "react-dom": "^19.2.5",
63
64
  "rimraf": "^6.1.3",
64
65
  "semantic-release": "^25.0.3",
65
66
  "tailwindcss": "^4.2.2",
66
- "typescript": "^6.0.2",
67
+ "typescript": "^6.0.3",
67
68
  "typescript-eslint": "^8.58.2",
68
69
  "vite": "^8.0.8",
69
70
  "vite-plugin-dts": "^4.5.4",
@@ -73,9 +74,9 @@
73
74
  "dependencies": {
74
75
  "clsx": "^2.1.1",
75
76
  "fast-deep-equal": "^3.1.3",
76
- "fast-xml-parser": "^5.6.0",
77
+ "fast-xml-parser": "^5.7.1",
77
78
  "interactjs": "^1.10.27",
78
- "spase": "^12.1.0"
79
+ "spase": "^13.0.0"
79
80
  },
80
81
  "peerDependencies": {
81
82
  "react": "^19.0.0"