install new components
This commit is contained in:
22
ArtisanConnect/components/ui/center/index.tsx
Normal file
22
ArtisanConnect/components/ui/center/index.tsx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { View, ViewProps } from 'react-native';
|
||||||
|
import React from 'react';
|
||||||
|
import { centerStyle } from './styles';
|
||||||
|
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
||||||
|
|
||||||
|
type ICenterProps = ViewProps & VariantProps<typeof centerStyle>;
|
||||||
|
|
||||||
|
const Center = React.forwardRef<React.ComponentRef<typeof View>, ICenterProps>(
|
||||||
|
function Center({ className, ...props }, ref) {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
className={centerStyle({ class: className })}
|
||||||
|
{...props}
|
||||||
|
ref={ref}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
Center.displayName = 'Center';
|
||||||
|
|
||||||
|
export { Center };
|
||||||
20
ArtisanConnect/components/ui/center/index.web.tsx
Normal file
20
ArtisanConnect/components/ui/center/index.web.tsx
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { centerStyle } from './styles';
|
||||||
|
|
||||||
|
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
||||||
|
|
||||||
|
type ICenterProps = React.ComponentPropsWithoutRef<'div'> &
|
||||||
|
VariantProps<typeof centerStyle>;
|
||||||
|
|
||||||
|
const Center = React.forwardRef<HTMLDivElement, ICenterProps>(function Center(
|
||||||
|
{ className, ...props },
|
||||||
|
ref
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<div className={centerStyle({ class: className })} {...props} ref={ref} />
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
Center.displayName = 'Center';
|
||||||
|
|
||||||
|
export { Center };
|
||||||
8
ArtisanConnect/components/ui/center/styles.tsx
Normal file
8
ArtisanConnect/components/ui/center/styles.tsx
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
||||||
|
import { isWeb } from '@gluestack-ui/nativewind-utils/IsWeb';
|
||||||
|
|
||||||
|
const baseStyle = isWeb ? 'flex flex-col relative z-0' : '';
|
||||||
|
|
||||||
|
export const centerStyle = tva({
|
||||||
|
base: `justify-center items-center ${baseStyle}`,
|
||||||
|
});
|
||||||
40
ArtisanConnect/components/ui/divider/index.tsx
Normal file
40
ArtisanConnect/components/ui/divider/index.tsx
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
'use client';
|
||||||
|
import React from 'react';
|
||||||
|
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
||||||
|
import { Platform, View } from 'react-native';
|
||||||
|
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
||||||
|
|
||||||
|
const dividerStyle = tva({
|
||||||
|
base: 'bg-background-200',
|
||||||
|
variants: {
|
||||||
|
orientation: {
|
||||||
|
vertical: 'w-px h-full',
|
||||||
|
horizontal: 'h-px w-full',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
type IUIDividerProps = React.ComponentPropsWithoutRef<typeof View> &
|
||||||
|
VariantProps<typeof dividerStyle>;
|
||||||
|
|
||||||
|
const Divider = React.forwardRef<
|
||||||
|
React.ComponentRef<typeof View>,
|
||||||
|
IUIDividerProps
|
||||||
|
>(function Divider({ className, orientation = 'horizontal', ...props }, ref) {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
ref={ref}
|
||||||
|
{...props}
|
||||||
|
aria-orientation={orientation}
|
||||||
|
role={Platform.OS === 'web' ? 'separator' : undefined}
|
||||||
|
className={dividerStyle({
|
||||||
|
orientation,
|
||||||
|
class: className,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
Divider.displayName = 'Divider';
|
||||||
|
|
||||||
|
export { Divider };
|
||||||
978
ArtisanConnect/package-lock.json
generated
978
ArtisanConnect/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user