@usememos/ui 26.10.2 → 26.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/components/avatar/index.js +3 -0
- package/dist/components/avatar/index.js.map +7 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/badge/index.js.map +7 -0
- package/dist/components/button/index.js +3 -0
- package/dist/components/button/index.js.map +7 -0
- package/dist/components/checkbox/index.js +3 -0
- package/dist/components/checkbox/index.js.map +7 -0
- package/dist/components/collapsible/index.js +3 -0
- package/dist/components/collapsible/index.js.map +7 -0
- package/dist/components/combobox/index.js +3 -0
- package/dist/components/combobox/index.js.map +7 -0
- package/dist/components/dialog/alert-dialog.js +3 -0
- package/dist/components/dialog/alert-dialog.js.map +7 -0
- package/dist/components/dialog/index.js +3 -0
- package/dist/components/dialog/index.js.map +7 -0
- package/dist/components/dialog/parts.js +3 -0
- package/dist/components/dialog/parts.js.map +7 -0
- package/dist/components/field/fieldset.js +3 -0
- package/dist/components/field/fieldset.js.map +7 -0
- package/dist/components/field/index.js +3 -0
- package/dist/components/field/index.js.map +7 -0
- package/dist/components/input/index.js +3 -0
- package/dist/components/input/index.js.map +7 -0
- package/dist/components/kbd/index.js +3 -0
- package/dist/components/kbd/index.js.map +7 -0
- package/dist/components/link/index.js +3 -0
- package/dist/components/link/index.js.map +7 -0
- package/dist/components/menu/classes.js +3 -0
- package/dist/components/menu/classes.js.map +7 -0
- package/dist/components/menu/index.js +3 -0
- package/dist/components/menu/index.js.map +7 -0
- package/dist/components/popover/classes.js +3 -0
- package/dist/components/popover/classes.js.map +7 -0
- package/dist/components/popover/index.js +3 -0
- package/dist/components/popover/index.js.map +7 -0
- package/dist/components/prose/index.js +3 -0
- package/dist/components/prose/index.js.map +7 -0
- package/dist/components/radio-group/index.js +3 -0
- package/dist/components/radio-group/index.js.map +7 -0
- package/dist/components/select/index.js +3 -0
- package/dist/components/select/index.js.map +7 -0
- package/dist/components/separator/index.js +3 -0
- package/dist/components/separator/index.js.map +7 -0
- package/dist/components/skeleton/index.js +3 -0
- package/dist/components/skeleton/index.js.map +7 -0
- package/dist/components/spinner/index.js +3 -0
- package/dist/components/spinner/index.js.map +7 -0
- package/dist/components/switch/index.js +3 -0
- package/dist/components/switch/index.js.map +7 -0
- package/dist/components/table/index.js +3 -0
- package/dist/components/table/index.js.map +7 -0
- package/dist/components/tabs/index.js +3 -0
- package/dist/components/tabs/index.js.map +7 -0
- package/dist/components/textarea/index.js +3 -0
- package/dist/components/textarea/index.js.map +7 -0
- package/dist/components/toast/index.js +3 -0
- package/dist/components/toast/index.js.map +7 -0
- package/dist/components/toggle/index.js +3 -0
- package/dist/components/toggle/index.js.map +7 -0
- package/dist/components/toggle-group/index.js +3 -0
- package/dist/components/toggle-group/index.js.map +7 -0
- package/dist/components/tooltip/index.js +3 -0
- package/dist/components/tooltip/index.js.map +7 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/internal/class-name.js +3 -0
- package/dist/internal/class-name.js.map +7 -0
- package/dist/internal/popup.js +3 -0
- package/dist/internal/popup.js.map +7 -0
- package/dist/internal/size.js +3 -0
- package/dist/internal/size.js.map +7 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +66 -0
- package/dist/theme-tokens.js +3 -0
- package/dist/theme-tokens.js.map +7 -0
- package/dist/tokens.css +1 -1
- package/dist/types/components/badge/index.d.ts +9 -0
- package/dist/types/components/collapsible/index.d.ts +1 -1
- package/dist/types/components/combobox/index.d.ts +2 -2
- package/dist/types/components/field/fieldset.d.ts +1 -1
- package/dist/types/components/field/index.d.ts +1 -1
- package/dist/types/components/input/index.d.ts +11 -1
- package/dist/types/components/menu/classes.d.ts +28 -0
- package/dist/types/components/menu/index.d.ts +2 -2
- package/dist/types/components/popover/classes.d.ts +14 -0
- package/dist/types/components/popover/index.d.ts +1 -1
- package/dist/types/components/select/index.d.ts +2 -2
- package/dist/types/components/spinner/index.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +1 -1
- package/dist/types/components/tabs/index.d.ts +1 -1
- package/dist/types/components/textarea/index.d.ts +11 -1
- package/dist/types/components/tooltip/index.d.ts +1 -1
- package/dist/types/index.d.ts +6 -3
- package/dist/types/internal/popup.d.ts +2 -2
- package/dist/types/internal/size.d.ts +2 -0
- package/dist/types/theme-tokens.d.ts +7 -0
- package/dist/types/types.d.ts +6 -2
- package/dist/types.js +2 -0
- package/dist/types.js.map +7 -0
- package/llms-full.txt +305 -87
- package/llms.txt +1 -0
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -11,9 +11,11 @@ The package ships the tokens, the foundation styles and 28 components, each with
|
|
|
11
11
|
## Use it
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npm install @usememos/ui
|
|
14
|
+
npm install @usememos/ui @base-ui/react@1.9.0 lucide-react
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
`@base-ui/react` is a peer dependency at the exact version the package is built and tested with, so an app that builds its own components on Base UI ships one copy. npm 7 and later install it with the package; check the version in the package's `peerDependencies` when you upgrade.
|
|
18
|
+
|
|
17
19
|
Load the tokens first, then the styles:
|
|
18
20
|
|
|
19
21
|
```ts
|
|
@@ -67,6 +69,10 @@ function NewNote() {
|
|
|
67
69
|
|
|
68
70
|
Components with more than one element are namespaces of parts named after Base UI's (`Menu.Root`, `Menu.Trigger`, `Menu.Popup`). Each part takes Base UI's props, plus the few listed on its docs page.
|
|
69
71
|
|
|
72
|
+
### Your own components
|
|
73
|
+
|
|
74
|
+
For a part the package doesn't ship, build on Base UI and reuse the package's looks: class functions such as `buttonClasses()` and `menuClasses()`, the public `mu-` classes, the `--mu-row-*` variables and the tokens. Apps on Tailwind CSS v4 also load `@usememos/ui/tailwind.css` for `bg-mu-surface` and similar utilities. See [Building your own component](docs/custom-components.md).
|
|
75
|
+
|
|
70
76
|
### For coding agents
|
|
71
77
|
|
|
72
78
|
The package ships `llms.txt`, an index of the docs, and `llms-full.txt`, every docs page in one file. Point an agent at `node_modules/@usememos/ui/llms-full.txt` before it builds a screen.
|
|
@@ -75,6 +81,8 @@ The package ships `llms.txt`, an index of the docs, and `llms-full.txt`, every d
|
|
|
75
81
|
|
|
76
82
|
Set `data-theme="light"`, `"dark"` or `"contrast"` 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.
|
|
77
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).
|
|
85
|
+
|
|
78
86
|
### Inside another page
|
|
79
87
|
|
|
80
88
|
In a browser extension or an embed, mount the UI under a `.mu-root` element or inside a shadow root. The package has no global selectors beyond `:root`, `:host` and `.mu-root`.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Avatar as t}from"@base-ui/react/avatar";import{forwardRef as o}from"react";import{withClass as s}from"../../internal/class-name.js";import{useSize as c}from"../../internal/size.js";import{jsx as m}from"react/jsx-runtime";var P=o(function({size:a,className:e,...r},n){let l=c(a);return m(t.Root,{ref:n,...r,className:s(`mu-avatar-root mu-base mu-s-${l}`,e)})}),b=o(function({className:a,...e},r){return m(t.Image,{ref:r,...e,className:s("mu-avatar-image",a)})}),g=o(function({className:a,...e},r){return m(t.Fallback,{ref:r,...e,className:s("mu-avatar-fallback",a)})});export{g as Fallback,b as Image,P as Root};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/avatar/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Avatar as BaseAvatar } from '@base-ui/react/avatar';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { useSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface RootProps extends BaseAvatar.Root.Props {\n /** 24, 32 or 40px. */\n size?: Size;\n}\n\n/** The circle. Holds an Image and a Fallback. */\nexport const Root = forwardRef<HTMLSpanElement, RootProps>(function AvatarRoot({ size, className, ...props }, ref) {\n const resolved = useSize(size);\n return <BaseAvatar.Root ref={ref} {...props} className={withClass(`mu-avatar-root mu-base mu-s-${resolved}`, className)} />;\n});\n\nexport interface ImageProps extends BaseAvatar.Image.Props {}\n\n/** The photo. Shown once it has loaded. Give it an `alt` with the person's name. */\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(function AvatarImage({ className, ...props }, ref) {\n return <BaseAvatar.Image ref={ref} {...props} className={withClass('mu-avatar-image', className)} />;\n});\n\nexport interface FallbackProps extends BaseAvatar.Fallback.Props {}\n\n/** Initials, shown while there is no photo or it fails to load. */\nexport const Fallback = forwardRef<HTMLSpanElement, FallbackProps>(function AvatarFallback({ className, ...props }, ref) {\n return <BaseAvatar.Fallback ref={ref} {...props} className={withClass('mu-avatar-fallback', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,UAAUA,MAAkB,wBACrC,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,WAAAC,MAAe,yBAWf,cAAAC,MAAA,oBAFF,IAAMC,EAAOJ,EAAuC,SAAoB,CAAE,KAAAK,EAAM,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACjH,IAAMC,EAAWP,EAAQG,CAAI,EAC7B,OAAOF,EAACJ,EAAW,KAAX,CAAgB,IAAKS,EAAM,GAAGD,EAAO,UAAWN,EAAU,+BAA+BQ,CAAQ,GAAIH,CAAS,EAAG,CAC3H,CAAC,EAKYI,EAAQV,EAAyC,SAAqB,CAAE,UAAAM,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC/G,OAAOL,EAACJ,EAAW,MAAX,CAAiB,IAAKS,EAAM,GAAGD,EAAO,UAAWN,EAAU,kBAAmBK,CAAS,EAAG,CACpG,CAAC,EAKYK,EAAWX,EAA2C,SAAwB,CAAE,UAAAM,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACvH,OAAOL,EAACJ,EAAW,SAAX,CAAoB,IAAKS,EAAM,GAAGD,EAAO,UAAWN,EAAU,qBAAsBK,CAAS,EAAG,CAC1G,CAAC",
|
|
6
|
+
"names": ["BaseAvatar", "forwardRef", "withClass", "useSize", "jsx", "Root", "size", "className", "props", "ref", "resolved", "Image", "Fallback"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{mergeProps as p}from"@base-ui/react/merge-props";import{useRender as m}from"@base-ui/react/use-render";import{forwardRef as d}from"react";import{cx as i}from"../../internal/class-name.js";import{Fragment as f,jsxs as g}from"react/jsx-runtime";function u({tone:e="neutral"}={}){return i("mu-badge",`mu-badge-${e}`,"mu-base","mu-s-xs")}var P=d(function({tone:o="neutral",icon:n,render:r,children:t,...s},a){return m({defaultTagName:"span",render:r,ref:a,props:p({className:u({tone:o}),children:g(f,{children:[n,t]})},s)})});export{P as Badge,u as badgeClasses};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/badge/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { forwardRef } from 'react';\nimport { cx } from '../../internal/class-name';\nimport type { IconElement, Tone } from '../../types';\n\nexport interface BadgeProps extends useRender.ComponentProps<'span'> {\n /** A status tone, or `outline` for a quiet label such as visibility. */\n tone?: Tone | 'outline';\n /** A Lucide element before the text, drawn at 12px. */\n icon?: IconElement;\n}\n\nexport interface BadgeClassesOptions {\n tone?: BadgeProps['tone'];\n}\n\n/**\n * The classes that make an element look like a Badge. Use them on an app's\n * own label, such as a tag that is also a link:\n * `<a className={badgeClasses()} href=\"/tags/work\">work</a>`.\n */\nexport function badgeClasses({ tone = 'neutral' }: BadgeClassesOptions = {}) {\n return cx('mu-badge', `mu-badge-${tone}`, 'mu-base', 'mu-s-xs');\n}\n\n/** A tag or status label: one or two words. */\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge({ tone = 'neutral', icon, render, children, ...props }, ref) {\n return useRender({\n defaultTagName: 'span',\n render,\n ref,\n props: mergeProps<'span'>({ className: badgeClasses({ tone }), children: (\n <>\n {icon}\n {children}\n </>\n ) }, props),\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,cAAAA,MAAkB,6BAC3B,OAAS,aAAAC,MAAiB,4BAC1B,OAAS,cAAAC,MAAkB,QAC3B,OAAS,MAAAC,MAAU,+BA8BT,mBAAAC,EAAA,QAAAC,MAAA,oBAXH,SAASC,EAAa,CAAE,KAAAC,EAAO,SAAU,EAAyB,CAAC,EAAG,CAC3E,OAAOJ,EAAG,WAAY,YAAYI,CAAI,GAAI,UAAW,SAAS,CAChE,CAGO,IAAMC,EAAQN,EAAwC,SAAe,CAAE,KAAAK,EAAO,UAAW,KAAAE,EAAM,OAAAC,EAAQ,SAAAC,EAAU,GAAGC,CAAM,EAAGC,EAAK,CACvI,OAAOZ,EAAU,CACf,eAAgB,OAChB,OAAAS,EACA,IAAAG,EACA,MAAOb,EAAmB,CAAE,UAAWM,EAAa,CAAE,KAAAC,CAAK,CAAC,EAAG,SACzDF,EAAAD,EAAA,CACG,UAAAK,EACAE,GACH,CACA,EAAGC,CAAK,CAChB,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["mergeProps", "useRender", "forwardRef", "cx", "Fragment", "jsxs", "badgeClasses", "tone", "Badge", "icon", "render", "children", "props", "ref"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Button as B}from"@base-ui/react/button";import{forwardRef as b}from"react";import{cx as y,withClass as z}from"../../internal/class-name.js";import{useSize as x}from"../../internal/size.js";import{jsx as i,jsxs as C}from"react/jsx-runtime";function N({variant:a="neutral",size:n="md",iconOnly:o=!1}={}){return y("mu-button",`mu-button-${a}`,o&&"mu-button-icon","mu-base",`mu-s-${n}`,"mu-focus","mu-hit")}var E=b(function({variant:n="neutral",size:o,icon:s,loading:t=!1,loadingLabel:u,disabled:l,focusableWhenDisabled:m,className:p,children:e,...f},c){let d=x(o),r=s!==void 0&&(e==null||e===!1);return C(B,{ref:c,...f,...t&&u?{"aria-label":u}:null,disabled:l||t,focusableWhenDisabled:t||m,"aria-busy":t||void 0,"data-loading":t?"":void 0,className:z(N({variant:n,size:d,iconOnly:r}),p),children:[s,r?null:i("span",{className:"mu-button-label",children:e}),t?i("span",{className:"mu-spinner","aria-hidden":!0}):null]})});export{E as Button,N as buttonClasses};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 /** 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, loading = false, loadingLabel, disabled, focusableWhenDisabled, className, children, ...props },\n ref,\n) {\n const resolved = useSize(size);\n const iconOnly = icon !== undefined && (children === undefined || children === null || children === false);\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 {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,yBAyCpB,OAWqB,OAAAC,EAXrB,QAAAC,MAAA,oBAZG,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,EAAU,GAAO,aAAAC,EAAc,SAAAC,EAAU,sBAAAC,EAAuB,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EACjIC,EACA,CACA,IAAMC,EAAWjB,EAAQK,CAAI,EACvBC,EAAWE,IAAS,SAAwCM,GAAa,MAAQA,IAAa,IACpG,OACEZ,EAACN,EAAA,CACC,IAAKoB,EACJ,GAAGD,EACH,GAAIN,GAAWC,EAAe,CAAE,aAAcA,CAAa,EAAI,KAChE,SAAUC,GAAYF,EACtB,sBAAuBA,GAAWG,EAClC,YAAWH,GAAW,OACtB,eAAcA,EAAU,GAAK,OAC7B,UAAWV,EAAUI,EAAc,CAAE,QAAAC,EAAS,KAAMa,EAAU,SAAAX,CAAS,CAAC,EAAGO,CAAS,EAEnF,UAAAL,EACAF,EAAW,KAAOL,EAAC,QAAK,UAAU,kBAAmB,SAAAa,EAAS,EAC9DL,EAAUR,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", "loading", "loadingLabel", "disabled", "focusableWhenDisabled", "className", "children", "props", "ref", "resolved"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Checkbox as o}from"@base-ui/react/checkbox";import{Check as n,Minus as h}from"lucide-react";import{forwardRef as p}from"react";import{withClass as f}from"../../internal/class-name.js";import{useSize as x}from"../../internal/size.js";import{jsx as e}from"react/jsx-runtime";var z=p(function({size:r,className:s,...t},i){let c=x(r);return e(o.Root,{ref:i,...t,className:f(`mu-checkbox mu-s-${c} mu-focus mu-hit`,s),children:e(o.Indicator,{className:"mu-checkbox-indicator",render:(m,a)=>e("span",{...m,children:a.indeterminate?e(h,{"aria-hidden":!0}):e(n,{"aria-hidden":!0})})})})});export{z as Checkbox};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/checkbox/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';\nimport { Check, Minus } from 'lucide-react';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { useSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface CheckboxProps extends BaseCheckbox.Root.Props {\n /** Box: 16, 18 or 20px. */\n size?: Size;\n}\n\n/**\n * Includes or excludes one item, saved with a form. Name it with a\n * `Field.Label` around it, or `aria-label`.\n */\nexport const Checkbox = forwardRef<HTMLElement, CheckboxProps>(function Checkbox({ size, className, ...props }, ref) {\n const resolved = useSize(size);\n return (\n <BaseCheckbox.Root ref={ref} {...props} className={withClass(`mu-checkbox mu-s-${resolved} mu-focus mu-hit`, className)}>\n <BaseCheckbox.Indicator\n className=\"mu-checkbox-indicator\"\n render={(indicatorProps, state) => (\n <span {...indicatorProps}>{state.indeterminate ? <Minus aria-hidden /> : <Check aria-hidden />}</span>\n )}\n />\n </BaseCheckbox.Root>\n );\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,YAAYA,MAAoB,0BACzC,OAAS,SAAAC,EAAO,SAAAC,MAAa,eAC7B,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,WAAAC,MAAe,yBAmBmC,cAAAC,MAAA,oBAPpD,IAAMC,EAAWJ,EAAuC,SAAkB,CAAE,KAAAK,EAAM,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACnH,IAAMC,EAAWP,EAAQG,CAAI,EAC7B,OACEF,EAACN,EAAa,KAAb,CAAkB,IAAKW,EAAM,GAAGD,EAAO,UAAWN,EAAU,oBAAoBQ,CAAQ,mBAAoBH,CAAS,EACpH,SAAAH,EAACN,EAAa,UAAb,CACC,UAAU,wBACV,OAAQ,CAACa,EAAgBC,IACvBR,EAAC,QAAM,GAAGO,EAAiB,SAAAC,EAAM,cAAgBR,EAACJ,EAAA,CAAM,cAAW,GAAC,EAAKI,EAACL,EAAA,CAAM,cAAW,GAAC,EAAG,EAEnG,EACF,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseCheckbox", "Check", "Minus", "forwardRef", "withClass", "useSize", "jsx", "Checkbox", "size", "className", "props", "ref", "resolved", "indicatorProps", "state"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Collapsible as a}from"@base-ui/react/collapsible";import{ChevronDown as c}from"lucide-react";import{forwardRef as i}from"react";import{withClass as n}from"../../internal/class-name.js";import{SizeContext as f,useRowSize as m}from"../../internal/size.js";import{buttonClasses as g}from"../button/index.js";import{jsx as l,jsxs as P}from"react/jsx-runtime";var v=i(function({size:e,className:o,...r},s){let t=m(e);return l(f.Provider,{value:t,children:l(a.Root,{ref:s,...r,className:n("mu-collapsible",o)})})}),R=i(function({className:e,children:o,...r},s){let t=m();return P(a.Trigger,{ref:s,...r,className:n(`mu-collapsible-trigger ${g({variant:"ghost",size:t})}`,e),children:[l("span",{className:"mu-button-label",children:o}),l(c,{className:"mu-collapsible-chevron","aria-hidden":!0})]})}),z=i(function({className:e,...o},r){return l(a.Panel,{ref:r,...o,className:n("mu-collapsible-panel",e)})});export{z as Panel,v as Root,R as Trigger};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/collapsible/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Collapsible as BaseCollapsible } from '@base-ui/react/collapsible';\nimport { ChevronDown } from 'lucide-react';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { Size } from '../../types';\nimport { buttonClasses } from '../button';\n\nexport interface RootProps extends BaseCollapsible.Root.Props {\n size?: Exclude<Size, 'xs'>;\n}\n\n/** Hides content behind one trigger until people ask for it. Holds a Trigger and a Panel. */\nexport const Root = forwardRef<HTMLDivElement, RootProps>(function CollapsibleRoot({ size, className, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseCollapsible.Root ref={ref} {...props} className={withClass('mu-collapsible', className)} />\n </SizeContext.Provider>\n );\n});\n\nexport interface TriggerProps extends BaseCollapsible.Trigger.Props {}\n\n/** A ghost key with a chevron at the end that turns while the panel is open. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function CollapsibleTrigger({ className, children, ...props }, ref) {\n const size = useRowSize();\n return (\n <BaseCollapsible.Trigger ref={ref} {...props} className={withClass(`mu-collapsible-trigger ${buttonClasses({ variant: 'ghost', size })}`, className)}>\n <span className=\"mu-button-label\">{children}</span>\n <ChevronDown className=\"mu-collapsible-chevron\" aria-hidden />\n </BaseCollapsible.Trigger>\n );\n});\n\nexport interface PanelProps extends BaseCollapsible.Panel.Props {}\n\n/** The hidden content. It fades and rises in; its height does not animate. */\nexport const Panel = forwardRef<HTMLDivElement, PanelProps>(function CollapsiblePanel({ className, ...props }, ref) {\n return <BaseCollapsible.Panel ref={ref} {...props} className={withClass('mu-collapsible-panel', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,eAAeA,MAAuB,6BAC/C,OAAS,eAAAC,MAAmB,eAC5B,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAExC,OAAS,iBAAAC,MAAqB,qBAWxB,cAAAC,EAWF,QAAAC,MAXE,oBAJC,IAAMC,EAAOP,EAAsC,SAAyB,CAAE,KAAAQ,EAAM,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACrH,IAAMC,EAAWT,EAAWK,CAAI,EAChC,OACEH,EAACH,EAAY,SAAZ,CAAqB,MAAOU,EAC3B,SAAAP,EAACP,EAAgB,KAAhB,CAAqB,IAAKa,EAAM,GAAGD,EAAO,UAAWT,EAAU,iBAAkBQ,CAAS,EAAG,EAChG,CAEJ,CAAC,EAKYI,EAAUb,EAA4C,SAA4B,CAAE,UAAAS,EAAW,SAAAK,EAAU,GAAGJ,CAAM,EAAGC,EAAK,CACrI,IAAMH,EAAOL,EAAW,EACxB,OACEG,EAACR,EAAgB,QAAhB,CAAwB,IAAKa,EAAM,GAAGD,EAAO,UAAWT,EAAU,0BAA0BG,EAAc,CAAE,QAAS,QAAS,KAAAI,CAAK,CAAC,CAAC,GAAIC,CAAS,EACjJ,UAAAJ,EAAC,QAAK,UAAU,kBAAmB,SAAAS,EAAS,EAC5CT,EAACN,EAAA,CAAY,UAAU,yBAAyB,cAAW,GAAC,GAC9D,CAEJ,CAAC,EAKYgB,EAAQf,EAAuC,SAA0B,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAClH,OAAON,EAACP,EAAgB,MAAhB,CAAsB,IAAKa,EAAM,GAAGD,EAAO,UAAWT,EAAU,uBAAwBQ,CAAS,EAAG,CAC9G,CAAC",
|
|
6
|
+
"names": ["BaseCollapsible", "ChevronDown", "forwardRef", "withClass", "SizeContext", "useRowSize", "buttonClasses", "jsx", "jsxs", "Root", "size", "className", "props", "ref", "resolved", "Trigger", "children", "Panel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Combobox as r}from"@base-ui/react/combobox";import{Check as x,ChevronsUpDown as P,Search as f}from"lucide-react";import{forwardRef as n}from"react";import{cx as d,withClass as a}from"../../internal/class-name.js";import{splitPositioner as C}from"../../internal/popup.js";import{SizeContext as I,useRowSize as b}from"../../internal/size.js";import{jsx as o,jsxs as c}from"react/jsx-runtime";var g=r.Collection,G=r.useFilter;function v({size:p,...e}){let t=b(p);return o(I.Provider,{value:t,children:o(r.Root,{...e})})}var M=n(function({icon:e=o(f,{}),triggerLabel:t="Show options",className:s,style:m,...i},u){let l=b();return c(r.InputGroup,{className:d("mu-input-root mu-combobox-input-root mu-base",`mu-s-${l}`,s),style:m,children:[e!==null?o("span",{className:"mu-input-prefix",children:e}):null,o(r.Input,{ref:u,...i,className:"mu-input"}),o("span",{className:"mu-input-suffix",children:o(r.Trigger,{className:"mu-combobox-trigger mu-focus","aria-label":t,children:o(P,{"aria-hidden":!0})})})]})}),h=n(function({container:e,className:t,...s},m){let i=b(),[u,l]=C(s);return o(r.Portal,{container:e,children:o(r.Positioner,{sideOffset:4,align:"start",...u,className:"mu-positioner",children:o(r.Popup,{ref:m,...l,className:a(`mu-combobox-popup mu-popup mu-popup-motion mu-base mu-s-${i}`,t)})})})}),T=n(function({className:e,...t},s){return o(r.List,{ref:s,...t,className:a("mu-combobox-list",e)})}),z=n(function({icon:e,className:t,children:s,...m},i){return c(r.Item,{ref:i,...m,className:a("mu-combobox-item",t),children:[e,o("span",{className:"mu-combobox-item-text",children:s}),o("span",{className:"mu-combobox-indicator",children:o(r.ItemIndicator,{render:o(x,{"aria-hidden":!0}),children:null})})]})}),R=n(function({className:e,...t},s){return o(r.Empty,{ref:s,...t,className:a("mu-combobox-empty mu-body",e)})}),D=n(function({className:e,...t},s){return o(r.Group,{ref:s,...t,className:a("mu-combobox-group",e)})}),H=n(function({className:e,...t},s){return o(r.GroupLabel,{ref:s,...t,className:a("mu-combobox-group-label mu-label-sm",e)})}),V=n(function({className:e,...t},s){return o(r.Separator,{ref:s,...t,className:a("mu-combobox-separator",e)})});export{g as Collection,R as Empty,D as Group,H as GroupLabel,M as Input,z as Item,T as List,h as Popup,v as Root,V as Separator,G as useFilter};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/combobox/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport { forwardRef, type CSSProperties, 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';\n\n/** Renders the items of one group from grouped `items`, inside a Group. Base UI's part, unstyled. */\nexport const Collection = BaseCombobox.Collection;\n\n/** Base UI's matcher for `filter`, with locale-aware `contains`, `startsWith` and `endsWith`. */\nexport const useFilter = BaseCombobox.useFilter;\n\nexport type RootProps<Value, Multiple extends boolean | undefined = false, Item = Value> = BaseCombobox.Root.Props<Value, Multiple, Item> & {\n size?: Exclude<Size, 'xs'>;\n};\n\n/**\n * Groups the input and the list, and holds the value. Pass `items` so the\n * list filters as people type and `Empty` knows when nothing matches.\n */\nexport function Root<Value, Multiple extends boolean | undefined = false, Item = Value>({ size, ...props }: RootProps<Value, Multiple, Item>) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseCombobox.Root {...props} />\n </SizeContext.Provider>\n );\n}\n\nexport interface InputProps extends Omit<BaseCombobox.Input.Props, 'size' | 'className' | 'style'> {\n /** A Lucide element at the start. Default a search icon; `null` drops it. */\n icon?: IconElement | null;\n /** The accessible name of the chevron that opens the list. Default \"Show options\". */\n triggerLabel?: string;\n /** Classes for the visible box around the input. */\n className?: string;\n /** Styles for the visible box around the input. */\n style?: CSSProperties;\n}\n\n/**\n * The text box people type in: an Input with a search icon and a chevron that\n * opens the list. The ref and every other prop go to the `<input>`;\n * `className` and `style` go to the box around it.\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function ComboboxInput(\n { icon = <Search />, triggerLabel = 'Show options', className, style, ...props },\n ref,\n) {\n const size = useRowSize();\n return (\n <BaseCombobox.InputGroup className={cx('mu-input-root mu-combobox-input-root mu-base', `mu-s-${size}`, className)} style={style}>\n {icon !== null ? <span className=\"mu-input-prefix\">{icon}</span> : null}\n <BaseCombobox.Input ref={ref} {...props} className=\"mu-input\" />\n <span className=\"mu-input-suffix\">\n <BaseCombobox.Trigger className=\"mu-combobox-trigger mu-focus\" aria-label={triggerLabel}>\n <ChevronsUpDown aria-hidden />\n </BaseCombobox.Trigger>\n </span>\n </BaseCombobox.InputGroup>\n );\n});\n\ntype PositionerProps = Pick<\n BaseCombobox.Positioner.Props,\n | 'side'\n | 'align'\n | 'collisionAvoidance'\n | 'collisionBoundary'\n | 'sticky'\n | 'anchor'\n | 'positionMethod'\n | 'disableAnchorTracking'\n>;\n\nexport interface PopupProps extends BaseCombobox.Popup.Props, PositionerProps {\n /** Where the list is portaled to. Default `document.body`. */\n container?: BaseCombobox.Portal.Props['container'];\n}\n\n/** The floating panel under the input. Holds `Empty` and `List`. */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function ComboboxPopup({ container, className, ...props }, ref) {\n const size = useRowSize();\n const [positioner, rest] = splitPositioner(props);\n return (\n <BaseCombobox.Portal container={container}>\n <BaseCombobox.Positioner sideOffset={4} align=\"start\" {...positioner} className=\"mu-positioner\">\n <BaseCombobox.Popup ref={ref} {...rest} className={withClass(`mu-combobox-popup mu-popup mu-popup-motion mu-base mu-s-${size}`, className)} />\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n );\n});\n\nexport interface ListProps extends BaseCombobox.List.Props {}\n\n/** The items. Pass a function child to render each of the root's filtered `items`. */\nexport const List = forwardRef<HTMLDivElement, ListProps>(function ComboboxList({ className, ...props }, ref) {\n return <BaseCombobox.List ref={ref} {...props} className={withClass('mu-combobox-list', className)} />;\n});\n\nexport interface ItemProps extends BaseCombobox.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 ComboboxItem({ icon, className, children, ...props }, ref) {\n return (\n <BaseCombobox.Item ref={ref} {...props} className={withClass('mu-combobox-item', className)}>\n {icon}\n <span className=\"mu-combobox-item-text\">{children}</span>\n <span className=\"mu-combobox-indicator\">\n {/* The empty children replace Base UI's default \"\u2714\uFE0F\" text inside the svg. */}\n <BaseCombobox.ItemIndicator render={<Check aria-hidden />}>{null}</BaseCombobox.ItemIndicator>\n </span>\n </BaseCombobox.Item>\n );\n});\n\nexport interface EmptyProps extends BaseCombobox.Empty.Props {}\n\n/** What shows when nothing matches, such as \"No tags found\". Always mounted, so screen readers hear it. */\nexport const Empty = forwardRef<HTMLDivElement, EmptyProps>(function ComboboxEmpty({ className, ...props }, ref) {\n return <BaseCombobox.Empty ref={ref} {...props} className={withClass('mu-combobox-empty mu-body', className)} />;\n});\n\nexport interface GroupProps extends BaseCombobox.Group.Props {}\n\n/** A labeled set of items. With grouped `items`, render its items with `Collection`. */\nexport const Group = forwardRef<HTMLDivElement, GroupProps>(function ComboboxGroup({ className, ...props }, ref) {\n return <BaseCombobox.Group ref={ref} {...props} className={withClass('mu-combobox-group', className)} />;\n});\n\nexport interface GroupLabelProps extends BaseCombobox.GroupLabel.Props {}\n\n/** The name of a Group. */\nexport const GroupLabel = forwardRef<HTMLDivElement, GroupLabelProps>(function ComboboxGroupLabel({ className, ...props }, ref) {\n return <BaseCombobox.GroupLabel ref={ref} {...props} className={withClass('mu-combobox-group-label mu-label-sm', className)} />;\n});\n\nexport interface SeparatorProps extends BaseCombobox.Separator.Props {}\n\n/** A line between groups of items. */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function ComboboxSeparator({ className, ...props }, ref) {\n return <BaseCombobox.Separator ref={ref} {...props} className={withClass('mu-combobox-separator', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,YAAYA,MAAoB,0BACzC,OAAS,SAAAC,EAAO,kBAAAC,EAAgB,UAAAC,MAAc,eAC9C,OAAS,cAAAC,MAAsD,QAC/D,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAqBlC,cAAAC,EA2BF,QAAAC,M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Ya,EAAY9B,EAA2C,SAA2B,CAAE,UAAAiB,EAAW,GAAGL,CAAM,EAAGO,EAAK,CAC3H,OAAOb,EAACV,EAAa,UAAb,CAAuB,IAAKuB,EAAM,GAAGP,EAAO,UAAWV,EAAU,wBAAyBe,CAAS,EAAG,CAChH,CAAC",
|
|
6
|
+
"names": ["BaseCombobox", "Check", "ChevronsUpDown", "Search", "forwardRef", "cx", "withClass", "splitPositioner", "SizeContext", "useRowSize", "jsx", "jsxs", "Collection", "useFilter", "Root", "size", "props", "resolved", "Input", "icon", "triggerLabel", "className", "style", "ref", "Popup", "container", "positioner", "rest", "List", "Item", "children", "Empty", "Group", "GroupLabel", "Separator"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{AlertDialog as t}from"@base-ui/react/alert-dialog";import{createDialogParts as r}from"./parts.js";var o=r(t,"alert-dialog",!1),s=o.Root,a=o.Trigger,i=o.Popup,l=o.Title,n=o.Description,P=o.Close,c=o.Footer;export{P as Close,n as Description,c as Footer,i as Popup,s as Root,l as Title,a as Trigger};
|
|
3
|
+
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/dialog/alert-dialog.tsx"],
|
|
4
|
+
"sourcesContent": ["import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog';\nimport type { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport type { ForwardRefExoticComponent, RefAttributes } from 'react';\nimport { createDialogParts, type PopupProps as SharedPopupProps } from './parts';\n\nexport type { CloseProps, DescriptionProps, FooterProps, RootProps, TitleProps, TriggerProps } from './parts';\nexport type PopupProps = SharedPopupProps;\n\n// AlertDialog has Dialog's anatomy; it only stays open on a backdrop click.\nconst parts = createDialogParts(BaseAlertDialog as unknown as typeof BaseDialog, 'alert-dialog', false);\n\n/** Groups a trigger and a confirmation. Closes only through its buttons. */\nexport const Root = parts.Root;\n/** Opens the confirmation. Usually `render={<Button />}`. */\nexport const Trigger = parts.Trigger;\n/** The panel over a dimmed backdrop, without an X. A sheet from the bottom below `breakpoint-sm`. */\nexport const Popup = parts.Popup as ForwardRefExoticComponent<PopupProps & RefAttributes<HTMLDivElement>>;\n/** The question, an `<h2>`: \"Delete this note?\". */\nexport const Title = parts.Title;\n/** What will happen, a `<p>` under the title. */\nexport const Description = parts.Description;\n/** Closes the confirmation: the Cancel button. */\nexport const Close = parts.Close;\n/** Right-aligns Cancel and the action. Stacks them full width in a sheet. */\nexport const Footer = parts.Footer;\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,eAAeA,MAAuB,8BAG/C,OAAS,qBAAAC,MAA8D,aAMvE,IAAMC,EAAQD,EAAkBD,EAAiD,eAAgB,EAAK,EAGzFG,EAAOD,EAAM,KAEbE,EAAUF,EAAM,QAEhBG,EAAQH,EAAM,MAEdI,EAAQJ,EAAM,MAEdK,EAAcL,EAAM,YAEpBM,EAAQN,EAAM,MAEdO,EAASP,EAAM",
|
|
6
|
+
"names": ["BaseAlertDialog", "createDialogParts", "parts", "Root", "Trigger", "Popup", "Title", "Description", "Close", "Footer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Dialog as r}from"@base-ui/react/dialog";import{createDialogParts as t}from"./parts.js";var o=t(r,"dialog",!0),s=o.Root,i=o.Trigger,a=o.Popup,n=o.Title,P=o.Description,c=o.Close,l=o.Footer;export{c as Close,P as Description,l as Footer,a as Popup,s as Root,n as Title,i as Trigger};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/dialog/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport type { ForwardRefExoticComponent, RefAttributes } from 'react';\nimport { createDialogParts, type PopupProps as SharedPopupProps } from './parts';\n\nexport type { CloseProps, DescriptionProps, FooterProps, RootProps, TitleProps, TriggerProps } from './parts';\n\nexport interface PopupProps extends SharedPopupProps {\n /** The accessible name of the X button at the top right. Default \"Close\". */\n closeLabel?: string;\n}\n\nconst parts = createDialogParts(BaseDialog, 'dialog', true);\n\n/** Groups a trigger and its dialog. Controlled with `open` and `onOpenChange`. */\nexport const Root = parts.Root;\n/** Opens the dialog. Usually `render={<Button />}`. */\nexport const Trigger = parts.Trigger;\n/** The panel over a dimmed backdrop, with an X at the top right. A sheet from the bottom below `breakpoint-sm`. */\nexport const Popup = parts.Popup as ForwardRefExoticComponent<PopupProps & RefAttributes<HTMLDivElement>>;\n/** The dialog's heading, an `<h2>`: a question or a task. */\nexport const Title = parts.Title;\n/** What will happen, a `<p>` under the title. */\nexport const Description = parts.Description;\n/** Closes the dialog. Usually `render={<Button variant=\"ghost\" />}` for Cancel. */\nexport const Close = parts.Close;\n/** Right-aligns the buttons at the end of the dialog: Cancel, then the action. Stacks them full width in a sheet. */\nexport const Footer = parts.Footer;\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,UAAUA,MAAkB,wBAErC,OAAS,qBAAAC,MAA8D,aASvE,IAAMC,EAAQD,EAAkBD,EAAY,SAAU,EAAI,EAG7CG,EAAOD,EAAM,KAEbE,EAAUF,EAAM,QAEhBG,EAAQH,EAAM,MAEdI,EAAQJ,EAAM,MAEdK,EAAcL,EAAM,YAEpBM,EAAQN,EAAM,MAEdO,EAASP,EAAM",
|
|
6
|
+
"names": ["BaseDialog", "createDialogParts", "parts", "Root", "Trigger", "Popup", "Title", "Description", "Close", "Footer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{X as b}from"lucide-react";import{forwardRef as s}from"react";import{cx as n,withClass as l}from"../../internal/class-name.js";import{Button as C}from"../button/index.js";import{jsx as i,jsxs as u}from"react/jsx-runtime";function v(t,p,g){let c=s(function({className:o,...e},r){return i(t.Trigger,{ref:r,...e,className:l(`mu-${p}-trigger`,o)})}),m=s(function({container:o,sheet:e=!0,closeLabel:r="Close",className:T,children:x,...H},L){return u(t.Portal,{container:o,children:[i(t.Backdrop,{className:"mu-dialog-backdrop"}),i(t.Viewport,{className:n("mu-dialog-viewport",e&&"mu-dialog-sheet"),children:u(t.Popup,{ref:L,...H,className:l(`mu-dialog-popup mu-${p}-popup mu-popup mu-base mu-s-md`,T),children:[x,g?i(t.Close,{className:"mu-dialog-x",render:i(C,{variant:"ghost",size:"sm",icon:i(b,{}),"aria-label":r})}):null]})})]})}),P=s(function({className:o,...e},r){return i(t.Title,{ref:r,...e,className:l("mu-dialog-title mu-title",o)})}),f=s(function({className:o,...e},r){return i(t.Description,{ref:r,...e,className:l("mu-dialog-description mu-body",o)})}),D=s(function({className:o,...e},r){return i(t.Close,{ref:r,...e,className:l(`mu-${p}-close`,o)})}),d=s(function({className:o,...e},r){return i("div",{ref:r,...e,className:n("mu-dialog-footer",o)})});return{Root:t.Root,Trigger:c,Popup:m,Title:P,Description:f,Close:D,Footer:d}}export{v as createDialogParts};
|
|
3
|
+
//# sourceMappingURL=parts.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { 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}\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 & { closeLabel?: string }>(function DialogPopup(\n { container, sheet = true, closeLabel = 'Close', className, children, ...props },\n ref,\n ) {\n return (\n <Base.Portal container={container}>\n <Base.Backdrop className=\"mu-dialog-backdrop\" />\n <Base.Viewport className={cx('mu-dialog-viewport', sheet && 'mu-dialog-sheet')}>\n <Base.Popup ref={ref} {...props} className={withClass(`mu-dialog-popup mu-${name}-popup mu-popup mu-base mu-s-md`, className)}>\n {children}\n {closeButton ? (\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
|
+
"mappings": ";AACA,OAAS,KAAAA,MAAS,eAClB,OAAS,cAAAC,MAAuC,QAChD,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,UAAAC,MAAc,qBAqBZ,cAAAC,EAWD,QAAAC,MAXC,oBAFJ,SAASC,EAAkBC,EAAyBC,EAAiCC,EAAsB,CAChH,IAAMC,EAAUV,EAA4C,SAAuB,CAAE,UAAAW,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC/G,OAAOT,EAACG,EAAK,QAAL,CAAa,IAAKM,EAAM,GAAGD,EAAO,UAAWV,EAAU,MAAMM,CAAI,WAAYG,CAAS,EAAG,CACnG,CAAC,EAEKG,EAAQd,EAAiE,SAC7E,CAAE,UAAAe,EAAW,MAAAC,EAAQ,GAAM,WAAAC,EAAa,QAAS,UAAAN,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAC/EC,EACA,CACA,OACER,EAACE,EAAK,OAAL,CAAY,UAAWQ,EACtB,UAAAX,EAACG,EAAK,SAAL,CAAc,UAAU,qBAAqB,EAC9CH,EAACG,EAAK,SAAL,CAAc,UAAWN,EAAG,qBAAsBe,GAAS,iBAAiB,EAC3E,SAAAX,EAACE,EAAK,MAAL,CAAW,IAAKM,EAAM,GAAGD,EAAO,UAAWV,EAAU,sBAAsBM,CAAI,kCAAmCG,CAAS,EACzH,UAAAO,EACAT,EACCL,EAACG,EAAK,MAAL,CAAW,UAAU,cAAc,OAAQH,EAACD,EAAA,CAAO,QAAQ,QAAQ,KAAK,KAAK,KAAMC,EAACL,EAAA,EAAE,EAAI,aAAYkB,EAAY,EAAI,EACrH,MACN,EACF,GACF,CAEJ,CAAC,EAEKE,EAAQnB,EAA2C,SAAqB,CAAE,UAAAW,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC1G,OAAOT,EAACG,EAAK,MAAL,CAAW,IAAKM,EAAM,GAAGD,EAAO,UAAWV,EAAU,2BAA4BS,CAAS,EAAG,CACvG,CAAC,EAEKS,EAAcpB,EAAmD,SAA2B,CAAE,UAAAW,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC9H,OAAOT,EAACG,EAAK,YAAL,CAAiB,IAAKM,EAAM,GAAGD,EAAO,UAAWV,EAAU,gCAAiCS,CAAS,EAAG,CAClH,CAAC,EAEKU,EAAQrB,EAA0C,SAAqB,CAAE,UAAAW,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzG,OAAOT,EAACG,EAAK,MAAL,CAAW,IAAKM,EAAM,GAAGD,EAAO,UAAWV,EAAU,MAAMM,CAAI,SAAUG,CAAS,EAAG,CAC/F,CAAC,EAEKW,EAAStB,EAAwC,SAAsB,CAAE,UAAAW,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzG,OAAOT,EAAC,OAAI,IAAKS,EAAM,GAAGD,EAAO,UAAWX,EAAG,mBAAoBU,CAAS,EAAG,CACjF,CAAC,EAED,MAAO,CAAE,KAAMJ,EAAK,KAAM,QAAAG,EAAS,MAAAI,EAAO,MAAAK,EAAO,YAAAC,EAAa,MAAAC,EAAO,OAAAC,CAAO,CAC9E",
|
|
6
|
+
"names": ["X", "forwardRef", "cx", "withClass", "Button", "jsx", "jsxs", "createDialogParts", "Base", "name", "closeButton", "Trigger", "className", "props", "ref", "Popup", "container", "sheet", "closeLabel", "children", "Title", "Description", "Close", "Footer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Fieldset as s}from"@base-ui/react/fieldset";import{forwardRef as i}from"react";import{withClass as d}from"../../internal/class-name.js";import{SizeContext as m,useRowSize as f}from"../../internal/size.js";import{jsx as r}from"react/jsx-runtime";var L=i(function({size:e,className:o,...t},l){let p=f(e);return r(m.Provider,{value:p,children:r(s.Root,{ref:l,...t,className:d("mu-fieldset-root",o)})})}),P=i(function({className:e,...o},t){return r(s.Legend,{ref:t,...o,className:d("mu-fieldset-legend mu-label",e)})});export{P as Legend,L as Root};
|
|
3
|
+
//# sourceMappingURL=fieldset.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/field/fieldset.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Fieldset as BaseFieldset } from '@base-ui/react/fieldset';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface RootProps extends BaseFieldset.Root.Props {\n size?: Exclude<Size, 'xs'>;\n}\n\n/** A group of checkboxes, radios or switches with one legend. */\nexport const Root = forwardRef<HTMLFieldSetElement, RootProps>(function FieldsetRoot({ size, className, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseFieldset.Root ref={ref} {...props} className={withClass('mu-fieldset-root', className)} />\n </SizeContext.Provider>\n );\n});\n\nexport interface LegendProps extends BaseFieldset.Legend.Props {}\n\n/** The group's name. */\nexport const Legend = forwardRef<HTMLDivElement, LegendProps>(function FieldsetLegend({ className, ...props }, ref) {\n return <BaseFieldset.Legend ref={ref} {...props} className={withClass('mu-fieldset-legend mu-label', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,YAAYA,MAAoB,0BACzC,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAYlC,cAAAC,MAAA,oBAJC,IAAMC,EAAOL,EAA2C,SAAsB,CAAE,KAAAM,EAAM,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACvH,IAAMC,EAAWP,EAAWG,CAAI,EAChC,OACEF,EAACF,EAAY,SAAZ,CAAqB,MAAOQ,EAC3B,SAAAN,EAACL,EAAa,KAAb,CAAkB,IAAKU,EAAM,GAAGD,EAAO,UAAWP,EAAU,mBAAoBM,CAAS,EAAG,EAC/F,CAEJ,CAAC,EAKYI,EAASX,EAAwC,SAAwB,CAAE,UAAAO,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAClH,OAAOL,EAACL,EAAa,OAAb,CAAoB,IAAKU,EAAM,GAAGD,EAAO,UAAWP,EAAU,8BAA+BM,CAAS,EAAG,CACnH,CAAC",
|
|
6
|
+
"names": ["BaseFieldset", "forwardRef", "withClass", "SizeContext", "useRowSize", "jsx", "Root", "size", "className", "props", "ref", "resolved", "Legend"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Field as i}from"@base-ui/react/field";import{CircleAlert as m}from"lucide-react";import{forwardRef as s}from"react";import{withClass as n}from"../../internal/class-name.js";import{SizeContext as c,useRowSize as d}from"../../internal/size.js";import{jsx as t,jsxs as f}from"react/jsx-runtime";var L=s(function({size:e,className:r,...o},a){let p=d(e);return t(c.Provider,{value:p,children:t(i.Root,{ref:a,...o,className:n("mu-field-root",r)})})}),b=s(function({className:e,...r},o){return t(i.Label,{ref:o,...r,className:n("mu-field-label mu-label",e)})}),D=s(function({className:e,...r},o){return t(i.Item,{ref:o,...r,className:n("mu-field-item",e)})}),R=s(function({className:e,...r},o){return t(i.Description,{ref:o,...r,className:n("mu-field-description mu-caption",e)})}),v=s(function({className:e,children:r,...o},a){return f(i.Error,{ref:a,...o,className:n("mu-field-error mu-caption",e),children:[t(m,{className:"mu-icon","aria-hidden":!0}),t("span",{children:r})]})});export{R as Description,v as Error,D as Item,b as Label,L as Root};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/field/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Field as BaseField } from '@base-ui/react/field';\nimport { CircleAlert } from 'lucide-react';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface RootProps extends BaseField.Root.Props {\n /** The size of the control inside, passed on to it. */\n size?: Exclude<Size, 'xs'>;\n}\n\n/** One control with its label, description and error, wired for screen readers. */\nexport const Root = forwardRef<HTMLDivElement, RootProps>(function FieldRoot({ size, className, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseField.Root ref={ref} {...props} className={withClass('mu-field-root', className)} />\n </SizeContext.Provider>\n );\n});\n\nexport interface LabelProps extends BaseField.Label.Props {}\n\n/** The label above a text control, or beside a Checkbox, Switch or Radio placed inside it. */\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(function FieldLabel({ className, ...props }, ref) {\n return <BaseField.Label ref={ref} {...props} className={withClass('mu-field-label mu-label', className)} />;\n});\n\nexport interface ItemProps extends BaseField.Item.Props {}\n\n/** One option of a checkbox or radio group inside a Field: holds a Field.Label around the control. */\nexport const Item = forwardRef<HTMLDivElement, ItemProps>(function FieldItem({ className, ...props }, ref) {\n return <BaseField.Item ref={ref} {...props} className={withClass('mu-field-item', className)} />;\n});\n\nexport interface DescriptionProps extends BaseField.Description.Props {}\n\n/** One line of help under the control. Hidden while the field shows an error. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function FieldDescription({ className, ...props }, ref) {\n return <BaseField.Description ref={ref} {...props} className={withClass('mu-field-description mu-caption', className)} />;\n});\n\nexport interface ErrorProps extends BaseField.Error.Props {}\n\n/** What is wrong and how to fix it, after a CircleAlert icon. Shown when the field is invalid. */\nexport const Error = forwardRef<HTMLDivElement, ErrorProps>(function FieldError({ className, children, ...props }, ref) {\n return (\n <BaseField.Error ref={ref} {...props} className={withClass('mu-field-error mu-caption', className)}>\n <CircleAlert className=\"mu-icon\" aria-hidden />\n <span>{children}</span>\n </BaseField.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UAAWR,EAAU,4BAA6BO,CAAS,EAC/F,UAAAJ,EAACL,EAAA,CAAY,UAAU,UAAU,cAAW,GAAC,EAC7CK,EAAC,QAAM,SAAAY,EAAS,GAClB,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseField", "CircleAlert", "forwardRef", "withClass", "SizeContext", "useRowSize", "jsx", "jsxs", "Root", "size", "className", "props", "ref", "resolved", "Label", "Item", "Description", "Error", "children"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Input as l}from"@base-ui/react/input";import{forwardRef as f}from"react";import{cx as n}from"../../internal/class-name.js";import{useRowSize as c}from"../../internal/size.js";import{jsx as e,jsxs as x}from"react/jsx-runtime";function d({size:s="md"}={}){return n("mu-input-root","mu-base",`mu-s-${s}`)}var y=f(function({size:o,prefix:t,suffix:p,className:r,style:i,...u},a){let m=c(o);return x("span",{className:n(d({size:m}),r),style:i,children:[t!==void 0?e("span",{className:"mu-input-prefix",children:t}):null,e(l,{ref:a,...u,className:"mu-input"}),p!==void 0?e("span",{className:"mu-input-suffix",children:p}):null]})});export{y as Input,d as inputClasses};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/input/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Input as BaseInput } from '@base-ui/react/input';\nimport { forwardRef, type CSSProperties, type ReactNode } from 'react';\nimport { cx } from '../../internal/class-name';\nimport { useRowSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface InputProps extends Omit<BaseInput.Props, 'size' | 'prefix' | 'className' | 'style'> {\n size?: Exclude<Size, 'xs'>;\n /** Says what the field is: a search or link icon. */\n prefix?: ReactNode;\n /** One action on the value (copy, clear), or a unit. */\n suffix?: ReactNode;\n /** Classes for the visible box around the input. */\n className?: string;\n /** Styles for the visible box around the input. */\n style?: CSSProperties;\n}\n\nexport interface InputClassesOptions {\n size?: Exclude<Size, 'xs'>;\n}\n\n/**\n * The classes that make an element look like an Input's box. Use them on an\n * app's own one-line field, such as a tag input: focus inside the element\n * shows the ring, and `aria-invalid=\"true\"` or `aria-disabled=\"true\"` on it\n * shows those states. See docs/custom-components.md.\n */\nexport function inputClasses({ size = 'md' }: InputClassesOptions = {}) {\n return cx('mu-input-root', 'mu-base', `mu-s-${size}`);\n}\n\n/**\n * One line of text: flat `surface` with an `edge`. The ref and every other\n * prop go to the `<input>`; `className` and `style` go to the box around it.\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input({ size, prefix, suffix, className, style, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <span className={cx(inputClasses({ size: resolved }), className)} style={style}>\n {prefix !== undefined ? <span className=\"mu-input-prefix\">{prefix}</span> : null}\n <BaseInput ref={ref} {...props} className=\"mu-input\" />\n {suffix !== undefined ? <span className=\"mu-input-suffix\">{suffix}</span> : null}\n </span>\n );\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,SAASA,MAAiB,uBACnC,OAAS,cAAAC,MAAsD,QAC/D,OAAS,MAAAC,MAAU,+BACnB,OAAS,cAAAC,MAAkB,yBAoCvB,OAC0B,OAAAC,EAD1B,QAAAC,MAAA,oBAXG,SAASC,EAAa,CAAE,KAAAC,EAAO,IAAK,EAAyB,CAAC,EAAG,CACtE,OAAOL,EAAG,gBAAiB,UAAW,QAAQK,CAAI,EAAE,CACtD,CAMO,IAAMC,EAAQP,EAAyC,SAAe,CAAE,KAAAM,EAAM,OAAAE,EAAQ,OAAAC,EAAQ,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAM,EAAGC,EAAK,CACtI,IAAMC,EAAWZ,EAAWI,CAAI,EAChC,OACEF,EAAC,QAAK,UAAWH,EAAGI,EAAa,CAAE,KAAMS,CAAS,CAAC,EAAGJ,CAAS,EAAG,MAAOC,EACtE,UAAAH,IAAW,OAAYL,EAAC,QAAK,UAAU,kBAAmB,SAAAK,EAAO,EAAU,KAC5EL,EAACJ,EAAA,CAAU,IAAKc,EAAM,GAAGD,EAAO,UAAU,WAAW,EACpDH,IAAW,OAAYN,EAAC,QAAK,UAAU,kBAAmB,SAAAM,EAAO,EAAU,MAC9E,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseInput", "forwardRef", "cx", "useRowSize", "jsx", "jsxs", "inputClasses", "size", "Input", "prefix", "suffix", "className", "style", "props", "ref", "resolved"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{mergeProps as d}from"@base-ui/react/merge-props";import{useRender as m}from"@base-ui/react/use-render";import{forwardRef as t}from"react";var a=t(function({render:e,...r},o){return m({defaultTagName:"kbd",render:e,ref:o,props:d({className:"mu-kbd mu-label-xs"},r)})});export{a as Kbd};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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"],
|
|
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
|
+
"names": ["mergeProps", "useRender", "forwardRef", "Kbd", "render", "props", "ref"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{mergeProps as i}from"@base-ui/react/merge-props";import{useRender as s}from"@base-ui/react/use-render";import{ArrowUpRight as t}from"lucide-react";import{forwardRef as u}from"react";import{Fragment as f,jsx as p,jsxs as d}from"react/jsx-runtime";var w=u(function({muted:r=!1,external:e=!1,underline:n="hover",render:o,children:a,...l},m){return s({defaultTagName:"a",render:o,ref:m,props:i({className:`mu-link${r?" mu-link-muted":""}${n==="always"?" mu-link-underline":""} mu-focus`,...e?{target:"_blank",rel:"noopener noreferrer"}:null,children:d(f,{children:[a,e?p(t,{className:"mu-icon","aria-hidden":!0}):null]})},l)})});export{w as Link};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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"],
|
|
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
|
+
"names": ["mergeProps", "useRender", "ArrowUpRight", "forwardRef", "Fragment", "jsx", "jsxs", "Link", "muted", "external", "underline", "render", "children", "props", "ref"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
function u({size:e="md"}={}){return{popup:`mu-menu-popup mu-popup mu-popup-motion mu-base mu-s-${e}`,item:"mu-menu-item",dangerItem:"mu-menu-item mu-menu-item-danger",label:"mu-menu-label",shortcut:"mu-menu-shortcut",separator:"mu-menu-separator",groupLabel:"mu-menu-group-label mu-label-sm"}}export{u as menuClasses};
|
|
3
|
+
//# sourceMappingURL=classes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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: 24 or 32px. */\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 /** 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 shortcut: 'mu-menu-shortcut',\n separator: 'mu-menu-separator',\n groupLabel: 'mu-menu-group-label mu-label-sm',\n };\n}\n"],
|
|
5
|
+
"mappings": ";AA8BO,SAASA,EAAY,CAAE,KAAAC,EAAO,IAAK,EAAwB,CAAC,EAAgB,CACjF,MAAO,CACL,MAAO,uDAAuDA,CAAI,GAClE,KAAM,eACN,WAAY,mCACZ,MAAO,gBACP,SAAU,mBACV,UAAW,oBACX,WAAY,iCACd,CACF",
|
|
6
|
+
"names": ["menuClasses", "size"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Menu as t}from"@base-ui/react/menu";import{Check as x,ChevronRight as g}from"lucide-react";import{forwardRef as a}from"react";import{cx as f,withClass as i}from"../../internal/class-name.js";import{splitPositioner as b}from"../../internal/popup.js";import{SizeContext as I,useRowSize as M}from"../../internal/size.js";import{menuClasses as R}from"./classes.js";import{Fragment as h,jsx as o,jsxs as d}from"react/jsx-runtime";var m=R();function C({size:s,...e}){let r=M(s);return o(I.Provider,{value:r,children:o(t.Root,{...e})})}var E=a(function({className:e,...r},n){return o(t.Trigger,{ref:n,...r,className:i("mu-menu-trigger",e)})}),k=a(function({container:e,className:r,...n},u){let p=M(),[c,l]=b(n);return o(t.Portal,{container:e,children:o(t.Positioner,{sideOffset:4,...c,className:"mu-positioner",children:o(t.Popup,{ref:u,...l,className:i(R({size:p}).popup,r)})})})});function P({icon:s,shortcut:e,children:r}){return d(h,{children:[s,o("span",{className:m.label,children:r}),e!==void 0?o("span",{className:m.shortcut,children:e}):null]})}var w=a(function({icon:e,shortcut:r,danger:n=!1,className:u,children:p,...c},l){return o(t.Item,{ref:l,...c,className:i(n?m.dangerItem:m.item,u),children:o(P,{icon:e,shortcut:r,children:p})})}),H=a(function({icon:e,shortcut:r,className:n,children:u,...p},c){return d(t.CheckboxItem,{ref:c,...p,className:i(f(m.item,"mu-menu-checkbox-item"),n),children:[o(P,{icon:e,shortcut:r,children:u}),o("span",{className:"mu-menu-indicator",children:o(t.CheckboxItemIndicator,{render:o(x,{"aria-hidden":!0})})})]})}),D=a(function({className:e,...r},n){return o(t.RadioGroup,{ref:n,...r,className:i("mu-menu-radio-group",e)})}),y=a(function({icon:e,shortcut:r,className:n,children:u,...p},c){return d(t.RadioItem,{ref:c,...p,className:i(f(m.item,"mu-menu-radio-item"),n),children:[o(P,{icon:e,shortcut:r,children:u}),o("span",{className:"mu-menu-indicator",children:o(t.RadioItemIndicator,{render:o(x,{"aria-hidden":!0})})})]})}),z=a(function({className:e,...r},n){return o(t.Group,{ref:n,...r,className:i("mu-menu-group",e)})}),A=a(function({className:e,...r},n){return o(t.GroupLabel,{ref:n,...r,className:i(m.groupLabel,e)})}),O=a(function({className:e,...r},n){return o(t.Separator,{ref:n,...r,className:i(m.separator,e)})}),q=t.SubmenuRoot,F=a(function({icon:e,className:r,children:n,...u},p){return d(t.SubmenuTrigger,{ref:p,...u,className:i(f(m.item,"mu-menu-submenu-trigger"),r),children:[o(P,{icon:e,children:n}),o(g,{className:"mu-menu-chevron","aria-hidden":!0})]})});export{H as CheckboxItem,z as Group,A as GroupLabel,w as Item,k as Popup,D as RadioGroup,y as RadioItem,C as Root,O as Separator,q as SubmenuRoot,F as SubmenuTrigger,E as Trigger};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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, 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: 24, 32 or 40px. */\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/** The list of items. Also the popup of a submenu, inside `SubmenuRoot`. */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function MenuPopup({ container, className, ...props }, ref) {\n const size = useRowSize();\n const [positioner, rest] = splitPositioner(props);\n return (\n <BaseMenu.Portal container={container}>\n <BaseMenu.Positioner sideOffset={4} {...positioner} className=\"mu-positioner\">\n <BaseMenu.Popup ref={ref} {...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 children?: ReactNode;\n}\n\n/** The shared inside of every row: icon, label, shortcut. */\nfunction Row({ icon, shortcut, children }: RowProps) {\n return (\n <>\n {icon}\n <span className={classes.label}>{children}</span>\n {shortcut !== undefined ? <span className={classes.shortcut}>{shortcut}</span> : null}\n </>\n );\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, danger = false, className, children, ...props }, ref) {\n return (\n <BaseMenu.Item ref={ref} {...props} className={withClass(danger ? classes.dangerItem : classes.item, className)}>\n <Row icon={icon} shortcut={shortcut}>\n {children}\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, className, children, ...props }, ref) {\n return (\n <BaseMenu.CheckboxItem ref={ref} {...props} className={withClass(cx(classes.item, 'mu-menu-checkbox-item'), className)}>\n <Row icon={icon} shortcut={shortcut}>\n {children}\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, className, children, ...props }, ref) {\n return (\n <BaseMenu.RadioItem ref={ref} {...props} className={withClass(cx(classes.item, 'mu-menu-radio-item'), className)}>\n <Row icon={icon} shortcut={shortcut}>\n {children}\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 return (\n <BaseMenu.SubmenuTrigger ref={ref} {...props} className={withClass(cx(classes.item, 'mu-menu-submenu-trigger'), className)}>\n <Row icon={icon}>{children}</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,MAAkC,QAC3C,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAExC,OAAS,eAAAC,MAAmB,eActB,OA8CF,YAAAC,EA9CE,OAAAC,EA8CF,QAAAC,MA9CE,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,EA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G,OAAOT,EAACX,EAAS,MAAT,CAAe,IAAKoB,EAAM,GAAGJ,EAAO,UAAWX,EAAU,gBAAiBc,CAAS,EAAG,CAChG,CAAC,EAKYgB,EAAahC,EAA4C,SAAwB,CAAE,UAAAgB,EAAW,GAAGH,CAAM,EAAGI,EAAK,CAC1H,OAAOT,EAACX,EAAS,WAAT,CAAoB,IAAKoB,EAAM,GAAGJ,EAAO,UAAWX,EAAUQ,EAAQ,WAAYM,CAAS,EAAG,CACxG,CAAC,EAKYiB,EAAYjC,EAA2C,SAAuB,CAAE,UAAAgB,EAAW,GAAGH,CAAM,EAAGI,EAAK,CACvH,OAAOT,EAACX,EAAS,UAAT,CAAmB,IAAKoB,EAAM,GAAGJ,EAAO,UAAWX,EAAUQ,EAAQ,UAAWM,CAAS,EAAG,CACtG,CAAC,EAKYkB,EAAcrC,EAAS,YAQvBsC,EAAiBnC,EAAgD,SAA4B,CAAE,KAAAuB,EAAM,UAAAP,EAAW,SAAAS,EAAU,GAAGZ,CAAM,EAAGI,EAAK,CACtJ,OACER,EAACZ,EAAS,eAAT,CAAwB,IAAKoB,EAAM,GAAGJ,EAAO,UAAWX,EAAUD,EAAGS,EAAQ,KAAM,yBAAyB,EAAGM,CAAS,EACvH,UAAAR,EAACc,EAAA,CAAI,KAAMC,EAAO,SAAAE,EAAS,EAC3BjB,EAACT,EAAA,CAAa,UAAU,kBAAkB,cAAW,GAAC,GACxD,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseMenu", "Check", "ChevronRight", "forwardRef", "cx", "withClass", "splitPositioner", "SizeContext", "useRowSize", "menuClasses", "Fragment", "jsx", "jsxs", "classes", "Root", "size", "props", "resolved", "Trigger", "className", "ref", "Popup", "container", "positioner", "rest", "Row", "icon", "shortcut", "children", "Item", "danger", "CheckboxItem", "RadioGroup", "RadioItem", "Group", "GroupLabel", "Separator", "SubmenuRoot", "SubmenuTrigger"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/popover/classes.ts"],
|
|
4
|
+
"sourcesContent": ["/** 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(): PopoverClasses {\n return {\n popup: 'mu-popover-popup 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
|
+
"mappings": ";AAcO,SAASA,GAAiC,CAC/C,MAAO,CACL,MAAO,4DACP,MAAO,4BACP,YAAa,mCACf,CACF",
|
|
6
|
+
"names": ["popoverClasses"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Popover as s}from"@base-ui/react/popover";import{forwardRef as p}from"react";import{withClass as i}from"../../internal/class-name.js";import{splitPositioner as f}from"../../internal/popup.js";import{popoverClasses as m}from"./classes.js";import{jsx as t}from"react/jsx-runtime";var P=m(),d=s.Root,B=p(function({className:o,...e},r){return t(s.Trigger,{ref:r,...e,className:i("mu-popover-trigger",o)})}),C=p(function({container:o,className:e,...r},a){let[c,l]=f(r);return t(s.Portal,{container:o,children:t(s.Positioner,{sideOffset:6,...c,className:"mu-positioner",children:t(s.Popup,{ref:a,...l,className:i(P.popup,e)})})})}),D=p(function({className:o,...e},r){return t(s.Title,{ref:r,...e,className:i(P.title,o)})}),H=p(function({className:o,...e},r){return t(s.Description,{ref:r,...e,className:i(P.description,o)})}),M=p(function({className:o,...e},r){return t(s.Close,{ref:r,...e,className:i("mu-popover-close",o)})});export{M as Close,H as Description,C as Popup,d as Root,D as Title,B as Trigger};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { popoverClasses } from './classes';\n\nconst classes = /* @__PURE__ */ popoverClasses();\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\n/** The panel: a surface with `shadow-pop`, `popover-width` wide. */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function PopoverPopup({ container, className, ...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(classes.popup, className)} />\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
|
+
"mappings": ";AAAA,OAAS,WAAWA,MAAmB,yBACvC,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,kBAAAC,MAAsB,eAatB,cAAAC,MAAA,oBAXT,IAAMC,EAA0BF,EAAe,EAKlCG,EAAOP,EAAY,KAKnBQ,EAAUP,EAA4C,SAAwB,CAAE,UAAAQ,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACvH,OAAON,EAACL,EAAY,QAAZ,CAAoB,IAAKW,EAAM,GAAGD,EAAO,UAAWR,EAAU,qBAAsBO,CAAS,EAAG,CAC1G,CAAC,EAaYG,EAAQX,EAAuC,SAAsB,CAAE,UAAAY,EAAW,UAAAJ,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzH,GAAM,CAACG,EAAYC,CAAI,EAAIZ,EAAgBO,CAAK,EAChD,OACEL,EAACL,EAAY,OAAZ,CAAmB,UAAWa,EAC7B,SAAAR,EAACL,EAAY,WAAZ,CAAuB,WAAY,EAAI,GAAGc,EAAY,UAAU,gBAC/D,SAAAT,EAACL,EAAY,MAAZ,CAAkB,IAAKW,EAAM,GAAGI,EAAM,UAAWb,EAAUI,EAAQ,MAAOG,CAAS,EAAG,EACzF,EACF,CAEJ,CAAC,EAKYO,EAAQf,EAA2C,SAAsB,CAAE,UAAAQ,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAClH,OAAON,EAACL,EAAY,MAAZ,CAAkB,IAAKW,EAAM,GAAGD,EAAO,UAAWR,EAAUI,EAAQ,MAAOG,CAAS,EAAG,CACjG,CAAC,EAKYQ,EAAchB,EAAmD,SAA4B,CAAE,UAAAQ,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACtI,OAAON,EAACL,EAAY,YAAZ,CAAwB,IAAKW,EAAM,GAAGD,EAAO,UAAWR,EAAUI,EAAQ,YAAaG,CAAS,EAAG,CAC7G,CAAC,EAKYS,EAAQjB,EAA0C,SAAsB,CAAE,UAAAQ,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACjH,OAAON,EAACL,EAAY,MAAZ,CAAkB,IAAKW,EAAM,GAAGD,EAAO,UAAWR,EAAU,mBAAoBO,CAAS,EAAG,CACtG,CAAC",
|
|
6
|
+
"names": ["BasePopover", "forwardRef", "withClass", "splitPositioner", "popoverClasses", "jsx", "classes", "Root", "Trigger", "className", "props", "ref", "Popup", "container", "positioner", "rest", "Title", "Description", "Close"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{forwardRef as t}from"react";import{cx as m}from"../../internal/class-name.js";import{jsx as p}from"react/jsx-runtime";var P=t(function({size:o="md",className:e,...r},s){return p("div",{ref:s,...r,className:m("mu-prose",o==="sm"&&"mu-prose-sm",e)})});export{P as Prose};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/prose/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { cx } from '../../internal/class-name';\n\nexport interface ProseProps extends ComponentPropsWithoutRef<'div'> {\n /** `md` is 15px on a 24px line for reading; `sm` is 14px on 22px, for dense lists. */\n size?: 'sm' | 'md';\n}\n\n/**\n * Styles rendered Markdown inside it: headings, paragraphs, lists, task lists,\n * code, quotes, tables, images and links. Put the rendered HTML in it as\n * children. Without React, use the `mu-prose` class.\n */\nexport const Prose = forwardRef<HTMLDivElement, ProseProps>(function Prose({ size = 'md', className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-prose', size === 'sm' && 'mu-prose-sm', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,cAAAA,MAAiD,QAC1D,OAAS,MAAAC,MAAU,+BAaV,cAAAC,MAAA,oBADF,IAAMC,EAAQH,EAAuC,SAAe,CAAE,KAAAI,EAAO,KAAM,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACpH,OAAOL,EAAC,OAAI,IAAKK,EAAM,GAAGD,EAAO,UAAWL,EAAG,WAAYG,IAAS,MAAQ,cAAeC,CAAS,EAAG,CACzG,CAAC",
|
|
6
|
+
"names": ["forwardRef", "cx", "jsx", "Prose", "size", "className", "props", "ref"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Radio as d}from"@base-ui/react/radio";import{RadioGroup as R}from"@base-ui/react/radio-group";import{forwardRef as p}from"react";import{withClass as n}from"../../internal/class-name.js";import{SizeContext as c,useSize as m}from"../../internal/size.js";import{jsx as r}from"react/jsx-runtime";var x=p(function({size:e,orientation:o="vertical",className:i,...a},t){let s=m(e);return r(c.Provider,{value:s,children:r(R,{ref:t,"aria-orientation":o,...a,"data-orientation":o,className:n(`mu-radio-group mu-s-${s}`,i)})})}),G=p(function({size:e,className:o,...i},a){let t=m(e);return r(d.Root,{ref:a,...i,className:n(`mu-radio mu-s-${t} mu-focus mu-hit`,o),children:r(d.Indicator,{className:"mu-radio-indicator"})})});export{G as Radio,x as RadioGroup};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/radio-group/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Radio as BaseRadio } from '@base-ui/react/radio';\nimport { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { SizeContext, useSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface RadioGroupProps extends BaseRadioGroup.Props {\n size?: Size;\n /** How the radios are laid out. Default `vertical`. */\n orientation?: 'vertical' | 'horizontal';\n}\n\n/** Exactly one option from a short list that is always visible. Holds Radio items, each inside a Field.Label. */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup({ size, orientation = 'vertical', className, ...props }, ref) {\n const resolved = useSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseRadioGroup\n ref={ref}\n aria-orientation={orientation}\n {...props}\n data-orientation={orientation}\n className={withClass(`mu-radio-group mu-s-${resolved}`, className)}\n />\n </SizeContext.Provider>\n );\n});\n\nexport interface RadioProps extends BaseRadio.Root.Props {\n size?: Size;\n}\n\n/** One option: a round well that becomes a flat primary circle with a dot. */\nexport const Radio = forwardRef<HTMLElement, RadioProps>(function Radio({ size, className, ...props }, ref) {\n const resolved = useSize(size);\n return (\n <BaseRadio.Root ref={ref} {...props} className={withClass(`mu-radio mu-s-${resolved} mu-focus mu-hit`, className)}>\n <BaseRadio.Indicator className=\"mu-radio-indicator\" />\n </BaseRadio.Root>\n );\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,SAASA,MAAiB,uBACnC,OAAS,cAAcC,MAAsB,6BAC7C,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,eAAAC,EAAa,WAAAC,MAAe,yBAc/B,cAAAC,MAAA,oBAJC,IAAMC,EAAaL,EAA4C,SAAoB,CAAE,KAAAM,EAAM,YAAAC,EAAc,WAAY,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACtJ,IAAMC,EAAWR,EAAQG,CAAI,EAC7B,OACEF,EAACF,EAAY,SAAZ,CAAqB,MAAOS,EAC3B,SAAAP,EAACL,EAAA,CACC,IAAKW,EACL,mBAAkBH,EACjB,GAAGE,EACJ,mBAAkBF,EAClB,UAAWN,EAAU,uBAAuBU,CAAQ,GAAIH,CAAS,EACnE,EACF,CAEJ,CAAC,EAOYI,EAAQZ,EAAoC,SAAe,CAAE,KAAAM,EAAM,UAAAE,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC1G,IAAMC,EAAWR,EAAQG,CAAI,EAC7B,OACEF,EAACN,EAAU,KAAV,CAAe,IAAKY,EAAM,GAAGD,EAAO,UAAWR,EAAU,iBAAiBU,CAAQ,mBAAoBH,CAAS,EAC9G,SAAAJ,EAACN,EAAU,UAAV,CAAoB,UAAU,qBAAqB,EACtD,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseRadio", "BaseRadioGroup", "forwardRef", "withClass", "SizeContext", "useSize", "jsx", "RadioGroup", "size", "orientation", "className", "props", "ref", "resolved", "Radio"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Select as t}from"@base-ui/react/select";import{Check as f,ChevronDown as x,ChevronsUpDown as g,ChevronUp as B}from"lucide-react";import{forwardRef as l}from"react";import{withClass as n}from"../../internal/class-name.js";import{splitPositioner as v}from"../../internal/popup.js";import{SizeContext as I,useRowSize as u}from"../../internal/size.js";import{buttonClasses as T}from"../button/index.js";import{jsx as e,jsxs as m}from"react/jsx-runtime";function E({size:a,...o}){let r=u(a);return e(I.Provider,{value:r,children:e(t.Root,{...o})})}var V=l(function({className:o,children:r,...s},i){let p=u();return m(t.Trigger,{ref:i,...s,className:n(`mu-select-trigger ${T({variant:"neutral",size:p})}`,o),children:[r,e(t.Icon,{className:"mu-select-icon",children:e(g,{"aria-hidden":!0})})]})}),R=l(function({className:o,...r},s){return e(t.Value,{ref:s,...r,className:n("mu-select-value",o)})}),z=l(function({container:o,className:r,children:s,...i},p){let P=u(),[d,S]=v(i);return e(t.Portal,{container:o,children:e(t.Positioner,{sideOffset:4,...d,className:"mu-positioner mu-select-positioner",children:m(t.Popup,{ref:p,...S,className:n(`mu-select-popup mu-popup mu-popup-motion mu-base mu-s-${P}`,r),children:[e(t.ScrollUpArrow,{className:"mu-select-scroll-arrow",render:c=>e("div",{...c,children:e(B,{"aria-hidden":!0})})}),e(t.List,{className:"mu-select-list",children:s}),e(t.ScrollDownArrow,{className:"mu-select-scroll-arrow",render:c=>e("div",{...c,children:e(x,{"aria-hidden":!0})})})]})})})}),C=l(function({icon:o,className:r,children:s,...i},p){return m(t.Item,{ref:p,...i,className:n("mu-select-item",r),children:[o,e(t.ItemText,{className:"mu-select-item-text",children:s}),e("span",{className:"mu-select-indicator",children:e(t.ItemIndicator,{render:e(f,{"aria-hidden":!0}),children:null})})]})}),D=l(function({className:o,...r},s){return e(t.Group,{ref:s,...r,className:n("mu-select-group",o)})}),y=l(function({className:o,...r},s){return e(t.GroupLabel,{ref:s,...r,className:n("mu-select-group-label mu-label-sm",o)})}),H=l(function({className:o,...r},s){return e(t.Separator,{ref:s,...r,className:n("mu-select-separator",o)})});export{D as Group,y as GroupLabel,C as Item,z as Popup,E as Root,H as Separator,V as Trigger,R as Value};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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/** A neutral key that shows the value, with a chevron at the end. Holds `Value`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function SelectTrigger({ className, children, ...props }, ref) {\n const size = useRowSize();\n return (\n <BaseSelect.Trigger ref={ref} {...props} className={withClass(`mu-select-trigger ${buttonClasses({ variant: 'neutral', 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"],
|
|
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,EAWF,QAAAC,MAXE,oBAJC,SAASC,EAA0D,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAA+B,CACxH,IAAMC,EAAWP,EAAWK,CAAI,EAChC,OACEH,EAACH,EAAY,SAAZ,CAAqB,MAAOQ,EAC3B,SAAAL,EAACX,EAAW,KAAX,CAAiB,GAAGe,EAAO,EAC9B,CAEJ,CAKO,IAAME,EAAUZ,EAA4C,SAAuB,CAAE,UAAAa,EAAW,SAAAC,EAAU,GAAGJ,CAAM,EAAGK,EAAK,CAChI,IAAMN,EAAOL,EAAW,EACxB,OACEG,EAACZ,EAAW,QAAX,CAAmB,IAAKoB,EAAM,GAAGL,EAAO,UAAWT,EAAU,qBAAqBI,EAAc,CAAE,QAAS,UAAW,KAAAI,CAAK,CAAC,CAAC,GAAII,CAAS,EACxI,UAAAC,EACDR,EAACX,EAAW,KAAX,CAAgB,UAAU,iBACzB,SAAAW,EAACR,EAAA,CAAe,cAAW,GAAC,EAC9B,GACF,CAEJ,CAAC,EAKYkB,EAAQhB,EAAwC,SAAqB,CAAE,UAAAa,EAAW,GAAGH,CAAM,EAAGK,EAAK,CAC9G,OAAOT,EAACX,EAAW,MAAX,CAAiB,IAA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,GAAC,EAAK,cAAK,EACjE,GACF,CAEJ,CAAC,EAKY4B,EAAQxB,EAAuC,SAAqB,CAAE,UAAAa,EAAW,GAAGH,CAAM,EAAGK,EAAK,CAC7G,OAAOT,EAACX,EAAW,MAAX,CAAiB,IAAKoB,EAAM,GAAGL,EAAO,UAAWT,EAAU,kBAAmBY,CAAS,EAAG,CACpG,CAAC,EAKYY,EAAazB,EAA4C,SAA0B,CAAE,UAAAa,EAAW,GAAGH,CAAM,EAAGK,EAAK,CAC5H,OAAOT,EAACX,EAAW,WAAX,CAAsB,IAAKoB,EAAM,GAAGL,EAAO,UAAWT,EAAU,oCAAqCY,CAAS,EAAG,CAC3H,CAAC,EAKYa,EAAY1B,EAA2C,SAAyB,CAAE,UAAAa,EAAW,GAAGH,CAAM,EAAGK,EAAK,CACzH,OAAOT,EAACX,EAAW,UAAX,CAAqB,IAAKoB,EAAM,GAAGL,EAAO,UAAWT,EAAU,sBAAuBY,CAAS,EAAG,CAC5G,CAAC",
|
|
6
|
+
"names": ["BaseSelect", "Check", "ChevronDown", "ChevronsUpDown", "ChevronUp", "forwardRef", "withClass", "splitPositioner", "SizeContext", "useRowSize", "buttonClasses", "jsx", "jsxs", "Root", "size", "props", "resolved", "Trigger", "className", "children", "ref", "Value", "Popup", "container", "positioner", "rest", "arrowProps", "Item", "icon", "Group", "GroupLabel", "Separator"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Separator as e}from"@base-ui/react/separator";import{forwardRef as t}from"react";import{withClass as p}from"../../internal/class-name.js";import{jsx as s}from"react/jsx-runtime";var n=t(function({className:r,...a},o){return s(e,{ref:o,...a,className:p("mu-separator",r)})});export{n as Separator};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/separator/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Separator as BaseSeparator } from '@base-ui/react/separator';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\n\nexport interface SeparatorProps extends BaseSeparator.Props {}\n\n/** A 1px line between groups of content. */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function Separator({ className, ...props }, ref) {\n return <BaseSeparator ref={ref} {...props} className={withClass('mu-separator', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,aAAaA,MAAqB,2BAC3C,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAMjB,cAAAC,MAAA,oBADF,IAAMC,EAAYH,EAA2C,SAAmB,CAAE,UAAAI,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACnH,OAAOJ,EAACH,EAAA,CAAc,IAAKO,EAAM,GAAGD,EAAO,UAAWJ,EAAU,eAAgBG,CAAS,EAAG,CAC9F,CAAC",
|
|
6
|
+
"names": ["BaseSeparator", "forwardRef", "withClass", "jsx", "Separator", "className", "props", "ref"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{mergeProps as d}from"@base-ui/react/merge-props";import{useRender as p}from"@base-ui/react/use-render";import{forwardRef as u}from"react";import{useSize as l}from"../../internal/size.js";var v=u(function({width:r,height:e,round:o=!1,size:t,render:n,...s},i){let m=l(t);return p({defaultTagName:"div",render:n,ref:i,props:d({className:`mu-skeleton${o?" mu-skeleton-round":""} mu-s-${m}`,"aria-hidden":!0,style:{width:r??(o?e:void 0),height:e}},s)})});export{v as Skeleton};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/skeleton/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { forwardRef } from 'react';\nimport { useSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface SkeletonProps extends useRender.ComponentProps<'div'> {\n /** Defaults to the full width. */\n width?: number | string;\n /** Defaults to one line of text at `size`. */\n height?: number | string;\n /** A circle, for an avatar. Its width defaults to its height. */\n round?: boolean;\n size?: Size;\n}\n\n/** Holds the place of content that is still loading. Hidden from screen readers. */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton({ width, height, round = false, size, render, ...props }, ref) {\n const resolved = useSize(size);\n return useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>(\n {\n className: `mu-skeleton${round ? ' mu-skeleton-round' : ''} mu-s-${resolved}`,\n 'aria-hidden': true,\n style: { width: width ?? (round ? height : undefined), height },\n },\n props,\n ),\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,cAAAA,MAAkB,6BAC3B,OAAS,aAAAC,MAAiB,4BAC1B,OAAS,cAAAC,MAAkB,QAC3B,OAAS,WAAAC,MAAe,yBAcjB,IAAMC,EAAWF,EAA0C,SAAkB,CAAE,MAAAG,EAAO,OAAAC,EAAQ,MAAAC,EAAQ,GAAO,KAAAC,EAAM,OAAAC,EAAQ,GAAGC,CAAM,EAAGC,EAAK,CACjJ,IAAMC,EAAWT,EAAQK,CAAI,EAC7B,OAAOP,EAAU,CACf,eAAgB,MAChB,OAAAQ,EACA,IAAAE,EACA,MAAOX,EACL,CACE,UAAW,cAAcO,EAAQ,qBAAuB,EAAE,SAASK,CAAQ,GAC3E,cAAe,GACf,MAAO,CAAE,MAAOP,IAAUE,EAAQD,EAAS,QAAY,OAAAA,CAAO,CAChE,EACAI,CACF,CACF,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["mergeProps", "useRender", "forwardRef", "useSize", "Skeleton", "width", "height", "round", "size", "render", "props", "ref", "resolved"]
|
|
7
|
+
}
|