@gridui/input 1.1.6 → 3.0.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.
@@ -0,0 +1,69 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # Input
3
+
4
+ Accepts a single line of text within a form. Use it with a visible label and field feedback to explain the expected value.
5
+
6
+ Import from ``@gridui/input`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { Input } from "@gridui/input";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/input/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/controls/input.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### onChange
23
+
24
+ ``(event: ChangeEvent<HTMLInputElement, HTMLInputElement>): void`` · Optional
25
+
26
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
27
+
28
+ ### children
29
+
30
+ ``ReactNode`` · Optional
31
+
32
+ Content rendered inside the component.
33
+
34
+ ### onFocus
35
+
36
+ ``(event: FocusEvent<HTMLInputElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onBlur
41
+
42
+ ``(event: FocusEvent<HTMLInputElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLInputElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLInputElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### controlSize
59
+
60
+ ``"small" | "standard" | undefined`` · Optional
61
+
62
+ Default: ``groupSize ?? "standard"``
63
+
64
+ ### onValueChange
65
+
66
+ ``(value: string): void`` · Optional
67
+
68
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
69
+
@@ -0,0 +1,61 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # Label
3
+
4
+ Compose Label with ActionForm inside the same @gridui/input component family.
5
+
6
+ Import from ``@gridui/input`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { Label } from "@gridui/input";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/input/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/action-form.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLLabelElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLLabelElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLLabelElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLLabelElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLLabelElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### icon
59
+
60
+ ``ReactNode`` · Optional
61
+
@@ -0,0 +1,81 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # PasswordInput
3
+
4
+ A native password field with an accessible reveal action. Use it for account credentials.
5
+
6
+ Import from ``@gridui/input`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { PasswordInput } from "@gridui/input";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/input/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/password-input.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLInputElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLInputElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLInputElement, HTMLInputElement>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLInputElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLInputElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### onValueChange
59
+
60
+ ``(value: string): void`` · Optional
61
+
62
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
63
+
64
+ ### controlSize
65
+
66
+ ``"small" | "standard" | undefined`` · Optional
67
+
68
+ Default: ``"standard"``
69
+
70
+ ### showLabel
71
+
72
+ ``string`` · Required
73
+
74
+ ### hideLabel
75
+
76
+ ``string`` · Required
77
+
78
+ ### rootClassName
79
+
80
+ ``string | undefined`` · Optional
81
+
@@ -0,0 +1,87 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # SearchInput
3
+
4
+ A native search field with clear and loading feedback. Applications own query requests and submission.
5
+
6
+ Import from ``@gridui/input`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { SearchInput } from "@gridui/input";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/input/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/search-input.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLInputElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLInputElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLInputElement, HTMLInputElement>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLInputElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLInputElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### onValueChange
59
+
60
+ ``(value: string): void`` · Optional
61
+
62
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
63
+
64
+ ### controlSize
65
+
66
+ ``"small" | "standard" | undefined`` · Optional
67
+
68
+ Default: ``"standard"``
69
+
70
+ ### clearLabel
71
+
72
+ ``string`` · Required
73
+
74
+ ### loading
75
+
76
+ ``boolean | undefined`` · Optional
77
+
78
+ Default: ``false``
79
+
80
+ ### loadingLabel
81
+
82
+ ``string | undefined`` · Optional
83
+
84
+ ### rootClassName
85
+
86
+ ``string | undefined`` · Optional
87
+
@@ -0,0 +1,89 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # Textarea
3
+
4
+ Accepts multiple lines of plain text. Use it for descriptions, notes, and longer responses.
5
+
6
+ Import from ``@gridui/input`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { Textarea } from "@gridui/input";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/input/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/textarea.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### rows
23
+
24
+ ``number | undefined`` · Optional
25
+
26
+ Default: ``2``
27
+
28
+ ### onChange
29
+
30
+ ``(event: ChangeEvent<HTMLTextAreaElement, HTMLTextAreaElement>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### children
35
+
36
+ ``ReactNode`` · Optional
37
+
38
+ Content rendered inside the component.
39
+
40
+ ### onFocus
41
+
42
+ ``(event: FocusEvent<HTMLTextAreaElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onBlur
47
+
48
+ ``(event: FocusEvent<HTMLTextAreaElement, Element>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onSubmit
53
+
54
+ ``(event: SubmitEvent<HTMLTextAreaElement>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### onClick
59
+
60
+ ``(event: MouseEvent<HTMLTextAreaElement, MouseEvent>): void`` · Optional
61
+
62
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
63
+
64
+ ### controlSize
65
+
66
+ ``"small" | "standard" | undefined`` · Optional
67
+
68
+ Default: ``groupSize ?? "standard"``
69
+
70
+ ### onValueChange
71
+
72
+ ``(value: string): void`` · Optional
73
+
74
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
75
+
76
+ ### autoSize
77
+
78
+ ``boolean | undefined`` · Optional
79
+
80
+ Default: ``false``
81
+
82
+ ### maxHeight
83
+
84
+ ``number | undefined`` · Optional
85
+
86
+ ### maxRows
87
+
88
+ ``number | undefined`` · Optional
89
+
package/docs/textarea.md CHANGED
@@ -1,28 +1,35 @@
1
1
  # Textarea
2
2
 
3
- Import `Textarea` and `TextareaProps` from `@gridui/input`. It is a native textarea with the same `controlSize`
4
- (`standard` or `small`), invalid, disabled, and focus styling as `Input`.
3
+ Textarea is a native multiline input. Native props, events and refs are retained,
4
+ including name, form, value/defaultValue, rows, required, maxLength and ARIA.
5
+ onChange runs before onValueChange. Enter and IME retain native multiline behavior.
6
+ Applications own labels, validation, persistence and submission.
5
7
 
6
- All native textarea props and refs are forwarded, including `value`,
7
- `defaultValue`, `name`, `rows`, `required`, `maxLength`, and ARIA attributes.
8
- `onChange` runs before the optional `onValueChange(string)` notification, matching
9
- Input. Use `value` plus `onValueChange` for a controlled field. The default resize
10
- behavior is vertical; override it with `className` (for example `resize-none`).
8
+ ## Automatic height
11
9
 
12
- The caller supplies the accessible label and owns validation, persistence, and
13
- submission. Enter and IME input retain native multiline behavior; the library
14
- does not add a chat-specific send shortcut or automatic submission.
10
+ `autoSize` uses CSS `field-sizing: content`, available in Baseline 2026 browsers
11
+ (https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/field-sizing).
12
+ Automatic height requires support for that property. This replaces the JavaScript
13
+ measurement and reset observers; there is no second sizing implementation.
14
+ Ordinary non-autosizing textareas retain native rows and vertical resizing.
15
15
 
16
- ## Optional automatic height
16
+ While autosizing, `rows` (default 2) establishes the minimum through line-height
17
+ and control density. Content, width, visibility, fonts, controlled updates and
18
+ native resets participate in browser layout. Height is automatic; avoid a competing
19
+ explicit height. Overflow remains auto, including when caller CSS limits height.
17
20
 
18
- Set `autoSize` to grow and shrink with the content. Native `rows` and CSS minimum
19
- height establish the baseline. Optional `maxHeight` is a positive finite CSS
20
- height in pixels; use a value at least as large as the configured CSS minimum
21
- height. Beyond the cap the field scrolls internally. The height and overflow are
22
- owned by autosizing while enabled; avoid competing `height` / `overflowY` styles.
23
- Without autosizing the existing vertical resize behavior remains unchanged.
21
+ Choose either a positive finite pixel `maxHeight` or an integer `maxRows >= rows`.
22
+ Supplying both throws. CSS minimum height wins when it exceeds an upper bound.
23
+ The pixel prop overrides an inline style.maxHeight; without a prop the caller's
24
+ CSS maximum remains effective. A caller can override generated sizing CSS through
25
+ className/style, and owns the resulting geometry. Constraints do not apply while
26
+ autoSize is false. Disabling autosizing restores ordinary native sizing without
27
+ retained inline height or overflow mutations.
24
28
 
25
- Sizing responds to native input, controlled value renders, element-width changes
26
- (including becoming visible), and native form reset. Width observation requires
27
- `ResizeObserver`. Disabling autosizing restores the original inline height and
28
- overflow. Native refs, onInput, onChange and onValueChange remain available.
29
+ ```tsx
30
+ <Textarea aria-label="Notes" autoSize rows={3} maxRows={8} />
31
+ ```
32
+
33
+ Use InputGroup with a block-start or block-end addon for a toolbar or footer.
34
+ FieldCounter from Form uses native maxLength units and can be connected with
35
+ aria-describedby. Composer owns sending; Textarea adds no submit shortcut.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/input",
3
- "version": "1.1.6",
3
+ "version": "3.0.0",
4
4
  "description": "GridUI React input",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,10 +27,12 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/overlay": "^1.2.2",
31
- "@gridui/style-utils": "^2.2.2",
30
+ "@gridui/button": "^4.0.0",
31
+ "@gridui/overlay": "^2.0.0",
32
+ "@gridui/style-utils": "^3.0.0",
32
33
  "@gridui/theme": "^2.5.3",
33
- "class-variance-authority": "0.7.1"
34
+ "class-variance-authority": "0.7.1",
35
+ "lucide-react": "1.70.0"
34
36
  },
35
37
  "devDependencies": {
36
38
  "@gridui-internal/configuration": "0.0.0-internal",
@@ -47,6 +49,8 @@
47
49
  },
48
50
  "scripts": {
49
51
  "build": "node ../../scripts/compilation/package.ts",
50
- "compile": "tsc --project tsconfig.json"
52
+ "compile": "tsc --project tsconfig.json",
53
+ "test": "jest",
54
+ "coverage": "jest --coverage"
51
55
  }
52
56
  }
@@ -1,8 +0,0 @@
1
- /**
2
- * @author WMXPY
3
- * @package Input
4
- * @namespace Textarea
5
- * @description Use Textarea Autosize
6
- */
7
- import { type RefObject } from "react";
8
- export declare const useTextareaAutosize: (ref: RefObject<HTMLTextAreaElement | null>, enabled: boolean, maxHeight?: number) => () => void;