@nypl/design-system-react-components 1.4.0 → 1.4.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.
- package/CHANGELOG.md +22 -2
- package/dist/components/Header/components/HeaderLogin.d.ts +1 -2
- package/dist/components/Header/components/HeaderSearchForm.d.ts +1 -0
- package/dist/components/Header/utils/headerUtils.d.ts +4 -0
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +6 -1
- package/dist/components/SearchBar/SearchBar.d.ts +5 -14
- package/dist/components/TextInput/TextInput.d.ts +2 -0
- package/dist/design-system-react-components.cjs.development.js +567 -821
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +568 -822
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/theme/components/header/headerLogin.d.ts +1 -8
- package/dist/theme/components/header/headerSearchForm.d.ts +14 -14
- package/dist/utils/utils.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,25 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 1.4.1 (February 9, 2023)
|
|
12
|
+
|
|
13
|
+
### Adds
|
|
14
|
+
|
|
15
|
+
- Adds the `pattern` prop to the `TextInput` component.
|
|
16
|
+
- Adds documentation page "Dynamic Content" to the `Accessibility Guide`.
|
|
17
|
+
- Adds the `isRenderedText` prop to the `HelperErrorText` component.
|
|
18
|
+
|
|
19
|
+
### Updates
|
|
20
|
+
|
|
21
|
+
- Adds a third radio button to the `Header` component, separating search options between the Circulating Catalog, Research Catalog, and the NYPL.org website.
|
|
22
|
+
- Temporarily removes the "log in" state from the `Header` component, the feature to read auth cookies, and the patron's name when logged in, and the log out link.
|
|
23
|
+
- Truncate breadcrumb text if beyond 40 characters then add ellipsis at the end. If the breadcrumb text is truncated, the DS `Tooltip` component is used to display the full text in a tooltip when the text is hovered.
|
|
24
|
+
- Updates the `SearchBar`'s `textInputProps` prop to include the following props to pass to the `TextInput` component: `isClearableCallback`, `max`, `maxLength`, `min`, and `pattern`.
|
|
25
|
+
- Updates how the `CheckboxGroup`, `ComponentWrapper`, `DatePicker`, and `RadioGroup` components internally render the `HelperErrorText` component. The update in the `ComponentWrapper` component affects the `AudioPlayer`, `Checkbox`, `Radio`, `SearchBar`, `Select`, `Slider`, `TextInput`, `Toggle`, and `VideoPlayer` DS components, each of which render helper or error text.
|
|
26
|
+
- Updates the `MultiSelect` component so it closes when the "escape" key is pressed.
|
|
27
|
+
- Updates where the focus is set in the `MultiSelect` "dialog" variant after the "Apply" button is clicked.
|
|
28
|
+
- Updates where the focus is set in the `MultiSelect` component after the selected items count button is clicked.
|
|
29
|
+
|
|
11
30
|
## 1.4.0 (January 26, 2023)
|
|
12
31
|
|
|
13
32
|
### Adds
|
|
@@ -28,7 +47,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
28
47
|
`dark.ui.status.primary`, `dark.ui.status.secondary`, `dark.ui.success.primary`,
|
|
29
48
|
`dark.ui.success.secondary`, `dark.ui.warning.primary`
|
|
30
49
|
and `dark.ui.warning.secondary`.
|
|
31
|
-
- Updates the layout of the category `RadioGroup` to `column` for the
|
|
50
|
+
- Updates the layout of the category `RadioGroup` to `column` for the mobile
|
|
32
51
|
view of the `FeedbackBox` component.
|
|
33
52
|
- Updates the background color for the `"iconOnly"` and `"text"` variants of
|
|
34
53
|
the `Button` component.
|
|
@@ -39,6 +58,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
39
58
|
- Updates the `HelperErrorText` component to set the `ariaLive` default value
|
|
40
59
|
to `"polite"`.
|
|
41
60
|
- Updates the `Accessibility` details for the `Notification` component.
|
|
61
|
+
- Better docs for the `onSubmit` prop in the `FeedbackBox` component.
|
|
42
62
|
|
|
43
63
|
### Fixes
|
|
44
64
|
|
|
@@ -198,7 +218,7 @@ This release is exactly the same as the `1.3.0-rc` release candidate published o
|
|
|
198
218
|
|
|
199
219
|
- Deprecates the `link` variant in the `Button` component.
|
|
200
220
|
|
|
201
|
-
## 1.1.0 (
|
|
221
|
+
## 1.1.0 (August 30, 2022)
|
|
202
222
|
|
|
203
223
|
This release is exactly the same as the `1.1.0-rc5` release candidate which was published and reviewed. Minor bug fixes, listed below, were made.
|
|
204
224
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface HeaderLoginProps {
|
|
3
3
|
catalogRef?: React.RefObject<HTMLDivElement & HTMLAnchorElement>;
|
|
4
|
-
greetingRef?: React.RefObject<HTMLDivElement>;
|
|
5
4
|
isMobile?: boolean;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
@@ -9,5 +8,5 @@ export interface HeaderLoginProps {
|
|
|
9
8
|
* in and log out. When the patron is logged in, it will also display the patron's
|
|
10
9
|
* name, links to the catalogs, and a log out link.
|
|
11
10
|
*/
|
|
12
|
-
declare const HeaderLogin: import("@chakra-ui/react").ChakraComponent<({ catalogRef,
|
|
11
|
+
declare const HeaderLogin: import("@chakra-ui/react").ChakraComponent<({ catalogRef, isMobile }: HeaderLoginProps) => JSX.Element, {}>;
|
|
13
12
|
export default HeaderLogin;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export interface HeaderSearchFormProps {
|
|
3
3
|
isMobile?: boolean;
|
|
4
4
|
}
|
|
5
|
+
export declare type SearchOptionType = "circulatingCatalog" | "researchCatalog" | "website";
|
|
5
6
|
/**
|
|
6
7
|
* Displays the search form for the Header's search interface. On mobile, two
|
|
7
8
|
* buttons are displayed and on desktop, two radio inputs are displayed.
|
|
@@ -48,6 +48,10 @@ export declare const encoreEncodeSearchString: (searchString: any) => any;
|
|
|
48
48
|
* Returns the final URL for the NYPL Encore search.
|
|
49
49
|
*/
|
|
50
50
|
export declare const getEncoreCatalogURL: (searchValue: any) => any;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the final URL for the NYPL Research Catalog search.
|
|
53
|
+
*/
|
|
54
|
+
export declare const getResearchCatalogURL: (searchValue: any) => string;
|
|
51
55
|
/**
|
|
52
56
|
* Returns the final URL for the NYPL catalog search.
|
|
53
57
|
*/
|
|
@@ -19,11 +19,16 @@ interface HelperErrorTextProps {
|
|
|
19
19
|
id?: string;
|
|
20
20
|
/** Toggles between helper and invalid styling. */
|
|
21
21
|
isInvalid?: boolean;
|
|
22
|
+
/** Offers the ability to render or not render the content passed in
|
|
23
|
+
* the `text` prop; `true` by default. */
|
|
24
|
+
isRenderedText?: boolean;
|
|
22
25
|
/** The text to display. */
|
|
23
26
|
text: HelperErrorTextType;
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
29
|
+
* Component that always renders a div even if the text content is not passed.
|
|
30
|
+
* This pattern guarantees accessibility guidelines are met if the text content
|
|
31
|
+
* is dynamically updated by the app or component that implements it.
|
|
27
32
|
*/
|
|
28
33
|
export declare const HelperErrorText: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<HelperErrorTextProps & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
29
34
|
export default HelperErrorText;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
labelText: string;
|
|
6
|
-
name: string;
|
|
7
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
8
|
-
value?: string;
|
|
9
|
-
}
|
|
3
|
+
import { SelectProps as InitialSelectProps } from "../Select/Select";
|
|
4
|
+
import { InputProps as InitialInputProps } from "../TextInput/TextInput";
|
|
10
5
|
interface SelectOptionsProps {
|
|
11
6
|
text: string;
|
|
12
7
|
value: string;
|
|
13
8
|
}
|
|
14
|
-
export
|
|
9
|
+
export declare type SelectProps = Partial<Pick<InitialSelectProps, "id" | "labelText" | "name" | "onChange" | "value">> & {
|
|
15
10
|
optionsData: SelectOptionsProps[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export interface TextInputProps extends BaseProps {
|
|
19
|
-
isClearable?: boolean;
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export declare type TextInputProps = Pick<InitialInputProps, "labelText" | "name"> & Partial<Pick<InitialInputProps, "id" | "isClearable" | "isClearableCallback" | "max" | "maxLength" | "min" | "onChange" | "pattern" | "placeholder" | "value">>;
|
|
22
13
|
export interface SearchBarProps {
|
|
23
14
|
/** Adds 'action' property to the `form` element. */
|
|
24
15
|
action?: string;
|
|
@@ -50,6 +50,8 @@ export interface InputProps {
|
|
|
50
50
|
onClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
51
51
|
/** The action to perform on the `input`/`textarea`'s onFocus function */
|
|
52
52
|
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
53
|
+
/** Regex to query the user input against. */
|
|
54
|
+
pattern?: string;
|
|
53
55
|
/** Populates the placeholder for the input/textarea elements */
|
|
54
56
|
placeholder?: string;
|
|
55
57
|
/** Allows the '(Required)' text to be changed for language purposes
|