etudes 32.6.0 → 32.8.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.
@@ -15,13 +15,13 @@ import { HTMLAttributes, Ref } from 'react';
15
15
  * requirements for landmark regions, pass `aria-label` (or `aria-labelledby`)
16
16
  * so the region has an accessible name.
17
17
  *
18
- * @exports Carousel.Viewport Component for the viewport.
19
18
  * @exports Carousel.Content Component for the list holding all items.
20
- * @exports Carousel.ItemContainer Component containing each item.
19
+ * @exports Carousel.Item Component containing each item.
20
+ * @exports Carousel.Viewport Component for the viewport.
21
21
  * @exports useCarouselItem Hook for reading the current item's index, exposure,
22
22
  * and active state from within an item's subtree.
23
23
  */
24
- export declare function Carousel({ ref, autoAdvanceInterval, children, dragSpeed, dragStartThreshold, index, orientation, overscrollResistance, swipeLiftWindow, swipeVelocityThreshold, shouldTrackExposure, onAutoAdvancePause, onAutoAdvanceResume, onIndexChange, ...props }: Carousel.Props): import("react").JSX.Element;
24
+ export declare function Carousel({ ref, autoAdvanceInterval, children, dragSpeed, index, orientation, shouldTrackExposure, onAutoAdvancePause, onAutoAdvanceResume, onIndexChange, ...props }: Carousel.Props): import("react").JSX.Element;
25
25
  export declare namespace Carousel {
26
26
  var displayName: string;
27
27
  }
@@ -48,12 +48,6 @@ export declare namespace Carousel {
48
48
  * default value is `1`.
49
49
  */
50
50
  dragSpeed?: number;
51
- /**
52
- * Minimum pixel distance the pointer must travel between pointer-down and
53
- * pointer-up for the gesture to be classified as a drag. Movements within
54
- * this threshold are treated as a click and are allowed to propagate.
55
- */
56
- dragStartThreshold?: number;
57
51
  /**
58
52
  * Current item index.
59
53
  */
@@ -62,32 +56,11 @@ export declare namespace Carousel {
62
56
  * Orientation of the carousel.
63
57
  */
64
58
  orientation?: Orientation;
65
- /**
66
- * Resistance applied when the user drags past the first or last item. `0`
67
- * lets the overshoot track the pointer 1:1 (no resistance); `1` clamps hard
68
- * at the boundary (max resistance, no overshoot). Values in between produce
69
- * a rubber-band effect—higher means more resistance.
70
- */
71
- overscrollResistance?: number;
72
59
  /**
73
60
  * Whether to track item exposure (0-1, 0 meaning the item is fully scrolled
74
61
  * out of view, 1 meaning the item is fully scrolled into view).
75
62
  */
76
63
  shouldTrackExposure?: boolean;
77
- /**
78
- * Maximum gap in milliseconds between the last pointer move and the pointer
79
- * release for the gesture to register as a swipe. If the pointer was held
80
- * stationary longer than this before release, no swipe is detected and the
81
- * release falls back to position-based snapping.
82
- */
83
- swipeLiftWindow?: number;
84
- /**
85
- * Minimum axial pointer velocity (in pixels per millisecond) at release for
86
- * the gesture to register as a swipe. A detected swipe advances the index
87
- * by one in the swipe direction, regardless of how far the displacement has
88
- * traveled.
89
- */
90
- swipeVelocityThreshold?: number;
91
64
  /**
92
65
  * Handler invoked when auto advance pauses. This is invoked only when
93
66
  * {@link autoAdvanceInterval} is greater than 0.
@@ -135,7 +108,7 @@ export declare namespace Carousel {
135
108
  /**
136
109
  * Component containing each item in a {@link Carousel}.
137
110
  */
138
- const ItemContainer: {
111
+ const Item: {
139
112
  ({ children, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
140
113
  displayName: string;
141
114
  };
@@ -8,13 +8,17 @@ export declare namespace TextArea {
8
8
  * Reference to the root element.
9
9
  */
10
10
  ref?: Ref<HTMLTextAreaElement>;
11
+ /**
12
+ * Specifies if the text area should be focused when it is mounted.
13
+ */
14
+ autoFocus?: boolean;
11
15
  onChange: (value: string) => void;
12
- } & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'>;
16
+ } & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'autoFocus' | 'onChange'>;
13
17
  }
14
18
  /**
15
19
  * A text area component that allows the user to enter multiple lines of text.
16
20
  */
17
- export declare function TextArea({ ref, onChange, ...props }: TextArea.Props): import("react").JSX.Element;
21
+ export declare function TextArea({ ref, autoFocus, onChange, ...props }: TextArea.Props): import("react").JSX.Element;
18
22
  export declare namespace TextArea {
19
23
  var displayName: string;
20
24
  }
@@ -8,6 +8,10 @@ export declare namespace TextField {
8
8
  * Reference to the root element.
9
9
  */
10
10
  ref?: Ref<HTMLInputElement>;
11
+ /**
12
+ * Specifies if the text field should be focused when it is mounted.
13
+ */
14
+ autoFocus?: boolean;
11
15
  /**
12
16
  * The value to set to when the text field is empty.
13
17
  */
@@ -39,7 +43,7 @@ export declare namespace TextField {
39
43
  *
40
44
  * @returns The formatted value.
41
45
  */
42
- formatter?: (value: string) => string;
46
+ formatValue?: (value: string) => string;
43
47
  /**
44
48
  * Handler invoked the text field is focused.
45
49
  *
@@ -58,12 +62,12 @@ export declare namespace TextField {
58
62
  * @param value The new value of the text field.
59
63
  */
60
64
  onChange?: (value: string) => void;
61
- } & Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-disabled' | 'aria-placeholder' | 'aria-required' | 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'placeholder' | 'required' | 'type' | 'value'>;
65
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-disabled' | 'aria-placeholder' | 'aria-required' | 'autoFocus' | 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'placeholder' | 'required' | 'type' | 'value'>;
62
66
  }
63
67
  /**
64
68
  * A text field that supports custom value formatting and empty value.
65
69
  */
66
- export declare function TextField({ className, ref, emptyValue, formatter, placeholder, type, value, isDisabled, isRequired, onChange, onFocus, onUnfocus, ...props }: TextField.Props): import("react").JSX.Element;
70
+ export declare function TextField({ className, ref, autoFocus, emptyValue, placeholder, type, value, isDisabled, isRequired, formatValue, onChange, onFocus, onUnfocus, ...props }: TextField.Props): import("react").JSX.Element;
67
71
  export declare namespace TextField {
68
72
  var displayName: string;
69
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etudes",
3
- "version": "32.6.0",
3
+ "version": "32.8.0",
4
4
  "description": "A study of headless React components",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -43,33 +43,33 @@
43
43
  "author": "Andrew Wei <andrewscwei@gmail.com>",
44
44
  "license": "MIT",
45
45
  "devDependencies": {
46
- "@commitlint/config-conventional": "^21.0.2",
46
+ "@commitlint/config-conventional": "^21.2.0",
47
47
  "@eslint/js": "^10.0.1",
48
48
  "@semantic-release/git": "^10.0.1",
49
49
  "@stylistic/eslint-plugin": "^5.10.0",
50
- "@tailwindcss/vite": "^4.3.1",
50
+ "@tailwindcss/vite": "^4.3.2",
51
51
  "@testing-library/react": "^16.3.2",
52
52
  "@testing-library/user-event": "^14.6.1",
53
- "@types/node": "^25.9.3",
53
+ "@types/node": "^26.1.0",
54
54
  "@types/react": "^19.2.17",
55
55
  "@types/react-dom": "^19.2.3",
56
- "@vitejs/plugin-react": "^6.0.2",
57
- "@vitest/coverage-v8": "^4.1.9",
56
+ "@vitejs/plugin-react": "^6.0.3",
57
+ "@vitest/coverage-v8": "^4.1.10",
58
58
  "concurrently": "^10.0.3",
59
- "eslint": "^10.5.0",
59
+ "eslint": "^10.6.0",
60
60
  "eslint-plugin-perfectionist": "^5.9.1",
61
- "happy-dom": "^20.10.5",
61
+ "happy-dom": "^20.10.6",
62
62
  "react": "^19.2.7",
63
63
  "react-dom": "^19.2.7",
64
64
  "rimraf": "^6.1.3",
65
65
  "semantic-release": "^25.0.5",
66
- "tailwindcss": "^4.3.1",
66
+ "tailwindcss": "^4.3.2",
67
67
  "typescript": "^6.0.3",
68
- "typescript-eslint": "^8.61.1",
69
- "vite": "^8.0.16",
70
- "vite-plugin-dts": "^5.0.2",
68
+ "typescript-eslint": "^8.62.1",
69
+ "vite": "^8.1.3",
70
+ "vite-plugin-dts": "^5.0.3",
71
71
  "vite-plugin-svgr": "^5.2.0",
72
- "vitest": "^4.1.9",
72
+ "vitest": "^4.1.10",
73
73
  "wait-on": "^9.0.10"
74
74
  },
75
75
  "dependencies": {