@foundrykit/components 1.0.4 → 1.0.6
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/CHANGELOG.md +20 -0
- package/package.json +6 -6
- package/src/components/calendar/config.ts +2 -1
- package/src/components/command/config.ts +3 -2
- package/src/components/date-picker/config.ts +2 -1
- package/src/components/pagination/config.ts +2 -1
- package/src/components/theme-toggle/config.ts +58 -0
- package/src/components/theme-toggle/index.tsx +36 -0
- package/components.json +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @foundrykit/components
|
|
2
2
|
|
|
3
|
+
## 1.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update to add command, import transformations and configs for many files
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @foundrykit/primitives@1.0.6
|
|
10
|
+
- @foundrykit/types@1.0.6
|
|
11
|
+
- @foundrykit/utils@1.0.4
|
|
12
|
+
|
|
13
|
+
## 1.0.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Update to config version management and config paths
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @foundrykit/primitives@1.0.5
|
|
20
|
+
- @foundrykit/types@1.0.5
|
|
21
|
+
- @foundrykit/utils@1.0.3
|
|
22
|
+
|
|
3
23
|
## 1.0.4
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundrykit/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"react-day-picker": "^9.9.0",
|
|
27
27
|
"react-dom": "^19.1.1",
|
|
28
28
|
"tailwind-merge": "^3.3.1",
|
|
29
|
-
"@foundrykit/primitives": "1.0.
|
|
30
|
-
"@foundrykit/types": "1.0.
|
|
31
|
-
"@foundrykit/utils": "1.0.
|
|
29
|
+
"@foundrykit/primitives": "1.0.6",
|
|
30
|
+
"@foundrykit/types": "1.0.6",
|
|
31
|
+
"@foundrykit/utils": "1.0.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^20.19.9",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"eslint": "^9.0.0",
|
|
38
38
|
"tsup": "^8.0.0",
|
|
39
39
|
"typescript": "^5.9.2",
|
|
40
|
-
"@foundrykit/eslint-config": "1.0.
|
|
41
|
-
"@foundrykit/typescript-config": "1.0.
|
|
40
|
+
"@foundrykit/eslint-config": "1.0.4",
|
|
41
|
+
"@foundrykit/typescript-config": "1.0.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": "^19.1.1",
|
|
@@ -798,6 +798,7 @@ export const commandConfig: ComponentConfig = {
|
|
|
798
798
|
},
|
|
799
799
|
},
|
|
800
800
|
],
|
|
801
|
-
dependencies: ['utils', '
|
|
802
|
-
|
|
801
|
+
dependencies: ['utils', 'dialog'],
|
|
802
|
+
packageDependencies: ['cmdk'],
|
|
803
|
+
files: ['components/command/index.tsx'],
|
|
803
804
|
};
|
|
@@ -49,6 +49,7 @@ export const datePickerConfig: ComponentConfig = {
|
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
|
-
dependencies: ['
|
|
52
|
+
dependencies: ['utils', 'button', 'input'],
|
|
53
|
+
packageDependencies: ['date-fns', 'lucide-react'],
|
|
53
54
|
files: ['components/date-picker/index.tsx'],
|
|
54
55
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
+
|
|
3
|
+
export const ThemeToggleConfig: ComponentConfig = {
|
|
4
|
+
name: 'Theme Toggle',
|
|
5
|
+
description: 'Toggle for changing the theme.',
|
|
6
|
+
category: 'components',
|
|
7
|
+
tags: ['toggle', 'input', 'form'],
|
|
8
|
+
preview: {
|
|
9
|
+
type: 'static',
|
|
10
|
+
html: '<div class="flex h-12 w-full items-center rounded-md border border-gray-300 bg-gray-100 px-3"><div class="h-2 w-12 rounded-full bg-gray-400"></div></div>',
|
|
11
|
+
},
|
|
12
|
+
variants: [
|
|
13
|
+
{
|
|
14
|
+
name: 'Default',
|
|
15
|
+
description: 'Default search bar',
|
|
16
|
+
code: '<SearchBar placeholder="Search..." onSearch={(query) => console.log(query)} />',
|
|
17
|
+
preview: {
|
|
18
|
+
type: 'component',
|
|
19
|
+
component: 'SearchBar',
|
|
20
|
+
props: {
|
|
21
|
+
placeholder: 'Search...',
|
|
22
|
+
onSearch: (query: string) => console.log(query),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'With Value',
|
|
28
|
+
description: 'Search bar with initial value',
|
|
29
|
+
code: '<SearchBar placeholder="Search..." value="React" onSearch={(query) => console.log(query)} />',
|
|
30
|
+
preview: {
|
|
31
|
+
type: 'component',
|
|
32
|
+
component: 'SearchBar',
|
|
33
|
+
props: {
|
|
34
|
+
placeholder: 'Search...',
|
|
35
|
+
value: 'React',
|
|
36
|
+
onSearch: (query: string) => console.log(query),
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Custom Style',
|
|
42
|
+
description: 'Search bar with custom styling',
|
|
43
|
+
code: '<SearchBar className="h-12 text-lg" placeholder="Search..." onSearch={(query) => console.log(query)} />',
|
|
44
|
+
preview: {
|
|
45
|
+
type: 'component',
|
|
46
|
+
component: 'SearchBar',
|
|
47
|
+
props: {
|
|
48
|
+
className: 'h-12 text-lg',
|
|
49
|
+
placeholder: 'Search...',
|
|
50
|
+
onSearch: (query: string) => console.log(query),
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
dependencies: ['utils', 'toggle'],
|
|
56
|
+
packageDependencies: ['lucide-react'],
|
|
57
|
+
files: ['components/theme-toggle/index.tsx'],
|
|
58
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { MoonIcon, SunIcon } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
import { Toggle } from '@foundrykit/primitives';
|
|
7
|
+
|
|
8
|
+
export default function ThemeToggle() {
|
|
9
|
+
const [theme, setTheme] = useState<string>('light');
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div>
|
|
13
|
+
<Toggle
|
|
14
|
+
variant='outline'
|
|
15
|
+
className='data-[state=on]:hover:bg-muted group size-9 data-[state=on]:bg-transparent'
|
|
16
|
+
pressed={theme === 'dark'}
|
|
17
|
+
onPressedChange={() =>
|
|
18
|
+
setTheme(prev => (prev === 'dark' ? 'light' : 'dark'))
|
|
19
|
+
}
|
|
20
|
+
aria-label={`Switch to ${theme === 'dark' ? 'light' : 'dark'} mode`}
|
|
21
|
+
>
|
|
22
|
+
{/* Note: After dark mode implementation, rely on dark: prefix rather than group-data-[state=on]: */}
|
|
23
|
+
<MoonIcon
|
|
24
|
+
size={16}
|
|
25
|
+
className='shrink-0 scale-0 opacity-0 transition-all group-data-[state=on]:scale-100 group-data-[state=on]:opacity-100'
|
|
26
|
+
aria-hidden='true'
|
|
27
|
+
/>
|
|
28
|
+
<SunIcon
|
|
29
|
+
size={16}
|
|
30
|
+
className='absolute shrink-0 scale-100 opacity-100 transition-all group-data-[state=on]:scale-0 group-data-[state=on]:opacity-0'
|
|
31
|
+
aria-hidden='true'
|
|
32
|
+
/>
|
|
33
|
+
</Toggle>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
package/components.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": true,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "",
|
|
8
|
-
"css": "src/styles/globals.css",
|
|
9
|
-
"baseColor": "neutral",
|
|
10
|
-
"cssVariables": true
|
|
11
|
-
},
|
|
12
|
-
"iconLibrary": "lucide",
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@workspace/ui/components",
|
|
15
|
-
"utils": "@workspace/ui/lib/utils",
|
|
16
|
-
"hooks": "@workspace/ui/hooks",
|
|
17
|
-
"lib": "@workspace/ui/lib",
|
|
18
|
-
"ui": "@workspace/ui/components"
|
|
19
|
-
}
|
|
20
|
-
}
|