arxatec-ui 0.1.0 → 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.
Files changed (2) hide show
  1. package/README.md +123 -60
  2. package/package.json +18 -6
package/README.md CHANGED
@@ -1,73 +1,136 @@
1
- # React + TypeScript + Vite
1
+ # arxatec-ui
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ React component kit for **Arxatec** products: primitives built on **Radix UI**, styling with **Tailwind CSS v4**, animations, and ready-made pieces for forms, data, maps, and more.
4
4
 
5
- Currently, two official plugins are available:
5
+ ## Requirements
6
6
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
7
+ - **React** 18 or 19 (`react` and `react-dom` are *peer dependencies*).
8
+ - A bundler that supports **ESM** (recommended: **Vite**).
9
+ - **Tailwind CSS v4** and the **`@tailwindcss/vite`** plugin (or an equivalent pipeline that processes the library stylesheet).
9
10
 
10
- ## React Compiler
11
+ ## Installation
11
12
 
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
+ ```bash
14
+ npm install arxatec-ui
15
+ ```
13
16
 
14
- ## Expanding the ESLint configuration
17
+ Make sure React is installed in your app:
15
18
 
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
19
+ ```bash
20
+ npm install react react-dom
21
+ ```
17
22
 
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
23
+ ## Global styles
25
24
 
26
- // Remove tseslint.configs.recommended and replace with this
27
- tseslint.configs.recommendedTypeChecked,
28
- // Alternatively, use this for stricter rules
29
- tseslint.configs.strictTypeChecked,
30
- // Optionally, add this for stylistic rules
31
- tseslint.configs.stylisticTypeChecked,
25
+ The package exposes a single stylesheet (theme tokens, Tailwind, shadcn-style utilities):
32
26
 
33
- // Other configs...
34
- ],
35
- languageOptions: {
36
- parserOptions: {
37
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
- tsconfigRootDir: import.meta.dirname,
39
- },
40
- // other options...
41
- },
42
- },
43
- ])
27
+ ```ts
28
+ // e.g. in main.tsx or App.tsx
29
+ import "arxatec-ui/styles.css";
44
30
  ```
45
31
 
46
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
-
48
- ```js
49
- // eslint.config.js
50
- import reactX from 'eslint-plugin-react-x'
51
- import reactDom from 'eslint-plugin-react-dom'
52
-
53
- export default defineConfig([
54
- globalIgnores(['dist']),
55
- {
56
- files: ['**/*.{ts,tsx}'],
57
- extends: [
58
- // Other configs...
59
- // Enable lint rules for React
60
- reactX.configs['recommended-typescript'],
61
- // Enable lint rules for React DOM
62
- reactDom.configs.recommended,
63
- ],
64
- languageOptions: {
65
- parserOptions: {
66
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
- tsconfigRootDir: import.meta.dirname,
68
- },
69
- // other options...
70
- },
71
- },
72
- ])
32
+ That CSS uses Tailwind v4 features (`@import "tailwindcss"`, `@theme`, etc.). Your build **must process** it with Tailwind (serving the raw file without compiling is not enough).
33
+
34
+ ### Vite + Tailwind v4
35
+
36
+ 1. Install Tailwind and the official Vite plugin:
37
+
38
+ ```bash
39
+ npm install tailwindcss @tailwindcss/vite
40
+ ```
41
+
42
+ 2. In `vite.config.ts`:
43
+
44
+ ```ts
45
+ import tailwindcss from "@tailwindcss/vite";
46
+ import { defineConfig } from "vite";
47
+
48
+ export default defineConfig({
49
+ plugins: [tailwindcss()],
50
+ });
51
+ ```
52
+
53
+ 3. If production builds **drop classes** that only appear inside `node_modules/arxatec-ui`, point Tailwind at the library’s compiled JS, for example in your entry CSS (Tailwind v4):
54
+
55
+ ```css
56
+ @source "../../node_modules/arxatec-ui/dist/**/*.js";
57
+ ```
58
+
59
+ Adjust the path relative to your CSS file.
60
+
61
+ ### Dark mode
62
+
63
+ The theme expects a **`.dark`** ancestor (e.g. `className="dark"` on `<html>`).
64
+
65
+ ## Basic usage
66
+
67
+ ```tsx
68
+ import { Button, Card, CardHeader, CardTitle, CardContent } from "arxatec-ui";
69
+
70
+ export function Example() {
71
+ return (
72
+ <Card>
73
+ <CardHeader>
74
+ <CardTitle>Hello</CardTitle>
75
+ </CardHeader>
76
+ <CardContent>
77
+ <Button>Action</Button>
78
+ </CardContent>
79
+ </Card>
80
+ );
81
+ }
73
82
  ```
83
+
84
+ Patterns follow **shadcn**-style APIs (compound components with named exports).
85
+
86
+ ## Package exports
87
+
88
+ ### Components (overview)
89
+
90
+ - **Forms & text:** `Button`, `Input`, `Textarea`, `Label`, `Checkbox`, `RadioGroup`, `Select`, `Slider`, `Toggle`, `InputOTP`, `FileDropZone`, `LocationInput`, `DateRangePicker`, `Calendar`, `AsyncSelect`, and more.
91
+ - **Surfaces & navigation:** `Card`, `Dialog`, `Sheet`, `Drawer`, `Popover`, `Tooltip`, `DropdownMenu`, `ContextMenu`, `Tabs`, `Breadcrumb`, `Pagination`, `PaginationController`, `Sidebar`, `Command`, `Collapsible`, and more.
92
+ - **Data & feedback:** `Table`, `Badge`, `Skeleton`, `Progress`, `StatusMessage`, `AsyncBoundary`, `AsyncCommandList`, `Chart`, `Carousel`, and more.
93
+ - **Maps:** `MapView`, `MapPicker`.
94
+ - **Extras:** `Toaster` (Sonner), `IconPicker`, `EmojiPicker`, brand icons, animated icons, etc.
95
+
96
+ The full list matches the `export *` entries in [`src/index.ts`](./src/index.ts).
97
+
98
+ ### Hooks
99
+
100
+ - **`useDebounce`**
101
+
102
+ ### Types
103
+
104
+ - **`PaginationState`**: `{ page, limit, total, total_pages }` (useful with `PaginationController`).
105
+
106
+ ### Utilities
107
+
108
+ - **`cn`**: class merging (`clsx` + `tailwind-merge`).
109
+ - Image crop helpers for `ImageCropDialog`.
110
+ - **`classNameControl`**: optional **Storybook** control metadata.
111
+
112
+ ## Toasts (Sonner)
113
+
114
+ Render **`Toaster`** once near the app root and call `toast(...)` per the **sonner** docs.
115
+
116
+ ## Maps (Leaflet)
117
+
118
+ ```ts
119
+ import "leaflet/dist/leaflet.css";
120
+ ```
121
+
122
+ ## Developing this repo
123
+
124
+ | Command | Description |
125
+ |--------|-------------|
126
+ | `npm run dev` | Vite playground (style guide). |
127
+ | `npm run storybook` | Storybook on port 6006. |
128
+ | `npm run build:lib` | Build `dist/` for npm. |
129
+ | `npm run build` | Playground production build. |
130
+ | `npm run lint` | ESLint. |
131
+
132
+ Publishing to npm requires **2FA**; use `npm publish --otp=...` when prompted.
133
+
134
+ ## License
135
+
136
+ MIT. See [LICENSE](./LICENSE).
package/package.json CHANGED
@@ -1,15 +1,26 @@
1
1
  {
2
2
  "name": "arxatec-ui",
3
- "version": "0.1.0",
4
- "description": "Kit de componentes React (Tailwind v4, Radix) para productos Arxatec.",
3
+ "version": "0.1.1",
4
+ "description": "React component library for building Arxatec product UIs—built on established ecosystem libraries for a consistent, efficient workflow. More at https://arxatec.net.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "keywords": [
8
8
  "react",
9
- "components",
9
+ "react-components",
10
10
  "ui",
11
- "tailwind",
11
+ "design-system",
12
+ "component-library",
13
+ "tailwindcss",
14
+ "tailwind-v4",
15
+ "shadcn",
16
+ "shadcn-ui",
12
17
  "radix",
18
+ "radix-ui",
19
+ "accessible",
20
+ "typescript",
21
+ "esm",
22
+ "lucide-react",
23
+ "cva",
13
24
  "arxatec"
14
25
  ],
15
26
  "repository": {
@@ -19,7 +30,7 @@
19
30
  "bugs": {
20
31
  "url": "https://github.com/arxatec-engine/arxatec-ui/issues"
21
32
  },
22
- "homepage": "https://github.com/arxatec-engine/arxatec-ui#readme",
33
+ "homepage": "https://arxatec.net",
23
34
  "sideEffects": [
24
35
  "**/*.css"
25
36
  ],
@@ -35,7 +46,8 @@
35
46
  "module": "./dist/index.js",
36
47
  "files": [
37
48
  "dist",
38
- "LICENSE"
49
+ "LICENSE",
50
+ "README.md"
39
51
  ],
40
52
  "publishConfig": {
41
53
  "access": "public"