@gridui/input 2.0.0 → 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.
- package/README.md +42 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +256 -101
- package/dist/index.js.map +4 -4
- package/dist/input-group/input-group.d.ts +11 -0
- package/dist/input-group-addon/input-group-addon.d.ts +11 -0
- package/dist/input-group-button/input-group-button.d.ts +10 -0
- package/dist/password-input/password-input.d.ts +14 -0
- package/dist/search-input/search-input.d.ts +15 -0
- package/dist/shared/input-group-context.d.ts +8 -0
- package/dist/styles.css +106 -0
- package/dist/textarea/textarea.d.ts +1 -0
- package/docs/catalog.json +64 -1
- package/docs/reference/README.md +11 -0
- package/docs/reference/input-group-addon.md +63 -0
- package/docs/reference/input-group-button.md +99 -0
- package/docs/reference/input-group.md +63 -0
- package/docs/reference/input.md +69 -0
- package/docs/reference/label.md +61 -0
- package/docs/reference/password-input.md +81 -0
- package/docs/reference/search-input.md +87 -0
- package/docs/reference/textarea.md +89 -0
- package/docs/textarea.md +28 -21
- package/package.json +7 -3
- package/dist/textarea/use-textarea-autosize.d.ts +0 -8
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Input
|
|
4
|
+
* @namespace PasswordInput
|
|
5
|
+
* @description Password Input
|
|
6
|
+
*/
|
|
7
|
+
import { type InputProps } from "../input/input";
|
|
8
|
+
import { type FC } from "react";
|
|
9
|
+
export type PasswordInputProps = Omit<InputProps, "type"> & {
|
|
10
|
+
readonly showLabel: string;
|
|
11
|
+
readonly hideLabel: string;
|
|
12
|
+
readonly rootClassName?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const PasswordInput: FC<PasswordInputProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Input
|
|
4
|
+
* @namespace SearchInput
|
|
5
|
+
* @description Search Input
|
|
6
|
+
*/
|
|
7
|
+
import { type InputProps } from "../input/input";
|
|
8
|
+
import { type FC } from "react";
|
|
9
|
+
export type SearchInputProps = Omit<InputProps, "type"> & {
|
|
10
|
+
readonly clearLabel: string;
|
|
11
|
+
readonly loading?: boolean;
|
|
12
|
+
readonly loadingLabel?: string;
|
|
13
|
+
readonly rootClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const SearchInput: FC<SearchInputProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Input
|
|
4
|
+
* @namespace Shared
|
|
5
|
+
* @description Input Group Context
|
|
6
|
+
*/
|
|
7
|
+
export declare const inputGroupContext: import("react").Context<"standard" | "small" | null>;
|
|
8
|
+
export declare const useInputGroupSize: () => "standard" | "small" | null;
|
package/dist/styles.css
CHANGED
|
@@ -8,18 +8,27 @@
|
|
|
8
8
|
.gridui-u-input--inline-flex {
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
}
|
|
11
|
+
.gridui-u-input--min-h-\(--_gridui-textarea-min-height\) {
|
|
12
|
+
min-height: var(--_gridui-textarea-min-height);
|
|
13
|
+
}
|
|
11
14
|
.gridui-u-input--min-h-gridui-control {
|
|
12
15
|
min-height: var(--gridui-control-min-height);
|
|
13
16
|
}
|
|
14
17
|
.gridui-u-input--min-h-gridui-control-small {
|
|
15
18
|
min-height: var(--gridui-control-min-height-small);
|
|
16
19
|
}
|
|
20
|
+
.gridui-u-input--w-0 {
|
|
21
|
+
width: 0px;
|
|
22
|
+
}
|
|
17
23
|
.gridui-u-input--w-full {
|
|
18
24
|
width: 100%;
|
|
19
25
|
}
|
|
20
26
|
.gridui-u-input--min-w-0 {
|
|
21
27
|
min-width: 0px;
|
|
22
28
|
}
|
|
29
|
+
.gridui-u-input--flex-1 {
|
|
30
|
+
flex: 1;
|
|
31
|
+
}
|
|
23
32
|
.gridui-u-input--shrink-0 {
|
|
24
33
|
flex-shrink: 0;
|
|
25
34
|
}
|
|
@@ -45,6 +54,10 @@
|
|
|
45
54
|
border-style: var(--tw-border-style);
|
|
46
55
|
border-width: 1px;
|
|
47
56
|
}
|
|
57
|
+
.gridui-u-input--border-0 {
|
|
58
|
+
border-style: var(--tw-border-style);
|
|
59
|
+
border-width: 0px;
|
|
60
|
+
}
|
|
48
61
|
.gridui-u-input--border-solid {
|
|
49
62
|
--tw-border-style: solid;
|
|
50
63
|
border-style: solid;
|
|
@@ -55,6 +68,9 @@
|
|
|
55
68
|
.gridui-u-input--bg-background {
|
|
56
69
|
background-color: var(--gridui-background);
|
|
57
70
|
}
|
|
71
|
+
.gridui-u-input--bg-transparent {
|
|
72
|
+
background-color: transparent;
|
|
73
|
+
}
|
|
58
74
|
.gridui-u-input--p-gridui-8 {
|
|
59
75
|
padding: var(--gridui-space-8);
|
|
60
76
|
}
|
|
@@ -89,6 +105,96 @@
|
|
|
89
105
|
height: var(--gridui-space-16);
|
|
90
106
|
}
|
|
91
107
|
}
|
|
108
|
+
@layer components {
|
|
109
|
+
.gridui-input-group {
|
|
110
|
+
--_gridui-input-height: var(--gridui-control-min-height);
|
|
111
|
+
position: relative;
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-wrap: wrap;
|
|
114
|
+
align-items: center;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
min-height: var(--_gridui-input-height);
|
|
117
|
+
width: 100%;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
border: 1px solid var(--gridui-border);
|
|
120
|
+
border-radius: var(--gridui-control-radius);
|
|
121
|
+
color: var(--gridui-foreground);
|
|
122
|
+
background: var(--gridui-background);
|
|
123
|
+
&[data-control-size="small"] {
|
|
124
|
+
--_gridui-input-height: var(--gridui-control-min-height-small);
|
|
125
|
+
}
|
|
126
|
+
> .gridui-control {
|
|
127
|
+
flex: 1;
|
|
128
|
+
width: 0;
|
|
129
|
+
border: 0;
|
|
130
|
+
background: transparent;
|
|
131
|
+
outline: none;
|
|
132
|
+
}
|
|
133
|
+
> textarea.gridui-control {
|
|
134
|
+
flex-basis: 100%;
|
|
135
|
+
width: 100%;
|
|
136
|
+
}
|
|
137
|
+
&:has(> .gridui-control:focus-visible) {
|
|
138
|
+
z-index: var(--gridui-z-interaction);
|
|
139
|
+
outline: var(--gridui-focus-width) solid var(--gridui-focus-color);
|
|
140
|
+
outline-offset: var(--gridui-focus-offset);
|
|
141
|
+
}
|
|
142
|
+
&:has(> .gridui-control[aria-invalid="true"]) {
|
|
143
|
+
border-color: var(--gridui-danger-foreground);
|
|
144
|
+
}
|
|
145
|
+
@media (hover: hover) and (pointer: fine) {
|
|
146
|
+
&:has(> .gridui-control:hover:not(:disabled, [readonly])):not(:has(:focus-visible)) {
|
|
147
|
+
outline: var(--gridui-hover-width) solid var(--gridui-focus-color);
|
|
148
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
149
|
+
outline: var(--gridui-hover-width) solid color-mix(in srgb, var(--gridui-focus-color) var(--gridui-hover-opacity), transparent);
|
|
150
|
+
}
|
|
151
|
+
outline-offset: var(--gridui-hover-offset);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
.gridui-input-group-addon {
|
|
156
|
+
display: flex;
|
|
157
|
+
flex: none;
|
|
158
|
+
align-items: center;
|
|
159
|
+
gap: var(--gridui-space-8);
|
|
160
|
+
min-width: 0;
|
|
161
|
+
padding-inline: var(--gridui-space-8);
|
|
162
|
+
&[data-align="inline-start"] {
|
|
163
|
+
order: -1;
|
|
164
|
+
}
|
|
165
|
+
&[data-align="block-start"], &[data-align="block-end"] {
|
|
166
|
+
flex-basis: 100%;
|
|
167
|
+
box-sizing: border-box;
|
|
168
|
+
padding-block: var(--gridui-space-8);
|
|
169
|
+
}
|
|
170
|
+
&[data-align="block-start"] {
|
|
171
|
+
order: -2;
|
|
172
|
+
}
|
|
173
|
+
&[data-align="block-end"] {
|
|
174
|
+
order: 2;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
.gridui-input-group-button {
|
|
178
|
+
flex: none;
|
|
179
|
+
}
|
|
180
|
+
.gridui-textarea[data-autosize] {
|
|
181
|
+
--_gridui-textarea-inset: calc(2 * var(--gridui-space-8) + 2px);
|
|
182
|
+
--_gridui-textarea-minimum: var(--gridui-control-min-height);
|
|
183
|
+
field-sizing: content;
|
|
184
|
+
height: auto;
|
|
185
|
+
--_gridui-textarea-min-height: max(var(--_gridui-textarea-minimum), calc(var(--_gridui-textarea-rows) * 1lh + var(--_gridui-textarea-inset)));
|
|
186
|
+
&.gridui-control-small {
|
|
187
|
+
--_gridui-textarea-inset: calc(2 * var(--gridui-space-4) + 2px);
|
|
188
|
+
--_gridui-textarea-minimum: var(--gridui-control-min-height-small);
|
|
189
|
+
}
|
|
190
|
+
&[data-max-rows] {
|
|
191
|
+
max-height: calc(var(--_gridui-textarea-max-rows) * 1lh + var(--_gridui-textarea-inset));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
.gridui-input-group > input[type="search"]::-webkit-search-cancel-button {
|
|
195
|
+
appearance: none;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
92
198
|
@property --tw-border-style {
|
|
93
199
|
syntax: "*";
|
|
94
200
|
inherits: false;
|
|
@@ -9,5 +9,6 @@ import { type ComponentPropsWithRef, type FC } from "react";
|
|
|
9
9
|
export type TextareaProps = ComponentPropsWithRef<"textarea"> & TextControlOptions & {
|
|
10
10
|
readonly autoSize?: boolean;
|
|
11
11
|
readonly maxHeight?: number;
|
|
12
|
+
readonly maxRows?: number;
|
|
12
13
|
};
|
|
13
14
|
export declare const Textarea: FC<TextareaProps>;
|
package/docs/catalog.json
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/input",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
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.",
|
|
8
8
|
"documentation": [
|
|
9
9
|
"README.md",
|
|
10
10
|
"docs/common-inputs.md",
|
|
11
|
+
"docs/reference/README.md",
|
|
12
|
+
"docs/reference/input-group-addon.md",
|
|
13
|
+
"docs/reference/input-group-button.md",
|
|
14
|
+
"docs/reference/input-group.md",
|
|
15
|
+
"docs/reference/input.md",
|
|
16
|
+
"docs/reference/label.md",
|
|
17
|
+
"docs/reference/password-input.md",
|
|
18
|
+
"docs/reference/search-input.md",
|
|
19
|
+
"docs/reference/textarea.md",
|
|
11
20
|
"docs/textarea.md"
|
|
12
21
|
],
|
|
13
22
|
"exports": [
|
|
@@ -21,6 +30,36 @@
|
|
|
21
30
|
"kind": "component",
|
|
22
31
|
"importPath": "@gridui/input"
|
|
23
32
|
},
|
|
33
|
+
{
|
|
34
|
+
"name": "InputGroup",
|
|
35
|
+
"kind": "component",
|
|
36
|
+
"importPath": "@gridui/input"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "InputGroupAddon",
|
|
40
|
+
"kind": "component",
|
|
41
|
+
"importPath": "@gridui/input"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "InputGroupAddonProps",
|
|
45
|
+
"kind": "type",
|
|
46
|
+
"importPath": "@gridui/input"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "InputGroupButton",
|
|
50
|
+
"kind": "component",
|
|
51
|
+
"importPath": "@gridui/input"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "InputGroupButtonProps",
|
|
55
|
+
"kind": "type",
|
|
56
|
+
"importPath": "@gridui/input"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "InputGroupProps",
|
|
60
|
+
"kind": "type",
|
|
61
|
+
"importPath": "@gridui/input"
|
|
62
|
+
},
|
|
24
63
|
{
|
|
25
64
|
"name": "InputProps",
|
|
26
65
|
"kind": "type",
|
|
@@ -36,6 +75,26 @@
|
|
|
36
75
|
"kind": "type",
|
|
37
76
|
"importPath": "@gridui/input"
|
|
38
77
|
},
|
|
78
|
+
{
|
|
79
|
+
"name": "PasswordInput",
|
|
80
|
+
"kind": "component",
|
|
81
|
+
"importPath": "@gridui/input"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "PasswordInputProps",
|
|
85
|
+
"kind": "type",
|
|
86
|
+
"importPath": "@gridui/input"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "SearchInput",
|
|
90
|
+
"kind": "component",
|
|
91
|
+
"importPath": "@gridui/input"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "SearchInputProps",
|
|
95
|
+
"kind": "type",
|
|
96
|
+
"importPath": "@gridui/input"
|
|
97
|
+
},
|
|
39
98
|
{
|
|
40
99
|
"name": "Textarea",
|
|
41
100
|
"kind": "component",
|
|
@@ -49,10 +108,14 @@
|
|
|
49
108
|
],
|
|
50
109
|
"styles": [
|
|
51
110
|
"@gridui/theme/styles.css",
|
|
111
|
+
"@gridui/button/styles.css",
|
|
52
112
|
"@gridui/overlay/styles.css",
|
|
53
113
|
"@gridui/input/styles.css"
|
|
54
114
|
],
|
|
55
115
|
"examples": [
|
|
116
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/input-group.stories.tsx",
|
|
117
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/password-input.stories.tsx",
|
|
118
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/search-input.stories.tsx",
|
|
56
119
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/input/stories/textarea.stories.tsx"
|
|
57
120
|
]
|
|
58
121
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Generated by pnpm docs:storybook. -->
|
|
2
|
+
# Component reference
|
|
3
|
+
|
|
4
|
+
- [Input](input.md)
|
|
5
|
+
- [InputGroup](input-group.md)
|
|
6
|
+
- [InputGroupAddon](input-group-addon.md)
|
|
7
|
+
- [InputGroupButton](input-group-button.md)
|
|
8
|
+
- [Label](label.md)
|
|
9
|
+
- [PasswordInput](password-input.md)
|
|
10
|
+
- [SearchInput](search-input.md)
|
|
11
|
+
- [Textarea](textarea.md)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# InputGroupAddon
|
|
3
|
+
|
|
4
|
+
Compose InputGroupAddon with InputGroup 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 { InputGroupAddon } 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/input-group.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<HTMLDivElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### align
|
|
59
|
+
|
|
60
|
+
``"inline-start" | "inline-end" | "block-start" | "block-end" | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Default: ``"inline-start"``
|
|
63
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# InputGroupButton
|
|
3
|
+
|
|
4
|
+
Compose InputGroupButton with InputGroup 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 { InputGroupButton } 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/input-group.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<HTMLButtonElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### size
|
|
59
|
+
|
|
60
|
+
``"small" | "standard" | "large" | "extra-large" | null | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Component size preset.
|
|
63
|
+
|
|
64
|
+
### iconMotion
|
|
65
|
+
|
|
66
|
+
``"none" | "outward" | null | undefined`` · Optional
|
|
67
|
+
|
|
68
|
+
### variant
|
|
69
|
+
|
|
70
|
+
``"text" | "primary" | "secondary" | "quiet" | "highlight" | "underlined" | null | undefined`` · Optional
|
|
71
|
+
|
|
72
|
+
Visual variant.
|
|
73
|
+
|
|
74
|
+
### layout
|
|
75
|
+
|
|
76
|
+
``"cell" | "standard" | "icon" | "entry" | "rail" | "divided" | null | undefined`` · Optional
|
|
77
|
+
|
|
78
|
+
Layout within the containing region.
|
|
79
|
+
|
|
80
|
+
### startIcon
|
|
81
|
+
|
|
82
|
+
``ReactNode`` · Optional
|
|
83
|
+
|
|
84
|
+
### startIconLayout
|
|
85
|
+
|
|
86
|
+
``"divided" | "inline" | undefined`` · Optional
|
|
87
|
+
|
|
88
|
+
### startIconSize
|
|
89
|
+
|
|
90
|
+
``"standard" | "large" | "extra-large" | undefined`` · Optional
|
|
91
|
+
|
|
92
|
+
### endIcon
|
|
93
|
+
|
|
94
|
+
``ReactNode`` · Optional
|
|
95
|
+
|
|
96
|
+
### loading
|
|
97
|
+
|
|
98
|
+
``boolean | undefined`` · Optional
|
|
99
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# InputGroup
|
|
3
|
+
|
|
4
|
+
Combines a native text control with units, icons, or actions inside one outline. Use block addons for multiline tools.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/input`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { InputGroup } 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/input-group.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<HTMLDivElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLDivElement, 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: ``"standard"``
|
|
63
|
+
|
|
@@ -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
|
+
|