@usememos/ui 26.11.1 → 26.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +3 -3
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/index.js.map +3 -3
- package/dist/components/dialog/index.js.map +2 -2
- package/dist/components/dialog/parts.js +1 -1
- package/dist/components/dialog/parts.js.map +3 -3
- package/dist/components/drawer/index.js +3 -0
- package/dist/components/drawer/index.js.map +7 -0
- package/dist/components/field/index.js +1 -1
- package/dist/components/field/index.js.map +3 -3
- package/dist/components/list/index.js +3 -0
- package/dist/components/list/index.js.map +7 -0
- package/dist/components/menu/classes.js +1 -1
- package/dist/components/menu/classes.js.map +2 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +3 -3
- package/dist/components/popover/classes.js +1 -1
- package/dist/components/popover/classes.js.map +3 -3
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +3 -3
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/index.js.map +3 -3
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/index.js.map +3 -3
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toast/index.js.map +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/styles.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/combobox/index.d.ts +8 -0
- package/dist/types/components/dialog/index.d.ts +3 -3
- package/dist/types/components/dialog/parts.d.ts +9 -1
- package/dist/types/components/drawer/index.d.ts +42 -0
- package/dist/types/components/field/index.d.ts +6 -0
- package/dist/types/components/list/index.d.ts +16 -0
- package/dist/types/components/menu/classes.d.ts +4 -0
- package/dist/types/components/menu/index.d.ts +2 -0
- package/dist/types/components/popover/classes.d.ts +6 -1
- package/dist/types/components/popover/index.d.ts +7 -0
- package/dist/types/components/select/index.d.ts +5 -0
- package/dist/types/components/table/index.d.ts +2 -0
- package/dist/types/components/toast/index.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/llms-full.txt +276 -49
- package/llms.txt +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The Memos UI design system: tokens, foundation styles and React components for m
|
|
|
6
6
|
- Light and Dark themes, all from CSS custom properties. Apps can add their own.
|
|
7
7
|
- One package, `@usememos/ui`. ESM only, for React 18 or later, with behavior from [Base UI](https://base-ui.com).
|
|
8
8
|
|
|
9
|
-
The package ships the tokens, the foundation styles and
|
|
9
|
+
The package ships the tokens, the foundation styles and 30 components, each with a page in [docs/components](docs/components/README.md). Versions follow memos' CalVer (`26.10.0`, `26.10.1`) and do not signal breaking changes, so pin an exact version. [docs/](docs/README.md) is the design system and the source of truth for the package.
|
|
10
10
|
|
|
11
11
|
## Use it
|
|
12
12
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{Button as B}from"@base-ui/react/button";import{forwardRef as
|
|
2
|
+
import{Button as B}from"@base-ui/react/button";import{forwardRef as y}from"react";import{cx as z,withClass as x}from"../../internal/class-name.js";import{useSize as N}from"../../internal/size.js";import{jsx as l,jsxs as E}from"react/jsx-runtime";function C({variant:u="neutral",size:n="md",iconOnly:o=!1}={}){return z("mu-button",`mu-button-${u}`,o&&"mu-button-icon","mu-base",`mu-s-${n}`,"mu-focus","mu-hit")}var L=y(function({variant:n="neutral",size:o,icon:a,iconEnd:r,loading:t=!1,loadingLabel:i,disabled:m,focusableWhenDisabled:p,className:f,children:e,...d},c){let b=N(o),s=(e==null||e===!1)&&(a!==void 0||r!==void 0);return E(B,{ref:c,...d,...t&&i?{"aria-label":i}:null,disabled:m||t,focusableWhenDisabled:t||p,"aria-busy":t||void 0,"data-loading":t?"":void 0,className:x(C({variant:n,size:b,iconOnly:s}),f),children:[a,s?null:l("span",{className:"mu-button-label",children:e}),s&&a!==void 0?null:r,t?l("span",{className:"mu-spinner","aria-hidden":!0}):null]})});export{L as Button,C as buttonClasses};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/button/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button as BaseButton } from '@base-ui/react/button';\nimport { forwardRef, type ReactNode } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { useSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\n\nexport type ButtonVariant = 'primary' | 'neutral' | 'ghost' | 'danger';\n\nexport interface ButtonProps extends BaseButton.Props {\n /** `primary` for the one action a view exists for, `neutral` for the rest, `ghost` in toolbars, `danger` to confirm a destructive action. */\n variant?: ButtonVariant;\n size?: Size;\n /** A Lucide element, before the label. With no children the button is square and needs `aria-label`. */\n icon?: IconElement;\n /** 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
|
|
5
|
-
"mappings": ";AAAA,OAAS,UAAUA,MAAkB,wBACrC,OAAS,cAAAC,MAAkC,QAC3C,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,WAAAC,MAAe,
|
|
6
|
-
"names": ["BaseButton", "forwardRef", "cx", "withClass", "useSize", "jsx", "jsxs", "buttonClasses", "variant", "size", "iconOnly", "Button", "icon", "loading", "loadingLabel", "disabled", "focusableWhenDisabled", "className", "children", "props", "ref", "resolved"]
|
|
4
|
+
"sourcesContent": ["import { Button as BaseButton } from '@base-ui/react/button';\nimport { forwardRef, type ReactNode } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { useSize } from '../../internal/size';\nimport type { IconElement, Size } from '../../types';\n\nexport type ButtonVariant = 'primary' | 'neutral' | 'ghost' | 'danger';\n\nexport interface ButtonProps extends BaseButton.Props {\n /** `primary` for the one action a view exists for, `neutral` for the rest, `ghost` in toolbars, `danger` to confirm a destructive action. */\n variant?: ButtonVariant;\n size?: Size;\n /** A Lucide element, before the label. With no children the button is square and needs `aria-label`. */\n icon?: IconElement;\n /** A Lucide element after the label, such as a chevron or an arrow that says where the action leads. */\n iconEnd?: IconElement;\n /** Keeps the width, shows a Spinner and ignores presses. */\n loading?: boolean;\n /** The accessible name while loading, such as \"Saving\". */\n loadingLabel?: string;\n children?: ReactNode;\n}\n\nexport interface ButtonClassesOptions {\n variant?: ButtonVariant;\n size?: Size;\n /** A square button with only an icon. */\n iconOnly?: boolean;\n}\n\n/**\n * The classes that make an element look like a Button. Use them on a link\n * that should look like an action: `<a className={buttonClasses({ variant: 'primary' })} href=\"/start\">`.\n */\nexport function buttonClasses({ variant = 'neutral', size = 'md', iconOnly = false }: ButtonClassesOptions = {}) {\n return cx('mu-button', `mu-button-${variant}`, iconOnly && 'mu-button-icon', 'mu-base', `mu-s-${size}`, 'mu-focus', 'mu-hit');\n}\n\n/** Starts an action. A raised key that sinks while pressed. */\nexport const Button = forwardRef<HTMLElement, ButtonProps>(function Button(\n { variant = 'neutral', size, icon, iconEnd, loading = false, loadingLabel, disabled, focusableWhenDisabled, className, children, ...props },\n ref,\n) {\n const resolved = useSize(size);\n const noLabel = children === undefined || children === null || children === false;\n const iconOnly = noLabel && (icon !== undefined || iconEnd !== undefined);\n return (\n <BaseButton\n ref={ref}\n {...props}\n {...(loading && loadingLabel ? { 'aria-label': loadingLabel } : null)}\n disabled={disabled || loading}\n focusableWhenDisabled={loading || focusableWhenDisabled}\n aria-busy={loading || undefined}\n data-loading={loading ? '' : undefined}\n className={withClass(buttonClasses({ variant, size: resolved, iconOnly }), className)}\n >\n {icon}\n {iconOnly ? null : <span className=\"mu-button-label\">{children}</span>}\n {iconOnly && icon !== undefined ? null : iconEnd}\n {loading ? <span className=\"mu-spinner\" aria-hidden /> : null}\n </BaseButton>\n );\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,UAAUA,MAAkB,wBACrC,OAAS,cAAAC,MAAkC,QAC3C,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,WAAAC,MAAe,yBA4CpB,OAWqB,OAAAC,EAXrB,QAAAC,MAAA,oBAbG,SAASC,EAAc,CAAE,QAAAC,EAAU,UAAW,KAAAC,EAAO,KAAM,SAAAC,EAAW,EAAM,EAA0B,CAAC,EAAG,CAC/G,OAAOR,EAAG,YAAa,aAAaM,CAAO,GAAIE,GAAY,iBAAkB,UAAW,QAAQD,CAAI,GAAI,WAAY,QAAQ,CAC9H,CAGO,IAAME,EAASV,EAAqC,SACzD,CAAE,QAAAO,EAAU,UAAW,KAAAC,EAAM,KAAAG,EAAM,QAAAC,EAAS,QAAAC,EAAU,GAAO,aAAAC,EAAc,SAAAC,EAAU,sBAAAC,EAAuB,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAC1IC,EACA,CACA,IAAMC,EAAWlB,EAAQK,CAAI,EAEvBC,GADoCS,GAAa,MAAQA,IAAa,MAC/CP,IAAS,QAAaC,IAAY,QAC/D,OACEP,EAACN,EAAA,CACC,IAAKqB,EACJ,GAAGD,EACH,GAAIN,GAAWC,EAAe,CAAE,aAAcA,CAAa,EAAI,KAChE,SAAUC,GAAYF,EACtB,sBAAuBA,GAAWG,EAClC,YAAWH,GAAW,OACtB,eAAcA,EAAU,GAAK,OAC7B,UAAWX,EAAUI,EAAc,CAAE,QAAAC,EAAS,KAAMc,EAAU,SAAAZ,CAAS,CAAC,EAAGQ,CAAS,EAEnF,UAAAN,EACAF,EAAW,KAAOL,EAAC,QAAK,UAAU,kBAAmB,SAAAc,EAAS,EAC9DT,GAAYE,IAAS,OAAY,KAAOC,EACxCC,EAAUT,EAAC,QAAK,UAAU,aAAa,cAAW,GAAC,EAAK,MAC3D,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseButton", "forwardRef", "cx", "withClass", "useSize", "jsx", "jsxs", "buttonClasses", "variant", "size", "iconOnly", "Button", "icon", "iconEnd", "loading", "loadingLabel", "disabled", "focusableWhenDisabled", "className", "children", "props", "ref", "resolved"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{Combobox as
|
|
2
|
+
import{Combobox as s}from"@base-ui/react/combobox";import{Check as f,ChevronsUpDown as d,Search as C}from"lucide-react";import{createContext as I,forwardRef as p,useContext as L}from"react";import{cx as B,withClass as a}from"../../internal/class-name.js";import{splitPositioner as N}from"../../internal/popup.js";import{SizeContext as y,useRowSize as b}from"../../internal/size.js";import{jsx as e,jsxs as P}from"react/jsx-runtime";var M=s.Collection,w=s.useFilter,x=I(!1);function T({size:n,...o}){let t=b(n);return e(y.Provider,{value:t,children:e(x.Provider,{value:o.inline??!1,children:e(s.Root,{...o.inline&&o.open===void 0&&o.defaultOpen===void 0?{open:!0}:null,...o})})})}var h=p(function({icon:o=e(C,{}),triggerLabel:t="Show options",className:r,style:i,...m},u){let l=b(),c=L(x);return P(s.InputGroup,{className:B("mu-input-root",!c&&"mu-combobox-input-root","mu-base",`mu-s-${l}`,r),style:i,children:[o!==null?e("span",{className:"mu-input-prefix",children:o}):null,e(s.Input,{ref:u,...m,className:"mu-input"}),c?null:e("span",{className:"mu-input-suffix",children:e(s.Trigger,{className:"mu-combobox-trigger mu-focus","aria-label":t,children:e(d,{"aria-hidden":!0})})})]})}),z=p(function({container:o,className:t,...r},i){let m=b(),[u,l]=N(r);return e(s.Portal,{container:o,children:e(s.Positioner,{sideOffset:4,align:"start",...u,className:"mu-positioner",children:e(s.Popup,{ref:i,...l,className:a(`mu-combobox-popup mu-popup mu-popup-motion mu-base mu-s-${m}`,t)})})})}),D=p(function({className:o,...t},r){return e(s.List,{ref:r,...t,className:a("mu-combobox-list",o)})}),H=p(function({icon:o,className:t,children:r,...i},m){return P(s.Item,{ref:m,...i,className:a("mu-combobox-item",t),children:[o,e("span",{className:"mu-combobox-item-text",children:r}),e("span",{className:"mu-combobox-indicator",children:e(s.ItemIndicator,{render:e(f,{"aria-hidden":!0}),children:null})})]})}),V=p(function({className:o,...t},r){return e(s.Row,{ref:r,...t,className:a("mu-combobox-row",o)})}),k=p(function({className:o,...t},r){return e(s.Empty,{ref:r,...t,className:a("mu-combobox-empty mu-body",o)})}),O=p(function({className:o,...t},r){return e(s.Group,{ref:r,...t,className:a("mu-combobox-group",o)})}),A=p(function({className:o,...t},r){return e(s.GroupLabel,{ref:r,...t,className:a("mu-combobox-group-label mu-label-sm",o)})}),F=p(function({className:o,...t},r){return e(s.Separator,{ref:r,...t,className:a("mu-combobox-separator",o)})});export{M as Collection,k as Empty,O as Group,A as GroupLabel,h as Input,H as Item,D as List,z as Popup,T as Root,V as Row,F as Separator,w as useFilter};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
5
|
-
"mappings": ";AAAA,OAAS,YAAYA,MAAoB,0BACzC,OAAS,SAAAC,EAAO,kBAAAC,EAAgB,UAAAC,MAAc,eAC9C,OAAS,cAAAC,MAAsD,
|
|
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"]
|
|
4
|
+
"sourcesContent": ["import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport { createContext, forwardRef, useContext, 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\n/** Whether the Root is `inline`: its list sits in the page, not in a popup. */\nconst InlineContext = createContext(false);\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 <InlineContext.Provider value={props.inline ?? false}>\n {/* An inline list is always shown, so it is open unless the app says otherwise; Enter only picks in an open list. */}\n <BaseCombobox.Root {...(props.inline && props.open === undefined && props.defaultOpen === undefined ? { open: true } : null)} {...props} />\n </InlineContext.Provider>\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 const inline = useContext(InlineContext);\n return (\n <BaseCombobox.InputGroup className={cx('mu-input-root', !inline && '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 {/* An inline list is always shown, so there is nothing to open. */}\n {inline ? null : (\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 )}\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 RowProps extends BaseCombobox.Row.Props {}\n\n/**\n * One row of a grid, with `grid` on the root: its items are square cells for\n * an icon or an emoji, and arrow keys move across rows and columns. Split the\n * filtered items into rows of a fixed count.\n */\nexport const Row = forwardRef<HTMLDivElement, RowProps>(function ComboboxRow({ className, ...props }, ref) {\n return <BaseCombobox.Row ref={ref} {...props} className={withClass('mu-combobox-row', className)} />;\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,iBAAAC,EAAe,cAAAC,EAAY,cAAAC,MAAsD,QAC1F,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBA0BhC,cAAAC,EA6BJ,QAAAC,MA7BI,oBAtBD,IAAMC,EAAad,EAAa,WAG1Be,EAAYf,EAAa,UAGhCgB,EAAgBZ,EAAc,EAAK,EAUlC,SAASa,EAAwE,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAAqC,CAC5I,IAAMC,EAAWT,EAAWO,CAAI,EAChC,OACEN,EAACF,EAAY,SAAZ,CAAqB,MAA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AWX,EAAU,oBAAqBgB,CAAS,EAAG,CACxG,CAAC,EAKYc,EAAajC,EAA4C,SAA4B,CAAE,UAAAmB,EAAW,GAAGL,CAAM,EAAGO,EAAK,CAC9H,OAAOd,EAACZ,EAAa,WAAb,CAAwB,IAAK0B,EAAM,GAAGP,EAAO,UAAWX,EAAU,sCAAuCgB,CAAS,EAAG,CAC/H,CAAC,EAKYe,EAAYlC,EAA2C,SAA2B,CAAE,UAAAmB,EAAW,GAAGL,CAAM,EAAGO,EAAK,CAC3H,OAAOd,EAACZ,EAAa,UAAb,CAAuB,IAAK0B,EAAM,GAAGP,EAAO,UAAWX,EAAU,wBAAyBgB,CAAS,EAAG,CAChH,CAAC",
|
|
6
|
+
"names": ["BaseCombobox", "Check", "ChevronsUpDown", "Search", "createContext", "forwardRef", "useContext", "cx", "withClass", "splitPositioner", "SizeContext", "useRowSize", "jsx", "jsxs", "Collection", "useFilter", "InlineContext", "Root", "size", "props", "resolved", "Input", "icon", "triggerLabel", "className", "style", "ref", "inline", "Popup", "container", "positioner", "rest", "List", "Item", "children", "Row", "Empty", "Group", "GroupLabel", "Separator"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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,
|
|
4
|
+
"sourcesContent": ["import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport type { ForwardRefExoticComponent, RefAttributes } from 'react';\nimport { createDialogParts, type PopupProps as SharedPopupProps, type VariantProps } from './parts';\n\nexport type { CloseProps, DescriptionProps, FooterProps, RootProps, TitleProps, TriggerProps } from './parts';\n\nexport interface PopupProps extends SharedPopupProps, VariantProps {\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; `variant=\"bare\"` drops the padding and the X. 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,MAAiF,aAS1F,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
6
|
"names": ["BaseDialog", "createDialogParts", "parts", "Root", "Trigger", "Popup", "Title", "Description", "Close", "Footer"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{X as L}from"lucide-react";import{forwardRef as
|
|
2
|
+
import{X as L}from"lucide-react";import{forwardRef as a}from"react";import{cx as n,withClass as p}from"../../internal/class-name.js";import{SizeContext as M}from"../../internal/size.js";import{Button as N}from"../button/index.js";import{jsx as t,jsxs as c}from"react/jsx-runtime";function y(i,l,g){let m=a(function({className:o,...e},r){return t(i.Trigger,{ref:r,...e,className:p(`mu-${l}-trigger`,o)})}),P=a(function({container:o,sheet:e=!0,variant:r="panel",closeLabel:x="Close",className:b,children:C,...v},H){let u=r==="bare";return c(i.Portal,{container:o,children:[t(i.Backdrop,{className:"mu-dialog-backdrop"}),t(i.Viewport,{className:n("mu-dialog-viewport",e&&"mu-dialog-sheet"),children:c(i.Popup,{ref:H,...v,className:p(n(`mu-dialog-popup mu-${l}-popup`,u&&"mu-dialog-bare","mu-popup mu-base mu-s-md"),b),children:[t(M.Provider,{value:"md",children:C}),g&&!u?t(i.Close,{className:"mu-dialog-x",render:t(N,{variant:"ghost",size:"sm",icon:t(L,{}),"aria-label":x})}):null]})})]})}),f=a(function({className:o,...e},r){return t(i.Title,{ref:r,...e,className:p("mu-dialog-title mu-title",o)})}),d=a(function({className:o,...e},r){return t(i.Description,{ref:r,...e,className:p("mu-dialog-description mu-body",o)})}),D=a(function({className:o,...e},r){return t(i.Close,{ref:r,...e,className:p(`mu-${l}-close`,o)})}),T=a(function({className:o,...e},r){return t("div",{ref:r,...e,className:n("mu-dialog-footer",o)})});return{Root:i.Root,Trigger:m,Popup:P,Title:f,Description:d,Close:D,Footer:T}}export{y as createDialogParts};
|
|
3
3
|
//# sourceMappingURL=parts.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dialog/parts.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\nimport { forwardRef, type HTMLAttributes } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { SizeContext } from '../../internal/size';\nimport { Button } from '../button';\n\nexport type RootProps = BaseDialog.Root.Props;\nexport interface TriggerProps extends BaseDialog.Trigger.Props {}\nexport interface PopupProps extends BaseDialog.Popup.Props {\n /** Where the dialog is portaled to. Default `document.body`. */\n container?: BaseDialog.Portal.Props['container'];\n /** Below `breakpoint-sm` the dialog becomes a sheet from the bottom. `false` keeps it centered. Default true. */\n sheet?: boolean;\n}\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
|
|
5
|
-
"mappings": ";AACA,OAAS,KAAAA,MAAS,eAClB,OAAS,cAAAC,MAAuC,QAChD,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,eAAAC,MAAmB,yBAC5B,OAAS,UAAAC,MAAc,
|
|
6
|
-
"names": ["X", "forwardRef", "cx", "withClass", "SizeContext", "Button", "jsx", "jsxs", "createDialogParts", "Base", "name", "closeButton", "Trigger", "className", "props", "ref", "Popup", "container", "sheet", "closeLabel", "children", "Title", "Description", "Close", "Footer"]
|
|
4
|
+
"sourcesContent": ["import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\nimport { forwardRef, type HTMLAttributes } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { SizeContext } from '../../internal/size';\nimport { Button } from '../button';\n\nexport type RootProps = BaseDialog.Root.Props;\nexport interface TriggerProps extends BaseDialog.Trigger.Props {}\nexport interface PopupProps extends BaseDialog.Popup.Props {\n /** Where the dialog is portaled to. Default `document.body`. */\n container?: BaseDialog.Portal.Props['container'];\n /** Below `breakpoint-sm` the dialog becomes a sheet from the bottom. `false` keeps it centered. Default true. */\n sheet?: boolean;\n}\n\nexport interface VariantProps {\n /**\n * `panel` (default) pads the content `space-5`, stacks it `space-4` apart and\n * adds the X. `bare` keeps the surface, radius and shadow but has no padding,\n * gap or X: the content runs edge to edge, for a search palette or an image.\n */\n variant?: 'panel' | 'bare';\n}\nexport interface TitleProps extends BaseDialog.Title.Props {}\nexport interface DescriptionProps extends BaseDialog.Description.Props {}\nexport interface CloseProps extends BaseDialog.Close.Props {}\nexport interface FooterProps extends HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Builds the styled parts on Base UI's Dialog or AlertDialog, which share\n * their anatomy. `closeButton` adds the X at the top right of the popup.\n */\nexport function createDialogParts(Base: typeof BaseDialog, name: 'dialog' | 'alert-dialog', closeButton: boolean) {\n const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function DialogTrigger({ className, ...props }, ref) {\n return <Base.Trigger ref={ref} {...props} className={withClass(`mu-${name}-trigger`, className)} />;\n });\n\n const Popup = forwardRef<HTMLDivElement, PopupProps & VariantProps & { closeLabel?: string }>(function DialogPopup(\n { container, sheet = true, variant = 'panel', closeLabel = 'Close', className, children, ...props },\n ref,\n ) {\n const bare = variant === 'bare';\n return (\n <Base.Portal container={container}>\n <Base.Backdrop className=\"mu-dialog-backdrop\" />\n <Base.Viewport className={cx('mu-dialog-viewport', sheet && 'mu-dialog-sheet')}>\n <Base.Popup\n ref={ref}\n {...props}\n className={withClass(cx(`mu-dialog-popup mu-${name}-popup`, bare && 'mu-dialog-bare', 'mu-popup mu-base mu-s-md'), className)}\n >\n {/* A dialog is md wherever it is declared: React context crosses the portal, so a size set by a parent Root (a sm Table) would leak in. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n {closeButton && !bare ? (\n <Base.Close className=\"mu-dialog-x\" render={<Button variant=\"ghost\" size=\"sm\" icon={<X />} aria-label={closeLabel} />} />\n ) : null}\n </Base.Popup>\n </Base.Viewport>\n </Base.Portal>\n );\n });\n\n const Title = forwardRef<HTMLHeadingElement, TitleProps>(function DialogTitle({ className, ...props }, ref) {\n return <Base.Title ref={ref} {...props} className={withClass('mu-dialog-title mu-title', className)} />;\n });\n\n const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function DialogDescription({ className, ...props }, ref) {\n return <Base.Description ref={ref} {...props} className={withClass('mu-dialog-description mu-body', className)} />;\n });\n\n const Close = forwardRef<HTMLButtonElement, CloseProps>(function DialogClose({ className, ...props }, ref) {\n return <Base.Close ref={ref} {...props} className={withClass(`mu-${name}-close`, className)} />;\n });\n\n const Footer = forwardRef<HTMLDivElement, FooterProps>(function DialogFooter({ className, ...props }, ref) {\n return <div ref={ref} {...props} className={cx('mu-dialog-footer', className)} />;\n });\n\n return { Root: Base.Root, Trigger, Popup, Title, Description, Close, Footer };\n}\n"],
|
|
5
|
+
"mappings": ";AACA,OAAS,KAAAA,MAAS,eAClB,OAAS,cAAAC,MAAuC,QAChD,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,eAAAC,MAAmB,yBAC5B,OAAS,UAAAC,MAAc,qBA8BZ,cAAAC,EAYD,QAAAC,MAZC,oBAFJ,SAASC,EAAkBC,EAAyBC,EAAiCC,EAAsB,CAChH,IAAMC,EAAUX,EAA4C,SAAuB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC/G,OAAOT,EAACG,EAAK,QAAL,CAAa,IAAKM,EAAM,GAAGD,EAAO,UAAWX,EAAU,MAAMO,CAAI,WAAYG,CAAS,EAAG,CACnG,CAAC,EAEKG,EAAQf,EAAgF,SAC5F,CAAE,UAAAgB,EAAW,MAAAC,EAAQ,GAAM,QAAAC,EAAU,QAAS,WAAAC,EAAa,QAAS,UAAAP,EAAW,SAAAQ,EAAU,GAAGP,CAAM,EAClGC,EACA,CACA,IAAMO,EAAOH,IAAY,OACzB,OACEZ,EAACE,EAAK,OAAL,CAAY,UAAWQ,EACtB,UAAAX,EAACG,EAAK,SAAL,CAAc,UAAU,qBAAqB,EAC9CH,EAACG,EAAK,SAAL,CAAc,UAAWP,EAAG,qBAAsBgB,GAAS,iBAAiB,EAC3E,SAAAX,EAACE,EAAK,MAAL,CACC,IAAKM,EACJ,GAAGD,EACJ,UAAWX,EAAUD,EAAG,sBAAsBQ,CAAI,SAAUY,GAAQ,iBAAkB,0BAA0B,EAAGT,CAAS,EAG5H,UAAAP,EAACF,EAAY,SAAZ,CAAqB,MAAM,KAAM,SAAAiB,EAAS,EAC1CV,GAAe,CAACW,EACfhB,EAACG,EAAK,MAAL,CAAW,UAAU,cAAc,OAAQH,EAACD,EAAA,CAAO,QAAQ,QAAQ,KAAK,KAAK,KAAMC,EAACN,EAAA,EAAE,EAAI,aAAYoB,EAAY,EAAI,EACrH,MACN,EACF,GACF,CAEJ,CAAC,EAEKG,EAAQtB,EAA2C,SAAqB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC1G,OAAOT,EAACG,EAAK,MAAL,CAAW,IAAKM,EAAM,GAAGD,EAAO,UAAWX,EAAU,2BAA4BU,CAAS,EAAG,CACvG,CAAC,EAEKW,EAAcvB,EAAmD,SAA2B,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC9H,OAAOT,EAACG,EAAK,YAAL,CAAiB,IAAKM,EAAM,GAAGD,EAAO,UAAWX,EAAU,gCAAiCU,CAAS,EAAG,CAClH,CAAC,EAEKY,EAAQxB,EAA0C,SAAqB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzG,OAAOT,EAACG,EAAK,MAAL,CAAW,IAAKM,EAAM,GAAGD,EAAO,UAAWX,EAAU,MAAMO,CAAI,SAAUG,CAAS,EAAG,CAC/F,CAAC,EAEKa,EAASzB,EAAwC,SAAsB,CAAE,UAAAY,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzG,OAAOT,EAAC,OAAI,IAAKS,EAAM,GAAGD,EAAO,UAAWZ,EAAG,mBAAoBW,CAAS,EAAG,CACjF,CAAC,EAED,MAAO,CAAE,KAAMJ,EAAK,KAAM,QAAAG,EAAS,MAAAI,EAAO,MAAAO,EAAO,YAAAC,EAAa,MAAAC,EAAO,OAAAC,CAAO,CAC9E",
|
|
6
|
+
"names": ["X", "forwardRef", "cx", "withClass", "SizeContext", "Button", "jsx", "jsxs", "createDialogParts", "Base", "name", "closeButton", "Trigger", "className", "props", "ref", "Popup", "container", "sheet", "variant", "closeLabel", "children", "bare", "Title", "Description", "Close", "Footer"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{useDirection as D}from"@base-ui/react/direction-provider";import{Drawer as a}from"@base-ui/react/drawer";import{X as f}from"lucide-react";import{createContext as g,forwardRef as s,useContext as x}from"react";import{cx as C,withClass as i}from"../../internal/class-name.js";import{SizeContext as T}from"../../internal/size.js";import{Button as B}from"../button/index.js";import{jsx as r,jsxs as m}from"react/jsx-runtime";var l=g("right");function L({side:n="end",...t}){let o=D(),e=n==="bottom"?"bottom":n==="start"==(o==="rtl")?"right":"left",p=e==="bottom"?"down":e;return r(l.Provider,{value:e,children:r(a.Root,{...t,swipeDirection:p})})}var R=s(function({className:t,...o},e){return r(a.Trigger,{ref:e,...o,className:i("mu-drawer-trigger",t)})}),M=s(function({container:t,variant:o="panel",closeLabel:e="Close",className:p,children:d,...u},w){let P=x(l),c=o==="bare";return m(a.Portal,{container:t,children:[r(a.Backdrop,{className:"mu-drawer-backdrop"}),r(a.Viewport,{className:`mu-drawer-viewport mu-drawer-${P}`,children:m(a.Popup,{ref:w,...u,className:i(C("mu-drawer-popup",c&&"mu-drawer-bare","mu-base mu-s-md"),p),children:[r(a.Content,{className:"mu-drawer-content",children:r(T.Provider,{value:"md",children:d})}),c?null:r(a.Close,{className:"mu-drawer-x",render:r(B,{variant:"ghost",size:"sm",icon:r(f,{}),"aria-label":e})})]})})]})}),y=s(function({className:t,...o},e){return r(a.Title,{ref:e,...o,className:i("mu-drawer-title mu-title",t)})}),z=s(function({className:t,...o},e){return r(a.Description,{ref:e,...o,className:i("mu-drawer-description mu-body",t)})}),k=s(function({className:t,...o},e){return r(a.Close,{ref:e,...o,className:i("mu-drawer-close",t)})});export{k as Close,z as Description,M as Popup,L as Root,y as Title,R as Trigger};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/drawer/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useDirection } from '@base-ui/react/direction-provider';\nimport { Drawer as BaseDrawer } from '@base-ui/react/drawer';\nimport { X } from 'lucide-react';\nimport { createContext, forwardRef, useContext } from 'react';\nimport { cx, withClass } from '../../internal/class-name';\nimport { SizeContext } from '../../internal/size';\nimport { Button } from '../button';\n\n/** The edge a drawer slides from. `start` and `end` follow the text direction. */\nexport type DrawerSide = 'start' | 'end' | 'bottom';\n\ntype Edge = 'left' | 'right' | 'bottom';\n\nconst EdgeContext = createContext<Edge>('right');\n\nexport interface RootProps extends Omit<BaseDrawer.Root.Props, 'swipeDirection' | 'snapPoints' | 'defaultSnapPoint' | 'snapPoint' | 'onSnapPointChange' | 'snapToSequentialPoints'> {\n /** The edge it slides from, and swipes back to. `start` is the left edge in a left-to-right page. Default `end`. */\n side?: DrawerSide;\n}\n\n/** Groups a trigger and its drawer. Controlled with `open` and `onOpenChange`. */\nexport function Root({ side = 'end', ...props }: RootProps) {\n const direction = useDirection();\n const edge: Edge = side === 'bottom' ? 'bottom' : (side === 'start') === (direction === 'rtl') ? 'right' : 'left';\n const swipeDirection = edge === 'bottom' ? 'down' : edge;\n return (\n <EdgeContext.Provider value={edge}>\n <BaseDrawer.Root {...props} swipeDirection={swipeDirection} />\n </EdgeContext.Provider>\n );\n}\n\nexport interface TriggerProps extends BaseDrawer.Trigger.Props {}\n\n/** Opens the drawer. Usually `render={<Button />}`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function DrawerTrigger({ className, ...props }, ref) {\n return <BaseDrawer.Trigger ref={ref} {...props} className={withClass('mu-drawer-trigger', className)} />;\n});\n\nexport interface PopupProps extends BaseDrawer.Popup.Props {\n /** Where the drawer is portaled to. Default `document.body`. */\n container?: BaseDrawer.Portal.Props['container'];\n /**\n * `panel` (default) pads the content `space-5`, stacks it `space-4` apart\n * and adds the X. `bare` has no padding, gap or X, for content that lays\n * itself out, such as an app's navigation sidebar.\n */\n variant?: 'panel' | 'bare';\n /** The accessible name of the X. Default \"Close\". */\n closeLabel?: string;\n}\n\n/**\n * The panel against one edge of the screen, over a dimmed backdrop, full\n * height (or full width from the bottom). Swipe it back to its edge to close.\n */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function DrawerPopup(\n { container, variant = 'panel', closeLabel = 'Close', className, children, ...props },\n ref,\n) {\n const edge = useContext(EdgeContext);\n const bare = variant === 'bare';\n return (\n <BaseDrawer.Portal container={container}>\n <BaseDrawer.Backdrop className=\"mu-drawer-backdrop\" />\n <BaseDrawer.Viewport className={`mu-drawer-viewport mu-drawer-${edge}`}>\n <BaseDrawer.Popup ref={ref} {...props} className={withClass(cx('mu-drawer-popup', bare && 'mu-drawer-bare', 'mu-base mu-s-md'), className)}>\n {/* Content keeps text selectable with a mouse instead of starting a swipe. */}\n <BaseDrawer.Content className=\"mu-drawer-content\">\n {/* A drawer is md wherever it is declared, as a Dialog is. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n </BaseDrawer.Content>\n {bare ? null : (\n <BaseDrawer.Close className=\"mu-drawer-x\" render={<Button variant=\"ghost\" size=\"sm\" icon={<X />} aria-label={closeLabel} />} />\n )}\n </BaseDrawer.Popup>\n </BaseDrawer.Viewport>\n </BaseDrawer.Portal>\n );\n});\n\nexport interface TitleProps extends BaseDrawer.Title.Props {}\n\n/** The drawer's heading, an `<h2>`. Names it for screen readers; hide it with `mu-visually-hidden` when the content names itself. */\nexport const Title = forwardRef<HTMLHeadingElement, TitleProps>(function DrawerTitle({ className, ...props }, ref) {\n return <BaseDrawer.Title ref={ref} {...props} className={withClass('mu-drawer-title mu-title', className)} />;\n});\n\nexport interface DescriptionProps extends BaseDrawer.Description.Props {}\n\n/** A `<p>` under the title. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function DrawerDescription({ className, ...props }, ref) {\n return <BaseDrawer.Description ref={ref} {...props} className={withClass('mu-drawer-description mu-body', className)} />;\n});\n\nexport interface CloseProps extends BaseDrawer.Close.Props {}\n\n/** Closes the drawer, such as a link in a navigation drawer. Usually `render={<Button />}`. */\nexport const Close = forwardRef<HTMLButtonElement, CloseProps>(function DrawerClose({ className, ...props }, ref) {\n return <BaseDrawer.Close ref={ref} {...props} className={withClass('mu-drawer-close', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,gBAAAA,MAAoB,oCAC7B,OAAS,UAAUC,MAAkB,wBACrC,OAAS,KAAAC,MAAS,eAClB,OAAS,iBAAAC,EAAe,cAAAC,EAAY,cAAAC,MAAkB,QACtD,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,eAAAC,MAAmB,yBAC5B,OAAS,UAAAC,MAAc,qBAqBjB,cAAAC,EAuCE,QAAAC,MAvCF,oBAdN,IAAMC,EAAcT,EAAoB,OAAO,EAQxC,SAASU,EAAK,CAAE,KAAAC,EAAO,MAAO,GAAGC,CAAM,EAAc,CAC1D,IAAMC,EAAYhB,EAAa,EACzBiB,EAAaH,IAAS,SAAW,SAAYA,IAAS,UAAcE,IAAc,OAAS,QAAU,OACrGE,EAAiBD,IAAS,SAAW,OAASA,EACpD,OACEP,EAACE,EAAY,SAAZ,CAAqB,MAAOK,EAC3B,SAAAP,EAACT,EAAW,KAAX,CAAiB,GAAGc,EAAO,eAAgBG,EAAgB,EAC9D,CAEJ,CAKO,IAAMC,EAAUf,EAA4C,SAAuB,CAAE,UAAAgB,EAAW,GAAGL,CAAM,EAAGM,EAAK,CACtH,OAAOX,EAACT,EAAW,QAAX,CAAmB,IAAKoB,EAAM,GAAGN,EAAO,UAAWR,EAAU,oBAAqBa,CAAS,EAAG,CACxG,CAAC,EAmBYE,EAAQlB,EAAuC,SAC1D,CAAE,UAAAmB,EAAW,QAAAC,EAAU,QAAS,WAAAC,EAAa,QAAS,UAAAL,EAAW,SAAAM,EAAU,GAAGX,CAAM,EACpFM,EACA,CACA,IAAMJ,EAAOZ,EAAWO,CAAW,EAC7Be,EAAOH,IAAY,OACzB,OACEb,EAACV,EAAW,OAAX,CAAkB,UAAWsB,EAC5B,UAAAb,EAACT,EAAW,SAAX,CAAoB,UAAU,qBAAqB,EACpDS,EAACT,EAAW,SAAX,CAAoB,UAAW,gCAAgCgB,CAAI,GAClE,SAAAN,EAACV,EAAW,MAAX,CAAiB,IAAKoB,EAAM,GAAGN,EAAO,UAAWR,EAAUD,EAAG,kBAAmBqB,GAAQ,iBAAkB,iBAAiB,EAAGP,CAAS,EAEvI,UAAAV,EAACT,EAAW,QAAX,CAAmB,UAAU,oBAE5B,SAAAS,EAACF,EAAY,SAAZ,CAAqB,MAAM,KAAM,SAAAkB,EAAS,EAC7C,EACCC,EAAO,KACNjB,EAACT,EAAW,MAAX,CAAiB,UAAU,cAAc,OAAQS,EAACD,EAAA,CAAO,QAAQ,QAAQ,KAAK,KAAK,KAAMC,EAACR,EAAA,EAAE,EAAI,aAAYuB,EAAY,EAAI,GAEjI,EACF,GACF,CAEJ,CAAC,EAKYG,EAAQxB,EAA2C,SAAqB,CAAE,UAAAgB,EAAW,GAAGL,CAAM,EAAGM,EAAK,CACjH,OAAOX,EAACT,EAAW,MAAX,CAAiB,IAAKoB,EAAM,GAAGN,EAAO,UAAWR,EAAU,2BAA4Ba,CAAS,EAAG,CAC7G,CAAC,EAKYS,EAAczB,EAAmD,SAA2B,CAAE,UAAAgB,EAAW,GAAGL,CAAM,EAAGM,EAAK,CACrI,OAAOX,EAACT,EAAW,YAAX,CAAuB,IAAKoB,EAAM,GAAGN,EAAO,UAAWR,EAAU,gCAAiCa,CAAS,EAAG,CACxH,CAAC,EAKYU,EAAQ1B,EAA0C,SAAqB,CAAE,UAAAgB,EAAW,GAAGL,CAAM,EAAGM,EAAK,CAChH,OAAOX,EAACT,EAAW,MAAX,CAAiB,IAAKoB,EAAM,GAAGN,EAAO,UAAWR,EAAU,kBAAmBa,CAAS,EAAG,CACpG,CAAC",
|
|
6
|
+
"names": ["useDirection", "BaseDrawer", "X", "createContext", "forwardRef", "useContext", "cx", "withClass", "SizeContext", "Button", "jsx", "jsxs", "EdgeContext", "Root", "side", "props", "direction", "edge", "swipeDirection", "Trigger", "className", "ref", "Popup", "container", "variant", "closeLabel", "children", "bare", "Title", "Description", "Close"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{Field as i}from"@base-ui/react/field";import{CircleAlert as
|
|
2
|
+
import{Field as i}from"@base-ui/react/field";import{CircleAlert as c}from"lucide-react";import{forwardRef as s}from"react";import{withClass as n}from"../../internal/class-name.js";import{SizeContext as d,useRowSize as f}from"../../internal/size.js";import{jsx as t,jsxs as u}from"react/jsx-runtime";var b=s(function({size:r,orientation:e="vertical",className:o,...l},p){let m=f(r);return t(d.Provider,{value:m,children:t(i.Root,{ref:p,"data-orientation":e,...l,className:n(e==="horizontal"?"mu-field-root mu-field-horizontal":"mu-field-root",o)})})}),v=s(function({className:r,...e},o){return t(i.Label,{ref:o,...e,className:n("mu-field-label mu-label",r)})}),z=s(function({className:r,...e},o){return t(i.Item,{ref:o,...e,className:n("mu-field-item",r)})}),D=s(function({className:r,...e},o){return t(i.Description,{ref:o,...e,className:n("mu-field-description mu-caption",r)})}),R=s(function({className:r,children:e,...o},l){return u(i.Error,{ref:l,...o,className:n("mu-field-error mu-caption",r),children:[t(c,{className:"mu-icon","aria-hidden":!0}),t("span",{children:e})]})});export{D as Description,R as Error,z as Item,v as Label,b as Root};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
5
|
-
"mappings": ";AAAA,OAAS,SAASA,MAAiB,uBACnC,OAAS,eAAAC,MAAmB,eAC5B,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,eAAAC,EAAa,cAAAC,MAAkB,
|
|
6
|
-
"names": ["BaseField", "CircleAlert", "forwardRef", "withClass", "SizeContext", "useRowSize", "jsx", "jsxs", "Root", "size", "className", "props", "ref", "resolved", "Label", "Item", "Description", "Error", "children"]
|
|
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 * `vertical` (default) stacks the label over the control. `horizontal` puts\n * the label and description first and the control at the end of the row,\n * as in a settings row with a Switch or Select.\n */\n orientation?: 'vertical' | 'horizontal';\n}\n\n/** One control with its label, description and error, wired for screen readers. */\nexport const Root = forwardRef<HTMLDivElement, RootProps>(function FieldRoot({ size, orientation = 'vertical', className, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <BaseField.Root\n ref={ref}\n data-orientation={orientation}\n {...props}\n className={withClass(orientation === 'horizontal' ? 'mu-field-root mu-field-horizontal' : 'mu-field-root', className)}\n />\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.Error>\n );\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,SAASA,MAAiB,uBACnC,OAAS,eAAAC,MAAmB,eAC5B,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAmBlC,cAAAC,EAoCF,QAAAC,MApCE,oBAJC,IAAMC,EAAON,EAAsC,SAAmB,CAAE,KAAAO,EAAM,YAAAC,EAAc,WAAY,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzI,IAAMC,EAAWT,EAAWI,CAAI,EAChC,OACEH,EAACF,EAAY,SAAZ,CAAqB,MAAOU,EAC3B,SAAAR,EAACN,EAAU,KAAV,CACC,IAAKa,EACL,mBAAkBH,EACjB,GAAGE,EACJ,UAAWT,EAAUO,IAAgB,aAAe,oCAAsC,gBAAiBC,CAAS,EACtH,EACF,CAEJ,CAAC,EAKYI,EAAQb,EAAyC,SAAoB,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAC9G,OAAOP,EAACN,EAAU,MAAV,CAAgB,IAAKa,EAAM,GAAGD,EAAO,UAAWT,EAAU,0BAA2BQ,CAAS,EAAG,CAC3G,CAAC,EAKYK,EAAOd,EAAsC,SAAmB,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACzG,OAAOP,EAACN,EAAU,KAAV,CAAe,IAAKa,EAAM,GAAGD,EAAO,UAAWT,EAAU,gBAAiBQ,CAAS,EAAG,CAChG,CAAC,EAKYM,EAAcf,EAAmD,SAA0B,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACpI,OAAOP,EAACN,EAAU,YAAV,CAAsB,IAAKa,EAAM,GAAGD,EAAO,UAAWT,EAAU,kCAAmCQ,CAAS,EAAG,CACzH,CAAC,EAKYO,EAAQhB,EAAuC,SAAoB,CAAE,UAAAS,EAAW,SAAAQ,EAAU,GAAGP,CAAM,EAAGC,EAAK,CACtH,OACEN,EAACP,EAAU,MAAV,CAAgB,IAAKa,EAAM,GAAGD,EAAO,UAAWT,EAAU,4BAA6BQ,CAAS,EAC/F,UAAAL,EAACL,EAAA,CAAY,UAAU,UAAU,cAAW,GAAC,EAC7CK,EAAC,QAAM,SAAAa,EAAS,GAClB,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseField", "CircleAlert", "forwardRef", "withClass", "SizeContext", "useRowSize", "jsx", "jsxs", "Root", "size", "orientation", "className", "props", "ref", "resolved", "Label", "Item", "Description", "Error", "children"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{forwardRef as i}from"react";import{cx as m}from"../../internal/class-name.js";import{SizeContext as u,useRowSize as f}from"../../internal/size.js";import{jsx as r}from"react/jsx-runtime";var P=i(function({size:e,className:o,...t},p){let s=f(e);return r(u.Provider,{value:s,children:r("ul",{ref:p,...t,className:m("mu-list mu-base mu-body",`mu-s-${s}`,o)})})}),R=i(function({className:e,...o},t){return r("li",{ref:t,...o,className:m("mu-list-item",e)})});export{R as Item,P as Root};
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/list/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { cx } from '../../internal/class-name';\nimport { SizeContext, useRowSize } from '../../internal/size';\nimport type { Size } from '../../types';\n\nexport interface RootProps extends ComponentPropsWithoutRef<'ul'> {\n /** `sm` for dense lists. Sets the rows' padding and the size of the controls inside. */\n size?: Exclude<Size, 'xs'>;\n}\n\n/**\n * A boxed list of records or settings rows: a `<ul>` with a `line` edge and\n * `radius-lg`, its rows divided by `line`. Name it with `aria-label` or\n * `aria-labelledby` when a heading above doesn't.\n */\nexport const Root = forwardRef<HTMLUListElement, RootProps>(function ListRoot({ size, className, ...props }, ref) {\n const resolved = useRowSize(size);\n return (\n <SizeContext.Provider value={resolved}>\n <ul ref={ref} {...props} className={cx('mu-list mu-base mu-body', `mu-s-${resolved}`, className)} />\n </SizeContext.Provider>\n );\n});\n\nexport interface ItemProps extends ComponentPropsWithoutRef<'li'> {}\n\n/** One row, an `<li>`: a horizontal Field, or a record's text with its actions at the end. */\nexport const Item = forwardRef<HTMLLIElement, ItemProps>(function ListItem({ className, ...props }, ref) {\n return <li ref={ref} {...props} className={cx('mu-list-item', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,cAAAA,MAAiD,QAC1D,OAAS,MAAAC,MAAU,+BACnB,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAiBlC,cAAAC,MAAA,oBAJC,IAAMC,EAAOL,EAAwC,SAAkB,CAAE,KAAAM,EAAM,UAAAC,EAAW,GAAGC,CAAM,EAAGC,EAAK,CAChH,IAAMC,EAAWP,EAAWG,CAAI,EAChC,OACEF,EAACF,EAAY,SAAZ,CAAqB,MAAOQ,EAC3B,SAAAN,EAAC,MAAG,IAAKK,EAAM,GAAGD,EAAO,UAAWP,EAAG,0BAA2B,QAAQS,CAAQ,GAAIH,CAAS,EAAG,EACpG,CAEJ,CAAC,EAKYI,EAAOX,EAAqC,SAAkB,CAAE,UAAAO,EAAW,GAAGC,CAAM,EAAGC,EAAK,CACvG,OAAOL,EAAC,MAAG,IAAKK,EAAM,GAAGD,EAAO,UAAWP,EAAG,eAAgBM,CAAS,EAAG,CAC5E,CAAC",
|
|
6
|
+
"names": ["forwardRef", "cx", "SizeContext", "useRowSize", "jsx", "Root", "size", "className", "props", "ref", "resolved", "Item"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
function
|
|
2
|
+
function t({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",text:"mu-menu-text",description:"mu-menu-description mu-caption",shortcut:"mu-menu-shortcut",separator:"mu-menu-separator",groupLabel:"mu-menu-group-label mu-label-sm"}}export{t as menuClasses};
|
|
3
3
|
//# sourceMappingURL=classes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/menu/classes.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Size } from '../../types';\n\nexport interface MenuClassesOptions {\n /** Row height of every item: 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": ";
|
|
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 /** Stacks a row's label over its description. */\n text: string;\n /** A line of `ink-muted` text under the label. */\n description: string;\n /** A keyboard shortcut at the end of a row. */\n shortcut: string;\n /** A line between groups of rows. */\n separator: string;\n /** The name of a group of rows. */\n groupLabel: string;\n}\n\n/**\n * The classes that make an app's own floating list look like a Menu, such as\n * an editor's suggestion list. The app sets `data-highlighted` on the active\n * row. See docs/custom-components.md.\n */\nexport function menuClasses({ size = 'md' }: MenuClassesOptions = {}): MenuClasses {\n return {\n popup: `mu-menu-popup mu-popup mu-popup-motion mu-base mu-s-${size}`,\n item: 'mu-menu-item',\n dangerItem: 'mu-menu-item mu-menu-item-danger',\n label: 'mu-menu-label',\n text: 'mu-menu-text',\n description: 'mu-menu-description mu-caption',\n shortcut: 'mu-menu-shortcut',\n separator: 'mu-menu-separator',\n groupLabel: 'mu-menu-group-label mu-label-sm',\n };\n}\n"],
|
|
5
|
+
"mappings": ";AAkCO,SAASA,EAAY,CAAE,KAAAC,EAAO,IAAK,EAAwB,CAAC,EAAgB,CACjF,MAAO,CACL,MAAO,uDAAuDA,CAAI,GAClE,KAAM,eACN,WAAY,mCACZ,MAAO,gBACP,KAAM,eACN,YAAa,iCACb,SAAU,mBACV,UAAW,oBACX,WAAY,iCACd,CACF",
|
|
6
6
|
"names": ["menuClasses", "size"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{Menu as t}from"@base-ui/react/menu";import{Check as
|
|
2
|
+
import{Menu as t}from"@base-ui/react/menu";import{Check as b,ChevronRight as h}from"lucide-react";import{forwardRef as c,useId as T}from"react";import{cx as M,withClass as m}from"../../internal/class-name.js";import{splitPositioner as B}from"../../internal/popup.js";import{SizeContext as N,useRowSize as g}from"../../internal/size.js";import{menuClasses as R}from"./classes.js";import{Fragment as S,jsx as n,jsxs as f}from"react/jsx-runtime";var u=R();function D({size:a,...o}){let e=g(a);return n(N.Provider,{value:e,children:n(t.Root,{...o})})}var H=c(function({className:o,...e},r){return n(t.Trigger,{ref:r,...e,className:m("mu-menu-trigger",o)})}),y=c(function({container:o,className:e,...r},s){let i=g(),[p,l]=B(r);return n(t.Portal,{container:o,children:n(t.Positioner,{sideOffset:4,...p,className:"mu-positioner",children:n(t.Popup,{ref:s,...l,className:m(R({size:i}).popup,e)})})})});function x({icon:a,shortcut:o,description:e,children:r}){let s=T(),i=e!=null&&e!==!1,p=n("span",{className:u.label,id:i?`${s}-label`:void 0,children:r}),l=f(S,{children:[a,i?f("span",{className:u.text,children:[p,n("span",{className:u.description,id:`${s}-description`,children:e})]}):p,o!==void 0?n("span",{className:u.shortcut,children:o}):null]}),d=i?{"aria-labelledby":`${s}-label`,"aria-describedby":`${s}-description`}:null;return[l,d]}var z=c(function({icon:o,shortcut:e,description:r,danger:s=!1,className:i,children:p,...l},d){let[P,I]=x({icon:o,shortcut:e,description:r,children:p});return n(t.Item,{ref:d,...I,...l,className:m(s?u.dangerItem:u.item,i),children:P})}),$=c(function({icon:o,shortcut:e,description:r,className:s,children:i,...p},l){let[d,P]=x({icon:o,shortcut:e,description:r,children:i});return f(t.CheckboxItem,{ref:l,...P,...p,className:m(M(u.item,"mu-menu-checkbox-item"),s),children:[d,n("span",{className:"mu-menu-indicator",children:n(t.CheckboxItemIndicator,{render:n(b,{"aria-hidden":!0})})})]})}),A=c(function({className:o,...e},r){return n(t.RadioGroup,{ref:r,...e,className:m("mu-menu-radio-group",o)})}),O=c(function({icon:o,shortcut:e,description:r,className:s,children:i,...p},l){let[d,P]=x({icon:o,shortcut:e,description:r,children:i});return f(t.RadioItem,{ref:l,...P,...p,className:m(M(u.item,"mu-menu-radio-item"),s),children:[d,n("span",{className:"mu-menu-indicator",children:n(t.RadioItemIndicator,{render:n(b,{"aria-hidden":!0})})})]})}),q=c(function({className:o,...e},r){return n(t.Group,{ref:r,...e,className:m("mu-menu-group",o)})}),F=c(function({className:o,...e},r){return n(t.GroupLabel,{ref:r,...e,className:m(u.groupLabel,o)})}),J=c(function({className:o,...e},r){return n(t.Separator,{ref:r,...e,className:m(u.separator,o)})}),K=t.SubmenuRoot,Q=c(function({icon:o,className:e,children:r,...s},i){let[p]=x({icon:o,children:r});return f(t.SubmenuTrigger,{ref:i,...s,className:m(M(u.item,"mu-menu-submenu-trigger"),e),children:[p,n(h,{className:"mu-menu-chevron","aria-hidden":!0})]})});export{$ as CheckboxItem,q as Group,F as GroupLabel,z as Item,y as Popup,A as RadioGroup,O as RadioItem,D as Root,J as Separator,K as SubmenuRoot,Q as SubmenuTrigger,H as Trigger};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/menu/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Menu as BaseMenu } from '@base-ui/react/menu';\nimport { Check, ChevronRight } from 'lucide-react';\nimport { forwardRef, 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
|
|
5
|
-
"mappings": ";AAAA,OAAS,QAAQA,MAAgB,sBACjC,OAAS,SAAAC,EAAO,gBAAAC,MAAoB,eACpC,OAAS,cAAAC,
|
|
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", "
|
|
4
|
+
"sourcesContent": ["import { Menu as BaseMenu } from '@base-ui/react/menu';\nimport { Check, ChevronRight } from 'lucide-react';\nimport { forwardRef, useId, 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 /** A line of `ink-muted` text under the label, which makes the row two lines tall. Screen readers read it as the item's description. */\n description?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * The shared inside of every row: icon, label, shortcut. With a description,\n * the label and description stack, and the item is named by the label and\n * described by the description.\n */\nfunction useRow({ icon, shortcut, description, children }: RowProps) {\n const id = useId();\n const hasDescription = description !== undefined && description !== null && description !== false;\n const label = <span className={classes.label} id={hasDescription ? `${id}-label` : undefined}>{children}</span>;\n const content = (\n <>\n {icon}\n {hasDescription ? (\n <span className={classes.text}>\n {label}\n <span className={classes.description} id={`${id}-description`}>{description}</span>\n </span>\n ) : (\n label\n )}\n {shortcut !== undefined ? <span className={classes.shortcut}>{shortcut}</span> : null}\n </>\n );\n const aria = hasDescription ? { 'aria-labelledby': `${id}-label`, 'aria-describedby': `${id}-description` } : null;\n return [content, aria] as const;\n}\n\nexport interface ItemProps extends BaseMenu.Item.Props, RowProps {\n /** A destructive action: red text. Put it last, after a Separator. */\n danger?: boolean;\n}\n\n/** One action. */\nexport const Item = forwardRef<HTMLDivElement, ItemProps>(function MenuItem({ icon, shortcut, description, danger = false, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.Item ref={ref} {...aria} {...props} className={withClass(danger ? classes.dangerItem : classes.item, className)}>\n {row}\n </BaseMenu.Item>\n );\n});\n\nexport interface CheckboxItemProps extends BaseMenu.CheckboxItem.Props, RowProps {}\n\n/** An option that turns on or off, with a check at the end. Stays open on click. */\nexport const CheckboxItem = forwardRef<HTMLDivElement, CheckboxItemProps>(function MenuCheckboxItem({ icon, shortcut, description, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.CheckboxItem ref={ref} {...aria} {...props} className={withClass(cx(classes.item, 'mu-menu-checkbox-item'), className)}>\n {row}\n <span className=\"mu-menu-indicator\">\n <BaseMenu.CheckboxItemIndicator render={<Check aria-hidden />} />\n </span>\n </BaseMenu.CheckboxItem>\n );\n});\n\nexport interface RadioGroupProps extends BaseMenu.RadioGroup.Props {}\n\n/** Groups RadioItems: exactly one is chosen. */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function MenuRadioGroup({ className, ...props }, ref) {\n return <BaseMenu.RadioGroup ref={ref} {...props} className={withClass('mu-menu-radio-group', className)} />;\n});\n\nexport interface RadioItemProps extends BaseMenu.RadioItem.Props, RowProps {}\n\n/** One choice in a RadioGroup, with a check at the end when chosen. Stays open on click. */\nexport const RadioItem = forwardRef<HTMLDivElement, RadioItemProps>(function MenuRadioItem({ icon, shortcut, description, className, children, ...props }, ref) {\n const [row, aria] = useRow({ icon, shortcut, description, children });\n return (\n <BaseMenu.RadioItem ref={ref} {...aria} {...props} className={withClass(cx(classes.item, 'mu-menu-radio-item'), className)}>\n {row}\n <span className=\"mu-menu-indicator\">\n <BaseMenu.RadioItemIndicator render={<Check aria-hidden />} />\n </span>\n </BaseMenu.RadioItem>\n );\n});\n\nexport interface GroupProps extends BaseMenu.Group.Props {}\n\n/** A labeled set of items. */\nexport const Group = forwardRef<HTMLDivElement, GroupProps>(function MenuGroup({ className, ...props }, ref) {\n return <BaseMenu.Group ref={ref} {...props} className={withClass('mu-menu-group', className)} />;\n});\n\nexport interface GroupLabelProps extends BaseMenu.GroupLabel.Props {}\n\n/** The name of a Group or RadioGroup. */\nexport const GroupLabel = forwardRef<HTMLDivElement, GroupLabelProps>(function MenuGroupLabel({ className, ...props }, ref) {\n return <BaseMenu.GroupLabel ref={ref} {...props} className={withClass(classes.groupLabel, className)} />;\n});\n\nexport interface SeparatorProps extends BaseMenu.Separator.Props {}\n\n/** A line between groups of items. */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function MenuSeparator({ className, ...props }, ref) {\n return <BaseMenu.Separator ref={ref} {...props} className={withClass(classes.separator, className)} />;\n});\n\nexport type SubmenuRootProps = BaseMenu.SubmenuRoot.Props;\n\n/** Holds a SubmenuTrigger and its own Popup. */\nexport const SubmenuRoot = BaseMenu.SubmenuRoot;\n\nexport interface SubmenuTriggerProps extends BaseMenu.SubmenuTrigger.Props {\n icon?: IconElement;\n children?: ReactNode;\n}\n\n/** The row that opens a submenu, with a chevron at the end. */\nexport const SubmenuTrigger = forwardRef<HTMLDivElement, SubmenuTriggerProps>(function MenuSubmenuTrigger({ icon, className, children, ...props }, ref) {\n const [row] = useRow({ icon, children });\n return (\n <BaseMenu.SubmenuTrigger ref={ref} {...props} className={withClass(cx(classes.item, 'mu-menu-submenu-trigger'), className)}>\n {row}\n <ChevronRight className=\"mu-menu-chevron\" aria-hidden />\n </BaseMenu.SubmenuTrigger>\n );\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,QAAQA,MAAgB,sBACjC,OAAS,SAAAC,EAAO,gBAAAC,MAAoB,eACpC,OAAS,cAAAC,EAAY,SAAAC,MAA6B,QAClD,OAAS,MAAAC,EAAI,aAAAC,MAAiB,+BAC9B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,EAAa,cAAAC,MAAkB,yBAExC,OAAS,eAAAC,MA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AA2C,SAAuB,CAAE,UAAAiB,EAAW,GAAGH,CAAM,EAAGI,EAAK,CACvH,OAAOT,EAACZ,EAAS,UAAT,CAAmB,IAAKqB,EAAM,GAAGJ,EAAO,UAAWX,EAAUQ,EAAQ,UAAWM,CAAS,EAAG,CACtG,CAAC,EAKYyB,EAAc7C,EAAS,YAQvB8C,EAAiB3C,EAAgD,SAA4B,CAAE,KAAAwB,EAAM,UAAAP,EAAW,SAAAU,EAAU,GAAGb,CAAM,EAAGI,EAAK,CACtJ,GAAM,CAACiB,CAAG,EAAIZ,EAAO,CAAE,KAAAC,EAAM,SAAAG,CAAS,CAAC,EACvC,OACEjB,EAACb,EAAS,eAAT,CAAwB,IAAKqB,EAAM,GAAGJ,EAAO,UAAWX,EAAUD,EAAGS,EAAQ,KAAM,yBAAyB,EAAGM,CAAS,EACtH,UAAAkB,EACD1B,EAACV,EAAA,CAAa,UAAU,kBAAkB,cAAW,GAAC,GACxD,CAEJ,CAAC",
|
|
6
|
+
"names": ["BaseMenu", "Check", "ChevronRight", "forwardRef", "useId", "cx", "withClass", "splitPositioner", "SizeContext", "useRowSize", "menuClasses", "Fragment", "jsx", "jsxs", "classes", "Root", "size", "props", "resolved", "Trigger", "className", "ref", "Popup", "container", "positioner", "rest", "useRow", "icon", "shortcut", "description", "children", "id", "hasDescription", "label", "content", "aria", "Item", "danger", "row", "CheckboxItem", "RadioGroup", "RadioItem", "Group", "GroupLabel", "Separator", "SubmenuRoot", "SubmenuTrigger"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
function p
|
|
2
|
+
function o({variant:p="panel"}={}){return{popup:`mu-popover-popup${p==="list"?" mu-popover-list":""} mu-popup mu-popup-motion mu-base mu-s-md`,title:"mu-popover-title mu-label",description:"mu-popover-description mu-caption"}}export{o as popoverClasses};
|
|
3
3
|
//# sourceMappingURL=classes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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:
|
|
5
|
-
"mappings": ";
|
|
6
|
-
"names": ["popoverClasses"]
|
|
4
|
+
"sourcesContent": ["export type PopoverVariant = 'panel' | 'list';\n\nexport interface PopoverClassesOptions {\n /** `panel` pads its content and stacks it `space-3` apart; `list` holds rows with a Menu's `space-1` padding and no gap. */\n variant?: PopoverVariant;\n}\n\n/** The classes of each part of a Popover. */\nexport interface PopoverClasses {\n /** The panel: a surface with `shadow-pop`, `popover-width` wide. */\n popup: string;\n /** The panel's heading. */\n title: string;\n /** One line under the title. */\n description: string;\n}\n\n/**\n * The classes that make an app's own floating panel look like a Popover, such\n * as an emoji picker. See docs/custom-components.md.\n */\nexport function popoverClasses({ variant = 'panel' }: PopoverClassesOptions = {}): PopoverClasses {\n return {\n popup: `mu-popover-popup${variant === 'list' ? ' mu-popover-list' : ''} mu-popup mu-popup-motion mu-base mu-s-md`,\n title: 'mu-popover-title mu-label',\n description: 'mu-popover-description mu-caption',\n };\n}\n"],
|
|
5
|
+
"mappings": ";AAqBO,SAASA,EAAe,CAAE,QAAAC,EAAU,OAAQ,EAA2B,CAAC,EAAmB,CAChG,MAAO,CACL,MAAO,mBAAmBA,IAAY,OAAS,mBAAqB,EAAE,4CACtE,MAAO,4BACP,YAAa,mCACf,CACF",
|
|
6
|
+
"names": ["popoverClasses", "variant"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
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
|
|
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 u}from"../../internal/popup.js";import{SizeContext as g}from"../../internal/size.js";import{popoverClasses as a}from"./classes.js";import{jsx as t}from"react/jsx-runtime";var P=a(),x=a({variant:"list"}),M=s.Root,N=p(function({className:o,...e},r){return t(s.Trigger,{ref:r,...e,className:i("mu-popover-trigger",o)})}),h=p(function({container:o,variant:e="panel",className:r,children:c,...l},v){let[m,f]=u(l);return t(s.Portal,{container:o,children:t(s.Positioner,{sideOffset:6,...m,className:"mu-positioner",children:t(s.Popup,{ref:v,...f,className:i(e==="list"?x.popup:P.popup,r),children:t(g.Provider,{value:"md",children:c})})})})}),y=p(function({className:o,...e},r){return t(s.Title,{ref:r,...e,className:i(P.title,o)})}),E=p(function({className:o,...e},r){return t(s.Description,{ref:r,...e,className:i(P.description,o)})}),L=p(function({className:o,...e},r){return t(s.Close,{ref:r,...e,className:i("mu-popover-close",o)})});export{L as Close,E as Description,h as Popup,M as Root,y as Title,N as Trigger};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/popover/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Popover as BasePopover } from '@base-ui/react/popover';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext } from '../../internal/size';\nimport { popoverClasses } 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, children, ...props }, ref) {\n const [positioner, rest] = splitPositioner(props);\n return (\n <BasePopover.Portal container={container}>\n <BasePopover.Positioner sideOffset={6} {...positioner} className=\"mu-positioner\">\n <BasePopover.Popup ref={ref} {...rest} className={withClass(classes.popup, className)}>\n {/* The panel is md wherever it is declared: React context crosses the portal, so a sm toolbar's size would leak in. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n );\n});\n\nexport interface TitleProps extends BasePopover.Title.Props {}\n\n/** The popover's heading, an `<h2>`. Names the popup for screen readers. */\nexport const Title = forwardRef<HTMLHeadingElement, TitleProps>(function PopoverTitle({ className, ...props }, ref) {\n return <BasePopover.Title ref={ref} {...props} className={withClass(classes.title, className)} />;\n});\n\nexport interface DescriptionProps extends BasePopover.Description.Props {}\n\n/** One line under the title, a `<p>`. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function PopoverDescription({ className, ...props }, ref) {\n return <BasePopover.Description ref={ref} {...props} className={withClass(classes.description, className)} />;\n});\n\nexport interface CloseProps extends BasePopover.Close.Props {}\n\n/** Closes the popover. Usually `render={<Button />}`. */\nexport const Close = forwardRef<HTMLButtonElement, CloseProps>(function PopoverClose({ className, ...props }, ref) {\n return <BasePopover.Close ref={ref} {...props} className={withClass('mu-popover-close', className)} />;\n});\n"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,WAAWA,MAAmB,yBACvC,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,MAAmB,yBAC5B,OAAS,kBAAAC,
|
|
6
|
-
"names": ["BasePopover", "forwardRef", "withClass", "splitPositioner", "SizeContext", "popoverClasses", "jsx", "classes", "Root", "Trigger", "className", "props", "ref", "Popup", "container", "children", "positioner", "rest", "Title", "Description", "Close"]
|
|
4
|
+
"sourcesContent": ["import { Popover as BasePopover } from '@base-ui/react/popover';\nimport { forwardRef } from 'react';\nimport { withClass } from '../../internal/class-name';\nimport { splitPositioner } from '../../internal/popup';\nimport { SizeContext } from '../../internal/size';\nimport { popoverClasses, type PopoverVariant } from './classes';\n\nconst classes = /* @__PURE__ */ popoverClasses();\nconst listClasses = /* @__PURE__ */ popoverClasses({ variant: 'list' });\n\nexport type RootProps = BasePopover.Root.Props;\n\n/** Groups a trigger and its popover. */\nexport const Root = BasePopover.Root;\n\nexport interface TriggerProps extends BasePopover.Trigger.Props {}\n\n/** Opens the popover. Usually `render={<Button />}`. */\nexport const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function PopoverTrigger({ className, ...props }, ref) {\n return <BasePopover.Trigger ref={ref} {...props} className={withClass('mu-popover-trigger', className)} />;\n});\n\ntype PositionerProps = Pick<\n BasePopover.Positioner.Props,\n 'side' | 'align' | 'collisionAvoidance' | 'collisionBoundary' | 'sticky' | 'anchor' | 'positionMethod' | 'disableAnchorTracking'\n>;\n\nexport interface PopupProps extends BasePopover.Popup.Props, PositionerProps {\n /** Where the popover is portaled to. Default `document.body`. */\n container?: BasePopover.Portal.Props['container'];\n /**\n * `panel` (default) pads its content `space-4` and stacks it `space-3` apart.\n * `list` holds rows, such as an account menu with a header: a Menu's\n * `space-1` padding and no gap, for rows with `menuClasses().item`.\n */\n variant?: PopoverVariant;\n}\n\n/** The panel: a surface with `shadow-pop`, `popover-width` wide. */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function PopoverPopup({ container, variant = 'panel', className, children, ...props }, ref) {\n const [positioner, rest] = splitPositioner(props);\n return (\n <BasePopover.Portal container={container}>\n <BasePopover.Positioner sideOffset={6} {...positioner} className=\"mu-positioner\">\n <BasePopover.Popup ref={ref} {...rest} className={withClass(variant === 'list' ? listClasses.popup : classes.popup, className)}>\n {/* The panel is md wherever it is declared: React context crosses the portal, so a sm toolbar's size would leak in. */}\n <SizeContext.Provider value=\"md\">{children}</SizeContext.Provider>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n );\n});\n\nexport interface TitleProps extends BasePopover.Title.Props {}\n\n/** The popover's heading, an `<h2>`. Names the popup for screen readers. */\nexport const Title = forwardRef<HTMLHeadingElement, TitleProps>(function PopoverTitle({ className, ...props }, ref) {\n return <BasePopover.Title ref={ref} {...props} className={withClass(classes.title, className)} />;\n});\n\nexport interface DescriptionProps extends BasePopover.Description.Props {}\n\n/** One line under the title, a `<p>`. */\nexport const Description = forwardRef<HTMLParagraphElement, DescriptionProps>(function PopoverDescription({ className, ...props }, ref) {\n return <BasePopover.Description ref={ref} {...props} className={withClass(classes.description, className)} />;\n});\n\nexport interface CloseProps extends BasePopover.Close.Props {}\n\n/** Closes the popover. Usually `render={<Button />}`. */\nexport const Close = forwardRef<HTMLButtonElement, CloseProps>(function PopoverClose({ className, ...props }, ref) {\n return <BasePopover.Close ref={ref} {...props} className={withClass('mu-popover-close', className)} />;\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,WAAWA,MAAmB,yBACvC,OAAS,cAAAC,MAAkB,QAC3B,OAAS,aAAAC,MAAiB,+BAC1B,OAAS,mBAAAC,MAAuB,0BAChC,OAAS,eAAAC,MAAmB,yBAC5B,OAAS,kBAAAC,MAA2C,eAc3C,cAAAC,MAAA,oBAZT,IAAMC,EAA0BF,EAAe,EACzCG,EAA8BH,EAA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H,OAAOP,EAACN,EAAY,MAAZ,CAAkB,IAAKa,EAAM,GAAGD,EAAO,UAAWV,EAAU,mBAAoBS,CAAS,EAAG,CACtG,CAAC",
|
|
6
|
+
"names": ["BasePopover", "forwardRef", "withClass", "splitPositioner", "SizeContext", "popoverClasses", "jsx", "classes", "listClasses", "Root", "Trigger", "className", "props", "ref", "Popup", "container", "variant", "children", "positioner", "rest", "Title", "Description", "Close"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
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
|
|
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 m}from"../../internal/size.js";import{buttonClasses as T}from"../button/index.js";import{jsx as e,jsxs as P}from"react/jsx-runtime";function E({size:a,...o}){let r=m(a);return e(I.Provider,{value:r,children:e(t.Root,{...o})})}var V=l(function({variant:o="neutral",className:r,children:s,...i},p){let c=m();return P(t.Trigger,{ref:p,...i,className:n(`mu-select-trigger ${T({variant:o,size:c})}`,r),children:[s,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 c=m(),[d,S]=v(i);return e(t.Portal,{container:o,children:e(t.Positioner,{sideOffset:4,...d,className:"mu-positioner mu-select-positioner",children:P(t.Popup,{ref:p,...S,className:n(`mu-select-popup mu-popup mu-popup-motion mu-base mu-s-${c}`,r),children:[e(t.ScrollUpArrow,{className:"mu-select-scroll-arrow",render:u=>e("div",{...u,children:e(B,{"aria-hidden":!0})})}),e(t.List,{className:"mu-select-list",children:s}),e(t.ScrollDownArrow,{className:"mu-select-scroll-arrow",render:u=>e("div",{...u,children:e(x,{"aria-hidden":!0})})})]})})})}),C=l(function({icon:o,className:r,children:s,...i},p){return P(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
3
|
//# sourceMappingURL=index.js.map
|