@apcrda/ui 0.3.0
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 +93 -0
- package/dist/colors-C8Jz-F17.js +89 -0
- package/dist/components/Accordion/Accordion.d.ts +9 -0
- package/dist/components/Accordion/Accordion.types.d.ts +10 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +5 -0
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +15 -0
- package/dist/components/AlertDialog/index.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +13 -0
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +18 -0
- package/dist/components/Autocomplete/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +9 -0
- package/dist/components/Avatar/Avatar.types.d.ts +11 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +10 -0
- package/dist/components/Badge/Badge.types.d.ts +9 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +16 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +10 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +13 -0
- package/dist/components/Button/Button.types.d.ts +11 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Calendar/Calendar.d.ts +6 -0
- package/dist/components/Calendar/Calendar.types.d.ts +4 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/Card.types.d.ts +9 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +10 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +10 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Combobox/Combobox.d.ts +11 -0
- package/dist/components/Combobox/Combobox.types.d.ts +17 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +5 -0
- package/dist/components/CommandPalette/CommandPalette.types.d.ts +20 -0
- package/dist/components/CommandPalette/index.d.ts +2 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +5 -0
- package/dist/components/ContextMenu/ContextMenu.types.d.ts +16 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +10 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +11 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +11 -0
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +14 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +22 -0
- package/dist/components/Dialog/Dialog.types.d.ts +16 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Divider/Divider.d.ts +7 -0
- package/dist/components/Divider/Divider.types.d.ts +6 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +23 -0
- package/dist/components/Drawer/Drawer.types.d.ts +18 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.d.ts +11 -0
- package/dist/components/FileUpload/FileUpload.types.d.ts +13 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +13 -0
- package/dist/components/Input/Input.types.d.ts +9 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Label/Label.d.ts +4 -0
- package/dist/components/Label/Label.types.d.ts +6 -0
- package/dist/components/Label/index.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +11 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +17 -0
- package/dist/components/MultiSelect/index.d.ts +2 -0
- package/dist/components/NotificationCenter/NotificationCenter.d.ts +5 -0
- package/dist/components/NotificationCenter/NotificationCenter.types.d.ts +26 -0
- package/dist/components/NotificationCenter/NotificationItem.d.ts +8 -0
- package/dist/components/NotificationCenter/NotificationPanel.d.ts +2 -0
- package/dist/components/NotificationCenter/index.d.ts +4 -0
- package/dist/components/Pagination/Pagination.d.ts +13 -0
- package/dist/components/Pagination/Pagination.types.d.ts +15 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +8 -0
- package/dist/components/Popover/Popover.types.d.ts +9 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +10 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +15 -0
- package/dist/components/Select/Select.types.d.ts +17 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +5 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +27 -0
- package/dist/components/Sidebar/SidebarContent.d.ts +7 -0
- package/dist/components/Sidebar/SidebarContext.d.ts +3 -0
- package/dist/components/Sidebar/SidebarItem.d.ts +7 -0
- package/dist/components/Sidebar/index.d.ts +5 -0
- package/dist/components/Switch/Switch.d.ts +8 -0
- package/dist/components/Switch/Switch.types.d.ts +8 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +8 -0
- package/dist/components/Tabs/Tabs.types.d.ts +11 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +9 -0
- package/dist/components/Textarea/Textarea.types.d.ts +7 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Toast/Toast.types.d.ts +13 -0
- package/dist/components/Toast/Toaster.d.ts +4 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/useToast.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +12 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/helpers-CgZQleCk.js +12 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useTheme.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +12254 -0
- package/dist/styles.css +2 -0
- package/dist/styles.js +0 -0
- package/dist/themes/ThemeProvider.d.ts +20 -0
- package/dist/themes/dark.d.ts +16 -0
- package/dist/themes/index.d.ts +4 -0
- package/dist/themes/light.d.ts +16 -0
- package/dist/themes-CF6D9f5U.js +91 -0
- package/dist/themes.js +2 -0
- package/dist/tokens/colors.d.ts +101 -0
- package/dist/tokens/index.d.ts +12 -0
- package/dist/tokens/motion.d.ts +14 -0
- package/dist/tokens/radius.d.ts +9 -0
- package/dist/tokens/shadows.d.ts +7 -0
- package/dist/tokens/spacing.d.ts +21 -0
- package/dist/tokens/typography.d.ts +63 -0
- package/dist/tokens-CLmSW3VY.js +100 -0
- package/dist/tokens.js +3 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/helpers.d.ts +7 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/mergeClasses.d.ts +1 -0
- package/dist/utils-BIF7GImV.js +1739 -0
- package/dist/utils.js +3 -0
- package/docs/Architecture.md +57 -0
- package/docs/Contributing.md +58 -0
- package/docs/Design-Principles.md +37 -0
- package/package.json +124 -0
package/dist/utils.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
APCRDA UI is a single Vite Library Mode project. It is not a monorepo and does not use workspaces. The package is published as `@apcrda/ui`.
|
|
4
|
+
|
|
5
|
+
## Folder Structure
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
src/
|
|
9
|
+
components/
|
|
10
|
+
hooks/
|
|
11
|
+
styles/
|
|
12
|
+
themes/
|
|
13
|
+
tokens/
|
|
14
|
+
utils/
|
|
15
|
+
index.ts
|
|
16
|
+
.storybook/
|
|
17
|
+
docs/
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Component Anatomy
|
|
21
|
+
|
|
22
|
+
Each component lives in its own folder:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Button/
|
|
26
|
+
Button.tsx
|
|
27
|
+
Button.types.ts
|
|
28
|
+
Button.test.tsx
|
|
29
|
+
Button.stories.tsx
|
|
30
|
+
index.ts
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Components use `forwardRef`, explicit prop types, CVA variants, Tailwind classes, CSS variables, and accessibility semantics. Radix UI is used where behavior and ARIA patterns are non-trivial.
|
|
34
|
+
|
|
35
|
+
## Public API
|
|
36
|
+
|
|
37
|
+
The package root exports components, prop types, hooks, themes, tokens, and utilities through `src/index.ts`.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { Button, Input, Card, ThemeProvider } from '@apcrda/ui'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The stylesheet is exported as:
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import '@apcrda/ui/styles.css'
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Build Strategy
|
|
50
|
+
|
|
51
|
+
Vite emits ESM modules with preserved module boundaries for tree shaking. TypeScript declarations are generated with `vite-plugin-dts`.
|
|
52
|
+
|
|
53
|
+
React and React DOM are peer dependencies. APCRDA UI runtime dependencies such as Radix UI, CVA, Tailwind Merge, Lucide React, React Hook Form, and Zod are packaged as normal npm dependencies.
|
|
54
|
+
|
|
55
|
+
## Storybook
|
|
56
|
+
|
|
57
|
+
Storybook is the primary development environment. It is used for component development, documentation, accessibility review, theme switching, and visual review.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Local Development
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install
|
|
7
|
+
npm run dev
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Storybook is the default development surface.
|
|
11
|
+
|
|
12
|
+
## Component Checklist
|
|
13
|
+
|
|
14
|
+
Every new component should include:
|
|
15
|
+
|
|
16
|
+
- `Component.tsx`
|
|
17
|
+
- `Component.types.ts`
|
|
18
|
+
- `Component.test.tsx`
|
|
19
|
+
- `Component.stories.tsx`
|
|
20
|
+
- `index.ts`
|
|
21
|
+
|
|
22
|
+
Use `forwardRef`, strict prop types, CVA variants where variants exist, Tailwind classes, CSS variables, and accessible semantics.
|
|
23
|
+
|
|
24
|
+
## Testing
|
|
25
|
+
|
|
26
|
+
Run:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm run test -- --run
|
|
30
|
+
npm run typecheck
|
|
31
|
+
npm run build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Tests should cover rendering, disabled states, loading states, keyboard or pointer interaction where relevant, and ARIA behavior.
|
|
35
|
+
|
|
36
|
+
## Naming
|
|
37
|
+
|
|
38
|
+
- Components use PascalCase.
|
|
39
|
+
- Props use clear domain-neutral names.
|
|
40
|
+
- Tokens use lowercase semantic names.
|
|
41
|
+
- CSS variables use the `--apcrda-*` prefix.
|
|
42
|
+
|
|
43
|
+
## Publishing
|
|
44
|
+
|
|
45
|
+
Use Changesets for versioning:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm run changeset
|
|
49
|
+
npm run version-packages
|
|
50
|
+
npm run build
|
|
51
|
+
npm publish
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For GitLab Package Registry, configure `.npmrc` with the APCRDA scope and run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm run publish:gitlab
|
|
58
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Design Principles
|
|
2
|
+
|
|
3
|
+
APCRDA UI follows Material Design 3 principles adapted for enterprise government software.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
- Target WCAG 2.1 AA.
|
|
8
|
+
- Preserve visible focus states.
|
|
9
|
+
- Support keyboard navigation.
|
|
10
|
+
- Use semantic HTML and Radix primitives for complex controls.
|
|
11
|
+
- Keep disabled and loading states programmatically discoverable through native attributes or ARIA.
|
|
12
|
+
|
|
13
|
+
## Visual System
|
|
14
|
+
|
|
15
|
+
- Use calm, high-contrast surfaces suitable for long-form administrative work.
|
|
16
|
+
- Prefer clear labels, consistent spacing, and predictable controls.
|
|
17
|
+
- Use restrained elevation for hierarchy.
|
|
18
|
+
- Avoid decorative styling that reduces legibility or scanability.
|
|
19
|
+
|
|
20
|
+
## Tokens
|
|
21
|
+
|
|
22
|
+
Tokens define color, typography, spacing, radius, shadows, and motion. They are available as TypeScript objects and CSS variables.
|
|
23
|
+
|
|
24
|
+
## Themes
|
|
25
|
+
|
|
26
|
+
Themes are applied through:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
data-theme="light"
|
|
30
|
+
data-theme="dark"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Components must use theme variables instead of hard-coded theme colors wherever possible.
|
|
34
|
+
|
|
35
|
+
## Mobile First
|
|
36
|
+
|
|
37
|
+
Components should be usable on small screens first, with touch-friendly hit areas and layouts that wrap without clipping.
|
package/package.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apcrda/ui",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "APCRDA UI is a production-ready React design system for APCRDA applications.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "APCRDA",
|
|
8
|
+
"homepage": "https://gitlab.com/apcrda/apcrda-ui",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://gitlab.com/apcrda/apcrda-ui.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://gitlab.com/apcrda/apcrda-ui/-/issues"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"docs/Architecture.md",
|
|
20
|
+
"docs/Design-Principles.md",
|
|
21
|
+
"docs/Contributing.md"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"dist/styles.css",
|
|
25
|
+
"src/styles/*.css"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./styles.css": "./dist/styles.css",
|
|
33
|
+
"./tokens": {
|
|
34
|
+
"types": "./dist/tokens/index.d.ts",
|
|
35
|
+
"import": "./dist/tokens.js"
|
|
36
|
+
},
|
|
37
|
+
"./themes": {
|
|
38
|
+
"types": "./dist/themes/index.d.ts",
|
|
39
|
+
"import": "./dist/themes.js"
|
|
40
|
+
},
|
|
41
|
+
"./utils": {
|
|
42
|
+
"types": "./dist/utils/index.d.ts",
|
|
43
|
+
"import": "./dist/utils.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"main": "./dist/index.js",
|
|
47
|
+
"module": "./dist/index.js",
|
|
48
|
+
"types": "./dist/index.d.ts",
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"registry": "https://registry.npmjs.org/"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "storybook dev -p 6006",
|
|
55
|
+
"storybook": "storybook dev -p 6006",
|
|
56
|
+
"build": "tsc -p tsconfig.json --pretty && vite build && tsc -p tsconfig.build.json --pretty",
|
|
57
|
+
"build:storybook": "storybook build",
|
|
58
|
+
"typecheck": "tsc -p tsconfig.json --pretty",
|
|
59
|
+
"test": "vitest",
|
|
60
|
+
"test:watch": "vitest --watch",
|
|
61
|
+
"lint": "eslint .",
|
|
62
|
+
"changeset": "changeset",
|
|
63
|
+
"version-packages": "changeset version",
|
|
64
|
+
"publish:npm": "npm publish",
|
|
65
|
+
"publish:gitlab": "npm publish --registry ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"react": "^19.0.0",
|
|
69
|
+
"react-dom": "^19.0.0"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@radix-ui/react-accordion": "^1.2.14",
|
|
73
|
+
"@radix-ui/react-alert-dialog": "^1.1.17",
|
|
74
|
+
"@radix-ui/react-avatar": "^1.2.0",
|
|
75
|
+
"@radix-ui/react-checkbox": "^1.3.5",
|
|
76
|
+
"@radix-ui/react-context-menu": "^2.3.1",
|
|
77
|
+
"@radix-ui/react-dialog": "^1.1.17",
|
|
78
|
+
"@radix-ui/react-label": "^2.1.10",
|
|
79
|
+
"@radix-ui/react-popover": "^1.1.17",
|
|
80
|
+
"@radix-ui/react-radio-group": "^1.4.1",
|
|
81
|
+
"@radix-ui/react-select": "^2.3.1",
|
|
82
|
+
"@radix-ui/react-switch": "^1.3.1",
|
|
83
|
+
"@radix-ui/react-tabs": "^1.1.15",
|
|
84
|
+
"@radix-ui/react-toast": "^1.2.17",
|
|
85
|
+
"@radix-ui/react-tooltip": "^1.2.10",
|
|
86
|
+
"class-variance-authority": "^0.7.1",
|
|
87
|
+
"clsx": "^2.1.1",
|
|
88
|
+
"cmdk": "^1.1.1",
|
|
89
|
+
"date-fns": "^4.4.0",
|
|
90
|
+
"lucide-react": "^1.21.0",
|
|
91
|
+
"react-day-picker": "^10.0.1",
|
|
92
|
+
"react-hook-form": "^7.80.0",
|
|
93
|
+
"tailwind-merge": "^3.6.0",
|
|
94
|
+
"zod": "^4.4.3"
|
|
95
|
+
},
|
|
96
|
+
"devDependencies": {
|
|
97
|
+
"@changesets/cli": "^2.30.0",
|
|
98
|
+
"@eslint/js": "^10.0.1",
|
|
99
|
+
"@storybook/addon-a11y": "^10.4.6",
|
|
100
|
+
"@storybook/addon-docs": "^10.4.6",
|
|
101
|
+
"@storybook/addon-themes": "^10.4.6",
|
|
102
|
+
"@storybook/react-vite": "^10.4.6",
|
|
103
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
104
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
105
|
+
"@testing-library/react": "^16.3.1",
|
|
106
|
+
"@testing-library/user-event": "^14.6.1",
|
|
107
|
+
"@types/node": "^24.12.3",
|
|
108
|
+
"@types/react": "^19.2.14",
|
|
109
|
+
"@types/react-dom": "^19.2.3",
|
|
110
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
111
|
+
"eslint": "^10.3.0",
|
|
112
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
113
|
+
"globals": "^17.6.0",
|
|
114
|
+
"jsdom": "^27.3.0",
|
|
115
|
+
"react": "^19.2.6",
|
|
116
|
+
"react-dom": "^19.2.6",
|
|
117
|
+
"storybook": "^10.4.6",
|
|
118
|
+
"tailwindcss": "^4.1.18",
|
|
119
|
+
"typescript": "~6.0.2",
|
|
120
|
+
"typescript-eslint": "^8.59.2",
|
|
121
|
+
"vite": "^8.0.12",
|
|
122
|
+
"vitest": "^4.0.16"
|
|
123
|
+
}
|
|
124
|
+
}
|