diff --git a/.gitignore b/.gitignore index b90522f5..4d9c3d23 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,3 @@ ngrok .dev.vars dumper/dump.sql -gitexporter.config.json diff --git a/src/lib/mobx-form/persistable-field.ts b/src/lib/mobx-form/persistable-field.ts index 52e70aa9..19fe371e 100644 --- a/src/lib/mobx-form/persistable-field.ts +++ b/src/lib/mobx-form/persistable-field.ts @@ -2,7 +2,7 @@ import { makePersistable } from "mobx-persist-store"; import { FieldWithValue } from "./field-with-value.ts"; import { storageAdapter } from "../telegram/storage-adapter.ts"; -export const persistableField = >( +export const persistableField = >( field: T, storageKey: string, expireIn?: number, diff --git a/src/screens/component-catalog/components.tsx b/src/screens/component-catalog/components.tsx index adb4b87b..8fd2b847 100644 --- a/src/screens/component-catalog/components.tsx +++ b/src/screens/component-catalog/components.tsx @@ -1,15 +1,18 @@ import { Button } from "../../ui/button.tsx"; import { ReactNode } from "react"; import { CardPreviewStory } from "./card-preview-story.tsx"; +import { SelectStory } from "./select-story.tsx"; -export type Component = { name: string; component: ReactNode }; +export type Component = { + name: string; + component: ReactNode; +}; export const components: Array = [ { name: "Button", component: , }, - { name: "Button - outline", component: , @@ -39,4 +42,8 @@ export const components: Array = [ /> ), }, + { + name: "Select", + component: , + }, ]; diff --git a/src/screens/component-catalog/select-story.tsx b/src/screens/component-catalog/select-story.tsx new file mode 100644 index 00000000..7943192e --- /dev/null +++ b/src/screens/component-catalog/select-story.tsx @@ -0,0 +1,23 @@ +import { Select } from "../../ui/select.tsx"; +import { useState } from "react"; + +const countries = [ + { value: "us", label: "United States" }, + { value: "fr", label: "France" }, + { value: "de", label: "Germany" }, +]; + +type Country = (typeof countries)[number]["value"]; + +export const SelectStory = () => { + const [value, setValue] = useState("us"); + return ( +