Skip to content

Commit

Permalink
fix: CI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralsh committed Nov 25, 2024
1 parent 49f34c2 commit 9ff5fb8
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
return config;
},
addons: [
"@storybook/addon-knobs",
"@storybook/addon-toolbars",
"@storybook/addon-viewport",
{
Expand Down
1 change: 1 addition & 0 deletions src/BottomSheet/BottomSheet.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe("BottomSheet", () => {

renderWithNDSProvider(
<BottomSheet
title="Some title"
isOpen={true}
onClose={onCloseMock}
primaryAction={primaryActionMock}
Expand Down
4 changes: 2 additions & 2 deletions src/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import styled, { useTheme } from "styled-components";
import type { IconName } from "@nulogy/icons";
import { space, SpaceProps, variant } from "styled-system";
import { Icon } from "../Icon";
import { DefaultNDSThemeType } from "../theme";
Expand All @@ -9,12 +10,11 @@ import {
ComponentVariant,
} from "../NDSProvider/ComponentVariantContext";
import { subPx } from "../utils";
import icons from "@nulogy/icons";

export type ButtonProps = SpaceProps &
React.ComponentPropsWithRef<"button"> & {
className?: string;
icon?: keyof typeof icons | "loading";
icon?: IconName | "loading";
iconSide?: "left" | "right";
size?: "small" | "medium";
variant?: ComponentVariant;
Expand Down
4 changes: 2 additions & 2 deletions src/Button/ControlIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import icons from "@nulogy/icons";
import type { IconName } from "@nulogy/icons";
import React from "react";
import styled from "styled-components";
import { layout, LayoutProps, space, SpaceProps } from "styled-system";
Expand All @@ -8,7 +8,7 @@ type ControlIconProps = React.ComponentPropsWithRef<"button"> &
SpaceProps &
LayoutProps & {
onClick?: React.MouseEventHandler<HTMLButtonElement>;
icon: keyof typeof icons | "loading";
icon: IconName | "loading";
toggled?: boolean;
disabled?: boolean;
size?: string;
Expand Down
3 changes: 2 additions & 1 deletion src/Button/IconicButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { space, SpaceProps, variant } from "styled-system";
import { Manager, Reference, Popper } from "react-popper-2";
import { transparentize } from "polished";
import icons from "@nulogy/icons";
import { IconName } from "@nulogy/icons";
import { Icon } from "../Icon";
import { Text } from "../Type";
import { DefaultNDSThemeType } from "../theme";
Expand All @@ -13,7 +14,7 @@ interface BaseProps {
variant?: ComponentVariant;
color?: string;
labelHidden?: boolean;
icon?: keyof typeof icons | "loading";
icon?: IconName | "loading";
iconSize?: string;
hoverBackgroundColor?: string;
fontSize?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/FieldLabel/FramedIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { ReactElement } from "react";
import icons from "@nulogy/icons";
import { IconName } from "@nulogy/icons";
import { Flex } from "../Flex";
import { Tooltip } from "../Tooltip";
import { Icon } from "../Icon";

interface FramedIconProps extends React.ComponentPropsWithoutRef<"svg"> {
iconSize: string;
icon: keyof typeof icons | "loading";
icon: IconName | "loading";
focusable?: boolean;
maxWidth?: string;
tooltip?: string | ReactElement;
Expand Down
4 changes: 2 additions & 2 deletions src/Icon/Icon.story.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { useTheme } from "styled-components";
import icons from "@nulogy/icons";
import type { IconName } from "@nulogy/icons";
import { Box, DefaultNDSThemeType, Flex, Icon, InlineIcon } from "../index";
import { useTheme } from "styled-components";
import { Box, Flex, Icon, InlineIcon } from "../index";

const iconNames = [...Object.keys(icons), "loading"] as IconName[];
const iconSubset = [...iconNames.slice(0, 5), "loading"] as IconName[];
Expand Down
3 changes: 2 additions & 1 deletion src/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React from "react";
import styled, { useTheme } from "styled-components";
import { space, SpaceProps } from "styled-system";
import icons from "@nulogy/icons";
import { IconName } from "@nulogy/icons";
import LoadingIcon from "./LoadingIcon";

interface IconProps extends SpaceProps {
icon: keyof typeof icons | "loading";
icon: IconName | "loading";
className?: string;
size?: string;
title?: string;
Expand Down
9 changes: 5 additions & 4 deletions src/Input/InputField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { forwardRef } from "react";
import styled, { CSSObject, useTheme } from "styled-components";
import { position, PositionProps, space, SpaceProps, variant } from "styled-system";
import { IconName } from "@nulogy/icons";
import { Icon } from "../Icon";
import { Box, BoxProps } from "../Box";
import { Flex } from "../Flex";
Expand All @@ -16,10 +17,10 @@ type NativeInputProps = Omit<React.ComponentPropsWithRef<"input">, "size" | "hei
export interface InputFieldProps extends NativeInputProps {
htmlSize?: number;
variant?: ComponentVariant;
iconRight?: keyof typeof icons | "loading";
iconLeft?: keyof typeof icons | "loading";
iconRightSize?: keyof typeof icons | "loading";
iconLeftSize?: keyof typeof icons | "loading";
iconRight?: IconName | "loading";
iconLeft?: IconName | "loading";
iconRightSize?: string;
iconLeftSize?: string;
error?: boolean;
labelText?: string;
requirementText?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/Select/customReactSelectStyles.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { desktop as theme } from "../theme/theme";
import { desktop as theme } from "../theme";
import { getControlBorderRadius, getMenuBorderRadius, showIndicatorSeparator } from "./customReactSelectStyles";

describe("custom react-select styles", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/theme/mergeThemes.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mergeThemes } from "./mergeThemes.util";
import { desktop as NDSTheme } from "./theme";
import { legacy as NDSTheme } from "./theme";

describe("mergedThemes", () => {
it("returns the default nds theme if custom theme is undefined", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Do not edit directly.
import { DefaultNDSThemeType } from "./theme.type";

type ThemeKey = "legacy" | "desktop" | "tablet" | "phone";
type ThemeKey = "legacy" | "experimental" | "tablet" | "phone";

export const themes: Record<ThemeKey, DefaultNDSThemeType> = {
legacy: {
Expand Down Expand Up @@ -153,7 +153,7 @@ export const themes: Record<ThemeKey, DefaultNDSThemeType> = {
},
borders: [],
},
desktop: {
experimental: {
colors: {
black: "#011e38",
blackBlue: "#122b47",
Expand Down Expand Up @@ -599,4 +599,4 @@ export const themes: Record<ThemeKey, DefaultNDSThemeType> = {
},
};

export const { legacy, desktop, tablet, phone } = themes;
export const { legacy, experimental, tablet, phone } = themes;
2 changes: 1 addition & 1 deletion src/theme/useNDSTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const getThemeByVariant = (
return isTabletSize ? themes.tablet : themes.phone;
}

return featureFlags.experimentalDesktopTypographyScale ? themes.desktop : themes.legacy;
return featureFlags.experimentalDesktopTypographyScale ? themes.experimental : themes.legacy;
};

export function useNDSTheme(variant: ComponentVariant = "desktop", customTheme?: ThemeType): DefaultNDSThemeType {
Expand Down

0 comments on commit 9ff5fb8

Please sign in to comment.