@sharpnr/ui 0.0.6 → 1.0.1

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 (50) hide show
  1. package/README.md +160 -0
  2. package/dist/components/ui/404Page.d.ts +1 -0
  3. package/dist/components/ui/GlobalLoader.d.ts +5 -0
  4. package/dist/components/ui/alert-dialog.d.ts +18 -0
  5. package/dist/components/ui/alert.d.ts +10 -0
  6. package/dist/components/ui/avatar.d.ts +11 -0
  7. package/dist/components/ui/badge.d.ts +9 -0
  8. package/dist/components/ui/breadcrumb.d.ts +11 -0
  9. package/dist/components/ui/button-group.d.ts +11 -0
  10. package/dist/components/ui/button-group.stories.d.ts +9 -0
  11. package/dist/components/ui/button.d.ts +2 -2
  12. package/dist/components/ui/button.stories.d.ts +9 -0
  13. package/dist/components/ui/card.d.ts +11 -0
  14. package/dist/components/ui/card.stories.d.ts +9 -0
  15. package/dist/components/ui/command.d.ts +18 -0
  16. package/dist/components/ui/dialog.d.ts +17 -0
  17. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  18. package/dist/components/ui/empty.d.ts +11 -0
  19. package/dist/components/ui/global-err.d.ts +8 -0
  20. package/dist/components/ui/hover-card.d.ts +6 -0
  21. package/dist/components/ui/input-group.d.ts +16 -0
  22. package/dist/components/ui/kbd.d.ts +3 -0
  23. package/dist/components/ui/pagination.d.ts +17 -0
  24. package/dist/components/ui/popover.d.ts +10 -0
  25. package/dist/components/ui/scroll-area.d.ts +5 -0
  26. package/dist/components/ui/select.d.ts +15 -0
  27. package/dist/components/ui/separator.d.ts +4 -0
  28. package/dist/components/ui/sheet.d.ts +13 -0
  29. package/dist/components/ui/sidebar.d.ts +69 -0
  30. package/dist/components/ui/sidebar.stories.d.ts +8 -0
  31. package/dist/components/ui/skeleton.d.ts +2 -0
  32. package/dist/components/ui/sonner.d.ts +3 -0
  33. package/dist/components/ui/spinner.d.ts +2 -0
  34. package/dist/components/ui/switch.d.ts +6 -0
  35. package/dist/components/ui/table.d.ts +10 -0
  36. package/dist/components/ui/tabs.d.ts +11 -0
  37. package/dist/components/ui/textarea.d.ts +3 -0
  38. package/dist/components/ui/tooltip.d.ts +7 -0
  39. package/dist/hooks/ThemeToggle.d.ts +1 -0
  40. package/dist/hooks/theme-provider.d.ts +13 -0
  41. package/dist/hooks/use-mobile.d.ts +1 -0
  42. package/dist/index.d.ts +35 -1
  43. package/dist/index.es.js +16740 -778
  44. package/dist/stories/Button.d.ts +14 -0
  45. package/dist/stories/Button.stories.d.ts +23 -0
  46. package/dist/stories/Header.d.ts +11 -0
  47. package/dist/stories/Header.stories.d.ts +18 -0
  48. package/dist/stories/Page.d.ts +2 -0
  49. package/dist/stories/Page.stories.d.ts +12 -0
  50. package/package.json +21 -3
@@ -0,0 +1,14 @@
1
+ export interface ButtonProps {
2
+ /** Is this the principal call to action on the page? */
3
+ primary?: boolean;
4
+ /** What background color to use */
5
+ backgroundColor?: string;
6
+ /** How large should the button be? */
7
+ size?: "small" | "medium" | "large";
8
+ /** Button contents */
9
+ label: string;
10
+ /** Optional click handler */
11
+ onClick?: () => void;
12
+ }
13
+ /** Primary UI component for user interaction */
14
+ export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ primary, size, backgroundColor, label, ...props }: import('./Button').ButtonProps) => import("react/jsx-runtime").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ argTypes: {
10
+ backgroundColor: {
11
+ control: "color";
12
+ };
13
+ };
14
+ args: {
15
+ onClick: import('storybook/test').Mock<(...args: any[]) => any>;
16
+ };
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+ export declare const Primary: Story;
21
+ export declare const Secondary: Story;
22
+ export declare const Large: Story;
23
+ export declare const Small: Story;
@@ -0,0 +1,11 @@
1
+ type User = {
2
+ name: string;
3
+ };
4
+ export interface HeaderProps {
5
+ user?: User;
6
+ onLogin?: () => void;
7
+ onLogout?: () => void;
8
+ onCreateAccount?: () => void;
9
+ }
10
+ export declare const Header: ({ user, onLogin, onLogout, onCreateAccount, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,18 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ user, onLogin, onLogout, onCreateAccount, }: import('./Header').HeaderProps) => import("react/jsx-runtime").JSX.Element;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ args: {
10
+ onLogin: import('storybook/test').Mock<(...args: any[]) => any>;
11
+ onLogout: import('storybook/test').Mock<(...args: any[]) => any>;
12
+ onCreateAccount: import('storybook/test').Mock<(...args: any[]) => any>;
13
+ };
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const LoggedIn: Story;
18
+ export declare const LoggedOut: Story;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const Page: React.FC;
@@ -0,0 +1,12 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import('react').FC<{}>;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const LoggedOut: Story;
12
+ export declare const LoggedIn: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharpnr/ui",
3
- "version": "0.0.6",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "Sharpnr's shared UI component library",
6
6
  "main": "./dist/index.es.js",
@@ -20,7 +20,9 @@
20
20
  "dev": "vite build --watch",
21
21
  "build": "tsc -b && vite build",
22
22
  "lint": "eslint .",
23
- "preview": "vite preview"
23
+ "preview": "vite preview",
24
+ "storybook": "storybook dev -p 6006",
25
+ "build-storybook": "storybook build"
24
26
  },
25
27
  "publishConfig": {
26
28
  "access": "public"
@@ -31,31 +33,47 @@
31
33
  },
32
34
  "dependencies": {
33
35
  "@fontsource-variable/outfit": "^5.2.8",
36
+ "@gsap/react": "^2.1.2",
34
37
  "class-variance-authority": "^0.7.1",
35
38
  "clsx": "^2.1.1",
39
+ "cmdk": "^1.1.1",
40
+ "framer-motion": "^12.23.12",
36
41
  "lucide-react": "^1.16.0",
42
+ "next-themes": "^0.4.6",
37
43
  "radix-ui": "^1.4.3",
44
+ "sonner": "^2.0.7",
38
45
  "tailwind-merge": "^3.6.0",
39
46
  "tw-animate-css": "^1.4.0"
40
47
  },
41
48
  "devDependencies": {
49
+ "@chromatic-com/storybook": "^5.2.1",
42
50
  "@eslint/js": "^10.0.1",
51
+ "@storybook/addon-a11y": "^10.4.0",
52
+ "@storybook/addon-docs": "^10.4.0",
53
+ "@storybook/addon-vitest": "^10.4.0",
54
+ "@storybook/react-vite": "^10.4.0",
43
55
  "@tailwindcss/vite": "^4.3.0",
44
56
  "@types/node": "^24.12.4",
45
57
  "@types/react": "^19.2.14",
46
58
  "@types/react-dom": "^19.2.3",
47
59
  "@vitejs/plugin-react": "^6.0.1",
60
+ "@vitest/browser-playwright": "^4.1.6",
61
+ "@vitest/coverage-v8": "^4.1.6",
48
62
  "autoprefixer": "^10.5.0",
49
63
  "eslint": "^10.3.0",
50
64
  "eslint-plugin-react-hooks": "^7.1.1",
51
65
  "eslint-plugin-react-refresh": "^0.5.2",
66
+ "eslint-plugin-storybook": "^10.4.0",
52
67
  "globals": "^17.6.0",
68
+ "playwright": "^1.60.0",
53
69
  "postcss": "^8.5.14",
54
70
  "shadcn": "^4.7.0",
71
+ "storybook": "^10.4.0",
55
72
  "tailwindcss": "^4.3.0",
56
73
  "typescript": "~6.0.2",
57
74
  "typescript-eslint": "^8.59.2",
58
75
  "vite": "^8.0.12",
59
- "vite-plugin-dts": "^5.0.0"
76
+ "vite-plugin-dts": "^5.0.0",
77
+ "vitest": "^4.1.6"
60
78
  }
61
79
  }