@wtfalch/design 0.10.0 → 0.10.1
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.
|
@@ -19,6 +19,16 @@ export interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
19
19
|
* opens this, which is what the mail client's `.mail-search-key` was. */
|
|
20
20
|
trailing?: React.ReactNode;
|
|
21
21
|
className?: string;
|
|
22
|
+
/** Accepted and not rendered. `Field`'s render prop hands a caller every
|
|
23
|
+
* piece of its wiring at once, and the documented way to use it is
|
|
24
|
+
* `<Field>{(f) => <Input {...f} />}</Field>` -- so `labelId` arrives here
|
|
25
|
+
* whether or not this control wants it. `Select` does want it, because a
|
|
26
|
+
* button takes its name from its contents; an `<input>` does not, because
|
|
27
|
+
* `Field`'s `<label for>` already names it. Taking it out of the props is
|
|
28
|
+
* what keeps it off the DOM node: React passes through anything it does
|
|
29
|
+
* not recognise, and the browser got `labelid="…"` with a console warning
|
|
30
|
+
* on every field in valet and tf. */
|
|
31
|
+
labelId?: string;
|
|
22
32
|
}
|
|
23
33
|
declare const Input: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLInputElement>>;
|
|
24
34
|
export default Input;
|
package/dist/components/Input.js
CHANGED
|
@@ -49,7 +49,7 @@ import { forwardRef, useState } from 'react';
|
|
|
49
49
|
import { ToggleButton } from 'react-aria-components';
|
|
50
50
|
import Icon from './Icon.js';
|
|
51
51
|
import { useFieldWiring } from './fieldWiring.js';
|
|
52
|
-
const Input = forwardRef(function Input({ size = 'md', mono, block, className, type = 'text', icon, onClear, trailing, ...rest }, ref) {
|
|
52
|
+
const Input = forwardRef(function Input({ size = 'md', mono, block, className, type = 'text', icon, onClear, trailing, labelId: _labelId, ...rest }, ref) {
|
|
53
53
|
/* What the `Field` above wired, when the caller did not thread it by hand.
|
|
54
54
|
Explicit props win: a caller that named an `id` meant that id, and a
|
|
55
55
|
render-prop `Field` spreading its wiring is passing the same values in
|
|
@@ -4,6 +4,16 @@ export interface Props extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaEle
|
|
|
4
4
|
* characters are the content. */
|
|
5
5
|
mono?: boolean;
|
|
6
6
|
className?: string;
|
|
7
|
+
/** Accepted and not rendered. `Field`'s render prop hands a caller every
|
|
8
|
+
* piece of its wiring at once, and the documented way to use it is
|
|
9
|
+
* `<Field>{(f) => <Input {...f} />}</Field>` -- so `labelId` arrives here
|
|
10
|
+
* whether or not this control wants it. `Select` does want it, because a
|
|
11
|
+
* button takes its name from its contents; an `<input>` does not, because
|
|
12
|
+
* `Field`'s `<label for>` already names it. Taking it out of the props is
|
|
13
|
+
* what keeps it off the DOM node: React passes through anything it does
|
|
14
|
+
* not recognise, and the browser got `labelid="…"` with a console warning
|
|
15
|
+
* on every field in valet and tf. */
|
|
16
|
+
labelId?: string;
|
|
7
17
|
}
|
|
8
18
|
declare const Textarea: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
9
19
|
export default Textarea;
|
|
@@ -15,7 +15,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
15
15
|
*/
|
|
16
16
|
import { forwardRef } from 'react';
|
|
17
17
|
import { useFieldWiring } from './fieldWiring.js';
|
|
18
|
-
const Textarea = forwardRef(function Textarea({ size = 'md', mono, className, ...rest }, ref) {
|
|
18
|
+
const Textarea = forwardRef(function Textarea({ size = 'md', mono, className, labelId: _labelId, ...rest }, ref) {
|
|
19
19
|
const classes = [size === 'md' ? '' : `size-${size}`, mono ? 'mono' : '', className ?? '']
|
|
20
20
|
.filter(Boolean)
|
|
21
21
|
.join(' ');
|