@womp/kookie-ui 0.14.1 → 0.14.3
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/components.css +18 -15
- package/dist/cjs/components/button.d.ts +16 -3
- package/dist/cjs/components/button.d.ts.map +1 -1
- package/dist/cjs/components/button.js +2 -2
- package/dist/cjs/components/button.js.map +3 -3
- package/dist/cjs/components/chatbar.js +2 -2
- package/dist/cjs/components/chatbar.js.map +3 -3
- package/dist/cjs/components/icon-button.js +2 -2
- package/dist/cjs/components/icon-button.js.map +3 -3
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/message-scroller.js +2 -2
- package/dist/cjs/components/message-scroller.js.map +3 -3
- package/dist/cjs/components/notice.js +2 -2
- package/dist/cjs/components/notice.js.map +3 -3
- package/dist/cjs/components/theme-panel.js +3 -3
- package/dist/cjs/components/theme-panel.js.map +3 -3
- package/dist/cjs/components/toggle-button.d.ts +37 -3
- package/dist/cjs/components/toggle-button.d.ts.map +1 -1
- package/dist/cjs/components/toggle-button.js +3 -3
- package/dist/cjs/components/toggle-button.js.map +3 -3
- package/dist/cjs/components/toggle-icon-button.js +3 -3
- package/dist/cjs/components/toggle-icon-button.js.map +3 -3
- package/dist/cjs/components/toolbar.d.ts.map +1 -1
- package/dist/cjs/components/toolbar.js +2 -2
- package/dist/cjs/components/toolbar.js.map +3 -3
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/chunk-522UYMDA.js +2 -0
- package/dist/esm/{chunk-VV67KTKA.js.map → chunk-522UYMDA.js.map} +3 -3
- package/dist/esm/{chunk-IQU6EELI.js → chunk-66GLO2EG.js} +2 -2
- package/dist/esm/{chunk-RAVFUI7W.js → chunk-BJ2Q2WVV.js} +2 -2
- package/dist/esm/{chunk-WXBTPEFO.js → chunk-DAGHSWME.js} +2 -2
- package/dist/esm/{chunk-7B6CIVAF.js → chunk-IICXZUIB.js} +2 -2
- package/dist/esm/{chunk-YDPCJO5G.js → chunk-KDYHYQ4D.js} +2 -2
- package/dist/esm/chunk-KDYHYQ4D.js.map +7 -0
- package/dist/esm/{chunk-TZ5MZQUB.js → chunk-RJTWRLK4.js} +2 -2
- package/dist/esm/chunk-UCIIRQUE.js +5 -0
- package/dist/esm/chunk-UCIIRQUE.js.map +7 -0
- package/dist/esm/{chunk-BOFVKXUV.js → chunk-YEYM7QQZ.js} +2 -2
- package/dist/esm/components/button.d.ts +16 -3
- package/dist/esm/components/button.d.ts.map +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/icon-button.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/message-scroller.js +1 -1
- package/dist/esm/components/notice.js +1 -1
- package/dist/esm/components/theme-panel.js +1 -1
- package/dist/esm/components/toggle-button.d.ts +37 -3
- package/dist/esm/components/toggle-button.d.ts.map +1 -1
- package/dist/esm/components/toggle-button.js +1 -1
- package/dist/esm/components/toggle-icon-button.js +1 -1
- package/dist/esm/components/toolbar.d.ts.map +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/src/components/button.tsx +44 -4
- package/src/components/notice.css +21 -13
- package/src/components/toggle-button.tsx +2 -2
- package/src/components/toolbar.tsx +8 -7
- package/styles.css +18 -15
- package/dist/esm/chunk-3DEZMXFF.js +0 -5
- package/dist/esm/chunk-3DEZMXFF.js.map +0 -7
- package/dist/esm/chunk-VV67KTKA.js +0 -2
- package/dist/esm/chunk-YDPCJO5G.js.map +0 -7
- /package/dist/esm/{chunk-IQU6EELI.js.map → chunk-66GLO2EG.js.map} +0 -0
- /package/dist/esm/{chunk-RAVFUI7W.js.map → chunk-BJ2Q2WVV.js.map} +0 -0
- /package/dist/esm/{chunk-WXBTPEFO.js.map → chunk-DAGHSWME.js.map} +0 -0
- /package/dist/esm/{chunk-7B6CIVAF.js.map → chunk-IICXZUIB.js.map} +0 -0
- /package/dist/esm/{chunk-TZ5MZQUB.js.map → chunk-RJTWRLK4.js.map} +0 -0
- /package/dist/esm/{chunk-BOFVKXUV.js.map → chunk-YEYM7QQZ.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as p}from"./chunk-ZUOK3KFY.js";import{a as x}from"./chunk-YEYM7QQZ.js";import{a as B}from"./chunk-UCIIRQUE.js";import{a as R}from"./chunk-KJTEZVOF.js";import{a as f}from"./chunk-6FLLFCBU.js";import{a as y}from"./chunk-GSTOGDAJ.js";import*as o from"react";import T from"classnames";import{Toolbar as m}from"radix-ui";var v=o.createContext(null),S=o.createContext(null);function b(t){let r=o.useContext(v);if(!r)throw new Error(`${t} must be rendered inside a Toolbar.`);return r}var c=o.forwardRef((t,r)=>{let e=t.size??p.size.default,a=t.orientation??p.orientation.default,{className:s,orientation:n,children:i,...l}=f(t,p,y),u=o.useMemo(()=>({size:e,orientation:a}),[e,a]);return o.createElement(m.Root,{...l,ref:r,orientation:a,className:T("rt-Toolbar",s)},o.createElement(v.Provider,{value:u},i))});c.displayName="Toolbar";var C=o.forwardRef(({className:t,disabled:r=!1,children:e,...a},s)=>{let{orientation:n}=b("ToolbarGroup"),i=o.useMemo(()=>({disabled:r}),[r]);return o.createElement("div",{role:"group","data-orientation":n,"data-disabled":r||void 0,...a,ref:s,className:T("rt-ToolbarGroup",t)},o.createElement(S.Provider,{value:i},e))});C.displayName="Toolbar.Group";function D(t){return t===!0||t==="true"}var G=o.forwardRef((t,r)=>{let e=b("ToolbarButton"),a=o.useContext(S),{iconOnly:s,size:n,variant:i,emphasis:l,color:u,disabled:z,...P}=t,O=D(t["aria-pressed"]),h="data-state"in t||t["aria-pressed"]===void 0?{}:{"data-state":O?"on":"off"},d={size:n??e.size,...l!==void 0?{emphasis:l}:{variant:i??(a?"ghost":"soft")},color:u??(i||l?void 0:"gray"),...h};return o.createElement(m.Button,{asChild:!0,ref:r,disabled:z||a?.disabled||void 0},s?o.createElement(x,{...P,...d}):o.createElement(B,{...P,...d}))});G.displayName="Toolbar.Button";var N=o.forwardRef(({className:t,...r},e)=>(b("ToolbarSeparator"),o.createElement(m.Separator,{...r,ref:e,className:T("rt-ToolbarSeparator",t)})));N.displayName="Toolbar.Separator";var w={1:"2",2:"3",3:"4",4:"5"},g=o.forwardRef(({className:t,children:r,style:e,id:a},s)=>{let{size:n}=b("ToolbarTitle");return r==null||r===!1?null:o.createElement(R,{ref:s,as:"span",size:w[n],weight:"medium",truncate:!0,id:a,style:e,className:T("rt-ToolbarTitle",t)},r)});g.displayName="Toolbar.Title";var A=Object.assign(c,{Root:c,Group:C,Button:G,Separator:N,Title:g});export{c as a,C as b,G as c,N as d,g as e,A as f};
|
|
2
|
+
//# sourceMappingURL=chunk-522UYMDA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/toolbar.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Toolbar as ToolbarPrimitive } from 'radix-ui';\n\nimport { toolbarRootPropDefs } from './toolbar.props.js';\nimport { Button } from './button.js';\nimport { IconButton } from './icon-button.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { ButtonProps } from './button.js';\nimport type { TextProps } from './text.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/*\n * Toolbar takes Kookie UI v2's contract (v2: components/toolbar), built on Radix instead of\n * Base UI. A toolbar is a row of controls with ONE tab stop: `role=\"toolbar\"`, and the arrow\n * keys move focus between its controls. That keyboard is the reason it is a component.\n *\n * Its `size` reaches every control inside it that does not state its own. The row itself paints\n * nothing; a `ToolbarGroup` draws a quiet well around controls that belong together, and a\n * `ToolbarSeparator` draws a gray hairline between clusters. Use a `Flex` to cluster controls\n * without a well: the row spaces the clusters with `space-between`.\n *\n * The band anchored to a pane's edge (Left / Center / Right / Title) that this name used to\n * mean is `AppBar` since 0.11.0.\n */\n\ntype ToolbarSize = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['size']>;\ntype ToolbarOrientation = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['orientation']>;\n\ninterface ToolbarContextValue {\n size: ToolbarSize;\n orientation: ToolbarOrientation;\n}\n\nconst ToolbarContext = React.createContext<ToolbarContextValue | null>(null);\n\n/** Set by a `ToolbarGroup`: its children rest quiet, and `disabled` turns them all off. */\nconst ToolbarGroupContext = React.createContext<{ disabled: boolean } | null>(null);\n\nfunction useToolbarContext(consumer: string): ToolbarContextValue {\n const context = React.useContext(ToolbarContext);\n if (!context) {\n throw new Error(`${consumer} must be rendered inside a Toolbar.`);\n }\n return context;\n}\n\n// ============================================================================\n// Toolbar (root)\n// ============================================================================\n\ntype ToolbarOwnProps = GetPropDefTypes<typeof toolbarRootPropDefs>;\n\ninterface ToolbarProps\n extends ComponentPropsWithout<typeof ToolbarPrimitive.Root, RemovedProps | 'orientation'>,\n ToolbarOwnProps,\n MarginProps {}\n\n/**\n * A row of controls with one keyboard tab stop. The arrow keys move focus between the controls.\n *\n * Give it an `aria-label` (or `aria-labelledby`) that says what the controls act on.\n *\n * @example\n * ```tsx\n * <Toolbar aria-label=\"Formatting\">\n * <ToolbarGroup>\n * <ToolbarButton iconOnly aria-label=\"Bold\" aria-pressed={bold} onClick={toggleBold}>\n * <HugeiconsIcon icon={TextBoldIcon} strokeWidth={1.75} />\n * </ToolbarButton>\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * <ToolbarButton>Share</ToolbarButton>\n * </Toolbar>\n * ```\n */\nconst ToolbarRoot = React.forwardRef<HTMLDivElement, ToolbarProps>((props, forwardedRef) => {\n const size: ToolbarSize = props.size ?? toolbarRootPropDefs.size.default;\n const orientation: ToolbarOrientation = props.orientation ?? toolbarRootPropDefs.orientation.default;\n const { className, orientation: _orientation, children, ...rootProps } = extractProps(\n props,\n toolbarRootPropDefs,\n marginPropDefs,\n );\n\n const context = React.useMemo(() => ({ size, orientation }), [size, orientation]);\n\n return (\n <ToolbarPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n orientation={orientation}\n className={classNames('rt-Toolbar', className)}\n >\n <ToolbarContext.Provider value={context}>{children}</ToolbarContext.Provider>\n </ToolbarPrimitive.Root>\n );\n});\nToolbarRoot.displayName = 'Toolbar';\n\n// ============================================================================\n// ToolbarGroup\n// ============================================================================\n\ninterface ToolbarGroupProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** Turns every control in the group off at once. */\n disabled?: boolean;\n}\n\n/**\n * Controls that belong together, drawn as one quiet well that stands level with a button\n * beside it. Buttons inside it rest as `ghost` unless they state a `variant`.\n * To cluster controls without a well, use a `Flex`.\n */\nconst ToolbarGroup = React.forwardRef<HTMLDivElement, ToolbarGroupProps>(\n ({ className, disabled = false, children, ...props }, forwardedRef) => {\n const { orientation } = useToolbarContext('ToolbarGroup');\n const group = React.useMemo(() => ({ disabled }), [disabled]);\n return (\n <div\n role=\"group\"\n data-orientation={orientation}\n data-disabled={disabled || undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('rt-ToolbarGroup', className)}\n >\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </div>\n );\n },\n);\nToolbarGroup.displayName = 'Toolbar.Group';\n\n// ============================================================================\n// ToolbarButton\n// ============================================================================\n\ntype ToolbarButtonBaseProps = Omit<ButtonProps, 'as' | 'asChild'>;\n\n/** A labelled button: takes every `Button` prop. */\ntype ToolbarTextButtonProps = ToolbarButtonBaseProps & {\n iconOnly?: false;\n};\n\n/** An icon-only button: renders an `IconButton`, and the type requires an `aria-label`. */\ntype ToolbarIconButtonProps = Omit<ToolbarButtonBaseProps, 'aria-label' | 'aria-labelledby' | 'overrideStyles'> & {\n iconOnly: true;\n /** The control's accessible name. An icon has no words of its own, so this is required. */\n 'aria-label': string;\n};\n\ntype ToolbarButtonProps = ToolbarTextButtonProps | ToolbarIconButtonProps;\n\nfunction isPressed(value: React.AriaAttributes['aria-pressed']) {\n return value === true || value === 'true';\n}\n\n/**\n * A `Button` that joins the toolbar's keyboard navigation, so a row of them is one tab stop.\n *\n * Set `iconOnly` (with an `aria-label`) for a symbol-only control. Set `aria-pressed` for a\n * control that toggles; a pressed button wears Button's pressed look.\n *\n * It takes the toolbar's `size`, and rests as a gray `soft` button (gray `ghost` inside a\n * `ToolbarGroup`). A stated `size`, `variant` or `color` wins; a stated `variant` without a\n * `color` takes Button's own default colour. It throws outside a `Toolbar`.\n */\nconst ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButtonProps>((props, forwardedRef) => {\n const toolbar = useToolbarContext('ToolbarButton');\n const group = React.useContext(ToolbarGroupContext);\n const { iconOnly, size, variant, color, disabled, ...rest } = props;\n\n const pressed = isPressed(props['aria-pressed']);\n const stateProps =\n 'data-state' in props || props['aria-pressed'] === undefined ? {} : { 'data-state': pressed ? 'on' : 'off' };\n\n const shared = {\n size: size ?? toolbar.size,\n variant: variant ?? (group ? 'ghost' : 'soft'),\n // The gray rest is a pair with the default variant: a caller who states a variant gets\n // Button's own colour for it unless they state a colour too.\n color: color ?? (variant ? undefined : 'gray'),\n ...stateProps,\n } as const;\n\n return (\n <ToolbarPrimitive.Button asChild ref={forwardedRef} disabled={disabled || group?.disabled || undefined}>\n {iconOnly ? (\n <IconButton {...(rest as Omit<ToolbarIconButtonProps, 'iconOnly'>)} {...shared} />\n ) : (\n <Button {...(rest as Omit<ToolbarTextButtonProps, 'iconOnly'>)} {...shared} />\n )}\n </ToolbarPrimitive.Button>\n );\n});\nToolbarButton.displayName = 'Toolbar.Button';\n\n// ============================================================================\n// ToolbarSeparator\n// ============================================================================\n\ntype ToolbarSeparatorProps = ComponentPropsWithout<typeof ToolbarPrimitive.Separator, RemovedProps | 'orientation'>;\n\n/**\n * A gray hairline between two clusters, announced as a separator. Its direction is always\n * opposite to the toolbar's.\n */\nconst ToolbarSeparator = React.forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => {\n useToolbarContext('ToolbarSeparator');\n return (\n <ToolbarPrimitive.Separator\n {...props}\n ref={forwardedRef}\n className={classNames('rt-ToolbarSeparator', className)}\n />\n );\n },\n);\nToolbarSeparator.displayName = 'Toolbar.Separator';\n\n// ============================================================================\n// ToolbarTitle\n// ============================================================================\n\n/** The title's text step: one step above the label of a button at the same size. */\nconst TITLE_SIZE = { '1': '2', '2': '3', '3': '4', '4': '5' } as const satisfies Record<ToolbarSize, TextProps['size']>;\n\ninterface ToolbarTitleProps {\n /** The title text. With none, the title renders nothing. */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /** The id of the title, so that the toolbar's `aria-labelledby` can point at it. */\n id?: string;\n}\n\n/**\n * What the row is about, at its leading edge. One line: it truncates rather than wrapping.\n * Its text step follows the toolbar's `size`, and it takes more air from the controls beside it\n * than they take from each other.\n */\nconst ToolbarTitle = React.forwardRef<HTMLSpanElement, ToolbarTitleProps>(\n ({ className, children, style, id }, forwardedRef) => {\n const { size } = useToolbarContext('ToolbarTitle');\n if (children === undefined || children === null || children === false) return null;\n return (\n <Text\n ref={forwardedRef}\n as=\"span\"\n size={TITLE_SIZE[size]}\n weight=\"medium\"\n truncate\n id={id}\n style={style}\n className={classNames('rt-ToolbarTitle', className)}\n >\n {children}\n </Text>\n );\n },\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = Object.assign(ToolbarRoot, {\n Root: ToolbarRoot,\n Group: ToolbarGroup,\n Button: ToolbarButton,\n Separator: ToolbarSeparator,\n Title: ToolbarTitle,\n});\n\nexport {\n Toolbar,\n ToolbarGroup,\n ToolbarButton,\n ToolbarSeparator,\n ToolbarTitle,\n ToolbarRoot as Root,\n ToolbarGroup as Group,\n ToolbarButton as Button,\n ToolbarSeparator as Separator,\n ToolbarTitle as Title,\n};\nexport type {\n ToolbarProps,\n ToolbarGroupProps,\n ToolbarButtonProps,\n ToolbarSeparatorProps,\n ToolbarTitleProps,\n ToolbarProps as RootProps,\n ToolbarGroupProps as GroupProps,\n ToolbarButtonProps as ButtonProps,\n ToolbarSeparatorProps as SeparatorProps,\n ToolbarTitleProps as TitleProps,\n};\n"],
|
|
5
|
-
"mappings": "gPAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,WAAWC,MAAwB,WAqC5C,IAAMC,EAAuB,gBAA0C,IAAI,EAGrEC,EAA4B,gBAA4C,IAAI,EAElF,SAASC,EAAkBC,EAAuC,CAChE,IAAMC,EAAgB,aAAWJ,CAAc,EAC/C,GAAI,CAACI,EACH,MAAM,IAAI,MAAM,GAAGD,CAAQ,qCAAqC,EAElE,OAAOC,CACT,CA+BA,IAAMC,EAAoB,aAAyC,CAACC,EAAOC,IAAiB,CAC1F,IAAMC,EAAoBF,EAAM,MAAQG,EAAoB,KAAK,QAC3DC,EAAkCJ,EAAM,aAAeG,EAAoB,YAAY,QACvF,CAAE,UAAAE,EAAW,YAAaC,EAAc,SAAAC,EAAU,GAAGC,CAAU,EAAIC,EACvET,EACAG,EACAO,CACF,EAEMZ,EAAgB,UAAQ,KAAO,CAAE,KAAAI,EAAM,YAAAE,CAAY,GAAI,CAACF,EAAME,CAAW,CAAC,EAEhF,OACE,gBAACO,EAAiB,KAAjB,CACE,GAAGH,EACJ,IAAKP,EACL,YAAaG,EACb,UAAWQ,EAAW,aAAcP,CAAS,GAE7C,gBAACX,EAAe,SAAf,CAAwB,MAAOI,GAAUS,CAAS,CACrD,CAEJ,CAAC,EACDR,EAAY,YAAc,UAgB1B,IAAMc,EAAqB,aACzB,CAAC,CAAE,UAAAR,EAAW,SAAAS,EAAW,GAAO,SAAAP,EAAU,GAAGP,CAAM,EAAGC,IAAiB,CACrE,GAAM,CAAE,YAAAG,CAAY,EAAIR,EAAkB,cAAc,EAClDmB,EAAc,UAAQ,KAAO,CAAE,SAAAD,CAAS,GAAI,CAACA,CAAQ,CAAC,EAC5D,OACE,gBAAC,OACC,KAAK,QACL,mBAAkBV,EAClB,gBAAeU,GAAY,OAC1B,GAAGd,EACJ,IAAKC,EACL,UAAWW,EAAW,kBAAmBP,CAAS,GAElD,gBAACV,EAAoB,SAApB,CAA6B,MAAOoB,GAAQR,CAAS,CACxD,CAEJ,CACF,EACAM,EAAa,YAAc,gBAsB3B,SAASG,EAAUC,EAA6C,CAC9D,OAAOA,IAAU,IAAQA,IAAU,MACrC,CAYA,IAAMC,EAAsB,aAAkD,CAAClB,EAAOC,IAAiB,CACrG,IAAMkB,EAAUvB,EAAkB,eAAe,EAC3CmB,EAAc,aAAWpB,CAAmB,EAC5C,CAAE,SAAAyB,EAAU,KAAAlB,EAAM,QAAAmB,EAAS,MAAAC,EAAO,
|
|
6
|
-
"names": ["React", "classNames", "ToolbarPrimitive", "ToolbarContext", "ToolbarGroupContext", "useToolbarContext", "consumer", "context", "ToolbarRoot", "props", "forwardedRef", "size", "toolbarRootPropDefs", "orientation", "className", "_orientation", "children", "rootProps", "extractProps", "marginPropDefs", "ToolbarPrimitive", "classNames", "ToolbarGroup", "disabled", "group", "isPressed", "value", "ToolbarButton", "toolbar", "iconOnly", "variant", "color", "rest", "pressed", "stateProps", "shared", "IconButton", "Button", "ToolbarSeparator", "TITLE_SIZE", "ToolbarTitle", "style", "id", "Text", "Toolbar"]
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Toolbar as ToolbarPrimitive } from 'radix-ui';\n\nimport { toolbarRootPropDefs } from './toolbar.props.js';\nimport { Button } from './button.js';\nimport { IconButton } from './icon-button.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { ButtonProps } from './button.js';\nimport type { TextProps } from './text.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/*\n * Toolbar takes Kookie UI v2's contract (v2: components/toolbar), built on Radix instead of\n * Base UI. A toolbar is a row of controls with ONE tab stop: `role=\"toolbar\"`, and the arrow\n * keys move focus between its controls. That keyboard is the reason it is a component.\n *\n * Its `size` reaches every control inside it that does not state its own. The row itself paints\n * nothing; a `ToolbarGroup` draws a quiet well around controls that belong together, and a\n * `ToolbarSeparator` draws a gray hairline between clusters. Use a `Flex` to cluster controls\n * without a well: the row spaces the clusters with `space-between`.\n *\n * The band anchored to a pane's edge (Left / Center / Right / Title) that this name used to\n * mean is `AppBar` since 0.11.0.\n */\n\ntype ToolbarSize = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['size']>;\ntype ToolbarOrientation = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['orientation']>;\n\ninterface ToolbarContextValue {\n size: ToolbarSize;\n orientation: ToolbarOrientation;\n}\n\nconst ToolbarContext = React.createContext<ToolbarContextValue | null>(null);\n\n/** Set by a `ToolbarGroup`: its children rest quiet, and `disabled` turns them all off. */\nconst ToolbarGroupContext = React.createContext<{ disabled: boolean } | null>(null);\n\nfunction useToolbarContext(consumer: string): ToolbarContextValue {\n const context = React.useContext(ToolbarContext);\n if (!context) {\n throw new Error(`${consumer} must be rendered inside a Toolbar.`);\n }\n return context;\n}\n\n// ============================================================================\n// Toolbar (root)\n// ============================================================================\n\ntype ToolbarOwnProps = GetPropDefTypes<typeof toolbarRootPropDefs>;\n\ninterface ToolbarProps\n extends ComponentPropsWithout<typeof ToolbarPrimitive.Root, RemovedProps | 'orientation'>,\n ToolbarOwnProps,\n MarginProps {}\n\n/**\n * A row of controls with one keyboard tab stop. The arrow keys move focus between the controls.\n *\n * Give it an `aria-label` (or `aria-labelledby`) that says what the controls act on.\n *\n * @example\n * ```tsx\n * <Toolbar aria-label=\"Formatting\">\n * <ToolbarGroup>\n * <ToolbarButton iconOnly aria-label=\"Bold\" aria-pressed={bold} onClick={toggleBold}>\n * <HugeiconsIcon icon={TextBoldIcon} strokeWidth={1.75} />\n * </ToolbarButton>\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * <ToolbarButton>Share</ToolbarButton>\n * </Toolbar>\n * ```\n */\nconst ToolbarRoot = React.forwardRef<HTMLDivElement, ToolbarProps>((props, forwardedRef) => {\n const size: ToolbarSize = props.size ?? toolbarRootPropDefs.size.default;\n const orientation: ToolbarOrientation = props.orientation ?? toolbarRootPropDefs.orientation.default;\n const { className, orientation: _orientation, children, ...rootProps } = extractProps(\n props,\n toolbarRootPropDefs,\n marginPropDefs,\n );\n\n const context = React.useMemo(() => ({ size, orientation }), [size, orientation]);\n\n return (\n <ToolbarPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n orientation={orientation}\n className={classNames('rt-Toolbar', className)}\n >\n <ToolbarContext.Provider value={context}>{children}</ToolbarContext.Provider>\n </ToolbarPrimitive.Root>\n );\n});\nToolbarRoot.displayName = 'Toolbar';\n\n// ============================================================================\n// ToolbarGroup\n// ============================================================================\n\ninterface ToolbarGroupProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** Turns every control in the group off at once. */\n disabled?: boolean;\n}\n\n/**\n * Controls that belong together, drawn as one quiet well that stands level with a button\n * beside it. Buttons inside it rest as `ghost` unless they state a `variant`.\n * To cluster controls without a well, use a `Flex`.\n */\nconst ToolbarGroup = React.forwardRef<HTMLDivElement, ToolbarGroupProps>(\n ({ className, disabled = false, children, ...props }, forwardedRef) => {\n const { orientation } = useToolbarContext('ToolbarGroup');\n const group = React.useMemo(() => ({ disabled }), [disabled]);\n return (\n <div\n role=\"group\"\n data-orientation={orientation}\n data-disabled={disabled || undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('rt-ToolbarGroup', className)}\n >\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </div>\n );\n },\n);\nToolbarGroup.displayName = 'Toolbar.Group';\n\n// ============================================================================\n// ToolbarButton\n// ============================================================================\n\ntype ToolbarButtonBaseProps = Omit<ButtonProps, 'as' | 'asChild'>;\n\n/** A labelled button: takes every `Button` prop. */\ntype ToolbarTextButtonProps = ToolbarButtonBaseProps & {\n iconOnly?: false;\n};\n\n/** An icon-only button: renders an `IconButton`, and the type requires an `aria-label`. */\ntype ToolbarIconButtonProps = Omit<ToolbarButtonBaseProps, 'aria-label' | 'aria-labelledby' | 'overrideStyles'> & {\n iconOnly: true;\n /** The control's accessible name. An icon has no words of its own, so this is required. */\n 'aria-label': string;\n};\n\ntype ToolbarButtonProps = ToolbarTextButtonProps | ToolbarIconButtonProps;\n\nfunction isPressed(value: React.AriaAttributes['aria-pressed']) {\n return value === true || value === 'true';\n}\n\n/**\n * A `Button` that joins the toolbar's keyboard navigation, so a row of them is one tab stop.\n *\n * Set `iconOnly` (with an `aria-label`) for a symbol-only control. Set `aria-pressed` for a\n * control that toggles; a pressed button wears Button's pressed look.\n *\n * It takes the toolbar's `size`, and rests as a gray `soft` button (gray `ghost` inside a\n * `ToolbarGroup`). A stated `size`, `variant` or `color` wins; a stated `variant` without a\n * `color` takes Button's own default colour. It throws outside a `Toolbar`.\n */\nconst ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButtonProps>((props, forwardedRef) => {\n const toolbar = useToolbarContext('ToolbarButton');\n const group = React.useContext(ToolbarGroupContext);\n const { iconOnly, size, variant, emphasis, color, disabled, ...rest } = props;\n\n const pressed = isPressed(props['aria-pressed']);\n const stateProps =\n 'data-state' in props || props['aria-pressed'] === undefined ? {} : { 'data-state': pressed ? 'on' : 'off' };\n\n const shared = {\n size: size ?? toolbar.size,\n // A caller states the look by `variant` or the rank by `emphasis`, never both.\n ...(emphasis !== undefined ? { emphasis } : { variant: variant ?? (group ? 'ghost' : 'soft') }),\n // The gray rest is a pair with the default variant: a caller who states a variant or an\n // emphasis gets Button's own colour for it unless they state a colour too.\n color: color ?? (variant || emphasis ? undefined : 'gray'),\n ...stateProps,\n } as const;\n\n return (\n <ToolbarPrimitive.Button asChild ref={forwardedRef} disabled={disabled || group?.disabled || undefined}>\n {iconOnly ? (\n <IconButton {...(rest as Omit<ToolbarIconButtonProps, 'iconOnly' | 'variant' | 'emphasis'>)} {...shared} />\n ) : (\n <Button {...(rest as Omit<ToolbarTextButtonProps, 'iconOnly' | 'variant' | 'emphasis'>)} {...shared} />\n )}\n </ToolbarPrimitive.Button>\n );\n});\nToolbarButton.displayName = 'Toolbar.Button';\n\n// ============================================================================\n// ToolbarSeparator\n// ============================================================================\n\ntype ToolbarSeparatorProps = ComponentPropsWithout<typeof ToolbarPrimitive.Separator, RemovedProps | 'orientation'>;\n\n/**\n * A gray hairline between two clusters, announced as a separator. Its direction is always\n * opposite to the toolbar's.\n */\nconst ToolbarSeparator = React.forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => {\n useToolbarContext('ToolbarSeparator');\n return (\n <ToolbarPrimitive.Separator\n {...props}\n ref={forwardedRef}\n className={classNames('rt-ToolbarSeparator', className)}\n />\n );\n },\n);\nToolbarSeparator.displayName = 'Toolbar.Separator';\n\n// ============================================================================\n// ToolbarTitle\n// ============================================================================\n\n/** The title's text step: one step above the label of a button at the same size. */\nconst TITLE_SIZE = { '1': '2', '2': '3', '3': '4', '4': '5' } as const satisfies Record<ToolbarSize, TextProps['size']>;\n\ninterface ToolbarTitleProps {\n /** The title text. With none, the title renders nothing. */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /** The id of the title, so that the toolbar's `aria-labelledby` can point at it. */\n id?: string;\n}\n\n/**\n * What the row is about, at its leading edge. One line: it truncates rather than wrapping.\n * Its text step follows the toolbar's `size`, and it takes more air from the controls beside it\n * than they take from each other.\n */\nconst ToolbarTitle = React.forwardRef<HTMLSpanElement, ToolbarTitleProps>(\n ({ className, children, style, id }, forwardedRef) => {\n const { size } = useToolbarContext('ToolbarTitle');\n if (children === undefined || children === null || children === false) return null;\n return (\n <Text\n ref={forwardedRef}\n as=\"span\"\n size={TITLE_SIZE[size]}\n weight=\"medium\"\n truncate\n id={id}\n style={style}\n className={classNames('rt-ToolbarTitle', className)}\n >\n {children}\n </Text>\n );\n },\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = Object.assign(ToolbarRoot, {\n Root: ToolbarRoot,\n Group: ToolbarGroup,\n Button: ToolbarButton,\n Separator: ToolbarSeparator,\n Title: ToolbarTitle,\n});\n\nexport {\n Toolbar,\n ToolbarGroup,\n ToolbarButton,\n ToolbarSeparator,\n ToolbarTitle,\n ToolbarRoot as Root,\n ToolbarGroup as Group,\n ToolbarButton as Button,\n ToolbarSeparator as Separator,\n ToolbarTitle as Title,\n};\nexport type {\n ToolbarProps,\n ToolbarGroupProps,\n ToolbarButtonProps,\n ToolbarSeparatorProps,\n ToolbarTitleProps,\n ToolbarProps as RootProps,\n ToolbarGroupProps as GroupProps,\n ToolbarButtonProps as ButtonProps,\n ToolbarSeparatorProps as SeparatorProps,\n ToolbarTitleProps as TitleProps,\n};\n"],
|
|
5
|
+
"mappings": "gPAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,WAAWC,MAAwB,WAqC5C,IAAMC,EAAuB,gBAA0C,IAAI,EAGrEC,EAA4B,gBAA4C,IAAI,EAElF,SAASC,EAAkBC,EAAuC,CAChE,IAAMC,EAAgB,aAAWJ,CAAc,EAC/C,GAAI,CAACI,EACH,MAAM,IAAI,MAAM,GAAGD,CAAQ,qCAAqC,EAElE,OAAOC,CACT,CA+BA,IAAMC,EAAoB,aAAyC,CAACC,EAAOC,IAAiB,CAC1F,IAAMC,EAAoBF,EAAM,MAAQG,EAAoB,KAAK,QAC3DC,EAAkCJ,EAAM,aAAeG,EAAoB,YAAY,QACvF,CAAE,UAAAE,EAAW,YAAaC,EAAc,SAAAC,EAAU,GAAGC,CAAU,EAAIC,EACvET,EACAG,EACAO,CACF,EAEMZ,EAAgB,UAAQ,KAAO,CAAE,KAAAI,EAAM,YAAAE,CAAY,GAAI,CAACF,EAAME,CAAW,CAAC,EAEhF,OACE,gBAACO,EAAiB,KAAjB,CACE,GAAGH,EACJ,IAAKP,EACL,YAAaG,EACb,UAAWQ,EAAW,aAAcP,CAAS,GAE7C,gBAACX,EAAe,SAAf,CAAwB,MAAOI,GAAUS,CAAS,CACrD,CAEJ,CAAC,EACDR,EAAY,YAAc,UAgB1B,IAAMc,EAAqB,aACzB,CAAC,CAAE,UAAAR,EAAW,SAAAS,EAAW,GAAO,SAAAP,EAAU,GAAGP,CAAM,EAAGC,IAAiB,CACrE,GAAM,CAAE,YAAAG,CAAY,EAAIR,EAAkB,cAAc,EAClDmB,EAAc,UAAQ,KAAO,CAAE,SAAAD,CAAS,GAAI,CAACA,CAAQ,CAAC,EAC5D,OACE,gBAAC,OACC,KAAK,QACL,mBAAkBV,EAClB,gBAAeU,GAAY,OAC1B,GAAGd,EACJ,IAAKC,EACL,UAAWW,EAAW,kBAAmBP,CAAS,GAElD,gBAACV,EAAoB,SAApB,CAA6B,MAAOoB,GAAQR,CAAS,CACxD,CAEJ,CACF,EACAM,EAAa,YAAc,gBAsB3B,SAASG,EAAUC,EAA6C,CAC9D,OAAOA,IAAU,IAAQA,IAAU,MACrC,CAYA,IAAMC,EAAsB,aAAkD,CAAClB,EAAOC,IAAiB,CACrG,IAAMkB,EAAUvB,EAAkB,eAAe,EAC3CmB,EAAc,aAAWpB,CAAmB,EAC5C,CAAE,SAAAyB,EAAU,KAAAlB,EAAM,QAAAmB,EAAS,SAAAC,EAAU,MAAAC,EAAO,SAAAT,EAAU,GAAGU,CAAK,EAAIxB,EAElEyB,EAAUT,EAAUhB,EAAM,cAAc,CAAC,EACzC0B,EACJ,eAAgB1B,GAASA,EAAM,cAAc,IAAM,OAAY,CAAC,EAAI,CAAE,aAAcyB,EAAU,KAAO,KAAM,EAEvGE,EAAS,CACb,KAAMzB,GAAQiB,EAAQ,KAEtB,GAAIG,IAAa,OAAY,CAAE,SAAAA,CAAS,EAAI,CAAE,QAASD,IAAYN,EAAQ,QAAU,OAAQ,EAG7F,MAAOQ,IAAUF,GAAWC,EAAW,OAAY,QACnD,GAAGI,CACL,EAEA,OACE,gBAACf,EAAiB,OAAjB,CAAwB,QAAO,GAAC,IAAKV,EAAc,SAAUa,GAAYC,GAAO,UAAY,QAC1FK,EACC,gBAACQ,EAAA,CAAY,GAAIJ,EAA6E,GAAGG,EAAQ,EAEzG,gBAACE,EAAA,CAAQ,GAAIL,EAA6E,GAAGG,EAAQ,CAEzG,CAEJ,CAAC,EACDT,EAAc,YAAc,iBAY5B,IAAMY,EAAyB,aAC7B,CAAC,CAAE,UAAAzB,EAAW,GAAGL,CAAM,EAAGC,KACxBL,EAAkB,kBAAkB,EAElC,gBAACe,EAAiB,UAAjB,CACE,GAAGX,EACJ,IAAKC,EACL,UAAWW,EAAW,sBAAuBP,CAAS,EACxD,EAGN,EACAyB,EAAiB,YAAc,oBAO/B,IAAMC,EAAa,CAAE,EAAK,IAAK,EAAK,IAAK,EAAK,IAAK,EAAK,GAAI,EAgBtDC,EAAqB,aACzB,CAAC,CAAE,UAAA3B,EAAW,SAAAE,EAAU,MAAA0B,EAAO,GAAAC,CAAG,EAAGjC,IAAiB,CACpD,GAAM,CAAE,KAAAC,CAAK,EAAIN,EAAkB,cAAc,EACjD,OAA8BW,GAAa,MAAQA,IAAa,GAAc,KAE5E,gBAAC4B,EAAA,CACC,IAAKlC,EACL,GAAG,OACH,KAAM8B,EAAW7B,CAAI,EACrB,OAAO,SACP,SAAQ,GACR,GAAIgC,EACJ,MAAOD,EACP,UAAWrB,EAAW,kBAAmBP,CAAS,GAEjDE,CACH,CAEJ,CACF,EACAyB,EAAa,YAAc,gBAM3B,IAAMI,EAAU,OAAO,OAAOrC,EAAa,CACzC,KAAMA,EACN,MAAOc,EACP,OAAQK,EACR,UAAWY,EACX,MAAOE,CACT,CAAC",
|
|
6
|
+
"names": ["React", "classNames", "ToolbarPrimitive", "ToolbarContext", "ToolbarGroupContext", "useToolbarContext", "consumer", "context", "ToolbarRoot", "props", "forwardedRef", "size", "toolbarRootPropDefs", "orientation", "className", "_orientation", "children", "rootProps", "extractProps", "marginPropDefs", "ToolbarPrimitive", "classNames", "ToolbarGroup", "disabled", "group", "isPressed", "value", "ToolbarButton", "toolbar", "iconOnly", "variant", "emphasis", "color", "rest", "pressed", "stateProps", "shared", "IconButton", "Button", "ToolbarSeparator", "TITLE_SIZE", "ToolbarTitle", "style", "id", "Text", "Toolbar"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-IBF5U4QW.js";import{a as X,b as q,c as J}from"./chunk-3TIO3EMN.js";import{a as U}from"./chunk-
|
|
1
|
+
import{a as Q}from"./chunk-IBF5U4QW.js";import{a as X,b as q,c as J}from"./chunk-3TIO3EMN.js";import{a as U}from"./chunk-YEYM7QQZ.js";import{a as w}from"./chunk-C7UXUTUF.js";import{a as T}from"./chunk-EUSMN3K7.js";import{a as W}from"./chunk-UCIIRQUE.js";import{a as R}from"./chunk-HIBX2EXV.js";import{a as j}from"./chunk-ERNM3KVF.js";import{a as F}from"./chunk-HFVD7W6R.js";import{a as v}from"./chunk-KJTEZVOF.js";import{b as V,c as x}from"./chunk-FISGGGPC.js";import{a as O}from"./chunk-F22ZRNWL.js";import{a as s}from"./chunk-7YIQV7VO.js";import{a as D}from"./chunk-GONBMSRL.js";import{a as i}from"./chunk-PXUQEA77.js";import{a as G}from"./chunk-IPHKKZYE.js";import*as e from"react";import{useCallbackRef as ie}from"radix-ui/internal";import{flushSync as re}from"react-dom";var Y=`
|
|
2
2
|
[contenteditable],
|
|
3
3
|
[role="combobox"],
|
|
4
4
|
[role="listbox"],
|
|
@@ -7,4 +7,4 @@ import{a as Q}from"./chunk-IBF5U4QW.js";import{a as X,b as q,c as J}from"./chunk
|
|
|
7
7
|
select,
|
|
8
8
|
textarea
|
|
9
9
|
`,se=e.forwardRef(({defaultOpen:n=!0,...o},r)=>{let[u,d]=e.useState(n),h=e.useRef(null),l=e.useRef(null);return e.useEffect(()=>{function C(c){let k=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey,g=document.activeElement?.closest(Y);if(c.key?.toUpperCase()==="T"&&!k&&!g){let f=!1;re(()=>{d(H=>(f=!H,f))}),f?(l.current=document.activeElement,h.current?.focus()):l.current?.focus()}}return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[]),e.createElement(_,{...o,ref:r,triggerRef:h,open:u,shortcut:e.createElement(R,{content:"Press T to show/hide the Theme Panel",side:"bottom",sideOffset:6},e.createElement(G,{asChild:!0,size:"3",tabIndex:0,className:"rt-ThemePanelShortcut"},e.createElement("button",{type:"button",onClick:()=>d(C=>!C),ref:h,"aria-label":"Toggle the Theme Panel"},"T")))})});se.displayName="ThemePanel";var _=e.forwardRef((n,o)=>{let{open:r,onAppearanceChange:u,shortcut:d,triggerRef:h,...l}=n,C=V();return e.createElement(x,{asChild:!0,radius:"medium",scaling:"100%"},e.createElement(i,{direction:"column",position:"fixed",top:"0",right:"0",mr:{initial:"2",sm:"4"},mt:{initial:"2",sm:"4"},width:{initial:"360px"},maxHeight:{initial:"calc(100svh - var(--space-2) - var(--space-2))",sm:"calc(100svh - var(--space-4) - var(--space-4))"},maxWidth:{initial:"calc(100svw - var(--space-2) - var(--space-2))",sm:"calc(100svw - var(--space-4) - var(--space-4))"},inert:r?void 0:Q,...l,ref:o,style:{zIndex:999999999,overflow:"hidden",borderRadius:"var(--radius-4)",backgroundColor:"var(--color-panel-solid)",transformOrigin:"top center",transitionProperty:"transform, box-shadow",transitionDuration:"200ms",transitionTimingFunction:r?"ease-out":"ease-in",transform:r?"none":"translateX(105%)",boxShadow:r?"var(--shadow-5)":"var(--shadow-2)",...n.style}},e.createElement(D,null,e.createElement(T,{flexGrow:"1",p:{initial:"4",xs:"5"},position:"relative"},!!d&&e.createElement(T,{position:"absolute",top:"0",right:"0",m:"2"},d),e.createElement(ee,{onAppearanceChange:u,context:C})))))});_.displayName="ThemePanelImpl";var ee=e.forwardRef((n,o)=>{let{onAppearanceChange:r,context:u,...d}=n,h=V(),{appearance:l,onAppearanceChange:C,accentColor:c,onAccentColorChange:k,grayColor:g,onGrayColorChange:K,panelBackground:f,onPanelBackgroundChange:H,radius:M,onRadiusChange:te,scaling:Z,onScalingChange:ae}=u??h,[E,S]=e.useState(l==="inherit"?null:l),N=r!==void 0,$=ie(r),A=e.useCallback(t=>{let a=ce();if(l!=="inherit"){C(t);return}N?$(t):(S(t),de(t)),a()},[l,C,N,$]),I=O(c),z=g==="auto"?I:g,[ne,B]=e.useState("idle");async function oe(){let t={appearance:l===s.appearance.default?void 0:l,accentColor:c===s.accentColor.default?void 0:c,grayColor:g===s.grayColor.default?void 0:g,panelBackground:f===s.panelBackground.default?void 0:f,radius:M===s.radius.default?void 0:M,scaling:Z===s.scaling.default?void 0:Z},a=Object.keys(t).filter(p=>t[p]!==void 0).map(p=>`${p}="${t[p]}"`).join(" "),y=a?`<Theme ${a}>`:"<Theme>";B("copying"),await navigator.clipboard.writeText(y),B("copied"),setTimeout(()=>B("idle"),2e3)}return e.useEffect(()=>{function t(a){let y=a.altKey||a.ctrlKey||a.shiftKey||a.metaKey,p=document.activeElement?.closest(Y);a.key?.toUpperCase()==="D"&&!y&&!p&&A(E==="light"?"dark":"light")}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[A,E]),e.useEffect(()=>{let t=document.documentElement,a=document.body;function y(){let L=t.classList.contains("dark")||t.classList.contains("dark-theme")||a.classList.contains("dark")||a.classList.contains("dark-theme");S(l==="inherit"?L?"dark":"light":l)}let p=new MutationObserver(function(L){L.forEach(function(le){le.attributeName==="class"&&y()})});return y(),l==="inherit"&&(p.observe(t,{attributes:!0}),p.observe(a,{attributes:!0})),()=>p.disconnect()},[l]),e.createElement(i,{direction:"column",gap:"5",...d,ref:o},e.createElement(F,{size:{initial:"3",sm:"5"},trim:"both",as:"h2"},"Theme"),e.createElement(i,{direction:"column",gap:"5"},e.createElement(P,null,e.createElement(b,{id:"accent-color-title"},"Accent color"),e.createElement(i,{wrap:"wrap",gap:"2",role:"group","aria-labelledby":"accent-color-title"},s.accentColor.values.map(t=>e.createElement(T,{asChild:!0,key:t},e.createElement("label",{className:"rt-ThemePanelSwatch","aria-label":m(t),style:{backgroundColor:`var(--${t}-9)`}},e.createElement(R,{content:`${m(t)}${c==="gray"&&z!=="gray"?` (${m(z)})`:""}`},e.createElement("input",{className:"rt-ThemePanelSwatchInput",type:"radio",name:"accentColor",value:t,checked:c===t,onChange:a=>k(a.target.value)}))))))),e.createElement(P,null,e.createElement(b,{id:"gray-color-title"},"Gray color"),e.createElement(i,{wrap:"wrap",gap:"2",role:"group","aria-labelledby":"gray-color-title"},s.grayColor.values.map(t=>e.createElement(i,{key:t,asChild:!0,align:"center",justify:"center"},e.createElement("label",{className:"rt-ThemePanelSwatch","aria-label":m(t),style:{backgroundColor:t==="auto"?`var(--${I}-9)`:t==="gray"?"var(--gray-9)":`var(--${t}-9)`,filter:t==="gray"?"saturate(0)":void 0}},e.createElement(R,{content:`${m(t)}${t==="auto"?` (${m(I)})`:""}`},e.createElement("input",{className:"rt-ThemePanelSwatchInput",type:"radio",name:"grayColor",value:t,checked:g===t,onChange:a=>K(a.target.value)}))))))),e.createElement(P,null,e.createElement(b,{id:"appearance-title"},"Appearance"),e.createElement(w,{columns:"2",gap:"2",role:"group","aria-labelledby":"appearance-title"},["light","dark"].map(t=>e.createElement("label",{key:t,className:"rt-ThemePanelRadioCard"},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"appearance",value:t,checked:E===t,onChange:a=>A(a.target.value)}),e.createElement(i,{align:"center",justify:"center",height:"32px",gap:"2"},t==="light"?e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -1px"}},e.createElement("path",{d:"M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})):e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -1px"}},e.createElement("path",{d:"M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),e.createElement(v,{size:"1",weight:"medium"},m(t))))))),e.createElement(P,null,e.createElement(b,{id:"radius-title"},"Radius"),e.createElement(i,{gap:"2",role:"group","aria-labelledby":"radius-title",wrap:"wrap"},s.radius.values.map(t=>e.createElement(i,{key:t,direction:"column",align:"center"},e.createElement("label",{className:"rt-ThemePanelRadioCard"},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"radius",id:`theme-panel-radius-${t}`,value:t,checked:M===t,onChange:a=>te(a.target.value)}),e.createElement(x,{asChild:!0,radius:t},e.createElement(T,{m:"3",width:{initial:"24px",sm:"32px"},height:{initial:"24px",sm:"32px"},style:{borderTopLeftRadius:t==="full"?"80%":"var(--radius-5)",backgroundImage:"linear-gradient(to bottom right, var(--accent-3), var(--accent-4))",borderTop:"2px solid var(--accent-a8)",borderLeft:"2px solid var(--accent-a8)"}}))),e.createElement(T,{asChild:!0,pt:"2"},e.createElement(v,{asChild:!0,size:"1",emphasis:"medium"},e.createElement("label",{htmlFor:`theme-panel-radius-${t}`},m(t)))))))),e.createElement(P,null,e.createElement(b,{id:"scaling-title"},"Scaling"),e.createElement(w,{columns:{initial:"repeat(3, 1fr)",sm:"5"},gap:"2",role:"group","aria-labelledby":"scaling-title"},s.scaling.values.map(t=>e.createElement("label",{key:t,className:"rt-ThemePanelRadioCard","aria-label":`Scaling ${t}`},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"scaling",value:t,checked:Z===t,onChange:a=>ae(a.target.value)}),e.createElement(i,{align:"center",justify:"center",height:"32px"},e.createElement(x,{asChild:!0,scaling:t},e.createElement(i,{align:"center",justify:"center"},e.createElement(v,{size:"1",weight:"medium"},m(t))))))))),e.createElement(P,null,e.createElement(i,{align:"center",gap:"2"},e.createElement(b,{id:"panel-background-title"},"Panel background"),e.createElement(X,null,e.createElement(q,null,e.createElement(U,{size:"1",variant:"ghost",color:"gray"},e.createElement(j,{label:"Learn more about panel background options"},e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fillRule:"evenodd",clipRule:"evenodd"}))))),e.createElement(J,{size:"1",width:"220px",maxWidth:"90svw",minWidth:"0",side:"top",align:"center"},e.createElement(v,{as:"p",size:"1"},"Whether Card and Table panels are translucent, showing some of the background behind them.")))),e.createElement(w,{columns:{initial:"1",sm:"2"},rows:{initial:"2",sm:"1"},gap:"2",role:"group","aria-labelledby":"panel-background-title"},s.panelBackground.values.map(t=>e.createElement("label",{key:t,className:"rt-ThemePanelRadioCard"},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"panelBackground",value:t,checked:f===t,onChange:a=>H(a.target.value)}),e.createElement(i,{align:"center",justify:"center",height:"32px",gap:"2"},t==="solid"?e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -2px"}},e.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})):e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -2px"}},e.createElement("path",{opacity:".05",d:"M6.78296 13.376C8.73904 9.95284 8.73904 5.04719 6.78296 1.62405L7.21708 1.37598C9.261 4.95283 9.261 10.0472 7.21708 13.624L6.78296 13.376Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".1",d:"M7.28204 13.4775C9.23929 9.99523 9.23929 5.00475 7.28204 1.52248L7.71791 1.2775C9.76067 4.9119 9.76067 10.0881 7.71791 13.7225L7.28204 13.4775Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".15",d:"M7.82098 13.5064C9.72502 9.99523 9.72636 5.01411 7.82492 1.50084L8.26465 1.26285C10.2465 4.92466 10.2451 10.085 8.26052 13.7448L7.82098 13.5064Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".2",d:"M8.41284 13.429C10.1952 9.92842 10.1957 5.07537 8.41435 1.57402L8.85999 1.34729C10.7139 4.99113 10.7133 10.0128 8.85841 13.6559L8.41284 13.429Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".25",d:"M9.02441 13.2956C10.6567 9.8379 10.6586 5.17715 9.03005 1.71656L9.48245 1.50366C11.1745 5.09919 11.1726 9.91629 9.47657 13.5091L9.02441 13.2956Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".3",d:"M9.66809 13.0655C11.1097 9.69572 11.1107 5.3121 9.67088 1.94095L10.1307 1.74457C11.6241 5.24121 11.6231 9.76683 10.1278 13.2622L9.66809 13.0655Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".35",d:"M10.331 12.7456C11.5551 9.52073 11.5564 5.49103 10.3347 2.26444L10.8024 2.0874C12.0672 5.42815 12.0659 9.58394 10.7985 12.9231L10.331 12.7456Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".4",d:"M11.0155 12.2986C11.9938 9.29744 11.9948 5.71296 11.0184 2.71067L11.4939 2.55603C12.503 5.6589 12.502 9.35178 11.4909 12.4535L11.0155 12.2986Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".45",d:"M11.7214 11.668C12.4254 9.01303 12.4262 5.99691 11.7237 3.34116L12.2071 3.21329C12.9318 5.95292 12.931 9.05728 12.2047 11.7961L11.7214 11.668Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".5",d:"M12.4432 10.752C12.8524 8.63762 12.8523 6.36089 12.4429 4.2466L12.9338 4.15155C13.3553 6.32861 13.3554 8.66985 12.9341 10.847L12.4432 10.752Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),e.createElement(v,{size:"1",weight:"medium"},m(t)))))))),e.createElement(W,{style:{width:"100%"},onClick:oe},ne==="copied"?"Copied":"Copy Theme"))});ee.displayName="ThemePanelContent";function P(n){return e.createElement(i,{direction:"column",gap:"3",asChild:!0,...n},e.createElement("section",null,n.children))}function b(n){return e.createElement(F,{as:"h3",size:{initial:"1",sm:"2"},...n})}function ce(){let n=document.createElement("style");return n.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(n),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(n)},1)}}function m(n){return n.charAt(0).toUpperCase()+n.slice(1)}function de(n){let o=document.documentElement,r=o.classList.contains("light-theme"),u=o.classList.contains("dark-theme"),d=o.classList.contains("light"),h=o.classList.contains("dark");(r||u)&&(o.classList.remove("light-theme","dark-theme"),o.style.colorScheme=n,o.classList.add(`${n}-theme`)),(d||h)&&(o.classList.remove("light","dark"),o.style.colorScheme=n,o.classList.add(n)),!r&&!u&&!d&&!h&&(o.style.colorScheme=n,o.classList.add(n))}export{se as a,ee as b};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-66GLO2EG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R}from"./chunk-YEYM7QQZ.js";import{a as m}from"./chunk-UCIIRQUE.js";import{a as N}from"./chunk-KJTEZVOF.js";import*as t from"react";import C from"classnames";var u=t.createContext(void 0),f=t.forwardRef(({kind:c,size:e="2",color:o="gray",material:s,className:i,children:l,trailing:a,leading:n,...r},d)=>t.createElement("div",{role:"status","aria-live":"polite",...r,ref:d,className:C("rt-NoticeRoot",`rt-r-size-${e}`,i),"data-kind":c,"data-accent-color":o,"data-material":s},n?t.createElement("span",{className:"rt-NoticeIcon","aria-hidden":!0},n):null,t.createElement(N,{as:"div",size:e,className:"rt-NoticeText"},l),a));f.displayName="Strip";var g=t.forwardRef(({icon:c,action:e,onDismiss:o,dismissLabel:s="Dismiss",size:i,...l},a)=>{let n=t.useContext(u),r=i??n??"2";return t.createElement(f,{...l,size:r,ref:a,kind:"notice",leading:c,trailing:e||o?t.createElement("span",{className:"rt-NoticeActions"},e,o?t.createElement(R,{size:r,variant:"ghost",color:"gray","aria-label":s,className:"rt-NoticeDismiss",onClick:o},t.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0},t.createElement("path",{d:"M4 4l7 7M11 4l-7 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))):null):null})});g.displayName="Notice";var v=t.forwardRef(({confirmLabel:c,cancelLabel:e="Not now",onConfirm:o,onCancel:s,busy:i=!1,size:l,color:a="gray",...n},r)=>{let d=t.useContext(u),p=l??d??"2";return t.createElement(f,{...n,size:p,color:a,ref:r,kind:"confirmation",trailing:t.createElement("span",{className:"rt-NoticeActions"},t.createElement(m,{size:p,variant:"ghost",color:"gray",disabled:i,onClick:s},e),t.createElement(m,{size:p,variant:"solid",color:a,loading:i,onClick:o},c))})});v.displayName="Confirmation";export{u as a,g as b,v as c};
|
|
2
|
+
//# sourceMappingURL=chunk-BJ2Q2WVV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-KDYHYQ4D.js";import*as e from"react";import"radix-ui";var r=e.forwardRef((t,n)=>e.createElement(o,{...t,iconOnly:!0,ref:n}));r.displayName="ToggleIconButton";export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DAGHSWME.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ot}from"./chunk-RAVFUI7W.js";import{a as Ve}from"./chunk-BOFVKXUV.js";import{g as nt,j as rt}from"./chunk-IX5HIHVI.js";import{a as we}from"./chunk-KJTEZVOF.js";import{a as at}from"./chunk-GONBMSRL.js";import{a as Be}from"./chunk-PAEHH3WS.js";import{a as je}from"./chunk-AGAQC4HH.js";import{a as De}from"./chunk-PXUQEA77.js";import{b as U}from"./chunk-FWB47YCH.js";import{a as tt}from"./chunk-AVFGMLL4.js";import{a as zt}from"./chunk-OS3FCYZY.js";var Gt={};zt(Gt,{AttachTrigger:()=>gt,Attachment:()=>Ue,AttachmentsRow:()=>ft,InlineEnd:()=>ht,InlineStart:()=>pt,Item:()=>Ct,Root:()=>ut,Row:()=>vt,RowEnd:()=>xt,RowStart:()=>yt,Send:()=>Pt,Textarea:()=>mt});import*as e from"react";import E from"classnames";import{LazyMotion as Dt,MotionConfig as Bt,domAnimation as jt,m as me}from"motion/react";import{useComposedRefs as ct}from"radix-ui/internal";import{useDropzone as Vt}from"react-dropzone";var We=typeof window<"u"?e.useLayoutEffect:e.useEffect;function st(a,o){let{placeholder:n}=a;if(!n){o();return}a.placeholder="";try{o()}finally{a.placeholder=n}}var pe={layout:{type:"spring",visualDuration:.15,bounce:.1}},lt=e.createContext(null),Ke=e.createContext(""),H=()=>{let a=e.useContext(lt);if(!a)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return a},ue=a=>Array.isArray(a)?a:typeof a=="string"?a.split(",").map(o=>o.trim()).filter(Boolean):[],Wt=(a,o)=>{if(o.length===0)return!0;let n=a.type.toLowerCase(),i=a.name.toLowerCase();for(let c of o){let l=c.toLowerCase();if(l.includes("/")){let[d,u]=l.split("/"),[f,b]=n.split("/");if(d==="*"||d===f&&(u==="*"||u===b))return!0}else if(l.startsWith(".")&&i.endsWith(l))return!0}return!1},$t=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,dt=(a,o)=>(o||"").toLowerCase().startsWith("image/")||$t.test(a),$e=a=>a.trim().length>0,it=(a,o)=>`${a} ${o}${a===1?"":"s"}`,Kt=0,Ut=()=>`chatbar-attachment-${Date.now()}-${++Kt}`,ut=e.forwardRef((a,o)=>{let{className:n,style:i,children:c,value:l,defaultValue:d="",onValueChange:u,open:f,defaultOpen:b=!1,onOpenChange:C,expandOn:v="both",minLines:m=3,maxLines:N=6,sendMode:I="whenDirty",disabled:R,readOnly:S,onSubmit:j,size:A="2",variant:F,color:L,radius:z,panelBackground:y,material:k,width:V,maxWidth:re,attachments:x,defaultAttachments:D,onAttachmentsChange:_,accept:he,multiple:O=!0,maxAttachments:G,maxFileSize:q,paste:B=!0,pasteAccept:M,clearOnSubmit:Y=!0,onAttachmentReject:Se,dropzone:oe=!0,apiRef:Ee,onBlurCapture:fe,notices:be,context:Re,...Te}=a,t=k||y,g=l!=null,[w,se]=e.useState(d),W=g?l:w,X=f!=null,[Le,ie]=e.useState(b),Q=X?f:Le,Z="attachments"in a,[_e,At]=e.useState(()=>D??[]),ce=e.useMemo(()=>Z?x??[]:_e,[Z,x,_e]),[Ge,wt]=e.useState({text:"",id:0}),le=e.useCallback(r=>wt(s=>({text:r,id:s.id+1})),[]),qe=e.useRef(null),St=ct(o,qe),ke=e.useRef(null),Me=e.useRef(null),de=e.useRef(!1),Ce=e.useRef(!1),ge=e.useRef(void 0),Ne=e.useRef(null),Ye=ue(he).join(","),Oe=ue(M).join(","),He=e.useMemo(()=>ue(Ye),[Ye]),Et=e.useMemo(()=>Oe?ue(Oe):He,[Oe,He]),Xe={value:W,attachments:ce,accepts:He,pasteAccepts:Et,multiple:O,maxAttachments:G,maxFileSize:q,disabled:R,readOnly:S,expandOn:v,isValueControlled:g,isOpenControlled:X,isAttachmentsControlled:Z,onValueChange:u,onOpenChange:C,onAttachmentsChange:_,onAttachmentReject:Se,onSubmit:j},P=e.useRef(Xe);P.current=Xe;let Ie=e.useRef(null),$=e.useCallback(()=>Ie.current??P.current.attachments,[]),ee=e.useCallback(r=>{P.current.isOpenControlled||ie(r),P.current.onOpenChange?.(r)},[]),ve=e.useCallback(r=>{P.current.isValueControlled||se(r),P.current.onValueChange?.(r)},[]),te=e.useCallback(r=>{Ie.current=r,queueMicrotask(()=>{Ie.current=null}),P.current.isAttachmentsControlled||At(r),P.current.onAttachmentsChange?.(r)},[]),ye=e.useRef(new Set),ae=e.useCallback((r,s,p=P.current.multiple)=>{let h=P.current;if(h.disabled||h.readOnly||r.length===0)return 0;let K=$(),J=[],ne=[],It=typeof h.maxAttachments=="number"?Math.max(h.maxAttachments-K.length,0):1/0,Ft=p?1/0:1;for(let T of r){if(J.length>=It||J.length>=Ft){ne.push({file:T,reason:"count"});continue}if(typeof h.maxFileSize=="number"&&T.size>h.maxFileSize){ne.push({file:T,reason:"size"});continue}if(!Wt(T,s)){ne.push({file:T,reason:"type"});continue}let ze=dt(T.name,T.type)?URL.createObjectURL(T):void 0;ze&&ye.current.add(ze),J.push({id:Ut(),name:T.name,size:T.size,type:T.type,file:T,url:ze,status:"idle"})}let Ae=[];return J.length>0&&(te(K.concat(J)),h.expandOn!=="none"&&ee(!0),Ae.push(`${it(J.length,"file")} attached.`)),ne.length>0&&(h.onAttachmentReject?.(ne),Ae.push(`${it(ne.length,"file")} could not be attached.`)),Ae.length>0&&le(Ae.join(" ")),J.length},[$,te,ee,le]),xe=e.useCallback(r=>ae(r,P.current.accepts),[ae]),Je=e.useCallback(r=>ae(r,P.current.pasteAccepts),[ae]),Qe=e.useCallback(r=>{let s=$(),p=s.find(h=>h.id===r);p&&(te(s.filter(h=>h.id!==r)),le(`Removed ${p.name}.`))},[$,te,le]),Ze=e.useCallback(r=>{let s=P.current;if(s.disabled||s.readOnly)return!1;let p=$();if(!$e(s.value)&&p.length===0)return!1;let h={value:s.value,attachments:p};if(r&&s.onSubmit)for(let K of p)K.url&&ye.current.delete(K.url);return s.onSubmit?.(h),r&&(ve(""),te([])),!0},[$,ve,te]);e.useEffect(()=>{let r=ye.current;if(r.size===0)return;let s=new Set(ce.map(p=>p.url));for(let p of Array.from(r))s.has(p)||(URL.revokeObjectURL(p),r.delete(p))},[ce]),e.useEffect(()=>{let r=ye.current;return()=>{if(!P.current.isAttachmentsControlled){for(let s of Array.from(r))URL.revokeObjectURL(s);r.clear()}}},[]);let Pe=e.useCallback(r=>{let s=P.current,p=Me.current;if(clearTimeout(ge.current),Ce.current=!1,!p||s.disabled||s.readOnly)return;let h=r?.accept!=null?ue(r.accept):s.accepts,K=r?.multiple??s.multiple;Ne.current={patterns:h,multiple:K},p.accept=h.join(","),p.multiple=K,de.current=!0,p.click(),setTimeout(()=>{document.hasFocus()&&(de.current=!1)},1e3)},[]),et=e.useCallback(()=>{Ce.current=!0,clearTimeout(ge.current),ge.current=setTimeout(()=>{Ce.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(ge.current),[]),e.useEffect(()=>{let r=Me.current,s=()=>{de.current=!1};return window.addEventListener("focus",s),r?.addEventListener("cancel",s),()=>{window.removeEventListener("focus",s),r?.removeEventListener("cancel",s)}},[]);let Tt=e.useCallback(r=>{let s=r.currentTarget,p=Array.from(s.files??[]),h=Ne.current;ae(p,h?.patterns??P.current.accepts,h?.multiple),de.current=!1,Ne.current=null,s.value=""},[ae]),Lt=e.useCallback(r=>{fe?.(r);let s=P.current,p=qe.current;if(!p||s.expandOn==="none")return;let h=r.relatedTarget;h&&p.contains(h)||de.current||Ce.current||!$e(s.value)&&$().length===0&&ee(!1)},[fe,ee,$]),kt=e.useCallback(r=>{xe(r)},[xe]),{getRootProps:Mt,isDragActive:Nt}=Vt({onDrop:kt,onDragEnter:()=>le(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!oe||R||S}),Fe=oe&&Nt;e.useImperativeHandle(Ee,()=>({focusTextarea:()=>ke.current?.focus({preventScroll:!0}),openFilePicker:()=>Pe()}),[Pe]);let Ot=e.useCallback(r=>{if(R||r.pointerType==="mouse"&&r.button!==0)return;let s=r.target;s instanceof Element&&s.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(r.preventDefault(),ke.current?.focus({preventScroll:!0}))},[R]),Ht=e.useMemo(()=>({open:Q,setOpen:ee,setValue:ve,size:A,expandOn:v,minLines:m,maxLines:N,sendMode:I,disabled:R,readOnly:S,paste:B,clearOnSubmit:Y,multiple:O,textareaRef:ke,attachments:ce,removeAttachment:Qe,submit:Ze,appendFiles:xe,appendFilesFromPaste:Je,openFilePicker:Pe,beginFilePickerPress:et}),[Q,ee,ve,A,v,m,N,I,R,S,B,Y,O,ce,Qe,Ze,xe,Je,Pe,et]);return e.createElement(lt.Provider,{value:Ht},e.createElement(Ke.Provider,{value:W},e.createElement(Dt,{features:jt},e.createElement(Bt,{reducedMotion:"user"},e.createElement("div",{...Te,ref:St,className:E("rt-ChatbarRoot",`rt-r-size-${A}`,n),style:{position:"relative",width:V,maxWidth:re,...i},"data-state":Q?"open":"closed","data-disabled":R?"":void 0,"data-readonly":S?"":void 0,"data-drop-active":Fe?"":void 0,"data-accent-color":L,"data-radius":z,"data-panel-background":t,"data-material":t,onBlurCapture:Lt},e.createElement("input",{ref:Me,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:Tt}),be?e.createElement("div",{className:"rt-ChatbarNotices"},e.createElement(ot.Provider,{value:A},be)):null,e.createElement("div",{...oe?Mt():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Ot},e.createElement(me.div,{className:E("rt-ChatbarBox",`rt-variant-${tt(F??"raised")}`),style:{position:"relative"},"data-accent-color":L,"data-radius":z,"data-panel-background":t,"data-material":t,layout:!0,transition:pe},e.createElement(me.div,{className:"rt-ChatbarGrid",layout:"position",transition:pe},c),Fe&&e.createElement("div",{className:"rt-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"rt-ChatbarDropContent"},e.createElement(we,{emphasis:"medium",size:A,weight:"medium"},"Drop files here to attach"))))),Re?e.createElement(we,{as:"div",size:A==="3"?"2":"1",emphasis:"medium",className:"rt-ChatbarContext"},Re):null,e.createElement(je,{role:"status","aria-live":"polite"},Fe?"Drop files here to attach.":e.createElement("span",{key:Ge.id},Ge.text)))))))});ut.displayName="Chatbar.Root";var mt=e.forwardRef((a,o)=>{let{className:n,style:i,asChild:c,onFocus:l,onChange:d,onPaste:u,onKeyDown:f,onCompositionStart:b,onCompositionEnd:C,submitOnEnter:v=!1,...m}=a,N=H(),I=e.useContext(Ke),{open:R,minLines:S,maxLines:j,expandOn:A,disabled:F,readOnly:L,setOpen:z,setValue:y,textareaRef:k,paste:V,appendFilesFromPaste:re,size:x,submit:D,clearOnSubmit:_}=N,he=ct(o,k),O=e.useRef(0),G=e.useRef(0),q=e.useRef(!1),B=e.useRef({open:R,minLines:S,maxLines:j});We(()=>{B.current={open:R,minLines:S,maxLines:j}},[R,S,j]);let M=e.useCallback(()=>{let t=k.current;if(!t)return;let g=window.getComputedStyle(t);O.current=parseFloat(g.lineHeight)||20,G.current=(parseFloat(g.paddingTop)||0)+(parseFloat(g.paddingBottom)||0)},[k]),Y=e.useCallback((t,g)=>{let{minLines:w,maxLines:se}=B.current,W=O.current,X=G.current,Le=Math.ceil((g?w:1)*W)+X,ie=Math.ceil((g?se:1)*W)+X,Q=Math.max(t.scrollHeight,Le);t.style.height=`${Math.min(Q,ie)}px`;let Z=Q>ie;t.style.overflowY=Z?"auto":"hidden",t.style.maxHeight=Z?`${ie}px`:"none"},[]);We(()=>{M()},[M,x]),We(()=>{let t=k.current;t&&(O.current===0&&M(),st(t,()=>{t.style.height="auto";let g=R;if(!R&&(A==="overflow"||A==="both")){let w=Math.ceil(O.current)+G.current;t.scrollHeight>w+1&&(g=!0,z(!0))}Y(t,g)}))},[I,R,A,S,j,x,z,k,M,Y]),e.useEffect(()=>{let t=k.current;if(!t||typeof ResizeObserver>"u")return;let g=-1,w=new ResizeObserver(se=>{let W=se[0]?.contentRect.width??0;if(W===g)return;let X=g===-1;g=W,!X&&(M(),st(t,()=>{t.style.height="auto",Y(t,B.current.open)}))});return w.observe(t),()=>w.disconnect()},[k,M,Y]),e.useEffect(()=>{},[]);let Se=e.useCallback(t=>{l?.(t),!(F||L)&&(A==="focus"||A==="both")&&!R&&z(!0)},[F,L,A,R,z,l]),oe=e.useCallback(t=>{y(t.currentTarget.value),d?.(t)},[y,d]),Ee=e.useCallback(t=>{if(u?.(t),t.defaultPrevented||!V||F||L)return;let g=Array.from(t.clipboardData?.items??[]).filter(w=>w.kind==="file").map(w=>w.getAsFile()).filter(w=>!!w);g.length!==0&&re(g)>0&&t.preventDefault()},[V,F,L,u,re]),fe=e.useCallback(t=>{q.current=!0,b?.(t)},[b]),be=e.useCallback(t=>{q.current=!1,C?.(t)},[C]),Re=e.useCallback(t=>{f?.(t),!(t.defaultPrevented||!v)&&(t.key!=="Enter"||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey||q.current||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||(t.preventDefault(),D(_)))},[v,f,D,_]),Te=c?U:"textarea";return e.createElement(me.div,{className:E("rt-ChatbarField","rt-ChatbarTextarea",n),layout:"position",transition:pe},e.createElement(Te,{...m,ref:he,className:"rt-ChatbarInput",value:I,onChange:oe,onFocus:Se,onPaste:Ee,onKeyDown:Re,onCompositionStart:fe,onCompositionEnd:be,disabled:F,readOnly:L,rows:R?S:1,spellCheck:m.spellCheck??!0,autoCorrect:m.autoCorrect??"on",style:i}))});mt.displayName="Chatbar.Textarea";var pt=e.forwardRef((a,o)=>{let{children:n,asChild:i,className:c,...l}=a;return H().open?null:e.createElement(i?U:"div",{...l,ref:o,className:E("rt-ChatbarInlineStart",c)},n)});pt.displayName="Chatbar.InlineStart";var ht=e.forwardRef((a,o)=>{let{children:n,asChild:i,className:c,...l}=a;return H().open?null:e.createElement(i?U:"div",{...l,ref:o,className:E("rt-ChatbarInlineEnd",c)},n)});ht.displayName="Chatbar.InlineEnd";var ft=e.forwardRef((a,o)=>{let{asChild:n,forceMount:i,renderAttachment:c,className:l,children:d,...u}=a,f=H(),b=e.Children.toArray(d).length>0;if(f.attachments.length===0&&!b&&!i)return null;let C=n?U:"div";return e.createElement(me.div,{layout:"position",transition:pe},e.createElement(C,{...u,ref:o,className:E("rt-ChatbarAttachmentsRow",l),role:"list","aria-label":u["aria-label"]??"Attachments"},e.createElement(at,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},e.createElement(De,{align:"center",gap:"2",minWidth:"fit-content"},f.attachments.map(v=>e.createElement(Ue,{key:v.id,attachment:v,asChild:!!c},c?.(v))),d))))});ft.displayName="Chatbar.AttachmentsRow";function bt(a,o){let n=a.closest('[role="listitem"]'),i=n?.parentElement?Array.from(n.parentElement.children):[],c=n?i.indexOf(n):-1,d=(i[c+1]??i[c-1])?.querySelector(".rt-ChatbarItemRemove");d?d.focus():o.current?.focus({preventScroll:!0})}var Rt=({lead:a,leadKind:o,label:n,detail:i,removeLabel:c,onRemove:l})=>{let d=H();return e.createElement(e.Fragment,null,e.createElement("span",{className:"rt-ChatbarItemLead","data-kind":o,"aria-hidden":!0},a),e.createElement(we,{className:"rt-ChatbarItemLabel",size:d.size,truncate:!0},n,i?e.createElement(je,null,", ",i):null),l&&e.createElement(Ve,{className:"rt-ChatbarItemRemove","aria-label":c,size:"1",variant:"ghost",color:"gray",onClick:l},e.createElement(nt,null)))},_t={uploading:"uploading",error:"failed to upload"},Ue=e.forwardRef((a,o)=>{let{attachment:n,asChild:i,className:c,children:l,...d}=a,u=H(),f=i?U:"div",b=!!n.url&&dt(n.name,n.type),C=`${Math.ceil(n.size/1024)} KB`,v=n.status?_t[n.status]:void 0,m=u.disabled||u.readOnly,N=R=>{bt(R.currentTarget,u.textareaRef),u.removeAttachment(n.id)},I=n.status==="uploading"?e.createElement(Be,{size:"1"}):b?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:n.url,alt:""}):e.createElement(rt,null);return e.createElement(f,{...d,ref:o,className:E(l?"rt-ChatbarAttachment":"rt-ChatbarAttachment rt-ChatbarItem",c),role:"listitem","data-kind":b?"image":"file","data-status":n.status,title:n.name},l??e.createElement(Rt,{lead:I,leadKind:b&&n.status!=="uploading"?"image":"icon",label:n.name,detail:v?`${C}, ${v}`:C,removeLabel:`Remove ${n.name}`,onRemove:m?void 0:N}))});Ue.displayName="Chatbar.Attachment";var Ct=e.forwardRef((a,o)=>{let{children:n,icon:i,image:c,color:l,onRemove:d,removeLabel:u,className:f,...b}=a,C=H(),v=C.disabled||C.readOnly,m=d?N=>{bt(N.currentTarget,C.textareaRef),d()}:void 0;return e.createElement("div",{...b,ref:o,className:E("rt-ChatbarItem",f),role:"listitem","data-accent-color":c?void 0:l??"gray",title:n},e.createElement(Rt,{lead:c?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:c,alt:""}):i,leadKind:c?"image":"icon",label:n,removeLabel:u??`Remove ${n}`,onRemove:v?void 0:m}))});Ct.displayName="Chatbar.Item";var gt=e.forwardRef((a,o)=>{let{asChild:n,accept:i,multiple:c,disabled:l,onPointerDown:d,onClick:u,...f}=a,b=H(),C=l||b.disabled||b.readOnly;return e.createElement(n?U:"button",{...f,ref:o,className:E("rt-ChatbarAttachTrigger",f.className),type:f.type??"button","aria-label":f["aria-label"]??"Add attachments",disabled:C,onPointerDown:m=>{d?.(m),!C&&!m.defaultPrevented&&b.beginFilePickerPress()},onClick:m=>{u?.(m),!(C||m.defaultPrevented)&&b.openFilePicker({accept:i,multiple:c})}})});gt.displayName="Chatbar.AttachTrigger";var vt=e.forwardRef((a,o)=>{let{asChild:n,children:i,className:c,...l}=a;if(!H().open)return null;let u=n?U:"div";return e.createElement(me.div,{layout:"position",transition:pe},e.createElement(u,{...l,ref:o,className:E("rt-ChatbarRow",c)},e.createElement(De,{align:"center",justify:"between",width:"100%"},i)))});vt.displayName="Chatbar.Row";var yt=e.forwardRef((a,o)=>{let{className:n,...i}=a;return e.createElement("div",{...i,ref:o,className:E("rt-ChatbarRowStart",n)})});yt.displayName="Chatbar.RowStart";var xt=e.forwardRef((a,o)=>{let{className:n,...i}=a;return e.createElement("div",{...i,ref:o,className:E("rt-ChatbarRowEnd",n)})});xt.displayName="Chatbar.RowEnd";var Pt=e.forwardRef((a,o)=>{let{asChild:n,clearOnSend:i,disabled:c,children:l,style:d,className:u,size:f,variant:b,tabIndex:C,onClick:v,status:m="ready",onStop:N,onRetry:I,stopLabel:R="Stop",retryLabel:S="Retry",stopIcon:j,retryIcon:A,"aria-label":F,"aria-labelledby":L,...z}=a,y=H(),k=e.useContext(Ke),V=$e(k)||y.attachments.length>0,x=V?"send":m==="submitted"||m==="streaming"?"stop":m==="error"?"retry":"send";if(y.sendMode==="never"&&x==="send")return null;let D=x!=="send"||y.sendMode==="always"||V,_=x==="send"?c||y.disabled||y.readOnly||!V:c||y.disabled,O=x==="stop"?{"aria-label":R}:x==="retry"?{"aria-label":S}:L?{"aria-labelledby":L}:{"aria-label":F??"Send"},G=B=>{if(v?.(B),B.defaultPrevented||_)return;if(x==="stop"){N?.();return}if(x==="retry"){I?.();return}let M=i??y.clearOnSubmit;y.submit(M)&&M&&y.textareaRef.current?.focus({preventScroll:!0})},q=x==="stop"?j??(m==="submitted"?e.createElement(Be,{size:y.size}):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):x==="retry"?A??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):l??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(Ve,{...z,ref:o,size:f??y.size,variant:b??(y.open||x!=="send"?"solid":"ghost"),disabled:_,className:E("rt-ChatbarSend",u),style:{opacity:D?1:0,pointerEvents:D?void 0:"none",...d},"aria-hidden":D?void 0:!0,tabIndex:D?C:-1,asChild:n,onClick:G,"data-status":m,"data-mode":x,...O},q)});Pt.displayName="Chatbar.Send";export{ut as a,mt as b,pt as c,ht as d,ft as e,Ue as f,Ct as g,gt as h,vt as i,yt as j,xt as k,Pt as l,Gt as m};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as ot}from"./chunk-BJ2Q2WVV.js";import{a as Ve}from"./chunk-YEYM7QQZ.js";import{g as nt,j as rt}from"./chunk-IX5HIHVI.js";import{a as we}from"./chunk-KJTEZVOF.js";import{a as at}from"./chunk-GONBMSRL.js";import{a as Be}from"./chunk-PAEHH3WS.js";import{a as je}from"./chunk-AGAQC4HH.js";import{a as De}from"./chunk-PXUQEA77.js";import{b as U}from"./chunk-FWB47YCH.js";import{a as tt}from"./chunk-AVFGMLL4.js";import{a as zt}from"./chunk-OS3FCYZY.js";var Gt={};zt(Gt,{AttachTrigger:()=>gt,Attachment:()=>Ue,AttachmentsRow:()=>ft,InlineEnd:()=>ht,InlineStart:()=>pt,Item:()=>Ct,Root:()=>ut,Row:()=>vt,RowEnd:()=>xt,RowStart:()=>yt,Send:()=>Pt,Textarea:()=>mt});import*as e from"react";import E from"classnames";import{LazyMotion as Dt,MotionConfig as Bt,domAnimation as jt,m as me}from"motion/react";import{useComposedRefs as ct}from"radix-ui/internal";import{useDropzone as Vt}from"react-dropzone";var We=typeof window<"u"?e.useLayoutEffect:e.useEffect;function st(a,o){let{placeholder:n}=a;if(!n){o();return}a.placeholder="";try{o()}finally{a.placeholder=n}}var pe={layout:{type:"spring",visualDuration:.15,bounce:.1}},lt=e.createContext(null),Ke=e.createContext(""),H=()=>{let a=e.useContext(lt);if(!a)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return a},ue=a=>Array.isArray(a)?a:typeof a=="string"?a.split(",").map(o=>o.trim()).filter(Boolean):[],Wt=(a,o)=>{if(o.length===0)return!0;let n=a.type.toLowerCase(),i=a.name.toLowerCase();for(let c of o){let l=c.toLowerCase();if(l.includes("/")){let[d,u]=l.split("/"),[f,b]=n.split("/");if(d==="*"||d===f&&(u==="*"||u===b))return!0}else if(l.startsWith(".")&&i.endsWith(l))return!0}return!1},$t=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,dt=(a,o)=>(o||"").toLowerCase().startsWith("image/")||$t.test(a),$e=a=>a.trim().length>0,it=(a,o)=>`${a} ${o}${a===1?"":"s"}`,Kt=0,Ut=()=>`chatbar-attachment-${Date.now()}-${++Kt}`,ut=e.forwardRef((a,o)=>{let{className:n,style:i,children:c,value:l,defaultValue:d="",onValueChange:u,open:f,defaultOpen:b=!1,onOpenChange:C,expandOn:v="both",minLines:m=3,maxLines:N=6,sendMode:I="whenDirty",disabled:R,readOnly:S,onSubmit:j,size:A="2",variant:F,color:L,radius:z,panelBackground:y,material:k,width:V,maxWidth:re,attachments:x,defaultAttachments:D,onAttachmentsChange:_,accept:he,multiple:O=!0,maxAttachments:G,maxFileSize:q,paste:B=!0,pasteAccept:M,clearOnSubmit:Y=!0,onAttachmentReject:Se,dropzone:oe=!0,apiRef:Ee,onBlurCapture:fe,notices:be,context:Re,...Te}=a,t=k||y,g=l!=null,[w,se]=e.useState(d),W=g?l:w,X=f!=null,[Le,ie]=e.useState(b),Q=X?f:Le,Z="attachments"in a,[_e,At]=e.useState(()=>D??[]),ce=e.useMemo(()=>Z?x??[]:_e,[Z,x,_e]),[Ge,wt]=e.useState({text:"",id:0}),le=e.useCallback(r=>wt(s=>({text:r,id:s.id+1})),[]),qe=e.useRef(null),St=ct(o,qe),ke=e.useRef(null),Me=e.useRef(null),de=e.useRef(!1),Ce=e.useRef(!1),ge=e.useRef(void 0),Ne=e.useRef(null),Ye=ue(he).join(","),Oe=ue(M).join(","),He=e.useMemo(()=>ue(Ye),[Ye]),Et=e.useMemo(()=>Oe?ue(Oe):He,[Oe,He]),Xe={value:W,attachments:ce,accepts:He,pasteAccepts:Et,multiple:O,maxAttachments:G,maxFileSize:q,disabled:R,readOnly:S,expandOn:v,isValueControlled:g,isOpenControlled:X,isAttachmentsControlled:Z,onValueChange:u,onOpenChange:C,onAttachmentsChange:_,onAttachmentReject:Se,onSubmit:j},P=e.useRef(Xe);P.current=Xe;let Ie=e.useRef(null),$=e.useCallback(()=>Ie.current??P.current.attachments,[]),ee=e.useCallback(r=>{P.current.isOpenControlled||ie(r),P.current.onOpenChange?.(r)},[]),ve=e.useCallback(r=>{P.current.isValueControlled||se(r),P.current.onValueChange?.(r)},[]),te=e.useCallback(r=>{Ie.current=r,queueMicrotask(()=>{Ie.current=null}),P.current.isAttachmentsControlled||At(r),P.current.onAttachmentsChange?.(r)},[]),ye=e.useRef(new Set),ae=e.useCallback((r,s,p=P.current.multiple)=>{let h=P.current;if(h.disabled||h.readOnly||r.length===0)return 0;let K=$(),J=[],ne=[],It=typeof h.maxAttachments=="number"?Math.max(h.maxAttachments-K.length,0):1/0,Ft=p?1/0:1;for(let T of r){if(J.length>=It||J.length>=Ft){ne.push({file:T,reason:"count"});continue}if(typeof h.maxFileSize=="number"&&T.size>h.maxFileSize){ne.push({file:T,reason:"size"});continue}if(!Wt(T,s)){ne.push({file:T,reason:"type"});continue}let ze=dt(T.name,T.type)?URL.createObjectURL(T):void 0;ze&&ye.current.add(ze),J.push({id:Ut(),name:T.name,size:T.size,type:T.type,file:T,url:ze,status:"idle"})}let Ae=[];return J.length>0&&(te(K.concat(J)),h.expandOn!=="none"&&ee(!0),Ae.push(`${it(J.length,"file")} attached.`)),ne.length>0&&(h.onAttachmentReject?.(ne),Ae.push(`${it(ne.length,"file")} could not be attached.`)),Ae.length>0&&le(Ae.join(" ")),J.length},[$,te,ee,le]),xe=e.useCallback(r=>ae(r,P.current.accepts),[ae]),Je=e.useCallback(r=>ae(r,P.current.pasteAccepts),[ae]),Qe=e.useCallback(r=>{let s=$(),p=s.find(h=>h.id===r);p&&(te(s.filter(h=>h.id!==r)),le(`Removed ${p.name}.`))},[$,te,le]),Ze=e.useCallback(r=>{let s=P.current;if(s.disabled||s.readOnly)return!1;let p=$();if(!$e(s.value)&&p.length===0)return!1;let h={value:s.value,attachments:p};if(r&&s.onSubmit)for(let K of p)K.url&&ye.current.delete(K.url);return s.onSubmit?.(h),r&&(ve(""),te([])),!0},[$,ve,te]);e.useEffect(()=>{let r=ye.current;if(r.size===0)return;let s=new Set(ce.map(p=>p.url));for(let p of Array.from(r))s.has(p)||(URL.revokeObjectURL(p),r.delete(p))},[ce]),e.useEffect(()=>{let r=ye.current;return()=>{if(!P.current.isAttachmentsControlled){for(let s of Array.from(r))URL.revokeObjectURL(s);r.clear()}}},[]);let Pe=e.useCallback(r=>{let s=P.current,p=Me.current;if(clearTimeout(ge.current),Ce.current=!1,!p||s.disabled||s.readOnly)return;let h=r?.accept!=null?ue(r.accept):s.accepts,K=r?.multiple??s.multiple;Ne.current={patterns:h,multiple:K},p.accept=h.join(","),p.multiple=K,de.current=!0,p.click(),setTimeout(()=>{document.hasFocus()&&(de.current=!1)},1e3)},[]),et=e.useCallback(()=>{Ce.current=!0,clearTimeout(ge.current),ge.current=setTimeout(()=>{Ce.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(ge.current),[]),e.useEffect(()=>{let r=Me.current,s=()=>{de.current=!1};return window.addEventListener("focus",s),r?.addEventListener("cancel",s),()=>{window.removeEventListener("focus",s),r?.removeEventListener("cancel",s)}},[]);let Tt=e.useCallback(r=>{let s=r.currentTarget,p=Array.from(s.files??[]),h=Ne.current;ae(p,h?.patterns??P.current.accepts,h?.multiple),de.current=!1,Ne.current=null,s.value=""},[ae]),Lt=e.useCallback(r=>{fe?.(r);let s=P.current,p=qe.current;if(!p||s.expandOn==="none")return;let h=r.relatedTarget;h&&p.contains(h)||de.current||Ce.current||!$e(s.value)&&$().length===0&&ee(!1)},[fe,ee,$]),kt=e.useCallback(r=>{xe(r)},[xe]),{getRootProps:Mt,isDragActive:Nt}=Vt({onDrop:kt,onDragEnter:()=>le(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!oe||R||S}),Fe=oe&&Nt;e.useImperativeHandle(Ee,()=>({focusTextarea:()=>ke.current?.focus({preventScroll:!0}),openFilePicker:()=>Pe()}),[Pe]);let Ot=e.useCallback(r=>{if(R||r.pointerType==="mouse"&&r.button!==0)return;let s=r.target;s instanceof Element&&s.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(r.preventDefault(),ke.current?.focus({preventScroll:!0}))},[R]),Ht=e.useMemo(()=>({open:Q,setOpen:ee,setValue:ve,size:A,expandOn:v,minLines:m,maxLines:N,sendMode:I,disabled:R,readOnly:S,paste:B,clearOnSubmit:Y,multiple:O,textareaRef:ke,attachments:ce,removeAttachment:Qe,submit:Ze,appendFiles:xe,appendFilesFromPaste:Je,openFilePicker:Pe,beginFilePickerPress:et}),[Q,ee,ve,A,v,m,N,I,R,S,B,Y,O,ce,Qe,Ze,xe,Je,Pe,et]);return e.createElement(lt.Provider,{value:Ht},e.createElement(Ke.Provider,{value:W},e.createElement(Dt,{features:jt},e.createElement(Bt,{reducedMotion:"user"},e.createElement("div",{...Te,ref:St,className:E("rt-ChatbarRoot",`rt-r-size-${A}`,n),style:{position:"relative",width:V,maxWidth:re,...i},"data-state":Q?"open":"closed","data-disabled":R?"":void 0,"data-readonly":S?"":void 0,"data-drop-active":Fe?"":void 0,"data-accent-color":L,"data-radius":z,"data-panel-background":t,"data-material":t,onBlurCapture:Lt},e.createElement("input",{ref:Me,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:Tt}),be?e.createElement("div",{className:"rt-ChatbarNotices"},e.createElement(ot.Provider,{value:A},be)):null,e.createElement("div",{...oe?Mt():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Ot},e.createElement(me.div,{className:E("rt-ChatbarBox",`rt-variant-${tt(F??"raised")}`),style:{position:"relative"},"data-accent-color":L,"data-radius":z,"data-panel-background":t,"data-material":t,layout:!0,transition:pe},e.createElement(me.div,{className:"rt-ChatbarGrid",layout:"position",transition:pe},c),Fe&&e.createElement("div",{className:"rt-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"rt-ChatbarDropContent"},e.createElement(we,{emphasis:"medium",size:A,weight:"medium"},"Drop files here to attach"))))),Re?e.createElement(we,{as:"div",size:A==="3"?"2":"1",emphasis:"medium",className:"rt-ChatbarContext"},Re):null,e.createElement(je,{role:"status","aria-live":"polite"},Fe?"Drop files here to attach.":e.createElement("span",{key:Ge.id},Ge.text)))))))});ut.displayName="Chatbar.Root";var mt=e.forwardRef((a,o)=>{let{className:n,style:i,asChild:c,onFocus:l,onChange:d,onPaste:u,onKeyDown:f,onCompositionStart:b,onCompositionEnd:C,submitOnEnter:v=!1,...m}=a,N=H(),I=e.useContext(Ke),{open:R,minLines:S,maxLines:j,expandOn:A,disabled:F,readOnly:L,setOpen:z,setValue:y,textareaRef:k,paste:V,appendFilesFromPaste:re,size:x,submit:D,clearOnSubmit:_}=N,he=ct(o,k),O=e.useRef(0),G=e.useRef(0),q=e.useRef(!1),B=e.useRef({open:R,minLines:S,maxLines:j});We(()=>{B.current={open:R,minLines:S,maxLines:j}},[R,S,j]);let M=e.useCallback(()=>{let t=k.current;if(!t)return;let g=window.getComputedStyle(t);O.current=parseFloat(g.lineHeight)||20,G.current=(parseFloat(g.paddingTop)||0)+(parseFloat(g.paddingBottom)||0)},[k]),Y=e.useCallback((t,g)=>{let{minLines:w,maxLines:se}=B.current,W=O.current,X=G.current,Le=Math.ceil((g?w:1)*W)+X,ie=Math.ceil((g?se:1)*W)+X,Q=Math.max(t.scrollHeight,Le);t.style.height=`${Math.min(Q,ie)}px`;let Z=Q>ie;t.style.overflowY=Z?"auto":"hidden",t.style.maxHeight=Z?`${ie}px`:"none"},[]);We(()=>{M()},[M,x]),We(()=>{let t=k.current;t&&(O.current===0&&M(),st(t,()=>{t.style.height="auto";let g=R;if(!R&&(A==="overflow"||A==="both")){let w=Math.ceil(O.current)+G.current;t.scrollHeight>w+1&&(g=!0,z(!0))}Y(t,g)}))},[I,R,A,S,j,x,z,k,M,Y]),e.useEffect(()=>{let t=k.current;if(!t||typeof ResizeObserver>"u")return;let g=-1,w=new ResizeObserver(se=>{let W=se[0]?.contentRect.width??0;if(W===g)return;let X=g===-1;g=W,!X&&(M(),st(t,()=>{t.style.height="auto",Y(t,B.current.open)}))});return w.observe(t),()=>w.disconnect()},[k,M,Y]),e.useEffect(()=>{},[]);let Se=e.useCallback(t=>{l?.(t),!(F||L)&&(A==="focus"||A==="both")&&!R&&z(!0)},[F,L,A,R,z,l]),oe=e.useCallback(t=>{y(t.currentTarget.value),d?.(t)},[y,d]),Ee=e.useCallback(t=>{if(u?.(t),t.defaultPrevented||!V||F||L)return;let g=Array.from(t.clipboardData?.items??[]).filter(w=>w.kind==="file").map(w=>w.getAsFile()).filter(w=>!!w);g.length!==0&&re(g)>0&&t.preventDefault()},[V,F,L,u,re]),fe=e.useCallback(t=>{q.current=!0,b?.(t)},[b]),be=e.useCallback(t=>{q.current=!1,C?.(t)},[C]),Re=e.useCallback(t=>{f?.(t),!(t.defaultPrevented||!v)&&(t.key!=="Enter"||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey||q.current||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||(t.preventDefault(),D(_)))},[v,f,D,_]),Te=c?U:"textarea";return e.createElement(me.div,{className:E("rt-ChatbarField","rt-ChatbarTextarea",n),layout:"position",transition:pe},e.createElement(Te,{...m,ref:he,className:"rt-ChatbarInput",value:I,onChange:oe,onFocus:Se,onPaste:Ee,onKeyDown:Re,onCompositionStart:fe,onCompositionEnd:be,disabled:F,readOnly:L,rows:R?S:1,spellCheck:m.spellCheck??!0,autoCorrect:m.autoCorrect??"on",style:i}))});mt.displayName="Chatbar.Textarea";var pt=e.forwardRef((a,o)=>{let{children:n,asChild:i,className:c,...l}=a;return H().open?null:e.createElement(i?U:"div",{...l,ref:o,className:E("rt-ChatbarInlineStart",c)},n)});pt.displayName="Chatbar.InlineStart";var ht=e.forwardRef((a,o)=>{let{children:n,asChild:i,className:c,...l}=a;return H().open?null:e.createElement(i?U:"div",{...l,ref:o,className:E("rt-ChatbarInlineEnd",c)},n)});ht.displayName="Chatbar.InlineEnd";var ft=e.forwardRef((a,o)=>{let{asChild:n,forceMount:i,renderAttachment:c,className:l,children:d,...u}=a,f=H(),b=e.Children.toArray(d).length>0;if(f.attachments.length===0&&!b&&!i)return null;let C=n?U:"div";return e.createElement(me.div,{layout:"position",transition:pe},e.createElement(C,{...u,ref:o,className:E("rt-ChatbarAttachmentsRow",l),role:"list","aria-label":u["aria-label"]??"Attachments"},e.createElement(at,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},e.createElement(De,{align:"center",gap:"2",minWidth:"fit-content"},f.attachments.map(v=>e.createElement(Ue,{key:v.id,attachment:v,asChild:!!c},c?.(v))),d))))});ft.displayName="Chatbar.AttachmentsRow";function bt(a,o){let n=a.closest('[role="listitem"]'),i=n?.parentElement?Array.from(n.parentElement.children):[],c=n?i.indexOf(n):-1,d=(i[c+1]??i[c-1])?.querySelector(".rt-ChatbarItemRemove");d?d.focus():o.current?.focus({preventScroll:!0})}var Rt=({lead:a,leadKind:o,label:n,detail:i,removeLabel:c,onRemove:l})=>{let d=H();return e.createElement(e.Fragment,null,e.createElement("span",{className:"rt-ChatbarItemLead","data-kind":o,"aria-hidden":!0},a),e.createElement(we,{className:"rt-ChatbarItemLabel",size:d.size,truncate:!0},n,i?e.createElement(je,null,", ",i):null),l&&e.createElement(Ve,{className:"rt-ChatbarItemRemove","aria-label":c,size:"1",variant:"ghost",color:"gray",onClick:l},e.createElement(nt,null)))},_t={uploading:"uploading",error:"failed to upload"},Ue=e.forwardRef((a,o)=>{let{attachment:n,asChild:i,className:c,children:l,...d}=a,u=H(),f=i?U:"div",b=!!n.url&&dt(n.name,n.type),C=`${Math.ceil(n.size/1024)} KB`,v=n.status?_t[n.status]:void 0,m=u.disabled||u.readOnly,N=R=>{bt(R.currentTarget,u.textareaRef),u.removeAttachment(n.id)},I=n.status==="uploading"?e.createElement(Be,{size:"1"}):b?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:n.url,alt:""}):e.createElement(rt,null);return e.createElement(f,{...d,ref:o,className:E(l?"rt-ChatbarAttachment":"rt-ChatbarAttachment rt-ChatbarItem",c),role:"listitem","data-kind":b?"image":"file","data-status":n.status,title:n.name},l??e.createElement(Rt,{lead:I,leadKind:b&&n.status!=="uploading"?"image":"icon",label:n.name,detail:v?`${C}, ${v}`:C,removeLabel:`Remove ${n.name}`,onRemove:m?void 0:N}))});Ue.displayName="Chatbar.Attachment";var Ct=e.forwardRef((a,o)=>{let{children:n,icon:i,image:c,color:l,onRemove:d,removeLabel:u,className:f,...b}=a,C=H(),v=C.disabled||C.readOnly,m=d?N=>{bt(N.currentTarget,C.textareaRef),d()}:void 0;return e.createElement("div",{...b,ref:o,className:E("rt-ChatbarItem",f),role:"listitem","data-accent-color":c?void 0:l??"gray",title:n},e.createElement(Rt,{lead:c?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:c,alt:""}):i,leadKind:c?"image":"icon",label:n,removeLabel:u??`Remove ${n}`,onRemove:v?void 0:m}))});Ct.displayName="Chatbar.Item";var gt=e.forwardRef((a,o)=>{let{asChild:n,accept:i,multiple:c,disabled:l,onPointerDown:d,onClick:u,...f}=a,b=H(),C=l||b.disabled||b.readOnly;return e.createElement(n?U:"button",{...f,ref:o,className:E("rt-ChatbarAttachTrigger",f.className),type:f.type??"button","aria-label":f["aria-label"]??"Add attachments",disabled:C,onPointerDown:m=>{d?.(m),!C&&!m.defaultPrevented&&b.beginFilePickerPress()},onClick:m=>{u?.(m),!(C||m.defaultPrevented)&&b.openFilePicker({accept:i,multiple:c})}})});gt.displayName="Chatbar.AttachTrigger";var vt=e.forwardRef((a,o)=>{let{asChild:n,children:i,className:c,...l}=a;if(!H().open)return null;let u=n?U:"div";return e.createElement(me.div,{layout:"position",transition:pe},e.createElement(u,{...l,ref:o,className:E("rt-ChatbarRow",c)},e.createElement(De,{align:"center",justify:"between",width:"100%"},i)))});vt.displayName="Chatbar.Row";var yt=e.forwardRef((a,o)=>{let{className:n,...i}=a;return e.createElement("div",{...i,ref:o,className:E("rt-ChatbarRowStart",n)})});yt.displayName="Chatbar.RowStart";var xt=e.forwardRef((a,o)=>{let{className:n,...i}=a;return e.createElement("div",{...i,ref:o,className:E("rt-ChatbarRowEnd",n)})});xt.displayName="Chatbar.RowEnd";var Pt=e.forwardRef((a,o)=>{let{asChild:n,clearOnSend:i,disabled:c,children:l,style:d,className:u,size:f,variant:b,tabIndex:C,onClick:v,status:m="ready",onStop:N,onRetry:I,stopLabel:R="Stop",retryLabel:S="Retry",stopIcon:j,retryIcon:A,"aria-label":F,"aria-labelledby":L,...z}=a,y=H(),k=e.useContext(Ke),V=$e(k)||y.attachments.length>0,x=V?"send":m==="submitted"||m==="streaming"?"stop":m==="error"?"retry":"send";if(y.sendMode==="never"&&x==="send")return null;let D=x!=="send"||y.sendMode==="always"||V,_=x==="send"?c||y.disabled||y.readOnly||!V:c||y.disabled,O=x==="stop"?{"aria-label":R}:x==="retry"?{"aria-label":S}:L?{"aria-labelledby":L}:{"aria-label":F??"Send"},G=B=>{if(v?.(B),B.defaultPrevented||_)return;if(x==="stop"){N?.();return}if(x==="retry"){I?.();return}let M=i??y.clearOnSubmit;y.submit(M)&&M&&y.textareaRef.current?.focus({preventScroll:!0})},q=x==="stop"?j??(m==="submitted"?e.createElement(Be,{size:y.size}):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):x==="retry"?A??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):l??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(Ve,{...z,ref:o,size:f??y.size,variant:b??(y.open||x!=="send"?"solid":"ghost"),disabled:_,className:E("rt-ChatbarSend",u),style:{opacity:D?1:0,pointerEvents:D?void 0:"none",...d},"aria-hidden":D?void 0:!0,tabIndex:D?C:-1,asChild:n,onClick:G,"data-status":m,"data-mode":x,...O},q)});Pt.displayName="Chatbar.Send";export{ut as a,mt as b,pt as c,ht as d,ft as e,Ue as f,Ct as g,gt as h,vt as i,yt as j,xt as k,Pt as l,Gt as m};
|
|
2
|
+
//# sourceMappingURL=chunk-IICXZUIB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-VK7RNXUO.js";import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-VK7RNXUO.js";import{a as s}from"./chunk-UCIIRQUE.js";import*as e from"react";import{Toggle as d}from"radix-ui";var B=e.forwardRef(({pressed:a,onPressedChange:u,defaultPressed:p,children:t,...l},f)=>{let{"aria-label":r,"aria-labelledby":o,iconOnly:c}=l,n=e.useRef(null);e.useEffect(()=>{n.current=null},[o]);let i=e.useCallback(()=>r||(o?(n.current===null&&(n.current=document.getElementById(o)?.textContent||"Toggle button"),n.current):typeof t=="string"?t:e.isValidElement(t)&&typeof t.props?.children=="string"?t.props.children:"Toggle button"),[r,o,t]),{handlePressedChange:m}=g({pressed:a,onPressedChange:u,getAccessibleName:i,componentName:c?"ToggleIconButton":"ToggleButton"});return e.createElement(d.Root,{pressed:a,onPressedChange:m,defaultPressed:p,asChild:!0},e.createElement(s,{...l,ref:f},t))});B.displayName="ToggleButton";export{B as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KDYHYQ4D.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/toggle-button.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Toggle } from 'radix-ui';\nimport { Button } from './button.js';\nimport { useToggleState } from '../hooks/use-toggle-state.js';\n\n/**\n * ToggleButton props that extend Button with toggle-specific functionality\n *\n * The ToggleButton component provides a button that can be pressed/unpressed\n * with proper accessibility announcements and state management.\n */\ntype ToggleButtonProps = React.ComponentPropsWithoutRef<typeof Button> & {\n /** Controlled pressed state */\n pressed?: boolean;\n /** Callback when pressed state changes */\n onPressedChange?: (pressed: boolean) => void;\n /** Default pressed state for uncontrolled usage */\n defaultPressed?: boolean;\n};\n\ntype ToggleButtonElement = React.ElementRef<typeof Button>;\n\n/**\n * ToggleButton component for buttons that can be pressed/unpressed\n *\n * The ToggleButton component extends Button with toggle functionality using\n * Radix UI's Toggle primitive. It provides proper accessibility announcements,\n * controlled/uncontrolled state management, and seamless integration with\n * the existing Button component.\n *\n * Key features:\n * - Controlled and uncontrolled state management\n * - Live accessibility announcements for screen readers\n * - Automatic state validation and warnings\n * - Seamless integration with Button props and styling\n * - Proper ARIA attributes for toggle functionality\n *\n * @example\n * ```tsx\n * // Uncontrolled toggle button\n * <ToggleButton defaultPressed={false}>\n * Toggle Me\n * </ToggleButton>\n *\n * // Controlled toggle button\n * const [pressed, setPressed] = React.useState(false);\n * <ToggleButton\n * pressed={pressed}\n * onPressedChange={setPressed}\n * >\n * {pressed ? 'On' : 'Off'}\n * </ToggleButton>\n *\n * // Toggle button with all Button props\n * <ToggleButton\n * variant=\"solid\"\n * size=\"3\"\n * color=\"blue\"\n * pressed={isActive}\n * onPressedChange={setIsActive}\n * >\n * {isActive ? 'Active' : 'Inactive'}\n * </ToggleButton>\n * ```\n */\nconst ToggleButton = React.forwardRef<ToggleButtonElement, ToggleButtonProps>(({ pressed, onPressedChange, defaultPressed, children, ...buttonProps }, forwardedRef) => {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, iconOnly } = buttonProps;\n\n // The label behind aria-labelledby is read once per id, not on every press.\n const cachedLabelRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n cachedLabelRef.current = null;\n }, [ariaLabelledBy]);\n\n /**\n * The name announced when the pressed state changes: aria-label, then the label\n * aria-labelledby points at, then visible text.\n */\n const getAccessibleName = React.useCallback(() => {\n if (ariaLabel) return ariaLabel;\n if (ariaLabelledBy) {\n if (cachedLabelRef.current === null) {\n cachedLabelRef.current = document.getElementById(ariaLabelledBy)?.textContent || 'Toggle button';\n }\n return cachedLabelRef.current;\n }\n if (typeof children === 'string') return children;\n if (React.isValidElement(children) && typeof (children.props as any)?.children === 'string') {\n return (children.props as any).children;\n }\n return 'Toggle button';\n }, [ariaLabel, ariaLabelledBy, children]);\n\n // Use shared toggle state hook for accessibility announcements and warnings\n const { handlePressedChange } = useToggleState({\n pressed,\n onPressedChange,\n getAccessibleName,\n componentName: iconOnly ? 'ToggleIconButton' : 'ToggleButton',\n });\n\n // Render the toggle button using Radix UI's Toggle primitive\n // This provides proper ARIA attributes and keyboard navigation\n return (\n <Toggle.Root pressed={pressed} onPressedChange={handlePressedChange} defaultPressed={defaultPressed} asChild>\n <Button {...buttonProps} ref={forwardedRef}>\n {children}\n </Button>\n </Toggle.Root>\n );\n});\nToggleButton.displayName = 'ToggleButton';\n\nexport { ToggleButton };\nexport type { ToggleButtonProps };\n"],
|
|
5
|
+
"mappings": "gFAAA,UAAYA,MAAW,QACvB,OAAS,UAAAC,MAAc,WAgEvB,IAAMC,EAAqB,aAAmD,CAAC,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,eAAAC,EAAgB,SAAAC,EAAU,GAAGC,CAAY,EAAGC,IAAiB,CACtK,GAAM,CAAE,aAAcC,EAAW,kBAAmBC,EAAgB,SAAAC,CAAS,EAAIJ,EAG3EK,EAAuB,SAAsB,IAAI,EACjD,YAAU,IAAM,CACpBA,EAAe,QAAU,IAC3B,EAAG,CAACF,CAAc,CAAC,EAMnB,IAAMG,EAA0B,cAAY,IACtCJ,IACAC,GACEE,EAAe,UAAY,OAC7BA,EAAe,QAAU,SAAS,eAAeF,CAAc,GAAG,aAAe,iBAE5EE,EAAe,SAEpB,OAAON,GAAa,SAAiBA,EAC/B,iBAAeA,CAAQ,GAAK,OAAQA,EAAS,OAAe,UAAa,SACzEA,EAAS,MAAc,SAE1B,iBACN,CAACG,EAAWC,EAAgBJ,CAAQ,CAAC,EAGlC,CAAE,oBAAAQ,CAAoB,EAAIC,EAAe,CAC7C,QAAAZ,EACA,gBAAAC,EACA,kBAAAS,EACA,cAAeF,EAAW,mBAAqB,cACjD,CAAC,EAID,OACE,gBAACK,EAAO,KAAP,CAAY,QAASb,EAAS,gBAAiBW,EAAqB,eAAgBT,EAAgB,QAAO,IAC1G,gBAACY,EAAA,CAAQ,GAAGV,EAAa,IAAKC,GAC3BF,CACH,CACF,CAEJ,CAAC,EACDJ,EAAa,YAAc",
|
|
6
|
+
"names": ["React", "Toggle", "ToggleButton", "pressed", "onPressedChange", "defaultPressed", "children", "buttonProps", "forwardedRef", "ariaLabel", "ariaLabelledBy", "iconOnly", "cachedLabelRef", "getAccessibleName", "handlePressedChange", "useToggleState", "Toggle", "Button"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d}from"./chunk-YEYM7QQZ.js";import{a as m}from"./chunk-5BWLY27A.js";import{a as v}from"./chunk-OS3FCYZY.js";var C={};v(C,{Button:()=>P,Content:()=>f,Item:()=>g,Root:()=>u,Viewport:()=>S,useMessageScroller:()=>y,useMessageScrollerScrollable:()=>w,useMessageScrollerVisibility:()=>B});import*as e from"react";import c from"classnames";import{MessageScroller as l,useMessageScroller as y,useMessageScrollerScrollable as w,useMessageScrollerVisibility as B}from"@shadcn/react/message-scroller";import{useComposedRefs as h}from"radix-ui/internal";var u=e.forwardRef(({autoScroll:o=!0,defaultScrollPosition:t="end",scrollEdgeThreshold:r,scrollMargin:s,className:a,children:n,...i},p)=>e.createElement(l.Provider,{autoScroll:o,defaultScrollPosition:t,...r!=null?{scrollEdgeThreshold:r}:{},...s!=null?{scrollMargin:s}:{}},e.createElement(l.Root,{...i,ref:p,className:c("rt-MessageScrollerRoot",a)},n)));u.displayName="MessageScroller.Root";var S=e.forwardRef(({className:o,"aria-label":t,fade:r=!0,...s},a)=>{let n=m(r),i=h(a,n);return e.createElement(l.Viewport,{"aria-label":t??"",...s,ref:i,"data-fade":r?"":void 0,className:c("rt-MessageScrollerViewport",o)})});S.displayName="MessageScroller.Viewport";var f=e.forwardRef(({className:o,...t},r)=>e.createElement(l.Content,{...t,ref:r,className:c("rt-MessageScrollerContent",o)}));f.displayName="MessageScroller.Content";var g=e.forwardRef(({className:o,...t},r)=>e.createElement(l.Item,{...t,ref:r,className:c("rt-MessageScrollerItem",o)}));g.displayName="MessageScroller.Item";var P=e.forwardRef(({direction:o="end",behavior:t,className:r,children:s,size:a="2",variant:n="surface",color:i="gray",radius:p="full","aria-label":M,...R},b)=>e.createElement(l.Button,{direction:o,...t?{behavior:t}:{},render:e.createElement(d,{...R,ref:b,size:a,variant:n,color:i,radius:p,"aria-label":M??(o==="end"?"Jump to the latest":"Jump to the first"),className:c("rt-MessageScrollerButton",r),"data-direction":o},s??e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:o==="start"?{transform:"rotate(180deg)"}:void 0},e.createElement("path",{d:"M7.5 2.5v10M3.5 8.5l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))}));P.displayName="MessageScroller.Button";export{y as a,w as b,B as c,u as d,S as e,f,g,P as h,C as i};
|
|
2
|
+
//# sourceMappingURL=chunk-RJTWRLK4.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as g}from"./chunk-2N2AQNJH.js";import{a as v}from"./chunk-HIBX2EXV.js";import{a as B}from"./chunk-BKES3M4Y.js";import*as r from"react";import T from"classnames";var N={loud:"solid",medium:"raised",quiet:"ghost"};function $(a){if(a["aria-label"]||a["aria-labelledby"]||a.children)return;console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
|
|
2
|
+
- aria-label prop with descriptive text
|
|
3
|
+
- aria-labelledby prop referencing a label element
|
|
4
|
+
- or visible text children`)}var I=r.forwardRef(({className:a,style:s,tooltip:c,tooltipSide:y="top",tooltipAlign:h="center",tooltipDelayDuration:R,tooltipDisableHoverableContent:O,overrideStyles:e,iconOnly:p=!1,emphasis:u,variant:f,...l},S)=>{let{tooltipId:P,hasTooltip:w,accessibilityProps:E}=g(c),d=r.useMemo(()=>{if(!e)return;let m={},o=(n,t)=>{t!==void 0&&(m[n]=t)},i=(n,t)=>{t&&(o(`--button-override-${n}color`,t.color),o(`--button-override-${n}background`,t.background),o(`--button-override-${n}background-color`,t.backgroundColor),o(`--button-override-${n}box-shadow`,t.boxShadow),o(`--button-override-${n}filter`,t.filter),o(`--button-override-${n}outline`,t.outline),o(`--button-override-${n}outline-offset`,t.outlineOffset),o(`--button-override-${n}opacity`,t.opacity))};return i("",e.normal),i("hover-",e.hover),i("active-",e.active),i("pressed-",e.pressed),i("open-",e.open),i("disabled-",e.disabled),e.focus&&(o("--button-override-focus-outline",e.focus.outline),o("--button-override-focus-outline-offset",e.focus.outlineOffset)),m},[e]),C=r.useMemo(()=>d?{...d,...s}:s,[d,s]);if(p&&($(l),l.fullWidth&&void 0),u!==void 0&&f!==void 0)throw new Error("Button: pass `emphasis` or `variant`, not both. They set the same thing.");let k=u!==void 0?N[u]:f,b=r.createElement(B,{...l,variant:k,...E,ref:S,className:T(p?"rt-IconButton":"rt-Button",a),style:C});return w?r.createElement(v,{content:c,side:y,align:h,delayDuration:R,disableHoverableContent:O,id:P},b):b});I.displayName="Button";export{I as a};
|
|
5
|
+
//# sourceMappingURL=chunk-UCIIRQUE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/button.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport { Tooltip } from './tooltip.js';\nimport { useTooltipWrapper } from '../hooks/use-tooltip-wrapper.js';\nimport { warnDeprecated } from '../helpers/warn-deprecated.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\n/**\n * Styles that can be overridden for a particular interaction state\n */\ninterface ButtonOverrideStateStyles {\n color?: string;\n background?: string;\n backgroundColor?: string;\n boxShadow?: string;\n filter?: string;\n outline?: string;\n outlineOffset?: string;\n opacity?: string | number;\n}\n\n/**\n * Full set of override styles keyed by interaction state\n */\ninterface ButtonOverrideStyles {\n /** Default/idle state styles */\n normal?: ButtonOverrideStateStyles;\n /** Hover state styles */\n hover?: ButtonOverrideStateStyles;\n /** Active (mouse down) state styles */\n active?: ButtonOverrideStateStyles;\n /** Toggle pressed state styles (data-state=\"on\") */\n pressed?: ButtonOverrideStateStyles;\n /** Open state styles (e.g., when used as a trigger) */\n open?: ButtonOverrideStateStyles;\n /** Disabled state styles */\n disabled?: ButtonOverrideStateStyles;\n /** Focus-visible outline styles */\n focus?: Pick<ButtonOverrideStateStyles, 'outline' | 'outlineOffset'>;\n}\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n/**\n * Tooltip configuration props that can be passed to Button\n * These props are forwarded to the underlying Tooltip component\n */\nexport interface ButtonTooltipProps {\n /** Content to display in the tooltip on hover/focus */\n tooltip?: React.ReactNode;\n /** Side of the button where the tooltip should appear */\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n /** Alignment of the tooltip relative to the button */\n tooltipAlign?: 'start' | 'center' | 'end';\n /** Delay before showing the tooltip (in milliseconds) */\n tooltipDelayDuration?: number;\n /** Whether to disable hoverable content behavior */\n tooltipDisableHoverableContent?: boolean;\n}\n\n/**\n * Core Button props excluding the 'as' prop for polymorphic behavior\n * Combines BaseButton props with tooltip functionality\n */\ntype ButtonEmphasis = 'loud' | 'medium' | 'quiet';\n\n/** `emphasis` is a button's rank: loud is `solid`, medium is `raised`, quiet is `ghost`. */\nconst EMPHASIS_VARIANT = { loud: 'solid', medium: 'raised', quiet: 'ghost' } as const;\n\n/**\n * A button states its rank with `emphasis` or its look with `variant`, never both.\n */\ntype ButtonRankProps =\n | {\n /** The button's look. `outline` and `surface` have no emphasis of their own. */\n variant?: BaseButtonProps['variant'];\n emphasis?: never;\n }\n | {\n /** The button's rank: `loud` (solid), `medium` (raised, the default) or `quiet` (ghost). */\n emphasis?: ButtonEmphasis;\n variant?: never;\n };\n\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as' | 'variant'> &\n ButtonRankProps &\n ButtonTooltipProps & {\n /**\n * When using variant=\"override\", provide token-based styles per state.\n * We propagate these into CSS variables consumed by the override variant.\n */\n overrideStyles?: ButtonOverrideStyles;\n /**\n * A square button holding only an icon. It needs an accessible name: `aria-label`,\n * `aria-labelledby`, or visible text. `IconButton` is this button with `iconOnly` set.\n */\n iconOnly?: boolean;\n };\n\n/**\n * Polymorphic Button props that support rendering as different HTML elements\n * @template C - The element type to render as (defaults to 'button')\n */\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\n/**\n * Button component type that supports polymorphic rendering\n * @template C - The element type to render as\n */\ntype ButtonComponent = <C extends React.ElementType = 'button'>(props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> }) => React.ReactElement | null;\n\n/**\n * An icon-only button must have an accessible name. Throws in development, logs otherwise.\n */\nfunction validateIconButtonName(props: Record<string, unknown>) {\n if (props['aria-label'] || props['aria-labelledby'] || props.children) return;\n const errorMessage =\n 'IconButton: Icon buttons must have an accessible name. Please provide either:' +\n '\\n- aria-label prop with descriptive text' +\n '\\n- aria-labelledby prop referencing a label element' +\n '\\n- or visible text children';\n if (process.env.NODE_ENV === 'development') throw new Error(errorMessage);\n console.error(errorMessage);\n}\n\n/**\n * Button component for triggering actions throughout your interface\n *\n * The Button component is the primary interactive element in the Kookie User Interface.\n * It provides six visual variants, four sizes, comprehensive color options, and built-in\n * tooltip support. The component automatically handles icon sizing, supports responsive\n * layouts, and provides accessibility compliance out of the box.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // Button with variant and size\n * <Button variant=\"solid\" size=\"3\">Primary Action</Button>\n *\n * // Button with tooltip\n * <Button tooltip=\"Save your progress\">Save</Button>\n *\n * // Polymorphic button as link\n * <Button as=\"a\" href=\"/dashboard\">Go to Dashboard</Button>\n * ```\n */\nconst Button = React.forwardRef(\n (\n {\n className,\n style,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n overrideStyles,\n iconOnly = false,\n emphasis,\n variant,\n ...props\n }: ButtonProps,\n forwardedRef: React.ForwardedRef<ButtonElement>,\n ) => {\n // Use shared tooltip wrapper hook for accessibility props\n const { tooltipId, hasTooltip, accessibilityProps: tooltipAccessibilityProps } = useTooltipWrapper(tooltip);\n\n // Create the base button element with tooltip accessibility props\n // Map overrideStyles to CSS variables consumed by the override variant rules\n const overrideVars = React.useMemo(() => {\n if (!overrideStyles) return undefined;\n const vars: Record<string, string | number> = {};\n const setVar = (key: string, value: string | number | undefined) => {\n if (value !== undefined) vars[key] = value;\n };\n const apply = (prefix: string, s?: ButtonOverrideStateStyles) => {\n if (!s) return;\n setVar(`--button-override-${prefix}color`, s.color);\n setVar(`--button-override-${prefix}background`, s.background);\n setVar(`--button-override-${prefix}background-color`, s.backgroundColor);\n setVar(`--button-override-${prefix}box-shadow`, s.boxShadow);\n setVar(`--button-override-${prefix}filter`, s.filter);\n setVar(`--button-override-${prefix}outline`, s.outline);\n setVar(`--button-override-${prefix}outline-offset`, s.outlineOffset);\n setVar(`--button-override-${prefix}opacity`, s.opacity);\n };\n\n apply('', overrideStyles.normal);\n apply('hover-', overrideStyles.hover);\n apply('active-', overrideStyles.active);\n apply('pressed-', overrideStyles.pressed);\n apply('open-', overrideStyles.open);\n apply('disabled-', overrideStyles.disabled);\n\n if (overrideStyles.focus) {\n setVar('--button-override-focus-outline', overrideStyles.focus.outline);\n setVar('--button-override-focus-outline-offset', overrideStyles.focus.outlineOffset);\n }\n\n return vars as React.CSSProperties;\n }, [overrideStyles]);\n\n // Combine override styles with user-provided styles\n const combinedStyle = React.useMemo(() => (overrideVars ? { ...overrideVars, ...style } : style), [overrideVars, style]);\n\n if (iconOnly) {\n validateIconButtonName(props);\n if (props.fullWidth) {\n warnDeprecated('`fullWidth` on an icon-only button is deprecated and will be removed in 0.15.0. An icon button is square.');\n }\n }\n\n if (emphasis !== undefined && variant !== undefined) {\n throw new Error('Button: pass `emphasis` or `variant`, not both. They set the same thing.');\n }\n const resolvedVariant = emphasis !== undefined ? EMPHASIS_VARIANT[emphasis] : variant;\n\n const button = (\n <BaseButton\n {...props}\n variant={resolvedVariant}\n {...tooltipAccessibilityProps}\n ref={forwardedRef}\n className={classNames(iconOnly ? 'rt-IconButton' : 'rt-Button', className)}\n style={combinedStyle}\n />\n );\n\n // If no tooltip is provided, return the button as-is for better performance\n if (!hasTooltip) {\n return button;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n // This creates a compound component that handles both button and tooltip functionality\n return (\n <Tooltip content={tooltip} side={tooltipSide} align={tooltipAlign} delayDuration={tooltipDelayDuration} disableHoverableContent={tooltipDisableHoverableContent} id={tooltipId}>\n {button}\n </Tooltip>\n );\n },\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps, ButtonEmphasis, ButtonOverrideStyles, ButtonOverrideStateStyles };\n"],
|
|
5
|
+
"mappings": "wHAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAoEvB,IAAMC,EAAmB,CAAE,KAAM,QAAS,OAAQ,SAAU,MAAO,OAAQ,EAkD3E,SAASC,EAAuBC,EAAgC,CAC9D,GAAIA,EAAM,YAAY,GAAKA,EAAM,iBAAiB,GAAKA,EAAM,SAAU,OAOvE,QAAQ,MALN;AAAA;AAAA;AAAA,2BAKwB,CAC5B,CAyBA,IAAMC,EAAe,aACnB,CACE,CACE,UAAAC,EACA,MAAAC,EACA,QAAAC,EACA,YAAAC,EAAc,MACd,aAAAC,EAAe,SACf,qBAAAC,EACA,+BAAAC,EACA,eAAAC,EACA,SAAAC,EAAW,GACX,SAAAC,EACA,QAAAC,EACA,GAAGZ,CACL,EACAa,IACG,CAEH,GAAM,CAAE,UAAAC,EAAW,WAAAC,EAAY,mBAAoBC,CAA0B,EAAIC,EAAkBb,CAAO,EAIpGc,EAAqB,UAAQ,IAAM,CACvC,GAAI,CAACT,EAAgB,OACrB,IAAMU,EAAwC,CAAC,EACzCC,EAAS,CAACC,EAAaC,IAAuC,CAC9DA,IAAU,SAAWH,EAAKE,CAAG,EAAIC,EACvC,EACMC,EAAQ,CAACC,EAAgBC,IAAkC,CAC1DA,IACLL,EAAO,qBAAqBI,CAAM,QAASC,EAAE,KAAK,EAClDL,EAAO,qBAAqBI,CAAM,aAAcC,EAAE,UAAU,EAC5DL,EAAO,qBAAqBI,CAAM,mBAAoBC,EAAE,eAAe,EACvEL,EAAO,qBAAqBI,CAAM,aAAcC,EAAE,SAAS,EAC3DL,EAAO,qBAAqBI,CAAM,SAAUC,EAAE,MAAM,EACpDL,EAAO,qBAAqBI,CAAM,UAAWC,EAAE,OAAO,EACtDL,EAAO,qBAAqBI,CAAM,iBAAkBC,EAAE,aAAa,EACnEL,EAAO,qBAAqBI,CAAM,UAAWC,EAAE,OAAO,EACxD,EAEA,OAAAF,EAAM,GAAId,EAAe,MAAM,EAC/Bc,EAAM,SAAUd,EAAe,KAAK,EACpCc,EAAM,UAAWd,EAAe,MAAM,EACtCc,EAAM,WAAYd,EAAe,OAAO,EACxCc,EAAM,QAASd,EAAe,IAAI,EAClCc,EAAM,YAAad,EAAe,QAAQ,EAEtCA,EAAe,QACjBW,EAAO,kCAAmCX,EAAe,MAAM,OAAO,EACtEW,EAAO,yCAA0CX,EAAe,MAAM,aAAa,GAG9EU,CACT,EAAG,CAACV,CAAc,CAAC,EAGbiB,EAAsB,UAAQ,IAAOR,EAAe,CAAE,GAAGA,EAAc,GAAGf,CAAM,EAAIA,EAAQ,CAACe,EAAcf,CAAK,CAAC,EASvH,GAPIO,IACFX,EAAuBC,CAAK,EACxBA,EAAM,WACR,QAIAW,IAAa,QAAaC,IAAY,OACxC,MAAM,IAAI,MAAM,0EAA0E,EAE5F,IAAMe,EAAkBhB,IAAa,OAAYb,EAAiBa,CAAQ,EAAIC,EAExEgB,EACJ,gBAACC,EAAA,CACE,GAAG7B,EACJ,QAAS2B,EACR,GAAGX,EACJ,IAAKH,EACL,UAAWiB,EAAWpB,EAAW,gBAAkB,YAAaR,CAAS,EACzE,MAAOwB,EACT,EAIF,OAAKX,EAOH,gBAACgB,EAAA,CAAQ,QAAS3B,EAAS,KAAMC,EAAa,MAAOC,EAAc,cAAeC,EAAsB,wBAAyBC,EAAgC,GAAIM,GAClKc,CACH,EAROA,CAUX,CACF,EAEA3B,EAAO,YAAc",
|
|
6
|
+
"names": ["React", "classNames", "EMPHASIS_VARIANT", "validateIconButtonName", "props", "Button", "className", "style", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "overrideStyles", "iconOnly", "emphasis", "variant", "forwardedRef", "tooltipId", "hasTooltip", "tooltipAccessibilityProps", "useTooltipWrapper", "overrideVars", "vars", "setVar", "key", "value", "apply", "prefix", "s", "combinedStyle", "resolvedVariant", "button", "BaseButton", "classNames", "Tooltip"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-UCIIRQUE.js";import*as t from"react";var a=t.forwardRef((e,n)=>t.createElement(o,{...e,iconOnly:!0,ref:n}));a.displayName="IconButton";export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-YEYM7QQZ.js.map
|
|
@@ -38,7 +38,7 @@ type ButtonElement = React.ElementRef<typeof BaseButton>;
|
|
|
38
38
|
* Tooltip configuration props that can be passed to Button
|
|
39
39
|
* These props are forwarded to the underlying Tooltip component
|
|
40
40
|
*/
|
|
41
|
-
interface ButtonTooltipProps {
|
|
41
|
+
export interface ButtonTooltipProps {
|
|
42
42
|
/** Content to display in the tooltip on hover/focus */
|
|
43
43
|
tooltip?: React.ReactNode;
|
|
44
44
|
/** Side of the button where the tooltip should appear */
|
|
@@ -54,7 +54,20 @@ interface ButtonTooltipProps {
|
|
|
54
54
|
* Core Button props excluding the 'as' prop for polymorphic behavior
|
|
55
55
|
* Combines BaseButton props with tooltip functionality
|
|
56
56
|
*/
|
|
57
|
-
type
|
|
57
|
+
type ButtonEmphasis = 'loud' | 'medium' | 'quiet';
|
|
58
|
+
/**
|
|
59
|
+
* A button states its rank with `emphasis` or its look with `variant`, never both.
|
|
60
|
+
*/
|
|
61
|
+
type ButtonRankProps = {
|
|
62
|
+
/** The button's look. `outline` and `surface` have no emphasis of their own. */
|
|
63
|
+
variant?: BaseButtonProps['variant'];
|
|
64
|
+
emphasis?: never;
|
|
65
|
+
} | {
|
|
66
|
+
/** The button's rank: `loud` (solid), `medium` (raised, the default) or `quiet` (ghost). */
|
|
67
|
+
emphasis?: ButtonEmphasis;
|
|
68
|
+
variant?: never;
|
|
69
|
+
};
|
|
70
|
+
type ButtonOwnProps = Omit<BaseButtonProps, 'as' | 'variant'> & ButtonRankProps & ButtonTooltipProps & {
|
|
58
71
|
/**
|
|
59
72
|
* When using variant="override", provide token-based styles per state.
|
|
60
73
|
* We propagate these into CSS variables consumed by the override variant.
|
|
@@ -108,5 +121,5 @@ declare const Button: ButtonComponent & {
|
|
|
108
121
|
displayName?: string;
|
|
109
122
|
};
|
|
110
123
|
export { Button };
|
|
111
|
-
export type { ButtonProps, ButtonOverrideStyles, ButtonOverrideStateStyles };
|
|
124
|
+
export type { ButtonProps, ButtonEmphasis, ButtonOverrideStyles, ButtonOverrideStateStyles };
|
|
112
125
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;GAEG;AACH,UAAU,yBAAyB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,UAAU,oBAAoB;IAC5B,gCAAgC;IAChC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,yBAAyB;IACzB,KAAK,CAAC,EAAE,yBAAyB,CAAC;IAClC,uCAAuC;IACvC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,oDAAoD;IACpD,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,uDAAuD;IACvD,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,mCAAmC;IACnC,KAAK,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,eAAe,CAAC,CAAC;CACtE;AAED,KAAK,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzD;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;GAEG;AACH,UAAU,yBAAyB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,UAAU,oBAAoB;IAC5B,gCAAgC;IAChC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,yBAAyB;IACzB,KAAK,CAAC,EAAE,yBAAyB,CAAC;IAClC,uCAAuC;IACvC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,oDAAoD;IACpD,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,uDAAuD;IACvD,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,mCAAmC;IACnC,KAAK,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,eAAe,CAAC,CAAC;CACtE;AAED,KAAK,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yDAAyD;IACzD,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,sDAAsD;IACtD,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC1C,yDAAyD;IACzD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oDAAoD;IACpD,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED;;;GAGG;AACH,KAAK,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAKlD;;GAEG;AACH,KAAK,eAAe,GAChB;IACE,gFAAgF;IAChF,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,GACD;IACE,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEN,KAAK,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,SAAS,CAAC,GAC3D,eAAe,GACf,kBAAkB,GAAG;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ;;;GAGG;AACH,KAAK,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,cAAc,GAAG;IAC1E,0DAA0D;IAC1D,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,cAAc,CAAC,CAAC;AAElE;;;GAGG;AACH,KAAK,eAAe,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;CAAE,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAgBlK;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,MAAM,EA+FP,eAAe,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-UCIIRQUE.js";import"../chunk-2N2AQNJH.js";import"../chunk-HIBX2EXV.js";import"../chunk-BPVVFHYD.js";import"../chunk-KJTEZVOF.js";import"../chunk-3HGHPAH4.js";import"../chunk-G2CKYO2I.js";import"../chunk-AXUDFYLY.js";import"../chunk-KNQBAOMV.js";import"../chunk-FD2TR343.js";import"../chunk-ZWZGUBL4.js";import"../chunk-WYADYDPN.js";import"../chunk-ZE2KAVXW.js";import"../chunk-FISGGGPC.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-7YIQV7VO.js";import"../chunk-BKES3M4Y.js";import"../chunk-PAEHH3WS.js";import"../chunk-3KB2XWBE.js";import"../chunk-AGAQC4HH.js";import"../chunk-5T6K7VPP.js";import"../chunk-PXUQEA77.js";import"../chunk-SMGDH54W.js";import"../chunk-SNR5VFWG.js";import"../chunk-FWB47YCH.js";import"../chunk-K53W3ELO.js";import"../chunk-TTFUM47A.js";import"../chunk-VX44UTQ5.js";import"../chunk-ERGJN7FJ.js";import"../chunk-5TXQLK4G.js";import"../chunk-E7LJHM3S.js";import"../chunk-KRJTW535.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-GSTOGDAJ.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-AVFGMLL4.js";import"../chunk-YIK4ACXS.js";import"../chunk-Z4DTHR2S.js";import"../chunk-OS3FCYZY.js";export{a as Button};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"../chunk-IICXZUIB.js";import"../chunk-BJ2Q2WVV.js";import"../chunk-YEYM7QQZ.js";import"../chunk-IX5HIHVI.js";import"../chunk-UCIIRQUE.js";import"../chunk-2N2AQNJH.js";import"../chunk-HIBX2EXV.js";import"../chunk-BPVVFHYD.js";import"../chunk-KJTEZVOF.js";import"../chunk-3HGHPAH4.js";import"../chunk-G2CKYO2I.js";import"../chunk-AXUDFYLY.js";import"../chunk-KNQBAOMV.js";import"../chunk-FD2TR343.js";import"../chunk-ZWZGUBL4.js";import"../chunk-WYADYDPN.js";import"../chunk-ZE2KAVXW.js";import"../chunk-FISGGGPC.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-7YIQV7VO.js";import"../chunk-GONBMSRL.js";import"../chunk-5GXFBLBJ.js";import"../chunk-UBOOUDS4.js";import"../chunk-XPRPYCII.js";import"../chunk-5BWLY27A.js";import"../chunk-PS6NEG5A.js";import"../chunk-BKES3M4Y.js";import"../chunk-PAEHH3WS.js";import"../chunk-3KB2XWBE.js";import"../chunk-AGAQC4HH.js";import"../chunk-5T6K7VPP.js";import"../chunk-PXUQEA77.js";import"../chunk-SMGDH54W.js";import"../chunk-SNR5VFWG.js";import"../chunk-FWB47YCH.js";import"../chunk-K53W3ELO.js";import"../chunk-TTFUM47A.js";import"../chunk-VX44UTQ5.js";import"../chunk-ERGJN7FJ.js";import"../chunk-5TXQLK4G.js";import"../chunk-E7LJHM3S.js";import"../chunk-KRJTW535.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-GSTOGDAJ.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-AVFGMLL4.js";import"../chunk-YIK4ACXS.js";import"../chunk-Z4DTHR2S.js";import"../chunk-OS3FCYZY.js";export{h as AttachTrigger,f as Attachment,e as AttachmentsRow,d as InlineEnd,c as InlineStart,g as Item,a as Root,i as Row,k as RowEnd,j as RowStart,l as Send,b as Textarea};
|
|
2
2
|
//# sourceMappingURL=chatbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-YEYM7QQZ.js";import"../chunk-UCIIRQUE.js";import"../chunk-2N2AQNJH.js";import"../chunk-HIBX2EXV.js";import"../chunk-BPVVFHYD.js";import"../chunk-KJTEZVOF.js";import"../chunk-3HGHPAH4.js";import"../chunk-G2CKYO2I.js";import"../chunk-AXUDFYLY.js";import"../chunk-KNQBAOMV.js";import"../chunk-FD2TR343.js";import"../chunk-ZWZGUBL4.js";import"../chunk-WYADYDPN.js";import"../chunk-ZE2KAVXW.js";import"../chunk-FISGGGPC.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-7YIQV7VO.js";import"../chunk-BKES3M4Y.js";import"../chunk-PAEHH3WS.js";import"../chunk-3KB2XWBE.js";import"../chunk-AGAQC4HH.js";import"../chunk-5T6K7VPP.js";import"../chunk-PXUQEA77.js";import"../chunk-SMGDH54W.js";import"../chunk-SNR5VFWG.js";import"../chunk-FWB47YCH.js";import"../chunk-K53W3ELO.js";import"../chunk-TTFUM47A.js";import"../chunk-VX44UTQ5.js";import"../chunk-ERGJN7FJ.js";import"../chunk-5TXQLK4G.js";import"../chunk-E7LJHM3S.js";import"../chunk-KRJTW535.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-GSTOGDAJ.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-AVFGMLL4.js";import"../chunk-YIK4ACXS.js";import"../chunk-Z4DTHR2S.js";import"../chunk-OS3FCYZY.js";export{a as IconButton};
|
|
2
2
|
//# sourceMappingURL=icon-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-C7EVYSWK.js";import{a as va}from"../chunk-
|
|
1
|
+
import"../chunk-C7EVYSWK.js";import{a as va}from"../chunk-DAGHSWME.js";import{a as ua}from"../chunk-KDYHYQ4D.js";import"../chunk-VK7RNXUO.js";import"../chunk-EE54S7YV.js";import{b as wa,c as xa,d as ya,e as za,f as Aa}from"../chunk-522UYMDA.js";import"../chunk-ZUOK3KFY.js";import{a as Ba}from"../chunk-3M73GWN5.js";import"../chunk-ZVIWTYHE.js";import{a as qa}from"../chunk-ROGC7K5N.js";import{c as ra}from"../chunk-CL6P54QT.js";import"../chunk-GRRV4I2I.js";import{a as sa,b as ta}from"../chunk-66GLO2EG.js";import{a as ma}from"../chunk-VBAXORVV.js";import{c as na}from"../chunk-UE2OBZIS.js";import"../chunk-AUV6B4AH.js";import{h as oa}from"../chunk-RUPET4E7.js";import"../chunk-BALS3AVM.js";import{e as pa}from"../chunk-SIBSXKFF.js";import"../chunk-TZTUPQYK.js";import"../chunk-OVGPUFRI.js";import{a as ka}from"../chunk-HJLBVNQE.js";import"../chunk-5G4WWJ4Z.js";import{a as la}from"../chunk-43A5GUSI.js";import"../chunk-XI5YXUCK.js";import"../chunk-3WCSLQNH.js";import{h as Da}from"../chunk-UTHTSYSL.js";import"../chunk-ADXZNG4F.js";import"../chunk-2EQWBT2S.js";import{p as Ca}from"../chunk-OUSDYZDE.js";import"../chunk-KJC32RWT.js";import{a as ha}from"../chunk-KXSMY4ZF.js";import{c as ga}from"../chunk-IHRLGR6J.js";import"../chunk-VJUFYYKP.js";import{h as ia}from"../chunk-SURYYF7I.js";import"../chunk-PLTTQFRQ.js";import{a as ja}from"../chunk-K7BWSYVP.js";import"../chunk-UBWRIE4C.js";import{g as Ea}from"../chunk-45AMHIBO.js";import"../chunk-NIX6Z3JG.js";import{c as ca}from"../chunk-IY3GKGDZ.js";import{c as da}from"../chunk-CIKDGYX3.js";import"../chunk-2DKLJMUU.js";import{a as ea}from"../chunk-4JNHUPIM.js";import"../chunk-STPMPY3X.js";import{a as fa}from"../chunk-FHEHX7CE.js";import{a as $}from"../chunk-XEZXKPLE.js";import{a as aa}from"../chunk-RUOOCYK4.js";import"../chunk-CMEKH4I5.js";import{a as ba}from"../chunk-GLERJXVS.js";import"../chunk-MCQCG6AS.js";import"../chunk-FNB47XDO.js";import{a as Z}from"../chunk-O2WPAUQN.js";import"../chunk-ZK55O7TN.js";import{i as Fa}from"../chunk-RJTWRLK4.js";import{e as _}from"../chunk-R2MQMCND.js";import"../chunk-7ZOGH5NT.js";import{a as X}from"../chunk-VUKTURU4.js";import{a as W}from"../chunk-IVBKTHDM.js";import"../chunk-IBF5U4QW.js";import"../chunk-L6UXAITB.js";import"../chunk-GFOSP3PZ.js";import{a as Y}from"../chunk-N6Q3L64W.js";import"../chunk-JAMLW534.js";import{d as V}from"../chunk-34UMKY2L.js";import"../chunk-VJSZG35J.js";import{e as R}from"../chunk-JXVUTFQN.js";import"../chunk-OW4KAIWF.js";import{g as S}from"../chunk-DJA5MCJA.js";import"../chunk-MHANZINI.js";import{o as T}from"../chunk-4WLDX7WZ.js";import"../chunk-WOR3JCLX.js";import{a as U}from"../chunk-7FC7HF76.js";import"../chunk-4JQZUQY7.js";import{a as L}from"../chunk-SGUTNJUO.js";import"../chunk-YBS2IB7Z.js";import{l as N}from"../chunk-V3QVAXH3.js";import{g as M}from"../chunk-3TIO3EMN.js";import"../chunk-WHAKQCNV.js";import"../chunk-27SCVCQY.js";import{a as O}from"../chunk-3UZHKW6I.js";import"../chunk-PPNWGWN3.js";import{n as Q}from"../chunk-H7LHGT44.js";import{a as P}from"../chunk-YLLCCUC7.js";import"../chunk-OA7C34MJ.js";import{m as G}from"../chunk-IICXZUIB.js";import{b as E,c as F}from"../chunk-BJ2Q2WVV.js";import{a as z}from"../chunk-YEYM7QQZ.js";import{c as I}from"../chunk-4BPRLR6C.js";import{a as H}from"../chunk-C7UXUTUF.js";import"../chunk-2C5WLKEZ.js";import"../chunk-HAGKI7NA.js";import{c as J}from"../chunk-ZE2GWHPY.js";import"../chunk-V32EP3S7.js";import"../chunk-YL62I5SI.js";import{a as K}from"../chunk-GLKN32J3.js";import{a as A,b as B,c as C,d as D}from"../chunk-IX5HIHVI.js";import"../chunk-UICSVJ3B.js";import{a as w}from"../chunk-EUSMN3K7.js";import"../chunk-FGORMEAO.js";import{a as x}from"../chunk-UCIIRQUE.js";import"../chunk-2N2AQNJH.js";import{d as y}from"../chunk-5JS7ADWX.js";import"../chunk-O2RISF37.js";import{f as q}from"../chunk-4D5LR4H6.js";import{a as p}from"../chunk-HNO4X33C.js";import"../chunk-CSUEZWN5.js";import{a as r}from"../chunk-Y7LT3F6R.js";import{a as s}from"../chunk-OB3MHLQL.js";import"../chunk-47CEZJM2.js";import{a as u}from"../chunk-S3GZZXQ7.js";import{a as t}from"../chunk-HIBX2EXV.js";import"../chunk-BPVVFHYD.js";import"../chunk-JTN3KTAS.js";import{a as v}from"../chunk-LJXP6K5Y.js";import"../chunk-OJSDBLP7.js";import{a as k}from"../chunk-ERNM3KVF.js";import{f as l}from"../chunk-6JP5PIOO.js";import"../chunk-2T74JEVN.js";import{h as o}from"../chunk-3Q3EOUGJ.js";import"../chunk-MJJ7XDIP.js";import{a as m}from"../chunk-HFVD7W6R.js";import"../chunk-IV4YJRVR.js";import{a as n}from"../chunk-KJTEZVOF.js";import"../chunk-3HGHPAH4.js";import"../chunk-G2CKYO2I.js";import"../chunk-AXUDFYLY.js";import"../chunk-KNQBAOMV.js";import"../chunk-FD2TR343.js";import"../chunk-ZWZGUBL4.js";import"../chunk-WYADYDPN.js";import"../chunk-ZE2KAVXW.js";import"../chunk-XKBLNVOD.js";import"../chunk-GCUGJXI2.js";import"../chunk-SQ4BU4GH.js";import{a as g,b as h,c as i}from"../chunk-FISGGGPC.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-7YIQV7VO.js";import"../chunk-SQZ5O7QS.js";import{a as j}from"../chunk-GONBMSRL.js";import"../chunk-5GXFBLBJ.js";import"../chunk-UBOOUDS4.js";import"../chunk-XPRPYCII.js";import"../chunk-5BWLY27A.js";import"../chunk-PS6NEG5A.js";import"../chunk-ZQVYY7UT.js";import"../chunk-62CJL5G7.js";import"../chunk-3J6AUDID.js";import"../chunk-HCNO7PX6.js";import"../chunk-GMHA5CFH.js";import"../chunk-A2XVR7GL.js";import"../chunk-BZZXXZ3O.js";import"../chunk-2LYX5S7H.js";import"../chunk-HWQ3NTJP.js";import"../chunk-BKES3M4Y.js";import{a as d}from"../chunk-PAEHH3WS.js";import"../chunk-3KB2XWBE.js";import{a as e}from"../chunk-AGAQC4HH.js";import"../chunk-5T6K7VPP.js";import{a as c}from"../chunk-PXUQEA77.js";import"../chunk-SMGDH54W.js";import"../chunk-SNR5VFWG.js";import{b as a,c as b}from"../chunk-FWB47YCH.js";import"../chunk-K53W3ELO.js";import"../chunk-TTFUM47A.js";import"../chunk-VX44UTQ5.js";import"../chunk-ERGJN7FJ.js";import"../chunk-5TXQLK4G.js";import"../chunk-E7LJHM3S.js";import"../chunk-KRJTW535.js";import"../chunk-RON6FXLO.js";import"../chunk-DVSXWSAT.js";import"../chunk-UK3BFTI2.js";import{a as f}from"../chunk-IPHKKZYE.js";import"../chunk-XILM2OMC.js";import"../chunk-3XSB7YIM.js";import"../chunk-YA5DF67M.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-GSTOGDAJ.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-WDNTAQ6G.js";import"../chunk-AVFGMLL4.js";import"../chunk-YIK4ACXS.js";import"../chunk-WTXQB2EV.js";import"../chunk-Z4DTHR2S.js";import"../chunk-JSW6J6RS.js";import"../chunk-OS3FCYZY.js";export{k as AccessibleIcon,l as Accordion,o as AlertDialog,q as AppBar,r as AspectRatio,s as Avatar,u as Badge,v as Blockquote,w as Box,x as Button,y as Callout,p as Card,G as Chatbar,K as Checkbox,I as CheckboxCards,J as CheckboxGroup,C as ChevronDownIcon,L as Code,N as Combobox,F as Confirmation,O as Container,Q as ContextMenu,R as DataList,S as Dialog,T as DropdownMenu,U as Em,c as Flex,H as Grid,m as Heading,V as HoverCard,z as IconButton,X as Image,Y as Inset,f as Kbd,Z as Link,Fa as MessageScroller,_ as Navbar,E as Notice,M as Popover,$ as Portal,aa as Progress,ba as Quote,ea as Radio,ca as RadioCards,da as RadioGroup,fa as Reset,j as ScrollArea,ha as Section,ga as SegmentedControl,ia as Select,ja as Separator,Ea as Sheet,Da as Shell,Ca as Sidebar,W as Skeleton,ka as Slider,a as Slot,b as Slottable,d as Spinner,la as Strong,ma as Switch,na as TabNav,oa as Table,pa as Tabs,n as Text,qa as TextArea,ra as TextField,i as Theme,g as ThemeContext,sa as ThemePanel,ta as ThemePanelContent,B as ThickCheckIcon,D as ThickChevronRightIcon,A as ThickDividerHorizontalIcon,ua as ToggleButton,va as ToggleIconButton,Aa as Toolbar,xa as ToolbarButton,wa as ToolbarGroup,ya as ToolbarSeparator,za as ToolbarTitle,t as Tooltip,Ba as UserCard,P as VirtualMenu,e as VisuallyHidden,h as useThemeContext};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{a,b,c,d,e,f,g,h}from"../chunk-
|
|
1
|
+
"use client";import{a,b,c,d,e,f,g,h}from"../chunk-RJTWRLK4.js";import"../chunk-YEYM7QQZ.js";import"../chunk-UCIIRQUE.js";import"../chunk-2N2AQNJH.js";import"../chunk-HIBX2EXV.js";import"../chunk-BPVVFHYD.js";import"../chunk-KJTEZVOF.js";import"../chunk-3HGHPAH4.js";import"../chunk-G2CKYO2I.js";import"../chunk-AXUDFYLY.js";import"../chunk-KNQBAOMV.js";import"../chunk-FD2TR343.js";import"../chunk-ZWZGUBL4.js";import"../chunk-WYADYDPN.js";import"../chunk-ZE2KAVXW.js";import"../chunk-FISGGGPC.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-7YIQV7VO.js";import"../chunk-5BWLY27A.js";import"../chunk-BKES3M4Y.js";import"../chunk-PAEHH3WS.js";import"../chunk-3KB2XWBE.js";import"../chunk-AGAQC4HH.js";import"../chunk-5T6K7VPP.js";import"../chunk-PXUQEA77.js";import"../chunk-SMGDH54W.js";import"../chunk-SNR5VFWG.js";import"../chunk-FWB47YCH.js";import"../chunk-K53W3ELO.js";import"../chunk-TTFUM47A.js";import"../chunk-VX44UTQ5.js";import"../chunk-ERGJN7FJ.js";import"../chunk-5TXQLK4G.js";import"../chunk-E7LJHM3S.js";import"../chunk-KRJTW535.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-GSTOGDAJ.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-AVFGMLL4.js";import"../chunk-YIK4ACXS.js";import"../chunk-Z4DTHR2S.js";import"../chunk-OS3FCYZY.js";export{h as Button,f as Content,g as Item,d as Root,e as Viewport,a as useMessageScroller,b as useMessageScrollerScrollable,c as useMessageScrollerVisibility};
|
|
2
2
|
//# sourceMappingURL=message-scroller.js.map
|