This commit is contained in:
DCCONSTRUCTIONS
2026-04-18 18:39:25 +03:00
commit 3ba092b60c
4944 changed files with 497564 additions and 0 deletions
@@ -0,0 +1,142 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import type { Meta, StoryObj } from "@storybook/react-vite";
import { CircularBarSpinner } from "./circular-bar-spinner";
const meta = {
title: "Components/CircularBarSpinner",
component: CircularBarSpinner,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
args: {
height: "16px",
width: "16px",
},
} satisfies Meta<typeof CircularBarSpinner>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {};
export const Small: Story = {
args: {
height: "12px",
width: "12px",
},
};
export const Medium: Story = {
args: {
height: "24px",
width: "24px",
},
};
export const Large: Story = {
args: {
height: "32px",
width: "32px",
},
};
export const ExtraLarge: Story = {
args: {
height: "48px",
width: "48px",
},
};
export const CustomColor: Story = {
args: {
className: "text-success-primary",
},
};
export const AllSizes: Story = {
render() {
return (
<div className="flex items-center gap-6">
<div className="text-center">
<CircularBarSpinner height="12px" width="12px" />
<p className="text-gray-600 mt-2 text-11">Small</p>
</div>
<div className="text-center">
<CircularBarSpinner height="16px" width="16px" />
<p className="text-gray-600 mt-2 text-11">Default</p>
</div>
<div className="text-center">
<CircularBarSpinner height="24px" width="24px" />
<p className="text-gray-600 mt-2 text-11">Medium</p>
</div>
<div className="text-center">
<CircularBarSpinner height="32px" width="32px" />
<p className="text-gray-600 mt-2 text-11">Large</p>
</div>
<div className="text-center">
<CircularBarSpinner height="48px" width="48px" />
<p className="text-gray-600 mt-2 text-11">XL</p>
</div>
</div>
);
},
};
export const ColorVariations: Story = {
render() {
return (
<div className="flex items-center gap-6">
<div className="text-center">
<CircularBarSpinner className="text-blue-500" height="24px" width="24px" />
<p className="text-gray-600 mt-2 text-11">Blue</p>
</div>
<div className="text-center">
<CircularBarSpinner className="text-success-primary" height="24px" width="24px" />
<p className="text-gray-600 mt-2 text-11">Green</p>
</div>
<div className="text-center">
<CircularBarSpinner className="text-danger-primary" height="24px" width="24px" />
<p className="text-gray-600 mt-2 text-11">Red</p>
</div>
<div className="text-center">
<CircularBarSpinner className="text-purple-500" height="24px" width="24px" />
<p className="text-gray-600 mt-2 text-11">Purple</p>
</div>
<div className="text-center">
<CircularBarSpinner className="text-orange-500" height="24px" width="24px" />
<p className="text-gray-600 mt-2 text-11">Orange</p>
</div>
</div>
);
},
};
export const InButton: Story = {
render() {
return (
<button className="bg-green-500 flex items-center gap-2 rounded-sm px-4 py-2 text-on-color">
<CircularBarSpinner height="16px" width="16px" />
<span>Processing...</span>
</button>
);
},
};
export const CenteredInCard: Story = {
render() {
return (
<div className="border-gray-200 shadow-md w-96 rounded-lg border bg-white p-8">
<div className="flex flex-col items-center justify-center space-y-4">
<CircularBarSpinner height="48px" width="48px" />
<p className="text-gray-600 text-13">Processing data...</p>
</div>
</div>
);
},
};
@@ -0,0 +1,39 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import * as React from "react";
export interface ICircularBarSpinner extends React.SVGAttributes<SVGElement> {
height?: string;
width?: string;
className?: string | undefined;
}
export function CircularBarSpinner({ height = "16px", width = "16px", className = "" }: ICircularBarSpinner) {
return (
<div role="status">
<svg xmlns="http://www.w3.org/2000/svg" width={width} height={height} viewBox="0 0 24 24" className={className}>
<g>
<rect width={2} height={5} x={11} y={1} fill="currentColor" opacity={0.14} />
<rect width={2} height={5} x={11} y={1} fill="currentColor" opacity={0.29} transform="rotate(30 12 12)" />
<rect width={2} height={5} x={11} y={1} fill="currentColor" opacity={0.43} transform="rotate(60 12 12)" />
<rect width={2} height={5} x={11} y={1} fill="currentColor" opacity={0.57} transform="rotate(90 12 12)" />
<rect width={2} height={5} x={11} y={1} fill="currentColor" opacity={0.71} transform="rotate(120 12 12)" />
<rect width={2} height={5} x={11} y={1} fill="currentColor" opacity={0.86} transform="rotate(150 12 12)" />
<rect width={2} height={5} x={11} y={1} fill="currentColor" transform="rotate(180 12 12)" />
<animateTransform
attributeName="transform"
calcMode="discrete"
dur="0.75s"
repeatCount="indefinite"
type="rotate"
values="0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12"
/>
</g>
</svg>
</div>
);
}
@@ -0,0 +1,142 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Spinner } from "./circular-spinner";
const meta = {
title: "Components/Spinner",
component: Spinner,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
args: {
height: "32px",
width: "32px",
},
} satisfies Meta<typeof Spinner>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {};
export const Small: Story = {
args: {
height: "16px",
width: "16px",
},
};
export const Medium: Story = {
args: {
height: "24px",
width: "24px",
},
};
export const Large: Story = {
args: {
height: "48px",
width: "48px",
},
};
export const ExtraLarge: Story = {
args: {
height: "64px",
width: "64px",
},
};
export const CustomColor: Story = {
args: {
className: "text-blue-500",
},
};
export const AllSizes: Story = {
render() {
return (
<div className="flex items-center gap-6">
<div className="text-center">
<Spinner height="16px" width="16px" />
<p className="text-gray-600 mt-2 text-11">Small</p>
</div>
<div className="text-center">
<Spinner height="24px" width="24px" />
<p className="text-gray-600 mt-2 text-11">Medium</p>
</div>
<div className="text-center">
<Spinner height="32px" width="32px" />
<p className="text-gray-600 mt-2 text-11">Default</p>
</div>
<div className="text-center">
<Spinner height="48px" width="48px" />
<p className="text-gray-600 mt-2 text-11">Large</p>
</div>
<div className="text-center">
<Spinner height="64px" width="64px" />
<p className="text-gray-600 mt-2 text-11">XL</p>
</div>
</div>
);
},
};
export const ColorVariations: Story = {
render() {
return (
<div className="flex items-center gap-6">
<div className="text-center">
<Spinner className="text-blue-500" />
<p className="text-gray-600 mt-2 text-11">Blue</p>
</div>
<div className="text-center">
<Spinner className="text-success-primary" />
<p className="text-gray-600 mt-2 text-11">Green</p>
</div>
<div className="text-center">
<Spinner className="text-danger-primary" />
<p className="text-gray-600 mt-2 text-11">Red</p>
</div>
<div className="text-center">
<Spinner className="text-purple-500" />
<p className="text-gray-600 mt-2 text-11">Purple</p>
</div>
<div className="text-center">
<Spinner className="text-orange-500" />
<p className="text-gray-600 mt-2 text-11">Orange</p>
</div>
</div>
);
},
};
export const InButton: Story = {
render() {
return (
<button className="bg-blue-500 flex items-center gap-2 rounded-sm px-4 py-2 text-on-color">
<Spinner height="16px" width="16px" />
<span>Loading...</span>
</button>
);
},
};
export const CenteredInCard: Story = {
render() {
return (
<div className="border-gray-200 shadow-md w-96 rounded-lg border bg-white p-8">
<div className="flex flex-col items-center justify-center space-y-4">
<Spinner height="48px" width="48px" />
<p className="text-gray-600 text-13">Loading content...</p>
</div>
</div>
);
},
};
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import * as React from "react";
// helpers
import clsx from "clsx";
export interface ISpinner extends React.SVGAttributes<SVGElement> {
height?: string;
width?: string;
className?: string | undefined;
}
export function Spinner({ height = "32px", width = "32px", className = "" }: ISpinner) {
return (
<div role="status">
<svg
aria-hidden="true"
height={height}
width={width}
className={clsx("animate-spin text-secondary", className)}
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
/>
<path
className="fill-accent-primary"
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
/>
</svg>
<span className="sr-only">Loading...</span>
</div>
);
}
@@ -0,0 +1,8 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export * from "./circular-spinner";
export * from "./circular-bar-spinner";