@foundrykit/primitives 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.
- package/.turbo/turbo-build.log +68 -0
- package/.turbo/turbo-type-check.log +5 -0
- package/CHANGELOG.md +10 -0
- package/README.md +151 -0
- package/dist/index.js +13 -13
- package/package.json +5 -5
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @foundrykit/primitives@0.1.0 build /Users/isaacsneddon-jenkins/Desktop/projects/umi/projects/foundrykit/packages/primitives
|
|
4
|
+
> tsup
|
|
5
|
+
|
|
6
|
+
[34mCLI[39m Building entry: src/index.ts, src/components/avatar/index.tsx, src/components/badge/index.tsx, src/components/breadcrumb/index.tsx, src/components/button/index.tsx, src/components/card/index.tsx, src/components/checkbox/index.tsx, src/components/dropdown/index.tsx, src/components/input/index.tsx, src/components/label/index.tsx, src/components/popover/index.tsx, src/components/radio-group/index.tsx, src/components/select/index.tsx, src/components/separator/index.tsx, src/components/skeleton/index.tsx, src/components/switch/index.tsx, src/components/tabs/index.tsx, src/components/textarea/index.tsx
|
|
7
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.0
|
|
9
|
+
[34mCLI[39m Using tsup config: /Users/isaacsneddon-jenkins/Desktop/projects/umi/projects/foundrykit/packages/primitives/tsup.config.ts
|
|
10
|
+
[34mCLI[39m Target: es2022
|
|
11
|
+
[34mCLI[39m Cleaning output folder
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/components/popover/index.js [22m[32m195.00 B[39m
|
|
14
|
+
[32mESM[39m [1mdist/components/radio-group/index.js [22m[32m131.00 B[39m
|
|
15
|
+
[32mESM[39m [1mdist/components/select/index.js [22m[32m411.00 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/components/label/index.js [22m[32m85.00 B[39m
|
|
17
|
+
[32mESM[39m [1mdist/components/skeleton/index.js [22m[32m77.00 B[39m
|
|
18
|
+
[32mESM[39m [1mdist/components/separator/index.js [22m[32m93.00 B[39m
|
|
19
|
+
[32mESM[39m [1mdist/components/dropdown/index.js [22m[32m757.00 B[39m
|
|
20
|
+
[32mESM[39m [1mdist/components/textarea/index.js [22m[32m77.00 B[39m
|
|
21
|
+
[32mESM[39m [1mdist/components/tabs/index.js [22m[32m167.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist/chunk-FYCANIVJ.js [22m[32m1.87 KB[39m
|
|
23
|
+
[32mESM[39m [1mdist/index.js [22m[32m2.44 KB[39m
|
|
24
|
+
[32mESM[39m [1mdist/components/input/index.js [22m[32m71.00 B[39m
|
|
25
|
+
[32mESM[39m [1mdist/chunk-KZMSLRLW.js [22m[32m806.00 B[39m
|
|
26
|
+
[32mESM[39m [1mdist/components/switch/index.js [22m[32m87.00 B[39m
|
|
27
|
+
[32mESM[39m [1mdist/chunk-J4CRGO2P.js [22m[32m1.49 KB[39m
|
|
28
|
+
[32mESM[39m [1mdist/chunk-AADRFFPH.js [22m[32m5.89 KB[39m
|
|
29
|
+
[32mESM[39m [1mdist/chunk-J57CV3VT.js [22m[32m690.00 B[39m
|
|
30
|
+
[32mESM[39m [1mdist/chunk-I44GXEPN.js [22m[32m809.00 B[39m
|
|
31
|
+
[32mESM[39m [1mdist/chunk-QL4XJD7Y.js [22m[32m627.00 B[39m
|
|
32
|
+
[32mESM[39m [1mdist/chunk-VVNIYCKH.js [22m[32m1.04 KB[39m
|
|
33
|
+
[32mESM[39m [1mdist/components/badge/index.js [22m[32m105.00 B[39m
|
|
34
|
+
[32mESM[39m [1mdist/components/avatar/index.js [22m[32m153.00 B[39m
|
|
35
|
+
[32mESM[39m [1mdist/components/breadcrumb/index.js [22m[32m315.00 B[39m
|
|
36
|
+
[32mESM[39m [1mdist/chunk-VSXKLSEP.js [22m[32m2.45 KB[39m
|
|
37
|
+
[32mESM[39m [1mdist/chunk-XQAJQKO7.js [22m[32m1.46 KB[39m
|
|
38
|
+
[32mESM[39m [1mdist/components/button/index.js [22m[32m109.00 B[39m
|
|
39
|
+
[32mESM[39m [1mdist/chunk-SKR3J46C.js [22m[32m363.00 B[39m
|
|
40
|
+
[32mESM[39m [1mdist/chunk-UZIMC7AQ.js [22m[32m1.61 KB[39m
|
|
41
|
+
[32mESM[39m [1mdist/chunk-U2EIVYWP.js [22m[32m1.21 KB[39m
|
|
42
|
+
[32mESM[39m [1mdist/chunk-A3U73FA7.js [22m[32m1.25 KB[39m
|
|
43
|
+
[32mESM[39m [1mdist/components/checkbox/index.js [22m[32m91.00 B[39m
|
|
44
|
+
[32mESM[39m [1mdist/chunk-FUWID6MC.js [22m[32m1.52 KB[39m
|
|
45
|
+
[32mESM[39m [1mdist/chunk-YTUI6MCB.js [22m[32m1.98 KB[39m
|
|
46
|
+
[32mESM[39m [1mdist/chunk-PHMEWMFS.js [22m[32m7.52 KB[39m
|
|
47
|
+
[32mESM[39m [1mdist/components/card/index.js [22m[32m219.00 B[39m
|
|
48
|
+
[32mESM[39m ⚡️ Build success in 207ms
|
|
49
|
+
DTS Build start
|
|
50
|
+
DTS ⚡️ Build success in 9157ms
|
|
51
|
+
DTS dist/index.d.ts 2.05 KB
|
|
52
|
+
DTS dist/components/avatar/index.d.ts 611.00 B
|
|
53
|
+
DTS dist/components/badge/index.d.ts 653.00 B
|
|
54
|
+
DTS dist/components/breadcrumb/index.d.ts 1.06 KB
|
|
55
|
+
DTS dist/components/button/index.d.ts 806.00 B
|
|
56
|
+
DTS dist/components/card/index.d.ts 947.00 B
|
|
57
|
+
DTS dist/components/checkbox/index.d.ts 310.00 B
|
|
58
|
+
DTS dist/components/dropdown/index.d.ts 2.84 KB
|
|
59
|
+
DTS dist/components/input/index.d.ts 252.00 B
|
|
60
|
+
DTS dist/components/label/index.d.ts 295.00 B
|
|
61
|
+
DTS dist/components/popover/index.d.ts 768.00 B
|
|
62
|
+
DTS dist/components/radio-group/index.d.ts 481.00 B
|
|
63
|
+
DTS dist/components/select/index.d.ts 1.75 KB
|
|
64
|
+
DTS dist/components/separator/index.d.ts 340.00 B
|
|
65
|
+
DTS dist/components/skeleton/index.d.ts 191.00 B
|
|
66
|
+
DTS dist/components/switch/index.d.ts 300.00 B
|
|
67
|
+
DTS dist/components/tabs/index.d.ts 734.00 B
|
|
68
|
+
DTS dist/components/textarea/index.d.ts 228.00 B
|
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# @foundrykit/primitives
|
|
2
|
+
|
|
3
|
+
A collection of accessible, unstyled UI primitives built on top of Radix UI primitives. These components provide the foundation for building consistent, accessible user interfaces.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Accessible by default** - Built on Radix UI primitives with proper ARIA attributes
|
|
8
|
+
- **Unstyled** - No default styling, allowing complete customization
|
|
9
|
+
- **TypeScript support** - Full type safety with comprehensive TypeScript definitions
|
|
10
|
+
- **Composable** - Components are built from sub-components for maximum flexibility
|
|
11
|
+
- **Themeable** - Designed to work with any styling solution
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @foundrykit/primitives
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Available Components
|
|
20
|
+
|
|
21
|
+
### Form Components
|
|
22
|
+
- **Button** - Accessible button with various variants and states
|
|
23
|
+
- **Input** - Form input with proper labeling and validation states
|
|
24
|
+
- **Textarea** - Multi-line text input
|
|
25
|
+
- **Checkbox** - Accessible checkbox with proper keyboard navigation
|
|
26
|
+
- **Radio Group** - Radio button group with proper form integration
|
|
27
|
+
- **Select** - Dropdown select with search and keyboard navigation
|
|
28
|
+
- **Switch** - Toggle switch component
|
|
29
|
+
- **Label** - Accessible form labels
|
|
30
|
+
|
|
31
|
+
### Layout Components
|
|
32
|
+
- **Card** - Container component with header, content, and footer sections
|
|
33
|
+
- **Separator** - Visual divider for content organization
|
|
34
|
+
- **Skeleton** - Loading placeholder components
|
|
35
|
+
|
|
36
|
+
### Navigation Components
|
|
37
|
+
- **Tabs** - Tabbed interface with keyboard navigation
|
|
38
|
+
- **Breadcrumb** - Navigation breadcrumbs
|
|
39
|
+
- **Dropdown** - Dropdown menu with sub-menus
|
|
40
|
+
|
|
41
|
+
### Overlay Components
|
|
42
|
+
- **Dialog** - Modal dialog with proper focus management
|
|
43
|
+
- **Popover** - Floating content overlay
|
|
44
|
+
- **Avatar** - User avatar with fallback support
|
|
45
|
+
|
|
46
|
+
### Display Components
|
|
47
|
+
- **Badge** - Status indicators and labels
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Basic Example
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { Button, ButtonRoot, ButtonContent } from '@foundrykit/primitives/button'
|
|
55
|
+
import { Input, InputRoot, InputField } from '@foundrykit/primitives/input'
|
|
56
|
+
|
|
57
|
+
function MyForm() {
|
|
58
|
+
return (
|
|
59
|
+
<form>
|
|
60
|
+
<Input>
|
|
61
|
+
<InputRoot>
|
|
62
|
+
<InputField placeholder="Enter your name" />
|
|
63
|
+
</InputRoot>
|
|
64
|
+
</Input>
|
|
65
|
+
|
|
66
|
+
<Button>
|
|
67
|
+
<ButtonRoot>
|
|
68
|
+
<ButtonContent>Submit</ButtonContent>
|
|
69
|
+
</ButtonRoot>
|
|
70
|
+
</Button>
|
|
71
|
+
</form>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Composable Pattern
|
|
77
|
+
|
|
78
|
+
All components follow a composable pattern where you can use either the complete component or individual sub-components:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
// Complete component (recommended for most cases)
|
|
82
|
+
import { Button } from '@foundrykit/primitives/button'
|
|
83
|
+
|
|
84
|
+
// Individual sub-components (for maximum customization)
|
|
85
|
+
import { ButtonRoot, ButtonContent, ButtonIcon } from '@foundrykit/primitives/button'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Styling
|
|
89
|
+
|
|
90
|
+
Since these are unstyled primitives, you'll need to add your own styling:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import { Button } from '@foundrykit/primitives/button'
|
|
94
|
+
import { cn } from '@foundrykit/utils'
|
|
95
|
+
|
|
96
|
+
function StyledButton({ className, ...props }) {
|
|
97
|
+
return (
|
|
98
|
+
<Button
|
|
99
|
+
className={cn(
|
|
100
|
+
"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",
|
|
101
|
+
className
|
|
102
|
+
)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Component Structure
|
|
110
|
+
|
|
111
|
+
Each component is organized as follows:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
component/
|
|
115
|
+
├── config.ts # Component configuration and variants
|
|
116
|
+
├── index.tsx # Main component exports
|
|
117
|
+
└── README.md # Component-specific documentation
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Accessibility
|
|
121
|
+
|
|
122
|
+
All components follow WCAG guidelines and include:
|
|
123
|
+
|
|
124
|
+
- Proper ARIA attributes
|
|
125
|
+
- Keyboard navigation support
|
|
126
|
+
- Focus management
|
|
127
|
+
- Screen reader compatibility
|
|
128
|
+
- Color contrast considerations
|
|
129
|
+
|
|
130
|
+
## Dependencies
|
|
131
|
+
|
|
132
|
+
- **Radix UI** - For accessibility primitives
|
|
133
|
+
- **React** - UI framework
|
|
134
|
+
- **TypeScript** - Type safety
|
|
135
|
+
- **class-variance-authority** - For component variants
|
|
136
|
+
- **clsx** - For conditional class names
|
|
137
|
+
- **tailwind-merge** - For class merging
|
|
138
|
+
|
|
139
|
+
## Contributing
|
|
140
|
+
|
|
141
|
+
When adding new primitives:
|
|
142
|
+
|
|
143
|
+
1. Follow the existing component structure
|
|
144
|
+
2. Ensure proper accessibility
|
|
145
|
+
3. Add TypeScript definitions
|
|
146
|
+
4. Include usage examples
|
|
147
|
+
5. Update this README
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
TabsList,
|
|
5
|
-
TabsTrigger
|
|
6
|
-
} from "./chunk-FYCANIVJ.js";
|
|
2
|
+
Switch
|
|
3
|
+
} from "./chunk-U2EIVYWP.js";
|
|
7
4
|
import {
|
|
8
5
|
Textarea
|
|
9
6
|
} from "./chunk-I44GXEPN.js";
|
|
10
|
-
import {
|
|
11
|
-
Input
|
|
12
|
-
} from "./chunk-KZMSLRLW.js";
|
|
13
7
|
import {
|
|
14
8
|
Label
|
|
15
9
|
} from "./chunk-QL4XJD7Y.js";
|
|
10
|
+
import {
|
|
11
|
+
Input
|
|
12
|
+
} from "./chunk-KZMSLRLW.js";
|
|
16
13
|
import {
|
|
17
14
|
Popover,
|
|
18
15
|
PopoverAnchor,
|
|
@@ -42,8 +39,11 @@ import {
|
|
|
42
39
|
Skeleton
|
|
43
40
|
} from "./chunk-SKR3J46C.js";
|
|
44
41
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
Tabs,
|
|
43
|
+
TabsContent,
|
|
44
|
+
TabsList,
|
|
45
|
+
TabsTrigger
|
|
46
|
+
} from "./chunk-FYCANIVJ.js";
|
|
47
47
|
import {
|
|
48
48
|
Avatar,
|
|
49
49
|
AvatarFallback,
|
|
@@ -62,6 +62,9 @@ import {
|
|
|
62
62
|
BreadcrumbPage,
|
|
63
63
|
BreadcrumbSeparator
|
|
64
64
|
} from "./chunk-VSXKLSEP.js";
|
|
65
|
+
import {
|
|
66
|
+
Checkbox
|
|
67
|
+
} from "./chunk-A3U73FA7.js";
|
|
65
68
|
import {
|
|
66
69
|
Button,
|
|
67
70
|
buttonVariants
|
|
@@ -74,9 +77,6 @@ import {
|
|
|
74
77
|
CardHeader,
|
|
75
78
|
CardTitle
|
|
76
79
|
} from "./chunk-UZIMC7AQ.js";
|
|
77
|
-
import {
|
|
78
|
-
Checkbox
|
|
79
|
-
} from "./chunk-A3U73FA7.js";
|
|
80
80
|
import {
|
|
81
81
|
DropdownMenu,
|
|
82
82
|
DropdownMenuCheckboxItem,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundrykit/primitives",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"react-dom": "^19.1.1",
|
|
41
41
|
"tailwind-merge": "^3.3.1",
|
|
42
42
|
"zod": "^3.25.76",
|
|
43
|
-
"@foundrykit/utils": "0.1.
|
|
44
|
-
"@foundrykit/types": "0.1.
|
|
43
|
+
"@foundrykit/utils": "0.1.1",
|
|
44
|
+
"@foundrykit/types": "0.1.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^20.19.9",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"fs-extra": "^11.2.0",
|
|
52
52
|
"tsup": "^8.0.0",
|
|
53
53
|
"typescript": "^5.9.2",
|
|
54
|
-
"@foundrykit/
|
|
55
|
-
"@foundrykit/
|
|
54
|
+
"@foundrykit/typescript-config": "0.1.1",
|
|
55
|
+
"@foundrykit/eslint-config": "0.1.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": "^19.1.1",
|