drivn 1.13.1 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +28 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3109,21 +3109,32 @@ import { cn } from '@/utils/cn'
3109
3109
  const styles = {
3110
3110
  root: 'relative',
3111
3111
  list: 'flex items-center gap-1',
3112
- item: 'relative',
3112
+ item: 'relative group/item',
3113
3113
  trigger: cn(
3114
3114
  'inline-flex items-center gap-1 px-3 py-2',
3115
3115
  'text-sm font-medium text-foreground rounded-lg',
3116
3116
  'hover:bg-accent transition-colors cursor-pointer',
3117
3117
  'outline-none'
3118
3118
  ),
3119
- triggerIcon: 'w-3.5 h-3.5 transition-transform duration-200',
3119
+ triggerIcon: cn(
3120
+ 'w-3.5 h-3.5 transition-transform duration-200',
3121
+ 'group-hover/item:rotate-180',
3122
+ 'group-focus-within/item:rotate-180'
3123
+ ),
3120
3124
  content: cn(
3121
3125
  'absolute left-0 top-full min-w-[220px] z-50',
3122
3126
  'bg-card border border-border rounded-xl p-2',
3123
3127
  'shadow-lg shadow-black/8',
3124
3128
  'origin-[var(--origin)]',
3125
3129
  'transition-[opacity,visibility]',
3126
- 'duration-150 ease-in'
3130
+ 'duration-150 ease-in',
3131
+ 'opacity-0 invisible',
3132
+ 'group-hover/item:opacity-100',
3133
+ 'group-hover/item:visible',
3134
+ 'group-hover/item:ease-out',
3135
+ 'group-focus-within/item:opacity-100',
3136
+ 'group-focus-within/item:visible',
3137
+ 'group-focus-within/item:ease-out'
3127
3138
  ),
3128
3139
  link: cn(
3129
3140
  'flex w-full gap-3 px-3 py-2.5',
@@ -3169,7 +3180,7 @@ function Item({
3169
3180
  className?: string
3170
3181
  }) {
3171
3182
  return (
3172
- <li className={cn('group/item', styles.item, className)}>
3183
+ <li className={cn(styles.item, className)}>
3173
3184
  {children}
3174
3185
  </li>
3175
3186
  )
@@ -3181,9 +3192,18 @@ function Trigger({
3181
3192
  ...props
3182
3193
  }: React.ButtonHTMLAttributes<HTMLButtonElement>) {
3183
3194
  return (
3184
- <button className={cn(styles.trigger, className)} {...props}>
3195
+ <button
3196
+ className={cn(styles.trigger, className)}
3197
+ onMouseDown={(e) => {
3198
+ if (document.activeElement === e.currentTarget) {
3199
+ e.preventDefault()
3200
+ e.currentTarget.blur()
3201
+ }
3202
+ }}
3203
+ {...props}
3204
+ >
3185
3205
  {children}
3186
- <ChevronDown className={cn(styles.triggerIcon, 'group-hover/item:rotate-180')} />
3206
+ <ChevronDown className={styles.triggerIcon} />
3187
3207
  </button>
3188
3208
  )
3189
3209
  }
@@ -3198,14 +3218,7 @@ function Content({
3198
3218
  return (
3199
3219
  <div
3200
3220
  style={{ '--origin': '0 0' } as React.CSSProperties}
3201
- className={cn(
3202
- styles.content,
3203
- 'opacity-0 invisible',
3204
- 'group-hover/item:opacity-100',
3205
- 'group-hover/item:visible',
3206
- 'group-hover/item:ease-out',
3207
- className
3208
- )}
3221
+ className={cn(styles.content, className)}
3209
3222
  >
3210
3223
  {children}
3211
3224
  </div>
@@ -5066,7 +5079,7 @@ import { cn } from '@/utils/cn'
5066
5079
  - Components declare internal deps (other Drivn components)
5067
5080
  - Some components need npm packages (react-day-picker, cmdk, embla-carousel-react, sonner)
5068
5081
  - The CLI resolves and installs all dependencies automatically
5069
- `;var L={version:"1.13.1"};function M(e){return v.find(r=>r.name===e)}function Qe(e){let r=new Set,t=a=>{if(r.has(a))return;let l=M(a);l&&(l.dependencies.forEach(d=>t(d)),r.add(a));};return t(e),r.delete(e),[...r]}async function ze(){let e=new McpServer({name:"drivn",version:L.version});e.tool("list_components","List all available Drivn UI components with descriptions",{},async()=>({content:[{type:"text",text:JSON.stringify(v.map(t=>({name:t.name,description:t.description})),null,2)}]})),e.tool("get_component","Get the full source code and metadata for a Drivn component",{name:z$1.string().describe('Component name (e.g. "button", "dialog")')},async({name:t})=>{let a=M(t);if(!a)return {content:[{type:"text",text:`Component "${t}" not found. Use list_components to see available components.`}],isError:true};let l=R[t];return {content:[{type:"text",text:JSON.stringify({name:a.name,description:a.description,dependencies:a.dependencies,npmDependencies:a.npmDependencies,source:l},null,2)}]}}),e.tool("get_component_metadata","Get metadata only (no source code) for a Drivn component \u2014 useful for planning",{name:z$1.string().describe("Component name")},async({name:t})=>{let a=M(t);if(!a)return {content:[{type:"text",text:`Component "${t}" not found. Use list_components to see available components.`}],isError:true};let l=Qe(t);return {content:[{type:"text",text:JSON.stringify({name:a.name,description:a.description,dependencies:a.dependencies,npmDependencies:a.npmDependencies,allResolvedDependencies:l},null,2)}]}}),e.tool("search_components","Search Drivn components by name or description",{query:z$1.string().describe("Search query")},async({query:t})=>{let a=t.toLowerCase(),l=v.filter(d=>d.name.includes(a)||d.description.toLowerCase().includes(a));return {content:[{type:"text",text:l.length?JSON.stringify(l.map(d=>({name:d.name,description:d.description})),null,2):`No components matching "${t}".`}]}}),e.tool("get_installation_instructions","Get step-by-step installation instructions for one or more components",{components:z$1.array(z$1.string()).describe("Component names to install"),packageManager:z$1.enum(["npm","pnpm"]).optional().describe("Package manager (default: npm)")},async({components:t,packageManager:a})=>{let l=a??"npm",d=new Set,p=new Set,f=[],g=o=>{if(d.has(o))return;let s=M(o);if(!s){f.push(o);return}s.dependencies.forEach(i=>g(i)),s.npmDependencies.forEach(i=>p.add(i)),d.add(o);};if(t.forEach(g),f.length)return {content:[{type:"text",text:`Unknown components: ${f.join(", ")}. Use list_components to see available components.`}],isError:true};let N=l==="pnpm"?"pnpm dlx":"npx",m=l==="pnpm"?"pnpm add":"npm install",h=[];return h.push(`# Install components via CLI
5082
+ `;var L={version:"1.13.2"};function M(e){return v.find(r=>r.name===e)}function Qe(e){let r=new Set,t=a=>{if(r.has(a))return;let l=M(a);l&&(l.dependencies.forEach(d=>t(d)),r.add(a));};return t(e),r.delete(e),[...r]}async function ze(){let e=new McpServer({name:"drivn",version:L.version});e.tool("list_components","List all available Drivn UI components with descriptions",{},async()=>({content:[{type:"text",text:JSON.stringify(v.map(t=>({name:t.name,description:t.description})),null,2)}]})),e.tool("get_component","Get the full source code and metadata for a Drivn component",{name:z$1.string().describe('Component name (e.g. "button", "dialog")')},async({name:t})=>{let a=M(t);if(!a)return {content:[{type:"text",text:`Component "${t}" not found. Use list_components to see available components.`}],isError:true};let l=R[t];return {content:[{type:"text",text:JSON.stringify({name:a.name,description:a.description,dependencies:a.dependencies,npmDependencies:a.npmDependencies,source:l},null,2)}]}}),e.tool("get_component_metadata","Get metadata only (no source code) for a Drivn component \u2014 useful for planning",{name:z$1.string().describe("Component name")},async({name:t})=>{let a=M(t);if(!a)return {content:[{type:"text",text:`Component "${t}" not found. Use list_components to see available components.`}],isError:true};let l=Qe(t);return {content:[{type:"text",text:JSON.stringify({name:a.name,description:a.description,dependencies:a.dependencies,npmDependencies:a.npmDependencies,allResolvedDependencies:l},null,2)}]}}),e.tool("search_components","Search Drivn components by name or description",{query:z$1.string().describe("Search query")},async({query:t})=>{let a=t.toLowerCase(),l=v.filter(d=>d.name.includes(a)||d.description.toLowerCase().includes(a));return {content:[{type:"text",text:l.length?JSON.stringify(l.map(d=>({name:d.name,description:d.description})),null,2):`No components matching "${t}".`}]}}),e.tool("get_installation_instructions","Get step-by-step installation instructions for one or more components",{components:z$1.array(z$1.string()).describe("Component names to install"),packageManager:z$1.enum(["npm","pnpm"]).optional().describe("Package manager (default: npm)")},async({components:t,packageManager:a})=>{let l=a??"npm",d=new Set,p=new Set,f=[],g=o=>{if(d.has(o))return;let s=M(o);if(!s){f.push(o);return}s.dependencies.forEach(i=>g(i)),s.npmDependencies.forEach(i=>p.add(i)),d.add(o);};if(t.forEach(g),f.length)return {content:[{type:"text",text:`Unknown components: ${f.join(", ")}. Use list_components to see available components.`}],isError:true};let N=l==="pnpm"?"pnpm dlx":"npx",m=l==="pnpm"?"pnpm add":"npm install",h=[];return h.push(`# Install components via CLI
5070
5083
  ${N} drivn@latest add ${[...d].join(" ")}`),p.size&&h.push(`# Install required npm dependencies
5071
5084
  ${m} ${[...p].join(" ")}`),h.push(`# Components will be installed to your configured components directory
5072
5085
  # (default: src/components/ui/)`),{content:[{type:"text",text:JSON.stringify({componentsToInstall:[...d],npmDependencies:[...p],steps:h},null,2)}]}}),e.tool("get_design_tokens","Get the Drivn CSS design tokens (base globals and theme tokens)",{},async()=>({content:[{type:"text",text:`/* === Base Globals === */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drivn",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "Modern UI components for React — add beautiful, accessible components to your project",
5
5
  "license": "MIT",
6
6
  "type": "module",