@nypl/design-system-react-components 3.2.0-rc → 3.2.0-rc2

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.
@@ -0,0 +1,31 @@
1
+ import { ChakraComponent } from "@chakra-ui/react";
2
+ import React from "react";
3
+ import { LayoutTypes } from "../../helpers/types";
4
+ import { MultiSelectWidths, SelectedItems as MultiSelectItems } from "../MultiSelect/MultiSelect";
5
+ export type FilterBarItemsType = (boolean | number | number[] | string | string[] | MultiSelectItems)[];
6
+ interface FilterBarInlineProps {
7
+ /** The className of the FilterBarInline. */
8
+ className?: string;
9
+ /** ID that other components can cross reference for accessibility purposes. */
10
+ id?: string;
11
+ /** Optional string value used to set the text for a `Heading` component, or
12
+ * a DS Heading component that can be passed in.
13
+ */
14
+ heading?: string | JSX.Element;
15
+ /** Renders the layout of the FilterBarInline child components in a row or column. */
16
+ layout?: LayoutTypes;
17
+ /** Function for the global `Clear Filters` button. If passed the `Clear Filters` button will render. */
18
+ onClear?: () => void;
19
+ /** Function for the global `Apply Filters` button. If passed the `Apply Filters` button will render. */
20
+ onSubmit?: () => void;
21
+ /** Render prop function used to render child components with updated props. */
22
+ renderChildren: ({ isBlockElement, layout, width, }: {
23
+ isBlockElement?: boolean;
24
+ layout?: LayoutTypes;
25
+ width?: MultiSelectWidths;
26
+ }) => React.ReactNode;
27
+ /** The selected items state (items that were checked by user). */
28
+ selectedItems?: FilterBarItemsType;
29
+ }
30
+ export declare const FilterBarInline: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<FilterBarInlineProps> & React.RefAttributes<HTMLDivElement>>, FilterBarInlineProps>;
31
+ export default FilterBarInline;
@@ -0,0 +1,48 @@
1
+ import { ChakraComponent } from "@chakra-ui/react";
2
+ import { LayoutTypes } from "../../helpers/types";
3
+ import React from "react";
4
+ export declare const borderTypeArray: readonly ["none", "circular", "straight"];
5
+ export type BorderType = typeof borderTypeArray[number];
6
+ export declare const colorTypeArray: readonly ["link", "textDefault", "textInverse"];
7
+ export type ColorType = typeof colorTypeArray[number];
8
+ export declare const sizeTypeArray: readonly ["small", "medium", "large"];
9
+ export type SizeType = typeof sizeTypeArray[number];
10
+ type IconNames = "fileTypeGenericDoc" | "socialFacebook" | "socialInstagram" | "socialPinterest" | "socialSoundCloud" | "socialTikTok" | "socialTumblr" | "socialTwitter" | "socialYoutube";
11
+ export interface SocialMediaLinkDataProps {
12
+ /** Required. Label rendered on page is showLabel is true */
13
+ labelText: string;
14
+ /** Required. Should match the social media platform that it's linking to */
15
+ icon: IconNames;
16
+ /** Required. Url to link to the platform */
17
+ url: string;
18
+ }
19
+ interface BaseSocialMediaLinksProps {
20
+ /** Optional className you can add in addition to "social-media-links." */
21
+ className?: string;
22
+ /** Any of three optional values that will change the color of the svg and label text (if any). */
23
+ color?: ColorType;
24
+ /** ID that other components can cross-reference for accessibility purposes. */
25
+ id?: string;
26
+ /** Optional desktop layout. Smaller viewports are always in a column if there are labels and
27
+ * in a row if there are no labels. */
28
+ layout?: LayoutTypes;
29
+ /** Required. Array of social media platform types, urls, and label texts. */
30
+ linksData: SocialMediaLinkDataProps[];
31
+ /** Optional size: small, medium, or large. */
32
+ size?: SizeType;
33
+ }
34
+ type ConditionalSocialMediaLinksProps = {
35
+ showLabels?: true;
36
+ borders?: Exclude<BorderType, "circular">;
37
+ } | {
38
+ showLabels?: false;
39
+ borders?: BorderType;
40
+ };
41
+ export type SocialMediaLinksProps = BaseSocialMediaLinksProps & ConditionalSocialMediaLinksProps;
42
+ /**
43
+ * The SocialMediaLinks component renders a list of links for accessing social media sites.
44
+ * The data passed to the `linksData` prop controls which social media icons are displayed,
45
+ * the order they appear, the url they link to, and the text used for the label of each.
46
+ */
47
+ export declare const SocialMediaLinks: ChakraComponent<React.ForwardRefExoticComponent<SocialMediaLinksProps & React.RefAttributes<HTMLDivElement & HTMLUListElement & HTMLOListElement>>, SocialMediaLinksProps>;
48
+ export default SocialMediaLinks;
@@ -23,6 +23,7 @@ export { default as FeaturedContent } from "./components/FeaturedContent/Feature
23
23
  export { default as FeedbackBox, useFeedbackBox, } from "./components/FeedbackBox/FeedbackBox";
24
24
  export type { FeedbackBoxViewType } from "./components/FeedbackBox/FeedbackBox";
25
25
  export { default as Fieldset } from "./components/Fieldset/Fieldset";
26
+ export { default as FilterBarInline } from "./components/FilterBarInline/FilterBarInline";
26
27
  export { default as Form, FormField, FormRow } from "./components/Form/Form";
27
28
  export { default as Heading } from "./components/Heading/Heading";
28
29
  export type { HeadingSizes, HeadingLevels } from "./components/Heading/Heading";
@@ -51,10 +52,8 @@ export { default as MultiSelect } from "./components/MultiSelect/MultiSelect";
51
52
  export type { MultiSelectItem, SelectedItems, } from "./components/MultiSelect/MultiSelect";
52
53
  export { default as MultiSelectGroup } from "./components/MultiSelectGroup/MultiSelectGroup";
53
54
  export type { MultiSelectGroupProps } from "./components/MultiSelectGroup/MultiSelectGroup";
54
- /** The code associated with the NewsletterSignup component and the
55
- * NewsletterSignupViewType type will not be exported until the refactor of the
56
- * component has been completed.
57
- * */
55
+ export { default as NewsletterSignup } from "./components/NewsletterSignup/NewsletterSignup";
56
+ export type { NewsletterSignupViewType } from "./components/NewsletterSignup/NewsletterSignup";
58
57
  export { default as Notification } from "./components/Notification/Notification";
59
58
  export type { NotificationTypes } from "./components/Notification/Notification";
60
59
  export { default as Pagination } from "./components/Pagination/Pagination";
@@ -71,9 +70,7 @@ export { default as SkeletonLoader } from "./components/SkeletonLoader/SkeletonL
71
70
  export type { SkeletonLoaderImageRatios } from "./components/SkeletonLoader/SkeletonLoader";
72
71
  export { default as SkipNavigation } from "./components/SkipNavigation/SkipNavigation";
73
72
  export { default as Slider } from "./components/Slider/Slider";
74
- /** The code associated with the SocialMediaLinks component will not be exported
75
- * until the refactor of the component has been completed.
76
- * */
73
+ export { default as SocialMediaLinks } from "./components/SocialMediaLinks/SocialMediaLinks";
77
74
  export { default as StatusBadge } from "./components/StatusBadge/StatusBadge";
78
75
  export type { StatusBadgeTypes } from "./components/StatusBadge/StatusBadge";
79
76
  export { default as StructuredContent } from "./components/StructuredContent/StructuredContent";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/design-system-react-components",
3
- "version": "3.2.0-rc",
3
+ "version": "3.2.0-rc2",
4
4
  "description": "NYPL Reservoir Design System React Components",
5
5
  "repository": {
6
6
  "type": "git",