@nypl/design-system-react-components 4.0.0-alpha-rc5 → 4.0.0-rc

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.
@@ -3,12 +3,12 @@ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
3
3
  export declare const accordionVariantsArray: readonly ["default", "warning", "error"];
4
4
  export type AccordionVariants = typeof accordionVariantsArray[number];
5
5
  export interface AccordionDataProps {
6
- variant?: AccordionVariants;
7
6
  ariaLabel?: string;
8
7
  /** Ref to the DOM element of the AccordionButton. */
9
8
  buttonInteractionRef?: any;
10
9
  label: string | JSX.Element;
11
10
  panel: string | React.ReactNode;
11
+ variant?: AccordionVariants;
12
12
  }
13
13
  export interface AccordionProps extends Omit<BoxProps, "onChange"> {
14
14
  /** Array of data to display, and an optional variant */
@@ -41,7 +41,7 @@ export declare const newsletterHighlightColorsArray: string[];
41
41
  export type HighlightColorTypes = typeof newsletterHighlightColorsArray[number];
42
42
  export type NewsletterSignupViewType = "form" | "submitting" | "confirmation" | "error";
43
43
  /**
44
- * The NewsletterSignup component provides a way for patrons to register for an
44
+ * The `NewsletterSignup` component provides a way for patrons to register for an
45
45
  * email-based newsletter distribution list.
46
46
  */
47
47
  export declare const NewsletterSignup: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<NewsletterSignupProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<NewsletterSignupProps>>;
@@ -38,9 +38,10 @@ export interface RadioGroupProps extends Omit<BoxProps, "onChange"> {
38
38
  }
39
39
  /**
40
40
  * `RadioGroup` is a wrapper for DS `Radio` components that render together
41
- * along with an optional helper text. The `name` prop is essential for this
42
- * form group element and is not needed for individual DS `Radio`
43
- * components when `RadioGroup` is used.
41
+ * along with an optional helper text.
42
+ *
43
+ * The `name` prop is essential for this form group element and is not needed
44
+ * for individual DS `Radio` components when `RadioGroup` is used.
44
45
  */
45
46
  export declare const RadioGroup: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<RadioGroupProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<RadioGroupProps>>;
46
47
  export default RadioGroup;
@@ -44,8 +44,8 @@ export interface SearchBarProps extends Pick<BoxProps, keyof ChakraProps>, Omit<
44
44
  textInputProps?: TextInputProps | undefined;
45
45
  }
46
46
  /**
47
- * Renders a wrapper `form` element to be used with `Select` (optional),
48
- * `Input`, and `Button` components together.
47
+ * `SearchBar` renders a wrapper `form` element containing an `Input`, `Button`,
48
+ * and optional `Select`.
49
49
  */
50
50
  export declare const SearchBar: ChakraComponent<React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLDivElement>>, SearchBarProps>;
51
51
  export default SearchBar;
@@ -5,7 +5,7 @@ export type TextSizes = typeof textSizesArray[number];
5
5
  export interface TextProps extends BoxProps {
6
6
  /** Optional prop used to show bolded text */
7
7
  isBold?: boolean;
8
- /** Optional prop used to show itlicized text */
8
+ /** Optional prop used to show italicized text */
9
9
  isItalic?: boolean;
10
10
  /** Optional prop used to show capitalized text */
11
11
  isCapitalized?: boolean;
@@ -117,7 +117,6 @@ export { default as Tooltip } from "./components/Tooltip/Tooltip";
117
117
  export type { TooltipProps } from "./components/Tooltip/Tooltip";
118
118
  export { default as VideoPlayer } from "./components/VideoPlayer/VideoPlayer";
119
119
  export type { VideoPlayerAspectRatios, VideoPlayerProps, VideoPlayerTypes, } from "./components/VideoPlayer/VideoPlayer";
120
- export { default as useCarouselStyles } from "./hooks/useCarouselStyles";
121
120
  export { default as useCloseDropDown } from "./hooks/useCloseDropDown";
122
121
  export { default as useFormatNumber } from "./hooks/useFormatNumber";
123
122
  export { default as useMultiSelect } from "./hooks/useMultiSelect";
@@ -125,5 +124,4 @@ export { default as useNYPLBreakpoints } from "./hooks/useNYPLBreakpoints";
125
124
  export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
126
125
  export { default as useResponsiveSpacing } from "./hooks/useResponsiveSpacing";
127
126
  export { default as useScrollFadeStyles } from "./hooks/useScrollFadeStyles";
128
- export { default as useWindowSize } from "./hooks/useWindowSize";
129
127
  export type { AutoCompleteValues } from "./utils/constantValues";
@@ -1,9 +1,10 @@
1
1
  import { StyleFunctionProps } from "@chakra-ui/system";
2
2
  interface SelectBaseStyle extends StyleFunctionProps {
3
3
  labelPosition: string;
4
+ showLabel: boolean;
4
5
  }
5
6
  declare const Select: {
6
- baseStyle?: ({ labelPosition }: SelectBaseStyle) => {
7
+ baseStyle?: ({ labelPosition, labelWidth, showLabel }: SelectBaseStyle) => {
7
8
  inline: {
8
9
  display: {
9
10
  md: "flex";
@@ -108,10 +109,13 @@ declare const Select: {
108
109
  };
109
110
  };
110
111
  };
112
+ "div[data-testid='ds-helperErrorText']": {
113
+ marginLeft: string;
114
+ };
111
115
  };
112
116
  sizes?: {
113
117
  [key: string]: import("@chakra-ui/styled-system").PartsStyleInterpolation<{
114
- keys: ("select" | "inline" | "helperText")[];
118
+ keys: ("select" | "inline")[];
115
119
  }>;
116
120
  };
117
121
  variants?: {
@@ -126,6 +130,6 @@ declare const Select: {
126
130
  variant?: "searchbar";
127
131
  colorScheme?: string;
128
132
  };
129
- parts: ("select" | "inline" | "helperText")[];
133
+ parts: ("select" | "inline")[];
130
134
  };
131
135
  export default Select;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/design-system-react-components",
3
- "version": "4.0.0-alpha-rc5",
3
+ "version": "4.0.0-rc",
4
4
  "description": "NYPL Reservoir Design System React Components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,17 +0,0 @@
1
- /**
2
- * Custom hook that controls the sliding function for the carousel wrapper.
3
- * This returns functions to use for the "previous" and "next" buttons as well
4
- * as a CSS style object that should be use to transition between slides. There
5
- * is also a function to programmatically slide to the first slide.
6
- * Inspired by: https://codesandbox.io/s/fxjeo
7
- */
8
- export declare const useCarouselStyles: (slidesCount?: number, slideWidth?: number) => {
9
- prevSlide: () => void;
10
- nextSlide: () => void;
11
- carouselStyle: {
12
- transition: string;
13
- marginStart: string;
14
- };
15
- goToStart: () => void;
16
- };
17
- export default useCarouselStyles;
@@ -1,10 +0,0 @@
1
- interface WindowSize {
2
- width: number;
3
- height: number;
4
- }
5
- /**
6
- * React hook used to get the window size on device resizing.
7
- * Based on https://usehooks-typescript.com/react-hook/use-window-size
8
- */
9
- declare function useWindowSize(): WindowSize;
10
- export default useWindowSize;