notionsoft-ui 1.0.5 → 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.5",
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
+ }
@@ -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 CircleLoaderProps {
5
5
  className?: string;
@@ -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,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;