fulldev-ui 0.25.0 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/liquid/README.md +1 -1
- package/liquid/assets/ui-licenses.json +1 -1
- package/liquid/assets/ui-manifest.json +1 -1
- package/package.json +4 -2
- package/public/r/liquid/components.json +1 -1
- package/public/r/liquid/init.json +1 -1
- package/public/r/styles/base-luma/button-examples.json +2 -2
- package/public/r/styles/base-luma/collapsible-examples.json +1 -1
- package/public/r/styles/base-luma/combobox-examples.json +1 -1
- package/public/r/styles/base-luma/combobox.json +1 -1
- package/public/r/styles/base-luma/input-group-examples.json +2 -2
- package/public/r/styles/base-luma/item-examples.json +1 -1
- package/public/r/styles/base-luma/select.json +1 -1
- package/public/r/styles/base-luma/tabs.json +1 -1
- package/public/r/styles/base-luma/tooltip-examples.json +1 -1
- package/public/r/styles/base-lyra/button-examples.json +2 -2
- package/public/r/styles/base-lyra/collapsible-examples.json +1 -1
- package/public/r/styles/base-lyra/combobox-examples.json +1 -1
- package/public/r/styles/base-lyra/combobox.json +1 -1
- package/public/r/styles/base-lyra/input-group-examples.json +2 -2
- package/public/r/styles/base-lyra/item-examples.json +1 -1
- package/public/r/styles/base-lyra/select.json +1 -1
- package/public/r/styles/base-lyra/tabs.json +1 -1
- package/public/r/styles/base-lyra/tooltip-examples.json +1 -1
- package/public/r/styles/base-maia/button-examples.json +2 -2
- package/public/r/styles/base-maia/collapsible-examples.json +1 -1
- package/public/r/styles/base-maia/combobox-examples.json +1 -1
- package/public/r/styles/base-maia/combobox.json +1 -1
- package/public/r/styles/base-maia/input-group-examples.json +2 -2
- package/public/r/styles/base-maia/item-examples.json +1 -1
- package/public/r/styles/base-maia/select.json +1 -1
- package/public/r/styles/base-maia/tabs.json +1 -1
- package/public/r/styles/base-maia/tooltip-examples.json +1 -1
- package/public/r/styles/base-mira/button-examples.json +2 -2
- package/public/r/styles/base-mira/collapsible-examples.json +1 -1
- package/public/r/styles/base-mira/combobox-examples.json +1 -1
- package/public/r/styles/base-mira/combobox.json +1 -1
- package/public/r/styles/base-mira/input-group-examples.json +2 -2
- package/public/r/styles/base-mira/item-examples.json +1 -1
- package/public/r/styles/base-mira/select.json +1 -1
- package/public/r/styles/base-mira/tabs.json +1 -1
- package/public/r/styles/base-mira/tooltip-examples.json +1 -1
- package/public/r/styles/base-nova/button-examples.json +2 -2
- package/public/r/styles/base-nova/collapsible-examples.json +1 -1
- package/public/r/styles/base-nova/combobox-examples.json +1 -1
- package/public/r/styles/base-nova/combobox.json +1 -1
- package/public/r/styles/base-nova/input-group-examples.json +2 -2
- package/public/r/styles/base-nova/item-examples.json +1 -1
- package/public/r/styles/base-nova/select.json +1 -1
- package/public/r/styles/base-nova/tabs.json +1 -1
- package/public/r/styles/base-nova/tooltip-examples.json +1 -1
- package/public/r/styles/base-rhea/button-examples.json +2 -2
- package/public/r/styles/base-rhea/collapsible-examples.json +1 -1
- package/public/r/styles/base-rhea/combobox-examples.json +1 -1
- package/public/r/styles/base-rhea/combobox.json +1 -1
- package/public/r/styles/base-rhea/input-group-examples.json +2 -2
- package/public/r/styles/base-rhea/item-examples.json +1 -1
- package/public/r/styles/base-rhea/select.json +1 -1
- package/public/r/styles/base-rhea/tabs.json +1 -1
- package/public/r/styles/base-rhea/tooltip-examples.json +1 -1
- package/public/r/styles/base-sera/button-examples.json +2 -2
- package/public/r/styles/base-sera/collapsible-examples.json +1 -1
- package/public/r/styles/base-sera/combobox-examples.json +1 -1
- package/public/r/styles/base-sera/combobox.json +1 -1
- package/public/r/styles/base-sera/input-group-examples.json +2 -2
- package/public/r/styles/base-sera/item-examples.json +1 -1
- package/public/r/styles/base-sera/select.json +1 -1
- package/public/r/styles/base-sera/tabs.json +1 -1
- package/public/r/styles/base-sera/tooltip-examples.json +1 -1
- package/public/r/styles/base-vega/button-examples.json +2 -2
- package/public/r/styles/base-vega/collapsible-examples.json +1 -1
- package/public/r/styles/base-vega/combobox-examples.json +1 -1
- package/public/r/styles/base-vega/combobox.json +1 -1
- package/public/r/styles/base-vega/input-group-examples.json +2 -2
- package/public/r/styles/base-vega/item-examples.json +1 -1
- package/public/r/styles/base-vega/select.json +1 -1
- package/public/r/styles/base-vega/tabs.json +1 -1
- package/public/r/styles/base-vega/tooltip-examples.json +1 -1
- package/liquid/vendor.json +0 -180
- package/public/r/accordion-examples.json +0 -49
- package/public/r/accordion.json +0 -42
- package/public/r/alert-dialog-examples.json +0 -51
- package/public/r/alert-dialog.json +0 -84
- package/public/r/alert-examples.json +0 -47
- package/public/r/alert.json +0 -38
- package/public/r/article-1.json +0 -22
- package/public/r/article-2.json +0 -22
- package/public/r/articles-1.json +0 -22
- package/public/r/articles-2.json +0 -23
- package/public/r/articles-3.json +0 -22
- package/public/r/articles-4.json +0 -22
- package/public/r/aspect-ratio-examples.json +0 -33
- package/public/r/aspect-ratio.json +0 -23
- package/public/r/attachment-examples.json +0 -48
- package/public/r/attachment.json +0 -66
- package/public/r/avatar-examples.json +0 -68
- package/public/r/avatar.json +0 -48
- package/public/r/badge-examples.json +0 -52
- package/public/r/badge.json +0 -28
- package/public/r/banner-1.json +0 -24
- package/public/r/banner-2.json +0 -22
- package/public/r/banner.json +0 -31
- package/public/r/base.json +0 -143
- package/public/r/blocks-1.json +0 -27
- package/public/r/blocks.json +0 -92
- package/public/r/breadcrumb-examples.json +0 -53
- package/public/r/breadcrumb.json +0 -56
- package/public/r/button-examples.json +0 -87
- package/public/r/button-group-examples.json +0 -75
- package/public/r/button-group.json +0 -41
- package/public/r/button.json +0 -28
- package/public/r/card-examples.json +0 -51
- package/public/r/card.json +0 -53
- package/public/r/carousel-examples.json +0 -49
- package/public/r/carousel.json +0 -50
- package/public/r/checkbox-examples.json +0 -56
- package/public/r/checkbox.json +0 -23
- package/public/r/code-block-examples.json +0 -33
- package/public/r/code-block.json +0 -65
- package/public/r/collapsible-examples.json +0 -51
- package/public/r/collapsible.json +0 -36
- package/public/r/combobox-examples.json +0 -69
- package/public/r/combobox.json +0 -81
- package/public/r/command-examples.json +0 -47
- package/public/r/command.json +0 -71
- package/public/r/components.json +0 -74
- package/public/r/contact-1.json +0 -23
- package/public/r/contact-2.json +0 -23
- package/public/r/contact-3.json +0 -29
- package/public/r/content-1.json +0 -31
- package/public/r/content-2.json +0 -31
- package/public/r/content-3.json +0 -28
- package/public/r/content-4.json +0 -31
- package/public/r/cta-1.json +0 -24
- package/public/r/cta-2.json +0 -30
- package/public/r/cta-3.json +0 -24
- package/public/r/cta-4.json +0 -30
- package/public/r/cta-5.json +0 -31
- package/public/r/cta-6.json +0 -30
- package/public/r/cta-7.json +0 -23
- package/public/r/cta-8.json +0 -22
- package/public/r/dialog-examples.json +0 -47
- package/public/r/dialog.json +0 -75
- package/public/r/doc-1.json +0 -30
- package/public/r/drawer-examples.json +0 -54
- package/public/r/drawer.json +0 -109
- package/public/r/dropdown-menu-examples.json +0 -63
- package/public/r/dropdown-menu.json +0 -77
- package/public/r/empty-examples.json +0 -55
- package/public/r/empty.json +0 -48
- package/public/r/faqs-1.json +0 -23
- package/public/r/faqs-2.json +0 -23
- package/public/r/faqs-3.json +0 -23
- package/public/r/faqs-4.json +0 -22
- package/public/r/features-1.json +0 -26
- package/public/r/features-2.json +0 -22
- package/public/r/features-3.json +0 -21
- package/public/r/features-4.json +0 -26
- package/public/r/features-5.json +0 -22
- package/public/r/features-6.json +0 -23
- package/public/r/field-examples.json +0 -86
- package/public/r/field.json +0 -72
- package/public/r/footer-1.json +0 -24
- package/public/r/footer-2.json +0 -24
- package/public/r/footer-3.json +0 -24
- package/public/r/form.json +0 -23
- package/public/r/header-1.json +0 -29
- package/public/r/header-2.json +0 -29
- package/public/r/header-3.json +0 -30
- package/public/r/header-4.json +0 -29
- package/public/r/header-5.json +0 -30
- package/public/r/header.json +0 -40
- package/public/r/hero-1.json +0 -23
- package/public/r/hero-10.json +0 -24
- package/public/r/hero-11.json +0 -24
- package/public/r/hero-12.json +0 -22
- package/public/r/hero-13.json +0 -22
- package/public/r/hero-2.json +0 -24
- package/public/r/hero-3.json +0 -22
- package/public/r/hero-4.json +0 -25
- package/public/r/hero-5.json +0 -27
- package/public/r/hero-6.json +0 -27
- package/public/r/hero-7.json +0 -27
- package/public/r/hero-8.json +0 -22
- package/public/r/hero-9.json +0 -27
- package/public/r/hover-card-examples.json +0 -29
- package/public/r/hover-card.json +0 -37
- package/public/r/icon.json +0 -27
- package/public/r/init.json +0 -44
- package/public/r/input-examples.json +0 -97
- package/public/r/input-group-examples.json +0 -91
- package/public/r/input-group.json +0 -53
- package/public/r/input.json +0 -23
- package/public/r/item-examples.json +0 -74
- package/public/r/item.json +0 -71
- package/public/r/kbd-examples.json +0 -50
- package/public/r/kbd.json +0 -28
- package/public/r/label-examples.json +0 -24
- package/public/r/label.json +0 -23
- package/public/r/layout.json +0 -41
- package/public/r/links-2.json +0 -24
- package/public/r/logo.json +0 -33
- package/public/r/logos-1.json +0 -22
- package/public/r/logos-2.json +0 -23
- package/public/r/logos-3.json +0 -22
- package/public/r/marquee.json +0 -46
- package/public/r/native-select-examples.json +0 -38
- package/public/r/native-select.json +0 -36
- package/public/r/navigation-menu-examples.json +0 -26
- package/public/r/navigation-menu.json +0 -67
- package/public/r/pagination-examples.json +0 -35
- package/public/r/pagination.json +0 -59
- package/public/r/popover-examples.json +0 -42
- package/public/r/popover.json +0 -51
- package/public/r/price.json +0 -38
- package/public/r/pricing-1.json +0 -29
- package/public/r/pricing-2.json +0 -28
- package/public/r/pricing-3.json +0 -29
- package/public/r/product-1.json +0 -24
- package/public/r/products-1.json +0 -24
- package/public/r/products-2.json +0 -24
- package/public/r/products-3.json +0 -24
- package/public/r/products-4.json +0 -24
- package/public/r/products-5.json +0 -25
- package/public/r/progress-examples.json +0 -33
- package/public/r/progress.json +0 -23
- package/public/r/radio-group-examples.json +0 -50
- package/public/r/radio-group.json +0 -31
- package/public/r/rating.json +0 -26
- package/public/r/registry.json +0 -6959
- package/public/r/resizable-examples.json +0 -33
- package/public/r/resizable.json +0 -36
- package/public/r/reviews-1.json +0 -27
- package/public/r/reviews-2.json +0 -27
- package/public/r/reviews-3.json +0 -27
- package/public/r/reviews-4.json +0 -25
- package/public/r/reviews-5.json +0 -27
- package/public/r/section.json +0 -38
- package/public/r/select-examples.json +0 -53
- package/public/r/select.json +0 -62
- package/public/r/separator-examples.json +0 -38
- package/public/r/separator.json +0 -23
- package/public/r/services-1.json +0 -32
- package/public/r/services-2.json +0 -29
- package/public/r/services-3.json +0 -29
- package/public/r/services-4.json +0 -31
- package/public/r/services-5.json +0 -26
- package/public/r/services-6.json +0 -32
- package/public/r/services-7.json +0 -32
- package/public/r/sheet-examples.json +0 -37
- package/public/r/sheet.json +0 -66
- package/public/r/sidebar-1.json +0 -35
- package/public/r/sidebar-examples.json +0 -24
- package/public/r/sidebar.json +0 -146
- package/public/r/skeleton-examples.json +0 -49
- package/public/r/skeleton.json +0 -23
- package/public/r/slider-examples.json +0 -44
- package/public/r/slider.json +0 -26
- package/public/r/spinner-examples.json +0 -61
- package/public/r/spinner.json +0 -26
- package/public/r/switch-examples.json +0 -50
- package/public/r/switch.json +0 -26
- package/public/r/table-examples.json +0 -38
- package/public/r/table.json +0 -58
- package/public/r/tabs-examples.json +0 -47
- package/public/r/tabs.json +0 -46
- package/public/r/textarea-examples.json +0 -45
- package/public/r/textarea.json +0 -23
- package/public/r/theme-toggle.json +0 -34
- package/public/r/toast-examples.json +0 -29
- package/public/r/toast.json +0 -80
- package/public/r/toc.json +0 -43
- package/public/r/toggle-examples.json +0 -46
- package/public/r/toggle-group-examples.json +0 -57
- package/public/r/toggle-group.json +0 -34
- package/public/r/toggle.json +0 -31
- package/public/r/tooltip-examples.json +0 -43
- package/public/r/tooltip.json +0 -36
- package/public/r/typography.json +0 -103
- package/public/r/video.json +0 -23
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "src/components/examples/item/item-group.astro",
|
|
33
|
-
"content": "---\nimport PlusIcon from \"@lucide/astro/icons/plus\"\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemTitle,\n} from \"@/components/ui/item\"\n\nconst people = [\n {\n username: \"shadcn\",\n avatar: \"https://github.com/shadcn.png\",\n email: \"shadcn@vercel.com\",\n },\n {\n username: \"maxleiter\",\n avatar: \"https://github.com/maxleiter.png\",\n email: \"maxleiter@vercel.com\",\n },\n {\n username: \"evilrabbit\",\n avatar: \"https://github.com/evilrabbit.png\",\n email: \"evilrabbit@vercel.com\",\n },\n]\n---\n\n<ItemGroup class=\"max-w-sm\">\n {people.map((person) => (\n <Item variant=\"outline\">\n <ItemMedia>\n <Avatar>\n <AvatarImage src={person.avatar} class=\"grayscale\" />\n <AvatarFallback>{person.username.charAt(0)}</AvatarFallback>\n </Avatar>\n </ItemMedia>\n <ItemContent class=\"gap-1\">\n <ItemTitle>{person.username}</ItemTitle>\n <ItemDescription>{person.email}</ItemDescription>\n </ItemContent>\n <ItemActions>\n <Button
|
|
33
|
+
"content": "---\nimport PlusIcon from \"@lucide/astro/icons/plus\"\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemTitle,\n} from \"@/components/ui/item\"\n\nconst people = [\n {\n username: \"shadcn\",\n avatar: \"https://github.com/shadcn.png\",\n email: \"shadcn@vercel.com\",\n },\n {\n username: \"maxleiter\",\n avatar: \"https://github.com/maxleiter.png\",\n email: \"maxleiter@vercel.com\",\n },\n {\n username: \"evilrabbit\",\n avatar: \"https://github.com/evilrabbit.png\",\n email: \"evilrabbit@vercel.com\",\n },\n]\n---\n\n<ItemGroup class=\"max-w-sm\">\n {people.map((person) => (\n <Item variant=\"outline\">\n <ItemMedia>\n <Avatar>\n <AvatarImage src={person.avatar} class=\"grayscale\" />\n <AvatarFallback>{person.username.charAt(0)}</AvatarFallback>\n </Avatar>\n </ItemMedia>\n <ItemContent class=\"gap-1\">\n <ItemTitle>{person.username}</ItemTitle>\n <ItemDescription>{person.email}</ItemDescription>\n </ItemContent>\n <ItemActions>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"rounded-full\"\n aria-label=\"Invite\"\n >\n <PlusIcon />\n </Button>\n </ItemActions>\n </Item>\n ))}\n</ItemGroup>\n",
|
|
34
34
|
"type": "registry:component"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
12
12
|
"path": "src/components/ui/select/select.astro",
|
|
13
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Position, Side } from \"@data-slot/select\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n position?: Position\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n highlightItemOnHover?: boolean\n lockScroll?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n position,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n highlightItemOnHover,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n<div\n data-slot=\"select\"\n data-mount-strategy={mountStrategy}\n data-default-value={defaultValue}\n data-default-open={defaultOpen}\n data-placeholder={placeholder}\n data-disabled={disabled}\n data-required={required}\n data-name={name}\n data-position={position}\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-align-offset={alignOffset}\n data-avoid-collisions={avoidCollisions}\n data-collision-padding={collisionPadding}\n data-highlight-item-on-hover={highlightItemOnHover}\n data-lock-scroll={lockScroll}\n class={cn(\n \"group/select relative inline-flex w-fit flex-col gap-1.5\",\n className\n )}\n {...props}\n>\n <
|
|
13
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Position, Side } from \"@data-slot/select\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n position?: Position\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n highlightItemOnHover?: boolean\n lockScroll?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n position,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n highlightItemOnHover,\n lockScroll,\n ...props\n} = Astro.props\n\n// Show the text Data Slot puts in the SelectValue when it starts: the label of\n// the default item, or the placeholder. Without it the trigger is empty, and\n// has no accessible name, until the script runs.\nconst html = await Astro.slots.render(\"default\")\nconst entities: Record<string, string> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n nbsp: \"\\u00a0\",\n}\nconst decode = (value: string) =>\n value.replace(\n /&(#x?[\\da-f]+|amp|lt|gt|quot|apos|nbsp);/gi,\n (entity, code: string) =>\n code.startsWith(\"#\")\n ? String.fromCodePoint(Number(code.replace(\"#\", \"0\")))\n : (entities[code] ?? entity)\n )\n// Attribute values can hold \">\", as Tailwind classes do.\nconst tags =\n /<!--[\\s\\S]*?-->|<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>|<(\\/?)([a-z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/gi\nconst attributes = (source: string) =>\n [\n ...source.matchAll(/([^\\s\"'>/=]+)(?:\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g),\n ].map(({ 0: text, 1: name, 2: value = \"\", index }) => ({\n name: name.toLowerCase(),\n value: decode(/^[\"']/.test(value) ? value.slice(1, -1) : value),\n index,\n text,\n }))\n// Elements without an end tag.\nconst empty = new Set(\n \"area base br col embed hr img input link meta source track wbr\".split(\" \")\n)\nconst escape = (value: string) =>\n value.replace(/[&<>]/g, (char) => `&#${char.charCodeAt(0)};`)\n\ntype Item = { value?: string; label?: string; text: string; itemText?: string }\nconst items: Item[] = []\nlet trigger: number | undefined\nlet value: { start: number; end?: number; placeholder?: string } | undefined\nconst open: { name: string; item?: Item; itemText?: Item; value?: true }[] = []\nlet last = 0\nfor (const match of html.matchAll(tags)) {\n const { 0: whole, 2: close, 3: tag, 4: source = \"\", index } = match\n const text = html.slice(last, index)\n last = index + whole.length\n for (const element of open) {\n if (element.item) element.item.text += text\n if (element.itemText) element.itemText.itemText += text\n }\n if (!tag) continue\n const name = tag.toLowerCase()\n if (close) {\n const at = open.findLastIndex((element) => element.name === name)\n if (at < 0) continue\n if (value && open.slice(at).some((element) => element.value)) {\n value.end ??= index\n }\n open.length = at\n continue\n }\n const list = attributes(source)\n const get = (key: string) => list.find((item) => item.name === key)?.value\n const slot = get(\"data-slot\")\n const element: (typeof open)[number] = { name }\n if (slot === \"select-item\") {\n element.item = {\n value: get(\"data-value\"),\n label: get(\"data-label\")?.trim(),\n text: \"\",\n }\n items.push(element.item)\n }\n const owner = open.findLast((element) => element.item)?.item\n if (slot === \"select-item-text\" && owner && owner.itemText === undefined) {\n owner.itemText = \"\"\n element.itemText = owner\n }\n if (slot === \"select-trigger\" && get(\"data-placeholder\") === undefined) {\n trigger ??= index + whole.length - 1\n }\n if (slot === \"select-value\" && !value) {\n value = { start: last, placeholder: get(\"data-placeholder\") }\n element.value = true\n }\n if (!empty.has(name) && !source.trimEnd().endsWith(\"/\")) open.push(element)\n}\n\n// The label as Data Slot reads it: data-label, the SelectItemText, the item's\n// text, or else the value itself.\nconst item = items.find((item) => item.value === defaultValue)\nconst plain = (source = \"\") => escape(decode(source).trim())\nconst label =\n defaultValue === undefined\n ? escape(placeholder ?? value?.placeholder ?? \"\")\n : item?.label\n ? escape(item.label)\n : plain(item?.itemText) || plain(item?.text) || escape(defaultValue)\nconst edits: [start: number, end: number, text: string][] = []\nif (value?.end !== undefined && label) {\n if (!html.slice(value.start, value.end).trim()) {\n edits.push([value.start, value.end, label])\n }\n}\nif (defaultValue === undefined && trigger !== undefined) {\n edits.push([trigger, trigger, \" data-placeholder\"])\n}\nlet content = html\nfor (const [start, end, text] of edits.sort(([a], [b]) => b - a)) {\n content = content.slice(0, start) + text + content.slice(end)\n}\n---\n\n<div\n data-slot=\"select\"\n data-mount-strategy={mountStrategy}\n data-default-value={defaultValue}\n data-default-open={defaultOpen}\n data-placeholder={placeholder}\n data-disabled={disabled}\n data-required={required}\n data-name={name}\n data-position={position}\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-align-offset={alignOffset}\n data-avoid-collisions={avoidCollisions}\n data-collision-padding={collisionPadding}\n data-highlight-item-on-hover={highlightItemOnHover}\n data-lock-scroll={lockScroll}\n class={cn(\n \"group/select relative inline-flex w-fit flex-col gap-1.5\",\n className\n )}\n {...props}\n>\n <Fragment set:html={content} />\n</div>\n\n<script>\n import { create } from \"@data-slot/select\"\n\n const controllers: ReturnType<typeof create> = []\n const initialize = () => controllers.push(...create())\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const controller of controllers) controller.destroy()\n controllers.length = 0\n })\n</script>\n",
|
|
14
14
|
"type": "registry:ui"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/tabs/tabs.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n orientation?: \"horizontal\" | \"vertical\"\n activationMode?: \"auto\" | \"manual\"\n}\n\nconst {\n class: className,\n defaultValue,\n orientation = \"horizontal\",\n activationMode,\n ...props\n} = Astro.props\n---\n\n<div\n data-slot=\"tabs\"\n data-default-value={defaultValue}\n data-orientation={orientation}\n data-activation-mode={activationMode}\n data-horizontal={orientation === \"horizontal\" ? \"\" : undefined}\n data-vertical={orientation === \"vertical\" ? \"\" : undefined}\n class={cn(\"gap-2 group/tabs flex data-horizontal:flex-col\", className)}\n {...props}\n>\n <
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n orientation?: \"horizontal\" | \"vertical\"\n activationMode?: \"auto\" | \"manual\"\n}\n\nconst {\n class: className,\n defaultValue,\n orientation = \"horizontal\",\n activationMode,\n ...props\n} = Astro.props\n\n// Show the initial panels in the HTML, the ones Data Slot shows when it\n// starts: those of the default value, or of the first enabled trigger.\n// TabsContent renders hidden, so without this the page shifts when the script\n// starts. Like Data Slot, skip the parts of nested tabs.\nconst html = await Astro.slots.render(\"default\")\nconst entities: Record<string, string> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n nbsp: \"\\u00a0\",\n}\nconst decode = (value: string) =>\n value.replace(\n /&(#x?[\\da-f]+|amp|lt|gt|quot|apos|nbsp);/gi,\n (entity, code: string) =>\n code.startsWith(\"#\")\n ? String.fromCodePoint(Number(code.replace(\"#\", \"0\")))\n : (entities[code] ?? entity)\n )\n// Attribute values can hold \">\", as Tailwind classes do.\nconst tags =\n /<!--[\\s\\S]*?-->|<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>|<(\\/?)([a-z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/gi\nconst attributes = (source: string) =>\n [\n ...source.matchAll(/([^\\s\"'>/=]+)(?:\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g),\n ].map(({ 0: text, 1: name, 2: value = \"\", index }) => ({\n name: name.toLowerCase(),\n value: decode(/^[\"']/.test(value) ? value.slice(1, -1) : value),\n index,\n text,\n }))\n// Elements without an end tag.\nconst empty = new Set(\n \"area base br col embed hr img input link meta source track wbr\".split(\" \")\n)\n\nconst triggers: { value: string; disabled: boolean }[] = []\nconst panels: { value: string; hidden: boolean; start: number; end: number }[] =\n []\nconst open: { name: string; tabs: boolean }[] = []\nfor (const { 2: close, 3: tag, 4: source = \"\", index } of html.matchAll(tags)) {\n if (!tag) continue\n const name = tag.toLowerCase()\n if (close) {\n const at = open.findLastIndex((element) => element.name === name)\n if (at >= 0) open.length = at\n continue\n }\n const list = attributes(source)\n const get = (key: string) => list.find((item) => item.name === key)?.value\n const slot = get(\"data-slot\")\n if (!open.some((element) => element.tabs)) {\n const value = get(\"data-value\")?.trim() ?? \"\"\n if (slot === \"tabs-trigger\" && value) {\n triggers.push({\n value,\n disabled:\n get(\"disabled\") !== undefined ||\n get(\"data-disabled\") !== undefined ||\n get(\"aria-disabled\") === \"true\",\n })\n }\n if (slot === \"tabs-content\" && value) {\n const attribute = list.find((item) => item.name === \"hidden\")\n const start = index + 1 + tag.length + (attribute?.index ?? 0)\n const end = start + (attribute?.text.length ?? 0)\n panels.push({ value, hidden: attribute !== undefined, start, end })\n }\n }\n if (!empty.has(name) && !source.trimEnd().endsWith(\"/\")) {\n open.push({ name, tabs: slot === \"tabs\" })\n }\n}\nconst preferred = triggers.findLast(\n (trigger) => trigger.value === defaultValue?.trim()\n)\nconst initial =\n preferred && !preferred.disabled\n ? preferred.value\n : triggers.find((trigger) => !trigger.disabled)?.value\n// Data Slot shows the panels of the initial value and hides the others.\nlet content = html\nfor (const { value, hidden, start, end } of panels.reverse()) {\n if (initial === undefined || hidden !== (value === initial)) continue\n content =\n content.slice(0, start) + (hidden ? \"\" : \" hidden\") + content.slice(end)\n}\n---\n\n<div\n data-slot=\"tabs\"\n data-default-value={defaultValue}\n data-orientation={orientation}\n data-activation-mode={activationMode}\n data-horizontal={orientation === \"horizontal\" ? \"\" : undefined}\n data-vertical={orientation === \"vertical\" ? \"\" : undefined}\n class={cn(\"gap-2 group/tabs flex data-horizontal:flex-col\", className)}\n {...props}\n>\n <Fragment set:html={content} />\n</div>\n\n<script>\n import { create } from \"@data-slot/tabs\"\n\n const controllers: ReturnType<typeof create> = []\n const initialize = () => controllers.push(...create())\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const controller of controllers) controller.destroy()\n controllers.length = 0\n })\n</script>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/examples/tooltip/tooltip-keyboard.astro",
|
|
27
|
-
"content": "---\nimport SaveIcon from \"@lucide/astro/icons/save\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n---\n\n<Tooltip>\n <TooltipTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon-sm\" })}\n >\n <SaveIcon />\n </TooltipTrigger>\n <TooltipContent>\n Save Changes <Kbd>S</Kbd>\n </TooltipContent>\n</Tooltip>\n",
|
|
27
|
+
"content": "---\nimport SaveIcon from \"@lucide/astro/icons/save\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n---\n\n<Tooltip>\n <TooltipTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon-sm\" })}\n aria-label=\"Save\"\n >\n <SaveIcon />\n </TooltipTrigger>\n <TooltipContent>\n Save Changes <Kbd>S</Kbd>\n </TooltipContent>\n</Tooltip>\n",
|
|
28
28
|
"type": "registry:component"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "src/components/examples/button/button-icon.astro",
|
|
36
|
-
"content": "---\nimport CircleFadingArrowUpIcon from \"@lucide/astro/icons/circle-fading-arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<Button variant=\"outline\" size=\"icon\">\n <CircleFadingArrowUpIcon />\n</Button>\n",
|
|
36
|
+
"content": "---\nimport CircleFadingArrowUpIcon from \"@lucide/astro/icons/circle-fading-arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<Button variant=\"outline\" size=\"icon\" aria-label=\"Upgrade\">\n <CircleFadingArrowUpIcon />\n</Button>\n",
|
|
37
37
|
"type": "registry:component"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"path": "src/components/examples/button/button-rounded.astro",
|
|
56
|
-
"content": "---\nimport ArrowUpIcon from \"@lucide/astro/icons/arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<div class=\"flex gap-2\">\n <Button class=\"rounded-full\">Get Started</Button>\n <Button
|
|
56
|
+
"content": "---\nimport ArrowUpIcon from \"@lucide/astro/icons/arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<div class=\"flex gap-2\">\n <Button class=\"rounded-full\">Get Started</Button>\n <Button\n variant=\"outline\"\n size=\"icon\"\n class=\"rounded-full\"\n aria-label=\"Submit\"\n >\n <ArrowUpIcon />\n </Button>\n</div>\n",
|
|
57
57
|
"type": "registry:component"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"path": "src/components/examples/collapsible/collapsible-settings.astro",
|
|
45
|
-
"content": "---\nimport MaximizeIcon from \"@lucide/astro/icons/maximize\"\nimport MinimizeIcon from \"@lucide/astro/icons/minimize\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\nimport { Field, FieldGroup, FieldLabel } from \"@/components/ui/field\"\nimport { Input } from \"@/components/ui/input\"\n---\n\n<Card class=\"mx-auto w-full max-w-xs\" size=\"sm\">\n <CardHeader>\n <CardTitle>Radius</CardTitle>\n <CardDescription>Set the corner radius of the element.</CardDescription>\n </CardHeader>\n <CardContent>\n <Collapsible class=\"flex items-start gap-2\">\n <FieldGroup class=\"grid w-full grid-cols-2 gap-2\">\n <Field>\n <FieldLabel for=\"radius-x\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y\" placeholder=\"0\" value=\"0\" />\n </Field>\n <CollapsibleContent class=\"col-span-full grid grid-cols-subgrid gap-2\">\n <Field>\n <FieldLabel for=\"radius-x-2\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y-2\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n </CollapsibleContent>\n </FieldGroup>\n <CollapsibleTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon\" })}\n >\n <MaximizeIcon class=\"group-aria-expanded/button:hidden\" />\n <MinimizeIcon class=\"hidden group-aria-expanded/button:block\" />\n </CollapsibleTrigger>\n </Collapsible>\n </CardContent>\n</Card>\n",
|
|
45
|
+
"content": "---\nimport MaximizeIcon from \"@lucide/astro/icons/maximize\"\nimport MinimizeIcon from \"@lucide/astro/icons/minimize\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\nimport { Field, FieldGroup, FieldLabel } from \"@/components/ui/field\"\nimport { Input } from \"@/components/ui/input\"\n---\n\n<Card class=\"mx-auto w-full max-w-xs\" size=\"sm\">\n <CardHeader>\n <CardTitle>Radius</CardTitle>\n <CardDescription>Set the corner radius of the element.</CardDescription>\n </CardHeader>\n <CardContent>\n <Collapsible class=\"flex items-start gap-2\">\n <FieldGroup class=\"grid w-full grid-cols-2 gap-2\">\n <Field>\n <FieldLabel for=\"radius-x\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y\" placeholder=\"0\" value=\"0\" />\n </Field>\n <CollapsibleContent class=\"col-span-full grid grid-cols-subgrid gap-2\">\n <Field>\n <FieldLabel for=\"radius-x-2\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y-2\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n </CollapsibleContent>\n </FieldGroup>\n <CollapsibleTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon\" })}\n >\n <MaximizeIcon class=\"group-aria-expanded/button:hidden\" />\n <MinimizeIcon class=\"hidden group-aria-expanded/button:block\" />\n <span class=\"sr-only\">Toggle details</span>\n </CollapsibleTrigger>\n </Collapsible>\n </CardContent>\n</Card>\n",
|
|
46
46
|
"type": "registry:component"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "src/components/examples/combobox/combobox-popup.astro",
|
|
63
|
-
"content": "---\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxValue,\n} from \"@/components/ui/combobox\"\n\nconst countries = [\n { code: \"\", value: \"\", continent: \"\", label: \"Select country\" },\n {\n code: \"ar\",\n value: \"argentina\",\n label: \"Argentina\",\n continent: \"South America\",\n },\n { code: \"au\", value: \"australia\", label: \"Australia\", continent: \"Oceania\" },\n { code: \"br\", value: \"brazil\", label: \"Brazil\", continent: \"South America\" },\n { code: \"ca\", value: \"canada\", label: \"Canada\", continent: \"North America\" },\n { code: \"cn\", value: \"china\", label: \"China\", continent: \"Asia\" },\n {\n code: \"co\",\n value: \"colombia\",\n label: \"Colombia\",\n continent: \"South America\",\n },\n { code: \"eg\", value: \"egypt\", label: \"Egypt\", continent: \"Africa\" },\n { code: \"fr\", value: \"france\", label: \"France\", continent: \"Europe\" },\n { code: \"de\", value: \"germany\", label: \"Germany\", continent: \"Europe\" },\n { code: \"it\", value: \"italy\", label: \"Italy\", continent: \"Europe\" },\n { code: \"jp\", value: \"japan\", label: \"Japan\", continent: \"Asia\" },\n { code: \"ke\", value: \"kenya\", label: \"Kenya\", continent: \"Africa\" },\n { code: \"mx\", value: \"mexico\", label: \"Mexico\", continent: \"North America\" },\n {\n code: \"nz\",\n value: \"new-zealand\",\n label: \"New Zealand\",\n continent: \"Oceania\",\n },\n { code: \"ng\", value: \"nigeria\", label: \"Nigeria\", continent: \"Africa\" },\n {\n code: \"za\",\n value: \"south-africa\",\n label: \"South Africa\",\n continent: \"Africa\",\n },\n { code: \"kr\", value: \"south-korea\", label: \"South Korea\", continent: \"Asia\" },\n {\n code: \"gb\",\n value: \"united-kingdom\",\n label: \"United Kingdom\",\n continent: \"Europe\",\n },\n {\n code: \"us\",\n value: \"united-states\",\n label: \"United States\",\n continent: \"North America\",\n },\n]\n---\n\n<Combobox defaultValue={countries[0].value}>\n <Button\n variant=\"outline\"\n data-slot=\"combobox-trigger\"\n class=\"[&_svg:not([class*='size-'])]:size-4 w-64 justify-between font-normal\"\n >\n <ComboboxValue
|
|
63
|
+
"content": "---\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxValue,\n} from \"@/components/ui/combobox\"\n\nconst countries = [\n { code: \"\", value: \"\", continent: \"\", label: \"Select country\" },\n {\n code: \"ar\",\n value: \"argentina\",\n label: \"Argentina\",\n continent: \"South America\",\n },\n { code: \"au\", value: \"australia\", label: \"Australia\", continent: \"Oceania\" },\n { code: \"br\", value: \"brazil\", label: \"Brazil\", continent: \"South America\" },\n { code: \"ca\", value: \"canada\", label: \"Canada\", continent: \"North America\" },\n { code: \"cn\", value: \"china\", label: \"China\", continent: \"Asia\" },\n {\n code: \"co\",\n value: \"colombia\",\n label: \"Colombia\",\n continent: \"South America\",\n },\n { code: \"eg\", value: \"egypt\", label: \"Egypt\", continent: \"Africa\" },\n { code: \"fr\", value: \"france\", label: \"France\", continent: \"Europe\" },\n { code: \"de\", value: \"germany\", label: \"Germany\", continent: \"Europe\" },\n { code: \"it\", value: \"italy\", label: \"Italy\", continent: \"Europe\" },\n { code: \"jp\", value: \"japan\", label: \"Japan\", continent: \"Asia\" },\n { code: \"ke\", value: \"kenya\", label: \"Kenya\", continent: \"Africa\" },\n { code: \"mx\", value: \"mexico\", label: \"Mexico\", continent: \"North America\" },\n {\n code: \"nz\",\n value: \"new-zealand\",\n label: \"New Zealand\",\n continent: \"Oceania\",\n },\n { code: \"ng\", value: \"nigeria\", label: \"Nigeria\", continent: \"Africa\" },\n {\n code: \"za\",\n value: \"south-africa\",\n label: \"South Africa\",\n continent: \"Africa\",\n },\n { code: \"kr\", value: \"south-korea\", label: \"South Korea\", continent: \"Asia\" },\n {\n code: \"gb\",\n value: \"united-kingdom\",\n label: \"United Kingdom\",\n continent: \"Europe\",\n },\n {\n code: \"us\",\n value: \"united-states\",\n label: \"United States\",\n continent: \"North America\",\n },\n]\n---\n\n<Combobox defaultValue={countries[0].value}>\n <Button\n variant=\"outline\"\n data-slot=\"combobox-trigger\"\n class=\"[&_svg:not([class*='size-'])]:size-4 w-64 justify-between font-normal\"\n >\n <ComboboxValue>{countries[0].label}</ComboboxValue>\n <ChevronDownIcon class=\"text-muted-foreground size-4 pointer-events-none\" />\n </Button>\n <ComboboxContent>\n <ComboboxInput showTrigger={false} placeholder=\"Search\" />\n <ComboboxList>\n <ComboboxEmpty>No items found.</ComboboxEmpty>\n {countries.map((item) => (\n <ComboboxItem value={item.value}>{item.label}</ComboboxItem>\n ))}\n </ComboboxList>\n </ComboboxContent>\n</Combobox>\n",
|
|
64
64
|
"type": "registry:component"
|
|
65
65
|
}
|
|
66
66
|
],
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"path": "src/components/ui/combobox/combobox-trigger.astro",
|
|
62
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { cn } from \"@/lib/utils\"\nimport { InputGroupButton } from \"@/components/ui/input-group\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n showIcon?: boolean\n}\n\nconst {\n class: className,\n type = \"button\",\n showIcon = true,\n ...props\n} = Astro.props\n---\n\n<InputGroupButton\n type={type ?? \"button\"}\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"combobox-trigger\"\n class={cn(\"[&_svg]:text-muted-foreground\", className)}\n {...props}\n>\n <slot />\n {showIcon && (\n <ChevronDownIcon class=\"text-muted-foreground size-4 pointer-events-none\" />\n )}\n</InputGroupButton>\n",
|
|
62
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { cn } from \"@/lib/utils\"\nimport { InputGroupButton } from \"@/components/ui/input-group\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n showIcon?: boolean\n}\n\nconst {\n class: className,\n type = \"button\",\n showIcon = true,\n ...props\n} = Astro.props\n\n// Data Slot names the trigger \"Toggle\" when it starts. Name it the same in the\n// HTML, so it has a name before the script runs.\n---\n\n<InputGroupButton\n type={type ?? \"button\"}\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"combobox-trigger\"\n class={cn(\"[&_svg]:text-muted-foreground\", className)}\n aria-label=\"Toggle\"\n {...props}\n>\n <slot />\n {showIcon && (\n <ChevronDownIcon class=\"text-muted-foreground size-4 pointer-events-none\" />\n )}\n</InputGroupButton>\n",
|
|
63
63
|
"type": "registry:ui"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "src/components/examples/input-group/input-group-button.astro",
|
|
30
|
-
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"@/components/ui/input-group\"\nimport { Popover, PopoverContent } from \"@/components/ui/popover\"\n---\n\n<div class=\"grid w-full max-w-sm gap-6\" data-input-group-button-example>\n <InputGroup>\n <InputGroupInput placeholder=\"https://x.com/shadcn\" readonly />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n aria-label=\"Copy\"\n title=\"Copy\"\n size=\"icon-xs\"\n data-copy-value=\"https://x.com/shadcn\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-check hidden\"\n data-copied-icon\n >\n <path d=\"M5 12l5 5l10 -10\"></path>\n </svg>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n data-copy-icon\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n <InputGroup class=\"[--radius:9999px]\">\n <InputGroupAddon>\n <Popover>\n <InputGroupButton\n data-slot=\"popover-trigger\"\n variant=\"secondary\"\n size=\"icon-xs\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-info-circle\"\n >\n <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\"></path>\n <path d=\"M12 9h.01\"></path>\n <path d=\"M11 12h1v4h1\"></path>\n </svg>\n </InputGroupButton>\n <PopoverContent\n align=\"start\"\n class=\"flex flex-col gap-1 rounded-xl text-sm\"\n >\n <p class=\"font-medium\">Your connection is not secure.</p>\n <p>You should not enter any sensitive information on this site.</p>\n </PopoverContent>\n </Popover>\n </InputGroupAddon>\n <InputGroupAddon class=\"pl-1.5 text-muted-foreground\">\n https://\n </InputGroupAddon>\n <InputGroupInput id=\"input-secure-19\" />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton
|
|
30
|
+
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"@/components/ui/input-group\"\nimport { Popover, PopoverContent } from \"@/components/ui/popover\"\n---\n\n<div class=\"grid w-full max-w-sm gap-6\" data-input-group-button-example>\n <InputGroup>\n <InputGroupInput placeholder=\"https://x.com/shadcn\" readonly />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n aria-label=\"Copy\"\n title=\"Copy\"\n size=\"icon-xs\"\n data-copy-value=\"https://x.com/shadcn\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-check hidden\"\n data-copied-icon\n >\n <path d=\"M5 12l5 5l10 -10\"></path>\n </svg>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n data-copy-icon\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n <InputGroup class=\"[--radius:9999px]\">\n <InputGroupAddon>\n <Popover>\n <InputGroupButton\n data-slot=\"popover-trigger\"\n variant=\"secondary\"\n size=\"icon-xs\"\n aria-label=\"Info\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-info-circle\"\n >\n <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\"></path>\n <path d=\"M12 9h.01\"></path>\n <path d=\"M11 12h1v4h1\"></path>\n </svg>\n </InputGroupButton>\n <PopoverContent\n align=\"start\"\n class=\"flex flex-col gap-1 rounded-xl text-sm\"\n >\n <p class=\"font-medium\">Your connection is not secure.</p>\n <p>You should not enter any sensitive information on this site.</p>\n </PopoverContent>\n </Popover>\n </InputGroupAddon>\n <InputGroupAddon class=\"pl-1.5 text-muted-foreground\">\n https://\n </InputGroupAddon>\n <InputGroupInput id=\"input-secure-19\" />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n size=\"icon-xs\"\n aria-label=\"Favorite\"\n data-favorite-toggle\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-star data-[favorite=true]:fill-blue-600 data-[favorite=true]:stroke-blue-600\"\n data-favorite=\"false\"\n >\n <path d=\"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n <InputGroup>\n <InputGroupInput placeholder=\"Type to search...\" />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton variant=\"secondary\">Search</InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n</div>\n\n<script>\n const initialize = () => {\n for (const root of document.querySelectorAll<HTMLElement>(\n \"[data-input-group-button-example]\"\n )) {\n if (root.hasAttribute(\"data-bound\")) continue\n root.setAttribute(\"data-bound\", \"\")\n\n const copy = root.querySelector<HTMLElement>(\"[data-copy-value]\")!\n const copyIcon = copy.querySelector(\"[data-copy-icon]\")!\n const copiedIcon = copy.querySelector(\"[data-copied-icon]\")!\n let timeout: ReturnType<typeof setTimeout> | undefined\n const setCopied = (copied: boolean) => {\n copiedIcon.classList.toggle(\"hidden\", !copied)\n copyIcon.classList.toggle(\"hidden\", copied)\n }\n copy.addEventListener(\"click\", async () => {\n try {\n await navigator.clipboard.writeText(copy.dataset.copyValue!)\n } catch {\n return\n }\n setCopied(true)\n clearTimeout(timeout)\n timeout = setTimeout(() => setCopied(false), 2000)\n })\n\n const favorite = root.querySelector(\"[data-favorite-toggle]\")!\n const star = favorite.querySelector<SVGElement>(\"[data-favorite]\")!\n favorite.addEventListener(\"click\", () => {\n star.dataset.favorite = String(star.dataset.favorite !== \"true\")\n })\n }\n }\n\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n</script>\n",
|
|
31
31
|
"type": "registry:component"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"path": "src/components/examples/input-group/input-group-textarea.astro",
|
|
85
|
-
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupTextarea,\n} from \"@/components/ui/input-group\"\n---\n\n<div class=\"grid w-full max-w-md gap-4\">\n <InputGroup>\n <InputGroupTextarea\n id=\"textarea-code-32\"\n placeholder=\"console.log('Hello, world!');\"\n class=\"min-h-[200px]\"\n />\n <InputGroupAddon align=\"block-end\" class=\"border-t\">\n <InputGroupText>Line 1, Column 1</InputGroupText>\n <InputGroupButton size=\"sm\" class=\"ml-auto\" variant=\"default\">\n Run\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-corner-down-left\"\n >\n <path d=\"M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n <InputGroupAddon align=\"block-start\" class=\"border-b\">\n <InputGroupText class=\"font-mono font-medium\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-brand-javascript\"\n >\n <path d=\"M20 4l-2 14.5l-6 2l-6 -2l-2 -14.5l16 0\"></path>\n <path d=\"M7.5 8h3v8l-2 -1\"></path>\n <path d=\"M16.5 8h-2.5a.5 .5 0 0 0 -.5 .5v3a.5 .5 0 0 0 .5 .5h1.423a.5 .5 0 0 1 .495 .57l-.418 2.93l-2 .5\"></path>\n </svg>\n script.js\n </InputGroupText>\n <InputGroupButton class=\"ml-auto\" size=\"icon-xs\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-refresh\"\n >\n <path d=\"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4\"></path>\n <path d=\"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4\"></path>\n </svg>\n </InputGroupButton>\n <InputGroupButton variant=\"ghost\" size=\"icon-xs\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n</div>\n",
|
|
85
|
+
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupTextarea,\n} from \"@/components/ui/input-group\"\n---\n\n<div class=\"grid w-full max-w-md gap-4\">\n <InputGroup>\n <InputGroupTextarea\n id=\"textarea-code-32\"\n placeholder=\"console.log('Hello, world!');\"\n class=\"min-h-[200px]\"\n />\n <InputGroupAddon align=\"block-end\" class=\"border-t\">\n <InputGroupText>Line 1, Column 1</InputGroupText>\n <InputGroupButton size=\"sm\" class=\"ml-auto\" variant=\"default\">\n Run\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-corner-down-left\"\n >\n <path d=\"M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n <InputGroupAddon align=\"block-start\" class=\"border-b\">\n <InputGroupText class=\"font-mono font-medium\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-brand-javascript\"\n >\n <path d=\"M20 4l-2 14.5l-6 2l-6 -2l-2 -14.5l16 0\"></path>\n <path d=\"M7.5 8h3v8l-2 -1\"></path>\n <path d=\"M16.5 8h-2.5a.5 .5 0 0 0 -.5 .5v3a.5 .5 0 0 0 .5 .5h1.423a.5 .5 0 0 1 .495 .57l-.418 2.93l-2 .5\"></path>\n </svg>\n script.js\n </InputGroupText>\n <InputGroupButton class=\"ml-auto\" size=\"icon-xs\" aria-label=\"Refresh\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-refresh\"\n >\n <path d=\"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4\"></path>\n <path d=\"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4\"></path>\n </svg>\n </InputGroupButton>\n <InputGroupButton variant=\"ghost\" size=\"icon-xs\" aria-label=\"Copy\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n</div>\n",
|
|
86
86
|
"type": "registry:component"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "src/components/examples/item/item-group.astro",
|
|
33
|
-
"content": "---\nimport PlusIcon from \"@lucide/astro/icons/plus\"\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemTitle,\n} from \"@/components/ui/item\"\n\nconst people = [\n {\n username: \"shadcn\",\n avatar: \"https://github.com/shadcn.png\",\n email: \"shadcn@vercel.com\",\n },\n {\n username: \"maxleiter\",\n avatar: \"https://github.com/maxleiter.png\",\n email: \"maxleiter@vercel.com\",\n },\n {\n username: \"evilrabbit\",\n avatar: \"https://github.com/evilrabbit.png\",\n email: \"evilrabbit@vercel.com\",\n },\n]\n---\n\n<ItemGroup class=\"max-w-sm\">\n {people.map((person) => (\n <Item variant=\"outline\">\n <ItemMedia>\n <Avatar>\n <AvatarImage src={person.avatar} class=\"grayscale\" />\n <AvatarFallback>{person.username.charAt(0)}</AvatarFallback>\n </Avatar>\n </ItemMedia>\n <ItemContent class=\"gap-1\">\n <ItemTitle>{person.username}</ItemTitle>\n <ItemDescription>{person.email}</ItemDescription>\n </ItemContent>\n <ItemActions>\n <Button
|
|
33
|
+
"content": "---\nimport PlusIcon from \"@lucide/astro/icons/plus\"\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemTitle,\n} from \"@/components/ui/item\"\n\nconst people = [\n {\n username: \"shadcn\",\n avatar: \"https://github.com/shadcn.png\",\n email: \"shadcn@vercel.com\",\n },\n {\n username: \"maxleiter\",\n avatar: \"https://github.com/maxleiter.png\",\n email: \"maxleiter@vercel.com\",\n },\n {\n username: \"evilrabbit\",\n avatar: \"https://github.com/evilrabbit.png\",\n email: \"evilrabbit@vercel.com\",\n },\n]\n---\n\n<ItemGroup class=\"max-w-sm\">\n {people.map((person) => (\n <Item variant=\"outline\">\n <ItemMedia>\n <Avatar>\n <AvatarImage src={person.avatar} class=\"grayscale\" />\n <AvatarFallback>{person.username.charAt(0)}</AvatarFallback>\n </Avatar>\n </ItemMedia>\n <ItemContent class=\"gap-1\">\n <ItemTitle>{person.username}</ItemTitle>\n <ItemDescription>{person.email}</ItemDescription>\n </ItemContent>\n <ItemActions>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"rounded-full\"\n aria-label=\"Invite\"\n >\n <PlusIcon />\n </Button>\n </ItemActions>\n </Item>\n ))}\n</ItemGroup>\n",
|
|
34
34
|
"type": "registry:component"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
12
12
|
"path": "src/components/ui/select/select.astro",
|
|
13
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Position, Side } from \"@data-slot/select\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n position?: Position\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n highlightItemOnHover?: boolean\n lockScroll?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n position,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n highlightItemOnHover,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n<div\n data-slot=\"select\"\n data-mount-strategy={mountStrategy}\n data-default-value={defaultValue}\n data-default-open={defaultOpen}\n data-placeholder={placeholder}\n data-disabled={disabled}\n data-required={required}\n data-name={name}\n data-position={position}\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-align-offset={alignOffset}\n data-avoid-collisions={avoidCollisions}\n data-collision-padding={collisionPadding}\n data-highlight-item-on-hover={highlightItemOnHover}\n data-lock-scroll={lockScroll}\n class={cn(\n \"group/select relative inline-flex w-fit flex-col gap-1.5\",\n className\n )}\n {...props}\n>\n <
|
|
13
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Position, Side } from \"@data-slot/select\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n position?: Position\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n highlightItemOnHover?: boolean\n lockScroll?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n position,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n highlightItemOnHover,\n lockScroll,\n ...props\n} = Astro.props\n\n// Show the text Data Slot puts in the SelectValue when it starts: the label of\n// the default item, or the placeholder. Without it the trigger is empty, and\n// has no accessible name, until the script runs.\nconst html = await Astro.slots.render(\"default\")\nconst entities: Record<string, string> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n nbsp: \"\\u00a0\",\n}\nconst decode = (value: string) =>\n value.replace(\n /&(#x?[\\da-f]+|amp|lt|gt|quot|apos|nbsp);/gi,\n (entity, code: string) =>\n code.startsWith(\"#\")\n ? String.fromCodePoint(Number(code.replace(\"#\", \"0\")))\n : (entities[code] ?? entity)\n )\n// Attribute values can hold \">\", as Tailwind classes do.\nconst tags =\n /<!--[\\s\\S]*?-->|<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>|<(\\/?)([a-z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/gi\nconst attributes = (source: string) =>\n [\n ...source.matchAll(/([^\\s\"'>/=]+)(?:\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g),\n ].map(({ 0: text, 1: name, 2: value = \"\", index }) => ({\n name: name.toLowerCase(),\n value: decode(/^[\"']/.test(value) ? value.slice(1, -1) : value),\n index,\n text,\n }))\n// Elements without an end tag.\nconst empty = new Set(\n \"area base br col embed hr img input link meta source track wbr\".split(\" \")\n)\nconst escape = (value: string) =>\n value.replace(/[&<>]/g, (char) => `&#${char.charCodeAt(0)};`)\n\ntype Item = { value?: string; label?: string; text: string; itemText?: string }\nconst items: Item[] = []\nlet trigger: number | undefined\nlet value: { start: number; end?: number; placeholder?: string } | undefined\nconst open: { name: string; item?: Item; itemText?: Item; value?: true }[] = []\nlet last = 0\nfor (const match of html.matchAll(tags)) {\n const { 0: whole, 2: close, 3: tag, 4: source = \"\", index } = match\n const text = html.slice(last, index)\n last = index + whole.length\n for (const element of open) {\n if (element.item) element.item.text += text\n if (element.itemText) element.itemText.itemText += text\n }\n if (!tag) continue\n const name = tag.toLowerCase()\n if (close) {\n const at = open.findLastIndex((element) => element.name === name)\n if (at < 0) continue\n if (value && open.slice(at).some((element) => element.value)) {\n value.end ??= index\n }\n open.length = at\n continue\n }\n const list = attributes(source)\n const get = (key: string) => list.find((item) => item.name === key)?.value\n const slot = get(\"data-slot\")\n const element: (typeof open)[number] = { name }\n if (slot === \"select-item\") {\n element.item = {\n value: get(\"data-value\"),\n label: get(\"data-label\")?.trim(),\n text: \"\",\n }\n items.push(element.item)\n }\n const owner = open.findLast((element) => element.item)?.item\n if (slot === \"select-item-text\" && owner && owner.itemText === undefined) {\n owner.itemText = \"\"\n element.itemText = owner\n }\n if (slot === \"select-trigger\" && get(\"data-placeholder\") === undefined) {\n trigger ??= index + whole.length - 1\n }\n if (slot === \"select-value\" && !value) {\n value = { start: last, placeholder: get(\"data-placeholder\") }\n element.value = true\n }\n if (!empty.has(name) && !source.trimEnd().endsWith(\"/\")) open.push(element)\n}\n\n// The label as Data Slot reads it: data-label, the SelectItemText, the item's\n// text, or else the value itself.\nconst item = items.find((item) => item.value === defaultValue)\nconst plain = (source = \"\") => escape(decode(source).trim())\nconst label =\n defaultValue === undefined\n ? escape(placeholder ?? value?.placeholder ?? \"\")\n : item?.label\n ? escape(item.label)\n : plain(item?.itemText) || plain(item?.text) || escape(defaultValue)\nconst edits: [start: number, end: number, text: string][] = []\nif (value?.end !== undefined && label) {\n if (!html.slice(value.start, value.end).trim()) {\n edits.push([value.start, value.end, label])\n }\n}\nif (defaultValue === undefined && trigger !== undefined) {\n edits.push([trigger, trigger, \" data-placeholder\"])\n}\nlet content = html\nfor (const [start, end, text] of edits.sort(([a], [b]) => b - a)) {\n content = content.slice(0, start) + text + content.slice(end)\n}\n---\n\n<div\n data-slot=\"select\"\n data-mount-strategy={mountStrategy}\n data-default-value={defaultValue}\n data-default-open={defaultOpen}\n data-placeholder={placeholder}\n data-disabled={disabled}\n data-required={required}\n data-name={name}\n data-position={position}\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-align-offset={alignOffset}\n data-avoid-collisions={avoidCollisions}\n data-collision-padding={collisionPadding}\n data-highlight-item-on-hover={highlightItemOnHover}\n data-lock-scroll={lockScroll}\n class={cn(\n \"group/select relative inline-flex w-fit flex-col gap-1.5\",\n className\n )}\n {...props}\n>\n <Fragment set:html={content} />\n</div>\n\n<script>\n import { create } from \"@data-slot/select\"\n\n const controllers: ReturnType<typeof create> = []\n const initialize = () => controllers.push(...create())\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const controller of controllers) controller.destroy()\n controllers.length = 0\n })\n</script>\n",
|
|
14
14
|
"type": "registry:ui"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/tabs/tabs.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n orientation?: \"horizontal\" | \"vertical\"\n activationMode?: \"auto\" | \"manual\"\n}\n\nconst {\n class: className,\n defaultValue,\n orientation = \"horizontal\",\n activationMode,\n ...props\n} = Astro.props\n---\n\n<div\n data-slot=\"tabs\"\n data-default-value={defaultValue}\n data-orientation={orientation}\n data-activation-mode={activationMode}\n data-horizontal={orientation === \"horizontal\" ? \"\" : undefined}\n data-vertical={orientation === \"vertical\" ? \"\" : undefined}\n class={cn(\"gap-2 group/tabs flex data-horizontal:flex-col\", className)}\n {...props}\n>\n <
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n orientation?: \"horizontal\" | \"vertical\"\n activationMode?: \"auto\" | \"manual\"\n}\n\nconst {\n class: className,\n defaultValue,\n orientation = \"horizontal\",\n activationMode,\n ...props\n} = Astro.props\n\n// Show the initial panels in the HTML, the ones Data Slot shows when it\n// starts: those of the default value, or of the first enabled trigger.\n// TabsContent renders hidden, so without this the page shifts when the script\n// starts. Like Data Slot, skip the parts of nested tabs.\nconst html = await Astro.slots.render(\"default\")\nconst entities: Record<string, string> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n nbsp: \"\\u00a0\",\n}\nconst decode = (value: string) =>\n value.replace(\n /&(#x?[\\da-f]+|amp|lt|gt|quot|apos|nbsp);/gi,\n (entity, code: string) =>\n code.startsWith(\"#\")\n ? String.fromCodePoint(Number(code.replace(\"#\", \"0\")))\n : (entities[code] ?? entity)\n )\n// Attribute values can hold \">\", as Tailwind classes do.\nconst tags =\n /<!--[\\s\\S]*?-->|<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>|<(\\/?)([a-z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/gi\nconst attributes = (source: string) =>\n [\n ...source.matchAll(/([^\\s\"'>/=]+)(?:\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g),\n ].map(({ 0: text, 1: name, 2: value = \"\", index }) => ({\n name: name.toLowerCase(),\n value: decode(/^[\"']/.test(value) ? value.slice(1, -1) : value),\n index,\n text,\n }))\n// Elements without an end tag.\nconst empty = new Set(\n \"area base br col embed hr img input link meta source track wbr\".split(\" \")\n)\n\nconst triggers: { value: string; disabled: boolean }[] = []\nconst panels: { value: string; hidden: boolean; start: number; end: number }[] =\n []\nconst open: { name: string; tabs: boolean }[] = []\nfor (const { 2: close, 3: tag, 4: source = \"\", index } of html.matchAll(tags)) {\n if (!tag) continue\n const name = tag.toLowerCase()\n if (close) {\n const at = open.findLastIndex((element) => element.name === name)\n if (at >= 0) open.length = at\n continue\n }\n const list = attributes(source)\n const get = (key: string) => list.find((item) => item.name === key)?.value\n const slot = get(\"data-slot\")\n if (!open.some((element) => element.tabs)) {\n const value = get(\"data-value\")?.trim() ?? \"\"\n if (slot === \"tabs-trigger\" && value) {\n triggers.push({\n value,\n disabled:\n get(\"disabled\") !== undefined ||\n get(\"data-disabled\") !== undefined ||\n get(\"aria-disabled\") === \"true\",\n })\n }\n if (slot === \"tabs-content\" && value) {\n const attribute = list.find((item) => item.name === \"hidden\")\n const start = index + 1 + tag.length + (attribute?.index ?? 0)\n const end = start + (attribute?.text.length ?? 0)\n panels.push({ value, hidden: attribute !== undefined, start, end })\n }\n }\n if (!empty.has(name) && !source.trimEnd().endsWith(\"/\")) {\n open.push({ name, tabs: slot === \"tabs\" })\n }\n}\nconst preferred = triggers.findLast(\n (trigger) => trigger.value === defaultValue?.trim()\n)\nconst initial =\n preferred && !preferred.disabled\n ? preferred.value\n : triggers.find((trigger) => !trigger.disabled)?.value\n// Data Slot shows the panels of the initial value and hides the others.\nlet content = html\nfor (const { value, hidden, start, end } of panels.reverse()) {\n if (initial === undefined || hidden !== (value === initial)) continue\n content =\n content.slice(0, start) + (hidden ? \"\" : \" hidden\") + content.slice(end)\n}\n---\n\n<div\n data-slot=\"tabs\"\n data-default-value={defaultValue}\n data-orientation={orientation}\n data-activation-mode={activationMode}\n data-horizontal={orientation === \"horizontal\" ? \"\" : undefined}\n data-vertical={orientation === \"vertical\" ? \"\" : undefined}\n class={cn(\"gap-2 group/tabs flex data-horizontal:flex-col\", className)}\n {...props}\n>\n <Fragment set:html={content} />\n</div>\n\n<script>\n import { create } from \"@data-slot/tabs\"\n\n const controllers: ReturnType<typeof create> = []\n const initialize = () => controllers.push(...create())\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const controller of controllers) controller.destroy()\n controllers.length = 0\n })\n</script>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/examples/tooltip/tooltip-keyboard.astro",
|
|
27
|
-
"content": "---\nimport SaveIcon from \"@lucide/astro/icons/save\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n---\n\n<Tooltip>\n <TooltipTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon-sm\" })}\n >\n <SaveIcon />\n </TooltipTrigger>\n <TooltipContent>\n Save Changes <Kbd>S</Kbd>\n </TooltipContent>\n</Tooltip>\n",
|
|
27
|
+
"content": "---\nimport SaveIcon from \"@lucide/astro/icons/save\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n---\n\n<Tooltip>\n <TooltipTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon-sm\" })}\n aria-label=\"Save\"\n >\n <SaveIcon />\n </TooltipTrigger>\n <TooltipContent>\n Save Changes <Kbd>S</Kbd>\n </TooltipContent>\n</Tooltip>\n",
|
|
28
28
|
"type": "registry:component"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "src/components/examples/button/button-icon.astro",
|
|
36
|
-
"content": "---\nimport CircleFadingArrowUpIcon from \"@lucide/astro/icons/circle-fading-arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<Button variant=\"outline\" size=\"icon\">\n <CircleFadingArrowUpIcon />\n</Button>\n",
|
|
36
|
+
"content": "---\nimport CircleFadingArrowUpIcon from \"@lucide/astro/icons/circle-fading-arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<Button variant=\"outline\" size=\"icon\" aria-label=\"Upgrade\">\n <CircleFadingArrowUpIcon />\n</Button>\n",
|
|
37
37
|
"type": "registry:component"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"path": "src/components/examples/button/button-rounded.astro",
|
|
56
|
-
"content": "---\nimport ArrowUpIcon from \"@lucide/astro/icons/arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<div class=\"flex gap-2\">\n <Button class=\"rounded-full\">Get Started</Button>\n <Button
|
|
56
|
+
"content": "---\nimport ArrowUpIcon from \"@lucide/astro/icons/arrow-up\"\n\nimport { Button } from \"@/components/ui/button\"\n---\n\n<div class=\"flex gap-2\">\n <Button class=\"rounded-full\">Get Started</Button>\n <Button\n variant=\"outline\"\n size=\"icon\"\n class=\"rounded-full\"\n aria-label=\"Submit\"\n >\n <ArrowUpIcon />\n </Button>\n</div>\n",
|
|
57
57
|
"type": "registry:component"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"path": "src/components/examples/collapsible/collapsible-settings.astro",
|
|
45
|
-
"content": "---\nimport MaximizeIcon from \"@lucide/astro/icons/maximize\"\nimport MinimizeIcon from \"@lucide/astro/icons/minimize\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\nimport { Field, FieldGroup, FieldLabel } from \"@/components/ui/field\"\nimport { Input } from \"@/components/ui/input\"\n---\n\n<Card class=\"mx-auto w-full max-w-xs\" size=\"sm\">\n <CardHeader>\n <CardTitle>Radius</CardTitle>\n <CardDescription>Set the corner radius of the element.</CardDescription>\n </CardHeader>\n <CardContent>\n <Collapsible class=\"flex items-start gap-2\">\n <FieldGroup class=\"grid w-full grid-cols-2 gap-2\">\n <Field>\n <FieldLabel for=\"radius-x\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y\" placeholder=\"0\" value=\"0\" />\n </Field>\n <CollapsibleContent class=\"col-span-full grid grid-cols-subgrid gap-2\">\n <Field>\n <FieldLabel for=\"radius-x-2\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y-2\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n </CollapsibleContent>\n </FieldGroup>\n <CollapsibleTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon\" })}\n >\n <MaximizeIcon class=\"group-aria-expanded/button:hidden\" />\n <MinimizeIcon class=\"hidden group-aria-expanded/button:block\" />\n </CollapsibleTrigger>\n </Collapsible>\n </CardContent>\n</Card>\n",
|
|
45
|
+
"content": "---\nimport MaximizeIcon from \"@lucide/astro/icons/maximize\"\nimport MinimizeIcon from \"@lucide/astro/icons/minimize\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\nimport { Field, FieldGroup, FieldLabel } from \"@/components/ui/field\"\nimport { Input } from \"@/components/ui/input\"\n---\n\n<Card class=\"mx-auto w-full max-w-xs\" size=\"sm\">\n <CardHeader>\n <CardTitle>Radius</CardTitle>\n <CardDescription>Set the corner radius of the element.</CardDescription>\n </CardHeader>\n <CardContent>\n <Collapsible class=\"flex items-start gap-2\">\n <FieldGroup class=\"grid w-full grid-cols-2 gap-2\">\n <Field>\n <FieldLabel for=\"radius-x\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y\" placeholder=\"0\" value=\"0\" />\n </Field>\n <CollapsibleContent class=\"col-span-full grid grid-cols-subgrid gap-2\">\n <Field>\n <FieldLabel for=\"radius-x-2\" class=\"sr-only\">\n Radius X\n </FieldLabel>\n <Input id=\"radius-x-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n <Field>\n <FieldLabel for=\"radius-y-2\" class=\"sr-only\">\n Radius Y\n </FieldLabel>\n <Input id=\"radius-y-2\" placeholder=\"0\" value=\"0\" />\n </Field>\n </CollapsibleContent>\n </FieldGroup>\n <CollapsibleTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon\" })}\n >\n <MaximizeIcon class=\"group-aria-expanded/button:hidden\" />\n <MinimizeIcon class=\"hidden group-aria-expanded/button:block\" />\n <span class=\"sr-only\">Toggle details</span>\n </CollapsibleTrigger>\n </Collapsible>\n </CardContent>\n</Card>\n",
|
|
46
46
|
"type": "registry:component"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "src/components/examples/combobox/combobox-popup.astro",
|
|
63
|
-
"content": "---\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxValue,\n} from \"@/components/ui/combobox\"\n\nconst countries = [\n { code: \"\", value: \"\", continent: \"\", label: \"Select country\" },\n {\n code: \"ar\",\n value: \"argentina\",\n label: \"Argentina\",\n continent: \"South America\",\n },\n { code: \"au\", value: \"australia\", label: \"Australia\", continent: \"Oceania\" },\n { code: \"br\", value: \"brazil\", label: \"Brazil\", continent: \"South America\" },\n { code: \"ca\", value: \"canada\", label: \"Canada\", continent: \"North America\" },\n { code: \"cn\", value: \"china\", label: \"China\", continent: \"Asia\" },\n {\n code: \"co\",\n value: \"colombia\",\n label: \"Colombia\",\n continent: \"South America\",\n },\n { code: \"eg\", value: \"egypt\", label: \"Egypt\", continent: \"Africa\" },\n { code: \"fr\", value: \"france\", label: \"France\", continent: \"Europe\" },\n { code: \"de\", value: \"germany\", label: \"Germany\", continent: \"Europe\" },\n { code: \"it\", value: \"italy\", label: \"Italy\", continent: \"Europe\" },\n { code: \"jp\", value: \"japan\", label: \"Japan\", continent: \"Asia\" },\n { code: \"ke\", value: \"kenya\", label: \"Kenya\", continent: \"Africa\" },\n { code: \"mx\", value: \"mexico\", label: \"Mexico\", continent: \"North America\" },\n {\n code: \"nz\",\n value: \"new-zealand\",\n label: \"New Zealand\",\n continent: \"Oceania\",\n },\n { code: \"ng\", value: \"nigeria\", label: \"Nigeria\", continent: \"Africa\" },\n {\n code: \"za\",\n value: \"south-africa\",\n label: \"South Africa\",\n continent: \"Africa\",\n },\n { code: \"kr\", value: \"south-korea\", label: \"South Korea\", continent: \"Asia\" },\n {\n code: \"gb\",\n value: \"united-kingdom\",\n label: \"United Kingdom\",\n continent: \"Europe\",\n },\n {\n code: \"us\",\n value: \"united-states\",\n label: \"United States\",\n continent: \"North America\",\n },\n]\n---\n\n<Combobox defaultValue={countries[0].value}>\n <Button\n variant=\"outline\"\n data-slot=\"combobox-trigger\"\n class=\"[&_svg:not([class*='size-'])]:size-3.5 w-64 justify-between font-normal\"\n >\n <ComboboxValue
|
|
63
|
+
"content": "---\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxValue,\n} from \"@/components/ui/combobox\"\n\nconst countries = [\n { code: \"\", value: \"\", continent: \"\", label: \"Select country\" },\n {\n code: \"ar\",\n value: \"argentina\",\n label: \"Argentina\",\n continent: \"South America\",\n },\n { code: \"au\", value: \"australia\", label: \"Australia\", continent: \"Oceania\" },\n { code: \"br\", value: \"brazil\", label: \"Brazil\", continent: \"South America\" },\n { code: \"ca\", value: \"canada\", label: \"Canada\", continent: \"North America\" },\n { code: \"cn\", value: \"china\", label: \"China\", continent: \"Asia\" },\n {\n code: \"co\",\n value: \"colombia\",\n label: \"Colombia\",\n continent: \"South America\",\n },\n { code: \"eg\", value: \"egypt\", label: \"Egypt\", continent: \"Africa\" },\n { code: \"fr\", value: \"france\", label: \"France\", continent: \"Europe\" },\n { code: \"de\", value: \"germany\", label: \"Germany\", continent: \"Europe\" },\n { code: \"it\", value: \"italy\", label: \"Italy\", continent: \"Europe\" },\n { code: \"jp\", value: \"japan\", label: \"Japan\", continent: \"Asia\" },\n { code: \"ke\", value: \"kenya\", label: \"Kenya\", continent: \"Africa\" },\n { code: \"mx\", value: \"mexico\", label: \"Mexico\", continent: \"North America\" },\n {\n code: \"nz\",\n value: \"new-zealand\",\n label: \"New Zealand\",\n continent: \"Oceania\",\n },\n { code: \"ng\", value: \"nigeria\", label: \"Nigeria\", continent: \"Africa\" },\n {\n code: \"za\",\n value: \"south-africa\",\n label: \"South Africa\",\n continent: \"Africa\",\n },\n { code: \"kr\", value: \"south-korea\", label: \"South Korea\", continent: \"Asia\" },\n {\n code: \"gb\",\n value: \"united-kingdom\",\n label: \"United Kingdom\",\n continent: \"Europe\",\n },\n {\n code: \"us\",\n value: \"united-states\",\n label: \"United States\",\n continent: \"North America\",\n },\n]\n---\n\n<Combobox defaultValue={countries[0].value}>\n <Button\n variant=\"outline\"\n data-slot=\"combobox-trigger\"\n class=\"[&_svg:not([class*='size-'])]:size-3.5 w-64 justify-between font-normal\"\n >\n <ComboboxValue>{countries[0].label}</ComboboxValue>\n <ChevronDownIcon class=\"text-muted-foreground size-3.5 pointer-events-none\" />\n </Button>\n <ComboboxContent>\n <ComboboxInput showTrigger={false} placeholder=\"Search\" />\n <ComboboxList>\n <ComboboxEmpty>No items found.</ComboboxEmpty>\n {countries.map((item) => (\n <ComboboxItem value={item.value}>{item.label}</ComboboxItem>\n ))}\n </ComboboxList>\n </ComboboxContent>\n</Combobox>\n",
|
|
64
64
|
"type": "registry:component"
|
|
65
65
|
}
|
|
66
66
|
],
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"path": "src/components/ui/combobox/combobox-trigger.astro",
|
|
62
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { cn } from \"@/lib/utils\"\nimport { InputGroupButton } from \"@/components/ui/input-group\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n showIcon?: boolean\n}\n\nconst {\n class: className,\n type = \"button\",\n showIcon = true,\n ...props\n} = Astro.props\n---\n\n<InputGroupButton\n type={type ?? \"button\"}\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"combobox-trigger\"\n class={cn(\"[&_svg]:text-muted-foreground\", className)}\n {...props}\n>\n <slot />\n {showIcon && (\n <ChevronDownIcon class=\"text-muted-foreground size-3.5 pointer-events-none\" />\n )}\n</InputGroupButton>\n",
|
|
62
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\n\nimport { cn } from \"@/lib/utils\"\nimport { InputGroupButton } from \"@/components/ui/input-group\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n showIcon?: boolean\n}\n\nconst {\n class: className,\n type = \"button\",\n showIcon = true,\n ...props\n} = Astro.props\n\n// Data Slot names the trigger \"Toggle\" when it starts. Name it the same in the\n// HTML, so it has a name before the script runs.\n---\n\n<InputGroupButton\n type={type ?? \"button\"}\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"combobox-trigger\"\n class={cn(\"[&_svg]:text-muted-foreground\", className)}\n aria-label=\"Toggle\"\n {...props}\n>\n <slot />\n {showIcon && (\n <ChevronDownIcon class=\"text-muted-foreground size-3.5 pointer-events-none\" />\n )}\n</InputGroupButton>\n",
|
|
63
63
|
"type": "registry:ui"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "src/components/examples/input-group/input-group-button.astro",
|
|
30
|
-
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"@/components/ui/input-group\"\nimport { Popover, PopoverContent } from \"@/components/ui/popover\"\n---\n\n<div class=\"grid w-full max-w-sm gap-6\" data-input-group-button-example>\n <InputGroup>\n <InputGroupInput placeholder=\"https://x.com/shadcn\" readonly />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n aria-label=\"Copy\"\n title=\"Copy\"\n size=\"icon-xs\"\n data-copy-value=\"https://x.com/shadcn\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-check hidden\"\n data-copied-icon\n >\n <path d=\"M5 12l5 5l10 -10\"></path>\n </svg>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n data-copy-icon\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n <InputGroup class=\"[--radius:9999px]\">\n <InputGroupAddon>\n <Popover>\n <InputGroupButton\n data-slot=\"popover-trigger\"\n variant=\"secondary\"\n size=\"icon-xs\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-info-circle\"\n >\n <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\"></path>\n <path d=\"M12 9h.01\"></path>\n <path d=\"M11 12h1v4h1\"></path>\n </svg>\n </InputGroupButton>\n <PopoverContent\n align=\"start\"\n class=\"flex flex-col gap-1 rounded-xl text-sm\"\n >\n <p class=\"font-medium\">Your connection is not secure.</p>\n <p>You should not enter any sensitive information on this site.</p>\n </PopoverContent>\n </Popover>\n </InputGroupAddon>\n <InputGroupAddon class=\"pl-1.5 text-muted-foreground\">\n https://\n </InputGroupAddon>\n <InputGroupInput id=\"input-secure-19\" />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton
|
|
30
|
+
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"@/components/ui/input-group\"\nimport { Popover, PopoverContent } from \"@/components/ui/popover\"\n---\n\n<div class=\"grid w-full max-w-sm gap-6\" data-input-group-button-example>\n <InputGroup>\n <InputGroupInput placeholder=\"https://x.com/shadcn\" readonly />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n aria-label=\"Copy\"\n title=\"Copy\"\n size=\"icon-xs\"\n data-copy-value=\"https://x.com/shadcn\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-check hidden\"\n data-copied-icon\n >\n <path d=\"M5 12l5 5l10 -10\"></path>\n </svg>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n data-copy-icon\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n <InputGroup class=\"[--radius:9999px]\">\n <InputGroupAddon>\n <Popover>\n <InputGroupButton\n data-slot=\"popover-trigger\"\n variant=\"secondary\"\n size=\"icon-xs\"\n aria-label=\"Info\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-info-circle\"\n >\n <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\"></path>\n <path d=\"M12 9h.01\"></path>\n <path d=\"M11 12h1v4h1\"></path>\n </svg>\n </InputGroupButton>\n <PopoverContent\n align=\"start\"\n class=\"flex flex-col gap-1 rounded-xl text-sm\"\n >\n <p class=\"font-medium\">Your connection is not secure.</p>\n <p>You should not enter any sensitive information on this site.</p>\n </PopoverContent>\n </Popover>\n </InputGroupAddon>\n <InputGroupAddon class=\"pl-1.5 text-muted-foreground\">\n https://\n </InputGroupAddon>\n <InputGroupInput id=\"input-secure-19\" />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n size=\"icon-xs\"\n aria-label=\"Favorite\"\n data-favorite-toggle\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-star data-[favorite=true]:fill-blue-600 data-[favorite=true]:stroke-blue-600\"\n data-favorite=\"false\"\n >\n <path d=\"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n <InputGroup>\n <InputGroupInput placeholder=\"Type to search...\" />\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton variant=\"secondary\">Search</InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n</div>\n\n<script>\n const initialize = () => {\n for (const root of document.querySelectorAll<HTMLElement>(\n \"[data-input-group-button-example]\"\n )) {\n if (root.hasAttribute(\"data-bound\")) continue\n root.setAttribute(\"data-bound\", \"\")\n\n const copy = root.querySelector<HTMLElement>(\"[data-copy-value]\")!\n const copyIcon = copy.querySelector(\"[data-copy-icon]\")!\n const copiedIcon = copy.querySelector(\"[data-copied-icon]\")!\n let timeout: ReturnType<typeof setTimeout> | undefined\n const setCopied = (copied: boolean) => {\n copiedIcon.classList.toggle(\"hidden\", !copied)\n copyIcon.classList.toggle(\"hidden\", copied)\n }\n copy.addEventListener(\"click\", async () => {\n try {\n await navigator.clipboard.writeText(copy.dataset.copyValue!)\n } catch {\n return\n }\n setCopied(true)\n clearTimeout(timeout)\n timeout = setTimeout(() => setCopied(false), 2000)\n })\n\n const favorite = root.querySelector(\"[data-favorite-toggle]\")!\n const star = favorite.querySelector<SVGElement>(\"[data-favorite]\")!\n favorite.addEventListener(\"click\", () => {\n star.dataset.favorite = String(star.dataset.favorite !== \"true\")\n })\n }\n }\n\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n</script>\n",
|
|
31
31
|
"type": "registry:component"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"path": "src/components/examples/input-group/input-group-textarea.astro",
|
|
85
|
-
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupTextarea,\n} from \"@/components/ui/input-group\"\n---\n\n<div class=\"grid w-full max-w-md gap-4\">\n <InputGroup>\n <InputGroupTextarea\n id=\"textarea-code-32\"\n placeholder=\"console.log('Hello, world!');\"\n class=\"min-h-[200px]\"\n />\n <InputGroupAddon align=\"block-end\" class=\"border-t\">\n <InputGroupText>Line 1, Column 1</InputGroupText>\n <InputGroupButton size=\"sm\" class=\"ml-auto\" variant=\"default\">\n Run\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-corner-down-left\"\n >\n <path d=\"M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n <InputGroupAddon align=\"block-start\" class=\"border-b\">\n <InputGroupText class=\"font-mono font-medium\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-brand-javascript\"\n >\n <path d=\"M20 4l-2 14.5l-6 2l-6 -2l-2 -14.5l16 0\"></path>\n <path d=\"M7.5 8h3v8l-2 -1\"></path>\n <path d=\"M16.5 8h-2.5a.5 .5 0 0 0 -.5 .5v3a.5 .5 0 0 0 .5 .5h1.423a.5 .5 0 0 1 .495 .57l-.418 2.93l-2 .5\"></path>\n </svg>\n script.js\n </InputGroupText>\n <InputGroupButton class=\"ml-auto\" size=\"icon-xs\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-refresh\"\n >\n <path d=\"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4\"></path>\n <path d=\"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4\"></path>\n </svg>\n </InputGroupButton>\n <InputGroupButton variant=\"ghost\" size=\"icon-xs\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n</div>\n",
|
|
85
|
+
"content": "---\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupTextarea,\n} from \"@/components/ui/input-group\"\n---\n\n<div class=\"grid w-full max-w-md gap-4\">\n <InputGroup>\n <InputGroupTextarea\n id=\"textarea-code-32\"\n placeholder=\"console.log('Hello, world!');\"\n class=\"min-h-[200px]\"\n />\n <InputGroupAddon align=\"block-end\" class=\"border-t\">\n <InputGroupText>Line 1, Column 1</InputGroupText>\n <InputGroupButton size=\"sm\" class=\"ml-auto\" variant=\"default\">\n Run\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-corner-down-left\"\n >\n <path d=\"M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n <InputGroupAddon align=\"block-start\" class=\"border-b\">\n <InputGroupText class=\"font-mono font-medium\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-brand-javascript\"\n >\n <path d=\"M20 4l-2 14.5l-6 2l-6 -2l-2 -14.5l16 0\"></path>\n <path d=\"M7.5 8h3v8l-2 -1\"></path>\n <path d=\"M16.5 8h-2.5a.5 .5 0 0 0 -.5 .5v3a.5 .5 0 0 0 .5 .5h1.423a.5 .5 0 0 1 .495 .57l-.418 2.93l-2 .5\"></path>\n </svg>\n script.js\n </InputGroupText>\n <InputGroupButton class=\"ml-auto\" size=\"icon-xs\" aria-label=\"Refresh\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-refresh\"\n >\n <path d=\"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4\"></path>\n <path d=\"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4\"></path>\n </svg>\n </InputGroupButton>\n <InputGroupButton variant=\"ghost\" size=\"icon-xs\" aria-label=\"Copy\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"tabler-icon tabler-icon-copy\"\n >\n <path d=\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\"></path>\n <path d=\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\"></path>\n </svg>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n</div>\n",
|
|
86
86
|
"type": "registry:component"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "src/components/examples/item/item-group.astro",
|
|
33
|
-
"content": "---\nimport PlusIcon from \"@lucide/astro/icons/plus\"\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemTitle,\n} from \"@/components/ui/item\"\n\nconst people = [\n {\n username: \"shadcn\",\n avatar: \"https://github.com/shadcn.png\",\n email: \"shadcn@vercel.com\",\n },\n {\n username: \"maxleiter\",\n avatar: \"https://github.com/maxleiter.png\",\n email: \"maxleiter@vercel.com\",\n },\n {\n username: \"evilrabbit\",\n avatar: \"https://github.com/evilrabbit.png\",\n email: \"evilrabbit@vercel.com\",\n },\n]\n---\n\n<ItemGroup class=\"max-w-sm\">\n {people.map((person) => (\n <Item variant=\"outline\">\n <ItemMedia>\n <Avatar>\n <AvatarImage src={person.avatar} class=\"grayscale\" />\n <AvatarFallback>{person.username.charAt(0)}</AvatarFallback>\n </Avatar>\n </ItemMedia>\n <ItemContent class=\"gap-1\">\n <ItemTitle>{person.username}</ItemTitle>\n <ItemDescription>{person.email}</ItemDescription>\n </ItemContent>\n <ItemActions>\n <Button
|
|
33
|
+
"content": "---\nimport PlusIcon from \"@lucide/astro/icons/plus\"\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemTitle,\n} from \"@/components/ui/item\"\n\nconst people = [\n {\n username: \"shadcn\",\n avatar: \"https://github.com/shadcn.png\",\n email: \"shadcn@vercel.com\",\n },\n {\n username: \"maxleiter\",\n avatar: \"https://github.com/maxleiter.png\",\n email: \"maxleiter@vercel.com\",\n },\n {\n username: \"evilrabbit\",\n avatar: \"https://github.com/evilrabbit.png\",\n email: \"evilrabbit@vercel.com\",\n },\n]\n---\n\n<ItemGroup class=\"max-w-sm\">\n {people.map((person) => (\n <Item variant=\"outline\">\n <ItemMedia>\n <Avatar>\n <AvatarImage src={person.avatar} class=\"grayscale\" />\n <AvatarFallback>{person.username.charAt(0)}</AvatarFallback>\n </Avatar>\n </ItemMedia>\n <ItemContent class=\"gap-1\">\n <ItemTitle>{person.username}</ItemTitle>\n <ItemDescription>{person.email}</ItemDescription>\n </ItemContent>\n <ItemActions>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"rounded-full\"\n aria-label=\"Invite\"\n >\n <PlusIcon />\n </Button>\n </ItemActions>\n </Item>\n ))}\n</ItemGroup>\n",
|
|
34
34
|
"type": "registry:component"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
12
12
|
"path": "src/components/ui/select/select.astro",
|
|
13
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Position, Side } from \"@data-slot/select\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n position?: Position\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n highlightItemOnHover?: boolean\n lockScroll?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n position,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n highlightItemOnHover,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n<div\n data-slot=\"select\"\n data-mount-strategy={mountStrategy}\n data-default-value={defaultValue}\n data-default-open={defaultOpen}\n data-placeholder={placeholder}\n data-disabled={disabled}\n data-required={required}\n data-name={name}\n data-position={position}\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-align-offset={alignOffset}\n data-avoid-collisions={avoidCollisions}\n data-collision-padding={collisionPadding}\n data-highlight-item-on-hover={highlightItemOnHover}\n data-lock-scroll={lockScroll}\n class={cn(\n \"group/select relative inline-flex w-fit flex-col gap-1.5\",\n className\n )}\n {...props}\n>\n <
|
|
13
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Position, Side } from \"@data-slot/select\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n position?: Position\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n highlightItemOnHover?: boolean\n lockScroll?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n position,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n highlightItemOnHover,\n lockScroll,\n ...props\n} = Astro.props\n\n// Show the text Data Slot puts in the SelectValue when it starts: the label of\n// the default item, or the placeholder. Without it the trigger is empty, and\n// has no accessible name, until the script runs.\nconst html = await Astro.slots.render(\"default\")\nconst entities: Record<string, string> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n nbsp: \"\\u00a0\",\n}\nconst decode = (value: string) =>\n value.replace(\n /&(#x?[\\da-f]+|amp|lt|gt|quot|apos|nbsp);/gi,\n (entity, code: string) =>\n code.startsWith(\"#\")\n ? String.fromCodePoint(Number(code.replace(\"#\", \"0\")))\n : (entities[code] ?? entity)\n )\n// Attribute values can hold \">\", as Tailwind classes do.\nconst tags =\n /<!--[\\s\\S]*?-->|<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>|<(\\/?)([a-z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/gi\nconst attributes = (source: string) =>\n [\n ...source.matchAll(/([^\\s\"'>/=]+)(?:\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g),\n ].map(({ 0: text, 1: name, 2: value = \"\", index }) => ({\n name: name.toLowerCase(),\n value: decode(/^[\"']/.test(value) ? value.slice(1, -1) : value),\n index,\n text,\n }))\n// Elements without an end tag.\nconst empty = new Set(\n \"area base br col embed hr img input link meta source track wbr\".split(\" \")\n)\nconst escape = (value: string) =>\n value.replace(/[&<>]/g, (char) => `&#${char.charCodeAt(0)};`)\n\ntype Item = { value?: string; label?: string; text: string; itemText?: string }\nconst items: Item[] = []\nlet trigger: number | undefined\nlet value: { start: number; end?: number; placeholder?: string } | undefined\nconst open: { name: string; item?: Item; itemText?: Item; value?: true }[] = []\nlet last = 0\nfor (const match of html.matchAll(tags)) {\n const { 0: whole, 2: close, 3: tag, 4: source = \"\", index } = match\n const text = html.slice(last, index)\n last = index + whole.length\n for (const element of open) {\n if (element.item) element.item.text += text\n if (element.itemText) element.itemText.itemText += text\n }\n if (!tag) continue\n const name = tag.toLowerCase()\n if (close) {\n const at = open.findLastIndex((element) => element.name === name)\n if (at < 0) continue\n if (value && open.slice(at).some((element) => element.value)) {\n value.end ??= index\n }\n open.length = at\n continue\n }\n const list = attributes(source)\n const get = (key: string) => list.find((item) => item.name === key)?.value\n const slot = get(\"data-slot\")\n const element: (typeof open)[number] = { name }\n if (slot === \"select-item\") {\n element.item = {\n value: get(\"data-value\"),\n label: get(\"data-label\")?.trim(),\n text: \"\",\n }\n items.push(element.item)\n }\n const owner = open.findLast((element) => element.item)?.item\n if (slot === \"select-item-text\" && owner && owner.itemText === undefined) {\n owner.itemText = \"\"\n element.itemText = owner\n }\n if (slot === \"select-trigger\" && get(\"data-placeholder\") === undefined) {\n trigger ??= index + whole.length - 1\n }\n if (slot === \"select-value\" && !value) {\n value = { start: last, placeholder: get(\"data-placeholder\") }\n element.value = true\n }\n if (!empty.has(name) && !source.trimEnd().endsWith(\"/\")) open.push(element)\n}\n\n// The label as Data Slot reads it: data-label, the SelectItemText, the item's\n// text, or else the value itself.\nconst item = items.find((item) => item.value === defaultValue)\nconst plain = (source = \"\") => escape(decode(source).trim())\nconst label =\n defaultValue === undefined\n ? escape(placeholder ?? value?.placeholder ?? \"\")\n : item?.label\n ? escape(item.label)\n : plain(item?.itemText) || plain(item?.text) || escape(defaultValue)\nconst edits: [start: number, end: number, text: string][] = []\nif (value?.end !== undefined && label) {\n if (!html.slice(value.start, value.end).trim()) {\n edits.push([value.start, value.end, label])\n }\n}\nif (defaultValue === undefined && trigger !== undefined) {\n edits.push([trigger, trigger, \" data-placeholder\"])\n}\nlet content = html\nfor (const [start, end, text] of edits.sort(([a], [b]) => b - a)) {\n content = content.slice(0, start) + text + content.slice(end)\n}\n---\n\n<div\n data-slot=\"select\"\n data-mount-strategy={mountStrategy}\n data-default-value={defaultValue}\n data-default-open={defaultOpen}\n data-placeholder={placeholder}\n data-disabled={disabled}\n data-required={required}\n data-name={name}\n data-position={position}\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-align-offset={alignOffset}\n data-avoid-collisions={avoidCollisions}\n data-collision-padding={collisionPadding}\n data-highlight-item-on-hover={highlightItemOnHover}\n data-lock-scroll={lockScroll}\n class={cn(\n \"group/select relative inline-flex w-fit flex-col gap-1.5\",\n className\n )}\n {...props}\n>\n <Fragment set:html={content} />\n</div>\n\n<script>\n import { create } from \"@data-slot/select\"\n\n const controllers: ReturnType<typeof create> = []\n const initialize = () => controllers.push(...create())\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const controller of controllers) controller.destroy()\n controllers.length = 0\n })\n</script>\n",
|
|
14
14
|
"type": "registry:ui"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/tabs/tabs.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n orientation?: \"horizontal\" | \"vertical\"\n activationMode?: \"auto\" | \"manual\"\n}\n\nconst {\n class: className,\n defaultValue,\n orientation = \"horizontal\",\n activationMode,\n ...props\n} = Astro.props\n---\n\n<div\n data-slot=\"tabs\"\n data-default-value={defaultValue}\n data-orientation={orientation}\n data-activation-mode={activationMode}\n data-horizontal={orientation === \"horizontal\" ? \"\" : undefined}\n data-vertical={orientation === \"vertical\" ? \"\" : undefined}\n class={cn(\"gap-2 group/tabs flex data-horizontal:flex-col\", className)}\n {...props}\n>\n <
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n orientation?: \"horizontal\" | \"vertical\"\n activationMode?: \"auto\" | \"manual\"\n}\n\nconst {\n class: className,\n defaultValue,\n orientation = \"horizontal\",\n activationMode,\n ...props\n} = Astro.props\n\n// Show the initial panels in the HTML, the ones Data Slot shows when it\n// starts: those of the default value, or of the first enabled trigger.\n// TabsContent renders hidden, so without this the page shifts when the script\n// starts. Like Data Slot, skip the parts of nested tabs.\nconst html = await Astro.slots.render(\"default\")\nconst entities: Record<string, string> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n nbsp: \"\\u00a0\",\n}\nconst decode = (value: string) =>\n value.replace(\n /&(#x?[\\da-f]+|amp|lt|gt|quot|apos|nbsp);/gi,\n (entity, code: string) =>\n code.startsWith(\"#\")\n ? String.fromCodePoint(Number(code.replace(\"#\", \"0\")))\n : (entities[code] ?? entity)\n )\n// Attribute values can hold \">\", as Tailwind classes do.\nconst tags =\n /<!--[\\s\\S]*?-->|<(script|style|textarea)\\b[\\s\\S]*?<\\/\\1\\s*>|<(\\/?)([a-z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/gi\nconst attributes = (source: string) =>\n [\n ...source.matchAll(/([^\\s\"'>/=]+)(?:\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g),\n ].map(({ 0: text, 1: name, 2: value = \"\", index }) => ({\n name: name.toLowerCase(),\n value: decode(/^[\"']/.test(value) ? value.slice(1, -1) : value),\n index,\n text,\n }))\n// Elements without an end tag.\nconst empty = new Set(\n \"area base br col embed hr img input link meta source track wbr\".split(\" \")\n)\n\nconst triggers: { value: string; disabled: boolean }[] = []\nconst panels: { value: string; hidden: boolean; start: number; end: number }[] =\n []\nconst open: { name: string; tabs: boolean }[] = []\nfor (const { 2: close, 3: tag, 4: source = \"\", index } of html.matchAll(tags)) {\n if (!tag) continue\n const name = tag.toLowerCase()\n if (close) {\n const at = open.findLastIndex((element) => element.name === name)\n if (at >= 0) open.length = at\n continue\n }\n const list = attributes(source)\n const get = (key: string) => list.find((item) => item.name === key)?.value\n const slot = get(\"data-slot\")\n if (!open.some((element) => element.tabs)) {\n const value = get(\"data-value\")?.trim() ?? \"\"\n if (slot === \"tabs-trigger\" && value) {\n triggers.push({\n value,\n disabled:\n get(\"disabled\") !== undefined ||\n get(\"data-disabled\") !== undefined ||\n get(\"aria-disabled\") === \"true\",\n })\n }\n if (slot === \"tabs-content\" && value) {\n const attribute = list.find((item) => item.name === \"hidden\")\n const start = index + 1 + tag.length + (attribute?.index ?? 0)\n const end = start + (attribute?.text.length ?? 0)\n panels.push({ value, hidden: attribute !== undefined, start, end })\n }\n }\n if (!empty.has(name) && !source.trimEnd().endsWith(\"/\")) {\n open.push({ name, tabs: slot === \"tabs\" })\n }\n}\nconst preferred = triggers.findLast(\n (trigger) => trigger.value === defaultValue?.trim()\n)\nconst initial =\n preferred && !preferred.disabled\n ? preferred.value\n : triggers.find((trigger) => !trigger.disabled)?.value\n// Data Slot shows the panels of the initial value and hides the others.\nlet content = html\nfor (const { value, hidden, start, end } of panels.reverse()) {\n if (initial === undefined || hidden !== (value === initial)) continue\n content =\n content.slice(0, start) + (hidden ? \"\" : \" hidden\") + content.slice(end)\n}\n---\n\n<div\n data-slot=\"tabs\"\n data-default-value={defaultValue}\n data-orientation={orientation}\n data-activation-mode={activationMode}\n data-horizontal={orientation === \"horizontal\" ? \"\" : undefined}\n data-vertical={orientation === \"vertical\" ? \"\" : undefined}\n class={cn(\"gap-2 group/tabs flex data-horizontal:flex-col\", className)}\n {...props}\n>\n <Fragment set:html={content} />\n</div>\n\n<script>\n import { create } from \"@data-slot/tabs\"\n\n const controllers: ReturnType<typeof create> = []\n const initialize = () => controllers.push(...create())\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const controller of controllers) controller.destroy()\n controllers.length = 0\n })\n</script>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/examples/tooltip/tooltip-keyboard.astro",
|
|
27
|
-
"content": "---\nimport SaveIcon from \"@lucide/astro/icons/save\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n---\n\n<Tooltip>\n <TooltipTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon-sm\" })}\n >\n <SaveIcon />\n </TooltipTrigger>\n <TooltipContent>\n Save Changes <Kbd>S</Kbd>\n </TooltipContent>\n</Tooltip>\n",
|
|
27
|
+
"content": "---\nimport SaveIcon from \"@lucide/astro/icons/save\"\n\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n---\n\n<Tooltip>\n <TooltipTrigger\n class={buttonVariants({ variant: \"outline\", size: \"icon-sm\" })}\n aria-label=\"Save\"\n >\n <SaveIcon />\n </TooltipTrigger>\n <TooltipContent>\n Save Changes <Kbd>S</Kbd>\n </TooltipContent>\n</Tooltip>\n",
|
|
28
28
|
"type": "registry:component"
|
|
29
29
|
},
|
|
30
30
|
{
|