notionsoft-ui 1.0.1 → 1.0.3

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.
Files changed (46) hide show
  1. package/.storybook/main.ts +19 -0
  2. package/.storybook/preview.css +160 -0
  3. package/.storybook/preview.ts +21 -0
  4. package/.storybook/vitest.setup.ts +7 -0
  5. package/README.md +7 -1
  6. package/cli/index.cjs +1 -1
  7. package/package.json +23 -2
  8. package/src/stories/Button.stories.ts +54 -0
  9. package/src/stories/Button.tsx +37 -0
  10. package/src/stories/Configure.mdx +364 -0
  11. package/src/stories/Header.stories.ts +34 -0
  12. package/src/stories/Header.tsx +56 -0
  13. package/src/stories/Page.stories.ts +33 -0
  14. package/src/stories/Page.tsx +73 -0
  15. package/src/stories/assets/accessibility.png +0 -0
  16. package/src/stories/assets/accessibility.svg +1 -0
  17. package/src/stories/assets/addon-library.png +0 -0
  18. package/src/stories/assets/assets.png +0 -0
  19. package/src/stories/assets/avif-test-image.avif +0 -0
  20. package/src/stories/assets/context.png +0 -0
  21. package/src/stories/assets/discord.svg +1 -0
  22. package/src/stories/assets/docs.png +0 -0
  23. package/src/stories/assets/figma-plugin.png +0 -0
  24. package/src/stories/assets/github.svg +1 -0
  25. package/src/stories/assets/share.png +0 -0
  26. package/src/stories/assets/styling.png +0 -0
  27. package/src/stories/assets/testing.png +0 -0
  28. package/src/stories/assets/theming.png +0 -0
  29. package/src/stories/assets/tutorials.svg +1 -0
  30. package/src/stories/assets/youtube.svg +1 -0
  31. package/src/stories/button.css +30 -0
  32. package/src/stories/header.css +32 -0
  33. package/src/stories/page.css +68 -0
  34. package/src/templates/button/BooleanStatusButton.stories.tsx +90 -0
  35. package/src/templates/button/BooleanStatusButton.tsx +29 -0
  36. package/src/templates/button/Button.stories.tsx +51 -0
  37. package/src/templates/button/button.tsx +31 -20
  38. package/src/templates/sheet/AnimatedSheet.stories.tsx +103 -0
  39. package/src/templates/sheet/AnimatedSheet.tsx +163 -0
  40. package/src/templates/text/ShinyText.stories.tsx +43 -0
  41. package/src/templates/text/ShinyText.tsx +35 -0
  42. package/tsconfig.json +2 -1
  43. package/vite.config.ts +36 -0
  44. package/vitest.shims.d.ts +1 -0
  45. package/src/templates/card/card.tsx +0 -20
  46. package/src/utils/cn.js +0 -15
@@ -0,0 +1,19 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+
3
+ const config: StorybookConfig = {
4
+ "stories": [
5
+ "../src/**/*.mdx",
6
+ "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
7
+ ],
8
+ "addons": [
9
+ "@chromatic-com/storybook",
10
+ "@storybook/addon-docs",
11
+ "@storybook/addon-a11y",
12
+ "@storybook/addon-vitest"
13
+ ],
14
+ "framework": {
15
+ "name": "@storybook/react-vite",
16
+ "options": {}
17
+ }
18
+ };
19
+ export default config;
@@ -0,0 +1,160 @@
1
+ @import "tailwindcss";
2
+
3
+ @custom-variant dark (&:is(.dark *));
4
+
5
+ @theme inline {
6
+ --radius-sm: calc(var(--radius) - 4px);
7
+ --radius-md: calc(var(--radius) - 2px);
8
+ --radius-lg: var(--radius);
9
+ --radius-xl: calc(var(--radius) + 4px);
10
+ --color-background: var(--background);
11
+ --color-foreground: var(--foreground);
12
+ --color-card: var(--card);
13
+ --color-card-foreground: var(--card-foreground);
14
+ --color-popover: var(--popover);
15
+ --color-popover-foreground: var(--popover-foreground);
16
+ --color-primary: var(--primary);
17
+ --color-primary-foreground: var(--primary-foreground);
18
+ --color-secondary: var(--secondary);
19
+ --color-secondary-foreground: var(--secondary-foreground);
20
+ --color-muted: var(--muted);
21
+ --color-muted-foreground: var(--muted-foreground);
22
+ --color-accent: var(--accent);
23
+ --color-accent-foreground: var(--accent-foreground);
24
+ --color-destructive: var(--destructive);
25
+ --color-border: var(--border);
26
+ --color-input: var(--input);
27
+ --color-ring: var(--ring);
28
+ --color-chart-1: var(--chart-1);
29
+ --color-chart-2: var(--chart-2);
30
+ --color-chart-3: var(--chart-3);
31
+ --color-chart-4: var(--chart-4);
32
+ --color-chart-5: var(--chart-5);
33
+ --color-sidebar: var(--sidebar);
34
+ --color-sidebar-foreground: var(--sidebar-foreground);
35
+ --color-sidebar-primary: var(--sidebar-primary);
36
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
37
+ --color-sidebar-accent: var(--sidebar-accent);
38
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
39
+ --color-sidebar-border: var(--sidebar-border);
40
+ --color-sidebar-ring: var(--sidebar-ring);
41
+ --color-from-shimmer: var(--from-shimmer);
42
+ --color-to-shimmer: var(--to-shimmer);
43
+ --color-tertiary: var(--tertiary);
44
+ --color-fourth: var(--fourth);
45
+ --color-gradient-dark-from: var(--gradient-dark-from);
46
+ --color-gradient-dark-to: var(--gradient-dark-to);
47
+ --color-primary-background: var(--primary-background);
48
+ --primary-background: oklch(20.435% 0.06485 262.22);
49
+
50
+ --text-sm-ltr: 11px;
51
+ --text-md-ltr: 12px;
52
+ --text-lg-ltr: 13px;
53
+ --text-xl-ltr: 14px;
54
+ --text-2xl-ltr: 15px;
55
+ --text-3xl-ltr: 17px;
56
+ --text-4xl-ltr: 20px;
57
+
58
+ --text-sm-rtl: 15px;
59
+ --text-md-rtl: 16px;
60
+ --text-lg-rtl: 17px;
61
+ --text-xl-rtl: 18px;
62
+ --text-2xl-rtl: 19px;
63
+ --text-3xl-rtl: 20px;
64
+ --text-4xl-rtl: 22px;
65
+
66
+ --breakpoint-xxl: 500px;
67
+ --animate-shimmer: shimmer 2.2s infinite linear;
68
+ @keyframes shimmer {
69
+ 0% {
70
+ background-position: -1200px 0;
71
+ }
72
+ 100% {
73
+ background-position: 1200px 0;
74
+ }
75
+ }
76
+ }
77
+
78
+ :root {
79
+ --from-shimmer: transparent;
80
+ --to-shimmer: oklch(1 0 0 / 68.6%); /* white with alpha */
81
+ --tertiary: oklch(0.398 0.07 227.392); /* #03daab */
82
+ --fourth: oklch(70.5% 0.213 47.604);
83
+ --gradient-dark-from: rgb(11, 11, 11);
84
+ --gradient-dark-to: rgb(45 45 45);
85
+ --radius: 0.625rem;
86
+ --background: oklch(1 0 0);
87
+ --foreground: oklch(0.145 0 0);
88
+ --card: oklch(1 0 0);
89
+ --card-foreground: oklch(0.145 0 0);
90
+ --popover: oklch(1 0 0);
91
+ --popover-foreground: oklch(0.145 0 0);
92
+ --primary: oklch(0.205 0 0);
93
+ --primary-foreground: oklch(0.985 0 0);
94
+ --secondary: oklch(0.97 0 0);
95
+ --secondary-foreground: oklch(0.205 0 0);
96
+ --muted: oklch(0.97 0 0);
97
+ --muted-foreground: oklch(0.556 0 0);
98
+ --accent: oklch(0.97 0 0);
99
+ --accent-foreground: oklch(0.205 0 0);
100
+ --destructive: oklch(0.577 0.245 27.325);
101
+ --border: oklch(0.922 0 0);
102
+ --input: oklch(0.922 0 0);
103
+ --ring: oklch(0.708 0 0);
104
+ --chart-1: oklch(0.646 0.222 41.116);
105
+ --chart-2: oklch(0.6 0.118 184.704);
106
+ --chart-3: oklch(0.398 0.07 227.392);
107
+ --chart-4: oklch(0.828 0.189 84.429);
108
+ --chart-5: oklch(0.769 0.188 70.08);
109
+ --sidebar: oklch(0.985 0 0);
110
+ --sidebar-foreground: oklch(0.145 0 0);
111
+ --sidebar-primary: oklch(0.205 0 0);
112
+ --sidebar-primary-foreground: oklch(0.985 0 0);
113
+ --sidebar-accent: oklch(0.97 0 0);
114
+ --sidebar-accent-foreground: oklch(0.205 0 0);
115
+ --sidebar-border: oklch(0.922 0 0);
116
+ --sidebar-ring: oklch(0.708 0 0);
117
+ --scrollbar-color: oklch(77% 0 0deg);
118
+ }
119
+
120
+ .dark {
121
+ --from-shimmer: transparent;
122
+ --to-shimmer: oklch(0.593 0.015 26.89 / 45.9%);
123
+ --tertiary: oklch(0.5265 0.0882 197.88);
124
+ --fourth: oklch(0.5265 0.0882 197.88);
125
+
126
+ --gradient-dark-from: rgb(11, 11, 11);
127
+ --gradient-dark-to: rgb(45 45 45);
128
+ --background: oklch(0.145 0 0);
129
+ --foreground: oklch(0.985 0 0);
130
+ --card: oklch(0.205 0 0);
131
+ --card-foreground: oklch(0.985 0 0);
132
+ --popover: oklch(0.205 0 0);
133
+ --popover-foreground: oklch(0.985 0 0);
134
+ --primary: oklch(0.922 0 0);
135
+ --primary-foreground: oklch(0.205 0 0);
136
+ --secondary: oklch(0.269 0 0);
137
+ --secondary-foreground: oklch(0.985 0 0);
138
+ --muted: oklch(0.269 0 0);
139
+ --muted-foreground: oklch(0.708 0 0);
140
+ --accent: oklch(0.269 0 0);
141
+ --accent-foreground: oklch(0.985 0 0);
142
+ --destructive: oklch(0.704 0.191 22.216);
143
+ --border: oklch(1 0 0 / 10%);
144
+ --input: oklch(1 0 0 / 15%);
145
+ --ring: oklch(0.556 0 0);
146
+ --chart-1: oklch(0.488 0.243 264.376);
147
+ --chart-2: oklch(0.696 0.17 162.48);
148
+ --chart-3: oklch(0.769 0.188 70.08);
149
+ --chart-4: oklch(0.627 0.265 303.9);
150
+ --chart-5: oklch(0.645 0.246 16.439);
151
+ --sidebar: oklch(0.205 0 0);
152
+ --sidebar-foreground: oklch(0.985 0 0);
153
+ --sidebar-primary: oklch(0.488 0.243 264.376);
154
+ --sidebar-primary-foreground: oklch(0.985 0 0);
155
+ --sidebar-accent: oklch(0.269 0 0);
156
+ --sidebar-accent-foreground: oklch(0.985 0 0);
157
+ --sidebar-border: oklch(1 0 0 / 10%);
158
+ --sidebar-ring: oklch(0.556 0 0);
159
+ --scrollbar-color: oklch(45.958% 0.00387 16.556);
160
+ }
@@ -0,0 +1,21 @@
1
+ import type { Preview } from "@storybook/react-vite";
2
+ import "./preview.css";
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: {
7
+ color: /(background|color)$/i,
8
+ date: /Date$/i,
9
+ },
10
+ },
11
+
12
+ a11y: {
13
+ // 'todo' - show a11y violations in the test UI only
14
+ // 'error' - fail CI on a11y violations
15
+ // 'off' - skip a11y checks entirely
16
+ test: "todo",
17
+ },
18
+ },
19
+ };
20
+
21
+ export default preview;
@@ -0,0 +1,7 @@
1
+ import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
2
+ import { setProjectAnnotations } from '@storybook/react-vite';
3
+ import * as projectAnnotations from './preview';
4
+
5
+ // This is an important step to apply the right configuration when testing your stories.
6
+ // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
7
+ setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
package/README.md CHANGED
@@ -17,9 +17,15 @@ A **shadcn-style component installer** that copies React components directly int
17
17
  Inside your project:
18
18
 
19
19
  ```sh
20
- npx notionsoft-ui init
20
+ npm i notionsoft-ui
21
21
  ```
22
22
 
23
23
  ```sh
24
24
  npx notionsoft-ui init
25
25
  ```
26
+
27
+ Add component to your project:
28
+
29
+ ```sh
30
+ npx notionsoft-ui add button
31
+ ```
package/cli/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const { program } = require("commander");
4
4
  const fs = require("fs-extra");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notionsoft-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
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"
@@ -17,17 +17,38 @@
17
17
  "cli"
18
18
  ],
19
19
  "dependencies": {
20
+ "@react-spring/web": "^10.0.3",
21
+ "@tailwindcss/vite": "^4.1.17",
20
22
  "chalk": "^4.1.2",
21
23
  "clsx": "^2.1.1",
22
24
  "commander": "^12.0.0",
23
25
  "fs-extra": "^11.2.0",
26
+ "lucide-react": "^0.554.0",
24
27
  "react": "^19.2.0",
25
28
  "react-dom": "^19.2.0",
26
29
  "tailwind-merge": "^3.4.0"
27
30
  },
28
31
  "devDependencies": {
32
+ "@chromatic-com/storybook": "^4.1.3",
33
+ "@storybook/addon-a11y": "^10.0.8",
34
+ "@storybook/addon-docs": "^10.0.8",
35
+ "@storybook/addon-vitest": "^10.0.8",
36
+ "@storybook/react-vite": "^10.0.8",
37
+ "@types/node": "^24.10.1",
29
38
  "@types/react": "^19.2.6",
30
39
  "@types/react-dom": "^19.2.3",
31
- "typescript": "^5.9.3"
40
+ "@vitest/browser-playwright": "4.0.13",
41
+ "@vitest/coverage-v8": "4.0.13",
42
+ "autoprefixer": "^10.4.22",
43
+ "playwright": "^1.56.1",
44
+ "postcss": "^8.5.6",
45
+ "storybook": "^10.0.8",
46
+ "tailwindcss": "^4.1.17",
47
+ "typescript": "^5.9.3",
48
+ "vitest": "^4.0.13"
49
+ },
50
+ "scripts": {
51
+ "storybook": "storybook dev -p 6006",
52
+ "build-storybook": "storybook build"
32
53
  }
33
54
  }
@@ -0,0 +1,54 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import { fn } from 'storybook/test';
4
+
5
+ import { Button } from './Button';
6
+
7
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
8
+ const meta = {
9
+ title: 'Example/Button',
10
+ component: Button,
11
+ parameters: {
12
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
13
+ layout: 'centered',
14
+ },
15
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
16
+ tags: ['autodocs'],
17
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
18
+ argTypes: {
19
+ backgroundColor: { control: 'color' },
20
+ },
21
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
22
+ args: { onClick: fn() },
23
+ } satisfies Meta<typeof Button>;
24
+
25
+ export default meta;
26
+ type Story = StoryObj<typeof meta>;
27
+
28
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
29
+ export const Primary: Story = {
30
+ args: {
31
+ primary: true,
32
+ label: 'Button',
33
+ },
34
+ };
35
+
36
+ export const Secondary: Story = {
37
+ args: {
38
+ label: 'Button',
39
+ },
40
+ };
41
+
42
+ export const Large: Story = {
43
+ args: {
44
+ size: 'large',
45
+ label: 'Button',
46
+ },
47
+ };
48
+
49
+ export const Small: Story = {
50
+ args: {
51
+ size: 'small',
52
+ label: 'Button',
53
+ },
54
+ };
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+
3
+ import './button.css';
4
+
5
+ export interface ButtonProps {
6
+ /** Is this the principal call to action on the page? */
7
+ primary?: boolean;
8
+ /** What background color to use */
9
+ backgroundColor?: string;
10
+ /** How large should the button be? */
11
+ size?: 'small' | 'medium' | 'large';
12
+ /** Button contents */
13
+ label: string;
14
+ /** Optional click handler */
15
+ onClick?: () => void;
16
+ }
17
+
18
+ /** Primary UI component for user interaction */
19
+ export const Button = ({
20
+ primary = false,
21
+ size = 'medium',
22
+ backgroundColor,
23
+ label,
24
+ ...props
25
+ }: ButtonProps) => {
26
+ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
27
+ return (
28
+ <button
29
+ type="button"
30
+ className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
31
+ style={{ backgroundColor }}
32
+ {...props}
33
+ >
34
+ {label}
35
+ </button>
36
+ );
37
+ };