@mistriwork/ui 1.0.0-rc.48 → 1.0.0-rc.49
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 +1 -1
- package/dist/TextArea.d.ts +24 -0
- package/dist/TextArea.js +7 -0
- package/dist/forms.css +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ drawn with: Modal, DropMenu, Dropdown, Typeahead, Button, Field, Icon and
|
|
|
7
7
|
DateField over [Base UI](https://base-ui.com), the tokens and stylesheet they
|
|
8
8
|
are drawn with, and the zoom-aware ruler their popups are placed by.
|
|
9
9
|
|
|
10
|
-
The form controls are built on them (**Preview**: @mistriwork/ui is Preview at 1.0): `TextField`, `MaskedField`,
|
|
10
|
+
The form controls are built on them (**Preview**: @mistriwork/ui is Preview at 1.0): `TextField`, `TextArea`, `MaskedField`,
|
|
11
11
|
`MoneyField`, `SensitiveField`, `FileField`, `Select`, `MultiSelect`, `YesNo`, `ChoiceCards`, `Checkbox`, `Consent`, `Slider`,
|
|
12
12
|
`HelpTip`, `ProgressBar`, `StepHeader`, `ActionBar`, `Columns` and `ReviewList`, with the `masks` they take
|
|
13
13
|
(`phone`, `date`, `month`, `ssn`, `zip`, `money`). Each takes a value and an `onChange` and draws what it is told. A
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A box of several lines, in the same frame as a TextField: a Field's label, hint and problem wired to a textarea, which
|
|
3
|
+
* the reader may stretch down. Props only. Preview: @mistriwork/ui is Preview at 1.0.
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactNode, Ref } from 'react';
|
|
6
|
+
import { type FieldFrame } from './fieldFrame.js';
|
|
7
|
+
import { type ChangeDetails } from './changeDetails.js';
|
|
8
|
+
export interface TextAreaProps extends FieldFrame {
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string, details: ChangeDetails<'input-change'>) => void;
|
|
11
|
+
onBlur?: () => void;
|
|
12
|
+
/** Lines the box shows before the reader stretches it. Default 3. */
|
|
13
|
+
rows?: number;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
autoComplete?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
inputRef?: Ref<HTMLTextAreaElement>;
|
|
21
|
+
/** Something drawn under the box: a count, say. */
|
|
22
|
+
after?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare function TextArea(props: TextAreaProps): ReactNode;
|
package/dist/TextArea.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Field } from './Field.js';
|
|
3
|
+
import { frameOf } from './fieldFrame.js';
|
|
4
|
+
import { changeDetails } from './changeDetails.js';
|
|
5
|
+
export function TextArea(props) {
|
|
6
|
+
return (_jsx(Field, { ...frameOf(props), children: (control) => (_jsxs(_Fragment, { children: [_jsx("div", { className: "field-box", children: _jsx("textarea", { ...control, ref: props.inputRef, className: "field-control", rows: props.rows ?? 3, maxLength: props.maxLength, name: props.name, value: props.value, autoComplete: props.autoComplete ?? 'off', placeholder: props.placeholder, disabled: props.disabled, readOnly: props.readOnly, onChange: (e) => props.onChange(e.target.value, changeDetails('input-change', e)), onBlur: props.onBlur }) }), props.after] })) }));
|
|
7
|
+
}
|
package/dist/forms.css
CHANGED
|
@@ -69,6 +69,9 @@
|
|
|
69
69
|
}
|
|
70
70
|
/* On is a thicker edge drawn outside the box, not a wider border, so choosing moves nothing. */
|
|
71
71
|
.choice-pick.is-on, .choice-card.is-on { border-color: var(--choice-on, var(--accent)); box-shadow: 0 0 0 1px var(--choice-on, var(--accent)); background: var(--choice-on-well, var(--accent-soft)); }
|
|
72
|
+
/* A button that is picked has no square to say so, so its face carries it: the host's picked well where it names one
|
|
73
|
+
(--choice-pick-on-well: a quiet form, whose --choice-on-well is its field's own fill), and heavier words. */
|
|
74
|
+
.choice-pick.is-on { background: var(--choice-pick-on-well, var(--choice-on-well, var(--accent-soft))); font-weight: 600; }
|
|
72
75
|
.choice-pick:has(.choice-input:focus-visible), .choice-card:has(.choice-input:focus-visible), .choice-card:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
|
|
73
76
|
.choice-card[aria-disabled="true"] { cursor: not-allowed; opacity: 0.6; }
|
|
74
77
|
.choice-cards { display: flex; flex-direction: column; gap: var(--space-3); }
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { Icon, loadIconsWith, registerIcons, weighIconsWith, type IconGlyph, typ
|
|
|
16
16
|
export { DateField, type DateFieldOpenReason, type DateFieldProps, type DateFieldWords } from './DateField.js';
|
|
17
17
|
export type { FieldFrame } from './fieldFrame.js';
|
|
18
18
|
export { TextField, MaskedField, MoneyField, ValidMark, type MaskedFieldProps, type TextFieldProps } from './TextField.js';
|
|
19
|
+
export { TextArea, type TextAreaProps } from './TextArea.js';
|
|
19
20
|
export { SensitiveField, type SensitiveFieldProps } from './SensitiveField.js';
|
|
20
21
|
export { FileField, type FileFieldProps } from './FileField.js';
|
|
21
22
|
export { Select, MultiSelect } from './Select.js';
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { Typeahead } from './Typeahead.js';
|
|
|
16
16
|
export { Icon, loadIconsWith, registerIcons, weighIconsWith, } from './Icon.js';
|
|
17
17
|
export { DateField } from './DateField.js';
|
|
18
18
|
export { TextField, MaskedField, MoneyField, ValidMark } from './TextField.js';
|
|
19
|
+
export { TextArea } from './TextArea.js';
|
|
19
20
|
export { SensitiveField } from './SensitiveField.js';
|
|
20
21
|
export { FileField } from './FileField.js';
|
|
21
22
|
export { Select, MultiSelect } from './Select.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mistriwork/ui",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.49",
|
|
4
4
|
"description": "The standalone React primitives both shells are drawn with: Modal, DropMenu, Dropdown, Typeahead, Button, Field, Icon and DateField over Base UI, Switch, Tabs, Drawer, Popover, Avatar, Pagination, Carousel, Resizable, ScrollArea and Tooltip, the form controls built on them (text, masked, money and sensitive boxes, listboxes, choices, slider, progress and action bar; Preview), the landing hero's blocks (badge, photo tiles, icon rows; Preview), their tokens and stylesheet, and the zoom-aware ruler their popups are placed by.",
|
|
5
5
|
"homepage": "https://mistriwork.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"./Resizable.js": "./dist/Resizable.js",
|
|
44
44
|
"./ScrollArea.js": "./dist/ScrollArea.js",
|
|
45
45
|
"./Popover.js": "./dist/Popover.js",
|
|
46
|
+
"./TextArea.js": "./dist/TextArea.js",
|
|
46
47
|
"./FileField.js": "./dist/FileField.js",
|
|
47
48
|
"./Select.js": "./dist/Select.js",
|
|
48
49
|
"./SensitiveField.js": "./dist/SensitiveField.js",
|