notionsoft-ui 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notionsoft-ui",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A React UI component installer (shadcn-style). Installs components directly into your project.",
5
5
  "bin": {
6
6
  "notionsoft-ui": "./cli/index.cjs"
@@ -1,5 +1,5 @@
1
- // import { cn } from "../../utils/cn";
2
- import { cn } from "@/utils/cn";
1
+ import { cn } from "../../utils/cn";
2
+ // import { cn } from "@/utils/cn";
3
3
 
4
4
  export interface BooleanStatusButtonProps {
5
5
  getColor: () => {
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- // import { cn } from "../../utils/cn";
3
- import { cn } from "@/utils/cn";
2
+ import { cn } from "../../utils/cn";
3
+ // import { cn } from "@/utils/cn";
4
4
 
5
5
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
6
  variant?: "primary" | "secondary" | "warning" | "success";
@@ -0,0 +1,58 @@
1
+ import Button from "../button/button";
2
+ import ButtonSpinner from "./button-spinner";
3
+ import type { Meta, StoryObj } from "@storybook/react";
4
+
5
+ const meta: Meta<typeof ButtonSpinner> = {
6
+ title: "Components/ButtonSpinner",
7
+ component: ButtonSpinner,
8
+ parameters: {
9
+ layout: "centered",
10
+ },
11
+ argTypes: {
12
+ loading: { control: "boolean" },
13
+ className: { control: "text" },
14
+ children: { control: "text" },
15
+ },
16
+ };
17
+
18
+ export default meta;
19
+ type Story = StoryObj<typeof ButtonSpinner>;
20
+
21
+ /* -----------------------------
22
+ Template: how ButtonSpinner
23
+ is intended to be used
24
+ ------------------------------ */
25
+ const Template = (args) => (
26
+ <Button disabled={args.loading} className="flex items-center gap-3">
27
+ <ButtonSpinner {...args} />
28
+ </Button>
29
+ );
30
+
31
+ /* -----------------------------
32
+ Stories
33
+ ------------------------------ */
34
+
35
+ export const Default: Story = {
36
+ render: Template,
37
+ args: {
38
+ loading: false,
39
+ children: "Save",
40
+ },
41
+ };
42
+
43
+ export const Loading: Story = {
44
+ render: Template,
45
+ args: {
46
+ loading: true,
47
+ children: "Saving...",
48
+ },
49
+ };
50
+
51
+ export const WithCustomClass: Story = {
52
+ render: Template,
53
+ args: {
54
+ loading: true,
55
+ className: "text-blue-600 font-semibold",
56
+ children: "Processing...",
57
+ },
58
+ };
@@ -0,0 +1,26 @@
1
+ import { cn } from "../../utils/cn";
2
+ // import { cn } from "@/utils/cn";
3
+
4
+ export interface IButtonSpinnerProps {
5
+ children: any;
6
+ loading: boolean;
7
+ className?: string;
8
+ }
9
+
10
+ export default function ButtonSpinner(props: IButtonSpinnerProps) {
11
+ const { loading, children, className } = props;
12
+ return (
13
+ <>
14
+ {loading && (
15
+ <div className="relative w-[16px] h-[16px]">
16
+ {/* <!-- Ring --> */}
17
+ <div
18
+ className="w-[16px] h-[16px] rounded-full animate-spin absolute
19
+ border border-solid border-secondary border-t-transparent"
20
+ />
21
+ </div>
22
+ )}
23
+ <h1 className={cn("", className)}>{children}</h1>
24
+ </>
25
+ );
26
+ }
@@ -0,0 +1,38 @@
1
+ import CircleLoader from "../circle-loader/circle-loader"; // Adjust the import path as needed
2
+ import { CircleLoaderProps } from "./circle-loader";
3
+
4
+ // Meta information for Storybook
5
+ export default {
6
+ title: "Components/CircleLoader", // This will be the folder and component name in Storybook's sidebar
7
+ component: CircleLoader, // The component being showcased
8
+ argTypes: {
9
+ className: { control: "text" },
10
+ labelclassname: { control: "text" },
11
+ label: { control: "text" },
12
+ parentClassName: { control: "text" },
13
+ },
14
+ } as const;
15
+
16
+ // Template to generate different versions of the CircleLoader component
17
+ const Template = (args: CircleLoaderProps) => <CircleLoader {...args} />;
18
+
19
+ // Default story with default props
20
+ export const Default = Template.bind({});
21
+ Default.args = {
22
+ label: "Loading...",
23
+ };
24
+
25
+ // Story with a custom label
26
+ export const WithCustomLabel = Template.bind({});
27
+ WithCustomLabel.args = {
28
+ label: "Please wait while we fetch data...",
29
+ };
30
+
31
+ // Story with custom styles (for demonstration purposes)
32
+ export const WithCustomStyles = Template.bind({});
33
+ WithCustomStyles.args = {
34
+ label: "Fetching resources...",
35
+ className: "text-blue-500", // Custom SVG color
36
+ labelclassname: "text-lg font-bold", // Custom label styling
37
+ parentClassName: "bg-gray-200 p-4", // Custom container styling
38
+ };
@@ -0,0 +1,48 @@
1
+ // import { cn } from "@/utils/cn";
2
+ import { cn } from "../../utils/cn";
3
+
4
+ export interface CircleLoaderProps {
5
+ className?: string;
6
+ labelclassname?: string;
7
+ label?: string;
8
+ parentClassName?: string;
9
+ }
10
+
11
+ export default function CircleLoader(props: CircleLoaderProps) {
12
+ const { label, className, labelclassname, parentClassName, ...restProps } =
13
+ props;
14
+
15
+ return (
16
+ <div
17
+ role="status"
18
+ className={cn(
19
+ "flex flex-col items-center justify-center",
20
+ parentClassName
21
+ )}
22
+ >
23
+ <svg
24
+ {...restProps}
25
+ aria-hidden="true"
26
+ className={cn(
27
+ "w-8 h-8 text-primary/40 animate-spin fill-primary",
28
+ className
29
+ )}
30
+ viewBox="0 0 100 101"
31
+ fill="none"
32
+ xmlns="http://www.w3.org/2000/svg"
33
+ >
34
+ <path
35
+ 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"
36
+ fill="currentColor"
37
+ />
38
+ <path
39
+ 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"
40
+ fill="currentFill"
41
+ />
42
+ </svg>
43
+ <span className={cn("font-semibold text-sm md:text-md", labelclassname)}>
44
+ {label ? label : "loading"}
45
+ </span>
46
+ </div>
47
+ );
48
+ }
@@ -1,5 +1,5 @@
1
- // import { cn } from "../../utils/cn";
2
- import { cn } from "@/utils/cn";
1
+ import { cn } from "../../utils/cn";
2
+ // import { cn } from "@/utils/cn";
3
3
 
4
4
  import { useTransition, animated } from "@react-spring/web";
5
5
  import { X } from "lucide-react";
@@ -1,8 +1,9 @@
1
- import { ShiningText } from "@/templates/shining-text/shining-text";
1
+ import { ShiningText } from "../shining-text/shining-text";
2
+
2
3
  import type { Meta, StoryObj } from "@storybook/react";
3
4
 
4
5
  const meta: Meta<typeof ShiningText> = {
5
- title: "Components/ShiningText",
6
+ title: "Text/ShiningText",
6
7
  component: ShiningText,
7
8
  args: {
8
9
  text: "Loading...",
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useSpring, animated } from "@react-spring/web";
3
- // import { cn } from "../../utils/cn";
4
- import { cn } from "@/utils/cn";
3
+ import { cn } from "../../utils/cn";
4
+ // import { cn } from "@/utils/cn";
5
5
 
6
6
  interface ShiningTextProps extends React.HTMLAttributes<HTMLSpanElement> {
7
7
  text: string;