@uselets/ui 2.0.0 → 2.0.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 (209) hide show
  1. package/dist/{as-child-Dxg3Xo1G.d.ts → as-child-T9W73ZYU.d.ts} +1 -3
  2. package/dist/{chart-B_6nC_ih.d.ts → chart-8rgtsk95.d.ts} +1 -3
  3. package/dist/cli/uselets.mjs.map +1 -1
  4. package/dist/components/accordion.d.ts +1 -3
  5. package/dist/components/accordion.js.map +1 -1
  6. package/dist/components/alert-dialog.d.ts +5 -5
  7. package/dist/components/alert-dialog.js +1 -1
  8. package/dist/components/alert-dialog.js.map +1 -1
  9. package/dist/components/alert.d.ts +0 -2
  10. package/dist/components/alert.js.map +1 -1
  11. package/dist/components/anchor.d.ts +1 -3
  12. package/dist/components/anchor.js.map +1 -1
  13. package/dist/components/area-chart.d.ts +1 -3
  14. package/dist/components/area-chart.js.map +1 -1
  15. package/dist/components/avatar.d.ts +1 -3
  16. package/dist/components/avatar.js.map +1 -1
  17. package/dist/components/badge.d.ts +1 -3
  18. package/dist/components/badge.js.map +1 -1
  19. package/dist/components/bar-chart.d.ts +1 -3
  20. package/dist/components/bar-chart.js.map +1 -1
  21. package/dist/components/bottom-nav.d.ts +1 -3
  22. package/dist/components/bottom-nav.js.map +1 -1
  23. package/dist/components/breadcrumb.d.ts +1 -3
  24. package/dist/components/breadcrumb.js.map +1 -1
  25. package/dist/components/button-group.d.ts +1 -3
  26. package/dist/components/button-group.js.map +1 -1
  27. package/dist/components/button.d.ts +1 -3
  28. package/dist/components/button.js.map +1 -1
  29. package/dist/components/calendar.d.ts +0 -2
  30. package/dist/components/calendar.js +1 -1
  31. package/dist/components/calendar.js.map +1 -1
  32. package/dist/components/card.d.ts +0 -2
  33. package/dist/components/card.js.map +1 -1
  34. package/dist/components/carousel.d.ts +0 -2
  35. package/dist/components/carousel.js.map +1 -1
  36. package/dist/components/center.d.ts +0 -2
  37. package/dist/components/center.js.map +1 -1
  38. package/dist/components/chart.d.ts +1 -1
  39. package/dist/components/chart.js.map +1 -1
  40. package/dist/components/checkbox.d.ts +0 -2
  41. package/dist/components/checkbox.js.map +1 -1
  42. package/dist/components/code.d.ts +0 -2
  43. package/dist/components/code.js.map +1 -1
  44. package/dist/components/collapsible.d.ts +1 -3
  45. package/dist/components/collapsible.js.map +1 -1
  46. package/dist/components/combobox.d.ts +1 -3
  47. package/dist/components/combobox.js.map +1 -1
  48. package/dist/components/command.d.ts +0 -2
  49. package/dist/components/command.js.map +1 -1
  50. package/dist/components/container.d.ts +0 -2
  51. package/dist/components/container.js.map +1 -1
  52. package/dist/components/data-table.d.ts +0 -2
  53. package/dist/components/data-table.js.map +1 -1
  54. package/dist/components/date-range-picker.d.ts +0 -2
  55. package/dist/components/date-range-picker.js.map +1 -1
  56. package/dist/components/dialog.d.ts +5 -5
  57. package/dist/components/dialog.js +1 -1
  58. package/dist/components/dialog.js.map +1 -1
  59. package/dist/components/direction.d.ts +0 -2
  60. package/dist/components/donut-chart.d.ts +0 -2
  61. package/dist/components/donut-chart.js.map +1 -1
  62. package/dist/components/drawer.d.ts +2 -4
  63. package/dist/components/drawer.js +1 -1
  64. package/dist/components/drawer.js.map +1 -1
  65. package/dist/components/dropdown-menu.d.ts +1 -3
  66. package/dist/components/dropdown-menu.js.map +1 -1
  67. package/dist/components/dropzone.d.ts +0 -2
  68. package/dist/components/dropzone.js.map +1 -1
  69. package/dist/components/empty.d.ts +0 -2
  70. package/dist/components/empty.js.map +1 -1
  71. package/dist/components/field.d.ts +0 -2
  72. package/dist/components/field.js.map +1 -1
  73. package/dist/components/flex.d.ts +0 -2
  74. package/dist/components/flex.js.map +1 -1
  75. package/dist/components/grid.d.ts +0 -2
  76. package/dist/components/grid.js.map +1 -1
  77. package/dist/components/group.d.ts +0 -2
  78. package/dist/components/group.js.map +1 -1
  79. package/dist/components/heading.d.ts +1 -3
  80. package/dist/components/heading.js.map +1 -1
  81. package/dist/components/hover-card.d.ts +1 -3
  82. package/dist/components/hover-card.js.map +1 -1
  83. package/dist/components/input-group.d.ts +0 -2
  84. package/dist/components/input-group.js.map +1 -1
  85. package/dist/components/input-otp.d.ts +0 -2
  86. package/dist/components/input-otp.js.map +1 -1
  87. package/dist/components/input.d.ts +0 -2
  88. package/dist/components/input.js.map +1 -1
  89. package/dist/components/kbd.d.ts +0 -2
  90. package/dist/components/kbd.js.map +1 -1
  91. package/dist/components/label.d.ts +1 -3
  92. package/dist/components/label.js.map +1 -1
  93. package/dist/components/list.d.ts +1 -3
  94. package/dist/components/list.js.map +1 -1
  95. package/dist/components/logo.d.ts +0 -2
  96. package/dist/components/marker.d.ts +1 -3
  97. package/dist/components/marker.js.map +1 -1
  98. package/dist/components/mask-input.d.ts +0 -2
  99. package/dist/components/mask-input.js.map +1 -1
  100. package/dist/components/native-select.d.ts +0 -2
  101. package/dist/components/native-select.js.map +1 -1
  102. package/dist/components/navigation-menu.d.ts +1 -3
  103. package/dist/components/navigation-menu.js.map +1 -1
  104. package/dist/components/number-field.d.ts +1 -3
  105. package/dist/components/number-field.js.map +1 -1
  106. package/dist/components/pagination.d.ts +0 -2
  107. package/dist/components/pagination.js.map +1 -1
  108. package/dist/components/phone-input.d.ts +0 -2
  109. package/dist/components/phone-input.js.map +1 -1
  110. package/dist/components/pie-chart.d.ts +1 -3
  111. package/dist/components/pie-chart.js.map +1 -1
  112. package/dist/components/popover.d.ts +1 -3
  113. package/dist/components/popover.js.map +1 -1
  114. package/dist/components/progress.d.ts +0 -2
  115. package/dist/components/progress.js.map +1 -1
  116. package/dist/components/radio-group.d.ts +0 -2
  117. package/dist/components/radio-group.js.map +1 -1
  118. package/dist/components/resizable.d.ts +0 -2
  119. package/dist/components/resizable.js.map +1 -1
  120. package/dist/components/ring-progress.d.ts +0 -2
  121. package/dist/components/ring-progress.js.map +1 -1
  122. package/dist/components/scroll-area.d.ts +0 -2
  123. package/dist/components/scroll-area.js.map +1 -1
  124. package/dist/components/select.d.ts +1 -3
  125. package/dist/components/select.js.map +1 -1
  126. package/dist/components/separator.d.ts +1 -3
  127. package/dist/components/separator.js.map +1 -1
  128. package/dist/components/sidebar.d.ts +1 -3
  129. package/dist/components/sidebar.js.map +1 -1
  130. package/dist/components/simple-grid.d.ts +0 -2
  131. package/dist/components/simple-grid.js.map +1 -1
  132. package/dist/components/skeleton.d.ts +0 -2
  133. package/dist/components/skeleton.js.map +1 -1
  134. package/dist/components/slider.d.ts +0 -2
  135. package/dist/components/slider.js.map +1 -1
  136. package/dist/components/sonner.d.ts +0 -2
  137. package/dist/components/sonner.js.map +1 -1
  138. package/dist/components/spinner.d.ts +0 -2
  139. package/dist/components/spinner.js.map +1 -1
  140. package/dist/components/stack.d.ts +0 -2
  141. package/dist/components/stack.js.map +1 -1
  142. package/dist/components/stepper.d.ts +1 -3
  143. package/dist/components/stepper.js.map +1 -1
  144. package/dist/components/switch.d.ts +0 -2
  145. package/dist/components/switch.js.map +1 -1
  146. package/dist/components/table.d.ts +0 -2
  147. package/dist/components/table.js.map +1 -1
  148. package/dist/components/tabs.d.ts +1 -3
  149. package/dist/components/tabs.js.map +1 -1
  150. package/dist/components/text.d.ts +1 -3
  151. package/dist/components/text.js.map +1 -1
  152. package/dist/components/textarea.d.ts +0 -2
  153. package/dist/components/textarea.js.map +1 -1
  154. package/dist/components/theme.d.ts +0 -2
  155. package/dist/components/theme.js.map +1 -1
  156. package/dist/components/timeline.d.ts +0 -2
  157. package/dist/components/timeline.js.map +1 -1
  158. package/dist/components/toggle-group.d.ts +1 -3
  159. package/dist/components/toggle-group.js.map +1 -1
  160. package/dist/components/toggle.d.ts +1 -3
  161. package/dist/components/toggle.js.map +1 -1
  162. package/dist/components/tooltip.d.ts +1 -3
  163. package/dist/components/tooltip.js.map +1 -1
  164. package/dist/components/unstyled-button.d.ts +1 -3
  165. package/dist/components/unstyled-button.js.map +1 -1
  166. package/dist/components/visibility.d.ts +0 -2
  167. package/dist/components/visibility.js.map +1 -1
  168. package/dist/hooks/use-breakpoint-value.d.ts +0 -2
  169. package/dist/hooks/use-breakpoint-value.js.map +1 -1
  170. package/dist/hooks/use-breakpoint.d.ts +0 -2
  171. package/dist/hooks/use-breakpoint.js.map +1 -1
  172. package/dist/hooks/use-disclosure.d.ts +0 -2
  173. package/dist/hooks/use-disclosure.js.map +1 -1
  174. package/dist/hooks/use-document-visibility.d.ts +0 -2
  175. package/dist/hooks/use-document-visibility.js.map +1 -1
  176. package/dist/hooks/use-hotkeys.d.ts +1 -1
  177. package/dist/hooks/use-idle.d.ts +0 -2
  178. package/dist/hooks/use-idle.js.map +1 -1
  179. package/dist/hooks/use-interval.d.ts +0 -2
  180. package/dist/hooks/use-interval.js.map +1 -1
  181. package/dist/hooks/use-local-storage.d.ts +0 -2
  182. package/dist/hooks/use-local-storage.js.map +1 -1
  183. package/dist/hooks/use-mask.d.ts +0 -2
  184. package/dist/hooks/use-mask.js.map +1 -1
  185. package/dist/hooks/use-mobile.d.ts +0 -2
  186. package/dist/hooks/use-mobile.js.map +1 -1
  187. package/dist/index.d.ts +3 -3
  188. package/dist/lib/as-child.d.ts +1 -1
  189. package/dist/lib/as-child.js.map +1 -1
  190. package/dist/lib/badge.d.ts +0 -2
  191. package/dist/lib/badge.js.map +1 -1
  192. package/dist/lib/button.d.ts +0 -2
  193. package/dist/lib/button.js.map +1 -1
  194. package/dist/lib/color.d.ts +0 -2
  195. package/dist/lib/color.js.map +1 -1
  196. package/dist/lib/compose-refs.d.ts +0 -2
  197. package/dist/lib/compose-refs.js.map +1 -1
  198. package/dist/lib/progress.d.ts +0 -2
  199. package/dist/lib/progress.js.map +1 -1
  200. package/dist/lib/utils.d.ts +0 -2
  201. package/dist/lib/utils.js.map +1 -1
  202. package/dist/logo--R3_XDgA.js.map +1 -1
  203. package/dist/postcss.config.js.map +1 -1
  204. package/dist/resolve-class-name-BurP8ngI.js.map +1 -1
  205. package/dist/skills/uselets-ui/references/component-catalog.md +3 -3
  206. package/dist/{use-hotkeys-D1_TEIwN.d.ts → use-hotkeys-BVm0IGb8.d.ts} +1 -5
  207. package/dist/use-hotkeys-YDJmGWX6.js.map +1 -1
  208. package/package.json +9 -9
  209. package/skills/uselets-ui/references/component-catalog.md +3 -3
@@ -1,6 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-BhWHdk3m.js";
2
2
  import * as React from "react";
3
- //#region src/lib/as-child.d.ts
4
3
  type AsChildTag = keyof React.JSX.IntrinsicElements;
5
4
  type AsChildProps<Tag extends AsChildTag> = React.ComponentProps<Tag> & {
6
5
  /** Renders the child element instead of the default one, passing this component's props and behavior to it. */
@@ -36,6 +35,5 @@ declare function toAsChildRenderProps<Children>(asChild: boolean | undefined, ch
36
35
  render?: React.ReactElement;
37
36
  children?: Children;
38
37
  };
39
- //#endregion
40
38
  export { useAsChild as i, AsChildProps as n, toAsChildRenderProps as r, AsChildPrimitiveProps as t };
41
- //# sourceMappingURL=as-child-Dxg3Xo1G.d.ts.map
39
+ //# sourceMappingURL=as-child-T9W73ZYU.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { t as __name } from "./rolldown-runtime-BhWHdk3m.js";
2
2
  import * as React from "react";
3
3
  import * as RechartsPrimitive from "recharts";
4
- //#region src/components/chart.d.ts
5
4
  declare const THEMES: {
6
5
  readonly light: '';
7
6
  readonly dark: '.dark';
@@ -49,6 +48,5 @@ declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
49
48
  declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }: ChartTooltipContentProps): React.JSX.Element | null;
50
49
  declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
51
50
  declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey }: ChartLegendContentProps): React.JSX.Element | null;
52
- //#endregion
53
51
  export { resolveChartColor as _, ChartContainerProps as a, ChartLegendContentProps as c, ChartStyleProps as d, ChartTooltip as f, DEFAULT_CHART_PALETTE as g, ChartTooltipProps as h, ChartContainer as i, ChartLegendProps as l, ChartTooltipContentProps as m, ChartColorKey as n, ChartLegend as o, ChartTooltipContent as p, ChartConfig as r, ChartLegendContent as s, CHART_COLOR_KEYS as t, ChartStyle as u };
54
- //# sourceMappingURL=chart-B_6nC_ih.d.ts.map
52
+ //# sourceMappingURL=chart-8rgtsk95.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uselets.mjs","names":["fs","path","readline","ENTRY_FILE_CANDIDATES","TAILWIND_IMPORT_PATTERN","THEME_IMPORT_PATTERN","PACKAGE_SOURCE_PATTERN","buildPackageSource","cssDir","cssPath","relativeSource","updateGlobalCss","tailwindMatch","source","themeMatch","hasTheme","themeBeforeTailwind","imports","theme","lines","separator","insertAt","SKILL_NAME","FONT_PACKAGE","AGENT_TARGETS","ALL_AGENT_TARGETS","pathExists","targetPath","readJsonFile","filePath","findPackageRoot","currentDir","fileURLToPath","parentDir","resolveTargets","agent","hasDependency","packageJson","dependencyName","detectPackageManager","declaredManager","projectRoot","buildAddCommand","packageManager","dev","dependencies","runCommand","command","args","commandParts","child","spawn","reject","code","resolve","getPackageVersion","version","installMissingDependencies","packageRoot","projectPackageJson","runtimeDependencies","devDependencies","installSkill","sourcePath","installedPaths","target","targets","installedPath","createPrompt","promptTheme","defaultTheme","prompt","answer","promptCssPath","defaultCssPath","promptInstallSkill","ensurePostcssConfig","postcssPath","ensureGlobalCss","absoluteCssPath","updatedSource","detectEntryFile","candidate","promptEntryPath","resolveEntryPath","entryOption","logManualFontImportInstructions","reason","ensureFontImport","entryPath","absoluteEntryPath","directiveMatch","insertion","initProject","packageJsonPath","options","shouldInstallSkill","main","program","Command","Option","error"],"sources":["../../src/cli/init.ts","../../src/cli/uselets.ts"],"sourcesContent":["import path from 'node:path'\n\nexport type ThemeOption = 'max' | 'gomax'\n\nexport const ENTRY_FILE_CANDIDATES = [\n 'app/layout.tsx',\n 'app/layout.jsx',\n 'src/app/layout.tsx',\n 'src/app/layout.jsx',\n 'pages/_app.tsx',\n 'pages/_app.jsx',\n 'src/pages/_app.tsx',\n 'src/pages/_app.jsx',\n 'src/main.tsx',\n 'src/main.jsx',\n 'src/index.tsx',\n 'src/index.jsx'\n]\n\nconst TAILWIND_IMPORT_PATTERN = /^[ \\t]*@import\\s+['\"]tailwindcss['\"][^\\n]*$/m\nconst THEME_IMPORT_PATTERN = /@import\\s+['\"]@uselets\\/ui\\/themes\\/(?:max|gomax)\\.css['\"]/\nconst PACKAGE_SOURCE_PATTERN = /@source\\s+['\"][^'\"]*@uselets\\/ui\\/dist['\"]/\n\nexport function buildPackageSource(cssPath: string) {\n const cssDir = path.posix.dirname(cssPath.replaceAll(path.sep, path.posix.sep))\n const relativeSource = path.posix.relative(cssDir, 'node_modules/@uselets/ui/dist')\n\n return relativeSource.startsWith('.') ? relativeSource : `./${relativeSource}`\n}\n\nexport type GlobalCssUpdate = {\n // `null` when the file already has every import.\n source: string | null\n hasTheme: boolean\n // An existing theme import placed before `@import 'tailwindcss'` lets Tailwind's preflight override the theme's\n // base styles; the file is left as is, so the caller should warn about it.\n themeBeforeTailwind: boolean\n}\n\nexport function updateGlobalCss(source: string, theme: ThemeOption, cssPath: string): GlobalCssUpdate {\n const tailwindMatch = TAILWIND_IMPORT_PATTERN.exec(source)\n const themeMatch = THEME_IMPORT_PATTERN.exec(source)\n const hasTheme = themeMatch !== null\n const themeBeforeTailwind = hasTheme && tailwindMatch !== null && themeMatch.index < tailwindMatch.index\n const imports = []\n\n if (!hasTheme) {\n imports.push(`@import '@uselets/ui/themes/${theme}.css';`)\n }\n\n if (!PACKAGE_SOURCE_PATTERN.test(source)) {\n imports.push(`@source '${buildPackageSource(cssPath)}';`)\n }\n\n if (!tailwindMatch) {\n // The theme must come after Tailwind so its base layer wins over the preflight reset.\n const lines = [\"@import 'tailwindcss';\", ...imports]\n const separator = source.length > 0 && !source.startsWith('\\n') ? '\\n' : ''\n\n return { source: `${lines.join('\\n')}${separator}${source}`, hasTheme, themeBeforeTailwind }\n }\n\n if (imports.length === 0) {\n return { source: null, hasTheme, themeBeforeTailwind }\n }\n\n const insertAt = tailwindMatch.index + tailwindMatch[0].length\n\n return {\n source: `${source.slice(0, insertAt)}\\n${imports.join('\\n')}${source.slice(insertAt)}`,\n hasTheme,\n themeBeforeTailwind\n }\n}\n","#!/usr/bin/env node\n\nimport { spawn } from 'node:child_process'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport readline from 'node:readline/promises'\nimport { fileURLToPath } from 'node:url'\n\nimport { Command, Option } from 'commander'\n\nimport { ENTRY_FILE_CANDIDATES, type ThemeOption, updateGlobalCss } from './init'\n\nconst SKILL_NAME = 'uselets-ui'\nconst DEFAULT_CSS_PATH = 'src/styles/globals.css'\nconst FONT_PACKAGE = '@fontsource-variable/inter'\nconst POSTCSS_CONFIG = \"export { default } from '@uselets/ui/postcss.config'\\n\"\nconst AGENT_TARGETS = {\n codex: path.join('.agents', 'skills', SKILL_NAME),\n claude: path.join('.claude', 'skills', SKILL_NAME)\n} as const\n\ntype AgentTarget = keyof typeof AGENT_TARGETS\ntype AgentOption = AgentTarget | 'all'\ntype PackageManager = 'bun' | 'pnpm' | 'yarn' | 'npm'\ntype PackageJson = {\n name?: string\n version?: string\n packageManager?: string\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n peerDependencies?: Record<string, string>\n optionalDependencies?: Record<string, string>\n}\ntype InitOptions = {\n theme?: ThemeOption\n css?: string\n entry?: string\n installSkill?: boolean\n}\n\nconst ALL_AGENT_TARGETS = Object.keys(AGENT_TARGETS) as AgentTarget[]\n\nasync function pathExists(targetPath: string) {\n try {\n await fs.access(targetPath)\n return true\n } catch {\n return false\n }\n}\n\nasync function readJsonFile<T>(filePath: string) {\n return JSON.parse(await fs.readFile(filePath, 'utf8')) as T\n}\n\nasync function findPackageRoot() {\n let currentDir = fileURLToPath(new URL('.', import.meta.url))\n\n while (true) {\n try {\n await fs.access(path.join(currentDir, 'package.json'))\n return currentDir\n } catch {\n const parentDir = path.dirname(currentDir)\n\n if (parentDir === currentDir) {\n throw new Error('Unable to resolve @uselets/ui package root')\n }\n\n currentDir = parentDir\n }\n }\n}\n\nfunction resolveTargets(agent: AgentOption) {\n return agent === 'all' ? ALL_AGENT_TARGETS : [agent]\n}\n\nfunction hasDependency(packageJson: PackageJson, dependencyName: string) {\n return Boolean(\n packageJson.dependencies?.[dependencyName] ||\n packageJson.devDependencies?.[dependencyName] ||\n packageJson.peerDependencies?.[dependencyName] ||\n packageJson.optionalDependencies?.[dependencyName]\n )\n}\n\nasync function detectPackageManager(projectRoot: string, packageJson: PackageJson): Promise<PackageManager> {\n const declaredManager = packageJson.packageManager?.split('@')[0]\n\n if (\n declaredManager === 'bun' ||\n declaredManager === 'pnpm' ||\n declaredManager === 'yarn' ||\n declaredManager === 'npm'\n ) {\n return declaredManager\n }\n\n if (await pathExists(path.join(projectRoot, 'bun.lock'))) {\n return 'bun'\n }\n\n if (await pathExists(path.join(projectRoot, 'pnpm-lock.yaml'))) {\n return 'pnpm'\n }\n\n if (await pathExists(path.join(projectRoot, 'yarn.lock'))) {\n return 'yarn'\n }\n\n if (await pathExists(path.join(projectRoot, 'package-lock.json'))) {\n return 'npm'\n }\n\n return 'npm'\n}\n\nfunction buildAddCommand(packageManager: PackageManager, dependencies: string[], dev: boolean) {\n switch (packageManager) {\n case 'bun':\n return ['bun', 'add', ...(dev ? ['-d'] : []), ...dependencies]\n case 'pnpm':\n return ['pnpm', 'add', ...(dev ? ['-D'] : []), ...dependencies]\n case 'yarn':\n return ['yarn', 'add', ...(dev ? ['-D'] : []), ...dependencies]\n case 'npm':\n return ['npm', 'install', ...(dev ? ['-D'] : []), ...dependencies]\n }\n}\n\nasync function runCommand(commandParts: string[], cwd: string) {\n const [command, ...args] = commandParts\n\n if (!command) {\n throw new Error('Missing command')\n }\n\n console.log(`Running: ${commandParts.join(' ')}`)\n\n await new Promise<void>((resolve, reject) => {\n const child = spawn(command, args, { cwd, stdio: 'inherit' })\n\n child.on('error', reject)\n child.on('close', (code) => {\n if (code === 0) {\n resolve()\n return\n }\n\n reject(new Error(`${command} exited with code ${code}`))\n })\n })\n}\n\nfunction getPackageVersion(packageJson: PackageJson, dependencyName: string) {\n const version = packageJson.dependencies?.[dependencyName] ?? packageJson.devDependencies?.[dependencyName]\n\n if (!version) {\n throw new Error(`Unable to find ${dependencyName} version in @uselets/ui package metadata`)\n }\n\n return version\n}\n\nasync function installMissingDependencies(projectRoot: string, projectPackageJson: PackageJson) {\n const packageRoot = await findPackageRoot()\n const packageJson = await readJsonFile<PackageJson>(path.join(packageRoot, 'package.json'))\n const packageManager = await detectPackageManager(projectRoot, projectPackageJson)\n const runtimeDependencies = []\n const devDependencies = []\n\n if (!packageJson.name || !packageJson.version) {\n throw new Error('Unable to resolve @uselets/ui package name and version')\n }\n\n if (!hasDependency(projectPackageJson, packageJson.name)) {\n runtimeDependencies.push(`${packageJson.name}@${packageJson.version}`)\n }\n\n if (!hasDependency(projectPackageJson, FONT_PACKAGE)) {\n runtimeDependencies.push(`${FONT_PACKAGE}@${getPackageVersion(packageJson, FONT_PACKAGE)}`)\n }\n\n if (!hasDependency(projectPackageJson, 'tailwindcss')) {\n devDependencies.push(`tailwindcss@${getPackageVersion(packageJson, 'tailwindcss')}`)\n }\n\n if (!hasDependency(projectPackageJson, '@tailwindcss/postcss')) {\n devDependencies.push(`@tailwindcss/postcss@${getPackageVersion(packageJson, '@tailwindcss/postcss')}`)\n }\n\n if (runtimeDependencies.length > 0) {\n await runCommand(buildAddCommand(packageManager, runtimeDependencies, false), projectRoot)\n } else {\n console.log('Runtime dependencies already declared.')\n }\n\n if (devDependencies.length > 0) {\n await runCommand(buildAddCommand(packageManager, devDependencies, true), projectRoot)\n } else {\n console.log('Tailwind dependencies already declared.')\n }\n}\n\nasync function installSkill(targets: AgentTarget[]) {\n const packageRoot = await findPackageRoot()\n const sourcePath = path.join(packageRoot, 'skills', SKILL_NAME)\n\n try {\n await fs.access(sourcePath)\n } catch {\n throw new Error(`Bundled skill not found at ${sourcePath}`)\n }\n\n const installedPaths = []\n\n for (const target of targets) {\n const targetPath = path.join(process.cwd(), AGENT_TARGETS[target])\n\n await fs.rm(targetPath, { recursive: true, force: true })\n await fs.mkdir(path.dirname(targetPath), { recursive: true })\n await fs.cp(sourcePath, targetPath, { recursive: true })\n\n installedPaths.push(targetPath)\n }\n\n console.log(`Installed ${SKILL_NAME} skill:`)\n\n for (const installedPath of installedPaths) {\n console.log(`- ${installedPath}`)\n }\n}\n\nasync function createPrompt() {\n return readline.createInterface({ input: process.stdin, output: process.stdout })\n}\n\nasync function promptTheme(defaultTheme: ThemeOption) {\n if (!process.stdin.isTTY) {\n return defaultTheme\n }\n\n const prompt = await createPrompt()\n\n try {\n while (true) {\n const answer = (await prompt.question(`Theme (max/gomax) [${defaultTheme}]: `)).trim().toLowerCase()\n\n if (!answer) {\n return defaultTheme\n }\n\n if (answer === 'max' || answer === 'gomax') {\n return answer\n }\n\n console.log('Please choose \"max\" or \"gomax\".')\n }\n } finally {\n prompt.close()\n }\n}\n\nasync function promptCssPath(defaultCssPath: string) {\n if (!process.stdin.isTTY) {\n return defaultCssPath\n }\n\n const prompt = await createPrompt()\n\n try {\n const answer = (await prompt.question(`Global CSS path [${defaultCssPath}]: `)).trim()\n return answer || defaultCssPath\n } finally {\n prompt.close()\n }\n}\n\nasync function promptInstallSkill() {\n if (!process.stdin.isTTY) {\n return false\n }\n\n const prompt = await createPrompt()\n\n try {\n while (true) {\n const answer = (await prompt.question('Install agent skill? (y/N): ')).trim().toLowerCase()\n\n if (!answer || answer === 'n' || answer === 'no') {\n return false\n }\n\n if (answer === 'y' || answer === 'yes') {\n return true\n }\n\n console.log('Please answer \"y\" or \"n\".')\n }\n } finally {\n prompt.close()\n }\n}\n\nasync function ensurePostcssConfig(projectRoot: string) {\n const postcssPath = path.join(projectRoot, 'postcss.config.mjs')\n\n if (await pathExists(postcssPath)) {\n console.log('Preserved existing postcss.config.mjs.')\n return\n }\n\n await fs.writeFile(postcssPath, POSTCSS_CONFIG)\n console.log('Created postcss.config.mjs.')\n}\n\nasync function ensureGlobalCss(projectRoot: string, cssPath: string, theme: ThemeOption) {\n const absoluteCssPath = path.resolve(projectRoot, cssPath)\n const existingSource = (await pathExists(absoluteCssPath)) ? await fs.readFile(absoluteCssPath, 'utf8') : ''\n const { source: updatedSource, hasTheme, themeBeforeTailwind } = updateGlobalCss(existingSource, theme, cssPath)\n\n if (hasTheme) {\n console.log('Preserved existing @uselets/ui theme import.')\n }\n\n if (themeBeforeTailwind) {\n console.warn(\n `Warning: the @uselets/ui theme import comes before @import 'tailwindcss' in ${cssPath}. Move it below so Tailwind's preflight doesn't override the theme's base styles.`\n )\n }\n\n if (updatedSource === null) {\n console.log(`Global CSS already configured at ${cssPath}.`)\n return\n }\n\n await fs.mkdir(path.dirname(absoluteCssPath), { recursive: true })\n await fs.writeFile(absoluteCssPath, updatedSource)\n console.log(`Updated global CSS at ${cssPath}.`)\n}\n\nasync function detectEntryFile(projectRoot: string) {\n for (const candidate of ENTRY_FILE_CANDIDATES) {\n if (await pathExists(path.join(projectRoot, candidate))) {\n return candidate\n }\n }\n\n return undefined\n}\n\nasync function promptEntryPath() {\n if (!process.stdin.isTTY) {\n return undefined\n }\n\n const prompt = await createPrompt()\n\n try {\n const answer = (await prompt.question('App entry file to import the font in (leave empty to skip): ')).trim()\n return answer || undefined\n } finally {\n prompt.close()\n }\n}\n\nasync function resolveEntryPath(projectRoot: string, entryOption?: string) {\n if (entryOption) {\n return entryOption\n }\n\n const detected = await detectEntryFile(projectRoot)\n\n if (detected) {\n return detected\n }\n\n return promptEntryPath()\n}\n\nfunction logManualFontImportInstructions(reason: string) {\n console.log(\n `${reason} Add \\`import '${FONT_PACKAGE}'\\` to your app's entry file (for example app/layout.tsx or src/main.tsx) to load the font.`\n )\n}\n\nasync function ensureFontImport(projectRoot: string, entryPath?: string) {\n if (!entryPath) {\n logManualFontImportInstructions('Could not detect an app entry file.')\n return\n }\n\n const absoluteEntryPath = path.resolve(projectRoot, entryPath)\n\n if (!(await pathExists(absoluteEntryPath))) {\n logManualFontImportInstructions(`Entry file ${entryPath} not found.`)\n return\n }\n\n const source = await fs.readFile(absoluteEntryPath, 'utf8')\n const importPattern = new RegExp(`import\\\\s+['\"]${FONT_PACKAGE}['\"]`)\n\n if (importPattern.test(source)) {\n console.log(`Font import already present in ${entryPath}.`)\n return\n }\n\n const directiveMatch = source.match(/^(['\"])use (?:client|server)\\1;?\\r?\\n/)\n const insertion = `import '${FONT_PACKAGE}'\\n`\n const updatedSource = directiveMatch\n ? source.slice(0, directiveMatch[0].length) + insertion + source.slice(directiveMatch[0].length)\n : insertion + source\n\n await fs.writeFile(absoluteEntryPath, updatedSource)\n console.log(`Added font import to ${entryPath}.`)\n}\n\nasync function initProject(options: InitOptions) {\n const projectRoot = process.cwd()\n const packageJsonPath = path.join(projectRoot, 'package.json')\n\n if (!(await pathExists(packageJsonPath))) {\n throw new Error('No package.json found in the current directory. Run uselets init from your project root.')\n }\n\n const projectPackageJson = await readJsonFile<PackageJson>(packageJsonPath)\n const theme = options.theme ?? (await promptTheme('max'))\n const cssPath = options.css ?? (await promptCssPath(DEFAULT_CSS_PATH))\n const entryPath = await resolveEntryPath(projectRoot, options.entry)\n const shouldInstallSkill = options.installSkill ?? (await promptInstallSkill())\n\n await installMissingDependencies(projectRoot, projectPackageJson)\n await ensurePostcssConfig(projectRoot)\n await ensureGlobalCss(projectRoot, cssPath, theme)\n await ensureFontImport(projectRoot, entryPath)\n\n if (shouldInstallSkill) {\n await installSkill(ALL_AGENT_TARGETS)\n }\n}\n\nasync function main() {\n const program = new Command()\n\n program.name('uselets').description('CLI for @uselets/ui').showHelpAfterError()\n\n program\n .command('skill')\n .description(`Reinstall the ${SKILL_NAME} agent skill`)\n .addOption(\n new Option('--agent <agent>', 'Target agent directory').choices(['codex', 'claude', 'all']).default('all')\n )\n .action(async (options: { agent: AgentOption }) => {\n await installSkill(resolveTargets(options.agent))\n })\n\n program\n .command('init')\n .description('Set up @uselets/ui in this project')\n .addOption(new Option('--theme <theme>', 'Theme to import').choices(['max', 'gomax']))\n .option('--css <path>', 'Global CSS file path')\n .option('--entry <path>', 'App entry file to import the font in (for example app/layout.tsx or src/main.tsx)')\n .option('--install-skill', 'Install the agent skill without prompting')\n .option('--no-install-skill', 'Skip the agent skill prompt and installation')\n .action(async (options: InitOptions) => {\n await initProject(options)\n })\n\n if (process.argv.length <= 2) {\n program.outputHelp()\n return\n }\n\n await program.parseAsync()\n}\n\nmain().catch((error: unknown) => {\n console.error(error instanceof Error ? error.message : error)\n process.exitCode = 1\n})\n"],"mappings":";mOAIA,MAAaG,EAAwB,CACnC,iBACA,iBACA,qBACA,qBACA,iBACA,iBACA,qBACA,qBACA,eACA,eACA,gBACA,eACF,EAEMC,EAA0B,+CAC1BC,EAAuB,6DACvBC,EAAyB,6CAE/B,SAAgBC,EAAmB,EAAiB,CAClD,IAAMC,EAASP,EAAK,MAAM,QAAQQ,EAAQ,WAAWR,EAAK,IAAKA,EAAK,MAAM,GAAG,CAAC,EACxES,EAAiBT,EAAK,MAAM,SAASO,EAAQ,+BAA+B,EAElF,OAAOE,EAAe,WAAW,GAAG,EAAIA,EAAiB,KAAKA,GAChE,CAWA,SAAgBC,EAAgB,EAAgB,EAAoB,EAAkC,CACpG,IAAMC,EAAgBR,EAAwB,KAAKS,CAAM,EACnDC,EAAaT,EAAqB,KAAKQ,CAAM,EAC7CE,EAAWD,IAAe,KAC1BE,EAAsBD,GAAYH,IAAkB,MAAQE,EAAW,MAAQF,EAAc,MAC7FK,EAAU,CAAC,EAUjB,GARKF,GACHE,EAAQ,KAAK,+BAA+BC,EAAM,OAAO,EAGtDZ,EAAuB,KAAKO,CAAM,GACrCI,EAAQ,KAAK,YAAYV,EAAmBE,CAAO,EAAE,GAAG,EAGtD,CAACG,EAAe,CAElB,IAAMO,EAAQ,CAAC,yBAA0B,GAAGF,CAAO,EAC7CG,EAAYP,EAA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AAK,CAAC,CAClD,CAAC,EAEHG,EACG,QAAQ,MAAM,CAAC,CACf,YAAY,oCAAoC,CAAC,CACjD,UAAU,IAAIE,EAAO,kBAAmB,iBAAiB,CAAC,CAAC,QAAQ,CAAC,MAAO,OAAO,CAAC,CAAC,CAAC,CACrF,OAAO,eAAgB,sBAAsB,CAAC,CAC9C,OAAO,iBAAkB,mFAAmF,CAAC,CAC7G,OAAO,kBAAmB,2CAA2C,CAAC,CACtE,OAAO,qBAAsB,8CAA8C,CAAC,CAC5E,OAAO,KAAO,IAAyB,CACtC,MAAMP,EAAYE,CAAO,CAC3B,CAAC,EAEC,QAAQ,KAAK,QAAU,EACzBG,EAAQ,WAAW,EAIrB,MAAMA,EAAQ,WAAW,CAC3B,CAEAD,EAAK,CAAC,CAAC,MAAO,GAAmB,CAC/B,QAAQ,MAAMI,aAAiB,MAAQA,EAAM,QAAUA,CAAK,EAC5D,QAAQ,SAAW,CACrB,CAAC"}
1
+ {"version":3,"file":"uselets.mjs","names":["fs","path","readline","ENTRY_FILE_CANDIDATES","TAILWIND_IMPORT_PATTERN","THEME_IMPORT_PATTERN","PACKAGE_SOURCE_PATTERN","buildPackageSource","cssDir","cssPath","relativeSource","updateGlobalCss","tailwindMatch","source","themeMatch","hasTheme","themeBeforeTailwind","imports","theme","lines","separator","insertAt","SKILL_NAME","FONT_PACKAGE","AGENT_TARGETS","ALL_AGENT_TARGETS","pathExists","targetPath","readJsonFile","filePath","findPackageRoot","currentDir","fileURLToPath","parentDir","resolveTargets","agent","hasDependency","packageJson","dependencyName","detectPackageManager","declaredManager","projectRoot","buildAddCommand","packageManager","dev","dependencies","runCommand","command","args","commandParts","child","spawn","reject","code","resolve","getPackageVersion","version","installMissingDependencies","packageRoot","projectPackageJson","runtimeDependencies","devDependencies","installSkill","sourcePath","installedPaths","target","targets","installedPath","createPrompt","promptTheme","defaultTheme","prompt","answer","promptCssPath","defaultCssPath","promptInstallSkill","ensurePostcssConfig","postcssPath","ensureGlobalCss","absoluteCssPath","updatedSource","detectEntryFile","candidate","promptEntryPath","resolveEntryPath","entryOption","logManualFontImportInstructions","reason","ensureFontImport","entryPath","absoluteEntryPath","directiveMatch","insertion","initProject","packageJsonPath","options","shouldInstallSkill","main","program","Command","Option","error"],"sources":["../../src/cli/init.ts","../../src/cli/uselets.ts"],"sourcesContent":["import path from 'node:path'\n\nexport type ThemeOption = 'max' | 'gomax'\n\nexport const ENTRY_FILE_CANDIDATES = [\n 'app/layout.tsx',\n 'app/layout.jsx',\n 'src/app/layout.tsx',\n 'src/app/layout.jsx',\n 'pages/_app.tsx',\n 'pages/_app.jsx',\n 'src/pages/_app.tsx',\n 'src/pages/_app.jsx',\n 'src/main.tsx',\n 'src/main.jsx',\n 'src/index.tsx',\n 'src/index.jsx'\n]\n\nconst TAILWIND_IMPORT_PATTERN = /^[ \\t]*@import\\s+['\"]tailwindcss['\"][^\\n]*$/m\nconst THEME_IMPORT_PATTERN = /@import\\s+['\"]@uselets\\/ui\\/themes\\/(?:max|gomax)\\.css['\"]/\nconst PACKAGE_SOURCE_PATTERN = /@source\\s+['\"][^'\"]*@uselets\\/ui\\/dist['\"]/\n\nexport function buildPackageSource(cssPath: string) {\n const cssDir = path.posix.dirname(cssPath.replaceAll(path.sep, path.posix.sep))\n const relativeSource = path.posix.relative(cssDir, 'node_modules/@uselets/ui/dist')\n\n return relativeSource.startsWith('.') ? relativeSource : `./${relativeSource}`\n}\n\nexport type GlobalCssUpdate = {\n // `null` when the file already has every import.\n source: string | null\n hasTheme: boolean\n // An existing theme import placed before `@import 'tailwindcss'` lets Tailwind's preflight override the theme's\n // base styles; the file is left as is, so the caller should warn about it.\n themeBeforeTailwind: boolean\n}\n\nexport function updateGlobalCss(source: string, theme: ThemeOption, cssPath: string): GlobalCssUpdate {\n const tailwindMatch = TAILWIND_IMPORT_PATTERN.exec(source)\n const themeMatch = THEME_IMPORT_PATTERN.exec(source)\n const hasTheme = themeMatch !== null\n const themeBeforeTailwind = hasTheme && tailwindMatch !== null && themeMatch.index < tailwindMatch.index\n const imports = []\n\n if (!hasTheme) {\n imports.push(`@import '@uselets/ui/themes/${theme}.css';`)\n }\n\n if (!PACKAGE_SOURCE_PATTERN.test(source)) {\n imports.push(`@source '${buildPackageSource(cssPath)}';`)\n }\n\n if (!tailwindMatch) {\n // The theme must come after Tailwind so its base layer wins over the preflight reset.\n const lines = [\"@import 'tailwindcss';\", ...imports]\n const separator = source.length > 0 && !source.startsWith('\\n') ? '\\n' : ''\n\n return { source: `${lines.join('\\n')}${separator}${source}`, hasTheme, themeBeforeTailwind }\n }\n\n if (imports.length === 0) {\n return { source: null, hasTheme, themeBeforeTailwind }\n }\n\n const insertAt = tailwindMatch.index + tailwindMatch[0].length\n\n return {\n source: `${source.slice(0, insertAt)}\\n${imports.join('\\n')}${source.slice(insertAt)}`,\n hasTheme,\n themeBeforeTailwind\n }\n}\n","#!/usr/bin/env node\n\nimport { spawn } from 'node:child_process'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport readline from 'node:readline/promises'\nimport { fileURLToPath } from 'node:url'\n\nimport { Command, Option } from 'commander'\n\nimport { ENTRY_FILE_CANDIDATES, type ThemeOption, updateGlobalCss } from './init'\n\nconst SKILL_NAME = 'uselets-ui'\nconst DEFAULT_CSS_PATH = 'src/styles/globals.css'\nconst FONT_PACKAGE = '@fontsource-variable/inter'\nconst POSTCSS_CONFIG = \"export { default } from '@uselets/ui/postcss.config'\\n\"\nconst AGENT_TARGETS = {\n codex: path.join('.agents', 'skills', SKILL_NAME),\n claude: path.join('.claude', 'skills', SKILL_NAME)\n} as const\n\ntype AgentTarget = keyof typeof AGENT_TARGETS\ntype AgentOption = AgentTarget | 'all'\ntype PackageManager = 'bun' | 'pnpm' | 'yarn' | 'npm'\ntype PackageJson = {\n name?: string\n version?: string\n packageManager?: string\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n peerDependencies?: Record<string, string>\n optionalDependencies?: Record<string, string>\n}\ntype InitOptions = {\n theme?: ThemeOption\n css?: string\n entry?: string\n installSkill?: boolean\n}\n\nconst ALL_AGENT_TARGETS = Object.keys(AGENT_TARGETS) as AgentTarget[]\n\nasync function pathExists(targetPath: string) {\n try {\n await fs.access(targetPath)\n return true\n } catch {\n return false\n }\n}\n\nasync function readJsonFile<T>(filePath: string) {\n return JSON.parse(await fs.readFile(filePath, 'utf8')) as T\n}\n\nasync function findPackageRoot() {\n let currentDir = fileURLToPath(new URL('.', import.meta.url))\n\n while (true) {\n try {\n await fs.access(path.join(currentDir, 'package.json'))\n return currentDir\n } catch {\n const parentDir = path.dirname(currentDir)\n\n if (parentDir === currentDir) {\n throw new Error('Unable to resolve @uselets/ui package root')\n }\n\n currentDir = parentDir\n }\n }\n}\n\nfunction resolveTargets(agent: AgentOption) {\n return agent === 'all' ? ALL_AGENT_TARGETS : [agent]\n}\n\nfunction hasDependency(packageJson: PackageJson, dependencyName: string) {\n return Boolean(\n packageJson.dependencies?.[dependencyName] ||\n packageJson.devDependencies?.[dependencyName] ||\n packageJson.peerDependencies?.[dependencyName] ||\n packageJson.optionalDependencies?.[dependencyName]\n )\n}\n\nasync function detectPackageManager(projectRoot: string, packageJson: PackageJson): Promise<PackageManager> {\n const declaredManager = packageJson.packageManager?.split('@')[0]\n\n if (\n declaredManager === 'bun' ||\n declaredManager === 'pnpm' ||\n declaredManager === 'yarn' ||\n declaredManager === 'npm'\n ) {\n return declaredManager\n }\n\n if (await pathExists(path.join(projectRoot, 'bun.lock'))) {\n return 'bun'\n }\n\n if (await pathExists(path.join(projectRoot, 'pnpm-lock.yaml'))) {\n return 'pnpm'\n }\n\n if (await pathExists(path.join(projectRoot, 'yarn.lock'))) {\n return 'yarn'\n }\n\n if (await pathExists(path.join(projectRoot, 'package-lock.json'))) {\n return 'npm'\n }\n\n return 'npm'\n}\n\nfunction buildAddCommand(packageManager: PackageManager, dependencies: string[], dev: boolean) {\n switch (packageManager) {\n case 'bun':\n return ['bun', 'add', ...(dev ? ['-d'] : []), ...dependencies]\n case 'pnpm':\n return ['pnpm', 'add', ...(dev ? ['-D'] : []), ...dependencies]\n case 'yarn':\n return ['yarn', 'add', ...(dev ? ['-D'] : []), ...dependencies]\n case 'npm':\n return ['npm', 'install', ...(dev ? ['-D'] : []), ...dependencies]\n }\n}\n\nasync function runCommand(commandParts: string[], cwd: string) {\n const [command, ...args] = commandParts\n\n if (!command) {\n throw new Error('Missing command')\n }\n\n console.log(`Running: ${commandParts.join(' ')}`)\n\n await new Promise<void>((resolve, reject) => {\n const child = spawn(command, args, { cwd, stdio: 'inherit' })\n\n child.on('error', reject)\n child.on('close', (code) => {\n if (code === 0) {\n resolve()\n return\n }\n\n reject(new Error(`${command} exited with code ${code}`))\n })\n })\n}\n\nfunction getPackageVersion(packageJson: PackageJson, dependencyName: string) {\n const version = packageJson.dependencies?.[dependencyName] ?? packageJson.devDependencies?.[dependencyName]\n\n if (!version) {\n throw new Error(`Unable to find ${dependencyName} version in @uselets/ui package metadata`)\n }\n\n return version\n}\n\nasync function installMissingDependencies(projectRoot: string, projectPackageJson: PackageJson) {\n const packageRoot = await findPackageRoot()\n const packageJson = await readJsonFile<PackageJson>(path.join(packageRoot, 'package.json'))\n const packageManager = await detectPackageManager(projectRoot, projectPackageJson)\n const runtimeDependencies = []\n const devDependencies = []\n\n if (!packageJson.name || !packageJson.version) {\n throw new Error('Unable to resolve @uselets/ui package name and version')\n }\n\n if (!hasDependency(projectPackageJson, packageJson.name)) {\n runtimeDependencies.push(`${packageJson.name}@${packageJson.version}`)\n }\n\n if (!hasDependency(projectPackageJson, FONT_PACKAGE)) {\n runtimeDependencies.push(`${FONT_PACKAGE}@${getPackageVersion(packageJson, FONT_PACKAGE)}`)\n }\n\n if (!hasDependency(projectPackageJson, 'tailwindcss')) {\n devDependencies.push(`tailwindcss@${getPackageVersion(packageJson, 'tailwindcss')}`)\n }\n\n if (!hasDependency(projectPackageJson, '@tailwindcss/postcss')) {\n devDependencies.push(`@tailwindcss/postcss@${getPackageVersion(packageJson, '@tailwindcss/postcss')}`)\n }\n\n if (runtimeDependencies.length > 0) {\n await runCommand(buildAddCommand(packageManager, runtimeDependencies, false), projectRoot)\n } else {\n console.log('Runtime dependencies already declared.')\n }\n\n if (devDependencies.length > 0) {\n await runCommand(buildAddCommand(packageManager, devDependencies, true), projectRoot)\n } else {\n console.log('Tailwind dependencies already declared.')\n }\n}\n\nasync function installSkill(targets: AgentTarget[]) {\n const packageRoot = await findPackageRoot()\n const sourcePath = path.join(packageRoot, 'skills', SKILL_NAME)\n\n try {\n await fs.access(sourcePath)\n } catch {\n throw new Error(`Bundled skill not found at ${sourcePath}`)\n }\n\n const installedPaths = []\n\n for (const target of targets) {\n const targetPath = path.join(process.cwd(), AGENT_TARGETS[target])\n\n await fs.rm(targetPath, { recursive: true, force: true })\n await fs.mkdir(path.dirname(targetPath), { recursive: true })\n await fs.cp(sourcePath, targetPath, { recursive: true })\n\n installedPaths.push(targetPath)\n }\n\n console.log(`Installed ${SKILL_NAME} skill:`)\n\n for (const installedPath of installedPaths) {\n console.log(`- ${installedPath}`)\n }\n}\n\nasync function createPrompt() {\n return readline.createInterface({ input: process.stdin, output: process.stdout })\n}\n\nasync function promptTheme(defaultTheme: ThemeOption) {\n if (!process.stdin.isTTY) {\n return defaultTheme\n }\n\n const prompt = await createPrompt()\n\n try {\n while (true) {\n const answer = (await prompt.question(`Theme (max/gomax) [${defaultTheme}]: `)).trim().toLowerCase()\n\n if (!answer) {\n return defaultTheme\n }\n\n if (answer === 'max' || answer === 'gomax') {\n return answer\n }\n\n console.log('Please choose \"max\" or \"gomax\".')\n }\n } finally {\n prompt.close()\n }\n}\n\nasync function promptCssPath(defaultCssPath: string) {\n if (!process.stdin.isTTY) {\n return defaultCssPath\n }\n\n const prompt = await createPrompt()\n\n try {\n const answer = (await prompt.question(`Global CSS path [${defaultCssPath}]: `)).trim()\n return answer || defaultCssPath\n } finally {\n prompt.close()\n }\n}\n\nasync function promptInstallSkill() {\n if (!process.stdin.isTTY) {\n return false\n }\n\n const prompt = await createPrompt()\n\n try {\n while (true) {\n const answer = (await prompt.question('Install agent skill? (y/N): ')).trim().toLowerCase()\n\n if (!answer || answer === 'n' || answer === 'no') {\n return false\n }\n\n if (answer === 'y' || answer === 'yes') {\n return true\n }\n\n console.log('Please answer \"y\" or \"n\".')\n }\n } finally {\n prompt.close()\n }\n}\n\nasync function ensurePostcssConfig(projectRoot: string) {\n const postcssPath = path.join(projectRoot, 'postcss.config.mjs')\n\n if (await pathExists(postcssPath)) {\n console.log('Preserved existing postcss.config.mjs.')\n return\n }\n\n await fs.writeFile(postcssPath, POSTCSS_CONFIG)\n console.log('Created postcss.config.mjs.')\n}\n\nasync function ensureGlobalCss(projectRoot: string, cssPath: string, theme: ThemeOption) {\n const absoluteCssPath = path.resolve(projectRoot, cssPath)\n const existingSource = (await pathExists(absoluteCssPath)) ? await fs.readFile(absoluteCssPath, 'utf8') : ''\n const { source: updatedSource, hasTheme, themeBeforeTailwind } = updateGlobalCss(existingSource, theme, cssPath)\n\n if (hasTheme) {\n console.log('Preserved existing @uselets/ui theme import.')\n }\n\n if (themeBeforeTailwind) {\n console.warn(\n `Warning: the @uselets/ui theme import comes before @import 'tailwindcss' in ${cssPath}. Move it below so Tailwind's preflight doesn't override the theme's base styles.`\n )\n }\n\n if (updatedSource === null) {\n console.log(`Global CSS already configured at ${cssPath}.`)\n return\n }\n\n await fs.mkdir(path.dirname(absoluteCssPath), { recursive: true })\n await fs.writeFile(absoluteCssPath, updatedSource)\n console.log(`Updated global CSS at ${cssPath}.`)\n}\n\nasync function detectEntryFile(projectRoot: string) {\n for (const candidate of ENTRY_FILE_CANDIDATES) {\n if (await pathExists(path.join(projectRoot, candidate))) {\n return candidate\n }\n }\n\n return undefined\n}\n\nasync function promptEntryPath() {\n if (!process.stdin.isTTY) {\n return undefined\n }\n\n const prompt = await createPrompt()\n\n try {\n const answer = (await prompt.question('App entry file to import the font in (leave empty to skip): ')).trim()\n return answer || undefined\n } finally {\n prompt.close()\n }\n}\n\nasync function resolveEntryPath(projectRoot: string, entryOption?: string) {\n if (entryOption) {\n return entryOption\n }\n\n const detected = await detectEntryFile(projectRoot)\n\n if (detected) {\n return detected\n }\n\n return promptEntryPath()\n}\n\nfunction logManualFontImportInstructions(reason: string) {\n console.log(\n `${reason} Add \\`import '${FONT_PACKAGE}'\\` to your app's entry file (for example app/layout.tsx or src/main.tsx) to load the font.`\n )\n}\n\nasync function ensureFontImport(projectRoot: string, entryPath?: string) {\n if (!entryPath) {\n logManualFontImportInstructions('Could not detect an app entry file.')\n return\n }\n\n const absoluteEntryPath = path.resolve(projectRoot, entryPath)\n\n if (!(await pathExists(absoluteEntryPath))) {\n logManualFontImportInstructions(`Entry file ${entryPath} not found.`)\n return\n }\n\n const source = await fs.readFile(absoluteEntryPath, 'utf8')\n const importPattern = new RegExp(`import\\\\s+['\"]${FONT_PACKAGE}['\"]`)\n\n if (importPattern.test(source)) {\n console.log(`Font import already present in ${entryPath}.`)\n return\n }\n\n const directiveMatch = source.match(/^(['\"])use (?:client|server)\\1;?\\r?\\n/)\n const insertion = `import '${FONT_PACKAGE}'\\n`\n const updatedSource = directiveMatch\n ? source.slice(0, directiveMatch[0].length) + insertion + source.slice(directiveMatch[0].length)\n : insertion + source\n\n await fs.writeFile(absoluteEntryPath, updatedSource)\n console.log(`Added font import to ${entryPath}.`)\n}\n\nasync function initProject(options: InitOptions) {\n const projectRoot = process.cwd()\n const packageJsonPath = path.join(projectRoot, 'package.json')\n\n if (!(await pathExists(packageJsonPath))) {\n throw new Error('No package.json found in the current directory. Run uselets init from your project root.')\n }\n\n const projectPackageJson = await readJsonFile<PackageJson>(packageJsonPath)\n const theme = options.theme ?? (await promptTheme('max'))\n const cssPath = options.css ?? (await promptCssPath(DEFAULT_CSS_PATH))\n const entryPath = await resolveEntryPath(projectRoot, options.entry)\n const shouldInstallSkill = options.installSkill ?? (await promptInstallSkill())\n\n await installMissingDependencies(projectRoot, projectPackageJson)\n await ensurePostcssConfig(projectRoot)\n await ensureGlobalCss(projectRoot, cssPath, theme)\n await ensureFontImport(projectRoot, entryPath)\n\n if (shouldInstallSkill) {\n await installSkill(ALL_AGENT_TARGETS)\n }\n}\n\nasync function main() {\n const program = new Command()\n\n program.name('uselets').description('CLI for @uselets/ui').showHelpAfterError()\n\n program\n .command('skill')\n .description(`Reinstall the ${SKILL_NAME} agent skill`)\n .addOption(\n new Option('--agent <agent>', 'Target agent directory').choices(['codex', 'claude', 'all']).default('all')\n )\n .action(async (options: { agent: AgentOption }) => {\n await installSkill(resolveTargets(options.agent))\n })\n\n program\n .command('init')\n .description('Set up @uselets/ui in this project')\n .addOption(new Option('--theme <theme>', 'Theme to import').choices(['max', 'gomax']))\n .option('--css <path>', 'Global CSS file path')\n .option('--entry <path>', 'App entry file to import the font in (for example app/layout.tsx or src/main.tsx)')\n .option('--install-skill', 'Install the agent skill without prompting')\n .option('--no-install-skill', 'Skip the agent skill prompt and installation')\n .action(async (options: InitOptions) => {\n await initProject(options)\n })\n\n if (process.argv.length <= 2) {\n program.outputHelp()\n return\n }\n\n await program.parseAsync()\n}\n\nmain().catch((error: unknown) => {\n console.error(error instanceof Error ? error.message : error)\n process.exitCode = 1\n})\n"],"mappings":";A,mOAIA,MAAaG,EAAwB,CACnC,iBACA,iBACA,qBACA,qBACA,iBACA,iBACA,qBACA,qBACA,eACA,eACA,gBACA,eACF,EAEMC,EAA0B,+CAC1BC,EAAuB,6DACvBC,EAAyB,6CAE/B,SAAgBC,EAAmB,EAAiB,CAClD,IAAMC,EAASP,EAAK,MAAM,QAAQQ,EAAQ,WAAWR,EAAK,IAAKA,EAAK,MAAM,GAAG,CAAC,EACxES,EAAiBT,EAAK,MAAM,SAASO,EAAQ,+BAA+B,EAElF,OAAOE,EAAe,WAAW,GAAG,EAAIA,EAAiB,KAAKA,GAChE,CAWA,SAAgBC,EAAgB,EAAgB,EAAoB,EAAkC,CACpG,IAAMC,EAAgBR,EAAwB,KAAKS,CAAM,EACnDC,EAAaT,EAAqB,KAAKQ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EAAQ,KAAK,SAAS,CAAC,CAAC,YAAY,qBAAqB,CAAC,CAAC,mBAAmB,EAE9EA,EACG,QAAQ,OAAO,CAAC,CAChB,YAAY,iBAAiB5E,EAAW,aAAa,CAAC,CACtD,UACC,IAAI8E,EAAO,kBAAmB,wBAAwB,CAAC,CAAC,QAAQ,CAAC,QAAS,SAAU,KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,CAC3G,CAAC,CACA,OAAO,KAAO,IAAoC,CACjD,MAAMtC,EAAa5B,EAAe6D,EAAQ,KAAK,CAAC,CAClD,CAAC,EAEHG,EACG,QAAQ,MAAM,CAAC,CACf,YAAY,oCAAoC,CAAC,CACjD,UAAU,IAAIE,EAAO,kBAAmB,iBAAiB,CAAC,CAAC,QAAQ,CAAC,MAAO,OAAO,CAAC,CAAC,CAAC,CACrF,OAAO,eAAgB,sBAAsB,CAAC,CAC9C,OAAO,iBAAkB,mFAAmF,CAAC,CAC7G,OAAO,kBAAmB,2CAA2C,CAAC,CACtE,OAAO,qBAAsB,8CAA8C,CAAC,CAC5E,OAAO,KAAO,IAAyB,CACtC,MAAMP,EAAYE,CAAO,CAC3B,CAAC,EAEC,QAAQ,KAAK,QAAU,EACzBG,EAAQ,WAAW,EAIrB,MAAMA,EAAQ,WAAW,CAC3B,CAEAD,EAAK,CAAC,CAAC,MAAO,GAAmB,CAC/B,QAAQ,MAAMI,aAAiB,MAAQA,EAAM,QAAUA,CAAK,EAC5D,QAAQ,SAAW,CACrB,CAAC,E"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
4
4
  import * as React from "react";
5
- //#region src/components/accordion.d.ts
6
5
  export type AccordionProps = AsChildPrimitiveProps<typeof Accordion$1.Root>;
7
6
  export type AccordionItemProps = AsChildPrimitiveProps<typeof Accordion$1.Item>;
8
7
  export type AccordionTriggerProps = AsChildPrimitiveProps<typeof Accordion$1.Trigger>;
@@ -14,6 +13,5 @@ declare function Accordion({ className, asChild, children, ...props }: Accordion
14
13
  declare function AccordionItem({ className, asChild, children, ...props }: AccordionItemProps): React.JSX.Element;
15
14
  declare function AccordionTrigger({ className, children, asChild, ...props }: AccordionTriggerProps): React.JSX.Element;
16
15
  declare function AccordionContent({ className, children, ...props }: AccordionContentProps): React.JSX.Element;
17
- //#endregion
18
16
  export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
19
17
  //# sourceMappingURL=accordion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.js","names":["AccordionPrimitive","resolveClassName","Accordion$1","props","cn","className","state","toAsChildRenderProps","asChild","children","Fragment","IconChevronDown","IconChevronUp"],"sources":["../../src/components/accordion.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Accordion as AccordionPrimitive } from '@base-ui/react/accordion'\nimport { IconChevronDown, IconChevronUp } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type AccordionProps = AsChildPrimitiveProps<typeof AccordionPrimitive.Root>\n\nexport type AccordionItemProps = AsChildPrimitiveProps<typeof AccordionPrimitive.Item>\n\nexport type AccordionTriggerProps = AsChildPrimitiveProps<typeof AccordionPrimitive.Trigger>\n\nexport type AccordionContentProps = Omit<\n React.ComponentProps<typeof AccordionPrimitive.Panel>,\n 'render' | 'className'\n> & {\n /** Classes for the content wrapper inside the panel. */\n className?: string\n}\n\nfunction Accordion({ className, asChild, children, ...props }: AccordionProps) {\n return (\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n className={(state) => cn('flex w-full flex-col border rounded-sm', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AccordionItem({ className, asChild, children, ...props }: AccordionItemProps) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={(state) => cn('not-last:border-b px-4', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AccordionTrigger({ className, children, asChild, ...props }: AccordionTriggerProps) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={(state) =>\n cn(\n 'group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring data-disabled:pointer-events-none data-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && (\n <>\n <IconChevronDown\n data-slot=\"accordion-trigger-icon\"\n className=\"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden\"\n />\n <IconChevronUp\n data-slot=\"accordion-trigger-icon\"\n className=\"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline\"\n />\n </>\n )}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n )\n}\n\nfunction AccordionContent({ className, children, ...props }: AccordionContentProps) {\n return (\n <AccordionPrimitive.Panel\n data-slot=\"accordion-content\"\n className=\"wrap-break-word overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up\"\n {...props}\n >\n <div\n className={cn(\n 'h-(--accordion-panel-height) pt-0 pb-2.5',\n 'data-starting-style:h-0 data-ending-style:h-0',\n className\n )}\n >\n {children}\n </div>\n </AccordionPrimitive.Panel>\n )\n}\n\nexport { Accordion, AccordionContent, AccordionItem, AccordionTrigger }\n"],"mappings":"2XAuBA,SAAS,UAAU,CAAE,YAAW,UAAS,WAAU,GAAGG,GAAyB,CAC7E,MACE,kBAACH,EAAmB,KAApB,CACE,YAAU,YACV,UAAY,GAAUI,EAAG,yCAA0CH,EAAiBI,EAAWC,CAAK,CAAC,EACrG,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,cAAc,CAAE,YAAW,UAAS,WAAU,GAAGN,GAA6B,CACrF,MACE,kBAACH,EAAmB,KAApB,CACE,YAAU,iBACV,UAAY,GAAUI,EAAG,yBAA0BH,EAAiBI,EAAWC,CAAK,CAAC,EACrF,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,WAAU,UAAS,GAAGN,GAAgC,CAC3F,MACE,kBAACH,EAAmB,OAApB,CAA2B,UAAU,OACnC,SAAA,kBAACA,EAAmB,QAApB,CACE,YAAU,oBACV,UAAY,GACVI,EACE,6fACAH,EAAiBI,EAAWC,CAAK,CACnC,EAEF,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,EAT5C,SAAA,CAWG,CAACD,GAAWC,EACZ,CAACD,GACA,kBAAAE,EAAA,CAAA,SAAA,CACE,kBAACC,EAAD,CACE,YAAU,yBACV,UAAU,2EACX,CAAA,EACD,kBAACC,EAAD,CACE,YAAU,yBACV,UAAU,kFACX,CAAA,CACD,CAAA,CAAA,CAEsB,GACH,CAAA,CAE/B,CAEA,SAAS,iBAAiB,CAAE,YAAW,WAAU,GAAGT,GAAgC,CAClF,MACE,kBAACH,EAAmB,MAApB,CACE,YAAU,oBACV,UAAU,4GACV,GAAIG,EAEJ,SAAA,kBAAC,MAAD,CACE,UAAWC,EACT,2CACA,gDACAC,CACF,EAEC,UACE,CAAA,CACmB,CAAA,CAE9B"}
1
+ {"version":3,"file":"accordion.js","names":["AccordionPrimitive","resolveClassName","Accordion$1","props","cn","className","state","toAsChildRenderProps","asChild","children","Fragment","IconChevronDown","IconChevronUp"],"sources":["../../src/components/accordion.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Accordion as AccordionPrimitive } from '@base-ui/react/accordion'\nimport { IconChevronDown, IconChevronUp } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type AccordionProps = AsChildPrimitiveProps<typeof AccordionPrimitive.Root>\n\nexport type AccordionItemProps = AsChildPrimitiveProps<typeof AccordionPrimitive.Item>\n\nexport type AccordionTriggerProps = AsChildPrimitiveProps<typeof AccordionPrimitive.Trigger>\n\nexport type AccordionContentProps = Omit<\n React.ComponentProps<typeof AccordionPrimitive.Panel>,\n 'render' | 'className'\n> & {\n /** Classes for the content wrapper inside the panel. */\n className?: string\n}\n\nfunction Accordion({ className, asChild, children, ...props }: AccordionProps) {\n return (\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n className={(state) => cn('flex w-full flex-col border rounded-sm', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AccordionItem({ className, asChild, children, ...props }: AccordionItemProps) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={(state) => cn('not-last:border-b px-4', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AccordionTrigger({ className, children, asChild, ...props }: AccordionTriggerProps) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={(state) =>\n cn(\n 'group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring data-disabled:pointer-events-none data-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && (\n <>\n <IconChevronDown\n data-slot=\"accordion-trigger-icon\"\n className=\"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden\"\n />\n <IconChevronUp\n data-slot=\"accordion-trigger-icon\"\n className=\"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline\"\n />\n </>\n )}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n )\n}\n\nfunction AccordionContent({ className, children, ...props }: AccordionContentProps) {\n return (\n <AccordionPrimitive.Panel\n data-slot=\"accordion-content\"\n className=\"wrap-break-word overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up\"\n {...props}\n >\n <div\n className={cn(\n 'h-(--accordion-panel-height) pt-0 pb-2.5',\n 'data-starting-style:h-0 data-ending-style:h-0',\n className\n )}\n >\n {children}\n </div>\n </AccordionPrimitive.Panel>\n )\n}\n\nexport { Accordion, AccordionContent, AccordionItem, AccordionTrigger }\n"],"mappings":"A,2XAuBA,SAAS,UAAU,CAAE,YAAW,UAAS,WAAU,GAAGG,GAAyB,CAC7E,MACE,kBAACH,EAAmB,KAApB,CACE,YAAU,YACV,UAAY,GAAUI,EAAG,yCAA0CH,EAAiBI,EAAWC,CAAK,CAAC,EACrG,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,cAAc,CAAE,YAAW,UAAS,WAAU,GAAGN,GAA6B,CACrF,MACE,kBAACH,EAAmB,KAApB,CACE,YAAU,iBACV,UAAY,GAAUI,EAAG,yBAA0BH,EAAiBI,EAAWC,CAAK,CAAC,EACrF,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,WAAU,UAAS,GAAGN,GAAgC,CAC3F,MACE,kBAACH,EAAmB,OAApB,CAA2B,UAAU,OACnC,SAAA,kBAACA,EAAmB,QAApB,CACE,YAAU,oBACV,UAAY,GACVI,EACE,6fACAH,EAAiBI,EAAWC,CAAK,CACnC,EAEF,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,EAT5C,SAAA,CAWG,CAACD,GAAWC,EACZ,CAACD,GACA,kBAAAE,EAAA,CAAA,SAAA,CACE,kBAACC,EAAD,CACE,YAAU,yBACV,UAAU,2EACX,CAAA,EACD,kBAACC,EAAD,CACE,YAAU,yBACV,UAAU,kFACX,CAAA,CACD,CAAA,CAAA,CAEsB,C,EACH,CAAA,CAE/B,CAEA,SAAS,iBAAiB,CAAE,YAAW,WAAU,GAAGT,GAAgC,CAClF,MACE,kBAACH,EAAmB,MAApB,CACE,YAAU,oBACV,UAAU,4GACV,GAAIG,EAEJ,SAAA,kBAAC,MAAD,CACE,UAAWC,EACT,2CACA,gDACAC,CACF,EAEC,UACE,CAAA,CACmB,CAAA,CAE9B,C"}
@@ -1,9 +1,8 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import { Button } from "./button.js";
4
4
  import * as React from "react";
5
5
  import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
6
- //#region src/components/alert-dialog.d.ts
7
6
  export type AlertDialogProps = React.ComponentProps<typeof AlertDialog$1.Root>;
8
7
  export type AlertDialogTriggerProps = AsChildPrimitiveProps<typeof AlertDialog$1.Trigger>;
9
8
  export type AlertDialogPortalProps = React.ComponentProps<typeof AlertDialog$1.Portal>;
@@ -14,6 +13,8 @@ export type AlertDialogContentProps = AsChildPrimitiveProps<typeof AlertDialog$1
14
13
  * @default 'md'
15
14
  */
16
15
  size?: 'sm' | 'md';
16
+ /** Props passed to the overlay rendered behind the dialog. */
17
+ overlayProps?: AlertDialogOverlayProps;
17
18
  };
18
19
  export type AlertDialogHeaderProps = React.ComponentProps<'div'>;
19
20
  export type AlertDialogFooterProps = React.ComponentProps<'div'>;
@@ -25,8 +26,8 @@ export type AlertDialogCancelProps = Omit<AsChildPrimitiveProps<typeof AlertDial
25
26
  declare function AlertDialog({ ...props }: AlertDialogProps): React.JSX.Element;
26
27
  declare function AlertDialogTrigger({ asChild, children, ...props }: AlertDialogTriggerProps): React.JSX.Element;
27
28
  declare function AlertDialogPortal({ ...props }: AlertDialogPortalProps): React.JSX.Element;
28
- declare function AlertDialogOverlay({ className, asChild, children, ...props }: AlertDialogOverlayProps): React.JSX.Element;
29
- declare function AlertDialogContent({ className, size, keepMounted, asChild, children, ...props }: AlertDialogContentProps): React.JSX.Element;
29
+ declare function AlertDialogOverlay({ className, forceRender, asChild, children, ...props }: AlertDialogOverlayProps): React.JSX.Element;
30
+ declare function AlertDialogContent({ className, size, overlayProps, keepMounted, asChild, children, ...props }: AlertDialogContentProps): React.JSX.Element;
30
31
  declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): React.JSX.Element;
31
32
  declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): React.JSX.Element;
32
33
  declare function AlertDialogMedia({ className, ...props }: AlertDialogMediaProps): React.JSX.Element;
@@ -34,6 +35,5 @@ declare function AlertDialogTitle({ className, asChild, children, ...props }: Al
34
35
  declare function AlertDialogDescription({ className, asChild, children, ...props }: AlertDialogDescriptionProps): React.JSX.Element;
35
36
  declare function AlertDialogAction({ className, variant, color, size, asChild, children, ...props }: AlertDialogActionProps): React.JSX.Element;
36
37
  declare function AlertDialogCancel({ className, variant, color, size, asChild, children, ...props }: AlertDialogCancelProps): React.JSX.Element;
37
- //#endregion
38
38
  export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
39
39
  //# sourceMappingURL=alert-dialog.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../resolve-class-name-BurP8ngI.js";import{Button as r}from"./button.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{AlertDialog as o}from"@base-ui/react/alert-dialog";function AlertDialog({...e}){return/* @__PURE__ */ i(o.Root,{"data-slot":`alert-dialog`,...e})}function AlertDialogTrigger({asChild:t,children:n,...r}){return/* @__PURE__ */ i(o.Trigger,{"data-slot":`alert-dialog-trigger`,...r,...e(t,n)})}function AlertDialogPortal({...e}){return/* @__PURE__ */ i(o.Portal,{"data-slot":`alert-dialog-portal`,...e})}function AlertDialogOverlay({className:r,asChild:a,children:s,...c}){return/* @__PURE__ */ i(o.Backdrop,{"data-slot":`alert-dialog-overlay`,className:e=>t(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n(r,e)),...c,...e(a,s)})}function AlertDialogContent({className:r,size:s=`md`,keepMounted:c,asChild:l,children:u,...d}){return/* @__PURE__ */ a(AlertDialogPortal,{keepMounted:c,children:[/* @__PURE__ */ i(AlertDialogOverlay,{}),/* @__PURE__ */ i(o.Popup,{"data-slot":`alert-dialog-content`,"data-size":s,className:e=>t(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 ring-1 ring-foreground/10 duration-100 outline-none data-[size=md]:max-w-xs data-[size=sm]:max-w-xs data-[size=md]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n(r,e)),...d,...e(l,u)})]})}function AlertDialogHeader({className:e,...n}){return/* @__PURE__ */ i(`div`,{"data-slot":`alert-dialog-header`,className:t(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=md]/alert-dialog-content:place-items-start sm:group-data-[size=md]/alert-dialog-content:text-left sm:group-data-[size=md]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...n})}function AlertDialogFooter({className:e,...n}){return/* @__PURE__ */ i(`div`,{"data-slot":`alert-dialog-footer`,className:t(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...n})}function AlertDialogMedia({className:e,...n}){return/* @__PURE__ */ i(`div`,{"data-slot":`alert-dialog-media`,className:t(`mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=md]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6`,e),...n})}function AlertDialogTitle({className:r,asChild:a,children:s,...c}){return/* @__PURE__ */ i(o.Title,{"data-slot":`alert-dialog-title`,className:e=>t(`text-base font-medium sm:group-data-[size=md]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,n(r,e)),...c,...e(a,s)})}function AlertDialogDescription({className:r,asChild:a,children:s,...c}){return/* @__PURE__ */ i(o.Description,{"data-slot":`alert-dialog-description`,className:e=>t(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n(r,e)),...c,...e(a,s)})}function AlertDialogAction({className:e,variant:n=`solid`,color:a=`primary`,size:s=`md`,asChild:c,children:l,...u}){let d={variant:n,color:a,size:s,className:t(e)};return/* @__PURE__ */ i(o.Close,{"data-slot":`alert-dialog-action`,render:c?/* @__PURE__ */ i(r,{...d,asChild:!0,children:l}):/* @__PURE__ */ i(r,{...d}),...u,children:c?void 0:l})}function AlertDialogCancel({className:e,variant:n=`outline`,color:a=`primary`,size:s=`md`,asChild:c,children:l,...u}){let d={variant:n,color:a,size:s,className:t(e)};return/* @__PURE__ */ i(o.Close,{"data-slot":`alert-dialog-cancel`,render:c?/* @__PURE__ */ i(r,{...d,asChild:!0,children:l}):/* @__PURE__ */ i(r,{...d}),...u,children:c?void 0:l})}export{AlertDialog,AlertDialogAction,AlertDialogCancel,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,AlertDialogMedia,AlertDialogOverlay,AlertDialogPortal,AlertDialogTitle,AlertDialogTrigger};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../resolve-class-name-BurP8ngI.js";import{Button as r}from"./button.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{AlertDialog as o}from"@base-ui/react/alert-dialog";function AlertDialog({...e}){return/* @__PURE__ */ i(o.Root,{"data-slot":`alert-dialog`,...e})}function AlertDialogTrigger({asChild:t,children:n,...r}){return/* @__PURE__ */ i(o.Trigger,{"data-slot":`alert-dialog-trigger`,...r,...e(t,n)})}function AlertDialogPortal({...e}){return/* @__PURE__ */ i(o.Portal,{"data-slot":`alert-dialog-portal`,...e})}function AlertDialogOverlay({className:r,forceRender:a=!0,asChild:s,children:c,...l}){return/* @__PURE__ */ i(o.Backdrop,{"data-slot":`alert-dialog-overlay`,forceRender:a,className:e=>t(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n(r,e)),...l,...e(s,c)})}function AlertDialogContent({className:r,size:s=`md`,overlayProps:c,keepMounted:l,asChild:u,children:d,...f}){return/* @__PURE__ */ a(AlertDialogPortal,{keepMounted:l,children:[/* @__PURE__ */ i(AlertDialogOverlay,{...c}),/* @__PURE__ */ i(o.Popup,{"data-slot":`alert-dialog-content`,"data-size":s,className:e=>t(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 ring-1 ring-foreground/10 duration-100 outline-none data-[size=md]:max-w-xs data-[size=sm]:max-w-xs data-[size=md]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n(r,e)),...f,...e(u,d)})]})}function AlertDialogHeader({className:e,...n}){return/* @__PURE__ */ i(`div`,{"data-slot":`alert-dialog-header`,className:t(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=md]/alert-dialog-content:place-items-start sm:group-data-[size=md]/alert-dialog-content:text-left sm:group-data-[size=md]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...n})}function AlertDialogFooter({className:e,...n}){return/* @__PURE__ */ i(`div`,{"data-slot":`alert-dialog-footer`,className:t(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...n})}function AlertDialogMedia({className:e,...n}){return/* @__PURE__ */ i(`div`,{"data-slot":`alert-dialog-media`,className:t(`mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=md]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6`,e),...n})}function AlertDialogTitle({className:r,asChild:a,children:s,...c}){return/* @__PURE__ */ i(o.Title,{"data-slot":`alert-dialog-title`,className:e=>t(`text-base font-medium sm:group-data-[size=md]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,n(r,e)),...c,...e(a,s)})}function AlertDialogDescription({className:r,asChild:a,children:s,...c}){return/* @__PURE__ */ i(o.Description,{"data-slot":`alert-dialog-description`,className:e=>t(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n(r,e)),...c,...e(a,s)})}function AlertDialogAction({className:e,variant:n=`solid`,color:a=`primary`,size:s=`md`,asChild:c,children:l,...u}){let d={variant:n,color:a,size:s,className:t(e)};return/* @__PURE__ */ i(o.Close,{"data-slot":`alert-dialog-action`,render:c?/* @__PURE__ */ i(r,{...d,asChild:!0,children:l}):/* @__PURE__ */ i(r,{...d}),...u,children:c?void 0:l})}function AlertDialogCancel({className:e,variant:n=`outline`,color:a=`primary`,size:s=`md`,asChild:c,children:l,...u}){let d={variant:n,color:a,size:s,className:t(e)};return/* @__PURE__ */ i(o.Close,{"data-slot":`alert-dialog-cancel`,render:c?/* @__PURE__ */ i(r,{...d,asChild:!0,children:l}):/* @__PURE__ */ i(r,{...d}),...u,children:c?void 0:l})}export{AlertDialog,AlertDialogAction,AlertDialogCancel,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,AlertDialogMedia,AlertDialogOverlay,AlertDialogPortal,AlertDialogTitle,AlertDialogTrigger};
2
2
  //# sourceMappingURL=alert-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.js","names":["AlertDialogPrimitive","resolveClassName","AlertDialog$1","props","toAsChildRenderProps","asChild","children","cn","className","state","size","buttonProps","Button"],"sources":["../../src/components/alert-dialog.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\n\nexport type AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root>\n\nexport type AlertDialogTriggerProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Trigger>\n\nexport type AlertDialogPortalProps = React.ComponentProps<typeof AlertDialogPrimitive.Portal>\n\nexport type AlertDialogOverlayProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Backdrop>\n\nexport type AlertDialogContentProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Popup> &\n Pick<AlertDialogPortalProps, 'keepMounted'> & {\n /**\n * Width of the dialog; `md` also places `AlertDialogMedia` next to the text on larger screens.\n * @default 'md'\n */\n size?: 'sm' | 'md'\n }\n\nexport type AlertDialogHeaderProps = React.ComponentProps<'div'>\n\nexport type AlertDialogFooterProps = React.ComponentProps<'div'>\n\nexport type AlertDialogMediaProps = React.ComponentProps<'div'>\n\nexport type AlertDialogTitleProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Title>\n\nexport type AlertDialogDescriptionProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Description>\n\nexport type AlertDialogActionProps = Omit<AsChildPrimitiveProps<typeof AlertDialogPrimitive.Close>, 'className'> &\n Pick<React.ComponentProps<typeof Button>, 'className' | 'variant' | 'color' | 'size'>\n\nexport type AlertDialogCancelProps = Omit<AsChildPrimitiveProps<typeof AlertDialogPrimitive.Close>, 'className'> &\n Pick<React.ComponentProps<typeof Button>, 'className' | 'variant' | 'color' | 'size'>\n\nfunction AlertDialog({ ...props }: AlertDialogProps) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({ asChild, children, ...props }: AlertDialogTriggerProps) {\n return (\n <AlertDialogPrimitive.Trigger\n data-slot=\"alert-dialog-trigger\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogPortal({ ...props }: AlertDialogPortalProps) {\n return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n}\n\nfunction AlertDialogOverlay({ className, asChild, children, ...props }: AlertDialogOverlayProps) {\n return (\n <AlertDialogPrimitive.Backdrop\n data-slot=\"alert-dialog-overlay\"\n className={(state) =>\n cn(\n 'fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n size = 'md',\n keepMounted,\n asChild,\n children,\n ...props\n}: AlertDialogContentProps) {\n return (\n <AlertDialogPortal keepMounted={keepMounted}>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Popup\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={(state) =>\n cn(\n 'group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 ring-1 ring-foreground/10 duration-100 outline-none data-[size=md]:max-w-xs data-[size=sm]:max-w-xs data-[size=md]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n 'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=md]/alert-dialog-content:place-items-start sm:group-data-[size=md]/alert-dialog-content:text-left sm:group-data-[size=md]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n '-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogMedia({ className, ...props }: AlertDialogMediaProps) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=md]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({ className, asChild, children, ...props }: AlertDialogTitleProps) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={(state) =>\n cn(\n 'text-base font-medium sm:group-data-[size=md]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogDescription({ className, asChild, children, ...props }: AlertDialogDescriptionProps) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={(state) =>\n cn(\n 'text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild,\n children,\n ...props\n}: AlertDialogActionProps) {\n const buttonProps = { variant, color, size, className: cn(className) }\n\n // With `asChild`, the Button merges the close behavior into the consumer's element instead of a <button>.\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-action\"\n render={\n asChild ? (\n <Button {...buttonProps} asChild>\n {children}\n </Button>\n ) : (\n <Button {...buttonProps} />\n )\n }\n {...props}\n >\n {asChild ? undefined : children}\n </AlertDialogPrimitive.Close>\n )\n}\n\nfunction AlertDialogCancel({\n className,\n variant = 'outline',\n color = 'primary',\n size = 'md',\n asChild,\n children,\n ...props\n}: AlertDialogCancelProps) {\n const buttonProps = { variant, color, size, className: cn(className) }\n\n // With `asChild`, the Button merges the close behavior into the consumer's element instead of a <button>.\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-cancel\"\n render={\n asChild ? (\n <Button {...buttonProps} asChild>\n {children}\n </Button>\n ) : (\n <Button {...buttonProps} />\n )\n }\n {...props}\n >\n {asChild ? undefined : children}\n </AlertDialogPrimitive.Close>\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger\n}\n"],"mappings":"8UA0CA,SAAS,YAAY,CAAE,GAAGG,GAA2B,CACnD,MAAO,kBAACH,EAAqB,KAAtB,CAA2B,YAAU,eAAe,GAAIG,CAAQ,CAAA,CACzE,CAEA,SAAS,mBAAmB,CAAE,UAAS,WAAU,GAAGA,GAAkC,CACpF,MACE,kBAACH,EAAqB,QAAtB,CACE,YAAU,uBACV,GAAIG,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,kBAAkB,CAAE,GAAGH,GAAiC,CAC/D,MAAO,kBAACH,EAAqB,OAAtB,CAA6B,YAAU,sBAAsB,GAAIG,CAAQ,CAAA,CAClF,CAEA,SAAS,mBAAmB,CAAE,YAAW,UAAS,WAAU,GAAGA,GAAkC,CAC/F,MACE,kBAACH,EAAqB,SAAtB,CACE,YAAU,uBACV,UAAY,GACVO,EACE,gLACAN,EAAiBO,EAAWC,CAAK,CACnC,EAEF,GAAIN,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CA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AAkB,CACzB,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UACA,WACA,GAAGH,GACsB,CACzB,IAAMQ,EAAc,CAAE,UAAS,QAAO,OAAM,UAAWJ,EAAGC,CAAS,CAAE,EAGrE,MACE,kBAACR,EAAqB,MAAtB,CACE,YAAU,sBACV,OACEK,EACE,kBAACO,EAAD,CAAQ,GAAID,EAAa,QAAA,GACtB,UACK,CAAA,EAER,kBAACC,EAAD,CAAQ,GAAID,CAAc,CAAA,EAG9B,GAAIR,EAEH,SAAAE,EAAU,IAAA,GAAYC,CACG,CAAA,CAEhC,CAEA,SAAS,kBAAkB,CACzB,YACA,UAAU,UACV,QAAQ,UACR,OAAO,KACP,UACA,WACA,GAAGH,GACsB,CACzB,IAAMQ,EAAc,CAAE,UAAS,QAAO,OAAM,UAAWJ,EAAGC,CAAS,CAAE,EAGrE,MACE,kBAACR,EAAqB,MAAtB,CACE,YAAU,sBACV,OACEK,EACE,kBAACO,EAAD,CAAQ,GAAID,EAAa,QAAA,GACtB,UACK,CAAA,EAER,kBAACC,EAAD,CAAQ,GAAID,CAAc,CAAA,EAG9B,GAAIR,EAEH,SAAAE,EAAU,IAAA,GAAYC,CACG,CAAA,CAEhC"}
1
+ {"version":3,"file":"alert-dialog.js","names":["AlertDialogPrimitive","resolveClassName","AlertDialog$1","props","toAsChildRenderProps","asChild","children","cn","className","state","overlayProps","size","buttonProps","Button"],"sources":["../../src/components/alert-dialog.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\n\nexport type AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root>\n\nexport type AlertDialogTriggerProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Trigger>\n\nexport type AlertDialogPortalProps = React.ComponentProps<typeof AlertDialogPrimitive.Portal>\n\nexport type AlertDialogOverlayProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Backdrop>\n\nexport type AlertDialogContentProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Popup> &\n Pick<AlertDialogPortalProps, 'keepMounted'> & {\n /**\n * Width of the dialog; `md` also places `AlertDialogMedia` next to the text on larger screens.\n * @default 'md'\n */\n size?: 'sm' | 'md'\n /** Props passed to the overlay rendered behind the dialog. */\n overlayProps?: AlertDialogOverlayProps\n }\n\nexport type AlertDialogHeaderProps = React.ComponentProps<'div'>\n\nexport type AlertDialogFooterProps = React.ComponentProps<'div'>\n\nexport type AlertDialogMediaProps = React.ComponentProps<'div'>\n\nexport type AlertDialogTitleProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Title>\n\nexport type AlertDialogDescriptionProps = AsChildPrimitiveProps<typeof AlertDialogPrimitive.Description>\n\nexport type AlertDialogActionProps = Omit<AsChildPrimitiveProps<typeof AlertDialogPrimitive.Close>, 'className'> &\n Pick<React.ComponentProps<typeof Button>, 'className' | 'variant' | 'color' | 'size'>\n\nexport type AlertDialogCancelProps = Omit<AsChildPrimitiveProps<typeof AlertDialogPrimitive.Close>, 'className'> &\n Pick<React.ComponentProps<typeof Button>, 'className' | 'variant' | 'color' | 'size'>\n\nfunction AlertDialog({ ...props }: AlertDialogProps) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({ asChild, children, ...props }: AlertDialogTriggerProps) {\n return (\n <AlertDialogPrimitive.Trigger\n data-slot=\"alert-dialog-trigger\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogPortal({ ...props }: AlertDialogPortalProps) {\n return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n}\n\nfunction AlertDialogOverlay({ className, forceRender = true, asChild, children, ...props }: AlertDialogOverlayProps) {\n return (\n <AlertDialogPrimitive.Backdrop\n data-slot=\"alert-dialog-overlay\"\n forceRender={forceRender}\n className={(state) =>\n cn(\n 'fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n size = 'md',\n overlayProps,\n keepMounted,\n asChild,\n children,\n ...props\n}: AlertDialogContentProps) {\n return (\n <AlertDialogPortal keepMounted={keepMounted}>\n <AlertDialogOverlay {...overlayProps} />\n <AlertDialogPrimitive.Popup\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={(state) =>\n cn(\n 'group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 ring-1 ring-foreground/10 duration-100 outline-none data-[size=md]:max-w-xs data-[size=sm]:max-w-xs data-[size=md]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n 'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=md]/alert-dialog-content:place-items-start sm:group-data-[size=md]/alert-dialog-content:text-left sm:group-data-[size=md]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n '-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogMedia({ className, ...props }: AlertDialogMediaProps) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=md]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({ className, asChild, children, ...props }: AlertDialogTitleProps) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={(state) =>\n cn(\n 'text-base font-medium sm:group-data-[size=md]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogDescription({ className, asChild, children, ...props }: AlertDialogDescriptionProps) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={(state) =>\n cn(\n 'text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild,\n children,\n ...props\n}: AlertDialogActionProps) {\n const buttonProps = { variant, color, size, className: cn(className) }\n\n // With `asChild`, the Button merges the close behavior into the consumer's element instead of a <button>.\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-action\"\n render={\n asChild ? (\n <Button {...buttonProps} asChild>\n {children}\n </Button>\n ) : (\n <Button {...buttonProps} />\n )\n }\n {...props}\n >\n {asChild ? undefined : children}\n </AlertDialogPrimitive.Close>\n )\n}\n\nfunction AlertDialogCancel({\n className,\n variant = 'outline',\n color = 'primary',\n size = 'md',\n asChild,\n children,\n ...props\n}: AlertDialogCancelProps) {\n const buttonProps = { variant, color, size, className: cn(className) }\n\n // With `asChild`, the Button merges the close behavior into the consumer's element instead of a <button>.\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-cancel\"\n render={\n asChild ? (\n <Button {...buttonProps} asChild>\n {children}\n </Button>\n ) : (\n <Button {...buttonProps} />\n )\n }\n {...props}\n >\n {asChild ? undefined : children}\n </AlertDialogPrimitive.Close>\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger\n}\n"],"mappings":"A,8UA4CA,SAAS,YAAY,CAAE,GAAGG,GAA2B,CACnD,MAAO,kBAACH,EAAqB,KAAtB,CAA2B,YAAU,eAAe,GAAIG,CAAQ,CAAA,CACzE,CAEA,SAAS,mBAAmB,CAAE,UAAS,WAAU,GAAGA,GAAkC,CACpF,MACE,kBAACH,EAAqB,QAAtB,CACE,YAAU,uBACV,GAAIG,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,kBAAkB,CAAE,GAAGH,GAAiC,CAC/D,MAAO,kBAACH,EAAqB,OAAtB,CAA6B,YAAU,sBAAsB,GAAIG,CAAQ,CAAA,CAClF,CAEA,SAAS,mBAAmB,CAAE,YAAW,cAAc,GAAM,UAAS,WAAU,GAAGA,GAAkC,CACnH,MACE,kBAACH,EAAqB,SAAtB,CACE,YAAU,uBACG,cACb,UAAY,GACVO,EACE,gLACAN,EAAiBO,EAAWC,CAAK,CACnC,EAEF,GAAIN,EACJ,GAAIC,EAAqBC,EA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,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,kBAAkB,CACzB,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UACA,WACA,GAAGH,GACsB,CACzB,IAAMS,EAAc,CAAE,UAAS,QAAO,OAAM,UAAWL,EAAGC,CAAS,CAAE,EAGrE,MACE,kBAACR,EAAqB,MAAtB,CACE,YAAU,sBACV,OACEK,EACE,kBAACQ,EAAD,CAAQ,GAAID,EAAa,QAAA,GACtB,UACK,CAAA,EAER,kBAACC,EAAD,CAAQ,GAAID,CAAc,CAAA,EAG9B,GAAIT,EAEH,SAAAE,EAAU,IAAA,GAAYC,CACG,CAAA,CAEhC,CAEA,SAAS,kBAAkB,CACzB,YACA,UAAU,UACV,QAAQ,UACR,OAAO,KACP,UACA,WACA,GAAGH,GACsB,CACzB,IAAMS,EAAc,CAAE,UAAS,QAAO,OAAM,UAAWL,EAAGC,CAAS,CAAE,EAGrE,MACE,kBAACR,EAAqB,MAAtB,CACE,YAAU,sBACV,OACEK,EACE,kBAACQ,EAAD,CAAQ,GAAID,EAAa,QAAA,GACtB,UACK,CAAA,EAER,kBAACC,EAAD,CAAQ,GAAID,CAAc,CAAA,EAG9B,GAAIT,EAEH,SAAAE,EAAU,IAAA,GAAYC,CACG,CAAA,CAEhC,C"}
@@ -1,7 +1,6 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import * as React from "react";
3
3
  import { VariantProps } from "class-variance-authority";
4
- //#region src/components/alert.d.ts
5
4
  declare const alertVariants: (props?: ({
6
5
  variant?: "default" | "destructive" | null | undefined;
7
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -13,6 +12,5 @@ declare function Alert({ className, variant, ...props }: AlertProps): React.JSX.
13
12
  declare function AlertTitle({ className, ...props }: AlertTitleProps): React.JSX.Element;
14
13
  declare function AlertDescription({ className, ...props }: AlertDescriptionProps): React.JSX.Element;
15
14
  declare function AlertAction({ className, ...props }: AlertActionProps): React.JSX.Element;
16
- //#endregion
17
15
  export { Alert, AlertAction, AlertDescription, AlertTitle };
18
16
  //# sourceMappingURL=alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":["alertVariants","cva","props","cn","className"],"sources":["../../src/components/alert.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst alertVariants = cva(\n \"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert\",\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive: 'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current'\n }\n },\n defaultVariants: {\n variant: 'default'\n }\n }\n)\n\nexport type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants>\n\nexport type AlertTitleProps = React.ComponentProps<'div'>\n\nexport type AlertDescriptionProps = React.ComponentProps<'div'>\n\nexport type AlertActionProps = React.ComponentProps<'div'>\n\nfunction Alert({ className, variant, ...props }: AlertProps) {\n return <div data-slot=\"alert\" role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n}\n\nfunction AlertTitle({ className, ...props }: AlertTitleProps) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n 'font-medium group-has-[>svg]/alert:col-start-2',\n '[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDescription({ className, ...props }: AlertDescriptionProps) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n 'text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4',\n '[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertAction({ className, ...props }: AlertActionProps) {\n return <div data-slot=\"alert-action\" className={cn('absolute top-2 right-2', className)} {...props} />\n}\n\nexport { Alert, AlertAction, AlertDescription, AlertTitle }\n"],"mappings":"oKAMA,MAAMA,EAAgBC,EACpB,4TACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,+BACT,YAAa,mGACf,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAUA,SAAS,MAAM,CAAE,YAAW,UAAS,GAAGC,GAAqB,CAC3D,MAAO,kBAAC,MAAD,CAAK,YAAU,QAAQ,KAAK,QAAQ,UAAWC,EAAGH,EAAc,CAAE,SAAQ,CAAC,EAAGI,CAAS,EAAG,GAAIF,CAAQ,CAAA,CAC/G,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWC,EACT,iDACA,uEACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,GAAGA,GAAgC,CACxE,MACE,kBAAC,MAAD,CACE,YAAU,oBACV,UAAWC,EACT,wFACA,uEACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MAAO,kBAAC,MAAD,CAAK,YAAU,eAAe,UAAWC,EAAG,yBAA0BC,CAAS,EAAG,GAAIF,CAAQ,CAAA,CACvG"}
1
+ {"version":3,"file":"alert.js","names":["alertVariants","cva","props","cn","className"],"sources":["../../src/components/alert.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst alertVariants = cva(\n \"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert\",\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive: 'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current'\n }\n },\n defaultVariants: {\n variant: 'default'\n }\n }\n)\n\nexport type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants>\n\nexport type AlertTitleProps = React.ComponentProps<'div'>\n\nexport type AlertDescriptionProps = React.ComponentProps<'div'>\n\nexport type AlertActionProps = React.ComponentProps<'div'>\n\nfunction Alert({ className, variant, ...props }: AlertProps) {\n return <div data-slot=\"alert\" role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n}\n\nfunction AlertTitle({ className, ...props }: AlertTitleProps) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n 'font-medium group-has-[>svg]/alert:col-start-2',\n '[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDescription({ className, ...props }: AlertDescriptionProps) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n 'text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4',\n '[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertAction({ className, ...props }: AlertActionProps) {\n return <div data-slot=\"alert-action\" className={cn('absolute top-2 right-2', className)} {...props} />\n}\n\nexport { Alert, AlertAction, AlertDescription, AlertTitle }\n"],"mappings":"A,oKAMA,MAAMA,EAAgBC,EACpB,4TACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,+BACT,YAAa,mGACf,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAUA,SAAS,MAAM,CAAE,YAAW,UAAS,GAAGC,GAAqB,CAC3D,MAAO,kBAAC,MAAD,CAAK,YAAU,QAAQ,KAAK,QAAQ,UAAWC,EAAGH,EAAc,CAAE,SAAQ,CAAC,EAAGI,CAAS,EAAG,GAAIF,CAAQ,CAAA,CAC/G,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWC,EACT,iDACA,uEACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,GAAGA,GAAgC,CACxE,MACE,kBAAC,MAAD,CACE,YAAU,oBACV,UAAWC,EACT,wFACA,uEACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MAAO,kBAAC,MAAD,CAAK,YAAU,eAAe,UAAWC,EAAG,yBAA0BC,CAAS,EAAG,GAAIF,CAAQ,CAAA,CACvG,C"}
@@ -1,13 +1,11 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { n as AsChildProps } from "../as-child-T9W73ZYU.js";
3
3
  import { VariantProps } from "class-variance-authority";
4
- //#region src/components/anchor.d.ts
5
4
  declare const anchorVariants: (props?: ({
6
5
  size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
7
6
  underline?: "always" | "hover" | "never" | "not-hover" | null | undefined;
8
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
8
  export type AnchorProps = AsChildProps<'a'> & VariantProps<typeof anchorVariants>;
10
9
  declare function Anchor({ className, size, underline, ...props }: AnchorProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
11
- //#endregion
12
10
  export { Anchor, anchorVariants };
13
11
  //# sourceMappingURL=anchor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.js","names":["anchorVariants","cva","props","useAsChild","size","underline","cn","className"],"sources":["../../src/components/anchor.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\n\nconst anchorVariants = cva(\n 'text-primary rounded-sm underline-offset-4 transition-colors outline-none hover:text-primary/80 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n {\n variants: {\n size: {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-base',\n lg: 'text-lg',\n xl: 'text-xl'\n },\n underline: {\n always: 'underline',\n hover: 'no-underline hover:underline',\n never: 'no-underline',\n 'not-hover': 'underline hover:no-underline'\n }\n },\n defaultVariants: {\n size: 'md',\n underline: 'hover'\n }\n }\n)\n\nexport type AnchorProps = AsChildProps<'a'> & VariantProps<typeof anchorVariants>\n\nfunction Anchor({ className, size = 'md', underline = 'hover', ...props }: AnchorProps) {\n return useAsChild('a', {\n 'data-slot': 'anchor',\n 'data-size': size,\n 'data-underline': underline,\n className: cn(anchorVariants({ size, underline }), className),\n ...props\n })\n}\n\nexport { Anchor, anchorVariants }\n"],"mappings":"4KAKA,MAAMA,EAAiBC,EACrB,4KACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,YACJ,GAAI,UACJ,GAAI,SACN,EACA,UAAW,CACT,OAAQ,YACR,MAAO,+BACP,MAAO,eACP,YAAa,8BACf,CACF,EACA,gBAAiB,CACf,KAAM,KACN,UAAW,OACb,CACF,CACF,EAIA,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,YAAY,QAAS,GAAGC,GAAsB,CACtF,OAAOC,EAAW,IAAK,CACrB,YAAa,SACb,YAAaC,EACb,iBAAkBC,EAClB,UAAWC,EAAGN,EAAe,CAAE,OAAM,WAAU,CAAC,EAAGO,CAAS,EAC5D,GAAGL,CACL,CAAC,CACH"}
1
+ {"version":3,"file":"anchor.js","names":["anchorVariants","cva","props","useAsChild","size","underline","cn","className"],"sources":["../../src/components/anchor.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\n\nconst anchorVariants = cva(\n 'text-primary rounded-sm underline-offset-4 transition-colors outline-none hover:text-primary/80 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n {\n variants: {\n size: {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-base',\n lg: 'text-lg',\n xl: 'text-xl'\n },\n underline: {\n always: 'underline',\n hover: 'no-underline hover:underline',\n never: 'no-underline',\n 'not-hover': 'underline hover:no-underline'\n }\n },\n defaultVariants: {\n size: 'md',\n underline: 'hover'\n }\n }\n)\n\nexport type AnchorProps = AsChildProps<'a'> & VariantProps<typeof anchorVariants>\n\nfunction Anchor({ className, size = 'md', underline = 'hover', ...props }: AnchorProps) {\n return useAsChild('a', {\n 'data-slot': 'anchor',\n 'data-size': size,\n 'data-underline': underline,\n className: cn(anchorVariants({ size, underline }), className),\n ...props\n })\n}\n\nexport { Anchor, anchorVariants }\n"],"mappings":"A,4KAKA,MAAMA,EAAiBC,EACrB,4KACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,YACJ,GAAI,UACJ,GAAI,SACN,EACA,UAAW,CACT,OAAQ,YACR,MAAO,+BACP,MAAO,eACP,YAAa,8BACf,CACF,EACA,gBAAiB,CACf,KAAM,KACN,UAAW,OACb,CACF,CACF,EAIA,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,YAAY,QAAS,GAAGC,GAAsB,CACtF,OAAOC,EAAW,IAAK,CACrB,YAAa,SACb,YAAaC,EACb,iBAAkBC,EAClB,UAAWC,EAAGN,EAAe,CAAE,OAAM,WAAU,CAAC,EAAGO,CAAS,EAC5D,GAAGL,CACL,CAAC,CACH,C"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey } from "../chart-B_6nC_ih.js";
2
+ import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey } from "../chart-8rgtsk95.js";
3
3
  import * as React from "react";
4
4
  import { Area, AreaChart as AreaChart$1 } from "recharts";
5
- //#region src/components/area-chart.d.ts
6
5
  export type AreaChartSeries = {
7
6
  /** Field of each `data` row holding this series’ values. Also the default label. */
8
7
  name: string;
@@ -89,6 +88,5 @@ export type AreaChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {
89
88
  areaChartProps?: Omit<React.ComponentProps<typeof AreaChart$1>, 'data' | 'stackOffset'>;
90
89
  };
91
90
  declare function AreaChart({ className, data, series, dataKey, type, curveType, withXAxis, withYAxis, gridAxis, withDots, withTooltip, withLegend, connectNulls, unit, fillOpacity, strokeWidth, animationDuration, tooltipProps, legendProps, areaProps, areaChartProps, ...props }: AreaChartProps): React.JSX.Element;
92
- //#endregion
93
91
  export { AreaChart };
94
92
  //# sourceMappingURL=area-chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"area-chart.js","names":["RechartsAreaChart","React","AreaChart$1","series","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","stackId","type","stackOffset","ChartContainer","cn","className","areaChartProps","gridAxis","CartesianGrid","withXAxis","XAxis","withYAxis","YAxis","value","unit","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","Area","curveType","withDots","animationDuration","areaProps"],"sources":["../../src/components/area-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Area, CartesianGrid, Legend, AreaChart as RechartsAreaChart, Tooltip, XAxis, YAxis } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport {\n type ChartColorKey,\n type ChartConfig,\n ChartContainer,\n ChartLegendContent,\n type ChartLegendContentProps,\n ChartTooltipContent,\n type ChartTooltipContentProps,\n DEFAULT_CHART_PALETTE,\n resolveChartColor\n} from './chart'\n\nexport type AreaChartSeries = {\n /** Field of each `data` row holding this series’ values. Also the default label. */\n name: string\n /** Name shown in the tooltip and legend. Defaults to `name`. */\n label?: string\n /** Any CSS color. Wins over `colorKey`. */\n color?: string\n /** Palette family, resolved to its semantic color `var(--{key})`. */\n colorKey?: ChartColorKey\n}\n\nexport type AreaChartType = 'default' | 'stacked' | 'percent' | 'split'\nexport type AreaChartCurveType = 'linear' | 'monotone' | 'natural' | 'step' | 'bump' | 'stepAfter' | 'stepBefore'\nexport type AreaChartGridAxis = 'none' | 'x' | 'y' | 'xy'\n\nexport type AreaChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n /** Rows to plot. */\n data: Array<Record<string, unknown>>\n /** Series to draw, one per field of `data`. */\n series: AreaChartSeries[]\n /** Field of `data` used for the categories axis. */\n dataKey: string\n /**\n * `stacked` stacks the series, `percent` stacks them to 100%, `split` stacks them around a center line.\n * @default 'default'\n */\n type?: AreaChartType\n /**\n * Shape of the lines between points.\n * @default 'monotone'\n */\n curveType?: AreaChartCurveType\n /**\n * Shows the x axis.\n * @default true\n */\n withXAxis?: boolean\n /**\n * Shows the y axis.\n * @default true\n */\n withYAxis?: boolean\n /**\n * Grid lines to draw.\n * @default 'x'\n */\n gridAxis?: AreaChartGridAxis\n /**\n * Draws a dot on each point.\n * @default false\n */\n withDots?: boolean\n /**\n * Shows a tooltip on hover.\n * @default true\n */\n withTooltip?: boolean\n /**\n * Shows the legend.\n * @default false\n */\n withLegend?: boolean\n /** Connects the line across missing values. */\n connectNulls?: boolean\n /** Appended to the axis and tooltip values. */\n unit?: string\n /**\n * Opacity of the area fill.\n * @default 0.2\n */\n fillOpacity?: number\n /**\n * Width of the lines.\n * @default 2\n */\n strokeWidth?: number\n /** Animation length in ms. */\n animationDuration?: number\n /** Props for the tooltip content. */\n tooltipProps?: ChartTooltipContentProps\n /** Props for the legend content. */\n legendProps?: ChartLegendContentProps\n /** Props for each Recharts `<Area>`. */\n areaProps?: Partial<React.ComponentProps<typeof Area>>\n /** Props for the Recharts `<AreaChart>`. */\n areaChartProps?: Omit<React.ComponentProps<typeof RechartsAreaChart>, 'data' | 'stackOffset'>\n}\n\nfunction buildConfig(series: AreaChartSeries[]): ChartConfig {\n return series.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n label: item.label ?? item.name,\n color:\n item.color ?? resolveChartColor(item.colorKey) ?? DEFAULT_CHART_PALETTE[index % DEFAULT_CHART_PALETTE.length]\n }\n return acc\n }, {})\n}\n\nfunction AreaChart({\n className,\n data,\n series,\n dataKey,\n type = 'default',\n curveType = 'monotone',\n withXAxis = true,\n withYAxis = true,\n gridAxis = 'x',\n withDots = false,\n withTooltip = true,\n withLegend = false,\n connectNulls,\n unit,\n fillOpacity = 0.2,\n strokeWidth = 2,\n animationDuration,\n tooltipProps,\n legendProps,\n areaProps,\n areaChartProps,\n ...props\n}: AreaChartProps) {\n const config = React.useMemo(() => buildConfig(series), [series])\n const stackId = type === 'default' ? undefined : 'stack'\n const stackOffset = type === 'percent' ? 'expand' : type === 'split' ? 'silhouette' : undefined\n\n return (\n <ChartContainer data-slot=\"area-chart\" className={cn('w-full', className)} config={config} {...props}>\n <RechartsAreaChart {...areaChartProps} data={data} stackOffset={stackOffset}>\n {gridAxis !== 'none' && (\n <CartesianGrid\n vertical={gridAxis === 'y' || gridAxis === 'xy'}\n horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n />\n )}\n {withXAxis && <XAxis dataKey={dataKey} tickLine={false} axisLine={false} tickMargin={8} />}\n {withYAxis && (\n <YAxis\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={\n type === 'percent'\n ? (value: number) => `${Math.round(value * 100)}%`\n : unit\n ? (value) => `${value}${unit}`\n : undefined\n }\n />\n )}\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent {...legendProps} />} />}\n {series.map((item) => (\n <Area\n key={item.name}\n type={curveType}\n dataKey={item.name}\n stackId={stackId}\n stroke={config[item.name]?.color}\n fill={config[item.name]?.color}\n fillOpacity={fillOpacity}\n strokeWidth={strokeWidth}\n dot={withDots}\n connectNulls={connectNulls}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...areaProps}\n />\n ))}\n </RechartsAreaChart>\n </ChartContainer>\n )\n}\n\nexport { AreaChart }\n"],"mappings":"uZAyGA,SAAS,YAAY,EAAwC,CAC3D,OAAOG,EAAO,QAAqB,EAAK,EAAM,KAC5C,EAAIC,EAAK,MAAQ,CACf,MAAOA,EAAK,OAASA,EAAK,KAC1B,MACEA,EAAK,OAASC,EAAkBD,EAAK,QAAQ,GAAKE,EAAsBC,EAAQD,EAAsB,OAC1G,EACOE,GACN,CAAC,CAAC,CACP,CAEA,SAAS,UAAU,CACjB,YACA,OACA,SACA,UACA,OAAO,UACP,YAAY,WACZ,YAAY,GACZ,YAAY,GACZ,WAAW,IACX,WAAW,GACX,cAAc,GACd,aAAa,GACb,eACA,OACA,cAAc,GACd,cAAc,EACd,oBACA,eACA,cACA,YACA,iBACA,GAAGC,GACc,CACjB,IAAMC,EAAST,EAAM,YAAc,YAAYE,CAAM,EAAG,CAACA,CAAM,CAAC,EAC1DQ,EAAUC,IAAS,UAAY,IAAA,GAAY,QAC3CC,EAAcD,IAAS,UAAY,SAAWA,IAAS,QAAU,aAAe,IAAA,GAEtF,MACE,kBAACE,EAAD,CAAgB,YAAU,aAAa,UAAWC,EAAG,SAAUC,CAAS,EAAW,SAAQ,GAAIP,EAC7F,SAAA,kBAACT,EAAD,CAAmB,GAAIiB,EAAsB,OAAmB,cAAhE,SAAA,CACGC,IAAa,QACZ,kBAACC,EAAD,CACE,SAAUD,IAAa,KAAOA,IAAa,KAC3C,WAAYA,IAAa,KAAOA,IAAa,IAC9C,CAAA,EAEFE,GAAa,kBAACC,EAAD,CAAgB,UAAS,SAAU,GAAO,SAAU,GAAO,WAAY,CAAI,CAAA,EACxFC,GACC,kBAACC,EAAD,CACE,SAAU,GACV,SAAU,GACV,WAAY,EACZ,cACEX,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAMY,EAAQ,GAAG,EAAE,GAC9CC,EACG,GAAU,GAAGD,IAAQC,IACtB,IAAA,EAET,CAAA,EAEFC,GAAe,kBAACC,EAAD,CAAS,OAAQ,GAAO,QAAS,kBAACC,EAAD,CAAqB,GAAIC,CAAe,CAAA,CAAI,CAAA,EAC5FC,GAAc,kBAACC,EAAD,CAAQ,QAAS,kBAACC,EAAD,CAAoB,GAAIC,CAAc,CAAA,CAAI,CAAA,EACzE9B,EAAO,IAAK,GACX,kBAAC+B,EAAD,CAEE,KAAMC,EACN,QAAS/B,EAAK,KACL,UACT,OAAQM,EAAON,EAAK,KAAK,EAAE,MAC3B,KAAMM,EAAON,EAAK,KAAK,EAAE,MACZ,cACA,cACb,IAAKgC,EACS,eACK,oBACnB,kBAAmBC,IAAsB,EACzC,GAAIC,CACL,EAbMlC,EAAK,IAaX,CACF,CACgB,GACL,CAAA,CAEpB"}
1
+ {"version":3,"file":"area-chart.js","names":["RechartsAreaChart","React","AreaChart$1","series","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","stackId","type","stackOffset","ChartContainer","cn","className","areaChartProps","gridAxis","CartesianGrid","withXAxis","XAxis","withYAxis","YAxis","value","unit","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","Area","curveType","withDots","animationDuration","areaProps"],"sources":["../../src/components/area-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Area, CartesianGrid, Legend, AreaChart as RechartsAreaChart, Tooltip, XAxis, YAxis } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport {\n type ChartColorKey,\n type ChartConfig,\n ChartContainer,\n ChartLegendContent,\n type ChartLegendContentProps,\n ChartTooltipContent,\n type ChartTooltipContentProps,\n DEFAULT_CHART_PALETTE,\n resolveChartColor\n} from './chart'\n\nexport type AreaChartSeries = {\n /** Field of each `data` row holding this series’ values. Also the default label. */\n name: string\n /** Name shown in the tooltip and legend. Defaults to `name`. */\n label?: string\n /** Any CSS color. Wins over `colorKey`. */\n color?: string\n /** Palette family, resolved to its semantic color `var(--{key})`. */\n colorKey?: ChartColorKey\n}\n\nexport type AreaChartType = 'default' | 'stacked' | 'percent' | 'split'\nexport type AreaChartCurveType = 'linear' | 'monotone' | 'natural' | 'step' | 'bump' | 'stepAfter' | 'stepBefore'\nexport type AreaChartGridAxis = 'none' | 'x' | 'y' | 'xy'\n\nexport type AreaChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n /** Rows to plot. */\n data: Array<Record<string, unknown>>\n /** Series to draw, one per field of `data`. */\n series: AreaChartSeries[]\n /** Field of `data` used for the categories axis. */\n dataKey: string\n /**\n * `stacked` stacks the series, `percent` stacks them to 100%, `split` stacks them around a center line.\n * @default 'default'\n */\n type?: AreaChartType\n /**\n * Shape of the lines between points.\n * @default 'monotone'\n */\n curveType?: AreaChartCurveType\n /**\n * Shows the x axis.\n * @default true\n */\n withXAxis?: boolean\n /**\n * Shows the y axis.\n * @default true\n */\n withYAxis?: boolean\n /**\n * Grid lines to draw.\n * @default 'x'\n */\n gridAxis?: AreaChartGridAxis\n /**\n * Draws a dot on each point.\n * @default false\n */\n withDots?: boolean\n /**\n * Shows a tooltip on hover.\n * @default true\n */\n withTooltip?: boolean\n /**\n * Shows the legend.\n * @default false\n */\n withLegend?: boolean\n /** Connects the line across missing values. */\n connectNulls?: boolean\n /** Appended to the axis and tooltip values. */\n unit?: string\n /**\n * Opacity of the area fill.\n * @default 0.2\n */\n fillOpacity?: number\n /**\n * Width of the lines.\n * @default 2\n */\n strokeWidth?: number\n /** Animation length in ms. */\n animationDuration?: number\n /** Props for the tooltip content. */\n tooltipProps?: ChartTooltipContentProps\n /** Props for the legend content. */\n legendProps?: ChartLegendContentProps\n /** Props for each Recharts `<Area>`. */\n areaProps?: Partial<React.ComponentProps<typeof Area>>\n /** Props for the Recharts `<AreaChart>`. */\n areaChartProps?: Omit<React.ComponentProps<typeof RechartsAreaChart>, 'data' | 'stackOffset'>\n}\n\nfunction buildConfig(series: AreaChartSeries[]): ChartConfig {\n return series.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n label: item.label ?? item.name,\n color:\n item.color ?? resolveChartColor(item.colorKey) ?? DEFAULT_CHART_PALETTE[index % DEFAULT_CHART_PALETTE.length]\n }\n return acc\n }, {})\n}\n\nfunction AreaChart({\n className,\n data,\n series,\n dataKey,\n type = 'default',\n curveType = 'monotone',\n withXAxis = true,\n withYAxis = true,\n gridAxis = 'x',\n withDots = false,\n withTooltip = true,\n withLegend = false,\n connectNulls,\n unit,\n fillOpacity = 0.2,\n strokeWidth = 2,\n animationDuration,\n tooltipProps,\n legendProps,\n areaProps,\n areaChartProps,\n ...props\n}: AreaChartProps) {\n const config = React.useMemo(() => buildConfig(series), [series])\n const stackId = type === 'default' ? undefined : 'stack'\n const stackOffset = type === 'percent' ? 'expand' : type === 'split' ? 'silhouette' : undefined\n\n return (\n <ChartContainer data-slot=\"area-chart\" className={cn('w-full', className)} config={config} {...props}>\n <RechartsAreaChart {...areaChartProps} data={data} stackOffset={stackOffset}>\n {gridAxis !== 'none' && (\n <CartesianGrid\n vertical={gridAxis === 'y' || gridAxis === 'xy'}\n horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n />\n )}\n {withXAxis && <XAxis dataKey={dataKey} tickLine={false} axisLine={false} tickMargin={8} />}\n {withYAxis && (\n <YAxis\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={\n type === 'percent'\n ? (value: number) => `${Math.round(value * 100)}%`\n : unit\n ? (value) => `${value}${unit}`\n : undefined\n }\n />\n )}\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent {...legendProps} />} />}\n {series.map((item) => (\n <Area\n key={item.name}\n type={curveType}\n dataKey={item.name}\n stackId={stackId}\n stroke={config[item.name]?.color}\n fill={config[item.name]?.color}\n fillOpacity={fillOpacity}\n strokeWidth={strokeWidth}\n dot={withDots}\n connectNulls={connectNulls}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...areaProps}\n />\n ))}\n </RechartsAreaChart>\n </ChartContainer>\n )\n}\n\nexport { AreaChart }\n"],"mappings":"A,uZAyGA,SAAS,YAAY,EAAwC,CAC3D,OAAOG,EAAO,QAAqB,EAAK,EAAM,KAC5C,EAAIC,EAAK,MAAQ,CACf,MAAOA,EAAK,OAASA,EAAK,KAC1B,MACEA,EAAK,OAASC,EAAkBD,EAAK,QAAQ,GAAKE,EAAsBC,EAAQD,EAAsB,OAC1G,EACOE,GACN,CAAC,CAAC,CACP,CAEA,SAAS,UAAU,CACjB,YACA,OACA,SACA,UACA,OAAO,UACP,YAAY,WACZ,YAAY,GACZ,YAAY,GACZ,WAAW,IACX,WAAW,GACX,cAAc,GACd,aAAa,GACb,eACA,OACA,cAAc,GACd,cAAc,EACd,oBACA,eACA,cACA,YACA,iBACA,GAAGC,GACc,CACjB,IAAMC,EAAST,EAAM,YAAc,YAAYE,CAAM,EAAG,CAACA,CAAM,CAAC,EAC1DQ,EAAUC,IAAS,UAAY,IAAA,GAAY,QAC3CC,EAAcD,IAAS,UAAY,SAAWA,IAAS,QAAU,aAAe,IAAA,GAEtF,MACE,kBAACE,EAAD,CAAgB,YAAU,aAAa,UAAWC,EAAG,SAAUC,CAAS,EAAW,SAAQ,GAAIP,EAC7F,SAAA,kBAACT,EAAD,CAAmB,GAAIiB,EAAsB,OAAmB,cAAhE,SAAA,CACGC,IAAa,QACZ,kBAACC,EAAD,CACE,SAAUD,IAAa,KAAOA,IAAa,KAC3C,WAAYA,IAAa,KAAOA,IAAa,IAC9C,CAAA,EAEFE,GAAa,kBAACC,EAAD,CAAgB,UAAS,SAAU,GAAO,SAAU,GAAO,WAAY,CAAI,CAAA,EACxFC,GACC,kBAACC,EAAD,CACE,SAAU,GACV,SAAU,GACV,WAAY,EACZ,cACEX,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAMY,EAAQ,GAAG,EAAE,GAC9CC,EACG,GAAU,GAAGD,IAAQC,IACtB,IAAA,EAET,CAAA,EAEFC,GAAe,kBAACC,EAAD,CAAS,OAAQ,GAAO,QAAS,kBAACC,EAAD,CAAqB,GAAIC,CAAe,CAAA,CAAI,CAAA,EAC5FC,GAAc,kBAACC,EAAD,CAAQ,QAAS,kBAACC,EAAD,CAAoB,GAAIC,CAAc,CAAA,CAAI,CAAA,EACzE9B,EAAO,IAAK,GACX,kBAAC+B,EAAD,CAEE,KAAMC,EACN,QAAS/B,EAAK,KACL,UACT,OAAQM,EAAON,EAAK,KAAK,EAAE,MAC3B,KAAMM,EAAON,EAAK,KAAK,EAAE,MACZ,cACA,cACb,IAAKgC,EACS,eACK,oBACnB,kBAAmBC,IAAsB,EACzC,GAAIC,CACL,EAbMlC,EAAK,IAaX,CACF,CACgB,C,EACL,CAAA,CAEpB,C"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
4
  import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
5
- //#region src/components/avatar.d.ts
6
5
  export type AvatarProps = AsChildPrimitiveProps<typeof Avatar$1.Root> & {
7
6
  /**
8
7
  * Avatar size.
@@ -21,6 +20,5 @@ declare function AvatarFallback({ className, asChild, children, ...props }: Avat
21
20
  declare function AvatarBadge({ className, ...props }: AvatarBadgeProps): React.JSX.Element;
22
21
  declare function AvatarGroup({ className, ...props }: AvatarGroupProps): React.JSX.Element;
23
22
  declare function AvatarGroupCount({ className, ...props }: AvatarGroupCountProps): React.JSX.Element;
24
- //#endregion
25
23
  export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
26
24
  //# sourceMappingURL=avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","names":["AvatarPrimitive","resolveClassName","Avatar$1","props","size","cn","className","state","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type AvatarProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Root> & {\n /**\n * Avatar size.\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport type AvatarImageProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Image>\n\nexport type AvatarFallbackProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Fallback>\n\nexport type AvatarBadgeProps = React.ComponentProps<'span'>\n\nexport type AvatarGroupProps = React.ComponentProps<'div'>\n\nexport type AvatarGroupCountProps = React.ComponentProps<'div'>\n\nfunction Avatar({ className, size = 'md', asChild, children, ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={(state) =>\n cn(\n 'group/avatar relative flex shrink-0 size-8 rounded-full select-none',\n 'data-[size=lg]:size-10 data-[size=sm]:size-6',\n 'after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarImage({ className, asChild, children, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={(state) => cn('rounded-full aspect-square size-full object-cover', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarFallback({ className, asChild, children, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={(state) =>\n cn(\n 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarBadge({ className, ...props }: AvatarBadgeProps) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroup({ className, ...props }: AvatarGroupProps) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroupCount({ className, ...props }: AvatarGroupCountProps) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2',\n 'group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6',\n '[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }\n"],"mappings":"oRA0BA,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,UAAS,WAAU,GAAGG,GAAsB,CACpF,MACE,kBAACH,EAAgB,KAAjB,CACE,YAAU,SACV,YAAWI,EACX,UAAY,GACVC,EACE,sEACA,+CACA,uIACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,UAAS,WAAU,GAAGP,GAA2B,CACjF,MACE,kBAACH,EAAgB,MAAjB,CACE,YAAU,eACV,UAAY,GAAUK,EAAG,oDAAqDJ,EAAiBK,EAAWC,CAAK,CAAC,EAChH,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,YAAW,UAAS,WAAU,GAAGP,GAA8B,CACvF,MACE,kBAACH,EAAgB,SAAjB,CACE,YAAU,kBACV,UAAY,GACVK,EACE,qIACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGP,GAA2B,CAC9D,MACE,kBAAC,OAAD,CACE,YAAU,eACV,UAAWE,EACT,2KACA,gFACA,kFACA,gFACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAAC,MAAD,CACE,YAAU,eACV,UAAWE,EACT,sGACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,GAAGA,GAAgC,CACxE,MACE,kBAAC,MAAD,CACE,YAAU,qBACV,UAAWE,EACT,uIACA,6FACA,2HACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"avatar.js","names":["AvatarPrimitive","resolveClassName","Avatar$1","props","size","cn","className","state","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type AvatarProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Root> & {\n /**\n * Avatar size.\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport type AvatarImageProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Image>\n\nexport type AvatarFallbackProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Fallback>\n\nexport type AvatarBadgeProps = React.ComponentProps<'span'>\n\nexport type AvatarGroupProps = React.ComponentProps<'div'>\n\nexport type AvatarGroupCountProps = React.ComponentProps<'div'>\n\nfunction Avatar({ className, size = 'md', asChild, children, ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={(state) =>\n cn(\n 'group/avatar relative flex shrink-0 size-8 rounded-full select-none',\n 'data-[size=lg]:size-10 data-[size=sm]:size-6',\n 'after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarImage({ className, asChild, children, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={(state) => cn('rounded-full aspect-square size-full object-cover', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarFallback({ className, asChild, children, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={(state) =>\n cn(\n 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarBadge({ className, ...props }: AvatarBadgeProps) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroup({ className, ...props }: AvatarGroupProps) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroupCount({ className, ...props }: AvatarGroupCountProps) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2',\n 'group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6',\n '[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }\n"],"mappings":"A,oRA0BA,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,UAAS,WAAU,GAAGG,GAAsB,CACpF,MACE,kBAACH,EAAgB,KAAjB,CACE,YAAU,SACV,YAAWI,EACX,UAAY,GACVC,EACE,sEACA,+CACA,uIACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,UAAS,WAAU,GAAGP,GAA2B,CACjF,MACE,kBAACH,EAAgB,MAAjB,CACE,YAAU,eACV,UAAY,GAAUK,EAAG,oDAAqDJ,EAAiBK,EAAWC,CAAK,CAAC,EAChH,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,YAAW,UAAS,WAAU,GAAGP,GAA8B,CACvF,MACE,kBAACH,EAAgB,SAAjB,CACE,YAAU,kBACV,UAAY,GACVK,EACE,qIACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGP,GAA2B,CAC9D,MACE,kBAAC,OAAD,CACE,YAAU,eACV,UAAWE,EACT,2KACA,gFACA,kFACA,gFACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAAC,MAAD,CACE,YAAU,eACV,UAAWE,EACT,sGACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,GAAGA,GAAgC,CACxE,MACE,kBAAC,MAAD,CACE,YAAU,qBACV,UAAWE,EACT,uIACA,6FACA,2HACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,C"}
@@ -1,7 +1,6 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { n as AsChildProps } from "../as-child-T9W73ZYU.js";
3
3
  import { VariantProps } from "class-variance-authority";
4
- //#region src/components/badge.d.ts
5
4
  declare const badgeVariants: (props?: ({
6
5
  size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
7
6
  variant?: "outline" | "secondary" | "solid" | "subtle" | null | undefined;
@@ -9,6 +8,5 @@ declare const badgeVariants: (props?: ({
9
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
9
  export type BadgeProps = AsChildProps<'span'> & VariantProps<typeof badgeVariants>;
11
10
  declare function Badge({ className, size, variant, color, ...props }: BadgeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
12
- //#endregion
13
11
  export { Badge, badgeVariants };
14
12
  //# sourceMappingURL=badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","names":["badgeVariants","cva","badgeColorVariants","props","useAsChild","size","variant","color","cn","className"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { badgeColorVariants } from '../lib/badge'\nimport { cn } from '../lib/utils'\n\nconst badgeVariants = cva(\n 'group/badge inline-flex w-fit items-center justify-center overflow-hidden border border-transparent font-semibold whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none',\n {\n variants: {\n size: {\n xs: 'h-4 gap-0.5 px-1.5 text-[10px] rounded-[4px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1',\n sm: 'h-4.5 gap-0.5 px-2 text-[11px] rounded-[5px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n md: 'h-5 gap-1 px-2 py-0.5 text-xs rounded-[6px] [&>svg]:size-3! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n lg: 'h-6 gap-1 px-2.5 text-xs rounded-[7px] [&>svg]:size-3.5! has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xl: 'h-7 gap-1.5 px-3 text-sm rounded-[8px] [&>svg]:size-4! has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5'\n },\n variant: {\n solid: 'bg-(--badge-solid) text-(--badge-solid-foreground) [a]:hover:opacity-90',\n secondary:\n 'border-border bg-background text-foreground [a]:hover:bg-muted dark:border-input dark:bg-input/30 dark:[a]:hover:bg-input/50',\n outline:\n 'border-(--badge-outline-border) text-(--badge-outline-foreground) [a]:hover:bg-(--badge-soft) [a]:hover:text-(--badge-soft-foreground)',\n subtle: 'bg-(--badge-soft) text-(--badge-soft-foreground) [a]:hover:bg-(--badge-soft-hover)'\n },\n color: badgeColorVariants\n },\n defaultVariants: {\n size: 'md',\n variant: 'solid',\n color: 'primary'\n }\n }\n)\n\nexport type BadgeProps = AsChildProps<'span'> & VariantProps<typeof badgeVariants>\n\nfunction Badge({ className, size = 'md', variant = 'solid', color = 'primary', ...props }: BadgeProps) {\n return useAsChild('span', {\n 'data-slot': 'badge',\n 'data-size': size,\n 'data-variant': variant,\n 'data-color': color,\n className: cn(badgeVariants({ size, variant, color }), className),\n ...props\n })\n}\n\nexport { Badge, badgeVariants }\n"],"mappings":"iOAMA,MAAMA,EAAgBC,EACpB,sWACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,mIACJ,GAAI,uIACJ,GAAI,oIACJ,GAAI,6HACJ,GAAI,8HACN,EACA,QAAS,CACP,MAAO,0EACP,UACE,+HACF,QACE,yIACF,OAAQ,oFACV,EACA,MAAOC,CACT,EACA,gBAAiB,CACf,KAAM,KACN,QAAS,QACT,MAAO,SACT,CACF,CACF,EAIA,SAAS,MAAM,CAAE,YAAW,OAAO,KAAM,UAAU,QAAS,QAAQ,UAAW,GAAGC,GAAqB,CACrG,OAAOC,EAAW,OAAQ,CACxB,YAAa,QACb,YAAaC,EACb,eAAgBC,EAChB,aAAcC,EACd,UAAWC,EAAGR,EAAc,CAAE,OAAM,UAAS,OAAM,CAAC,EAAGS,CAAS,EAChE,GAAGN,CACL,CAAC,CACH"}
1
+ {"version":3,"file":"badge.js","names":["badgeVariants","cva","badgeColorVariants","props","useAsChild","size","variant","color","cn","className"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { badgeColorVariants } from '../lib/badge'\nimport { cn } from '../lib/utils'\n\nconst badgeVariants = cva(\n 'group/badge inline-flex w-fit items-center justify-center overflow-hidden border border-transparent font-semibold whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none',\n {\n variants: {\n size: {\n xs: 'h-4 gap-0.5 px-1.5 text-[10px] rounded-[4px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1',\n sm: 'h-4.5 gap-0.5 px-2 text-[11px] rounded-[5px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n md: 'h-5 gap-1 px-2 py-0.5 text-xs rounded-[6px] [&>svg]:size-3! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n lg: 'h-6 gap-1 px-2.5 text-xs rounded-[7px] [&>svg]:size-3.5! has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xl: 'h-7 gap-1.5 px-3 text-sm rounded-[8px] [&>svg]:size-4! has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5'\n },\n variant: {\n solid: 'bg-(--badge-solid) text-(--badge-solid-foreground) [a]:hover:opacity-90',\n secondary:\n 'border-border bg-background text-foreground [a]:hover:bg-muted dark:border-input dark:bg-input/30 dark:[a]:hover:bg-input/50',\n outline:\n 'border-(--badge-outline-border) text-(--badge-outline-foreground) [a]:hover:bg-(--badge-soft) [a]:hover:text-(--badge-soft-foreground)',\n subtle: 'bg-(--badge-soft) text-(--badge-soft-foreground) [a]:hover:bg-(--badge-soft-hover)'\n },\n color: badgeColorVariants\n },\n defaultVariants: {\n size: 'md',\n variant: 'solid',\n color: 'primary'\n }\n }\n)\n\nexport type BadgeProps = AsChildProps<'span'> & VariantProps<typeof badgeVariants>\n\nfunction Badge({ className, size = 'md', variant = 'solid', color = 'primary', ...props }: BadgeProps) {\n return useAsChild('span', {\n 'data-slot': 'badge',\n 'data-size': size,\n 'data-variant': variant,\n 'data-color': color,\n className: cn(badgeVariants({ size, variant, color }), className),\n ...props\n })\n}\n\nexport { Badge, badgeVariants }\n"],"mappings":"A,iOAMA,MAAMA,EAAgBC,EACpB,sWACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,mIACJ,GAAI,uIACJ,GAAI,oIACJ,GAAI,6HACJ,GAAI,8HACN,EACA,QAAS,CACP,MAAO,0EACP,UACE,+HACF,QACE,yIACF,OAAQ,oFACV,EACA,MAAOC,CACT,EACA,gBAAiB,CACf,KAAM,KACN,QAAS,QACT,MAAO,SACT,CACF,CACF,EAIA,SAAS,MAAM,CAAE,YAAW,OAAO,KAAM,UAAU,QAAS,QAAQ,UAAW,GAAGC,GAAqB,CACrG,OAAOC,EAAW,OAAQ,CACxB,YAAa,QACb,YAAaC,EACb,eAAgBC,EAChB,aAAcC,EACd,UAAWC,EAAGR,EAAc,CAAE,OAAM,UAAS,OAAM,CAAC,EAAGS,CAAS,EAChE,GAAGN,CACL,CAAC,CACH,C"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey } from "../chart-B_6nC_ih.js";
2
+ import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey } from "../chart-8rgtsk95.js";
3
3
  import * as React from "react";
4
4
  import { Bar, BarChart as BarChart$1 } from "recharts";
5
- //#region src/components/bar-chart.d.ts
6
5
  export type BarChartSeries = {
7
6
  /** Field of each `data` row holding this series’ values. Also the default label. */
8
7
  name: string;
@@ -85,6 +84,5 @@ export type BarChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {
85
84
  barChartProps?: Omit<React.ComponentProps<typeof BarChart$1>, 'data' | 'layout' | 'stackOffset'>;
86
85
  };
87
86
  declare function BarChart({ className, data, series, dataKey, type, orientation, withXAxis, withYAxis, gridAxis, withTooltip, withLegend, barSize, radius, unit, animationDuration, tooltipProps, legendProps, barProps, barChartProps, ...props }: BarChartProps): React.JSX.Element;
88
- //#endregion
89
87
  export { BarChart };
90
88
  //# sourceMappingURL=bar-chart.d.ts.map