@oaiz/app-kit 0.0.0-stage → 0.1.4130
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/LICENSE +21 -0
- package/README.md +149 -2
- package/THIRD_PARTY_NOTICES.md +76 -0
- package/package.json +139 -4
- package/registry.json +1847 -0
- package/src/components/activity-timeline.tsx +227 -0
- package/src/components/app-shell.tsx +622 -0
- package/src/components/bar-list.tsx +47 -0
- package/src/components/board.tsx +700 -0
- package/src/components/calendar-view.tsx +1388 -0
- package/src/components/card-grid.tsx +462 -0
- package/src/components/charts.tsx +701 -0
- package/src/components/chat-markdown.tsx +230 -0
- package/src/components/chat-panel.tsx +760 -0
- package/src/components/code-editor.tsx +276 -0
- package/src/components/collection-controls.tsx +226 -0
- package/src/components/command-palette.tsx +403 -0
- package/src/components/confirm-action.tsx +123 -0
- package/src/components/data-table.tsx +821 -0
- package/src/components/date-input.tsx +429 -0
- package/src/components/empty-state.tsx +31 -0
- package/src/components/error-state.tsx +37 -0
- package/src/components/file-upload.tsx +595 -0
- package/src/components/filter-bar.tsx +415 -0
- package/src/components/grouped-picker.tsx +250 -0
- package/src/components/line-items.tsx +601 -0
- package/src/components/list-view.tsx +491 -0
- package/src/components/metrics.tsx +53 -0
- package/src/components/page-header.tsx +33 -0
- package/src/components/property-picker.tsx +546 -0
- package/src/components/record-detail.tsx +416 -0
- package/src/components/record-form.tsx +295 -0
- package/src/components/record-name.tsx +85 -0
- package/src/components/save-bar.tsx +142 -0
- package/src/components/sign-in.tsx +179 -0
- package/src/components/split-view.tsx +128 -0
- package/src/components/status-dot.tsx +56 -0
- package/src/components/stepper.tsx +153 -0
- package/src/components/text-diff-model.ts +111 -0
- package/src/components/text-diff.tsx +98 -0
- package/src/components/time-zone-picker.tsx +69 -0
- package/src/components/ui/accordion.tsx +138 -0
- package/src/components/ui/alert-dialog.tsx +67 -0
- package/src/components/ui/alert.tsx +65 -0
- package/src/components/ui/avatar-group.tsx +119 -0
- package/src/components/ui/avatar.tsx +55 -0
- package/src/components/ui/badge.tsx +59 -0
- package/src/components/ui/bottom-navigation.tsx +102 -0
- package/src/components/ui/breadcrumb.tsx +117 -0
- package/src/components/ui/button.tsx +71 -0
- package/src/components/ui/card.tsx +95 -0
- package/src/components/ui/checkbox.tsx +31 -0
- package/src/components/ui/collapsible.tsx +27 -0
- package/src/components/ui/context-menu.tsx +270 -0
- package/src/components/ui/count-up.tsx +136 -0
- package/src/components/ui/detail-disclosure-section.tsx +109 -0
- package/src/components/ui/dialog.tsx +157 -0
- package/src/components/ui/dropdown-menu.tsx +273 -0
- package/src/components/ui/form-field.tsx +155 -0
- package/src/components/ui/heading.tsx +126 -0
- package/src/components/ui/hover-card.tsx +45 -0
- package/src/components/ui/input.tsx +50 -0
- package/src/components/ui/label.tsx +30 -0
- package/src/components/ui/orb-spinner.tsx +238 -0
- package/src/components/ui/popover.tsx +59 -0
- package/src/components/ui/progress-ring.tsx +125 -0
- package/src/components/ui/progress.tsx +38 -0
- package/src/components/ui/radio-group.tsx +124 -0
- package/src/components/ui/resizable.tsx +48 -0
- package/src/components/ui/scroll-fade.tsx +98 -0
- package/src/components/ui/segmented-control.tsx +70 -0
- package/src/components/ui/select.tsx +230 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +170 -0
- package/src/components/ui/shimmer-text.tsx +87 -0
- package/src/components/ui/shortcut.tsx +39 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +48 -0
- package/src/components/ui/switch.tsx +44 -0
- package/src/components/ui/table.tsx +119 -0
- package/src/components/ui/tabs.tsx +80 -0
- package/src/components/ui/text.tsx +93 -0
- package/src/components/ui/textarea.tsx +51 -0
- package/src/components/ui/toast.tsx +141 -0
- package/src/components/ui/toaster.tsx +40 -0
- package/src/components/ui/tooltip.tsx +38 -0
- package/src/components/ui/top-banner.tsx +108 -0
- package/src/components/ui/tree-view.tsx +215 -0
- package/src/components/ui/use-toast.tsx +184 -0
- package/src/components/ui/voice-orb.tsx +252 -0
- package/src/hooks/oaiz-chat.tsx +530 -0
- package/src/hooks/oaiz-data.tsx +617 -0
- package/src/hooks/oaiz-session.tsx +63 -0
- package/src/hooks/use-arrivals.ts +19 -0
- package/src/hooks/use-breakpoint.ts +100 -0
- package/src/hooks/use-media-query.ts +36 -0
- package/src/hooks/use-theme.ts +67 -0
- package/src/hooks/use-url-state.ts +77 -0
- package/src/lib/breakpoints.ts +81 -0
- package/src/lib/csp-nonce.ts +15 -0
- package/src/lib/format.ts +291 -0
- package/src/lib/speech-level.ts +118 -0
- package/src/lib/utils.ts +109 -0
- package/src/styles/oaiz/app.css +21 -0
- package/src/styles/oaiz/scrollbars.css +20 -0
- package/src/styles/oaiz/tokens.css +952 -0
- package/src/styles/oaiz/voice-orb.css +39 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { Avatar, AvatarImage } from './avatar';
|
|
7
|
+
import { Text } from './text';
|
|
8
|
+
|
|
9
|
+
export interface AvatarGroupPerson {
|
|
10
|
+
name: string;
|
|
11
|
+
/** A picture of the person; their initials show without it. */
|
|
12
|
+
image?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const avatarGroupVariants = cva('flex items-center', {
|
|
16
|
+
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
sm: '-space-x-1',
|
|
19
|
+
md: '-space-x-1.5',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: { size: 'md' },
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/** Each size's avatar and the size of its initials, which a smaller avatar needs smaller. */
|
|
26
|
+
const AVATAR = { sm: 'size-6', md: 'size-8' } as const;
|
|
27
|
+
const INITIALS = { sm: '2xs', md: 'xs' } as const;
|
|
28
|
+
|
|
29
|
+
export interface AvatarGroupProps
|
|
30
|
+
extends
|
|
31
|
+
Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,
|
|
32
|
+
VariantProps<typeof avatarGroupVariants> {
|
|
33
|
+
people: AvatarGroupPerson[];
|
|
34
|
+
/** What the people are to the record, such as "Assignees"; it starts the group's accessible name. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** The most avatars shown; the rest are counted as "+N". */
|
|
37
|
+
max?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function initials(name: string): string {
|
|
41
|
+
const words = name.split(/[\s@.]+/).filter(Boolean);
|
|
42
|
+
return (
|
|
43
|
+
words
|
|
44
|
+
.slice(0, 2)
|
|
45
|
+
.map((word) => word.charAt(0).toUpperCase())
|
|
46
|
+
.join('') || '?'
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Several people as overlapping avatars, such as a record's assignees or who it is shared with.
|
|
52
|
+
* Past `max` the rest are counted. A screen reader hears the label and every name.
|
|
53
|
+
*/
|
|
54
|
+
const AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(
|
|
55
|
+
({ people, label, max = 4, size, className, ...props }, ref) => {
|
|
56
|
+
const scale = size ?? 'md';
|
|
57
|
+
const shown = people.slice(0, max);
|
|
58
|
+
const hidden = people.length - shown.length;
|
|
59
|
+
const names = people.map((person) => person.name).join(', ');
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
ref={ref}
|
|
63
|
+
role="img"
|
|
64
|
+
aria-label={
|
|
65
|
+
people.length === 0 ? `${label}: none` : `${label}: ${names}`
|
|
66
|
+
}
|
|
67
|
+
className={cn(avatarGroupVariants({ size }), className)}
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
{shown.map((person) => (
|
|
71
|
+
<Avatar
|
|
72
|
+
key={person.name}
|
|
73
|
+
title={person.name}
|
|
74
|
+
className={cn(AVATAR[scale], 'ring-2 ring-background')}
|
|
75
|
+
>
|
|
76
|
+
{person.image && <AvatarImage src={person.image} alt="" />}
|
|
77
|
+
<AvatarPrimitive.Fallback asChild>
|
|
78
|
+
<Text
|
|
79
|
+
as="span"
|
|
80
|
+
size={INITIALS[scale]}
|
|
81
|
+
weight="medium"
|
|
82
|
+
variant="muted"
|
|
83
|
+
leading="none"
|
|
84
|
+
className="flex size-full items-center justify-center rounded-full bg-muted"
|
|
85
|
+
>
|
|
86
|
+
{initials(person.name)}
|
|
87
|
+
</Text>
|
|
88
|
+
</AvatarPrimitive.Fallback>
|
|
89
|
+
</Avatar>
|
|
90
|
+
))}
|
|
91
|
+
{hidden > 0 && (
|
|
92
|
+
<span
|
|
93
|
+
title={people
|
|
94
|
+
.slice(max)
|
|
95
|
+
.map((person) => person.name)
|
|
96
|
+
.join(', ')}
|
|
97
|
+
className={cn(
|
|
98
|
+
AVATAR[scale],
|
|
99
|
+
'relative flex shrink-0 items-center justify-center rounded-full bg-muted ring-2 ring-background',
|
|
100
|
+
)}
|
|
101
|
+
>
|
|
102
|
+
<Text
|
|
103
|
+
as="span"
|
|
104
|
+
size={INITIALS[scale]}
|
|
105
|
+
weight="medium"
|
|
106
|
+
variant="muted"
|
|
107
|
+
leading="none"
|
|
108
|
+
>
|
|
109
|
+
+{hidden}
|
|
110
|
+
</Text>
|
|
111
|
+
</span>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
);
|
|
117
|
+
AvatarGroup.displayName = 'AvatarGroup';
|
|
118
|
+
|
|
119
|
+
export { AvatarGroup, avatarGroupVariants };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { Text } from './text';
|
|
6
|
+
|
|
7
|
+
const Avatar = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<AvatarPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
'relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full',
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
));
|
|
20
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
21
|
+
|
|
22
|
+
const AvatarImage = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
25
|
+
>(({ className, ...props }, ref) => (
|
|
26
|
+
<AvatarPrimitive.Image
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={cn('aspect-square h-full w-full', className)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
));
|
|
32
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
33
|
+
|
|
34
|
+
const AvatarFallback = React.forwardRef<
|
|
35
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
36
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
37
|
+
>(({ className, ...props }, ref) => (
|
|
38
|
+
<Text
|
|
39
|
+
asChild
|
|
40
|
+
as="span"
|
|
41
|
+
size="sm"
|
|
42
|
+
weight="medium"
|
|
43
|
+
variant="muted"
|
|
44
|
+
leading="none"
|
|
45
|
+
className={cn(
|
|
46
|
+
'flex h-full w-full items-center justify-center rounded-full bg-muted',
|
|
47
|
+
className,
|
|
48
|
+
)}
|
|
49
|
+
>
|
|
50
|
+
<AvatarPrimitive.Fallback ref={ref} {...props} />
|
|
51
|
+
</Text>
|
|
52
|
+
));
|
|
53
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
54
|
+
|
|
55
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
const badgeVariants = cva(
|
|
8
|
+
'inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
default: 'px-2.5 py-0.5 text-xs',
|
|
13
|
+
compact: 'px-1.5 py-0.5 text-2xs',
|
|
14
|
+
},
|
|
15
|
+
variant: {
|
|
16
|
+
default:
|
|
17
|
+
'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
|
18
|
+
secondary:
|
|
19
|
+
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
20
|
+
destructive:
|
|
21
|
+
'border-transparent bg-destructive text-destructive-foreground',
|
|
22
|
+
// Status fills pair with their own foreground token and carry no hover
|
|
23
|
+
// alpha: at 80% over the page the success pair falls below 4.5:1.
|
|
24
|
+
success: 'border-transparent bg-success text-success-foreground',
|
|
25
|
+
warning: 'border-transparent bg-warning text-warning-foreground',
|
|
26
|
+
info: 'border-transparent bg-info-bg text-info-text font-medium',
|
|
27
|
+
'success-subtle':
|
|
28
|
+
'border-transparent bg-badge-success text-badge-success-foreground font-medium',
|
|
29
|
+
'warning-subtle':
|
|
30
|
+
'border-transparent bg-badge-warning text-badge-warning-foreground font-medium',
|
|
31
|
+
'destructive-subtle':
|
|
32
|
+
'border-transparent bg-destructive-bg-subtle text-destructive-text font-medium',
|
|
33
|
+
neutral:
|
|
34
|
+
'border-transparent bg-badge-neutral text-badge-neutral-foreground font-medium',
|
|
35
|
+
outline: 'text-foreground',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
variant: 'default',
|
|
40
|
+
size: 'default',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export interface BadgeProps
|
|
46
|
+
extends
|
|
47
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
48
|
+
VariantProps<typeof badgeVariants> {}
|
|
49
|
+
|
|
50
|
+
function Badge({ className, variant, size, ...props }: BadgeProps) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
className={cn(badgeVariants({ variant, size }), className)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Slot, Slottable } from '@radix-ui/react-slot';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { Text } from './text';
|
|
6
|
+
|
|
7
|
+
export interface BottomNavigationProps extends React.HTMLAttributes<HTMLElement> {
|
|
8
|
+
'aria-label': string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const BottomNavigation = React.forwardRef<HTMLElement, BottomNavigationProps>(
|
|
12
|
+
({ className, ...props }, ref) => (
|
|
13
|
+
<nav
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
'flex min-h-[var(--mobile-nav-height)] w-full items-stretch border-t border-border bg-background',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
BottomNavigation.displayName = 'BottomNavigation';
|
|
24
|
+
|
|
25
|
+
export interface BottomNavigationItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
26
|
+
icon: React.ReactNode;
|
|
27
|
+
label: React.ReactNode;
|
|
28
|
+
badge?: React.ReactNode;
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
/** Compose an empty link as the interactive root; label supplies its content. */
|
|
31
|
+
asChild?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const BottomNavigationItem = React.forwardRef<
|
|
35
|
+
HTMLButtonElement,
|
|
36
|
+
BottomNavigationItemProps
|
|
37
|
+
>(
|
|
38
|
+
(
|
|
39
|
+
{
|
|
40
|
+
className,
|
|
41
|
+
icon,
|
|
42
|
+
label,
|
|
43
|
+
badge,
|
|
44
|
+
selected = false,
|
|
45
|
+
asChild = false,
|
|
46
|
+
children,
|
|
47
|
+
type = 'button',
|
|
48
|
+
...props
|
|
49
|
+
},
|
|
50
|
+
ref,
|
|
51
|
+
) => {
|
|
52
|
+
const Comp = asChild ? Slot : 'button';
|
|
53
|
+
const content = (
|
|
54
|
+
<>
|
|
55
|
+
<span className="flex min-h-5 w-full flex-wrap items-center justify-center gap-1">
|
|
56
|
+
<span aria-hidden="true" className="shrink-0 [&_svg]:size-5">
|
|
57
|
+
{icon}
|
|
58
|
+
</span>
|
|
59
|
+
{badge != null && (
|
|
60
|
+
<span className="flex shrink-0 items-center empty:hidden">
|
|
61
|
+
{badge}
|
|
62
|
+
</span>
|
|
63
|
+
)}
|
|
64
|
+
</span>
|
|
65
|
+
<Text
|
|
66
|
+
as="span"
|
|
67
|
+
size="xs"
|
|
68
|
+
weight="medium"
|
|
69
|
+
variant={selected ? 'default' : 'muted'}
|
|
70
|
+
className="w-full min-w-0 whitespace-normal [overflow-wrap:anywhere]"
|
|
71
|
+
>
|
|
72
|
+
{label}
|
|
73
|
+
</Text>
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Comp
|
|
79
|
+
ref={ref}
|
|
80
|
+
type={asChild ? undefined : type}
|
|
81
|
+
data-selected={selected ? 'true' : 'false'}
|
|
82
|
+
className={cn(
|
|
83
|
+
'flex min-h-[var(--touch-target-min)] min-w-[var(--touch-target-min)] flex-1 basis-0 cursor-pointer flex-col items-center justify-start gap-1 px-0 py-2 text-center transition-colors duration-fast ease-move hover:bg-sidebar-selected active:bg-sidebar-selected-pressed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring',
|
|
84
|
+
selected
|
|
85
|
+
? 'bg-sidebar-selected text-foreground'
|
|
86
|
+
: 'text-muted-foreground',
|
|
87
|
+
className,
|
|
88
|
+
)}
|
|
89
|
+
{...props}
|
|
90
|
+
>
|
|
91
|
+
{asChild ? (
|
|
92
|
+
<Slottable child={children}>{() => content}</Slottable>
|
|
93
|
+
) : (
|
|
94
|
+
content
|
|
95
|
+
)}
|
|
96
|
+
</Comp>
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
BottomNavigationItem.displayName = 'BottomNavigationItem';
|
|
101
|
+
|
|
102
|
+
export { BottomNavigation, BottomNavigationItem };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
import { Heading } from './heading';
|
|
8
|
+
const Breadcrumb = React.forwardRef<
|
|
9
|
+
HTMLElement,
|
|
10
|
+
React.ComponentPropsWithoutRef<'nav'> & {
|
|
11
|
+
separator?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
|
|
14
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
|
15
|
+
|
|
16
|
+
const BreadcrumbList = React.forwardRef<
|
|
17
|
+
HTMLOListElement,
|
|
18
|
+
React.ComponentPropsWithoutRef<'ol'>
|
|
19
|
+
>(({ className, ...props }, ref) => (
|
|
20
|
+
<ol
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn(
|
|
23
|
+
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground mobile:gap-2.5',
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
));
|
|
29
|
+
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
30
|
+
|
|
31
|
+
const BreadcrumbItem = React.forwardRef<
|
|
32
|
+
HTMLLIElement,
|
|
33
|
+
React.ComponentPropsWithoutRef<'li'>
|
|
34
|
+
>(({ className, ...props }, ref) => (
|
|
35
|
+
<li
|
|
36
|
+
ref={ref}
|
|
37
|
+
className={cn('inline-flex items-center gap-1.5', className)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
));
|
|
41
|
+
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
42
|
+
|
|
43
|
+
const BreadcrumbLink = React.forwardRef<
|
|
44
|
+
HTMLAnchorElement,
|
|
45
|
+
React.ComponentPropsWithoutRef<'a'> & {
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
}
|
|
48
|
+
>(({ asChild, className, ...props }, ref) => {
|
|
49
|
+
const Comp = asChild ? Slot : 'a';
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Comp
|
|
53
|
+
ref={ref}
|
|
54
|
+
className={cn('transition-colors hover:text-foreground', className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
60
|
+
|
|
61
|
+
const BreadcrumbPage = React.forwardRef<
|
|
62
|
+
HTMLHeadingElement,
|
|
63
|
+
Omit<React.ComponentPropsWithoutRef<typeof Heading>, 'level'>
|
|
64
|
+
>(({ className, size = 'sm', weight = 'normal', ...props }, ref) => (
|
|
65
|
+
<Heading
|
|
66
|
+
level={1}
|
|
67
|
+
size={size}
|
|
68
|
+
weight={weight}
|
|
69
|
+
ref={ref}
|
|
70
|
+
aria-current="page"
|
|
71
|
+
className={className}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
));
|
|
75
|
+
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
76
|
+
|
|
77
|
+
const BreadcrumbSeparator = ({
|
|
78
|
+
children,
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}: React.ComponentProps<'li'>) => (
|
|
82
|
+
<li
|
|
83
|
+
role="presentation"
|
|
84
|
+
aria-hidden="true"
|
|
85
|
+
className={cn('[&>svg]:w-3.5 [&>svg]:h-3.5', className)}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
{children ?? <ChevronRight />}
|
|
89
|
+
</li>
|
|
90
|
+
);
|
|
91
|
+
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
|
|
92
|
+
|
|
93
|
+
const BreadcrumbEllipsis = ({
|
|
94
|
+
className,
|
|
95
|
+
...props
|
|
96
|
+
}: React.ComponentProps<'span'>) => (
|
|
97
|
+
<span
|
|
98
|
+
role="presentation"
|
|
99
|
+
aria-hidden="true"
|
|
100
|
+
className={cn('flex h-9 w-9 items-center justify-center', className)}
|
|
101
|
+
{...props}
|
|
102
|
+
>
|
|
103
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
104
|
+
<span className="sr-only">More</span>
|
|
105
|
+
</span>
|
|
106
|
+
);
|
|
107
|
+
BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis';
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
Breadcrumb,
|
|
111
|
+
BreadcrumbList,
|
|
112
|
+
BreadcrumbItem,
|
|
113
|
+
BreadcrumbLink,
|
|
114
|
+
BreadcrumbPage,
|
|
115
|
+
BreadcrumbSeparator,
|
|
116
|
+
BreadcrumbEllipsis,
|
|
117
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
|
|
8
|
+
const buttonVariants = cva(
|
|
9
|
+
'inline-flex items-center justify-center gap-inline whitespace-nowrap text-sm font-medium outline-none ring-offset-background transition-[color,background-color,border-color,outline-color,box-shadow,transform,translate,scale,rotate] duration-fast ease-move active:scale-[0.98] focus-visible:outline-none focus-visible:not-data-[pointer-close-focus]:ring-2 focus-visible:not-data-[pointer-close-focus]:ring-ring focus-visible:not-data-[pointer-close-focus]:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
14
|
+
destructive:
|
|
15
|
+
'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
16
|
+
outline:
|
|
17
|
+
'border border-input bg-background hover:bg-accent text-card-foreground hover:text-accent-foreground',
|
|
18
|
+
secondary:
|
|
19
|
+
'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
20
|
+
info: 'bg-info-solid text-info-solid-foreground hover:bg-info-solid/90',
|
|
21
|
+
brand: 'bg-logo-yellow text-brand-foreground hover:bg-logo-yellow/90',
|
|
22
|
+
success: 'bg-success text-success-foreground hover:bg-success/90',
|
|
23
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
24
|
+
plain: 'bg-transparent',
|
|
25
|
+
filled:
|
|
26
|
+
'border border-transparent bg-input-fill text-muted-foreground font-normal hover:bg-input-fill-hover focus-visible:not-data-[pointer-close-focus]:border-input focus-visible:not-data-[pointer-close-focus]:bg-background disabled:border-transparent disabled:bg-input-fill disabled:hover:bg-input-fill aria-invalid:border-destructive-text aria-invalid:focus-visible:border-destructive-text',
|
|
27
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
28
|
+
},
|
|
29
|
+
shape: {
|
|
30
|
+
default: 'rounded-md',
|
|
31
|
+
pill: 'rounded-full',
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
default: 'h-10 px-4 py-2',
|
|
35
|
+
sm: 'h-9 px-3',
|
|
36
|
+
xs: 'h-7 px-3 text-xs [&_svg]:size-3.5',
|
|
37
|
+
lg: 'h-11 px-8',
|
|
38
|
+
icon: 'h-10 w-10',
|
|
39
|
+
'icon-xs': 'h-6 w-6 [&_svg]:size-3.5',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
variant: 'default',
|
|
44
|
+
size: 'default',
|
|
45
|
+
shape: 'default',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export interface ButtonProps
|
|
51
|
+
extends
|
|
52
|
+
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
53
|
+
VariantProps<typeof buttonVariants> {
|
|
54
|
+
asChild?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
58
|
+
({ className, variant, size, shape, asChild = false, ...props }, ref) => {
|
|
59
|
+
const Comp = asChild ? Slot : 'button';
|
|
60
|
+
return (
|
|
61
|
+
<Comp
|
|
62
|
+
className={cn(buttonVariants({ variant, size, shape, className }))}
|
|
63
|
+
ref={ref}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
);
|
|
69
|
+
Button.displayName = 'Button';
|
|
70
|
+
|
|
71
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { Heading } from './heading';
|
|
5
|
+
import { Text } from './text';
|
|
6
|
+
|
|
7
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
interactive?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
|
12
|
+
({ className, interactive = false, ...props }, ref) => (
|
|
13
|
+
<div
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
'rounded-lg border bg-card text-card-foreground shadow-sm',
|
|
17
|
+
interactive &&
|
|
18
|
+
'transition-shadow duration-normal ease-move hover:shadow-lg focus-within:shadow-lg motion-reduce:transition-none',
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
Card.displayName = 'Card';
|
|
26
|
+
|
|
27
|
+
const CardHeader = React.forwardRef<
|
|
28
|
+
HTMLDivElement,
|
|
29
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
30
|
+
>(({ className, ...props }, ref) => (
|
|
31
|
+
<div
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={cn('flex flex-col space-y-1.5 p-6', className)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
));
|
|
37
|
+
CardHeader.displayName = 'CardHeader';
|
|
38
|
+
|
|
39
|
+
const CardTitle = React.forwardRef<
|
|
40
|
+
HTMLDivElement,
|
|
41
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
42
|
+
>(({ className, ...props }, ref) => (
|
|
43
|
+
<Heading
|
|
44
|
+
asChild
|
|
45
|
+
as="div"
|
|
46
|
+
size="2xl"
|
|
47
|
+
weight="semibold"
|
|
48
|
+
className={cn(
|
|
49
|
+
'leading-none tracking-tight text-card-foreground',
|
|
50
|
+
className,
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
53
|
+
<div ref={ref} {...props} />
|
|
54
|
+
</Heading>
|
|
55
|
+
));
|
|
56
|
+
CardTitle.displayName = 'CardTitle';
|
|
57
|
+
|
|
58
|
+
const CardDescription = React.forwardRef<
|
|
59
|
+
HTMLDivElement,
|
|
60
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
61
|
+
>(({ className, ...props }, ref) => (
|
|
62
|
+
<Text asChild as="div" size="sm" variant="muted" className={className}>
|
|
63
|
+
<div ref={ref} {...props} />
|
|
64
|
+
</Text>
|
|
65
|
+
));
|
|
66
|
+
CardDescription.displayName = 'CardDescription';
|
|
67
|
+
|
|
68
|
+
const CardContent = React.forwardRef<
|
|
69
|
+
HTMLDivElement,
|
|
70
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
71
|
+
>(({ className, ...props }, ref) => (
|
|
72
|
+
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
|
|
73
|
+
));
|
|
74
|
+
CardContent.displayName = 'CardContent';
|
|
75
|
+
|
|
76
|
+
const CardFooter = React.forwardRef<
|
|
77
|
+
HTMLDivElement,
|
|
78
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
79
|
+
>(({ className, ...props }, ref) => (
|
|
80
|
+
<div
|
|
81
|
+
ref={ref}
|
|
82
|
+
className={cn('flex items-center p-6 pt-0', className)}
|
|
83
|
+
{...props}
|
|
84
|
+
/>
|
|
85
|
+
));
|
|
86
|
+
CardFooter.displayName = 'CardFooter';
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
Card,
|
|
90
|
+
CardHeader,
|
|
91
|
+
CardFooter,
|
|
92
|
+
CardTitle,
|
|
93
|
+
CardDescription,
|
|
94
|
+
CardContent,
|
|
95
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
import { Check } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
const Checkbox = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<CheckboxPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
// The box stays 16px; the pseudo-element widens what a pointer or finger hits to 24px.
|
|
15
|
+
'peer relative h-4 w-4 shrink-0 rounded-sm border after:absolute after:-inset-1 border-primary ring-offset-background transition-colors duration-fast ease-move focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<CheckboxPrimitive.Indicator
|
|
21
|
+
className={cn(
|
|
22
|
+
'flex items-center justify-center text-current duration-fast ease-enter data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=unchecked]:animate-out data-[state=unchecked]:zoom-out-50',
|
|
23
|
+
)}
|
|
24
|
+
>
|
|
25
|
+
<Check className="h-4 w-4" />
|
|
26
|
+
</CheckboxPrimitive.Indicator>
|
|
27
|
+
</CheckboxPrimitive.Root>
|
|
28
|
+
));
|
|
29
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
30
|
+
|
|
31
|
+
export { Checkbox };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
|
|
5
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
6
|
+
|
|
7
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
8
|
+
|
|
9
|
+
const CollapsibleContent = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof CollapsiblePrimitive.CollapsibleContent>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.CollapsibleContent>
|
|
12
|
+
>(({ className, children, ...props }, ref) => (
|
|
13
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
'overflow-hidden data-[state=closed]:animate-[oaiz-collapsible-collapse_var(--transition-duration-normal)_var(--ease-move)] data-[state=open]:animate-[oaiz-collapsible-expand_var(--transition-duration-normal)_var(--ease-move)]',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</CollapsiblePrimitive.CollapsibleContent>
|
|
23
|
+
));
|
|
24
|
+
CollapsibleContent.displayName =
|
|
25
|
+
CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
26
|
+
|
|
27
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|