@nypl/design-system-react-components 1.4.0-rc3 → 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.
@@ -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, greetingRef, isMobile }: HeaderLoginProps) => JSX.Element, {}>;
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
- * Helper or error text for forms components.
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
- interface BaseProps {
4
- id?: string;
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 interface SelectProps extends BaseProps {
9
+ export declare type SelectProps = Partial<Pick<InitialSelectProps, "id" | "labelText" | "name" | "onChange" | "value">> & {
15
10
  optionsData: SelectOptionsProps[];
16
- onChange?: (event: React.FormEvent) => void;
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