@lincros-ui/components 0.1.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.
package/README.md ADDED
@@ -0,0 +1,270 @@
1
+ # LaisaUI Components
2
+
3
+ A comprehensive React component library for the Torre Frontend project, built on top of shadcn/ui and Radix UI primitives.
4
+
5
+ ## Overview
6
+
7
+ LaisaUI contains all UI components, hooks, utilities, and styles extracted from the Torre Frontend project. This package is designed to be used as a shared component library across Torre projects.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @lincros-ui/components
13
+ ```
14
+
15
+ ## Peer Dependencies
16
+
17
+ This package requires the following peer dependencies:
18
+
19
+ ```json
20
+ {
21
+ "react": "^18.3.1",
22
+ "react-dom": "^18.3.1"
23
+ }
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ### Importing Components
29
+
30
+ ```tsx
31
+ import { Button, Card, Input } from '@lincros-ui/components';
32
+
33
+ function MyComponent() {
34
+ return (
35
+ <Card>
36
+ <Input placeholder="Enter text" />
37
+ <Button>Submit</Button>
38
+ </Card>
39
+ );
40
+ }
41
+ ```
42
+
43
+ ### Importing Styles
44
+
45
+ ```tsx
46
+ import '@lincros-ui/components/styles';
47
+ ```
48
+
49
+ ### Using Hooks
50
+
51
+ ```tsx
52
+ import { useToast, useTenant } from '@lincros-ui/components';
53
+
54
+ function MyComponent() {
55
+ const { toast } = useToast();
56
+ const { currentTenant } = useTenant();
57
+
58
+ return <div>...</div>;
59
+ }
60
+ ```
61
+
62
+ ## Package Structure
63
+
64
+ ```
65
+ dist/
66
+ ├── index.js # Main component exports
67
+ ├── index.js.map # Source maps
68
+ ├── styles/
69
+ │ ├── index.js # Design tokens and styles
70
+ │ └── *.css # CSS files
71
+ ```
72
+
73
+ ## Components Included
74
+
75
+ ### UI Components (shadcn/ui based)
76
+ - Accordion, Alert, AlertDialog
77
+ - Avatar, Badge, Button
78
+ - Card, Carousel, Chart
79
+ - Checkbox, Collapsible, Command
80
+ - Dialog, Drawer, DropdownMenu
81
+ - Form, HoverCard, Input
82
+ - Label, Menubar, NavigationMenu
83
+ - Pagination, Popover, Progress
84
+ - RadioGroup, ScrollArea, Select
85
+ - Separator, Sheet, Sidebar
86
+ - Skeleton, Slider, Switch
87
+ - Table, Tabs, Textarea
88
+ - Toast, Toggle, Tooltip
89
+ - And more...
90
+
91
+ ### Business Components
92
+ - Flow Editor and Flow Execution components
93
+ - Webhook management components
94
+ - WhatsApp integration components
95
+ - Motorista (Driver) management
96
+ - Credential management
97
+ - Authentication components
98
+
99
+ ### Hooks
100
+ - useAuth, useAuthContext
101
+ - useTenant, usePermissions
102
+ - useFlows, useFlowEditor
103
+ - useWhatsApp, useWhatsAppTriggers
104
+ - And many more...
105
+
106
+ ### Utilities
107
+ - `cn()` - Class name merger (clsx + tailwind-merge)
108
+ - Date formatters
109
+ - String formatters
110
+ - Node styling utilities
111
+ - Webhook utilities
112
+
113
+ ## Important Notes
114
+
115
+ ### External Dependencies
116
+
117
+ This library has external dependencies on Torre-specific business logic modules. When using this package, you must provide these implementations in your consuming project:
118
+
119
+ - `@/domain/*` - Domain entities
120
+ - `@/application/*` - Application use cases
121
+ - `@/infrastructure/*` - Infrastructure repositories
122
+ - `@/services/*` - API services
123
+ - `@/lib/*` - Utility libraries
124
+ - Contexts (TenantContext, EdgeLabelContext, SSOContext, AuthProvider)
125
+ - Stores (execution store)
126
+ - Types (ErrorType)
127
+ - Constants (routes)
128
+
129
+ These are marked as external in the build and will not be bundled with the library.
130
+
131
+ ### TypeScript
132
+
133
+ Type definitions are not included in the current version due to the external dependencies architecture. You can use the components with TypeScript by configuring path aliases in your project's `tsconfig.json`:
134
+
135
+ ```json
136
+ {
137
+ "compilerOptions": {
138
+ "paths": {
139
+ "@/*": ["./src/*"],
140
+ "@lincros-ui/components": ["./node_modules/@lincros-ui/components/dist"]
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ ### Tailwind CSS Configuration
147
+
148
+ To use the components with proper styling, you need to:
149
+
150
+ 1. **Include the library in your Tailwind content paths:**
151
+
152
+ ```js
153
+ // tailwind.config.js
154
+ module.exports = {
155
+ content: [
156
+ "./src/**/*.{js,ts,jsx,tsx}",
157
+ "./node_modules/@lincros-ui/components/**/*.{js,jsx}"
158
+ ],
159
+ // ... rest of config
160
+ }
161
+ ```
162
+
163
+ 2. **Import design tokens (optional):**
164
+
165
+ ```ts
166
+ import { acordeDesignTokens } from '@lincros-ui/components/styles';
167
+
168
+ // Use in your Tailwind config
169
+ export default {
170
+ theme: {
171
+ extend: {
172
+ colors: acordeDesignTokens.colors,
173
+ fontSize: acordeDesignTokens.typography.fontSize,
174
+ // ... other tokens
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ 3. **Import CSS variables:**
181
+
182
+ Make sure your project includes the necessary CSS variables for theme colors. See the Torre Frontend project's global.css for reference.
183
+
184
+ ## Development
185
+
186
+ ### Building
187
+
188
+ ```bash
189
+ npm run build
190
+ ```
191
+
192
+ ### Development Mode
193
+
194
+ ```bash
195
+ npm run dev
196
+ ```
197
+
198
+ This will watch for changes and rebuild automatically.
199
+
200
+ ### Type Checking
201
+
202
+ ```bash
203
+ npm run typecheck
204
+ ```
205
+
206
+ ### Linting
207
+
208
+ ```bash
209
+ npm run lint
210
+ ```
211
+
212
+ ## Publishing
213
+
214
+ Before publishing to NPM:
215
+
216
+ 1. Update the version in `package.json`
217
+ 2. Build the package: `npm run build`
218
+ 3. Publish: `npm publish`
219
+
220
+ For scoped packages:
221
+ ```bash
222
+ npm publish --access public
223
+ ```
224
+
225
+ ## Using Locally in Torre Frontend
226
+
227
+ To use this package locally before publishing:
228
+
229
+ 1. **Build the package:**
230
+ ```bash
231
+ cd /home/tom/git/LaisaUI
232
+ npm run build
233
+ ```
234
+
235
+ 2. **Link the package:**
236
+ ```bash
237
+ cd /home/tom/git/LaisaUI
238
+ npm link
239
+ ```
240
+
241
+ 3. **Link in Torre Frontend:**
242
+ ```bash
243
+ cd /home/tom/git/torre_frontend
244
+ npm link @lincros-ui/components
245
+ ```
246
+
247
+ 4. **Update imports in Torre Frontend:**
248
+ ```tsx
249
+ // Before
250
+ import { Button } from '@/presentation/components/ui/button';
251
+
252
+ // After
253
+ import { Button } from '@lincros-ui/components';
254
+ ```
255
+
256
+ 5. **Update Tailwind config:**
257
+ ```js
258
+ content: [
259
+ "./src/**/*.{js,ts,jsx,tsx}",
260
+ "./node_modules/@lincros-ui/components/**/*.{js,jsx}"
261
+ ]
262
+ ```
263
+
264
+ ## License
265
+
266
+ MIT
267
+
268
+ ## Contributing
269
+
270
+ This package is maintained as part of the Torre Frontend project. For issues or contributions, please refer to the main project repository.