### Install Dependencies Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Run this command in the launcher directory to install all necessary project dependencies. ```bash npm install ``` -------------------------------- ### Quick Start Astro Component Setup Source: https://github.com/incluud/accessible-astro-launcher/blob/main/README.md Integrate the Accessible Astro Launcher into your Astro project by importing and using its components. This example shows how to set up triggers, preferences, and navigation links. ```astro --- import { Launcher, LauncherTrigger, LauncherPreferences, LauncherSwitch, LauncherNav, LauncherLink, } from 'accessible-astro-launcher' --- ``` -------------------------------- ### Install Accessible Astro Launcher Source: https://github.com/incluud/accessible-astro-launcher/blob/main/README.md Install the Accessible Astro Launcher package using npm, pnpm, or yarn. ```bash # npm npm install accessible-astro-launcher # pnpm pnpm add accessible-astro-launcher # yarn yarn add accessible-astro-launcher ``` -------------------------------- ### Format Code Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Execute this command to format the entire project according to Prettier standards. ```bash npx prettier --write . ``` -------------------------------- ### Link Local Package Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Use npm link to connect the launcher to consuming projects for local development and testing. ```bash # From the launcher directory npm link # In consuming project npm link accessible-astro-launcher ``` -------------------------------- ### Handle Launcher Actions Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Listen for the 'launcher:action' custom event to perform actions like toggling dark mode or logging out. ```javascript document.addEventListener('launcher:action', (e) => { switch (e.detail.action) { case 'toggle-dark-mode': window.darkMode?.toggle() break case 'logout': window.location.href = '/logout' break } }) ``` -------------------------------- ### Publish to NPM Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Commands to publish the launcher package to NPM after updating the version and testing. ```bash npm publish ``` -------------------------------- ### Launcher Component Structure Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Overview of the file structure for the Accessible Astro Launcher package, detailing the location of components, styles, and type definitions. ```bash accessible-astro-launcher/ ├── src/ │ ├── components/ │ │ └── launcher/ │ │ ├── Launcher.astro # Main dialog component │ │ ├── LauncherTrigger.astro # Search field trigger │ │ ├── LauncherPreferences.astro # Fieldset wrapper for preference switches │ │ ├── LauncherSwitch.astro # Toggle switch item │ │ ├── LauncherNav.astro # Navigation wrapper with heading │ │ └── LauncherLink.astro # Semantic link item │ ├── styles/ │ │ └── index.css # All component styles │ └── types/ │ └── index.d.ts # TypeScript definitions ├── index.js # Package exports ├── package.json ├── tsconfig.json ├── .prettierrc ├── README.md └── LICENSE ``` -------------------------------- ### Update Consuming Projects Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md After publishing, update the launcher in consuming projects using npm update. ```bash cd ../accessible-astro-starter npm update accessible-astro-launcher ``` -------------------------------- ### LauncherLink Component Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md A semantic link item for navigation within the launcher. It supports additional search keywords and custom type labels. ```APIDOC ## LauncherLink Component ### Description Semantic link item for navigation. ### Props - **label** (string) - Required - Display text - **href** (string) - Required - URL for navigation - **keywords** (string[]) - Optional - Additional search keywords - **typeLabel** (string) - Optional - i18n label for type indicator (default: "Go to") - **class** (string) - Optional - Additional CSS classes - **[key: string]: string | string[] | undefined** - Additional HTML attributes to apply to the anchor (e.g., target, rel, aria-*) ### Slots - **icon** - Custom icon for navigation items Extra attributes passed to `LauncherLink` are forwarded to the rendered anchor element. ``` -------------------------------- ### LauncherNav Component Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md A navigation wrapper component that includes a heading for organizing navigation links within the launcher. ```APIDOC ## LauncherNav Component ### Description Navigation wrapper with heading. ### Props - **label** (string) - Required - Group heading text - **headingLevel** (2 | 3 | 4 | 5 | 6) - Optional - Heading level (default: 3) - **class** (string) - Optional - Additional CSS classes - **[key: string]: string | number | undefined** - Additional HTML attributes to apply to the nav element ### Slots - **default** - LauncherLink items ``` -------------------------------- ### Launcher Component Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md The main dialog component that houses the search input and displays results. It requires a unique ID to be linked with its triggers. ```APIDOC ## Launcher Component ### Description The main dialog component containing search input and results. ### Props - **id** (string) - Required - Unique identifier (must match `launcherId` on triggers) - **labels** (LauncherLabels) - Optional - i18n labels object (exported type) - **class** (string) - Optional - Additional CSS classes ``` -------------------------------- ### LauncherTrigger Component Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md A trigger button that opens the launcher. It can display the keyboard shortcut and can be configured for different visual modes. ```APIDOC ## LauncherTrigger Component ### Description A trigger button that opens the launcher with keyboard shortcut display. ### Props - **launcherId** (string) - Required - ID of the launcher to open - **id** (string) - Optional - Optional trigger element ID - **placeholder** (string) - Optional - Placeholder text (default: "Search") - **shortcutKey** (string) - Optional - Keyboard shortcut key display (default: "K") - **compact** (boolean) - Optional - Compact mode without placeholder text - **iconOnly** (boolean) - Optional - Icon-only mode - **gradientBorder** (boolean) - Optional - Animated gradient border effect - **class** (string) - Optional - Additional CSS classes ``` -------------------------------- ### Verify Symlink Command Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Use this command to verify the symlink in the node_modules directory when troubleshooting symlink issues. ```bash ls -la ../accessible-astro-starter/node_modules/accessible-astro-launcher ``` -------------------------------- ### CSS Custom Properties for Launcher Styling Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Customize the launcher's appearance using these CSS variables. They control colors, dimensions, spacing, and animation properties. ```css :root { /* Colors */ --launcher-theme-light: #fff; --launcher-theme-dark: #090b0f; --launcher-text-color: /* auto light/dark */; --launcher-subtle-text-color: /* auto light/dark */; /* Dimensions */ --launcher-width: min(90vw, 650px); --launcher-height: min(60vh, 500px); /* Spacing */ --launcher-space-xs: /* fluid */; --launcher-space-sm: /* fluid */; --launcher-space-md: /* fluid */; /* Animation */ --launcher-animation-duration: 0.2s; --launcher-animation-timing: cubic-bezier(0.165, 0.84, 0.44, 1); } ``` -------------------------------- ### LauncherPreferences Component Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md A fieldset wrapper component used to group preference switches within the launcher. ```APIDOC ## LauncherPreferences Component ### Description Fieldset wrapper for preference switches. ### Props - **label** (string) - Required - Group heading text - **class** (string) - Optional - Additional CSS classes - **[key: string]: string | undefined** - Additional HTML attributes to apply to the fieldset ``` -------------------------------- ### Clear Cache Command Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Clear the Astro and Vite caches by removing these directories when troubleshooting issues. ```bash rm -rf node_modules/.astro node_modules/.vite ``` -------------------------------- ### LauncherSwitch Component Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md A toggle switch item used for preference settings within the launcher. It supports custom actions and search keywords. ```APIDOC ## LauncherSwitch Component ### Description Toggle switch item for preferences. ### Props - **label** (string) - Required - Display text - **onAction** (string) - Required - Action identifier for action items - **checked** (boolean) - Optional - Initial checked state (maps to aria-checked) - **keywords** (string[]) - Optional - Additional search keywords - **class** (string) - Optional - Additional CSS classes - **[key: string]: string | string[] | boolean | undefined** - Additional HTML attributes to apply to the wrapper ``` -------------------------------- ### Conventional Commits Format Source: https://github.com/incluud/accessible-astro-launcher/blob/main/AGENTS.md Adhere to the conventional commits format for commit messages. This includes a type, optional scope, and a subject line. ```text type(scope): subject ``` ```text feat(switch): add typeLabel prop for i18n ``` ```text fix(launcher): improve search debouncing ``` ```text a11y(switch): enhance LED indicator contrast ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.