@coopdigital/react 1.32.4 → 1.33.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/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Combobox/Combobox.d.ts +2 -2
- package/dist/components/Combobox/Combobox.js +5 -5
- package/dist/components/Combobox/index.d.ts +1 -1
- package/dist/components/DateInput/DateInput.d.ts +2 -2
- package/dist/components/DateInput/DateInput.js +3 -3
- package/dist/components/DateInput/index.d.ts +1 -1
- package/dist/components/DateInput/index.js +1 -1
- package/dist/components/DatePicker/DatePicker.js +3 -3
- package/dist/components/DatePicker/datepicker-utils.d.ts +1 -1
- package/dist/components/Expandable/Expandable.js +1 -1
- package/dist/components/Field/Field.d.ts +6 -1
- package/dist/components/Field/Field.js +8 -7
- package/dist/components/FieldMarkers/Error.d.ts +1 -1
- package/dist/components/FieldMarkers/Hint.d.ts +1 -1
- package/dist/components/FieldMarkers/Label.d.ts +1 -1
- package/dist/components/FieldMarkers/Legend.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.js +4 -4
- package/dist/components/Pill/Pill.js +1 -1
- package/dist/components/Searchbox/Searchbox.d.ts +3 -3
- package/dist/components/Searchbox/Searchbox.js +6 -6
- package/dist/components/Signpost/Signpost.js +1 -1
- package/dist/components/ValidationSummary/ValidationSummary.js +2 -2
- package/dist/components/ValidationSummary/validationsummary-internal.d.ts +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.d.ts +33 -33
- package/package.json +10 -10
- package/src/components/Field/Field.tsx +8 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ImageProps } from "../Image/Image.js";
|
|
2
2
|
import "../Image/index.js";
|
|
3
|
-
import { StandardSizes } from "../../types/index.js";
|
|
4
|
-
import { PictureProps } from "../Picture/Picture.js";
|
|
5
3
|
import "../Picture/index.js";
|
|
4
|
+
import { PictureProps } from "../Picture/Picture.js";
|
|
5
|
+
import { StandardSizes } from "../../types/index.js";
|
|
6
6
|
import React, { AnchorHTMLAttributes, ForwardRefExoticComponent, HTMLAttributes, JSX, Ref } from "react";
|
|
7
7
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
8
|
/** Specify how the Card behaves across screen sizes.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Image } from "../Image/Image.js";
|
|
2
|
-
import { hasUserBg } from "../../utils/classes.js";
|
|
3
2
|
import Picture_default from "../Picture/index.js";
|
|
4
3
|
import { useSlots } from "../../hooks/useSlots.js";
|
|
4
|
+
import { hasUserBg } from "../../utils/classes.js";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import React from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StandardSizes } from "../../types/index.js";
|
|
2
1
|
import { ComboboxItem, ComboboxOption } from "./combobox-utils.js";
|
|
3
|
-
import { TextInputProps } from "../TextInput/TextInput.js";
|
|
4
2
|
import "../TextInput/index.js";
|
|
3
|
+
import { TextInputProps } from "../TextInput/TextInput.js";
|
|
4
|
+
import { StandardSizes } from "../../types/index.js";
|
|
5
5
|
import { ButtonHTMLAttributes, HTMLAttributes, JSX, ReactNode, Ref } from "react";
|
|
6
6
|
import { UseComboboxHighlightedIndexChange, UseComboboxInputValueChange, UseComboboxIsOpenChange, UseComboboxStateChange } from "downshift";
|
|
7
7
|
export interface ComboboxSelectEvent {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
3
|
-
import { ChevronDownIcon } from "../icons/ChevronDownIcon.js";
|
|
4
|
-
import { getSlotProp } from "../../utils/slots.js";
|
|
5
|
-
import { useSlots } from "../../hooks/useSlots.js";
|
|
6
|
-
import { getFieldError, useField } from "../Field/Field.context.js";
|
|
7
2
|
import { defaultFilter, defaultIsItemDisabled, defaultItemToString, defaultMaxResultsText, isMatchingText, normalizeOptions, resolveOption, shouldShowSelectionText } from "./combobox-internal.js";
|
|
8
3
|
import { ComboboxContext, useComboboxContext } from "./Combobox.context.js";
|
|
4
|
+
import { getFieldError, useField } from "../Field/Field.context.js";
|
|
5
|
+
import { ChevronDownIcon } from "../icons/ChevronDownIcon.js";
|
|
9
6
|
import { TextInput } from "../TextInput/TextInput.js";
|
|
10
7
|
import { useDebounce } from "../../hooks/useDebounce.js";
|
|
11
8
|
import { useFormReset } from "../../hooks/useFormReset.js";
|
|
9
|
+
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
10
|
+
import { useSlots } from "../../hooks/useSlots.js";
|
|
11
|
+
import { getSlotProp } from "../../utils/slots.js";
|
|
12
12
|
import clsx from "clsx";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ComboboxItem, ComboboxOption } from "./combobox-utils.js";
|
|
2
1
|
import { Combobox, ComboboxButton, ComboboxButtonProps, ComboboxControls, ComboboxControlsProps, ComboboxInput, ComboboxInputProps, ComboboxOptions, ComboboxOptionsProps, ComboboxProps, ComboboxSelectEvent } from "./Combobox.js";
|
|
2
|
+
import { ComboboxItem, ComboboxOption } from "./combobox-utils.js";
|
|
3
3
|
export { Combobox, Combobox as default, ComboboxButton, ComboboxButtonProps, ComboboxControls, ComboboxControlsProps, ComboboxInput, ComboboxInputProps, type ComboboxItem, type ComboboxOption, ComboboxOptions, ComboboxOptionsProps, ComboboxProps, ComboboxSelectEvent };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateParts } from "../../validations/date.js";
|
|
2
2
|
import { TextInputProps } from "../TextInput/TextInput.js";
|
|
3
3
|
import "../TextInput/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { StandardSizes } from "../../types/index.js";
|
|
5
5
|
import { DateInputMode } from "./dateinput-utils.js";
|
|
6
6
|
import { HTMLAttributes, JSX, ReactNode, Ref } from "react";
|
|
7
7
|
export interface DateInputChangeEvent {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { forEachSlot } from "../../utils/slots.js";
|
|
2
|
+
import { Field } from "../Field/Field.js";
|
|
4
3
|
import { TextInput } from "../TextInput/TextInput.js";
|
|
5
4
|
import { useFormReset } from "../../hooks/useFormReset.js";
|
|
6
|
-
import {
|
|
5
|
+
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
6
|
+
import { forEachSlot } from "../../utils/slots.js";
|
|
7
7
|
import { formatDateValue, toDateParts, toDateValue } from "../../validations/date-internal.js";
|
|
8
8
|
import { getAutoComplete } from "./dateinput-utils.js";
|
|
9
9
|
import { DateInputContext, useDateInput } from "./DateInput.context.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DateInputMode, getAutoComplete } from "./dateinput-utils.js";
|
|
2
1
|
import { DateInput, DateInputChangeEvent, DateInputDay, DateInputMonth, DateInputPartProps, DateInputProps, DateInputYear } from "./DateInput.js";
|
|
2
|
+
import { DateInputMode, getAutoComplete } from "./dateinput-utils.js";
|
|
3
3
|
export { DateInput, DateInput as default, DateInputChangeEvent, DateInputDay, DateInputMode, DateInputMonth, DateInputPartProps, DateInputProps, DateInputYear, getAutoComplete };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getAutoComplete } from "./dateinput-utils.js";
|
|
2
1
|
import { DateInput, DateInputDay, DateInputMonth, DateInputYear } from "./DateInput.js";
|
|
2
|
+
import { getAutoComplete } from "./dateinput-utils.js";
|
|
3
3
|
// src/components/DateInput/index.ts
|
|
4
4
|
var DateInput_default = DateInput;
|
|
5
5
|
export { DateInput, DateInputDay, DateInputMonth, DateInputYear, DateInput_default as default, getAutoComplete };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Button } from "../Button/Button.js";
|
|
3
|
+
import { getFieldError, useField } from "../Field/Field.context.js";
|
|
2
4
|
import { CalendarIcon } from "../icons/CalendarIcon.js";
|
|
3
5
|
import { CrossIcon } from "../icons/CrossIcon.js";
|
|
4
6
|
import { TickIcon } from "../icons/TickIcon.js";
|
|
5
|
-
import { Button } from "../Button/Button.js";
|
|
6
|
-
import { getFieldError, useField } from "../Field/Field.context.js";
|
|
7
|
-
import { TextInput } from "../TextInput/TextInput.js";
|
|
8
7
|
import { Popover } from "../Popover/Popover.js";
|
|
8
|
+
import { TextInput } from "../TextInput/TextInput.js";
|
|
9
9
|
import { getDateValues, getDefaultMonth, getEndDate, getInitialDate, getStartDate, shouldClose, shouldSkipParsing } from "./datepicker-utils.js";
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChevronDownIcon } from "../icons/ChevronDownIcon.js";
|
|
2
|
-
import { hasUserBg } from "../../utils/classes.js";
|
|
3
2
|
import { useSlots } from "../../hooks/useSlots.js";
|
|
3
|
+
import { hasUserBg } from "../../utils/classes.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
// src/components/Expandable/Expandable.tsx
|
|
@@ -15,11 +15,16 @@ interface FieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
15
15
|
error?: boolean;
|
|
16
16
|
/** Specify whether the Field should show the left-hand error bar if it is in an error state. */
|
|
17
17
|
hideErrorBar?: boolean;
|
|
18
|
+
/** For Radio and Checkbox, specify whether the control renders on the same row as the label.
|
|
19
|
+
*
|
|
20
|
+
* Default: `true`
|
|
21
|
+
*/
|
|
22
|
+
inline?: boolean;
|
|
18
23
|
/** Specify a custom React ref for this component. */
|
|
19
24
|
ref?: Ref<HTMLDivElement>;
|
|
20
25
|
}
|
|
21
26
|
declare const Field: {
|
|
22
|
-
({ boxed, children, className, error: errorProp, hideErrorBar, ref, ...props }: FieldProps): JSX.Element;
|
|
27
|
+
({ boxed, children, className, error: errorProp, hideErrorBar, inline, ref, ...props }: FieldProps): JSX.Element;
|
|
23
28
|
slot: {
|
|
24
29
|
name: string;
|
|
25
30
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
3
|
-
import { forEachSlot, getSlotProp } from "../../utils/slots.js";
|
|
4
|
-
import { getMarkerIds } from "../FieldMarkers/fieldmarkers-internal.js";
|
|
5
|
-
import { FieldContext, useField } from "./Field.context.js";
|
|
6
2
|
import { Error } from "../FieldMarkers/Error.js";
|
|
3
|
+
import { getMarkerIds } from "../FieldMarkers/fieldmarkers-internal.js";
|
|
7
4
|
import { Hint } from "../FieldMarkers/Hint.js";
|
|
8
5
|
import { Label } from "../FieldMarkers/Label.js";
|
|
9
6
|
import { useFieldset } from "../Fieldset/Fieldset.context.js";
|
|
7
|
+
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
8
|
+
import { forEachSlot, getSlotProp } from "../../utils/slots.js";
|
|
9
|
+
import { FieldContext, useField } from "./Field.context.js";
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
12
|
import "react";
|
|
13
13
|
// src/components/Field/Field.tsx
|
|
14
|
-
const Field = ({ boxed = false, children, className, error: errorProp, hideErrorBar = false, ref, ...props }) => {
|
|
14
|
+
const Field = ({ boxed = false, children, className, error: errorProp, hideErrorBar = false, inline, ref, ...props }) => {
|
|
15
15
|
const internalId = useId$1();
|
|
16
16
|
const fieldset = useFieldset();
|
|
17
17
|
const error = errorProp ?? fieldset?.error ?? false;
|
|
@@ -33,10 +33,11 @@ const Field = ({ boxed = false, children, className, error: errorProp, hideError
|
|
|
33
33
|
const componentProps = {
|
|
34
34
|
...props,
|
|
35
35
|
"aria-disabled": controlProps.disabled || void 0,
|
|
36
|
-
className: clsx("coop-field",
|
|
36
|
+
className: clsx("coop-field", className),
|
|
37
37
|
"data-boxed": boxed || void 0,
|
|
38
38
|
"data-error": error || void 0,
|
|
39
|
-
"data-hide-error": hideErrorBar || void 0
|
|
39
|
+
"data-hide-error": hideErrorBar || void 0,
|
|
40
|
+
"data-inline": inline ?? controlProps.inline
|
|
40
41
|
};
|
|
41
42
|
return /* @__PURE__ */ jsx(FieldContext.Provider, {
|
|
42
43
|
value: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useId } from "../../hooks/useId.js";
|
|
3
|
-
import { forEachSlot, getSlotProp } from "../../utils/slots.js";
|
|
4
|
-
import { getMarkerIds, joinIds } from "../FieldMarkers/fieldmarkers-internal.js";
|
|
5
2
|
import { Error } from "../FieldMarkers/Error.js";
|
|
3
|
+
import { getMarkerIds, joinIds } from "../FieldMarkers/fieldmarkers-internal.js";
|
|
6
4
|
import { Hint } from "../FieldMarkers/Hint.js";
|
|
7
|
-
import { FieldsetContext, useFieldset } from "./Fieldset.context.js";
|
|
8
5
|
import { Legend } from "../FieldMarkers/Legend.js";
|
|
6
|
+
import { useId } from "../../hooks/useId.js";
|
|
7
|
+
import { forEachSlot, getSlotProp } from "../../utils/slots.js";
|
|
8
|
+
import { FieldsetContext, useFieldset } from "./Fieldset.context.js";
|
|
9
9
|
import clsx from "clsx";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
// src/components/Fieldset/Fieldset.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { StandardSizes } from "../../types/index.js";
|
|
2
|
-
import { ButtonProps } from "../Button/Button.js";
|
|
3
1
|
import "../Button/index.js";
|
|
4
|
-
import {
|
|
2
|
+
import { ButtonProps } from "../Button/Button.js";
|
|
5
3
|
import "../TextInput/index.js";
|
|
4
|
+
import { TextInputProps } from "../TextInput/TextInput.js";
|
|
5
|
+
import { StandardSizes } from "../../types/index.js";
|
|
6
6
|
import React, { FormHTMLAttributes, JSX, RefObject } from "react";
|
|
7
7
|
export interface SearchboxProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
8
8
|
/** Specify a server endpoint to submit the form. Will be ignored if onSubmit is also set. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
3
|
-
import { SearchIcon } from "../icons/SearchIcon.js";
|
|
4
|
-
import { hasUserBorder } from "../../utils/classes.js";
|
|
5
|
-
import { getSlotProp } from "../../utils/slots.js";
|
|
6
2
|
import { Button } from "../Button/Button.js";
|
|
7
|
-
import { useSlots } from "../../hooks/useSlots.js";
|
|
8
|
-
import TextInput_default from "../TextInput/index.js";
|
|
9
3
|
import { Field, FieldLabel } from "../Field/Field.js";
|
|
4
|
+
import { SearchIcon } from "../icons/SearchIcon.js";
|
|
10
5
|
import { SearchboxContext, useSearchbox } from "./Searchbox.context.js";
|
|
6
|
+
import TextInput_default from "../TextInput/index.js";
|
|
7
|
+
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
8
|
+
import { useSlots } from "../../hooks/useSlots.js";
|
|
9
|
+
import { getSlotProp } from "../../utils/slots.js";
|
|
10
|
+
import { hasUserBorder } from "../../utils/classes.js";
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useState } from "react";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getSlotProp } from "../../utils/slots.js";
|
|
3
|
-
import { useSlots } from "../../hooks/useSlots.js";
|
|
4
2
|
import { getFieldElement, getFieldOrder, getForm, sanitizeFieldId, sortErrorsByFieldOrder } from "./validationsummary-internal.js";
|
|
5
3
|
import { ValidationSummaryContext, useValidationSummary } from "./ValidationSummary.context.js";
|
|
4
|
+
import { useSlots } from "../../hooks/useSlots.js";
|
|
5
|
+
import { getSlotProp } from "../../utils/slots.js";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useId } from "./useId.js";
|
|
2
|
-
import { useSlots } from "./useSlots.js";
|
|
3
1
|
import { useDebounce } from "./useDebounce.js";
|
|
4
2
|
import { useFormReset } from "./useFormReset.js";
|
|
3
|
+
import { useId } from "./useId.js";
|
|
4
|
+
import { useSlots } from "./useSlots.js";
|
|
5
5
|
export { useDebounce, useFormReset, useId, useSlots };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { AlertBanner, AlertBannerHeading, AlertBannerProps } from "./components/AlertBanner/AlertBanner.js";
|
|
2
2
|
import "./components/AlertBanner/index.js";
|
|
3
3
|
import { Image, ImageProps } from "./components/Image/Image.js";
|
|
4
|
-
import "./components/Image/index.js";
|
|
5
|
-
import { Author, AuthorImage, AuthorImageProps, AuthorMeta, AuthorMetaProps, AuthorProps } from "./components/Author/Author.js";
|
|
6
4
|
import "./components/Author/index.js";
|
|
7
|
-
import {
|
|
5
|
+
import { Author, AuthorImage, AuthorImageProps, AuthorMeta, AuthorMetaProps, AuthorProps } from "./components/Author/Author.js";
|
|
8
6
|
import "./components/Box/index.js";
|
|
9
|
-
import {
|
|
7
|
+
import { Box, BoxProps } from "./components/Box/Box.js";
|
|
10
8
|
import "./components/Button/index.js";
|
|
9
|
+
import { Button, ButtonProps } from "./components/Button/Button.js";
|
|
10
|
+
import "./components/Card/index.js";
|
|
11
11
|
import { Picture, PictureProps } from "./components/Picture/Picture.js";
|
|
12
|
-
import "./components/
|
|
12
|
+
import "./components/Checkbox/index.js";
|
|
13
13
|
import { Card, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture, CardProps } from "./components/Card/Card.js";
|
|
14
|
-
import "./components/
|
|
14
|
+
import "./components/Combobox/index.js";
|
|
15
15
|
import { Checkbox, CheckboxProps } from "./components/Checkbox/Checkbox.js";
|
|
16
|
-
import "./components/
|
|
16
|
+
import "./components/DateInput/index.js";
|
|
17
17
|
import { ComboboxItem, ComboboxOption } from "./components/Combobox/combobox-utils.js";
|
|
18
18
|
import { TextInput, TextInputProps } from "./components/TextInput/TextInput.js";
|
|
19
|
-
import "./components/
|
|
19
|
+
import "./components/DatePicker/index.js";
|
|
20
20
|
import { Combobox, ComboboxButton, ComboboxButtonProps, ComboboxControls, ComboboxControlsProps, ComboboxInput, ComboboxInputProps, ComboboxOptions, ComboboxOptionsProps, ComboboxProps, ComboboxSelectEvent } from "./components/Combobox/Combobox.js";
|
|
21
|
-
import "./components/
|
|
21
|
+
import "./components/Dialog/index.js";
|
|
22
22
|
import { DATE_ERROR_MESSAGES, DATE_PARTS, DateErrorCode, DateErrorMessage, DatePart, DateParts, DateValidation, DateValidationError, DateValidationOptions, DateValidationSuccess, validateDate, validateDateParts, validateDob } from "./validations/date.js";
|
|
23
23
|
import { DateInputMode, getAutoComplete } from "./components/DateInput/dateinput-utils.js";
|
|
24
24
|
import { DateInput, DateInputChangeEvent, DateInputDay, DateInputMonth, DateInputPartProps, DateInputProps, DateInputYear } from "./components/DateInput/DateInput.js";
|
|
25
|
-
import "./components/
|
|
25
|
+
import "./components/Expandable/index.js";
|
|
26
26
|
import { DateType, DateTypeStr } from "./components/DatePicker/datepicker-utils.js";
|
|
27
27
|
import { DatePicker, DatePickerProps } from "./components/DatePicker/DatePicker.js";
|
|
28
|
-
import "./components/
|
|
28
|
+
import "./components/Field/index.js";
|
|
29
29
|
import { Dialog, DialogBody, DialogHeader, DialogProps } from "./components/Dialog/Dialog.js";
|
|
30
|
-
import "./components/
|
|
30
|
+
import "./components/Fieldset/index.js";
|
|
31
31
|
import { Expandable, ExpandableContent, ExpandableProps, ExpandableSummary } from "./components/Expandable/Expandable.js";
|
|
32
|
-
import "./components/
|
|
32
|
+
import "./components/Flourish/index.js";
|
|
33
33
|
import { Field, FieldError, FieldHint, FieldLabel } from "./components/Field/Field.js";
|
|
34
|
-
import "./components/
|
|
34
|
+
import "./components/Form/index.js";
|
|
35
35
|
import { Fieldset, FieldsetError, FieldsetFields, FieldsetHint, FieldsetLegend, FieldsetProps } from "./components/Fieldset/Fieldset.js";
|
|
36
|
-
import "./components/
|
|
36
|
+
import "./components/Image/index.js";
|
|
37
37
|
import { Flourish, FlourishProps } from "./components/Flourish/Flourish.js";
|
|
38
|
-
import "./components/
|
|
38
|
+
import "./components/LoadingSpinner/index.js";
|
|
39
39
|
import { Form, FormProps } from "./components/Form/Form.js";
|
|
40
|
-
import "./components/
|
|
40
|
+
import "./components/Logo/index.js";
|
|
41
41
|
import { LoadingSpinner, LoadingSpinnerProps } from "./components/LoadingSpinner/LoadingSpinner.js";
|
|
42
|
-
import "./components/
|
|
42
|
+
import "./components/PasswordInput/index.js";
|
|
43
43
|
import { Logo, LogoProps } from "./components/Logo/Logo.js";
|
|
44
|
-
import "./components/
|
|
44
|
+
import "./components/Picture/index.js";
|
|
45
45
|
import { PasswordInput, PasswordInputProps } from "./components/PasswordInput/PasswordInput.js";
|
|
46
|
-
import "./components/PasswordInput/index.js";
|
|
47
|
-
import { Pill, PillBadge, PillProps } from "./components/Pill/Pill.js";
|
|
48
46
|
import "./components/Pill/index.js";
|
|
49
|
-
import {
|
|
47
|
+
import { Pill, PillBadge, PillProps } from "./components/Pill/Pill.js";
|
|
50
48
|
import "./components/Popover/index.js";
|
|
51
|
-
import {
|
|
49
|
+
import { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverProps, PopoverTrigger } from "./components/Popover/Popover.js";
|
|
52
50
|
import "./components/Prose/index.js";
|
|
53
|
-
import {
|
|
51
|
+
import { Prose, ProseProps } from "./components/Prose/Prose.js";
|
|
54
52
|
import "./components/Radio/index.js";
|
|
55
|
-
import {
|
|
53
|
+
import { Radio, RadioProps } from "./components/Radio/Radio.js";
|
|
56
54
|
import "./components/RootSVG/index.js";
|
|
57
|
-
import {
|
|
55
|
+
import { RootSVG } from "./components/RootSVG/RootSVG.js";
|
|
58
56
|
import "./components/Searchbox/index.js";
|
|
59
|
-
import {
|
|
57
|
+
import { Searchbox, SearchboxButton, SearchboxInput, SearchboxProps } from "./components/Searchbox/Searchbox.js";
|
|
60
58
|
import "./components/Section/index.js";
|
|
61
|
-
import {
|
|
59
|
+
import { Section, SectionProps } from "./components/Section/Section.js";
|
|
62
60
|
import "./components/Select/index.js";
|
|
63
|
-
import {
|
|
61
|
+
import { Select, SelectOption, SelectOptionGroup, SelectProps } from "./components/Select/Select.js";
|
|
64
62
|
import "./components/Signpost/index.js";
|
|
65
|
-
import {
|
|
63
|
+
import { Signpost, SignpostProps } from "./components/Signpost/Signpost.js";
|
|
66
64
|
import "./components/SkipNav/index.js";
|
|
67
|
-
import {
|
|
65
|
+
import { SkipNav, SkipNavProps } from "./components/SkipNav/SkipNav.js";
|
|
68
66
|
import "./components/Squircle/index.js";
|
|
69
|
-
import {
|
|
67
|
+
import { Squircle, SquircleProps, SquircleSvg, SquircleSvgProps, SquircleText } from "./components/Squircle/Squircle.js";
|
|
70
68
|
import "./components/Tag/index.js";
|
|
71
|
-
import {
|
|
69
|
+
import { Tag, TagProps } from "./components/Tag/Tag.js";
|
|
72
70
|
import "./components/Textarea/index.js";
|
|
71
|
+
import { Textarea, TextareaProps } from "./components/Textarea/Textarea.js";
|
|
72
|
+
import "./components/TextInput/index.js";
|
|
73
73
|
import { ValidationSummary, ValidationSummaryErrors, ValidationSummaryHeading, ValidationSummaryPrompt, ValidationSummaryProps } from "./components/ValidationSummary/ValidationSummary.js";
|
|
74
74
|
import "./components/ValidationSummary/index.js";
|
|
75
75
|
import { Wrapper, WrapperProps } from "./components/Wrapper/Wrapper.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopdigital/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.33.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
"description": "React components for the Experience Library design system",
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@axe-core/playwright": "^4.14.0",
|
|
79
|
-
"@playwright/test": "^1.
|
|
80
|
-
"@storybook/addon-a11y": "^10.6.
|
|
81
|
-
"@storybook/addon-docs": "^10.6.
|
|
82
|
-
"@storybook/addon-links": "^10.6.
|
|
83
|
-
"@storybook/addon-onboarding": "^10.6.
|
|
84
|
-
"@storybook/react-vite": "^10.6.
|
|
79
|
+
"@playwright/test": "^1.65.0",
|
|
80
|
+
"@storybook/addon-a11y": "^10.6.6",
|
|
81
|
+
"@storybook/addon-docs": "^10.6.6",
|
|
82
|
+
"@storybook/addon-links": "^10.6.6",
|
|
83
|
+
"@storybook/addon-onboarding": "^10.6.6",
|
|
84
|
+
"@storybook/react-vite": "^10.6.6",
|
|
85
85
|
"@testing-library/jest-dom": "^7.0.1",
|
|
86
86
|
"@testing-library/react": "^16.3.3",
|
|
87
87
|
"@types/react": "^19.3.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"react-hook-form": "^7.91.0",
|
|
94
94
|
"resize-observer-polyfill": "^1.5.1",
|
|
95
95
|
"serve": "^14.2.6",
|
|
96
|
-
"storybook": "^10.6.
|
|
96
|
+
"storybook": "^10.6.6",
|
|
97
97
|
"storybook-addon-tag-badges": "^3.1.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"storybook": "$storybook"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@coopdigital/styles": "^1.
|
|
120
|
+
"@coopdigital/styles": "^1.24.0",
|
|
121
121
|
"@radix-ui/react-popover": "^1.3.1",
|
|
122
122
|
"clsx": "^2.1.1",
|
|
123
123
|
"date-fns": "^4.4.0",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"merge-refs": "^2.0.0",
|
|
127
127
|
"react-day-picker": "^10.0.2"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "5dfe0e7c059ab52fcc2b68b94ea772962a5176cd"
|
|
130
130
|
}
|
|
@@ -27,6 +27,11 @@ interface FieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
27
27
|
error?: boolean
|
|
28
28
|
/** Specify whether the Field should show the left-hand error bar if it is in an error state. */
|
|
29
29
|
hideErrorBar?: boolean
|
|
30
|
+
/** For Radio and Checkbox, specify whether the control renders on the same row as the label.
|
|
31
|
+
*
|
|
32
|
+
* Default: `true`
|
|
33
|
+
*/
|
|
34
|
+
inline?: boolean
|
|
30
35
|
/** Specify a custom React ref for this component. */
|
|
31
36
|
ref?: Ref<HTMLDivElement>
|
|
32
37
|
}
|
|
@@ -37,6 +42,7 @@ const Field = ({
|
|
|
37
42
|
className,
|
|
38
43
|
error: errorProp,
|
|
39
44
|
hideErrorBar = false,
|
|
45
|
+
inline,
|
|
40
46
|
ref,
|
|
41
47
|
...props
|
|
42
48
|
}: FieldProps): JSX.Element => {
|
|
@@ -70,10 +76,11 @@ const Field = ({
|
|
|
70
76
|
const componentProps = {
|
|
71
77
|
...props,
|
|
72
78
|
"aria-disabled": controlProps.disabled || undefined,
|
|
73
|
-
className: clsx("coop-field",
|
|
79
|
+
className: clsx("coop-field", className),
|
|
74
80
|
"data-boxed": boxed || undefined,
|
|
75
81
|
"data-error": error || undefined,
|
|
76
82
|
"data-hide-error": hideErrorBar || undefined,
|
|
83
|
+
"data-inline": inline ?? controlProps.inline,
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
return (
|