@foundrykit/components 2.1.4 → 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.
Files changed (107) hide show
  1. package/dist/chunk-4WYKNDYY.js +91 -0
  2. package/dist/chunk-4WYKNDYY.js.map +1 -0
  3. package/dist/chunk-5CXNMTIN.js +84 -0
  4. package/dist/chunk-5CXNMTIN.js.map +1 -0
  5. package/dist/chunk-B5ZTF5MZ.js +203 -0
  6. package/dist/chunk-B5ZTF5MZ.js.map +1 -0
  7. package/dist/chunk-EDNWBEKV.js +51 -0
  8. package/dist/chunk-EDNWBEKV.js.map +1 -0
  9. package/dist/chunk-ID7BFTID.js +248 -0
  10. package/dist/chunk-ID7BFTID.js.map +1 -0
  11. package/dist/chunk-IYBHXVCH.js +181 -0
  12. package/dist/chunk-IYBHXVCH.js.map +1 -0
  13. package/dist/chunk-KQZEF7PS.js +71 -0
  14. package/dist/chunk-KQZEF7PS.js.map +1 -0
  15. package/dist/chunk-P3GSYR7O.js +889 -0
  16. package/dist/chunk-P3GSYR7O.js.map +1 -0
  17. package/dist/chunk-PKSRYDN4.js +168 -0
  18. package/dist/chunk-PKSRYDN4.js.map +1 -0
  19. package/dist/chunk-SFM7ZMG2.js +104 -0
  20. package/dist/chunk-SFM7ZMG2.js.map +1 -0
  21. package/dist/chunk-TLQQZJUR.js +126 -0
  22. package/dist/chunk-TLQQZJUR.js.map +1 -0
  23. package/dist/chunk-UE7CDYEN.js +59 -0
  24. package/dist/chunk-UE7CDYEN.js.map +1 -0
  25. package/dist/chunk-UG7YS3D5.js +198 -0
  26. package/dist/chunk-UG7YS3D5.js.map +1 -0
  27. package/dist/components/advanced-search-bar/index.d.ts +308 -0
  28. package/dist/components/advanced-search-bar/index.js +34 -0
  29. package/dist/components/advanced-search-bar/index.js.map +1 -0
  30. package/dist/components/calendar/index.d.ts +20 -0
  31. package/dist/components/calendar/index.js +11 -0
  32. package/dist/components/calendar/index.js.map +1 -0
  33. package/dist/components/carousel/index.d.ts +40 -0
  34. package/dist/components/carousel/index.js +17 -0
  35. package/dist/components/carousel/index.js.map +1 -0
  36. package/dist/components/chart/index.d.ts +59 -0
  37. package/dist/components/chart/index.js +21 -0
  38. package/dist/components/chart/index.js.map +1 -0
  39. package/dist/components/combobox/index.d.ts +33 -0
  40. package/dist/components/combobox/index.js +10 -0
  41. package/dist/components/combobox/index.js.map +1 -0
  42. package/dist/components/command/index.d.ts +33 -0
  43. package/dist/components/command/index.js +25 -0
  44. package/dist/components/command/index.js.map +1 -0
  45. package/dist/components/data-table/index.d.ts +17 -0
  46. package/dist/components/data-table/index.js +9 -0
  47. package/dist/components/data-table/index.js.map +1 -0
  48. package/dist/components/date-picker/index.d.ts +17 -0
  49. package/dist/components/date-picker/index.js +9 -0
  50. package/dist/components/date-picker/index.js.map +1 -0
  51. package/dist/components/form/index.d.ts +37 -0
  52. package/dist/components/form/index.js +23 -0
  53. package/dist/components/form/index.js.map +1 -0
  54. package/dist/components/input-otp/index.d.ts +30 -0
  55. package/dist/components/input-otp/index.js +15 -0
  56. package/dist/components/input-otp/index.js.map +1 -0
  57. package/dist/components/pagination/index.d.ts +26 -0
  58. package/dist/components/pagination/index.js +20 -0
  59. package/dist/components/pagination/index.js.map +1 -0
  60. package/dist/components/search-bar/index.d.ts +17 -0
  61. package/dist/components/search-bar/index.js +9 -0
  62. package/dist/components/search-bar/index.js.map +1 -0
  63. package/dist/components/sidebar/index.d.ts +70 -0
  64. package/dist/components/sidebar/index.js +652 -0
  65. package/dist/components/sidebar/index.js.map +1 -0
  66. package/dist/components/theme-toggle/index.d.ts +20 -0
  67. package/dist/components/theme-toggle/index.js +9 -0
  68. package/dist/components/theme-toggle/index.js.map +1 -0
  69. package/dist/index.d.ts +27 -582
  70. package/dist/index.js +74 -2280
  71. package/dist/index.js.map +1 -1
  72. package/package.json +15 -8
  73. package/.turbo/turbo-build.log +0 -17
  74. package/.turbo/turbo-type-check.log +0 -4
  75. package/CHANGELOG.md +0 -351
  76. package/src/components/advanced-search-bar/config.ts +0 -223
  77. package/src/components/advanced-search-bar/index.tsx +0 -1415
  78. package/src/components/calendar/config.ts +0 -51
  79. package/src/components/calendar/index.tsx +0 -225
  80. package/src/components/carousel/config.ts +0 -28
  81. package/src/components/carousel/index.tsx +0 -258
  82. package/src/components/chart/config.ts +0 -28
  83. package/src/components/chart/index.tsx +0 -365
  84. package/src/components/combobox/config.ts +0 -28
  85. package/src/components/combobox/index.tsx +0 -101
  86. package/src/components/command/config.ts +0 -804
  87. package/src/components/command/index.tsx +0 -195
  88. package/src/components/data-table/config.ts +0 -28
  89. package/src/components/data-table/index.tsx +0 -124
  90. package/src/components/date-picker/config.ts +0 -55
  91. package/src/components/date-picker/index.tsx +0 -207
  92. package/src/components/form/config.ts +0 -21
  93. package/src/components/form/index.tsx +0 -150
  94. package/src/components/input-otp/config.ts +0 -28
  95. package/src/components/input-otp/index.tsx +0 -92
  96. package/src/components/pagination/config.ts +0 -367
  97. package/src/components/pagination/index.tsx +0 -135
  98. package/src/components/search-bar/config.ts +0 -58
  99. package/src/components/search-bar/index.tsx +0 -70
  100. package/src/components/sidebar/config.ts +0 -29
  101. package/src/components/sidebar/index.tsx +0 -723
  102. package/src/components/theme-toggle/config.ts +0 -58
  103. package/src/components/theme-toggle/index.tsx +0 -35
  104. package/src/index.ts +0 -82
  105. package/tsconfig.json +0 -12
  106. package/tsconfig.lint.json +0 -8
  107. 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
- 'useIsMobile',
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
- };