@rackbops/ui-react 0.2.41 → 0.2.43
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/dist/form.d.ts +19 -0
- package/dist/form.js +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/dist/form.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement>, Re
|
|
|
9
9
|
}
|
|
10
10
|
export declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps, "ref"> & RefAttributes<HTMLSelectElement>>;
|
|
11
11
|
export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement>, RefAttributes<HTMLLabelElement> {
|
|
12
|
+
/** Renders a visible `.rb-label__required` marker after the label's children --
|
|
13
|
+
* an `aria-hidden` glyph, text not colour (#210). The control's own native
|
|
14
|
+
* `required` attribute is what carries the programmatic state to assistive
|
|
15
|
+
* tech; set it on the control, not here. */
|
|
16
|
+
required?: boolean;
|
|
12
17
|
}
|
|
13
18
|
export declare const Label: import("react").ForwardRefExoticComponent<Omit<LabelProps, "ref"> & RefAttributes<HTMLLabelElement>>;
|
|
14
19
|
export interface FieldProps extends HTMLAttributes<HTMLDivElement>, RefAttributes<HTMLDivElement> {
|
|
@@ -25,3 +30,17 @@ export interface ChoiceProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
25
30
|
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<ChoiceProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
26
31
|
export declare const Radio: import("react").ForwardRefExoticComponent<Omit<ChoiceProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
27
32
|
export declare const Switch: import("react").ForwardRefExoticComponent<Omit<ChoiceProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
33
|
+
/** Supporting text below a field -- `--rb-text-soft` in every theme (#210). Presentational: the
|
|
34
|
+
* consumer sets `id` and wires it into the control's `aria-describedby`. Not a live region --
|
|
35
|
+
* it renders with the field, it does not announce a change. */
|
|
36
|
+
export interface FieldHelpProps extends HTMLAttributes<HTMLParagraphElement>, RefAttributes<HTMLParagraphElement> {
|
|
37
|
+
}
|
|
38
|
+
export declare const FieldHelp: import("react").ForwardRefExoticComponent<Omit<FieldHelpProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
|
|
39
|
+
/** A field's error message -- ink text with a `--rb-danger` left bar in every theme, never
|
|
40
|
+
* coloured small text (#210, STANDARD.md 9). Presentational: the consumer sets `id`, wires it
|
|
41
|
+
* into the control's `aria-describedby`, and sets `aria-invalid="true"` on the control. Not a
|
|
42
|
+
* live region -- a live container mounted before its content changes is what reliable dynamic
|
|
43
|
+
* announcement needs, which this wrapper alone cannot guarantee. */
|
|
44
|
+
export interface FieldErrorProps extends HTMLAttributes<HTMLParagraphElement>, RefAttributes<HTMLParagraphElement> {
|
|
45
|
+
}
|
|
46
|
+
export declare const FieldError: import("react").ForwardRefExoticComponent<Omit<FieldErrorProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
|
package/dist/form.js
CHANGED
|
@@ -13,7 +13,9 @@ export const Textarea = styled("textarea", "rb-textarea");
|
|
|
13
13
|
Textarea.displayName = "Textarea";
|
|
14
14
|
export const Select = styled("select", "rb-select");
|
|
15
15
|
Select.displayName = "Select";
|
|
16
|
-
export const Label =
|
|
16
|
+
export const Label = forwardRef(function Label({ className, required, children, ...rest }, ref) {
|
|
17
|
+
return (_jsxs("label", { ref: ref, className: cx("rb-label", className), ...rest, children: [children, required && (_jsx("span", { className: "rb-label__required", "aria-hidden": "true", children: "*" }))] }));
|
|
18
|
+
});
|
|
17
19
|
Label.displayName = "Label";
|
|
18
20
|
export const Field = styled("div", "rb-field");
|
|
19
21
|
Field.displayName = "Field";
|
|
@@ -34,3 +36,7 @@ function choiceControl(displayName, cls, attrs) {
|
|
|
34
36
|
export const Checkbox = choiceControl("Checkbox", "rb-checkbox", { type: "checkbox" });
|
|
35
37
|
export const Radio = choiceControl("Radio", "rb-radio", { type: "radio" });
|
|
36
38
|
export const Switch = choiceControl("Switch", "rb-switch", { type: "checkbox", role: "switch" });
|
|
39
|
+
export const FieldHelp = styled("p", "rb-field__help");
|
|
40
|
+
FieldHelp.displayName = "FieldHelp";
|
|
41
|
+
export const FieldError = styled("p", "rb-field__error");
|
|
42
|
+
FieldError.displayName = "FieldError";
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { Card, type CardProps } from "./Card.js";
|
|
|
3
3
|
export { EmptyState, type EmptyStateProps } from "./EmptyState.js";
|
|
4
4
|
export { NavLink, type NavLinkProps } from "./NavLink.js";
|
|
5
5
|
export { NavRail, type NavRailProps, type NavRailItem } from "./NavRail.js";
|
|
6
|
-
export { Input, Textarea, Select, Label, Field, Checkbox, Radio, Switch, type InputProps, type TextareaProps, type SelectProps, type LabelProps, type FieldProps, type ChoiceProps, } from "./form.js";
|
|
6
|
+
export { Input, Textarea, Select, Label, Field, Checkbox, Radio, Switch, FieldHelp, FieldError, type InputProps, type TextareaProps, type SelectProps, type LabelProps, type FieldProps, type ChoiceProps, type FieldHelpProps, type FieldErrorProps, } from "./form.js";
|
|
7
7
|
export { Badge, Alert, Progress, Spinner, type BadgeProps, type AlertProps, type ProgressProps, type SpinnerProps, type SemanticVariant, } from "./feedback.js";
|
|
8
8
|
export { Dialog, type DialogProps } from "./Dialog.js";
|
|
9
9
|
export { Toast, ToastRegion, type ToastProps, type ToastRegionProps } from "./Toast.js";
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { Card } from "./Card.js";
|
|
|
3
3
|
export { EmptyState } from "./EmptyState.js";
|
|
4
4
|
export { NavLink } from "./NavLink.js";
|
|
5
5
|
export { NavRail } from "./NavRail.js";
|
|
6
|
-
export { Input, Textarea, Select, Label, Field, Checkbox, Radio, Switch, } from "./form.js";
|
|
6
|
+
export { Input, Textarea, Select, Label, Field, Checkbox, Radio, Switch, FieldHelp, FieldError, } from "./form.js";
|
|
7
7
|
export { Badge, Alert, Progress, Spinner, } from "./feedback.js";
|
|
8
8
|
export { Dialog } from "./Dialog.js";
|
|
9
9
|
export { Toast, ToastRegion } from "./Toast.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rackbops/ui-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43",
|
|
4
4
|
"description": "React components styled by @rackbops/styles rackbops themes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/jsdom": "^30.0.0",
|
|
33
|
-
"@types/node": "^26.
|
|
33
|
+
"@types/node": "^26.6.3",
|
|
34
34
|
"@types/react": "^19.0.0",
|
|
35
35
|
"@types/react-dom": "^19.0.0",
|
|
36
|
-
"jsdom": "^30.
|
|
36
|
+
"jsdom": "^30.1.1",
|
|
37
37
|
"react": "^19.0.0",
|
|
38
38
|
"react-dom": "^19.0.0",
|
|
39
|
-
"tsx": "^4.
|
|
39
|
+
"tsx": "^4.23.15",
|
|
40
40
|
"typescript": "^7.0.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|