2024-02-27 05:05:16 +00:00
|
|
|
|
import React from 'react';
|
2024-02-21 09:13:16 +00:00
|
|
|
|
import { Calendar } from 'components/shared/Calendar';
|
2024-02-23 03:44:29 +00:00
|
|
|
|
import { DatePicker } from 'components/shared/DatePicker';
|
|
|
|
|
import { Radio } from 'components/shared/Radio';
|
|
|
|
|
import { SegmentedControls } from 'components/shared/SegmentedControls';
|
|
|
|
|
import { Switch } from 'components/shared/Switch';
|
2024-02-27 05:05:16 +00:00
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
import { Value } from 'react-calendar/dist/cjs/shared/types';
|
2024-02-21 09:13:16 +00:00
|
|
|
|
import { avatars, avatarsFallback } from './renders/avatar';
|
|
|
|
|
import { renderBadges } from './renders/badge';
|
2024-02-22 02:17:22 +00:00
|
|
|
|
import {
|
|
|
|
|
renderButtonIcons,
|
|
|
|
|
renderButtons,
|
2024-02-22 05:24:25 +00:00
|
|
|
|
renderDisabledButtons,
|
2024-02-22 02:17:22 +00:00
|
|
|
|
renderLinks,
|
|
|
|
|
} from './renders/button';
|
2024-02-21 09:13:16 +00:00
|
|
|
|
import {
|
2024-02-23 03:44:29 +00:00
|
|
|
|
renderCheckbox,
|
|
|
|
|
renderCheckboxWithDescription,
|
|
|
|
|
} from './renders/checkbox';
|
2024-02-27 05:05:16 +00:00
|
|
|
|
import { DropdownExample } from './renders/dropdown';
|
2024-02-22 03:45:19 +00:00
|
|
|
|
import {
|
|
|
|
|
renderInlineNotificationWithDescriptions,
|
|
|
|
|
renderInlineNotifications,
|
|
|
|
|
} from './renders/inlineNotifications';
|
2024-02-21 10:08:14 +00:00
|
|
|
|
import { renderInputs } from './renders/input';
|
2024-02-23 03:44:29 +00:00
|
|
|
|
import { RADIO_OPTIONS } from './renders/radio';
|
|
|
|
|
import { SEGMENTED_CONTROLS_OPTIONS } from './renders/segmentedControls';
|
|
|
|
|
import {
|
|
|
|
|
renderTabWithBadges,
|
|
|
|
|
renderTabs,
|
|
|
|
|
renderVerticalTabs,
|
|
|
|
|
} from './renders/tabs';
|
2024-02-22 15:48:31 +00:00
|
|
|
|
import { renderDefaultTag, renderMinimalTag } from './renders/tag';
|
2024-02-22 07:17:02 +00:00
|
|
|
|
import { renderToast, renderToastsWithCta } from './renders/toast';
|
2024-02-22 10:25:04 +00:00
|
|
|
|
import { renderTooltips } from './renders/tooltip';
|
2024-02-21 03:39:38 +00:00
|
|
|
|
|
2024-02-24 05:01:06 +00:00
|
|
|
|
const Page: React.FC = () => {
|
2024-02-20 09:54:32 +00:00
|
|
|
|
const [singleDate, setSingleDate] = useState<Value>();
|
|
|
|
|
const [dateRange, setDateRange] = useState<Value>();
|
2024-02-23 03:20:08 +00:00
|
|
|
|
const [selectedSegmentedControl, setSelectedSegmentedControl] =
|
|
|
|
|
useState<string>('Test 1');
|
2024-02-22 10:42:13 +00:00
|
|
|
|
const [switchValue, setSwitchValue] = useState(false);
|
2024-02-22 10:30:33 +00:00
|
|
|
|
const [selectedRadio, setSelectedRadio] = useState<string>('');
|
2024-02-20 09:54:32 +00:00
|
|
|
|
|
2024-02-16 05:31:13 +00:00
|
|
|
|
return (
|
|
|
|
|
<div className="relative h-full min-h-full">
|
2024-02-22 03:45:19 +00:00
|
|
|
|
<div className="flex flex-col items-center justify-center container mx-auto px-20 py-20">
|
2024-02-16 05:31:13 +00:00
|
|
|
|
<h1 className="text-4xl font-bold">Manual Storybook</h1>
|
|
|
|
|
<p className="mt-4 text-lg text-center text-gray-500">
|
|
|
|
|
Get started by editing{' '}
|
|
|
|
|
<code className="p-2 font-mono text-sm bg-gray-100 rounded-md">
|
|
|
|
|
packages/frontend/src/pages/components/index.tsx
|
|
|
|
|
</code>
|
|
|
|
|
</p>
|
2024-02-20 09:33:59 +00:00
|
|
|
|
|
2024-02-16 05:31:13 +00:00
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-22 15:46:10 +00:00
|
|
|
|
{/* Tag */}
|
2024-02-22 10:01:58 +00:00
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
2024-02-22 15:46:10 +00:00
|
|
|
|
<h1 className="text-2xl font-bold">Tag</h1>
|
2024-02-22 10:01:58 +00:00
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-center">
|
2024-02-22 15:46:10 +00:00
|
|
|
|
{renderDefaultTag()}
|
|
|
|
|
{renderMinimalTag()}
|
2024-02-22 10:01:58 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-22 04:46:39 +00:00
|
|
|
|
{/* Toast */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Toasts</h1>
|
2024-02-22 07:17:02 +00:00
|
|
|
|
{renderToastsWithCta()}
|
|
|
|
|
{renderToast()}
|
2024-02-22 04:46:39 +00:00
|
|
|
|
</div>
|
2024-02-22 07:17:02 +00:00
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-23 03:22:33 +00:00
|
|
|
|
{/* Tooltip */}
|
2024-02-16 05:31:13 +00:00
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
2024-02-22 10:25:04 +00:00
|
|
|
|
<h1 className="text-2xl font-bold">Tooltip</h1>
|
|
|
|
|
<div className="flex w-full flex-wrap max-w-[680px] justify-center gap-10">
|
|
|
|
|
{renderTooltips()}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
|
|
|
|
{/* Input */}
|
2024-02-21 08:44:21 +00:00
|
|
|
|
<h1 className="text-2xl font-bold">Input</h1>
|
2024-02-21 10:08:14 +00:00
|
|
|
|
<div className="flex w-full flex-col gap-10">{renderInputs()}</div>
|
2024-02-21 08:44:21 +00:00
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-22 10:25:04 +00:00
|
|
|
|
{/* Button */}
|
2024-02-19 13:13:56 +00:00
|
|
|
|
<h1 className="text-2xl font-bold">Button</h1>
|
2024-02-19 14:16:39 +00:00
|
|
|
|
<div className="flex flex-col gap-10">
|
2024-02-21 09:13:16 +00:00
|
|
|
|
{renderButtons()}
|
|
|
|
|
{renderButtonIcons()}
|
2024-02-16 05:31:13 +00:00
|
|
|
|
</div>
|
2024-02-20 11:51:09 +00:00
|
|
|
|
|
2024-02-22 05:24:25 +00:00
|
|
|
|
{/* Link */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Link</h1>
|
|
|
|
|
<div className="flex gap-4 items-center justify-center">
|
|
|
|
|
{renderLinks()}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Disabled button, icon only, and link */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<div className="flex flex-col gap-2">
|
|
|
|
|
<h1 className="text-2xl font-bold text-center">Disabled</h1>
|
|
|
|
|
<p className="text-lg text-center text-gray-500">
|
|
|
|
|
Button – icon only – link
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex gap-10 items-center justify-center">
|
|
|
|
|
{renderDisabledButtons()}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-02-21 03:39:38 +00:00
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
2024-02-20 11:51:09 +00:00
|
|
|
|
|
2024-02-21 09:13:16 +00:00
|
|
|
|
{/* Badge */}
|
2024-02-21 03:39:38 +00:00
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Badge</h1>
|
2024-02-21 09:13:16 +00:00
|
|
|
|
<div className="space-y-5">{renderBadges()}</div>
|
2024-02-20 11:51:09 +00:00
|
|
|
|
</div>
|
2024-02-20 16:38:35 +00:00
|
|
|
|
|
2024-02-21 03:39:38 +00:00
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
2024-02-20 16:38:35 +00:00
|
|
|
|
|
2024-02-21 09:13:16 +00:00
|
|
|
|
{/* Checkbox */}
|
2024-02-21 03:39:38 +00:00
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Checkbox</h1>
|
2024-02-21 09:13:16 +00:00
|
|
|
|
<div className="flex gap-10 flex-wrap">{renderCheckbox()}</div>
|
2024-02-21 03:39:38 +00:00
|
|
|
|
<div className="flex gap-10 flex-wrap">
|
2024-02-21 09:13:16 +00:00
|
|
|
|
{renderCheckboxWithDescription()}
|
2024-02-21 03:39:38 +00:00
|
|
|
|
</div>
|
2024-02-20 11:25:13 +00:00
|
|
|
|
</div>
|
2024-02-20 16:29:18 +00:00
|
|
|
|
|
2024-02-21 03:39:38 +00:00
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
2024-02-20 16:29:18 +00:00
|
|
|
|
|
2024-02-21 09:13:16 +00:00
|
|
|
|
{/* Calendar */}
|
2024-02-21 03:39:38 +00:00
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Calendar</h1>
|
|
|
|
|
<div className="flex flex-col gap-10">
|
|
|
|
|
<div className="space-y-5 flex flex-col items-center">
|
|
|
|
|
<p>Selected date: {singleDate?.toString()}</p>
|
|
|
|
|
<Calendar
|
|
|
|
|
value={singleDate}
|
|
|
|
|
onChange={setSingleDate}
|
|
|
|
|
onSelect={setSingleDate}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="space-y-5 flex flex-col items-center">
|
|
|
|
|
<p>
|
|
|
|
|
Start date:{' '}
|
|
|
|
|
{dateRange instanceof Array ? dateRange[0]?.toString() : ''}{' '}
|
|
|
|
|
<br />
|
|
|
|
|
End date:{' '}
|
|
|
|
|
{dateRange instanceof Array ? dateRange[1]?.toString() : ''}
|
|
|
|
|
</p>
|
|
|
|
|
<Calendar
|
|
|
|
|
selectRange
|
|
|
|
|
value={dateRange}
|
|
|
|
|
onChange={setDateRange}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-02-20 09:54:32 +00:00
|
|
|
|
</div>
|
2024-02-23 03:22:33 +00:00
|
|
|
|
|
|
|
|
|
<h1 className="text-2xl font-bold">Date Picker</h1>
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-center">
|
|
|
|
|
<DatePicker value={singleDate} onChange={setSingleDate} />
|
|
|
|
|
<DatePicker
|
|
|
|
|
selectRange
|
|
|
|
|
value={dateRange}
|
|
|
|
|
onChange={setDateRange}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-02-21 09:13:16 +00:00
|
|
|
|
</div>
|
2024-02-21 03:39:38 +00:00
|
|
|
|
|
2024-02-21 09:13:16 +00:00
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
2024-02-21 03:39:38 +00:00
|
|
|
|
|
2024-02-21 09:13:16 +00:00
|
|
|
|
{/* Avatar */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Avatar</h1>
|
|
|
|
|
<div className="flex gap-10 flex-wrap max-w-[522px]">
|
|
|
|
|
{avatars}
|
|
|
|
|
{avatarsFallback}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
|
|
|
|
{/* Tabs */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Tabs</h1>
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-center">
|
|
|
|
|
{renderTabs()}
|
|
|
|
|
{renderTabWithBadges()}
|
2024-02-20 09:54:32 +00:00
|
|
|
|
</div>
|
2024-02-21 09:13:16 +00:00
|
|
|
|
<h1 className="text-2xl font-bold">Vertical Tabs</h1>
|
|
|
|
|
{renderVerticalTabs()}
|
2024-02-20 09:33:59 +00:00
|
|
|
|
</div>
|
2024-02-22 02:17:22 +00:00
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-23 03:20:08 +00:00
|
|
|
|
{/* Segmented Controls */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Segmented Controls</h1>
|
|
|
|
|
<div className="flex flex-col gap-10">
|
|
|
|
|
<SegmentedControls
|
|
|
|
|
options={SEGMENTED_CONTROLS_OPTIONS}
|
|
|
|
|
value={selectedSegmentedControl}
|
|
|
|
|
onChange={setSelectedSegmentedControl}
|
|
|
|
|
/>
|
|
|
|
|
<SegmentedControls
|
|
|
|
|
size="sm"
|
|
|
|
|
options={SEGMENTED_CONTROLS_OPTIONS}
|
|
|
|
|
value={selectedSegmentedControl}
|
|
|
|
|
onChange={setSelectedSegmentedControl}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-22 10:42:13 +00:00
|
|
|
|
{/* Switch */}
|
2024-02-22 03:45:19 +00:00
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
2024-02-22 10:42:13 +00:00
|
|
|
|
<h1 className="text-2xl font-bold">Switch</h1>
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-center">
|
|
|
|
|
<Switch
|
|
|
|
|
label="Label"
|
|
|
|
|
checked={switchValue}
|
|
|
|
|
onCheckedChange={setSwitchValue}
|
|
|
|
|
/>
|
|
|
|
|
<Switch
|
|
|
|
|
label="Label"
|
|
|
|
|
description="Additional information or context"
|
|
|
|
|
checked={switchValue}
|
|
|
|
|
onCheckedChange={setSwitchValue}
|
|
|
|
|
/>
|
|
|
|
|
<Switch disabled label="Disabled unchecked" />
|
|
|
|
|
<Switch disabled checked label="Disabled checked" />
|
2024-02-22 03:45:19 +00:00
|
|
|
|
</div>
|
2024-02-22 10:42:13 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-22 10:30:33 +00:00
|
|
|
|
{/* Radio */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Radio</h1>
|
|
|
|
|
<div className="flex gap-20 items-start">
|
|
|
|
|
<Radio
|
|
|
|
|
options={RADIO_OPTIONS}
|
|
|
|
|
orientation="vertical"
|
|
|
|
|
value={selectedRadio}
|
|
|
|
|
onValueChange={setSelectedRadio}
|
|
|
|
|
/>
|
|
|
|
|
<Radio
|
|
|
|
|
options={RADIO_OPTIONS}
|
|
|
|
|
orientation="horizontal"
|
|
|
|
|
value={selectedRadio}
|
|
|
|
|
onValueChange={setSelectedRadio}
|
|
|
|
|
/>
|
2024-02-22 03:45:19 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-27 05:05:16 +00:00
|
|
|
|
{/* Dropdown */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Dropdown / Select</h1>
|
|
|
|
|
<DropdownExample />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full h border border-gray-200 px-20 my-10" />
|
|
|
|
|
|
2024-02-22 03:45:19 +00:00
|
|
|
|
{/* Inline notification */}
|
|
|
|
|
<div className="flex flex-col gap-10 items-center justify-between">
|
|
|
|
|
<h1 className="text-2xl font-bold">Inline Notification</h1>
|
|
|
|
|
<div className="flex gap-1 flex-wrap">
|
|
|
|
|
{renderInlineNotifications()}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex gap-1 flex-wrap">
|
|
|
|
|
{renderInlineNotificationWithDescriptions()}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-02-20 09:33:59 +00:00
|
|
|
|
</div>
|
2024-02-16 05:31:13 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Page;
|