opsfuse-ui 0.1.0 → 0.1.2
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/opsfuse-components/SKILL.md +47 -1
- package/.claude/skills/opsfuse-setup/SKILL.md +2 -57
- package/.claude/skills/opsfuse-ui-consistency/SKILL.md +10 -1
- package/README.md +7 -213
- package/dist/core.js +2 -2
- package/dist/date-fns-BNhPf8zY.js +3871 -0
- package/dist/date-fns-locale.d.ts +2 -0
- package/dist/date-fns-locale.d.ts.map +1 -0
- package/dist/date-fns-locale.js +39648 -0
- package/dist/date-fns.d.ts +2 -0
- package/dist/date-fns.d.ts.map +1 -0
- package/dist/date-fns.js +3 -0
- package/dist/{es6-D-3xKXBT.js → es6-DckNYvTU.js} +1 -1
- package/dist/extended.js +2 -2
- package/dist/icons.js +1 -1
- package/dist/index.js +150 -149
- package/dist/{input-group-DIfVGMYe.js → input-group-8e8jjdvl.js} +2 -2
- package/dist/{input-otp-DwLGFwVo.js → input-otp-Cy2f60X3.js} +2902 -4223
- package/dist/isSameWeek-BUR9Q_Qt.js +537 -0
- package/dist/public-api.d.ts +1 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/recharts.js +1 -1
- package/dist/{toggle-group-D21Ul2kd.js → toggle-group-D2isQKZo.js} +2 -2
- package/package.json +11 -1
- /package/dist/{clsx-D7D_XZ_-.js → clsx-BD2qMUU1.js} +0 -0
- /package/dist/{lucide-react-DLVJK_zM.js → lucide-react-BST2iBrS.js} +0 -0
|
@@ -9,6 +9,7 @@ You are an expert on the OpsFuse UI component library. When invoked, answer ques
|
|
|
9
9
|
```tsx
|
|
10
10
|
import { Button, Card, CardContent, Input, Badge, Recharts } from "opsfuse-ui";
|
|
11
11
|
import { Home, Search, Plus } from "opsfuse-ui/icons";
|
|
12
|
+
import { format, addDays } from "opsfuse-ui/date-fns";
|
|
12
13
|
// or for performance-sensitive apps:
|
|
13
14
|
import { Button, Badge } from "opsfuse-ui/core";
|
|
14
15
|
import { ChartContainer, Calendar } from "opsfuse-ui/extended";
|
|
@@ -17,9 +18,10 @@ import { Button } from "@/components/ui/button";
|
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
- `opsfuse-ui/icons` — flat Lucide icon re-exports. Write `<Search />` directly. For names that collide with opsfuse components (`Badge`, `Calendar`, `Command`, `Form`, `Sheet`, `Sidebar`, `Table`) either alias on import or use `Lucide.<Icon>` from the main entry.
|
|
21
|
+
- `opsfuse-ui/date-fns` — flat `date-fns` re-exports (functions + locales). Use the `DateFns` namespace from the main entry (`import { DateFns } from "opsfuse-ui"`) only for collision cases.
|
|
20
22
|
- `Recharts` (main entry) — namespace re-export of `recharts`. Write `<Recharts.BarChart />`.
|
|
21
23
|
|
|
22
|
-
Never install `lucide-react` or `
|
|
24
|
+
Never install `lucide-react`, `recharts`, or `date-fns` directly in host apps.
|
|
23
25
|
|
|
24
26
|
All components require a `.opsfuse-ui` ancestor class (provided by `OpsfuseThemeProvider`).
|
|
25
27
|
|
|
@@ -1392,6 +1394,50 @@ const Icon = Icons[name as keyof typeof Icons] as Icons.LucideIcon;
|
|
|
1392
1394
|
|
|
1393
1395
|
---
|
|
1394
1396
|
|
|
1397
|
+
## date-fns
|
|
1398
|
+
|
|
1399
|
+
**Subpath:** `opsfuse-ui/date-fns` (flat re-export of [`date-fns`](https://date-fns.org/) — all functions and locales, fully tree-shakable)
|
|
1400
|
+
**Main entry:** `DateFns` namespace (`import { DateFns } from "opsfuse-ui"`) — only needed for collision cases
|
|
1401
|
+
|
|
1402
|
+
### Direct named import (preferred)
|
|
1403
|
+
|
|
1404
|
+
Import any date-fns function from `opsfuse-ui/date-fns` — no need to install `date-fns` directly. The library pins the version, so the host and library always agree.
|
|
1405
|
+
|
|
1406
|
+
```tsx
|
|
1407
|
+
import { format, addDays, parseISO, differenceInDays } from "opsfuse-ui/date-fns";
|
|
1408
|
+
|
|
1409
|
+
const today = new Date();
|
|
1410
|
+
const next = addDays(today, 7);
|
|
1411
|
+
const label = format(next, "PPP");
|
|
1412
|
+
```
|
|
1413
|
+
|
|
1414
|
+
### Locales
|
|
1415
|
+
|
|
1416
|
+
Locales live at the `opsfuse-ui/date-fns/locale` subpath (mirroring date-fns itself):
|
|
1417
|
+
|
|
1418
|
+
```tsx
|
|
1419
|
+
import { format } from "opsfuse-ui/date-fns";
|
|
1420
|
+
import { fr, enUS } from "opsfuse-ui/date-fns/locale";
|
|
1421
|
+
|
|
1422
|
+
format(new Date(), "PPP", { locale: fr });
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
### Name collisions
|
|
1426
|
+
|
|
1427
|
+
If a date-fns export name collides with another import in your file, use the `DateFns` namespace:
|
|
1428
|
+
|
|
1429
|
+
```tsx
|
|
1430
|
+
import { DateFns } from "opsfuse-ui";
|
|
1431
|
+
|
|
1432
|
+
DateFns.format(new Date(), "yyyy-MM-dd");
|
|
1433
|
+
```
|
|
1434
|
+
|
|
1435
|
+
### Why route through the library
|
|
1436
|
+
|
|
1437
|
+
Host apps must **not** install or import `date-fns` directly. Routing through `opsfuse-ui/date-fns` guarantees a single pinned version across the host and library (matching the version the `Calendar` and date components are built against), avoids duplicate copies in the bundle, and keeps host upgrades centralized to bumping `opsfuse-ui`.
|
|
1438
|
+
|
|
1439
|
+
---
|
|
1440
|
+
|
|
1395
1441
|
## Provider / Theme
|
|
1396
1442
|
|
|
1397
1443
|
**Export:** `OpsfuseThemeProvider`, `OpsfuseRoot`, `OPSFUSE_THEME_SCOPE`, `OPSFUSE_BRAND_THEMES`, `DEFAULT_OPSFUSE_BRAND_THEME`
|
|
@@ -29,59 +29,8 @@ Before touching anything, understand what you're working with:
|
|
|
29
29
|
|
|
30
30
|
### 1a. Install the package
|
|
31
31
|
|
|
32
|
-
Pick **one** install method. Submodule is preferred when the host repo should pin a specific library revision alongside application code.
|
|
33
|
-
|
|
34
|
-
#### Option A — Git submodule (recommended for monorepos / pinned source)
|
|
35
|
-
|
|
36
|
-
From the **host app** repository root:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
git submodule add git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git packages/ui
|
|
40
|
-
git submodule update --init --recursive
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Add to the host `package.json`:
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"opsfuse-ui": "file:packages/ui"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Install with the detected package manager (`npm install`, `pnpm install`, etc.). On fresh clones of the host repo, run `git submodule update --init --recursive` before install.
|
|
54
|
-
|
|
55
|
-
**Pull / update submodule in the host app** (from host repo root unless noted):
|
|
56
|
-
|
|
57
|
-
| Situation | Commands |
|
|
58
|
-
| --------- | -------- |
|
|
59
|
-
| Fresh clone | `git submodule update --init --recursive` → `npm install` |
|
|
60
|
-
| After `git pull` on host (submodule SHA may have changed) | `git submodule update --init --recursive` → `cd packages/ui && npm run build:lib` → `npm install` in host if `packages/ui/package.json` changed |
|
|
61
|
-
| Pull host + sync submodules together | `git pull --recurse-submodules` (or `git config submodule.recurse true` then `git pull`) → rebuild in `packages/ui` |
|
|
62
|
-
| Bump library to latest remote | `cd packages/ui` → `git fetch` → `git checkout main` → `git pull` → `cd ../..` → `git add packages/ui` → commit → `npm run build:lib` in `packages/ui` → `npm install` in host if needed |
|
|
63
|
-
|
|
64
|
-
The host records which library commit is pinned; always commit `packages/ui` when intentionally upgrading the submodule.
|
|
65
|
-
|
|
66
|
-
#### Option B — Registry or git dependency
|
|
67
|
-
|
|
68
|
-
Use the detected package manager:
|
|
69
|
-
|
|
70
32
|
```bash
|
|
71
|
-
# npm (registry)
|
|
72
33
|
npm install opsfuse-ui
|
|
73
|
-
|
|
74
|
-
# yarn
|
|
75
|
-
yarn add opsfuse-ui
|
|
76
|
-
|
|
77
|
-
# pnpm
|
|
78
|
-
pnpm add opsfuse-ui
|
|
79
|
-
|
|
80
|
-
# bun
|
|
81
|
-
bun add opsfuse-ui
|
|
82
|
-
|
|
83
|
-
# From private Git repo (internal, not submodule)
|
|
84
|
-
npm install git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git#main
|
|
85
34
|
```
|
|
86
35
|
|
|
87
36
|
**Peer dependencies** — opsfuse-ui requires `react` and `react-dom` (same major version). Verify they are already installed. Do not add them if they already exist.
|
|
@@ -170,15 +119,10 @@ If the host app uses Tailwind v4, point content at the built bundle so utility c
|
|
|
170
119
|
// tailwind.config.js or @source in your CSS
|
|
171
120
|
content: [
|
|
172
121
|
"./src/**/*.{js,ts,jsx,tsx}",
|
|
173
|
-
// npm / git dependency:
|
|
174
122
|
"./node_modules/opsfuse-ui/dist/index.js",
|
|
175
|
-
// git submodule at packages/ui:
|
|
176
|
-
"./packages/ui/dist/index.js",
|
|
177
123
|
],
|
|
178
124
|
```
|
|
179
125
|
|
|
180
|
-
Use the path that matches how opsfuse-ui was installed (only one of the library paths is needed).
|
|
181
|
-
|
|
182
126
|
---
|
|
183
127
|
|
|
184
128
|
## PHASE 3 — Theme Selection
|
|
@@ -543,6 +487,7 @@ export default function RootLayout({
|
|
|
543
487
|
| Use design tokens `var(--subtle-foreground)` | Use `text-gray-600` or `#6b7280` |
|
|
544
488
|
| Use `data-slot` on custom component parts | Skip `data-slot` on wrappers |
|
|
545
489
|
| Use `confirm()` before destructive actions | Use `window.confirm()` |
|
|
546
|
-
| Import icons from `
|
|
490
|
+
| Import icons from `opsfuse-ui/icons` | Import from `lucide-react` or other icon libraries |
|
|
491
|
+
| Import dates from `opsfuse-ui/date-fns` | Install or import `date-fns` directly |
|
|
547
492
|
| Use `<Field>` for form layout | Raw `div` + `label` + `input` |
|
|
548
493
|
| Test light AND dark mode after migration | Only check light mode |
|
|
@@ -70,6 +70,14 @@ Host apps must **not** install or import `lucide-react` directly — the full ic
|
|
|
70
70
|
|
|
71
71
|
For names that collide with opsfuse component exports (`Badge`, `Calendar`, `Command`, `Form`, `Sheet`, `Sidebar`, `Table`), alias on import (`import { Calendar as CalendarIcon } from "opsfuse-ui/icons"`) or use `<Lucide.Calendar />` from the main entry.
|
|
72
72
|
|
|
73
|
+
### Dates always from `opsfuse-ui/date-fns`
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { format, addDays, parseISO } from "opsfuse-ui/date-fns";
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Host apps must **not** install or import `date-fns` directly — the full `date-fns` surface (including locales) is re-exported as flat named exports from `opsfuse-ui/date-fns` (and as the `DateFns` namespace from the main entry, for collision cases: `import { DateFns } from "opsfuse-ui"` → `DateFns.format(...)`). This guarantees a single pinned version across the host and library.
|
|
80
|
+
|
|
73
81
|
---
|
|
74
82
|
|
|
75
83
|
## 2. PROVIDERS SETUP (main.tsx)
|
|
@@ -152,7 +160,8 @@ Write stories for all new components. Test in both light and dark mode. Page-lev
|
|
|
152
160
|
| Use `cva()` for multi-variant components | Inline ternary chains for variants |
|
|
153
161
|
| Add `data-slot` to every component part | Skip `data-slot` on wrapper/part elements |
|
|
154
162
|
| Use `<Field>` compound for form inputs | Lay out label + input with raw divs |
|
|
155
|
-
| Import icons from `
|
|
163
|
+
| Import icons from `opsfuse-ui/icons` | Import from `lucide-react` or other icon libraries |
|
|
164
|
+
| Import dates from `opsfuse-ui/date-fns` | Install/import `date-fns` directly in host apps |
|
|
156
165
|
| Use `.transition-micro/smooth/data` motion classes | Hardcode `transition duration-200` everywhere |
|
|
157
166
|
| Use `confirm()` before destructive actions | Skip confirmation on destructive button clicks |
|
|
158
167
|
| Use spacing tokens `--space-1` through `--space-10` | Use arbitrary gaps like `gap-[13px]` |
|
package/README.md
CHANGED
|
@@ -91,115 +91,29 @@ import { Button, cn } from "opsfuse-ui";
|
|
|
91
91
|
| `opsfuse-ui/core` | Core components only (no charts, calendar, carousel, etc.) |
|
|
92
92
|
| `opsfuse-ui/extended` | Heavier components (Chart, Calendar, Carousel, Command, Combobox, Drawer, InputOTP, Sonner) |
|
|
93
93
|
| `opsfuse-ui/recharts` | Re-exported Recharts with theme support |
|
|
94
|
+
| `opsfuse-ui/icons` | Flat re-export of `lucide-react` icons |
|
|
95
|
+
| `opsfuse-ui/date-fns` | Flat re-export of `date-fns` utilities |
|
|
96
|
+
| `opsfuse-ui/date-fns/locale` | Flat re-export of `date-fns` locales |
|
|
94
97
|
|
|
95
98
|
```ts
|
|
96
99
|
import { Button, Badge, OpsfuseRoot } from "opsfuse-ui/core";
|
|
97
100
|
import { ChartContainer, Calendar } from "opsfuse-ui/extended";
|
|
98
101
|
import { Recharts } from "opsfuse-ui/recharts";
|
|
102
|
+
import { Home, Search } from "opsfuse-ui/icons";
|
|
103
|
+
import { format, addDays } from "opsfuse-ui/date-fns";
|
|
99
104
|
```
|
|
100
105
|
|
|
101
106
|
**TypeScript:** use `moduleResolution` `"bundler"` or `"node16"` / `"nodenext"` so `package.json` `exports` resolve correctly.
|
|
102
107
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
## Install as a git submodule
|
|
106
|
-
|
|
107
|
-
Use a submodule when you want the library source pinned in your repo (for example at `packages/ui`) instead of pulling from the npm registry or a one-off git dependency.
|
|
108
|
-
|
|
109
|
-
From your **host app** repository root:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
git submodule add git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git packages/ui
|
|
113
|
-
git submodule update --init --recursive
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Wire the submodule into the host app’s `package.json`:
|
|
117
|
-
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"dependencies": {
|
|
121
|
-
"opsfuse-ui": "file:packages/ui"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Then install in the host app:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
npm install
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
The `prepare` script in this repo runs `build:lib`, so `dist/` is produced on install. If you clone the host repo later, initialize submodules before installing:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
git submodule update --init --recursive
|
|
136
|
-
npm install
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Update and pull in the host app
|
|
140
|
-
|
|
141
|
-
The host repo stores a **commit SHA** for `packages/ui`. Pulling the host app does not always check out that commit inside the submodule unless you sync submodules explicitly.
|
|
142
|
-
|
|
143
|
-
**After `git pull` on the host** (teammate bumped the submodule, or you switched branches):
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
# From the host app repository root
|
|
147
|
-
git submodule update --init --recursive
|
|
148
|
-
cd packages/ui && npm run build:lib
|
|
149
|
-
cd ../.. && npm install # if packages/ui/package.json or lockfile changed
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**Pull host + sync submodules in one step** (optional; set once per machine):
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
git config submodule.recurse true
|
|
156
|
-
git pull
|
|
157
|
-
cd packages/ui && npm run build:lib
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Or a single pull without changing config:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
git pull --recurse-submodules
|
|
164
|
-
cd packages/ui && npm run build:lib
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**Bump `packages/ui` to the latest library** (you choose the new commit and record it in the host repo):
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
cd packages/ui
|
|
171
|
-
git fetch origin
|
|
172
|
-
git checkout main # or a tag / commit you want to pin
|
|
173
|
-
git pull origin main
|
|
174
|
-
cd ../..
|
|
175
|
-
git add packages/ui
|
|
176
|
-
git commit -m "chore: bump opsfuse-ui submodule"
|
|
177
|
-
cd packages/ui && npm run build:lib
|
|
178
|
-
cd ../.. && npm install # if library dependencies changed
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
**Fresh clone of the host app:**
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
git clone <host-repo-url>
|
|
185
|
-
cd <host-app>
|
|
186
|
-
git submodule update --init --recursive
|
|
187
|
-
npm install
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Imports, styles, fonts, and `OpsfuseThemeProvider` are the same as in [Install in an application](#install-in-an-application) above (`import "opsfuse-ui/..."`, etc.).
|
|
191
|
-
|
|
192
|
-
**Tailwind v4 content** — if you scan the library for classes, point at the submodule build output instead of `node_modules`:
|
|
108
|
+
**Tailwind v4 content** — if you scan the library for classes, include the built bundle:
|
|
193
109
|
|
|
194
110
|
```js
|
|
195
111
|
content: [
|
|
196
112
|
"./src/**/*.{js,ts,jsx,tsx}",
|
|
197
|
-
"./
|
|
113
|
+
"./node_modules/opsfuse-ui/dist/index.js",
|
|
198
114
|
],
|
|
199
115
|
```
|
|
200
116
|
|
|
201
|
-
**Claude Code skills** — the `postinstall` script copies skills into the host app’s `.claude/skills/` when you `npm install` the `file:` dependency.
|
|
202
|
-
|
|
203
117
|
---
|
|
204
118
|
|
|
205
119
|
## Claude Code Skills
|
|
@@ -212,130 +126,10 @@ Available skills:
|
|
|
212
126
|
- `/color-theme` — Design token and typography guide
|
|
213
127
|
- `/ui-consistency` — Best practices and mandatory code patterns
|
|
214
128
|
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## Use the library locally (path / link)
|
|
218
|
-
|
|
219
|
-
For a copy tracked in git at a fixed path (`packages/ui`), use [Install as a git submodule](#install-as-a-git-submodule) instead of a manual relative path.
|
|
220
|
-
|
|
221
|
-
1. In this repo, build the package:
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
npm run build:lib
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
2. In the **host app**, depend on the folder (adjust the relative path):
|
|
228
|
-
|
|
229
|
-
**package.json**
|
|
230
|
-
|
|
231
|
-
```json
|
|
232
|
-
{
|
|
233
|
-
"dependencies": {
|
|
234
|
-
"opsfuse-ui": "file:../opsfuse-ui"
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Then run `npm install` in the host app.
|
|
240
|
-
|
|
241
|
-
**Alternative — `npm link`**
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
cd opsfuse-ui && npm run build:lib && npm link
|
|
245
|
-
cd ../your-host-app && npm link opsfuse-ui
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
If you see duplicate React errors, prefer `file:` or align `react` / `react-dom` versions; restart the host dev server after rebuilding the library.
|
|
249
|
-
|
|
250
|
-
3. After changing this library, run `npm run build:lib` again; the host picks up the new `dist/` on the next install or when the link updates.
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## Install directly from Git
|
|
255
|
-
|
|
256
|
-
If you install from a Git URL, use `git+https` (or `git+ssh`) instead of a plain `https://...git` URL. A plain URL may be treated as a tarball endpoint and fail with `TAR_BAD_ARCHIVE`.
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
npm install git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git#main
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
Notes:
|
|
263
|
-
|
|
264
|
-
- This repository now has a `prepare` script, so npm builds the library (`dist/`) when installing from git.
|
|
265
|
-
- The git host must be accessible/authenticated from the host app environment.
|
|
266
|
-
- Git installs are best for internal/dev usage; for stable consumer installs, prefer the GitLab npm registry flow below.
|
|
267
|
-
|
|
268
|
-
---
|
|
269
|
-
|
|
270
|
-
## Publish and install from GitLab (Package Registry)
|
|
271
|
-
|
|
272
|
-
Use the [GitLab npm registry](https://docs.gitlab.com/ee/user/packages/npm_registry/) for your project or group. URLs below use placeholders—replace with your GitLab instance URL, project ID, or group path.
|
|
273
|
-
|
|
274
|
-
### Publish (this repo)
|
|
275
|
-
|
|
276
|
-
1. Choose a registry URL:
|
|
277
|
-
|
|
278
|
-
- **Project:** `https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/`
|
|
279
|
-
- **Group:** `https://gitlab.example.com/api/v4/groups/<GROUP_ID>/-/packages/npm/`
|
|
280
|
-
|
|
281
|
-
2. **Bump version** in `package.json` (GitLab rejects duplicate versions).
|
|
282
|
-
|
|
283
|
-
3. Authenticate, then publish:
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
npm run build:lib
|
|
287
|
-
npm publish --registry=https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
Use a [GitLab deploy token](https://docs.gitlab.com/ee/user/project/deploy_tokens/) or [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) with scopes `read_package_registry` / `write_package_registry` as required. For CI, use `CI_JOB_TOKEN` with a [CI/CD job token](https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html) allowed to access the registry.
|
|
291
|
-
|
|
292
|
-
Optional **publishConfig** in this package’s `package.json` so you do not pass `--registry` each time:
|
|
293
|
-
|
|
294
|
-
```json
|
|
295
|
-
"publishConfig": {
|
|
296
|
-
"registry": "https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/"
|
|
297
|
-
}
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
For a **scoped** name (e.g. `@company/opsfuse-ui`), set `name` and scope in `.npmrc` on the consumer as shown below; the registry URL pattern is the same idea for project or group.
|
|
301
|
-
|
|
302
|
-
### Install in the host app (GitLab)
|
|
303
|
-
|
|
304
|
-
1. In the **host app**, add a **`.npmrc`** next to `package.json` (use the same registry base URL you publish to):
|
|
305
|
-
|
|
306
|
-
```ini
|
|
307
|
-
; Project registry example
|
|
308
|
-
registry=https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/
|
|
309
|
-
|
|
310
|
-
; For private registry auth (choose one approach)
|
|
311
|
-
//gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/:_authToken=${GITLAB_TOKEN}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
For **local development**, set `GITLAB_TOKEN` to a personal access token or deploy token with `read_package_registry`. In **GitLab CI**, use `CI_JOB_TOKEN` if your job is allowed to pull packages from that project.
|
|
315
|
-
|
|
316
|
-
2. Install:
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
npm install opsfuse-ui
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
If the package is **scoped** (e.g. `@company/opsfuse-ui`), configure the scope in `.npmrc`:
|
|
323
|
-
|
|
324
|
-
```ini
|
|
325
|
-
@company:registry=https://gitlab.example.com/api/v4/groups/<GROUP_ID>/-/packages/npm/
|
|
326
|
-
//gitlab.example.com/api/v4/groups/<GROUP_ID>/-/packages/npm/:_authToken=${GITLAB_TOKEN}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
Then `npm install @company/opsfuse-ui`.
|
|
330
|
-
|
|
331
|
-
See GitLab’s docs for [npm authentication](https://docs.gitlab.com/ee/user/packages/npm_registry/#authenticate-with-the-registry) and [troubleshooting](https://docs.gitlab.com/ee/user/packages/npm_registry/) (401/403, token scopes, duplicate versions).
|
|
332
|
-
|
|
333
129
|
### IDE (VS Code / Cursor) — completions and auto-imports
|
|
334
130
|
|
|
335
131
|
TypeScript only suggests symbols from packages that are **listed in the host app’s `package.json`** (`dependencies` or `devDependencies`). Add `opsfuse-ui` there, then run **“TypeScript: Restart TS Server”** after install or upgrades.
|
|
336
132
|
|
|
337
|
-
If you use a **`file:`** path or **`npm link`**, run **`npm run build:lib`** in this repo first so **`dist/index.d.ts`** exists; without it, the editor has nothing to load.
|
|
338
|
-
|
|
339
133
|
Optional: set **`typescript.preferences.includePackageJsonAutoImports`** to **`on`** if you want broader auto-import behavior (the default **`auto`** only considers direct `package.json` dependencies).
|
|
340
134
|
|
|
341
135
|
---
|
package/dist/core.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, F as i, I as a, M as o, N as s, O as c, P as l, S as u, Ut as d, _ as f, a as p, b as m, c as h, f as g, g as _, h as v, i as y, k as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, v as k, x as A, y as j } from "./input-group-
|
|
2
|
-
import { $ as M, $n as N, $r as P, $t as F, A as I, An as L, Ar as R, At as z, B, Bn as V, Br as H, Bt as U, C as W, Cn as G, Cr as K, Ct as q, D as J, Dn as Y, Dr as X, Dt as Z, E as Q, En as $, Er as ee, Et as te, F as ne, Fn as re, Fr as ie, Ft as ae, G as oe, Gn as se, Gr as ce, Gt as le, H as ue, Hn as de, Hr as fe, Ht as pe, I as me, In as he, Ir as ge, It as _e, J as ve, Jn as ye, Jr as be, Jt as xe, K as Se, Kn as Ce, Kr as we, Kt as Te, L as Ee, Ln as De, Lr as Oe, Lt as ke, M as Ae, Mn as je, Mr as Me, Mt as Ne, N as Pe, Nn as Fe, Nr as Ie, Nt as Le, O as Re, On as ze, Or as Be, Ot as Ve, P as He, Pn as Ue, Pr as We, Pt as Ge, Q as Ke, Qn as qe, Qr as Je, Qt as Ye, R as Xe, Rn as Ze, Rr as Qe, Rt as $e, S as et, Sn as tt, Sr as nt, St as rt, T as it, Tn as at, Tr as ot, Tt as st, U as ct, Un as lt, Ur as ut, Ut as dt, V as ft, Vn as pt, Vr as mt, Vt as ht, W as gt, Wn as _t, Wr as vt, Wt as yt, X as bt, Xn as xt, Xr as St, Xt as Ct, Y as wt, Yn as Tt, Yr as Et, Yt as Dt, Z as Ot, Zn as kt, Zr as At, Zt as jt, _ as Mt, _n as Nt, _r as Pt, _t as Ft, a as It, ai as Lt, an as Rt, ar as zt, at as Bt, b as Vt, bn as Ht, br as Ut, bt as Wt, c as Gt, ci as Kt, cn as qt, cr as Jt, ct as Yt, d as Xt, dn as Zt, dr as Qt, dt as $t, ei as en, en as tn, er as nn, et as rn, f as an, fn as on, fr as sn, ft as cn, g as ln, gn as un, gr as dn, gt as fn, h as pn, hn as mn, hr as hn, ht as gn, i as _n, ii as vn, in as yn, ir as bn, it as xn, j as Sn, jn as Cn, jr as wn, jt as Tn, k as En, kn as Dn, kr as On, kt as kn, l as An, li as jn, ln as Mn, lr as Nn, lt as Pn, m as Fn, mn as In, mr as Ln, mt as Rn, n as zn, ni as Bn, nn as Vn, nr as Hn, nt as Un, o as Wn, oi as Gn, on as Kn, or as qn, ot as Jn, p as Yn, pn as Xn, pr as Zn, pt as Qn, q as $n, qn as er, qr as tr, qt as nr, r as rr, ri as ir, rn as ar, rr as or, rt as sr, s as cr, si as lr, sn as ur, sr as dr, st as fr, t as pr, ti as mr, tn as hr, tr as gr, tt as _r, u as vr, ui as yr, un as br, ur as xr, ut as Sr, v as Cr, vn as wr, vr as Tr, vt as Er, w as Dr, wn as Or, wr as kr, wt as Ar, x as jr, xn as Mr, xr as Nr, xt as Pr, y as Fr, yn as Ir, yr as Lr, yt as Rr, z as zr, zn as Br, zr as Vr, zt as Hr } from "./toggle-group-
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F as i, I as a, M as o, N as s, O as c, P as l, S as u, Ut as d, _ as f, a as p, b as m, c as h, f as g, g as _, h as v, i as y, k as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, v as k, x as A, y as j } from "./input-group-8e8jjdvl.js";
|
|
2
|
+
import { $ as M, $n as N, $r as P, $t as F, A as I, An as L, Ar as R, At as z, B, Bn as V, Br as H, Bt as U, C as W, Cn as G, Cr as K, Ct as q, D as J, Dn as Y, Dr as X, Dt as Z, E as Q, En as $, Er as ee, Et as te, F as ne, Fn as re, Fr as ie, Ft as ae, G as oe, Gn as se, Gr as ce, Gt as le, H as ue, Hn as de, Hr as fe, Ht as pe, I as me, In as he, Ir as ge, It as _e, J as ve, Jn as ye, Jr as be, Jt as xe, K as Se, Kn as Ce, Kr as we, Kt as Te, L as Ee, Ln as De, Lr as Oe, Lt as ke, M as Ae, Mn as je, Mr as Me, Mt as Ne, N as Pe, Nn as Fe, Nr as Ie, Nt as Le, O as Re, On as ze, Or as Be, Ot as Ve, P as He, Pn as Ue, Pr as We, Pt as Ge, Q as Ke, Qn as qe, Qr as Je, Qt as Ye, R as Xe, Rn as Ze, Rr as Qe, Rt as $e, S as et, Sn as tt, Sr as nt, St as rt, T as it, Tn as at, Tr as ot, Tt as st, U as ct, Un as lt, Ur as ut, Ut as dt, V as ft, Vn as pt, Vr as mt, Vt as ht, W as gt, Wn as _t, Wr as vt, Wt as yt, X as bt, Xn as xt, Xr as St, Xt as Ct, Y as wt, Yn as Tt, Yr as Et, Yt as Dt, Z as Ot, Zn as kt, Zr as At, Zt as jt, _ as Mt, _n as Nt, _r as Pt, _t as Ft, a as It, ai as Lt, an as Rt, ar as zt, at as Bt, b as Vt, bn as Ht, br as Ut, bt as Wt, c as Gt, ci as Kt, cn as qt, cr as Jt, ct as Yt, d as Xt, dn as Zt, dr as Qt, dt as $t, ei as en, en as tn, er as nn, et as rn, f as an, fn as on, fr as sn, ft as cn, g as ln, gn as un, gr as dn, gt as fn, h as pn, hn as mn, hr as hn, ht as gn, i as _n, ii as vn, in as yn, ir as bn, it as xn, j as Sn, jn as Cn, jr as wn, jt as Tn, k as En, kn as Dn, kr as On, kt as kn, l as An, li as jn, ln as Mn, lr as Nn, lt as Pn, m as Fn, mn as In, mr as Ln, mt as Rn, n as zn, ni as Bn, nn as Vn, nr as Hn, nt as Un, o as Wn, oi as Gn, on as Kn, or as qn, ot as Jn, p as Yn, pn as Xn, pr as Zn, pt as Qn, q as $n, qn as er, qr as tr, qt as nr, r as rr, ri as ir, rn as ar, rr as or, rt as sr, s as cr, si as lr, sn as ur, sr as dr, st as fr, t as pr, ti as mr, tn as hr, tr as gr, tt as _r, u as vr, ui as yr, un as br, ur as xr, ut as Sr, v as Cr, vn as wr, vr as Tr, vt as Er, w as Dr, wn as Or, wr as kr, wt as Ar, x as jr, xn as Mr, xr as Nr, xt as Pr, y as Fr, yn as Ir, yr as Lr, yt as Rr, z as zr, zn as Br, zr as Vr, zt as Hr } from "./toggle-group-D2isQKZo.js";
|
|
3
3
|
export { Ln as Accordion, hn as AccordionContent, dn as AccordionItem, Pt as AccordionTrigger, P as Alert, en as AlertAction, mr as AlertDescription, mt as AlertDialog, fe as AlertDialogAction, ut as AlertDialogCancel, vt as AlertDialogContent, ce as AlertDialogDescription, we as AlertDialogFooter, tr as AlertDialogHeader, be as AlertDialogMedia, Et as AlertDialogOverlay, St as AlertDialogPortal, At as AlertDialogTitle, Je as AlertDialogTrigger, Bn as AlertProvider, ir as AlertTitle, Zn as AspectRatio, sn as Avatar, xr as Badge, or as Breadcrumb, bn as BreadcrumbEllipsis, zt as BreadcrumbItem, qn as BreadcrumbLink, dr as BreadcrumbList, Jt as BreadcrumbPage, Nn as BreadcrumbSeparator, l as Button, qe as ButtonGroup, N as ButtonGroupSeparator, nn as ButtonGroupText, se as Card, Ce as CardAction, er as CardContent, ye as CardDescription, Tt as CardFooter, xt as CardHeader, kt as CardTitle, _t as Checkbox, pt as Collapsible, de as CollapsibleContent, lt as CollapsibleTrigger, Vr as ConfirmationDialogProvider, $ as ContextMenu, Y as ContextMenuCheckboxItem, ze as ContextMenuContent, Dn as ContextMenuGroup, L as ContextMenuItem, Cn as ContextMenuLabel, je as ContextMenuPortal, Fe as ContextMenuRadioGroup, Ue as ContextMenuRadioItem, re as ContextMenuSeparator, he as ContextMenuShortcut, De as ContextMenuSub, Ze as ContextMenuSubContent, Br as ContextMenuSubTrigger, V as ContextMenuTrigger, o as DEFAULT_OPSFUSE_BRAND_THEME, g as Dialog, T as DialogClose, S as DialogContent, v as DialogDescription, _ as DialogFooter, f as DialogHeader, k as DialogOverlay, j as DialogPortal, m as DialogProvider, A as DialogTitle, u as DialogTrigger, Or as DirectionProvider, G as DropdownMenu, tt as Empty, on as Field, Xn as FieldContent, In as FieldDescription, mn as FieldError, un as FieldGroup, Nt as FieldLabel, wr as FieldLegend, Ir as FieldSeparator, Ht as FieldSet, Mr as FieldTitle, Mn as HoverCard, br as HoverCardContent, Zt as HoverCardTrigger, h as Input, O as InputGroup, C as InputGroupAddon, E as InputGroupButton, y as InputGroupInput, p as InputGroupText, w as InputGroupTextarea, Ye as Item, F as ItemActions, tn as ItemContent, hr as ItemDescription, Vn as ItemFooter, ar as ItemGroup, yn as ItemHeader, Rt as ItemMedia, Kn as ItemSeparator, ur as ItemTitle, Ct as Kbd, jt as KbdGroup, x as Label, Ge as Menubar, ae as MenubarCheckboxItem, _e as MenubarContent, ke as MenubarGroup, $e as MenubarItem, Hr as MenubarLabel, U as MenubarMenu, ht as MenubarPortal, pe as MenubarRadioGroup, dt as MenubarRadioItem, yt as MenubarSeparator, le as MenubarShortcut, Te as MenubarSub, nr as MenubarSubContent, xe as MenubarSubTrigger, Dt as MenubarTrigger, st as NavigationMenu, te as NavigationMenuContent, Z as NavigationMenuIndicator, Ve as NavigationMenuItem, kn as NavigationMenuLink, z as NavigationMenuList, Tn as NavigationMenuTrigger, Ne as NavigationMenuViewport, s as OPSFUSE_BRAND_THEMES, e as OPSFUSE_THEME_SCOPE, Lr as OpsfuseRoot, Ut as OpsfuseThemeProvider, qt as PageHeader, Er as Pagination, Rr as PaginationContent, Wt as PaginationEllipsis, Pr as PaginationItem, rt as PaginationLink, q as PaginationNext, Ar as PaginationPrevious, Ft as PaginationWrapper, Sr as Popover, $t as PopoverAnchor, cn as PopoverContent, Qn as PopoverDescription, Rn as PopoverHeader, gn as PopoverTitle, fn as PopoverTrigger, Pn as Progress, fr as RadioGroup, Yt as RadioGroupItem, yr as RecruitSmartly, xn as ResizableHandle, Bt as ResizablePanel, Jn as ResizablePanelGroup, oe as SSelect, K as STooltip, Un as ScrollArea, sr as ScrollBar, gt as Select, Se as SelectContent, $n as SelectField, ve as SelectGroup, wt as SelectItem, bt as SelectLabel, Ot as SelectScrollDownButton, Ke as SelectScrollUpButton, M as SelectSeparator, rn as SelectTrigger, _r as SelectValue, Hn as Separator, On as Sheet, R as SheetClose, wn as SheetContent, Me as SheetDescription, Ie as SheetFooter, We as SheetHeader, ie as SheetProvider, ge as SheetTitle, Oe as SheetTrigger, Fr as Sidebar, Vt as SidebarContent, jr as SidebarFooter, et as SidebarGroup, W as SidebarGroupAction, Dr as SidebarGroupContent, it as SidebarGroupLabel, Q as SidebarHeader, J as SidebarInput, Re as SidebarInset, En as SidebarMenu, I as SidebarMenuAction, Sn as SidebarMenuBadge, Ae as SidebarMenuButton, Pe as SidebarMenuItem, He as SidebarMenuSkeleton, ne as SidebarMenuSub, me as SidebarMenuSubButton, Ee as SidebarMenuSubItem, Xe as SidebarProvider, zr as SidebarRail, B as SidebarSeparator, ft as SidebarTrigger, ct as Skeleton, jn as SkillReady, ee as Slider, X as SliderDialogProvider, a as Spinner, Cr as Switch, vr as Table, Xt as TableBody, an as TableCaption, Yn as TableCell, Fn as TableFooter, pn as TableHead, ln as TableHeader, Mt as TableRow, Wn as Tabs, It as TabsComponent, cr as TabsContent, Gt as TabsList, An as TabsTrigger, Kt as TalentScan, D as Textarea, rr as Toggle, pr as ToggleGroup, zn as ToggleGroupItem, Nr as Tooltip, nt as TooltipContent, kr as TooltipProvider, ot as TooltipTrigger, lr as Verity, Gn as WorkLog, Qt as badgeVariants, gr as buttonGroupVariants, i as buttonVariants, d as cn, H as confirm, vn as dismissAlert, r as mergeOpsfusePortalSurface, Le as navigationMenuTriggerStyle, t as openDialog, Qe as openSheet, Be as openSlider, n as opsfuseBrandThemeClass, Lt as showAlert, _n as toggleVariants, at as useDirection, Tr as useIsMobile, c as useOpsfuseBrandTheme, b as useOpsfusePortalSurface, ue as useSidebar };
|