diff --git a/components.json b/components.json index f0a7d4e..8de717f 100644 --- a/components.json +++ b/components.json @@ -1,14 +1,14 @@ { - "$schema": "https://shadcn-svelte.com/schema.json", - "style": "default", - "tailwind": { - "config": "tailwind.config.js", - "css": "src/index.css", - "baseColor": "slate" - }, - "aliases": { - "components": "src/lib/shadcnComponents", - "utils": "src/utils" - }, - "typescript": true -} \ No newline at end of file + "$schema": "https://shadcn-svelte.com/schema.json", + "style": "default", + "tailwind": { + "config": "tailwind.config.js", + "css": "src/index.css", + "baseColor": "slate" + }, + "aliases": { + "components": "$src/lib/shadcnComponents", + "utils": "$src/utils" + }, + "typescript": true +} diff --git a/package-lock.json b/package-lock.json index 176c8be..65d0d1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@storybook/addons": "^7.6.17", - "bits-ui": "^0.21.15", + "bits-ui": "^0.21.16", "clsx": "^2.1.1", "svelte": "^4.2.19", "tailwind-merge": "^2.5.2" @@ -2860,9 +2860,9 @@ } }, "node_modules/bits-ui": { - "version": "0.21.15", - "resolved": "https://registry.npmjs.org/bits-ui/-/bits-ui-0.21.15.tgz", - "integrity": "sha512-+m5WSpJnFdCcNdXSTIVC1WYBozipO03qRh03GFWgrdxoHiolCfwW71EYG4LPCWYPG6KcTZV0Cj6iHSiZ7cdKdg==", + "version": "0.21.16", + "resolved": "https://registry.npmjs.org/bits-ui/-/bits-ui-0.21.16.tgz", + "integrity": "sha512-XFZ7/bK7j/K+5iktxX/ZpmoFHjYjpPzP5EOO/4bWiaFg5TG1iMcfjDhlBTQnJxD6BoVoHuqeZPHZvaTgF4Iv3Q==", "dependencies": { "@internationalized/date": "^3.5.1", "@melt-ui/svelte": "0.76.2", diff --git a/package.json b/package.json index 544a072..a2ba883 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "@storybook/addons": "^7.6.17", - "bits-ui": "^0.21.15", + "bits-ui": "^0.21.16", "clsx": "^2.1.1", "svelte": "^4.2.19", "tailwind-merge": "^2.5.2" diff --git a/src/assets/Check.svelte b/src/assets/Check.svelte deleted file mode 100644 index 0b643fc..0000000 --- a/src/assets/Check.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/assets/Chevron.svelte b/src/assets/Chevron.svelte deleted file mode 100644 index 9f16e7f..0000000 --- a/src/assets/Chevron.svelte +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/icons/Check.svelte b/src/icons/Check.svelte new file mode 100644 index 0000000..f8bbd09 --- /dev/null +++ b/src/icons/Check.svelte @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/src/icons/Chevron.svelte b/src/icons/Chevron.svelte new file mode 100644 index 0000000..a9291df --- /dev/null +++ b/src/icons/Chevron.svelte @@ -0,0 +1,6 @@ + + + diff --git a/src/icons/Chevron.svelte.d.ts b/src/icons/Chevron.svelte.d.ts new file mode 100644 index 0000000..b51ca73 --- /dev/null +++ b/src/icons/Chevron.svelte.d.ts @@ -0,0 +1,18 @@ +import { SvelteComponent } from "svelte"; +declare const __propDef: { + props: { + [x: string]: any; + }; + events: { + [evt: string]: CustomEvent; + }; + slots: {}; + exports?: undefined; + bindings?: undefined; +}; +export type ChevronProps = typeof __propDef.props; +export type ChevronEvents = typeof __propDef.events; +export type ChevronSlots = typeof __propDef.slots; +export default class Chevron extends SvelteComponent { +} +export {}; diff --git a/src/assets/Error.svelte b/src/icons/Error.svelte similarity index 77% rename from src/assets/Error.svelte rename to src/icons/Error.svelte index 46a3a70..17b5a31 100644 --- a/src/assets/Error.svelte +++ b/src/icons/Error.svelte @@ -1,4 +1,11 @@ - + + import { Meta, Story } from '@storybook/addon-svelte-csf'; + import Check from './Check.svelte'; + import Chevron from './Chevron.svelte'; + import Error from './Error.svelte'; + + const icons = { + Check, + Chevron, + Error, + }; + + + + + + + {#each Object.entries(icons) as [name, Icon]} + + {name} + + + {/each} + + diff --git a/src/lib/features/Accordion.stories.svelte b/src/lib/features/Accordion.stories.svelte new file mode 100644 index 0000000..09bae4f --- /dev/null +++ b/src/lib/features/Accordion.stories.svelte @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/src/lib/features/Accordion.svelte b/src/lib/features/Accordion.svelte new file mode 100644 index 0000000..3f8303b --- /dev/null +++ b/src/lib/features/Accordion.svelte @@ -0,0 +1,13 @@ + + + + + {trigger} + {content} + + diff --git a/src/lib/features/AccordionList.stories.svelte b/src/lib/features/AccordionList.stories.svelte new file mode 100644 index 0000000..0c41506 --- /dev/null +++ b/src/lib/features/AccordionList.stories.svelte @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/src/lib/features/AccordionList.svelte b/src/lib/features/AccordionList.svelte new file mode 100644 index 0000000..5eddfd9 --- /dev/null +++ b/src/lib/features/AccordionList.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/src/lib/shadcnComponents/ui/accordion/accordion-content.svelte b/src/lib/shadcnComponents/ui/accordion/accordion-content.svelte new file mode 100644 index 0000000..3d065d3 --- /dev/null +++ b/src/lib/shadcnComponents/ui/accordion/accordion-content.svelte @@ -0,0 +1,25 @@ + + + + + + + diff --git a/src/lib/shadcnComponents/ui/accordion/accordion-item.svelte b/src/lib/shadcnComponents/ui/accordion/accordion-item.svelte new file mode 100644 index 0000000..dc14460 --- /dev/null +++ b/src/lib/shadcnComponents/ui/accordion/accordion-item.svelte @@ -0,0 +1,14 @@ + + + + + diff --git a/src/lib/shadcnComponents/ui/accordion/accordion-trigger.svelte b/src/lib/shadcnComponents/ui/accordion/accordion-trigger.svelte new file mode 100644 index 0000000..caca9e6 --- /dev/null +++ b/src/lib/shadcnComponents/ui/accordion/accordion-trigger.svelte @@ -0,0 +1,26 @@ + + + + svg]:rotate-180', + className + )} + {...$$restProps} + on:click + > + + + + diff --git a/src/lib/shadcnComponents/ui/accordion/index.ts b/src/lib/shadcnComponents/ui/accordion/index.ts new file mode 100644 index 0000000..ed49213 --- /dev/null +++ b/src/lib/shadcnComponents/ui/accordion/index.ts @@ -0,0 +1,17 @@ +import { Accordion as AccordionPrimitive } from "bits-ui"; +import Content from "./accordion-content.svelte"; +import Item from "./accordion-item.svelte"; +import Trigger from "./accordion-trigger.svelte"; +const Root = AccordionPrimitive.Root; + +export { + Root, + Content, + Item, + Trigger, + // + Root as Accordion, + Content as AccordionContent, + Item as AccordionItem, + Trigger as AccordionTrigger, +}; diff --git a/src/lib/shadcnComponents/ui/select/select-item.svelte b/src/lib/shadcnComponents/ui/select/select-item.svelte index 5bf52e6..5cab81e 100644 --- a/src/lib/shadcnComponents/ui/select/select-item.svelte +++ b/src/lib/shadcnComponents/ui/select/select-item.svelte @@ -1,5 +1,5 @@