@nypl/design-system-react-components 3.2.0 → 3.3.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.
- package/dist/design-system-react-components.cjs +50 -50
- package/dist/design-system-react-components.js +6611 -6458
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/dist/src/components/FilterBarInline/FilterBarInline.d.ts +2 -1
- package/dist/src/components/FilterBarPopup/FilterBarPopup.d.ts +38 -0
- package/dist/src/components/Menu/Menu.d.ts +2 -0
- package/dist/src/index.d.ts +2 -3
- package/dist/src/theme/components/breadcrumb.d.ts +3 -0
- package/dist/src/theme/components/filterBarPopup.d.ts +51 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export type BreadcrumbsTypes = typeof breadcrumbTypeArray[number];
|
|
|
5
5
|
export interface BreadcrumbsDataProps {
|
|
6
6
|
url: string;
|
|
7
7
|
text: string | React.ReactNode;
|
|
8
|
+
linkProps?: any;
|
|
8
9
|
}
|
|
9
10
|
export interface BreadcrumbProps {
|
|
10
11
|
/** Breadcrumb links as an array */
|
|
@@ -15,6 +16,8 @@ export interface BreadcrumbProps {
|
|
|
15
16
|
className?: string;
|
|
16
17
|
/** ID that other components can cross reference for accessibility purposes */
|
|
17
18
|
id?: string;
|
|
19
|
+
/** Custom Link component for apps with internal routing, defaults to BreadcrumbLink if not passed */
|
|
20
|
+
customLinkComponent?: any;
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* The `Breadcrumbs` component is a navigation element that provides a
|
|
@@ -19,7 +19,8 @@ export interface FilterBarInlineProps {
|
|
|
19
19
|
/** Function for the global `Apply Filters` button. If passed the `Apply Filters` button will render. */
|
|
20
20
|
onSubmit?: () => void;
|
|
21
21
|
/** Render prop function used to render child components with updated props. */
|
|
22
|
-
renderChildren: ({ isBlockElement, layout, width, }: {
|
|
22
|
+
renderChildren: ({ closeOnBlur, isBlockElement, layout, width, }: {
|
|
23
|
+
closeOnBlur?: boolean;
|
|
23
24
|
isBlockElement?: boolean;
|
|
24
25
|
layout?: LayoutTypes;
|
|
25
26
|
width?: MultiSelectWidths;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { LayoutTypes } from "../../helpers/types";
|
|
4
|
+
import { MultiSelectWidths } from "../MultiSelect/MultiSelect";
|
|
5
|
+
import { FilterBarItemsType } from "../FilterBarInline/FilterBarInline";
|
|
6
|
+
export interface FilterBarPopupProps {
|
|
7
|
+
/** The className of the FilterBarInline. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Optional string value used to set the text for a `Heading` component, or
|
|
10
|
+
* a DS Heading component that can be passed in.
|
|
11
|
+
*/
|
|
12
|
+
heading?: string | JSX.Element;
|
|
13
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
14
|
+
id?: string;
|
|
15
|
+
/** Only used for internal purposes. */
|
|
16
|
+
isOpen?: boolean;
|
|
17
|
+
/** Function for the global `Clear Filters` button. If passed the `Clear Filters` button will render. */
|
|
18
|
+
onClear?: () => void;
|
|
19
|
+
/** Only used for internal purposes. */
|
|
20
|
+
onClose?: any;
|
|
21
|
+
/** Only used for internal purposes. */
|
|
22
|
+
onOpen?: any;
|
|
23
|
+
/** Function for the global `Apply Filters` button. If passed the `Apply Filters` button will render. */
|
|
24
|
+
onSubmit?: () => void;
|
|
25
|
+
/** Render prop function used to render child components with updated props. */
|
|
26
|
+
renderChildren: ({ isBlockElement, layout, width, }: {
|
|
27
|
+
isBlockElement?: boolean;
|
|
28
|
+
layout?: LayoutTypes;
|
|
29
|
+
width?: MultiSelectWidths;
|
|
30
|
+
}) => React.ReactNode;
|
|
31
|
+
/** The selected items state (items that were checked by user). */
|
|
32
|
+
selectedItems?: FilterBarItemsType;
|
|
33
|
+
/** A number that represents the total number of results in the associated search results list. */
|
|
34
|
+
totalResults?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare const FilterBarPopup: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<FilterBarPopupProps> & React.RefAttributes<HTMLDivElement>>, FilterBarPopupProps>;
|
|
37
|
+
export declare function useFilterBarPopup(): any;
|
|
38
|
+
export default FilterBarPopup;
|
|
@@ -10,6 +10,8 @@ export interface MenuProps {
|
|
|
10
10
|
/** Optional string used to identify and highlight an item when the menu opens. The value should
|
|
11
11
|
* match the id associated with one of the items. */
|
|
12
12
|
selectedItem?: string;
|
|
13
|
+
/** Optional boolean value, toggles whether the label of the menu will display the text of the selected item. labelText is required for the aria-label either way. */
|
|
14
|
+
showSelectionAsLabel?: boolean;
|
|
13
15
|
/** Used to set the highlight color for the current item. The values correspond with the NYPL section colors */
|
|
14
16
|
highlightColor?: SectionTypes;
|
|
15
17
|
/** Required string used to set the label text for the button element. If showLabel is false,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export { default as Fieldset } from "./components/Fieldset/Fieldset";
|
|
|
31
31
|
export type { FieldsetProps } from "./components/Fieldset/Fieldset";
|
|
32
32
|
export { default as FilterBarInline } from "./components/FilterBarInline/FilterBarInline";
|
|
33
33
|
export type { FilterBarItemsType, FilterBarInlineProps, } from "./components/FilterBarInline/FilterBarInline";
|
|
34
|
+
export { default as FilterBarPopup, useFilterBarPopup, } from "./components/FilterBarPopup/FilterBarPopup";
|
|
35
|
+
export type { FilterBarPopupProps } from "./components/FilterBarPopup/FilterBarPopup";
|
|
34
36
|
export { default as Form, FormField, FormRow } from "./components/Form/Form";
|
|
35
37
|
export type { FormProps } from "./components/Form/Form";
|
|
36
38
|
export { default as Heading } from "./components/Heading/Heading";
|
|
@@ -115,9 +117,6 @@ export { default as Tooltip } from "./components/Tooltip/Tooltip";
|
|
|
115
117
|
export type { TooltipProps } from "./components/Tooltip/Tooltip";
|
|
116
118
|
export { default as useCarouselStyles } from "./hooks/useCarouselStyles";
|
|
117
119
|
export { default as useCloseDropDown } from "./hooks/useCloseDropDown";
|
|
118
|
-
/** The useFilterBar hooks will not be exported until the refactor of the v2
|
|
119
|
-
* versions of the FilterBar component has been completed.
|
|
120
|
-
* */
|
|
121
120
|
export { default as useMultiSelect } from "./hooks/useMultiSelect";
|
|
122
121
|
export { default as useNYPLBreakpoints } from "./hooks/useNYPLBreakpoints";
|
|
123
122
|
export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
declare const FilterBarPopup: {
|
|
2
|
+
baseStyle?: {
|
|
3
|
+
width: string;
|
|
4
|
+
modalBody: {
|
|
5
|
+
_dark: {
|
|
6
|
+
background: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
modalHeader: {
|
|
10
|
+
bg: string;
|
|
11
|
+
borderBottom: string;
|
|
12
|
+
borderColor: string;
|
|
13
|
+
_dark: {
|
|
14
|
+
background: string;
|
|
15
|
+
borderBottom: string;
|
|
16
|
+
borderColor: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
modalFooter: {
|
|
20
|
+
bg: string;
|
|
21
|
+
borderTop: string;
|
|
22
|
+
borderColor: string;
|
|
23
|
+
_dark: {
|
|
24
|
+
background: string;
|
|
25
|
+
borderTop: string;
|
|
26
|
+
borderColor: string;
|
|
27
|
+
color: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
modalCloseButton: {
|
|
31
|
+
mt: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
sizes?: {
|
|
35
|
+
[key: string]: import("@chakra-ui/styled-system").PartsStyleInterpolation<{
|
|
36
|
+
keys: ("modalBody" | "modalHeader" | "modalFooter" | "modalCloseButton")[];
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
variants?: {
|
|
40
|
+
[key: string]: import("@chakra-ui/styled-system").PartsStyleInterpolation<{
|
|
41
|
+
keys: ("modalBody" | "modalHeader" | "modalFooter" | "modalCloseButton")[];
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
44
|
+
defaultProps?: {
|
|
45
|
+
size?: string | number;
|
|
46
|
+
variant?: string | number;
|
|
47
|
+
colorScheme?: string;
|
|
48
|
+
};
|
|
49
|
+
parts: ("modalBody" | "modalHeader" | "modalFooter" | "modalCloseButton")[];
|
|
50
|
+
};
|
|
51
|
+
export default FilterBarPopup;
|