@uselets/ui 1.13.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,10 +53,15 @@ bun uselets init
53
53
  ```
54
54
 
55
55
  The command asks which theme to import, asks for your global CSS path with `src/styles/globals.css` as the
56
- default, and optionally installs the agent skill. For non-interactive setup, pass options:
56
+ default, and optionally installs the agent skill. It also imports the Inter font: it detects a conventional
57
+ app entry file (`app/layout.tsx`, `pages/_app.tsx`, `src/main.tsx`, `src/index.tsx`, and `.jsx` variants) and
58
+ inserts `import '@fontsource-variable/inter'` there, or asks for the entry file path when none is found. This
59
+ avoids `@import '@fontsource-variable/inter'` in the global CSS, which some bundlers (including Next.js) don't
60
+ resolve correctly for third-party CSS — import it as a JS module instead. For non-interactive setup, pass
61
+ options:
57
62
 
58
63
  ```bash
59
- bun uselets init --theme max --css src/styles/globals.css --no-install-skill
64
+ bun uselets init --theme max --css src/styles/globals.css --entry app/layout.tsx --no-install-skill
60
65
  ```
61
66
 
62
67
  ## Tailwind CSS v4 setup
@@ -76,13 +81,12 @@ npm install tailwindcss @tailwindcss/postcss
76
81
  export { default } from '@uselets/ui/postcss.config'
77
82
  ```
78
83
 
79
- 3. Import Tailwind, one package theme, and the Inter font in your global stylesheet:
84
+ 3. Import Tailwind and one package theme in your global stylesheet:
80
85
 
81
86
  ```css
82
87
  /* app.css */
83
88
  @import 'tailwindcss';
84
89
  @import '@uselets/ui/themes/max.css';
85
- @import '@fontsource-variable/inter';
86
90
  ```
87
91
 
88
92
  Use `@uselets/ui/themes/gomax.css` instead for GoMax apps. If your app consumes `@uselets/ui` components, add a
@@ -92,17 +96,25 @@ source directive so Tailwind can generate classes used by the package:
92
96
  @source '../node_modules/@uselets/ui/dist';
93
97
  ```
94
98
 
99
+ 4. Import the Inter font once from your app's entry file (not from CSS — bundlers such as Next.js don't
100
+ resolve third-party CSS `@import`s reliably):
101
+
102
+ ```ts
103
+ // app/layout.tsx (or src/main.tsx, pages/_app.tsx, ...)
104
+ import '@fontsource-variable/inter'
105
+ ```
106
+
95
107
  ## Quick start
96
108
 
97
- 1. Import one package theme once in your global stylesheet:
109
+ 1. Import Tailwind and one package theme once in your global stylesheet:
98
110
 
99
111
  ```css
100
112
  @import 'tailwindcss';
101
113
  @import '@uselets/ui/themes/max.css';
102
- @import '@fontsource-variable/inter';
103
114
  ```
104
115
 
105
- For GoMax apps, import `@uselets/ui/themes/gomax.css` instead.
116
+ For GoMax apps, import `@uselets/ui/themes/gomax.css` instead. Import the font once from your app's entry
117
+ file, as shown above.
106
118
 
107
119
  2. Import components from the package root:
108
120
 
@@ -355,7 +367,9 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
355
367
  | `heading` | `Heading`, `headingVariants` | Heading primitive with `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` (default: `md`) and `asChild`. |
356
368
  | `input` | `Input` | Wrapper for Base UI Input with all native `<input>` props. |
357
369
  | `input-otp` | `InputOTP`, `InputOTPGroup`, `InputOTPSlot`, `InputOTPSeparator`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS` | `InputOTP` supports all `input-otp` props plus `containerClassName`; use `maxLength` and `pattern` for validation. |
358
- | `mask-input` | `MaskInput` | Formatted input backed by `@react-input/mask`. Accepts `mask` plus optional `replacement`, `showMask`, `separate`, `track`, `modify`. Default replacement tokens: `9` (digit), `a` (letter), `*` (any). Forwards an external `ref` prop to the underlying `<input>`, composed with the mask ref. The `useMask` hook is also exported from `@uselets/ui/hooks/use-mask` for custom inputs. |
370
+ | `number-field` | `NumberField`, `NumberFieldGroup`, `NumberFieldDecrement`, `NumberFieldIncrement`, `NumberFieldInput`, `NumberFieldScrubArea` | Base UI-backed numeric stepper input. `size: 'sm' \| 'md' \| 'lg'` (default: `md`); supports `min`, `max`, `step`, and other Base UI `NumberField.Root` props. `NumberFieldScrubArea` renders a draggable `label` (required) that scrubs the value on pointer drag. |
371
+ | `phone-input` | `PhoneInput` | International phone input built on `react-phone-number-input`, composed from the existing `Input` and `Combobox` (country select), matching `Input`'s styling and single size. `value` / `onChange` use the E.164 `Value` string; `defaultCountry` defaults to `BR`. |
372
+ | `mask-input` | `MaskInput` | Formatted input backed by `@react-input/mask`. Accepts `mask` plus optional `replacement`, `showMask`, `separate`, `track`, `modify`. Default replacement tokens: `_` (digit), `#` (letter), `*` (any) — chosen so the token character is never a value the user actually types. When no custom `replacement` is passed, `mask` strings written with the older `9`/`a` tokens are automatically translated to `_`/`#`, so existing masks keep working. Forwards an external `ref` prop to the underlying `<input>`, composed with the mask ref. The `useMask` hook is also exported from `@uselets/ui/hooks/use-mask` for custom inputs. |
359
373
  | `kbd` | `Kbd`, `KbdGroup` | Keyboard shortcut presentation primitives. |
360
374
  | `label` | `Label` | Styled `<label>` wrapper. |
361
375
  | `marker` | `Marker`, `MarkerContent`, `MarkerIcon`, `markerVariants` | `variant: 'default' \| 'separator' \| 'border'` (default: `default`); `asChild?: boolean`. `separator` renders divider lines on both sides of the content (for labeled dividers); `border` renders a bottom border instead. |
@@ -371,6 +385,7 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
371
385
  | `skeleton` | `Skeleton` | Generic loading placeholder block. Supports `visible?: boolean` (default: `true`) and can wrap `children` to reserve their size while the placeholder is shown. |
372
386
  | `spinner` | `Spinner` | Loader icon (`role="status"`), accepts SVG props and supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`). |
373
387
  | `switch` | `Switch` | `Switch` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`), `color: UIColor` (default: `green`), `label?: React.ReactNode`, and `labelProps` for the composed `Label`. When `label` is provided without `id`, it generates an id and wires `htmlFor` automatically. Track size is `sm` 34x16px, `md` 42x20px, and `lg` 48x22px; the thumb and internal indicator scale with the switch. Label text follows switch size: `sm` 14px, `md` 16px, `lg` 18px. |
388
+ | `stepper` | `Stepper`, `StepperNav`, `StepperItem`, `StepperTrigger`, `StepperIndicator`, `StepperSeparator`, `StepperTitle`, `StepperDescription`, `StepperPanel`, `StepperContent`, `useStepper`, `useStepItem` | Multi-step progress navigation. `Stepper.orientation: 'horizontal' \| 'vertical'` (default: `horizontal`); supports controlled (`value` / `onValueChange`) and uncontrolled (`defaultValue`) active step, plus custom per-state `indicators` (`active`, `completed`, `inactive`, `loading`). `StepperItem` accepts `completed`, `disabled`, and `loading`. Arrow-key and Home/End keyboard navigation between triggers is built in. |
374
389
  | `tabs` | `Tabs`, `TabsContent`, `TabsList`, `TabsTrigger`, `tabsListVariants` | `TabsList.variant: 'line' \| 'enclosed'` (default: `line`); `TabsList.grow?: boolean` makes horizontal tabs share the available width equally; `line` uses a neutral border line with a `primary` active indicator. |
375
390
  | `text` | `Text`, `textVariants` | Text primitive with `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` (default: `md`) and `asChild`. |
376
391
  | `timeline` | `Timeline`, `TimelineItem`, `TimelineConnector`, `TimelineContent`, `TimelineDescription`, `TimelineEmpty`, `TimelineHeader`, `TimelineIcon`, `TimelineTime`, `TimelineTitle`, `timelineVariants` | `Timeline.size: 'sm' \| 'md' \| 'lg'` (default: `md`); `Timeline.iconSize: 'sm' \| 'md' \| 'lg'`; `TimelineItem.status: 'completed' \| 'in-progress' \| 'pending'`; icon and connector colors use the semantic palette (`primary`, `secondary`, `muted`, `accent`, `destructive`). |
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import{spawn as e}from"node:child_process";import t from"node:fs/promises";import n from"node:path";import r from"node:readline/promises";import{fileURLToPath as i}from"node:url";import{Command as a,Option as o}from"commander";const s=`uselets-ui`,c={codex:n.join(`.agents`,`skills`,s),claude:n.join(`.claude`,`skills`,s)},l=Object.keys(c);async function u(e){try{return await t.access(e),!0}catch{return!1}}async function d(e){return JSON.parse(await t.readFile(e,`utf8`))}async function f(){let e=i(new URL(`.`,import.meta.url));for(;;)try{return await t.access(n.join(e,`package.json`)),e}catch{let t=n.dirname(e);if(t===e)throw Error(`Unable to resolve @uselets/ui package root`);e=t}}function p(e){return e===`all`?l:[e]}function m(e,t){return!!(e.dependencies?.[t]||e.devDependencies?.[t]||e.peerDependencies?.[t]||e.optionalDependencies?.[t])}async function h(e,t){let r=t.packageManager?.split(`@`)[0];return r===`bun`||r===`pnpm`||r===`yarn`||r===`npm`?r:await u(n.join(e,`bun.lock`))?`bun`:await u(n.join(e,`pnpm-lock.yaml`))?`pnpm`:await u(n.join(e,`yarn.lock`))?`yarn`:(await u(n.join(e,`package-lock.json`)),`npm`)}function g(e,t,n){switch(e){case`bun`:return[`bun`,`add`,...n?[`-d`]:[],...t];case`pnpm`:return[`pnpm`,`add`,...n?[`-D`]:[],...t];case`yarn`:return[`yarn`,`add`,...n?[`-D`]:[],...t];case`npm`:return[`npm`,`install`,...n?[`-D`]:[],...t]}}async function _(t,n){let[r,...i]=t;if(!r)throw Error(`Missing command`);console.log(`Running: ${t.join(` `)}`),await new Promise((t,a)=>{let o=e(r,i,{cwd:n,stdio:`inherit`});o.on(`error`,a),o.on(`close`,e=>{if(e===0){t();return}a(Error(`${r} exited with code ${e}`))})})}function v(e,t){let n=e.dependencies?.[t]??e.devDependencies?.[t];if(!n)throw Error(`Unable to find ${t} version in @uselets/ui package metadata`);return n}async function y(e,t){let r=await f(),i=await d(n.join(r,`package.json`)),a=await h(e,t),o=[],s=[];if(!i.name||!i.version)throw Error(`Unable to resolve @uselets/ui package name and version`);m(t,i.name)||o.push(`${i.name}@${i.version}`),m(t,`@fontsource-variable/inter`)||o.push(`@fontsource-variable/inter@${v(i,`@fontsource-variable/inter`)}`),m(t,`tailwindcss`)||s.push(`tailwindcss@${v(i,`tailwindcss`)}`),m(t,`@tailwindcss/postcss`)||s.push(`@tailwindcss/postcss@${v(i,`@tailwindcss/postcss`)}`),o.length>0?await _(g(a,o,!1),e):console.log(`Runtime dependencies already declared.`),s.length>0?await _(g(a,s,!0),e):console.log(`Tailwind dependencies already declared.`)}async function b(e){let r=await f(),i=n.join(r,`skills`,s);try{await t.access(i)}catch{throw Error(`Bundled skill not found at ${i}`)}let a=[];for(let r of e){let e=n.join(process.cwd(),c[r]);await t.rm(e,{recursive:!0,force:!0}),await t.mkdir(n.dirname(e),{recursive:!0}),await t.cp(i,e,{recursive:!0}),a.push(e)}console.log(`Installed ${s} skill:`);for(let e of a)console.log(`- ${e}`)}async function x(){return r.createInterface({input:process.stdin,output:process.stdout})}async function S(e){if(!process.stdin.isTTY)return e;let t=await x();try{for(;;){let n=(await t.question(`Theme (max/gomax) [${e}]: `)).trim().toLowerCase();if(!n)return e;if(n===`max`||n===`gomax`)return n;console.log(`Please choose "max" or "gomax".`)}}finally{t.close()}}async function C(e){if(!process.stdin.isTTY)return e;let t=await x();try{return(await t.question(`Global CSS path [${e}]: `)).trim()||e}finally{t.close()}}async function w(){if(!process.stdin.isTTY)return!1;let e=await x();try{for(;;){let t=(await e.question(`Install agent skill? (y/N): `)).trim().toLowerCase();if(!t||t===`n`||t===`no`)return!1;if(t===`y`||t===`yes`)return!0;console.log(`Please answer "y" or "n".`)}}finally{e.close()}}async function T(e){let r=n.join(e,`postcss.config.mjs`);if(await u(r)){console.log(`Preserved existing postcss.config.mjs.`);return}await t.writeFile(r,`export { default } from '@uselets/ui/postcss.config'
3
- `),console.log(`Created postcss.config.mjs.`)}function E(e){let t=n.posix.dirname(e.replaceAll(n.sep,n.posix.sep)),r=n.posix.relative(t,`node_modules/@uselets/ui/dist`);return r.startsWith(`.`)?r:`./${r}`}function D(e,t,n){let r=[],i=/@import\s+['"]tailwindcss['"]/.test(e),a=/@import\s+['"]@uselets\/ui\/themes\/(?:max|gomax)\.css['"]/.test(e),o=/@import\s+['"]@fontsource-variable\/inter['"]/.test(e),s=/@source\s+['"][^'"]*@uselets\/ui\/dist['"]/.test(e);return i||r.push(`@import 'tailwindcss';`),a||r.push(`@import '@uselets/ui/themes/${t}.css';`),o||r.push(`@import '@fontsource-variable/inter';`),s||r.push(`@source '${E(n)}';`),{imports:r,hasTheme:a}}async function O(e,r,i){let a=n.resolve(e,r),o=await u(a)?await t.readFile(a,`utf8`):``,{imports:s,hasTheme:c}=D(o,i,r);if(c&&console.log(`Preserved existing @uselets/ui theme import.`),s.length===0){console.log(`Global CSS already configured at ${r}.`);return}let l=o.length>0&&!o.startsWith(`
2
+ import{spawn as e}from"node:child_process";import t from"node:fs/promises";import n from"node:path";import r from"node:readline/promises";import{fileURLToPath as i}from"node:url";import{Command as a,Option as o}from"commander";const s=`uselets-ui`,c=`@fontsource-variable/inter`,l=[`app/layout.tsx`,`app/layout.jsx`,`pages/_app.tsx`,`pages/_app.jsx`,`src/main.tsx`,`src/main.jsx`,`src/index.tsx`,`src/index.jsx`],u={codex:n.join(`.agents`,`skills`,s),claude:n.join(`.claude`,`skills`,s)},d=Object.keys(u);async function f(e){try{return await t.access(e),!0}catch{return!1}}async function p(e){return JSON.parse(await t.readFile(e,`utf8`))}async function m(){let e=i(new URL(`.`,import.meta.url));for(;;)try{return await t.access(n.join(e,`package.json`)),e}catch{let t=n.dirname(e);if(t===e)throw Error(`Unable to resolve @uselets/ui package root`);e=t}}function h(e){return e===`all`?d:[e]}function g(e,t){return!!(e.dependencies?.[t]||e.devDependencies?.[t]||e.peerDependencies?.[t]||e.optionalDependencies?.[t])}async function _(e,t){let r=t.packageManager?.split(`@`)[0];return r===`bun`||r===`pnpm`||r===`yarn`||r===`npm`?r:await f(n.join(e,`bun.lock`))?`bun`:await f(n.join(e,`pnpm-lock.yaml`))?`pnpm`:await f(n.join(e,`yarn.lock`))?`yarn`:(await f(n.join(e,`package-lock.json`)),`npm`)}function v(e,t,n){switch(e){case`bun`:return[`bun`,`add`,...n?[`-d`]:[],...t];case`pnpm`:return[`pnpm`,`add`,...n?[`-D`]:[],...t];case`yarn`:return[`yarn`,`add`,...n?[`-D`]:[],...t];case`npm`:return[`npm`,`install`,...n?[`-D`]:[],...t]}}async function y(t,n){let[r,...i]=t;if(!r)throw Error(`Missing command`);console.log(`Running: ${t.join(` `)}`),await new Promise((t,a)=>{let o=e(r,i,{cwd:n,stdio:`inherit`});o.on(`error`,a),o.on(`close`,e=>{if(e===0){t();return}a(Error(`${r} exited with code ${e}`))})})}function b(e,t){let n=e.dependencies?.[t]??e.devDependencies?.[t];if(!n)throw Error(`Unable to find ${t} version in @uselets/ui package metadata`);return n}async function x(e,t){let r=await m(),i=await p(n.join(r,`package.json`)),a=await _(e,t),o=[],s=[];if(!i.name||!i.version)throw Error(`Unable to resolve @uselets/ui package name and version`);g(t,i.name)||o.push(`${i.name}@${i.version}`),g(t,c)||o.push(`${c}@${b(i,c)}`),g(t,`tailwindcss`)||s.push(`tailwindcss@${b(i,`tailwindcss`)}`),g(t,`@tailwindcss/postcss`)||s.push(`@tailwindcss/postcss@${b(i,`@tailwindcss/postcss`)}`),o.length>0?await y(v(a,o,!1),e):console.log(`Runtime dependencies already declared.`),s.length>0?await y(v(a,s,!0),e):console.log(`Tailwind dependencies already declared.`)}async function S(e){let r=await m(),i=n.join(r,`skills`,s);try{await t.access(i)}catch{throw Error(`Bundled skill not found at ${i}`)}let a=[];for(let r of e){let e=n.join(process.cwd(),u[r]);await t.rm(e,{recursive:!0,force:!0}),await t.mkdir(n.dirname(e),{recursive:!0}),await t.cp(i,e,{recursive:!0}),a.push(e)}console.log(`Installed ${s} skill:`);for(let e of a)console.log(`- ${e}`)}async function C(){return r.createInterface({input:process.stdin,output:process.stdout})}async function w(e){if(!process.stdin.isTTY)return e;let t=await C();try{for(;;){let n=(await t.question(`Theme (max/gomax) [${e}]: `)).trim().toLowerCase();if(!n)return e;if(n===`max`||n===`gomax`)return n;console.log(`Please choose "max" or "gomax".`)}}finally{t.close()}}async function T(e){if(!process.stdin.isTTY)return e;let t=await C();try{return(await t.question(`Global CSS path [${e}]: `)).trim()||e}finally{t.close()}}async function E(){if(!process.stdin.isTTY)return!1;let e=await C();try{for(;;){let t=(await e.question(`Install agent skill? (y/N): `)).trim().toLowerCase();if(!t||t===`n`||t===`no`)return!1;if(t===`y`||t===`yes`)return!0;console.log(`Please answer "y" or "n".`)}}finally{e.close()}}async function D(e){let r=n.join(e,`postcss.config.mjs`);if(await f(r)){console.log(`Preserved existing postcss.config.mjs.`);return}await t.writeFile(r,`export { default } from '@uselets/ui/postcss.config'
3
+ `),console.log(`Created postcss.config.mjs.`)}function O(e){let t=n.posix.dirname(e.replaceAll(n.sep,n.posix.sep)),r=n.posix.relative(t,`node_modules/@uselets/ui/dist`);return r.startsWith(`.`)?r:`./${r}`}function k(e,t,n){let r=[],i=/@import\s+['"]tailwindcss['"]/.test(e),a=/@import\s+['"]@uselets\/ui\/themes\/(?:max|gomax)\.css['"]/.test(e),o=/@source\s+['"][^'"]*@uselets\/ui\/dist['"]/.test(e);return i||r.push(`@import 'tailwindcss';`),a||r.push(`@import '@uselets/ui/themes/${t}.css';`),o||r.push(`@source '${O(n)}';`),{imports:r,hasTheme:a}}async function A(e,r,i){let a=n.resolve(e,r),o=await f(a)?await t.readFile(a,`utf8`):``,{imports:s,hasTheme:c}=k(o,i,r);if(c&&console.log(`Preserved existing @uselets/ui theme import.`),s.length===0){console.log(`Global CSS already configured at ${r}.`);return}let l=o.length>0&&!o.startsWith(`
4
4
  `)?`
5
- `:``,d=`${s.join(`
6
- `)}${l}${o}`;await t.mkdir(n.dirname(a),{recursive:!0}),await t.writeFile(a,d),console.log(`Updated global CSS at ${r}.`)}async function k(e){let t=process.cwd(),r=n.join(t,`package.json`);if(!await u(r))throw Error(`No package.json found in the current directory. Run uselets init from your project root.`);let i=await d(r),a=e.theme??await S(`max`),o=e.css??await C(`src/styles/globals.css`),s=e.installSkill??await w();await y(t,i),await T(t),await O(t,o,a),s&&await b(l)}async function A(){let e=new a;if(e.name(`uselets`).description(`CLI for @uselets/ui`).showHelpAfterError(),e.command(`skill`).description(`Reinstall the ${s} agent skill`).addOption(new o(`--agent <agent>`,`Target agent directory`).choices([`codex`,`claude`,`all`]).default(`all`)).action(async e=>{await b(p(e.agent))}),e.command(`init`).description(`Set up @uselets/ui in this project`).addOption(new o(`--theme <theme>`,`Theme to import`).choices([`max`,`gomax`])).option(`--css <path>`,`Global CSS file path`).option(`--install-skill`,`Install the agent skill without prompting`).option(`--no-install-skill`,`Skip the agent skill prompt and installation`).action(async e=>{await k(e)}),process.argv.length<=2){e.outputHelp();return}await e.parseAsync()}A().catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});export{};
5
+ `:``,u=`${s.join(`
6
+ `)}${l}${o}`;await t.mkdir(n.dirname(a),{recursive:!0}),await t.writeFile(a,u),console.log(`Updated global CSS at ${r}.`)}async function j(e){for(let t of l)if(await f(n.join(e,t)))return t}async function M(){if(!process.stdin.isTTY)return;let e=await C();try{return(await e.question(`App entry file to import the font in (leave empty to skip): `)).trim()||void 0}finally{e.close()}}async function N(e,t){return t||await j(e)||M()}function P(e){console.log(`${e} Add \`import '${c}'\` to your app's entry file (for example app/layout.tsx or src/main.tsx) to load the font.`)}async function F(e,r){if(!r){P(`Could not detect an app entry file.`);return}let i=n.resolve(e,r);if(!await f(i)){P(`Entry file ${r} not found.`);return}let a=await t.readFile(i,`utf8`);if(RegExp(`import\\s+['"]${c}['"]`).test(a)){console.log(`Font import already present in ${r}.`);return}let o=a.match(/^(['"])use (?:client|server)\1;?\r?\n/),s=`import '${c}'\n`,l=o?a.slice(0,o[0].length)+s+a.slice(o[0].length):s+a;await t.writeFile(i,l),console.log(`Added font import to ${r}.`)}async function I(e){let t=process.cwd(),r=n.join(t,`package.json`);if(!await f(r))throw Error(`No package.json found in the current directory. Run uselets init from your project root.`);let i=await p(r),a=e.theme??await w(`max`),o=e.css??await T(`src/styles/globals.css`),s=await N(t,e.entry),c=e.installSkill??await E();await x(t,i),await D(t),await A(t,o,a),await F(t,s),c&&await S(d)}async function L(){let e=new a;if(e.name(`uselets`).description(`CLI for @uselets/ui`).showHelpAfterError(),e.command(`skill`).description(`Reinstall the ${s} agent skill`).addOption(new o(`--agent <agent>`,`Target agent directory`).choices([`codex`,`claude`,`all`]).default(`all`)).action(async e=>{await S(h(e.agent))}),e.command(`init`).description(`Set up @uselets/ui in this project`).addOption(new o(`--theme <theme>`,`Theme to import`).choices([`max`,`gomax`])).option(`--css <path>`,`Global CSS file path`).option(`--entry <path>`,`App entry file to import the font in (for example app/layout.tsx or src/main.tsx)`).option(`--install-skill`,`Install the agent skill without prompting`).option(`--no-install-skill`,`Skip the agent skill prompt and installation`).action(async e=>{await I(e)}),process.argv.length<=2){e.outputHelp();return}await e.parseAsync()}L().catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});export{};
7
7
  //# sourceMappingURL=uselets.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"uselets.mjs","names":[],"sources":["../../src/cli/uselets.ts"],"sourcesContent":["#!/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\nconst SKILL_NAME = 'uselets-ui'\nconst DEFAULT_CSS_PATH = 'src/styles/globals.css'\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 ThemeOption = 'max' | 'gomax'\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 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, '@fontsource-variable/inter')) {\n runtimeDependencies.push(\n `@fontsource-variable/inter@${getPackageVersion(packageJson, '@fontsource-variable/inter')}`\n )\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\nfunction 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\nfunction buildCssImports(source: string, theme: ThemeOption, cssPath: string) {\n const imports = []\n const hasTailwind = /@import\\s+['\"]tailwindcss['\"]/.test(source)\n const hasTheme = /@import\\s+['\"]@uselets\\/ui\\/themes\\/(?:max|gomax)\\.css['\"]/.test(source)\n const hasFont = /@import\\s+['\"]@fontsource-variable\\/inter['\"]/.test(source)\n const hasPackageSource = /@source\\s+['\"][^'\"]*@uselets\\/ui\\/dist['\"]/.test(source)\n\n if (!hasTailwind) {\n imports.push(\"@import 'tailwindcss';\")\n }\n\n if (!hasTheme) {\n imports.push(`@import '@uselets/ui/themes/${theme}.css';`)\n }\n\n if (!hasFont) {\n imports.push(\"@import '@fontsource-variable/inter';\")\n }\n\n if (!hasPackageSource) {\n imports.push(`@source '${buildPackageSource(cssPath)}';`)\n }\n\n return { imports, hasTheme }\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 { imports, hasTheme } = buildCssImports(existingSource, theme, cssPath)\n\n if (hasTheme) {\n console.log('Preserved existing @uselets/ui theme import.')\n }\n\n if (imports.length === 0) {\n console.log(`Global CSS already configured at ${cssPath}.`)\n return\n }\n\n const separator = existingSource.length > 0 && !existingSource.startsWith('\\n') ? '\\n' : ''\n const updatedSource = `${imports.join('\\n')}${separator}${existingSource}`\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 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 shouldInstallSkill = options.installSkill ?? (await promptInstallSkill())\n\n await installMissingDependencies(projectRoot, projectPackageJson)\n await ensurePostcssConfig(projectRoot)\n await ensureGlobalCss(projectRoot, cssPath, theme)\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('--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 instance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,sBAAsB,CAAC,CAC9C,OAAO,kBAAmB,2CAA2C,CAAC,CACtE,OAAO,qBAAsB,8CAA8C,CAAC,CAC5E,OAAO,KAAO,IAAyB,CACtC,MAAM,EAAY,CAAO,CAC3B,CAAC,EAEC,QAAQ,KAAK,QAAU,EAAG,CAC5B,EAAQ,WAAW,EACnB,MACF,CAEA,MAAM,EAAQ,WAAW,CAC3B,CAEA,EAAK,CAAC,CAAC,MAAO,GAAmB,CAC/B,QAAQ,MAAM,aAAiB,MAAQ,EAAM,QAAU,CAAK,EAC5D,QAAQ,SAAW,CACrB,CAAC"}
1
+ {"version":3,"file":"uselets.mjs","names":[],"sources":["../../src/cli/uselets.ts"],"sourcesContent":["#!/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\nconst SKILL_NAME = 'uselets-ui'\nconst DEFAULT_CSS_PATH = 'src/styles/globals.css'\nconst FONT_PACKAGE = '@fontsource-variable/inter'\nconst ENTRY_FILE_CANDIDATES = [\n 'app/layout.tsx',\n 'app/layout.jsx',\n 'pages/_app.tsx',\n 'pages/_app.jsx',\n 'src/main.tsx',\n 'src/main.jsx',\n 'src/index.tsx',\n 'src/index.jsx'\n]\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 ThemeOption = 'max' | 'gomax'\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\nfunction 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\nfunction buildCssImports(source: string, theme: ThemeOption, cssPath: string) {\n const imports = []\n const hasTailwind = /@import\\s+['\"]tailwindcss['\"]/.test(source)\n const hasTheme = /@import\\s+['\"]@uselets\\/ui\\/themes\\/(?:max|gomax)\\.css['\"]/.test(source)\n const hasPackageSource = /@source\\s+['\"][^'\"]*@uselets\\/ui\\/dist['\"]/.test(source)\n\n if (!hasTailwind) {\n imports.push(\"@import 'tailwindcss';\")\n }\n\n if (!hasTheme) {\n imports.push(`@import '@uselets/ui/themes/${theme}.css';`)\n }\n\n if (!hasPackageSource) {\n imports.push(`@source '${buildPackageSource(cssPath)}';`)\n }\n\n return { imports, hasTheme }\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 { imports, hasTheme } = buildCssImports(existingSource, theme, cssPath)\n\n if (hasTheme) {\n console.log('Preserved existing @uselets/ui theme import.')\n }\n\n if (imports.length === 0) {\n console.log(`Global CSS already configured at ${cssPath}.`)\n return\n }\n\n const separator = existingSource.length > 0 && !existingSource.startsWith('\\n') ? '\\n' : ''\n const updatedSource = `${imports.join('\\n')}${separator}${existingSource}`\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":";mOAUA,MAAM,EAAa,aAEb,EAAe,6BACf,EAAwB,CAC5B,iBACA,iBACA,iBACA,iBACA,eACA,eACA,gBACA,eACF,EAEM,EAAgB,CACpB,MAAO,EAAK,KAAK,UAAW,SAAU,CAAU,EAChD,OAAQ,EAAK,KAAK,UAAW,SAAU,CAAU,CACnD,EAsBM,EAAoB,OAAO,KAAK,CAAa,EAEnD,eAAe,EAAW,EAAoB,CAC5C,GAAI,CAEF,OADA,MAAM,EAAG,OAAO,CAAU,EACnB,EACT,MAAQ,CACN,MAAO,EACT,CACF,CAEA,eAAe,EAAgB,EAAkB,CAC/C,OAAO,KAAK,MAAM,MAAM,EAAG,SAAS,EAAU,MAAM,CAAC,CACvD,CAEA,eAAe,GAAkB,CAC/B,IAAI,EAAa,EAAc,IAAI,IAAI,IAAK,OAAO,KAAK,GAAG,CAAC,EAE5D,OACE,GAAI,CAEF,OADA,MAAM,EAAG,OAAO,EAAK,KAAK,EAAY,cAAc,CAAC,EAC9C,CACT,MAAQ,CACN,IAAM,EAAY,EAAK,QAAQ,CAAU,EAEzC,GAAI,IAAc,EAChB,MAAU,MAAM,4CAA4C,EAG9D,EAAa,CACf,CAEJ,CAEA,SAAS,EAAe,EAAoB,CAC1C,OAAO,IAAU,MAAQ,EAAoB,CAAC,CAAK,CACrD,CAEA,SAAS,EAAc,EAA0B,EAAwB,CACvE,MAAO,GACL,EAAY,eAAe,IACzB,EAAY,kBAAkB,IAC9B,EAAY,mBAAmB,IAC/B,EAAY,uBAAuB,GAEzC,CAEA,eAAe,EAAqB,EAAqB,EAAmD,CAC1G,IAAM,EAAkB,EAAY,gBAAgB,MAAM,GAAG,CAAC,CAAC,GA2B/D,OAxBE,IAAoB,OACpB,IAAoB,QACpB,IAAoB,QACpB,IAAoB,MAEb,EAGL,MAAM,EAAW,EAAK,KAAK,EAAa,UAAU,CAAC,EAC9C,MAGL,MAAM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,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,MAAM,EAAY,CAAO,CAC3B,CAAC,EAEC,QAAQ,KAAK,QAAU,EAAG,CAC5B,EAAQ,WAAW,EACnB,MACF,CAEA,MAAM,EAAQ,WAAW,CAC3B,CAEA,EAAK,CAAC,CAAC,MAAO,GAAmB,CAC/B,QAAQ,MAAM,aAAiB,MAAQ,EAAM,QAAU,CAAK,EAC5D,QAAQ,SAAW,CACrB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
+ import { VariantProps } from "class-variance-authority";
3
+ import { ReactNode } from "react";
4
+ import { NumberField as NumberField$1 } from "@base-ui/react/number-field";
5
+ //#region src/components/number-field.d.ts
6
+ declare const numberFieldGroupVariants: (props?: ({
7
+ size?: "lg" | "md" | "sm" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ declare const numberFieldButtonVariants: (props?: ({
10
+ size?: "lg" | "md" | "sm" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ declare const numberFieldInputVariants: (props?: ({
13
+ size?: "lg" | "md" | "sm" | null | undefined;
14
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
+ type NumberFieldProps = NumberField$1.Root.Props & VariantProps<typeof numberFieldGroupVariants>;
16
+ declare function NumberField({ id, className, size, ...props }: NumberFieldProps): import("react").JSX.Element;
17
+ type NumberFieldGroupProps = NumberField$1.Group.Props & Partial<VariantProps<typeof numberFieldGroupVariants>>;
18
+ declare function NumberFieldGroup({ className, size: sizeProp, ...props }: NumberFieldGroupProps): import("react").JSX.Element;
19
+ type NumberFieldDecrementProps = NumberField$1.Decrement.Props & Partial<VariantProps<typeof numberFieldButtonVariants>> & {
20
+ children?: React.ReactNode;
21
+ };
22
+ declare function NumberFieldDecrement({ className, size: sizeProp, children, ...props }: NumberFieldDecrementProps): import("react").JSX.Element;
23
+ type NumberFieldIncrementProps = NumberField$1.Increment.Props & Partial<VariantProps<typeof numberFieldButtonVariants>> & {
24
+ children?: ReactNode;
25
+ };
26
+ declare function NumberFieldIncrement({ className, size: sizeProp, children, ...props }: NumberFieldIncrementProps): import("react").JSX.Element;
27
+ type NumberFieldInputProps = NumberField$1.Input.Props & Partial<VariantProps<typeof numberFieldInputVariants>>;
28
+ declare function NumberFieldInput({ id, className, size: sizeProp, ...props }: NumberFieldInputProps): import("react").JSX.Element;
29
+ type NumberFieldScrubAreaProps = NumberField$1.ScrubArea.Props & {
30
+ label: string;
31
+ };
32
+ declare function NumberFieldScrubArea({ className, label, ...props }: NumberFieldScrubAreaProps): import("react").JSX.Element;
33
+ //#endregion
34
+ export { NumberField, NumberFieldDecrement, NumberFieldDecrementProps, NumberFieldGroup, NumberFieldGroupProps, NumberFieldIncrement, NumberFieldIncrementProps, NumberFieldInput, NumberFieldInputProps, NumberFieldProps, NumberFieldScrubArea, NumberFieldScrubAreaProps };
35
+ //# sourceMappingURL=number-field.d.ts.map
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{Label as t}from"./label.js";import{useFieldControlId as n}from"./field.js";import{IconMinus as r,IconPlus as i}from"@tabler/icons-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{createContext as c,useContext as l,useId as u}from"react";import{NumberField as d}from"@base-ui/react/number-field";const f=c(null),p=s(`relative flex w-full justify-between border border-input data-disabled:pointer-events-none data-disabled:opacity-50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-within:has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 dark:focus-within:has-aria-invalid:ring-destructive/40 rounded-lg bg-transparent dark:bg-input/30 transition-colors focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-3`,{variants:{size:{sm:`h-7 text-sm`,md:`h-8 text-sm`,lg:`h-9 text-sm`}},defaultVariants:{size:`md`}}),m=s(`relative flex shrink-0 cursor-pointer items-center justify-center transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,{variants:{size:{sm:`px-1.5 [&_svg:not([class*='size-'])]:size-3.5`,md:`px-2 [&_svg:not([class*='size-'])]:size-4`,lg:`px-2.5 [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{size:`md`}}),h=s(`w-full min-w-0 flex-1 bg-transparent text-center tabular-nums outline-none`,{variants:{size:{sm:`px-2 py-0.5`,md:`px-2.5 py-1`,lg:`px-2.5 py-1.5`}},defaultVariants:{size:`md`}});function NumberField({id:t,className:r,size:i=`md`,...o}){let s=u(),c=n(t)??s,l=i??`md`;return a(f.Provider,{value:{fieldId:c,size:l},children:a(d.Root,{className:e(`flex w-full flex-col items-start gap-2`,r),"data-size":l,"data-slot":`number-field`,...o})})}function NumberFieldGroup({className:t,size:n,...r}){let i=l(f);if(!i)throw Error(`NumberFieldGroup must be used within a NumberField component.`);let o=n??i.size;return a(d.Group,{className:e(p({size:o}),t),"data-slot":`number-field-group`,...r})}function NumberFieldDecrement({className:t,size:n,children:i,...o}){let s=l(f);if(!s)throw Error(`NumberFieldDecrement must be used within a NumberField component.`);let c=n??s.size;return a(d.Decrement,{className:e(m({size:c}),`rounded-s-lg border-e-0`,t),"data-slot":`number-field-decrement`,...o,children:i??a(r,{})})}function NumberFieldIncrement({className:t,size:n,children:r,...o}){let s=l(f);if(!s)throw Error(`NumberFieldIncrement must be used within a NumberField component.`);let c=n??s.size;return a(d.Increment,{className:e(m({size:c}),`rounded-e-lg border-s-0`,t),"data-slot":`number-field-increment`,...o,children:r??a(i,{})})}function NumberFieldInput({id:t,className:n,size:r,...i}){let o=l(f);if(!o)throw Error(`NumberFieldInput must be used within a NumberField component.`);let s=r??o.size;return a(d.Input,{id:t??o.fieldId,className:e(h({size:s}),n),"data-slot":`number-field-input`,...i})}function NumberFieldScrubArea({className:n,label:r,...i}){let s=l(f);if(!s)throw Error(`NumberFieldScrubArea must be used within a NumberField component for accessibility.`);return o(d.ScrubArea,{className:e(`flex cursor-ew-resize`,n),"data-slot":`number-field-scrub-area`,...i,children:[a(t,{className:`cursor-ew-resize`,htmlFor:s.fieldId,children:r}),a(d.ScrubAreaCursor,{className:`drop-shadow-[0_1px_1px_#0008] filter`,children:a(CursorGrowIcon,{})})]})}function CursorGrowIcon(e){return a(`svg`,{"aria-hidden":`true`,fill:`black`,height:`14`,stroke:`white`,viewBox:`0 0 24 14`,width:`26`,xmlns:`http://www.w3.org/2000/svg`,...e,children:a(`path`,{d:`M19.5 5.5L6.49737 5.51844V2L1 6.9999L6.5 12L6.49737 8.5L19.5 8.5V12L25 6.9999L19.5 2V5.5Z`})})}export{NumberField,NumberFieldDecrement,NumberFieldGroup,NumberFieldIncrement,NumberFieldInput,NumberFieldScrubArea};
2
+ //# sourceMappingURL=number-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-field.js","names":["NumberFieldPrimitive"],"sources":["../../src/components/number-field.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext, useId } from 'react'\n\nimport { NumberField as NumberFieldPrimitive } from '@base-ui/react/number-field'\nimport { IconMinus, IconPlus } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\nimport { Label } from './label'\n\nconst NumberFieldContext = createContext<{\n fieldId: string\n size: 'sm' | 'md' | 'lg'\n} | null>(null)\n\nconst numberFieldGroupVariants = cva(\n 'relative flex w-full justify-between border border-input data-disabled:pointer-events-none data-disabled:opacity-50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-within:has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 dark:focus-within:has-aria-invalid:ring-destructive/40 rounded-lg bg-transparent dark:bg-input/30 transition-colors focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-3',\n {\n variants: {\n size: {\n sm: 'h-7 text-sm',\n md: 'h-8 text-sm',\n lg: 'h-9 text-sm'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nconst numberFieldButtonVariants = cva(\n 'relative flex shrink-0 cursor-pointer items-center justify-center transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent',\n {\n variants: {\n size: {\n sm: \"px-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n md: \"px-2 [&_svg:not([class*='size-'])]:size-4\",\n lg: \"px-2.5 [&_svg:not([class*='size-'])]:size-4\"\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nconst numberFieldInputVariants = cva('w-full min-w-0 flex-1 bg-transparent text-center tabular-nums outline-none', {\n variants: {\n size: {\n sm: 'px-2 py-0.5',\n md: 'px-2.5 py-1',\n lg: 'px-2.5 py-1.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nexport type NumberFieldProps = NumberFieldPrimitive.Root.Props & VariantProps<typeof numberFieldGroupVariants>\n\nfunction NumberField({ id, className, size = 'md', ...props }: NumberFieldProps) {\n const generatedId = useId()\n const fieldControlId = useFieldControlId(id)\n const fieldId = fieldControlId ?? generatedId\n const sizeValue = size ?? 'md'\n\n return (\n <NumberFieldContext.Provider value={{ fieldId, size: sizeValue }}>\n <NumberFieldPrimitive.Root\n className={cn('flex w-full flex-col items-start gap-2', className)}\n data-size={sizeValue}\n data-slot=\"number-field\"\n {...props}\n />\n </NumberFieldContext.Provider>\n )\n}\n\nexport type NumberFieldGroupProps = NumberFieldPrimitive.Group.Props &\n Partial<VariantProps<typeof numberFieldGroupVariants>>\n\nfunction NumberFieldGroup({ className, size: sizeProp, ...props }: NumberFieldGroupProps) {\n const context = useContext(NumberFieldContext)\n if (!context) {\n throw new Error('NumberFieldGroup must be used within a NumberField component.')\n }\n const size = sizeProp ?? context.size\n\n return (\n <NumberFieldPrimitive.Group\n className={cn(numberFieldGroupVariants({ size }), className)}\n data-slot=\"number-field-group\"\n {...props}\n />\n )\n}\n\nexport type NumberFieldDecrementProps = NumberFieldPrimitive.Decrement.Props &\n Partial<VariantProps<typeof numberFieldButtonVariants>> & {\n children?: React.ReactNode\n }\n\nfunction NumberFieldDecrement({ className, size: sizeProp, children, ...props }: NumberFieldDecrementProps) {\n const context = useContext(NumberFieldContext)\n if (!context) {\n throw new Error('NumberFieldDecrement must be used within a NumberField component.')\n }\n const size = sizeProp ?? context.size\n\n return (\n <NumberFieldPrimitive.Decrement\n className={cn(numberFieldButtonVariants({ size }), 'rounded-s-lg border-e-0', className)}\n data-slot=\"number-field-decrement\"\n {...props}\n >\n {children ?? <IconMinus />}\n </NumberFieldPrimitive.Decrement>\n )\n}\n\nexport type NumberFieldIncrementProps = NumberFieldPrimitive.Increment.Props &\n Partial<VariantProps<typeof numberFieldButtonVariants>> & {\n children?: ReactNode\n }\n\nfunction NumberFieldIncrement({ className, size: sizeProp, children, ...props }: NumberFieldIncrementProps) {\n const context = useContext(NumberFieldContext)\n if (!context) {\n throw new Error('NumberFieldIncrement must be used within a NumberField component.')\n }\n const size = sizeProp ?? context.size\n\n return (\n <NumberFieldPrimitive.Increment\n className={cn(numberFieldButtonVariants({ size }), 'rounded-e-lg border-s-0', className)}\n data-slot=\"number-field-increment\"\n {...props}\n >\n {children ?? <IconPlus />}\n </NumberFieldPrimitive.Increment>\n )\n}\n\nexport type NumberFieldInputProps = NumberFieldPrimitive.Input.Props &\n Partial<VariantProps<typeof numberFieldInputVariants>>\n\nfunction NumberFieldInput({ id, className, size: sizeProp, ...props }: NumberFieldInputProps) {\n const context = useContext(NumberFieldContext)\n if (!context) {\n throw new Error('NumberFieldInput must be used within a NumberField component.')\n }\n const size = sizeProp ?? context.size\n\n return (\n <NumberFieldPrimitive.Input\n id={id ?? context.fieldId}\n className={cn(numberFieldInputVariants({ size }), className)}\n data-slot=\"number-field-input\"\n {...props}\n />\n )\n}\n\nexport type NumberFieldScrubAreaProps = NumberFieldPrimitive.ScrubArea.Props & {\n label: string\n}\n\nfunction NumberFieldScrubArea({ className, label, ...props }: NumberFieldScrubAreaProps) {\n const context = useContext(NumberFieldContext)\n if (!context) {\n throw new Error('NumberFieldScrubArea must be used within a NumberField component for accessibility.')\n }\n\n return (\n <NumberFieldPrimitive.ScrubArea\n className={cn('flex cursor-ew-resize', className)}\n data-slot=\"number-field-scrub-area\"\n {...props}\n >\n <Label className=\"cursor-ew-resize\" htmlFor={context.fieldId}>\n {label}\n </Label>\n <NumberFieldPrimitive.ScrubAreaCursor className=\"drop-shadow-[0_1px_1px_#0008] filter\">\n <CursorGrowIcon />\n </NumberFieldPrimitive.ScrubAreaCursor>\n </NumberFieldPrimitive.ScrubArea>\n )\n}\n\nfunction CursorGrowIcon(props: React.ComponentProps<'svg'>) {\n return (\n <svg\n aria-hidden=\"true\"\n fill=\"black\"\n height=\"14\"\n stroke=\"white\"\n viewBox=\"0 0 24 14\"\n width=\"26\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path d=\"M19.5 5.5L6.49737 5.51844V2L1 6.9999L6.5 12L6.49737 8.5L19.5 8.5V12L25 6.9999L19.5 2V5.5Z\" />\n </svg>\n )\n}\n\nexport {\n NumberField,\n NumberFieldDecrement,\n NumberFieldGroup,\n NumberFieldIncrement,\n NumberFieldInput,\n NumberFieldScrubArea\n}\n"],"mappings":"ybAUA,MAAM,EAAqB,EAGjB,IAAI,EAER,EAA2B,EAC/B,2fACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,GAAI,cACJ,GAAI,aACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EAEM,EAA4B,EAChC,+NAC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AA,EAAC,OAAD,CAAM,EAAE,2FAA6F,CAAA,CAClG,CAAA,CAET"}
@@ -0,0 +1,13 @@
1
+ import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
+ import { ComponentProps } from "react";
3
+ import * as BasePhoneInput from "react-phone-number-input";
4
+ //#region src/components/phone-input.d.ts
5
+ type PhoneInputProps = Omit<ComponentProps<'input'>, 'onChange' | 'value' | 'ref'> & Omit<BasePhoneInput.Props<typeof BasePhoneInput.default>, 'onChange' | 'popupClassName' | 'scrollAreaClassName'> & {
6
+ onChange?: (value: BasePhoneInput.Value) => void;
7
+ popupClassName?: string;
8
+ scrollAreaClassName?: string;
9
+ };
10
+ declare function PhoneInput({ className, popupClassName, scrollAreaClassName, onChange, value, ...props }: PhoneInputProps): import("react").JSX.Element;
11
+ //#endregion
12
+ export { PhoneInput, PhoneInputProps };
13
+ //# sourceMappingURL=phone-input.d.ts.map
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{Input as n}from"./input.js";import{Combobox as r,ComboboxContent as i,ComboboxEmpty as a,ComboboxInput as o,ComboboxItem as s,ComboboxList as c,ComboboxSeparator as l,ComboboxTrigger as u,ComboboxValue as d}from"./combobox.js";import{ScrollArea as f}from"./scroll-area.js";import{IconWorld as p}from"@tabler/icons-react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{createContext as g,useContext as _,useMemo as v,useState as y}from"react";import*as b from"react-phone-number-input";import x from"react-phone-number-input/flags";const S=g({popupClassName:void 0,scrollAreaClassName:void 0});function PhoneInput({className:t,popupClassName:n,scrollAreaClassName:r,onChange:i,value:a,...o}){return m(S.Provider,{value:{popupClassName:n,scrollAreaClassName:r},children:m(b.default,{className:e(`flex`,o[`aria-invalid`]&&`[&_*[data-slot=combobox-trigger]]:border-destructive [&_*[data-slot=combobox-trigger]]:ring-destructive/50`,t),flagComponent:FlagComponent,countrySelectComponent:CountrySelect,inputComponent:InputComponent,smartCaret:!1,defaultCountry:`BR`,value:a||void 0,onChange:e=>i?.(e||``),...o})})}function InputComponent({className:t,...r}){return m(n,{className:e(`rounded-s-none focus:z-1`,t),...r})}function CountrySelect({disabled:n,value:p,options:g,onChange:x}){let{popupClassName:C}=_(S),[w,T]=y(``),E=v(()=>w?g.filter(({label:e})=>e.toLowerCase().includes(w.toLowerCase())):g,[g,w]);return h(r,{items:E,value:p||``,onValueChange:e=>{e&&x(e)},children:[m(u,{render:h(t,{variant:`outline`,color:`zinc`,className:e(`flex h-8 items-center gap-1 rounded-s-lg rounded-e-none border-e-0 border-input px-2.5 py-0 leading-none dark:bg-input/30`,`hover:bg-transparent focus:z-10 data-pressed:bg-transparent`,n&&`opacity-50`),disabled:n,children:[m(`span`,{className:`sr-only`,children:m(d,{})}),m(FlagComponent,{country:p,countryName:p})]})}),h(i,{className:e(`w-xs *:data-[slot=input-group]:bg-transparent`,C),children:[m(o,{placeholder:`e.g. United States`,value:w,onChange:e=>T(e.target.value),showTrigger:!1,className:`border-input focus-visible:border-border rounded-none border-0 px-0 py-2.5 shadow-none ring-0! outline-none! focus-visible:ring-0 focus-visible:ring-offset-0`}),m(l,{}),m(a,{className:`px-4 py-2.5 text-sm`,children:`Nenhum país encontrado.`}),m(c,{children:m(`div`,{className:`relative flex max-h-full`,children:m(`div`,{className:`flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain`,children:m(f,{className:`size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain`,children:E.map(e=>e.value?h(s,{value:e.value,className:`flex items-center gap-2`,children:[m(FlagComponent,{country:e.value,countryName:e.label}),m(`span`,{className:`flex-1 text-sm`,children:e.label}),m(`span`,{className:`text-foreground/50 text-sm`,children:`+${b.getCountryCallingCode(e.value)}`})]},e.value):null)})})})})]})]})}function FlagComponent({country:e,countryName:t}){let n=x[e];return m(`span`,{className:`flex h-4 w-4 items-center justify-center [&_svg:not([class*='size-'])]:size-full! [&_svg:not([class*='size-'])]:rounded-[5px]`,children:n?m(n,{title:t}):m(p,{className:`size-4 opacity-60`})})}export{PhoneInput};
2
+ //# sourceMappingURL=phone-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-input.js","names":[],"sources":["../../src/components/phone-input.tsx"],"sourcesContent":["import { type ComponentProps, createContext, useContext, useMemo, useState } from 'react'\nimport * as BasePhoneInput from 'react-phone-number-input'\nimport flags from 'react-phone-number-input/flags'\n\nimport { IconWorld } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue\n} from './combobox'\nimport { Input } from './input'\nimport { ScrollArea } from './scroll-area'\n\nconst PhoneInputContext = createContext<{\n popupClassName?: string\n scrollAreaClassName?: string\n}>({\n popupClassName: undefined,\n scrollAreaClassName: undefined\n})\n\nexport type PhoneInputProps = Omit<ComponentProps<'input'>, 'onChange' | 'value' | 'ref'> &\n Omit<BasePhoneInput.Props<typeof BasePhoneInput.default>, 'onChange' | 'popupClassName' | 'scrollAreaClassName'> & {\n onChange?: (value: BasePhoneInput.Value) => void\n popupClassName?: string\n scrollAreaClassName?: string\n }\n\nfunction PhoneInput({ className, popupClassName, scrollAreaClassName, onChange, value, ...props }: PhoneInputProps) {\n return (\n <PhoneInputContext.Provider value={{ popupClassName, scrollAreaClassName }}>\n <BasePhoneInput.default\n className={cn(\n 'flex',\n props['aria-invalid'] &&\n '[&_*[data-slot=combobox-trigger]]:border-destructive [&_*[data-slot=combobox-trigger]]:ring-destructive/50',\n className\n )}\n flagComponent={FlagComponent}\n countrySelectComponent={CountrySelect}\n inputComponent={InputComponent}\n smartCaret={false}\n defaultCountry=\"BR\"\n value={value || undefined}\n onChange={(value) => onChange?.(value || ('' as BasePhoneInput.Value))}\n {...props}\n />\n </PhoneInputContext.Provider>\n )\n}\n\nfunction InputComponent({ className, ...props }: ComponentProps<typeof Input>) {\n return <Input className={cn('rounded-s-none focus:z-1', className)} {...props} />\n}\n\ntype CountryEntry = { label: string; value: BasePhoneInput.Country | undefined }\n\ntype CountrySelectProps = {\n disabled?: boolean\n value: BasePhoneInput.Country\n options: CountryEntry[]\n onChange: (country: BasePhoneInput.Country) => void\n}\n\nfunction CountrySelect({ disabled, value: selectedCountry, options: countryList, onChange }: CountrySelectProps) {\n const { popupClassName } = useContext(PhoneInputContext)\n const [searchValue, setSearchValue] = useState('')\n\n const filteredCountries = useMemo(() => {\n if (!searchValue) return countryList\n return countryList.filter(({ label }) => label.toLowerCase().includes(searchValue.toLowerCase()))\n }, [countryList, searchValue])\n\n return (\n <Combobox\n items={filteredCountries}\n value={selectedCountry || ''}\n onValueChange={(country: BasePhoneInput.Country | null) => {\n if (country) {\n onChange(country)\n }\n }}\n >\n <ComboboxTrigger\n render={\n <Button\n variant=\"outline\"\n color=\"zinc\"\n className={cn(\n 'flex h-8 items-center gap-1 rounded-s-lg rounded-e-none border-e-0 border-input px-2.5 py-0 leading-none dark:bg-input/30',\n 'hover:bg-transparent focus:z-10 data-pressed:bg-transparent',\n disabled && 'opacity-50'\n )}\n disabled={disabled}\n >\n <span className=\"sr-only\">\n <ComboboxValue />\n </span>\n <FlagComponent country={selectedCountry} countryName={selectedCountry} />\n </Button>\n }\n />\n <ComboboxContent className={cn('w-xs *:data-[slot=input-group]:bg-transparent', popupClassName)}>\n <ComboboxInput\n placeholder=\"e.g. United States\"\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n showTrigger={false}\n className=\"border-input focus-visible:border-border rounded-none border-0 px-0 py-2.5 shadow-none ring-0! outline-none! focus-visible:ring-0 focus-visible:ring-offset-0\"\n />\n <ComboboxSeparator />\n <ComboboxEmpty className=\"px-4 py-2.5 text-sm\">Nenhum país encontrado.</ComboboxEmpty>\n <ComboboxList>\n <div className=\"relative flex max-h-full\">\n <div className=\"flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain\">\n <ScrollArea className=\"size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain\">\n {filteredCountries.map((item: CountryEntry) =>\n item.value ? (\n <ComboboxItem key={item.value} value={item.value} className=\"flex items-center gap-2\">\n <FlagComponent country={item.value} countryName={item.label} />\n <span className=\"flex-1 text-sm\">{item.label}</span>\n <span className=\"text-foreground/50 text-sm\">\n {`+${BasePhoneInput.getCountryCallingCode(item.value)}`}\n </span>\n </ComboboxItem>\n ) : null\n )}\n </ScrollArea>\n </div>\n </div>\n </ComboboxList>\n </ComboboxContent>\n </Combobox>\n )\n}\n\nfunction FlagComponent({ country, countryName }: BasePhoneInput.FlagProps) {\n const Flag = flags[country]\n\n return (\n <span className=\"flex h-4 w-4 items-center justify-center [&_svg:not([class*='size-'])]:size-full! [&_svg:not([class*='size-'])]:rounded-[5px]\">\n {Flag ? <Flag title={countryName} /> : <IconWorld className=\"size-4 opacity-60\" />}\n </span>\n )\n}\n\nexport { PhoneInput }\n"],"mappings":"spBAsBA,MAAM,EAAoB,EAGvB,CACD,eAAgB,IAAA,GAChB,oBAAqB,IAAA,EACvB,CAAC,EASD,SAAS,WAAW,CAAE,YAAW,iBAAgB,sBAAqB,WAAU,QAAO,GAAG,GAA0B,CAClH,OACE,EAAC,EAAkB,SAAnB,CAA4B,MAAO,CAAE,iBAAgB,qBAAoB,EACvE,SAAA,EAAC,EAAe,QAAhB,CACE,UAAW,EACT,OACA,EAAM,iBACJ,6GACF,CACF,EACA,cAAe,cACf,uBAAwB,cACxB,eAAgB,eAChB,WAAY,GACZ,eAAe,KACf,MAAO,GAAS,IAAA,GAChB,SAAW,GAAU,IAAW,GAAU,EAA2B,EACrE,GAAI,CACL,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+JACnB,SAAA,EAAkB,IAAK,GACtB,EAAK,MACH,EAAC,EAAD,CAA+B,MAAO,EAAK,MAAO,UAAU,0BAA5D,SAAA,CACE,EAAC,cAAD,CAAe,QAAS,EAAK,MAAO,YAAa,EAAK,KAAQ,CAAA,EAC9D,EAAC,OAAD,CAAM,UAAU,iBAAkB,SAAA,EAAK,KAAY,CAAA,EACnD,EAAC,OAAD,CAAM,UAAU,6BACb,SAAA,IAAI,EAAe,sBAAsB,EAAK,KAAK,GAChD,CAAA,CACM,CANK,EAAA,EAAK,KAMV,EACZ,IACN,CACU,CAAA,CACT,CAAA,CACF,CAAA,CACO,CAAA,CACC,CACT,CAAA,CAAA,GAEd,CAEA,SAAS,cAAc,CAAE,UAAS,eAAyC,CACzE,IAAM,EAAO,EAAM,GAEnB,OACE,EAAC,OAAD,CAAM,UAAU,gIACb,SAAA,EAAO,EAAC,EAAD,CAAM,MAAO,CAAc,CAAA,EAAI,EAAC,EAAD,CAAW,UAAU,mBAAqB,CAAA,CAC7E,CAAA,CAEV"}
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{useFieldControlId as t}from"./field.js";import{Slider as n}from"radix-ui";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";function Slider({className:o,defaultValue:s,id:c,value:l,min:u=0,max:d=100,...f}){let p=t(c),m=a.useMemo(()=>Array.isArray(l)?l:Array.isArray(s)?s:[u,d],[l,s,u,d]);return i(n.Root,{id:p,"data-slot":`slider`,defaultValue:s,value:l,min:u,max:d,className:e(`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,o),...f,children:[r(n.Track,{"data-slot":`slider-track`,className:e(`relative grow overflow-hidden rounded-full bg-muted`,`data-horizontal:h-1 data-horizontal:w-full`,`data-vertical:h-full data-vertical:w-1`),children:r(n.Range,{"data-slot":`slider-range`,className:`absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),m.map(t=>r(n.Thumb,{"data-slot":`slider-thumb`,className:e(`relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50`,`transition-[color,box-shadow] select-none after:absolute after:-inset-2`,`hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3`,`disabled:pointer-events-none disabled:opacity-50`)},t))]})}export{Slider};
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{useFieldControlId as t}from"./field.js";import{Slider as n}from"radix-ui";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";function Slider({className:o,defaultValue:s,id:c,value:l,min:u=0,max:d=100,...f}){let p=t(c),m=a.useMemo(()=>Array.isArray(l)?l:Array.isArray(s)?s:[u,d],[l,s,u,d]);return i(n.Root,{id:p,"data-slot":`slider`,defaultValue:s,value:l,min:u,max:d,className:e(`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,o),...f,children:[r(n.Track,{"data-slot":`slider-track`,className:e(`relative grow overflow-hidden rounded-full bg-muted`,`data-horizontal:h-1 data-horizontal:w-full`,`data-vertical:h-full data-vertical:w-1`),children:r(n.Range,{"data-slot":`slider-range`,className:`absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),m.map((t,i)=>r(n.Thumb,{"data-slot":`slider-thumb`,className:e(`relative block size-3 shrink-0 rounded-full border border-ring bg-white dark:bg-primary ring-ring/50`,`transition-[color,box-shadow] select-none after:absolute after:-inset-2`,`hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3`,`disabled:pointer-events-none disabled:opacity-50`)},String(i)))]})}export{Slider};
2
2
  //# sourceMappingURL=slider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slider.js","names":["SliderPrimitive"],"sources":["../../src/components/slider.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Slider as SliderPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\n\nexport type SliderProps = React.ComponentProps<typeof SliderPrimitive.Root>\n\nfunction Slider({ className, defaultValue, id, value, min = 0, max = 100, ...props }: SliderProps) {\n const fieldControlId = useFieldControlId(id)\n const _values = React.useMemo(\n () => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),\n [value, defaultValue, min, max]\n )\n\n return (\n <SliderPrimitive.Root\n id={fieldControlId}\n data-slot=\"slider\"\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n className={cn(\n 'relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col',\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n 'relative grow overflow-hidden rounded-full bg-muted',\n 'data-horizontal:h-1 data-horizontal:w-full',\n 'data-vertical:h-full data-vertical:w-1'\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className=\"absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full\"\n />\n </SliderPrimitive.Track>\n {_values.map((value) => (\n <SliderPrimitive.Thumb\n data-slot=\"slider-thumb\"\n key={value}\n className={cn(\n 'relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50',\n 'transition-[color,box-shadow] select-none after:absolute after:-inset-2',\n 'hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3',\n 'disabled:pointer-events-none disabled:opacity-50'\n )}\n />\n ))}\n </SliderPrimitive.Root>\n )\n}\n\nexport { Slider }\n"],"mappings":"wOASA,SAAS,OAAO,CAAE,YAAW,eAAc,KAAI,QAAO,MAAM,EAAG,MAAM,IAAK,GAAG,GAAsB,CACjG,IAAM,EAAiB,EAAkB,CAAE,EACrC,EAAU,EAAM,YACb,MAAM,QAAQ,CAAK,EAAI,EAAQ,MAAM,QAAQ,CAAY,EAAI,EAAe,CAAC,EAAK,CAAG,EAC5F,CAAC,EAAO,EAAc,EAAK,CAAG,CAChC,EAEA,OACE,EAACA,EAAgB,KAAjB,CACE,GAAI,EACJ,YAAU,SACI,eACP,QACF,MACA,MACL,UAAW,EACT,4KACA,CACF,EACA,GAAI,EAXN,SAAA,CAaE,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EACT,sDACA,6CACA,wCACF,EAEA,SAAA,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAU,6EACX,CAAA,CACoB,CAAA,EACtB,EAAQ,IAAK,GACZ,EAACA,EAAgB,MAAjB,CACE,YAAU,eAEV,UAAW,EACT,uFACA,0EACA,+EACA,kDACF,CACD,EAPM,CAON,CACF,CACmB,GAE1B"}
1
+ {"version":3,"file":"slider.js","names":["SliderPrimitive"],"sources":["../../src/components/slider.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Slider as SliderPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\n\nexport type SliderProps = React.ComponentProps<typeof SliderPrimitive.Root>\n\nfunction Slider({ className, defaultValue, id, value, min = 0, max = 100, ...props }: SliderProps) {\n const fieldControlId = useFieldControlId(id)\n const values = React.useMemo(\n () => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),\n [value, defaultValue, min, max]\n )\n\n return (\n <SliderPrimitive.Root\n id={fieldControlId}\n data-slot=\"slider\"\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n className={cn(\n 'relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col',\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n 'relative grow overflow-hidden rounded-full bg-muted',\n 'data-horizontal:h-1 data-horizontal:w-full',\n 'data-vertical:h-full data-vertical:w-1'\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className=\"absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full\"\n />\n </SliderPrimitive.Track>\n {values.map((_, index) => (\n <SliderPrimitive.Thumb\n data-slot=\"slider-thumb\"\n key={String(index)}\n className={cn(\n 'relative block size-3 shrink-0 rounded-full border border-ring bg-white dark:bg-primary ring-ring/50',\n 'transition-[color,box-shadow] select-none after:absolute after:-inset-2',\n 'hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3',\n 'disabled:pointer-events-none disabled:opacity-50'\n )}\n />\n ))}\n </SliderPrimitive.Root>\n )\n}\n\nexport { Slider }\n"],"mappings":"wOASA,SAAS,OAAO,CAAE,YAAW,eAAc,KAAI,QAAO,MAAM,EAAG,MAAM,IAAK,GAAG,GAAsB,CACjG,IAAM,EAAiB,EAAkB,CAAE,EACrC,EAAS,EAAM,YACZ,MAAM,QAAQ,CAAK,EAAI,EAAQ,MAAM,QAAQ,CAAY,EAAI,EAAe,CAAC,EAAK,CAAG,EAC5F,CAAC,EAAO,EAAc,EAAK,CAAG,CAChC,EAEA,OACE,EAACA,EAAgB,KAAjB,CACE,GAAI,EACJ,YAAU,SACI,eACP,QACF,MACA,MACL,UAAW,EACT,4KACA,CACF,EACA,GAAI,EAXN,SAAA,CAaE,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EACT,sDACA,6CACA,wCACF,EAEA,SAAA,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAU,6EACX,CAAA,CACoB,CAAA,EACtB,EAAO,KAAK,EAAG,IACd,EAACA,EAAgB,MAAjB,CACE,YAAU,eAEV,UAAW,EACT,uGACA,0EACA,+EACA,kDACF,CACD,EAPM,OAAO,CAAK,CAOlB,CACF,CACmB,GAE1B"}
@@ -0,0 +1,71 @@
1
+ import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
+ import { HTMLAttributes } from "react";
3
+ //#region src/components/stepper.d.ts
4
+ type StepperOrientation = 'horizontal' | 'vertical';
5
+ type StepState = 'active' | 'completed' | 'inactive' | 'loading';
6
+ type StepIndicators = {
7
+ active?: React.ReactNode;
8
+ completed?: React.ReactNode;
9
+ inactive?: React.ReactNode;
10
+ loading?: React.ReactNode;
11
+ };
12
+ interface StepperContextValue {
13
+ activeStep: number;
14
+ setActiveStep: (step: number) => void;
15
+ stepsCount: number;
16
+ orientation: StepperOrientation;
17
+ registerTrigger: (node: HTMLButtonElement | null) => void;
18
+ triggerNodes: HTMLButtonElement[];
19
+ focusNext: (currentIdx: number) => void;
20
+ focusPrev: (currentIdx: number) => void;
21
+ focusFirst: () => void;
22
+ focusLast: () => void;
23
+ indicators: StepIndicators;
24
+ }
25
+ interface StepItemContextValue {
26
+ step: number;
27
+ state: StepState;
28
+ isDisabled: boolean;
29
+ isLoading: boolean;
30
+ }
31
+ declare function useStepper(): StepperContextValue;
32
+ declare function useStepItem(): StepItemContextValue;
33
+ interface StepperProps extends HTMLAttributes<HTMLDivElement> {
34
+ defaultValue?: number;
35
+ value?: number;
36
+ onValueChange?: (value: number) => void;
37
+ orientation?: StepperOrientation;
38
+ indicators?: StepIndicators;
39
+ }
40
+ declare function Stepper({ defaultValue, value, onValueChange, orientation, className, children, indicators, ...props }: StepperProps): import("react").JSX.Element;
41
+ interface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {
42
+ step: number;
43
+ completed?: boolean;
44
+ disabled?: boolean;
45
+ loading?: boolean;
46
+ }
47
+ declare function StepperItem({ step, completed, disabled, loading, className, children, ...props }: StepperItemProps): import("react").JSX.Element;
48
+ interface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
49
+ asChild?: boolean;
50
+ }
51
+ declare function StepperTrigger({ asChild, className, children, tabIndex, ...props }: StepperTriggerProps): import("react").JSX.Element;
52
+ type StepperIndicatorProps = React.ComponentProps<'div'>;
53
+ declare function StepperIndicator({ children, className }: StepperIndicatorProps): import("react").JSX.Element;
54
+ type StepperSeparatorProps = React.ComponentProps<'div'>;
55
+ declare function StepperSeparator({ className }: StepperSeparatorProps): import("react").JSX.Element;
56
+ type StepperTitleProps = React.ComponentProps<'h3'>;
57
+ declare function StepperTitle({ children, className }: StepperTitleProps): import("react").JSX.Element;
58
+ type StepperDescriptionProps = React.ComponentProps<'div'>;
59
+ declare function StepperDescription({ children, className }: StepperDescriptionProps): import("react").JSX.Element;
60
+ type StepperNavProps = React.ComponentProps<'nav'>;
61
+ declare function StepperNav({ children, className }: StepperNavProps): import("react").JSX.Element;
62
+ type StepperPanelProps = React.ComponentProps<'div'>;
63
+ declare function StepperPanel({ children, className }: StepperPanelProps): import("react").JSX.Element;
64
+ interface StepperContentProps extends React.ComponentProps<'div'> {
65
+ value: number;
66
+ forceMount?: boolean;
67
+ }
68
+ declare function StepperContent({ value, forceMount, children, className }: StepperContentProps): import("react").JSX.Element | null;
69
+ //#endregion
70
+ export { Stepper, StepperContent, type StepperContentProps, StepperDescription, StepperDescriptionProps, StepperIndicator, StepperIndicatorProps, StepperItem, type StepperItemProps, StepperNav, StepperNavProps, StepperPanel, StepperPanelProps, type StepperProps, StepperSeparator, StepperSeparatorProps, StepperTitle, StepperTitleProps, StepperTrigger, type StepperTriggerProps, useStepItem, useStepper };
71
+ //# sourceMappingURL=stepper.d.ts.map
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{Children as n,createContext as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";const d=r(void 0),f=r(void 0);function useStepper(){let e=o(d);if(!e)throw Error(`useStepper must be used within a Stepper`);return e}function useStepItem(){let e=o(f);if(!e)throw Error(`useStepItem must be used within a StepperItem`);return e}function Stepper({defaultValue:r=1,value:o,onValueChange:s,orientation:l=`horizontal`,className:f,children:p,indicators:m={},...h}){let[g,_]=u(r),[v,y]=u([]),b=a(e=>{y(t=>e&&!t.includes(e)?[...t,e]:!e&&t.includes(e)?t.filter(t=>t!==e):t)},[]),x=a(e=>{o===void 0&&_(e),s?.(e)},[o,s]),S=o??g,C=a(e=>{v[e]&&v[e].focus()},[v]),w=a(e=>C((e+1)%v.length),[C,v]),T=a(e=>C((e-1+v.length)%v.length),[C,v]),E=a(()=>C(0),[C]),D=a(()=>C(v.length-1),[C,v]),O=c(()=>({activeStep:S,setActiveStep:x,stepsCount:n.toArray(p).filter(e=>i(e)&&e.type.displayName===`StepperItem`).length,orientation:l,registerTrigger:b,focusNext:w,focusPrev:T,focusFirst:E,focusLast:D,triggerNodes:v,indicators:m}),[S,x,p,l,b,v,E,D,w,T,m]);return t(d.Provider,{value:O,children:t(`div`,{role:`tablist`,"aria-orientation":l,"data-slot":`stepper`,className:e(`w-full`,f),"data-orientation":l,...h,children:p})})}function StepperItem({step:n,completed:r=!1,disabled:i=!1,loading:a=!1,className:o,children:s,...c}){let{activeStep:l}=useStepper(),u=r||n<l?`completed`:l===n?`active`:`inactive`,d=a&&n===l;return t(f.Provider,{value:{step:n,state:u,isDisabled:i,isLoading:d},children:t(`div`,{"data-slot":`stepper-item`,className:e(`group/step flex items-center justify-center not-last:flex-1 group-data-[orientation=horizontal]/stepper-nav:flex-row group-data-[orientation=vertical]/stepper-nav:flex-col`,o),"data-state":u,...d?{"data-loading":!0}:{},...c,children:s})})}function StepperTrigger({asChild:n=!1,className:r,children:i,tabIndex:a,...o}){let{state:u,isLoading:d}=useStepItem(),{setActiveStep:f,activeStep:p,registerTrigger:m,triggerNodes:h,focusNext:g,focusPrev:_,focusFirst:v,focusLast:y}=useStepper(),{step:b,isDisabled:x}=useStepItem(),S=p===b,C=`stepper-tab-${b}`,w=`stepper-panel-${b}`,T=l(null);s(()=>{T.current&&m(T.current)},[m]);let E=c(()=>h.findIndex(e=>e===T.current),[h]),handleKeyDown=e=>{switch(e.key){case`ArrowRight`:case`ArrowDown`:e.preventDefault(),E!==-1&&g&&g(E);break;case`ArrowLeft`:case`ArrowUp`:e.preventDefault(),E!==-1&&_&&_(E);break;case`Home`:e.preventDefault(),v&&v();break;case`End`:e.preventDefault(),y&&y();break;case`Enter`:case` `:e.preventDefault(),f(b);break}};return n?t(`span`,{"data-slot":`stepper-trigger`,"data-state":u,className:r,children:i}):t(`button`,{ref:T,role:`tab`,id:C,"aria-selected":S,"aria-controls":w,tabIndex:typeof a==`number`?a:S?0:-1,"data-slot":`stepper-trigger`,"data-state":u,"data-loading":d,className:e(`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex cursor-pointer items-center outline-none focus-visible:z-10 focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-60`,`gap-2.5 rounded-full`,r),onClick:()=>f(b),onKeyDown:handleKeyDown,disabled:x,...o,children:i})}function StepperIndicator({children:n,className:r}){let{state:i,isLoading:a}=useStepItem(),{indicators:o}=useStepper();return t(`div`,{"data-slot":`stepper-indicator`,"data-state":i,className:e(`border-background bg-accent text-accent-foreground data-[state=completed]:bg-primary data-[state=completed]:text-primary-foreground data-[state=active]:bg-primary data-[state=active]:text-primary-foreground relative flex size-6 shrink-0 items-center justify-center overflow-hidden`,`rounded-full text-xs`,r),children:t(`div`,{className:`absolute`,children:o&&(a&&o.loading||i===`completed`&&o.completed||i===`active`&&o.active||i===`inactive`&&o.inactive)?a&&o.loading||i===`completed`&&o.completed||i===`active`&&o.active||i===`inactive`&&o.inactive:n})})}function StepperSeparator({className:n}){let{state:r}=useStepItem();return t(`div`,{"data-slot":`stepper-separator`,"data-state":r,className:e(`bg-muted rounded-sm group-data-[orientation=horizontal]/stepper-nav:h-0.5 group-data-[orientation=vertical]/stepper-nav:h-12 group-data-[orientation=vertical]/stepper-nav:w-0.5 m-0.5 group-data-[orientation=horizontal]/stepper-nav:flex-1`,n)})}function StepperTitle({children:n,className:r}){let{state:i}=useStepItem();return t(`h3`,{"data-slot":`stepper-title`,"data-state":i,className:e(`text-sm leading-none font-medium`,r),children:n})}function StepperDescription({children:n,className:r}){let{state:i}=useStepItem();return t(`div`,{"data-slot":`stepper-description`,"data-state":i,className:e(`text-muted-foreground text-sm`,r),children:n})}function StepperNav({children:n,className:r}){let{activeStep:i,orientation:a}=useStepper();return t(`nav`,{"data-slot":`stepper-nav`,"data-state":i,"data-orientation":a,className:e(`group/stepper-nav inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col`,r),children:n})}function StepperPanel({children:n,className:r}){let{activeStep:i}=useStepper();return t(`div`,{"data-slot":`stepper-panel`,"data-state":i,className:e(`w-full`,r),children:n})}function StepperContent({value:n,forceMount:r,children:i,className:a}){let{activeStep:o}=useStepper(),s=n===o;return!r&&!s?null:t(`div`,{"data-slot":`stepper-content`,"data-state":o,className:e(`w-full`,a,!s&&r&&`hidden`),hidden:!s&&r,children:i})}export{Stepper,StepperContent,StepperDescription,StepperIndicator,StepperItem,StepperNav,StepperPanel,StepperSeparator,StepperTitle,StepperTrigger,useStepItem,useStepper};
2
+ //# sourceMappingURL=stepper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepper.js","names":[],"sources":["../../src/components/stepper.tsx"],"sourcesContent":["import {\n Children,\n createContext,\n type HTMLAttributes,\n isValidElement,\n type ReactElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react'\n\nimport { cn } from '../lib/utils'\n\n// Types\ntype StepperOrientation = 'horizontal' | 'vertical'\ntype StepState = 'active' | 'completed' | 'inactive' | 'loading'\ntype StepIndicators = {\n active?: React.ReactNode\n completed?: React.ReactNode\n inactive?: React.ReactNode\n loading?: React.ReactNode\n}\n\ninterface StepperContextValue {\n activeStep: number\n setActiveStep: (step: number) => void\n stepsCount: number\n orientation: StepperOrientation\n registerTrigger: (node: HTMLButtonElement | null) => void\n triggerNodes: HTMLButtonElement[]\n focusNext: (currentIdx: number) => void\n focusPrev: (currentIdx: number) => void\n focusFirst: () => void\n focusLast: () => void\n indicators: StepIndicators\n}\n\ninterface StepItemContextValue {\n step: number\n state: StepState\n isDisabled: boolean\n isLoading: boolean\n}\n\nconst StepperContext = createContext<StepperContextValue | undefined>(undefined)\nconst StepItemContext = createContext<StepItemContextValue | undefined>(undefined)\n\nfunction useStepper() {\n const ctx = useContext(StepperContext)\n if (!ctx) throw new Error('useStepper must be used within a Stepper')\n return ctx\n}\n\nfunction useStepItem() {\n const ctx = useContext(StepItemContext)\n if (!ctx) throw new Error('useStepItem must be used within a StepperItem')\n return ctx\n}\n\ninterface StepperProps extends HTMLAttributes<HTMLDivElement> {\n defaultValue?: number\n value?: number\n onValueChange?: (value: number) => void\n orientation?: StepperOrientation\n indicators?: StepIndicators\n}\n\nfunction Stepper({\n defaultValue = 1,\n value,\n onValueChange,\n orientation = 'horizontal',\n className,\n children,\n indicators = {},\n ...props\n}: StepperProps) {\n const [activeStep, setActiveStep] = useState(defaultValue)\n const [triggerNodes, setTriggerNodes] = useState<HTMLButtonElement[]>([])\n\n // Register/unregister triggers\n const registerTrigger = useCallback((node: HTMLButtonElement | null) => {\n setTriggerNodes((prev) => {\n if (node && !prev.includes(node)) {\n return [...prev, node]\n } else if (!node && prev.includes(node!)) {\n return prev.filter((n) => n !== node)\n } else {\n return prev\n }\n })\n }, [])\n\n const handleSetActiveStep = useCallback(\n (step: number) => {\n if (value === undefined) {\n setActiveStep(step)\n }\n onValueChange?.(step)\n },\n [value, onValueChange]\n )\n\n const currentStep = value ?? activeStep\n\n // Keyboard navigation logic\n const focusTrigger = useCallback(\n (idx: number) => {\n if (triggerNodes[idx]) triggerNodes[idx].focus()\n },\n [triggerNodes]\n )\n const focusNext = useCallback(\n (currentIdx: number) => focusTrigger((currentIdx + 1) % triggerNodes.length),\n [focusTrigger, triggerNodes]\n )\n const focusPrev = useCallback(\n (currentIdx: number) => focusTrigger((currentIdx - 1 + triggerNodes.length) % triggerNodes.length),\n [focusTrigger, triggerNodes]\n )\n const focusFirst = useCallback(() => focusTrigger(0), [focusTrigger])\n const focusLast = useCallback(() => focusTrigger(triggerNodes.length - 1), [focusTrigger, triggerNodes])\n\n // Context value\n const contextValue = useMemo<StepperContextValue>(\n () => ({\n activeStep: currentStep,\n setActiveStep: handleSetActiveStep,\n stepsCount: Children.toArray(children).filter(\n (child): child is ReactElement =>\n isValidElement(child) && (child.type as { displayName?: string }).displayName === 'StepperItem'\n ).length,\n orientation,\n registerTrigger,\n focusNext,\n focusPrev,\n focusFirst,\n focusLast,\n triggerNodes,\n indicators\n }),\n [\n currentStep,\n handleSetActiveStep,\n children,\n orientation,\n registerTrigger,\n triggerNodes,\n focusFirst,\n focusLast,\n focusNext,\n focusPrev,\n indicators\n ]\n )\n\n return (\n <StepperContext.Provider value={contextValue}>\n <div\n role=\"tablist\"\n aria-orientation={orientation}\n data-slot=\"stepper\"\n className={cn('w-full', className)}\n data-orientation={orientation}\n {...props}\n >\n {children}\n </div>\n </StepperContext.Provider>\n )\n}\n\ninterface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n step: number\n completed?: boolean\n disabled?: boolean\n loading?: boolean\n}\n\nfunction StepperItem({\n step,\n completed = false,\n disabled = false,\n loading = false,\n className,\n children,\n ...props\n}: StepperItemProps) {\n const { activeStep } = useStepper()\n\n const state: StepState = completed || step < activeStep ? 'completed' : activeStep === step ? 'active' : 'inactive'\n\n const isLoading = loading && step === activeStep\n\n return (\n <StepItemContext.Provider value={{ step, state, isDisabled: disabled, isLoading }}>\n <div\n data-slot=\"stepper-item\"\n className={cn(\n 'group/step flex items-center justify-center not-last:flex-1 group-data-[orientation=horizontal]/stepper-nav:flex-row group-data-[orientation=vertical]/stepper-nav:flex-col',\n className\n )}\n data-state={state}\n {...(isLoading ? { 'data-loading': true } : {})}\n {...props}\n >\n {children}\n </div>\n </StepItemContext.Provider>\n )\n}\n\ninterface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean\n}\n\nfunction StepperTrigger({ asChild = false, className, children, tabIndex, ...props }: StepperTriggerProps) {\n const { state, isLoading } = useStepItem()\n const stepperCtx = useStepper()\n const { setActiveStep, activeStep, registerTrigger, triggerNodes, focusNext, focusPrev, focusFirst, focusLast } =\n stepperCtx\n const { step, isDisabled } = useStepItem()\n const isSelected = activeStep === step\n const id = `stepper-tab-${step}`\n const panelId = `stepper-panel-${step}`\n\n // Register this trigger for keyboard navigation\n const btnRef = useRef<HTMLButtonElement>(null)\n useEffect(() => {\n if (btnRef.current) {\n registerTrigger(btnRef.current)\n }\n }, [registerTrigger])\n\n // Find our index among triggers for navigation\n const myIdx = useMemo(() => triggerNodes.findIndex((n: HTMLButtonElement) => n === btnRef.current), [triggerNodes])\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n switch (e.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n e.preventDefault()\n if (myIdx !== -1 && focusNext) focusNext(myIdx)\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n e.preventDefault()\n if (myIdx !== -1 && focusPrev) focusPrev(myIdx)\n break\n case 'Home':\n e.preventDefault()\n if (focusFirst) focusFirst()\n break\n case 'End':\n e.preventDefault()\n if (focusLast) focusLast()\n break\n case 'Enter':\n case ' ':\n e.preventDefault()\n setActiveStep(step)\n break\n }\n }\n\n if (asChild) {\n return (\n <span data-slot=\"stepper-trigger\" data-state={state} className={className}>\n {children}\n </span>\n )\n }\n\n return (\n <button\n ref={btnRef}\n role=\"tab\"\n id={id}\n aria-selected={isSelected}\n aria-controls={panelId}\n tabIndex={typeof tabIndex === 'number' ? tabIndex : isSelected ? 0 : -1}\n data-slot=\"stepper-trigger\"\n data-state={state}\n data-loading={isLoading}\n className={cn(\n 'focus-visible:border-ring focus-visible:ring-ring/50 inline-flex cursor-pointer items-center outline-none focus-visible:z-10 focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-60',\n 'gap-2.5 rounded-full',\n className\n )}\n onClick={() => setActiveStep(step)}\n onKeyDown={handleKeyDown}\n disabled={isDisabled}\n {...props}\n >\n {children}\n </button>\n )\n}\n\nexport type StepperIndicatorProps = React.ComponentProps<'div'>\n\nfunction StepperIndicator({ children, className }: StepperIndicatorProps) {\n const { state, isLoading } = useStepItem()\n const { indicators } = useStepper()\n\n return (\n <div\n data-slot=\"stepper-indicator\"\n data-state={state}\n className={cn(\n 'border-background bg-accent text-accent-foreground data-[state=completed]:bg-primary data-[state=completed]:text-primary-foreground data-[state=active]:bg-primary data-[state=active]:text-primary-foreground relative flex size-6 shrink-0 items-center justify-center overflow-hidden',\n 'rounded-full text-xs',\n className\n )}\n >\n <div className=\"absolute\">\n {indicators &&\n ((isLoading && indicators.loading) ||\n (state === 'completed' && indicators.completed) ||\n (state === 'active' && indicators.active) ||\n (state === 'inactive' && indicators.inactive))\n ? (isLoading && indicators.loading) ||\n (state === 'completed' && indicators.completed) ||\n (state === 'active' && indicators.active) ||\n (state === 'inactive' && indicators.inactive)\n : children}\n </div>\n </div>\n )\n}\n\nexport type StepperSeparatorProps = React.ComponentProps<'div'>\n\nfunction StepperSeparator({ className }: StepperSeparatorProps) {\n const { state } = useStepItem()\n\n return (\n <div\n data-slot=\"stepper-separator\"\n data-state={state}\n className={cn(\n 'bg-muted rounded-sm group-data-[orientation=horizontal]/stepper-nav:h-0.5 group-data-[orientation=vertical]/stepper-nav:h-12 group-data-[orientation=vertical]/stepper-nav:w-0.5 m-0.5 group-data-[orientation=horizontal]/stepper-nav:flex-1',\n className\n )}\n />\n )\n}\n\nexport type StepperTitleProps = React.ComponentProps<'h3'>\n\nfunction StepperTitle({ children, className }: StepperTitleProps) {\n const { state } = useStepItem()\n\n return (\n <h3 data-slot=\"stepper-title\" data-state={state} className={cn('text-sm leading-none font-medium', className)}>\n {children}\n </h3>\n )\n}\n\nexport type StepperDescriptionProps = React.ComponentProps<'div'>\n\nfunction StepperDescription({ children, className }: StepperDescriptionProps) {\n const { state } = useStepItem()\n\n return (\n <div data-slot=\"stepper-description\" data-state={state} className={cn('text-muted-foreground text-sm', className)}>\n {children}\n </div>\n )\n}\n\nexport type StepperNavProps = React.ComponentProps<'nav'>\n\nfunction StepperNav({ children, className }: StepperNavProps) {\n const { activeStep, orientation } = useStepper()\n\n return (\n <nav\n data-slot=\"stepper-nav\"\n data-state={activeStep}\n data-orientation={orientation}\n className={cn(\n 'group/stepper-nav inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col',\n className\n )}\n >\n {children}\n </nav>\n )\n}\n\nexport type StepperPanelProps = React.ComponentProps<'div'>\n\nfunction StepperPanel({ children, className }: StepperPanelProps) {\n const { activeStep } = useStepper()\n\n return (\n <div data-slot=\"stepper-panel\" data-state={activeStep} className={cn('w-full', className)}>\n {children}\n </div>\n )\n}\n\ninterface StepperContentProps extends React.ComponentProps<'div'> {\n value: number\n forceMount?: boolean\n}\n\nfunction StepperContent({ value, forceMount, children, className }: StepperContentProps) {\n const { activeStep } = useStepper()\n const isActive = value === activeStep\n\n if (!forceMount && !isActive) {\n return null\n }\n\n return (\n <div\n data-slot=\"stepper-content\"\n data-state={activeStep}\n className={cn('w-full', className, !isActive && forceMount && 'hidden')}\n hidden={!isActive && forceMount}\n >\n {children}\n </div>\n )\n}\n\nexport {\n Stepper,\n StepperContent,\n type StepperContentProps,\n StepperDescription,\n StepperIndicator,\n StepperItem,\n type StepperItemProps,\n StepperNav,\n StepperPanel,\n type StepperProps,\n StepperSeparator,\n StepperTitle,\n StepperTrigger,\n type StepperTriggerProps,\n useStepItem,\n useStepper\n}\n"],"mappings":"oRA+CA,MAAM,EAAiB,EAA+C,IAAA,EAAS,EACzE,EAAkB,EAAgD,IAAA,EAAS,EAEjF,SAAS,YAAa,CACpB,IAAM,EAAM,EAAW,CAAc,EACrC,GAAI,CAAC,EAAK,MAAU,MAAM,0CAA0C,EACpE,OAAO,CACT,CAEA,SAAS,aAAc,CACrB,IAAM,EAAM,EAAW,CAAe,EACtC,GAAI,CAAC,EAAK,MAAU,MAAM,+CAA+C,EACzE,OAAO,CACT,CAUA,SAAS,QAAQ,CACf,eAAe,EACf,QACA,gBACA,cAAc,aACd,YACA,WACA,aAAa,CAAC,EACd,GAAG,GACY,CACf,GA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CAER,CAIA,SAAS,mBAAmB,CAAE,WAAU,aAAsC,CAC5E,GAAM,CAAE,SAAU,YAAY,EAE9B,OACE,EAAC,MAAD,CAAK,YAAU,sBAAsB,aAAY,EAAO,UAAW,EAAG,gCAAiC,CAAS,EAC7G,UACE,CAAA,CAET,CAIA,SAAS,WAAW,CAAE,WAAU,aAA8B,CAC5D,GAAM,CAAE,aAAY,eAAgB,WAAW,EAE/C,OACE,EAAC,MAAD,CACE,YAAU,cACV,aAAY,EACZ,mBAAkB,EAClB,UAAW,EACT,iJACA,CACF,EAEC,UACE,CAAA,CAET,CAIA,SAAS,aAAa,CAAE,WAAU,aAAgC,CAChE,GAAM,CAAE,cAAe,WAAW,EAElC,OACE,EAAC,MAAD,CAAK,YAAU,gBAAgB,aAAY,EAAY,UAAW,EAAG,SAAU,CAAS,EACrF,UACE,CAAA,CAET,CAOA,SAAS,eAAe,CAAE,QAAO,aAAY,WAAU,aAAkC,CACvF,GAAM,CAAE,cAAe,WAAW,EAC5B,EAAW,IAAU,EAM3B,MAJI,CAAC,GAAc,CAAC,EACX,KAIP,EAAC,MAAD,CACE,YAAU,kBACV,aAAY,EACZ,UAAW,EAAG,SAAU,EAAW,CAAC,GAAY,GAAc,QAAQ,EACtE,OAAQ,CAAC,GAAY,EAEpB,UACE,CAAA,CAET"}
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{useMask as e}from"@react-input/mask";const t={9:/\d/,a:/[A-Za-z]/,"*":/./};function useMask(n={}){let{replacement:r,...i}=n;return e({...i,replacement:r??t})}export{useMask};
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{useMask as e}from"@react-input/mask";const t={_:/\d/,"#":/[A-Za-z]/,"*":/./};function useMask(n={}){let{replacement:r,mask:i,...a}=n;return e({mask:!r&&i?i.replace(/[9a]/g,e=>e===`9`?`_`:`#`):i,...a,replacement:r??t})}export{useMask};
2
2
  //# sourceMappingURL=use-mask.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-mask.js","names":["useReactInputMask"],"sources":["../../src/hooks/use-mask.ts"],"sourcesContent":["import type { MaskOptions, Replacement } from '@react-input/mask'\nimport { useMask as useReactInputMask } from '@react-input/mask'\n\nexport type { MaskOptions, ModifiedData, Modify, Replacement, Track, TrackingData } from '@react-input/mask'\n\nconst DEFAULT_REPLACEMENT: Replacement = {\n 9: /\\d/,\n a: /[A-Za-z]/,\n '*': /./\n}\n\nexport type UseMaskOptions = MaskOptions\n\nexport function useMask(options: UseMaskOptions = {}) {\n const { replacement, ...rest } = options\n return useReactInputMask({\n ...rest,\n replacement: replacement ?? DEFAULT_REPLACEMENT\n })\n}\n"],"mappings":"oFAKA,MAAM,EAAmC,CACvC,EAAG,KACH,EAAG,WACH,IAAK,GACP,EAIA,SAAgB,QAAQ,EAA0B,CAAC,EAAG,CACpD,GAAM,CAAE,cAAa,GAAG,GAAS,EACjC,OAAOA,EAAkB,CACvB,GAAG,EACH,YAAa,GAAe,CAC9B,CAAC,CACH"}
1
+ {"version":3,"file":"use-mask.js","names":["useReactInputMask"],"sources":["../../src/hooks/use-mask.ts"],"sourcesContent":["import type { MaskOptions, Replacement } from '@react-input/mask'\nimport { useMask as useReactInputMask } from '@react-input/mask'\n\nexport type { MaskOptions, ModifiedData, Modify, Replacement, Track, TrackingData } from '@react-input/mask'\n\nconst DEFAULT_REPLACEMENT: Replacement = {\n _: /\\d/,\n '#': /[A-Za-z]/,\n '*': /./\n}\n\nexport type UseMaskOptions = MaskOptions\n\nexport function useMask(options: UseMaskOptions = {}) {\n const { replacement, mask, ...rest } = options\n\n // Legacy default tokens (9/a) collided with typed digits/letters; rewrite them to the safe tokens (_/#) when the default replacement is in effect.\n const safeMask = !replacement && mask ? mask.replace(/[9a]/g, (token) => (token === '9' ? '_' : '#')) : mask\n\n return useReactInputMask({\n mask: safeMask,\n ...rest,\n replacement: replacement ?? DEFAULT_REPLACEMENT\n })\n}\n"],"mappings":"oFAKA,MAAM,EAAmC,CACvC,EAAG,KACH,IAAK,WACL,IAAK,GACP,EAIA,SAAgB,QAAQ,EAA0B,CAAC,EAAG,CACpD,GAAM,CAAE,cAAa,OAAM,GAAG,GAAS,EAKvC,OAAOA,EAAkB,CACvB,KAHe,CAAC,GAAe,EAAO,EAAK,QAAQ,QAAU,GAAW,IAAU,IAAM,IAAM,GAAI,EAAI,EAItG,GAAG,EACH,YAAa,GAAe,CAC9B,CAAC,CACH"}
package/dist/index.d.ts CHANGED
@@ -50,7 +50,9 @@ import { MaskOptions, ModifiedData, Modify, Replacement, Track, TrackingData, Us
50
50
  import { MaskInput, MaskInputProps } from "./components/mask-input.js";
51
51
  import { NativeSelect, NativeSelectOptGroup, NativeSelectOptGroupProps, NativeSelectOption, NativeSelectOptionProps, NativeSelectProps } from "./components/native-select.js";
52
52
  import { NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, navigationMenuTriggerStyle } from "./components/navigation-menu.js";
53
+ import { NumberField, NumberFieldDecrement, NumberFieldDecrementProps, NumberFieldGroup, NumberFieldGroupProps, NumberFieldIncrement, NumberFieldIncrementProps, NumberFieldInput, NumberFieldInputProps, NumberFieldProps, NumberFieldScrubArea, NumberFieldScrubAreaProps } from "./components/number-field.js";
53
54
  import { Pagination, PaginationContent, PaginationContentProps, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationNext, PaginationNextProps, PaginationPrevious, PaginationPreviousProps, PaginationProps } from "./components/pagination.js";
55
+ import { PhoneInput, PhoneInputProps } from "./components/phone-input.js";
54
56
  import { Progress, ProgressProps, progressVariants } from "./components/progress.js";
55
57
  import { RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps } from "./components/radio-group.js";
56
58
  import { ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps } from "./components/resizable.js";
@@ -65,6 +67,7 @@ import { Slider, SliderProps } from "./components/slider.js";
65
67
  import { Toaster, ToasterProps, toast } from "./components/sonner.js";
66
68
  import { Spinner, SpinnerProps, spinnerVariants } from "./components/spinner.js";
67
69
  import { Stack, StackProps, stackVariants } from "./components/stack.js";
70
+ import { Stepper, StepperContent, StepperContentProps, StepperDescription, StepperDescriptionProps, StepperIndicator, StepperIndicatorProps, StepperItem, StepperItemProps, StepperNav, StepperNavProps, StepperPanel, StepperPanelProps, StepperProps, StepperSeparator, StepperSeparatorProps, StepperTitle, StepperTitleProps, StepperTrigger, StepperTriggerProps, useStepItem, useStepper } from "./components/stepper.js";
68
71
  import { Switch, SwitchProps } from "./components/switch.js";
69
72
  import { Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, tabsListVariants } from "./components/tabs.js";
70
73
  import { Text, TextProps, textVariants } from "./components/text.js";
@@ -89,4 +92,4 @@ import { ButtonColor, buttonColorVariants } from "./lib/button.js";
89
92
  import { composeRefs, setRef } from "./lib/compose-refs.js";
90
93
  import { ProgressColor, progressColorVariants } from "./lib/progress.js";
91
94
  import { cn, randomId } from "./lib/utils.js";
92
- export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, AreaChart, AreaChartCurveType, AreaChartGridAxis, AreaChartProps, AreaChartSeries, AreaChartType, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeColor, BadgeProps, BarChart, BarChartDatum, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, CHART_COLOR_KEYS, Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselApi, CarouselContent, CarouselContentProps, CarouselIndicators, CarouselIndicatorsProps, CarouselItem, CarouselItemProps, CarouselNext, CarouselNextProps, CarouselPrevious, CarouselPreviousProps, CarouselProps, Center, CenterProps, ChartColorKey, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, Checkbox, CheckboxProps, Code, CodeProps, Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps, type Column, type ColumnDef, Combobox, ComboboxChip, ComboboxChipProps, ComboboxChips, ComboboxChipsInput, ComboboxChipsInputProps, ComboboxChipsProps, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupProps, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxProps, ComboboxSeparator, ComboboxSeparatorProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps, Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps, Container, ContainerProps, DEFAULT_CHART_PALETTE, DataTable, DataTableBody, DataTableBodyProps, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableHeader, DataTableHeaderProps, DataTableLabels, DataTablePagination, DataTablePaginationProps, DataTableProps, DataTableRoot, DataTableRootProps, DataTableToolbar, DataTableToolbarProps, DataTableViewOptions, DataTableViewOptionsProps, type DateRange, DateRangePicker, DateRangePickerActions, DateRangePickerActionsProps, DateRangePickerApply, DateRangePickerApplyProps, DateRangePickerCalendar, DateRangePickerCalendarProps, DateRangePickerContent, DateRangePickerContentProps, DateRangePickerDateFields, DateRangePickerDateFieldsProps, DateRangePickerPreset, DateRangePickerPresetOption, DateRangePickerPresetProps, DateRangePickerPresets, DateRangePickerPresetsProps, DateRangePickerProps, DateRangePickerReset, DateRangePickerResetProps, DateRangePickerTrigger, DateRangePickerTriggerProps, DateRangePickerValue, DateRangePickerValueProps, Dialog, DialogBody, DialogBodyProps, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, DonutChart, DonutChartProps, Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps, Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps, ErrorCode, Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, type FileError, FileStatus, Flex, FlexProps, Grid, GridItem, GridItemProps, GridProps, Group, GroupProps, Heading, HeadingProps, HiddenFrom, HiddenFromProps, HotkeyItem, type HotkeyItemOptions, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, InfiniteProgress, InfiniteProgressProps, Input, InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupButtonProps, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupText, InputGroupTextProps, InputGroupTextarea, InputGroupTextareaProps, InputOTP, InputOTPGroup, InputOTPGroupProps, InputOTPProps, InputOTPSeparator, InputOTPSeparatorProps, InputOTPSlot, InputOTPSlotProps, InputProps, Kbd, KbdGroup, KbdGroupProps, KbdProps, Label, LabelProps, List, ListIcon, ListIconProps, ListItem, ListItemProps, ListProps, Marker, MarkerContent, MarkerContentProps, MarkerIcon, MarkerIconProps, MarkerProps, MaskInput, MaskInputProps, type MaskOptions, ModeToggle, ModeToggleProps, type ModifiedData, type Modify, NativeSelect, NativeSelectOptGroup, NativeSelectOptGroupProps, NativeSelectOption, NativeSelectOptionProps, NativeSelectProps, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, Pagination, PaginationContent, PaginationContentProps, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationNext, PaginationNextProps, PaginationPrevious, PaginationPreviousProps, PaginationProps, PieChart, PieChartBase, PieChartBaseProps, PieChartDatum, PieChartProps, Popover, PopoverAnchor, PopoverAnchorProps, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTitle, PopoverTitleProps, PopoverTrigger, PopoverTriggerProps, Progress, ProgressColor, ProgressProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps, type Replacement, ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveValueMap, RingProgress, RingProgressProps, RingProgressThickness, type RowData, ScrollArea, ScrollAreaProps, ScrollBar, ScrollBarProps, Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectScrollDownButton, SelectScrollDownButtonProps, SelectScrollUpButton, SelectScrollUpButtonProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps, Separator, SeparatorProps, Sidebar, SidebarContent, SidebarContentProps, SidebarFooter, SidebarFooterProps, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupContentProps, SidebarGroupLabel, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeader, SidebarHeaderProps, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSeparator, SidebarSeparatorProps, SidebarTrigger, SidebarTriggerProps, SimpleGrid, SimpleGridProps, Skeleton, SkeletonProps, Slider, SliderProps, Spinner, SpinnerProps, Stack, StackProps, Switch, SwitchProps, Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableContainer, TableContainerProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, type TanStackTable, Text, TextProps, Textarea, TextareaProps, Theme, ThemeProvider, ThemeProviderProps, ThemeProviderState, Timeline, TimelineConnector, TimelineConnectorColor, TimelineConnectorProps, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineEmpty, TimelineEmptyProps, TimelineHeader, TimelineHeaderProps, TimelineIcon, TimelineIconColor, TimelineIconProps, TimelineIconSize, TimelineItem, TimelineItemProps, TimelineProps, TimelineStatus, TimelineTime, TimelineTimeProps, TimelineTitle, TimelineTitleProps, Toaster, ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleProps, Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps, type Track, type TrackingData, UIColor, UnstyledButton, UnstyledButtonProps, UseDataTableOptions, UseDisclosureHandlers, UseDisclosureOptions, UseDisclosureReturnValue, UseDropzoneProps, UseDropzoneReturn, UseIdleOptions, UseIntervalOptions, UseIntervalReturnValue, UseLocalStorageOptions, UseMaskOptions, VisibleFrom, VisibleFromProps, anchorVariants, badgeColorVariants, badgeVariants, breakpointValues, buildPieConfig, buttonColorVariants, buttonGroupVariants, buttonVariants, centerVariants, cn, composeRefs, containerVariants, createDataTableSelectColumn, defaultDataTableLabels, flexVariants, getHotkeyHandler, groupVariants, headingVariants, listVariants, locale, markerVariants, navigationMenuTriggerStyle, progressColorVariants, progressVariants, randomId, resolveChartColor, ringProgressVariants, selectionControlColorVariants, setRef, spinnerVariants, stackVariants, tableVariants, tabsListVariants, textVariants, timelineVariants, toast, toggleVariants, uiColors, useBreakpoint, useBreakpointValue, useCarousel, useComboboxAnchor, useDataTable, useDataTableContext, useDisclosure, useDocumentVisibility, useDropzone, useFieldControlId, useHotkeys, useIdle, useInterval, useIsMobile, useLocalStorage, useMask, useSidebar, useTheme };
95
+ export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, AreaChart, AreaChartCurveType, AreaChartGridAxis, AreaChartProps, AreaChartSeries, AreaChartType, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeColor, BadgeProps, BarChart, BarChartDatum, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, CHART_COLOR_KEYS, Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselApi, CarouselContent, CarouselContentProps, CarouselIndicators, CarouselIndicatorsProps, CarouselItem, CarouselItemProps, CarouselNext, CarouselNextProps, CarouselPrevious, CarouselPreviousProps, CarouselProps, Center, CenterProps, ChartColorKey, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, Checkbox, CheckboxProps, Code, CodeProps, Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps, type Column, type ColumnDef, Combobox, ComboboxChip, ComboboxChipProps, ComboboxChips, ComboboxChipsInput, ComboboxChipsInputProps, ComboboxChipsProps, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupProps, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxProps, ComboboxSeparator, ComboboxSeparatorProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps, Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps, Container, ContainerProps, DEFAULT_CHART_PALETTE, DataTable, DataTableBody, DataTableBodyProps, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableHeader, DataTableHeaderProps, DataTableLabels, DataTablePagination, DataTablePaginationProps, DataTableProps, DataTableRoot, DataTableRootProps, DataTableToolbar, DataTableToolbarProps, DataTableViewOptions, DataTableViewOptionsProps, type DateRange, DateRangePicker, DateRangePickerActions, DateRangePickerActionsProps, DateRangePickerApply, DateRangePickerApplyProps, DateRangePickerCalendar, DateRangePickerCalendarProps, DateRangePickerContent, DateRangePickerContentProps, DateRangePickerDateFields, DateRangePickerDateFieldsProps, DateRangePickerPreset, DateRangePickerPresetOption, DateRangePickerPresetProps, DateRangePickerPresets, DateRangePickerPresetsProps, DateRangePickerProps, DateRangePickerReset, DateRangePickerResetProps, DateRangePickerTrigger, DateRangePickerTriggerProps, DateRangePickerValue, DateRangePickerValueProps, Dialog, DialogBody, DialogBodyProps, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, DonutChart, DonutChartProps, Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps, Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps, ErrorCode, Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, type FileError, FileStatus, Flex, FlexProps, Grid, GridItem, GridItemProps, GridProps, Group, GroupProps, Heading, HeadingProps, HiddenFrom, HiddenFromProps, HotkeyItem, type HotkeyItemOptions, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, InfiniteProgress, InfiniteProgressProps, Input, InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupButtonProps, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupText, InputGroupTextProps, InputGroupTextarea, InputGroupTextareaProps, InputOTP, InputOTPGroup, InputOTPGroupProps, InputOTPProps, InputOTPSeparator, InputOTPSeparatorProps, InputOTPSlot, InputOTPSlotProps, InputProps, Kbd, KbdGroup, KbdGroupProps, KbdProps, Label, LabelProps, List, ListIcon, ListIconProps, ListItem, ListItemProps, ListProps, Marker, MarkerContent, MarkerContentProps, MarkerIcon, MarkerIconProps, MarkerProps, MaskInput, MaskInputProps, type MaskOptions, ModeToggle, ModeToggleProps, type ModifiedData, type Modify, NativeSelect, NativeSelectOptGroup, NativeSelectOptGroupProps, NativeSelectOption, NativeSelectOptionProps, NativeSelectProps, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, NumberField, NumberFieldDecrement, NumberFieldDecrementProps, NumberFieldGroup, NumberFieldGroupProps, NumberFieldIncrement, NumberFieldIncrementProps, NumberFieldInput, NumberFieldInputProps, NumberFieldProps, NumberFieldScrubArea, NumberFieldScrubAreaProps, Pagination, PaginationContent, PaginationContentProps, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationNext, PaginationNextProps, PaginationPrevious, PaginationPreviousProps, PaginationProps, PhoneInput, PhoneInputProps, PieChart, PieChartBase, PieChartBaseProps, PieChartDatum, PieChartProps, Popover, PopoverAnchor, PopoverAnchorProps, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTitle, PopoverTitleProps, PopoverTrigger, PopoverTriggerProps, Progress, ProgressColor, ProgressProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps, type Replacement, ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveValueMap, RingProgress, RingProgressProps, RingProgressThickness, type RowData, ScrollArea, ScrollAreaProps, ScrollBar, ScrollBarProps, Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectScrollDownButton, SelectScrollDownButtonProps, SelectScrollUpButton, SelectScrollUpButtonProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps, Separator, SeparatorProps, Sidebar, SidebarContent, SidebarContentProps, SidebarFooter, SidebarFooterProps, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupContentProps, SidebarGroupLabel, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeader, SidebarHeaderProps, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSeparator, SidebarSeparatorProps, SidebarTrigger, SidebarTriggerProps, SimpleGrid, SimpleGridProps, Skeleton, SkeletonProps, Slider, SliderProps, Spinner, SpinnerProps, Stack, StackProps, Stepper, StepperContent, type StepperContentProps, StepperDescription, StepperDescriptionProps, StepperIndicator, StepperIndicatorProps, StepperItem, type StepperItemProps, StepperNav, StepperNavProps, StepperPanel, StepperPanelProps, type StepperProps, StepperSeparator, StepperSeparatorProps, StepperTitle, StepperTitleProps, StepperTrigger, type StepperTriggerProps, Switch, SwitchProps, Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableContainer, TableContainerProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, type TanStackTable, Text, TextProps, Textarea, TextareaProps, Theme, ThemeProvider, ThemeProviderProps, ThemeProviderState, Timeline, TimelineConnector, TimelineConnectorColor, TimelineConnectorProps, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineEmpty, TimelineEmptyProps, TimelineHeader, TimelineHeaderProps, TimelineIcon, TimelineIconColor, TimelineIconProps, TimelineIconSize, TimelineItem, TimelineItemProps, TimelineProps, TimelineStatus, TimelineTime, TimelineTimeProps, TimelineTitle, TimelineTitleProps, Toaster, ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleProps, Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps, type Track, type TrackingData, UIColor, UnstyledButton, UnstyledButtonProps, UseDataTableOptions, UseDisclosureHandlers, UseDisclosureOptions, UseDisclosureReturnValue, UseDropzoneProps, UseDropzoneReturn, UseIdleOptions, UseIntervalOptions, UseIntervalReturnValue, UseLocalStorageOptions, UseMaskOptions, VisibleFrom, VisibleFromProps, anchorVariants, badgeColorVariants, badgeVariants, breakpointValues, buildPieConfig, buttonColorVariants, buttonGroupVariants, buttonVariants, centerVariants, cn, composeRefs, containerVariants, createDataTableSelectColumn, defaultDataTableLabels, flexVariants, getHotkeyHandler, groupVariants, headingVariants, listVariants, locale, markerVariants, navigationMenuTriggerStyle, progressColorVariants, progressVariants, randomId, resolveChartColor, ringProgressVariants, selectionControlColorVariants, setRef, spinnerVariants, stackVariants, tableVariants, tabsListVariants, textVariants, timelineVariants, toast, toggleVariants, uiColors, useBreakpoint, useBreakpointValue, useCarousel, useComboboxAnchor, useDataTable, useDataTableContext, useDisclosure, useDocumentVisibility, useDropzone, useFieldControlId, useHotkeys, useIdle, useInterval, useIsMobile, useLocalStorage, useMask, useSidebar, useStepItem, useStepper, useTheme };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{cn as e,randomId as t}from"./lib/utils.js";import{Accordion as n,AccordionContent as r,AccordionItem as i,AccordionTrigger as a}from"./components/accordion.js";import{Alert as o,AlertAction as s,AlertDescription as c,AlertTitle as l}from"./components/alert.js";import{buttonColorVariants as u}from"./lib/button.js";import{Spinner as d,spinnerVariants as f}from"./components/spinner.js";import{Button as p,buttonVariants as m}from"./components/button.js";import{AlertDialog as h,AlertDialogAction as g,AlertDialogCancel as _,AlertDialogContent as v,AlertDialogDescription as y,AlertDialogFooter as b,AlertDialogHeader as x,AlertDialogMedia as S,AlertDialogOverlay as C,AlertDialogPortal as w,AlertDialogTitle as T,AlertDialogTrigger as E}from"./components/alert-dialog.js";import{Anchor as D,anchorVariants as O}from"./components/anchor.js";import{CHART_COLOR_KEYS as k,ChartContainer as A,ChartLegend as j,ChartLegendContent as M,ChartStyle as N,ChartTooltip as P,ChartTooltipContent as F,DEFAULT_CHART_PALETTE as I,resolveChartColor as L}from"./components/chart.js";import{AreaChart as R}from"./components/area-chart.js";import{Avatar as z,AvatarBadge as B,AvatarFallback as V,AvatarGroup as H,AvatarGroupCount as U,AvatarImage as W}from"./components/avatar.js";import{badgeColorVariants as G}from"./lib/badge.js";import{Badge as K,badgeVariants as q}from"./components/badge.js";import{BarChart as J}from"./components/bar-chart.js";import{Breadcrumb as Y,BreadcrumbEllipsis as X,BreadcrumbItem as Z,BreadcrumbLink as Q,BreadcrumbList as $,BreadcrumbPage as ee,BreadcrumbSeparator as te}from"./components/breadcrumb.js";import{Separator as ne}from"./components/separator.js";import{ButtonGroup as re,ButtonGroupSeparator as ie,ButtonGroupText as ae,buttonGroupVariants as oe}from"./components/button-group.js";import{Calendar as se,CalendarDayButton as ce,locale as le}from"./components/calendar.js";import{Card as ue,CardAction as de,CardContent as fe,CardDescription as pe,CardFooter as me,CardHeader as he,CardTitle as ge}from"./components/card.js";import{Carousel as _e,CarouselContent as ve,CarouselIndicators as ye,CarouselItem as be,CarouselNext as xe,CarouselPrevious as Se,useCarousel as Ce}from"./components/carousel.js";import{Center as we,centerVariants as Te}from"./components/center.js";import{selectionControlColorVariants as Ee,uiColors as De}from"./lib/color.js";import{Label as Oe}from"./components/label.js";import{Field as ke,FieldContent as Ae,FieldDescription as je,FieldError as Me,FieldGroup as Ne,FieldLabel as Pe,FieldLegend as Fe,FieldSeparator as Ie,FieldSet as Le,FieldTitle as Re,useFieldControlId as ze}from"./components/field.js";import{Checkbox as Be}from"./components/checkbox.js";import{Code as Ve}from"./components/code.js";import{Collapsible as He,CollapsibleContent as Ue,CollapsibleTrigger as We}from"./components/collapsible.js";import{Input as Ge}from"./components/input.js";import{Textarea as Ke}from"./components/textarea.js";import{InputGroup as qe,InputGroupAddon as Je,InputGroupButton as Ye,InputGroupInput as Xe,InputGroupText as Ze,InputGroupTextarea as Qe}from"./components/input-group.js";import{Combobox as $e,ComboboxChip as et,ComboboxChips as tt,ComboboxChipsInput as nt,ComboboxClear as rt,ComboboxCollection as it,ComboboxContent as at,ComboboxEmpty as ot,ComboboxGroup as st,ComboboxInput as ct,ComboboxItem as lt,ComboboxLabel as ut,ComboboxList as dt,ComboboxSeparator as ft,ComboboxTrigger as pt,ComboboxValue as mt,useComboboxAnchor as ht}from"./components/combobox.js";import{Dialog as gt,DialogBody as _t,DialogClose as vt,DialogContent as yt,DialogDescription as bt,DialogFooter as xt,DialogHeader as St,DialogOverlay as Ct,DialogPortal as wt,DialogTitle as Tt,DialogTrigger as Et}from"./components/dialog.js";import{Command as Dt,CommandDialog as Ot,CommandEmpty as kt,CommandGroup as At,CommandInput as jt,CommandItem as Mt,CommandList as Nt,CommandSeparator as Pt,CommandShortcut as Ft}from"./components/command.js";import{Container as It,containerVariants as Lt}from"./components/container.js";import{DropdownMenu as Rt,DropdownMenuCheckboxItem as zt,DropdownMenuContent as Bt,DropdownMenuGroup as Vt,DropdownMenuItem as Ht,DropdownMenuLabel as Ut,DropdownMenuPortal as Wt,DropdownMenuRadioGroup as Gt,DropdownMenuRadioItem as Kt,DropdownMenuSeparator as qt,DropdownMenuShortcut as Jt,DropdownMenuSub as Yt,DropdownMenuSubContent as Xt,DropdownMenuSubTrigger as Zt,DropdownMenuTrigger as Qt}from"./components/dropdown-menu.js";import{Select as $t,SelectContent as en,SelectGroup as tn,SelectItem as nn,SelectLabel as rn,SelectScrollDownButton as an,SelectScrollUpButton as on,SelectSeparator as sn,SelectTrigger as cn,SelectValue as ln}from"./components/select.js";import{Table as un,TableBody as dn,TableCaption as fn,TableCell as pn,TableContainer as mn,TableFooter as hn,TableHead as gn,TableHeader as _n,TableRow as vn,tableVariants as yn}from"./components/table.js";import{DataTable as bn,DataTableBody as xn,DataTableColumnHeader as Sn,DataTableHeader as Cn,DataTablePagination as wn,DataTableRoot as Tn,DataTableToolbar as En,DataTableViewOptions as Dn,createDataTableSelectColumn as On,defaultDataTableLabels as kn,useDataTable as An,useDataTableContext as jn}from"./components/data-table.js";import{Popover as Mn,PopoverAnchor as Nn,PopoverContent as Pn,PopoverDescription as Fn,PopoverHeader as In,PopoverTitle as Ln,PopoverTrigger as Rn}from"./components/popover.js";import{DateRangePicker as zn,DateRangePickerActions as Bn,DateRangePickerApply as Vn,DateRangePickerCalendar as Hn,DateRangePickerContent as Un,DateRangePickerDateFields as Wn,DateRangePickerPreset as Gn,DateRangePickerPresets as Kn,DateRangePickerReset as qn,DateRangePickerTrigger as Jn,DateRangePickerValue as Yn}from"./components/date-range-picker.js";import{PieChart as Xn,PieChartBase as Zn,buildPieConfig as Qn}from"./components/pie-chart.js";import{DonutChart as $n}from"./components/donut-chart.js";import{Drawer as er,DrawerBody as tr,DrawerClose as nr,DrawerContent as rr,DrawerDescription as ir,DrawerFooter as ar,DrawerHeader as or,DrawerOverlay as sr,DrawerPortal as cr,DrawerTitle as lr,DrawerTrigger as ur}from"./components/drawer.js";import{composeRefs as dr,setRef as fr}from"./lib/compose-refs.js";import{Dropzone as pr,DropzoneArea as mr,DropzoneDescription as hr,DropzoneFileList as gr,DropzoneFileListItem as _r,DropzoneFileMessage as vr,DropzoneMessage as yr,DropzoneRemoveFile as br,DropzoneRetryFile as xr,DropzoneTrigger as Sr,ErrorCode as Cr,InfiniteProgress as wr,useDropzone as Tr}from"./components/dropzone.js";import{Empty as Er,EmptyContent as Dr,EmptyDescription as Or,EmptyHeader as kr,EmptyMedia as Ar,EmptyTitle as jr}from"./components/empty.js";import{Flex as Mr,flexVariants as Nr}from"./components/flex.js";import{Grid as Pr,GridItem as Fr}from"./components/grid.js";import{Group as Ir,groupVariants as Lr}from"./components/group.js";import{Heading as Rr,headingVariants as zr}from"./components/heading.js";import{HoverCard as Br,HoverCardContent as Vr,HoverCardTrigger as Hr}from"./components/hover-card.js";import{InputOTP as Ur,InputOTPGroup as Wr,InputOTPSeparator as Gr,InputOTPSlot as Kr,REGEXP_ONLY_CHARS as qr,REGEXP_ONLY_DIGITS as Jr,REGEXP_ONLY_DIGITS_AND_CHARS as Yr}from"./components/input-otp.js";import{Kbd as Xr,KbdGroup as Zr}from"./components/kbd.js";import{List as Qr,ListIcon as $r,ListItem as ei,listVariants as ti}from"./components/list.js";import{Marker as ni,MarkerContent as ri,MarkerIcon as ii,markerVariants as ai}from"./components/marker.js";import{useMask as oi}from"./hooks/use-mask.js";import{MaskInput as si}from"./components/mask-input.js";import{NativeSelect as ci,NativeSelectOptGroup as li,NativeSelectOption as ui}from"./components/native-select.js";import{NavigationMenu as di,NavigationMenuContent as fi,NavigationMenuIndicator as pi,NavigationMenuItem as mi,NavigationMenuLink as hi,NavigationMenuList as gi,NavigationMenuTrigger as _i,NavigationMenuViewport as vi,navigationMenuTriggerStyle as yi}from"./components/navigation-menu.js";import{Pagination as bi,PaginationContent as xi,PaginationEllipsis as Si,PaginationItem as Ci,PaginationLink as wi,PaginationNext as Ti,PaginationPrevious as Ei}from"./components/pagination.js";import{progressColorVariants as Di}from"./lib/progress.js";import{Progress as Oi,progressVariants as ki}from"./components/progress.js";import{RadioGroup as Ai,RadioGroupItem as ji}from"./components/radio-group.js";import{ResizableHandle as Mi,ResizablePanel as Ni,ResizablePanelGroup as Pi}from"./components/resizable.js";import{RingProgress as Fi,ringProgressVariants as Ii}from"./components/ring-progress.js";import{ScrollArea as Li,ScrollBar as Ri}from"./components/scroll-area.js";import{useIsMobile as zi}from"./hooks/use-mobile.js";import{Skeleton as Bi}from"./components/skeleton.js";import{Tooltip as Vi,TooltipContent as Hi,TooltipProvider as Ui,TooltipRoot as Wi,TooltipTrigger as Gi}from"./components/tooltip.js";import{Sidebar as Ki,SidebarContent as qi,SidebarFooter as Ji,SidebarGroup as Yi,SidebarGroupAction as Xi,SidebarGroupContent as Zi,SidebarGroupLabel as Qi,SidebarHeader as $i,SidebarInput as ea,SidebarInset as ta,SidebarMenu as na,SidebarMenuAction as ra,SidebarMenuBadge as ia,SidebarMenuButton as aa,SidebarMenuItem as oa,SidebarMenuSkeleton as sa,SidebarMenuSub as ca,SidebarMenuSubButton as la,SidebarMenuSubItem as ua,SidebarProvider as da,SidebarRail as fa,SidebarSeparator as pa,SidebarTrigger as ma,useSidebar as ha}from"./components/sidebar.js";import{SimpleGrid as ga}from"./components/simple-grid.js";import{Slider as _a}from"./components/slider.js";import{Toaster as va,toast as ya}from"./components/sonner.js";import{Stack as ba,stackVariants as xa}from"./components/stack.js";import{Switch as Sa}from"./components/switch.js";import{Tabs as Ca,TabsContent as wa,TabsList as Ta,TabsTrigger as Ea,tabsListVariants as Da}from"./components/tabs.js";import{Text as Oa,textVariants as ka}from"./components/text.js";import{ModeToggle as Aa,ThemeProvider as ja,useTheme as Ma}from"./components/theme.js";import{Timeline as Na,TimelineConnector as Pa,TimelineContent as Fa,TimelineDescription as Ia,TimelineEmpty as La,TimelineHeader as Ra,TimelineIcon as za,TimelineItem as Ba,TimelineTime as Va,TimelineTitle as Ha,timelineVariants as Ua}from"./components/timeline.js";import{Toggle as Wa,toggleVariants as Ga}from"./components/toggle.js";import{ToggleGroup as Ka,ToggleGroupItem as qa}from"./components/toggle-group.js";import{UnstyledButton as Ja}from"./components/unstyled-button.js";import{breakpointValues as Ya,useBreakpoint as Xa}from"./hooks/use-breakpoint.js";import{HiddenFrom as Za,VisibleFrom as Qa}from"./components/visibility.js";import{useBreakpointValue as $a}from"./hooks/use-breakpoint-value.js";import{useDisclosure as eo}from"./hooks/use-disclosure.js";import{useDocumentVisibility as to}from"./hooks/use-document-visibility.js";import{n as no,t as ro}from"./use-hotkeys-C0d5t4yo.js";import{useIdle as io}from"./hooks/use-idle.js";import{useInterval as ao}from"./hooks/use-interval.js";import{useLocalStorage as oo}from"./hooks/use-local-storage.js";export{n as Accordion,r as AccordionContent,i as AccordionItem,a as AccordionTrigger,o as Alert,s as AlertAction,c as AlertDescription,h as AlertDialog,g as AlertDialogAction,_ as AlertDialogCancel,v as AlertDialogContent,y as AlertDialogDescription,b as AlertDialogFooter,x as AlertDialogHeader,S as AlertDialogMedia,C as AlertDialogOverlay,w as AlertDialogPortal,T as AlertDialogTitle,E as AlertDialogTrigger,l as AlertTitle,D as Anchor,R as AreaChart,z as Avatar,B as AvatarBadge,V as AvatarFallback,H as AvatarGroup,U as AvatarGroupCount,W as AvatarImage,K as Badge,J as BarChart,Y as Breadcrumb,X as BreadcrumbEllipsis,Z as BreadcrumbItem,Q as BreadcrumbLink,$ as BreadcrumbList,ee as BreadcrumbPage,te as BreadcrumbSeparator,p as Button,re as ButtonGroup,ie as ButtonGroupSeparator,ae as ButtonGroupText,k as CHART_COLOR_KEYS,se as Calendar,ce as CalendarDayButton,ue as Card,de as CardAction,fe as CardContent,pe as CardDescription,me as CardFooter,he as CardHeader,ge as CardTitle,_e as Carousel,ve as CarouselContent,ye as CarouselIndicators,be as CarouselItem,xe as CarouselNext,Se as CarouselPrevious,we as Center,A as ChartContainer,j as ChartLegend,M as ChartLegendContent,N as ChartStyle,P as ChartTooltip,F as ChartTooltipContent,Be as Checkbox,Ve as Code,He as Collapsible,Ue as CollapsibleContent,We as CollapsibleTrigger,$e as Combobox,et as ComboboxChip,tt as ComboboxChips,nt as ComboboxChipsInput,rt as ComboboxClear,it as ComboboxCollection,at as ComboboxContent,ot as ComboboxEmpty,st as ComboboxGroup,ct as ComboboxInput,lt as ComboboxItem,ut as ComboboxLabel,dt as ComboboxList,ft as ComboboxSeparator,pt as ComboboxTrigger,mt as ComboboxValue,Dt as Command,Ot as CommandDialog,kt as CommandEmpty,At as CommandGroup,jt as CommandInput,Mt as CommandItem,Nt as CommandList,Pt as CommandSeparator,Ft as CommandShortcut,It as Container,I as DEFAULT_CHART_PALETTE,bn as DataTable,xn as DataTableBody,Sn as DataTableColumnHeader,Cn as DataTableHeader,wn as DataTablePagination,Tn as DataTableRoot,En as DataTableToolbar,Dn as DataTableViewOptions,zn as DateRangePicker,Bn as DateRangePickerActions,Vn as DateRangePickerApply,Hn as DateRangePickerCalendar,Un as DateRangePickerContent,Wn as DateRangePickerDateFields,Gn as DateRangePickerPreset,Kn as DateRangePickerPresets,qn as DateRangePickerReset,Jn as DateRangePickerTrigger,Yn as DateRangePickerValue,gt as Dialog,_t as DialogBody,vt as DialogClose,yt as DialogContent,bt as DialogDescription,xt as DialogFooter,St as DialogHeader,Ct as DialogOverlay,wt as DialogPortal,Tt as DialogTitle,Et as DialogTrigger,$n as DonutChart,er as Drawer,tr as DrawerBody,nr as DrawerClose,rr as DrawerContent,ir as DrawerDescription,ar as DrawerFooter,or as DrawerHeader,sr as DrawerOverlay,cr as DrawerPortal,lr as DrawerTitle,ur as DrawerTrigger,Rt as DropdownMenu,zt as DropdownMenuCheckboxItem,Bt as DropdownMenuContent,Vt as DropdownMenuGroup,Ht as DropdownMenuItem,Ut as DropdownMenuLabel,Wt as DropdownMenuPortal,Gt as DropdownMenuRadioGroup,Kt as DropdownMenuRadioItem,qt as DropdownMenuSeparator,Jt as DropdownMenuShortcut,Yt as DropdownMenuSub,Xt as DropdownMenuSubContent,Zt as DropdownMenuSubTrigger,Qt as DropdownMenuTrigger,pr as Dropzone,mr as DropzoneArea,hr as DropzoneDescription,gr as DropzoneFileList,_r as DropzoneFileListItem,vr as DropzoneFileMessage,yr as DropzoneMessage,br as DropzoneRemoveFile,xr as DropzoneRetryFile,Sr as DropzoneTrigger,Er as Empty,Dr as EmptyContent,Or as EmptyDescription,kr as EmptyHeader,Ar as EmptyMedia,jr as EmptyTitle,Cr as ErrorCode,ke as Field,Ae as FieldContent,je as FieldDescription,Me as FieldError,Ne as FieldGroup,Pe as FieldLabel,Fe as FieldLegend,Ie as FieldSeparator,Le as FieldSet,Re as FieldTitle,Mr as Flex,Pr as Grid,Fr as GridItem,Ir as Group,Rr as Heading,Za as HiddenFrom,Br as HoverCard,Vr as HoverCardContent,Hr as HoverCardTrigger,wr as InfiniteProgress,Ge as Input,qe as InputGroup,Je as InputGroupAddon,Ye as InputGroupButton,Xe as InputGroupInput,Ze as InputGroupText,Qe as InputGroupTextarea,Ur as InputOTP,Wr as InputOTPGroup,Gr as InputOTPSeparator,Kr as InputOTPSlot,Xr as Kbd,Zr as KbdGroup,Oe as Label,Qr as List,$r as ListIcon,ei as ListItem,ni as Marker,ri as MarkerContent,ii as MarkerIcon,si as MaskInput,Aa as ModeToggle,ci as NativeSelect,li as NativeSelectOptGroup,ui as NativeSelectOption,di as NavigationMenu,fi as NavigationMenuContent,pi as NavigationMenuIndicator,mi as NavigationMenuItem,hi as NavigationMenuLink,gi as NavigationMenuList,_i as NavigationMenuTrigger,vi as NavigationMenuViewport,bi as Pagination,xi as PaginationContent,Si as PaginationEllipsis,Ci as PaginationItem,wi as PaginationLink,Ti as PaginationNext,Ei as PaginationPrevious,Xn as PieChart,Zn as PieChartBase,Mn as Popover,Nn as PopoverAnchor,Pn as PopoverContent,Fn as PopoverDescription,In as PopoverHeader,Ln as PopoverTitle,Rn as PopoverTrigger,Oi as Progress,qr as REGEXP_ONLY_CHARS,Jr as REGEXP_ONLY_DIGITS,Yr as REGEXP_ONLY_DIGITS_AND_CHARS,Ai as RadioGroup,ji as RadioGroupItem,Mi as ResizableHandle,Ni as ResizablePanel,Pi as ResizablePanelGroup,Fi as RingProgress,Li as ScrollArea,Ri as ScrollBar,$t as Select,en as SelectContent,tn as SelectGroup,nn as SelectItem,rn as SelectLabel,an as SelectScrollDownButton,on as SelectScrollUpButton,sn as SelectSeparator,cn as SelectTrigger,ln as SelectValue,ne as Separator,Ki as Sidebar,qi as SidebarContent,Ji as SidebarFooter,Yi as SidebarGroup,Xi as SidebarGroupAction,Zi as SidebarGroupContent,Qi as SidebarGroupLabel,$i as SidebarHeader,ea as SidebarInput,ta as SidebarInset,na as SidebarMenu,ra as SidebarMenuAction,ia as SidebarMenuBadge,aa as SidebarMenuButton,oa as SidebarMenuItem,sa as SidebarMenuSkeleton,ca as SidebarMenuSub,la as SidebarMenuSubButton,ua as SidebarMenuSubItem,da as SidebarProvider,fa as SidebarRail,pa as SidebarSeparator,ma as SidebarTrigger,ga as SimpleGrid,Bi as Skeleton,_a as Slider,d as Spinner,ba as Stack,Sa as Switch,un as Table,dn as TableBody,fn as TableCaption,pn as TableCell,mn as TableContainer,hn as TableFooter,gn as TableHead,_n as TableHeader,vn as TableRow,Ca as Tabs,wa as TabsContent,Ta as TabsList,Ea as TabsTrigger,Oa as Text,Ke as Textarea,ja as ThemeProvider,Na as Timeline,Pa as TimelineConnector,Fa as TimelineContent,Ia as TimelineDescription,La as TimelineEmpty,Ra as TimelineHeader,za as TimelineIcon,Ba as TimelineItem,Va as TimelineTime,Ha as TimelineTitle,va as Toaster,Wa as Toggle,Ka as ToggleGroup,qa as ToggleGroupItem,Vi as Tooltip,Hi as TooltipContent,Ui as TooltipProvider,Wi as TooltipRoot,Gi as TooltipTrigger,Ja as UnstyledButton,Qa as VisibleFrom,O as anchorVariants,G as badgeColorVariants,q as badgeVariants,Ya as breakpointValues,Qn as buildPieConfig,u as buttonColorVariants,oe as buttonGroupVariants,m as buttonVariants,Te as centerVariants,e as cn,dr as composeRefs,Lt as containerVariants,On as createDataTableSelectColumn,kn as defaultDataTableLabels,Nr as flexVariants,no as getHotkeyHandler,Lr as groupVariants,zr as headingVariants,ti as listVariants,le as locale,ai as markerVariants,yi as navigationMenuTriggerStyle,Di as progressColorVariants,ki as progressVariants,t as randomId,L as resolveChartColor,Ii as ringProgressVariants,Ee as selectionControlColorVariants,fr as setRef,f as spinnerVariants,xa as stackVariants,yn as tableVariants,Da as tabsListVariants,ka as textVariants,Ua as timelineVariants,ya as toast,Ga as toggleVariants,De as uiColors,Xa as useBreakpoint,$a as useBreakpointValue,Ce as useCarousel,ht as useComboboxAnchor,An as useDataTable,jn as useDataTableContext,eo as useDisclosure,to as useDocumentVisibility,Tr as useDropzone,ze as useFieldControlId,ro as useHotkeys,io as useIdle,ao as useInterval,zi as useIsMobile,oo as useLocalStorage,oi as useMask,ha as useSidebar,Ma as useTheme};
1
+ import{cn as e,randomId as t}from"./lib/utils.js";import{Accordion as n,AccordionContent as r,AccordionItem as i,AccordionTrigger as a}from"./components/accordion.js";import{Alert as o,AlertAction as s,AlertDescription as c,AlertTitle as l}from"./components/alert.js";import{buttonColorVariants as u}from"./lib/button.js";import{Spinner as d,spinnerVariants as f}from"./components/spinner.js";import{Button as p,buttonVariants as m}from"./components/button.js";import{AlertDialog as h,AlertDialogAction as g,AlertDialogCancel as _,AlertDialogContent as v,AlertDialogDescription as y,AlertDialogFooter as b,AlertDialogHeader as x,AlertDialogMedia as S,AlertDialogOverlay as C,AlertDialogPortal as w,AlertDialogTitle as T,AlertDialogTrigger as E}from"./components/alert-dialog.js";import{Anchor as D,anchorVariants as O}from"./components/anchor.js";import{CHART_COLOR_KEYS as k,ChartContainer as A,ChartLegend as j,ChartLegendContent as M,ChartStyle as N,ChartTooltip as P,ChartTooltipContent as F,DEFAULT_CHART_PALETTE as I,resolveChartColor as L}from"./components/chart.js";import{AreaChart as R}from"./components/area-chart.js";import{Avatar as z,AvatarBadge as B,AvatarFallback as V,AvatarGroup as H,AvatarGroupCount as U,AvatarImage as W}from"./components/avatar.js";import{badgeColorVariants as G}from"./lib/badge.js";import{Badge as K,badgeVariants as q}from"./components/badge.js";import{BarChart as J}from"./components/bar-chart.js";import{Breadcrumb as Y,BreadcrumbEllipsis as X,BreadcrumbItem as Z,BreadcrumbLink as Q,BreadcrumbList as $,BreadcrumbPage as ee,BreadcrumbSeparator as te}from"./components/breadcrumb.js";import{Separator as ne}from"./components/separator.js";import{ButtonGroup as re,ButtonGroupSeparator as ie,ButtonGroupText as ae,buttonGroupVariants as oe}from"./components/button-group.js";import{Calendar as se,CalendarDayButton as ce,locale as le}from"./components/calendar.js";import{Card as ue,CardAction as de,CardContent as fe,CardDescription as pe,CardFooter as me,CardHeader as he,CardTitle as ge}from"./components/card.js";import{Carousel as _e,CarouselContent as ve,CarouselIndicators as ye,CarouselItem as be,CarouselNext as xe,CarouselPrevious as Se,useCarousel as Ce}from"./components/carousel.js";import{Center as we,centerVariants as Te}from"./components/center.js";import{selectionControlColorVariants as Ee,uiColors as De}from"./lib/color.js";import{Label as Oe}from"./components/label.js";import{Field as ke,FieldContent as Ae,FieldDescription as je,FieldError as Me,FieldGroup as Ne,FieldLabel as Pe,FieldLegend as Fe,FieldSeparator as Ie,FieldSet as Le,FieldTitle as Re,useFieldControlId as ze}from"./components/field.js";import{Checkbox as Be}from"./components/checkbox.js";import{Code as Ve}from"./components/code.js";import{Collapsible as He,CollapsibleContent as Ue,CollapsibleTrigger as We}from"./components/collapsible.js";import{Input as Ge}from"./components/input.js";import{Textarea as Ke}from"./components/textarea.js";import{InputGroup as qe,InputGroupAddon as Je,InputGroupButton as Ye,InputGroupInput as Xe,InputGroupText as Ze,InputGroupTextarea as Qe}from"./components/input-group.js";import{Combobox as $e,ComboboxChip as et,ComboboxChips as tt,ComboboxChipsInput as nt,ComboboxClear as rt,ComboboxCollection as it,ComboboxContent as at,ComboboxEmpty as ot,ComboboxGroup as st,ComboboxInput as ct,ComboboxItem as lt,ComboboxLabel as ut,ComboboxList as dt,ComboboxSeparator as ft,ComboboxTrigger as pt,ComboboxValue as mt,useComboboxAnchor as ht}from"./components/combobox.js";import{Dialog as gt,DialogBody as _t,DialogClose as vt,DialogContent as yt,DialogDescription as bt,DialogFooter as xt,DialogHeader as St,DialogOverlay as Ct,DialogPortal as wt,DialogTitle as Tt,DialogTrigger as Et}from"./components/dialog.js";import{Command as Dt,CommandDialog as Ot,CommandEmpty as kt,CommandGroup as At,CommandInput as jt,CommandItem as Mt,CommandList as Nt,CommandSeparator as Pt,CommandShortcut as Ft}from"./components/command.js";import{Container as It,containerVariants as Lt}from"./components/container.js";import{DropdownMenu as Rt,DropdownMenuCheckboxItem as zt,DropdownMenuContent as Bt,DropdownMenuGroup as Vt,DropdownMenuItem as Ht,DropdownMenuLabel as Ut,DropdownMenuPortal as Wt,DropdownMenuRadioGroup as Gt,DropdownMenuRadioItem as Kt,DropdownMenuSeparator as qt,DropdownMenuShortcut as Jt,DropdownMenuSub as Yt,DropdownMenuSubContent as Xt,DropdownMenuSubTrigger as Zt,DropdownMenuTrigger as Qt}from"./components/dropdown-menu.js";import{Select as $t,SelectContent as en,SelectGroup as tn,SelectItem as nn,SelectLabel as rn,SelectScrollDownButton as an,SelectScrollUpButton as on,SelectSeparator as sn,SelectTrigger as cn,SelectValue as ln}from"./components/select.js";import{Table as un,TableBody as dn,TableCaption as fn,TableCell as pn,TableContainer as mn,TableFooter as hn,TableHead as gn,TableHeader as _n,TableRow as vn,tableVariants as yn}from"./components/table.js";import{DataTable as bn,DataTableBody as xn,DataTableColumnHeader as Sn,DataTableHeader as Cn,DataTablePagination as wn,DataTableRoot as Tn,DataTableToolbar as En,DataTableViewOptions as Dn,createDataTableSelectColumn as On,defaultDataTableLabels as kn,useDataTable as An,useDataTableContext as jn}from"./components/data-table.js";import{Popover as Mn,PopoverAnchor as Nn,PopoverContent as Pn,PopoverDescription as Fn,PopoverHeader as In,PopoverTitle as Ln,PopoverTrigger as Rn}from"./components/popover.js";import{DateRangePicker as zn,DateRangePickerActions as Bn,DateRangePickerApply as Vn,DateRangePickerCalendar as Hn,DateRangePickerContent as Un,DateRangePickerDateFields as Wn,DateRangePickerPreset as Gn,DateRangePickerPresets as Kn,DateRangePickerReset as qn,DateRangePickerTrigger as Jn,DateRangePickerValue as Yn}from"./components/date-range-picker.js";import{PieChart as Xn,PieChartBase as Zn,buildPieConfig as Qn}from"./components/pie-chart.js";import{DonutChart as $n}from"./components/donut-chart.js";import{Drawer as er,DrawerBody as tr,DrawerClose as nr,DrawerContent as rr,DrawerDescription as ir,DrawerFooter as ar,DrawerHeader as or,DrawerOverlay as sr,DrawerPortal as cr,DrawerTitle as lr,DrawerTrigger as ur}from"./components/drawer.js";import{composeRefs as dr,setRef as fr}from"./lib/compose-refs.js";import{Dropzone as pr,DropzoneArea as mr,DropzoneDescription as hr,DropzoneFileList as gr,DropzoneFileListItem as _r,DropzoneFileMessage as vr,DropzoneMessage as yr,DropzoneRemoveFile as br,DropzoneRetryFile as xr,DropzoneTrigger as Sr,ErrorCode as Cr,InfiniteProgress as wr,useDropzone as Tr}from"./components/dropzone.js";import{Empty as Er,EmptyContent as Dr,EmptyDescription as Or,EmptyHeader as kr,EmptyMedia as Ar,EmptyTitle as jr}from"./components/empty.js";import{Flex as Mr,flexVariants as Nr}from"./components/flex.js";import{Grid as Pr,GridItem as Fr}from"./components/grid.js";import{Group as Ir,groupVariants as Lr}from"./components/group.js";import{Heading as Rr,headingVariants as zr}from"./components/heading.js";import{HoverCard as Br,HoverCardContent as Vr,HoverCardTrigger as Hr}from"./components/hover-card.js";import{InputOTP as Ur,InputOTPGroup as Wr,InputOTPSeparator as Gr,InputOTPSlot as Kr,REGEXP_ONLY_CHARS as qr,REGEXP_ONLY_DIGITS as Jr,REGEXP_ONLY_DIGITS_AND_CHARS as Yr}from"./components/input-otp.js";import{Kbd as Xr,KbdGroup as Zr}from"./components/kbd.js";import{List as Qr,ListIcon as $r,ListItem as ei,listVariants as ti}from"./components/list.js";import{Marker as ni,MarkerContent as ri,MarkerIcon as ii,markerVariants as ai}from"./components/marker.js";import{useMask as oi}from"./hooks/use-mask.js";import{MaskInput as si}from"./components/mask-input.js";import{NativeSelect as ci,NativeSelectOptGroup as li,NativeSelectOption as ui}from"./components/native-select.js";import{NavigationMenu as di,NavigationMenuContent as fi,NavigationMenuIndicator as pi,NavigationMenuItem as mi,NavigationMenuLink as hi,NavigationMenuList as gi,NavigationMenuTrigger as _i,NavigationMenuViewport as vi,navigationMenuTriggerStyle as yi}from"./components/navigation-menu.js";import{NumberField as bi,NumberFieldDecrement as xi,NumberFieldGroup as Si,NumberFieldIncrement as Ci,NumberFieldInput as wi,NumberFieldScrubArea as Ti}from"./components/number-field.js";import{Pagination as Ei,PaginationContent as Di,PaginationEllipsis as Oi,PaginationItem as ki,PaginationLink as Ai,PaginationNext as ji,PaginationPrevious as Mi}from"./components/pagination.js";import{ScrollArea as Ni,ScrollBar as Pi}from"./components/scroll-area.js";import{PhoneInput as Fi}from"./components/phone-input.js";import{progressColorVariants as Ii}from"./lib/progress.js";import{Progress as Li,progressVariants as Ri}from"./components/progress.js";import{RadioGroup as zi,RadioGroupItem as Bi}from"./components/radio-group.js";import{ResizableHandle as Vi,ResizablePanel as Hi,ResizablePanelGroup as Ui}from"./components/resizable.js";import{RingProgress as Wi,ringProgressVariants as Gi}from"./components/ring-progress.js";import{useIsMobile as Ki}from"./hooks/use-mobile.js";import{Skeleton as qi}from"./components/skeleton.js";import{Tooltip as Ji,TooltipContent as Yi,TooltipProvider as Xi,TooltipRoot as Zi,TooltipTrigger as Qi}from"./components/tooltip.js";import{Sidebar as $i,SidebarContent as ea,SidebarFooter as ta,SidebarGroup as na,SidebarGroupAction as ra,SidebarGroupContent as ia,SidebarGroupLabel as aa,SidebarHeader as oa,SidebarInput as sa,SidebarInset as ca,SidebarMenu as la,SidebarMenuAction as ua,SidebarMenuBadge as da,SidebarMenuButton as fa,SidebarMenuItem as pa,SidebarMenuSkeleton as ma,SidebarMenuSub as ha,SidebarMenuSubButton as ga,SidebarMenuSubItem as _a,SidebarProvider as va,SidebarRail as ya,SidebarSeparator as ba,SidebarTrigger as xa,useSidebar as Sa}from"./components/sidebar.js";import{SimpleGrid as Ca}from"./components/simple-grid.js";import{Slider as wa}from"./components/slider.js";import{Toaster as Ta,toast as Ea}from"./components/sonner.js";import{Stack as Da,stackVariants as Oa}from"./components/stack.js";import{Stepper as ka,StepperContent as Aa,StepperDescription as ja,StepperIndicator as Ma,StepperItem as Na,StepperNav as Pa,StepperPanel as Fa,StepperSeparator as Ia,StepperTitle as La,StepperTrigger as Ra,useStepItem as za,useStepper as Ba}from"./components/stepper.js";import{Switch as Va}from"./components/switch.js";import{Tabs as Ha,TabsContent as Ua,TabsList as Wa,TabsTrigger as Ga,tabsListVariants as Ka}from"./components/tabs.js";import{Text as qa,textVariants as Ja}from"./components/text.js";import{ModeToggle as Ya,ThemeProvider as Xa,useTheme as Za}from"./components/theme.js";import{Timeline as Qa,TimelineConnector as $a,TimelineContent as eo,TimelineDescription as to,TimelineEmpty as no,TimelineHeader as ro,TimelineIcon as io,TimelineItem as ao,TimelineTime as oo,TimelineTitle as so,timelineVariants as co}from"./components/timeline.js";import{Toggle as lo,toggleVariants as uo}from"./components/toggle.js";import{ToggleGroup as fo,ToggleGroupItem as po}from"./components/toggle-group.js";import{UnstyledButton as mo}from"./components/unstyled-button.js";import{breakpointValues as ho,useBreakpoint as go}from"./hooks/use-breakpoint.js";import{HiddenFrom as _o,VisibleFrom as vo}from"./components/visibility.js";import{useBreakpointValue as yo}from"./hooks/use-breakpoint-value.js";import{useDisclosure as bo}from"./hooks/use-disclosure.js";import{useDocumentVisibility as xo}from"./hooks/use-document-visibility.js";import{n as So,t as Co}from"./use-hotkeys-C0d5t4yo.js";import{useIdle as wo}from"./hooks/use-idle.js";import{useInterval as To}from"./hooks/use-interval.js";import{useLocalStorage as Eo}from"./hooks/use-local-storage.js";export{n as Accordion,r as AccordionContent,i as AccordionItem,a as AccordionTrigger,o as Alert,s as AlertAction,c as AlertDescription,h as AlertDialog,g as AlertDialogAction,_ as AlertDialogCancel,v as AlertDialogContent,y as AlertDialogDescription,b as AlertDialogFooter,x as AlertDialogHeader,S as AlertDialogMedia,C as AlertDialogOverlay,w as AlertDialogPortal,T as AlertDialogTitle,E as AlertDialogTrigger,l as AlertTitle,D as Anchor,R as AreaChart,z as Avatar,B as AvatarBadge,V as AvatarFallback,H as AvatarGroup,U as AvatarGroupCount,W as AvatarImage,K as Badge,J as BarChart,Y as Breadcrumb,X as BreadcrumbEllipsis,Z as BreadcrumbItem,Q as BreadcrumbLink,$ as BreadcrumbList,ee as BreadcrumbPage,te as BreadcrumbSeparator,p as Button,re as ButtonGroup,ie as ButtonGroupSeparator,ae as ButtonGroupText,k as CHART_COLOR_KEYS,se as Calendar,ce as CalendarDayButton,ue as Card,de as CardAction,fe as CardContent,pe as CardDescription,me as CardFooter,he as CardHeader,ge as CardTitle,_e as Carousel,ve as CarouselContent,ye as CarouselIndicators,be as CarouselItem,xe as CarouselNext,Se as CarouselPrevious,we as Center,A as ChartContainer,j as ChartLegend,M as ChartLegendContent,N as ChartStyle,P as ChartTooltip,F as ChartTooltipContent,Be as Checkbox,Ve as Code,He as Collapsible,Ue as CollapsibleContent,We as CollapsibleTrigger,$e as Combobox,et as ComboboxChip,tt as ComboboxChips,nt as ComboboxChipsInput,rt as ComboboxClear,it as ComboboxCollection,at as ComboboxContent,ot as ComboboxEmpty,st as ComboboxGroup,ct as ComboboxInput,lt as ComboboxItem,ut as ComboboxLabel,dt as ComboboxList,ft as ComboboxSeparator,pt as ComboboxTrigger,mt as ComboboxValue,Dt as Command,Ot as CommandDialog,kt as CommandEmpty,At as CommandGroup,jt as CommandInput,Mt as CommandItem,Nt as CommandList,Pt as CommandSeparator,Ft as CommandShortcut,It as Container,I as DEFAULT_CHART_PALETTE,bn as DataTable,xn as DataTableBody,Sn as DataTableColumnHeader,Cn as DataTableHeader,wn as DataTablePagination,Tn as DataTableRoot,En as DataTableToolbar,Dn as DataTableViewOptions,zn as DateRangePicker,Bn as DateRangePickerActions,Vn as DateRangePickerApply,Hn as DateRangePickerCalendar,Un as DateRangePickerContent,Wn as DateRangePickerDateFields,Gn as DateRangePickerPreset,Kn as DateRangePickerPresets,qn as DateRangePickerReset,Jn as DateRangePickerTrigger,Yn as DateRangePickerValue,gt as Dialog,_t as DialogBody,vt as DialogClose,yt as DialogContent,bt as DialogDescription,xt as DialogFooter,St as DialogHeader,Ct as DialogOverlay,wt as DialogPortal,Tt as DialogTitle,Et as DialogTrigger,$n as DonutChart,er as Drawer,tr as DrawerBody,nr as DrawerClose,rr as DrawerContent,ir as DrawerDescription,ar as DrawerFooter,or as DrawerHeader,sr as DrawerOverlay,cr as DrawerPortal,lr as DrawerTitle,ur as DrawerTrigger,Rt as DropdownMenu,zt as DropdownMenuCheckboxItem,Bt as DropdownMenuContent,Vt as DropdownMenuGroup,Ht as DropdownMenuItem,Ut as DropdownMenuLabel,Wt as DropdownMenuPortal,Gt as DropdownMenuRadioGroup,Kt as DropdownMenuRadioItem,qt as DropdownMenuSeparator,Jt as DropdownMenuShortcut,Yt as DropdownMenuSub,Xt as DropdownMenuSubContent,Zt as DropdownMenuSubTrigger,Qt as DropdownMenuTrigger,pr as Dropzone,mr as DropzoneArea,hr as DropzoneDescription,gr as DropzoneFileList,_r as DropzoneFileListItem,vr as DropzoneFileMessage,yr as DropzoneMessage,br as DropzoneRemoveFile,xr as DropzoneRetryFile,Sr as DropzoneTrigger,Er as Empty,Dr as EmptyContent,Or as EmptyDescription,kr as EmptyHeader,Ar as EmptyMedia,jr as EmptyTitle,Cr as ErrorCode,ke as Field,Ae as FieldContent,je as FieldDescription,Me as FieldError,Ne as FieldGroup,Pe as FieldLabel,Fe as FieldLegend,Ie as FieldSeparator,Le as FieldSet,Re as FieldTitle,Mr as Flex,Pr as Grid,Fr as GridItem,Ir as Group,Rr as Heading,_o as HiddenFrom,Br as HoverCard,Vr as HoverCardContent,Hr as HoverCardTrigger,wr as InfiniteProgress,Ge as Input,qe as InputGroup,Je as InputGroupAddon,Ye as InputGroupButton,Xe as InputGroupInput,Ze as InputGroupText,Qe as InputGroupTextarea,Ur as InputOTP,Wr as InputOTPGroup,Gr as InputOTPSeparator,Kr as InputOTPSlot,Xr as Kbd,Zr as KbdGroup,Oe as Label,Qr as List,$r as ListIcon,ei as ListItem,ni as Marker,ri as MarkerContent,ii as MarkerIcon,si as MaskInput,Ya as ModeToggle,ci as NativeSelect,li as NativeSelectOptGroup,ui as NativeSelectOption,di as NavigationMenu,fi as NavigationMenuContent,pi as NavigationMenuIndicator,mi as NavigationMenuItem,hi as NavigationMenuLink,gi as NavigationMenuList,_i as NavigationMenuTrigger,vi as NavigationMenuViewport,bi as NumberField,xi as NumberFieldDecrement,Si as NumberFieldGroup,Ci as NumberFieldIncrement,wi as NumberFieldInput,Ti as NumberFieldScrubArea,Ei as Pagination,Di as PaginationContent,Oi as PaginationEllipsis,ki as PaginationItem,Ai as PaginationLink,ji as PaginationNext,Mi as PaginationPrevious,Fi as PhoneInput,Xn as PieChart,Zn as PieChartBase,Mn as Popover,Nn as PopoverAnchor,Pn as PopoverContent,Fn as PopoverDescription,In as PopoverHeader,Ln as PopoverTitle,Rn as PopoverTrigger,Li as Progress,qr as REGEXP_ONLY_CHARS,Jr as REGEXP_ONLY_DIGITS,Yr as REGEXP_ONLY_DIGITS_AND_CHARS,zi as RadioGroup,Bi as RadioGroupItem,Vi as ResizableHandle,Hi as ResizablePanel,Ui as ResizablePanelGroup,Wi as RingProgress,Ni as ScrollArea,Pi as ScrollBar,$t as Select,en as SelectContent,tn as SelectGroup,nn as SelectItem,rn as SelectLabel,an as SelectScrollDownButton,on as SelectScrollUpButton,sn as SelectSeparator,cn as SelectTrigger,ln as SelectValue,ne as Separator,$i as Sidebar,ea as SidebarContent,ta as SidebarFooter,na as SidebarGroup,ra as SidebarGroupAction,ia as SidebarGroupContent,aa as SidebarGroupLabel,oa as SidebarHeader,sa as SidebarInput,ca as SidebarInset,la as SidebarMenu,ua as SidebarMenuAction,da as SidebarMenuBadge,fa as SidebarMenuButton,pa as SidebarMenuItem,ma as SidebarMenuSkeleton,ha as SidebarMenuSub,ga as SidebarMenuSubButton,_a as SidebarMenuSubItem,va as SidebarProvider,ya as SidebarRail,ba as SidebarSeparator,xa as SidebarTrigger,Ca as SimpleGrid,qi as Skeleton,wa as Slider,d as Spinner,Da as Stack,ka as Stepper,Aa as StepperContent,ja as StepperDescription,Ma as StepperIndicator,Na as StepperItem,Pa as StepperNav,Fa as StepperPanel,Ia as StepperSeparator,La as StepperTitle,Ra as StepperTrigger,Va as Switch,un as Table,dn as TableBody,fn as TableCaption,pn as TableCell,mn as TableContainer,hn as TableFooter,gn as TableHead,_n as TableHeader,vn as TableRow,Ha as Tabs,Ua as TabsContent,Wa as TabsList,Ga as TabsTrigger,qa as Text,Ke as Textarea,Xa as ThemeProvider,Qa as Timeline,$a as TimelineConnector,eo as TimelineContent,to as TimelineDescription,no as TimelineEmpty,ro as TimelineHeader,io as TimelineIcon,ao as TimelineItem,oo as TimelineTime,so as TimelineTitle,Ta as Toaster,lo as Toggle,fo as ToggleGroup,po as ToggleGroupItem,Ji as Tooltip,Yi as TooltipContent,Xi as TooltipProvider,Zi as TooltipRoot,Qi as TooltipTrigger,mo as UnstyledButton,vo as VisibleFrom,O as anchorVariants,G as badgeColorVariants,q as badgeVariants,ho as breakpointValues,Qn as buildPieConfig,u as buttonColorVariants,oe as buttonGroupVariants,m as buttonVariants,Te as centerVariants,e as cn,dr as composeRefs,Lt as containerVariants,On as createDataTableSelectColumn,kn as defaultDataTableLabels,Nr as flexVariants,So as getHotkeyHandler,Lr as groupVariants,zr as headingVariants,ti as listVariants,le as locale,ai as markerVariants,yi as navigationMenuTriggerStyle,Ii as progressColorVariants,Ri as progressVariants,t as randomId,L as resolveChartColor,Gi as ringProgressVariants,Ee as selectionControlColorVariants,fr as setRef,f as spinnerVariants,Oa as stackVariants,yn as tableVariants,Ka as tabsListVariants,Ja as textVariants,co as timelineVariants,Ea as toast,uo as toggleVariants,De as uiColors,go as useBreakpoint,yo as useBreakpointValue,Ce as useCarousel,ht as useComboboxAnchor,An as useDataTable,jn as useDataTableContext,bo as useDisclosure,xo as useDocumentVisibility,Tr as useDropzone,ze as useFieldControlId,Co as useHotkeys,wo as useIdle,To as useInterval,Ki as useIsMobile,Eo as useLocalStorage,oi as useMask,Sa as useSidebar,za as useStepItem,Ba as useStepper,Za as useTheme};
@@ -46,10 +46,12 @@ To set up a consumer project after installing `@uselets/ui`, run `bun uselets in
46
46
  - Prefer barrel imports for common app usage and readability.
47
47
  - Use module subpaths when you want a single module or when the user asks for the exact import path.
48
48
  - Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths, not legacy `@uselets/ui/use-*` paths.
49
- - Recommend importing Tailwind, one theme stylesheet, and Inter once in the app global CSS. Use `@uselets/ui/themes/max.css` for Max apps or `@uselets/ui/themes/gomax.css` for Gomax apps.
49
+ - Recommend importing Tailwind and one theme stylesheet once in the app global CSS. Use `@uselets/ui/themes/max.css` for Max apps or `@uselets/ui/themes/gomax.css` for Gomax apps.
50
50
  - Recommend `@source '../node_modules/@uselets/ui/dist';` when Tailwind needs to generate classes used by installed `@uselets/ui` components.
51
51
  - Treat `@uselets/ui/themes/gomax.css` as the GoMax Figma-backed palette, exposed through the same public color families as the Max theme.
52
- - Recommend `@fontsource-variable/inter` when matching the package typography setup.
52
+ - Recommend `@fontsource-variable/inter` when matching the package typography setup. Import it once from the
53
+ app's entry file (`import '@fontsource-variable/inter'` in `app/layout.tsx`, `pages/_app.tsx`, or `src/main.tsx`),
54
+ not via `@import` in CSS — some bundlers, including Next.js, don't resolve third-party CSS `@import`s reliably.
53
55
  - Recommend `@uselets/ui/postcss.config` when the app needs the package PostCSS preset for Tailwind v4.
54
56
  - For tooltip-heavy apps, wrap the app with `TooltipProvider`; use `Tooltip label={...}` for common trigger/content usage and `TooltipRoot` only when manual composition is needed.
55
57
  - Use `UnstyledButton` when button semantics are needed without `Button` variants; it provides reset styles, pointer cursor, focus ring, default `type="button"`, and `asChild`.
@@ -154,7 +154,13 @@ Unless noted otherwise, each module also exports its public `*Props` types from
154
154
  - Exports: `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS`
155
155
  - `mask-input`
156
156
  - Exports: `MaskInput`
157
- - Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `9` (digit), `a` (letter), `*` (any). Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual. Forwards a `ref` prop to the underlying `<input>`, composed with the internal mask ref via `composeRefs`.
157
+ - Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `_` (digit), `#` (letter), `*` (any) — picked so the token is never a character the user actually types. When no custom `replacement` is passed, `mask` strings using the older `9`/`a` tokens are transparently translated to `_`/`#`, so existing masks keep working. Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual. Forwards a `ref` prop to the underlying `<input>`, composed with the internal mask ref via `composeRefs`.
158
+ - `number-field`
159
+ - Exports: `NumberField`, `NumberFieldGroup`, `NumberFieldDecrement`, `NumberFieldIncrement`, `NumberFieldInput`, `NumberFieldScrubArea`
160
+ - Notes: Base UI-backed numeric stepper input. `NumberField.size: 'sm' | 'md' | 'lg'` (default `md`); supports `min`, `max`, `step`, and other Base UI `NumberField.Root` props. `NumberFieldScrubArea` requires a `label` and renders a draggable handle that scrubs the value on pointer drag.
161
+ - `phone-input`
162
+ - Exports: `PhoneInput`
163
+ - Notes: international phone input built on `react-phone-number-input`, composed from the existing `Input` and `Combobox` (country select, with flags); matches `Input`'s styling and single size (no `variant`/size prop). `value` / `onChange` use the E.164 `Value` string from `react-phone-number-input`; `defaultCountry` defaults to `BR`.
158
164
  - `checkbox`
159
165
  - Exports: `Checkbox`
160
166
  - Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `primary`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows checkbox size (`sm` 12px, `md` 14px, `lg` 20px)
@@ -217,6 +223,9 @@ Unless noted otherwise, each module also exports its public `*Props` types from
217
223
  - Exports: `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`
218
224
  - `sidebar`
219
225
  - Exports: `Sidebar`, `SidebarContent`, `SidebarFooter`, `SidebarGroup`, `SidebarGroupAction`, `SidebarGroupContent`, `SidebarGroupLabel`, `SidebarHeader`, `SidebarInput`, `SidebarInset`, `SidebarMenu`, `SidebarMenuAction`, `SidebarMenuBadge`, `SidebarMenuButton`, `SidebarMenuItem`, `SidebarMenuSkeleton`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `useSidebar`
226
+ - `stepper`
227
+ - Exports: `Stepper`, `StepperNav`, `StepperItem`, `StepperTrigger`, `StepperIndicator`, `StepperSeparator`, `StepperTitle`, `StepperDescription`, `StepperPanel`, `StepperContent`, `useStepper`, `useStepItem`
228
+ - Notes: multi-step progress navigation. `Stepper.orientation: 'horizontal' | 'vertical'` (default `horizontal`); supports controlled (`value` / `onValueChange`) and uncontrolled (`defaultValue`) active step, plus custom per-state `indicators` (`active`, `completed`, `inactive`, `loading`). `StepperItem` accepts `completed`, `disabled`, and `loading`. Arrow-key and Home/End keyboard navigation between triggers is built in.
220
229
  - `tabs`
221
230
  - Exports: `Tabs`, `TabsContent`, `TabsList`, `tabsListVariants`, `TabsTrigger`
222
231
  - Notes: `TabsList.variant` supports `line` and `enclosed`, defaults to `line`, accepts `grow?: boolean` for equal-width horizontal tabs, and uses the `primary` color for the active line indicator
@@ -53,12 +53,12 @@ Run the package setup command from the project root to install dependencies, con
53
53
  bun uselets init
54
54
  ```
55
55
 
56
- The command asks for the package theme, defaults the global CSS path to `src/styles/globals.css`, creates that CSS file when missing, preserves an existing `postcss.config.mjs`, and asks whether to install the agent skill.
56
+ The command asks for the package theme, defaults the global CSS path to `src/styles/globals.css`, creates that CSS file when missing, preserves an existing `postcss.config.mjs`, and asks whether to install the agent skill. It also detects a conventional app entry file (`app/layout.tsx`, `pages/_app.tsx`, `src/main.tsx`, `src/index.tsx`, and `.jsx` variants) and inserts `import '@fontsource-variable/inter'` there, or asks for the entry file path when none is found. Use `--entry <path>` to set it explicitly for non-interactive setups.
57
57
 
58
58
  For non-interactive setup, provide explicit options:
59
59
 
60
60
  ```bash
61
- bun uselets init --theme max --css src/styles/globals.css --no-install-skill
61
+ bun uselets init --theme max --css src/styles/globals.css --entry app/layout.tsx --no-install-skill
62
62
  ```
63
63
 
64
64
  ## Agent skill installation
@@ -99,16 +99,22 @@ Use `bun uselets skill --agent codex` or `bun uselets skill --agent claude` to i
99
99
 
100
100
  ## Base setup
101
101
 
102
- Import Tailwind, one package theme, and Inter once in the app global stylesheet:
102
+ Import Tailwind and one package theme once in the app global stylesheet:
103
103
 
104
104
  ```css
105
105
  @import 'tailwindcss';
106
106
  @import '@uselets/ui/themes/max.css';
107
- @import '@fontsource-variable/inter';
108
107
  ```
109
108
 
110
109
  For GoMax apps, import `@uselets/ui/themes/gomax.css` instead.
111
110
 
111
+ Import the Inter font once from the app's entry file, not from CSS (some bundlers, including Next.js, don't resolve third-party CSS `@import`s reliably):
112
+
113
+ ```ts
114
+ // app/layout.tsx (or src/main.tsx, pages/_app.tsx, ...)
115
+ import '@fontsource-variable/inter'
116
+ ```
117
+
112
118
  If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
113
119
 
114
120
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uselets/ui",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "React component library for the LET'S design system.",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@base-ui/react": "1.6.0",
62
- "@fontsource-variable/inter": "5.2.8",
62
+ "@fontsource-variable/inter": "5.3.0",
63
63
  "@react-input/mask": "2.0.4",
64
64
  "@tabler/icons-react": "3.45.0",
65
65
  "@tanstack/react-table": "8.21.3",
@@ -71,12 +71,13 @@
71
71
  "embla-carousel-react": "8.6.0",
72
72
  "input-otp": "1.4.2",
73
73
  "next-themes": "0.4.6",
74
- "radix-ui": "1.6.2",
74
+ "radix-ui": "1.6.7",
75
75
  "react-day-picker": "10.0.1",
76
- "react-dropzone": "17.0.0",
76
+ "react-dropzone": "19.1.1",
77
+ "react-phone-number-input": "3.4.17",
77
78
  "react-resizable-panels": "4.12.2",
78
- "recharts": "3.9.2",
79
- "shadcn": "4.13.1",
79
+ "recharts": "3.10.1",
80
+ "shadcn": "4.16.0",
80
81
  "sonner": "2.0.7",
81
82
  "tailwind-merge": "3.6.0",
82
83
  "tailwind-scrollbar": "4.0.2",
@@ -90,14 +91,14 @@
90
91
  "@bosh-code/tsdown-plugin-tailwindcss": "1.0.1",
91
92
  "@tailwindcss/postcss": "4.3.3",
92
93
  "@testing-library/react": "16.3.2",
93
- "@tsdown/css": "0.22.9",
94
- "@turbo/gen": "2.10.5",
95
- "@types/node": "26.1.1",
94
+ "@tsdown/css": "0.22.14",
95
+ "@turbo/gen": "2.10.7",
96
+ "@types/node": "26.1.2",
96
97
  "@types/react": "19.2.17",
97
98
  "@types/react-dom": "19.2.3",
98
99
  "jsdom": "29.1.1",
99
100
  "tailwindcss": "4.3.3",
100
- "tsdown": "0.22.9",
101
+ "tsdown": "0.22.14",
101
102
  "typescript": "7.0.2",
102
103
  "vitest": "4.1.10"
103
104
  }
@@ -46,10 +46,12 @@ To set up a consumer project after installing `@uselets/ui`, run `bun uselets in
46
46
  - Prefer barrel imports for common app usage and readability.
47
47
  - Use module subpaths when you want a single module or when the user asks for the exact import path.
48
48
  - Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths, not legacy `@uselets/ui/use-*` paths.
49
- - Recommend importing Tailwind, one theme stylesheet, and Inter once in the app global CSS. Use `@uselets/ui/themes/max.css` for Max apps or `@uselets/ui/themes/gomax.css` for Gomax apps.
49
+ - Recommend importing Tailwind and one theme stylesheet once in the app global CSS. Use `@uselets/ui/themes/max.css` for Max apps or `@uselets/ui/themes/gomax.css` for Gomax apps.
50
50
  - Recommend `@source '../node_modules/@uselets/ui/dist';` when Tailwind needs to generate classes used by installed `@uselets/ui` components.
51
51
  - Treat `@uselets/ui/themes/gomax.css` as the GoMax Figma-backed palette, exposed through the same public color families as the Max theme.
52
- - Recommend `@fontsource-variable/inter` when matching the package typography setup.
52
+ - Recommend `@fontsource-variable/inter` when matching the package typography setup. Import it once from the
53
+ app's entry file (`import '@fontsource-variable/inter'` in `app/layout.tsx`, `pages/_app.tsx`, or `src/main.tsx`),
54
+ not via `@import` in CSS — some bundlers, including Next.js, don't resolve third-party CSS `@import`s reliably.
53
55
  - Recommend `@uselets/ui/postcss.config` when the app needs the package PostCSS preset for Tailwind v4.
54
56
  - For tooltip-heavy apps, wrap the app with `TooltipProvider`; use `Tooltip label={...}` for common trigger/content usage and `TooltipRoot` only when manual composition is needed.
55
57
  - Use `UnstyledButton` when button semantics are needed without `Button` variants; it provides reset styles, pointer cursor, focus ring, default `type="button"`, and `asChild`.
@@ -154,7 +154,13 @@ Unless noted otherwise, each module also exports its public `*Props` types from
154
154
  - Exports: `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS`
155
155
  - `mask-input`
156
156
  - Exports: `MaskInput`
157
- - Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `9` (digit), `a` (letter), `*` (any). Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual. Forwards a `ref` prop to the underlying `<input>`, composed with the internal mask ref via `composeRefs`.
157
+ - Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `_` (digit), `#` (letter), `*` (any) — picked so the token is never a character the user actually types. When no custom `replacement` is passed, `mask` strings using the older `9`/`a` tokens are transparently translated to `_`/`#`, so existing masks keep working. Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual. Forwards a `ref` prop to the underlying `<input>`, composed with the internal mask ref via `composeRefs`.
158
+ - `number-field`
159
+ - Exports: `NumberField`, `NumberFieldGroup`, `NumberFieldDecrement`, `NumberFieldIncrement`, `NumberFieldInput`, `NumberFieldScrubArea`
160
+ - Notes: Base UI-backed numeric stepper input. `NumberField.size: 'sm' | 'md' | 'lg'` (default `md`); supports `min`, `max`, `step`, and other Base UI `NumberField.Root` props. `NumberFieldScrubArea` requires a `label` and renders a draggable handle that scrubs the value on pointer drag.
161
+ - `phone-input`
162
+ - Exports: `PhoneInput`
163
+ - Notes: international phone input built on `react-phone-number-input`, composed from the existing `Input` and `Combobox` (country select, with flags); matches `Input`'s styling and single size (no `variant`/size prop). `value` / `onChange` use the E.164 `Value` string from `react-phone-number-input`; `defaultCountry` defaults to `BR`.
158
164
  - `checkbox`
159
165
  - Exports: `Checkbox`
160
166
  - Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `primary`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows checkbox size (`sm` 12px, `md` 14px, `lg` 20px)
@@ -217,6 +223,9 @@ Unless noted otherwise, each module also exports its public `*Props` types from
217
223
  - Exports: `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`
218
224
  - `sidebar`
219
225
  - Exports: `Sidebar`, `SidebarContent`, `SidebarFooter`, `SidebarGroup`, `SidebarGroupAction`, `SidebarGroupContent`, `SidebarGroupLabel`, `SidebarHeader`, `SidebarInput`, `SidebarInset`, `SidebarMenu`, `SidebarMenuAction`, `SidebarMenuBadge`, `SidebarMenuButton`, `SidebarMenuItem`, `SidebarMenuSkeleton`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `useSidebar`
226
+ - `stepper`
227
+ - Exports: `Stepper`, `StepperNav`, `StepperItem`, `StepperTrigger`, `StepperIndicator`, `StepperSeparator`, `StepperTitle`, `StepperDescription`, `StepperPanel`, `StepperContent`, `useStepper`, `useStepItem`
228
+ - Notes: multi-step progress navigation. `Stepper.orientation: 'horizontal' | 'vertical'` (default `horizontal`); supports controlled (`value` / `onValueChange`) and uncontrolled (`defaultValue`) active step, plus custom per-state `indicators` (`active`, `completed`, `inactive`, `loading`). `StepperItem` accepts `completed`, `disabled`, and `loading`. Arrow-key and Home/End keyboard navigation between triggers is built in.
220
229
  - `tabs`
221
230
  - Exports: `Tabs`, `TabsContent`, `TabsList`, `tabsListVariants`, `TabsTrigger`
222
231
  - Notes: `TabsList.variant` supports `line` and `enclosed`, defaults to `line`, accepts `grow?: boolean` for equal-width horizontal tabs, and uses the `primary` color for the active line indicator
@@ -53,12 +53,12 @@ Run the package setup command from the project root to install dependencies, con
53
53
  bun uselets init
54
54
  ```
55
55
 
56
- The command asks for the package theme, defaults the global CSS path to `src/styles/globals.css`, creates that CSS file when missing, preserves an existing `postcss.config.mjs`, and asks whether to install the agent skill.
56
+ The command asks for the package theme, defaults the global CSS path to `src/styles/globals.css`, creates that CSS file when missing, preserves an existing `postcss.config.mjs`, and asks whether to install the agent skill. It also detects a conventional app entry file (`app/layout.tsx`, `pages/_app.tsx`, `src/main.tsx`, `src/index.tsx`, and `.jsx` variants) and inserts `import '@fontsource-variable/inter'` there, or asks for the entry file path when none is found. Use `--entry <path>` to set it explicitly for non-interactive setups.
57
57
 
58
58
  For non-interactive setup, provide explicit options:
59
59
 
60
60
  ```bash
61
- bun uselets init --theme max --css src/styles/globals.css --no-install-skill
61
+ bun uselets init --theme max --css src/styles/globals.css --entry app/layout.tsx --no-install-skill
62
62
  ```
63
63
 
64
64
  ## Agent skill installation
@@ -99,16 +99,22 @@ Use `bun uselets skill --agent codex` or `bun uselets skill --agent claude` to i
99
99
 
100
100
  ## Base setup
101
101
 
102
- Import Tailwind, one package theme, and Inter once in the app global stylesheet:
102
+ Import Tailwind and one package theme once in the app global stylesheet:
103
103
 
104
104
  ```css
105
105
  @import 'tailwindcss';
106
106
  @import '@uselets/ui/themes/max.css';
107
- @import '@fontsource-variable/inter';
108
107
  ```
109
108
 
110
109
  For GoMax apps, import `@uselets/ui/themes/gomax.css` instead.
111
110
 
111
+ Import the Inter font once from the app's entry file, not from CSS (some bundlers, including Next.js, don't resolve third-party CSS `@import`s reliably):
112
+
113
+ ```ts
114
+ // app/layout.tsx (or src/main.tsx, pages/_app.tsx, ...)
115
+ import '@fontsource-variable/inter'
116
+ ```
117
+
112
118
  If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
113
119
 
114
120
  ```js