@bizapps/design-system-testing 1.0.7 → 1.0.10

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 CHANGED
@@ -1,41 +1,74 @@
1
- # @bizapps/design-system-testing
1
+ # @bizapps/ui — TCCE Design System
2
2
 
3
- A React component library built for TCCE CRM applications. Provides reusable, consistent UI components built with React, TypeScript, and Tailwind CSS v4.
3
+ A React component library built for TCCE CRM applications. Provides reusable, accessible UI components built with React, TypeScript, and Tailwind CSS v4.
4
+
5
+ > **This is the production package.** For internal testing during development, use [`@bizapps/design-system-testing`](#packages).
4
6
 
5
7
  ---
6
8
 
7
9
  ## Table of Contents
8
10
 
11
+ - [Packages](#packages)
9
12
  - [Requirements](#requirements)
10
13
  - [Installation](#installation)
11
14
  - [Setup](#setup)
12
15
  - [Usage](#usage)
13
16
  - [Available Components](#available-components)
17
+ - [Brand Assets](#brand-assets)
14
18
  - [Design Tokens](#design-tokens)
15
- - [Contributing](#contributing)
19
+ - [Local Development](#local-development)
16
20
  - [Publishing a New Version](#publishing-a-new-version)
17
21
  - [Troubleshooting](#troubleshooting)
18
22
 
19
23
  ---
20
24
 
21
- ## Requirements
25
+ ## Packages
22
26
 
23
- Your project must have the following installed before using this library:
27
+ | Package | Purpose | Branch |
28
+ |---|---|---|
29
+ | `@bizapps/ui` | **Production.** Use this in all real projects. | `main` |
30
+ | `@bizapps/design-system-testing` | **Internal testing only.** Never install in real projects. | `develop` |
31
+
32
+ ---
24
33
 
25
- | Package | Version |
26
- | ------------------- | ------- |
27
- | `react` | ^19 |
28
- | `react-dom` | ^19 |
29
- | `tailwindcss` | ^4 |
30
- | `@tailwindcss/vite` | ^4 |
34
+ ## Requirements
31
35
 
32
- > **Note:** `shadcn`, `tw-animate-css`, and font packages are already bundled inside the library's CSS. You do **not** need to install them separately.
36
+ Your project must have the following installed:
37
+
38
+ | Package | Version |
39
+ |---|---|
40
+ | `react` | ^19 |
41
+ | `react-dom` | ^19 |
42
+ | `tailwindcss` | ^4 |
43
+ | `@tailwindcss/vite` | ^4 |
44
+
45
+ The following peer dependencies are **required** for specific components. Install only what you use:
46
+
47
+ | Package | Used by |
48
+ |---|---|
49
+ | `lucide-react` | Icon support across components |
50
+ | `radix-ui` | Dialog, Popover, Tooltip, Select, and more |
51
+ | `zod` | Form validation |
52
+ | `react-hook-form` + `@hookform/resolvers` | Form state management |
53
+ | `@tanstack/react-table` | DataTable component |
54
+ | `motion` | Animation tokens |
55
+ | `next-themes` | Theme provider |
56
+ | `sonner` | Toast notifications |
57
+ | `react-day-picker` | Calendar and DatePicker |
58
+ | `embla-carousel-react` | Carousel component |
59
+ | `@schedule-x/*` | EventCalendar component |
60
+
61
+ > Fonts (`Dax`, `Helvetica Neue`) are served automatically via CDN — no font packages needed.
33
62
 
34
63
  ---
35
64
 
36
65
  ## Installation
37
66
 
38
67
  ```bash
68
+ # Production
69
+ pnpm add @bizapps/ui
70
+
71
+ # Internal testing only
39
72
  pnpm add @bizapps/design-system-testing
40
73
  ```
41
74
 
@@ -43,7 +76,22 @@ pnpm add @bizapps/design-system-testing
43
76
 
44
77
  ## Setup
45
78
 
46
- ### 1. Configure Vite
79
+ ### 1. Wrap your app with `TCCEProvider`
80
+
81
+ The `TCCEProvider` initializes theming and global context. It must wrap your entire application:
82
+
83
+ ```tsx
84
+ // src/main.tsx
85
+ import { TCCEProvider } from '@bizapps/ui';
86
+
87
+ ReactDOM.createRoot(document.getElementById('root')!).render(
88
+ <TCCEProvider>
89
+ <App />
90
+ </TCCEProvider>
91
+ );
92
+ ```
93
+
94
+ ### 2. Configure Vite
47
95
 
48
96
  Add the Tailwind CSS plugin to your `vite.config.ts`:
49
97
 
@@ -53,30 +101,29 @@ import react from '@vitejs/plugin-react';
53
101
  import tailwindcss from '@tailwindcss/vite';
54
102
 
55
103
  export default defineConfig({
56
- plugins: [react(), tailwindcss()],
104
+ plugins: [react(), tailwindcss()],
57
105
  });
58
106
  ```
59
107
 
60
- ### 2. Import the styles
108
+ ### 3. Import the styles
61
109
 
62
110
  In your main CSS file (e.g. `src/index.css`), add these two lines **in this order**:
63
111
 
64
112
  ```css
65
113
  @import 'tailwindcss';
66
- @import '@bizapps/design-system-testing/styles';
114
+ @import '@bizapps/ui/styles';
67
115
  ```
68
116
 
69
117
  > **Important:** `tailwindcss` must come **before** the library styles so that Tailwind's base layer is available when the library's theme tokens are applied.
70
118
 
71
- ### 3. Import the CSS in your entry point
72
-
73
- Make sure your `src/main.tsx` imports the CSS file:
119
+ ### 4. Import the CSS in your entry point
74
120
 
75
121
  ```tsx
122
+ // src/main.tsx
76
123
  import './index.css';
77
124
  ```
78
125
 
79
- That's it. No further configuration is needed.
126
+ That's it. Fonts load automatically from the CDN — no extra configuration needed.
80
127
 
81
128
  ---
82
129
 
@@ -85,14 +132,14 @@ That's it. No further configuration is needed.
85
132
  Import components directly from the package:
86
133
 
87
134
  ```tsx
88
- import { Button } from '@bizapps/design-system-testing';
135
+ import { Button, Badge, Text } from '@bizapps/ui';
89
136
 
90
137
  function App() {
91
- return (
92
- <Button variant='primary' size='md'>
93
- Click me
94
- </Button>
95
- );
138
+ return (
139
+ <Button variant="primary" size="md">
140
+ Click me
141
+ </Button>
142
+ );
96
143
  }
97
144
  ```
98
145
 
@@ -100,52 +147,109 @@ function App() {
100
147
 
101
148
  ## Available Components
102
149
 
103
- ### Button
150
+ > 📖 **Full component documentation and interactive examples:**
151
+ > `[Storybook preview — link coming soon]`
152
+
153
+ ### UI Components
154
+
155
+ | Component | Import |
156
+ |---|---|
157
+ | `Accordion` | `import { Accordion } from '@bizapps/ui'` |
158
+ | `Alert` | `import { Alert } from '@bizapps/ui'` |
159
+ | `AlertDialog` | `import { AlertDialog } from '@bizapps/ui'` |
160
+ | `Avatar` | `import { Avatar } from '@bizapps/ui'` |
161
+ | `Badge` | `import { Badge } from '@bizapps/ui'` |
162
+ | `Breadcrumb` | `import { Breadcrumb } from '@bizapps/ui'` |
163
+ | `Button` | `import { Button } from '@bizapps/ui'` |
164
+ | `Calendar` | `import { Calendar } from '@bizapps/ui'` |
165
+ | `Card` | `import { Card } from '@bizapps/ui'` |
166
+ | `Carousel` | `import { Carousel } from '@bizapps/ui'` |
167
+ | `Checkbox` | `import { Checkbox } from '@bizapps/ui'` |
168
+ | `Combobox` | `import { Combobox } from '@bizapps/ui'` |
169
+ | `Dialog` | `import { Dialog } from '@bizapps/ui'` |
170
+ | `DropdownMenu` | `import { DropdownMenu } from '@bizapps/ui'` |
171
+ | `Dropzone` | `import { Dropzone } from '@bizapps/ui'` |
172
+ | `Empty` | `import { Empty } from '@bizapps/ui'` |
173
+ | `Input` | `import { Input } from '@bizapps/ui'` |
174
+ | `Item` | `import { Item } from '@bizapps/ui'` |
175
+ | `Link` | `import { Link } from '@bizapps/ui'` |
176
+ | `MiniCalendar` | `import { MiniCalendar } from '@bizapps/ui'` |
177
+ | `PinInput` | `import { PinInput } from '@bizapps/ui'` |
178
+ | `Popover` | `import { Popover } from '@bizapps/ui'` |
179
+ | `Progress` | `import { Progress } from '@bizapps/ui'` |
180
+ | `Radio` | `import { RadioGroup } from '@bizapps/ui'` |
181
+ | `Select` | `import { Select } from '@bizapps/ui'` |
182
+ | `Separator` | `import { Separator } from '@bizapps/ui'` |
183
+ | `Skeleton` | `import { Skeleton } from '@bizapps/ui'` |
184
+ | `Slider` | `import { Slider } from '@bizapps/ui'` |
185
+ | `Spinner` | `import { Spinner } from '@bizapps/ui'` |
186
+ | `Status` | `import { Status } from '@bizapps/ui'` |
187
+ | `Switch` | `import { Switch } from '@bizapps/ui'` |
188
+ | `Table` | `import { Table } from '@bizapps/ui'` |
189
+ | `Tabs` | `import { Tabs } from '@bizapps/ui'` |
190
+ | `Text` | `import { Text } from '@bizapps/ui'` |
191
+ | `Toast` | `import { Toast } from '@bizapps/ui'` |
192
+ | `Toggle` | `import { Toggle } from '@bizapps/ui'` |
193
+ | `ToggleGroup` | `import { ToggleGroup } from '@bizapps/ui'` |
194
+ | `Tooltip` | `import { Tooltip } from '@bizapps/ui'` |
195
+
196
+ ### Compound Components
197
+
198
+ | Component | Import |
199
+ |---|---|
200
+ | `AppShell` | `import { AppShell } from '@bizapps/ui'` |
201
+ | `ColorPicker` | `import { ColorPicker } from '@bizapps/ui'` |
202
+ | `DataTable` | `import { DataTable } from '@bizapps/ui'` |
203
+ | `DatePicker` | `import { DatePicker } from '@bizapps/ui'` |
204
+ | `EventCalendar` | `import { EventCalendar } from '@bizapps/ui'` |
205
+ | `Form` | `import { Form, FormField, FormLabel } from '@bizapps/ui'` |
206
+ | `NavBar` | `import { NavBar } from '@bizapps/ui'` |
207
+ | `Pagination` | `import { Pagination } from '@bizapps/ui'` |
208
+ | `SegmentedControl` | `import { SegmentedControl } from '@bizapps/ui'` |
209
+ | `TextArea` | `import { TextArea } from '@bizapps/ui'` |
210
+
211
+ ### Authorization
212
+
213
+ | Export | Import |
214
+ |---|---|
215
+ | `Can`, `CanNot` | `import { Can, CanNot } from '@bizapps/ui'` |
216
+ | `AbilityProvider`, `useAbility`, `useCan` | `import { AbilityProvider, useAbility, useCan } from '@bizapps/ui'` |
104
217
 
105
- ```tsx
106
- import { Button } from '@bizapps/design-system-testing';
107
- ```
218
+ ---
219
+
220
+ ## Brand Assets
108
221
 
109
- #### Props
222
+ Fonts and logos are served via CloudFront CDN (`https://dibt9vplwriap.cloudfront.net`).
110
223
 
111
- | Prop | Type | Default | Description |
112
- | ----------- | -------------------------------------------------------------- | ----------- | ----------------------------------------- |
113
- | `variant` | `'primary' \| 'secondary' \| 'cancel' \| 'outline' \| 'ghost'` | `'primary'` | Visual style of the button |
114
- | `size` | `'sm' \| 'md' \| 'lg' \| 'icon-sm'` | `'md'` | Size of the button |
115
- | `isLoading` | `boolean` | `false` | Shows a loading state |
116
- | `disabled` | `boolean` | `false` | Disables the button |
117
- | `asChild` | `boolean` | `false` | Renders as child element (via Radix Slot) |
224
+ **Fonts** load automatically when you import the library styles — no configuration needed.
118
225
 
119
- #### Examples
226
+ **Logos** are available as a typed object:
120
227
 
121
228
  ```tsx
122
- // Variants
123
- <Button variant="primary">Primary</Button>
124
- <Button variant="secondary">Secondary</Button>
125
- <Button variant="cancel">Cancel</Button>
126
- <Button variant="outline">Outline</Button>
127
- <Button variant="ghost">Ghost</Button>
128
-
129
- // Sizes
130
- <Button size="sm">Small</Button>
131
- <Button size="md">Medium</Button>
132
- <Button size="lg">Large</Button>
133
-
134
- // States
135
- <Button disabled>Disabled</Button>
136
- <Button isLoading>Loading...</Button>
137
-
138
- // As a link (using asChild)
139
- <Button asChild variant="primary">
140
- <a href="/dashboard">Go to Dashboard</a>
141
- </Button>
229
+ import { logos, type LogoKey } from '@bizapps/ui';
230
+
231
+ // 8 variants: color | colorAna | colorAnaa | negative | positive | grayScale | monochBlack | monochOrange
232
+ <img src={logos.color} alt="TCCE Logo" />
233
+ <img src={logos.negative} alt="TCCE Logo" height={40} />
142
234
  ```
143
235
 
144
236
  ---
145
237
 
146
238
  ## Design Tokens
147
239
 
148
- The library exposes a full set of CSS custom properties (design tokens) that you can use directly in your project's styles. These are injected globally when you import the library styles.
240
+ All tokens are injected globally when you import the library styles and are also available as Tailwind utility classes.
241
+
242
+ ### Typography
243
+
244
+ | Font | Weights | Use |
245
+ |---|---|---|
246
+ | `Dax` | 400, 700 | Headings and display text |
247
+ | `Helvetica Neue` | 100–900 (normal + italic) | Body text, UI labels |
248
+
249
+ ```css
250
+ .heading { font-family: 'Dax', Arial, sans-serif; font-weight: 700; }
251
+ .body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; }
252
+ ```
149
253
 
150
254
  ### Colors
151
255
 
@@ -157,14 +261,11 @@ The library exposes a full set of CSS custom properties (design tokens) that you
157
261
 
158
262
  /* Semantic */
159
263
  --color-main-positive-state: #01d42f; /* success */
160
- --color-main-warning-state: #ea3a3d; /* error/danger */
264
+ --color-main-warning-state: #ea3a3d; /* error / danger */
161
265
  --color-main-yellow-primary: #faca4a; /* warning */
162
266
 
163
- /* Scales: dark, light, blue, red, orange, yellow, green, purple */
164
- /* Each scale goes from 100 (lightest) to 1000 (darkest) */
165
- --color-blue-100 through --color-blue-1000
166
- --color-green-100 through --color-green-1000
167
- /* ...etc */
267
+ /* Scales: blue, green, red, orange, yellow, purple, dark, light */
268
+ /* Each scale: 100 (lightest) → 1000 (darkest) */
168
269
  ```
169
270
 
170
271
  ### Border Radius
@@ -187,41 +288,17 @@ The library exposes a full set of CSS custom properties (design tokens) that you
187
288
  --shadow-hover-orange-button
188
289
  ```
189
290
 
190
- ### Typography
191
-
192
- The library includes the following fonts, loaded automatically:
193
-
194
- - **Inter Variable** — primary UI font (`--font-sans`)
195
- - **Dax** — brand heading font
196
- - **Helvetica Neue** — secondary font
197
-
198
- ### Using tokens in your CSS
199
-
200
- ```css
201
- .my-card {
202
- background: var(--color-main-white);
203
- border-radius: var(--border-radius-card);
204
- box-shadow: var(--shadow-black-card);
205
- }
206
-
207
- .my-card:hover {
208
- box-shadow: var(--shadow-hover-black-card);
209
- }
210
- ```
211
-
212
- ### Using tokens in Tailwind classes
213
-
214
- The tokens are also registered as Tailwind theme values, so you can use them as utility classes:
291
+ ### Using tokens in Tailwind
215
292
 
216
293
  ```tsx
217
- <div className='bg-main-blue-primary text-main-white rounded-card shadow-black-card'>Hello</div>
294
+ <div className="bg-main-blue-primary text-main-white rounded-card shadow-black-card">
295
+ Hello
296
+ </div>
218
297
  ```
219
298
 
220
299
  ---
221
300
 
222
- ## Contributing
223
-
224
- ### Local Development
301
+ ## Local Development
225
302
 
226
303
  ```bash
227
304
  # Clone the repo
@@ -240,14 +317,7 @@ pnpm dev
240
317
  # → http://localhost:5173
241
318
  ```
242
319
 
243
- ### Adding a New Component
244
-
245
- 1. Create the component folder under `src/components/ui/ComponentName/`
246
- 2. Build the component following the existing `Button` pattern
247
- 3. Export it from `src/main.ts`
248
- 4. Add a Storybook story under `src/stories/`
249
-
250
- ### Code Quality
320
+ ### Code quality
251
321
 
252
322
  ```bash
253
323
  pnpm lint # check for lint errors
@@ -256,35 +326,72 @@ pnpm format # format with Prettier
256
326
  pnpm type-check # TypeScript check without building
257
327
  ```
258
328
 
329
+ ### Adding a new component
330
+
331
+ 1. Run the shadcn CLI first if the component exists in the registry:
332
+ ```bash
333
+ pnpm dlx shadcn@latest add <component-name>
334
+ ```
335
+ 2. Adapt the generated file to TCCE design tokens (colors, radius, typography)
336
+ 3. Export it from `src/main.ts`
337
+ 4. Add a Storybook story under `src/stories/`
338
+
339
+ > For full contributor guidelines see the [Confluence documentation](https://tcce-tech.atlassian.net/wiki/spaces/DOCAPLSOL/pages/19333122).
340
+
259
341
  ---
260
342
 
261
343
  ## Publishing a New Version
262
344
 
263
- 1. Make your changes and commit them:
345
+ Publishing is **fully automated** via GitHub Actions. Never run `pnpm publish` manually.
264
346
 
265
- ```bash
266
- git add -A
267
- git commit -m "feat: description of changes"
268
- ```
347
+ ### Branch → Package mapping
348
+
349
+ | Branch | Tag pattern | Publishes |
350
+ |---|---|---|
351
+ | `develop` | `dev-v*` e.g. `dev-v1.0.8` | `@bizapps/design-system-testing` |
352
+ | `main` | `v*` e.g. `v1.0.1` | `@bizapps/ui` |
269
353
 
270
- 2. Update the version in `package.json` following [semver](https://semver.org/):
271
- - `patch` (0.4.x) → bug fixes
272
- - `minor` (0.x.0) → new components or features
273
- - `major` (x.0.0) → breaking changes
354
+ > Both branches have **independent** version numbers in `package.json` — they do not need to match.
274
355
 
275
- 3. Build the library:
356
+ ### Publish a testing version (from `develop`)
276
357
 
277
358
  ```bash
278
- pnpm build
359
+ git checkout develop && git pull origin develop
360
+
361
+ # Bump version in package.json, then:
362
+ git add package.json
363
+ git commit -m "chore: bump version to 1.0.8"
364
+ git push origin develop
365
+
366
+ git tag -a dev-v1.0.8 -m "Release dev-v1.0.8 - description"
367
+ git push origin dev-v1.0.8
368
+ # → publishes @bizapps/design-system-testing
279
369
  ```
280
370
 
281
- 4. Publish to npm:
371
+ ### Publish a production version (from `main`)
282
372
 
283
373
  ```bash
284
- npm publish --access public
374
+ git checkout main && git pull origin main
375
+
376
+ # Bump version in package.json, then:
377
+ git add package.json
378
+ git commit -m "chore: bump version to 1.0.1"
379
+ git push origin main
380
+
381
+ git tag -a v1.0.1 -m "Release v1.0.1 - description"
382
+ git push origin v1.0.1
383
+ # → publishes @bizapps/ui
285
384
  ```
286
385
 
287
- > Use `npm publish` (not `pnpm publish`) to avoid branch and git-state validation errors from pnpm.
386
+ > ⚠️ `v*` tags created from any branch other than `main` will be **rejected** by the CI.
387
+
388
+ ### Version convention (semver)
389
+
390
+ | Type | When | Example |
391
+ |---|---|---|
392
+ | `patch` (`x.x.+1`) | Bug fix, style tweak, minor refactor — no API change | `v1.0.0 → v1.0.1` |
393
+ | `minor` (`x.+1.0`) | New component or backwards-compatible feature | `v1.0.1 → v1.1.0` |
394
+ | `major` (`+1.0.0`) | Breaking change requiring updates in consuming apps | `v1.1.0 → v2.0.0` |
288
395
 
289
396
  ---
290
397
 
@@ -295,37 +402,28 @@ npm publish --access public
295
402
  Make sure the import order in your CSS file is correct — `tailwindcss` must come first:
296
403
 
297
404
  ```css
298
- @import 'tailwindcss'; /* ✅ first */
299
- @import '@bizapps/design-system-testing/styles'; /* ✅ second */
405
+ @import 'tailwindcss'; /* ✅ first */
406
+ @import '@bizapps/ui/styles'; /* ✅ second */
300
407
  ```
301
408
 
302
- ### `Cannot resolve './tokens.css'` or similar errors
409
+ ### Fonts not loading
303
410
 
304
- This means you're using an older version of the package (0.4.0 or 0.4.1). Update to the latest version:
411
+ Fonts are fetched from the CDN on first render. Make sure the app has internet access and that `dibt9vplwriap.cloudfront.net` is not blocked by a corporate proxy or firewall.
305
412
 
306
- ```bash
307
- pnpm add @bizapps/design-system-testing@latest
308
- ```
413
+ ### `v*` tag rejected by CI
309
414
 
310
- ### `Scope not found` on publish
311
-
312
- The npm scope `@bizapps` belongs to the `bizapps` npm user account. Make sure you're logged in as that user:
415
+ Tags matching `v*` can only be created from commits on `main`. If the workflow fails with `"Tag v* must be created from main"`, merge your changes to `main` first and re-tag from there.
313
416
 
314
- ```bash
315
- npm whoami # should return: bizapps
316
- npm login # if not logged in
317
- ```
417
+ ### Version already exists on npm
318
418
 
319
- ### pnpm `minimumReleaseAge` policy error
419
+ npm does not allow republishing the same version. Bump to the next version number, commit, and re-tag.
320
420
 
321
- If pnpm blocks installation of a recently published version, run:
421
+ ### `Scope not found` on publish
322
422
 
323
- ```bash
324
- pnpm config set minimum-release-age 0 --location project
325
- ```
423
+ The `NPM_TOKEN` secret in the GitHub repo must have publish permissions on the `@bizapps` scope. See the [Confluence deployment docs](https://tcce-tech.atlassian.net/wiki/spaces/DOCAPLSOL/pages/88834079) for token rotation steps.
326
424
 
327
425
  ---
328
426
 
329
427
  ## License
330
428
 
331
- MIT — BizAppsTotal &lt;bizapps@tcce.biz&gt;
429
+ MIT — BizAppsTotal <bizapps@tcce.biz>