linked-data-browser 0.0.0 → 0.0.2
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/README.md +1 -1
- package/app/index.tsx +4 -4
- package/components/DataBrowser.tsx +1 -1
- package/components/ThemeProvider.tsx +3 -3
- package/components/nav/DialogProvider.tsx +2 -2
- package/components/nav/Layout.tsx +5 -5
- package/components/nav/header/AddressBox.tsx +7 -7
- package/components/nav/header/Header.tsx +1 -1
- package/components/nav/header/SignInMenu.tsx +3 -3
- package/components/nav/header/ThemeToggleMenu.tsx +2 -2
- package/components/nav/header/ViewMenu.tsx +4 -4
- package/components/nav/useValidView.tsx +1 -1
- package/components/ui/accordion.tsx +151 -0
- package/components/ui/alert.tsx +83 -0
- package/components/ui/aspect-ratio.tsx +5 -0
- package/components/ui/avatar.tsx +1 -1
- package/components/ui/badge.tsx +59 -0
- package/components/ui/button.tsx +2 -2
- package/components/ui/card.tsx +2 -2
- package/components/ui/checkbox.tsx +35 -0
- package/components/ui/collapsible.tsx +9 -0
- package/components/ui/context-menu.tsx +265 -0
- package/components/ui/dialog.tsx +35 -12
- package/components/ui/dropdown-menu.tsx +6 -6
- package/components/ui/hover-card.tsx +47 -0
- package/components/ui/input.tsx +1 -1
- package/components/ui/label.tsx +1 -1
- package/components/ui/menubar.tsx +288 -0
- package/components/ui/navigation-menu.tsx +2 -2
- package/components/ui/popover.tsx +2 -2
- package/components/ui/progress.tsx +1 -1
- package/components/ui/radio-group.tsx +1 -1
- package/components/ui/select.tsx +215 -0
- package/components/ui/separator.tsx +2 -2
- package/components/ui/skeleton.tsx +40 -0
- package/components/ui/switch.tsx +1 -1
- package/components/ui/table.tsx +132 -0
- package/components/ui/tabs.tsx +70 -0
- package/components/ui/text.tsx +1 -1
- package/components/ui/textarea.tsx +30 -0
- package/components/ui/toggle-group.tsx +100 -0
- package/components/ui/toggle.tsx +96 -0
- package/components/ui/tooltip.tsx +2 -2
- package/components/ui/typography.tsx +157 -0
- package/components.json +3 -3
- package/infra/ansible.cfg +0 -0
- package/infra/hosts +2 -0
- package/infra/hosts.example +2 -0
- package/infra/nginx.conf.j2 +12 -0
- package/infra/playbook.yml +77 -0
- package/infra/secrets.yml +11 -0
- package/lib/android-navigation-bar.ts +1 -1
- package/lib/icons/Check.tsx +1 -1
- package/lib/icons/ChevronDown.tsx +1 -1
- package/lib/icons/ChevronUp.tsx +1 -1
- package/lib/icons/X.tsx +1 -1
- package/package.json +17 -5
- package/resourceViews/Container/ContainerConfig.tsx +2 -2
- package/resourceViews/Container/ContainerView.tsx +12 -12
- package/resourceViews/RawCode/RawCodeConfig.tsx +2 -2
- package/resourceViews/RawCode/RawCodeEditor.tsx +1 -2
- package/resourceViews/RawCode/RawCodeView.tsx +3 -3
- package/tsconfig.json +1 -6
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as TablePrimitive from '@rn-primitives/table';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { TextClassContext } from '../ui/text';
|
|
5
|
+
|
|
6
|
+
function Table({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: TablePrimitive.RootProps & {
|
|
10
|
+
ref?: React.RefObject<TablePrimitive.RootRef>;
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<TablePrimitive.Root
|
|
14
|
+
className={cn('w-full caption-bottom text-sm', className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function TableHeader({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: TablePrimitive.HeaderProps & {
|
|
24
|
+
ref?: React.RefObject<TablePrimitive.HeaderRef>;
|
|
25
|
+
}) {
|
|
26
|
+
return (
|
|
27
|
+
<TablePrimitive.Header
|
|
28
|
+
className={cn('border-border [&_tr]:border-b', className)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function TableBody({
|
|
35
|
+
className,
|
|
36
|
+
style,
|
|
37
|
+
...props
|
|
38
|
+
}: TablePrimitive.BodyProps & {
|
|
39
|
+
ref?: React.RefObject<TablePrimitive.BodyRef>;
|
|
40
|
+
}) {
|
|
41
|
+
return (
|
|
42
|
+
<TablePrimitive.Body
|
|
43
|
+
className={cn(
|
|
44
|
+
'flex-1 border-border [&_tr:last-child]:border-0',
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
47
|
+
// eslint-disable-next-line react-native/no-inline-styles
|
|
48
|
+
style={[{ minHeight: 2 }, style]}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function TableFooter({
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
}: TablePrimitive.FooterProps & {
|
|
58
|
+
ref?: React.RefObject<TablePrimitive.FooterRef>;
|
|
59
|
+
}) {
|
|
60
|
+
return (
|
|
61
|
+
<TablePrimitive.Footer
|
|
62
|
+
className={cn(
|
|
63
|
+
'bg-muted/50 font-medium [&>tr]:last:border-b-0',
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function TableRow({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}: TablePrimitive.RowProps & {
|
|
75
|
+
ref?: React.RefObject<TablePrimitive.RowRef>;
|
|
76
|
+
}) {
|
|
77
|
+
return (
|
|
78
|
+
<TablePrimitive.Row
|
|
79
|
+
className={cn(
|
|
80
|
+
'flex-row border-border border-b web:transition-colors web:hover:bg-muted/50 web:data-[state=selected]:bg-muted',
|
|
81
|
+
className,
|
|
82
|
+
)}
|
|
83
|
+
{...props}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function TableHead({
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}: TablePrimitive.HeadProps & {
|
|
92
|
+
ref?: React.RefObject<TablePrimitive.HeadRef>;
|
|
93
|
+
}) {
|
|
94
|
+
return (
|
|
95
|
+
<TextClassContext.Provider value="text-muted-foreground">
|
|
96
|
+
<TablePrimitive.Head
|
|
97
|
+
className={cn(
|
|
98
|
+
'h-12 px-4 text-left justify-center font-medium [&:has([role=checkbox])]:pr-0',
|
|
99
|
+
className,
|
|
100
|
+
)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
</TextClassContext.Provider>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function TableCell({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}: TablePrimitive.CellProps & {
|
|
111
|
+
ref?: React.RefObject<TablePrimitive.CellRef>;
|
|
112
|
+
}) {
|
|
113
|
+
return (
|
|
114
|
+
<TablePrimitive.Cell
|
|
115
|
+
className={cn(
|
|
116
|
+
'p-4 align-middle [&:has([role=checkbox])]:pr-0',
|
|
117
|
+
className,
|
|
118
|
+
)}
|
|
119
|
+
{...props}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
Table,
|
|
126
|
+
TableBody,
|
|
127
|
+
TableCell,
|
|
128
|
+
TableFooter,
|
|
129
|
+
TableHead,
|
|
130
|
+
TableHeader,
|
|
131
|
+
TableRow,
|
|
132
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as TabsPrimitive from '@rn-primitives/tabs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { TextClassContext } from '../ui/text';
|
|
5
|
+
|
|
6
|
+
const Tabs = TabsPrimitive.Root;
|
|
7
|
+
|
|
8
|
+
function TabsList({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: TabsPrimitive.ListProps & {
|
|
12
|
+
ref?: React.RefObject<TabsPrimitive.ListRef>;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<TabsPrimitive.List
|
|
16
|
+
className={cn(
|
|
17
|
+
'web:inline-flex h-10 native:h-12 items-center justify-center rounded-md bg-muted p-1 native:px-1.5',
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function TabsTrigger({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: TabsPrimitive.TriggerProps & {
|
|
29
|
+
ref?: React.RefObject<TabsPrimitive.TriggerRef>;
|
|
30
|
+
}) {
|
|
31
|
+
const { value } = TabsPrimitive.useRootContext();
|
|
32
|
+
return (
|
|
33
|
+
<TextClassContext.Provider
|
|
34
|
+
value={cn(
|
|
35
|
+
'text-sm native:text-base font-medium text-muted-foreground web:transition-all',
|
|
36
|
+
value === props.value && 'text-foreground',
|
|
37
|
+
)}
|
|
38
|
+
>
|
|
39
|
+
<TabsPrimitive.Trigger
|
|
40
|
+
className={cn(
|
|
41
|
+
'inline-flex items-center justify-center shadow-none web:whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium web:ring-offset-background web:transition-all web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
42
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
43
|
+
props.value === value &&
|
|
44
|
+
'bg-background shadow-lg shadow-foreground/10',
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
</TextClassContext.Provider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function TabsContent({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: TabsPrimitive.ContentProps & {
|
|
57
|
+
ref?: React.RefObject<TabsPrimitive.ContentRef>;
|
|
58
|
+
}) {
|
|
59
|
+
return (
|
|
60
|
+
<TabsPrimitive.Content
|
|
61
|
+
className={cn(
|
|
62
|
+
'web:ring-offset-background web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
package/components/ui/text.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Slot from '@rn-primitives/slot';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Text as RNText } from 'react-native';
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
5
|
|
|
6
6
|
const TextClassContext = React.createContext<string | undefined>(undefined);
|
|
7
7
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TextInput, type TextInputProps } from 'react-native';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
|
|
5
|
+
function Textarea({
|
|
6
|
+
className,
|
|
7
|
+
multiline = true,
|
|
8
|
+
numberOfLines = 4,
|
|
9
|
+
placeholderClassName,
|
|
10
|
+
...props
|
|
11
|
+
}: TextInputProps & {
|
|
12
|
+
ref?: React.RefObject<TextInput>;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<TextInput
|
|
16
|
+
className={cn(
|
|
17
|
+
'web:flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base lg:text-sm native:text-lg native:leading-[1.25] text-foreground web:ring-offset-background placeholder:text-muted-foreground web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
18
|
+
props.editable === false && 'opacity-50 web:cursor-not-allowed',
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
|
|
22
|
+
multiline={multiline}
|
|
23
|
+
numberOfLines={numberOfLines}
|
|
24
|
+
textAlignVertical="top"
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Textarea };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { LucideIcon } from 'lucide-react-native';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { toggleTextVariants, toggleVariants } from '../ui/toggle';
|
|
5
|
+
import { TextClassContext } from '../ui/text';
|
|
6
|
+
import * as ToggleGroupPrimitive from '@rn-primitives/toggle-group';
|
|
7
|
+
import { cn } from '../../lib/utils';
|
|
8
|
+
|
|
9
|
+
const ToggleGroupContext = React.createContext<VariantProps<
|
|
10
|
+
typeof toggleVariants
|
|
11
|
+
> | null>(null);
|
|
12
|
+
|
|
13
|
+
function ToggleGroup({
|
|
14
|
+
className,
|
|
15
|
+
variant,
|
|
16
|
+
size,
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}: ToggleGroupPrimitive.RootProps &
|
|
20
|
+
VariantProps<typeof toggleVariants> & {
|
|
21
|
+
ref?: React.RefObject<ToggleGroupPrimitive.RootRef>;
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<ToggleGroupPrimitive.Root
|
|
25
|
+
className={cn(
|
|
26
|
+
'flex flex-row items-center justify-center gap-1',
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
32
|
+
{children}
|
|
33
|
+
</ToggleGroupContext.Provider>
|
|
34
|
+
</ToggleGroupPrimitive.Root>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function useToggleGroupContext() {
|
|
39
|
+
const context = React.useContext(ToggleGroupContext);
|
|
40
|
+
if (context === null) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
'ToggleGroup compound components cannot be rendered outside the ToggleGroup component',
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return context;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function ToggleGroupItem({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
variant,
|
|
52
|
+
size,
|
|
53
|
+
...props
|
|
54
|
+
}: ToggleGroupPrimitive.ItemProps &
|
|
55
|
+
VariantProps<typeof toggleVariants> & {
|
|
56
|
+
ref?: React.RefObject<ToggleGroupPrimitive.ItemRef>;
|
|
57
|
+
}) {
|
|
58
|
+
const context = useToggleGroupContext();
|
|
59
|
+
const { value } = ToggleGroupPrimitive.useRootContext();
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<TextClassContext.Provider
|
|
63
|
+
value={cn(
|
|
64
|
+
toggleTextVariants({ variant, size }),
|
|
65
|
+
ToggleGroupPrimitive.utils.getIsSelected(value, props.value)
|
|
66
|
+
? 'text-accent-foreground'
|
|
67
|
+
: 'web:group-hover:text-muted-foreground',
|
|
68
|
+
)}
|
|
69
|
+
>
|
|
70
|
+
<ToggleGroupPrimitive.Item
|
|
71
|
+
className={cn(
|
|
72
|
+
toggleVariants({
|
|
73
|
+
variant: context.variant || variant,
|
|
74
|
+
size: context.size || size,
|
|
75
|
+
}),
|
|
76
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
77
|
+
ToggleGroupPrimitive.utils.getIsSelected(value, props.value) &&
|
|
78
|
+
'bg-accent',
|
|
79
|
+
className,
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</ToggleGroupPrimitive.Item>
|
|
85
|
+
</TextClassContext.Provider>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function ToggleGroupIcon({
|
|
90
|
+
className,
|
|
91
|
+
icon: Icon,
|
|
92
|
+
...props
|
|
93
|
+
}: React.ComponentPropsWithoutRef<LucideIcon> & {
|
|
94
|
+
icon: LucideIcon;
|
|
95
|
+
}) {
|
|
96
|
+
const textClass = React.useContext(TextClassContext);
|
|
97
|
+
return <Icon className={cn(textClass, className)} {...props} />;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { ToggleGroup, ToggleGroupIcon, ToggleGroupItem };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as TogglePrimitive from '@rn-primitives/toggle';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { LucideIcon } from 'lucide-react-native';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { TextClassContext } from '../ui/text';
|
|
7
|
+
|
|
8
|
+
const toggleVariants = cva(
|
|
9
|
+
'web:group web:inline-flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:hover:bg-muted active:bg-muted web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: 'bg-transparent',
|
|
14
|
+
outline:
|
|
15
|
+
'border border-input bg-transparent web:hover:bg-accent active:bg-accent active:bg-accent',
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: 'h-10 px-3 native:h-12 native:px-[12]',
|
|
19
|
+
sm: 'h-9 px-2.5 native:h-10 native:px-[9]',
|
|
20
|
+
lg: 'h-11 px-5 native:h-14 native:px-6',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: 'default',
|
|
25
|
+
size: 'default',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const toggleTextVariants = cva(
|
|
31
|
+
'text-sm native:text-base text-foreground font-medium',
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
variant: {
|
|
35
|
+
default: '',
|
|
36
|
+
outline:
|
|
37
|
+
'web:group-hover:text-accent-foreground web:group-active:text-accent-foreground',
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
default: '',
|
|
41
|
+
sm: '',
|
|
42
|
+
lg: '',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: 'default',
|
|
47
|
+
size: 'default',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
function Toggle({
|
|
53
|
+
className,
|
|
54
|
+
variant,
|
|
55
|
+
size,
|
|
56
|
+
...props
|
|
57
|
+
}: TogglePrimitive.RootProps &
|
|
58
|
+
VariantProps<typeof toggleVariants> &
|
|
59
|
+
VariantProps<typeof toggleVariants> & {
|
|
60
|
+
ref?: React.RefObject<TogglePrimitive.RootRef>;
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<TextClassContext.Provider
|
|
64
|
+
value={cn(
|
|
65
|
+
toggleTextVariants({ variant, size }),
|
|
66
|
+
props.pressed
|
|
67
|
+
? 'text-accent-foreground'
|
|
68
|
+
: 'web:group-hover:text-muted-foreground',
|
|
69
|
+
className,
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
<TogglePrimitive.Root
|
|
73
|
+
className={cn(
|
|
74
|
+
toggleVariants({ variant, size }),
|
|
75
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
76
|
+
props.pressed && 'bg-accent',
|
|
77
|
+
className,
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
</TextClassContext.Provider>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function ToggleIcon({
|
|
86
|
+
className,
|
|
87
|
+
icon: Icon,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentPropsWithoutRef<LucideIcon> & {
|
|
90
|
+
icon: LucideIcon;
|
|
91
|
+
}) {
|
|
92
|
+
const textClass = React.useContext(TextClassContext);
|
|
93
|
+
return <Icon className={cn(textClass, className)} {...props} />;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { Toggle, ToggleIcon, toggleTextVariants, toggleVariants };
|
|
@@ -2,8 +2,8 @@ import * as TooltipPrimitive from '@rn-primitives/tooltip';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Platform, StyleSheet } from 'react-native';
|
|
4
4
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
5
|
-
import { TextClassContext } from '
|
|
6
|
-
import { cn } from '
|
|
5
|
+
import { TextClassContext } from '../../components/ui/text';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
7
|
|
|
8
8
|
const Tooltip = TooltipPrimitive.Root;
|
|
9
9
|
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import * as Slot from '@rn-primitives/slot';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Platform, Text as RNText } from 'react-native';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
type TypographyProps = React.ComponentProps<typeof RNText> & {
|
|
7
|
+
ref?: React.RefObject<RNText>;
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function H1({ className, asChild = false, ...props }: TypographyProps) {
|
|
12
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
13
|
+
return (
|
|
14
|
+
<Component
|
|
15
|
+
role="heading"
|
|
16
|
+
aria-level="1"
|
|
17
|
+
className={cn(
|
|
18
|
+
'web:scroll-m-20 text-4xl text-foreground font-extrabold tracking-tight lg:text-5xl web:select-text',
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function H2({ className, asChild = false, ...props }: TypographyProps) {
|
|
27
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
28
|
+
return (
|
|
29
|
+
<Component
|
|
30
|
+
role="heading"
|
|
31
|
+
aria-level="2"
|
|
32
|
+
className={cn(
|
|
33
|
+
'web:scroll-m-20 border-b border-border pb-2 text-3xl text-foreground font-semibold tracking-tight first:mt-0 web:select-text',
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function H3({ className, asChild = false, ...props }: TypographyProps) {
|
|
42
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
43
|
+
return (
|
|
44
|
+
<Component
|
|
45
|
+
role="heading"
|
|
46
|
+
aria-level="3"
|
|
47
|
+
className={cn(
|
|
48
|
+
'web:scroll-m-20 text-2xl text-foreground font-semibold tracking-tight web:select-text',
|
|
49
|
+
className,
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function H4({ className, asChild = false, ...props }: TypographyProps) {
|
|
57
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
58
|
+
return (
|
|
59
|
+
<Component
|
|
60
|
+
role="heading"
|
|
61
|
+
aria-level="4"
|
|
62
|
+
className={cn(
|
|
63
|
+
'web:scroll-m-20 text-xl text-foreground font-semibold tracking-tight web:select-text',
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function P({ className, asChild = false, ...props }: TypographyProps) {
|
|
72
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
73
|
+
return (
|
|
74
|
+
<Component
|
|
75
|
+
className={cn('text-base text-foreground web:select-text', className)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function BlockQuote({ className, asChild = false, ...props }: TypographyProps) {
|
|
82
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
83
|
+
return (
|
|
84
|
+
<Component
|
|
85
|
+
// @ts-ignore - role of blockquote renders blockquote element on the web
|
|
86
|
+
role={Platform.OS === 'web' ? 'blockquote' : undefined}
|
|
87
|
+
className={cn(
|
|
88
|
+
'mt-6 native:mt-4 border-l-2 border-border pl-6 native:pl-3 text-base text-foreground italic web:select-text',
|
|
89
|
+
className,
|
|
90
|
+
)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function Code({ className, asChild = false, ...props }: TypographyProps) {
|
|
97
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
98
|
+
return (
|
|
99
|
+
<Component
|
|
100
|
+
// @ts-ignore - role of code renders code element on the web
|
|
101
|
+
role={Platform.OS === 'web' ? 'code' : undefined}
|
|
102
|
+
className={cn(
|
|
103
|
+
'relative rounded-md bg-muted px-[0.3rem] py-[0.2rem] text-sm text-foreground font-semibold web:select-text',
|
|
104
|
+
className,
|
|
105
|
+
)}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function Lead({ className, asChild = false, ...props }: TypographyProps) {
|
|
112
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
113
|
+
return (
|
|
114
|
+
<Component
|
|
115
|
+
className={cn('text-xl text-muted-foreground web:select-text', className)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function Large({ className, asChild = false, ...props }: TypographyProps) {
|
|
122
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
123
|
+
return (
|
|
124
|
+
<Component
|
|
125
|
+
className={cn(
|
|
126
|
+
'text-xl text-foreground font-semibold web:select-text',
|
|
127
|
+
className,
|
|
128
|
+
)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function Small({ className, asChild = false, ...props }: TypographyProps) {
|
|
135
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
136
|
+
return (
|
|
137
|
+
<Component
|
|
138
|
+
className={cn(
|
|
139
|
+
'text-sm text-foreground font-medium leading-none web:select-text',
|
|
140
|
+
className,
|
|
141
|
+
)}
|
|
142
|
+
{...props}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function Muted({ className, asChild = false, ...props }: TypographyProps) {
|
|
148
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
149
|
+
return (
|
|
150
|
+
<Component
|
|
151
|
+
className={cn('text-sm text-muted-foreground web:select-text', className)}
|
|
152
|
+
{...props}
|
|
153
|
+
/>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { BlockQuote, Code, H1, H2, H3, H4, Large, Lead, Muted, P, Small };
|
package/components.json
CHANGED
|
File without changes
|
package/infra/hosts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
server {
|
|
2
|
+
listen 80;
|
|
3
|
+
server_name {{ domain }};
|
|
4
|
+
location / {
|
|
5
|
+
proxy_pass http://localhost:3000;
|
|
6
|
+
proxy_http_version 1.1;
|
|
7
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
8
|
+
proxy_set_header Connection 'upgrade';
|
|
9
|
+
proxy_set_header Host $host;
|
|
10
|
+
proxy_cache_bypass $http_upgrade;
|
|
11
|
+
}
|
|
12
|
+
}
|