Skip to content

Commit

Permalink
prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfishdesign13 committed Aug 29, 2024
1 parent 2c3ddec commit 58ab51f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const bannerTypesArray = [
"recommendation",
"warning",
] as const;
export type BannerTypes = typeof bannerTypesArray[number];
export type BannerTypes = (typeof bannerTypesArray)[number];
export const bannerBgColorsArray = [
"brand.primary-05",
"section.blogs.primary-05",
Expand All @@ -43,7 +43,7 @@ export const bannerBgColorsArray = [
"dark.section.research-library.schwarzman-05",
"dark.section.whats-on.primary-05",
] as const;
export type BannerBgColors = typeof bannerBgColorsArray[number];
export type BannerBgColors = (typeof bannerBgColorsArray)[number];
export const bannerHighlightColorsArray = [
"brand.primary",
"section.blogs.primary",
Expand All @@ -68,7 +68,7 @@ export const bannerHighlightColorsArray = [
"dark.section.research-library-schwarzman.primary",
"dark.section.whats-on.primary",
] as const;
export type BannerHighlightColors = typeof bannerHighlightColorsArray[number];
export type BannerHighlightColors = (typeof bannerHighlightColorsArray)[number];

export interface BannerProps {
/** Label used to describe the `Banner`'s aside HTML element. */
Expand Down
2 changes: 1 addition & 1 deletion src/components/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const breadcrumbTypeArray = [
"research",
"whatsOn",
] as const;
export type BreadcrumbsTypes = typeof breadcrumbTypeArray[number];
export type BreadcrumbsTypes = (typeof breadcrumbTypeArray)[number];
export interface BreadcrumbsDataProps {
url: string;
text: string | React.ReactNode;
Expand Down
5 changes: 3 additions & 2 deletions src/components/FeaturedContent/FeaturedContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ export const featuredContentWidthArray = [
"twoThirds",
"threeQuarters",
];
export type FeaturedContentWidthType = typeof featuredContentWidthArray[number];
export type FeaturedContentWidthType =
(typeof featuredContentWidthArray)[number];

export const featuredContentPositionArray = ["start", "end"] as const;
export type FeaturedContentPositionType =
typeof featuredContentPositionArray[number];
(typeof featuredContentPositionArray)[number];

export interface FeaturedContentImageProps extends ImageProps {
/** String value that specifies the width of the image rendered within the component. */
Expand Down
14 changes: 10 additions & 4 deletions src/components/FilterBarInline/FilterBarInline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ import useNYPLBreakpoints from "../../hooks/useNYPLBreakpoints";
import ComponentWrapper from "../ComponentWrapper/ComponentWrapper";
import Heading, { HeadingSizes } from "../Heading/Heading";

export type FilterBarItemsType =
| (boolean | number | number[] | string | string[] | MultiSelectItems)[];
export type FilterBarItemsType = (
| boolean
| number
| number[]
| string
| string[]
| MultiSelectItems
)[];

export interface FilterBarInlineProps {
/** The className of the FilterBarInline. */
Expand Down Expand Up @@ -72,8 +78,8 @@ export const FilterBarInline: ChakraComponent<
const finalWidth = !isLargerThanMobile
? "full"
: layout === "row"
? "fitContent"
: "full";
? "fitContent"
: "full";

const generalHeadingProps = {
size: "heading5" as HeadingSizes,
Expand Down
6 changes: 3 additions & 3 deletions src/components/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export const imageSizesArray = [
"large",
] as const;
export const imageTypesArray = ["default", "circle"] as const;
export type ImageRatios = typeof imageRatiosArray[number];
export type ImageSizes = typeof imageSizesArray[number];
export type ImageTypes = typeof imageTypesArray[number];
export type ImageRatios = (typeof imageRatiosArray)[number];
export type ImageSizes = (typeof imageSizesArray)[number];
export type ImageTypes = (typeof imageTypesArray)[number];

// Used for components that have an `imageProps` prop.
export interface ComponentImageProps extends Partial<HTMLImageElement> {
Expand Down
8 changes: 4 additions & 4 deletions src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export interface MultiSelectItem {
children?: MultiSelectItem[];
}
export const multiSelectWidthsArray = ["fitContent", "full"] as const;
export type MultiSelectWidths = typeof multiSelectWidthsArray[number];
export type MultiSelectWidths = (typeof multiSelectWidthsArray)[number];
export const multiSelectListOverflowArray = ["scroll", "expand"] as const;
export type MultiSelectListOverflowTypes =
typeof multiSelectListOverflowArray[number];
(typeof multiSelectListOverflowArray)[number];
export interface SelectedItems {
[name: string]: { items: string[] };
}
Expand Down Expand Up @@ -155,8 +155,8 @@ export const MultiSelect: ChakraComponent<
listOverflow === "expand"
? "unset"
: isSearchable
? MAXIMUM_ITEMS_LIST_HEIGHT
: MINIMUM_ITEMS_LIST_HEIGHT;
? MAXIMUM_ITEMS_LIST_HEIGHT
: MINIMUM_ITEMS_LIST_HEIGHT;

const isOverflowExpand =
items.length > defaultItemsVisible && listOverflow === "expand";
Expand Down
8 changes: 4 additions & 4 deletions src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { getAriaAttrs } from "../../utils/utils";

export const selectTypesArray = ["default", "searchbar"];
export const labelPositionsArray = ["default", "inline"];
export type SelectTypes = typeof selectTypesArray[number];
export type LabelPositions = typeof labelPositionsArray[number];
export type SelectTypes = (typeof selectTypesArray)[number];
export type LabelPositions = (typeof labelPositionsArray)[number];

export interface SelectProps {
/** A class name for the `div` parent element. */
Expand Down Expand Up @@ -124,8 +124,8 @@ export const Select: ChakraComponent<
const controlledOrUncontrolledProps = onChange
? { onChange, value }
: defaultValue
? { defaultValue }
: {};
? { defaultValue }
: {};

// The number of pixels between the label and select elements
// when the labelPosition is inline (equivalent to --nypl-space-xs).
Expand Down

0 comments on commit 58ab51f

Please sign in to comment.