From 6f8b6aaed10739d3f296d6708d4a59ebb7edff67 Mon Sep 17 00:00:00 2001 From: Sil Date: Mon, 26 Oct 2026 12:19:04 +0100 Subject: [PATCH] Start Data Slot components with their page script Dialog, Sheet and NavigationMenu import their controller statically and call create(), as the other Data Slot components do, instead of loading it per media query. The on-media helper, src/lib/dialog.ts, the on-media registry item and the responsive activation docs are removed. `media` stays on the three components as a deprecated prop with no effect, so installs that pass it still type-check. Header blocks keep `fold` and close their sheet or navigation menu when the layout hides it at that breakpoint, which also releases the scroll lock. Every Data Slot component also binds new roots on astro:after-swap, before a site's own astro:page-load listeners run after ClientRouter navigation; create() skips roots that are already bound. All eight styles are regenerated. Liquid and the published @data-slot ^1.1.2 dependencies are unchanged. Co-Authored-By: Claude Opus 5.5 --- .changeset/static-data-slot-scripts.md | 5 + public/r/styles/base-luma/accordion.json | 2 +- public/r/styles/base-luma/alert-dialog.json | 2 +- public/r/styles/base-luma/collapsible.json | 2 +- public/r/styles/base-luma/combobox.json | 2 +- public/r/styles/base-luma/command.json | 2 +- public/r/styles/base-luma/dialog.json | 10 +- public/r/styles/base-luma/drawer.json | 2 +- public/r/styles/base-luma/dropdown-menu.json | 2 +- public/r/styles/base-luma/header-1.json | 2 +- public/r/styles/base-luma/header-2.json | 2 +- public/r/styles/base-luma/header-3.json | 2 +- public/r/styles/base-luma/header-4.json | 2 +- public/r/styles/base-luma/header-5.json | 2 +- public/r/styles/base-luma/hover-card.json | 2 +- .../r/styles/base-luma/navigation-menu.json | 5 +- public/r/styles/base-luma/on-media.json | 14 - public/r/styles/base-luma/popover.json | 2 +- public/r/styles/base-luma/radio-group.json | 2 +- public/r/styles/base-luma/registry.json | 22 +- public/r/styles/base-luma/resizable.json | 2 +- public/r/styles/base-luma/select.json | 2 +- public/r/styles/base-luma/sheet.json | 2 +- public/r/styles/base-luma/slider.json | 2 +- public/r/styles/base-luma/switch.json | 2 +- public/r/styles/base-luma/tabs.json | 2 +- public/r/styles/base-luma/toast.json | 2 +- public/r/styles/base-luma/toggle-group.json | 2 +- public/r/styles/base-luma/toggle.json | 2 +- public/r/styles/base-luma/tooltip.json | 2 +- public/r/styles/base-lyra/accordion.json | 2 +- public/r/styles/base-lyra/alert-dialog.json | 2 +- public/r/styles/base-lyra/collapsible.json | 2 +- public/r/styles/base-lyra/combobox.json | 2 +- public/r/styles/base-lyra/command.json | 2 +- public/r/styles/base-lyra/dialog.json | 10 +- public/r/styles/base-lyra/drawer.json | 2 +- public/r/styles/base-lyra/dropdown-menu.json | 2 +- public/r/styles/base-lyra/header-1.json | 2 +- public/r/styles/base-lyra/header-2.json | 2 +- public/r/styles/base-lyra/header-3.json | 2 +- public/r/styles/base-lyra/header-4.json | 2 +- public/r/styles/base-lyra/header-5.json | 2 +- public/r/styles/base-lyra/hover-card.json | 2 +- .../r/styles/base-lyra/navigation-menu.json | 5 +- public/r/styles/base-lyra/on-media.json | 14 - public/r/styles/base-lyra/popover.json | 2 +- public/r/styles/base-lyra/radio-group.json | 2 +- public/r/styles/base-lyra/registry.json | 22 +- public/r/styles/base-lyra/resizable.json | 2 +- public/r/styles/base-lyra/select.json | 2 +- public/r/styles/base-lyra/sheet.json | 2 +- public/r/styles/base-lyra/slider.json | 2 +- public/r/styles/base-lyra/switch.json | 2 +- public/r/styles/base-lyra/tabs.json | 2 +- public/r/styles/base-lyra/toast.json | 2 +- public/r/styles/base-lyra/toggle-group.json | 2 +- public/r/styles/base-lyra/toggle.json | 2 +- public/r/styles/base-lyra/tooltip.json | 2 +- public/r/styles/base-maia/accordion.json | 2 +- public/r/styles/base-maia/alert-dialog.json | 2 +- public/r/styles/base-maia/collapsible.json | 2 +- public/r/styles/base-maia/combobox.json | 2 +- public/r/styles/base-maia/command.json | 2 +- public/r/styles/base-maia/dialog.json | 10 +- public/r/styles/base-maia/drawer.json | 2 +- public/r/styles/base-maia/dropdown-menu.json | 2 +- public/r/styles/base-maia/header-1.json | 2 +- public/r/styles/base-maia/header-2.json | 2 +- public/r/styles/base-maia/header-3.json | 2 +- public/r/styles/base-maia/header-4.json | 2 +- public/r/styles/base-maia/header-5.json | 2 +- public/r/styles/base-maia/hover-card.json | 2 +- .../r/styles/base-maia/navigation-menu.json | 5 +- public/r/styles/base-maia/on-media.json | 14 - public/r/styles/base-maia/popover.json | 2 +- public/r/styles/base-maia/radio-group.json | 2 +- public/r/styles/base-maia/registry.json | 22 +- public/r/styles/base-maia/resizable.json | 2 +- public/r/styles/base-maia/select.json | 2 +- public/r/styles/base-maia/sheet.json | 2 +- public/r/styles/base-maia/slider.json | 2 +- public/r/styles/base-maia/switch.json | 2 +- public/r/styles/base-maia/tabs.json | 2 +- public/r/styles/base-maia/toast.json | 2 +- public/r/styles/base-maia/toggle-group.json | 2 +- public/r/styles/base-maia/toggle.json | 2 +- public/r/styles/base-maia/tooltip.json | 2 +- public/r/styles/base-mira/accordion.json | 2 +- public/r/styles/base-mira/alert-dialog.json | 2 +- public/r/styles/base-mira/collapsible.json | 2 +- public/r/styles/base-mira/combobox.json | 2 +- public/r/styles/base-mira/command.json | 2 +- public/r/styles/base-mira/dialog.json | 10 +- public/r/styles/base-mira/drawer.json | 2 +- public/r/styles/base-mira/dropdown-menu.json | 2 +- public/r/styles/base-mira/header-1.json | 2 +- public/r/styles/base-mira/header-2.json | 2 +- public/r/styles/base-mira/header-3.json | 2 +- public/r/styles/base-mira/header-4.json | 2 +- public/r/styles/base-mira/header-5.json | 2 +- public/r/styles/base-mira/hover-card.json | 2 +- .../r/styles/base-mira/navigation-menu.json | 5 +- public/r/styles/base-mira/on-media.json | 14 - public/r/styles/base-mira/popover.json | 2 +- public/r/styles/base-mira/radio-group.json | 2 +- public/r/styles/base-mira/registry.json | 22 +- public/r/styles/base-mira/resizable.json | 2 +- public/r/styles/base-mira/select.json | 2 +- public/r/styles/base-mira/sheet.json | 2 +- public/r/styles/base-mira/slider.json | 2 +- public/r/styles/base-mira/switch.json | 2 +- public/r/styles/base-mira/tabs.json | 2 +- public/r/styles/base-mira/toast.json | 2 +- public/r/styles/base-mira/toggle-group.json | 2 +- public/r/styles/base-mira/toggle.json | 2 +- public/r/styles/base-mira/tooltip.json | 2 +- public/r/styles/base-nova/accordion.json | 2 +- public/r/styles/base-nova/alert-dialog.json | 2 +- public/r/styles/base-nova/collapsible.json | 2 +- public/r/styles/base-nova/combobox.json | 2 +- public/r/styles/base-nova/command.json | 2 +- public/r/styles/base-nova/dialog.json | 10 +- public/r/styles/base-nova/drawer.json | 2 +- public/r/styles/base-nova/dropdown-menu.json | 2 +- public/r/styles/base-nova/header-1.json | 2 +- public/r/styles/base-nova/header-2.json | 2 +- public/r/styles/base-nova/header-3.json | 2 +- public/r/styles/base-nova/header-4.json | 2 +- public/r/styles/base-nova/header-5.json | 2 +- public/r/styles/base-nova/hover-card.json | 2 +- .../r/styles/base-nova/navigation-menu.json | 5 +- public/r/styles/base-nova/on-media.json | 14 - public/r/styles/base-nova/popover.json | 2 +- public/r/styles/base-nova/radio-group.json | 2 +- public/r/styles/base-nova/registry.json | 22 +- public/r/styles/base-nova/resizable.json | 2 +- public/r/styles/base-nova/select.json | 2 +- public/r/styles/base-nova/sheet.json | 2 +- public/r/styles/base-nova/slider.json | 2 +- public/r/styles/base-nova/switch.json | 2 +- public/r/styles/base-nova/tabs.json | 2 +- public/r/styles/base-nova/toast.json | 2 +- public/r/styles/base-nova/toggle-group.json | 2 +- public/r/styles/base-nova/toggle.json | 2 +- public/r/styles/base-nova/tooltip.json | 2 +- public/r/styles/base-rhea/accordion.json | 2 +- public/r/styles/base-rhea/alert-dialog.json | 2 +- public/r/styles/base-rhea/collapsible.json | 2 +- public/r/styles/base-rhea/combobox.json | 2 +- public/r/styles/base-rhea/command.json | 2 +- public/r/styles/base-rhea/dialog.json | 10 +- public/r/styles/base-rhea/drawer.json | 2 +- public/r/styles/base-rhea/dropdown-menu.json | 2 +- public/r/styles/base-rhea/header-1.json | 2 +- public/r/styles/base-rhea/header-2.json | 2 +- public/r/styles/base-rhea/header-3.json | 2 +- public/r/styles/base-rhea/header-4.json | 2 +- public/r/styles/base-rhea/header-5.json | 2 +- public/r/styles/base-rhea/hover-card.json | 2 +- .../r/styles/base-rhea/navigation-menu.json | 5 +- public/r/styles/base-rhea/on-media.json | 14 - public/r/styles/base-rhea/popover.json | 2 +- public/r/styles/base-rhea/radio-group.json | 2 +- public/r/styles/base-rhea/registry.json | 22 +- public/r/styles/base-rhea/resizable.json | 2 +- public/r/styles/base-rhea/select.json | 2 +- public/r/styles/base-rhea/sheet.json | 2 +- public/r/styles/base-rhea/slider.json | 2 +- public/r/styles/base-rhea/switch.json | 2 +- public/r/styles/base-rhea/tabs.json | 2 +- public/r/styles/base-rhea/toast.json | 2 +- public/r/styles/base-rhea/toggle-group.json | 2 +- public/r/styles/base-rhea/toggle.json | 2 +- public/r/styles/base-rhea/tooltip.json | 2 +- public/r/styles/base-sera/accordion.json | 2 +- public/r/styles/base-sera/alert-dialog.json | 2 +- public/r/styles/base-sera/collapsible.json | 2 +- public/r/styles/base-sera/combobox.json | 2 +- public/r/styles/base-sera/command.json | 2 +- public/r/styles/base-sera/dialog.json | 10 +- public/r/styles/base-sera/drawer.json | 2 +- public/r/styles/base-sera/dropdown-menu.json | 2 +- public/r/styles/base-sera/header-1.json | 2 +- public/r/styles/base-sera/header-2.json | 2 +- public/r/styles/base-sera/header-3.json | 2 +- public/r/styles/base-sera/header-4.json | 2 +- public/r/styles/base-sera/header-5.json | 2 +- public/r/styles/base-sera/hover-card.json | 2 +- .../r/styles/base-sera/navigation-menu.json | 5 +- public/r/styles/base-sera/on-media.json | 14 - public/r/styles/base-sera/popover.json | 2 +- public/r/styles/base-sera/radio-group.json | 2 +- public/r/styles/base-sera/registry.json | 22 +- public/r/styles/base-sera/resizable.json | 2 +- public/r/styles/base-sera/select.json | 2 +- public/r/styles/base-sera/sheet.json | 2 +- public/r/styles/base-sera/slider.json | 2 +- public/r/styles/base-sera/switch.json | 2 +- public/r/styles/base-sera/tabs.json | 2 +- public/r/styles/base-sera/toast.json | 2 +- public/r/styles/base-sera/toggle-group.json | 2 +- public/r/styles/base-sera/toggle.json | 2 +- public/r/styles/base-sera/tooltip.json | 2 +- public/r/styles/base-vega/accordion.json | 2 +- public/r/styles/base-vega/alert-dialog.json | 2 +- public/r/styles/base-vega/collapsible.json | 2 +- public/r/styles/base-vega/combobox.json | 2 +- public/r/styles/base-vega/command.json | 2 +- public/r/styles/base-vega/dialog.json | 10 +- public/r/styles/base-vega/drawer.json | 2 +- public/r/styles/base-vega/dropdown-menu.json | 2 +- public/r/styles/base-vega/header-1.json | 2 +- public/r/styles/base-vega/header-2.json | 2 +- public/r/styles/base-vega/header-3.json | 2 +- public/r/styles/base-vega/header-4.json | 2 +- public/r/styles/base-vega/header-5.json | 2 +- public/r/styles/base-vega/hover-card.json | 2 +- .../r/styles/base-vega/navigation-menu.json | 5 +- public/r/styles/base-vega/on-media.json | 14 - public/r/styles/base-vega/popover.json | 2 +- public/r/styles/base-vega/radio-group.json | 2 +- public/r/styles/base-vega/registry.json | 22 +- public/r/styles/base-vega/resizable.json | 2 +- public/r/styles/base-vega/select.json | 2 +- public/r/styles/base-vega/sheet.json | 2 +- public/r/styles/base-vega/slider.json | 2 +- public/r/styles/base-vega/switch.json | 2 +- public/r/styles/base-vega/tabs.json | 2 +- public/r/styles/base-vega/toast.json | 2 +- public/r/styles/base-vega/toggle-group.json | 2 +- public/r/styles/base-vega/toggle.json | 2 +- public/r/styles/base-vega/tooltip.json | 2 +- registry.json | 19 +- src/components/blocks/header-1.astro | 29 +- src/components/blocks/header-2.astro | 29 +- src/components/blocks/header-3.astro | 29 +- src/components/blocks/header-4.astro | 29 +- src/components/blocks/header-5.astro | 29 +- src/components/ui/accordion/accordion.astro | 1 + .../ui/alert-dialog/alert-dialog.astro | 1 + .../ui/collapsible/collapsible.astro | 1 + src/components/ui/combobox/combobox.astro | 1 + src/components/ui/command/command.astro | 1 + src/components/ui/dialog/dialog.astro | 15 +- src/components/ui/drawer/drawer.astro | 1 + .../ui/dropdown-menu/dropdown-menu.astro | 1 + src/components/ui/hover-card/hover-card.astro | 1 + .../ui/navigation-menu/navigation-menu.astro | 36 +- src/components/ui/popover/popover.astro | 1 + .../ui/radio-group/radio-group.astro | 1 + src/components/ui/resizable/resizable.astro | 1 + src/components/ui/select/select.astro | 1 + src/components/ui/sheet/sheet.astro | 15 +- src/components/ui/slider/slider.astro | 1 + src/components/ui/switch/switch.astro | 1 + src/components/ui/tabs/tabs.astro | 1 + src/components/ui/toast/toast.astro | 1 + .../ui/toggle-group/toggle-group.astro | 1 + src/components/ui/toggle/toggle.astro | 1 + src/components/ui/tooltip/tooltip.astro | 1 + src/content/pages/components/dialog.mdx | 13 - .../pages/components/navigation-menu.mdx | 13 - src/content/pages/components/sheet.mdx | 13 - src/lib/dialog.ts | 29 -- src/lib/on-media.ts | 105 ------ tests/browser/docs-search.test.mjs | 95 +---- tests/browser/responsive-menu.test.mjs | 354 ++---------------- tests/on-media.test.mjs | 291 -------------- 269 files changed, 440 insertions(+), 1535 deletions(-) create mode 100644 .changeset/static-data-slot-scripts.md delete mode 100644 public/r/styles/base-luma/on-media.json delete mode 100644 public/r/styles/base-lyra/on-media.json delete mode 100644 public/r/styles/base-maia/on-media.json delete mode 100644 public/r/styles/base-mira/on-media.json delete mode 100644 public/r/styles/base-nova/on-media.json delete mode 100644 public/r/styles/base-rhea/on-media.json delete mode 100644 public/r/styles/base-sera/on-media.json delete mode 100644 public/r/styles/base-vega/on-media.json delete mode 100644 src/lib/dialog.ts delete mode 100644 src/lib/on-media.ts delete mode 100644 tests/on-media.test.mjs diff --git a/.changeset/static-data-slot-scripts.md b/.changeset/static-data-slot-scripts.md new file mode 100644 index 000000000..6590cdedd --- /dev/null +++ b/.changeset/static-data-slot-scripts.md @@ -0,0 +1,5 @@ +--- +"fulldev-ui": minor +--- + +Data Slot components start with their page script, with no loading helper. Dialog, Sheet and NavigationMenu no longer load their controller per media query: `media` is still accepted but has no effect, and the registry no longer has the `on-media` item or `src/lib/dialog.ts`; a site that installed them can delete `src/lib/on-media.ts` and `src/lib/dialog.ts` once nothing imports them. Header blocks 1 to 5 take `fold="lg"`, the default, or `fold="xl"` for the breakpoint between their mobile sheet and desktop navigation, and close whichever one the layout hides at that breakpoint, which also releases the sheet's scroll lock. Every Data Slot component also binds new roots on `astro:after-swap`, so a site's own `astro:page-load` command after ClientRouter navigation reaches a started controller. diff --git a/public/r/styles/base-luma/accordion.json b/public/r/styles/base-luma/accordion.json index 3f65ff7a4..8aa10e279 100644 --- a/public/r/styles/base-luma/accordion.json +++ b/public/r/styles/base-luma/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/alert-dialog.json b/public/r/styles/base-luma/alert-dialog.json index a468db30a..89c4c6ab7 100644 --- a/public/r/styles/base-luma/alert-dialog.json +++ b/public/r/styles/base-luma/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/collapsible.json b/public/r/styles/base-luma/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-luma/collapsible.json +++ b/public/r/styles/base-luma/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/combobox.json b/public/r/styles/base-luma/combobox.json index 04c5c83a7..646ecbb68 100644 --- a/public/r/styles/base-luma/combobox.json +++ b/public/r/styles/base-luma/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/command.json b/public/r/styles/base-luma/command.json index 47e318171..ff067f6d2 100644 --- a/public/r/styles/base-luma/command.json +++ b/public/r/styles/base-luma/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/dialog.json b/public/r/styles/base-luma/dialog.json index e78813e1a..f8767e6d7 100644 --- a/public/r/styles/base-luma/dialog.json +++ b/public/r/styles/base-luma/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-luma/drawer.json b/public/r/styles/base-luma/drawer.json index c4de548b8..b4beb4776 100644 --- a/public/r/styles/base-luma/drawer.json +++ b/public/r/styles/base-luma/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/dropdown-menu.json b/public/r/styles/base-luma/dropdown-menu.json index ca89e2c0a..c7a598dfa 100644 --- a/public/r/styles/base-luma/dropdown-menu.json +++ b/public/r/styles/base-luma/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/header-1.json b/public/r/styles/base-luma/header-1.json index bdb755eda..0823df6fd 100644 --- a/public/r/styles/base-luma/header-1.json +++ b/public/r/styles/base-luma/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-luma/header-2.json b/public/r/styles/base-luma/header-2.json index ae95d9456..c7f4e9e7c 100644 --- a/public/r/styles/base-luma/header-2.json +++ b/public/r/styles/base-luma/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-luma/header-3.json b/public/r/styles/base-luma/header-3.json index 4a298248a..64d7f383a 100644 --- a/public/r/styles/base-luma/header-3.json +++ b/public/r/styles/base-luma/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-luma/header-4.json b/public/r/styles/base-luma/header-4.json index 3ca6481bf..52623446d 100644 --- a/public/r/styles/base-luma/header-4.json +++ b/public/r/styles/base-luma/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-luma/header-5.json b/public/r/styles/base-luma/header-5.json index 05e37eea8..618e5f899 100644 --- a/public/r/styles/base-luma/header-5.json +++ b/public/r/styles/base-luma/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-luma/hover-card.json b/public/r/styles/base-luma/hover-card.json index c17e2e651..af026df2f 100644 --- a/public/r/styles/base-luma/hover-card.json +++ b/public/r/styles/base-luma/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/navigation-menu.json b/public/r/styles/base-luma/navigation-menu.json index 3f00e2c0a..3db0843cc 100644 --- a/public/r/styles/base-luma/navigation-menu.json +++ b/public/r/styles/base-luma/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/on-media.json b/public/r/styles/base-luma/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-luma/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-luma/popover.json b/public/r/styles/base-luma/popover.json index 7c1325cdc..e5df45afd 100644 --- a/public/r/styles/base-luma/popover.json +++ b/public/r/styles/base-luma/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/radio-group.json b/public/r/styles/base-luma/radio-group.json index dfd12f473..44c8e4fe1 100644 --- a/public/r/styles/base-luma/radio-group.json +++ b/public/r/styles/base-luma/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/registry.json b/public/r/styles/base-luma/registry.json index 0e4d43364..ee42214e2 100644 --- a/public/r/styles/base-luma/registry.json +++ b/public/r/styles/base-luma/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-luma/resizable.json b/public/r/styles/base-luma/resizable.json index b58e4687f..03981b9cf 100644 --- a/public/r/styles/base-luma/resizable.json +++ b/public/r/styles/base-luma/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-luma/select.json b/public/r/styles/base-luma/select.json index 9d0e1303f..074e5bc22 100644 --- a/public/r/styles/base-luma/select.json +++ b/public/r/styles/base-luma/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/sheet.json b/public/r/styles/base-luma/sheet.json index 8d2ad1084..c1d1df178 100644 --- a/public/r/styles/base-luma/sheet.json +++ b/public/r/styles/base-luma/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/slider.json b/public/r/styles/base-luma/slider.json index 6283e80b6..fd380d807 100644 --- a/public/r/styles/base-luma/slider.json +++ b/public/r/styles/base-luma/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/switch.json b/public/r/styles/base-luma/switch.json index ec0a491b0..e58a5ae22 100644 --- a/public/r/styles/base-luma/switch.json +++ b/public/r/styles/base-luma/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input/90 data-checked:border-primary border-2 data-unchecked:border-transparent focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:data-unchecked:border-transparent group-has-[:focus-visible]/field-label:data-checked:border-primary data-[size=default]:h-5 data-[size=default]:w-11 data-[size=sm]:h-4 data-[size=sm]:w-7 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input/90 data-checked:border-primary border-2 data-unchecked:border-transparent focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:data-unchecked:border-transparent group-has-[:focus-visible]/field-label:data-checked:border-primary data-[size=default]:h-5 data-[size=default]:w-11 data-[size=sm]:h-4 data-[size=sm]:w-7 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/tabs.json b/public/r/styles/base-luma/tabs.json index 84e284dfa..655b6087b 100644 --- a/public/r/styles/base-luma/tabs.json +++ b/public/r/styles/base-luma/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/toast.json b/public/r/styles/base-luma/toast.json index c087fb469..d2f72c690 100644 --- a/public/r/styles/base-luma/toast.json +++ b/public/r/styles/base-luma/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/toggle-group.json b/public/r/styles/base-luma/toggle-group.json index cc6bcdec1..8416e8c41 100644 --- a/public/r/styles/base-luma/toggle-group.json +++ b/public/r/styles/base-luma/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-luma/toggle.json b/public/r/styles/base-luma/toggle.json index 8be271974..6f9b29c21 100644 --- a/public/r/styles/base-luma/toggle.json +++ b/public/r/styles/base-luma/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-luma/tooltip.json b/public/r/styles/base-luma/tooltip.json index 0ec7166b9..652678e27 100644 --- a/public/r/styles/base-luma/tooltip.json +++ b/public/r/styles/base-luma/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/accordion.json b/public/r/styles/base-lyra/accordion.json index 54deaebe0..03d478756 100644 --- a/public/r/styles/base-lyra/accordion.json +++ b/public/r/styles/base-lyra/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/alert-dialog.json b/public/r/styles/base-lyra/alert-dialog.json index 21d834d63..3019b12bc 100644 --- a/public/r/styles/base-lyra/alert-dialog.json +++ b/public/r/styles/base-lyra/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/collapsible.json b/public/r/styles/base-lyra/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-lyra/collapsible.json +++ b/public/r/styles/base-lyra/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/combobox.json b/public/r/styles/base-lyra/combobox.json index efc9c05ae..bb776fda1 100644 --- a/public/r/styles/base-lyra/combobox.json +++ b/public/r/styles/base-lyra/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/command.json b/public/r/styles/base-lyra/command.json index b74747316..44bd21712 100644 --- a/public/r/styles/base-lyra/command.json +++ b/public/r/styles/base-lyra/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/dialog.json b/public/r/styles/base-lyra/dialog.json index 31934bfdd..2d2f44cdd 100644 --- a/public/r/styles/base-lyra/dialog.json +++ b/public/r/styles/base-lyra/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-lyra/drawer.json b/public/r/styles/base-lyra/drawer.json index b7487c287..a5024f4e4 100644 --- a/public/r/styles/base-lyra/drawer.json +++ b/public/r/styles/base-lyra/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/dropdown-menu.json b/public/r/styles/base-lyra/dropdown-menu.json index 3dfa31939..db6d0674d 100644 --- a/public/r/styles/base-lyra/dropdown-menu.json +++ b/public/r/styles/base-lyra/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/header-1.json b/public/r/styles/base-lyra/header-1.json index 39040261d..81e1ce3e8 100644 --- a/public/r/styles/base-lyra/header-1.json +++ b/public/r/styles/base-lyra/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-lyra/header-2.json b/public/r/styles/base-lyra/header-2.json index 0994b6fa0..dc12a2584 100644 --- a/public/r/styles/base-lyra/header-2.json +++ b/public/r/styles/base-lyra/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-lyra/header-3.json b/public/r/styles/base-lyra/header-3.json index ce43de7ca..bce22e4ac 100644 --- a/public/r/styles/base-lyra/header-3.json +++ b/public/r/styles/base-lyra/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-lyra/header-4.json b/public/r/styles/base-lyra/header-4.json index a8bb19062..c4900d2c7 100644 --- a/public/r/styles/base-lyra/header-4.json +++ b/public/r/styles/base-lyra/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-lyra/header-5.json b/public/r/styles/base-lyra/header-5.json index c666f48db..a3a465402 100644 --- a/public/r/styles/base-lyra/header-5.json +++ b/public/r/styles/base-lyra/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-lyra/hover-card.json b/public/r/styles/base-lyra/hover-card.json index 3a57eca11..7ca8723d4 100644 --- a/public/r/styles/base-lyra/hover-card.json +++ b/public/r/styles/base-lyra/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/navigation-menu.json b/public/r/styles/base-lyra/navigation-menu.json index 8fb08e84f..51feb85ce 100644 --- a/public/r/styles/base-lyra/navigation-menu.json +++ b/public/r/styles/base-lyra/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/on-media.json b/public/r/styles/base-lyra/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-lyra/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-lyra/popover.json b/public/r/styles/base-lyra/popover.json index 173f76908..598437115 100644 --- a/public/r/styles/base-lyra/popover.json +++ b/public/r/styles/base-lyra/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/radio-group.json b/public/r/styles/base-lyra/radio-group.json index e7bf65a66..f108dfc93 100644 --- a/public/r/styles/base-lyra/radio-group.json +++ b/public/r/styles/base-lyra/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/registry.json b/public/r/styles/base-lyra/registry.json index 7a951fce8..5f4f21362 100644 --- a/public/r/styles/base-lyra/registry.json +++ b/public/r/styles/base-lyra/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-lyra/resizable.json b/public/r/styles/base-lyra/resizable.json index 7c559a9e7..b8c0fb751 100644 --- a/public/r/styles/base-lyra/resizable.json +++ b/public/r/styles/base-lyra/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-lyra/select.json b/public/r/styles/base-lyra/select.json index ced35dc67..e2ef56418 100644 --- a/public/r/styles/base-lyra/select.json +++ b/public/r/styles/base-lyra/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/sheet.json b/public/r/styles/base-lyra/sheet.json index dafb5f79d..91793d9fc 100644 --- a/public/r/styles/base-lyra/sheet.json +++ b/public/r/styles/base-lyra/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/slider.json b/public/r/styles/base-lyra/slider.json index 0a28201d4..1feae0a69 100644 --- a/public/r/styles/base-lyra/slider.json +++ b/public/r/styles/base-lyra/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/switch.json b/public/r/styles/base-lyra/switch.json index 9ec099716..29ca8ccae 100644 --- a/public/r/styles/base-lyra/switch.json +++ b/public/r/styles/base-lyra/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-1 aria-invalid:ring-1 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-1 aria-invalid:ring-1 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/tabs.json b/public/r/styles/base-lyra/tabs.json index ff0939cf4..0f4752d03 100644 --- a/public/r/styles/base-lyra/tabs.json +++ b/public/r/styles/base-lyra/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/toast.json b/public/r/styles/base-lyra/toast.json index 1e3d9187c..5b680444c 100644 --- a/public/r/styles/base-lyra/toast.json +++ b/public/r/styles/base-lyra/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/toggle-group.json b/public/r/styles/base-lyra/toggle-group.json index 2dbe0efa2..49e8ed6f0 100644 --- a/public/r/styles/base-lyra/toggle-group.json +++ b/public/r/styles/base-lyra/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-lyra/toggle.json b/public/r/styles/base-lyra/toggle.json index 15942d3c7..30233cf46 100644 --- a/public/r/styles/base-lyra/toggle.json +++ b/public/r/styles/base-lyra/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-lyra/tooltip.json b/public/r/styles/base-lyra/tooltip.json index 9a99dee83..dd2dc0c44 100644 --- a/public/r/styles/base-lyra/tooltip.json +++ b/public/r/styles/base-lyra/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/accordion.json b/public/r/styles/base-maia/accordion.json index 3f65ff7a4..8aa10e279 100644 --- a/public/r/styles/base-maia/accordion.json +++ b/public/r/styles/base-maia/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/alert-dialog.json b/public/r/styles/base-maia/alert-dialog.json index e23e285b3..a8f12fd12 100644 --- a/public/r/styles/base-maia/alert-dialog.json +++ b/public/r/styles/base-maia/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/collapsible.json b/public/r/styles/base-maia/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-maia/collapsible.json +++ b/public/r/styles/base-maia/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/combobox.json b/public/r/styles/base-maia/combobox.json index b4b9e1ea7..3196e27a5 100644 --- a/public/r/styles/base-maia/combobox.json +++ b/public/r/styles/base-maia/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/command.json b/public/r/styles/base-maia/command.json index 426f88421..a0a932b4e 100644 --- a/public/r/styles/base-maia/command.json +++ b/public/r/styles/base-maia/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/dialog.json b/public/r/styles/base-maia/dialog.json index e4a10aa40..67d168a1f 100644 --- a/public/r/styles/base-maia/dialog.json +++ b/public/r/styles/base-maia/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-maia/drawer.json b/public/r/styles/base-maia/drawer.json index c90c4eb17..f5f4667f3 100644 --- a/public/r/styles/base-maia/drawer.json +++ b/public/r/styles/base-maia/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/dropdown-menu.json b/public/r/styles/base-maia/dropdown-menu.json index 276c9cae8..85cb7ad59 100644 --- a/public/r/styles/base-maia/dropdown-menu.json +++ b/public/r/styles/base-maia/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/header-1.json b/public/r/styles/base-maia/header-1.json index 817755925..611052241 100644 --- a/public/r/styles/base-maia/header-1.json +++ b/public/r/styles/base-maia/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-maia/header-2.json b/public/r/styles/base-maia/header-2.json index ad1218347..8c762bf80 100644 --- a/public/r/styles/base-maia/header-2.json +++ b/public/r/styles/base-maia/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-maia/header-3.json b/public/r/styles/base-maia/header-3.json index f2fbc6f6f..781506218 100644 --- a/public/r/styles/base-maia/header-3.json +++ b/public/r/styles/base-maia/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-maia/header-4.json b/public/r/styles/base-maia/header-4.json index 53b453cc9..e3375e84b 100644 --- a/public/r/styles/base-maia/header-4.json +++ b/public/r/styles/base-maia/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-maia/header-5.json b/public/r/styles/base-maia/header-5.json index 194275a0f..1a8f902a1 100644 --- a/public/r/styles/base-maia/header-5.json +++ b/public/r/styles/base-maia/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-maia/hover-card.json b/public/r/styles/base-maia/hover-card.json index aa8bffbd5..d0f758eca 100644 --- a/public/r/styles/base-maia/hover-card.json +++ b/public/r/styles/base-maia/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/navigation-menu.json b/public/r/styles/base-maia/navigation-menu.json index f188242e4..128d24446 100644 --- a/public/r/styles/base-maia/navigation-menu.json +++ b/public/r/styles/base-maia/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/on-media.json b/public/r/styles/base-maia/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-maia/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-maia/popover.json b/public/r/styles/base-maia/popover.json index 7568597a6..91cbff198 100644 --- a/public/r/styles/base-maia/popover.json +++ b/public/r/styles/base-maia/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/radio-group.json b/public/r/styles/base-maia/radio-group.json index 65f1f7199..62491c23e 100644 --- a/public/r/styles/base-maia/radio-group.json +++ b/public/r/styles/base-maia/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/registry.json b/public/r/styles/base-maia/registry.json index ba1b85ade..c2bb2bef2 100644 --- a/public/r/styles/base-maia/registry.json +++ b/public/r/styles/base-maia/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-maia/resizable.json b/public/r/styles/base-maia/resizable.json index b58e4687f..03981b9cf 100644 --- a/public/r/styles/base-maia/resizable.json +++ b/public/r/styles/base-maia/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-maia/select.json b/public/r/styles/base-maia/select.json index 133768eac..e4e4a0110 100644 --- a/public/r/styles/base-maia/select.json +++ b/public/r/styles/base-maia/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/sheet.json b/public/r/styles/base-maia/sheet.json index ac120b149..05dd72742 100644 --- a/public/r/styles/base-maia/sheet.json +++ b/public/r/styles/base-maia/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/slider.json b/public/r/styles/base-maia/slider.json index 8236a6133..92b2a55bd 100644 --- a/public/r/styles/base-maia/slider.json +++ b/public/r/styles/base-maia/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/switch.json b/public/r/styles/base-maia/switch.json index 2a031a4c5..4bd1a2515 100644 --- a/public/r/styles/base-maia/switch.json +++ b/public/r/styles/base-maia/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[3px] aria-invalid:ring-[3px] group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[3px] aria-invalid:ring-[3px] group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/tabs.json b/public/r/styles/base-maia/tabs.json index a4ce938d3..246a1ee88 100644 --- a/public/r/styles/base-maia/tabs.json +++ b/public/r/styles/base-maia/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/toast.json b/public/r/styles/base-maia/toast.json index c087fb469..d2f72c690 100644 --- a/public/r/styles/base-maia/toast.json +++ b/public/r/styles/base-maia/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/toggle-group.json b/public/r/styles/base-maia/toggle-group.json index 63fd673ad..d48f87e56 100644 --- a/public/r/styles/base-maia/toggle-group.json +++ b/public/r/styles/base-maia/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-maia/toggle.json b/public/r/styles/base-maia/toggle.json index 6b695b5fd..3cb821f25 100644 --- a/public/r/styles/base-maia/toggle.json +++ b/public/r/styles/base-maia/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-maia/tooltip.json b/public/r/styles/base-maia/tooltip.json index 7d987f2f8..c314ec9d0 100644 --- a/public/r/styles/base-maia/tooltip.json +++ b/public/r/styles/base-maia/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/accordion.json b/public/r/styles/base-mira/accordion.json index a3d1c68dc..0e801d202 100644 --- a/public/r/styles/base-mira/accordion.json +++ b/public/r/styles/base-mira/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/alert-dialog.json b/public/r/styles/base-mira/alert-dialog.json index 19b4183fb..b4ca701b5 100644 --- a/public/r/styles/base-mira/alert-dialog.json +++ b/public/r/styles/base-mira/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/collapsible.json b/public/r/styles/base-mira/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-mira/collapsible.json +++ b/public/r/styles/base-mira/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/combobox.json b/public/r/styles/base-mira/combobox.json index 75609543e..615d03b08 100644 --- a/public/r/styles/base-mira/combobox.json +++ b/public/r/styles/base-mira/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/command.json b/public/r/styles/base-mira/command.json index 77cca2076..66377de98 100644 --- a/public/r/styles/base-mira/command.json +++ b/public/r/styles/base-mira/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/dialog.json b/public/r/styles/base-mira/dialog.json index 7251f173a..edec3acc8 100644 --- a/public/r/styles/base-mira/dialog.json +++ b/public/r/styles/base-mira/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-mira/drawer.json b/public/r/styles/base-mira/drawer.json index 5cd1a579c..e136ecc91 100644 --- a/public/r/styles/base-mira/drawer.json +++ b/public/r/styles/base-mira/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/dropdown-menu.json b/public/r/styles/base-mira/dropdown-menu.json index 0cefaec42..a63d4258c 100644 --- a/public/r/styles/base-mira/dropdown-menu.json +++ b/public/r/styles/base-mira/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/header-1.json b/public/r/styles/base-mira/header-1.json index 817755925..611052241 100644 --- a/public/r/styles/base-mira/header-1.json +++ b/public/r/styles/base-mira/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-mira/header-2.json b/public/r/styles/base-mira/header-2.json index ad1218347..8c762bf80 100644 --- a/public/r/styles/base-mira/header-2.json +++ b/public/r/styles/base-mira/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-mira/header-3.json b/public/r/styles/base-mira/header-3.json index f2fbc6f6f..781506218 100644 --- a/public/r/styles/base-mira/header-3.json +++ b/public/r/styles/base-mira/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-mira/header-4.json b/public/r/styles/base-mira/header-4.json index 53b453cc9..e3375e84b 100644 --- a/public/r/styles/base-mira/header-4.json +++ b/public/r/styles/base-mira/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-mira/header-5.json b/public/r/styles/base-mira/header-5.json index 194275a0f..1a8f902a1 100644 --- a/public/r/styles/base-mira/header-5.json +++ b/public/r/styles/base-mira/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-mira/hover-card.json b/public/r/styles/base-mira/hover-card.json index b599e6507..dc90bc750 100644 --- a/public/r/styles/base-mira/hover-card.json +++ b/public/r/styles/base-mira/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/navigation-menu.json b/public/r/styles/base-mira/navigation-menu.json index 4cb0ebad6..cf6e3f636 100644 --- a/public/r/styles/base-mira/navigation-menu.json +++ b/public/r/styles/base-mira/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/on-media.json b/public/r/styles/base-mira/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-mira/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-mira/popover.json b/public/r/styles/base-mira/popover.json index 5062be3aa..80617ed76 100644 --- a/public/r/styles/base-mira/popover.json +++ b/public/r/styles/base-mira/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/radio-group.json b/public/r/styles/base-mira/radio-group.json index 65f1f7199..62491c23e 100644 --- a/public/r/styles/base-mira/radio-group.json +++ b/public/r/styles/base-mira/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/registry.json b/public/r/styles/base-mira/registry.json index 8d83a000f..d36fc2bf9 100644 --- a/public/r/styles/base-mira/registry.json +++ b/public/r/styles/base-mira/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-mira/resizable.json b/public/r/styles/base-mira/resizable.json index b58e4687f..03981b9cf 100644 --- a/public/r/styles/base-mira/resizable.json +++ b/public/r/styles/base-mira/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-mira/select.json b/public/r/styles/base-mira/select.json index 942bc6668..83629d6d8 100644 --- a/public/r/styles/base-mira/select.json +++ b/public/r/styles/base-mira/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/sheet.json b/public/r/styles/base-mira/sheet.json index 040a9b84a..415322e39 100644 --- a/public/r/styles/base-mira/sheet.json +++ b/public/r/styles/base-mira/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/slider.json b/public/r/styles/base-mira/slider.json index 18ba79712..94af523da 100644 --- a/public/r/styles/base-mira/slider.json +++ b/public/r/styles/base-mira/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/switch.json b/public/r/styles/base-mira/switch.json index 6d4392e5f..780ed33c5 100644 --- a/public/r/styles/base-mira/switch.json +++ b/public/r/styles/base-mira/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-2 aria-invalid:ring-2 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-2 aria-invalid:ring-2 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/tabs.json b/public/r/styles/base-mira/tabs.json index f23331b79..502f2c65b 100644 --- a/public/r/styles/base-mira/tabs.json +++ b/public/r/styles/base-mira/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/toast.json b/public/r/styles/base-mira/toast.json index 2c80c0d43..5e677b424 100644 --- a/public/r/styles/base-mira/toast.json +++ b/public/r/styles/base-mira/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/toggle-group.json b/public/r/styles/base-mira/toggle-group.json index 6f2824642..3867e1c2c 100644 --- a/public/r/styles/base-mira/toggle-group.json +++ b/public/r/styles/base-mira/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-mira/toggle.json b/public/r/styles/base-mira/toggle.json index fe740eca5..a06c3d7e3 100644 --- a/public/r/styles/base-mira/toggle.json +++ b/public/r/styles/base-mira/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-mira/tooltip.json b/public/r/styles/base-mira/tooltip.json index 9d1754e23..e8c2f3653 100644 --- a/public/r/styles/base-mira/tooltip.json +++ b/public/r/styles/base-mira/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/accordion.json b/public/r/styles/base-nova/accordion.json index 8986f964d..e07aa560b 100644 --- a/public/r/styles/base-nova/accordion.json +++ b/public/r/styles/base-nova/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/alert-dialog.json b/public/r/styles/base-nova/alert-dialog.json index f7de14429..4125cea9c 100644 --- a/public/r/styles/base-nova/alert-dialog.json +++ b/public/r/styles/base-nova/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/collapsible.json b/public/r/styles/base-nova/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-nova/collapsible.json +++ b/public/r/styles/base-nova/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/combobox.json b/public/r/styles/base-nova/combobox.json index 1c5520ed4..713e4b536 100644 --- a/public/r/styles/base-nova/combobox.json +++ b/public/r/styles/base-nova/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/command.json b/public/r/styles/base-nova/command.json index eecf9c0eb..79e09dd33 100644 --- a/public/r/styles/base-nova/command.json +++ b/public/r/styles/base-nova/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/dialog.json b/public/r/styles/base-nova/dialog.json index cb223f7b4..7815479a7 100644 --- a/public/r/styles/base-nova/dialog.json +++ b/public/r/styles/base-nova/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-nova/drawer.json b/public/r/styles/base-nova/drawer.json index a2d4fdd0d..85186fa0e 100644 --- a/public/r/styles/base-nova/drawer.json +++ b/public/r/styles/base-nova/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/dropdown-menu.json b/public/r/styles/base-nova/dropdown-menu.json index 9e09da020..4c9b590b6 100644 --- a/public/r/styles/base-nova/dropdown-menu.json +++ b/public/r/styles/base-nova/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/header-1.json b/public/r/styles/base-nova/header-1.json index 39040261d..81e1ce3e8 100644 --- a/public/r/styles/base-nova/header-1.json +++ b/public/r/styles/base-nova/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-nova/header-2.json b/public/r/styles/base-nova/header-2.json index 0994b6fa0..dc12a2584 100644 --- a/public/r/styles/base-nova/header-2.json +++ b/public/r/styles/base-nova/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-nova/header-3.json b/public/r/styles/base-nova/header-3.json index ce43de7ca..bce22e4ac 100644 --- a/public/r/styles/base-nova/header-3.json +++ b/public/r/styles/base-nova/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-nova/header-4.json b/public/r/styles/base-nova/header-4.json index a8bb19062..c4900d2c7 100644 --- a/public/r/styles/base-nova/header-4.json +++ b/public/r/styles/base-nova/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-nova/header-5.json b/public/r/styles/base-nova/header-5.json index c666f48db..a3a465402 100644 --- a/public/r/styles/base-nova/header-5.json +++ b/public/r/styles/base-nova/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-nova/hover-card.json b/public/r/styles/base-nova/hover-card.json index 8f1581961..f5976bbd2 100644 --- a/public/r/styles/base-nova/hover-card.json +++ b/public/r/styles/base-nova/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/navigation-menu.json b/public/r/styles/base-nova/navigation-menu.json index 879213914..dc3fa4577 100644 --- a/public/r/styles/base-nova/navigation-menu.json +++ b/public/r/styles/base-nova/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/on-media.json b/public/r/styles/base-nova/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-nova/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-nova/popover.json b/public/r/styles/base-nova/popover.json index fc799d4ba..30c22e4df 100644 --- a/public/r/styles/base-nova/popover.json +++ b/public/r/styles/base-nova/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/radio-group.json b/public/r/styles/base-nova/radio-group.json index e7bf65a66..f108dfc93 100644 --- a/public/r/styles/base-nova/radio-group.json +++ b/public/r/styles/base-nova/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/registry.json b/public/r/styles/base-nova/registry.json index d43d3d7cc..c2520628b 100644 --- a/public/r/styles/base-nova/registry.json +++ b/public/r/styles/base-nova/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-nova/resizable.json b/public/r/styles/base-nova/resizable.json index b58e4687f..03981b9cf 100644 --- a/public/r/styles/base-nova/resizable.json +++ b/public/r/styles/base-nova/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-nova/select.json b/public/r/styles/base-nova/select.json index efb1113be..7923f2667 100644 --- a/public/r/styles/base-nova/select.json +++ b/public/r/styles/base-nova/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/sheet.json b/public/r/styles/base-nova/sheet.json index 5c1c6d852..5a859036f 100644 --- a/public/r/styles/base-nova/sheet.json +++ b/public/r/styles/base-nova/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/slider.json b/public/r/styles/base-nova/slider.json index 05104c003..defd8c41b 100644 --- a/public/r/styles/base-nova/slider.json +++ b/public/r/styles/base-nova/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/switch.json b/public/r/styles/base-nova/switch.json index b0d22bc2a..352ee664e 100644 --- a/public/r/styles/base-nova/switch.json +++ b/public/r/styles/base-nova/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/tabs.json b/public/r/styles/base-nova/tabs.json index d8db86e45..e8f807405 100644 --- a/public/r/styles/base-nova/tabs.json +++ b/public/r/styles/base-nova/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/toast.json b/public/r/styles/base-nova/toast.json index c087fb469..d2f72c690 100644 --- a/public/r/styles/base-nova/toast.json +++ b/public/r/styles/base-nova/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/toggle-group.json b/public/r/styles/base-nova/toggle-group.json index 6037669ce..2aabe2fba 100644 --- a/public/r/styles/base-nova/toggle-group.json +++ b/public/r/styles/base-nova/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-nova/toggle.json b/public/r/styles/base-nova/toggle.json index 5ecb0b613..633ba7895 100644 --- a/public/r/styles/base-nova/toggle.json +++ b/public/r/styles/base-nova/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-nova/tooltip.json b/public/r/styles/base-nova/tooltip.json index 9d1754e23..e8c2f3653 100644 --- a/public/r/styles/base-nova/tooltip.json +++ b/public/r/styles/base-nova/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/accordion.json b/public/r/styles/base-rhea/accordion.json index 3f65ff7a4..8aa10e279 100644 --- a/public/r/styles/base-rhea/accordion.json +++ b/public/r/styles/base-rhea/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/alert-dialog.json b/public/r/styles/base-rhea/alert-dialog.json index 083d9f475..1355c7856 100644 --- a/public/r/styles/base-rhea/alert-dialog.json +++ b/public/r/styles/base-rhea/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/collapsible.json b/public/r/styles/base-rhea/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-rhea/collapsible.json +++ b/public/r/styles/base-rhea/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/combobox.json b/public/r/styles/base-rhea/combobox.json index 5343c8c69..4d16c704a 100644 --- a/public/r/styles/base-rhea/combobox.json +++ b/public/r/styles/base-rhea/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/command.json b/public/r/styles/base-rhea/command.json index 1c09da085..0396f2840 100644 --- a/public/r/styles/base-rhea/command.json +++ b/public/r/styles/base-rhea/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/dialog.json b/public/r/styles/base-rhea/dialog.json index 701f422a1..fd625ff36 100644 --- a/public/r/styles/base-rhea/dialog.json +++ b/public/r/styles/base-rhea/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-rhea/drawer.json b/public/r/styles/base-rhea/drawer.json index 21f28debe..1c219db43 100644 --- a/public/r/styles/base-rhea/drawer.json +++ b/public/r/styles/base-rhea/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/dropdown-menu.json b/public/r/styles/base-rhea/dropdown-menu.json index cb2c5b4cd..199a8372f 100644 --- a/public/r/styles/base-rhea/dropdown-menu.json +++ b/public/r/styles/base-rhea/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/header-1.json b/public/r/styles/base-rhea/header-1.json index bdb755eda..0823df6fd 100644 --- a/public/r/styles/base-rhea/header-1.json +++ b/public/r/styles/base-rhea/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-rhea/header-2.json b/public/r/styles/base-rhea/header-2.json index ae95d9456..c7f4e9e7c 100644 --- a/public/r/styles/base-rhea/header-2.json +++ b/public/r/styles/base-rhea/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-rhea/header-3.json b/public/r/styles/base-rhea/header-3.json index 4a298248a..64d7f383a 100644 --- a/public/r/styles/base-rhea/header-3.json +++ b/public/r/styles/base-rhea/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-rhea/header-4.json b/public/r/styles/base-rhea/header-4.json index 3ca6481bf..52623446d 100644 --- a/public/r/styles/base-rhea/header-4.json +++ b/public/r/styles/base-rhea/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-rhea/header-5.json b/public/r/styles/base-rhea/header-5.json index 05e37eea8..618e5f899 100644 --- a/public/r/styles/base-rhea/header-5.json +++ b/public/r/styles/base-rhea/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-rhea/hover-card.json b/public/r/styles/base-rhea/hover-card.json index c17e2e651..af026df2f 100644 --- a/public/r/styles/base-rhea/hover-card.json +++ b/public/r/styles/base-rhea/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/navigation-menu.json b/public/r/styles/base-rhea/navigation-menu.json index 93c918598..cc1f75cf9 100644 --- a/public/r/styles/base-rhea/navigation-menu.json +++ b/public/r/styles/base-rhea/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/on-media.json b/public/r/styles/base-rhea/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-rhea/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-rhea/popover.json b/public/r/styles/base-rhea/popover.json index 7c1325cdc..e5df45afd 100644 --- a/public/r/styles/base-rhea/popover.json +++ b/public/r/styles/base-rhea/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/radio-group.json b/public/r/styles/base-rhea/radio-group.json index afdf9fef1..cf8f8dc50 100644 --- a/public/r/styles/base-rhea/radio-group.json +++ b/public/r/styles/base-rhea/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/registry.json b/public/r/styles/base-rhea/registry.json index 05a2b539f..1d9d85ac5 100644 --- a/public/r/styles/base-rhea/registry.json +++ b/public/r/styles/base-rhea/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-rhea/resizable.json b/public/r/styles/base-rhea/resizable.json index b58e4687f..03981b9cf 100644 --- a/public/r/styles/base-rhea/resizable.json +++ b/public/r/styles/base-rhea/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-rhea/select.json b/public/r/styles/base-rhea/select.json index cf6373afd..1d6a829e3 100644 --- a/public/r/styles/base-rhea/select.json +++ b/public/r/styles/base-rhea/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/sheet.json b/public/r/styles/base-rhea/sheet.json index 8d2ad1084..c1d1df178 100644 --- a/public/r/styles/base-rhea/sheet.json +++ b/public/r/styles/base-rhea/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/slider.json b/public/r/styles/base-rhea/slider.json index 891303553..d007e49c6 100644 --- a/public/r/styles/base-rhea/slider.json +++ b/public/r/styles/base-rhea/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/switch.json b/public/r/styles/base-rhea/switch.json index 1697da96c..ab35263c8 100644 --- a/public/r/styles/base-rhea/switch.json +++ b/public/r/styles/base-rhea/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input/90 data-checked:border-primary border-2 data-unchecked:border-transparent focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-2xl focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:data-unchecked:border-transparent group-has-[:focus-visible]/field-label:data-checked:border-primary data-[size=default]:h-5 data-[size=default]:w-8 data-[size=sm]:h-4 data-[size=sm]:w-6 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input/90 data-checked:border-primary border-2 data-unchecked:border-transparent focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-2xl focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:data-unchecked:border-transparent group-has-[:focus-visible]/field-label:data-checked:border-primary data-[size=default]:h-5 data-[size=default]:w-8 data-[size=sm]:h-4 data-[size=sm]:w-6 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/tabs.json b/public/r/styles/base-rhea/tabs.json index d89e5cb51..31ac8b5d9 100644 --- a/public/r/styles/base-rhea/tabs.json +++ b/public/r/styles/base-rhea/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/toast.json b/public/r/styles/base-rhea/toast.json index 0d123d06b..5a23298ff 100644 --- a/public/r/styles/base-rhea/toast.json +++ b/public/r/styles/base-rhea/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/toggle-group.json b/public/r/styles/base-rhea/toggle-group.json index 9765f2a99..6dfe1f25d 100644 --- a/public/r/styles/base-rhea/toggle-group.json +++ b/public/r/styles/base-rhea/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-rhea/toggle.json b/public/r/styles/base-rhea/toggle.json index e4763415f..842dd5511 100644 --- a/public/r/styles/base-rhea/toggle.json +++ b/public/r/styles/base-rhea/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-rhea/tooltip.json b/public/r/styles/base-rhea/tooltip.json index 0ec7166b9..652678e27 100644 --- a/public/r/styles/base-rhea/tooltip.json +++ b/public/r/styles/base-rhea/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/accordion.json b/public/r/styles/base-sera/accordion.json index 1f3fb804f..69a8e8816 100644 --- a/public/r/styles/base-sera/accordion.json +++ b/public/r/styles/base-sera/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/alert-dialog.json b/public/r/styles/base-sera/alert-dialog.json index d965391d2..c44910cdf 100644 --- a/public/r/styles/base-sera/alert-dialog.json +++ b/public/r/styles/base-sera/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/collapsible.json b/public/r/styles/base-sera/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-sera/collapsible.json +++ b/public/r/styles/base-sera/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/combobox.json b/public/r/styles/base-sera/combobox.json index 9cef6c46c..ef6469094 100644 --- a/public/r/styles/base-sera/combobox.json +++ b/public/r/styles/base-sera/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/command.json b/public/r/styles/base-sera/command.json index 8e9e13a1f..1443d04e8 100644 --- a/public/r/styles/base-sera/command.json +++ b/public/r/styles/base-sera/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/dialog.json b/public/r/styles/base-sera/dialog.json index dd17f8e34..f42333b83 100644 --- a/public/r/styles/base-sera/dialog.json +++ b/public/r/styles/base-sera/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-sera/drawer.json b/public/r/styles/base-sera/drawer.json index 2c577a682..fe5ba93cf 100644 --- a/public/r/styles/base-sera/drawer.json +++ b/public/r/styles/base-sera/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/dropdown-menu.json b/public/r/styles/base-sera/dropdown-menu.json index aeb816846..445dfdbfe 100644 --- a/public/r/styles/base-sera/dropdown-menu.json +++ b/public/r/styles/base-sera/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/header-1.json b/public/r/styles/base-sera/header-1.json index bdb755eda..0823df6fd 100644 --- a/public/r/styles/base-sera/header-1.json +++ b/public/r/styles/base-sera/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-sera/header-2.json b/public/r/styles/base-sera/header-2.json index ae95d9456..c7f4e9e7c 100644 --- a/public/r/styles/base-sera/header-2.json +++ b/public/r/styles/base-sera/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-sera/header-3.json b/public/r/styles/base-sera/header-3.json index 4a298248a..64d7f383a 100644 --- a/public/r/styles/base-sera/header-3.json +++ b/public/r/styles/base-sera/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-sera/header-4.json b/public/r/styles/base-sera/header-4.json index 3ca6481bf..52623446d 100644 --- a/public/r/styles/base-sera/header-4.json +++ b/public/r/styles/base-sera/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-sera/header-5.json b/public/r/styles/base-sera/header-5.json index 05e37eea8..618e5f899 100644 --- a/public/r/styles/base-sera/header-5.json +++ b/public/r/styles/base-sera/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-sera/hover-card.json b/public/r/styles/base-sera/hover-card.json index 7b0cd4016..8d8fbf99d 100644 --- a/public/r/styles/base-sera/hover-card.json +++ b/public/r/styles/base-sera/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/navigation-menu.json b/public/r/styles/base-sera/navigation-menu.json index f4020aed8..a8837ce88 100644 --- a/public/r/styles/base-sera/navigation-menu.json +++ b/public/r/styles/base-sera/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/on-media.json b/public/r/styles/base-sera/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-sera/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-sera/popover.json b/public/r/styles/base-sera/popover.json index 32abc68d5..e3fb8791d 100644 --- a/public/r/styles/base-sera/popover.json +++ b/public/r/styles/base-sera/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/radio-group.json b/public/r/styles/base-sera/radio-group.json index 6ffc237bd..0afc71bd8 100644 --- a/public/r/styles/base-sera/radio-group.json +++ b/public/r/styles/base-sera/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/registry.json b/public/r/styles/base-sera/registry.json index e1e6e54e3..1ee79fae1 100644 --- a/public/r/styles/base-sera/registry.json +++ b/public/r/styles/base-sera/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-sera/resizable.json b/public/r/styles/base-sera/resizable.json index 7c559a9e7..b8c0fb751 100644 --- a/public/r/styles/base-sera/resizable.json +++ b/public/r/styles/base-sera/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-sera/select.json b/public/r/styles/base-sera/select.json index 43e881408..13de0345d 100644 --- a/public/r/styles/base-sera/select.json +++ b/public/r/styles/base-sera/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/sheet.json b/public/r/styles/base-sera/sheet.json index 7a0a7f728..02037e72f 100644 --- a/public/r/styles/base-sera/sheet.json +++ b/public/r/styles/base-sera/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/slider.json b/public/r/styles/base-sera/slider.json index abbedde63..09ae13c8d 100644 --- a/public/r/styles/base-sera/slider.json +++ b/public/r/styles/base-sera/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/switch.json b/public/r/styles/base-sera/switch.json index 4d65124dc..086a10084 100644 --- a/public/r/styles/base-sera/switch.json +++ b/public/r/styles/base-sera/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input data-checked:border-primary border data-unchecked:border-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-none focus-visible:ring-2 aria-invalid:ring-2 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:data-unchecked:border-input/50 group-has-[:focus-visible]/field-label:data-checked:border-primary data-[size=default]:h-4.5 data-[size=default]:w-8.25 data-[size=sm]:h-3.5 data-[size=sm]:w-6.25 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input data-checked:border-primary border data-unchecked:border-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-none focus-visible:ring-2 aria-invalid:ring-2 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:data-unchecked:border-input/50 group-has-[:focus-visible]/field-label:data-checked:border-primary data-[size=default]:h-4.5 data-[size=default]:w-8.25 data-[size=sm]:h-3.5 data-[size=sm]:w-6.25 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/tabs.json b/public/r/styles/base-sera/tabs.json index e0d26b5b6..9d1d089e2 100644 --- a/public/r/styles/base-sera/tabs.json +++ b/public/r/styles/base-sera/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/toast.json b/public/r/styles/base-sera/toast.json index e0a9986fb..a67a93294 100644 --- a/public/r/styles/base-sera/toast.json +++ b/public/r/styles/base-sera/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/toggle-group.json b/public/r/styles/base-sera/toggle-group.json index dfcb0059a..df779aa09 100644 --- a/public/r/styles/base-sera/toggle-group.json +++ b/public/r/styles/base-sera/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-sera/toggle.json b/public/r/styles/base-sera/toggle.json index 5c6e3e99f..878efe486 100644 --- a/public/r/styles/base-sera/toggle.json +++ b/public/r/styles/base-sera/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-sera/tooltip.json b/public/r/styles/base-sera/tooltip.json index 9a99dee83..dd2dc0c44 100644 --- a/public/r/styles/base-sera/tooltip.json +++ b/public/r/styles/base-sera/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/accordion.json b/public/r/styles/base-vega/accordion.json index fb470a949..d10a0434e 100644 --- a/public/r/styles/base-vega/accordion.json +++ b/public/r/styles/base-vega/accordion.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/accordion/accordion.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n multiple?: boolean\n defaultValue?: string | string[]\n disabled?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loopFocus?: boolean\n hiddenUntilFound?: boolean\n collapsible?: boolean\n}\n\nconst {\n class: className,\n multiple,\n defaultValue,\n disabled,\n orientation = \"vertical\",\n loopFocus,\n hiddenUntilFound,\n collapsible,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/alert-dialog.json b/public/r/styles/base-vega/alert-dialog.json index e818af71f..98a8a3ae0 100644 --- a/public/r/styles/base-vega/alert-dialog.json +++ b/public/r/styles/base-vega/alert-dialog.json @@ -12,7 +12,7 @@ "files": [ { "path": "src/components/ui/alert-dialog/alert-dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/collapsible.json b/public/r/styles/base-vega/collapsible.json index dd0c03d41..beff3692c 100644 --- a/public/r/styles/base-vega/collapsible.json +++ b/public/r/styles/base-vega/collapsible.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/collapsible/collapsible.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // \"li\" makes a list item the collapsible, such as a sidebar menu item.\n as?: \"div\" | \"li\"\n defaultOpen?: boolean\n hiddenUntilFound?: boolean\n closeOnEscape?: boolean\n closeOnClickOutside?: boolean\n}\n\nconst {\n as: Tag = \"div\",\n class: className,\n defaultOpen,\n hiddenUntilFound,\n closeOnEscape,\n closeOnClickOutside,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/combobox.json b/public/r/styles/base-vega/combobox.json index 106cb02cf..5f75c5e1e 100644 --- a/public/r/styles/base-vega/combobox.json +++ b/public/r/styles/base-vega/combobox.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/combobox/combobox.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type {\n Align as ComboboxAlign,\n Side as ComboboxSide,\n} from \"@data-slot/combobox\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n defaultOpen?: boolean\n placeholder?: string\n disabled?: boolean\n required?: boolean\n name?: string\n openOnFocus?: boolean\n autoHighlight?: boolean\n side?: ComboboxSide\n align?: ComboboxAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n}\n\nconst {\n class: className,\n defaultValue,\n defaultOpen,\n placeholder,\n disabled,\n required,\n name,\n openOnFocus,\n autoHighlight,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/command.json b/public/r/styles/base-vega/command.json index f664cd338..5cdabf837 100644 --- a/public/r/styles/base-vega/command.json +++ b/public/r/styles/base-vega/command.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/command/command.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n label?: string\n defaultValue?: string\n defaultSearch?: string\n shouldFilter?: boolean\n loop?: boolean\n disablePointerSelection?: boolean\n vimBindings?: boolean\n}\n\nconst {\n class: className,\n label,\n defaultValue,\n defaultSearch,\n shouldFilter,\n loop,\n disablePointerSelection,\n vimBindings,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/dialog.json b/public/r/styles/base-vega/dialog.json index d23e66345..a3eb10dd5 100644 --- a/public/r/styles/base-vega/dialog.json +++ b/public/r/styles/base-vega/dialog.json @@ -8,13 +8,12 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { "path": "src/components/ui/dialog/dialog.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n alertDialog?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n alertDialog,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { @@ -66,11 +65,6 @@ "path": "src/components/ui/dialog/index.ts", "content": "export { default as Dialog } from \"./dialog.astro\"\nexport { default as DialogPortal } from \"./dialog-portal.astro\"\nexport { default as DialogOverlay } from \"./dialog-overlay.astro\"\nexport { default as DialogContent } from \"./dialog-content.astro\"\nexport { default as DialogTrigger } from \"./dialog-trigger.astro\"\nexport { default as DialogHeader } from \"./dialog-header.astro\"\nexport { default as DialogTitle } from \"./dialog-title.astro\"\nexport { default as DialogDescription } from \"./dialog-description.astro\"\nexport { default as DialogFooter } from \"./dialog-footer.astro\"\nexport { default as DialogClose } from \"./dialog-close.astro\"\n", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "content": "import { onMedia } from \"./on-media\"\n\nconst roots = new Map void>()\n\nexport function initializeDialogs() {\n for (const root of document.querySelectorAll(\n '[data-slot=\"dialog\"]'\n )) {\n if (roots.has(root)) continue\n roots.set(\n root,\n onMedia(\n root.dataset.media ?? \"all\",\n () => import(\"@data-slot/dialog\"),\n ({ createDialog }) => {\n const controller = createDialog(root)\n return () => controller.destroy()\n },\n { root, selector: '[data-slot=\"dialog-trigger\"]', event: \"dialog:set\" }\n )\n )\n }\n}\n\ndocument.addEventListener(\"astro:page-load\", initializeDialogs)\ndocument.addEventListener(\"astro:before-swap\", () => {\n for (const dispose of roots.values()) dispose()\n roots.clear()\n})\n", - "type": "registry:lib" } ], "docs": "https://ui.full.dev/components/dialog/", diff --git a/public/r/styles/base-vega/drawer.json b/public/r/styles/base-vega/drawer.json index 343339cfc..cf8e91d0b 100644 --- a/public/r/styles/base-vega/drawer.json +++ b/public/r/styles/base-vega/drawer.json @@ -92,7 +92,7 @@ }, { "path": "src/components/ui/drawer/drawer.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DrawerSnapPoint, DrawerSwipeDirection } from \"@data-slot/drawer\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n modal?: boolean | \"trap-focus\"\n disablePointerDismissal?: boolean\n closeOnEscape?: boolean\n swipeDirection?: DrawerSwipeDirection\n snapPoint?: DrawerSnapPoint | null\n defaultSnapPoint?: DrawerSnapPoint | null\n triggerId?: string | null\n defaultTriggerId?: string | null\n}\n\nconst {\n class: className,\n defaultOpen,\n modal,\n disablePointerDismissal,\n closeOnEscape,\n swipeDirection,\n snapPoint,\n defaultSnapPoint,\n triggerId,\n defaultTriggerId,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/dropdown-menu.json b/public/r/styles/base-vega/dropdown-menu.json index 4495930c2..c8e05f046 100644 --- a/public/r/styles/base-vega/dropdown-menu.json +++ b/public/r/styles/base-vega/dropdown-menu.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/dropdown-menu/dropdown-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { Align, Side } from \"@data-slot/dropdown-menu\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n defaultValue?: string | null\n defaultValues?: string[]\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n closeOnSelect?: boolean\n highlightItemOnHover?: boolean\n side?: Side\n align?: Align\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n lockScroll?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n defaultValue,\n defaultValues,\n closeOnClickOutside,\n closeOnEscape,\n closeOnSelect,\n highlightItemOnHover,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n lockScroll,\n ...props\n} = Astro.props\n\nconst defaultValuesAttr =\n defaultValues === undefined ? undefined : JSON.stringify(defaultValues)\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/header-1.json b/public/r/styles/base-vega/header-1.json index 817755925..611052241 100644 --- a/public/r/styles/base-vega/header-1.json +++ b/public/r/styles/base-vega/header-1.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-1.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n {navigation.length > 0 && (\n \n \n {navigation.map((item, index) => (\n \n \n {item.label}\n \n \n ))}\n \n \n )}\n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-vega/header-2.json b/public/r/styles/base-vega/header-2.json index ad1218347..8c762bf80 100644 --- a/public/r/styles/base-vega/header-2.json +++ b/public/r/styles/base-vega/header-2.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-2.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-vega/header-3.json b/public/r/styles/base-vega/header-3.json index f2fbc6f6f..781506218 100644 --- a/public/r/styles/base-vega/header-3.json +++ b/public/r/styles/base-vega/header-3.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-3.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n active?: boolean\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-vega/header-4.json b/public/r/styles/base-vega/header-4.json index 53b453cc9..e3375e84b 100644 --- a/public/r/styles/base-vega/header-4.json +++ b/public/r/styles/base-vega/header-4.json @@ -17,7 +17,7 @@ "files": [ { "path": "src/components/blocks/header-4.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\n---\n\n
\n \n \n \n \n {logo.label}\n \n \n \n
\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-vega/header-5.json b/public/r/styles/base-vega/header-5.json index 194275a0f..1a8f902a1 100644 --- a/public/r/styles/base-vega/header-5.json +++ b/public/r/styles/base-vega/header-5.json @@ -18,7 +18,7 @@ "files": [ { "path": "src/components/blocks/header-5.astro", - "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopQuery = fold === \"xl\" ? \"(min-width: 80rem)\" : \"(min-width: 64rem)\"\nconst mobileQuery = fold === \"xl\" ? \"(width < 80rem)\" : \"(width < 64rem)\"\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n", + "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n fold?: \"lg\" | \"xl\"\n logo: {\n label: string\n href: string\n src?: ImageMetadata\n srcLight?: ImageMetadata\n srcDark?: ImageMetadata\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n target?: \"_self\" | \"_blank\"\n }[]\n navigationLabel: string\n menu: {\n label: string\n title: string\n description: string\n closeLabel: string\n }\n}\n\nconst {\n fold = \"lg\",\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel,\n menu,\n ...props\n} = Astro.props\n\nconst desktopClass = fold === \"xl\" ? \"xl:flex\" : \"lg:flex\"\nconst mobileClass = fold === \"xl\" ? \"xl:hidden\" : \"lg:hidden\"\nconst dividerClass = fold === \"xl\" ? \"xl:block\" : \"lg:block\"\n---\n\n\n \n \n \n \n {logo.label}\n \n \n \n \n \n \n \n \n \n {menu.title}\n {menu.description}\n \n
\n \n {buttons.length > 0 && }\n {buttons.length > 0 && (\n
\n {buttons.map(({ label, href, icon, target }, index) => (\n \n {icon && }\n {label}\n \n ))}\n
\n )}\n
\n \n \n {menu.closeLabel}\n \n
\n
\n
\n \n \n \n \n {navigation.map((item, index) =>\n item.links?.length ? (\n \n {item.label}\n \n
\n \n {item.image && (\n \n )}\n \n {item.label}\n {item.description && (\n \n {item.description}\n \n )}\n \n \n
\n {item.links.map((link) => (\n \n {link.icon && (\n \n )}\n \n {link.label}\n {link.description && (\n \n {link.description}\n \n )}\n \n \n ))}\n
\n
\n
\n
\n ) : (\n \n \n {item.label}\n \n \n )\n )}\n
\n \n
\n\n\n\n", "type": "registry:block" } ], diff --git a/public/r/styles/base-vega/hover-card.json b/public/r/styles/base-vega/hover-card.json index e1e8b21ac..6567bba4a 100644 --- a/public/r/styles/base-vega/hover-card.json +++ b/public/r/styles/base-vega/hover-card.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/hover-card/hover-card.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n defaultOpen?: boolean\n open?: boolean\n delay?: number\n skipDelayDuration?: number\n closeDelay?: number\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n defaultOpen,\n open,\n delay = 700,\n skipDelayDuration = 300,\n closeDelay = 300,\n side = \"bottom\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/navigation-menu.json b/public/r/styles/base-vega/navigation-menu.json index cc52ed99e..9311ceb2c 100644 --- a/public/r/styles/base-vega/navigation-menu.json +++ b/public/r/styles/base-vega/navigation-menu.json @@ -7,13 +7,10 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport NavigationMenuPositioner from \"./navigation-menu-positioner.astro\"\n\ntype Props = HTMLAttributes<\"nav\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n mountStrategy?: \"lazy\" | \"eager\"\n delayOpen?: number\n delayClose?: number\n openOnFocus?: boolean\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n align?: \"start\" | \"center\" | \"end\"\n sideOffset?: number\n alignOffset?: number\n positionMethod?: \"absolute\" | \"fixed\"\n safeTriangle?: boolean\n debugSafeTriangle?: boolean\n}\n\nconst {\n media,\n mountStrategy,\n class: className = \"\",\n delayOpen = 0,\n delayClose = 0,\n openOnFocus,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 8,\n alignOffset = 0,\n positionMethod = \"absolute\",\n safeTriangle,\n debugSafeTriangle,\n \"aria-label\": ariaLabel = \"Main\",\n ...props\n} = Astro.props\n---\n\n\n \n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/on-media.json b/public/r/styles/base-vega/on-media.json deleted file mode 100644 index d8e7970e4..000000000 --- a/public/r/styles/base-vega/on-media.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "on-media", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "content": "type Trigger = { root: Element; selector: string; event?: string }\n\n// A modified or non-primary click on a link keeps its native action, such as\n// opening a new tab, instead of being replayed as a plain click.\nconst nativeLinkClick = (event: Event, target: Element) => {\n const { button = 0, metaKey, ctrlKey, shiftKey, altKey } = event as MouseEvent\n return (\n (button !== 0 || metaKey || ctrlKey || shiftKey || altKey) &&\n target.matches(\"a[href], area[href]\")\n )\n}\n\n/** Import and mount only while the query matches; dispose on exit. */\nexport function onMedia(\n query: string,\n load: () => Promise,\n mount: (module: T) => () => void,\n trigger?: Trigger\n) {\n const media = window.matchMedia(query)\n let disposed = false\n let epoch = 0\n let cleanup: (() => void) | undefined\n let pendingClick: HTMLElement | undefined\n let pendingEvent: CustomEvent | undefined\n\n const matches = () => {\n const matching = window.matchMedia(query).matches\n if (!matching) {\n pendingClick = undefined\n pendingEvent = undefined\n }\n return matching\n }\n\n const replayClick = () => {\n const target = pendingClick\n const event = pendingEvent\n pendingClick = undefined\n pendingEvent = undefined\n if (event && trigger?.root.isConnected)\n trigger.root.dispatchEvent(\n new CustomEvent(event.type, { detail: event.detail })\n )\n else if (target?.isConnected)\n target.dispatchEvent(new MouseEvent(\"click\", { cancelable: true }))\n }\n\n const update = async () => {\n const current = ++epoch\n cleanup?.()\n cleanup = undefined\n if (!matches() || disposed) {\n pendingClick = undefined\n pendingEvent = undefined\n return\n }\n try {\n const module = await load()\n if (disposed || current !== epoch || !matches()) return\n cleanup = mount(module)\n replayClick()\n } catch (error) {\n if (!disposed && current === epoch) {\n pendingClick = undefined\n pendingEvent = undefined\n console.error(error)\n }\n }\n }\n const click = (event: Event) => {\n if (!trigger || cleanup || disposed || !matches() || event.defaultPrevented)\n return\n if (!(event.target instanceof Element)) return\n const target = event.target.closest(trigger.selector)\n if (!target || !trigger.root.contains(target)) return\n if (nativeLinkClick(event, target)) return\n pendingClick ??= target\n pendingEvent = undefined\n event.preventDefault()\n }\n const request = (event: Event) => {\n if (cleanup || disposed || !matches() || event.target !== trigger?.root)\n return\n if (!(event instanceof CustomEvent)) return\n pendingEvent = event\n pendingClick = undefined\n }\n const change = () => void update()\n media.addEventListener(\"change\", change)\n trigger?.root.addEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.addEventListener(trigger.event, request)\n change()\n return () => {\n disposed = true\n epoch++\n pendingClick = undefined\n pendingEvent = undefined\n media.removeEventListener(\"change\", change)\n trigger?.root.removeEventListener(\"click\", click, true)\n if (trigger?.event) trigger.root.removeEventListener(trigger.event, request)\n cleanup?.()\n cleanup = undefined\n }\n}\n", - "type": "registry:lib" - } - ], - "type": "registry:lib" -} \ No newline at end of file diff --git a/public/r/styles/base-vega/popover.json b/public/r/styles/base-vega/popover.json index 6572d0fce..f054804b9 100644 --- a/public/r/styles/base-vega/popover.json +++ b/public/r/styles/base-vega/popover.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/popover/popover.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { PopoverAlign, PopoverSide } from \"@data-slot/popover\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultOpen?: boolean\n side?: PopoverSide\n align?: PopoverAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n /** Compatibility alias. Prefer `side`. */\n position?: PopoverSide\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n}\n\nconst {\n class: className,\n defaultOpen,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal,\n position,\n closeOnClickOutside,\n closeOnEscape,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/radio-group.json b/public/r/styles/base-vega/radio-group.json index 65f1f7199..62491c23e 100644 --- a/public/r/styles/base-vega/radio-group.json +++ b/public/r/styles/base-vega/radio-group.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/radio-group/radio-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: string\n name?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n name,\n disabled,\n readOnly,\n required,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/registry.json b/public/r/styles/base-vega/registry.json index cc92c80b6..19cd0846d 100644 --- a/public/r/styles/base-vega/registry.json +++ b/public/r/styles/base-vega/registry.json @@ -595,8 +595,7 @@ "@lucide/astro" ], "registryDependencies": [ - "@fulldev/button", - "@fulldev/on-media" + "@fulldev/button" ], "files": [ { @@ -642,10 +641,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1266,9 +1261,6 @@ "@data-slot/navigation-menu@^1.1.2", "@lucide/astro" ], - "registryDependencies": [ - "@fulldev/on-media" - ], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4858,18 +4850,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/public/r/styles/base-vega/resizable.json b/public/r/styles/base-vega/resizable.json index b58e4687f..03981b9cf 100644 --- a/public/r/styles/base-vega/resizable.json +++ b/public/r/styles/base-vega/resizable.json @@ -24,7 +24,7 @@ }, { "path": "src/components/ui/resizable/resizable.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n direction?: \"horizontal\" | \"vertical\"\n keyboardResizeBy?: number\n}\n\nconst {\n class: className,\n direction = \"horizontal\",\n keyboardResizeBy,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-vega/select.json b/public/r/styles/base-vega/select.json index 2f45edd0e..4f993a253 100644 --- a/public/r/styles/base-vega/select.json +++ b/public/r/styles/base-vega/select.json @@ -10,7 +10,7 @@ "files": [ { "path": "src/components/ui/select/select.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/sheet.json b/public/r/styles/base-vega/sheet.json index 8e6aec92b..326e6bb9f 100644 --- a/public/r/styles/base-vega/sheet.json +++ b/public/r/styles/base-vega/sheet.json @@ -14,7 +14,7 @@ "files": [ { "path": "src/components/ui/sheet/sheet.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n // No effect: the controller starts with the page. Kept so installs that\n // pass it still type-check.\n media?: string\n defaultOpen?: boolean\n closeOnClickOutside?: boolean\n closeOnEscape?: boolean\n lockScroll?: boolean\n}\n\nconst {\n media,\n class: className,\n defaultOpen,\n closeOnClickOutside,\n closeOnEscape,\n lockScroll,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/slider.json b/public/r/styles/base-vega/slider.json index 8de2e4374..6ef9d408f 100644 --- a/public/r/styles/base-vega/slider.json +++ b/public/r/styles/base-vega/slider.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/slider/slider.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderValue = number | [number, number]\ntype ThumbAlignment = \"center\" | \"edge\" | \"edge-client-only\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n defaultValue?: SliderValue\n min?: number\n max?: number\n step?: number\n largeStep?: number\n orientation?: \"horizontal\" | \"vertical\"\n thumbAlignment?: ThumbAlignment\n disabled?: boolean\n}\n\nconst {\n class: className,\n defaultValue,\n min,\n max,\n step,\n largeStep,\n orientation = \"horizontal\",\n thumbAlignment = \"edge\",\n disabled,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\",\")\n : defaultValue\nconst thumbCount = String(serializedDefaultValue ?? \"\").includes(\",\") ? 2 : 1\nconst orientationAttributes = {\n \"data-horizontal\": orientation === \"horizontal\" ? \"\" : undefined,\n \"data-vertical\": orientation === \"vertical\" ? \"\" : undefined,\n}\n---\n\n\n \n \n \n \n {Array.from({ length: thumbCount }).map(() => (\n \n ))}\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/switch.json b/public/r/styles/base-vega/switch.json index 2b587fc4f..ceca23f86 100644 --- a/public/r/styles/base-vega/switch.json +++ b/public/r/styles/base-vega/switch.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/switch/switch.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent shadow-xs focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n defaultChecked?: boolean\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n name?: string\n size?: \"default\" | \"sm\"\n value?: string\n uncheckedValue?: string\n}\n\nconst {\n class: className,\n defaultChecked,\n disabled,\n readOnly,\n required,\n name,\n size = \"default\",\n value,\n uncheckedValue,\n ...props\n} = Astro.props\n\nconst initialChecked = defaultChecked === true\nconst switchStyle =\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent shadow-xs focus-visible:ring-3 aria-invalid:ring-3 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:border-transparent data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\"\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/tabs.json b/public/r/styles/base-vega/tabs.json index fb9731375..abfb73ed8 100644 --- a/public/r/styles/base-vega/tabs.json +++ b/public/r/styles/base-vega/tabs.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tabs/tabs.astro", - "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 = {\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 /|<(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\n \n\n\n\n", + "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 = {\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 /|<(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\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/toast.json b/public/r/styles/base-vega/toast.json index c087fb469..d2f72c690 100644 --- a/public/r/styles/base-vega/toast.json +++ b/public/r/styles/base-vega/toast.json @@ -63,7 +63,7 @@ }, { "path": "src/components/ui/toast/toast.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { ToastPosition } from \"@data-slot/toast\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n limit?: number\n duration?: number\n position?: ToastPosition\n pauseOnHover?: boolean\n pauseOnFocus?: boolean\n portal?: boolean\n}\n\nconst {\n class: className,\n limit,\n duration,\n position,\n pauseOnHover,\n pauseOnFocus,\n portal,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/toggle-group.json b/public/r/styles/base-vega/toggle-group.json index 216166a8e..1a13c9a73 100644 --- a/public/r/styles/base-vega/toggle-group.json +++ b/public/r/styles/base-vega/toggle-group.json @@ -22,7 +22,7 @@ }, { "path": "src/components/ui/toggle-group/toggle-group.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { ToggleVariantProps } from \"@/components/ui/toggle\"\n\ntype Props = HTMLAttributes<\"div\"> &\n ToggleVariantProps & {\n defaultValue?: string | string[]\n multiple?: boolean\n orientation?: \"horizontal\" | \"vertical\"\n loop?: boolean\n disabled?: boolean\n spacing?: number\n }\n\nconst {\n class: className,\n style,\n defaultValue,\n multiple,\n orientation = \"horizontal\",\n loop,\n disabled,\n variant,\n size,\n spacing = 2,\n ...props\n} = Astro.props\n\nconst serializedDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.join(\" \")\n : defaultValue\n\nconst resolvedStyle =\n typeof style === \"string\"\n ? `--gap: ${spacing}; ${style}`\n : { \"--gap\": spacing, ...(style ?? {}) }\n---\n\n[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none\",\n className\n )}\n {...props}\n>\n \n\n\n\n", "type": "registry:ui" } ], diff --git a/public/r/styles/base-vega/toggle.json b/public/r/styles/base-vega/toggle.json index 3b3118847..c8460fd1a 100644 --- a/public/r/styles/base-vega/toggle.json +++ b/public/r/styles/base-vega/toggle.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/toggle/toggle.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toggleVariants, type ToggleVariantProps } from \"./toggle-variants\"\n\ntype Props = HTMLAttributes<\"button\"> &\n ToggleVariantProps & {\n defaultPressed?: boolean\n disabled?: boolean\n }\n\nconst {\n class: className,\n variant = \"default\",\n size = \"default\",\n defaultPressed,\n disabled,\n type = \"button\",\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/public/r/styles/base-vega/tooltip.json b/public/r/styles/base-vega/tooltip.json index 9d1754e23..e8c2f3653 100644 --- a/public/r/styles/base-vega/tooltip.json +++ b/public/r/styles/base-vega/tooltip.json @@ -9,7 +9,7 @@ "files": [ { "path": "src/components/ui/tooltip/tooltip.astro", - "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", + "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { TooltipAlign, TooltipSide } from \"@data-slot/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n mountStrategy?: \"lazy\" | \"eager\"\n delay?: number\n skipDelayDuration?: number\n side?: TooltipSide\n align?: TooltipAlign\n sideOffset?: number\n alignOffset?: number\n avoidCollisions?: boolean\n collisionPadding?: number\n portal?: boolean\n}\n\nconst {\n mountStrategy,\n class: className,\n delay = 300,\n skipDelayDuration = 300,\n side = \"top\",\n align = \"center\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n portal = true,\n ...props\n} = Astro.props\n---\n\n\n \n\n\n\n", "type": "registry:ui" }, { diff --git a/registry.json b/registry.json index 8173d4f45..4298d8a31 100644 --- a/registry.json +++ b/registry.json @@ -539,7 +539,7 @@ "categories": ["ui"], "docs": "https://ui.full.dev/components/dialog/", "dependencies": ["@data-slot/dialog@^1.1.2", "@lucide/astro"], - "registryDependencies": ["@fulldev/button", "@fulldev/on-media"], + "registryDependencies": ["@fulldev/button"], "files": [ { "path": "src/components/ui/dialog/dialog.astro", @@ -584,10 +584,6 @@ { "path": "src/components/ui/dialog/index.ts", "type": "registry:ui" - }, - { - "path": "src/lib/dialog.ts", - "type": "registry:lib" } ] }, @@ -1142,7 +1138,6 @@ "categories": ["ui"], "docs": "https://ui.full.dev/components/navigation-menu/", "dependencies": ["@data-slot/navigation-menu@^1.1.2", "@lucide/astro"], - "registryDependencies": ["@fulldev/on-media"], "files": [ { "path": "src/components/ui/navigation-menu/navigation-menu.astro", @@ -4304,18 +4299,6 @@ "@fulldev/sidebar-1" ] }, - { - "name": "on-media", - "type": "registry:lib", - "title": "On Media", - "description": "Load and dispose browser behavior while a media query matches.", - "files": [ - { - "path": "src/lib/on-media.ts", - "type": "registry:lib" - } - ] - }, { "name": "accordion-examples", "type": "registry:example", diff --git a/src/components/blocks/header-1.astro b/src/components/blocks/header-1.astro index 8e65d10a1..48c6e06a2 100644 --- a/src/components/blocks/header-1.astro +++ b/src/components/blocks/header-1.astro @@ -64,8 +64,6 @@ const { ...props } = Astro.props -const desktopQuery = fold === "xl" ? "(min-width: 80rem)" : "(min-width: 64rem)" -const mobileQuery = fold === "xl" ? "(width < 80rem)" : "(width < 64rem)" const desktopClass = fold === "xl" ? "xl:flex" : "lg:flex" const mobileClass = fold === "xl" ? "xl:hidden" : "lg:hidden" --- @@ -85,7 +83,6 @@ const mobileClass = fold === "xl" ? "xl:hidden" : "lg:hidden" {navigation.length > 0 && ( @@ -115,7 +112,7 @@ const mobileClass = fold === "xl" ? "xl:hidden" : "lg:hidden" ))} - + + + diff --git a/src/components/blocks/header-2.astro b/src/components/blocks/header-2.astro index 2b47520f2..2c101fa83 100644 --- a/src/components/blocks/header-2.astro +++ b/src/components/blocks/header-2.astro @@ -64,8 +64,6 @@ const { ...props } = Astro.props -const desktopQuery = fold === "xl" ? "(min-width: 80rem)" : "(min-width: 64rem)" -const mobileQuery = fold === "xl" ? "(width < 80rem)" : "(width < 64rem)" const desktopClass = fold === "xl" ? "xl:flex" : "lg:flex" const mobileClass = fold === "xl" ? "xl:hidden" : "lg:hidden" --- @@ -84,7 +82,6 @@ const mobileClass = fold === "xl" ? "xl:hidden" : "lg:hidden"