Compare commits
9 Commits
tableCompo
...
merge_mstr
| Author | SHA1 | Date | |
|---|---|---|---|
| a309559b93 | |||
| b836e66af7 | |||
| a08e51049d | |||
|
|
32ac16abc8 | ||
|
|
226aceb1dc | ||
| d5ac090054 | |||
|
|
766541b19b | ||
|
|
4257c560c9 | ||
|
|
1d6ad9c875 |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 812 B After Width: | Height: | Size: 812 B |
@@ -0,0 +1,89 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from "@/components/ui/card"
|
||||||
|
import { Rs232PropertyView } from './Rs232PropertyView';
|
||||||
|
import { IpClientPropertyView } from './IpClientPropertyView';
|
||||||
|
import { IpServerPropertyView } from './IpServerPropertyView';
|
||||||
|
import { RowIndicatorv1 } from './RowIndicatorv1';
|
||||||
|
import { IpClientType, IpServerType, Rs232Type, UdpClientType, UdpServerType, } from '../models/InstrumentModel';
|
||||||
|
|
||||||
|
interface CardProps {
|
||||||
|
titleAlat?: string,
|
||||||
|
type?: string,
|
||||||
|
lampu?: boolean,
|
||||||
|
online?: boolean,
|
||||||
|
typeDetail: Rs232Type | IpClientType | IpServerType | UdpClientType | UdpServerType
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
export const CardInstrument = ({
|
||||||
|
...props
|
||||||
|
}: CardProps) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Card className="w-60 mx-auto rounded-lg overflow-hidden border-black border-solid">
|
||||||
|
<CardHeader className='bg-orange-500'>
|
||||||
|
<CardTitle>
|
||||||
|
<div className='flex justify-between'>
|
||||||
|
<div className='mx-2'>
|
||||||
|
<span className='text-white font-inter font-semibold text-base'>{props.titleAlat}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<svg
|
||||||
|
className='mt-2'
|
||||||
|
xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.19148 2.53673C8.88826 1.28772 7.11194 1.28772 6.80872 2.53673C6.61285 3.34357 5.68846 3.72646 4.97943 3.29445C3.88184 2.62567 2.6258 3.88172 3.29457 4.97931C3.72659 5.68833 3.34369 6.61272 2.53685 6.8086C1.28785 7.11182 1.28785 8.88813 2.53685 9.19135C3.34369 9.38723 3.72659 10.3116 3.29457 11.0206C2.6258 12.1182 3.88184 13.3743 4.97943 12.7055C5.68846 12.2735 6.61285 12.6564 6.80872 13.4632C7.11194 14.7122 8.88826 14.7122 9.19148 13.4632C9.38735 12.6564 10.3117 12.2735 11.0208 12.7055C12.1184 13.3743 13.3744 12.1182 12.7056 11.0206C12.2736 10.3116 12.6565 9.38723 13.4633 9.19135C14.7123 8.88813 14.7123 7.11182 13.4633 6.8086C12.6565 6.61272 12.2736 5.68833 12.7056 4.97931C13.3744 3.88172 12.1184 2.62568 11.0208 3.29445C10.3117 3.72646 9.38735 3.34357 9.19148 2.53673ZM8.0001 10.4C9.32558 10.4 10.4001 9.32546 10.4001 7.99998C10.4001 6.67449 9.32558 5.59998 8.0001 5.59998C6.67461 5.59998 5.6001 6.67449 5.6001 7.99998C5.6001 9.32546 6.67461 10.4 8.0001 10.4Z" fill="#F5F5F5" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
{/* ROW 1 & 2 START */}
|
||||||
|
<RowIndicatorv1
|
||||||
|
lampu={props.lampu}
|
||||||
|
type={props.type}
|
||||||
|
online={props.online}
|
||||||
|
blink={false}
|
||||||
|
/>
|
||||||
|
{/* ROW 1 & 2 END */}
|
||||||
|
|
||||||
|
{/* ROW 3 */}
|
||||||
|
{
|
||||||
|
props.type == 'rs232' ? (<Rs232PropertyView
|
||||||
|
type={props.type}
|
||||||
|
valueSpeed={(props.typeDetail as Rs232Type).speedValue}
|
||||||
|
valueBaud='8'
|
||||||
|
valueDataBit={(props.typeDetail as Rs232Type).dataBitValue}
|
||||||
|
valueStopBit={(props.typeDetail as Rs232Type).stopBitValue}
|
||||||
|
/>) : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
props.type == 'ipclient' ? (<IpClientPropertyView
|
||||||
|
type={props.type}
|
||||||
|
valueHost={(props.typeDetail as IpClientType).hostValue}
|
||||||
|
valuePort={(props.typeDetail as IpClientType).portValue}
|
||||||
|
/>) : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
props.type == 'ipserver' ? (<IpServerPropertyView
|
||||||
|
type={props.type}
|
||||||
|
valueListeningPort={(props.typeDetail as IpServerType).listeningPortValue}
|
||||||
|
/>) : ''
|
||||||
|
}
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
import { RowLabelValue } from './RowLabelValue';
|
||||||
|
|
||||||
|
interface IpClientPropertyViewProps {
|
||||||
|
type?: string,
|
||||||
|
valueHost:string,
|
||||||
|
valuePort:string,
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const IpClientPropertyView = ({
|
||||||
|
...props
|
||||||
|
}: IpClientPropertyViewProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* IpClient START */}
|
||||||
|
<RowLabelValue
|
||||||
|
label='Host'
|
||||||
|
value={props.valueHost}
|
||||||
|
/>
|
||||||
|
<RowLabelValue
|
||||||
|
label='Port'
|
||||||
|
value={props.valuePort}
|
||||||
|
/>
|
||||||
|
{/* IpClient END */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
import { RowLabelValue } from './RowLabelValue';
|
||||||
|
|
||||||
|
interface IpServerPropertyViewProps {
|
||||||
|
type?: string,
|
||||||
|
valueListeningPort:string,
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const IpServerPropertyView = ({
|
||||||
|
...props
|
||||||
|
}: IpServerPropertyViewProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* IpServer START */}
|
||||||
|
<RowLabelValue
|
||||||
|
label='Listening Port'
|
||||||
|
value={props.valueListeningPort}
|
||||||
|
/>
|
||||||
|
{/* IpServer END */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
import { StatusTransferv1 } from './StatusTransferv1';
|
||||||
|
import { StatusOnlinev1 } from './StatusOnlinev1';
|
||||||
|
import { TypeCardv1 } from './TypeCardv1';
|
||||||
|
|
||||||
|
interface RowIndicatorv1Props {
|
||||||
|
lampu?: boolean,
|
||||||
|
type?: string;
|
||||||
|
online?: boolean;
|
||||||
|
blink?:boolean;
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
export const RowIndicatorv1 = ({
|
||||||
|
...props
|
||||||
|
}: RowIndicatorv1Props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='flex justify-between mt-2 mb-3'>
|
||||||
|
{/* LAMP START */}
|
||||||
|
<StatusTransferv1
|
||||||
|
isTransferCard={props.lampu}
|
||||||
|
/>
|
||||||
|
{/* LAMP END */}
|
||||||
|
|
||||||
|
{/* Type Badge START*/}
|
||||||
|
<TypeCardv1
|
||||||
|
titleType={props.type}
|
||||||
|
/>
|
||||||
|
{/* Type Badge END */}
|
||||||
|
|
||||||
|
{/* ONLINE / OFFLINE START */}
|
||||||
|
<StatusOnlinev1
|
||||||
|
isOnlineCard={props.online}
|
||||||
|
/>
|
||||||
|
{/* ONLINE / OFFLINE END */}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
|
||||||
|
interface RowLabelValueProps {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
export const RowLabelValue = ({
|
||||||
|
...props
|
||||||
|
}: RowLabelValueProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="grid grid-cols-2 gap-4">
|
||||||
|
<div>
|
||||||
|
<span className="text-inter text-sm font-normal">
|
||||||
|
{props.label}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-inter text-sm font-normal text-left">{props.value}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
import { RowLabelValue } from './RowLabelValue';
|
||||||
|
|
||||||
|
interface Rs232PropertyViewProps {
|
||||||
|
type?: string,
|
||||||
|
valueSpeed:string,
|
||||||
|
valueBaud:string,
|
||||||
|
valueDataBit:string,
|
||||||
|
valueStopBit:string
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Rs232PropertyView = ({
|
||||||
|
...props
|
||||||
|
}: Rs232PropertyViewProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* RS232 START */}
|
||||||
|
<RowLabelValue
|
||||||
|
label='Speed'
|
||||||
|
value={props.valueSpeed}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<RowLabelValue
|
||||||
|
label='Baud'
|
||||||
|
value={props.valueBaud}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<RowLabelValue
|
||||||
|
label='Data Bit'
|
||||||
|
value={props.valueDataBit}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<RowLabelValue
|
||||||
|
label='Stop Bit'
|
||||||
|
value={props.valueStopBit}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* RS232 END */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
import { StatusTransferv1 } from './StatusTransferv1';
|
||||||
|
import { StatusOnlinev1 } from './StatusOnlinev1';
|
||||||
|
|
||||||
|
interface StatusCardProps {
|
||||||
|
isOnline?: boolean;
|
||||||
|
isTransferCard?:boolean;
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
export const StatusCardv1 = ({
|
||||||
|
...props
|
||||||
|
}: StatusCardProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='flex justify-between mt-2 mb-2'>
|
||||||
|
{/* LAMP START */}
|
||||||
|
<StatusTransferv1
|
||||||
|
isTransferCard={props.isTransferCard}
|
||||||
|
/>
|
||||||
|
{/* LAMP END */}
|
||||||
|
|
||||||
|
{/* ONLINE / OFFLINE START */}
|
||||||
|
<StatusOnlinev1
|
||||||
|
isOnlineCard={props.isOnline}
|
||||||
|
/>
|
||||||
|
{/* ONLINE / OFFLINE END */}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
|
||||||
|
interface StatusOnlinev1Props {
|
||||||
|
isOnlineCard?: boolean,
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
export const StatusOnlinev1 = ({
|
||||||
|
...props
|
||||||
|
}: StatusOnlinev1Props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* ONLINE/OFFLINE START */}
|
||||||
|
{
|
||||||
|
props.isOnlineCard == true
|
||||||
|
? (
|
||||||
|
<>
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
<div className='flex justify-between'>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||||
|
<path d="M8.25 15C12.116 15 15.25 11.866 15.25 8C15.25 4.13401 12.116 1 8.25 1C4.38401 1 1.25 4.13401 1.25 8C1.25 11.866 4.38401 15 8.25 15Z" fill="#1B9828" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
|
||||||
|
)
|
||||||
|
: <>
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
<div className='flex justify-between'>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||||
|
<path d="M8.25 15C12.116 15 15.25 11.866 15.25 8C15.25 4.13401 12.116 1 8.25 1C4.38401 1 1.25 4.13401 1.25 8C1.25 11.866 4.38401 15 8.25 15Z" fill="#BA1A1A" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
{/* ONLINE/OFFLINE END */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
|
||||||
|
interface StatusTransferv1Props {
|
||||||
|
isTransferCard?: boolean,
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
export const StatusTransferv1 = ({
|
||||||
|
...props
|
||||||
|
}: StatusTransferv1Props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* TRANSFER CARD START */}
|
||||||
|
{
|
||||||
|
props.isTransferCard == true
|
||||||
|
? (
|
||||||
|
<>
|
||||||
|
<div>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||||
|
<g clip-path="url(#clip0_39_14671)">
|
||||||
|
<path d="M2.66658 7.33337C2.8365 7.33356 2.99993 7.39863 3.12349 7.51527C3.24705 7.63192 3.3214 7.79134 3.33136 7.96097C3.34132 8.1306 3.28613 8.29763 3.17707 8.42793C3.06801 8.55823 2.91331 8.64197 2.74458 8.66204L2.66658 8.66671H1.99991C1.82999 8.66652 1.66656 8.60145 1.543 8.48481C1.41944 8.36816 1.34509 8.20874 1.33513 8.03911C1.32517 7.86948 1.38036 7.70245 1.48942 7.57215C1.59848 7.44185 1.75318 7.35811 1.92191 7.33804L1.99991 7.33337H2.66658ZM7.99991 1.33337C8.1632 1.3334 8.3208 1.39334 8.44283 1.50185C8.56485 1.61036 8.64281 1.75987 8.66191 1.92204L8.66658 2.00004V2.66671C8.66639 2.83663 8.60133 3.00006 8.48468 3.12362C8.36803 3.24718 8.20861 3.32153 8.03898 3.33149C7.86935 3.34145 7.70233 3.28626 7.57202 3.1772C7.44172 3.06814 7.35798 2.91344 7.33791 2.74471L7.33325 2.66671V2.00004C7.33325 1.82323 7.40348 1.65366 7.52851 1.52864C7.65353 1.40361 7.8231 1.33337 7.99991 1.33337ZM13.9999 7.33337C14.1698 7.33356 14.3333 7.39863 14.4568 7.51527C14.5804 7.63192 14.6547 7.79134 14.6647 7.96097C14.6747 8.1306 14.6195 8.29763 14.5104 8.42793C14.4013 8.55823 14.2466 8.64197 14.0779 8.66204L13.9999 8.66671H13.3332C13.1633 8.66652 12.9999 8.60145 12.8763 8.48481C12.7528 8.36816 12.6784 8.20874 12.6685 8.03911C12.6585 7.86948 12.7137 7.70245 12.8228 7.57215C12.9318 7.44185 13.0865 7.35811 13.2552 7.33804L13.3332 7.33337H13.9999ZM3.26191 3.26204C3.37671 3.14726 3.52944 3.0783 3.69146 3.06811C3.85348 3.05793 4.01364 3.10721 4.14191 3.20671L4.20458 3.26204L4.67125 3.72871C4.79081 3.84868 4.86023 4.00966 4.8654 4.17896C4.87057 4.34826 4.8111 4.51318 4.69908 4.64023C4.58706 4.76727 4.43088 4.84691 4.26226 4.86297C4.09365 4.87904 3.92524 4.83032 3.79125 4.72671L3.72858 4.67137L3.26191 4.20471C3.13693 4.07969 3.06672 3.91015 3.06672 3.73337C3.06672 3.5566 3.13693 3.38706 3.26191 3.26204ZM11.7952 3.26204C11.9152 3.14248 12.0762 3.07306 12.2455 3.06789C12.4148 3.06272 12.5797 3.12218 12.7068 3.23421C12.8338 3.34623 12.9135 3.50241 12.9295 3.67102C12.9456 3.83964 12.8969 4.00805 12.7932 4.14204L12.7379 4.20471L12.2712 4.67137C12.1513 4.79094 11.9903 4.86036 11.821 4.86553C11.6517 4.8707 11.4868 4.81123 11.3597 4.69921C11.2327 4.58719 11.153 4.43101 11.137 4.26239C11.1209 4.09378 11.1696 3.92537 11.2732 3.79137L11.3286 3.72871L11.7952 3.26204ZM9.33325 12C9.51006 12 9.67963 12.0703 9.80465 12.1953C9.92967 12.3203 9.99991 12.4899 9.99991 12.6667C9.99991 13.1971 9.7892 13.7058 9.41413 14.0809C9.03905 14.456 8.53035 14.6667 7.99991 14.6667C7.46948 14.6667 6.96077 14.456 6.5857 14.0809C6.21063 13.7058 5.99991 13.1971 5.99991 12.6667C5.99993 12.5034 6.05988 12.3458 6.16839 12.2238C6.2769 12.1018 6.42641 12.0238 6.58858 12.0047L6.66658 12H9.33325ZM7.99991 4.00004C8.83944 4.00004 9.65769 4.26419 10.3388 4.75507C11.0198 5.24595 11.5292 5.93868 11.7946 6.73513C12.0601 7.53158 12.0683 8.39137 11.818 9.19271C11.5676 9.99405 11.0715 10.6963 10.3999 11.2C10.308 11.2691 10.1999 11.3132 10.0859 11.328L9.99991 11.3334H5.99991C5.85567 11.3334 5.71531 11.2866 5.59991 11.2C4.92829 10.6963 4.43218 9.99405 4.18186 9.19271C3.93154 8.39137 3.9397 7.53158 4.20518 6.73513C4.47066 5.93868 4.98001 5.24595 5.66107 4.75507C6.34213 4.26419 7.16038 4.00004 7.99991 4.00004Z" fill="#FFBC11" />
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_39_14671">
|
||||||
|
<rect width="16" height="16" fill="white" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
|
||||||
|
)
|
||||||
|
: <div></div>
|
||||||
|
}
|
||||||
|
{/* TRANSFER CARD END */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
|
||||||
|
interface TypeCardv1Props {
|
||||||
|
titleType?: string;
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
export const TypeCardv1 = ({
|
||||||
|
...props
|
||||||
|
}: TypeCardv1Props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<span className="inline-block mb-2 bg-teal-400 bg-opacity-25 text-teal-400 px-2 py-1 rounded-md text-center font-public-sans text-xs font-bold">
|
||||||
|
{props.titleType}
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"idInstrument":"1",
|
||||||
|
"namaInstrument":"Mindray BC800",
|
||||||
|
"type":"rs232",
|
||||||
|
"instrumentTypeDetail":[
|
||||||
|
{
|
||||||
|
"label":"speed",
|
||||||
|
"value":"800"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label":"baudRate",
|
||||||
|
"value":"8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label":"dataBit",
|
||||||
|
"value":"N"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label":"stopBit",
|
||||||
|
"value":"1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idInstrument":"2",
|
||||||
|
"namaInstrument":"Mindray BC240",
|
||||||
|
"type":"rs232",
|
||||||
|
"instrumentTypeDetail":[
|
||||||
|
{
|
||||||
|
"label":"speed",
|
||||||
|
"value":"800"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label":"baudRate",
|
||||||
|
"value":"8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label":"dataBit",
|
||||||
|
"value":"N"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label":"stopBit",
|
||||||
|
"value":"1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idInstrument":"3",
|
||||||
|
"namaInstrument":"Mindray BC800",
|
||||||
|
"type":"ipclient",
|
||||||
|
"instrumentTypeDetail":[
|
||||||
|
{
|
||||||
|
"label":"host",
|
||||||
|
"value":"192.168.10.10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label":"port",
|
||||||
|
"value":"5001"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idInstrument":"4",
|
||||||
|
"namaInstrument":"Mindray BC240",
|
||||||
|
"type":"ipserver",
|
||||||
|
"instrumentTypeDetail":[
|
||||||
|
{
|
||||||
|
"label":"listeningPort",
|
||||||
|
"value":"8001"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import '../../../../app/global.css'
|
||||||
|
import { CardInstrument } from '../cardInstrument/CardInstrument';
|
||||||
|
import { InstrumentType } from '../models/InstrumentModel';
|
||||||
|
|
||||||
|
interface InstrumentBoxProps {
|
||||||
|
totalCard?: number;
|
||||||
|
dataInstrumentType: InstrumentType[];
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary UI component for user interaction
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const InstrumentBox = ({
|
||||||
|
...props
|
||||||
|
}: InstrumentBoxProps) => {
|
||||||
|
|
||||||
|
let col = 2;
|
||||||
|
|
||||||
|
let showData = [];
|
||||||
|
|
||||||
|
if (props.totalCard != undefined && props.totalCard > 0) {
|
||||||
|
for (let index = 0; index < props.totalCard; index++) {
|
||||||
|
showData.push([
|
||||||
|
<CardInstrument
|
||||||
|
lampu={true}
|
||||||
|
online={true}
|
||||||
|
titleAlat={props.dataInstrumentType[index].title}
|
||||||
|
type={props.dataInstrumentType[index].type}
|
||||||
|
typeDetail={props.dataInstrumentType[index].data}
|
||||||
|
/>
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className={`grid grid-cols-${col} gap-10`}>
|
||||||
|
{ showData }
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
24
front_end_portserver/src/components/main/model/TableModel.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
|
|
||||||
|
export type PortServerData = {
|
||||||
|
id : string;
|
||||||
|
info : string;
|
||||||
|
date : Date;
|
||||||
|
type : 'status' | 'result' | 'query';
|
||||||
|
}
|
||||||
|
|
||||||
|
export type HeaderTableProps = {
|
||||||
|
data: PortServerData[];
|
||||||
|
columns: ColumnDef<PortServerData>[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DropDownComponentProps = {
|
||||||
|
label: string ;
|
||||||
|
type : string ;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TableBodyProps = {
|
||||||
|
data: PortServerData[]; // Sesuaikan dengan tipe data sebenarnya
|
||||||
|
columns: ColumnDef<PortServerData>[]; // Sesuaikan dengan tipe data sebenarnya
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
// export type InstrumentTypeDetail = {
|
||||||
|
// label: string;
|
||||||
|
// value: string;
|
||||||
|
// };
|
||||||
|
|
||||||
|
// export type InstrumentModel = {
|
||||||
|
// idInstrument: string;
|
||||||
|
// namaInstrument: string;
|
||||||
|
// type:string;
|
||||||
|
// instrumentTypeDetail: InstrumentTypeDetail[]
|
||||||
|
// };
|
||||||
|
|
||||||
|
export type Rs232Type = {
|
||||||
|
speedValue: string,
|
||||||
|
dataBitValue: string,
|
||||||
|
parityValue: string,
|
||||||
|
stopBitValue: string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type IpClientType = {
|
||||||
|
hostValue: string,
|
||||||
|
portValue: string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type IpServerType = {
|
||||||
|
listeningPortValue: string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type UdpClientType = {
|
||||||
|
hostValue: string,
|
||||||
|
portValue: string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type UdpServerType = {
|
||||||
|
listeningPortValue: string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type InstrumentType = {
|
||||||
|
engine: string,
|
||||||
|
type: string,
|
||||||
|
title: string,
|
||||||
|
data: Rs232Type | IpClientType | IpServerType | UdpClientType | UdpServerType
|
||||||
|
};
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { Meta, StoryObj } from "@storybook/react";
|
||||||
|
import { PortServerData } from "@/components/main/model/TableModel";
|
||||||
|
import { TableBodyComponent } from "../tableComponent/BodyTableComponent";
|
||||||
|
import { columns } from "../tableComponent/columns";
|
||||||
|
|
||||||
|
const data:PortServerData[] = [
|
||||||
|
{ id: "1", info: "Info 1", date: new Date("2023-10-30 15:26:04"), type: 'status' },
|
||||||
|
{ id: "2", info: "Info 2", date: new Date("2023-10-30 15:26:04"), type: 'result' },
|
||||||
|
{ id: "3", info: "Info 3", date: new Date("2023-10-30 15:26:04"), type: 'query' }
|
||||||
|
];
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Table/Body',
|
||||||
|
component: TableBodyComponent,
|
||||||
|
args: {
|
||||||
|
data: data,
|
||||||
|
columns: columns,
|
||||||
|
},
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
|
||||||
|
} satisfies Meta<typeof TableBodyComponent>
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>
|
||||||
|
|
||||||
|
export const PortServerBodyTables = (args: Story ) => {
|
||||||
|
return (
|
||||||
|
<TableBodyComponent data={data} columns={columns} {...args} />
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Meta, StoryObj} from "@storybook/react";
|
import { Meta, StoryObj} from "@storybook/react";
|
||||||
import { DataTableDemo, columns, data } from "../tableComponent/DataTable";
|
import { DataTableDemo, columns, data } from "../tableComponent/DataTable";
|
||||||
|
import DataTable from "../tableComponent/newDataTable";
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Component/Table',
|
title: 'Component/Table',
|
||||||
component: DataTableDemo,
|
component: DataTableDemo,
|
||||||
parameters: {
|
parameters: {
|
||||||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
@@ -25,3 +25,9 @@ export const Datable = (args:Story) => {
|
|||||||
<DataTableDemo data={data} columns={columns} {...args} />
|
<DataTableDemo data={data} columns={columns} {...args} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const DataTable2 = (args: Story) => {
|
||||||
|
return (
|
||||||
|
<DataTable data={data} columns={columns} {...args}/>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
import { DropDownMenuComponent } from '../tableComponent/DropDownMenuComponent';
|
||||||
|
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Table/DropdownOption',
|
||||||
|
component: DropDownMenuComponent,
|
||||||
|
argTypes:{
|
||||||
|
label: {
|
||||||
|
options: ["cog", "dot",],
|
||||||
|
control: { type: 'radio' },
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
options: ['status','query','result','head'],
|
||||||
|
control: {type: 'radio'},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
tags: ['autodocs'],
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof DropDownMenuComponent>;
|
||||||
|
|
||||||
|
export default meta
|
||||||
|
|
||||||
|
type Story = StoryObj<typeof meta>
|
||||||
|
|
||||||
|
export const CogDropDown = () => {
|
||||||
|
return(
|
||||||
|
<DropDownMenuComponent
|
||||||
|
label= "cog"
|
||||||
|
type= "head"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DotDropDownStatus = (args: Story) => {
|
||||||
|
return(
|
||||||
|
<DropDownMenuComponent
|
||||||
|
label= "dot"
|
||||||
|
type= "status"
|
||||||
|
{...args}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DotDropDownQuery = (args: Story) => {
|
||||||
|
return(
|
||||||
|
<DropDownMenuComponent
|
||||||
|
label= "dot"
|
||||||
|
type= "query"
|
||||||
|
{...args}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DotDropDownResult = (args: Story) => {
|
||||||
|
return(
|
||||||
|
<DropDownMenuComponent
|
||||||
|
label= "dot"
|
||||||
|
type= "result"
|
||||||
|
{...args}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { Meta, StoryObj } from "@storybook/react";
|
||||||
|
import { PortServerData } from "@/components/main/model/TableModel";
|
||||||
|
import { TableHeaderComponent } from "../tableComponent/HeaderTableComponent";
|
||||||
|
import { columns } from "../tableComponent/columns";
|
||||||
|
|
||||||
|
const data:PortServerData[] = [
|
||||||
|
{ id: "1", info: "Info 1", date: new Date("2023-10-30 15:26:04"), type: 'status' },
|
||||||
|
{ id: "2", info: "Info 2", date: new Date("2023-10-30 15:26:04"), type: 'result' },
|
||||||
|
{ id: "3", info: "Info 3", date: new Date("2023-10-30 15:26:04"), type: 'query' }
|
||||||
|
];
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Table/Header',
|
||||||
|
component: TableHeaderComponent,
|
||||||
|
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
args: {
|
||||||
|
data: data,
|
||||||
|
columns: columns
|
||||||
|
}
|
||||||
|
|
||||||
|
} satisfies Meta<typeof TableHeaderComponent>
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>
|
||||||
|
|
||||||
|
export const PortServerHeadTables = (args: Story) => {
|
||||||
|
return (
|
||||||
|
<TableHeaderComponent data={data} columns={columns} {...args}/>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Meta, StoryObj } from "@storybook/react";
|
import { Meta, StoryObj } from "@storybook/react";
|
||||||
import { Icon } from "../tableComponent/icon";
|
import { Icon } from "../tableComponent/IconComponent";
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Component/Table/Icon',
|
title: 'Component/Table/Icon',
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import { TableBody, TableRow, TableCell } from '@/components/ui/table';
|
||||||
|
import { flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
|
||||||
|
import { TableBodyProps } from '@/components/main/model/TableModel';
|
||||||
|
|
||||||
|
|
||||||
|
export const TableBodyComponent = ({ data, columns }:TableBodyProps) => {
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
})
|
||||||
|
return (
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(
|
||||||
|
cell.column.columnDef.cell,
|
||||||
|
cell.getContext()
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell
|
||||||
|
colSpan={columns.length}
|
||||||
|
className="h-24 text-center"
|
||||||
|
>
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</TableBody>
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -91,7 +91,7 @@ export const columns: ColumnDef<PortServer>[] = [
|
|||||||
<CogIcon />
|
<CogIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuContent align="end" >
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={() => {}}
|
onClick={() => {}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import { DropDownComponentProps } from "@/components/main/model/TableModel";
|
||||||
|
import { CogIcon, DotIcon } from "../stories/Icon.stories"
|
||||||
|
import { Button } from "@/components/ui/button"
|
||||||
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
|
||||||
|
|
||||||
|
|
||||||
|
export const DropDownMenuComponent = ({label, type}:DropDownComponentProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button variant="ghost" className="h-8 w-8 p-0">
|
||||||
|
{label.toLowerCase() === 'cog' && (
|
||||||
|
<CogIcon />
|
||||||
|
)}
|
||||||
|
{label.toLowerCase() === 'dot' && (
|
||||||
|
<DotIcon />
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent align="end">
|
||||||
|
{type.toLowerCase() === 'status' && (
|
||||||
|
<DropdownMenuItem
|
||||||
|
onClick={() => {}}
|
||||||
|
>
|
||||||
|
Info
|
||||||
|
</DropdownMenuItem>
|
||||||
|
)}
|
||||||
|
{type.toLowerCase() === 'result' && (
|
||||||
|
<>
|
||||||
|
<DropdownMenuItem onClick={() => {}} >Raw Data</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem onClick={() => {}}>Result</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem onClick={() => {}}>Export</DropdownMenuItem>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{type.toLowerCase() === 'query' && (
|
||||||
|
<>
|
||||||
|
<DropdownMenuItem onClick={() => {}}>Raw Data</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem onClick={() => {}}>Query Response</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem onClick={() => {}}>Export</DropdownMenuItem>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{type.toLowerCase() === 'head' && (
|
||||||
|
<DropdownMenuItem onClick={() => {}}>Change Password</DropdownMenuItem>
|
||||||
|
)}
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</>
|
||||||
|
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import { HeaderTableProps } from "@/components/main/model/TableModel";
|
||||||
|
import { TableHeader, TableRow, TableHead } from "@/components/ui/table";
|
||||||
|
import { flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
|
||||||
|
|
||||||
|
export const TableHeaderComponent = ({ data, columns }:HeaderTableProps) => {
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup: any) => (
|
||||||
|
<TableRow key={headerGroup.id}>
|
||||||
|
{headerGroup.headers.map((header: any) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
typeof header.getContext === 'function' ? header.getContext() : {}
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import cog from "@/components/table/assets/cog.svg"
|
import cog from "@/assets/cog.svg"
|
||||||
import dot from "@/components/table/assets/dots-vertical.svg"
|
import dot from "@/assets/dots-vertical.svg"
|
||||||
|
|
||||||
interface IconProps {
|
interface IconProps {
|
||||||
type ?: "cog" | "dot";
|
type ?: "cog" | "dot";
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import { PortServerData } from "@/components/main/model/TableModel"
|
||||||
|
import { ColumnDef } from "@tanstack/react-table"
|
||||||
|
import { DateDisplay } from "./DateDisplay"
|
||||||
|
import { CogDropDown } from "../stories/DropDownMenu.stories"
|
||||||
|
import { DropDownMenuComponent } from "./DropDownMenuComponent"
|
||||||
|
|
||||||
|
export const columns: ColumnDef<PortServerData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "date",
|
||||||
|
header: "Date",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const date = new Date(row.getValue("date"))
|
||||||
|
return(
|
||||||
|
<div className="text-[#637381] bg-[#919EAB29] rounded-md border-4 border-[#919EAB29]">
|
||||||
|
<DateDisplay date={date}/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "info",
|
||||||
|
header: "Info",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="capitalize">{row.getValue("info")}</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
header:() => {
|
||||||
|
return(
|
||||||
|
<CogDropDown />
|
||||||
|
)
|
||||||
|
},
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const type = row.original
|
||||||
|
return (
|
||||||
|
<DropDownMenuComponent label="dot" type={type.type}/>
|
||||||
|
)}
|
||||||
|
},
|
||||||
|
]
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { Table} from "@/components/ui/table";
|
||||||
|
import { TableBodyComponent } from "./BodyTableComponent";
|
||||||
|
import { TableHeaderComponent } from "./HeaderTableComponent";
|
||||||
|
import { PortServerData } from "@/components/main/model/TableModel";
|
||||||
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
|
|
||||||
|
interface DataTableprops {
|
||||||
|
data: PortServerData[];
|
||||||
|
columns: ColumnDef<PortServerData>[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const DataTable = ({data, columns }:DataTableprops) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="rounded-md border">
|
||||||
|
<Table>
|
||||||
|
<TableHeaderComponent data={data} columns={columns} />
|
||||||
|
<TableBodyComponent data={data} columns={columns} />
|
||||||
|
</Table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DataTable;
|
||||||
36
front_end_portserver/src/components/ui/badge.tsx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
import { cva, type VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const badgeVariants = cva(
|
||||||
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||||
|
{
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default:
|
||||||
|
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
||||||
|
secondary:
|
||||||
|
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||||
|
destructive:
|
||||||
|
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
||||||
|
outline: "text-foreground",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: "default",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface BadgeProps
|
||||||
|
extends React.HTMLAttributes<HTMLDivElement>,
|
||||||
|
VariantProps<typeof badgeVariants> {}
|
||||||
|
|
||||||
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
||||||
|
return (
|
||||||
|
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Badge, badgeVariants }
|
||||||
79
front_end_portserver/src/components/ui/card.tsx
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const Card = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn(
|
||||||
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
Card.displayName = "Card"
|
||||||
|
|
||||||
|
const CardHeader = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardHeader.displayName = "CardHeader"
|
||||||
|
|
||||||
|
const CardTitle = React.forwardRef<
|
||||||
|
HTMLParagraphElement,
|
||||||
|
React.HTMLAttributes<HTMLHeadingElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<h3
|
||||||
|
ref={ref}
|
||||||
|
className={cn(
|
||||||
|
"text-2xl font-semibold leading-none tracking-tight",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardTitle.displayName = "CardTitle"
|
||||||
|
|
||||||
|
const CardDescription = React.forwardRef<
|
||||||
|
HTMLParagraphElement,
|
||||||
|
React.HTMLAttributes<HTMLParagraphElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<p
|
||||||
|
ref={ref}
|
||||||
|
className={cn("text-sm text-muted-foreground", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardDescription.displayName = "CardDescription"
|
||||||
|
|
||||||
|
const CardContent = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
||||||
|
))
|
||||||
|
CardContent.displayName = "CardContent"
|
||||||
|
|
||||||
|
const CardFooter = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn("flex items-center p-6 pt-0", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardFooter.displayName = "CardFooter"
|
||||||
|
|
||||||
|
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/react';
|
|
||||||
|
|
||||||
import { Header } from './Header';
|
|
||||||
|
|
||||||
const meta = {
|
|
||||||
title: 'Example/Header',
|
|
||||||
component: Header,
|
|
||||||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
||||||
tags: ['autodocs'],
|
|
||||||
parameters: {
|
|
||||||
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
|
|
||||||
layout: 'fullscreen',
|
|
||||||
},
|
|
||||||
} satisfies Meta<typeof Header>;
|
|
||||||
|
|
||||||
export default meta;
|
|
||||||
type Story = StoryObj<typeof meta>;
|
|
||||||
|
|
||||||
export const LoggedIn: Story = {
|
|
||||||
args: {
|
|
||||||
user: {
|
|
||||||
name: 'Jane Doe',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const LoggedOut: Story = {};
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/react';
|
|
||||||
import { within, userEvent } from '@storybook/testing-library';
|
|
||||||
|
|
||||||
import { Page } from './Page';
|
|
||||||
|
|
||||||
const meta = {
|
|
||||||
title: 'Example/Page',
|
|
||||||
component: Page,
|
|
||||||
parameters: {
|
|
||||||
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
|
|
||||||
layout: 'fullscreen',
|
|
||||||
},
|
|
||||||
} satisfies Meta<typeof Page>;
|
|
||||||
|
|
||||||
export default meta;
|
|
||||||
type Story = StoryObj<typeof meta>;
|
|
||||||
|
|
||||||
export const LoggedOut: Story = {};
|
|
||||||
|
|
||||||
// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
|
|
||||||
export const LoggedIn: Story = {
|
|
||||||
play: async ({ canvasElement }) => {
|
|
||||||
const canvas = within(canvasElement);
|
|
||||||
const loginButton = await canvas.getByRole('button', {
|
|
||||||
name: /Log in/i,
|
|
||||||
});
|
|
||||||
await userEvent.click(loginButton);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
import { CardInstrument } from '../../components/main/cardInstrument/CardInstrument';
|
||||||
|
|
||||||
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Main/Card',
|
||||||
|
component: CardInstrument,
|
||||||
|
parameters: {
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
||||||
|
tags: ['autodocs'],
|
||||||
|
argTypes: {
|
||||||
|
// backgroundColor: { control: 'color' },
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof CardInstrument>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
// Rs 232 Cobas Online NoTransfer
|
||||||
|
export const rs232CobasOnlineNoTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'COBAS 800',
|
||||||
|
type: 'rs232',
|
||||||
|
lampu: true,
|
||||||
|
online: true,
|
||||||
|
typeDetail: {
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Rs 232 Cobas Online Transfer
|
||||||
|
export const rs232CobasOnlineTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'COBAS 800',
|
||||||
|
type: 'rs232',
|
||||||
|
lampu: false,
|
||||||
|
online: true,
|
||||||
|
typeDetail: {
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Rs 232 Cobas Offline Transfer
|
||||||
|
export const rs232CobasOfflineTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'COBAS 800',
|
||||||
|
type: 'rs232',
|
||||||
|
lampu: false,
|
||||||
|
online: false,
|
||||||
|
typeDetail: {
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ipclient Mindray Online No Transfer
|
||||||
|
export const ipclientMindrayBC800OnlineNoTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'Mindray BC800',
|
||||||
|
type: 'ipclient',
|
||||||
|
lampu: true,
|
||||||
|
online: true,
|
||||||
|
typeDetail: {
|
||||||
|
hostValue: "192.168.10.10",
|
||||||
|
portValue: "5001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ipclient Mindray Online Transfer
|
||||||
|
export const ipclientMindrayBC800OnlineTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'Mindray BC800',
|
||||||
|
type: 'ipclient',
|
||||||
|
lampu: false,
|
||||||
|
online: true,
|
||||||
|
typeDetail: {
|
||||||
|
hostValue: "192.168.10.10",
|
||||||
|
portValue: "5001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ip Client Offline Transfer
|
||||||
|
export const ipclientMindrayBC800OfflineTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'Mindray BC800',
|
||||||
|
type: 'ipclient',
|
||||||
|
lampu: false,
|
||||||
|
online: false,
|
||||||
|
typeDetail: {
|
||||||
|
hostValue: "192.168.10.10",
|
||||||
|
portValue: "5001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ip Server Mindray Online No Transfer
|
||||||
|
export const ipserverMindrayBC240OnlineNoTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'Mindray BC240',
|
||||||
|
type: 'ipserver',
|
||||||
|
lampu: true,
|
||||||
|
online: true,
|
||||||
|
typeDetail: {
|
||||||
|
listeningPortValue:"8001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ip Server Mindray Online Transfer
|
||||||
|
export const ipserverMindrayBC240OnlineTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'Mindray BC240',
|
||||||
|
type: 'ipserver',
|
||||||
|
lampu: false,
|
||||||
|
online: true,
|
||||||
|
typeDetail:{
|
||||||
|
listeningPortValue:"8001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ip Server Offline Transfer
|
||||||
|
export const ipserverMindrayBC240OfflineTransfer: Story = {
|
||||||
|
args: {
|
||||||
|
titleAlat: 'Mindray BC240',
|
||||||
|
type: 'ipserver',
|
||||||
|
lampu: false,
|
||||||
|
online: false,
|
||||||
|
typeDetail:{
|
||||||
|
listeningPortValue:"8001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/react';
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
import { IpClientPropertyView } from '../../components/main/cardInstrument/IpClientPropertyView';
|
||||||
import { Button } from './Button';
|
|
||||||
|
|
||||||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Example/Button',
|
title: 'Component/Main/Ipclient',
|
||||||
component: Button,
|
component: IpClientPropertyView,
|
||||||
parameters: {
|
parameters: {
|
||||||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
@@ -14,37 +13,16 @@ const meta = {
|
|||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
argTypes: {
|
argTypes: {
|
||||||
backgroundColor: { control: 'color' },
|
// backgroundColor: { control: 'color' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Button>;
|
} satisfies Meta<typeof IpClientPropertyView>;
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
type Story = StoryObj<typeof meta>;
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
export const Primary: Story = {
|
export const Ipclient: Story = {
|
||||||
args: {
|
args: {
|
||||||
primary: true,
|
type:''
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Secondary: Story = {
|
|
||||||
args: {
|
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Large: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'large',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Small: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'small',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/react';
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
import { IpServerPropertyView } from '../../components/main/cardInstrument/IpServerPropertyView';
|
||||||
import { Button } from './Button';
|
|
||||||
|
|
||||||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Example/Button',
|
title: 'Component/Main/Ipserver',
|
||||||
component: Button,
|
component: IpServerPropertyView,
|
||||||
parameters: {
|
parameters: {
|
||||||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
@@ -14,37 +13,16 @@ const meta = {
|
|||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
argTypes: {
|
argTypes: {
|
||||||
backgroundColor: { control: 'color' },
|
// backgroundColor: { control: 'color' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Button>;
|
} satisfies Meta<typeof IpServerPropertyView>;
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
type Story = StoryObj<typeof meta>;
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
export const Primary: Story = {
|
export const Ipclient: Story = {
|
||||||
args: {
|
args: {
|
||||||
primary: true,
|
type:''
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Secondary: Story = {
|
|
||||||
args: {
|
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Large: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'large',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Small: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'small',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
import { RowLabelValue } from '../../components/main/cardInstrument/RowLabelValue';
|
||||||
|
|
||||||
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Main/Row Label Value',
|
||||||
|
component: RowLabelValue,
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
||||||
|
tags: ['autodocs'],
|
||||||
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
|
argTypes: {
|
||||||
|
// backgroundColor: { control: 'color' },
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof RowLabelValue>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
|
export const Initial: Story = {
|
||||||
|
args: {
|
||||||
|
label:'',
|
||||||
|
value:''
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { RowIndicatorv1 } from '@/components/main/cardInstrument/Rowindicatorv1';
|
||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Main/Row Indicator',
|
||||||
|
component: RowIndicatorv1,
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
||||||
|
tags: ['autodocs'],
|
||||||
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
|
argTypes: {
|
||||||
|
// backgroundColor: { control: 'color' },
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof RowIndicatorv1>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
|
export const Initial: Story = {
|
||||||
|
args: {
|
||||||
|
type:''
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
import { Rs232PropertyView } from '../../components/main/cardInstrument/Rs232PropertyView';
|
||||||
|
|
||||||
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Main/Rs232',
|
||||||
|
component: Rs232PropertyView,
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
||||||
|
tags: ['autodocs'],
|
||||||
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
|
argTypes: {
|
||||||
|
// backgroundColor: { control: 'color' },
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof Rs232PropertyView>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
|
export const Rs232: Story = {
|
||||||
|
args: {
|
||||||
|
type:''
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { StatusCardv1 } from '@/components/main/cardInstrument/StatusCardv1';
|
||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Main/Status card',
|
||||||
|
component: StatusCardv1,
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
||||||
|
tags: ['autodocs'],
|
||||||
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
|
argTypes: {
|
||||||
|
// backgroundColor: { control: 'color' },
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof StatusCardv1>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
|
export const Initial: Story = {
|
||||||
|
args: {
|
||||||
|
isOnline:false
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
|
import { StatusOnlinev1 } from '@/components/main/cardInstrument/StatusOnlinev1';
|
||||||
import type { Meta, StoryObj } from '@storybook/react';
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
import { Cardv1 } from './Cardv1';
|
|
||||||
|
|
||||||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Example/Card',
|
title: 'Component/Main/Status Online',
|
||||||
component: Cardv1,
|
component: StatusOnlinev1,
|
||||||
parameters: {
|
parameters: {
|
||||||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
@@ -14,37 +13,22 @@ const meta = {
|
|||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
argTypes: {
|
argTypes: {
|
||||||
backgroundColor: { control: 'color' },
|
// backgroundColor: { control: 'color' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Cardv1>;
|
} satisfies Meta<typeof StatusOnlinev1>;
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
type Story = StoryObj<typeof meta>;
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
export const Primary: Story = {
|
export const StatusOnline: Story = {
|
||||||
args: {
|
args: {
|
||||||
primary: true,
|
isOnlineCard:true
|
||||||
label: 'Button',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Secondary: Story = {
|
export const StatusOffline: Story = {
|
||||||
args: {
|
args: {
|
||||||
label: 'Button',
|
isOnlineCard:false
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Large: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'large',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Small: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'small',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
|
import { StatusTransferv1 } from '@/components/main/cardInstrument/StatusTransferv1';
|
||||||
import type { Meta, StoryObj } from '@storybook/react';
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
import { Cardv1 } from './Cardv1';
|
|
||||||
|
|
||||||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Example/Card',
|
title: 'Component/Main/Status Transfer',
|
||||||
component: Cardv1,
|
component: StatusTransferv1,
|
||||||
parameters: {
|
parameters: {
|
||||||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
@@ -14,37 +13,22 @@ const meta = {
|
|||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
argTypes: {
|
argTypes: {
|
||||||
backgroundColor: { control: 'color' },
|
// backgroundColor: { control: 'color' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Cardv1>;
|
} satisfies Meta<typeof StatusTransferv1>;
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
type Story = StoryObj<typeof meta>;
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
export const Primary: Story = {
|
export const StatusTransferTrue: Story = {
|
||||||
args: {
|
args: {
|
||||||
primary: true,
|
isTransferCard:true
|
||||||
label: 'Button',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Secondary: Story = {
|
export const StatusTransferFalse: Story = {
|
||||||
args: {
|
args: {
|
||||||
label: 'Button',
|
isTransferCard:false
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Large: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'large',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Small: Story = {
|
|
||||||
args: {
|
|
||||||
size: 'small',
|
|
||||||
label: 'Button',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { TypeCardv1 } from '@/components/main/cardInstrument/TypeCardv1';
|
||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Main/Type Card',
|
||||||
|
component: TypeCardv1,
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
||||||
|
tags: ['autodocs'],
|
||||||
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
|
argTypes: {
|
||||||
|
// backgroundColor: { control: 'color' },
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof TypeCardv1>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
|
export const Initial: Story = {
|
||||||
|
args: {
|
||||||
|
titleType:''
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import '../../../app/global.css'
|
|
||||||
import { Button } from "@/components/ui/button"
|
|
||||||
|
|
||||||
interface CardProps {
|
|
||||||
/**
|
|
||||||
* Is this the principal call to action on the page?
|
|
||||||
*/
|
|
||||||
primary?: boolean;
|
|
||||||
/**
|
|
||||||
* What background color to use
|
|
||||||
*/
|
|
||||||
backgroundColor?: string;
|
|
||||||
/**
|
|
||||||
* How large should the button be?
|
|
||||||
*/
|
|
||||||
size?: 'small' | 'medium' | 'large';
|
|
||||||
/**
|
|
||||||
* Button contents
|
|
||||||
*/
|
|
||||||
label: string;
|
|
||||||
/**
|
|
||||||
* Optional click handler
|
|
||||||
*/
|
|
||||||
onClick?: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Primary UI component for user interaction
|
|
||||||
*/
|
|
||||||
export const Cardv1 = ({
|
|
||||||
primary = false,
|
|
||||||
size = 'medium',
|
|
||||||
backgroundColor,
|
|
||||||
label,
|
|
||||||
...props
|
|
||||||
}: CardProps) => {
|
|
||||||
return (
|
|
||||||
<Button>ROOT COLOR</Button>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
import { InstrumentBox } from '@/components/main/instrumentBox/InstrumentBox';
|
||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
|
const meta = {
|
||||||
|
title: 'Component/Main/Instrument Box',
|
||||||
|
component: InstrumentBox,
|
||||||
|
parameters: {
|
||||||
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
||||||
|
tags: ['autodocs'],
|
||||||
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
|
argTypes: {
|
||||||
|
// backgroundColor: { control: 'color' },
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof InstrumentBox>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
||||||
|
|
||||||
|
// Instrument 1 Alat
|
||||||
|
export const Instrument1Alat: Story = {
|
||||||
|
args: {
|
||||||
|
totalCard:1,
|
||||||
|
dataInstrumentType:[
|
||||||
|
{
|
||||||
|
engine:'astm',
|
||||||
|
title:'Cobas800',
|
||||||
|
type:'rs232',
|
||||||
|
data:{
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Instrument 2 Alat
|
||||||
|
export const Instrument2Alat: Story = {
|
||||||
|
args: {
|
||||||
|
totalCard:2,
|
||||||
|
dataInstrumentType:[
|
||||||
|
{
|
||||||
|
engine:'astm',
|
||||||
|
title:'Cobas800',
|
||||||
|
type:'rs232',
|
||||||
|
data:{
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
engine:'astm',
|
||||||
|
title:'Axsym 100',
|
||||||
|
type:'rs232',
|
||||||
|
data:{
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Instrument 3 Alat
|
||||||
|
export const Instrument3Alat: Story = {
|
||||||
|
args: {
|
||||||
|
totalCard:3,
|
||||||
|
dataInstrumentType:[
|
||||||
|
{
|
||||||
|
engine:'astm',
|
||||||
|
title:'Cobas800',
|
||||||
|
type:'rs232',
|
||||||
|
data:{
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
engine:'astm',
|
||||||
|
title:'Axsym 100',
|
||||||
|
type:'rs232',
|
||||||
|
data:{
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
engine:'mindray',
|
||||||
|
title:'Mindray BC800',
|
||||||
|
type:'ipclient',
|
||||||
|
data:{
|
||||||
|
hostValue:"192.168.10.10",
|
||||||
|
portValue:"5001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Instrument 4 Alat
|
||||||
|
export const Instrument4Alat: Story = {
|
||||||
|
args: {
|
||||||
|
totalCard:4,
|
||||||
|
dataInstrumentType:[
|
||||||
|
{
|
||||||
|
engine:'astm',
|
||||||
|
title:'Cobas800',
|
||||||
|
type:'rs232',
|
||||||
|
data:{
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
engine:'astm',
|
||||||
|
title:'Axsym 100',
|
||||||
|
type:'rs232',
|
||||||
|
data:{
|
||||||
|
speedValue: '800',
|
||||||
|
dataBitValue: 'N',
|
||||||
|
parityValue: '',
|
||||||
|
stopBitValue: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
engine:'mindray',
|
||||||
|
title:'Mindray BC800',
|
||||||
|
type:'ipclient',
|
||||||
|
data:{
|
||||||
|
hostValue:"192.168.10.10",
|
||||||
|
portValue:"5001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
engine:'mindray',
|
||||||
|
title:'Mindray BC240',
|
||||||
|
type:'ipserver',
|
||||||
|
data:{
|
||||||
|
listeningPortValue:"8001"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
env: { browser: true, es2020: true },
|
|
||||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'],
|
|
||||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: ['react-refresh'],
|
|
||||||
rules: {
|
|
||||||
'react-refresh/only-export-components': [
|
|
||||||
'warn',
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
24
front_end_portserver_old/.gitignore
vendored
@@ -1,24 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
pnpm-debug.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
*.local
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
.idea
|
|
||||||
.DS_Store
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import type { StorybookConfig } from "@storybook/react-vite";
|
|
||||||
|
|
||||||
const config: StorybookConfig = {
|
|
||||||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
||||||
addons: [
|
|
||||||
"@storybook/addon-links",
|
|
||||||
"@storybook/addon-essentials",
|
|
||||||
"@storybook/addon-onboarding",
|
|
||||||
"@storybook/addon-interactions",
|
|
||||||
],
|
|
||||||
framework: {
|
|
||||||
name: "@storybook/react-vite",
|
|
||||||
options: {},
|
|
||||||
},
|
|
||||||
docs: {
|
|
||||||
autodocs: "tag",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
export default config;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import type { Preview } from "@storybook/react";
|
|
||||||
|
|
||||||
const preview: Preview = {
|
|
||||||
parameters: {
|
|
||||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
||||||
controls: {
|
|
||||||
matchers: {
|
|
||||||
color: /(background|color)$/i,
|
|
||||||
date: /Date$/i,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default preview;
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# React + TypeScript + Vite
|
|
||||||
|
|
||||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
||||||
|
|
||||||
Currently, two official plugins are available:
|
|
||||||
|
|
||||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
||||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
||||||
|
|
||||||
## Expanding the ESLint configuration
|
|
||||||
|
|
||||||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
||||||
|
|
||||||
- Configure the top-level `parserOptions` property like this:
|
|
||||||
|
|
||||||
```js
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 'latest',
|
|
||||||
sourceType: 'module',
|
|
||||||
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
||||||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
||||||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
@tailwind base;
|
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|
||||||
@layer base {
|
|
||||||
:root {
|
|
||||||
--background: 0 0% 100%;
|
|
||||||
--foreground: 222.2 84% 4.9%;
|
|
||||||
|
|
||||||
--card: 0 0% 100%;
|
|
||||||
--card-foreground: 222.2 84% 4.9%;
|
|
||||||
|
|
||||||
--popover: 0 0% 100%;
|
|
||||||
--popover-foreground: 222.2 84% 4.9%;
|
|
||||||
|
|
||||||
--primary: 222.2 47.4% 11.2%;
|
|
||||||
--primary-foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--secondary: 210 40% 96.1%;
|
|
||||||
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
||||||
|
|
||||||
--muted: 210 40% 96.1%;
|
|
||||||
--muted-foreground: 215.4 16.3% 46.9%;
|
|
||||||
|
|
||||||
--accent: 210 40% 96.1%;
|
|
||||||
--accent-foreground: 222.2 47.4% 11.2%;
|
|
||||||
|
|
||||||
--destructive: 0 84.2% 60.2%;
|
|
||||||
--destructive-foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--border: 214.3 31.8% 91.4%;
|
|
||||||
--input: 214.3 31.8% 91.4%;
|
|
||||||
--ring: 222.2 84% 4.9%;
|
|
||||||
|
|
||||||
--radius: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dark {
|
|
||||||
--background: 222.2 84% 4.9%;
|
|
||||||
--foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--card: 222.2 84% 4.9%;
|
|
||||||
--card-foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--popover: 222.2 84% 4.9%;
|
|
||||||
--popover-foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--primary: 210 40% 98%;
|
|
||||||
--primary-foreground: 222.2 47.4% 11.2%;
|
|
||||||
|
|
||||||
--secondary: 217.2 32.6% 17.5%;
|
|
||||||
--secondary-foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--muted: 217.2 32.6% 17.5%;
|
|
||||||
--muted-foreground: 215 20.2% 65.1%;
|
|
||||||
|
|
||||||
--accent: 217.2 32.6% 17.5%;
|
|
||||||
--accent-foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--destructive: 0 62.8% 30.6%;
|
|
||||||
--destructive-foreground: 210 40% 98%;
|
|
||||||
|
|
||||||
--border: 217.2 32.6% 17.5%;
|
|
||||||
--input: 217.2 32.6% 17.5%;
|
|
||||||
--ring: 212.7 26.8% 83.9%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@layer base {
|
|
||||||
* {
|
|
||||||
@apply border-border;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
@apply bg-background text-foreground;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://ui.shadcn.com/schema.json",
|
|
||||||
"style": "default",
|
|
||||||
"rsc": false,
|
|
||||||
"tsx": true,
|
|
||||||
"tailwind": {
|
|
||||||
"config": "tailwind.config.js",
|
|
||||||
"css": "app/global.css",
|
|
||||||
"baseColor": "slate",
|
|
||||||
"cssVariables": true
|
|
||||||
},
|
|
||||||
"aliases": {
|
|
||||||
"components": "@/components",
|
|
||||||
"utils": "@/lib/utils"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Vite + React + TS</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
14348
front_end_portserver_old/package-lock.json
generated
@@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "front_end_portserver",
|
|
||||||
"private": true,
|
|
||||||
"version": "0.0.0",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "vite",
|
|
||||||
"build": "tsc && vite build",
|
|
||||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
||||||
"preview": "vite preview",
|
|
||||||
"storybook": "storybook dev -p 6006",
|
|
||||||
"build-storybook": "storybook build"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@radix-ui/react-slot": "^1.0.2",
|
|
||||||
"class-variance-authority": "^0.7.0",
|
|
||||||
"clsx": "^2.0.0",
|
|
||||||
"lucide-react": "^0.292.0",
|
|
||||||
"react": "^18.2.0",
|
|
||||||
"react-dom": "^18.2.0",
|
|
||||||
"tailwind-merge": "^2.0.0",
|
|
||||||
"tailwindcss-animate": "^1.0.7"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@storybook/addon-essentials": "^7.5.2",
|
|
||||||
"@storybook/addon-interactions": "^7.5.2",
|
|
||||||
"@storybook/addon-links": "^7.5.2",
|
|
||||||
"@storybook/addon-onboarding": "^1.0.8",
|
|
||||||
"@storybook/blocks": "^7.5.2",
|
|
||||||
"@storybook/react": "^7.5.2",
|
|
||||||
"@storybook/react-vite": "^7.5.2",
|
|
||||||
"@storybook/testing-library": "^0.2.2",
|
|
||||||
"@types/node": "^20.8.10",
|
|
||||||
"@types/react": "^18.2.15",
|
|
||||||
"@types/react-dom": "^18.2.7",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
||||||
"@typescript-eslint/parser": "^6.0.0",
|
|
||||||
"@vitejs/plugin-react": "^4.0.3",
|
|
||||||
"autoprefixer": "^10.4.16",
|
|
||||||
"eslint": "^8.45.0",
|
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
|
||||||
"eslint-plugin-react-refresh": "^0.4.3",
|
|
||||||
"eslint-plugin-storybook": "^0.6.15",
|
|
||||||
"postcss": "^8.4.31",
|
|
||||||
"storybook": "^7.5.2",
|
|
||||||
"tailwindcss": "^3.3.5",
|
|
||||||
"typescript": "^5.0.2",
|
|
||||||
"vite": "^4.4.5"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export default {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,42 +0,0 @@
|
|||||||
#root {
|
|
||||||
max-width: 1280px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 2rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
height: 6em;
|
|
||||||
padding: 1.5em;
|
|
||||||
will-change: filter;
|
|
||||||
transition: filter 300ms;
|
|
||||||
}
|
|
||||||
.logo:hover {
|
|
||||||
filter: drop-shadow(0 0 2em #646cffaa);
|
|
||||||
}
|
|
||||||
.logo.react:hover {
|
|
||||||
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes logo-spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
|
||||||
a:nth-of-type(2) .logo {
|
|
||||||
animation: logo-spin infinite 20s linear;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
padding: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.read-the-docs {
|
|
||||||
color: #888;
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
import { useState } from 'react'
|
|
||||||
import reactLogo from './assets/react.svg'
|
|
||||||
import viteLogo from '/vite.svg'
|
|
||||||
import './App.css'
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
const [count, setCount] = useState(0)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div>
|
|
||||||
<a href="https://vitejs.dev" target="_blank">
|
|
||||||
<img src={viteLogo} className="logo" alt="Vite logo" />
|
|
||||||
</a>
|
|
||||||
<a href="https://react.dev" target="_blank">
|
|
||||||
<img src={reactLogo} className="logo react" alt="React logo" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<h1>Vite + React</h1>
|
|
||||||
<div className="card">
|
|
||||||
<button onClick={() => setCount((count) => count + 1)}>
|
|
||||||
count is {count}
|
|
||||||
</button>
|
|
||||||
<p>
|
|
||||||
Edit <code>src/App.tsx</code> and save to test HMR
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p className="read-the-docs">
|
|
||||||
Click on the Vite and React logos to learn more
|
|
||||||
</p>
|
|
||||||
<h1 className="text-3xl font-bold underline">
|
|
||||||
INI TAILWIND CSS
|
|
||||||
</h1>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,56 +0,0 @@
|
|||||||
import * as React from "react"
|
|
||||||
import { Slot } from "@radix-ui/react-slot"
|
|
||||||
import { cva, type VariantProps } from "class-variance-authority"
|
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
|
||||||
|
|
||||||
const buttonVariants = cva(
|
|
||||||
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
||||||
{
|
|
||||||
variants: {
|
|
||||||
variant: {
|
|
||||||
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
||||||
destructive:
|
|
||||||
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
||||||
outline:
|
|
||||||
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
||||||
secondary:
|
|
||||||
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
||||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
||||||
link: "text-primary underline-offset-4 hover:underline",
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
default: "h-10 px-4 py-2",
|
|
||||||
sm: "h-9 rounded-md px-3",
|
|
||||||
lg: "h-11 rounded-md px-8",
|
|
||||||
icon: "h-10 w-10",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
defaultVariants: {
|
|
||||||
variant: "default",
|
|
||||||
size: "default",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
export interface ButtonProps
|
|
||||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
||||||
VariantProps<typeof buttonVariants> {
|
|
||||||
asChild?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
||||||
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
||||||
const Comp = asChild ? Slot : "button"
|
|
||||||
return (
|
|
||||||
<Comp
|
|
||||||
className={cn(buttonVariants({ variant, size, className }))}
|
|
||||||
ref={ref}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
Button.displayName = "Button"
|
|
||||||
|
|
||||||
export { Button, buttonVariants }
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
@tailwind base;
|
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|
||||||
:root {
|
|
||||||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 1.5;
|
|
||||||
font-weight: 400;
|
|
||||||
|
|
||||||
color-scheme: light dark;
|
|
||||||
color: rgba(255, 255, 255, 0.87);
|
|
||||||
background-color: #242424;
|
|
||||||
|
|
||||||
font-synthesis: none;
|
|
||||||
text-rendering: optimizeLegibility;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
font-weight: 500;
|
|
||||||
color: #646cff;
|
|
||||||
text-decoration: inherit;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: #535bf2;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
display: flex;
|
|
||||||
place-items: center;
|
|
||||||
min-width: 320px;
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 3.2em;
|
|
||||||
line-height: 1.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
border-radius: 8px;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
padding: 0.6em 1.2em;
|
|
||||||
font-size: 1em;
|
|
||||||
font-weight: 500;
|
|
||||||
font-family: inherit;
|
|
||||||
background-color: #1a1a1a;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: border-color 0.25s;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
border-color: #646cff;
|
|
||||||
}
|
|
||||||
button:focus,
|
|
||||||
button:focus-visible {
|
|
||||||
outline: 4px auto -webkit-focus-ring-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
|
||||||
:root {
|
|
||||||
color: #213547;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: #747bff;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type ClassValue, clsx } from "clsx"
|
|
||||||
import { twMerge } from "tailwind-merge"
|
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
|
||||||
return twMerge(clsx(inputs))
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import ReactDOM from 'react-dom/client'
|
|
||||||
import App from './App.tsx'
|
|
||||||
import './index.css'
|
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
||||||
<React.StrictMode>
|
|
||||||
<App />
|
|
||||||
</React.StrictMode>,
|
|
||||||
)
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import './button.css';
|
|
||||||
|
|
||||||
interface ButtonProps {
|
|
||||||
/**
|
|
||||||
* Is this the principal call to action on the page?
|
|
||||||
*/
|
|
||||||
primary?: boolean;
|
|
||||||
/**
|
|
||||||
* What background color to use
|
|
||||||
*/
|
|
||||||
backgroundColor?: string;
|
|
||||||
/**
|
|
||||||
* How large should the button be?
|
|
||||||
*/
|
|
||||||
size?: 'small' | 'medium' | 'large';
|
|
||||||
/**
|
|
||||||
* Button contents
|
|
||||||
*/
|
|
||||||
label: string;
|
|
||||||
/**
|
|
||||||
* Optional click handler
|
|
||||||
*/
|
|
||||||
onClick?: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Primary UI component for user interaction
|
|
||||||
*/
|
|
||||||
export const Button = ({
|
|
||||||
primary = false,
|
|
||||||
size = 'medium',
|
|
||||||
backgroundColor,
|
|
||||||
label,
|
|
||||||
...props
|
|
||||||
}: ButtonProps) => {
|
|
||||||
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
||||||
style={{ backgroundColor }}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{label}
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,364 +0,0 @@
|
|||||||
import { Meta } from "@storybook/blocks";
|
|
||||||
|
|
||||||
import Github from "./assets/github.svg";
|
|
||||||
import Discord from "./assets/discord.svg";
|
|
||||||
import Youtube from "./assets/youtube.svg";
|
|
||||||
import Tutorials from "./assets/tutorials.svg";
|
|
||||||
import Styling from "./assets/styling.png";
|
|
||||||
import Context from "./assets/context.png";
|
|
||||||
import Assets from "./assets/assets.png";
|
|
||||||
import Docs from "./assets/docs.png";
|
|
||||||
import Share from "./assets/share.png";
|
|
||||||
import FigmaPlugin from "./assets/figma-plugin.png";
|
|
||||||
import Testing from "./assets/testing.png";
|
|
||||||
import Accessibility from "./assets/accessibility.png";
|
|
||||||
import Theming from "./assets/theming.png";
|
|
||||||
import AddonLibrary from "./assets/addon-library.png";
|
|
||||||
|
|
||||||
export const RightArrow = () => <svg
|
|
||||||
viewBox="0 0 14 14"
|
|
||||||
width="8px"
|
|
||||||
height="14px"
|
|
||||||
style={{
|
|
||||||
marginLeft: '4px',
|
|
||||||
display: 'inline-block',
|
|
||||||
shapeRendering: 'inherit',
|
|
||||||
verticalAlign: 'middle',
|
|
||||||
fill: 'currentColor',
|
|
||||||
'path fill': 'currentColor'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<Meta title="Configure your project" />
|
|
||||||
|
|
||||||
<div className="sb-container">
|
|
||||||
<div className='sb-section-title'>
|
|
||||||
# Configure your project
|
|
||||||
|
|
||||||
Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
|
|
||||||
</div>
|
|
||||||
<div className="sb-section">
|
|
||||||
<div className="sb-section-item">
|
|
||||||
<img
|
|
||||||
src={Styling}
|
|
||||||
alt="A wall of logos representing different styling technologies"
|
|
||||||
/>
|
|
||||||
<h4 className="sb-section-item-heading">Add styling and CSS</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-section-item">
|
|
||||||
<img
|
|
||||||
src={Context}
|
|
||||||
alt="An abstraction representing the composition of data for a component"
|
|
||||||
/>
|
|
||||||
<h4 className="sb-section-item-heading">Provide context and mocking</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/writing-stories/decorators#context-for-mocking"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-section-item">
|
|
||||||
<img src={Assets} alt="A representation of typography and image assets" />
|
|
||||||
<div>
|
|
||||||
<h4 className="sb-section-item-heading">Load assets and resources</h4>
|
|
||||||
<p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
|
|
||||||
`staticDirs` configuration option to specify folders to load when
|
|
||||||
starting Storybook.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/configure/images-and-assets"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="sb-container">
|
|
||||||
<div className='sb-section-title'>
|
|
||||||
# Do more with Storybook
|
|
||||||
|
|
||||||
Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="sb-section">
|
|
||||||
<div className="sb-features-grid">
|
|
||||||
<div className="sb-grid-item">
|
|
||||||
<img src={Docs} alt="A screenshot showing the autodocs tag being set, pointing a docs page being generated" />
|
|
||||||
<h4 className="sb-section-item-heading">Autodocs</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Auto-generate living,
|
|
||||||
interactive reference documentation from your components and stories.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/writing-docs/autodocs"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-grid-item">
|
|
||||||
<img src={Share} alt="A browser window showing a Storybook being published to a chromatic.com URL" />
|
|
||||||
<h4 className="sb-section-item-heading">Publish to Chromatic</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/sharing/publish-storybook#publish-storybook-with-chromatic"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-grid-item">
|
|
||||||
<img src={FigmaPlugin} alt="Windows showing the Storybook plugin in Figma" />
|
|
||||||
<h4 className="sb-section-item-heading">Figma Plugin</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
|
|
||||||
implementation in one place.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/sharing/design-integrations#embed-storybook-in-figma-with-the-plugin"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-grid-item">
|
|
||||||
<img src={Testing} alt="Screenshot of tests passing and failing" />
|
|
||||||
<h4 className="sb-section-item-heading">Testing</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
|
|
||||||
complex.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/writing-tests/introduction"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-grid-item">
|
|
||||||
<img src={Accessibility} alt="Screenshot of accessibility tests passing and failing" />
|
|
||||||
<h4 className="sb-section-item-heading">Accessibility</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/writing-tests/accessibility-testing"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-grid-item">
|
|
||||||
<img src={Theming} alt="Screenshot of Storybook in light and dark mode" />
|
|
||||||
<h4 className="sb-section-item-heading">Theming</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/docs/react/configure/theming"
|
|
||||||
target="_blank"
|
|
||||||
>Learn more<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className='sb-addon'>
|
|
||||||
<div className='sb-addon-text'>
|
|
||||||
<h4>Addons</h4>
|
|
||||||
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/integrations/"
|
|
||||||
target="_blank"
|
|
||||||
>Discover all addons<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className='sb-addon-img'>
|
|
||||||
<img src={AddonLibrary} alt="Integrate your tools with Storybook to connect workflows." />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="sb-section sb-socials">
|
|
||||||
<div className="sb-section-item">
|
|
||||||
<img src={Github} alt="Github logo" className="sb-explore-image"/>
|
|
||||||
Join our contributors building the future of UI development.
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://github.com/storybookjs/storybook"
|
|
||||||
target="_blank"
|
|
||||||
>Star on GitHub<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
<div className="sb-section-item">
|
|
||||||
<img src={Discord} alt="Discord logo" className="sb-explore-image"/>
|
|
||||||
<div>
|
|
||||||
Get support and chat with frontend developers.
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://discord.gg/storybook"
|
|
||||||
target="_blank"
|
|
||||||
>Join Discord server<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="sb-section-item">
|
|
||||||
<img src={Youtube} alt="Youtube logo" className="sb-explore-image"/>
|
|
||||||
<div>
|
|
||||||
Watch tutorials, feature previews and interviews.
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://www.youtube.com/@chromaticui"
|
|
||||||
target="_blank"
|
|
||||||
>Watch on YouTube<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="sb-section-item">
|
|
||||||
<img src={Tutorials} alt="A book" className="sb-explore-image"/>
|
|
||||||
<p>Follow guided walkthroughs on for key workflows.</p>
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://storybook.js.org/tutorials/"
|
|
||||||
target="_blank"
|
|
||||||
>Discover tutorials<RightArrow /></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
{`
|
|
||||||
.sb-container {
|
|
||||||
margin-bottom: 48px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-section {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-section-title {
|
|
||||||
margin-bottom: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-section a:not(h1 a, h2 a, h3 a) {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-section-item, .sb-grid-item {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-section-item-heading {
|
|
||||||
padding-top: 20px !important;
|
|
||||||
padding-bottom: 5px !important;
|
|
||||||
margin: 0 !important;
|
|
||||||
}
|
|
||||||
.sb-section-item-paragraph {
|
|
||||||
margin: 0;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-chevron {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-features-grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
grid-gap: 32px 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-socials {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(4, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-socials p {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-explore-image {
|
|
||||||
max-height: 32px;
|
|
||||||
align-self: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
background-color: #EEF3F8;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
||||||
background: #EEF3F8;
|
|
||||||
height: 180px;
|
|
||||||
margin-bottom: 48px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon-text {
|
|
||||||
padding-left: 48px;
|
|
||||||
max-width: 240px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon-text h4 {
|
|
||||||
padding-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon-img {
|
|
||||||
position: absolute;
|
|
||||||
left: 345px;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 200%;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon-img img {
|
|
||||||
width: 650px;
|
|
||||||
transform: rotate(-15deg);
|
|
||||||
margin-left: 40px;
|
|
||||||
margin-top: -72px;
|
|
||||||
box-shadow: 0 0 1px rgba(255, 255, 255, 0);
|
|
||||||
backface-visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
.sb-addon-img {
|
|
||||||
left: 300px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
.sb-section {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-features-grid {
|
|
||||||
grid-template-columns: repeat(1, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-socials {
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon {
|
|
||||||
height: 280px;
|
|
||||||
align-items: flex-start;
|
|
||||||
padding-top: 32px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon-text {
|
|
||||||
padding-left: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon-img {
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
top: 130px;
|
|
||||||
bottom: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
height: auto;
|
|
||||||
width: 124%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sb-addon-img img {
|
|
||||||
width: 1200px;
|
|
||||||
transform: rotate(-12deg);
|
|
||||||
margin-left: 0;
|
|
||||||
margin-top: 48px;
|
|
||||||
margin-bottom: -40px;
|
|
||||||
margin-left: -24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`}
|
|
||||||
</style>
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/react';
|
|
||||||
|
|
||||||
import { Header } from './Header';
|
|
||||||
|
|
||||||
const meta = {
|
|
||||||
title: 'Example/Header',
|
|
||||||
component: Header,
|
|
||||||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
||||||
tags: ['autodocs'],
|
|
||||||
parameters: {
|
|
||||||
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
|
|
||||||
layout: 'fullscreen',
|
|
||||||
},
|
|
||||||
} satisfies Meta<typeof Header>;
|
|
||||||
|
|
||||||
export default meta;
|
|
||||||
type Story = StoryObj<typeof meta>;
|
|
||||||
|
|
||||||
export const LoggedIn: Story = {
|
|
||||||
args: {
|
|
||||||
user: {
|
|
||||||
name: 'Jane Doe',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const LoggedOut: Story = {};
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { Button } from './Button';
|
|
||||||
import './header.css';
|
|
||||||
|
|
||||||
type User = {
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface HeaderProps {
|
|
||||||
user?: User;
|
|
||||||
onLogin: () => void;
|
|
||||||
onLogout: () => void;
|
|
||||||
onCreateAccount: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
|
|
||||||
<header>
|
|
||||||
<div className="storybook-header">
|
|
||||||
<div>
|
|
||||||
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g fill="none" fillRule="evenodd">
|
|
||||||
<path
|
|
||||||
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
||||||
fill="#FFF"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
||||||
fill="#555AB9"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
||||||
fill="#91BAF8"
|
|
||||||
/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
<h1>Acme</h1>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{user ? (
|
|
||||||
<>
|
|
||||||
<span className="welcome">
|
|
||||||
Welcome, <b>{user.name}</b>!
|
|
||||||
</span>
|
|
||||||
<Button size="small" onClick={onLogout} label="Log out" />
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Button size="small" onClick={onLogin} label="Log in" />
|
|
||||||
<Button primary size="small" onClick={onCreateAccount} label="Sign up" />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
);
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/react';
|
|
||||||
import { within, userEvent } from '@storybook/testing-library';
|
|
||||||
|
|
||||||
import { Page } from './Page';
|
|
||||||
|
|
||||||
const meta = {
|
|
||||||
title: 'Example/Page',
|
|
||||||
component: Page,
|
|
||||||
parameters: {
|
|
||||||
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
|
|
||||||
layout: 'fullscreen',
|
|
||||||
},
|
|
||||||
} satisfies Meta<typeof Page>;
|
|
||||||
|
|
||||||
export default meta;
|
|
||||||
type Story = StoryObj<typeof meta>;
|
|
||||||
|
|
||||||
export const LoggedOut: Story = {};
|
|
||||||
|
|
||||||
// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
|
|
||||||
export const LoggedIn: Story = {
|
|
||||||
play: async ({ canvasElement }) => {
|
|
||||||
const canvas = within(canvasElement);
|
|
||||||
const loginButton = await canvas.getByRole('button', {
|
|
||||||
name: /Log in/i,
|
|
||||||
});
|
|
||||||
await userEvent.click(loginButton);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { Header } from './Header';
|
|
||||||
import './page.css';
|
|
||||||
|
|
||||||
type User = {
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Page: React.FC = () => {
|
|
||||||
const [user, setUser] = React.useState<User>();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<article>
|
|
||||||
<Header
|
|
||||||
user={user}
|
|
||||||
onLogin={() => setUser({ name: 'Jane Doe' })}
|
|
||||||
onLogout={() => setUser(undefined)}
|
|
||||||
onCreateAccount={() => setUser({ name: 'Jane Doe' })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<section className="storybook-page">
|
|
||||||
<h2>Pages in Storybook</h2>
|
|
||||||
<p>
|
|
||||||
We recommend building UIs with a{' '}
|
|
||||||
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
|
|
||||||
<strong>component-driven</strong>
|
|
||||||
</a>{' '}
|
|
||||||
process starting with atomic components and ending with pages.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Render pages with mock data. This makes it easy to build and review page states without
|
|
||||||
needing to navigate to them in your app. Here are some handy patterns for managing page
|
|
||||||
data in Storybook:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
||||||
"args" of child component stories
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Assemble data in the page component from your services. You can mock these services out
|
|
||||||
using Storybook.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
Get a guided tutorial on component-driven development at{' '}
|
|
||||||
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
|
|
||||||
Storybook tutorials
|
|
||||||
</a>
|
|
||||||
. Read more in the{' '}
|
|
||||||
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">
|
|
||||||
docs
|
|
||||||
</a>
|
|
||||||
.
|
|
||||||
</p>
|
|
||||||
<div className="tip-wrapper">
|
|
||||||
<span className="tip">Tip</span> Adjust the width of the canvas with the{' '}
|
|
||||||
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g fill="none" fillRule="evenodd">
|
|
||||||
<path
|
|
||||||
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
|
|
||||||
id="a"
|
|
||||||
fill="#999"
|
|
||||||
/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
Viewports addon in the toolbar
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
Before Width: | Height: | Size: 41 KiB |
@@ -1,5 +0,0 @@
|
|||||||
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<title>Accessibility</title>
|
|
||||||
<circle cx="24.334" cy="24" r="24" fill="#A849FF" fill-opacity="0.3"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.8609 11.585C27.8609 9.59506 26.2497 7.99023 24.2519 7.99023C22.254 7.99023 20.6429 9.65925 20.6429 11.585C20.6429 13.575 22.254 15.1799 24.2519 15.1799C26.2497 15.1799 27.8609 13.575 27.8609 11.585ZM21.8922 22.6473C21.8467 23.9096 21.7901 25.4788 21.5897 26.2771C20.9853 29.0462 17.7348 36.3314 17.3325 37.2275C17.1891 37.4923 17.1077 37.7955 17.1077 38.1178C17.1077 39.1519 17.946 39.9902 18.9802 39.9902C19.6587 39.9902 20.253 39.6293 20.5814 39.0889L20.6429 38.9874L24.2841 31.22C24.2841 31.22 27.5529 37.9214 27.9238 38.6591C28.2948 39.3967 28.8709 39.9902 29.7168 39.9902C30.751 39.9902 31.5893 39.1519 31.5893 38.1178C31.5893 37.7951 31.3639 37.2265 31.3639 37.2265C30.9581 36.3258 27.698 29.0452 27.0938 26.2771C26.8975 25.4948 26.847 23.9722 26.8056 22.7236C26.7927 22.333 26.7806 21.9693 26.7653 21.6634C26.7008 21.214 27.0231 20.8289 27.4097 20.7005L35.3366 18.3253C36.3033 18.0685 36.8834 16.9773 36.6256 16.0144C36.3678 15.0515 35.2722 14.4737 34.3055 14.7305C34.3055 14.7305 26.8619 17.1057 24.2841 17.1057C21.7062 17.1057 14.456 14.7947 14.456 14.7947C13.4893 14.5379 12.3937 14.9873 12.0715 15.9502C11.7493 16.9131 12.3293 18.0044 13.3604 18.3253L21.2873 20.7005C21.674 20.8289 21.9318 21.214 21.9318 21.6634C21.9174 21.9493 21.9053 22.2857 21.8922 22.6473Z" fill="#A470D5"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 456 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
@@ -1,15 +0,0 @@
|
|||||||
<svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g clip-path="url(#clip0_10031_177575)">
|
|
||||||
<mask id="mask0_10031_177575" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="33" height="25">
|
|
||||||
<path d="M32.5034 4.00195H0.503906V28.7758H32.5034V4.00195Z" fill="white"/>
|
|
||||||
</mask>
|
|
||||||
<g mask="url(#mask0_10031_177575)">
|
|
||||||
<path d="M27.5928 6.20817C25.5533 5.27289 23.3662 4.58382 21.0794 4.18916C21.0378 4.18154 20.9962 4.20057 20.9747 4.23864C20.6935 4.73863 20.3819 5.3909 20.1637 5.90358C17.7042 5.53558 15.2573 5.53558 12.8481 5.90358C12.6299 5.37951 12.307 4.73863 12.0245 4.23864C12.003 4.20184 11.9614 4.18281 11.9198 4.18916C9.63431 4.58255 7.44721 5.27163 5.40641 6.20817C5.38874 6.21578 5.3736 6.22848 5.36355 6.24497C1.21508 12.439 0.078646 18.4809 0.636144 24.4478C0.638667 24.477 0.655064 24.5049 0.677768 24.5227C3.41481 26.5315 6.06609 27.7511 8.66815 28.5594C8.70979 28.5721 8.75392 28.5569 8.78042 28.5226C9.39594 27.6826 9.94461 26.7968 10.4151 25.8653C10.4428 25.8107 10.4163 25.746 10.3596 25.7244C9.48927 25.3945 8.66058 24.9922 7.86343 24.5354C7.80038 24.4986 7.79533 24.4084 7.85333 24.3653C8.02108 24.2397 8.18888 24.109 8.34906 23.977C8.37804 23.9529 8.41842 23.9478 8.45249 23.963C13.6894 26.3526 19.359 26.3526 24.5341 23.963C24.5682 23.9465 24.6086 23.9516 24.6388 23.9757C24.799 24.1077 24.9668 24.2397 25.1358 24.3653C25.1938 24.4084 25.19 24.4986 25.127 24.5354C24.3298 25.0011 23.5011 25.3945 22.6296 25.7232C22.5728 25.7447 22.5476 25.8107 22.5754 25.8653C23.0559 26.7955 23.6046 27.6812 24.2087 28.5213C24.234 28.5569 24.2794 28.5721 24.321 28.5594C26.9357 27.7511 29.5869 26.5315 32.324 24.5227C32.348 24.5049 32.3631 24.4783 32.3656 24.4491C33.0328 17.5506 31.2481 11.5584 27.6344 6.24623C27.6256 6.22848 27.6105 6.21578 27.5928 6.20817ZM11.1971 20.8146C9.62043 20.8146 8.32129 19.3679 8.32129 17.5913C8.32129 15.8146 9.59523 14.368 11.1971 14.368C12.8115 14.368 14.0981 15.8273 14.0729 17.5913C14.0729 19.3679 12.7989 20.8146 11.1971 20.8146ZM21.8299 20.8146C20.2533 20.8146 18.9541 19.3679 18.9541 17.5913C18.9541 15.8146 20.228 14.368 21.8299 14.368C23.4444 14.368 24.7309 15.8273 24.7057 17.5913C24.7057 19.3679 23.4444 20.8146 21.8299 20.8146Z" fill="#5865F2"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<defs>
|
|
||||||
<clipPath id="clip0_10031_177575">
|
|
||||||
<rect width="31.9995" height="32" fill="white" transform="translate(0.5)"/>
|
|
||||||
</clipPath>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 43 KiB |
@@ -1,3 +0,0 @@
|
|||||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M16.0001 0C7.16466 0 0 7.17472 0 16.0256C0 23.1061 4.58452 29.1131 10.9419 31.2322C11.7415 31.3805 12.0351 30.8845 12.0351 30.4613C12.0351 30.0791 12.0202 28.8167 12.0133 27.4776C7.56209 28.447 6.62283 25.5868 6.62283 25.5868C5.89499 23.7345 4.8463 23.2419 4.8463 23.2419C3.39461 22.2473 4.95573 22.2678 4.95573 22.2678C6.56242 22.3808 7.40842 23.9192 7.40842 23.9192C8.83547 26.3691 11.1514 25.6609 12.0645 25.2514C12.2081 24.2156 12.6227 23.5087 13.0803 23.1085C9.52648 22.7032 5.7906 21.3291 5.7906 15.1886C5.7906 13.4389 6.41563 12.0094 7.43916 10.8871C7.27303 10.4834 6.72537 8.85349 7.59415 6.64609C7.59415 6.64609 8.93774 6.21539 11.9953 8.28877C13.2716 7.9337 14.6404 7.75563 16.0001 7.74953C17.3599 7.75563 18.7297 7.9337 20.0084 8.28877C23.0623 6.21539 24.404 6.64609 24.404 6.64609C25.2749 8.85349 24.727 10.4834 24.5608 10.8871C25.5868 12.0094 26.2075 13.4389 26.2075 15.1886C26.2075 21.3437 22.4645 22.699 18.9017 23.0957C19.4756 23.593 19.9869 24.5683 19.9869 26.0634C19.9869 28.2077 19.9684 29.9334 19.9684 30.4613C19.9684 30.8877 20.2564 31.3874 21.0674 31.2301C27.4213 29.1086 32 23.1037 32 16.0256C32 7.17472 24.8364 0 16.0001 0ZM5.99257 22.8288C5.95733 22.9084 5.83227 22.9322 5.71834 22.8776C5.60229 22.8253 5.53711 22.7168 5.57474 22.6369C5.60918 22.5549 5.7345 22.5321 5.85029 22.587C5.9666 22.6393 6.03284 22.7489 5.99257 22.8288ZM6.7796 23.5321C6.70329 23.603 6.55412 23.5701 6.45291 23.4581C6.34825 23.3464 6.32864 23.197 6.40601 23.125C6.4847 23.0542 6.62937 23.0874 6.73429 23.1991C6.83895 23.3121 6.85935 23.4605 6.7796 23.5321ZM7.31953 24.4321C7.2215 24.5003 7.0612 24.4363 6.96211 24.2938C6.86407 24.1513 6.86407 23.9804 6.96422 23.9119C7.06358 23.8435 7.2215 23.905 7.32191 24.0465C7.41968 24.1914 7.41968 24.3623 7.31953 24.4321ZM8.23267 25.4743C8.14497 25.5712 7.95818 25.5452 7.82146 25.413C7.68156 25.2838 7.64261 25.1004 7.73058 25.0035C7.81934 24.9064 8.00719 24.9337 8.14497 25.0648C8.28381 25.1938 8.3262 25.3785 8.23267 25.4743ZM9.41281 25.8262C9.37413 25.9517 9.19423 26.0088 9.013 25.9554C8.83203 25.9005 8.7136 25.7535 8.75016 25.6266C8.78778 25.5003 8.96848 25.4408 9.15104 25.4979C9.33174 25.5526 9.45044 25.6985 9.41281 25.8262ZM10.7559 25.9754C10.7604 26.1076 10.6067 26.2172 10.4165 26.2196C10.2252 26.2238 10.0704 26.1169 10.0683 25.9868C10.0683 25.8534 10.2185 25.7448 10.4098 25.7416C10.6001 25.7379 10.7559 25.8441 10.7559 25.9754ZM12.0753 25.9248C12.0981 26.0537 11.9658 26.1862 11.7769 26.2215C11.5912 26.2554 11.4192 26.1758 11.3957 26.0479C11.3726 25.9157 11.5072 25.7833 11.6927 25.7491C11.8819 25.7162 12.0512 25.7937 12.0753 25.9248Z" fill="#161614"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 43 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g clip-path="url(#clip0_10031_177597)">
|
|
||||||
<path opacity="0.7" fill-rule="evenodd" clip-rule="evenodd" d="M17 7.87059C17 6.48214 17.9812 5.28722 19.3431 5.01709L29.5249 2.99755C31.3238 2.64076 33 4.01717 33 5.85105V22.1344C33 23.5229 32.0188 24.7178 30.6569 24.9879L20.4751 27.0074C18.6762 27.3642 17 25.9878 17 24.1539L17 7.87059Z" fill="#B7F0EF"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 5.85245C1 4.01857 2.67623 2.64215 4.47507 2.99895L14.6569 5.01848C16.0188 5.28861 17 6.48354 17 7.87198V24.1553C17 25.9892 15.3238 27.3656 13.5249 27.0088L3.34311 24.9893C1.98119 24.7192 1 23.5242 1 22.1358V5.85245Z" fill="#87E6E5"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.543 5.71289C15.543 5.71289 16.8157 5.96289 17.4002 6.57653C17.9847 7.19016 18.4521 9.03107 18.4521 9.03107C18.4521 9.03107 18.4521 25.1106 18.4521 26.9629C18.4521 28.8152 19.3775 31.4174 19.3775 31.4174L17.4002 28.8947L16.2575 31.4174C16.2575 31.4174 15.543 29.0765 15.543 27.122C15.543 25.1674 15.543 5.71289 15.543 5.71289Z" fill="#61C1FD"/>
|
|
||||||
</g>
|
|
||||||
<defs>
|
|
||||||
<clipPath id="clip0_10031_177597">
|
|
||||||
<rect width="32" height="32" fill="white" transform="translate(0.5)"/>
|
|
||||||
</clipPath>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,4 +0,0 @@
|
|||||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M31.3313 8.44657C30.9633 7.08998 29.8791 6.02172 28.5022 5.65916C26.0067 5.00026 16 5.00026 16 5.00026C16 5.00026 5.99333 5.00026 3.4978 5.65916C2.12102 6.02172 1.03665 7.08998 0.668678 8.44657C0 10.9053 0 16.0353 0 16.0353C0 16.0353 0 21.1652 0.668678 23.6242C1.03665 24.9806 2.12102 26.0489 3.4978 26.4116C5.99333 27.0703 16 27.0703 16 27.0703C16 27.0703 26.0067 27.0703 28.5022 26.4116C29.8791 26.0489 30.9633 24.9806 31.3313 23.6242C32 21.1652 32 16.0353 32 16.0353C32 16.0353 32 10.9053 31.3313 8.44657Z" fill="#ED1D24"/>
|
|
||||||
<path d="M12.7266 20.6934L21.0902 16.036L12.7266 11.3781V20.6934Z" fill="white"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 721 B |
@@ -1,30 +0,0 @@
|
|||||||
.storybook-button {
|
|
||||||
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
||||||
font-weight: 700;
|
|
||||||
border: 0;
|
|
||||||
border-radius: 3em;
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.storybook-button--primary {
|
|
||||||
color: white;
|
|
||||||
background-color: #1ea7fd;
|
|
||||||
}
|
|
||||||
.storybook-button--secondary {
|
|
||||||
color: #333;
|
|
||||||
background-color: transparent;
|
|
||||||
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
||||||
}
|
|
||||||
.storybook-button--small {
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 10px 16px;
|
|
||||||
}
|
|
||||||
.storybook-button--medium {
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 11px 20px;
|
|
||||||
}
|
|
||||||
.storybook-button--large {
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 12px 24px;
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import '../../../app/global.css'
|
|
||||||
import { Button } from "@/components/ui/button"
|
|
||||||
|
|
||||||
interface CardProps {
|
|
||||||
/**
|
|
||||||
* Is this the principal call to action on the page?
|
|
||||||
*/
|
|
||||||
primary?: boolean;
|
|
||||||
/**
|
|
||||||
* What background color to use
|
|
||||||
*/
|
|
||||||
backgroundColor?: string;
|
|
||||||
/**
|
|
||||||
* How large should the button be?
|
|
||||||
*/
|
|
||||||
size?: 'small' | 'medium' | 'large';
|
|
||||||
/**
|
|
||||||
* Button contents
|
|
||||||
*/
|
|
||||||
label: string;
|
|
||||||
/**
|
|
||||||
* Optional click handler
|
|
||||||
*/
|
|
||||||
onClick?: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Primary UI component for user interaction
|
|
||||||
*/
|
|
||||||
export const Cardv1 = ({
|
|
||||||
primary = false,
|
|
||||||
size = 'medium',
|
|
||||||
backgroundColor,
|
|
||||||
label,
|
|
||||||
...props
|
|
||||||
}: CardProps) => {
|
|
||||||
return (
|
|
||||||
<Button>ROOT COLOR</Button>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
.storybook-header {
|
|
||||||
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
||||||
padding: 15px 20px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-header svg {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-header h1 {
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 20px;
|
|
||||||
line-height: 1;
|
|
||||||
margin: 6px 0 6px 10px;
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-header button + button {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-header .welcome {
|
|
||||||
color: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
.storybook-page {
|
|
||||||
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 24px;
|
|
||||||
padding: 48px 20px;
|
|
||||||
margin: 0 auto;
|
|
||||||
max-width: 600px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page h2 {
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 32px;
|
|
||||||
line-height: 1;
|
|
||||||
margin: 0 0 4px;
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page p {
|
|
||||||
margin: 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #1ea7fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page ul {
|
|
||||||
padding-left: 30px;
|
|
||||||
margin: 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page li {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page .tip {
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 1em;
|
|
||||||
font-size: 11px;
|
|
||||||
line-height: 12px;
|
|
||||||
font-weight: 700;
|
|
||||||
background: #e7fdd8;
|
|
||||||
color: #66bf3c;
|
|
||||||
padding: 4px 12px;
|
|
||||||
margin-right: 10px;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page .tip-wrapper {
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 20px;
|
|
||||||
margin-top: 40px;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page .tip-wrapper svg {
|
|
||||||
display: inline-block;
|
|
||||||
height: 12px;
|
|
||||||
width: 12px;
|
|
||||||
margin-right: 4px;
|
|
||||||
vertical-align: top;
|
|
||||||
margin-top: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storybook-page .tip-wrapper svg path {
|
|
||||||
fill: #1ea7fd;
|
|
||||||
}
|
|
||||||
1
front_end_portserver_old/src/vite-env.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
/// <reference types="vite/client" />
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
|
||||||
module.exports = {
|
|
||||||
darkMode: ["class"],
|
|
||||||
content: [
|
|
||||||
'./pages/**/*.{ts,tsx}',
|
|
||||||
'./components/**/*.{ts,tsx}',
|
|
||||||
'./app/**/*.{ts,tsx}',
|
|
||||||
'./src/**/*.{ts,tsx}',
|
|
||||||
],
|
|
||||||
theme: {
|
|
||||||
container: {
|
|
||||||
center: true,
|
|
||||||
padding: "2rem",
|
|
||||||
screens: {
|
|
||||||
"2xl": "1400px",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
extend: {
|
|
||||||
colors: {
|
|
||||||
border: "hsl(var(--border))",
|
|
||||||
input: "hsl(var(--input))",
|
|
||||||
ring: "hsl(var(--ring))",
|
|
||||||
background: "hsl(var(--background))",
|
|
||||||
foreground: "hsl(var(--foreground))",
|
|
||||||
primary: {
|
|
||||||
DEFAULT: "hsl(var(--primary))",
|
|
||||||
foreground: "hsl(var(--primary-foreground))",
|
|
||||||
},
|
|
||||||
secondary: {
|
|
||||||
DEFAULT: "hsl(var(--secondary))",
|
|
||||||
foreground: "hsl(var(--secondary-foreground))",
|
|
||||||
},
|
|
||||||
destructive: {
|
|
||||||
DEFAULT: "hsl(var(--destructive))",
|
|
||||||
foreground: "hsl(var(--destructive-foreground))",
|
|
||||||
},
|
|
||||||
muted: {
|
|
||||||
DEFAULT: "hsl(var(--muted))",
|
|
||||||
foreground: "hsl(var(--muted-foreground))",
|
|
||||||
},
|
|
||||||
accent: {
|
|
||||||
DEFAULT: "hsl(var(--accent))",
|
|
||||||
foreground: "hsl(var(--accent-foreground))",
|
|
||||||
},
|
|
||||||
popover: {
|
|
||||||
DEFAULT: "hsl(var(--popover))",
|
|
||||||
foreground: "hsl(var(--popover-foreground))",
|
|
||||||
},
|
|
||||||
card: {
|
|
||||||
DEFAULT: "hsl(var(--card))",
|
|
||||||
foreground: "hsl(var(--card-foreground))",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
borderRadius: {
|
|
||||||
lg: "var(--radius)",
|
|
||||||
md: "calc(var(--radius) - 2px)",
|
|
||||||
sm: "calc(var(--radius) - 4px)",
|
|
||||||
},
|
|
||||||
keyframes: {
|
|
||||||
"accordion-down": {
|
|
||||||
from: { height: 0 },
|
|
||||||
to: { height: "var(--radix-accordion-content-height)" },
|
|
||||||
},
|
|
||||||
"accordion-up": {
|
|
||||||
from: { height: "var(--radix-accordion-content-height)" },
|
|
||||||
to: { height: 0 },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
animation: {
|
|
||||||
"accordion-down": "accordion-down 0.2s ease-out",
|
|
||||||
"accordion-up": "accordion-up 0.2s ease-out",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [require("tailwindcss-animate")],
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ES2020",
|
|
||||||
"useDefineForClassFields": true,
|
|
||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
||||||
"module": "ESNext",
|
|
||||||
"skipLibCheck": true,
|
|
||||||
|
|
||||||
/* Bundler mode */
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
|
|
||||||
/* Linting */
|
|
||||||
"strict": true,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"noUnusedParameters": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": [
|
|
||||||
"./src/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": ["src"],
|
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowSyntheticDefaultImports": true
|
|
||||||
},
|
|
||||||
"include": ["vite.config.ts"]
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import path from "path"
|
|
||||||
import { defineConfig } from 'vite'
|
|
||||||
import react from '@vitejs/plugin-react'
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [react()],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
"@": path.resolve(__dirname, "./src"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||