@phsa.tec/design-system-react 0.1.6 → 0.1.9

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 (217) hide show
  1. package/README.md +390 -209
  2. package/dist/index.d.mts +485 -0
  3. package/dist/index.d.ts +485 -0
  4. package/dist/index.js +4259 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +4186 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/styles.css +2534 -0
  9. package/dist/styles.css.map +1 -0
  10. package/dist/styles.d.mts +2 -0
  11. package/dist/styles.d.ts +2 -0
  12. package/package.json +46 -6
  13. package/.eslintrc.json +0 -7
  14. package/.github/workflows/deploy-storybook.yml +0 -75
  15. package/.storybook/main.ts +0 -16
  16. package/.storybook/preview.ts +0 -15
  17. package/components.json +0 -21
  18. package/jest.config.ts +0 -25
  19. package/next.config.ts +0 -7
  20. package/postcss.config.mjs +0 -8
  21. package/public/file.svg +0 -1
  22. package/public/globe.svg +0 -1
  23. package/public/next.svg +0 -1
  24. package/public/vercel.svg +0 -1
  25. package/public/window.svg +0 -1
  26. package/src/app/columns.tsx +0 -178
  27. package/src/app/favicon.ico +0 -0
  28. package/src/app/fonts/GeistMonoVF.woff +0 -0
  29. package/src/app/fonts/GeistVF.woff +0 -0
  30. package/src/app/globals.css +0 -94
  31. package/src/app/layout.tsx +0 -35
  32. package/src/app/page.tsx +0 -7
  33. package/src/components/actions/AlertDialog/AlertDialog.tsx +0 -45
  34. package/src/components/actions/AlertDialog/alert-dialog.stories.tsx +0 -21
  35. package/src/components/actions/AlertDialog/index.ts +0 -1
  36. package/src/components/actions/Button/Button.stories.ts +0 -38
  37. package/src/components/actions/Button/Button.tsx +0 -23
  38. package/src/components/actions/Button/index.ts +0 -1
  39. package/src/components/actions/Collapsible/index.ts +0 -1
  40. package/src/components/actions/Dialog/Dialog.stories.tsx +0 -70
  41. package/src/components/actions/Dialog/Dialog.tsx +0 -87
  42. package/src/components/actions/Dialog/components/DialogWithActions/index.tsx +0 -40
  43. package/src/components/actions/Dialog/index.ts +0 -1
  44. package/src/components/actions/Steps/Steps.stories.tsx +0 -25
  45. package/src/components/actions/Steps/Steps.tsx +0 -51
  46. package/src/components/actions/Steps/index.ts +0 -1
  47. package/src/components/actions/index.ts +0 -5
  48. package/src/components/dataDisplay/Avatar/Avatar.stories.tsx +0 -22
  49. package/src/components/dataDisplay/Avatar/Avatar.tsx +0 -21
  50. package/src/components/dataDisplay/Avatar/index.ts +0 -2
  51. package/src/components/dataDisplay/Badge/Badge.stories.tsx +0 -36
  52. package/src/components/dataDisplay/Badge/index.ts +0 -1
  53. package/src/components/dataDisplay/Card/Card.stories.tsx +0 -24
  54. package/src/components/dataDisplay/Card/Card.tsx +0 -34
  55. package/src/components/dataDisplay/Card/index.ts +0 -1
  56. package/src/components/dataDisplay/DataPairList/DataPairList.tsx +0 -56
  57. package/src/components/dataDisplay/DataPairList/data-pair-list.stories.tsx +0 -87
  58. package/src/components/dataDisplay/DataPairList/index.ts +0 -2
  59. package/src/components/dataDisplay/DataPairList/types.ts +0 -10
  60. package/src/components/dataDisplay/DropDownMenu/index.ts +0 -1
  61. package/src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx +0 -6
  62. package/src/components/dataDisplay/ErrorMessage/index.ts +0 -1
  63. package/src/components/dataDisplay/Icon/Icon.stories.tsx +0 -21
  64. package/src/components/dataDisplay/Icon/Icon.tsx +0 -47
  65. package/src/components/dataDisplay/Icon/index.ts +0 -1
  66. package/src/components/dataDisplay/Icon/types.ts +0 -6
  67. package/src/components/dataDisplay/Label/Label.stories.tsx +0 -21
  68. package/src/components/dataDisplay/Label/Label.tsx +0 -10
  69. package/src/components/dataDisplay/Label/index.ts +0 -1
  70. package/src/components/dataDisplay/Table/Table.tsx +0 -173
  71. package/src/components/dataDisplay/Table/columns.tsx +0 -223
  72. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx +0 -72
  73. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx +0 -91
  74. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx +0 -17
  75. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx +0 -58
  76. package/src/components/dataDisplay/Table/components/DynamicTable/data-table.stories.tsx +0 -118
  77. package/src/components/dataDisplay/Table/components/DynamicTable/index.tsx +0 -136
  78. package/src/components/dataDisplay/Table/components/DynamicTable/types.ts +0 -43
  79. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-column-header.tsx +0 -71
  80. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-faceted-filter.tsx +0 -147
  81. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-pagination.tsx +0 -97
  82. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-row-actions.tsx +0 -78
  83. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-toolbar.tsx +0 -60
  84. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-view-options.tsx +0 -59
  85. package/src/components/dataDisplay/Table/custom/CustomTable/data-table.tsx +0 -145
  86. package/src/components/dataDisplay/Table/custom/CustomTable/data.ts +0 -71
  87. package/src/components/dataDisplay/Table/custom/CustomTable/index.tsx +0 -34
  88. package/src/components/dataDisplay/Table/custom/CustomTable/schema.ts +0 -11
  89. package/src/components/dataDisplay/Table/index.ts +0 -2
  90. package/src/components/dataDisplay/Table/table.stories.tsx +0 -147
  91. package/src/components/dataDisplay/Table/types.ts +0 -15
  92. package/src/components/dataDisplay/Tabs/Tabs.stories.tsx +0 -34
  93. package/src/components/dataDisplay/Tabs/Tabs.tsx +0 -53
  94. package/src/components/dataDisplay/Tabs/index.ts +0 -1
  95. package/src/components/dataDisplay/Text/Text.stories.tsx +0 -66
  96. package/src/components/dataDisplay/Text/Text.tsx +0 -56
  97. package/src/components/dataDisplay/Text/index.ts +0 -1
  98. package/src/components/dataDisplay/index.ts +0 -8
  99. package/src/components/dataInput/Input/components/Input/Input.stories.tsx +0 -99
  100. package/src/components/dataInput/Input/components/Input/InputBase.tsx +0 -50
  101. package/src/components/dataInput/Input/components/Input/__tests__/input.test.tsx +0 -38
  102. package/src/components/dataInput/Input/components/Input/index.tsx +0 -48
  103. package/src/components/dataInput/Input/components/Input/types.ts +0 -15
  104. package/src/components/dataInput/Input/components/InputBase/index.tsx +0 -31
  105. package/src/components/dataInput/Input/components/MaskInput/__tests__/mask-input.test.tsx +0 -77
  106. package/src/components/dataInput/Input/components/MaskInput/index.ts +0 -1
  107. package/src/components/dataInput/Input/components/MaskInput/mask-input.stories.tsx +0 -85
  108. package/src/components/dataInput/Input/components/MaskInput/mask-input.tsx +0 -73
  109. package/src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx +0 -105
  110. package/src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx +0 -100
  111. package/src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx +0 -35
  112. package/src/components/dataInput/Input/components/MultipleInput/MultipleNumberInput.tsx +0 -35
  113. package/src/components/dataInput/Input/components/MultipleInput/__tests__/multiple-input.test.tsx +0 -152
  114. package/src/components/dataInput/Input/components/MultipleInput/index.ts +0 -2
  115. package/src/components/dataInput/Input/components/MultipleInput/multiple-input.stories.tsx +0 -96
  116. package/src/components/dataInput/Input/components/NumberInput/__tests__/number-input.test.tsx +0 -175
  117. package/src/components/dataInput/Input/components/NumberInput/index.ts +0 -1
  118. package/src/components/dataInput/Input/components/NumberInput/number-input.stories.tsx +0 -76
  119. package/src/components/dataInput/Input/components/NumberInput/number-input.tsx +0 -70
  120. package/src/components/dataInput/Input/index.ts +0 -4
  121. package/src/components/dataInput/Select/MultiSelect/MultiSelect.stories.tsx +0 -119
  122. package/src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx +0 -135
  123. package/src/components/dataInput/Select/MultiSelect/index.tsx +0 -75
  124. package/src/components/dataInput/Select/Select.stories.tsx +0 -61
  125. package/src/components/dataInput/Select/Select.tsx +0 -73
  126. package/src/components/dataInput/Select/SelectBase.tsx +0 -58
  127. package/src/components/dataInput/Select/index.ts +0 -2
  128. package/src/components/dataInput/Switch/Switch.stories.tsx +0 -75
  129. package/src/components/dataInput/Switch/Switch.tsx +0 -52
  130. package/src/components/dataInput/Switch/index.ts +0 -1
  131. package/src/components/dataInput/checkbox/Checkbox.tsx +0 -57
  132. package/src/components/dataInput/checkbox/Checkbox_old.tsx +0 -58
  133. package/src/components/dataInput/checkbox/Checkout.stories.tsx +0 -62
  134. package/src/components/dataInput/checkbox/index.ts +0 -1
  135. package/src/components/dataInput/form/Form.tsx +0 -47
  136. package/src/components/dataInput/form/index.ts +0 -3
  137. package/src/components/dataInput/index.ts +0 -5
  138. package/src/components/feedback/ErrorLabel/index.tsx +0 -24
  139. package/src/components/feedback/Spinner/index.ts +0 -1
  140. package/src/components/feedback/Toast/Toast.stories.tsx +0 -45
  141. package/src/components/feedback/Toast/index.ts +0 -2
  142. package/src/components/feedback/index.ts +0 -2
  143. package/src/components/index.ts +0 -6
  144. package/src/components/layout/Crud/components/Table/index.tsx +0 -183
  145. package/src/components/layout/Crud/components/Table/types.ts +0 -15
  146. package/src/components/layout/Crud/crud.stories.tsx +0 -317
  147. package/src/components/layout/Crud/hook/useCrudLayout/index.tsx +0 -94
  148. package/src/components/layout/Crud/hook/useRequest/index.tsx +0 -156
  149. package/src/components/layout/Crud/index.tsx +0 -295
  150. package/src/components/layout/Crud/store/CrudLayoutStore.ts +0 -75
  151. package/src/components/layout/Crud/types.ts +0 -14
  152. package/src/components/layout/Drawer/CustomDrawer/index.tsx +0 -33
  153. package/src/components/layout/Drawer/Drawer.stories.tsx +0 -80
  154. package/src/components/layout/Drawer/index.ts +0 -2
  155. package/src/components/layout/PageLayout/PageLayout.stories.tsx +0 -42
  156. package/src/components/layout/PageLayout/index.tsx +0 -28
  157. package/src/components/layout/Separator/index.ts +0 -1
  158. package/src/components/layout/Sheet/Sheet.stories.tsx +0 -28
  159. package/src/components/layout/Sheet/Sheet.tsx +0 -22
  160. package/src/components/layout/Sheet/index.ts +0 -1
  161. package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -116
  162. package/src/components/layout/Sidebar/Sidebar.tsx +0 -50
  163. package/src/components/layout/Sidebar/components/app-sidebar.tsx +0 -203
  164. package/src/components/layout/Sidebar/components/footer-sidebar.tsx +0 -17
  165. package/src/components/layout/Sidebar/components/header-sidebar.tsx +0 -90
  166. package/src/components/layout/Sidebar/components/menus.tsx +0 -55
  167. package/src/components/layout/Sidebar/components/nav-projects.tsx +0 -88
  168. package/src/components/layout/Sidebar/components/nav-user.tsx +0 -114
  169. package/src/components/layout/Sidebar/components/team-switcher.tsx +0 -85
  170. package/src/components/layout/Sidebar/index.ts +0 -2
  171. package/src/components/layout/Sidebar/provider/index.tsx +0 -51
  172. package/src/components/layout/Tabs/Tabs.tsx +0 -51
  173. package/src/components/layout/Tabs/index.ts +0 -1
  174. package/src/components/layout/Tabs/tabs.stories.tsx +0 -57
  175. package/src/components/layout/index.ts +0 -6
  176. package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +0 -66
  177. package/src/components/navigation/Breadcrumbs/index.ts +0 -2
  178. package/src/components/navigation/index.ts +0 -1
  179. package/src/components/ui/alert-dialog.tsx +0 -141
  180. package/src/components/ui/alert.tsx +0 -59
  181. package/src/components/ui/avatar.tsx +0 -50
  182. package/src/components/ui/badge.tsx +0 -40
  183. package/src/components/ui/breadcrumb.tsx +0 -115
  184. package/src/components/ui/button.tsx +0 -57
  185. package/src/components/ui/card.tsx +0 -83
  186. package/src/components/ui/checkbox.tsx +0 -34
  187. package/src/components/ui/collapsible.tsx +0 -11
  188. package/src/components/ui/command.tsx +0 -153
  189. package/src/components/ui/dialog.tsx +0 -124
  190. package/src/components/ui/drawer.tsx +0 -117
  191. package/src/components/ui/dropdown-menu.tsx +0 -201
  192. package/src/components/ui/form.tsx +0 -179
  193. package/src/components/ui/input.tsx +0 -24
  194. package/src/components/ui/label.tsx +0 -30
  195. package/src/components/ui/popover.tsx +0 -33
  196. package/src/components/ui/select.tsx +0 -161
  197. package/src/components/ui/separator.tsx +0 -31
  198. package/src/components/ui/sheet.tsx +0 -140
  199. package/src/components/ui/sidebar.tsx +0 -763
  200. package/src/components/ui/skeleton.tsx +0 -15
  201. package/src/components/ui/sonner.tsx +0 -31
  202. package/src/components/ui/spinner.tsx +0 -54
  203. package/src/components/ui/switch.tsx +0 -33
  204. package/src/components/ui/table.tsx +0 -120
  205. package/src/components/ui/tabs.tsx +0 -55
  206. package/src/components/ui/toast.tsx +0 -130
  207. package/src/components/ui/toaster.tsx +0 -35
  208. package/src/components/ui/tooltip.tsx +0 -32
  209. package/src/hooks/use-conditional-controller.tsx +0 -35
  210. package/src/hooks/use-mask.tsx +0 -116
  211. package/src/hooks/use-mobile.tsx +0 -19
  212. package/src/hooks/use-toast.ts +0 -191
  213. package/src/index.ts +0 -1
  214. package/src/introduction.mdx +0 -132
  215. package/src/lib/utils.ts +0 -6
  216. package/tailwind.config.ts +0 -83
  217. package/tsconfig.json +0 -27
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🎨 PHSA Design System
1
+ # �� PHSA Design System React
2
2
 
3
3
  A comprehensive React design system built with modern tools and best practices, featuring reusable components, consistent styling, and powerful layout solutions.
4
4
 
@@ -6,289 +6,470 @@ A comprehensive React design system built with modern tools and best practices,
6
6
 
7
7
  🌐 **[View Live Documentation](https://henriques4nti4go.github.io/phsa-design-system/)**
8
8
 
9
- Explore all components interactively in our Storybook documentation, deployed automatically via GitHub Pages.
9
+ Explore all components interactively in our Storybook documentation.
10
10
 
11
11
  ## ✨ Features
12
12
 
13
- - 🧩 **Modular Components** - Reusable React components built with TypeScript
14
- - 🎭 **Storybook Integration** - Interactive component documentation and testing
15
- - 🎨 **Tailwind CSS** - Utility-first CSS framework for rapid styling
16
- - 🔧 **Form Management** - Integrated with React Hook Form for robust form handling
17
- - 📊 **Data Tables** - Advanced table components with TanStack Table
18
- - 🌙 **Theme Support** - Dark/light mode with next-themes
19
- - 🔍 **Type Safety** - Full TypeScript support
20
- - 🧪 **Testing Ready** - Jest and Testing Library setup
21
- - 📱 **Responsive Design** - Mobile-first approach
13
+ - 🧩 **50+ Modular Components** - Complete component library with TypeScript
14
+ - 🎨 **Tailwind CSS Ready** - Pre-styled components with customizable themes
15
+ - 🔧 **Form Management** - Integrated with React Hook Form + Zod validation
16
+ - 📊 **Advanced Data Tables** - Built with TanStack Table
17
+ - 🌙 **Dark/Light Theme** - Built-in theme switching
18
+ - 🔍 **Full TypeScript Support** - Complete type safety
19
+ - 📱 **Responsive & Accessible** - Mobile-first and WCAG compliant
22
20
 
23
- ## 🛠️ Tech Stack
24
-
25
- - **Framework**: Next.js 15
26
- - **UI Library**: Radix UI primitives
27
- - **Styling**: Tailwind CSS
28
- - **State Management**: Zustand
29
- - **Forms**: React Hook Form + Zod validation
30
- - **Data Fetching**: TanStack Query
31
- - **Icons**: Lucide React
32
- - **Documentation**: Storybook
33
- - **Testing**: Jest + Testing Library
34
- - **Language**: TypeScript
35
-
36
- ## 🚀 Getting Started
37
-
38
- ### Prerequisites
39
-
40
- Make sure you have Node.js installed on your machine (version 18 or higher recommended).
41
-
42
- ### Installation
43
-
44
- #### Option 1: Install from npm (Recommended)
45
-
46
- Install the published package directly from npm:
21
+ ## 🚀 Installation
47
22
 
48
23
  ```bash
49
24
  npm install @phsa.tec/design-system-react
50
- # or
51
- yarn add @phsa.tec/design-system-react
52
- # or
53
- pnpm add @phsa.tec/design-system-react
54
25
  ```
55
26
 
56
- View the package on npm: [https://www.npmjs.com/package/@phsa.tec/design-system-react](https://www.npmjs.com/package/@phsa.tec/design-system-react)
27
+ ### Required Peer Dependencies
57
28
 
58
- #### Option 2: Development Setup
29
+ Install the required peer dependencies in your project:
59
30
 
60
- For contributing or local development:
61
-
62
- 1. **Clone the repository**
63
-
64
- ```bash
65
- git clone <repository-url>
66
- cd phsa-design-system
67
- ```
68
-
69
- 2. **Install dependencies**
70
- ```bash
71
- npm install
72
- # or
73
- yarn install
74
- # or
75
- pnpm install
76
- ```
77
-
78
- ### 🏃 Running the Project
79
-
80
- #### Development Server
31
+ ```bash
32
+ npm install react react-dom @radix-ui/react-alert-dialog @radix-ui/react-avatar @radix-ui/react-checkbox @radix-ui/react-collapsible @radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-icons @radix-ui/react-label @radix-ui/react-popover @radix-ui/react-select @radix-ui/react-separator @radix-ui/react-slot @radix-ui/react-switch @radix-ui/react-tabs @radix-ui/react-toast @radix-ui/react-tooltip class-variance-authority clsx lucide-react tailwind-merge
33
+ ```
81
34
 
82
- Start the Next.js development server:
35
+ Or use yarn:
83
36
 
84
37
  ```bash
85
- npm run dev
38
+ yarn add react react-dom @radix-ui/react-alert-dialog @radix-ui/react-avatar @radix-ui/react-checkbox @radix-ui/react-collapsible @radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-icons @radix-ui/react-label @radix-ui/react-popover @radix-ui/react-select @radix-ui/react-separator @radix-ui/react-slot @radix-ui/react-switch @radix-ui/react-tabs @radix-ui/react-toast @radix-ui/react-tooltip class-variance-authority clsx lucide-react tailwind-merge
86
39
  ```
87
40
 
88
- Open [http://localhost:3000](http://localhost:3000) to view the application.
41
+ ## ⚙️ Setup
89
42
 
90
- #### Storybook
43
+ ### 1. Configure Tailwind CSS
91
44
 
92
- Launch Storybook for component development and documentation:
45
+ Add to your `tailwind.config.js`:
93
46
 
94
- ```bash
95
- npm run storybook
47
+ ```javascript
48
+ /** @type {import('tailwindcss').Config} */
49
+ module.exports = {
50
+ content: [
51
+ "./src/**/*.{js,ts,jsx,tsx,mdx}",
52
+ "./node_modules/@phsa.tec/design-system-react/**/*.{js,ts,jsx,tsx}",
53
+ ],
54
+ theme: {
55
+ extend: {
56
+ colors: {
57
+ border: "hsl(var(--border))",
58
+ background: "hsl(var(--background))",
59
+ foreground: "hsl(var(--foreground))",
60
+ primary: {
61
+ DEFAULT: "hsl(var(--primary))",
62
+ foreground: "hsl(var(--primary-foreground))",
63
+ },
64
+ secondary: {
65
+ DEFAULT: "hsl(var(--secondary))",
66
+ foreground: "hsl(var(--secondary-foreground))",
67
+ },
68
+ // Add more theme colors as needed
69
+ },
70
+ },
71
+ },
72
+ plugins: [],
73
+ };
96
74
  ```
97
75
 
98
- Open [http://localhost:6006](http://localhost:6006) to view the component library.
99
-
100
- #### Build for Production
76
+ ### 2. Add CSS Variables
77
+
78
+ Add these CSS variables to your global CSS file (`globals.css` or `index.css`):
79
+
80
+ ```css
81
+ @tailwind base;
82
+ @tailwind components;
83
+ @tailwind utilities;
84
+
85
+ @layer base {
86
+ :root {
87
+ --background: 0 0% 100%;
88
+ --foreground: 222.2 84% 4.9%;
89
+ --card: 0 0% 100%;
90
+ --card-foreground: 222.2 84% 4.9%;
91
+ --popover: 0 0% 100%;
92
+ --popover-foreground: 222.2 84% 4.9%;
93
+ --primary: 222.2 47.4% 11.2%;
94
+ --primary-foreground: 210 40% 98%;
95
+ --secondary: 210 40% 96%;
96
+ --secondary-foreground: 222.2 84% 4.9%;
97
+ --muted: 210 40% 96%;
98
+ --muted-foreground: 215.4 16.3% 46.9%;
99
+ --accent: 210 40% 96%;
100
+ --accent-foreground: 222.2 84% 4.9%;
101
+ --destructive: 0 84.2% 60.2%;
102
+ --destructive-foreground: 210 40% 98%;
103
+ --border: 214.3 31.8% 91.4%;
104
+ --input: 214.3 31.8% 91.4%;
105
+ --ring: 222.2 84% 4.9%;
106
+ --radius: 0.5rem;
107
+ }
101
108
 
102
- ```bash
103
- npm run build
104
- npm run start
109
+ .dark {
110
+ --background: 222.2 84% 4.9%;
111
+ --foreground: 210 40% 98%;
112
+ --card: 222.2 84% 4.9%;
113
+ --card-foreground: 210 40% 98%;
114
+ --popover: 222.2 84% 4.9%;
115
+ --popover-foreground: 210 40% 98%;
116
+ --primary: 210 40% 98%;
117
+ --primary-foreground: 222.2 47.4% 11.2%;
118
+ --secondary: 217.2 32.6% 17.5%;
119
+ --secondary-foreground: 210 40% 98%;
120
+ --muted: 217.2 32.6% 17.5%;
121
+ --muted-foreground: 215 20.2% 65.1%;
122
+ --accent: 217.2 32.6% 17.5%;
123
+ --accent-foreground: 210 40% 98%;
124
+ --destructive: 0 62.8% 30.6%;
125
+ --destructive-foreground: 210 40% 98%;
126
+ --border: 217.2 32.6% 17.5%;
127
+ --input: 217.2 32.6% 17.5%;
128
+ --ring: 212.7 26.8% 83.9%;
129
+ }
130
+ }
105
131
  ```
106
132
 
107
- #### Testing
133
+ ### 3. Theme Provider (Optional)
108
134
 
109
- ```bash
110
- npm run test
111
- ```
135
+ For dark/light mode support, wrap your app with the theme provider:
112
136
 
113
- #### Linting
137
+ ```tsx
138
+ import { ThemeProvider } from "next-themes";
114
139
 
115
- ```bash
116
- npm run lint
140
+ function App() {
141
+ return (
142
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
143
+ {/* Your app components */}
144
+ </ThemeProvider>
145
+ );
146
+ }
117
147
  ```
118
148
 
119
- ## 📁 Project Structure
149
+ ## 🎯 Usage Examples
120
150
 
121
- ```
122
- src/
123
- ├── components/ # Reusable components
124
- │ ├── ui/ # Base UI components
125
- │ ├── layout/ # Layout components (Crud, etc.)
126
- │ └── dataInput/ # Form input components
127
- ├── hooks/ # Custom React hooks
128
- ├── lib/ # Utility functions
129
- ├── styles/ # Global styles
130
- └── types/ # TypeScript type definitions
151
+ ### Basic Components
152
+
153
+ ```tsx
154
+ import {
155
+ Button,
156
+ Input,
157
+ Badge,
158
+ Card,
159
+ CardContent,
160
+ CardHeader,
161
+ CardTitle,
162
+ } from "@phsa.tec/design-system-react";
163
+
164
+ function MyComponent() {
165
+ return (
166
+ <Card>
167
+ <CardHeader>
168
+ <CardTitle>Welcome</CardTitle>
169
+ </CardHeader>
170
+ <CardContent>
171
+ <div className="space-y-4">
172
+ <Input placeholder="Enter your name" />
173
+ <div className="flex gap-2">
174
+ <Button>Primary Action</Button>
175
+ <Button variant="secondary">Secondary</Button>
176
+ </div>
177
+ <Badge>New Feature</Badge>
178
+ </div>
179
+ </CardContent>
180
+ </Card>
181
+ );
182
+ }
131
183
  ```
132
184
 
133
- This README provides a comprehensive overview of your design system project, including:
185
+ ### Form Example with Validation
134
186
 
135
- 1. **Clear project description** with emoji icons for visual appeal
136
- 2. **Feature highlights** showcasing the main capabilities
137
- 3. **Complete tech stack** listing all major dependencies
138
- 4. **Step-by-step setup instructions** for new developers
139
- 5. **Project structure** to help navigate the codebase
140
- 6. **Component documentation** explaining key features
141
- 7. **Theming and configuration** guides
142
- 8. **Contributing guidelines** for team collaboration
143
- 9. **Scripts reference** for quick command lookup
144
- 10. **Professional formatting** with proper sections and styling
187
+ ```tsx
188
+ import {
189
+ Form,
190
+ FormControl,
191
+ FormField,
192
+ FormItem,
193
+ FormLabel,
194
+ FormMessage,
195
+ Input,
196
+ Button,
197
+ Select,
198
+ SelectContent,
199
+ SelectItem,
200
+ SelectTrigger,
201
+ SelectValue,
202
+ } from "@phsa.tec/design-system-react";
203
+ import { useForm } from "react-hook-form";
204
+ import { zodResolver } from "@hookform/resolvers/zod";
205
+ import * as z from "zod";
206
+
207
+ const formSchema = z.object({
208
+ name: z.string().min(2, "Name must be at least 2 characters"),
209
+ email: z.string().email("Invalid email address"),
210
+ role: z.string().min(1, "Please select a role"),
211
+ });
212
+
213
+ function UserForm() {
214
+ const form = useForm<z.infer<typeof formSchema>>({
215
+ resolver: zodResolver(formSchema),
216
+ defaultValues: {
217
+ name: "",
218
+ email: "",
219
+ role: "",
220
+ },
221
+ });
145
222
 
146
- The README is written in English as requested and provides everything a developer would need to understand, set up, and contribute to your design system project.
223
+ function onSubmit(values: z.infer<typeof formSchema>) {
224
+ console.log(values);
225
+ }
147
226
 
148
- ## 🧩 Key Components
227
+ return (
228
+ <Form {...form}>
229
+ <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
230
+ <FormField
231
+ control={form.control}
232
+ name="name"
233
+ render={({ field }) => (
234
+ <FormItem>
235
+ <FormLabel>Name</FormLabel>
236
+ <FormControl>
237
+ <Input placeholder="John Doe" {...field} />
238
+ </FormControl>
239
+ <FormMessage />
240
+ </FormItem>
241
+ )}
242
+ />
243
+
244
+ <FormField
245
+ control={form.control}
246
+ name="email"
247
+ render={({ field }) => (
248
+ <FormItem>
249
+ <FormLabel>Email</FormLabel>
250
+ <FormControl>
251
+ <Input placeholder="john@example.com" {...field} />
252
+ </FormControl>
253
+ <FormMessage />
254
+ </FormItem>
255
+ )}
256
+ />
257
+
258
+ <FormField
259
+ control={form.control}
260
+ name="role"
261
+ render={({ field }) => (
262
+ <FormItem>
263
+ <FormLabel>Role</FormLabel>
264
+ <Select onValueChange={field.onChange} defaultValue={field.value}>
265
+ <FormControl>
266
+ <SelectTrigger>
267
+ <SelectValue placeholder="Select a role" />
268
+ </SelectTrigger>
269
+ </FormControl>
270
+ <SelectContent>
271
+ <SelectItem value="admin">Admin</SelectItem>
272
+ <SelectItem value="user">User</SelectItem>
273
+ <SelectItem value="viewer">Viewer</SelectItem>
274
+ </SelectContent>
275
+ </Select>
276
+ <FormMessage />
277
+ </FormItem>
278
+ )}
279
+ />
280
+
281
+ <Button type="submit">Submit</Button>
282
+ </form>
283
+ </Form>
284
+ );
285
+ }
286
+ ```
149
287
 
150
- ### Layout Components
288
+ ### Data Table Example
151
289
 
152
- - **CrudLayout** - Complete CRUD operations layout with forms, tables, and modals
153
- - **DataTable** - Advanced table component with sorting, filtering, and pagination
290
+ ```tsx
291
+ import { DataTable } from "@phsa.tec/design-system-react";
292
+ import { ColumnDef } from "@tanstack/react-table";
293
+
294
+ type User = {
295
+ id: string;
296
+ name: string;
297
+ email: string;
298
+ role: string;
299
+ };
154
300
 
155
- ### Form Components
301
+ const columns: ColumnDef<User>[] = [
302
+ {
303
+ accessorKey: "name",
304
+ header: "Name",
305
+ },
306
+ {
307
+ accessorKey: "email",
308
+ header: "Email",
309
+ },
310
+ {
311
+ accessorKey: "role",
312
+ header: "Role",
313
+ },
314
+ ];
156
315
 
157
- - **Input** - Flexible input component with validation
158
- - **Button** - Customizable button with variants
159
- - **Select** - Dropdown selection component
160
- - **Form controls** - Checkbox, Switch, and more
316
+ function UsersTable() {
317
+ const data: User[] = [
318
+ { id: "1", name: "John Doe", email: "john@example.com", role: "Admin" },
319
+ { id: "2", name: "Jane Smith", email: "jane@example.com", role: "User" },
320
+ ];
161
321
 
162
- ### UI Components
322
+ return (
323
+ <DataTable
324
+ columns={columns}
325
+ data={data}
326
+ searchKey="name"
327
+ searchPlaceholder="Search users..."
328
+ />
329
+ );
330
+ }
331
+ ```
163
332
 
164
- - **Dialog/Modal** - Accessible modal components
165
- - **Toast** - Notification system
166
- - **Avatar** - User avatar component
167
- - **Tooltip** - Contextual help tooltips
333
+ ### Dialog/Modal Example
168
334
 
169
- ## 📚 Documentation
335
+ ```tsx
336
+ import {
337
+ Dialog,
338
+ DialogContent,
339
+ DialogDescription,
340
+ DialogHeader,
341
+ DialogTitle,
342
+ DialogTrigger,
343
+ Button,
344
+ } from "@phsa.tec/design-system-react";
345
+
346
+ function MyDialog() {
347
+ return (
348
+ <Dialog>
349
+ <DialogTrigger asChild>
350
+ <Button>Open Dialog</Button>
351
+ </DialogTrigger>
352
+ <DialogContent>
353
+ <DialogHeader>
354
+ <DialogTitle>Confirm Action</DialogTitle>
355
+ <DialogDescription>
356
+ This action cannot be undone. Are you sure you want to continue?
357
+ </DialogDescription>
358
+ </DialogHeader>
359
+ <div className="flex justify-end space-x-2">
360
+ <Button variant="outline">Cancel</Button>
361
+ <Button>Confirm</Button>
362
+ </div>
363
+ </DialogContent>
364
+ </Dialog>
365
+ );
366
+ }
367
+ ```
170
368
 
171
- ### Live Documentation
369
+ ## 🧩 Available Components
172
370
 
173
- Visit our live Storybook documentation: **[https://henriques4nti4go.github.io/phsa-design-system/](https://henriques4nti4go.github.io/phsa-design-system/)**
371
+ ### Layout
174
372
 
175
- ### Local Development
373
+ - `Card`, `CardContent`, `CardHeader`, `CardTitle`, `CardDescription`
374
+ - `Sheet`, `SheetContent`, `SheetHeader`, `SheetTitle`
375
+ - `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`
376
+ - `Separator`
176
377
 
177
- Run Storybook locally to explore all available components:
378
+ ### Data Display
178
379
 
179
- ```bash
180
- npm run storybook
181
- ```
380
+ - `DataTable` - Advanced table with sorting, filtering, pagination
381
+ - `Badge` - Status indicators
382
+ - `Avatar`, `AvatarImage`, `AvatarFallback`
383
+ - `Tooltip`, `TooltipContent`, `TooltipProvider`, `TooltipTrigger`
182
384
 
183
- Each component includes:
385
+ ### Data Input
184
386
 
185
- - 📖 **Usage examples**
186
- - ⚙️ **Props documentation**
187
- - 🎮 **Interactive controls**
188
- - 💡 **Best practices**
387
+ - `Input` - Text input with validation
388
+ - `Button` - Customizable button component
389
+ - `Select`, `SelectContent`, `SelectItem`, `SelectTrigger`, `SelectValue`
390
+ - `Checkbox` - Checkbox input
391
+ - `Switch` - Toggle switch
392
+ - `Form`, `FormControl`, `FormField`, `FormItem`, `FormLabel`, `FormMessage`
189
393
 
190
- ## 🎨 Theming
394
+ ### Feedback
191
395
 
192
- The design system supports customizable themes through Tailwind CSS and next-themes:
396
+ - `Dialog`, `DialogContent`, `DialogHeader`, `DialogTitle`, `DialogTrigger`
397
+ - `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`
398
+ - `Toast` - Notification system
399
+ - `Alert`, `AlertDescription`, `AlertTitle`
193
400
 
194
- ```tsx
195
- import { ThemeProvider } from "next-themes";
401
+ ### Navigation
196
402
 
197
- function App() {
198
- return (
199
- <ThemeProvider attribute="class" defaultTheme="system">
200
- {/* Your app */}
201
- </ThemeProvider>
202
- );
203
- }
204
- ```
403
+ - `DropdownMenu`, `DropdownMenuContent`, `DropdownMenuItem`
404
+ - `Command`, `CommandDialog`, `CommandInput`, `CommandList`
205
405
 
206
- ## 🔧 Configuration
406
+ ## 🎨 Customization
207
407
 
208
- ### Tailwind CSS
408
+ ### Component Variants
209
409
 
210
- Customize the design tokens in `tailwind.config.js`:
410
+ Most components support multiple variants:
211
411
 
212
- ```javascript
213
- module.exports = {
214
- theme: {
215
- extend: {
216
- colors: {
217
- // Your custom colors
218
- },
219
- spacing: {
220
- // Your custom spacing
221
- },
222
- },
223
- },
224
- };
412
+ ```tsx
413
+ // Button variants
414
+ <Button variant="default">Default</Button>
415
+ <Button variant="destructive">Delete</Button>
416
+ <Button variant="outline">Outline</Button>
417
+ <Button variant="secondary">Secondary</Button>
418
+ <Button variant="ghost">Ghost</Button>
419
+ <Button variant="link">Link</Button>
420
+
421
+ // Button sizes
422
+ <Button size="sm">Small</Button>
423
+ <Button size="default">Default</Button>
424
+ <Button size="lg">Large</Button>
225
425
  ```
226
426
 
227
- ### Component Variants
427
+ ### Custom Styling
228
428
 
229
- Components use `class-variance-authority` for consistent variant management:
429
+ Components accept custom className props:
230
430
 
231
431
  ```tsx
232
- const buttonVariants = cva(
233
- "inline-flex items-center justify-center rounded-md",
234
- {
235
- variants: {
236
- variant: {
237
- default: "bg-primary text-primary-foreground",
238
- secondary: "bg-secondary text-secondary-foreground",
239
- },
240
- },
241
- }
242
- );
432
+ <Button className="bg-purple-500 hover:bg-purple-600">
433
+ Custom Purple Button
434
+ </Button>
243
435
  ```
244
436
 
245
- ## 🤝 Contributing
437
+ ## 🔧 TypeScript Support
246
438
 
247
- 1. Fork the repository
248
- 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
249
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
250
- 4. Push to the branch (`git push origin feature/amazing-feature`)
251
- 5. Open a Pull Request
439
+ All components are fully typed with TypeScript:
252
440
 
253
- ### Development Guidelines
441
+ ```tsx
442
+ import type { ButtonProps } from "@phsa.tec/design-system-react";
254
443
 
255
- - Follow TypeScript best practices
256
- - Add Storybook stories for new components
257
- - Include tests for complex logic
258
- - Follow the existing code style
259
- - Update documentation as needed
444
+ interface CustomButtonProps extends ButtonProps {
445
+ isLoading?: boolean;
446
+ }
260
447
 
261
- ## 📝 Scripts Reference
448
+ function CustomButton({ isLoading, children, ...props }: CustomButtonProps) {
449
+ return (
450
+ <Button disabled={isLoading} {...props}>
451
+ {isLoading ? "Loading..." : children}
452
+ </Button>
453
+ );
454
+ }
455
+ ```
262
456
 
263
- | Command | Description |
264
- | ------------------------- | ------------------------ |
265
- | `npm run dev` | Start development server |
266
- | `npm run build` | Build for production |
267
- | `npm run start` | Start production server |
268
- | `npm run lint` | Run ESLint |
269
- | `npm run storybook` | Start Storybook |
270
- | `npm run build-storybook` | Build Storybook |
271
- | `npm run test` | Run tests |
457
+ ## 📚 Documentation & Storybook
272
458
 
273
- ## 📦 Publishing
459
+ - **Live Documentation**: [https://henriques4nti4go.github.io/phsa-design-system/](https://henriques4nti4go.github.io/phsa-design-system/)
460
+ - **Interactive Examples**: All components include interactive Storybook stories
461
+ - **Props Documentation**: Complete API reference for all components
274
462
 
275
- This package is configured for publishing to npm:
463
+ ## 🤝 Support & Contributing
276
464
 
277
- ```bash
278
- npm publish
279
- ```
465
+ - **Issues**: [GitHub Issues](https://github.com/henriques4nti4go/phsa-design-system/issues)
466
+ - **Repository**: [GitHub](https://github.com/henriques4nti4go/phsa-design-system)
467
+ - **NPM Package**: [@phsa.tec/design-system-react](https://www.npmjs.com/package/@phsa.tec/design-system-react)
280
468
 
281
469
  ## 📄 License
282
470
 
283
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
284
-
285
- ## 🙏 Acknowledgments
286
-
287
- - [Radix UI](https://radix-ui.com/) for accessible component primitives
288
- - [Tailwind CSS](https://tailwindcss.com/) for the utility-first CSS framework
289
- - [Shadcn/ui](https://ui.shadcn.com/) for component inspiration
290
- - [Storybook](https://storybook.js.org/) for component documentation
471
+ MIT License - see the [LICENSE](LICENSE) file for details.
291
472
 
292
473
  ---
293
474
 
294
- Built with ❤️ by the PHSA team
475
+ Built with ❤️ using React, TypeScript, Tailwind CSS, and Radix UI