@usememos/ui 26.11.9 → 26.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +4 -4
  2. package/dist/components/button/index.js +1 -1
  3. package/dist/components/button/index.js.map +3 -3
  4. package/dist/components/dialog/parts.js.map +1 -1
  5. package/dist/components/form/index.js.map +1 -1
  6. package/dist/components/kbd/index.js.map +1 -1
  7. package/dist/components/link/index.js.map +1 -1
  8. package/dist/components/menu/classes.js.map +1 -1
  9. package/dist/components/menu/index.js +1 -1
  10. package/dist/components/menu/index.js.map +3 -3
  11. package/dist/components/popover/classes.js.map +1 -1
  12. package/dist/components/popover/index.js.map +1 -1
  13. package/dist/components/select/index.js.map +1 -1
  14. package/dist/components/table/index.js.map +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +3 -3
  17. package/dist/spacing.js +3 -0
  18. package/dist/spacing.js.map +7 -0
  19. package/dist/styles.css +1 -1
  20. package/dist/tailwind.css +8 -13
  21. package/dist/theme-tokens.js +1 -1
  22. package/dist/theme-tokens.js.map +2 -2
  23. package/dist/tokens.css +1 -1
  24. package/dist/types/components/button/index.d.ts +2 -2
  25. package/dist/types/components/dialog/parts.d.ts +1 -1
  26. package/dist/types/components/form/index.d.ts +1 -1
  27. package/dist/types/components/kbd/index.d.ts +1 -1
  28. package/dist/types/components/link/index.d.ts +1 -1
  29. package/dist/types/components/menu/classes.d.ts +1 -1
  30. package/dist/types/components/menu/index.d.ts +2 -2
  31. package/dist/types/components/popover/classes.d.ts +1 -1
  32. package/dist/types/components/popover/index.d.ts +1 -1
  33. package/dist/types/components/select/index.d.ts +2 -2
  34. package/dist/types/components/table/index.d.ts +2 -2
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/spacing.d.ts +18 -0
  37. package/dist/types/theme-tokens.d.ts +3 -4
  38. package/llms-full.txt +243 -222
  39. package/llms.txt +1 -1
  40. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Memos UI design system: tokens, foundation styles and React components for memos, the website, the web clipper and future usememos projects.
4
4
 
5
- - Calm, dense and tactile: pure grays, ink for emphasis, and a little depth that shows what holds a value and what you can press.
5
+ - Calm, dense and flat: pure grays, ink for emphasis, and clear fills and borders for controls and state.
6
6
  - Light and Dark themes, all from CSS custom properties. Apps can add their own.
7
7
  - One package, `@usememos/ui`. ESM only, for React 18 or later, with behavior from [Base UI](https://base-ui.com).
8
8
 
@@ -24,9 +24,9 @@ import '@usememos/ui/styles.css';
24
24
  ```
25
25
 
26
26
  - `tokens.css` defines every token as a CSS custom property on `:root`, on a shadow root's `:host`, and on any `.mu-root` element.
27
- - `styles.css` holds the foundation classes (`mu-s-md`, `mu-raised`, `mu-recessed`, `mu-key`, `mu-popup`, `mu-icon`, the `mu-` type scale) and the component styles.
27
+ - `styles.css` holds the foundation classes (`mu-s-md`, `mu-key`, `mu-well`, `mu-popup`, `mu-icon`, the `mu-` type scale) and the component styles.
28
28
 
29
- Use tokens through their variables (`var(--mu-ink)`, `var(--mu-space-4)`), never as copied values.
29
+ Use tokens through their variables (`var(--mu-text)`, `var(--mu-space-4)`), never as copied values.
30
30
 
31
31
  Both stylesheets sit in the `mu` cascade layer, so the app's own CSS overrides them without a specificity fight. If the app uses layers too (Tailwind CSS does), declare the order first; see [Loading the CSS](docs/building.md#cascade-layer).
32
32
 
@@ -81,7 +81,7 @@ The package ships `llms.txt`, an index of the docs, and `llms-full.txt`, every d
81
81
 
82
82
  Set `data-theme="light"` or `"dark"` on the root element, or on any element to theme its subtree. Without the attribute the tokens are Light. The package does not read `prefers-color-scheme`; the app does, so a saved preference can win over the system setting.
83
83
 
84
- An app can add its own themes and fonts by setting the color, shadow and font tokens; every other token is internal. See [What an app can change](docs/color.md#what-an-app-can-change).
84
+ An app can add its own themes and fonts by setting the color and font tokens; every other token is internal. See [What an app can change](docs/color.md#what-an-app-can-change).
85
85
 
86
86
  ### Inside another page
87
87
 
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import{Button as B}from"@base-ui/react/button";import{forwardRef as y}from"react";import{cx as z,withClass as x}from"../../internal/class-name.js";import{useSize as N}from"../../internal/size.js";import{jsx as l,jsxs as E}from"react/jsx-runtime";function C({variant:u="neutral",size:n="md",iconOnly:o=!1}={}){return z("mu-button",`mu-button-${u}`,o&&"mu-button-icon","mu-base",`mu-s-${n}`,"mu-focus","mu-hit")}var L=y(function({variant:n="neutral",size:o,icon:a,iconEnd:r,loading:t=!1,loadingLabel:i,disabled:m,focusableWhenDisabled:p,className:f,children:e,...d},c){let b=N(o),s=(e==null||e===!1)&&(a!==void 0||r!==void 0);return E(B,{ref:c,...d,...t&&i?{"aria-label":i}:null,disabled:m||t,focusableWhenDisabled:t||p,"aria-busy":t||void 0,"data-loading":t?"":void 0,className:x(C({variant:n,size:b,iconOnly:s}),f),children:[a,s?null:l("span",{className:"mu-button-label",children:e}),s&&a!==void 0?null:r,t?l("span",{className:"mu-spinner","aria-hidden":!0}):null]})});export{L as Button,C as buttonClasses};
2
+ import{Button as x}from"@base-ui/react/button";import{forwardRef as h,useEffect as E,useState as N}from"react";import{cx as v,withClass as w}from"../../internal/class-name.js";import{useSize as C}from"../../internal/size.js";import{jsx as f,jsxs as V}from"react/jsx-runtime";function O({variant:u="neutral",size:n="md",iconOnly:o=!1}={}){return v("mu-button",`mu-button-${u}`,o&&"mu-button-icon","mu-base",`mu-s-${n}`,"mu-focus","mu-hit")}var $=h(function({variant:n="neutral",size:o,icon:s,iconEnd:r,loading:e=!1,loadingLabel:i,disabled:p,focusableWhenDisabled:c,className:d,children:t,...b},B){let y=C(o),[S,l]=N(!1);E(()=>{if(!e){l(!1);return}let z=setTimeout(()=>l(!0),300);return()=>clearTimeout(z)},[e]);let m=e&&S,a=(t==null||t===!1)&&(s!==void 0||r!==void 0);return V(x,{ref:B,...b,...e&&i?{"aria-label":i}:null,disabled:p||e,focusableWhenDisabled:e||c,"aria-busy":e||void 0,"data-loading":e?"":void 0,"data-loading-visible":m?"":void 0,className:w(O({variant:n,size:y,iconOnly:a}),d),children:[s,a?null:f("span",{className:"mu-button-label",children:t}),a&&s!==void 0?null:r,m?f("span",{className:"mu-spinner","aria-hidden":!0}):null]})});export{$ as Button,O as buttonClasses};
3
3
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/button/index.tsx"],
4
- "sourcesContent": ["import { Button as BaseButton } from '@base-ui/react/button';\nimport { forwardRef, type ReactNode } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { useSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\n\nexport type ButtonVariant = 'primary' | 'neutral' | 'ghost' | 'danger';\n\nexport interface ButtonProps extends BaseButton.Props {\n /** `primary` for the one action a view exists for, `neutral` for the rest, `ghost` in toolbars, `danger` to confirm a destructive action. */\n variant?: ButtonVariant;\n size?: Size;\n /** A Lucide element, before the label. With no children the button is square and needs `aria-label`. */\n icon?: IconElement;\n /** A Lucide element after the label, such as a chevron or an arrow that says where the action leads. */\n iconEnd?: IconElement;\n /** Keeps the width, shows a Spinner and ignores presses. */\n loading?: boolean;\n /** The accessible name while loading, such as \"Saving\". */\n loadingLabel?: string;\n children?: ReactNode;\n}\n\nexport interface ButtonClassesOptions {\n variant?: ButtonVariant;\n size?: Size;\n /** A square button with only an icon. */\n iconOnly?: boolean;\n}\n\n/**\n * The classes that make an element look like a Button. Use them on a link\n * that should look like an action: `<a className={buttonClasses({ variant: 'primary' })} href=\"/start\">`.\n */\nexport function buttonClasses({ variant = 'neutral', size = 'md', iconOnly = false }: ButtonClassesOptions = {}) {\n return cx('mu-button', `mu-button-${variant}`, iconOnly && 'mu-button-icon', 'mu-base', `mu-s-${size}`, 'mu-focus', 'mu-hit');\n}\n\n/** Starts an action. A raised key that sinks while pressed. */\nexport const Button = forwardRef<HTMLElement, ButtonProps>(function Button(\n { variant = 'neutral', size, icon, iconEnd, loading = false, loadingLabel, disabled, focusableWhenDisabled, className, children, ...props },\n ref,\n) {\n const resolved = useSize(size);\n const noLabel = children === undefined || children === null || children === false;\n const iconOnly = noLabel && (icon !== undefined || iconEnd !== undefined);\n return (\n <BaseButton\n ref={ref}\n {...props}\n {...(loading && loadingLabel ? { 'aria-label': loadingLabel } : null)}\n disabled={disabled || loading}\n focusableWhenDisabled={loading || focusableWhenDisabled}\n aria-busy={loading || undefined}\n data-loading={loading ? '' : undefined}\n className={withClass(buttonClasses({ variant, size: resolved, iconOnly }), className)}\n >\n {icon}\n {iconOnly ? null : <span className=\"mu-button-label\">{children}</span>}\n {iconOnly && icon !== undefined ? null : iconEnd}\n {loading ? <span className=\"mu-spinner\" aria-hidden /> : null}\n </BaseButton>\n );\n});\n"],
5
- "mappings": ";AAAA,OAAS,UAAUA,MAAkB,wBACrC,OAAS,cAAAC,MAAkC,QAC3C,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,WAAAC,MAAe,yBA4CpB,OAWqB,OAAAC,EAXrB,QAAAC,MAAA,oBAbG,SAASC,EAAc,CAAE,QAAAC,EAAU,UAAW,KAAAC,EAAO,KAAM,SAAAC,EAAW,EAAM,EAA0B,CAAC,EAAG,CAC/G,OAAOR,EAAG,YAAa,aAAaM,CAAO,GAAIE,GAAY,iBAAkB,UAAW,QAAQD,CAAI,GAAI,WAAY,QAAQ,CAC9H,CAGO,IAAME,EAASV,EAAqC,SACzD,CAAE,QAAAO,EAAU,UAAW,KAAAC,EAAM,KAAAG,EAAM,QAAAC,EAAS,QAAAC,EAAU,GAAO,aAAAC,EAAc,SAAAC,EAAU,sBAAAC,EAAuB,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAC1IC,EACA,CACA,IAAMC,EAAWlB,EAAQK,CAAI,EAEvBC,GADoCS,GAAa,MAAQA,IAAa,MAC/CP,IAAS,QAAaC,IAAY,QAC/D,OACEP,EAACN,EAAA,CACC,IAAKqB,EACJ,GAAGD,EACH,GAAIN,GAAWC,EAAe,CAAE,aAAcA,CAAa,EAAI,KAChE,SAAUC,GAAYF,EACtB,sBAAuBA,GAAWG,EAClC,YAAWH,GAAW,OACtB,eAAcA,EAAU,GAAK,OAC7B,UAAWX,EAAUI,EAAc,CAAE,QAAAC,EAAS,KAAMc,EAAU,SAAAZ,CAAS,CAAC,EAAGQ,CAAS,EAEnF,UAAAN,EACAF,EAAW,KAAOL,EAAC,QAAK,UAAU,kBAAmB,SAAAc,EAAS,EAC9DT,GAAYE,IAAS,OAAY,KAAOC,EACxCC,EAAUT,EAAC,QAAK,UAAU,aAAa,cAAW,GAAC,EAAK,MAC3D,CAEJ,CAAC",
6
- "names": ["BaseButton", "forwardRef", "cx", "withClass", "useSize", "jsx", "jsxs", "buttonClasses", "variant", "size", "iconOnly", "Button", "icon", "iconEnd", "loading", "loadingLabel", "disabled", "focusableWhenDisabled", "className", "children", "props", "ref", "resolved"]
4
+ "sourcesContent": ["import { Button as BaseButton } from '@base-ui/react/button';\nimport { forwardRef, useEffect, useState, type ReactNode } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { useSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\n\nexport type ButtonVariant = 'primary' | 'neutral' | 'ghost' | 'danger';\n\nexport interface ButtonProps extends BaseButton.Props {\n /** `primary` for the one action a view exists for, `neutral` for the rest, `ghost` in toolbars, `danger` to confirm a destructive action. */\n variant?: ButtonVariant;\n size?: Size;\n /** A Lucide element, before the label. With no children the button is square and needs `aria-label`. */\n icon?: IconElement;\n /** A Lucide element after the label, such as a chevron or an arrow that says where the action leads. */\n iconEnd?: IconElement;\n /** Ignores presses immediately; after 300ms, shows a Spinner without changing width. */\n loading?: boolean;\n /** The accessible name while loading, such as \"Saving\". */\n loadingLabel?: string;\n children?: ReactNode;\n}\n\nexport interface ButtonClassesOptions {\n variant?: ButtonVariant;\n size?: Size;\n /** A square button with only an icon. */\n iconOnly?: boolean;\n}\n\n/**\n * The classes that make an element look like a Button. Use them on a link\n * that should look like an action: `<a className={buttonClasses({ variant: 'primary' })} href=\"/start\">`.\n */\nexport function buttonClasses({ variant = 'neutral', size = 'md', iconOnly = false }: ButtonClassesOptions = {}) {\n return cx('mu-button', `mu-button-${variant}`, iconOnly && 'mu-button-icon', 'mu-base', `mu-s-${size}`, 'mu-focus', 'mu-hit');\n}\n\n/** Starts an action. A flat control with a distinct pressed fill. */\nexport const Button = forwardRef<HTMLElement, ButtonProps>(function Button(\n { variant = 'neutral', size, icon, iconEnd, loading = false, loadingLabel, disabled, focusableWhenDisabled, className, children, ...props },\n ref,\n) {\n const resolved = useSize(size);\n const [showSpinner, setShowSpinner] = useState(false);\n useEffect(() => {\n if (!loading) {\n setShowSpinner(false);\n return;\n }\n const timer = setTimeout(() => setShowSpinner(true), 300);\n return () => clearTimeout(timer);\n }, [loading]);\n const loadingVisible = loading && showSpinner;\n const noLabel = children === undefined || children === null || children === false;\n const iconOnly = noLabel && (icon !== undefined || iconEnd !== undefined);\n return (\n <BaseButton\n ref={ref}\n {...props}\n {...(loading && loadingLabel ? { 'aria-label': loadingLabel } : null)}\n disabled={disabled || loading}\n focusableWhenDisabled={loading || focusableWhenDisabled}\n aria-busy={loading || undefined}\n data-loading={loading ? '' : undefined}\n data-loading-visible={loadingVisible ? '' : undefined}\n className={withClass(buttonClasses({ variant, size: resolved, iconOnly }), className)}\n >\n {icon}\n {iconOnly ? null : <span className=\"mu-button-label\">{children}</span>}\n {iconOnly && icon !== undefined ? null : iconEnd}\n {loadingVisible ? <span className=\"mu-spinner\" aria-hidden /> : null}\n </BaseButton>\n );\n});\n"],
5
+ "mappings": ";AAAA,OAAS,UAAUA,MAAkB,wBACrC,OAAS,cAAAC,EAAY,aAAAC,EAAW,YAAAC,MAAgC,QAChE,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,WAAAC,MAAe,yBAsDpB,OAYqB,OAAAC,EAZrB,QAAAC,MAAA,oBAvBG,SAASC,EAAc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AAW,GAAC,EAAK,MAClE,CAEJ,CAAC",
6
+ "names": ["BaseButton", "forwardRef", "useEffect", "useState", "cx", "withClass", "useSize", "jsx", "jsxs", "buttonClasses", "variant", "size", "iconOnly", "Button", "icon", "iconEnd", "loading", "loadingLabel", "disabled", "focusableWhenDisabled", "className", "children", "props", "ref", "resolved", "showSpinner", "setShowSpinner", "timer", "loadingVisible"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/dialog/parts.tsx"],
4
- "sourcesContent": ["import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\nimport { forwardRef, type HTMLAttributes } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { SizeContext } from '../../internal/size';\nimport { Button } from '../button';\n\nexport type RootProps = BaseDialog.Root.Props;\nexport interface TriggerProps extends BaseDialog.Trigger.Props {}\nexport interface PopupProps extends BaseDialog.Popup.Props {\n /** Where the dialog is portaled to. Default `document.body`. */\n container?: BaseDialog.Portal.Props['container'];\n /** Below `breakpoint-sm` the dialog becomes a sheet from the bottom. `false` keeps it centered. Default true. */\n sheet?: boolean;\n}\n\nexport interface VariantProps {\n /**\n * `panel` (default) pads the content `space-5`, stacks it `space-4` apart and\n * adds the X. `bare` keeps the surface, radius and shadow but has no padding,\n * gap or X: the content runs edge to edge, for a search palette or an image.\n */\n variant?: 'panel' | 'bare';\n /**\n * Covers the whole screen with square corners, at every width, instead of\n * a centered panel or a sheet. With `bare`, for an image viewer.\n */\n fullScreen?: boolean;\n}\nexport interface TitleProps extends BaseDialog.Title.Props {}\nexport interface DescriptionProps extends BaseDialog.Description.Props {}\nexport interface CloseProps extends BaseDialog.Close.Props {}\nexport interface FooterProps extends HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Builds the styled parts on Base UI's Dialog or AlertDialog, which share\n * their anatomy. `closeButton` adds the X at the top right of the popup.\n */\nexport function createDialogParts(Base: typeof BaseDialog, name: 'dialog' | 'alert-dialog', closeButton: boolean) {\n const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function DialogTrigger({ className, ...props }, ref) {\n return <Base.Trigger ref={ref} {...props} className={withClass(`mu-${name}-trigger`, className)} />;\n });\n\n const Popup = forwardRef<HTMLDivElement, PopupProps & VariantProps & { closeLabel?: string }>(function DialogPopup(\n { container, sheet = true, variant = 'panel', fullScreen = false, closeLabel = 'Close', className, children, ...props },\n ref,\n ) {\n const bare = variant === 'bare';\n return (\n <Base.Portal container={container}>\n <Base.Backdrop className=\"mu-dialog-backdrop\" />\n <Base.Viewport className={cx('mu-dialog-viewport', fullScreen ? 'mu-dialog-full' : sheet && 'mu-dialog-sheet')}>\n <Base.Popup\n ref={ref}\n {...props}\n className={withClass(cx(`mu-dialog-popup mu-${name}-popup`, bare && 'mu-dialog-bare', 'mu-popup mu-base mu-s-md'), className)}\n >\n {/* A dialog is md wherever it is declared: React context crosses the portal, so a size set by a parent Root (a sm Table) would leak in. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n {closeButton && !bare ? (\n <Base.Close className=\"mu-dialog-x\" render={<Button variant=\"ghost\" size=\"sm\" icon={<X />} aria-label={closeLabel} />} />\n ) : null}\n </Base.Popup>\n </Base.Viewport>\n </Base.Portal>\n );\n });\n\n const Title = forwardRef<HTMLHeadingElement, TitleProps>(function DialogTitle({ className, ...props }, ref) {\n return <Base.Title ref={ref} {...props} className={withClass('mu-dialog-title mu-title', className)} />;\n });\n\n const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function DialogDescription({ className, ...props }, ref) {\n return <Base.Description ref={ref} {...props} className={withClass('mu-dialog-description mu-body', className)} />;\n });\n\n const Close = forwardRef<HTMLButtonElement, CloseProps>(function DialogClose({ className, ...props }, ref) {\n return <Base.Close ref={ref} {...props} className={withClass(`mu-${name}-close`, className)} />;\n });\n\n const Footer = forwardRef<HTMLDivElement, FooterProps>(function DialogFooter({ className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-dialog-footer', className)} />;\n });\n\n return { Root: Base.Root, Trigger, Popup, Title, Description, Close, Footer };\n}\n"],
4
+ "sourcesContent": ["import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\nimport { forwardRef, type HTMLAttributes } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { SizeContext } from '../../internal/size';\nimport { Button } from '../button';\n\nexport type RootProps = BaseDialog.Root.Props;\nexport interface TriggerProps extends BaseDialog.Trigger.Props {}\nexport interface PopupProps extends BaseDialog.Popup.Props {\n /** Where the dialog is portaled to. Default `document.body`. */\n container?: BaseDialog.Portal.Props['container'];\n /** Below `breakpoint-sm` the dialog becomes a sheet from the bottom. `false` keeps it centered. Default true. */\n sheet?: boolean;\n}\n\nexport interface VariantProps {\n /**\n * `panel` (default) pads the content `space-5`, stacks it `space-4` apart and\n * adds the X. `bare` keeps the surface, radius and border but has no padding,\n * gap or X: the content runs edge to edge, for a search palette or an image.\n */\n variant?: 'panel' | 'bare';\n /**\n * Covers the whole screen with square corners, at every width, instead of\n * a centered panel or a sheet. With `bare`, for an image viewer.\n */\n fullScreen?: boolean;\n}\nexport interface TitleProps extends BaseDialog.Title.Props {}\nexport interface DescriptionProps extends BaseDialog.Description.Props {}\nexport interface CloseProps extends BaseDialog.Close.Props {}\nexport interface FooterProps extends HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Builds the styled parts on Base UI's Dialog or AlertDialog, which share\n * their anatomy. `closeButton` adds the X at the top right of the popup.\n */\nexport function createDialogParts(Base: typeof BaseDialog, name: 'dialog' | 'alert-dialog', closeButton: boolean) {\n const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function DialogTrigger({ className, ...props }, ref) {\n return <Base.Trigger ref={ref} {...props} className={withClass(`mu-${name}-trigger`, className)} />;\n });\n\n const Popup = forwardRef<HTMLDivElement, PopupProps & VariantProps & { closeLabel?: string }>(function DialogPopup(\n { container, sheet = true, variant = 'panel', fullScreen = false, closeLabel = 'Close', className, children, ...props },\n ref,\n ) {\n const bare = variant === 'bare';\n return (\n <Base.Portal container={container}>\n <Base.Backdrop className=\"mu-dialog-backdrop\" />\n <Base.Viewport className={cx('mu-dialog-viewport', fullScreen ? 'mu-dialog-full' : sheet && 'mu-dialog-sheet')}>\n <Base.Popup\n ref={ref}\n {...props}\n className={withClass(cx(`mu-dialog-popup mu-${name}-popup`, bare && 'mu-dialog-bare', 'mu-popup mu-base mu-s-md'), className)}\n >\n {/* A dialog is md wherever it is declared: React context crosses the portal, so a size set by a parent Root (a sm Table) would leak in. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n {closeButton && !bare ? (\n <Base.Close className=\"mu-dialog-x\" render={<Button variant=\"ghost\" size=\"sm\" icon={<X />} aria-label={closeLabel} />} />\n ) : null}\n </Base.Popup>\n </Base.Viewport>\n </Base.Portal>\n );\n });\n\n const Title = forwardRef<HTMLHeadingElement, TitleProps>(function DialogTitle({ className, ...props }, ref) {\n return <Base.Title ref={ref} {...props} className={withClass('mu-dialog-title mu-title', className)} />;\n });\n\n const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function DialogDescription({ className, ...props }, ref) {\n return <Base.Description ref={ref} {...props} className={withClass('mu-dialog-description mu-body', className)} />;\n });\n\n const Close = forwardRef<HTMLButtonElement, CloseProps>(function DialogClose({ className, ...props }, ref) {\n return <Base.Close ref={ref} {...props} className={withClass(`mu-${name}-close`, className)} />;\n });\n\n const Footer = forwardRef<HTMLDivElement, FooterProps>(function DialogFooter({ className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-dialog-footer', className)} />;\n });\n\n return { Root: Base.Root, Trigger, Popup, Title, Description, Close, Footer };\n}\n"],
5
5
  "mappings": ";AACA,OAAS,KAAAA,MAAS,eAClB,OAAS,cAAAC,MAAuC,QAChD,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,eAAAC,MAAmB,yBAC5B,OAAS,UAAAC,MAAc,qBAmCZ,cAAAC,EA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BU,CAAS,EAAG,CACvG,CAAC,EAEKY,EAAcxB,EAAmD,SAA2B,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC9H,OAAOT,EAACG,EAAK,YAAL,CAAiB,IAAKM,EAAM,GAAGD,EAAO,UAAWX,EAAU,gCAAiCU,CAAS,EAAG,CAClH,CAAC,EAEKa,EAAQzB,EAA0C,SAAqB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzG,OAAOT,EAACG,EAAK,MAAL,CAAW,IAAKM,EAAM,GAAGD,EAAO,UAAWX,EAAU,MAAMO,CAAI,SAAUG,CAAS,EAAG,CAC/F,CAAC,EAEKc,EAAS1B,EAAwC,SAAsB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzG,OAAOT,EAAC,OAAI,IAAKS,EAAM,GAAGD,EAAO,UAAWZ,EAAG,mBAAoBW,CAAS,EAAG,CACjF,CAAC,EAED,MAAO,CAAE,KAAMJ,EAAK,KAAM,QAAAG,EAAS,MAAAI,EAAO,MAAAQ,EAAO,YAAAC,EAAa,MAAAC,EAAO,OAAAC,CAAO,CAC9E",
6
6
  "names": ["X", "forwardRef", "cx", "withClass", "SizeContext", "Button", "jsx", "jsxs", "createDialogParts", "Base", "name", "closeButton", "Trigger", "className", "props", "ref", "Popup", "container", "sheet", "variant", "fullScreen", "closeLabel", "children", "bare", "Title", "Description", "Close", "Footer"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/form/index.tsx"],
4
- "sourcesContent": ["import { Form as BaseForm } from '@base-ui/react/form';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { createContext, forwardRef, useContext, useId, useLayoutEffect, useState, type ComponentPropsWithoutRef } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { SizeContext } from '../../internal/size';\n\n/** The id of the form's Title, so the Root can be named by it. */\nconst TitleIdContext = createContext<((id: string | undefined) => void) | null>(null);\n\nexport interface RootProps extends BaseForm.Props {\n /**\n * Draws the form in a box, as a List: a `line` edge, `radius-lg` corners and\n * a `surface` fill, with the Footer as a `canvas` bar under a `line`. For a\n * small form among Lists on a settings page.\n */\n bordered?: boolean;\n}\n\n/**\n * A `<form>` on Base UI's Form, which shows each Field's errors. Its children\n * stack `space-4` apart. A Title inside names it.\n */\nexport const Root = forwardRef<HTMLFormElement, RootProps>(function FormRoot({ bordered = false, className, ...props }, ref) {\n const [titleId, setTitleId] = useState<string | undefined>(undefined);\n return (\n <TitleIdContext.Provider value={setTitleId}>\n {/* A form is md wherever it is declared, as a Dialog is. */}\n <SizeContext.Provider value=\"md\">\n <BaseForm\n ref={ref}\n aria-labelledby={props['aria-label'] ? undefined : titleId}\n {...props}\n className={withClass(cx('mu-form mu-base mu-body mu-s-md', bordered && 'mu-form-bordered'), className)}\n />\n </SizeContext.Provider>\n </TitleIdContext.Provider>\n );\n});\n\nexport interface TitleProps extends useRender.ComponentProps<'h2'> {}\n\n/** The form's heading, an `<h2>` in `label` style that names the form. Use `render` for another level. */\nexport const Title = forwardRef<HTMLHeadingElement, TitleProps>(function FormTitle({ render, id: ownId, ...props }, ref) {\n const generated = useId();\n const id = ownId ?? generated;\n const register = useContext(TitleIdContext);\n useLayoutEffect(() => {\n register?.(id);\n return () => register?.(undefined);\n }, [register, id]);\n return useRender({\n defaultTagName: 'h2',\n render,\n ref,\n props: mergeProps<'h2'>({ id, className: 'mu-form-title mu-label' }, props),\n });\n});\n\nexport interface DescriptionProps extends ComponentPropsWithoutRef<'p'> {}\n\n/** One line under the title, in `caption` and `ink-muted`. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function FormDescription({ className, ...props }, ref) {\n return <p ref={ref} {...props} className={cx('mu-form-description mu-caption', className)} />;\n});\n\nexport interface FooterProps extends ComponentPropsWithoutRef<'div'> {}\n\n/** The form's buttons, right-aligned: a ghost Cancel, then the primary. In a bordered form, a `canvas` bar along the bottom. */\nexport const Footer = forwardRef<HTMLDivElement, FooterProps>(function FormFooter({ className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-form-footer', className)} />;\n});\n"],
4
+ "sourcesContent": ["import { Form as BaseForm } from '@base-ui/react/form';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { createContext, forwardRef, useContext, useId, useLayoutEffect, useState, type ComponentPropsWithoutRef } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { SizeContext } from '../../internal/size';\n\n/** The id of the form's Title, so the Root can be named by it. */\nconst TitleIdContext = createContext<((id: string | undefined) => void) | null>(null);\n\nexport interface RootProps extends BaseForm.Props {\n /**\n * Draws the form in a box, as a List: a `line` edge, `radius-lg` corners and\n * a `surface` fill, with the Footer as a `canvas` bar under a `line`. For a\n * small form among Lists on a settings page.\n */\n bordered?: boolean;\n}\n\n/**\n * A `<form>` on Base UI's Form, which shows each Field's errors. Its children\n * stack `space-4` apart. A Title inside names it.\n */\nexport const Root = forwardRef<HTMLFormElement, RootProps>(function FormRoot({ bordered = false, className, ...props }, ref) {\n const [titleId, setTitleId] = useState<string | undefined>(undefined);\n return (\n <TitleIdContext.Provider value={setTitleId}>\n {/* A form is md wherever it is declared, as a Dialog is. */}\n <SizeContext.Provider value=\"md\">\n <BaseForm\n ref={ref}\n aria-labelledby={props['aria-label'] ? undefined : titleId}\n {...props}\n className={withClass(cx('mu-form mu-base mu-body mu-s-md', bordered && 'mu-form-bordered'), className)}\n />\n </SizeContext.Provider>\n </TitleIdContext.Provider>\n );\n});\n\nexport interface TitleProps extends useRender.ComponentProps<'h2'> {}\n\n/** The form's heading, an `<h2>` in `label` style that names the form. Use `render` for another level. */\nexport const Title = forwardRef<HTMLHeadingElement, TitleProps>(function FormTitle({ render, id: ownId, ...props }, ref) {\n const generated = useId();\n const id = ownId ?? generated;\n const register = useContext(TitleIdContext);\n useLayoutEffect(() => {\n register?.(id);\n return () => register?.(undefined);\n }, [register, id]);\n return useRender({\n defaultTagName: 'h2',\n render,\n ref,\n props: mergeProps<'h2'>({ id, className: 'mu-form-title mu-label' }, props),\n });\n});\n\nexport interface DescriptionProps extends ComponentPropsWithoutRef<'p'> {}\n\n/** One line under the title, in `caption` and `text-secondary`. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function FormDescription({ className, ...props }, ref) {\n return <p ref={ref} {...props} className={cx('mu-form-description mu-caption', className)} />;\n});\n\nexport interface FooterProps extends ComponentPropsWithoutRef<'div'> {}\n\n/** The form's buttons, right-aligned: a ghost Cancel, then the primary. In a bordered form, a `canvas` bar along the bottom. */\nexport const Footer = forwardRef<HTMLDivElement, FooterProps>(function FormFooter({ className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-form-footer', className)} />;\n});\n"],
5
5
  "mappings": ";AAAA,OAAS,QAAQA,MAAgB,sBACjC,OAAS,cAAAC,MAAkB,6BAC3B,OAAS,aAAAC,MAAiB,4BAC1B,OAAS,iBAAAC,EAAe,cAAAC,EAAY,cAAAC,EAAY,SAAAC,EAAO,mBAAAC,EAAiB,YAAAC,MAA+C,QACvH,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,eAAAC,MAAmB,yBAwBpB,cAAAC,MAAA,oBArBR,IAAMC,EAAiBV,EAAyD,IAAI,EAevEW,EAAOV,EAAuC,SAAkB,CAAE,SAAAW,EAAW,GAAO,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC3H,GAAM,CAACC,EAASC,CAAU,EAAIZ,EAA6B,MAAS,EACpE,OACEI,EAACC,EAAe,SAAf,CAAwB,MAAOO,EAE9B,SAAAR,EAACD,EAAY,SAAZ,CAAqB,MAAM,KAC1B,SAAAC,EAACZ,EAAA,CACC,IAAKkB,EACL,kBAAiBD,EAAM,YAAY,EAAI,OAAYE,EAClD,GAAGF,EACJ,UAAWP,EAAUD,EAAG,kCAAmCM,GAAY,kBAAkB,EAAGC,CAAS,EACvG,EACF,EACF,CAEJ,CAAC,EAKYK,EAAQjB,EAA2C,SAAmB,CAAE,OAAAkB,EAAQ,GAAIC,EAAO,GAAGN,CAAM,EAAGC,EAAK,CACvH,IAAMM,EAAYlB,EAAM,EAClBmB,EAAKF,GAASC,EACdE,EAAWrB,EAAWQ,CAAc,EAC1C,OAAAN,EAAgB,KACdmB,IAAWD,CAAE,EACN,IAAMC,IAAW,MAAS,GAChC,CAACA,EAAUD,CAAE,CAAC,EACVvB,EAAU,CACf,eAAgB,KAChB,OAAAoB,EACA,IAAAJ,EACA,MAAOjB,EAAiB,CAAE,GAAAwB,EAAI,UAAW,wBAAyB,EAAGR,CAAK,CAC5E,CAAC,CACH,CAAC,EAKYU,EAAcvB,EAAmD,SAAyB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACnI,OAAON,EAAC,KAAE,IAAKM,EAAM,GAAGD,EAAO,UAAWR,EAAG,iCAAkCO,CAAS,EAAG,CAC7F,CAAC,EAKYY,EAASxB,EAAwC,SAAoB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC9G,OAAON,EAAC,OAAI,IAAKM,EAAM,GAAGD,EAAO,UAAWR,EAAG,iBAAkBO,CAAS,EAAG,CAC/E,CAAC",
6
6
  "names": ["BaseForm", "mergeProps", "useRender", "createContext", "forwardRef", "useContext", "useId", "useLayoutEffect", "useState", "cx", "withClass", "SizeContext", "jsx", "TitleIdContext", "Root", "bordered", "className", "props", "ref", "titleId", "setTitleId", "Title", "render", "ownId", "generated", "id", "register", "Description", "Footer"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/kbd/index.tsx"],
4
- "sourcesContent": ["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { forwardRef } from 'react';\n\nexport interface KbdProps extends useRender.ComponentProps<'kbd'> {}\n\n/** One keyboard key, such as \"\u2318\", \"Enter\" or \"/\", as a tiny raised key. */\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(function Kbd({ render, ...props }, ref) {\n return useRender({ defaultTagName: 'kbd', render, ref, props: mergeProps<'kbd'>({ className: 'mu-kbd mu-label-xs' }, props) });\n});\n"],
4
+ "sourcesContent": ["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { forwardRef } from 'react';\n\nexport interface KbdProps extends useRender.ComponentProps<'kbd'> {}\n\n/** One keyboard key, such as \"\u2318\", \"Enter\" or \"/\", as a tiny flat key. */\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(function Kbd({ render, ...props }, ref) {\n return useRender({ defaultTagName: 'kbd', render, ref, props: mergeProps<'kbd'>({ className: 'mu-kbd mu-label-xs' }, props) });\n});\n"],
5
5
  "mappings": ";AAAA,OAAS,cAAAA,MAAkB,6BAC3B,OAAS,aAAAC,MAAiB,4BAC1B,OAAS,cAAAC,MAAkB,QAKpB,IAAMC,EAAMD,EAAkC,SAAa,CAAE,OAAAE,EAAQ,GAAGC,CAAM,EAAGC,EAAK,CAC3F,OAAOL,EAAU,CAAE,eAAgB,MAAO,OAAAG,EAAQ,IAAAE,EAAK,MAAON,EAAkB,CAAE,UAAW,oBAAqB,EAAGK,CAAK,CAAE,CAAC,CAC/H,CAAC",
6
6
  "names": ["mergeProps", "useRender", "forwardRef", "Kbd", "render", "props", "ref"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/link/index.tsx"],
4
- "sourcesContent": ["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { ArrowUpRight } from 'lucide-react';\nimport { forwardRef } from 'react';\n\nexport interface LinkProps extends useRender.ComponentProps<'a'> {\n /** For navigation that shouldn't draw the eye: ink-muted, ink on hover. */\n muted?: boolean;\n /** Opens in a new tab and shows an arrow. */\n external?: boolean;\n /** `always` inside running text, so the link isn't told apart by color alone. Default `hover`. */\n underline?: 'hover' | 'always';\n}\n\n/** Goes somewhere. Accent text that underlines on hover and focus. */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link({ muted = false, external = false, underline = 'hover', render, children, ...props }, ref) {\n return useRender({\n defaultTagName: 'a',\n render,\n ref,\n props: mergeProps<'a'>(\n {\n className: `mu-link${muted ? ' mu-link-muted' : ''}${underline === 'always' ? ' mu-link-underline' : ''} mu-focus`,\n ...(external ? { target: '_blank', rel: 'noopener noreferrer' } : null),\n children: (\n <>\n {children}\n {external ? <ArrowUpRight className=\"mu-icon\" aria-hidden /> : null}\n </>\n ),\n },\n props,\n ),\n });\n});\n"],
4
+ "sourcesContent": ["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { ArrowUpRight } from 'lucide-react';\nimport { forwardRef } from 'react';\n\nexport interface LinkProps extends useRender.ComponentProps<'a'> {\n /** For navigation that shouldn't draw the eye: `text-secondary`, `text` on hover. */\n muted?: boolean;\n /** Opens in a new tab and shows an arrow. */\n external?: boolean;\n /** `always` inside running text, so the link isn't told apart by color alone. Default `hover`. */\n underline?: 'hover' | 'always';\n}\n\n/** Goes somewhere. Accent text that underlines on hover and focus. */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link({ muted = false, external = false, underline = 'hover', render, children, ...props }, ref) {\n return useRender({\n defaultTagName: 'a',\n render,\n ref,\n props: mergeProps<'a'>(\n {\n className: `mu-link${muted ? ' mu-link-muted' : ''}${underline === 'always' ? ' mu-link-underline' : ''} mu-focus`,\n ...(external ? { target: '_blank', rel: 'noopener noreferrer' } : null),\n children: (\n <>\n {children}\n {external ? <ArrowUpRight className=\"mu-icon\" aria-hidden /> : null}\n </>\n ),\n },\n props,\n ),\n });\n});\n"],
5
5
  "mappings": ";AAAA,OAAS,cAAAA,MAAkB,6BAC3B,OAAS,aAAAC,MAAiB,4BAC1B,OAAS,gBAAAC,MAAoB,eAC7B,OAAS,cAAAC,MAAkB,QAsBjB,mBAAAC,EAEc,OAAAC,EAFd,QAAAC,MAAA,oBAVH,IAAMC,EAAOJ,EAAyC,SAAc,CAAE,MAAAK,EAAQ,GAAO,SAAAC,EAAW,GAAO,UAAAC,EAAY,QAAS,OAAAC,EAAQ,SAAAC,EAAU,GAAGC,CAAM,EAAGC,EAAK,CACpK,OAAOb,EAAU,CACf,eAAgB,IAChB,OAAAU,EACA,IAAAG,EACA,MAAOd,EACL,CACE,UAAW,UAAUQ,EAAQ,iBAAmB,EAAE,GAAGE,IAAc,SAAW,qBAAuB,EAAE,YACvG,GAAID,EAAW,CAAE,OAAQ,SAAU,IAAK,qBAAsB,EAAI,KAClE,SACEH,EAAAF,EAAA,CACG,UAAAQ,EACAH,EAAWJ,EAACH,EAAA,CAAa,UAAU,UAAU,cAAW,GAAC,EAAK,MACjE,CAEJ,EACAW,CACF,CACF,CAAC,CACH,CAAC",
6
6
  "names": ["mergeProps", "useRender", "ArrowUpRight", "forwardRef", "Fragment", "jsx", "jsxs", "Link", "muted", "external", "underline", "render", "children", "props", "ref"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/menu/classes.ts"],
4
- "sourcesContent": ["import type { Size } from '../../types';\n\nexport interface MenuClassesOptions {\n /** Row height of every item: 28 (sm) or 32px (md). */\n size?: Exclude<Size, 'xs'>;\n}\n\n/** The classes of each part of a Menu. */\nexport interface MenuClasses {\n /** The floating list. Sets the row size its items read. */\n popup: string;\n /** One row. Highlighted while it has `data-highlighted`; dimmed with `data-disabled`. */\n item: string;\n /** A destructive row: red text. */\n dangerItem: string;\n /** The text of a row, which truncates. */\n label: string;\n /** Stacks a row's label over its description. */\n text: string;\n /** A line of `ink-muted` text under the label. */\n description: string;\n /** A keyboard shortcut at the end of a row. */\n shortcut: string;\n /** A line between groups of rows. */\n separator: string;\n /** The name of a group of rows. */\n groupLabel: string;\n}\n\n/**\n * The classes that make an app's own floating list look like a Menu, such as\n * an editor's suggestion list. The app sets `data-highlighted` on the active\n * row. See docs/custom-components.md.\n */\nexport function menuClasses({ size = 'md' }: MenuClassesOptions = {}): MenuClasses {\n return {\n popup: `mu-menu-popup mu-popup mu-popup-motion mu-base mu-s-${size}`,\n item: 'mu-menu-item',\n dangerItem: 'mu-menu-item mu-menu-item-danger',\n label: 'mu-menu-label',\n text: 'mu-menu-text',\n description: 'mu-menu-description mu-caption',\n shortcut: 'mu-menu-shortcut',\n separator: 'mu-menu-separator',\n groupLabel: 'mu-menu-group-label mu-label-sm',\n };\n}\n"],
4
+ "sourcesContent": ["import type { Size } from '../../types';\n\nexport interface MenuClassesOptions {\n /** Row height of every item: 28 (sm) or 32px (md). */\n size?: Exclude<Size, 'xs'>;\n}\n\n/** The classes of each part of a Menu. */\nexport interface MenuClasses {\n /** The floating list. Sets the row size its items read. */\n popup: string;\n /** One row. Highlighted while it has `data-highlighted`; dimmed with `data-disabled`. */\n item: string;\n /** A destructive row: red text. */\n dangerItem: string;\n /** The text of a row, which truncates. */\n label: string;\n /** Stacks a row's label over its description. */\n text: string;\n /** A line of `text-secondary` text under the label. */\n description: string;\n /** A keyboard shortcut at the end of a row. */\n shortcut: string;\n /** A line between groups of rows. */\n separator: string;\n /** The name of a group of rows. */\n groupLabel: string;\n}\n\n/**\n * The classes that make an app's own floating list look like a Menu, such as\n * an editor's suggestion list. The app sets `data-highlighted` on the active\n * row. See docs/custom-components.md.\n */\nexport function menuClasses({ size = 'md' }: MenuClassesOptions = {}): MenuClasses {\n return {\n popup: `mu-menu-popup mu-popup mu-popup-motion mu-base mu-s-${size}`,\n item: 'mu-menu-item',\n dangerItem: 'mu-menu-item mu-menu-item-danger',\n label: 'mu-menu-label',\n text: 'mu-menu-text',\n description: 'mu-menu-description mu-caption',\n shortcut: 'mu-menu-shortcut',\n separator: 'mu-menu-separator',\n groupLabel: 'mu-menu-group-label mu-label-sm',\n };\n}\n"],
5
5
  "mappings": ";AAkCO,SAASA,EAAY,CAAE,KAAAC,EAAO,IAAK,EAAwB,CAAC,EAAgB,CACjF,MAAO,CACL,MAAO,uDAAuDA,CAAI,GAClE,KAAM,eACN,WAAY,mCACZ,MAAO,gBACP,KAAM,eACN,YAAa,iCACb,SAAU,mBACV,UAAW,oBACX,WAAY,iCACd,CACF",
6
6
  "names": ["menuClasses", "size"]
7
7
  }
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import{Menu as s}from"@base-ui/react/menu";import{Check as h,ChevronRight as L}from"lucide-react";import{forwardRef as c,useCallback as R,useId as v,useRef as G}from"react";import{cx as I,withClass as m}from"../../internal/class-name.js";import{splitPositioner as C}from"../../internal/popup.js";import{SizeContext as E,useRowSize as S}from"../../internal/size.js";import{menuClasses as B}from"./classes.js";import{Fragment as k,jsx as t,jsxs as x}from"react/jsx-runtime";var u=B();function A({size:i,...o}){let e=S(i);return t(E.Provider,{value:e,children:t(s.Root,{...o})})}var F=c(function({className:o,...e},r){return t(s.Trigger,{ref:r,...e,className:m("mu-menu-trigger",o)})}),q=c(function({container:o,className:e,...r},n){let p=S(),a=G(null),l=R(f=>{a.current=f,typeof n=="function"?n(f):n&&(n.current=f)},[n]),d=R(({side:f,align:g})=>{let T=a.current;return!T||g==="center"||f==="top"||f==="bottom"?0:-parseFloat(getComputedStyle(T).paddingTop)||0},[]),P=R(({side:f})=>{let g=a.current;return!g||f==="top"||f==="bottom"?4:parseFloat(getComputedStyle(g).paddingTop)||4},[]),[b,N]=C(r);return t(s.Portal,{container:o,children:t(s.Positioner,{sideOffset:P,alignOffset:d,...b,className:"mu-positioner",children:t(s.Popup,{ref:l,...N,className:m(B({size:p}).popup,e)})})})});function M({icon:i,shortcut:o,description:e,children:r}){let n=v(),p=e!=null&&e!==!1,a=t("span",{className:u.label,id:p?`${n}-label`:void 0,children:r}),l=x(k,{children:[i,p?x("span",{className:u.text,children:[a,t("span",{className:u.description,id:`${n}-description`,children:e})]}):a,o!==void 0?t("span",{className:u.shortcut,children:o}):null]}),d=p?{"aria-labelledby":`${n}-label`,"aria-describedby":`${n}-description`}:null;return[l,d]}var J=c(function({icon:o,shortcut:e,description:r,danger:n=!1,className:p,children:a,...l},d){let[P,b]=M({icon:o,shortcut:e,description:r,children:a});return t(s.Item,{ref:d,...b,...l,className:m(n?u.dangerItem:u.item,p),children:P})}),K=c(function({icon:o,shortcut:e,description:r,className:n,children:p,...a},l){let[d,P]=M({icon:o,shortcut:e,description:r,children:p});return x(s.CheckboxItem,{ref:l,...P,...a,className:m(I(u.item,"mu-menu-checkbox-item"),n),children:[d,t("span",{className:"mu-menu-indicator",children:t(s.CheckboxItemIndicator,{render:t(h,{"aria-hidden":!0})})})]})}),Q=c(function({className:o,...e},r){return t(s.RadioGroup,{ref:r,...e,className:m("mu-menu-radio-group",o)})}),U=c(function({icon:o,shortcut:e,description:r,className:n,children:p,...a},l){let[d,P]=M({icon:o,shortcut:e,description:r,children:p});return x(s.RadioItem,{ref:l,...P,...a,className:m(I(u.item,"mu-menu-radio-item"),n),children:[d,t("span",{className:"mu-menu-indicator",children:t(s.RadioItemIndicator,{render:t(h,{"aria-hidden":!0})})})]})}),V=c(function({className:o,...e},r){return t(s.Group,{ref:r,...e,className:m("mu-menu-group",o)})}),W=c(function({className:o,...e},r){return t(s.GroupLabel,{ref:r,...e,className:m(u.groupLabel,o)})}),X=c(function({className:o,...e},r){return t(s.Separator,{ref:r,...e,className:m(u.separator,o)})}),Y=s.SubmenuRoot,Z=c(function({icon:o,className:e,children:r,...n},p){let[a]=M({icon:o,children:r});return x(s.SubmenuTrigger,{ref:p,...n,className:m(I(u.item,"mu-menu-submenu-trigger"),e),children:[a,t(L,{className:"mu-menu-chevron","aria-hidden":!0})]})});export{K as CheckboxItem,V as Group,W as GroupLabel,J as Item,q as Popup,Q as RadioGroup,U as RadioItem,A as Root,X as Separator,Y as SubmenuRoot,Z as SubmenuTrigger,F as Trigger};
2
+ import{Menu as s}from"@base-ui/react/menu";import{Check as S,ChevronRight as v}from"lucide-react";import{forwardRef as c,useCallback as I,useId as G,useRef as C}from"react";import{cx as T,withClass as m}from"../../internal/class-name.js";import{splitPositioner as E}from"../../internal/popup.js";import{SizeContext as k,useRowSize as B}from"../../internal/size.js";import{menuClasses as N}from"./classes.js";import{Fragment as y,jsx as t,jsxs as g}from"react/jsx-runtime";var u=N();function A({size:i,...o}){let e=B(i);return t(k.Provider,{value:e,children:t(s.Root,{...o})})}var W=c(function({className:o,...e},r){return t(s.Trigger,{ref:r,...e,className:m("mu-menu-trigger",o)})}),q=c(function({container:o,className:e,...r},n){let p=B(),a=C(null),l=I(f=>{a.current=f,typeof n=="function"?n(f):n&&(n.current=f)},[n]),d=I(({side:f,align:M})=>{let x=a.current;if(!x||M==="center"||f==="top"||f==="bottom")return 0;let h=getComputedStyle(x);return-(parseFloat(h.paddingTop)+parseFloat(h.borderTopWidth))||0},[]),P=I(({side:f})=>{let M=a.current;if(!M||f==="top"||f==="bottom")return 4;let x=getComputedStyle(M);return parseFloat(x.paddingTop)+parseFloat(x.borderTopWidth)||4},[]),[R,L]=E(r);return t(s.Portal,{container:o,children:t(s.Positioner,{sideOffset:P,alignOffset:d,...R,className:"mu-positioner",children:t(s.Popup,{ref:l,...L,className:m(N({size:p}).popup,e)})})})});function b({icon:i,shortcut:o,description:e,children:r}){let n=G(),p=e!=null&&e!==!1,a=t("span",{className:u.label,id:p?`${n}-label`:void 0,children:r}),l=g(y,{children:[i,p?g("span",{className:u.text,children:[a,t("span",{className:u.description,id:`${n}-description`,children:e})]}):a,o!==void 0?t("span",{className:u.shortcut,children:o}):null]}),d=p?{"aria-labelledby":`${n}-label`,"aria-describedby":`${n}-description`}:null;return[l,d]}var J=c(function({icon:o,shortcut:e,description:r,danger:n=!1,className:p,children:a,...l},d){let[P,R]=b({icon:o,shortcut:e,description:r,children:a});return t(s.Item,{ref:d,...R,...l,className:m(n?u.dangerItem:u.item,p),children:P})}),K=c(function({icon:o,shortcut:e,description:r,className:n,children:p,...a},l){let[d,P]=b({icon:o,shortcut:e,description:r,children:p});return g(s.CheckboxItem,{ref:l,...P,...a,className:m(T(u.item,"mu-menu-checkbox-item"),n),children:[d,t("span",{className:"mu-menu-indicator",children:t(s.CheckboxItemIndicator,{render:t(S,{"aria-hidden":!0})})})]})}),Q=c(function({className:o,...e},r){return t(s.RadioGroup,{ref:r,...e,className:m("mu-menu-radio-group",o)})}),U=c(function({icon:o,shortcut:e,description:r,className:n,children:p,...a},l){let[d,P]=b({icon:o,shortcut:e,description:r,children:p});return g(s.RadioItem,{ref:l,...P,...a,className:m(T(u.item,"mu-menu-radio-item"),n),children:[d,t("span",{className:"mu-menu-indicator",children:t(s.RadioItemIndicator,{render:t(S,{"aria-hidden":!0})})})]})}),V=c(function({className:o,...e},r){return t(s.Group,{ref:r,...e,className:m("mu-menu-group",o)})}),X=c(function({className:o,...e},r){return t(s.GroupLabel,{ref:r,...e,className:m(u.groupLabel,o)})}),Y=c(function({className:o,...e},r){return t(s.Separator,{ref:r,...e,className:m(u.separator,o)})}),Z=s.SubmenuRoot,_=c(function({icon:o,className:e,children:r,...n},p){let[a]=b({icon:o,children:r});return g(s.SubmenuTrigger,{ref:p,...n,className:m(T(u.item,"mu-menu-submenu-trigger"),e),children:[a,t(v,{className:"mu-menu-chevron","aria-hidden":!0})]})});export{K as CheckboxItem,V as Group,X as GroupLabel,J as Item,q as Popup,Q as RadioGroup,U as RadioItem,A as Root,Y as Separator,Z as SubmenuRoot,_ as SubmenuTrigger,W as Trigger};
3
3
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/menu/index.tsx"],
4
- "sourcesContent": ["import { Menu as BaseMenu } from '@base-ui/react/menu';\nimport { Check, ChevronRight } from 'lucide-react';\nimport { forwardRef, useCallback, useId, useRef, type ReactNode } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\nimport { menuClasses } from './classes';\n\nconst classes = /* @__PURE__ */ menuClasses();\n\nexport interface RootProps extends BaseMenu.Root.Props {\n /** Row height of every item: 28 (sm) or 32px (md). */\n size?: Exclude<Size, 'xs'>;\n}\n\n/** Groups a trigger and its menu. */\nexport function Root({ size, ...props }: RootProps) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseMenu.Root {...props} />\n </SizeContext.Provider>\n );\n}\n\nexport interface TriggerProps extends BaseMenu.Trigger.Props {}\n\n/** Opens the menu. Usually `render={<Button variant=\"ghost\" icon={<Ellipsis />} aria-label=\"More actions\" />}`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function MenuTrigger({ className, ...props }, ref) {\n return <BaseMenu.Trigger ref={ref} {...props} className={withClass('mu-menu-trigger', className)} />;\n});\n\ntype PositionerProps = Pick<\n BaseMenu.Positioner.Props,\n 'side' | 'align' | 'collisionAvoidance' | 'collisionBoundary' | 'sticky' | 'anchor' | 'positionMethod' | 'disableAnchorTracking'\n>;\n\nexport interface PopupProps extends BaseMenu.Popup.Props, PositionerProps {\n /** Where the menu is portaled to. Default `document.body`. */\n container?: BaseMenu.Portal.Props['container'];\n}\n\n/**\n * The list of items. Also the popup of a submenu, inside `SubmenuRoot`. When it\n * opens to the side of its trigger (a submenu, or a panel row's own menu),\n * aligned to the start or end, it moves along the trigger by its own top\n * padding (read when it is placed, so it follows `space-1`): its first row\n * lines up with the trigger, or its last row when it opens upward.\n */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function MenuPopup({ container, className, ...props }, ref) {\n const size = useRowSize();\n const popupRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n popupRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n // Base UI reverses the sign when the popup aligns to the trigger's end, so one value serves both.\n // `side` is where it actually opens, after any flip; above, below or centered, it does not move.\n const alignOffset = useCallback(({ side, align }: { side: string; align: string }) => {\n const popup = popupRef.current;\n if (!popup || align === 'center' || side === 'top' || side === 'bottom') return 0;\n return -parseFloat(getComputedStyle(popup).paddingTop) || 0;\n }, []);\n // Beside its trigger, it sits its own padding away, so a submenu's edge meets its parent's edge.\n const sideOffset = useCallback(({ side }: { side: string }) => {\n const popup = popupRef.current;\n if (!popup || side === 'top' || side === 'bottom') return 4;\n return parseFloat(getComputedStyle(popup).paddingTop) || 4;\n }, []);\n const [positioner, rest] = splitPositioner(props);\n return (\n <BaseMenu.Portal container={container}>\n <BaseMenu.Positioner sideOffset={sideOffset} alignOffset={alignOffset} {...positioner} className=\"mu-positioner\">\n <BaseMenu.Popup ref={setRef} {...rest} className={withClass(menuClasses({ size }).popup, className)} />\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n );\n});\n\ninterface RowProps {\n /** A Lucide element before the label. */\n icon?: IconElement;\n /** A keyboard shortcut at the end of the row, such as \"\u2318 D\". */\n shortcut?: ReactNode;\n /** A line of `ink-muted` text under the label, which makes the row two lines tall. Screen readers read it as the item's description. */\n description?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * The shared inside of every row: icon, label, shortcut. With a description,\n * the label and description stack, and the item is named by the label and\n * described by the description.\n */\nfunction useRow({ icon, shortcut, description, children }: RowProps) {\n const id = useId();\n const hasDescription = description !== undefined && description !== null && description !== false;\n const label = <span className={classes.label} id={hasDescription ? `${id}-label` : undefined}>{children}</span>;\n const content = (\n <>\n {icon}\n {hasDescription ? (\n <span className={classes.text}>\n {label}\n <span className={classes.description} id={`${id}-description`}>{description}</span>\n </span>\n ) : (\n label\n )}\n {shortcut !== undefined ? <span className={classes.shortcut}>{shortcut}</span> : null}\n </>\n );\n const aria = hasDescription ? { 'aria-labelledby': `${id}-label`, 'aria-describedby': `${id}-description` } : null;\n return [content, aria] as const;\n}\n\nexport interface ItemProps extends BaseMenu.Item.Props, RowProps {\n /** A destructive action: red text. Put it last, after a Separator. */\n danger?: boolean;\n}\n\n/** One action. */\nexport const Item = forwardRef<HTMLDivElement, ItemProps>(function MenuItem({ icon, shortcut, description, danger = false, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.Item ref={ref} {...aria} {...props} className={withClass(danger ? classes.dangerItem : classes.item, className)}>\n {row}\n </BaseMenu.Item>\n );\n});\n\nexport interface CheckboxItemProps extends BaseMenu.CheckboxItem.Props, RowProps {}\n\n/** An option that turns on or off, with a check at the end. Stays open on click. */\nexport const CheckboxItem = forwardRef<HTMLDivElement, CheckboxItemProps>(function MenuCheckboxItem({ icon, shortcut, description, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.CheckboxItem ref={ref} {...aria} {...props} className={withClass(cx(classes.item, 'mu-menu-checkbox-item'), className)}>\n {row}\n <span className=\"mu-menu-indicator\">\n <BaseMenu.CheckboxItemIndicator render={<Check aria-hidden />} />\n </span>\n </BaseMenu.CheckboxItem>\n );\n});\n\nexport interface RadioGroupProps extends BaseMenu.RadioGroup.Props {}\n\n/** Groups RadioItems: exactly one is chosen. */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function MenuRadioGroup({ className, ...props }, ref) {\n return <BaseMenu.RadioGroup ref={ref} {...props} className={withClass('mu-menu-radio-group', className)} />;\n});\n\nexport interface RadioItemProps extends BaseMenu.RadioItem.Props, RowProps {}\n\n/** One choice in a RadioGroup, with a check at the end when chosen. Stays open on click. */\nexport const RadioItem = forwardRef<HTMLDivElement, RadioItemProps>(function MenuRadioItem({ icon, shortcut, description, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.RadioItem ref={ref} {...aria} {...props} className={withClass(cx(classes.item, 'mu-menu-radio-item'), className)}>\n {row}\n <span className=\"mu-menu-indicator\">\n <BaseMenu.RadioItemIndicator render={<Check aria-hidden />} />\n </span>\n </BaseMenu.RadioItem>\n );\n});\n\nexport interface GroupProps extends BaseMenu.Group.Props {}\n\n/** A labeled set of items. */\nexport const Group = forwardRef<HTMLDivElement, GroupProps>(function MenuGroup({ className, ...props }, ref) {\n return <BaseMenu.Group ref={ref} {...props} className={withClass('mu-menu-group', className)} />;\n});\n\nexport interface GroupLabelProps extends BaseMenu.GroupLabel.Props {}\n\n/** The name of a Group or RadioGroup. */\nexport const GroupLabel = forwardRef<HTMLDivElement, GroupLabelProps>(function MenuGroupLabel({ className, ...props }, ref) {\n return <BaseMenu.GroupLabel ref={ref} {...props} className={withClass(classes.groupLabel, className)} />;\n});\n\nexport interface SeparatorProps extends BaseMenu.Separator.Props {}\n\n/** A line between groups of items. */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function MenuSeparator({ className, ...props }, ref) {\n return <BaseMenu.Separator ref={ref} {...props} className={withClass(classes.separator, className)} />;\n});\n\nexport type SubmenuRootProps = BaseMenu.SubmenuRoot.Props;\n\n/** Holds a SubmenuTrigger and its own Popup. */\nexport const SubmenuRoot = BaseMenu.SubmenuRoot;\n\nexport interface SubmenuTriggerProps extends BaseMenu.SubmenuTrigger.Props {\n icon?: IconElement;\n children?: ReactNode;\n}\n\n/** The row that opens a submenu, with a chevron at the end. */\nexport const SubmenuTrigger = forwardRef<HTMLDivElement, SubmenuTriggerProps>(function MenuSubmenuTrigger({ icon, className, children, ...props }, ref) {\n const [row] = useRow({ icon, children });\n return (\n <BaseMenu.SubmenuTrigger ref={ref} {...props} className={withClass(cx(classes.item, 'mu-menu-submenu-trigger'), className)}>\n {row}\n <ChevronRight className=\"mu-menu-chevron\" aria-hidden />\n </BaseMenu.SubmenuTrigger>\n );\n});\n"],
5
- "mappings": ";AAAA,OAAS,QAAQA,MAAgB,sBACjC,OAAS,SAAAC,EAAO,gBAAAC,MAAoB,eACpC,OAAS,cAAAC,EAAY,eAAAC,EAAa,SAAAC,EAAO,UAAAC,MAA8B,QACvE,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,mBAAA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,UAAA0B,EACDlC,EAACZ,EAAA,CAAa,UAAU,kBAAkB,cAAW,GAAC,GACxD,CAEJ,CAAC",
6
- "names": ["BaseMenu", "Check", "ChevronRight", "forwardRef", "useCallback", "useId", "useRef", "cx", "withClass", "splitPositioner", "SizeContext", "useRowSize", "menuClasses", "Fragment", "jsx", "jsxs", "classes", "Root", "size", "props", "resolved", "Trigger", "className", "ref", "Popup", "container", "popupRef", "setRef", "node", "alignOffset", "side", "align", "popup", "sideOffset", "positioner", "rest", "useRow", "icon", "shortcut", "description", "children", "id", "hasDescription", "label", "content", "aria", "Item", "danger", "row", "CheckboxItem", "RadioGroup", "RadioItem", "Group", "GroupLabel", "Separator", "SubmenuRoot", "SubmenuTrigger"]
4
+ "sourcesContent": ["import { Menu as BaseMenu } from '@base-ui/react/menu';\nimport { Check, ChevronRight } from 'lucide-react';\nimport { forwardRef, useCallback, useId, useRef, type ReactNode } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\nimport { menuClasses } from './classes';\n\nconst classes = /* @__PURE__ */ menuClasses();\n\nexport interface RootProps extends BaseMenu.Root.Props {\n /** Row height of every item: 28 (sm) or 32px (md). */\n size?: Exclude<Size, 'xs'>;\n}\n\n/** Groups a trigger and its menu. */\nexport function Root({ size, ...props }: RootProps) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseMenu.Root {...props} />\n </SizeContext.Provider>\n );\n}\n\nexport interface TriggerProps extends BaseMenu.Trigger.Props {}\n\n/** Opens the menu. Usually `render={<Button variant=\"ghost\" icon={<Ellipsis />} aria-label=\"More actions\" />}`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function MenuTrigger({ className, ...props }, ref) {\n return <BaseMenu.Trigger ref={ref} {...props} className={withClass('mu-menu-trigger', className)} />;\n});\n\ntype PositionerProps = Pick<\n BaseMenu.Positioner.Props,\n 'side' | 'align' | 'collisionAvoidance' | 'collisionBoundary' | 'sticky' | 'anchor' | 'positionMethod' | 'disableAnchorTracking'\n>;\n\nexport interface PopupProps extends BaseMenu.Popup.Props, PositionerProps {\n /** Where the menu is portaled to. Default `document.body`. */\n container?: BaseMenu.Portal.Props['container'];\n}\n\n/**\n * The list of items. Also the popup of a submenu, inside `SubmenuRoot`. When it\n * opens to the side of its trigger (a submenu, or a panel row's own menu),\n * aligned to the start or end, it moves along the trigger by its own top\n * padding and border (read when it is placed): its first row\n * lines up with the trigger, or its last row when it opens upward.\n */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function MenuPopup({ container, className, ...props }, ref) {\n const size = useRowSize();\n const popupRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n popupRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n // Base UI reverses the sign when the popup aligns to the trigger's end, so one value serves both.\n // `side` is where it actually opens, after any flip; above, below or centered, it does not move.\n const alignOffset = useCallback(({ side, align }: { side: string; align: string }) => {\n const popup = popupRef.current;\n if (!popup || align === 'center' || side === 'top' || side === 'bottom') return 0;\n const style = getComputedStyle(popup);\n return -(parseFloat(style.paddingTop) + parseFloat(style.borderTopWidth)) || 0;\n }, []);\n // Beside its trigger, it sits its own padding away, so a submenu's edge meets its parent's edge.\n const sideOffset = useCallback(({ side }: { side: string }) => {\n const popup = popupRef.current;\n if (!popup || side === 'top' || side === 'bottom') return 4;\n const style = getComputedStyle(popup);\n return parseFloat(style.paddingTop) + parseFloat(style.borderTopWidth) || 4;\n }, []);\n const [positioner, rest] = splitPositioner(props);\n return (\n <BaseMenu.Portal container={container}>\n <BaseMenu.Positioner sideOffset={sideOffset} alignOffset={alignOffset} {...positioner} className=\"mu-positioner\">\n <BaseMenu.Popup ref={setRef} {...rest} className={withClass(menuClasses({ size }).popup, className)} />\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n );\n});\n\ninterface RowProps {\n /** A Lucide element before the label. */\n icon?: IconElement;\n /** A keyboard shortcut at the end of the row, such as \"\u2318 D\". */\n shortcut?: ReactNode;\n /** A line of `text-secondary` text under the label, which makes the row two lines tall. Screen readers read it as the item's description. */\n description?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * The shared inside of every row: icon, label, shortcut. With a description,\n * the label and description stack, and the item is named by the label and\n * described by the description.\n */\nfunction useRow({ icon, shortcut, description, children }: RowProps) {\n const id = useId();\n const hasDescription = description !== undefined && description !== null && description !== false;\n const label = <span className={classes.label} id={hasDescription ? `${id}-label` : undefined}>{children}</span>;\n const content = (\n <>\n {icon}\n {hasDescription ? (\n <span className={classes.text}>\n {label}\n <span className={classes.description} id={`${id}-description`}>{description}</span>\n </span>\n ) : (\n label\n )}\n {shortcut !== undefined ? <span className={classes.shortcut}>{shortcut}</span> : null}\n </>\n );\n const aria = hasDescription ? { 'aria-labelledby': `${id}-label`, 'aria-describedby': `${id}-description` } : null;\n return [content, aria] as const;\n}\n\nexport interface ItemProps extends BaseMenu.Item.Props, RowProps {\n /** A destructive action: red text. Put it last, after a Separator. */\n danger?: boolean;\n}\n\n/** One action. */\nexport const Item = forwardRef<HTMLDivElement, ItemProps>(function MenuItem({ icon, shortcut, description, danger = false, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.Item ref={ref} {...aria} {...props} className={withClass(danger ? classes.dangerItem : classes.item, className)}>\n {row}\n </BaseMenu.Item>\n );\n});\n\nexport interface CheckboxItemProps extends BaseMenu.CheckboxItem.Props, RowProps {}\n\n/** An option that turns on or off, with a check at the end. Stays open on click. */\nexport const CheckboxItem = forwardRef<HTMLDivElement, CheckboxItemProps>(function MenuCheckboxItem({ icon, shortcut, description, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.CheckboxItem ref={ref} {...aria} {...props} className={withClass(cx(classes.item, 'mu-menu-checkbox-item'), className)}>\n {row}\n <span className=\"mu-menu-indicator\">\n <BaseMenu.CheckboxItemIndicator render={<Check aria-hidden />} />\n </span>\n </BaseMenu.CheckboxItem>\n );\n});\n\nexport interface RadioGroupProps extends BaseMenu.RadioGroup.Props {}\n\n/** Groups RadioItems: exactly one is chosen. */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function MenuRadioGroup({ className, ...props }, ref) {\n return <BaseMenu.RadioGroup ref={ref} {...props} className={withClass('mu-menu-radio-group', className)} />;\n});\n\nexport interface RadioItemProps extends BaseMenu.RadioItem.Props, RowProps {}\n\n/** One choice in a RadioGroup, with a check at the end when chosen. Stays open on click. */\nexport const RadioItem = forwardRef<HTMLDivElement, RadioItemProps>(function MenuRadioItem({ icon, shortcut, description, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.RadioItem ref={ref} {...aria} {...props} className={withClass(cx(classes.item, 'mu-menu-radio-item'), className)}>\n {row}\n <span className=\"mu-menu-indicator\">\n <BaseMenu.RadioItemIndicator render={<Check aria-hidden />} />\n </span>\n </BaseMenu.RadioItem>\n );\n});\n\nexport interface GroupProps extends BaseMenu.Group.Props {}\n\n/** A labeled set of items. */\nexport const Group = forwardRef<HTMLDivElement, GroupProps>(function MenuGroup({ className, ...props }, ref) {\n return <BaseMenu.Group ref={ref} {...props} className={withClass('mu-menu-group', className)} />;\n});\n\nexport interface GroupLabelProps extends BaseMenu.GroupLabel.Props {}\n\n/** The name of a Group or RadioGroup. */\nexport const GroupLabel = forwardRef<HTMLDivElement, GroupLabelProps>(function MenuGroupLabel({ className, ...props }, ref) {\n return <BaseMenu.GroupLabel ref={ref} {...props} className={withClass(classes.groupLabel, className)} />;\n});\n\nexport interface SeparatorProps extends BaseMenu.Separator.Props {}\n\n/** A line between groups of items. */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function MenuSeparator({ className, ...props }, ref) {\n return <BaseMenu.Separator ref={ref} {...props} className={withClass(classes.separator, className)} />;\n});\n\nexport type SubmenuRootProps = BaseMenu.SubmenuRoot.Props;\n\n/** Holds a SubmenuTrigger and its own Popup. */\nexport const SubmenuRoot = BaseMenu.SubmenuRoot;\n\nexport interface SubmenuTriggerProps extends BaseMenu.SubmenuTrigger.Props {\n icon?: IconElement;\n children?: ReactNode;\n}\n\n/** The row that opens a submenu, with a chevron at the end. */\nexport const SubmenuTrigger = forwardRef<HTMLDivElement, SubmenuTriggerProps>(function MenuSubmenuTrigger({ icon, className, children, ...props }, ref) {\n const [row] = useRow({ icon, children });\n return (\n <BaseMenu.SubmenuTrigger ref={ref} {...props} className={withClass(cx(classes.item, 'mu-menu-submenu-trigger'), className)}>\n {row}\n <ChevronRight className=\"mu-menu-chevron\" aria-hidden />\n </BaseMenu.SubmenuTrigger>\n );\n});\n"],
5
+ "mappings": ";AAAA,OAAS,QAAQA,MAAgB,sBACjC,OAAS,SAAAC,EAAO,gBAAAC,MAAoB,eACpC,OAAS,cAAAC,EAAY,eAAAC,EAAa,SAAAC,EAAO,UAAAC,MAA8B,QACvE,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAExC,OAAS,eAAAC,MAAmB,eActB,OAqFF,YAAAC,EArFE,OAAAC,EAwFE,QAAAC,MAxFF,oBAZN,IAAMC,EAA0BJ,EAAY,EAQrC,SAASK,EAAK,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAAc,CAClD,IAAMC,EAAWT,EAAWO,CAAI,EAChC,OACEJ,EAACJ,EAAY,SAAZ,CAAqB,MAAOU,EAC3B,SAAAN,EAACd,EAAS,KAAT,CAAe,GAAGmB,EAAO,EAC5B,CAEJ,CAKO,IAAME,EAAUlB,EAA4C,SAAqB,CAAE,UAAAmB,EAAW,GAAGH,CAAM,EAAGI,EAAK,CACpH,OAAOT,EAACd,EAAS,QAAT,CAAiB,IAAKuB,EAA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AOT,EAACd,EAAS,MAAT,CAAe,IAAKuB,EAAM,GAAGJ,EAAO,UAAWX,EAAU,gBAAiBc,CAAS,EAAG,CAChG,CAAC,EAKYgC,EAAanD,EAA4C,SAAwB,CAAE,UAAAmB,EAAW,GAAGH,CAAM,EAAGI,EAAK,CAC1H,OAAOT,EAACd,EAAS,WAAT,CAAoB,IAAKuB,EAAM,GAAGJ,EAAO,UAAWX,EAAUQ,EAAQ,WAAYM,CAAS,EAAG,CACxG,CAAC,EAKYiC,EAAYpD,EAA2C,SAAuB,CAAE,UAAAmB,EAAW,GAAGH,CAAM,EAAGI,EAAK,CACvH,OAAOT,EAACd,EAAS,UAAT,CAAmB,IAAKuB,EAAM,GAAGJ,EAAO,UAAWX,EAAUQ,EAAQ,UAAWM,CAAS,EAAG,CACtG,CAAC,EAKYkC,EAAcxD,EAAS,YAQvByD,EAAiBtD,EAAgD,SAA4B,CAAE,KAAAmC,EAAM,UAAAhB,EAAW,SAAAmB,EAAU,GAAGtB,CAAM,EAAGI,EAAK,CACtJ,GAAM,CAAC0B,CAAG,EAAIZ,EAAO,CAAE,KAAAC,EAAM,SAAAG,CAAS,CAAC,EACvC,OACE1B,EAACf,EAAS,eAAT,CAAwB,IAAKuB,EAAM,GAAGJ,EAAO,UAAWX,EAAUD,EAAGS,EAAQ,KAAM,yBAAyB,EAAGM,CAAS,EACtH,UAAA2B,EACDnC,EAACZ,EAAA,CAAa,UAAU,kBAAkB,cAAW,GAAC,GACxD,CAEJ,CAAC",
6
+ "names": ["BaseMenu", "Check", "ChevronRight", "forwardRef", "useCallback", "useId", "useRef", "cx", "withClass", "splitPositioner", "SizeContext", "useRowSize", "menuClasses", "Fragment", "jsx", "jsxs", "classes", "Root", "size", "props", "resolved", "Trigger", "className", "ref", "Popup", "container", "popupRef", "setRef", "node", "alignOffset", "side", "align", "popup", "style", "sideOffset", "positioner", "rest", "useRow", "icon", "shortcut", "description", "children", "id", "hasDescription", "label", "content", "aria", "Item", "danger", "row", "CheckboxItem", "RadioGroup", "RadioItem", "Group", "GroupLabel", "Separator", "SubmenuRoot", "SubmenuTrigger"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/popover/classes.ts"],
4
- "sourcesContent": ["export type PopoverVariant = 'panel' | 'list';\n\nexport interface PopoverClassesOptions {\n /** `panel` pads its content and stacks it `space-3` apart; `list` holds rows with a Menu's `space-1` padding and no gap. */\n variant?: PopoverVariant;\n}\n\n/** The classes of each part of a Popover. */\nexport interface PopoverClasses {\n /** The panel: a surface with `shadow-pop`, `popover-width` wide. */\n popup: string;\n /** The panel's heading. */\n title: string;\n /** One line under the title. */\n description: string;\n}\n\n/**\n * The classes that make an app's own floating panel look like a Popover, such\n * as an emoji picker. See docs/custom-components.md.\n */\nexport function popoverClasses({ variant = 'panel' }: PopoverClassesOptions = {}): PopoverClasses {\n return {\n popup: `mu-popover-popup${variant === 'list' ? ' mu-popover-list' : ''} mu-popup mu-popup-motion mu-base mu-s-md`,\n title: 'mu-popover-title mu-label',\n description: 'mu-popover-description mu-caption',\n };\n}\n"],
4
+ "sourcesContent": ["export type PopoverVariant = 'panel' | 'list';\n\nexport interface PopoverClassesOptions {\n /** `panel` pads its content and stacks it `space-3` apart; `list` holds rows with a Menu's `space-1` padding and no gap. */\n variant?: PopoverVariant;\n}\n\n/** The classes of each part of a Popover. */\nexport interface PopoverClasses {\n /** The panel: a bordered surface, `popover-width` wide. */\n popup: string;\n /** The panel's heading. */\n title: string;\n /** One line under the title. */\n description: string;\n}\n\n/**\n * The classes that make an app's own floating panel look like a Popover, such\n * as an emoji picker. See docs/custom-components.md.\n */\nexport function popoverClasses({ variant = 'panel' }: PopoverClassesOptions = {}): PopoverClasses {\n return {\n popup: `mu-popover-popup${variant === 'list' ? ' mu-popover-list' : ''} mu-popup mu-popup-motion mu-base mu-s-md`,\n title: 'mu-popover-title mu-label',\n description: 'mu-popover-description mu-caption',\n };\n}\n"],
5
5
  "mappings": ";AAqBO,SAASA,EAAe,CAAE,QAAAC,EAAU,OAAQ,EAA2B,CAAC,EAAmB,CAChG,MAAO,CACL,MAAO,mBAAmBA,IAAY,OAAS,mBAAqB,EAAE,4CACtE,MAAO,4BACP,YAAa,mCACf,CACF",
6
6
  "names": ["popoverClasses", "variant"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/popover/index.tsx"],
4
- "sourcesContent": ["import { Popover as BasePopover } from '@base-ui/react/popover';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext } from '../../internal/size';\nimport { popoverClasses, type PopoverVariant } from './classes';\n\nconst classes = /* @__PURE__ */ popoverClasses();\nconst listClasses = /* @__PURE__ */ popoverClasses({ variant: 'list' });\n\nexport type RootProps = BasePopover.Root.Props;\n\n/** Groups a trigger and its popover. */\nexport const Root = BasePopover.Root;\n\nexport interface TriggerProps extends BasePopover.Trigger.Props {}\n\n/** Opens the popover. Usually `render={<Button />}`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function PopoverTrigger({ className, ...props }, ref) {\n return <BasePopover.Trigger ref={ref} {...props} className={withClass('mu-popover-trigger', className)} />;\n});\n\ntype PositionerProps = Pick<\n BasePopover.Positioner.Props,\n 'side' | 'align' | 'collisionAvoidance' | 'collisionBoundary' | 'sticky' | 'anchor' | 'positionMethod' | 'disableAnchorTracking'\n>;\n\nexport interface PopupProps extends BasePopover.Popup.Props, PositionerProps {\n /** Where the popover is portaled to. Default `document.body`. */\n container?: BasePopover.Portal.Props['container'];\n /**\n * `panel` (default) pads its content `space-4` and stacks it `space-3` apart.\n * `list` holds rows, such as an account menu with a header: a Menu's\n * `space-1` padding and no gap, for rows with `menuClasses().item`.\n */\n variant?: PopoverVariant;\n}\n\n/** The panel: a surface with `shadow-pop`, `popover-width` wide. */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function PopoverPopup({ container, variant = 'panel', className, children, ...props }, ref) {\n const [positioner, rest] = splitPositioner(props);\n return (\n <BasePopover.Portal container={container}>\n <BasePopover.Positioner sideOffset={6} {...positioner} className=\"mu-positioner\">\n <BasePopover.Popup ref={ref} {...rest} className={withClass(variant === 'list' ? listClasses.popup : classes.popup, className)}>\n {/* The panel is md wherever it is declared: React context crosses the portal, so a sm toolbar's size would leak in. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n );\n});\n\nexport interface TitleProps extends BasePopover.Title.Props {}\n\n/** The popover's heading, an `<h2>`. Names the popup for screen readers. */\nexport const Title = forwardRef<HTMLHeadingElement, TitleProps>(function PopoverTitle({ className, ...props }, ref) {\n return <BasePopover.Title ref={ref} {...props} className={withClass(classes.title, className)} />;\n});\n\nexport interface DescriptionProps extends BasePopover.Description.Props {}\n\n/** One line under the title, a `<p>`. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function PopoverDescription({ className, ...props }, ref) {\n return <BasePopover.Description ref={ref} {...props} className={withClass(classes.description, className)} />;\n});\n\nexport interface CloseProps extends BasePopover.Close.Props {}\n\n/** Closes the popover. Usually `render={<Button />}`. */\nexport const Close = forwardRef<HTMLButtonElement, CloseProps>(function PopoverClose({ className, ...props }, ref) {\n return <BasePopover.Close ref={ref} {...props} className={withClass('mu-popover-close', className)} />;\n});\n"],
4
+ "sourcesContent": ["import { Popover as BasePopover } from '@base-ui/react/popover';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext } from '../../internal/size';\nimport { popoverClasses, type PopoverVariant } from './classes';\n\nconst classes = /* @__PURE__ */ popoverClasses();\nconst listClasses = /* @__PURE__ */ popoverClasses({ variant: 'list' });\n\nexport type RootProps = BasePopover.Root.Props;\n\n/** Groups a trigger and its popover. */\nexport const Root = BasePopover.Root;\n\nexport interface TriggerProps extends BasePopover.Trigger.Props {}\n\n/** Opens the popover. Usually `render={<Button />}`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function PopoverTrigger({ className, ...props }, ref) {\n return <BasePopover.Trigger ref={ref} {...props} className={withClass('mu-popover-trigger', className)} />;\n});\n\ntype PositionerProps = Pick<\n BasePopover.Positioner.Props,\n 'side' | 'align' | 'collisionAvoidance' | 'collisionBoundary' | 'sticky' | 'anchor' | 'positionMethod' | 'disableAnchorTracking'\n>;\n\nexport interface PopupProps extends BasePopover.Popup.Props, PositionerProps {\n /** Where the popover is portaled to. Default `document.body`. */\n container?: BasePopover.Portal.Props['container'];\n /**\n * `panel` (default) pads its content `space-4` and stacks it `space-3` apart.\n * `list` holds rows, such as an account menu with a header: a Menu's\n * `space-1` padding and no gap, for rows with `menuClasses().item`.\n */\n variant?: PopoverVariant;\n}\n\n/** The panel: a bordered surface, `popover-width` wide. */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function PopoverPopup({ container, variant = 'panel', className, children, ...props }, ref) {\n const [positioner, rest] = splitPositioner(props);\n return (\n <BasePopover.Portal container={container}>\n <BasePopover.Positioner sideOffset={6} {...positioner} className=\"mu-positioner\">\n <BasePopover.Popup ref={ref} {...rest} className={withClass(variant === 'list' ? listClasses.popup : classes.popup, className)}>\n {/* The panel is md wherever it is declared: React context crosses the portal, so a sm toolbar's size would leak in. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n );\n});\n\nexport interface TitleProps extends BasePopover.Title.Props {}\n\n/** The popover's heading, an `<h2>`. Names the popup for screen readers. */\nexport const Title = forwardRef<HTMLHeadingElement, TitleProps>(function PopoverTitle({ className, ...props }, ref) {\n return <BasePopover.Title ref={ref} {...props} className={withClass(classes.title, className)} />;\n});\n\nexport interface DescriptionProps extends BasePopover.Description.Props {}\n\n/** One line under the title, a `<p>`. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function PopoverDescription({ className, ...props }, ref) {\n return <BasePopover.Description ref={ref} {...props} className={withClass(classes.description, className)} />;\n});\n\nexport interface CloseProps extends BasePopover.Close.Props {}\n\n/** Closes the popover. Usually `render={<Button />}`. */\nexport const Close = forwardRef<HTMLButtonElement, CloseProps>(function PopoverClose({ className, ...props }, ref) {\n return <BasePopover.Close ref={ref} {...props} className={withClass('mu-popover-close', className)} />;\n});\n"],
5
5
  "mappings": ";AAAA,OAAS,WAAWA,MAAmB,yBACvC,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,MAAmB,yBAC5B,OAAS,kBAAAC,MAA2C,eAc3C,cAAAC,MAAA,oBAZT,IAAMC,EAA0BF,EAAe,EACzCG,EAA8BH,EAAe,CAAE,QAAS,MAAO,CAAC,EAKzDI,EAAOT,EAAY,KAKnBU,EAAUT,EAA4C,SAAwB,CAAE,UAAAU,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACvH,OAAOP,EAACN,EAAY,QAAZ,CAAoB,IAAKa,EAAM,GAAGD,EAAO,UAAWV,EAAU,qBAAsBS,CAAS,EAAG,CAC1G,CAAC,EAmBYG,EAAQb,EAAuC,SAAsB,CAAE,UAAAc,EAAW,QAAAC,EAAU,QAAS,UAAAL,EAAW,SAAAM,EAAU,GAAGL,CAAM,EAAGC,EAAK,CACtJ,GAAM,CAACK,EAAYC,CAAI,EAAIhB,EAAgBS,CAAK,EAChD,OACEN,EAACN,EAAY,OAAZ,CAAmB,UAAWe,EAC7B,SAAAT,EAACN,EAAY,WAAZ,CAAuB,WAAY,EAAI,GAAGkB,EAAY,UAAU,gBAC/D,SAAAZ,EAACN,EAAY,MAAZ,CAAkB,IAAKa,EAAM,GAAGM,EAAM,UAAWjB,EAAUc,IAAY,OAASR,EAAY,MAAQD,EAAQ,MAAOI,CAAS,EAE3H,SAAAL,EAACF,EAAY,SAAZ,CAAqB,MAAM,KAAM,SAAAa,EAAS,EAC7C,EACF,EACF,CAEJ,CAAC,EAKYG,EAAQnB,EAA2C,SAAsB,CAAE,UAAAU,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAClH,OAAOP,EAACN,EAAY,MAAZ,CAAkB,IAAKa,EAAM,GAAGD,EAAO,UAAWV,EAAUK,EAAQ,MAAOI,CAAS,EAAG,CACjG,CAAC,EAKYU,EAAcpB,EAAmD,SAA4B,CAAE,UAAAU,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACtI,OAAOP,EAACN,EAAY,YAAZ,CAAwB,IAAKa,EAAM,GAAGD,EAAO,UAAWV,EAAUK,EAAQ,YAAaI,CAAS,EAAG,CAC7G,CAAC,EAKYW,EAAQrB,EAA0C,SAAsB,CAAE,UAAAU,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACjH,OAAOP,EAACN,EAAY,MAAZ,CAAkB,IAAKa,EAAM,GAAGD,EAAO,UAAWV,EAAU,mBAAoBS,CAAS,EAAG,CACtG,CAAC",
6
6
  "names": ["BasePopover", "forwardRef", "withClass", "splitPositioner", "SizeContext", "popoverClasses", "jsx", "classes", "listClasses", "Root", "Trigger", "className", "props", "ref", "Popup", "container", "variant", "children", "positioner", "rest", "Title", "Description", "Close"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/select/index.tsx"],
4
- "sourcesContent": ["import { Select as BaseSelect } from '@base-ui/react/select';\nimport { Check, ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react';\nimport { forwardRef, type ReactNode } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\nimport { buttonClasses } from '../button';\n\nexport type RootProps<Value, Multiple extends boolean | undefined = false> = BaseSelect.Root.Props<Value, Multiple> & {\n size?: Exclude<Size, 'xs'>;\n};\n\n/** Groups the trigger and the list, and holds the value. Pass `items` so `Value` shows labels, not raw values. */\nexport function Root<Value, Multiple extends boolean | undefined = false>({ size, ...props }: RootProps<Value, Multiple>) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseSelect.Root {...props} />\n </SizeContext.Provider>\n );\n}\n\nexport interface TriggerProps extends BaseSelect.Trigger.Props {\n /**\n * `neutral` (default) is a raised key, for a value in a form. `ghost` is a\n * flat row that fills with `hover`, for a switcher in a sidebar or toolbar.\n */\n variant?: 'neutral' | 'ghost';\n}\n\n/** A neutral key that shows the value, with a chevron at the end. Holds `Value`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function SelectTrigger({ variant = 'neutral', className, children, ...props }, ref) {\n const size = useRowSize();\n return (\n <BaseSelect.Trigger ref={ref} {...props} className={withClass(`mu-select-trigger ${buttonClasses({ variant, size })}`, className)}>\n {children}\n <BaseSelect.Icon className=\"mu-select-icon\">\n <ChevronsUpDown aria-hidden />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n );\n});\n\nexport interface ValueProps extends BaseSelect.Value.Props {}\n\n/** The chosen item's label, or `placeholder` in `ink-muted`. */\nexport const Value = forwardRef<HTMLSpanElement, ValueProps>(function SelectValue({ className, ...props }, ref) {\n return <BaseSelect.Value ref={ref} {...props} className={withClass('mu-select-value', className)} />;\n});\n\ntype PositionerProps = Pick<\n BaseSelect.Positioner.Props,\n | 'side'\n | 'align'\n | 'collisionAvoidance'\n | 'collisionBoundary'\n | 'sticky'\n | 'anchor'\n | 'positionMethod'\n | 'disableAnchorTracking'\n | 'alignItemWithTrigger'\n>;\n\nexport interface PopupProps extends BaseSelect.Popup.Props, PositionerProps {\n /** Where the list is portaled to. Default `document.body`. */\n container?: BaseSelect.Portal.Props['container'];\n}\n\n/**\n * The list of items. By default it opens over the trigger with the chosen\n * item on top of the value; `alignItemWithTrigger={false}` opens it below.\n */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function SelectPopup({ container, className, children, ...props }, ref) {\n const size = useRowSize();\n const [positioner, rest] = splitPositioner(props);\n return (\n <BaseSelect.Portal container={container}>\n <BaseSelect.Positioner sideOffset={4} {...positioner} className=\"mu-positioner mu-select-positioner\">\n <BaseSelect.Popup ref={ref} {...rest} className={withClass(`mu-select-popup mu-popup mu-popup-motion mu-base mu-s-${size}`, className)}>\n <BaseSelect.ScrollUpArrow className=\"mu-select-scroll-arrow\" render={(arrowProps) => <div {...arrowProps}><ChevronUp aria-hidden /></div>} />\n <BaseSelect.List className=\"mu-select-list\">{children}</BaseSelect.List>\n <BaseSelect.ScrollDownArrow className=\"mu-select-scroll-arrow\" render={(arrowProps) => <div {...arrowProps}><ChevronDown aria-hidden /></div>} />\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n );\n});\n\nexport interface ItemProps extends BaseSelect.Item.Props {\n /** A Lucide element before the label. */\n icon?: IconElement;\n children?: ReactNode;\n}\n\n/** One option, with a check at the end when chosen. */\nexport const Item = forwardRef<HTMLDivElement, ItemProps>(function SelectItem({ icon, className, children, ...props }, ref) {\n return (\n <BaseSelect.Item ref={ref} {...props} className={withClass('mu-select-item', className)}>\n {icon}\n <BaseSelect.ItemText className=\"mu-select-item-text\">{children}</BaseSelect.ItemText>\n <span className=\"mu-select-indicator\">\n {/* The empty children replace Base UI's default \"\u2714\uFE0F\" text inside the svg. */}\n <BaseSelect.ItemIndicator render={<Check aria-hidden />}>{null}</BaseSelect.ItemIndicator>\n </span>\n </BaseSelect.Item>\n );\n});\n\nexport interface GroupProps extends BaseSelect.Group.Props {}\n\n/** A labeled set of items. */\nexport const Group = forwardRef<HTMLDivElement, GroupProps>(function SelectGroup({ className, ...props }, ref) {\n return <BaseSelect.Group ref={ref} {...props} className={withClass('mu-select-group', className)} />;\n});\n\nexport interface GroupLabelProps extends BaseSelect.GroupLabel.Props {}\n\n/** The name of a Group. */\nexport const GroupLabel = forwardRef<HTMLDivElement, GroupLabelProps>(function SelectGroupLabel({ className, ...props }, ref) {\n return <BaseSelect.GroupLabel ref={ref} {...props} className={withClass('mu-select-group-label mu-label-sm', className)} />;\n});\n\nexport interface SeparatorProps extends BaseSelect.Separator.Props {}\n\n/** A line between groups of items. */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function SelectSeparator({ className, ...props }, ref) {\n return <BaseSelect.Separator ref={ref} {...props} className={withClass('mu-select-separator', className)} />;\n});\n"],
4
+ "sourcesContent": ["import { Select as BaseSelect } from '@base-ui/react/select';\nimport { Check, ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react';\nimport { forwardRef, type ReactNode } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\nimport { buttonClasses } from '../button';\n\nexport type RootProps<Value, Multiple extends boolean | undefined = false> = BaseSelect.Root.Props<Value, Multiple> & {\n size?: Exclude<Size, 'xs'>;\n};\n\n/** Groups the trigger and the list, and holds the value. Pass `items` so `Value` shows labels, not raw values. */\nexport function Root<Value, Multiple extends boolean | undefined = false>({ size, ...props }: RootProps<Value, Multiple>) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseSelect.Root {...props} />\n </SizeContext.Provider>\n );\n}\n\nexport interface TriggerProps extends BaseSelect.Trigger.Props {\n /**\n * `neutral` (default) is a flat key, for a value in a form. `ghost` is a\n * flat row that fills with `hover`, for a switcher in a sidebar or toolbar.\n */\n variant?: 'neutral' | 'ghost';\n}\n\n/** A neutral key that shows the value, with a chevron at the end. Holds `Value`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function SelectTrigger({ variant = 'neutral', className, children, ...props }, ref) {\n const size = useRowSize();\n return (\n <BaseSelect.Trigger ref={ref} {...props} className={withClass(`mu-select-trigger ${buttonClasses({ variant, size })}`, className)}>\n {children}\n <BaseSelect.Icon className=\"mu-select-icon\">\n <ChevronsUpDown aria-hidden />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n );\n});\n\nexport interface ValueProps extends BaseSelect.Value.Props {}\n\n/** The chosen item's label, or `placeholder` in `text-secondary`. */\nexport const Value = forwardRef<HTMLSpanElement, ValueProps>(function SelectValue({ className, ...props }, ref) {\n return <BaseSelect.Value ref={ref} {...props} className={withClass('mu-select-value', className)} />;\n});\n\ntype PositionerProps = Pick<\n BaseSelect.Positioner.Props,\n | 'side'\n | 'align'\n | 'collisionAvoidance'\n | 'collisionBoundary'\n | 'sticky'\n | 'anchor'\n | 'positionMethod'\n | 'disableAnchorTracking'\n | 'alignItemWithTrigger'\n>;\n\nexport interface PopupProps extends BaseSelect.Popup.Props, PositionerProps {\n /** Where the list is portaled to. Default `document.body`. */\n container?: BaseSelect.Portal.Props['container'];\n}\n\n/**\n * The list of items. By default it opens over the trigger with the chosen\n * item on top of the value; `alignItemWithTrigger={false}` opens it below.\n */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function SelectPopup({ container, className, children, ...props }, ref) {\n const size = useRowSize();\n const [positioner, rest] = splitPositioner(props);\n return (\n <BaseSelect.Portal container={container}>\n <BaseSelect.Positioner sideOffset={4} {...positioner} className=\"mu-positioner mu-select-positioner\">\n <BaseSelect.Popup ref={ref} {...rest} className={withClass(`mu-select-popup mu-popup mu-popup-motion mu-base mu-s-${size}`, className)}>\n <BaseSelect.ScrollUpArrow className=\"mu-select-scroll-arrow\" render={(arrowProps) => <div {...arrowProps}><ChevronUp aria-hidden /></div>} />\n <BaseSelect.List className=\"mu-select-list\">{children}</BaseSelect.List>\n <BaseSelect.ScrollDownArrow className=\"mu-select-scroll-arrow\" render={(arrowProps) => <div {...arrowProps}><ChevronDown aria-hidden /></div>} />\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n );\n});\n\nexport interface ItemProps extends BaseSelect.Item.Props {\n /** A Lucide element before the label. */\n icon?: IconElement;\n children?: ReactNode;\n}\n\n/** One option, with a check at the end when chosen. */\nexport const Item = forwardRef<HTMLDivElement, ItemProps>(function SelectItem({ icon, className, children, ...props }, ref) {\n return (\n <BaseSelect.Item ref={ref} {...props} className={withClass('mu-select-item', className)}>\n {icon}\n <BaseSelect.ItemText className=\"mu-select-item-text\">{children}</BaseSelect.ItemText>\n <span className=\"mu-select-indicator\">\n {/* The empty children replace Base UI's default \"\u2714\uFE0F\" text inside the svg. */}\n <BaseSelect.ItemIndicator render={<Check aria-hidden />}>{null}</BaseSelect.ItemIndicator>\n </span>\n </BaseSelect.Item>\n );\n});\n\nexport interface GroupProps extends BaseSelect.Group.Props {}\n\n/** A labeled set of items. */\nexport const Group = forwardRef<HTMLDivElement, GroupProps>(function SelectGroup({ className, ...props }, ref) {\n return <BaseSelect.Group ref={ref} {...props} className={withClass('mu-select-group', className)} />;\n});\n\nexport interface GroupLabelProps extends BaseSelect.GroupLabel.Props {}\n\n/** The name of a Group. */\nexport const GroupLabel = forwardRef<HTMLDivElement, GroupLabelProps>(function SelectGroupLabel({ className, ...props }, ref) {\n return <BaseSelect.GroupLabel ref={ref} {...props} className={withClass('mu-select-group-label mu-label-sm', className)} />;\n});\n\nexport interface SeparatorProps extends BaseSelect.Separator.Props {}\n\n/** A line between groups of items. */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function SelectSeparator({ className, ...props }, ref) {\n return <BaseSelect.Separator ref={ref} {...props} className={withClass('mu-select-separator', className)} />;\n});\n"],
5
5
  "mappings": ";AAAA,OAAS,UAAUA,MAAkB,wBACrC,OAAS,SAAAC,EAAO,eAAAC,EAAa,kBAAAC,EAAgB,aAAAC,MAAiB,eAC9D,OAAS,cAAAC,MAAkC,QAC3C,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAExC,OAAS,iBAAAC,MAAqB,qBAWxB,cAAAC,EAiBF,QAAAC,MAjBE,oBAJC,SAASC,EAA0D,CAAE,KAAAC,EAAM,G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X,EAAW,UAAX,CAAqB,IAAKqB,EAAM,GAAGN,EAAO,UAAWT,EAAU,sBAAuBa,CAAS,EAAG,CAC5G,CAAC",
6
6
  "names": ["BaseSelect", "Check", "ChevronDown", "ChevronsUpDown", "ChevronUp", "forwardRef", "withClass", "splitPositioner", "SizeContext", "useRowSize", "buttonClasses", "jsx", "jsxs", "Root", "size", "props", "resolved", "Trigger", "variant", "className", "children", "ref", "Value", "Popup", "container", "positioner", "rest", "arrowProps", "Item", "icon", "Group", "GroupLabel", "Separator"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/table/index.tsx"],
4
- "sourcesContent": ["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { cx } from '../../internal/class-name';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nconst bodyText: Record<Exclude<Size, 'xs'>, string> = { sm: 'mu-caption', md: 'mu-body' };\n\nexport interface RootProps extends ComponentPropsWithoutRef<'table'> {\n /** `sm` for dense admin lists. Sets row height and cell text. */\n size?: Exclude<Size, 'xs'>;\n /** Draws the table in a box: a `line` edge, `radius-lg` corners and a `surface` fill, as a List. */\n bordered?: boolean;\n}\n\n/**\n * A `<table>` with rows separated by `line`. It sits in a box that scrolls\n * sideways when the table is wider than the screen; the ref and every prop go\n * to the `<table>`.\n */\nexport const Root = forwardRef<HTMLTableElement, RootProps>(function TableRoot({ size, bordered = false, className, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <div className={bordered ? 'mu-table-scroll mu-table-bordered' : 'mu-table-scroll'}>\n <table ref={ref} {...props} className={cx('mu-table mu-base', `mu-s-${resolved}`, bodyText[resolved], className)} />\n </div>\n </SizeContext.Provider>\n );\n});\n\nexport interface HeaderProps extends ComponentPropsWithoutRef<'thead'> {}\n\n/** The `<thead>`, holding one Row of Head cells. */\nexport const Header = forwardRef<HTMLTableSectionElement, HeaderProps>(function TableHeader({ className, ...props }, ref) {\n return <thead ref={ref} {...props} className={cx('mu-table-header', className)} />;\n});\n\nexport interface BodyProps extends ComponentPropsWithoutRef<'tbody'> {}\n\n/** The `<tbody>`, holding the data Rows. */\nexport const Body = forwardRef<HTMLTableSectionElement, BodyProps>(function TableBody({ className, ...props }, ref) {\n return <tbody ref={ref} {...props} className={cx('mu-table-body', className)} />;\n});\n\nexport interface RowProps extends ComponentPropsWithoutRef<'tr'> {}\n\n/** A `<tr>`. Body rows highlight with `hover`. */\nexport const Row = forwardRef<HTMLTableRowElement, RowProps>(function TableRow({ className, ...props }, ref) {\n return <tr ref={ref} {...props} className={cx('mu-table-row', className)} />;\n});\n\nexport interface HeadProps extends ComponentPropsWithoutRef<'th'> {\n /** Right-aligns a column of numbers. Set it on the column's Cells too. */\n num?: boolean;\n}\n\n/** A column header, `<th scope=\"col\">` in 12px `ink-muted`. */\nexport const Head = forwardRef<HTMLTableCellElement, HeadProps>(function TableHead({ num = false, scope = 'col', className, ...props }, ref) {\n return <th ref={ref} scope={scope} {...props} className={cx('mu-table-head mu-label-sm', num && 'mu-table-num', className)} />;\n});\n\nexport interface CellProps extends ComponentPropsWithoutRef<'td'> {\n /** Right-aligns a number. */\n num?: boolean;\n /** Secondary text, such as a date, in `ink-muted`. */\n muted?: boolean;\n}\n\n/** A data cell, `<td>`. */\nexport const Cell = forwardRef<HTMLTableCellElement, CellProps>(function TableCell({ num = false, muted = false, className, ...props }, ref) {\n return <td ref={ref} {...props} className={cx('mu-table-cell', num && 'mu-table-num', muted && 'mu-table-muted', className)} />;\n});\n\nexport interface ActionsProps extends ComponentPropsWithoutRef<'div'> {}\n\n/**\n * Two or more row actions side by side in one Cell, such as Edit and Delete\n * Buttons. Like a single Button in a Cell, the group overlaps the cell's\n * padding, so the row keeps its height.\n */\nexport const Actions = forwardRef<HTMLDivElement, ActionsProps>(function TableActions({ className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-table-actions', className)} />;\n});\n\nexport interface CaptionProps extends ComponentPropsWithoutRef<'caption'> {}\n\n/** Names the table, under it in `caption` style. Screen readers read it as the table's name. */\nexport const Caption = forwardRef<HTMLTableCaptionElement, CaptionProps>(function TableCaption({ className, ...props }, ref) {\n return <caption ref={ref} {...props} className={cx('mu-table-caption mu-caption', className)} />;\n});\n"],
4
+ "sourcesContent": ["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { cx } from '../../internal/class-name';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nconst bodyText: Record<Exclude<Size, 'xs'>, string> = { sm: 'mu-caption', md: 'mu-body' };\n\nexport interface RootProps extends ComponentPropsWithoutRef<'table'> {\n /** `sm` for dense admin lists. Sets row height and cell text. */\n size?: Exclude<Size, 'xs'>;\n /** Draws the table in a box: a `line` edge, `radius-lg` corners and a `surface` fill, as a List. */\n bordered?: boolean;\n}\n\n/**\n * A `<table>` with rows separated by `line`. It sits in a box that scrolls\n * sideways when the table is wider than the screen; the ref and every prop go\n * to the `<table>`.\n */\nexport const Root = forwardRef<HTMLTableElement, RootProps>(function TableRoot({ size, bordered = false, className, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <div className={bordered ? 'mu-table-scroll mu-table-bordered' : 'mu-table-scroll'}>\n <table ref={ref} {...props} className={cx('mu-table mu-base', `mu-s-${resolved}`, bodyText[resolved], className)} />\n </div>\n </SizeContext.Provider>\n );\n});\n\nexport interface HeaderProps extends ComponentPropsWithoutRef<'thead'> {}\n\n/** The `<thead>`, holding one Row of Head cells. */\nexport const Header = forwardRef<HTMLTableSectionElement, HeaderProps>(function TableHeader({ className, ...props }, ref) {\n return <thead ref={ref} {...props} className={cx('mu-table-header', className)} />;\n});\n\nexport interface BodyProps extends ComponentPropsWithoutRef<'tbody'> {}\n\n/** The `<tbody>`, holding the data Rows. */\nexport const Body = forwardRef<HTMLTableSectionElement, BodyProps>(function TableBody({ className, ...props }, ref) {\n return <tbody ref={ref} {...props} className={cx('mu-table-body', className)} />;\n});\n\nexport interface RowProps extends ComponentPropsWithoutRef<'tr'> {}\n\n/** A `<tr>`. Body rows highlight with `hover`. */\nexport const Row = forwardRef<HTMLTableRowElement, RowProps>(function TableRow({ className, ...props }, ref) {\n return <tr ref={ref} {...props} className={cx('mu-table-row', className)} />;\n});\n\nexport interface HeadProps extends ComponentPropsWithoutRef<'th'> {\n /** Right-aligns a column of numbers. Set it on the column's Cells too. */\n num?: boolean;\n}\n\n/** A column header, `<th scope=\"col\">` in 13px `text-secondary`. */\nexport const Head = forwardRef<HTMLTableCellElement, HeadProps>(function TableHead({ num = false, scope = 'col', className, ...props }, ref) {\n return <th ref={ref} scope={scope} {...props} className={cx('mu-table-head mu-label-sm', num && 'mu-table-num', className)} />;\n});\n\nexport interface CellProps extends ComponentPropsWithoutRef<'td'> {\n /** Right-aligns a number. */\n num?: boolean;\n /** Secondary text, such as a date, in `text-secondary`. */\n muted?: boolean;\n}\n\n/** A data cell, `<td>`. */\nexport const Cell = forwardRef<HTMLTableCellElement, CellProps>(function TableCell({ num = false, muted = false, className, ...props }, ref) {\n return <td ref={ref} {...props} className={cx('mu-table-cell', num && 'mu-table-num', muted && 'mu-table-muted', className)} />;\n});\n\nexport interface ActionsProps extends ComponentPropsWithoutRef<'div'> {}\n\n/**\n * Two or more row actions side by side in one Cell, such as Edit and Delete\n * Buttons. Like a single Button in a Cell, the group overlaps the cell's\n * padding, so the row keeps its height.\n */\nexport const Actions = forwardRef<HTMLDivElement, ActionsProps>(function TableActions({ className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-table-actions', className)} />;\n});\n\nexport interface CaptionProps extends ComponentPropsWithoutRef<'caption'> {}\n\n/** Names the table, under it in `caption` style. Screen readers read it as the table's name. */\nexport const Caption = forwardRef<HTMLTableCaptionElement, CaptionProps>(function TableCaption({ className, ...props }, ref) {\n return <caption ref={ref} {...props} className={cx('mu-table-caption mu-caption', className)} />;\n});\n"],
5
5
  "mappings":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KO,EAAK,MAAOO,EAAQ,GAAGR,EAAO,UAAWT,EAAG,4BAA6BgB,GAAO,eAAgBR,CAAS,EAAG,CAC9H,CAAC,EAUYU,EAAOnB,EAA4C,SAAmB,CAAE,IAAAiB,EAAM,GAAO,MAAAG,EAAQ,GAAO,UAAAX,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC3I,OAAOP,EAAC,MAAG,IAAKO,EAAM,GAAGD,EAAO,UAAWT,EAAG,gBAAiBgB,GAAO,eAAgBG,GAAS,iBAAkBX,CAAS,EAAG,CAC/H,CAAC,EASYY,EAAUrB,EAAyC,SAAsB,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAClH,OAAOP,EAAC,OAAI,IAAKO,EAAM,GAAGD,EAAO,UAAWT,EAAG,mBAAoBQ,CAAS,EAAG,CACjF,CAAC,EAKYa,EAAUtB,EAAkD,SAAsB,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC3H,OAAOP,EAAC,WAAQ,IAAKO,EAAM,GAAGD,EAAO,UAAWT,EAAG,8BAA+BQ,CAAS,EAAG,CAChG,CAAC",
6
6
  "names": ["forwardRef", "cx", "SizeContext", "useRowSize", "jsx", "bodyText", "Root", "size", "bordered", "className", "props", "ref", "resolved", "Header", "Body", "Row", "Head", "num", "scope", "Cell", "muted", "Actions", "Caption"]
7
7
  }
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import{themeTokens as r}from"./theme-tokens.js";import*as p from"./components/dialog/alert-dialog.js";import*as t from"./components/avatar/index.js";import{Badge as a,badgeClasses as x}from"./components/badge/index.js";import{Button as f,buttonClasses as n}from"./components/button/index.js";import{Checkbox as y}from"./components/checkbox/index.js";import*as i from"./components/collapsible/index.js";import*as P from"./components/combobox/index.js";import*as C from"./components/dialog/index.js";import*as u from"./components/drawer/index.js";import*as d from"./components/field/index.js";import*as g from"./components/field/fieldset.js";import{Input as b,inputClasses as S}from"./components/input/index.js";import{Kbd as k}from"./components/kbd/index.js";import{Link as v}from"./components/link/index.js";import*as O from"./components/list/index.js";import*as h from"./components/form/index.js";import*as w from"./components/menu/index.js";import{menuClasses as G}from"./components/menu/classes.js";import*as I from"./components/popover/index.js";import{popoverClasses as F}from"./components/popover/classes.js";import{Prose as M}from"./components/prose/index.js";import{Radio as K,RadioGroup as V}from"./components/radio-group/index.js";import*as z from"./components/select/index.js";import{Separator as j}from"./components/separator/index.js";import{Skeleton as H}from"./components/skeleton/index.js";import{Spinner as N}from"./components/spinner/index.js";import{Switch as U}from"./components/switch/index.js";import*as W from"./components/table/index.js";import*as X from"./components/tabs/index.js";import{Textarea as Z,textareaClasses as _}from"./components/textarea/index.js";import*as $ from"./components/toast/index.js";import{Toggle as eo}from"./components/toggle/index.js";import{ToggleGroup as po}from"./components/toggle-group/index.js";import*as to from"./components/tooltip/index.js";export{p as AlertDialog,t as Avatar,a as Badge,f as Button,y as Checkbox,i as Collapsible,P as Combobox,C as Dialog,u as Drawer,d as Field,g as Fieldset,h as Form,b as Input,k as Kbd,v as Link,O as List,w as Menu,I as Popover,M as Prose,K as Radio,V as RadioGroup,z as Select,j as Separator,H as Skeleton,N as Spinner,U as Switch,W as Table,X as Tabs,Z as Textarea,$ as Toast,eo as Toggle,po as ToggleGroup,to as Tooltip,x as badgeClasses,n as buttonClasses,S as inputClasses,G as menuClasses,F as popoverClasses,_ as textareaClasses,r as themeTokens};
2
+ import{themeTokens as r}from"./theme-tokens.js";import{offLadderSpacing as t,spacingSteps as s}from"./spacing.js";import*as a from"./components/dialog/alert-dialog.js";import*as x from"./components/avatar/index.js";import{Badge as f,badgeClasses as n}from"./components/badge/index.js";import{Button as i,buttonClasses as y}from"./components/button/index.js";import{Checkbox as C}from"./components/checkbox/index.js";import*as u from"./components/collapsible/index.js";import*as d from"./components/combobox/index.js";import*as g from"./components/dialog/index.js";import*as S from"./components/drawer/index.js";import*as T from"./components/field/index.js";import*as b from"./components/field/fieldset.js";import{Input as k,inputClasses as B}from"./components/input/index.js";import{Kbd as O}from"./components/kbd/index.js";import{Link as w}from"./components/link/index.js";import*as D from"./components/list/index.js";import*as G from"./components/form/index.js";import*as I from"./components/menu/index.js";import{menuClasses as R}from"./components/menu/classes.js";import*as F from"./components/popover/index.js";import{popoverClasses as A}from"./components/popover/classes.js";import{Prose as V}from"./components/prose/index.js";import{Radio as E,RadioGroup as j}from"./components/radio-group/index.js";import*as q from"./components/select/index.js";import{Separator as J}from"./components/separator/index.js";import{Skeleton as Q}from"./components/skeleton/index.js";import{Spinner as W}from"./components/spinner/index.js";import{Switch as Y}from"./components/switch/index.js";import*as Z from"./components/table/index.js";import*as _ from"./components/tabs/index.js";import{Textarea as oo,textareaClasses as eo}from"./components/textarea/index.js";import*as ro from"./components/toast/index.js";import{Toggle as to}from"./components/toggle/index.js";import{ToggleGroup as ao}from"./components/toggle-group/index.js";import*as xo from"./components/tooltip/index.js";export{a as AlertDialog,x as Avatar,f as Badge,i as Button,C as Checkbox,u as Collapsible,d as Combobox,g as Dialog,S as Drawer,T as Field,b as Fieldset,G as Form,k as Input,O as Kbd,w as Link,D as List,I as Menu,F as Popover,V as Prose,E as Radio,j as RadioGroup,q as Select,J as Separator,Q as Skeleton,W as Spinner,Y as Switch,Z as Table,_ as Tabs,oo as Textarea,ro as Toast,to as Toggle,ao as ToggleGroup,xo as Tooltip,n as badgeClasses,y as buttonClasses,B as inputClasses,R as menuClasses,t as offLadderSpacing,A as popoverClasses,s as spacingSteps,eo as textareaClasses,r as themeTokens};
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export type { IconElement, Size, Tone } from './types';\nexport { themeTokens } from './theme-tokens';\n\nexport * as AlertDialog from './components/dialog/alert-dialog';\nexport * as Avatar from './components/avatar';\nexport { Badge, badgeClasses, type BadgeClassesOptions, type BadgeProps } from './components/badge';\nexport { Button, buttonClasses, type ButtonClassesOptions, type ButtonProps, type ButtonVariant } from './components/button';\nexport { Checkbox, type CheckboxProps } from './components/checkbox';\nexport * as Collapsible from './components/collapsible';\nexport * as Combobox from './components/combobox';\nexport * as Dialog from './components/dialog';\nexport * as Drawer from './components/drawer';\nexport type { DrawerSide } from './components/drawer';\nexport * as Field from './components/field';\nexport * as Fieldset from './components/field/fieldset';\nexport { Input, inputClasses, type InputClassesOptions, type InputProps } from './components/input';\nexport { Kbd, type KbdProps } from './components/kbd';\nexport { Link, type LinkProps } from './components/link';\nexport * as List from './components/list';\nexport * as Form from './components/form';\nexport * as Menu from './components/menu';\nexport { menuClasses, type MenuClasses, type MenuClassesOptions } from './components/menu/classes';\nexport * as Popover from './components/popover';\nexport { popoverClasses, type PopoverClasses, type PopoverClassesOptions, type PopoverVariant } from './components/popover/classes';\nexport { Prose, type ProseProps } from './components/prose';\nexport { Radio, RadioGroup, type RadioGroupProps, type RadioProps } from './components/radio-group';\nexport * as Select from './components/select';\nexport { Separator, type SeparatorProps } from './components/separator';\nexport { Skeleton, type SkeletonProps } from './components/skeleton';\nexport { Spinner, type SpinnerProps } from './components/spinner';\nexport { Switch, type SwitchProps } from './components/switch';\nexport * as Table from './components/table';\nexport * as Tabs from './components/tabs';\nexport { Textarea, textareaClasses, type TextareaClassesOptions, type TextareaProps } from './components/textarea';\nexport * as Toast from './components/toast';\nexport { Toggle, type ToggleProps } from './components/toggle';\nexport { ToggleGroup, type ToggleGroupProps } from './components/toggle-group';\nexport * as Tooltip from './components/tooltip';\n"],
5
- "mappings": ";AACA,OAAS,eAAAA,MAAmB,oBAE5B,UAAYC,MAAiB,sCAC7B,UAAYC,MAAY,+BACxB,OAAS,SAAAC,EAAO,gBAAAC,MAA+D,8BAC/E,OAAS,UAAAC,EAAQ,iBAAAC,MAAsF,+BACvG,OAAS,YAAAC,MAAoC,iCAC7C,UAAYC,MAAiB,oCAC7B,UAAYC,MAAc,iCAC1B,UAAYC,MAAY,+BACxB,UAAYC,MAAY,+BAExB,UAAYC,MAAW,8BACvB,UAAYC,MAAc,iCAC1B,OAAS,SAAAC,EAAO,gBAAAC,MAA+D,8BAC/E,OAAS,OAAAC,MAA0B,4BACnC,OAAS,QAAAC,MAA4B,6BACrC,UAAYC,MAAU,6BACtB,UAAYC,MAAU,6BACtB,UAAYC,MAAU,6BACtB,OAAS,eAAAC,MAA8D,+BACvE,UAAYC,MAAa,gCACzB,OAAS,kBAAAC,MAA4F,kCACrG,OAAS,SAAAC,MAA8B,8BACvC,OAAS,SAAAC,EAAO,cAAAC,MAAyD,oCACzE,UAAYC,MAAY,+BACxB,OAAS,aAAAC,MAAsC,kCAC/C,OAAS,YAAAC,MAAoC,iCAC7C,OAAS,WAAAC,MAAkC,gCAC3C,OAAS,UAAAC,MAAgC,+BACzC,UAAYC,MAAW,8BACvB,UAAYC,MAAU,6BACtB,OAAS,YAAAC,EAAU,mBAAAC,MAAwE,iCAC3F,UAAYC,MAAW,8BACvB,OAAS,UAAAC,OAAgC,+BACzC,OAAS,eAAAC,OAA0C,qCACnD,UAAYC,OAAa",
6
- "names": ["themeTokens", "AlertDialog", "Avatar", "Badge", "badgeClasses", "Button", "buttonClasses", "Checkbox", "Collapsible", "Combobox", "Dialog", "Drawer", "Field", "Fieldset", "Input", "inputClasses", "Kbd", "Link", "List", "Form", "Menu", "menuClasses", "Popover", "popoverClasses", "Prose", "Radio", "RadioGroup", "Select", "Separator", "Skeleton", "Spinner", "Switch", "Table", "Tabs", "Textarea", "textareaClasses", "Toast", "Toggle", "ToggleGroup", "Tooltip"]
4
+ "sourcesContent": ["export type { IconElement, Size, Tone } from './types';\nexport { themeTokens } from './theme-tokens';\nexport { offLadderSpacing, spacingSteps } from './spacing';\n\nexport * as AlertDialog from './components/dialog/alert-dialog';\nexport * as Avatar from './components/avatar';\nexport { Badge, badgeClasses, type BadgeClassesOptions, type BadgeProps } from './components/badge';\nexport { Button, buttonClasses, type ButtonClassesOptions, type ButtonProps, type ButtonVariant } from './components/button';\nexport { Checkbox, type CheckboxProps } from './components/checkbox';\nexport * as Collapsible from './components/collapsible';\nexport * as Combobox from './components/combobox';\nexport * as Dialog from './components/dialog';\nexport * as Drawer from './components/drawer';\nexport type { DrawerSide } from './components/drawer';\nexport * as Field from './components/field';\nexport * as Fieldset from './components/field/fieldset';\nexport { Input, inputClasses, type InputClassesOptions, type InputProps } from './components/input';\nexport { Kbd, type KbdProps } from './components/kbd';\nexport { Link, type LinkProps } from './components/link';\nexport * as List from './components/list';\nexport * as Form from './components/form';\nexport * as Menu from './components/menu';\nexport { menuClasses, type MenuClasses, type MenuClassesOptions } from './components/menu/classes';\nexport * as Popover from './components/popover';\nexport { popoverClasses, type PopoverClasses, type PopoverClassesOptions, type PopoverVariant } from './components/popover/classes';\nexport { Prose, type ProseProps } from './components/prose';\nexport { Radio, RadioGroup, type RadioGroupProps, type RadioProps } from './components/radio-group';\nexport * as Select from './components/select';\nexport { Separator, type SeparatorProps } from './components/separator';\nexport { Skeleton, type SkeletonProps } from './components/skeleton';\nexport { Spinner, type SpinnerProps } from './components/spinner';\nexport { Switch, type SwitchProps } from './components/switch';\nexport * as Table from './components/table';\nexport * as Tabs from './components/tabs';\nexport { Textarea, textareaClasses, type TextareaClassesOptions, type TextareaProps } from './components/textarea';\nexport * as Toast from './components/toast';\nexport { Toggle, type ToggleProps } from './components/toggle';\nexport { ToggleGroup, type ToggleGroupProps } from './components/toggle-group';\nexport * as Tooltip from './components/tooltip';\n"],
5
+ "mappings": ";AACA,OAAS,eAAAA,MAAmB,oBAC5B,OAAS,oBAAAC,EAAkB,gBAAAC,MAAoB,eAE/C,UAAYC,MAAiB,sCAC7B,UAAYC,MAAY,+BACxB,OAAS,SAAAC,EAAO,gBAAAC,MAA+D,8BAC/E,OAAS,UAAAC,EAAQ,iBAAAC,MAAsF,+BACvG,OAAS,YAAAC,MAAoC,iCAC7C,UAAYC,MAAiB,oCAC7B,UAAYC,MAAc,iCAC1B,UAAYC,MAAY,+BACxB,UAAYC,MAAY,+BAExB,UAAYC,MAAW,8BACvB,UAAYC,MAAc,iCAC1B,OAAS,SAAAC,EAAO,gBAAAC,MAA+D,8BAC/E,OAAS,OAAAC,MAA0B,4BACnC,OAAS,QAAAC,MAA4B,6BACrC,UAAYC,MAAU,6BACtB,UAAYC,MAAU,6BACtB,UAAYC,MAAU,6BACtB,OAAS,eAAAC,MAA8D,+BACvE,UAAYC,MAAa,gCACzB,OAAS,kBAAAC,MAA4F,kCACrG,OAAS,SAAAC,MAA8B,8BACvC,OAAS,SAAAC,EAAO,cAAAC,MAAyD,oCACzE,UAAYC,MAAY,+BACxB,OAAS,aAAAC,MAAsC,kCAC/C,OAAS,YAAAC,MAAoC,iCAC7C,OAAS,WAAAC,MAAkC,gCAC3C,OAAS,UAAAC,MAAgC,+BACzC,UAAYC,MAAW,8BACvB,UAAYC,MAAU,6BACtB,OAAS,YAAAC,GAAU,mBAAAC,OAAwE,iCAC3F,UAAYC,OAAW,8BACvB,OAAS,UAAAC,OAAgC,+BACzC,OAAS,eAAAC,OAA0C,qCACnD,UAAYC,OAAa",
6
+ "names": ["themeTokens", "offLadderSpacing", "spacingSteps", "AlertDialog", "Avatar", "Badge", "badgeClasses", "Button", "buttonClasses", "Checkbox", "Collapsible", "Combobox", "Dialog", "Drawer", "Field", "Fieldset", "Input", "inputClasses", "Kbd", "Link", "List", "Form", "Menu", "menuClasses", "Popover", "popoverClasses", "Prose", "Radio", "RadioGroup", "Select", "Separator", "Skeleton", "Spinner", "Switch", "Table", "Tabs", "Textarea", "textareaClasses", "Toast", "Toggle", "ToggleGroup", "Tooltip"]
7
7
  }
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+ var p=[4,8,12,16,20,24,32,48,64],a=new Set([0,1,2,...p]),d=/(?<![\w-])-?(?:[pm](?:[xytrblse]|b[se])?|gap(?:-[xy])?|space-[xy])-(?:(\d+(?:\.\d+)?)|\[(\d*\.?\d+)(px|rem)\])(?![\w./-])/g;function i(e){let n=[];for(let[t,s,o,r]of e.matchAll(d)){let c=s!==void 0?Number(s)*4:Number(o)*(r==="rem"?16:1);a.has(c)||n.push(t)}return n}export{i as offLadderSpacing,p as spacingSteps};
3
+ //# sourceMappingURL=spacing.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/spacing.ts"],
4
+ "sourcesContent": ["/**\n * The spacing ladder in px: every gap, margin and padding in a layout is one\n * of these steps, and each step has a job (docs/layout.md#spacing). The token\n * `--mu-space-<n>` is the step of n \u00D7 4px, and a Tailwind CSS class has the\n * same n: `gap-4` and `var(--mu-space-4)` are both 16px.\n */\nexport const spacingSteps = [4, 8, 12, 16, 20, 24, 32, 48, 64] as const;\n\n/** Not steps, but allowed: 0, a 1px nudge, and `inset` (2px), the gap between the items of one cluster. */\nconst allowed = new Set<number>([0, 1, 2, ...spacingSteps]);\n\n/**\n * A Tailwind CSS padding, margin, gap or space-between class whose value is a\n * number or an arbitrary px or rem length: `p-4`, `-mt-1.5`, `gap-x-2`,\n * `px-[10px]`. A variant before it (`md:`, `hover:`) is not part of the match.\n * Other values (`px`, `auto`, a variable, a calc) are never checked, and\n * neither is a longer class that ends the same way (`top-4`, `scroll-p-4`).\n */\nconst spacingClass = /(?<![\\w-])-?(?:[pm](?:[xytrblse]|b[se])?|gap(?:-[xy])?|space-[xy])-(?:(\\d+(?:\\.\\d+)?)|\\[(\\d*\\.?\\d+)(px|rem)\\])(?![\\w./-])/g;\n\n/**\n * The Tailwind CSS padding, margin and gap classes in `source` whose value is\n * not a step of the spacing ladder, as written and in order, so a class used\n * twice is listed twice: `[\"gap-1.5\", \"px-[10px]\"]`.\n *\n * `source` is any text that holds class names: a component file, a\n * stylesheet with `@apply`, a template. An app runs it over its source files\n * in a test (docs/layout.md#spacing-in-an-app). Width, height and position\n * classes are not spacing and are not checked.\n */\nexport function offLadderSpacing(source: string): string[] {\n const found: string[] = [];\n for (const [name, steps, length, unit] of source.matchAll(spacingClass)) {\n const px = steps !== undefined ? Number(steps) * 4 : Number(length) * (unit === 'rem' ? 16 : 1);\n if (!allowed.has(px)) found.push(name);\n }\n return found;\n}\n"],
5
+ "mappings": ";AAMO,IAAMA,EAAe,CAAC,EAAG,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,EAAE,EAGvDC,EAAU,IAAI,IAAY,CAAC,EAAG,EAAG,EAAG,GAAGD,CAAY,CAAC,EASpDE,EAAe,6HAYd,SAASC,EAAiBC,EAA0B,CACzD,IAAMC,EAAkB,CAAC,EACzB,OAAW,CAACC,EAAMC,EAAOC,EAAQC,CAAI,IAAKL,EAAO,SAASF,CAAY,EAAG,CACvE,IAAMQ,EAAKH,IAAU,OAAY,OAAOA,CAAK,EAAI,EAAI,OAAOC,CAAM,GAAKC,IAAS,MAAQ,GAAK,GACxFR,EAAQ,IAAIS,CAAE,GAAGL,EAAM,KAAKC,CAAI,CACvC,CACA,OAAOD,CACT",
6
+ "names": ["spacingSteps", "allowed", "spacingClass", "offLadderSpacing", "source", "found", "name", "steps", "length", "unit", "px"]
7
+ }