fulldev-ui 0.26.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/liquid/assets/data-slot-command.js +1 -1
- package/liquid/assets/data-slot-toast.js +1 -1
- package/liquid/assets/ui-carousel.css +32 -0
- package/liquid/assets/ui-carousel.js +29 -1
- package/liquid/assets/ui-controls.js +112 -0
- package/liquid/assets/ui-licenses.json +1 -1
- package/liquid/assets/ui-manifest.json +12 -10
- package/liquid/assets/ui-rating.css +5 -2
- package/liquid/contracts.json +14 -1
- package/liquid/examples/carousel.liquid +46 -0
- package/liquid/examples/dependencies.json +3 -1
- package/liquid/examples/number-field.liquid +67 -0
- package/liquid/examples/rating.liquid +11 -8
- package/liquid/examples/swatch.liquid +25 -0
- package/liquid/registry.json +39 -1
- package/liquid/snippets/ui-input-group.liquid +47 -8
- package/liquid/snippets/ui-input.liquid +3 -1
- package/liquid/snippets/ui-number-field.liquid +26 -0
- package/liquid/snippets/ui-swatch.liquid +19 -0
- package/liquid/snippets/ui.liquid +2 -0
- package/package.json +25 -25
- package/public/r/liquid/carousel.json +1 -1
- package/public/r/liquid/components.json +5 -3
- package/public/r/liquid/init.json +1 -1
- package/public/r/liquid/input-group.json +1 -1
- package/public/r/liquid/input.json +1 -1
- package/public/r/liquid/number-field.json +23 -0
- package/public/r/liquid/rating.json +1 -1
- package/public/r/liquid/registry.json +41 -1
- package/public/r/liquid/runtime.json +4 -4
- package/public/r/liquid/swatch.json +19 -0
- package/public/r/react/styles/base-luma/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-luma/components.json +3 -0
- package/public/r/react/styles/base-luma/number-field.json +26 -0
- package/public/r/react/styles/base-luma/registry.json +68 -0
- package/public/r/react/styles/base-luma/swatch.json +21 -0
- package/public/r/react/styles/base-lyra/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-lyra/components.json +3 -0
- package/public/r/react/styles/base-lyra/number-field.json +26 -0
- package/public/r/react/styles/base-lyra/registry.json +68 -0
- package/public/r/react/styles/base-lyra/swatch.json +21 -0
- package/public/r/react/styles/base-maia/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-maia/components.json +3 -0
- package/public/r/react/styles/base-maia/number-field.json +26 -0
- package/public/r/react/styles/base-maia/registry.json +68 -0
- package/public/r/react/styles/base-maia/swatch.json +21 -0
- package/public/r/react/styles/base-mira/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-mira/components.json +3 -0
- package/public/r/react/styles/base-mira/number-field.json +26 -0
- package/public/r/react/styles/base-mira/registry.json +68 -0
- package/public/r/react/styles/base-mira/swatch.json +21 -0
- package/public/r/react/styles/base-nova/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-nova/components.json +3 -0
- package/public/r/react/styles/base-nova/number-field.json +26 -0
- package/public/r/react/styles/base-nova/registry.json +68 -0
- package/public/r/react/styles/base-nova/swatch.json +21 -0
- package/public/r/react/styles/base-rhea/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-rhea/components.json +3 -0
- package/public/r/react/styles/base-rhea/number-field.json +26 -0
- package/public/r/react/styles/base-rhea/registry.json +68 -0
- package/public/r/react/styles/base-rhea/swatch.json +21 -0
- package/public/r/react/styles/base-sera/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-sera/components.json +3 -0
- package/public/r/react/styles/base-sera/number-field.json +26 -0
- package/public/r/react/styles/base-sera/registry.json +68 -0
- package/public/r/react/styles/base-sera/swatch.json +21 -0
- package/public/r/react/styles/base-vega/carousel-indicator.json +24 -0
- package/public/r/react/styles/base-vega/components.json +3 -0
- package/public/r/react/styles/base-vega/number-field.json +26 -0
- package/public/r/react/styles/base-vega/registry.json +68 -0
- package/public/r/react/styles/base-vega/swatch.json +21 -0
- package/public/r/styles/base-luma/accordion.json +1 -1
- package/public/r/styles/base-luma/alert-dialog.json +1 -1
- package/public/r/styles/base-luma/carousel.json +7 -2
- package/public/r/styles/base-luma/collapsible.json +1 -1
- package/public/r/styles/base-luma/combobox.json +2 -2
- package/public/r/styles/base-luma/command.json +2 -2
- package/public/r/styles/base-luma/components.json +2 -0
- package/public/r/styles/base-luma/dialog.json +1 -1
- package/public/r/styles/base-luma/drawer.json +1 -1
- package/public/r/styles/base-luma/dropdown-menu.json +1 -1
- package/public/r/styles/base-luma/hover-card.json +2 -2
- package/public/r/styles/base-luma/navigation-menu.json +1 -1
- package/public/r/styles/base-luma/number-field.json +44 -0
- package/public/r/styles/base-luma/popover.json +1 -1
- package/public/r/styles/base-luma/radio-group.json +1 -1
- package/public/r/styles/base-luma/registry.json +90 -26
- package/public/r/styles/base-luma/resizable.json +1 -1
- package/public/r/styles/base-luma/select.json +1 -1
- package/public/r/styles/base-luma/sheet.json +1 -1
- package/public/r/styles/base-luma/sidebar.json +1 -1
- package/public/r/styles/base-luma/slider.json +1 -1
- package/public/r/styles/base-luma/swatch.json +23 -0
- package/public/r/styles/base-luma/switch.json +1 -1
- package/public/r/styles/base-luma/tabs.json +1 -1
- package/public/r/styles/base-luma/toast.json +1 -1
- package/public/r/styles/base-luma/toggle-group.json +1 -1
- package/public/r/styles/base-luma/toggle.json +1 -1
- package/public/r/styles/base-luma/tooltip.json +1 -1
- package/public/r/styles/base-lyra/accordion.json +1 -1
- package/public/r/styles/base-lyra/alert-dialog.json +1 -1
- package/public/r/styles/base-lyra/carousel.json +7 -2
- package/public/r/styles/base-lyra/collapsible.json +1 -1
- package/public/r/styles/base-lyra/combobox.json +2 -2
- package/public/r/styles/base-lyra/command.json +2 -2
- package/public/r/styles/base-lyra/components.json +2 -0
- package/public/r/styles/base-lyra/dialog.json +1 -1
- package/public/r/styles/base-lyra/drawer.json +1 -1
- package/public/r/styles/base-lyra/dropdown-menu.json +1 -1
- package/public/r/styles/base-lyra/hover-card.json +2 -2
- package/public/r/styles/base-lyra/navigation-menu.json +1 -1
- package/public/r/styles/base-lyra/number-field.json +44 -0
- package/public/r/styles/base-lyra/popover.json +1 -1
- package/public/r/styles/base-lyra/radio-group.json +1 -1
- package/public/r/styles/base-lyra/registry.json +90 -26
- package/public/r/styles/base-lyra/resizable.json +1 -1
- package/public/r/styles/base-lyra/select.json +1 -1
- package/public/r/styles/base-lyra/sheet.json +1 -1
- package/public/r/styles/base-lyra/sidebar.json +1 -1
- package/public/r/styles/base-lyra/slider.json +1 -1
- package/public/r/styles/base-lyra/swatch.json +23 -0
- package/public/r/styles/base-lyra/switch.json +1 -1
- package/public/r/styles/base-lyra/tabs.json +1 -1
- package/public/r/styles/base-lyra/toast.json +1 -1
- package/public/r/styles/base-lyra/toggle-group.json +1 -1
- package/public/r/styles/base-lyra/toggle.json +1 -1
- package/public/r/styles/base-lyra/tooltip.json +1 -1
- package/public/r/styles/base-maia/accordion.json +1 -1
- package/public/r/styles/base-maia/alert-dialog.json +1 -1
- package/public/r/styles/base-maia/carousel.json +7 -2
- package/public/r/styles/base-maia/collapsible.json +1 -1
- package/public/r/styles/base-maia/combobox.json +2 -2
- package/public/r/styles/base-maia/command.json +2 -2
- package/public/r/styles/base-maia/components.json +2 -0
- package/public/r/styles/base-maia/dialog.json +1 -1
- package/public/r/styles/base-maia/drawer.json +1 -1
- package/public/r/styles/base-maia/dropdown-menu.json +1 -1
- package/public/r/styles/base-maia/hover-card.json +2 -2
- package/public/r/styles/base-maia/navigation-menu.json +1 -1
- package/public/r/styles/base-maia/number-field.json +44 -0
- package/public/r/styles/base-maia/popover.json +1 -1
- package/public/r/styles/base-maia/radio-group.json +1 -1
- package/public/r/styles/base-maia/registry.json +90 -26
- package/public/r/styles/base-maia/resizable.json +1 -1
- package/public/r/styles/base-maia/select.json +1 -1
- package/public/r/styles/base-maia/sheet.json +1 -1
- package/public/r/styles/base-maia/sidebar.json +1 -1
- package/public/r/styles/base-maia/slider.json +1 -1
- package/public/r/styles/base-maia/swatch.json +23 -0
- package/public/r/styles/base-maia/switch.json +1 -1
- package/public/r/styles/base-maia/tabs.json +1 -1
- package/public/r/styles/base-maia/toast.json +1 -1
- package/public/r/styles/base-maia/toggle-group.json +1 -1
- package/public/r/styles/base-maia/toggle.json +1 -1
- package/public/r/styles/base-maia/tooltip.json +1 -1
- package/public/r/styles/base-mira/accordion.json +1 -1
- package/public/r/styles/base-mira/alert-dialog.json +1 -1
- package/public/r/styles/base-mira/carousel.json +7 -2
- package/public/r/styles/base-mira/collapsible.json +1 -1
- package/public/r/styles/base-mira/combobox.json +2 -2
- package/public/r/styles/base-mira/command.json +2 -2
- package/public/r/styles/base-mira/components.json +2 -0
- package/public/r/styles/base-mira/dialog.json +1 -1
- package/public/r/styles/base-mira/drawer.json +1 -1
- package/public/r/styles/base-mira/dropdown-menu.json +1 -1
- package/public/r/styles/base-mira/hover-card.json +2 -2
- package/public/r/styles/base-mira/navigation-menu.json +1 -1
- package/public/r/styles/base-mira/number-field.json +44 -0
- package/public/r/styles/base-mira/popover.json +1 -1
- package/public/r/styles/base-mira/radio-group.json +1 -1
- package/public/r/styles/base-mira/registry.json +90 -26
- package/public/r/styles/base-mira/resizable.json +1 -1
- package/public/r/styles/base-mira/select.json +1 -1
- package/public/r/styles/base-mira/sheet.json +1 -1
- package/public/r/styles/base-mira/sidebar.json +1 -1
- package/public/r/styles/base-mira/slider.json +1 -1
- package/public/r/styles/base-mira/swatch.json +23 -0
- package/public/r/styles/base-mira/switch.json +1 -1
- package/public/r/styles/base-mira/tabs.json +1 -1
- package/public/r/styles/base-mira/toast.json +1 -1
- package/public/r/styles/base-mira/toggle-group.json +1 -1
- package/public/r/styles/base-mira/toggle.json +1 -1
- package/public/r/styles/base-mira/tooltip.json +1 -1
- package/public/r/styles/base-nova/accordion.json +1 -1
- package/public/r/styles/base-nova/alert-dialog.json +1 -1
- package/public/r/styles/base-nova/carousel.json +7 -2
- package/public/r/styles/base-nova/collapsible.json +1 -1
- package/public/r/styles/base-nova/combobox.json +2 -2
- package/public/r/styles/base-nova/command.json +2 -2
- package/public/r/styles/base-nova/components.json +2 -0
- package/public/r/styles/base-nova/dialog.json +1 -1
- package/public/r/styles/base-nova/drawer.json +1 -1
- package/public/r/styles/base-nova/dropdown-menu.json +1 -1
- package/public/r/styles/base-nova/hover-card.json +2 -2
- package/public/r/styles/base-nova/navigation-menu.json +1 -1
- package/public/r/styles/base-nova/number-field.json +44 -0
- package/public/r/styles/base-nova/popover.json +1 -1
- package/public/r/styles/base-nova/radio-group.json +1 -1
- package/public/r/styles/base-nova/registry.json +90 -26
- package/public/r/styles/base-nova/resizable.json +1 -1
- package/public/r/styles/base-nova/select.json +1 -1
- package/public/r/styles/base-nova/sheet.json +1 -1
- package/public/r/styles/base-nova/sidebar.json +1 -1
- package/public/r/styles/base-nova/slider.json +1 -1
- package/public/r/styles/base-nova/swatch.json +23 -0
- package/public/r/styles/base-nova/switch.json +1 -1
- package/public/r/styles/base-nova/tabs.json +1 -1
- package/public/r/styles/base-nova/toast.json +1 -1
- package/public/r/styles/base-nova/toggle-group.json +1 -1
- package/public/r/styles/base-nova/toggle.json +1 -1
- package/public/r/styles/base-nova/tooltip.json +1 -1
- package/public/r/styles/base-rhea/accordion.json +1 -1
- package/public/r/styles/base-rhea/alert-dialog.json +1 -1
- package/public/r/styles/base-rhea/carousel.json +7 -2
- package/public/r/styles/base-rhea/collapsible.json +1 -1
- package/public/r/styles/base-rhea/combobox.json +2 -2
- package/public/r/styles/base-rhea/command.json +2 -2
- package/public/r/styles/base-rhea/components.json +2 -0
- package/public/r/styles/base-rhea/dialog.json +1 -1
- package/public/r/styles/base-rhea/drawer.json +1 -1
- package/public/r/styles/base-rhea/dropdown-menu.json +1 -1
- package/public/r/styles/base-rhea/hover-card.json +2 -2
- package/public/r/styles/base-rhea/navigation-menu.json +1 -1
- package/public/r/styles/base-rhea/number-field.json +44 -0
- package/public/r/styles/base-rhea/popover.json +1 -1
- package/public/r/styles/base-rhea/radio-group.json +1 -1
- package/public/r/styles/base-rhea/registry.json +90 -26
- package/public/r/styles/base-rhea/resizable.json +1 -1
- package/public/r/styles/base-rhea/select.json +1 -1
- package/public/r/styles/base-rhea/sheet.json +1 -1
- package/public/r/styles/base-rhea/sidebar.json +1 -1
- package/public/r/styles/base-rhea/slider.json +1 -1
- package/public/r/styles/base-rhea/swatch.json +23 -0
- package/public/r/styles/base-rhea/switch.json +1 -1
- package/public/r/styles/base-rhea/tabs.json +1 -1
- package/public/r/styles/base-rhea/toast.json +1 -1
- package/public/r/styles/base-rhea/toggle-group.json +1 -1
- package/public/r/styles/base-rhea/toggle.json +1 -1
- package/public/r/styles/base-rhea/tooltip.json +1 -1
- package/public/r/styles/base-sera/accordion.json +1 -1
- package/public/r/styles/base-sera/alert-dialog.json +1 -1
- package/public/r/styles/base-sera/carousel.json +7 -2
- package/public/r/styles/base-sera/collapsible.json +1 -1
- package/public/r/styles/base-sera/combobox.json +2 -2
- package/public/r/styles/base-sera/command.json +2 -2
- package/public/r/styles/base-sera/components.json +2 -0
- package/public/r/styles/base-sera/dialog.json +1 -1
- package/public/r/styles/base-sera/drawer.json +1 -1
- package/public/r/styles/base-sera/dropdown-menu.json +1 -1
- package/public/r/styles/base-sera/hover-card.json +2 -2
- package/public/r/styles/base-sera/navigation-menu.json +1 -1
- package/public/r/styles/base-sera/number-field.json +44 -0
- package/public/r/styles/base-sera/popover.json +1 -1
- package/public/r/styles/base-sera/radio-group.json +1 -1
- package/public/r/styles/base-sera/registry.json +90 -26
- package/public/r/styles/base-sera/resizable.json +1 -1
- package/public/r/styles/base-sera/select.json +1 -1
- package/public/r/styles/base-sera/sheet.json +1 -1
- package/public/r/styles/base-sera/sidebar.json +1 -1
- package/public/r/styles/base-sera/slider.json +1 -1
- package/public/r/styles/base-sera/swatch.json +23 -0
- package/public/r/styles/base-sera/switch.json +1 -1
- package/public/r/styles/base-sera/tabs.json +1 -1
- package/public/r/styles/base-sera/toast.json +1 -1
- package/public/r/styles/base-sera/toggle-group.json +1 -1
- package/public/r/styles/base-sera/toggle.json +1 -1
- package/public/r/styles/base-sera/tooltip.json +1 -1
- package/public/r/styles/base-vega/accordion.json +1 -1
- package/public/r/styles/base-vega/alert-dialog.json +1 -1
- package/public/r/styles/base-vega/carousel.json +7 -2
- package/public/r/styles/base-vega/collapsible.json +1 -1
- package/public/r/styles/base-vega/combobox.json +2 -2
- package/public/r/styles/base-vega/command.json +2 -2
- package/public/r/styles/base-vega/components.json +2 -0
- package/public/r/styles/base-vega/dialog.json +1 -1
- package/public/r/styles/base-vega/drawer.json +1 -1
- package/public/r/styles/base-vega/dropdown-menu.json +1 -1
- package/public/r/styles/base-vega/hover-card.json +2 -2
- package/public/r/styles/base-vega/navigation-menu.json +1 -1
- package/public/r/styles/base-vega/number-field.json +44 -0
- package/public/r/styles/base-vega/popover.json +1 -1
- package/public/r/styles/base-vega/radio-group.json +1 -1
- package/public/r/styles/base-vega/registry.json +90 -26
- package/public/r/styles/base-vega/resizable.json +1 -1
- package/public/r/styles/base-vega/select.json +1 -1
- package/public/r/styles/base-vega/sheet.json +1 -1
- package/public/r/styles/base-vega/sidebar.json +1 -1
- package/public/r/styles/base-vega/slider.json +1 -1
- package/public/r/styles/base-vega/swatch.json +23 -0
- package/public/r/styles/base-vega/switch.json +1 -1
- package/public/r/styles/base-vega/tabs.json +1 -1
- package/public/r/styles/base-vega/toast.json +1 -1
- package/public/r/styles/base-vega/toggle-group.json +1 -1
- package/public/r/styles/base-vega/toggle.json +1 -1
- package/public/r/styles/base-vega/tooltip.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "number-field",
|
|
4
|
+
"title": "Number Field",
|
|
5
|
+
"description": "A number input with decrement and increment buttons.",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"@lucide/astro"
|
|
8
|
+
],
|
|
9
|
+
"registryDependencies": [
|
|
10
|
+
"@fulldev/input-group"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "src/components/ui/number-field/number-field.astro",
|
|
15
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<div\n data-slot=\"number-field\"\n role=\"group\"\n class={cn(\n \"border-transparent border-b-input bg-transparent has-[[data-slot=input-group-control]:focus-visible]:border-b-ring has-[[data-slot][aria-invalid=true]]:border-b-destructive dark:has-[[data-slot][aria-invalid=true]]:border-b-destructive/50 h-10 rounded-none border transition-[color,border-color] in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-none has-data-[align=block-start]:rounded-none has-[textarea]:rounded-none has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 group/input-group relative flex w-32 min-w-0 items-center outline-none\",\n className\n )}\n {...props}\n>\n <slot />\n</div>\n\n<script>\n // The buttons step the native input as its arrow keys do and fire the\n // input and change events that typing fires. As in Base UI, they are left\n // out of the tab order, where the input's arrow keys step, and disabled when\n // a step would not change the value: at a bound, or while the input is\n // disabled or read-only. They follow new attributes and replaced markup.\n // Without JavaScript the input still works on its own.\n const buttons = (root: Element) =>\n root.querySelectorAll<HTMLButtonElement>(\n '[data-slot=\"number-field-decrement\"], [data-slot=\"number-field-increment\"]'\n )\n // Steps a detached copy, so min, max and step apply as the browser applies\n // them.\n const canStep = (input: HTMLInputElement, decrement: boolean) => {\n if (input.disabled || input.readOnly) return false\n const probe = input.cloneNode() as HTMLInputElement\n probe.value = input.value\n try {\n if (decrement) probe.stepDown()\n else probe.stepUp()\n } catch {\n return false\n }\n return probe.value !== input.value\n }\n const observed = new WeakSet<Element>()\n const observer = new MutationObserver((mutations) => {\n const roots = new Set<Element>()\n for (const mutation of mutations) {\n if (\n mutation.type === \"attributes\" &&\n !(mutation.target instanceof HTMLInputElement)\n )\n continue\n const root =\n mutation.target instanceof Element &&\n mutation.target.closest('[data-slot=\"number-field\"]')\n if (root) roots.add(root)\n }\n for (const root of roots) sync(root)\n })\n // Syncs the buttons, and data-disabled for the input group look, and\n // follows the root's later changes.\n const sync = (root: Element) => {\n const input = root.querySelector(\"input\")\n if (!input) return\n if (input.disabled) root.setAttribute(\"data-disabled\", \"true\")\n else root.removeAttribute(\"data-disabled\")\n for (const button of buttons(root)) {\n if (button.dataset.manualDisabled === \"true\") continue\n const disabled = !canStep(\n input,\n button.dataset.slot === \"number-field-decrement\"\n )\n if (button.disabled !== disabled) button.disabled = disabled\n }\n if (observed.has(root)) return\n observed.add(root)\n observer.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"min\", \"max\", \"step\", \"value\", \"disabled\", \"readonly\"],\n })\n }\n const syncAll = () => {\n for (const root of document.querySelectorAll('[data-slot=\"number-field\"]'))\n sync(root)\n }\n\n if (!document.documentElement.dataset.numberFieldBound) {\n document.documentElement.dataset.numberFieldBound = \"true\"\n\n document.addEventListener(\"click\", (event) => {\n const target = event.target\n if (!(target instanceof Element)) return\n\n const button = target.closest(\n '[data-slot=\"number-field-decrement\"], [data-slot=\"number-field-increment\"]'\n )\n if (!(button instanceof HTMLButtonElement) || button.disabled) return\n\n const root = button.closest('[data-slot=\"number-field\"]')\n const input = root?.querySelector(\"input\")\n if (!root || !input || input.disabled || input.readOnly) return\n\n const value = input.value\n try {\n if (button.dataset.slot === \"number-field-decrement\") input.stepDown()\n else input.stepUp()\n } catch {\n return\n }\n if (input.value !== value) {\n input.dispatchEvent(new Event(\"input\", { bubbles: true }))\n input.dispatchEvent(new Event(\"change\", { bubbles: true }))\n }\n sync(root)\n })\n // Pressing a button keeps the focus on its field's input, so the typed\n // value is not committed by a blur, and a form that refreshes on change,\n // before the click steps it. Another field still blurs.\n document.addEventListener(\"mousedown\", (event) => {\n const button =\n event.target instanceof Element &&\n event.target.closest(\n '[data-slot=\"number-field-decrement\"], [data-slot=\"number-field-increment\"]'\n )\n const input = button\n ? button.closest('[data-slot=\"number-field\"]')?.querySelector(\"input\")\n : null\n if (input && input === document.activeElement) event.preventDefault()\n })\n // A pointer or focus that reaches the field first also syncs it, for a\n // field added later or a value a script set without an event.\n for (const type of [\"input\", \"change\", \"pointerover\", \"focusin\"])\n document.addEventListener(type, (event) => {\n const root =\n event.target instanceof Element &&\n event.target.closest('[data-slot=\"number-field\"]')\n if (root) sync(root)\n })\n // A form reset restores the inputs after the event, also an input that\n // belongs to the form from elsewhere.\n document.addEventListener(\"reset\", (event) => {\n setTimeout(() => {\n for (const root of document.querySelectorAll(\n '[data-slot=\"number-field\"]'\n ))\n if (root.querySelector(\"input\")?.form === event.target) sync(root)\n })\n })\n document.addEventListener(\"astro:page-load\", syncAll)\n }\n syncAll()\n</script>\n",
|
|
16
|
+
"type": "registry:ui"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "src/components/ui/number-field/number-field-decrement.astro",
|
|
20
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport MinusIcon from \"@lucide/astro/icons/minus\"\n\nimport { InputGroupAddon, InputGroupButton } from \"@/components/ui/input-group\"\n\ntype Props = Omit<ComponentProps<typeof InputGroupButton>, \"type\">\n\nconst {\n \"aria-label\": ariaLabel = \"Decrease\",\n size = \"icon-xs\",\n disabled,\n ...props\n} = Astro.props\n---\n\n<InputGroupAddon align=\"inline-start\">\n <InputGroupButton\n data-slot=\"number-field-decrement\"\n size={size}\n tabindex={-1}\n aria-label={ariaLabel}\n disabled={disabled}\n data-manual-disabled={disabled ? \"true\" : undefined}\n {...props}\n type=\"button\"\n >\n <slot>\n <MinusIcon aria-hidden=\"true\" />\n </slot>\n </InputGroupButton>\n</InputGroupAddon>\n",
|
|
21
|
+
"type": "registry:ui"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"path": "src/components/ui/number-field/number-field-increment.astro",
|
|
25
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport PlusIcon from \"@lucide/astro/icons/plus\"\n\nimport { InputGroupAddon, InputGroupButton } from \"@/components/ui/input-group\"\n\ntype Props = Omit<ComponentProps<typeof InputGroupButton>, \"type\">\n\nconst {\n \"aria-label\": ariaLabel = \"Increase\",\n size = \"icon-xs\",\n disabled,\n ...props\n} = Astro.props\n---\n\n<InputGroupAddon align=\"inline-end\">\n <InputGroupButton\n data-slot=\"number-field-increment\"\n size={size}\n tabindex={-1}\n aria-label={ariaLabel}\n disabled={disabled}\n data-manual-disabled={disabled ? \"true\" : undefined}\n {...props}\n type=\"button\"\n >\n <slot>\n <PlusIcon aria-hidden=\"true\" />\n </slot>\n </InputGroupButton>\n</InputGroupAddon>\n",
|
|
26
|
+
"type": "registry:ui"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "src/components/ui/number-field/number-field-input.astro",
|
|
30
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { InputGroupInput } from \"@/components/ui/input-group\"\n\ntype Props = Omit<ComponentProps<typeof InputGroupInput>, \"type\">\n\nconst { class: className, step, min, inputmode, ...props } = Astro.props\n// A field that cannot go below 0 gets the numeric keypad, or the decimal one\n// for fractions. Others keep the browser's keyboard, which has a minus key.\nconst bound =\n min === undefined || min === null || String(min).trim() === \"\"\n ? Number.NaN\n : Number(min)\nconst unsigned = bound >= 0\nconst whole = Number.isInteger(Number(step ?? 1)) && Number.isInteger(bound)\nconst keypad = unsigned ? (whole ? \"numeric\" : \"decimal\") : undefined\n---\n\n<InputGroupInput\n step={step}\n min={min}\n inputmode={inputmode ?? keypad}\n class={cn(\n \"text-center tabular-nums [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none\",\n className\n )}\n {...props}\n type=\"number\"\n/>\n",
|
|
31
|
+
"type": "registry:ui"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "src/components/ui/number-field/index.ts",
|
|
35
|
+
"content": "export { default as NumberField } from \"./number-field.astro\"\nexport { default as NumberFieldDecrement } from \"./number-field-decrement.astro\"\nexport { default as NumberFieldInput } from \"./number-field-input.astro\"\nexport { default as NumberFieldIncrement } from \"./number-field-increment.astro\"\n",
|
|
36
|
+
"type": "registry:ui"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"docs": "https://ui.full.dev/components/number-field/",
|
|
40
|
+
"categories": [
|
|
41
|
+
"ui"
|
|
42
|
+
],
|
|
43
|
+
"type": "registry:ui"
|
|
44
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "Radio Group",
|
|
5
5
|
"description": "A set of checkable buttons, known as radio buttons, where no more than one of the buttons can be checked at a time.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"@data-slot/radio-group@^1.1.
|
|
7
|
+
"@data-slot/radio-group@^1.1.3"
|
|
8
8
|
],
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"docs": "https://ui.full.dev/components/accordion/",
|
|
15
15
|
"dependencies": [
|
|
16
|
-
"@data-slot/accordion@^1.1.
|
|
16
|
+
"@data-slot/accordion@^1.1.3",
|
|
17
17
|
"@lucide/astro"
|
|
18
18
|
],
|
|
19
19
|
"files": [
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
],
|
|
82
82
|
"docs": "https://ui.full.dev/components/alert-dialog/",
|
|
83
83
|
"dependencies": [
|
|
84
|
-
"@data-slot/alert-dialog@^1.1.
|
|
84
|
+
"@data-slot/alert-dialog@^1.1.3"
|
|
85
85
|
],
|
|
86
86
|
"registryDependencies": [
|
|
87
87
|
"@fulldev/button"
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
],
|
|
433
433
|
"docs": "https://ui.full.dev/components/collapsible/",
|
|
434
434
|
"dependencies": [
|
|
435
|
-
"@data-slot/collapsible@^1.1.
|
|
435
|
+
"@data-slot/collapsible@^1.1.3"
|
|
436
436
|
],
|
|
437
437
|
"files": [
|
|
438
438
|
{
|
|
@@ -463,8 +463,8 @@
|
|
|
463
463
|
],
|
|
464
464
|
"docs": "https://ui.full.dev/components/combobox/",
|
|
465
465
|
"dependencies": [
|
|
466
|
-
"@data-slot/combobox@^1.1.
|
|
467
|
-
"@data-slot/core@^1.1.
|
|
466
|
+
"@data-slot/combobox@^1.1.3",
|
|
467
|
+
"@data-slot/core@^1.1.3",
|
|
468
468
|
"@lucide/astro"
|
|
469
469
|
],
|
|
470
470
|
"registryDependencies": [
|
|
@@ -531,9 +531,9 @@
|
|
|
531
531
|
],
|
|
532
532
|
"docs": "https://ui.full.dev/components/command/",
|
|
533
533
|
"dependencies": [
|
|
534
|
-
"@data-slot/command@^1.1.
|
|
534
|
+
"@data-slot/command@^1.1.3",
|
|
535
535
|
"@lucide/astro",
|
|
536
|
-
"@data-slot/core@^1.1.
|
|
536
|
+
"@data-slot/core@^1.1.3"
|
|
537
537
|
],
|
|
538
538
|
"registryDependencies": [
|
|
539
539
|
"@fulldev/dialog"
|
|
@@ -591,7 +591,7 @@
|
|
|
591
591
|
],
|
|
592
592
|
"docs": "https://ui.full.dev/components/dialog/",
|
|
593
593
|
"dependencies": [
|
|
594
|
-
"@data-slot/dialog@^1.1.
|
|
594
|
+
"@data-slot/dialog@^1.1.3",
|
|
595
595
|
"@lucide/astro"
|
|
596
596
|
],
|
|
597
597
|
"registryDependencies": [
|
|
@@ -654,7 +654,7 @@
|
|
|
654
654
|
],
|
|
655
655
|
"docs": "https://ui.full.dev/components/dropdown-menu/",
|
|
656
656
|
"dependencies": [
|
|
657
|
-
"@data-slot/dropdown-menu@^1.1.
|
|
657
|
+
"@data-slot/dropdown-menu@^1.1.3",
|
|
658
658
|
"@lucide/astro"
|
|
659
659
|
],
|
|
660
660
|
"files": [
|
|
@@ -873,8 +873,8 @@
|
|
|
873
873
|
],
|
|
874
874
|
"docs": "https://ui.full.dev/components/hover-card/",
|
|
875
875
|
"dependencies": [
|
|
876
|
-
"@data-slot/hover-card@^1.1.
|
|
877
|
-
"@data-slot/core@^1.1.
|
|
876
|
+
"@data-slot/hover-card@^1.1.3",
|
|
877
|
+
"@data-slot/core@^1.1.3"
|
|
878
878
|
],
|
|
879
879
|
"files": [
|
|
880
880
|
{
|
|
@@ -1242,6 +1242,10 @@
|
|
|
1242
1242
|
"path": "src/components/ui/carousel/carousel-previous.astro",
|
|
1243
1243
|
"type": "registry:ui"
|
|
1244
1244
|
},
|
|
1245
|
+
{
|
|
1246
|
+
"path": "src/components/ui/carousel/carousel-indicator.astro",
|
|
1247
|
+
"type": "registry:ui"
|
|
1248
|
+
},
|
|
1245
1249
|
{
|
|
1246
1250
|
"path": "src/components/ui/carousel/index.ts",
|
|
1247
1251
|
"type": "registry:ui"
|
|
@@ -1258,7 +1262,7 @@
|
|
|
1258
1262
|
],
|
|
1259
1263
|
"docs": "https://ui.full.dev/components/navigation-menu/",
|
|
1260
1264
|
"dependencies": [
|
|
1261
|
-
"@data-slot/navigation-menu@^1.1.
|
|
1265
|
+
"@data-slot/navigation-menu@^1.1.3",
|
|
1262
1266
|
"@lucide/astro"
|
|
1263
1267
|
],
|
|
1264
1268
|
"files": [
|
|
@@ -1345,7 +1349,7 @@
|
|
|
1345
1349
|
],
|
|
1346
1350
|
"docs": "https://ui.full.dev/components/popover/",
|
|
1347
1351
|
"dependencies": [
|
|
1348
|
-
"@data-slot/popover@^1.1.
|
|
1352
|
+
"@data-slot/popover@^1.1.3"
|
|
1349
1353
|
],
|
|
1350
1354
|
"files": [
|
|
1351
1355
|
{
|
|
@@ -1440,7 +1444,7 @@
|
|
|
1440
1444
|
],
|
|
1441
1445
|
"docs": "https://ui.full.dev/components/radio-group/",
|
|
1442
1446
|
"dependencies": [
|
|
1443
|
-
"@data-slot/radio-group@^1.1.
|
|
1447
|
+
"@data-slot/radio-group@^1.1.3"
|
|
1444
1448
|
],
|
|
1445
1449
|
"files": [
|
|
1446
1450
|
{
|
|
@@ -1490,7 +1494,7 @@
|
|
|
1490
1494
|
],
|
|
1491
1495
|
"docs": "https://ui.full.dev/components/select/",
|
|
1492
1496
|
"dependencies": [
|
|
1493
|
-
"@data-slot/select@^1.1.
|
|
1497
|
+
"@data-slot/select@^1.1.3",
|
|
1494
1498
|
"@lucide/astro"
|
|
1495
1499
|
],
|
|
1496
1500
|
"files": [
|
|
@@ -1594,7 +1598,7 @@
|
|
|
1594
1598
|
],
|
|
1595
1599
|
"docs": "https://ui.full.dev/components/sheet/",
|
|
1596
1600
|
"dependencies": [
|
|
1597
|
-
"@data-slot/dialog@^1.1.
|
|
1601
|
+
"@data-slot/dialog@^1.1.3",
|
|
1598
1602
|
"@lucide/astro"
|
|
1599
1603
|
],
|
|
1600
1604
|
"registryDependencies": [
|
|
@@ -1650,7 +1654,7 @@
|
|
|
1650
1654
|
],
|
|
1651
1655
|
"docs": "https://ui.full.dev/components/sidebar/",
|
|
1652
1656
|
"dependencies": [
|
|
1653
|
-
"@data-slot/tooltip@^1.1.
|
|
1657
|
+
"@data-slot/tooltip@^1.1.3",
|
|
1654
1658
|
"@lucide/astro"
|
|
1655
1659
|
],
|
|
1656
1660
|
"registryDependencies": [
|
|
@@ -1771,7 +1775,7 @@
|
|
|
1771
1775
|
],
|
|
1772
1776
|
"docs": "https://ui.full.dev/components/slider/",
|
|
1773
1777
|
"dependencies": [
|
|
1774
|
-
"@data-slot/slider@^1.1.
|
|
1778
|
+
"@data-slot/slider@^1.1.3"
|
|
1775
1779
|
],
|
|
1776
1780
|
"files": [
|
|
1777
1781
|
{
|
|
@@ -1837,7 +1841,7 @@
|
|
|
1837
1841
|
],
|
|
1838
1842
|
"docs": "https://ui.full.dev/components/switch/",
|
|
1839
1843
|
"dependencies": [
|
|
1840
|
-
"@data-slot/switch@^1.1.
|
|
1844
|
+
"@data-slot/switch@^1.1.3"
|
|
1841
1845
|
],
|
|
1842
1846
|
"files": [
|
|
1843
1847
|
{
|
|
@@ -1908,7 +1912,7 @@
|
|
|
1908
1912
|
],
|
|
1909
1913
|
"docs": "https://ui.full.dev/components/tabs/",
|
|
1910
1914
|
"dependencies": [
|
|
1911
|
-
"@data-slot/tabs@^1.1.
|
|
1915
|
+
"@data-slot/tabs@^1.1.3"
|
|
1912
1916
|
],
|
|
1913
1917
|
"files": [
|
|
1914
1918
|
{
|
|
@@ -1983,7 +1987,7 @@
|
|
|
1983
1987
|
],
|
|
1984
1988
|
"docs": "https://ui.full.dev/components/toggle/",
|
|
1985
1989
|
"dependencies": [
|
|
1986
|
-
"@data-slot/toggle@^1.1.
|
|
1990
|
+
"@data-slot/toggle@^1.1.3"
|
|
1987
1991
|
],
|
|
1988
1992
|
"files": [
|
|
1989
1993
|
{
|
|
@@ -2030,7 +2034,7 @@
|
|
|
2030
2034
|
],
|
|
2031
2035
|
"docs": "https://ui.full.dev/components/tooltip/",
|
|
2032
2036
|
"dependencies": [
|
|
2033
|
-
"@data-slot/tooltip@^1.1.
|
|
2037
|
+
"@data-slot/tooltip@^1.1.3"
|
|
2034
2038
|
],
|
|
2035
2039
|
"files": [
|
|
2036
2040
|
{
|
|
@@ -2165,7 +2169,7 @@
|
|
|
2165
2169
|
],
|
|
2166
2170
|
"docs": "https://ui.full.dev/components/drawer/",
|
|
2167
2171
|
"dependencies": [
|
|
2168
|
-
"@data-slot/drawer@^1.1.
|
|
2172
|
+
"@data-slot/drawer@^1.1.3"
|
|
2169
2173
|
],
|
|
2170
2174
|
"registryDependencies": [
|
|
2171
2175
|
"@fulldev/button"
|
|
@@ -2255,7 +2259,7 @@
|
|
|
2255
2259
|
],
|
|
2256
2260
|
"docs": "https://ui.full.dev/components/resizable/",
|
|
2257
2261
|
"dependencies": [
|
|
2258
|
-
"@data-slot/resizable@^1.1.
|
|
2262
|
+
"@data-slot/resizable@^1.1.3"
|
|
2259
2263
|
],
|
|
2260
2264
|
"files": [
|
|
2261
2265
|
{
|
|
@@ -2286,7 +2290,7 @@
|
|
|
2286
2290
|
],
|
|
2287
2291
|
"docs": "https://ui.full.dev/components/toast/",
|
|
2288
2292
|
"dependencies": [
|
|
2289
|
-
"@data-slot/toast@^1.1.
|
|
2293
|
+
"@data-slot/toast@^1.1.3",
|
|
2290
2294
|
"@lucide/astro"
|
|
2291
2295
|
],
|
|
2292
2296
|
"registryDependencies": [
|
|
@@ -2353,7 +2357,7 @@
|
|
|
2353
2357
|
],
|
|
2354
2358
|
"docs": "https://ui.full.dev/components/toggle-group/",
|
|
2355
2359
|
"dependencies": [
|
|
2356
|
-
"@data-slot/toggle-group@^1.1.
|
|
2360
|
+
"@data-slot/toggle-group@^1.1.3"
|
|
2357
2361
|
],
|
|
2358
2362
|
"registryDependencies": [
|
|
2359
2363
|
"@fulldev/toggle"
|
|
@@ -2533,6 +2537,64 @@
|
|
|
2533
2537
|
}
|
|
2534
2538
|
]
|
|
2535
2539
|
},
|
|
2540
|
+
{
|
|
2541
|
+
"name": "number-field",
|
|
2542
|
+
"type": "registry:ui",
|
|
2543
|
+
"title": "Number Field",
|
|
2544
|
+
"description": "A number input with decrement and increment buttons.",
|
|
2545
|
+
"categories": [
|
|
2546
|
+
"ui"
|
|
2547
|
+
],
|
|
2548
|
+
"docs": "https://ui.full.dev/components/number-field/",
|
|
2549
|
+
"dependencies": [
|
|
2550
|
+
"@lucide/astro"
|
|
2551
|
+
],
|
|
2552
|
+
"registryDependencies": [
|
|
2553
|
+
"@fulldev/input-group"
|
|
2554
|
+
],
|
|
2555
|
+
"files": [
|
|
2556
|
+
{
|
|
2557
|
+
"path": "src/components/ui/number-field/number-field.astro",
|
|
2558
|
+
"type": "registry:ui"
|
|
2559
|
+
},
|
|
2560
|
+
{
|
|
2561
|
+
"path": "src/components/ui/number-field/number-field-decrement.astro",
|
|
2562
|
+
"type": "registry:ui"
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
"path": "src/components/ui/number-field/number-field-increment.astro",
|
|
2566
|
+
"type": "registry:ui"
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
"path": "src/components/ui/number-field/number-field-input.astro",
|
|
2570
|
+
"type": "registry:ui"
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
"path": "src/components/ui/number-field/index.ts",
|
|
2574
|
+
"type": "registry:ui"
|
|
2575
|
+
}
|
|
2576
|
+
]
|
|
2577
|
+
},
|
|
2578
|
+
{
|
|
2579
|
+
"name": "swatch",
|
|
2580
|
+
"type": "registry:ui",
|
|
2581
|
+
"title": "Swatch",
|
|
2582
|
+
"description": "A color or pattern beside an option or filter value.",
|
|
2583
|
+
"categories": [
|
|
2584
|
+
"ui"
|
|
2585
|
+
],
|
|
2586
|
+
"docs": "https://ui.full.dev/components/swatch/",
|
|
2587
|
+
"files": [
|
|
2588
|
+
{
|
|
2589
|
+
"path": "src/components/ui/swatch/swatch.astro",
|
|
2590
|
+
"type": "registry:ui"
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
"path": "src/components/ui/swatch/index.ts",
|
|
2594
|
+
"type": "registry:ui"
|
|
2595
|
+
}
|
|
2596
|
+
]
|
|
2597
|
+
},
|
|
2536
2598
|
{
|
|
2537
2599
|
"name": "components",
|
|
2538
2600
|
"type": "registry:item",
|
|
@@ -2578,6 +2640,7 @@
|
|
|
2578
2640
|
"@fulldev/marquee",
|
|
2579
2641
|
"@fulldev/native-select",
|
|
2580
2642
|
"@fulldev/navigation-menu",
|
|
2643
|
+
"@fulldev/number-field",
|
|
2581
2644
|
"@fulldev/pagination",
|
|
2582
2645
|
"@fulldev/popover",
|
|
2583
2646
|
"@fulldev/price",
|
|
@@ -2593,6 +2656,7 @@
|
|
|
2593
2656
|
"@fulldev/skeleton",
|
|
2594
2657
|
"@fulldev/slider",
|
|
2595
2658
|
"@fulldev/spinner",
|
|
2659
|
+
"@fulldev/swatch",
|
|
2596
2660
|
"@fulldev/switch",
|
|
2597
2661
|
"@fulldev/table",
|
|
2598
2662
|
"@fulldev/tabs",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "swatch",
|
|
4
|
+
"title": "Swatch",
|
|
5
|
+
"description": "A color or pattern beside an option or filter value.",
|
|
6
|
+
"files": [
|
|
7
|
+
{
|
|
8
|
+
"path": "src/components/ui/swatch/swatch.astro",
|
|
9
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\"> & {\n color?: string\n image?: string\n}\n\nconst { class: className, color, image, style, ...props } = Astro.props\n\nconst background = {\n \"background-color\": color,\n \"background-image\": image ? `url(${JSON.stringify(image)})` : undefined,\n}\nconst backgroundText = Object.entries(background)\n .filter(([, value]) => value)\n .map(([property, value]) => `${property}: ${value}`)\n .join(\"; \")\n---\n\n<span\n data-slot=\"swatch\"\n aria-hidden=\"true\"\n class={cn(\n \"rounded-full ring-1 ring-foreground/15 ring-inset inline-block size-4 shrink-0 bg-cover bg-center\",\n className\n )}\n style={\n typeof style === \"string\"\n ? [backgroundText, style].filter(Boolean).join(\"; \")\n : { ...background, ...style }\n }\n {...props}\n/>\n",
|
|
10
|
+
"type": "registry:ui"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"path": "src/components/ui/swatch/index.ts",
|
|
14
|
+
"content": "export { default as Swatch } from \"./swatch.astro\"\n",
|
|
15
|
+
"type": "registry:ui"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"docs": "https://ui.full.dev/components/swatch/",
|
|
19
|
+
"categories": [
|
|
20
|
+
"ui"
|
|
21
|
+
],
|
|
22
|
+
"type": "registry:ui"
|
|
23
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "Toggle Group",
|
|
5
5
|
"description": "A set of two-state buttons that can be toggled independently or as a single choice.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"@data-slot/toggle-group@^1.1.
|
|
7
|
+
"@data-slot/toggle-group@^1.1.3"
|
|
8
8
|
],
|
|
9
9
|
"registryDependencies": [
|
|
10
10
|
"@fulldev/toggle"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
{
|
|
15
15
|
"path": "src/components/ui/carousel/carousel.astro",
|
|
16
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { EmblaOptionsType } from \"embla-carousel\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n opts?: EmblaOptionsType\n orientation?: \"horizontal\" | \"vertical\"\n}\n\nconst {\n class: className,\n opts,\n orientation = opts?.axis === \"y\" ? \"vertical\" : \"horizontal\",\n \"aria-roledescription\": roleDescription = \"carousel\",\n \"data-slot\": dataSlot = \"carousel\",\n // A named section is a region landmark. Without a name it would have no\n // role, so it becomes a group, the other container role the APG carousel\n // allows.\n role = Astro.props[\"aria-label\"] || Astro.props[\"aria-labelledby\"]\n ? undefined\n : \"group\",\n ...props\n} = Astro.props\n\nconst resolvedOpts: EmblaOptionsType = {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n}\n---\n\n<section\n data-slot={dataSlot}\n data-orientation={orientation}\n data-carousel-options={JSON.stringify(resolvedOpts)}\n class={cn(\"group/carousel relative\", className)}\n role={role}\n aria-roledescription={roleDescription}\n {...props}\n>\n <slot />\n</section>\n\n<script>\n import EmblaCarousel, {\n type EmblaCarouselType,\n type EmblaOptionsType,\n } from \"embla-carousel\"\n\n type CarouselRoot = HTMLElement & {\n __fulldevCarouselApi?: EmblaCarouselType\n }\n\n const instances = new Map<CarouselRoot, () => void>()\n // A nested carousel owns its own parts. The data-carousel-* markers stay\n // in place when a caller overrides data-slot.\n const rootSelector = \"[data-carousel-options]\"\n const getParts = <T extends Element>(root: CarouselRoot, part: string) =>\n [...root.querySelectorAll<T>(`[data-carousel-${part}]`)].filter(\n (element) => element.closest(rootSelector) === root\n )\n const initialize = () => {\n for (const root of document.querySelectorAll<CarouselRoot>(rootSelector)) {\n if (instances.has(root)) continue\n const viewport = getParts<HTMLElement>(root, \"viewport\")[0]\n if (!viewport) continue\n const opts: EmblaOptionsType = JSON.parse(\n root.dataset.carouselOptions || \"{}\"\n )\n const api = EmblaCarousel(viewport, opts)\n root.__fulldevCarouselApi = api\n const previous = getParts<HTMLButtonElement>(root, \"previous\")\n const next = getParts<HTMLButtonElement>(root, \"next\")\n const emit = (type: \"carousel:init\" | \"carousel:select\") => {\n root.dispatchEvent(\n new CustomEvent(type, {\n detail: {\n api,\n canScrollPrev: api.canScrollPrev(),\n canScrollNext: api.canScrollNext(),\n selectedScrollSnap: api.selectedScrollSnap(),\n scrollSnapList: api.scrollSnapList(),\n },\n })\n )\n }\n const sync = () => {\n root.dataset.canScrollPrev = String(api.canScrollPrev())\n root.dataset.canScrollNext = String(api.canScrollNext())\n root.dataset.selectedScrollSnap = String(api.selectedScrollSnap())\n for (const button of previous)\n if (button.dataset.manualDisabled !== \"true\")\n button.disabled = !api.canScrollPrev()\n for (const button of next)\n if (button.dataset.manualDisabled !== \"true\")\n button.disabled = !api.canScrollNext()\n emit(\"carousel:select\")\n }\n const jump = () =>\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n const onPrevious = () => api.scrollPrev(jump())\n const onNext = () => api.scrollNext(jump())\n const onKeyDown = (event: KeyboardEvent) => {\n const target = event.target\n if (\n event.defaultPrevented ||\n !(target instanceof Element) ||\n target.closest(rootSelector) !== root ||\n target.closest(\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n )\n )\n return\n const vertical = root.dataset.orientation === \"vertical\"\n switch (event.key) {\n case vertical ? \"ArrowUp\" : \"ArrowLeft\":\n onPrevious()\n break\n case vertical ? \"ArrowDown\" : \"ArrowRight\":\n onNext()\n break\n case \"Home\":\n api.scrollTo(0, jump())\n break\n case \"End\":\n api.scrollTo(api.scrollSnapList().length - 1, jump())\n break\n default:\n return\n }\n event.preventDefault()\n }\n for (const button of previous)\n button.addEventListener(\"click\", onPrevious)\n for (const button of next) button.addEventListener(\"click\", onNext)\n root.addEventListener(\"keydown\", onKeyDown)\n api.on(\"select\", sync)\n api.on(\"reInit\", sync)\n sync()\n const frame = requestAnimationFrame(() => emit(\"carousel:init\"))\n instances.set(root, () => {\n cancelAnimationFrame(frame)\n for (const button of previous)\n button.removeEventListener(\"click\", onPrevious)\n for (const button of next) button.removeEventListener(\"click\", onNext)\n root.removeEventListener(\"keydown\", onKeyDown)\n api.off(\"select\", sync)\n api.off(\"reInit\", sync)\n api.destroy()\n delete root.__fulldevCarouselApi\n })\n }\n }\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const cleanup of instances.values()) cleanup()\n instances.clear()\n })\n</script>\n",
|
|
16
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { EmblaOptionsType } from \"embla-carousel\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n opts?: EmblaOptionsType\n orientation?: \"horizontal\" | \"vertical\"\n}\n\nconst {\n class: className,\n opts,\n orientation = opts?.axis === \"y\" ? \"vertical\" : \"horizontal\",\n \"aria-roledescription\": roleDescription = \"carousel\",\n \"data-slot\": dataSlot = \"carousel\",\n // A named section is a region landmark. Without a name it would have no\n // role, so it becomes a group, the other container role the APG carousel\n // allows.\n role = Astro.props[\"aria-label\"] || Astro.props[\"aria-labelledby\"]\n ? undefined\n : \"group\",\n ...props\n} = Astro.props\n\nconst resolvedOpts: EmblaOptionsType = {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n}\n---\n\n<section\n data-slot={dataSlot}\n data-orientation={orientation}\n data-carousel-options={JSON.stringify(resolvedOpts)}\n class={cn(\"group/carousel relative\", className)}\n role={role}\n aria-roledescription={roleDescription}\n {...props}\n>\n <slot />\n</section>\n\n<script>\n import EmblaCarousel, {\n type EmblaCarouselType,\n type EmblaOptionsType,\n } from \"embla-carousel\"\n\n type CarouselRoot = HTMLElement & {\n __fulldevCarouselApi?: EmblaCarouselType\n }\n\n const instances = new Map<CarouselRoot, () => void>()\n // A nested carousel owns its own parts. The data-carousel-* markers stay\n // in place when a caller overrides data-slot.\n const rootSelector = \"[data-carousel-options]\"\n const getParts = <T extends Element>(root: CarouselRoot, part: string) =>\n [...root.querySelectorAll<T>(`[data-carousel-${part}]`)].filter(\n (element) => element.closest(rootSelector) === root\n )\n const initialize = () => {\n for (const root of document.querySelectorAll<CarouselRoot>(rootSelector)) {\n if (instances.has(root)) continue\n const viewport = getParts<HTMLElement>(root, \"viewport\")[0]\n if (!viewport) continue\n const opts: EmblaOptionsType = JSON.parse(\n root.dataset.carouselOptions || \"{}\"\n )\n const api = EmblaCarousel(viewport, opts)\n // Whether Embla runs at the current breakpoint.\n const active = () => api.internalEngine().options.active !== false\n root.__fulldevCarouselApi = api\n const previous = getParts<HTMLButtonElement>(root, \"previous\")\n const next = getParts<HTMLButtonElement>(root, \"next\")\n // Indicators are read on each use, so thumbnails that a variant change\n // replaces keep working.\n const indicators = () => getParts<HTMLElement>(root, \"indicator\")\n const emit = (type: \"carousel:init\" | \"carousel:select\") => {\n root.dispatchEvent(\n new CustomEvent(type, {\n detail: {\n api,\n canScrollPrev: api.canScrollPrev(),\n canScrollNext: api.canScrollNext(),\n selectedScrollSnap: api.selectedScrollSnap(),\n scrollSnapList: api.scrollSnapList(),\n },\n })\n )\n }\n // As in data-slot, an indicator without a scroll position, such as the\n // last thumbnails when several slides show, is hidden, and all are while\n // Embla is inactive at the current breakpoint.\n const markIndicators = () => {\n const selected = active() ? api.selectedScrollSnap() : -1\n const positions = api.scrollSnapList().length\n for (const indicator of indicators()) {\n const index = Number(indicator.dataset.index)\n indicator.hidden =\n !active() ||\n !Number.isInteger(index) ||\n index < 0 ||\n index >= positions\n const current = index === selected\n indicator.dataset.state = current ? \"active\" : \"inactive\"\n if (current) indicator.setAttribute(\"aria-current\", \"true\")\n else indicator.removeAttribute(\"aria-current\")\n }\n }\n const sync = () => {\n root.dataset.canScrollPrev = String(api.canScrollPrev())\n root.dataset.canScrollNext = String(api.canScrollNext())\n root.dataset.selectedScrollSnap = String(api.selectedScrollSnap())\n for (const button of previous)\n if (button.dataset.manualDisabled !== \"true\")\n button.disabled = !api.canScrollPrev()\n for (const button of next)\n if (button.dataset.manualDisabled !== \"true\")\n button.disabled = !api.canScrollNext()\n markIndicators()\n emit(\"carousel:select\")\n }\n const jump = () =>\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n const onPrevious = () => api.scrollPrev(jump())\n const onNext = () => api.scrollNext(jump())\n const onClick = (event: MouseEvent) => {\n const indicator =\n event.target instanceof Element &&\n event.target.closest<HTMLElement>(\"[data-carousel-indicator]\")\n if (!indicator || indicator.closest(rootSelector) !== root) return\n const index = Number(indicator.dataset.index)\n if (\n Number.isInteger(index) &&\n index >= 0 &&\n index < api.scrollSnapList().length\n )\n api.scrollTo(index, jump())\n // Thumbnails a variant change replaced are marked, also when the\n // slide did not change.\n markIndicators()\n }\n const onKeyDown = (event: KeyboardEvent) => {\n const target = event.target\n if (\n event.defaultPrevented ||\n !(target instanceof Element) ||\n target.closest(rootSelector) !== root ||\n target.closest(\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n )\n )\n return\n const vertical = root.dataset.orientation === \"vertical\"\n switch (event.key) {\n case vertical ? \"ArrowUp\" : \"ArrowLeft\":\n onPrevious()\n break\n case vertical ? \"ArrowDown\" : \"ArrowRight\":\n onNext()\n break\n case \"Home\":\n api.scrollTo(0, jump())\n break\n case \"End\":\n api.scrollTo(api.scrollSnapList().length - 1, jump())\n break\n default:\n return\n }\n event.preventDefault()\n }\n for (const button of previous)\n button.addEventListener(\"click\", onPrevious)\n for (const button of next) button.addEventListener(\"click\", onNext)\n root.addEventListener(\"click\", onClick)\n root.addEventListener(\"keydown\", onKeyDown)\n api.on(\"select\", sync)\n api.on(\"reInit\", sync)\n sync()\n const frame = requestAnimationFrame(() => emit(\"carousel:init\"))\n instances.set(root, () => {\n cancelAnimationFrame(frame)\n for (const button of previous)\n button.removeEventListener(\"click\", onPrevious)\n for (const button of next) button.removeEventListener(\"click\", onNext)\n root.removeEventListener(\"click\", onClick)\n root.removeEventListener(\"keydown\", onKeyDown)\n api.off(\"select\", sync)\n api.off(\"reInit\", sync)\n api.destroy()\n delete root.__fulldevCarouselApi\n })\n }\n }\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n document.addEventListener(\"astro:before-swap\", () => {\n for (const cleanup of instances.values()) cleanup()\n instances.clear()\n })\n</script>\n",
|
|
17
17
|
"type": "registry:ui"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
@@ -36,9 +36,14 @@
|
|
|
36
36
|
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronLeftIcon from \"@lucide/astro/icons/chevron-left\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants, type ButtonVariantProps } from \"@/components/ui/button\"\n\ntype Props = Omit<HTMLAttributes<\"button\">, \"type\"> & ButtonVariantProps\n\nconst {\n class: className,\n variant = \"outline\",\n size = \"icon-sm\",\n disabled,\n \"data-slot\": dataSlot = \"carousel-previous\",\n ...props\n} = Astro.props\n---\n\n<button\n type=\"button\"\n data-slot={dataSlot}\n data-carousel-previous\n data-variant={variant}\n data-size={size}\n data-manual-disabled={disabled ? \"true\" : undefined}\n disabled={disabled}\n class={cn(\n buttonVariants({ variant, size }),\n \"rounded-full absolute touch-manipulation group-data-[orientation=horizontal]/carousel:inset-y-0 group-data-[orientation=horizontal]/carousel:-left-12 group-data-[orientation=horizontal]/carousel:my-auto\",\n \"group-data-[orientation=vertical]/carousel:-top-12 group-data-[orientation=vertical]/carousel:left-1/2 group-data-[orientation=vertical]/carousel:-translate-x-1/2 group-data-[orientation=vertical]/carousel:translate-y-0 group-data-[orientation=vertical]/carousel:rotate-90\",\n className\n )}\n {...props}\n>\n <slot>\n <ChevronLeftIcon aria-hidden=\"true\" />\n <span class=\"sr-only\">Previous slide</span>\n </slot>\n</button>\n",
|
|
37
37
|
"type": "registry:ui"
|
|
38
38
|
},
|
|
39
|
+
{
|
|
40
|
+
"path": "src/components/ui/carousel/carousel-indicator.astro",
|
|
41
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Omit<HTMLAttributes<\"button\">, \"type\"> & {\n index: number\n}\n\nconst {\n class: className,\n index,\n \"aria-label\": ariaLabel = `Go to slide ${index + 1}`,\n \"data-slot\": dataSlot = \"carousel-indicator\",\n ...props\n} = Astro.props\n---\n\n<button\n type=\"button\"\n data-slot={dataSlot}\n data-carousel-indicator\n data-index={index}\n aria-label={ariaLabel}\n class={cn(\n \"rounded-md bg-muted outline-2 outline-offset-2 outline-transparent transition-[outline-color,box-shadow] focus-visible:ring-3 focus-visible:ring-ring/50 data-[state=active]:not-focus-visible:outline-foreground relative block shrink-0 cursor-pointer overflow-hidden [&>img]:size-full [&>img]:object-cover\",\n className\n )}\n {...props}\n>\n <slot />\n</button>\n",
|
|
42
|
+
"type": "registry:ui"
|
|
43
|
+
},
|
|
39
44
|
{
|
|
40
45
|
"path": "src/components/ui/carousel/index.ts",
|
|
41
|
-
"content": "export type {\n EmblaCarouselType as CarouselApi,\n EmblaOptionsType as CarouselOptions,\n EmblaPluginType as CarouselPlugin,\n} from \"embla-carousel\"\n\nexport { default as Carousel } from \"./carousel.astro\"\nexport { default as CarouselContent } from \"./carousel-content.astro\"\nexport { default as CarouselItem } from \"./carousel-item.astro\"\nexport { default as CarouselPrevious } from \"./carousel-previous.astro\"\nexport { default as CarouselNext } from \"./carousel-next.astro\"\n",
|
|
46
|
+
"content": "export type {\n EmblaCarouselType as CarouselApi,\n EmblaOptionsType as CarouselOptions,\n EmblaPluginType as CarouselPlugin,\n} from \"embla-carousel\"\n\nexport { default as Carousel } from \"./carousel.astro\"\nexport { default as CarouselContent } from \"./carousel-content.astro\"\nexport { default as CarouselItem } from \"./carousel-item.astro\"\nexport { default as CarouselPrevious } from \"./carousel-previous.astro\"\nexport { default as CarouselNext } from \"./carousel-next.astro\"\nexport { default as CarouselIndicator } from \"./carousel-indicator.astro\"\n",
|
|
42
47
|
"type": "registry:ui"
|
|
43
48
|
}
|
|
44
49
|
],
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"title": "Combobox",
|
|
5
5
|
"description": "Autocomplete input with a list of suggestions.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"@data-slot/combobox@^1.1.
|
|
8
|
-
"@data-slot/core@^1.1.
|
|
7
|
+
"@data-slot/combobox@^1.1.3",
|
|
8
|
+
"@data-slot/core@^1.1.3",
|
|
9
9
|
"@lucide/astro"
|
|
10
10
|
],
|
|
11
11
|
"registryDependencies": [
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"title": "Command",
|
|
5
5
|
"description": "Command menu for search and quick actions.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"@data-slot/command@^1.1.
|
|
7
|
+
"@data-slot/command@^1.1.3",
|
|
8
8
|
"@lucide/astro",
|
|
9
|
-
"@data-slot/core@^1.1.
|
|
9
|
+
"@data-slot/core@^1.1.3"
|
|
10
10
|
],
|
|
11
11
|
"registryDependencies": [
|
|
12
12
|
"@fulldev/dialog"
|