@foundrykit/components 2.2.0 → 2.2.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/dist/chunk-4WYKNDYY.js +91 -0
- package/dist/chunk-4WYKNDYY.js.map +1 -0
- package/dist/chunk-5CXNMTIN.js +84 -0
- package/dist/chunk-5CXNMTIN.js.map +1 -0
- package/dist/chunk-B5ZTF5MZ.js +203 -0
- package/dist/chunk-B5ZTF5MZ.js.map +1 -0
- package/dist/chunk-EDNWBEKV.js +51 -0
- package/dist/chunk-EDNWBEKV.js.map +1 -0
- package/dist/chunk-ID7BFTID.js +248 -0
- package/dist/chunk-ID7BFTID.js.map +1 -0
- package/dist/chunk-IYBHXVCH.js +181 -0
- package/dist/chunk-IYBHXVCH.js.map +1 -0
- package/dist/chunk-KQZEF7PS.js +71 -0
- package/dist/chunk-KQZEF7PS.js.map +1 -0
- package/dist/chunk-P3GSYR7O.js +889 -0
- package/dist/chunk-P3GSYR7O.js.map +1 -0
- package/dist/chunk-PKSRYDN4.js +168 -0
- package/dist/chunk-PKSRYDN4.js.map +1 -0
- package/dist/chunk-SFM7ZMG2.js +104 -0
- package/dist/chunk-SFM7ZMG2.js.map +1 -0
- package/dist/chunk-TLQQZJUR.js +126 -0
- package/dist/chunk-TLQQZJUR.js.map +1 -0
- package/dist/chunk-UE7CDYEN.js +59 -0
- package/dist/chunk-UE7CDYEN.js.map +1 -0
- package/dist/chunk-UG7YS3D5.js +198 -0
- package/dist/chunk-UG7YS3D5.js.map +1 -0
- package/dist/components/advanced-search-bar/index.d.ts +308 -0
- package/dist/components/advanced-search-bar/index.js +34 -0
- package/dist/components/advanced-search-bar/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +20 -0
- package/dist/components/calendar/index.js +11 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/carousel/index.d.ts +40 -0
- package/dist/components/carousel/index.js +17 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chart/index.d.ts +59 -0
- package/dist/components/chart/index.js +21 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/combobox/index.d.ts +33 -0
- package/dist/components/combobox/index.js +10 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/command/index.d.ts +33 -0
- package/dist/components/command/index.js +25 -0
- package/dist/components/command/index.js.map +1 -0
- package/dist/components/data-table/index.d.ts +17 -0
- package/dist/components/data-table/index.js +9 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +17 -0
- package/dist/components/date-picker/index.js +9 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/form/index.d.ts +37 -0
- package/dist/components/form/index.js +23 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/input-otp/index.d.ts +30 -0
- package/dist/components/input-otp/index.js +15 -0
- package/dist/components/input-otp/index.js.map +1 -0
- package/dist/components/pagination/index.d.ts +26 -0
- package/dist/components/pagination/index.js +20 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/search-bar/index.d.ts +17 -0
- package/dist/components/search-bar/index.js +9 -0
- package/dist/components/search-bar/index.js.map +1 -0
- package/dist/components/sidebar/index.d.ts +70 -0
- package/dist/components/sidebar/index.js +652 -0
- package/dist/components/sidebar/index.js.map +1 -0
- package/dist/components/theme-toggle/index.d.ts +20 -0
- package/dist/components/theme-toggle/index.js +9 -0
- package/dist/components/theme-toggle/index.js.map +1 -0
- package/dist/index.d.ts +27 -605
- package/dist/index.js +73 -2337
- package/dist/index.js.map +1 -1
- package/package.json +15 -8
- package/CHANGELOG.md +0 -362
- package/src/components/advanced-search-bar/config.ts +0 -223
- package/src/components/advanced-search-bar/index.tsx +0 -1415
- package/src/components/calendar/config.ts +0 -51
- package/src/components/calendar/index.tsx +0 -225
- package/src/components/carousel/config.ts +0 -28
- package/src/components/carousel/index.tsx +0 -258
- package/src/components/chart/config.ts +0 -28
- package/src/components/chart/index.tsx +0 -365
- package/src/components/combobox/config.ts +0 -28
- package/src/components/combobox/index.tsx +0 -111
- package/src/components/command/config.ts +0 -804
- package/src/components/command/index.tsx +0 -195
- package/src/components/data-table/config.ts +0 -28
- package/src/components/data-table/index.tsx +0 -124
- package/src/components/date-picker/config.ts +0 -55
- package/src/components/date-picker/index.tsx +0 -207
- package/src/components/form/config.ts +0 -21
- package/src/components/form/index.tsx +0 -150
- package/src/components/input-otp/config.ts +0 -28
- package/src/components/input-otp/index.tsx +0 -92
- package/src/components/pagination/config.ts +0 -367
- package/src/components/pagination/index.tsx +0 -135
- package/src/components/search-bar/config.ts +0 -58
- package/src/components/search-bar/index.tsx +0 -70
- package/src/components/sidebar/config.ts +0 -29
- package/src/components/sidebar/index.tsx +0 -723
- package/src/components/theme-toggle/config.ts +0 -27
- package/src/components/theme-toggle/index.tsx +0 -63
- package/src/index.ts +0 -83
- package/tsconfig.json +0 -12
- package/tsconfig.lint.json +0 -8
- package/tsup.config.ts +0 -11
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { type Button, buttonVariants } from '@foundrykit/primitives';
|
|
2
|
-
import { cn } from '@foundrykit/utils';
|
|
3
|
-
import {
|
|
4
|
-
ChevronLeftIcon,
|
|
5
|
-
ChevronRightIcon,
|
|
6
|
-
MoreHorizontalIcon,
|
|
7
|
-
} from 'lucide-react';
|
|
8
|
-
import type * as React from 'react';
|
|
9
|
-
|
|
10
|
-
/** Navigation landmark that wraps a set of pagination controls. */
|
|
11
|
-
function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
12
|
-
return (
|
|
13
|
-
<nav
|
|
14
|
-
aria-label='pagination'
|
|
15
|
-
data-slot='pagination'
|
|
16
|
-
className={cn('mx-auto flex w-full justify-center', className)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** Horizontal list container for pagination items. */
|
|
23
|
-
function PaginationContent({
|
|
24
|
-
className,
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<'ul'>) {
|
|
27
|
-
return (
|
|
28
|
-
<ul
|
|
29
|
-
data-slot='pagination-content'
|
|
30
|
-
className={cn('flex flex-row items-center gap-1', className)}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** List item wrapping a single pagination control. */
|
|
37
|
-
function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
|
|
38
|
-
return <li data-slot='pagination-item' {...props} />;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
type PaginationLinkProps = {
|
|
42
|
-
isActive?: boolean;
|
|
43
|
-
} & Pick<React.ComponentProps<typeof Button>, 'size'> &
|
|
44
|
-
React.ComponentProps<'a'>;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Anchor styled as a page-number button. Set `isActive` to mark the current
|
|
48
|
-
* page (applies `aria-current="page"` and an outlined style).
|
|
49
|
-
*/
|
|
50
|
-
function PaginationLink({
|
|
51
|
-
className,
|
|
52
|
-
isActive,
|
|
53
|
-
size = 'icon',
|
|
54
|
-
...props
|
|
55
|
-
}: PaginationLinkProps) {
|
|
56
|
-
return (
|
|
57
|
-
<a
|
|
58
|
-
aria-current={isActive ? 'page' : undefined}
|
|
59
|
-
data-slot='pagination-link'
|
|
60
|
-
data-active={isActive}
|
|
61
|
-
className={cn(
|
|
62
|
-
buttonVariants({
|
|
63
|
-
variant: isActive ? 'outline' : 'ghost',
|
|
64
|
-
size,
|
|
65
|
-
}),
|
|
66
|
-
className
|
|
67
|
-
)}
|
|
68
|
-
{...props}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** Pagination link for navigating to the previous page. */
|
|
74
|
-
function PaginationPrevious({
|
|
75
|
-
className,
|
|
76
|
-
...props
|
|
77
|
-
}: React.ComponentProps<typeof PaginationLink>) {
|
|
78
|
-
return (
|
|
79
|
-
<PaginationLink
|
|
80
|
-
aria-label='Go to previous page'
|
|
81
|
-
size='default'
|
|
82
|
-
className={cn('gap-1 px-2.5 sm:pl-2.5', className)}
|
|
83
|
-
{...props}
|
|
84
|
-
>
|
|
85
|
-
<ChevronLeftIcon />
|
|
86
|
-
<span className='hidden sm:block'>Previous</span>
|
|
87
|
-
</PaginationLink>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** Pagination link for navigating to the next page. */
|
|
92
|
-
function PaginationNext({
|
|
93
|
-
className,
|
|
94
|
-
...props
|
|
95
|
-
}: React.ComponentProps<typeof PaginationLink>) {
|
|
96
|
-
return (
|
|
97
|
-
<PaginationLink
|
|
98
|
-
aria-label='Go to next page'
|
|
99
|
-
size='default'
|
|
100
|
-
className={cn('gap-1 px-2.5 sm:pr-2.5', className)}
|
|
101
|
-
{...props}
|
|
102
|
-
>
|
|
103
|
-
<span className='hidden sm:block'>Next</span>
|
|
104
|
-
<ChevronRightIcon />
|
|
105
|
-
</PaginationLink>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** Non-interactive ellipsis indicating skipped page numbers. */
|
|
110
|
-
function PaginationEllipsis({
|
|
111
|
-
className,
|
|
112
|
-
...props
|
|
113
|
-
}: React.ComponentProps<'span'>) {
|
|
114
|
-
return (
|
|
115
|
-
<span
|
|
116
|
-
aria-hidden
|
|
117
|
-
data-slot='pagination-ellipsis'
|
|
118
|
-
className={cn('flex size-9 items-center justify-center', className)}
|
|
119
|
-
{...props}
|
|
120
|
-
>
|
|
121
|
-
<MoreHorizontalIcon className='size-4' />
|
|
122
|
-
<span className='sr-only'>More pages</span>
|
|
123
|
-
</span>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
Pagination,
|
|
129
|
-
PaginationContent,
|
|
130
|
-
PaginationEllipsis,
|
|
131
|
-
PaginationItem,
|
|
132
|
-
PaginationLink,
|
|
133
|
-
PaginationNext,
|
|
134
|
-
PaginationPrevious,
|
|
135
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const searchBarConfig: ComponentConfig = {
|
|
4
|
-
name: 'Search Bar',
|
|
5
|
-
description: 'Search input component with search functionality',
|
|
6
|
-
category: 'components',
|
|
7
|
-
tags: ['search', '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="mr-2 h-3 w-3 rounded-full border border-gray-400"></div><div class="h-2 w-12 rounded 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: ['input', 'utils'],
|
|
56
|
-
packageDependencies: ['lucide-react'],
|
|
57
|
-
files: ['components/search-bar/index.tsx'],
|
|
58
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Input } from '@foundrykit/primitives';
|
|
4
|
-
import { cn } from '@foundrykit/utils';
|
|
5
|
-
import { Search } from 'lucide-react';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
|
|
8
|
-
export interface SearchBarProps
|
|
9
|
-
extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
10
|
-
onSearch?: (query: string) => void;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
className?: string;
|
|
13
|
-
value?: string;
|
|
14
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Search input with a leading search icon. Works uncontrolled or controlled
|
|
19
|
-
* (pass `value`/`onChange`); `onSearch` is called with the current query text on
|
|
20
|
-
* every change.
|
|
21
|
-
*/
|
|
22
|
-
const SearchBar = React.forwardRef<HTMLInputElement, SearchBarProps>(
|
|
23
|
-
(
|
|
24
|
-
{
|
|
25
|
-
className,
|
|
26
|
-
onSearch,
|
|
27
|
-
placeholder = 'Search...',
|
|
28
|
-
value: externalValue,
|
|
29
|
-
onChange: externalOnChange,
|
|
30
|
-
...props
|
|
31
|
-
},
|
|
32
|
-
ref
|
|
33
|
-
) => {
|
|
34
|
-
const [internalQuery, setInternalQuery] = React.useState('');
|
|
35
|
-
|
|
36
|
-
// Use external value if provided, otherwise use internal state
|
|
37
|
-
const query = externalValue !== undefined ? externalValue : internalQuery;
|
|
38
|
-
const isControlled = externalValue !== undefined;
|
|
39
|
-
|
|
40
|
-
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
41
|
-
const value = e.target.value;
|
|
42
|
-
|
|
43
|
-
if (!isControlled) {
|
|
44
|
-
setInternalQuery(value);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
onSearch?.(value);
|
|
48
|
-
externalOnChange?.(e);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<div className={cn('relative', className)}>
|
|
53
|
-
<Search className='text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2' />
|
|
54
|
-
<Input
|
|
55
|
-
ref={ref}
|
|
56
|
-
type='search'
|
|
57
|
-
placeholder={placeholder}
|
|
58
|
-
value={query}
|
|
59
|
-
onChange={handleChange}
|
|
60
|
-
className='pl-10'
|
|
61
|
-
{...props}
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
SearchBar.displayName = 'SearchBar';
|
|
69
|
-
|
|
70
|
-
export { SearchBar };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const sidebarConfig: ComponentConfig = {
|
|
4
|
-
name: 'Sidebar',
|
|
5
|
-
description: 'Sidebar component for navigation',
|
|
6
|
-
category: 'components',
|
|
7
|
-
tags: ['navigation', 'sidebar'],
|
|
8
|
-
preview: {
|
|
9
|
-
type: 'static',
|
|
10
|
-
html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="h-8 w-20 rounded bg-gray-400 flex items-center justify-center text-xs text-white">Sidebar</div></div>',
|
|
11
|
-
},
|
|
12
|
-
variants: [],
|
|
13
|
-
files: ['components/sidebar/index.tsx'],
|
|
14
|
-
dependencies: [
|
|
15
|
-
'utils',
|
|
16
|
-
'hooks',
|
|
17
|
-
'tooltip',
|
|
18
|
-
'sheet',
|
|
19
|
-
'skeleton',
|
|
20
|
-
'button',
|
|
21
|
-
'input',
|
|
22
|
-
'separator',
|
|
23
|
-
],
|
|
24
|
-
packageDependencies: [
|
|
25
|
-
'@radix-ui/react-slot',
|
|
26
|
-
'class-variance-authority',
|
|
27
|
-
'lucide-react',
|
|
28
|
-
],
|
|
29
|
-
};
|