Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .storybook/preview.ts

This file was deleted.

54 changes: 54 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { useEffect } from "react";
import clsx from "clsx";

import type { Preview } from "@storybook/react";

import "../src/styles/global.css";

export type IPreviewArgs = {
themeUI: "light" | "dark";
backgroundUI: "white" | "light";
};

const preview: Preview = {
decorators: [
(Story, { args }) => {
const { themeUI, backgroundUI } = args;
useEffect(() => {
if (themeUI === "dark") document.documentElement.classList.add("dark");
else document.documentElement.classList.remove("dark");
}, [themeUI]);
return (
<div
className={clsx(
"p-4",
backgroundUI === "white"
? "bg-klerosUIComponentsWhiteBackground"
: "bg-klerosUIComponentsLightBackground",
)}
>
<Story />
</div>
);
},
],
args: {
themeUI: "light",
backgroundUI: "white",
},
argTypes: {
themeUI: {
options: ["light", "dark"],
control: { type: "radio" },
},
backgroundUI: {
options: ["white", "light"],
control: { type: "radio" },
},
},
parameters: {
layout: "centered",
},
};

export default preview;
5 changes: 5 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export default [
react: {
version: "^16.12.0",
},
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},

rules: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"simplebar": "^5.3.6",
"simplebar-react": "^2.3.6",
"smooth-scroll-into-view-if-needed": "^1.1.33",
"tailwind-merge": "^3.0.2",
"usehooks-ts": "^2.9.1"
},
"lint-staged": {
Expand Down
14 changes: 5 additions & 9 deletions src/lib/accordion/accordion-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useElementSize } from "../../hooks/useElementSize";
import Plus from "../../assets/svgs/accordion/plus.svg";
import Minus from "../../assets/svgs/accordion/minus.svg";

import clsx from "clsx";
import { Button } from "react-aria-components";
import { cn } from "../../utils";

interface AccordionItemProps {
setExpanded: React.Dispatch<React.SetStateAction<number>>;
Expand All @@ -25,7 +25,7 @@ const AccordionItem: React.FC<AccordionItemProps> = ({
return (
<div className="my-2">
<Button
className={clsx(
className={cn(
"bg-klerosUIComponentsWhiteBackground border-klerosUIComponentsStroke border",
"hover-medium-blue hover-short-transition hover:cursor-pointer",
"rounded-[3px] px-8 py-[11.5px]",
Expand All @@ -35,18 +35,14 @@ const AccordionItem: React.FC<AccordionItemProps> = ({
>
{title}
{expanded ? (
<Minus
className={clsx("fill-klerosUIComponentsPrimaryText h-4 w-4")}
/>
<Minus className={cn("fill-klerosUIComponentsPrimaryText h-4 w-4")} />
) : (
<Plus
className={clsx("fill-klerosUIComponentsPrimaryText h-4 w-4")}
/>
<Plus className={cn("fill-klerosUIComponentsPrimaryText h-4 w-4")} />
)}
</Button>
<div
style={{ height: expanded ? `${height.toString()}px` : 0 }}
className={clsx(
className={cn(
expanded ? `overflow-visible` : "overflow-hidden",
"transition-[height] duration-(--klerosUIComponentsTransitionSpeed) ease-initial",
)}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/accordion/custom.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode, useState } from "react";
import AccordionItem from "./accordion-item";
import clsx from "clsx";
import { cn } from "../../utils";

interface AccordionItem {
title: ReactNode;
Expand All @@ -20,7 +20,7 @@ const CustomAccordion: React.FC<AccordionProps> = ({
const [expanded, setExpanded] = useState(-1);
return (
<div
className={clsx("box-border flex w-[1000px] flex-col", className)}
className={cn("box-border flex w-[1000px] flex-col", className)}
{...props}
>
{items.map((item, index) => (
Expand Down
4 changes: 2 additions & 2 deletions src/lib/accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode, useState } from "react";
import AccordionItem from "./accordion-item";
import clsx from "clsx";
import { cn } from "../../utils";

interface AccordionItem {
title: string;
Expand Down Expand Up @@ -31,7 +31,7 @@ const Accordion: React.FC<AccordionProps> = ({
const [expanded, setExpanded] = useState(defaultExpanded ?? -1);
return (
<div
className={clsx("box-border flex w-[1000px] flex-col", className)}
className={cn("box-border flex w-[1000px] flex-col", className)}
{...props}
>
{items.map((item, index) => (
Expand Down
53 changes: 0 additions & 53 deletions src/stories/Button.stories.ts

This file was deleted.

41 changes: 0 additions & 41 deletions src/stories/Button.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions src/stories/Header.stories.ts

This file was deleted.

71 changes: 0 additions & 71 deletions src/stories/Header.tsx

This file was deleted.

32 changes: 0 additions & 32 deletions src/stories/Page.stories.ts

This file was deleted.

Loading