Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralsh committed Dec 27, 2024
1 parent cdd03b9 commit 502ecc0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"printWidth": 120
"printWidth": 120,
"trailingComma": "es5"
}
2 changes: 1 addition & 1 deletion src/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const NotificationTypes = {
warning: "warning",
} as const;

export type NotificationType = typeof NotificationTypes[keyof typeof NotificationTypes];
export type NotificationType = (typeof NotificationTypes)[keyof typeof NotificationTypes];

export type AlertProps = FlexProps & {
isCloseable?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface CustomProps<IsMulti extends boolean, Group extends GroupBase<NDSOption

export type NDSSelectProps<
IsMulti extends boolean = boolean,
Group extends GroupBase<NDSOption> = GroupBase<NDSOption>
Group extends GroupBase<NDSOption> = GroupBase<NDSOption>,
> = Omit<
Props<NDSOption, IsMulti, Group>,
keyof CustomProps<IsMulti, Group> | "isSearchable" | "isDisabled" | "defaultMenuIsOpen" | "isMulti" | "styles"
Expand Down
14 changes: 7 additions & 7 deletions src/Select/SelectComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NDSOption } from "./Select";
export function SelectControl<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: ControlProps<Option, IsMulti, Group>) {
const { isFocused } = props;
return (
Expand All @@ -30,7 +30,7 @@ export function SelectControl<
export function SelectMultiValue<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: MultiValueProps<Option, IsMulti, Group>) {
return (
<div data-testid="select-multivalue">
Expand All @@ -42,7 +42,7 @@ export function SelectMultiValue<
export function SelectClearIndicator<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: ClearIndicatorProps<Option, IsMulti, Group>) {
return (
<div data-testid="select-clear">
Expand All @@ -54,7 +54,7 @@ export function SelectClearIndicator<
export function SelectDropdownIndicator<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: DropdownIndicatorProps<Option, IsMulti, Group>) {
return (
<div data-testid="select-arrow">
Expand All @@ -66,7 +66,7 @@ export function SelectDropdownIndicator<
export function SelectMenu<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: MenuProps<Option, IsMulti, Group>) {
return (
<div data-testid="select-dropdown">
Expand All @@ -78,7 +78,7 @@ export function SelectMenu<
export function SelectContainer<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: ContainerProps<Option, IsMulti, Group>) {
return (
<div data-testid="select-container">
Expand All @@ -90,7 +90,7 @@ export function SelectContainer<
export function SelectInput<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: InputProps<Option, IsMulti, Group>) {
return (
<div data-testid="select-input">
Expand Down
4 changes: 2 additions & 2 deletions src/Select/SelectOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ export const StyledOption = styled.div<StyledOptionProps>(
export type SelectOptionProps<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
> = OptionProps<Option, IsMulti, Group> & {
variant?: ComponentVariant;
};

export function SelectOption<
Option = NDSOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: SelectOptionProps<Option, IsMulti, Group>) {
const variant = useComponentVariant(props.variant);

Expand Down
2 changes: 1 addition & 1 deletion src/StatusIndicator/StatusIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const StatusIndicatorValues = {
quiet: "quiet",
} as const;

export type StatusIndicatorType = typeof StatusIndicatorValues[keyof typeof StatusIndicatorValues];
export type StatusIndicatorType = (typeof StatusIndicatorValues)[keyof typeof StatusIndicatorValues];

const statusIndicatorStyles = (theme: DefaultNDSThemeType) => ({
[StatusIndicatorValues.neutral]: {
Expand Down
13 changes: 6 additions & 7 deletions src/utils/story/dashed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { ComponentType } from "react";
* to highlight its boundaries. To be used in Storybook exclusively.
* Do not export for production.
*/
export const dashed = <P extends Record<string, unknown>>(component: ComponentType<P>) =>
styled(component)`
border-radius: ${(props) => props.theme.radii.large};
border-width: ${(props) => props.theme.space.x0_25};
border-style: dashed;
border-color: ${({ theme }) => theme.colors.lightBlue};
`;
export const dashed = <P extends Record<string, unknown>>(component: ComponentType<P>) => styled(component)`
border-radius: ${(props) => props.theme.radii.large};
border-width: ${(props) => props.theme.space.x0_25};
border-style: dashed;
border-color: ${({ theme }) => theme.colors.lightBlue};
`;
11 changes: 5 additions & 6 deletions src/utils/withWindowDimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ class WindowDimensions extends React.Component {
}
}

const withWindowDimensions = (Component) => (props) =>
(
<WindowDimensions>
{(windowDimensions) => <Component windowDimensions={windowDimensions} {...props} />}
</WindowDimensions>
);
const withWindowDimensions = (Component) => (props) => (
<WindowDimensions>
{(windowDimensions) => <Component windowDimensions={windowDimensions} {...props} />}
</WindowDimensions>
);

export default withWindowDimensions;

0 comments on commit 502ecc0

Please sign in to comment.