opsfuse-ui 0.1.24 → 0.1.26
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/.claude/skills/brief-to-tasks/SKILL.md +74 -74
- package/.claude/skills/design-brief/SKILL.md +120 -120
- package/.claude/skills/design-flow/SKILL.md +124 -124
- package/.claude/skills/design-review/SKILL.md +249 -249
- package/.claude/skills/design-tokens/SKILL.md +198 -198
- package/.claude/skills/frontend-design/SKILL.md +144 -144
- package/.claude/skills/grill-me/SKILL.md +21 -21
- package/.claude/skills/information-architecture/SKILL.md +111 -111
- package/.claude/skills/opsfuse-color-theme/SKILL.md +257 -257
- package/.claude/skills/opsfuse-components/SKILL.md +1494 -1494
- package/.claude/skills/opsfuse-setup/SKILL.md +169 -169
- package/.claude/skills/opsfuse-ui-consistency/SKILL.md +169 -169
- package/LICENSE +17 -17
- package/README.md +214 -214
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/core.js +2 -2
- package/dist/extended.js +2 -2
- package/dist/index.js +3 -3
- package/dist/{input-group-DsOYhBRV.js → input-group-BFEABA03.js} +16 -0
- package/dist/{input-otp-B3Ht2pOf.js → input-otp-kzcY4B1V.js} +1 -1
- package/dist/style.css +256 -253
- package/dist/{toggle-group-BLGOVp8G.js → toggle-group-qup4FMjO.js} +1 -1
- package/package.json +151 -151
- package/scripts/postinstall.mjs +66 -66
- package/scripts/unwrap-css-layers.mjs +36 -36
- package/theme.css +253 -250
- package/.claude/settings.local.json +0 -8
|
@@ -1,169 +1,169 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: opsfuse-setup
|
|
3
|
-
description: >
|
|
4
|
-
Integrate opsfuse-ui into a React + Tailwind v4 app: install, CSS, fonts, brand theme,
|
|
5
|
-
OpsfuseThemeProvider, and migration. Use when starting integration or migrating an existing app.
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# OpsFuse UI — Integration Guide
|
|
9
|
-
|
|
10
|
-
Follow phases in order. For tokens use `/color-theme`; for component APIs use `/components`; for code patterns use `/ui-consistency`.
|
|
11
|
-
|
|
12
|
-
## 0 — Discovery
|
|
13
|
-
|
|
14
|
-
Before changing anything:
|
|
15
|
-
|
|
16
|
-
1. Framework (Next App/Pages, Vite, Remix, etc.) and package manager (lockfile).
|
|
17
|
-
2. Existing UI (shadcn, MUI, Chakra, etc.) and which components are used.
|
|
18
|
-
3. Global CSS entry and app root (`layout.tsx`, `main.tsx`, etc.).
|
|
19
|
-
|
|
20
|
-
## 1 — Install
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install opsfuse-ui
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Peers: `react`, `react-dom` (same major). If `tsconfig.json` exists, prefer `"moduleResolution": "bundler"` (or `node16` / `nodenext`) so `exports` resolve.
|
|
27
|
-
|
|
28
|
-
## 2 — CSS & fonts
|
|
29
|
-
|
|
30
|
-
**Tailwind v4 required.** One import in the host global stylesheet (not from JS):
|
|
31
|
-
|
|
32
|
-
```css
|
|
33
|
-
@import "tailwindcss";
|
|
34
|
-
@import "opsfuse-ui/styles.css";
|
|
35
|
-
/* your @theme / @source below this */
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
```ts
|
|
39
|
-
import "./globals.css"; // layout / main — not opsfuse-ui/styles.css here
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**Do**
|
|
43
|
-
|
|
44
|
-
- Import opsfuse **after** `tailwindcss`; put your `@theme` overrides **below** opsfuse.
|
|
45
|
-
- Scan **your** app source only — do **not** `@source` `node_modules/opsfuse-ui/dist/**/*.js` (breaks sidebar/tabs active states).
|
|
46
|
-
|
|
47
|
-
**Don't**
|
|
48
|
-
|
|
49
|
-
- Import `theme.css` separately or add `layer(opsfuse)` (obsolete).
|
|
50
|
-
|
|
51
|
-
**Fonts** — map host fonts to `--font-sans` / `--font-mono` (Next: `next/font` with `variable`; Vite: `:root` or existing font stack).
|
|
52
|
-
|
|
53
|
-
### Troubleshooting
|
|
54
|
-
|
|
55
|
-
| Symptom | Fix |
|
|
56
|
-
|--------|-----|
|
|
57
|
-
| All sidebar items look active / tabs never highlight | Remove host `@source` on opsfuse dist; use only the two imports above. |
|
|
58
|
-
| Tabs stay rounded in `line` variant | Tailwind v4 + package ≥ 0.1.10; confirm `data-[variant=line]:rounded-none` in built CSS. |
|
|
59
|
-
| Alert dialog header stays centered on `sm+` | Rebuild/reinstall; bundle should ship unlayered `alert-dialog-*` `text-align: left` at `sm`. |
|
|
60
|
-
|
|
61
|
-
## 3 — Brand theme
|
|
62
|
-
|
|
63
|
-
Ask the user to pick one:
|
|
64
|
-
|
|
65
|
-
| Brand | `theme` prop |
|
|
66
|
-
|-------|----------------|
|
|
67
|
-
| RecruitSmartly (default) | `"recruitsmartly"` |
|
|
68
|
-
| SkillReady | `"skillready"` |
|
|
69
|
-
| Verity | `"verity"` |
|
|
70
|
-
| WorkLog | `"worklog"` |
|
|
71
|
-
| LMS (Leave Management) | `"lms"` |
|
|
72
|
-
|
|
73
|
-
## 4 — Provider
|
|
74
|
-
|
|
75
|
-
Wrap the **entire app** once with `OpsfuseThemeProvider` (brand class, dark sync, portals, imperative APIs, tooltips, toaster). Do **not** nest `ConfirmationDialogProvider`, `TooltipProvider`, `AlertProvider`, `DialogProvider`, `SheetProvider`, `SliderDialogProvider`, or `Toaster` again in the entry file.
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
import { OpsfuseThemeProvider } from "opsfuse-ui";
|
|
79
|
-
|
|
80
|
-
<OpsfuseThemeProvider theme="skillready" className="min-h-svh">
|
|
81
|
-
{children}
|
|
82
|
-
</OpsfuseThemeProvider>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**Imperative APIs** (all provided by the theme provider):
|
|
86
|
-
|
|
87
|
-
| API | Use |
|
|
88
|
-
|-----|-----|
|
|
89
|
-
| `toast.*` from `sonner` | Notifications |
|
|
90
|
-
| `showAlert({ … })` | Alert dialog |
|
|
91
|
-
| `openDialog` / `openSheet` / `openSlider` | Overlays |
|
|
92
|
-
| `confirm({ … })` | Destructive confirm |
|
|
93
|
-
| `<Tooltip>` | Tooltips |
|
|
94
|
-
|
|
95
|
-
## 5 — Component migration
|
|
96
|
-
|
|
97
|
-
Work file by file: read context, replace UI only, keep logic. Remove dead imports from the old library.
|
|
98
|
-
|
|
99
|
-
Use `/components` for the full replacement map, variants, and composition. Quick mappings:
|
|
100
|
-
|
|
101
|
-
| Was | Use |
|
|
102
|
-
|-----|-----|
|
|
103
|
-
| Button | `<Button variant="…">` |
|
|
104
|
-
| Text field | `<Input label="…" />` or `<Field>` |
|
|
105
|
-
| Select | `<Select>` compound |
|
|
106
|
-
| Modal | `<Dialog>` or `openDialog` |
|
|
107
|
-
| Drawer | `<Sheet>` / `<Drawer>` |
|
|
108
|
-
| Confirm | `confirm()` not `window.confirm()` |
|
|
109
|
-
| Toast | `toast()` from `sonner` |
|
|
110
|
-
|
|
111
|
-
**Rules:** preserve handlers/state; icon-only buttons need `aria-label`; destructive flows use `confirm()` + `variant="destructive"` where appropriate.
|
|
112
|
-
|
|
113
|
-
**Bundle size:** prefer `opsfuse-ui/core` for light apps; `opsfuse-ui/extended` only where needed (charts, calendar, etc.).
|
|
114
|
-
|
|
115
|
-
## 6 — Tokens & dark mode
|
|
116
|
-
|
|
117
|
-
Replace hardcoded colors and `gray-*` / palette utilities with opsfuse tokens — see `/color-theme`.
|
|
118
|
-
|
|
119
|
-
Dark mode: add `dark` on `<html>`; tokens switch automatically. Use `dark:` with token classes, not hardcoded hex overrides.
|
|
120
|
-
|
|
121
|
-
## 7 — Verify
|
|
122
|
-
|
|
123
|
-
- [ ] `@import "opsfuse-ui/styles.css"` after `tailwindcss` in global CSS only
|
|
124
|
-
- [ ] No `@source` on opsfuse `dist/`
|
|
125
|
-
- [ ] `--font-sans` set; fonts render
|
|
126
|
-
- [ ] Single `OpsfuseThemeProvider` with chosen `theme`
|
|
127
|
-
- [ ] Tooltips / toasts / `confirm()` work if used
|
|
128
|
-
- [ ] Migrated files use tokens, not `text-gray-*` / hex
|
|
129
|
-
- [ ] `tsc --noEmit` clean
|
|
130
|
-
- [ ] Light + dark checked if the app supports dark mode
|
|
131
|
-
|
|
132
|
-
## Minimal Next.js snippet
|
|
133
|
-
|
|
134
|
-
```css
|
|
135
|
-
/* app/globals.css */
|
|
136
|
-
@import "tailwindcss";
|
|
137
|
-
@import "opsfuse-ui/styles.css";
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```tsx
|
|
141
|
-
// app/layout.tsx
|
|
142
|
-
import "./globals.css";
|
|
143
|
-
import { OpsfuseThemeProvider } from "opsfuse-ui";
|
|
144
|
-
|
|
145
|
-
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
146
|
-
return (
|
|
147
|
-
<html lang="en">
|
|
148
|
-
<body>
|
|
149
|
-
<OpsfuseThemeProvider theme="recruitsmartly" className="min-h-svh">
|
|
150
|
-
{children}
|
|
151
|
-
</OpsfuseThemeProvider>
|
|
152
|
-
</body>
|
|
153
|
-
</html>
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
Vite/CRA: same CSS imports; wrap `<App />` in `main.tsx`.
|
|
159
|
-
|
|
160
|
-
## Do / Don't
|
|
161
|
-
|
|
162
|
-
| Do | Don't |
|
|
163
|
-
|----|-------|
|
|
164
|
-
| One global CSS import after Tailwind | Import styles from JS or `@source` opsfuse dist |
|
|
165
|
-
| One root `OpsfuseThemeProvider` | Per-component theme wrappers or duplicate providers |
|
|
166
|
-
| `cn()` from `opsfuse-ui` | Concatenate class strings |
|
|
167
|
-
| Tokens + `/color-theme` | `text-gray-600`, arbitrary hex |
|
|
168
|
-
| Icons from `opsfuse-ui/icons` | `lucide-react` in consuming apps |
|
|
169
|
-
| `confirm()` for destructive actions | `window.confirm()` |
|
|
1
|
+
---
|
|
2
|
+
name: opsfuse-setup
|
|
3
|
+
description: >
|
|
4
|
+
Integrate opsfuse-ui into a React + Tailwind v4 app: install, CSS, fonts, brand theme,
|
|
5
|
+
OpsfuseThemeProvider, and migration. Use when starting integration or migrating an existing app.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# OpsFuse UI — Integration Guide
|
|
9
|
+
|
|
10
|
+
Follow phases in order. For tokens use `/color-theme`; for component APIs use `/components`; for code patterns use `/ui-consistency`.
|
|
11
|
+
|
|
12
|
+
## 0 — Discovery
|
|
13
|
+
|
|
14
|
+
Before changing anything:
|
|
15
|
+
|
|
16
|
+
1. Framework (Next App/Pages, Vite, Remix, etc.) and package manager (lockfile).
|
|
17
|
+
2. Existing UI (shadcn, MUI, Chakra, etc.) and which components are used.
|
|
18
|
+
3. Global CSS entry and app root (`layout.tsx`, `main.tsx`, etc.).
|
|
19
|
+
|
|
20
|
+
## 1 — Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install opsfuse-ui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Peers: `react`, `react-dom` (same major). If `tsconfig.json` exists, prefer `"moduleResolution": "bundler"` (or `node16` / `nodenext`) so `exports` resolve.
|
|
27
|
+
|
|
28
|
+
## 2 — CSS & fonts
|
|
29
|
+
|
|
30
|
+
**Tailwind v4 required.** One import in the host global stylesheet (not from JS):
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
@import "tailwindcss";
|
|
34
|
+
@import "opsfuse-ui/styles.css";
|
|
35
|
+
/* your @theme / @source below this */
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import "./globals.css"; // layout / main — not opsfuse-ui/styles.css here
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Do**
|
|
43
|
+
|
|
44
|
+
- Import opsfuse **after** `tailwindcss`; put your `@theme` overrides **below** opsfuse.
|
|
45
|
+
- Scan **your** app source only — do **not** `@source` `node_modules/opsfuse-ui/dist/**/*.js` (breaks sidebar/tabs active states).
|
|
46
|
+
|
|
47
|
+
**Don't**
|
|
48
|
+
|
|
49
|
+
- Import `theme.css` separately or add `layer(opsfuse)` (obsolete).
|
|
50
|
+
|
|
51
|
+
**Fonts** — map host fonts to `--font-sans` / `--font-mono` (Next: `next/font` with `variable`; Vite: `:root` or existing font stack).
|
|
52
|
+
|
|
53
|
+
### Troubleshooting
|
|
54
|
+
|
|
55
|
+
| Symptom | Fix |
|
|
56
|
+
|--------|-----|
|
|
57
|
+
| All sidebar items look active / tabs never highlight | Remove host `@source` on opsfuse dist; use only the two imports above. |
|
|
58
|
+
| Tabs stay rounded in `line` variant | Tailwind v4 + package ≥ 0.1.10; confirm `data-[variant=line]:rounded-none` in built CSS. |
|
|
59
|
+
| Alert dialog header stays centered on `sm+` | Rebuild/reinstall; bundle should ship unlayered `alert-dialog-*` `text-align: left` at `sm`. |
|
|
60
|
+
|
|
61
|
+
## 3 — Brand theme
|
|
62
|
+
|
|
63
|
+
Ask the user to pick one:
|
|
64
|
+
|
|
65
|
+
| Brand | `theme` prop |
|
|
66
|
+
|-------|----------------|
|
|
67
|
+
| RecruitSmartly (default) | `"recruitsmartly"` |
|
|
68
|
+
| SkillReady | `"skillready"` |
|
|
69
|
+
| Verity | `"verity"` |
|
|
70
|
+
| WorkLog | `"worklog"` |
|
|
71
|
+
| LMS (Leave Management) | `"lms"` |
|
|
72
|
+
|
|
73
|
+
## 4 — Provider
|
|
74
|
+
|
|
75
|
+
Wrap the **entire app** once with `OpsfuseThemeProvider` (brand class, dark sync, portals, imperative APIs, tooltips, toaster). Do **not** nest `ConfirmationDialogProvider`, `TooltipProvider`, `AlertProvider`, `DialogProvider`, `SheetProvider`, `SliderDialogProvider`, or `Toaster` again in the entry file.
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { OpsfuseThemeProvider } from "opsfuse-ui";
|
|
79
|
+
|
|
80
|
+
<OpsfuseThemeProvider theme="skillready" className="min-h-svh">
|
|
81
|
+
{children}
|
|
82
|
+
</OpsfuseThemeProvider>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Imperative APIs** (all provided by the theme provider):
|
|
86
|
+
|
|
87
|
+
| API | Use |
|
|
88
|
+
|-----|-----|
|
|
89
|
+
| `toast.*` from `sonner` | Notifications |
|
|
90
|
+
| `showAlert({ … })` | Alert dialog |
|
|
91
|
+
| `openDialog` / `openSheet` / `openSlider` | Overlays |
|
|
92
|
+
| `confirm({ … })` | Destructive confirm |
|
|
93
|
+
| `<Tooltip>` | Tooltips |
|
|
94
|
+
|
|
95
|
+
## 5 — Component migration
|
|
96
|
+
|
|
97
|
+
Work file by file: read context, replace UI only, keep logic. Remove dead imports from the old library.
|
|
98
|
+
|
|
99
|
+
Use `/components` for the full replacement map, variants, and composition. Quick mappings:
|
|
100
|
+
|
|
101
|
+
| Was | Use |
|
|
102
|
+
|-----|-----|
|
|
103
|
+
| Button | `<Button variant="…">` |
|
|
104
|
+
| Text field | `<Input label="…" />` or `<Field>` |
|
|
105
|
+
| Select | `<Select>` compound |
|
|
106
|
+
| Modal | `<Dialog>` or `openDialog` |
|
|
107
|
+
| Drawer | `<Sheet>` / `<Drawer>` |
|
|
108
|
+
| Confirm | `confirm()` not `window.confirm()` |
|
|
109
|
+
| Toast | `toast()` from `sonner` |
|
|
110
|
+
|
|
111
|
+
**Rules:** preserve handlers/state; icon-only buttons need `aria-label`; destructive flows use `confirm()` + `variant="destructive"` where appropriate.
|
|
112
|
+
|
|
113
|
+
**Bundle size:** prefer `opsfuse-ui/core` for light apps; `opsfuse-ui/extended` only where needed (charts, calendar, etc.).
|
|
114
|
+
|
|
115
|
+
## 6 — Tokens & dark mode
|
|
116
|
+
|
|
117
|
+
Replace hardcoded colors and `gray-*` / palette utilities with opsfuse tokens — see `/color-theme`.
|
|
118
|
+
|
|
119
|
+
Dark mode: add `dark` on `<html>`; tokens switch automatically. Use `dark:` with token classes, not hardcoded hex overrides.
|
|
120
|
+
|
|
121
|
+
## 7 — Verify
|
|
122
|
+
|
|
123
|
+
- [ ] `@import "opsfuse-ui/styles.css"` after `tailwindcss` in global CSS only
|
|
124
|
+
- [ ] No `@source` on opsfuse `dist/`
|
|
125
|
+
- [ ] `--font-sans` set; fonts render
|
|
126
|
+
- [ ] Single `OpsfuseThemeProvider` with chosen `theme`
|
|
127
|
+
- [ ] Tooltips / toasts / `confirm()` work if used
|
|
128
|
+
- [ ] Migrated files use tokens, not `text-gray-*` / hex
|
|
129
|
+
- [ ] `tsc --noEmit` clean
|
|
130
|
+
- [ ] Light + dark checked if the app supports dark mode
|
|
131
|
+
|
|
132
|
+
## Minimal Next.js snippet
|
|
133
|
+
|
|
134
|
+
```css
|
|
135
|
+
/* app/globals.css */
|
|
136
|
+
@import "tailwindcss";
|
|
137
|
+
@import "opsfuse-ui/styles.css";
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
// app/layout.tsx
|
|
142
|
+
import "./globals.css";
|
|
143
|
+
import { OpsfuseThemeProvider } from "opsfuse-ui";
|
|
144
|
+
|
|
145
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
146
|
+
return (
|
|
147
|
+
<html lang="en">
|
|
148
|
+
<body>
|
|
149
|
+
<OpsfuseThemeProvider theme="recruitsmartly" className="min-h-svh">
|
|
150
|
+
{children}
|
|
151
|
+
</OpsfuseThemeProvider>
|
|
152
|
+
</body>
|
|
153
|
+
</html>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Vite/CRA: same CSS imports; wrap `<App />` in `main.tsx`.
|
|
159
|
+
|
|
160
|
+
## Do / Don't
|
|
161
|
+
|
|
162
|
+
| Do | Don't |
|
|
163
|
+
|----|-------|
|
|
164
|
+
| One global CSS import after Tailwind | Import styles from JS or `@source` opsfuse dist |
|
|
165
|
+
| One root `OpsfuseThemeProvider` | Per-component theme wrappers or duplicate providers |
|
|
166
|
+
| `cn()` from `opsfuse-ui` | Concatenate class strings |
|
|
167
|
+
| Tokens + `/color-theme` | `text-gray-600`, arbitrary hex |
|
|
168
|
+
| Icons from `opsfuse-ui/icons` | `lucide-react` in consuming apps |
|
|
169
|
+
| `confirm()` for destructive actions | `window.confirm()` |
|