@apptify-labs/ui 1.0.0

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 (88) hide show
  1. package/.storybook/main.ts +27 -0
  2. package/.storybook/preview.tsx +15 -0
  3. package/.turbo/turbo-build.log +19 -0
  4. package/README.md +107 -0
  5. package/STORYBOOK.md +112 -0
  6. package/dist/index.d.mts +33 -0
  7. package/dist/index.d.ts +33 -0
  8. package/dist/index.js +182 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/index.mjs +136 -0
  11. package/dist/index.mjs.map +1 -0
  12. package/package.json +63 -0
  13. package/postcss.config.js +6 -0
  14. package/src/components/card/card.stories.tsx +38 -0
  15. package/src/components/card/card.tsx +75 -0
  16. package/src/components/card/index.ts +1 -0
  17. package/src/components/input/index.ts +1 -0
  18. package/src/components/input/input.stories.tsx +40 -0
  19. package/src/components/input/input.tsx +24 -0
  20. package/src/components/label/index.ts +1 -0
  21. package/src/components/label/label.stories.tsx +22 -0
  22. package/src/components/label/label.tsx +23 -0
  23. package/src/components/separator/index.ts +1 -0
  24. package/src/components/separator/separator.stories.tsx +36 -0
  25. package/src/components/separator/separator.tsx +28 -0
  26. package/src/index.ts +5 -0
  27. package/src/styles.css +69 -0
  28. package/src/utils/cn.ts +14 -0
  29. package/src/utils/index.ts +1 -0
  30. package/storybook-static/assets/Color-YHDXOIA2-kSxZo1Vy.js +1 -0
  31. package/storybook-static/assets/DocsRenderer-CFRXHY34-DsDoVbDP.js +575 -0
  32. package/storybook-static/assets/card.stories-1IXkTbkW.js +20 -0
  33. package/storybook-static/assets/chunk-XP5HYGXS-rhzvizV_.js +1 -0
  34. package/storybook-static/assets/client-CN6oaCdP.js +33 -0
  35. package/storybook-static/assets/entry-preview-Ct7_9bu-.js +2 -0
  36. package/storybook-static/assets/entry-preview-docs-pv-Qwe_M.js +46 -0
  37. package/storybook-static/assets/iframe-CbRAOl5a.js +211 -0
  38. package/storybook-static/assets/index-B3ijS-tw.js +11 -0
  39. package/storybook-static/assets/index-DH-M5T-F.js +240 -0
  40. package/storybook-static/assets/index-DHO77v_d.js +1 -0
  41. package/storybook-static/assets/index-DrFu-skq.js +6 -0
  42. package/storybook-static/assets/index-DzGJhHoF.js +9 -0
  43. package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
  44. package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
  45. package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
  46. package/storybook-static/assets/preview-BIuR4HGU.js +240 -0
  47. package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
  48. package/storybook-static/assets/preview-B_o1KE33.css +1 -0
  49. package/storybook-static/assets/preview-CM32KvaH.js +1 -0
  50. package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
  51. package/storybook-static/assets/preview-Cy3uZJAu.js +2 -0
  52. package/storybook-static/assets/preview-DD_OYowb.js +1 -0
  53. package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
  54. package/storybook-static/assets/preview-DHQbi4pV.js +1 -0
  55. package/storybook-static/assets/react-18-BeIp0fAf.js +1 -0
  56. package/storybook-static/assets/test-utils-BxnH6twK.js +9 -0
  57. package/storybook-static/favicon.svg +1 -0
  58. package/storybook-static/iframe.html +666 -0
  59. package/storybook-static/index.html +177 -0
  60. package/storybook-static/index.json +1 -0
  61. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  62. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  63. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  64. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  65. package/storybook-static/project.json +1 -0
  66. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
  67. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
  68. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +405 -0
  69. package/storybook-static/sb-addons/essentials-docs-4/manager-bundle.js +245 -0
  70. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
  71. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
  72. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
  73. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
  74. package/storybook-static/sb-addons/interactions-10/manager-bundle.js +222 -0
  75. package/storybook-static/sb-addons/links-1/manager-bundle.js +3 -0
  76. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  77. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  78. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  79. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  80. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  81. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  82. package/storybook-static/sb-manager/globals-module-info.js +1052 -0
  83. package/storybook-static/sb-manager/globals-runtime.js +41775 -0
  84. package/storybook-static/sb-manager/globals.js +48 -0
  85. package/storybook-static/sb-manager/runtime.js +12048 -0
  86. package/tailwind.config.js +103 -0
  87. package/tsconfig.json +21 -0
  88. package/tsup.config.ts +12 -0
@@ -0,0 +1,27 @@
1
+ import type { StorybookConfig } from "@storybook/react-vite";
2
+ import { join, dirname } from "path";
3
+
4
+ /**
5
+ * This function is used to resolve the absolute path of a package.
6
+ * It is needed in projects that use Yarn PnP or are set up within a monorepo.
7
+ */
8
+ function getAbsolutePath(value: string): any {
9
+ return dirname(require.resolve(join(value, "package.json")));
10
+ }
11
+
12
+ const config: StorybookConfig = {
13
+ stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
14
+ addons: [
15
+ getAbsolutePath("@storybook/addon-links"),
16
+ getAbsolutePath("@storybook/addon-essentials"),
17
+ getAbsolutePath("@storybook/addon-interactions"),
18
+ ],
19
+ framework: {
20
+ name: getAbsolutePath("@storybook/react-vite"),
21
+ options: {},
22
+ },
23
+ docs: {
24
+ autodocs: "tag",
25
+ },
26
+ };
27
+ export default config;
@@ -0,0 +1,15 @@
1
+ import type { Preview } from "@storybook/react";
2
+ import "../src/styles.css";
3
+
4
+ const preview: Preview = {
5
+ parameters: {
6
+ controls: {
7
+ matchers: {
8
+ color: /(background|color)$/i,
9
+ date: /Date$/i,
10
+ },
11
+ },
12
+ },
13
+ };
14
+
15
+ export default preview;
@@ -0,0 +1,19 @@
1
+ $ tsup
2
+ CLI Building entry: src/index.ts
3
+ CLI Using tsconfig: tsconfig.json
4
+ CLI tsup v8.5.1
5
+ CLI Using tsup config: /Volumes/iExternal/Developer/Website/apptify/ui-framework/framework/packages/ui/tsup.config.ts
6
+ CLI Target: es2022
7
+ CLI Cleaning output folder
8
+ CJS Build start
9
+ ESM Build start
10
+ CJS dist/index.js 6.01 KB
11
+ CJS dist/index.js.map 7.25 KB
12
+ CJS ⚡️ Build success in 9ms
13
+ ESM dist/index.mjs 3.77 KB
14
+ ESM dist/index.mjs.map 6.94 KB
15
+ ESM ⚡️ Build success in 9ms
16
+ DTS Build start
17
+ DTS ⚡️ Build success in 665ms
18
+ DTS dist/index.d.ts 2.18 KB
19
+ DTS dist/index.d.mts 2.18 KB
package/README.md ADDED
@@ -0,0 +1,107 @@
1
+ # @apptify/ui
2
+
3
+ แพ็กเกจนี้คือ **Shared UI Framework** สำหรับใช้งานในแอปพลิเคชันและโปรเจกต์ต่างๆ
4
+ โดยถูกพัฒนาต่อยอดมาจาก `shadcn/ui` และ `Tailwind CSS` เพื่อใช้เป็น **Enterprise Design System** แบบรวมศูนย์
5
+
6
+ > **สำคัญ:** แพ็กเกจนี้ถูกออกแบบให้ใช้งานในรูปแบบ **NPM Package** ที่มี Versioning ดังนั้นโค้ดของ Component ต่างๆ จะถูกล็อกอยู่ใน `node_modules` เพื่อรักษามาตรฐานและ Design ให้ตรงกันทุกโปรเจกต์ (Centralized Updates) จะแตกต่างจากการใช้งาน `shadcn/ui` แบบปกติที่คุณคัดลอกโค้ดมาปรับแต่งเองได้
7
+
8
+ ---
9
+
10
+ ## 📦 การติดตั้ง (Installation)
11
+
12
+ สำหรับการนำไปใช้ในโปรเจกต์ภายนอก ให้ทำการติดตั้งแพ็กเกจผ่าน Package Manager ที่คุณใช้งาน:
13
+
14
+ ```bash
15
+ npm install @apptify/ui
16
+ # หรือ
17
+ pnpm add @apptify/ui
18
+ # หรือ
19
+ yarn add @apptify/ui
20
+ ```
21
+
22
+ ---
23
+
24
+ ## 🚀 การตั้งค่าและเรียกใช้งาน (Setup & Usage)
25
+
26
+ เนื่องจาก `@apptify/ui` ใช้ Tailwind CSS เป็นแกนหลัก คุณจำเป็นต้องตั้งค่าโปรเจกต์ของคุณเล็กน้อย เพื่อให้แอปพลิเคชันของคุณอ่านคลาสต่างๆ ได้อย่างถูกต้อง
27
+
28
+ ### 1. การตั้งค่า Tailwind CSS
29
+
30
+ คุณต้องเพิ่ม Path ของไฟล์จากแพ็กเกจนี้เข้าไปใน `content` ของไฟล์ `tailwind.config.js` ในโปรเจกต์ของคุณ เพื่อไม่ให้คลาสของ Component ถูกลบออก (Purge) ตอน Build
31
+
32
+ ```javascript
33
+ // tailwind.config.js
34
+ module.exports = {
35
+ content: [
36
+ "./src/**/*.{js,ts,jsx,tsx}",
37
+
38
+ // สำคัญ: สแกนหา class จาก package @apptify/ui ที่ติดตั้งผ่าน npm
39
+ "./node_modules/@apptify/ui/dist/**/*.{js,mjs}",
40
+ ],
41
+ theme: {
42
+ extend: {},
43
+ },
44
+ plugins: [],
45
+ }
46
+ ```
47
+
48
+ ### 2. การนำเข้า Styles (CSS)
49
+
50
+ ในไฟล์ CSS หลักของแอปคุณ (เช่น `globals.css` สำหรับ Next.js หรือ `index.css` สำหรับ React/Vite) ให้ทำการ import stylesheet ของ UI Framework เข้ามาด้วย:
51
+
52
+ ```css
53
+ @import "@apptify/ui/styles.css";
54
+
55
+ /* โค้ด CSS เดิมของโปรเจกต์... */
56
+ @tailwind base;
57
+ @tailwind components;
58
+ @tailwind utilities;
59
+ ```
60
+
61
+ ### 3. การเรียกใช้งาน Components
62
+
63
+ คุณสามารถ import components ต่างๆ ที่มีให้ใช้งานในแพ็กเกจ และนำไปใช้ได้ทันที:
64
+
65
+ ```tsx
66
+ import { Card, CardHeader, CardTitle, CardContent, Input, Label } from "@apptify/ui";
67
+
68
+ export default function MyPage() {
69
+ return (
70
+ <Card className="max-w-md mx-auto mt-10">
71
+ <CardHeader>
72
+ <CardTitle>เข้าสู่ระบบ</CardTitle>
73
+ </CardHeader>
74
+ <CardContent className="space-y-4">
75
+ <div className="space-y-1">
76
+ <Label htmlFor="email">อีเมล</Label>
77
+ <Input id="email" placeholder="email@example.com" />
78
+ </div>
79
+ </CardContent>
80
+ </Card>
81
+ );
82
+ }
83
+ ```
84
+
85
+ ---
86
+
87
+ ## 🛠️ การแก้ไขและ Customization
88
+
89
+ - หากคุณต้องการปรับแต่งสไตล์ย่อยๆ ของ Component ในหน้าเว็บนั้นๆ สามารถส่ง Prop `className` เข้าไปเพื่อ Override คลาสผ่าน Tailwind ได้ (ระบบใช้ `tailwind-merge` จัดการคลาสที่ซ้ำซ้อนให้แล้ว)
90
+ - หากต้องการเปลี่ยนแปลงโครงสร้างหลัก หรือแก้บัคของ Component คุณจะต้องทำการแก้ไขที่ Source Code ของโปรเจกต์ `@apptify/ui` ต้นทาง ทำการ Build และ **Publish Version ใหม่** เพื่อให้โปรเจกต์อื่นๆ กดอัปเดตเวอร์ชันนำไปใช้งานต่อ
91
+
92
+ ---
93
+
94
+ ## 💻 สำหรับนักพัฒนาแพ็กเกจนี้ (Development & Publishing)
95
+
96
+ หากคุณเป็นผู้พัฒนา UI Framework ตัวนี้ และต้องการ Build โค้ดเพื่อ Publish:
97
+
98
+ 1. ติดตั้ง Dependencies ใน Workspace: `pnpm install`
99
+ 2. ทำการ Build ตัวแพ็กเกจ:
100
+ ```bash
101
+ pnpm run build --filter @apptify/ui
102
+ ```
103
+ 3. อัปเดตเลขเวอร์ชันใน `package.json` (เช่น `1.0.0` เป็น `1.0.1`)
104
+ 4. สั่ง Publish ขึ้นสู่ NPM Registry หรือ Private Registry ขององค์กร:
105
+ ```bash
106
+ npm publish
107
+ ```
package/STORYBOOK.md ADDED
@@ -0,0 +1,112 @@
1
+ # Storybook & การจัดการ Components
2
+
3
+ คู่มือนี้จะอธิบายขั้นตอนการรัน Storybook รวมถึงการนำ Component ใหม่จาก Shadcn UI มาใช้งานใน `@apptify/ui` ตั้งแต่ขั้นตอนการดาวน์โหลด การปรับแต่ง จนถึงการเขียนเอกสาร (Docs) ลงใน Storybook ครับ
4
+
5
+ ---
6
+
7
+ ## 🏃‍♂️ การรัน Storybook
8
+
9
+ หากต้องการดู Document หรือทดสอบ UI Components สามารถรัน Storybook ได้ด้วยคำสั่ง:
10
+
11
+ ```bash
12
+ cd packages/ui
13
+ pnpm run storybook
14
+ ```
15
+ จากนั้นเปิดเบราว์เซอร์ไปที่ `http://localhost:6006`
16
+
17
+ ---
18
+
19
+ ## 📦 การนำ Component ใหม่เข้ามาใน Project
20
+
21
+ คุณสามารถนำ Component จาก Shadcn UI เข้ามาในโฟลเดอร์ `packages/ui/src/components` ได้ 2 วิธี:
22
+
23
+ ### วิธีที่ 1: ผ่าน CLI (แนะนำ)
24
+ ถ้าคุณรันคำสั่งของ Shadcn ได้ในโปรเจ็กต์ ให้ใช้คำสั่ง:
25
+ ```bash
26
+ npx shadcn-ui@latest add input
27
+ ```
28
+ *(ระบบจะสร้างไฟล์และติดตั้ง Dependencies ของ Radix UI ให้ถ้าจำเป็น)*
29
+
30
+ ### วิธีที่ 2: Copy & Paste แบบ Manual
31
+ 1. ไปที่เว็บ [Shadcn UI](https://ui.shadcn.com/docs/components)
32
+ 2. เลือก Component (เช่น Input, Label) แล้วกดคัดลอกโค้ด
33
+ 3. สร้างโฟลเดอร์สำหรับ Component นั้น เช่น `src/components/input/`
34
+ 4. สร้างไฟล์ `input.tsx` และวางโค้ดลงไป
35
+
36
+ > ⚠️ **ข้อควรระวังเรื่อง Import Path:**
37
+ > Shadcn UI จะตั้งค่าเริ่มต้นให้ Import ฟังก์ชัน `cn` จาก `@/lib/utils`
38
+ > แต่โครงสร้างของเราอยู่ที่ `../../utils/cn` ดังนั้นคุณต้องแก้ Import ให้ถูกต้องตามโครงสร้างของเรา:
39
+ > ```diff
40
+ > - import { cn } from "@/lib/utils"
41
+ > + import { cn } from "../../utils/cn"
42
+ > ```
43
+
44
+ ---
45
+
46
+ ## 📝 การสร้างไฟล์ Storybook สำหรับ Component
47
+
48
+ เมื่อคุณมีไฟล์ `input.tsx` แล้ว ขั้นตอนต่อไปคือการสร้างไฟล์ Story เพื่อให้ Component นั้นไปแสดงใน Storybook
49
+
50
+ 1. สร้างไฟล์ชื่อ `input.stories.tsx` ในโฟลเดอร์เดียวกัน (เช่น `src/components/input/input.stories.tsx`)
51
+ 2. วางโครงสร้างมาตรฐานสำหรับ Storybook ดังนี้:
52
+
53
+ ```tsx
54
+ // src/components/input/input.stories.tsx
55
+ import type { Meta, StoryObj } from '@storybook/react';
56
+ import { Input } from './input';
57
+
58
+ // 1. ตั้งค่า Meta สำหรับ Component
59
+ const meta = {
60
+ title: 'Components/Input', // ชื่อหมวดหมู่และชื่อ Component ใน Sidebar
61
+ component: Input, // Component หลักที่เราจะทำ Docs
62
+ parameters: {
63
+ layout: 'centered', // จัดกึ่งกลางหน้าจอ
64
+ },
65
+ tags: ['autodocs'], // สร้างหน้า Docs ให้โดยอัตโนมัติ
66
+ } satisfies Meta<typeof Input>;
67
+
68
+ export default meta;
69
+ type Story = StoryObj<typeof meta>;
70
+
71
+ // 2. สร้าง Story รูปแบบต่างๆ (เช่น แบบ Default, Disabled, หรือมี Label)
72
+ export const Default: Story = {
73
+ args: {
74
+ type: 'text',
75
+ placeholder: 'Email address',
76
+ },
77
+ };
78
+
79
+ export const Disabled: Story = {
80
+ args: {
81
+ disabled: true,
82
+ placeholder: 'Disabled input',
83
+ },
84
+ };
85
+ ```
86
+
87
+ > **Tip:** `args` ใน Storybook คือการจำลองการส่ง `props` เข้าไปใน Component ของเรา คุณสามารถใส่ `className`, `disabled`, หรือ props อื่นๆ เพื่อจำลอง State แบบต่างๆ ได้เลย
88
+
89
+ ---
90
+
91
+ ## 🚀 การ Export Component เพื่อให้แอปพลิเคชันอื่นนำไปใช้ (สำคัญ)
92
+
93
+ หลังจากทำ Component และ Storybook เสร็จแล้ว อย่าลืม Export Component นั้นที่ไฟล์ `packages/ui/src/index.ts` เพื่อให้ Package หรือแอปพลิเคชันอื่นๆ ใน Monorepo มองเห็นและนำไปใช้งานได้
94
+
95
+ แก้ไขไฟล์ `src/index.ts`:
96
+ ```ts
97
+ // Export แบบนี้สำหรับทุก Component ใหม่ที่คุณเพิ่มเข้ามา
98
+ export * from "./components/card/card";
99
+ export * from "./components/input/input";
100
+ export * from "./components/label/label";
101
+ export * from "./components/separator/separator";
102
+ // ...
103
+ ```
104
+
105
+ ---
106
+
107
+ ## ✅ สรุป Workflow ในการทำงาน
108
+ 1. **ดึงโค้ด** (จาก Shadcn) -> ใส่ใน `src/components/[ชื่อ]/`
109
+ 2. **แก้ `cn`** -> เปลี่ยน `import { cn }` ให้ชี้ไปที่ `utils/cn` ของเรา
110
+ 3. **เขียน Story** -> สร้างไฟล์ `.stories.tsx` คู่กัน
111
+ 4. **Export** -> เอาไปใส่ใน `src/index.ts`
112
+ 5. **ดูผลลัพธ์** -> รัน `pnpm run storybook` เพื่อตรวจสอบความเรียบร้อย
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as LabelPrimitive from '@radix-ui/react-label';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
6
+ import { ClassValue } from 'clsx';
7
+
8
+ declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
11
+ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
12
+ declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
14
+
15
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
16
+ }
17
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
18
+
19
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
20
+
21
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
22
+
23
+ /**
24
+ * Merges Tailwind CSS classes with proper conflict resolution.
25
+ * Combines clsx for conditional classes and tailwind-merge for deduplication.
26
+ *
27
+ * @example
28
+ * cn("px-4 py-2", "px-8") // => "px-8 py-2"
29
+ * cn("text-red-500", isActive && "text-blue-500")
30
+ */
31
+ declare function cn(...inputs: ClassValue[]): string;
32
+
33
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, type InputProps, Label, Separator, cn };
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as LabelPrimitive from '@radix-ui/react-label';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
6
+ import { ClassValue } from 'clsx';
7
+
8
+ declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
11
+ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
12
+ declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
14
+
15
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
16
+ }
17
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
18
+
19
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
20
+
21
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
22
+
23
+ /**
24
+ * Merges Tailwind CSS classes with proper conflict resolution.
25
+ * Combines clsx for conditional classes and tailwind-merge for deduplication.
26
+ *
27
+ * @example
28
+ * cn("px-4 py-2", "px-8") // => "px-8 py-2"
29
+ * cn("text-red-500", isActive && "text-blue-500")
30
+ */
31
+ declare function cn(...inputs: ClassValue[]): string;
32
+
33
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, type InputProps, Label, Separator, cn };
package/dist/index.js ADDED
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Card: () => Card,
34
+ CardContent: () => CardContent,
35
+ CardDescription: () => CardDescription,
36
+ CardFooter: () => CardFooter,
37
+ CardHeader: () => CardHeader,
38
+ CardTitle: () => CardTitle,
39
+ Input: () => Input,
40
+ Label: () => Label,
41
+ Separator: () => Separator,
42
+ cn: () => cn
43
+ });
44
+ module.exports = __toCommonJS(index_exports);
45
+
46
+ // src/components/card/card.tsx
47
+ var React = __toESM(require("react"));
48
+
49
+ // src/utils/cn.ts
50
+ var import_clsx = require("clsx");
51
+ var import_tailwind_merge = require("tailwind-merge");
52
+ function cn(...inputs) {
53
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
54
+ }
55
+
56
+ // src/components/card/card.tsx
57
+ var import_jsx_runtime = require("react/jsx-runtime");
58
+ var Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
59
+ "div",
60
+ {
61
+ ref,
62
+ className: cn(
63
+ "rounded-xl border bg-card text-card-foreground shadow",
64
+ className
65
+ ),
66
+ ...props
67
+ }
68
+ ));
69
+ Card.displayName = "Card";
70
+ var CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
+ "div",
72
+ {
73
+ ref,
74
+ className: cn("flex flex-col space-y-1.5 p-6", className),
75
+ ...props
76
+ }
77
+ ));
78
+ CardHeader.displayName = "CardHeader";
79
+ var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
+ "h3",
81
+ {
82
+ ref,
83
+ className: cn("font-semibold leading-none tracking-tight", className),
84
+ ...props
85
+ }
86
+ ));
87
+ CardTitle.displayName = "CardTitle";
88
+ var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
+ "p",
90
+ {
91
+ ref,
92
+ className: cn("text-sm text-muted-foreground", className),
93
+ ...props
94
+ }
95
+ ));
96
+ CardDescription.displayName = "CardDescription";
97
+ var CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: cn("p-6 pt-0", className), ...props }));
98
+ CardContent.displayName = "CardContent";
99
+ var CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
+ "div",
101
+ {
102
+ ref,
103
+ className: cn("flex items-center p-6 pt-0", className),
104
+ ...props
105
+ }
106
+ ));
107
+ CardFooter.displayName = "CardFooter";
108
+
109
+ // src/components/input/input.tsx
110
+ var React2 = __toESM(require("react"));
111
+ var import_jsx_runtime2 = require("react/jsx-runtime");
112
+ var Input = React2.forwardRef(
113
+ ({ className, type, ...props }, ref) => {
114
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
115
+ "input",
116
+ {
117
+ type,
118
+ className: cn(
119
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
120
+ className
121
+ ),
122
+ ref,
123
+ ...props
124
+ }
125
+ );
126
+ }
127
+ );
128
+ Input.displayName = "Input";
129
+
130
+ // src/components/label/label.tsx
131
+ var React3 = __toESM(require("react"));
132
+ var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
133
+ var import_class_variance_authority = require("class-variance-authority");
134
+ var import_jsx_runtime3 = require("react/jsx-runtime");
135
+ var labelVariants = (0, import_class_variance_authority.cva)(
136
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
137
+ );
138
+ var Label = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
139
+ LabelPrimitive.Root,
140
+ {
141
+ ref,
142
+ className: cn(labelVariants(), className),
143
+ ...props
144
+ }
145
+ ));
146
+ Label.displayName = LabelPrimitive.Root.displayName;
147
+
148
+ // src/components/separator/separator.tsx
149
+ var React4 = __toESM(require("react"));
150
+ var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
151
+ var import_jsx_runtime4 = require("react/jsx-runtime");
152
+ var Separator = React4.forwardRef(
153
+ ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
154
+ SeparatorPrimitive.Root,
155
+ {
156
+ ref,
157
+ decorative,
158
+ orientation,
159
+ className: cn(
160
+ "shrink-0 bg-border",
161
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
162
+ className
163
+ ),
164
+ ...props
165
+ }
166
+ )
167
+ );
168
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
169
+ // Annotate the CommonJS export names for ESM import in node:
170
+ 0 && (module.exports = {
171
+ Card,
172
+ CardContent,
173
+ CardDescription,
174
+ CardFooter,
175
+ CardHeader,
176
+ CardTitle,
177
+ Input,
178
+ Label,
179
+ Separator,
180
+ cn
181
+ });
182
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/components/card/card.tsx","../src/utils/cn.ts","../src/components/input/input.tsx","../src/components/label/label.tsx","../src/components/separator/separator.tsx"],"sourcesContent":["export * from \"./components/card\";\nexport * from \"./components/input\";\nexport * from \"./components/label\";\nexport * from \"./components/separator\";\nexport * from \"./utils/cn\";\n","import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border bg-card text-card-foreground shadow\",\n className\n )}\n {...props}\n />\n));\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n));\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merges Tailwind CSS classes with proper conflict resolution.\n * Combines clsx for conditional classes and tailwind-merge for deduplication.\n *\n * @example\n * cn(\"px-4 py-2\", \"px-8\") // => \"px-8 py-2\"\n * cn(\"text-red-500\", isActive && \"text-blue-500\")\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n ref={ref}\n {...props}\n />\n );\n }\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","import * as React from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport { cn } from \"../../utils/cn\";\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n);\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"],"mappings":"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","names":["React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime"]}