@stackone/malachite 2.106.0 → 2.108.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/COMPONENTS.md +2 -2
  2. package/dist/ShadowRootWrapper.js +43 -36
  3. package/dist/ShadowRootWrapper.js.map +1 -1
  4. package/dist/components/CodeBlock.js +2 -2
  5. package/dist/components/CodeBlock.js.map +1 -1
  6. package/dist/components/CommandPalette.js +64 -62
  7. package/dist/components/CommandPalette.js.map +1 -1
  8. package/dist/components/MalachiteContext.js +11 -9
  9. package/dist/components/MalachiteContext.js.map +1 -1
  10. package/dist/components/SidePanel.js +145 -126
  11. package/dist/components/SidePanel.js.map +1 -1
  12. package/dist/components/SidePanelTabs.js +32 -0
  13. package/dist/components/SidePanelTabs.js.map +1 -0
  14. package/dist/components/Surface.js +2 -2
  15. package/dist/components/Surface.js.map +1 -1
  16. package/dist/components/TabStrip.js +81 -0
  17. package/dist/components/TabStrip.js.map +1 -0
  18. package/dist/components/Tabs.js +8 -78
  19. package/dist/components/Tabs.js.map +1 -1
  20. package/dist/components/Toolbar.js +2 -2
  21. package/dist/components/Toolbar.js.map +1 -1
  22. package/dist/components/Typography/Text.js +21 -19
  23. package/dist/components/Typography/Text.js.map +1 -1
  24. package/dist/components/sidePanelTabsContext.js +6 -0
  25. package/dist/components/sidePanelTabsContext.js.map +1 -0
  26. package/dist/components/useTabStripAndPanels.js +56 -0
  27. package/dist/components/useTabStripAndPanels.js.map +1 -0
  28. package/dist/fontInjection.js +21 -0
  29. package/dist/fontInjection.js.map +1 -0
  30. package/dist/geist-font.js +10 -16
  31. package/dist/geist-font.js.map +1 -1
  32. package/dist/index.d.ts +20 -2
  33. package/dist/inter-font.js +21 -27
  34. package/dist/inter-font.js.map +1 -1
  35. package/dist/stack-sans-font.js +5 -11
  36. package/dist/stack-sans-font.js.map +1 -1
  37. package/dist/tailwind.css.js +1 -1
  38. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPalette.js","sources":["../../src/components/CommandPalette.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { ShadowRootWrapper } from '../ShadowRootWrapper';\nimport Keycap from './Keycap';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport { paintOnChild } from './asChild';\nimport { useOverlayBehaviour } from './overlayBehaviour';\nimport { OVERLAY_ELEVATED_ATTR, overlayIdentity } from './portalOverlay';\nimport { isRenderableNode } from './renderableNode';\n\nconst PANEL =\n 'w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[var(--malachite-radius-xxl,14px)] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] outline-none [box-shadow:0_16px_48px_0_rgba(0,0,0,0.18)]';\n\nexport interface CommandPaletteProps {\n children?: React.ReactNode;\n /** Scrim click, and Escape unless a consumer handler already called `preventDefault`. */\n onDismiss?: () => void;\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/** Open while mounted. */\nconst CommandPaletteRoot: React.FC<CommandPaletteProps> = ({\n children,\n onDismiss,\n 'aria-label': ariaLabel,\n className = '',\n style,\n}) => {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const hostRef = useRef<HTMLDivElement | null>(null);\n const dismiss = useCallback(() => onDismiss?.(), [onDismiss]);\n const { ref, isTopmost, zIndex, elevated } = useOverlayBehaviour({\n open: true,\n onClose: dismiss,\n hostRef,\n initialFocus: 'content',\n });\n\n if (!isMounted) {\n return null;\n }\n\n return createPortal(\n <ShadowRootWrapper\n hostRef={hostRef}\n hostStyle={{ position: 'relative', zIndex }}\n hostProps={\n elevated\n ? { ...overlayIdentity('commandpalette'), [OVERLAY_ELEVATED_ATTR]: '' }\n : overlayIdentity('commandpalette')\n }\n >\n <div\n className=\"fixed inset-0 z-[1000] flex items-start justify-center pt-[10vh] bg-[var(--malachite-overlay-scrim,rgba(0,0,0,0.5))]\"\n onClick={\n onDismiss\n ? (event) => event.target === event.currentTarget && onDismiss()\n : undefined\n }\n role=\"presentation\"\n >\n <div\n ref={ref}\n role=\"dialog\"\n aria-modal={isTopmost ? 'true' : undefined}\n aria-label={ariaLabel}\n tabIndex={-1}\n className={`${PANEL} ${className}`.trim()}\n style={style}\n >\n {children}\n </div>\n </div>\n </ShadowRootWrapper>,\n document.body,\n );\n};\n\ninterface AsChildProps {\n children: React.ReactElement;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst FIELD =\n 'w-full border-none bg-transparent px-0 py-[18px] text-[length:var(--malachite-font-size-xlarge,18px)] text-[var(--malachite-text-primary)] outline-none placeholder:text-[var(--malachite-text-placeholder)]';\n\nconst Field: React.FC<AsChildProps> = ({ children, className = '', style }) =>\n paintOnChild(children, `${FIELD} ${className}`.trim(), style);\n\nexport interface FieldRowProps {\n children?: React.ReactNode;\n scope?: React.ReactNode;\n className?: string;\n}\n\nconst FieldRow: React.FC<FieldRowProps> = ({ children, scope, className = '' }) => (\n <div\n className={`flex items-center gap-2 border-0 border-b border-solid border-[var(--malachite-card-border)] px-[18px] ${className}`.trim()}\n >\n {scope}\n {children}\n </div>\n);\n\nconst ScopeChip: React.FC<{ children?: React.ReactNode }> = ({ children }) => (\n <span className=\"flex-none whitespace-nowrap rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-sunken-background)] px-2 py-[3px] text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-primary)]\">\n {children}\n </span>\n);\n\nexport interface ListProps extends AsChildProps {\n hasMoreBelow?: boolean;\n}\n\nconst LIST = 'max-h-[420px] overflow-auto py-1 bg-[var(--malachite-card-background)]';\n\nconst List: React.FC<ListProps> = ({ children, hasMoreBelow = false, className = '', style }) => (\n <div className=\"relative\">\n {paintOnChild(children, `${LIST} ${className}`.trim(), style)}\n {hasMoreBelow ? (\n <div\n aria-hidden\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-[28px] bg-[linear-gradient(to_bottom,transparent,var(--malachite-card-background))]\"\n />\n ) : null}\n </div>\n);\n\nexport interface GroupProps extends AsChildProps {\n divider?: boolean;\n}\n\nconst Group: React.FC<GroupProps> = ({ children, divider = false, className = '', style }) =>\n paintOnChild(\n children,\n `block pt-1 pb-2 ${\n divider ? 'border-0 border-b border-solid border-[var(--malachite-card-border)]' : ''\n } ${className}`.trim(),\n style,\n );\n\nconst Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"mb-1 flex items-center gap-2 px-4 text-[length:var(--malachite-font-size-xsmall,11px)] font-semibold uppercase tracking-[0.06em] text-[var(--malachite-text-secondary)]\">\n {children}\n {trailing}\n </div>\n);\n\nexport interface RowProps {\n /** Its children are replaced, so give the item an explicit `value`/`keywords`. */\n children: React.ReactElement;\n selected?: boolean;\n leading?: React.ReactNode;\n label?: React.ReactNode;\n /** The full label as text, shown in a tooltip only while the label is truncated. */\n labelTooltip?: string;\n /** Tags beside the label, kept visible while a long label truncates. */\n tags?: React.ReactNode;\n crumb?: React.ReactNode;\n /** Truncates before the label when the row runs out of room; inline text gets an ellipsis. */\n meta?: React.ReactNode;\n /** Held at a minimum width so status words line up; a row without one gives that room to its label. */\n status?: React.ReactNode;\n hint?: React.ReactNode;\n className?: string;\n}\n\n// `data-selected` too: a headless library marks its active item without re-rendering the row.\nconst ROW =\n 'group mx-2 flex cursor-pointer items-center gap-2 rounded-[var(--malachite-radius-xl,12px)] px-3 py-[10px] text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-primary)] transition-colors hover:bg-[var(--malachite-card-sunken-background)] data-[selected=true]:bg-[var(--malachite-card-sunken-background)]';\n\nconst Row: React.FC<RowProps> = ({\n children,\n selected = false,\n leading,\n label,\n labelTooltip,\n tags,\n crumb,\n meta,\n status,\n hint,\n className = '',\n}) =>\n paintOnChild(\n children,\n `${ROW} ${selected ? 'bg-[var(--malachite-card-sunken-background)]' : ''} ${className}`.trim(),\n undefined,\n <>\n {leading}\n <span className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n {label && labelTooltip ? (\n <TruncatedTooltip text={labelTooltip} triggerAs=\"span\" describesTrigger={false}>\n {label}\n </TruncatedTooltip>\n ) : null}\n {label && !labelTooltip ? (\n <span className=\"min-w-0 flex-[0_1_auto] overflow-hidden text-ellipsis whitespace-nowrap\">\n {label}\n </span>\n ) : null}\n {tags ? (\n <span className=\"flex flex-none items-center gap-1 self-center\">{tags}</span>\n ) : null}\n {crumb ? <span className=\"flex-none whitespace-nowrap\">{crumb}</span> : null}\n {/* Sized from zero, it takes only the room the label leaves, so it truncates first. */}\n {meta ? (\n <span className=\"min-w-0 flex-[1_1_0%] overflow-hidden text-ellipsis whitespace-nowrap\">\n {meta}\n </span>\n ) : null}\n </span>\n {isRenderableNode(status) ? (\n <span className=\"flex min-w-[84px] flex-none justify-end\">{status}</span>\n ) : null}\n <span\n className={`flex-none ${selected ? '' : 'invisible'} group-data-[selected=true]:visible`}\n >\n {hint}\n </span>\n </>,\n );\n\nexport interface MessageProps {\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst Message: React.FC<MessageProps> = ({ children, className = '', style }) => {\n const classes =\n `block px-4 py-2 text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-secondary)] ${className}`.trim();\n return React.isValidElement(children) ? (\n paintOnChild(children, classes, style)\n ) : (\n <div className={classes} style={style}>\n {children}\n </div>\n );\n};\n\nexport interface LegendProps {\n items: { key: string; label: string }[];\n}\n\nconst Legend: React.FC<LegendProps> = ({ items }) => (\n <div className=\"flex flex-wrap gap-[14px] px-4 pt-[10px] pb-1 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n {items.map((item) => (\n <span key={item.key} className=\"inline-flex items-center gap-[6px]\">\n <Keycap size=\"small\">{item.key}</Keycap>\n {item.label}\n </span>\n ))}\n </div>\n);\n\nexport interface GridProps {\n children?: React.ReactNode;\n columns?: 1 | 2;\n className?: string;\n}\n\nconst Grid: React.FC<GridProps> = ({ children, columns = 2, className = '' }) => (\n <div\n className={`grid gap-1 px-2 ${columns === 2 ? 'grid-cols-2' : 'grid-cols-1'} ${className}`.trim()}\n >\n {children}\n </div>\n);\n\nconst Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"flex items-center justify-between gap-3 border-0 border-t border-solid border-[var(--malachite-card-border)] px-4 py-3 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n <span className=\"flex items-center gap-[10px]\">{children}</span>\n {trailing ? <span className=\"flex items-center gap-[10px]\">{trailing}</span> : null}\n </div>\n);\n\ninterface CommandPaletteComponent extends React.FC<CommandPaletteProps> {\n FieldRow: React.FC<FieldRowProps>;\n Field: React.FC<AsChildProps>;\n ScopeChip: React.FC<{ children?: React.ReactNode }>;\n List: React.FC<ListProps>;\n Group: React.FC<GroupProps>;\n Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n Row: React.FC<RowProps>;\n Grid: React.FC<GridProps>;\n Message: React.FC<MessageProps>;\n Legend: React.FC<LegendProps>;\n Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n}\n\nconst CommandPalette = CommandPaletteRoot as CommandPaletteComponent;\nCommandPalette.FieldRow = FieldRow;\nCommandPalette.Field = Field;\nCommandPalette.ScopeChip = ScopeChip;\nCommandPalette.List = List;\nCommandPalette.Group = Group;\nCommandPalette.Heading = Heading;\nCommandPalette.Row = Row;\nCommandPalette.Grid = Grid;\nCommandPalette.Message = Message;\nCommandPalette.Legend = Legend;\nCommandPalette.Footer = Footer;\n\nexport default CommandPalette;\nexport { CommandPalette };\n"],"names":["PANEL","CommandPaletteRoot","children","onDismiss","ariaLabel","className","style","isMounted","setIsMounted","useState","useEffect","hostRef","useRef","dismiss","useCallback","ref","isTopmost","zIndex","elevated","useOverlayBehaviour","createPortal","jsx","ShadowRootWrapper","overlayIdentity","OVERLAY_ELEVATED_ATTR","event","FIELD","Field","paintOnChild","FieldRow","scope","jsxs","ScopeChip","LIST","List","hasMoreBelow","Group","divider","Heading","trailing","ROW","Row","selected","leading","label","labelTooltip","tags","crumb","meta","status","hint","Fragment","TruncatedTooltip","isRenderableNode","Message","classes","React","Legend","items","item","Keycap","Grid","columns","Footer","CommandPalette"],"mappings":";;;;;;;;;;AAUA,MAAMA,IACF,kQAYEC,IAAoD,CAAC;AAAA,EACvD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAcC;AAAA,EACd,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAM;AACF,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK;AAChD,EAAAC,EAAU,MAAMF,EAAa,EAAI,GAAG,CAAA,CAAE;AAEtC,QAAMG,IAAUC,EAA8B,IAAI,GAC5CC,IAAUC,EAAY,MAAMX,KAAA,gBAAAA,KAAe,CAACA,CAAS,CAAC,GACtD,EAAE,KAAAY,GAAK,WAAAC,GAAW,QAAAC,GAAQ,UAAAC,EAAA,IAAaC,EAAoB;AAAA,IAC7D,MAAM;AAAA,IACN,SAASN;AAAA,IACT,SAAAF;AAAA,IACA,cAAc;AAAA,EAAA,CACjB;AAED,SAAKJ,IAIEa;AAAA,IACH,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,SAAAX;AAAA,QACA,WAAW,EAAE,UAAU,YAAY,QAAAM,EAAA;AAAA,QACnC,WACIC,IACM,EAAE,GAAGK,EAAgB,gBAAgB,GAAG,CAACC,CAAqB,GAAG,GAAA,IACjED,EAAgB,gBAAgB;AAAA,QAG1C,UAAA,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAU;AAAA,YACV,SACIlB,IACM,CAACsB,MAAUA,EAAM,WAAWA,EAAM,iBAAiBtB,EAAA,IACnD;AAAA,YAEV,MAAK;AAAA,YAEL,UAAA,gBAAAkB;AAAA,cAAC;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CAAS;AAAA,EACxDqC,IAAW,gBAAAlB,EAAC,QAAA,EAAK,WAAU,gCAAgC,aAAS,IAAU;AAAA,GACnF,GAiBE2C,IAAiB/D;AACvB+D,EAAe,WAAWnC;AAC1BmC,EAAe,QAAQrC;AACvBqC,EAAe,YAAYhC;AAC3BgC,EAAe,OAAO9B;AACtB8B,EAAe,QAAQ5B;AACvB4B,EAAe,UAAU1B;AACzB0B,EAAe,MAAMvB;AACrBuB,EAAe,OAAOH;AACtBG,EAAe,UAAUV;AACzBU,EAAe,SAASP;AACxBO,EAAe,SAASD;"}
1
+ {"version":3,"file":"CommandPalette.js","sources":["../../src/components/CommandPalette.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useFontFace } from '../fontInjection';\nimport { ShadowRootWrapper } from '../ShadowRootWrapper';\nimport Keycap from './Keycap';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport { paintOnChild } from './asChild';\nimport { useOverlayBehaviour } from './overlayBehaviour';\nimport { OVERLAY_ELEVATED_ATTR, overlayIdentity } from './portalOverlay';\nimport { isRenderableNode } from './renderableNode';\n\nconst PANEL =\n 'w-full max-w-[640px] overflow-hidden font-body antialiased rounded-[var(--malachite-radius-xxl,14px)] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] outline-none [box-shadow:0_16px_48px_0_rgba(0,0,0,0.18)]';\n\nexport interface CommandPaletteProps {\n children?: React.ReactNode;\n /** Scrim click, and Escape unless a consumer handler already called `preventDefault`. */\n onDismiss?: () => void;\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/** Open while mounted. */\nconst CommandPaletteRoot: React.FC<CommandPaletteProps> = ({\n children,\n onDismiss,\n 'aria-label': ariaLabel,\n className = '',\n style,\n}) => {\n useFontFace('geist');\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const hostRef = useRef<HTMLDivElement | null>(null);\n const dismiss = useCallback(() => onDismiss?.(), [onDismiss]);\n const { ref, isTopmost, zIndex, elevated } = useOverlayBehaviour({\n open: true,\n onClose: dismiss,\n hostRef,\n initialFocus: 'content',\n });\n\n if (!isMounted) {\n return null;\n }\n\n return createPortal(\n <ShadowRootWrapper\n hostRef={hostRef}\n hostStyle={{ position: 'relative', zIndex }}\n hostProps={\n elevated\n ? { ...overlayIdentity('commandpalette'), [OVERLAY_ELEVATED_ATTR]: '' }\n : overlayIdentity('commandpalette')\n }\n >\n <div\n className=\"fixed inset-0 z-[1000] flex items-start justify-center pt-[10vh] bg-[var(--malachite-overlay-scrim,rgba(0,0,0,0.5))]\"\n onClick={\n onDismiss\n ? (event) => event.target === event.currentTarget && onDismiss()\n : undefined\n }\n role=\"presentation\"\n >\n <div\n ref={ref}\n role=\"dialog\"\n aria-modal={isTopmost ? 'true' : undefined}\n aria-label={ariaLabel}\n tabIndex={-1}\n className={`${PANEL} ${className}`.trim()}\n style={style}\n >\n {children}\n </div>\n </div>\n </ShadowRootWrapper>,\n document.body,\n );\n};\n\ninterface AsChildProps {\n children: React.ReactElement;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst FIELD =\n 'w-full border-none bg-transparent px-0 py-[18px] text-[length:var(--malachite-font-size-xlarge,18px)] text-[var(--malachite-text-primary)] outline-none placeholder:text-[var(--malachite-text-placeholder)]';\n\nconst Field: React.FC<AsChildProps> = ({ children, className = '', style }) =>\n paintOnChild(children, `${FIELD} ${className}`.trim(), style);\n\nexport interface FieldRowProps {\n children?: React.ReactNode;\n scope?: React.ReactNode;\n className?: string;\n}\n\nconst FieldRow: React.FC<FieldRowProps> = ({ children, scope, className = '' }) => (\n <div\n className={`flex items-center gap-2 border-0 border-b border-solid border-[var(--malachite-card-border)] px-[18px] ${className}`.trim()}\n >\n {scope}\n {children}\n </div>\n);\n\nconst ScopeChip: React.FC<{ children?: React.ReactNode }> = ({ children }) => (\n <span className=\"flex-none whitespace-nowrap rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-sunken-background)] px-2 py-[3px] text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-primary)]\">\n {children}\n </span>\n);\n\nexport interface ListProps extends AsChildProps {\n hasMoreBelow?: boolean;\n}\n\nconst LIST = 'max-h-[420px] overflow-auto py-1 bg-[var(--malachite-card-background)]';\n\nconst List: React.FC<ListProps> = ({ children, hasMoreBelow = false, className = '', style }) => (\n <div className=\"relative\">\n {paintOnChild(children, `${LIST} ${className}`.trim(), style)}\n {hasMoreBelow ? (\n <div\n aria-hidden\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-[28px] bg-[linear-gradient(to_bottom,transparent,var(--malachite-card-background))]\"\n />\n ) : null}\n </div>\n);\n\nexport interface GroupProps extends AsChildProps {\n divider?: boolean;\n}\n\nconst Group: React.FC<GroupProps> = ({ children, divider = false, className = '', style }) =>\n paintOnChild(\n children,\n `block pt-1 pb-2 ${\n divider ? 'border-0 border-b border-solid border-[var(--malachite-card-border)]' : ''\n } ${className}`.trim(),\n style,\n );\n\nconst Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"mb-1 flex items-center gap-2 px-4 text-[length:var(--malachite-font-size-xsmall,11px)] font-semibold uppercase tracking-[0.06em] text-[var(--malachite-text-secondary)]\">\n {children}\n {trailing}\n </div>\n);\n\nexport interface RowProps {\n /** Its children are replaced, so give the item an explicit `value`/`keywords`. */\n children: React.ReactElement;\n selected?: boolean;\n leading?: React.ReactNode;\n label?: React.ReactNode;\n /** The full label as text, shown in a tooltip only while the label is truncated. */\n labelTooltip?: string;\n /** Tags beside the label, kept visible while a long label truncates. */\n tags?: React.ReactNode;\n crumb?: React.ReactNode;\n /** Truncates before the label when the row runs out of room; inline text gets an ellipsis. */\n meta?: React.ReactNode;\n /** Held at a minimum width so status words line up; a row without one gives that room to its label. */\n status?: React.ReactNode;\n hint?: React.ReactNode;\n className?: string;\n}\n\n// `data-selected` too: a headless library marks its active item without re-rendering the row.\nconst ROW =\n 'group mx-2 flex cursor-pointer items-center gap-2 rounded-[var(--malachite-radius-xl,12px)] px-3 py-[10px] text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-primary)] transition-colors hover:bg-[var(--malachite-card-sunken-background)] data-[selected=true]:bg-[var(--malachite-card-sunken-background)]';\n\nconst Row: React.FC<RowProps> = ({\n children,\n selected = false,\n leading,\n label,\n labelTooltip,\n tags,\n crumb,\n meta,\n status,\n hint,\n className = '',\n}) =>\n paintOnChild(\n children,\n `${ROW} ${selected ? 'bg-[var(--malachite-card-sunken-background)]' : ''} ${className}`.trim(),\n undefined,\n <>\n {leading}\n <span className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n {label && labelTooltip ? (\n <TruncatedTooltip text={labelTooltip} triggerAs=\"span\" describesTrigger={false}>\n {label}\n </TruncatedTooltip>\n ) : null}\n {label && !labelTooltip ? (\n <span className=\"min-w-0 flex-[0_1_auto] overflow-hidden text-ellipsis whitespace-nowrap\">\n {label}\n </span>\n ) : null}\n {tags ? (\n <span className=\"flex flex-none items-center gap-1 self-center\">{tags}</span>\n ) : null}\n {crumb ? <span className=\"flex-none whitespace-nowrap\">{crumb}</span> : null}\n {/* Sized from zero, it takes only the room the label leaves, so it truncates first. */}\n {meta ? (\n <span className=\"min-w-0 flex-[1_1_0%] overflow-hidden text-ellipsis whitespace-nowrap\">\n {meta}\n </span>\n ) : null}\n </span>\n {isRenderableNode(status) ? (\n <span className=\"flex min-w-[84px] flex-none justify-end\">{status}</span>\n ) : null}\n <span\n className={`flex-none ${selected ? '' : 'invisible'} group-data-[selected=true]:visible`}\n >\n {hint}\n </span>\n </>,\n );\n\nexport interface MessageProps {\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst Message: React.FC<MessageProps> = ({ children, className = '', style }) => {\n const classes =\n `block px-4 py-2 text-[length:var(--malachite-font-size-medium,14px)] text-[var(--malachite-text-secondary)] ${className}`.trim();\n return React.isValidElement(children) ? (\n paintOnChild(children, classes, style)\n ) : (\n <div className={classes} style={style}>\n {children}\n </div>\n );\n};\n\nexport interface LegendProps {\n items: { key: string; label: string }[];\n}\n\nconst Legend: React.FC<LegendProps> = ({ items }) => (\n <div className=\"flex flex-wrap gap-[14px] px-4 pt-[10px] pb-1 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n {items.map((item) => (\n <span key={item.key} className=\"inline-flex items-center gap-[6px]\">\n <Keycap size=\"small\">{item.key}</Keycap>\n {item.label}\n </span>\n ))}\n </div>\n);\n\nexport interface GridProps {\n children?: React.ReactNode;\n columns?: 1 | 2;\n className?: string;\n}\n\nconst Grid: React.FC<GridProps> = ({ children, columns = 2, className = '' }) => (\n <div\n className={`grid gap-1 px-2 ${columns === 2 ? 'grid-cols-2' : 'grid-cols-1'} ${className}`.trim()}\n >\n {children}\n </div>\n);\n\nconst Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }> = ({\n children,\n trailing,\n}) => (\n <div className=\"flex items-center justify-between gap-3 border-0 border-t border-solid border-[var(--malachite-card-border)] px-4 py-3 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-secondary)]\">\n <span className=\"flex items-center gap-[10px]\">{children}</span>\n {trailing ? <span className=\"flex items-center gap-[10px]\">{trailing}</span> : null}\n </div>\n);\n\ninterface CommandPaletteComponent extends React.FC<CommandPaletteProps> {\n FieldRow: React.FC<FieldRowProps>;\n Field: React.FC<AsChildProps>;\n ScopeChip: React.FC<{ children?: React.ReactNode }>;\n List: React.FC<ListProps>;\n Group: React.FC<GroupProps>;\n Heading: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n Row: React.FC<RowProps>;\n Grid: React.FC<GridProps>;\n Message: React.FC<MessageProps>;\n Legend: React.FC<LegendProps>;\n Footer: React.FC<{ children?: React.ReactNode; trailing?: React.ReactNode }>;\n}\n\nconst CommandPalette = CommandPaletteRoot as CommandPaletteComponent;\nCommandPalette.FieldRow = FieldRow;\nCommandPalette.Field = Field;\nCommandPalette.ScopeChip = ScopeChip;\nCommandPalette.List = List;\nCommandPalette.Group = Group;\nCommandPalette.Heading = Heading;\nCommandPalette.Row = Row;\nCommandPalette.Grid = Grid;\nCommandPalette.Message = Message;\nCommandPalette.Legend = Legend;\nCommandPalette.Footer = Footer;\n\nexport default CommandPalette;\nexport { CommandPalette };\n"],"names":["PANEL","CommandPaletteRoot","children","onDismiss","ariaLabel","className","style","useFontFace","isMounted","setIsMounted","useState","useEffect","hostRef","useRef","dismiss","useCallback","ref","isTopmost","zIndex","elevated","useOverlayBehaviour","createPortal","jsx","ShadowRootWrapper","overlayIdentity","OVERLAY_ELEVATED_ATTR","event","FIELD","Field","paintOnChild","FieldRow","scope","jsxs","ScopeChip","LIST","List","hasMoreBelow","Group","divider","Heading","trailing","ROW","Row","selected","leading","label","labelTooltip","tags","crumb","meta","status","hint","Fragment","TruncatedTooltip","isRenderableNode","Message","classes","React","Legend","items","item","Keycap","Grid","columns","Footer","CommandPalette"],"mappings":";;;;;;;;;;;AAWA,MAAMA,IACF,kQAYEC,IAAoD,CAAC;AAAA,EACvD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAcC;AAAA,EACd,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAM;AACF,EAAAC,EAAY,OAAO;AACnB,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK;AAChD,EAAAC,EAAU,MAAMF,EAAa,EAAI,GAAG,CAAA,CAAE;AAEtC,QAAMG,IAAUC,EAA8B,IAAI,GAC5CC,IAAUC,EAAY,MAAMZ,KAAA,gBAAAA,KAAe,CAACA,CAAS,CAAC,GACtD,EAAE,KAAAa,GAAK,WAAAC,GAAW,QAAAC,GAAQ,UAAAC,EAAA,IAAaC,EAAoB;AAAA,IAC7D,MAAM;AAAA,IACN,SAASN;AAAA,IACT,SAAAF;AAAA,IACA,cAAc;AAAA,EAAA,CACjB;AAED,SAAKJ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,CACH,GACL,GASEE,IAA4B,CAAC,EAAE,UAAA5D,GAAU,SAAA6D,IAAU,GAAG,WAAA1D,IAAY,SACpE,gBAAAiB;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,mBAAmByC,MAAY,IAAI,gBAAgB,aAAa,IAAI1D,CAAS,GAAG,KAAA;AAAA,IAE1F,UAAAH;AAAA,EAAA;AACL,GAGE8D,IAA+E,CAAC;AAAA,EAClF,UAAA9D;AAAA,EACA,UAAAsC;AACJ,MACI,gBAAAR,EAAC,OAAA,EAAI,WAAU,qNACX,UAAA;AAAA,EAAA,gBAAAV,EAAC,QAAA,EAAK,WAAU,gCAAgC,UAAApB,EAAA,CAAS;AAAA,EACxDsC,IAAW,gBAAAlB,EAAC,QAAA,EAAK,WAAU,gCAAgC,aAAS,IAAU;AAAA,GACnF,GAiBE2C,IAAiBhE;AACvBgE,EAAe,WAAWnC;AAC1BmC,EAAe,QAAQrC;AACvBqC,EAAe,YAAYhC;AAC3BgC,EAAe,OAAO9B;AACtB8B,EAAe,QAAQ5B;AACvB4B,EAAe,UAAU1B;AACzB0B,EAAe,MAAMvB;AACrBuB,EAAe,OAAOH;AACtBG,EAAe,UAAUV;AACzBU,EAAe,SAASP;AACxBO,EAAe,SAASD;"}
@@ -1,23 +1,25 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { ShadowRootWrapper as i } from "../ShadowRootWrapper.js";
3
- import { SIDEBAR_Z_INDEX as p } from "./sidebarContext.js";
4
- const s = {
2
+ import { ShadowRootWrapper as p } from "../ShadowRootWrapper.js";
3
+ import { SIDEBAR_Z_INDEX as s } from "./sidebarContext.js";
4
+ const n = {
5
5
  page: {},
6
- sidebar: { position: "relative", zIndex: p }
7
- }, m = ({
6
+ sidebar: { position: "relative", zIndex: s }
7
+ }, S = ({
8
8
  children: e,
9
9
  className: r = "",
10
10
  fillHeight: o = !1,
11
- layer: a = "page"
11
+ layer: a = "page",
12
+ injectFonts: i
12
13
  }) => /* @__PURE__ */ t(
13
- i,
14
+ p,
14
15
  {
16
+ injectFonts: i,
15
17
  fillHeight: o,
16
- hostStyle: { ...s[a], ...o ? { height: "100%" } : {} },
18
+ hostStyle: { ...n[a], ...o ? { height: "100%" } : {} },
17
19
  children: /* @__PURE__ */ t("div", { className: r, style: o ? { height: "100%" } : void 0, children: e })
18
20
  }
19
21
  );
20
22
  export {
21
- m as MalachiteContext
23
+ S as MalachiteContext
22
24
  };
23
25
  //# sourceMappingURL=MalachiteContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MalachiteContext.js","sources":["../../src/components/MalachiteContext.tsx"],"sourcesContent":["import React from 'react';\nimport { ShadowRootWrapper } from '../ShadowRootWrapper';\nimport { SIDEBAR_Z_INDEX } from './sidebarContext';\n\ntype MalachiteLayer = 'page' | 'sidebar';\n\nconst LAYER_HOST_STYLE: Record<MalachiteLayer, React.CSSProperties> = {\n page: {},\n sidebar: { position: 'relative', zIndex: SIDEBAR_Z_INDEX },\n};\n\ninterface MalachiteContextProps {\n children: React.ReactNode;\n className?: string;\n /**\n * Stretches the shadow host, and every plain div between it and `children`, to 100% of\n * the height available from this component's own parent. Without it, the host sizes to\n * its content: a percentage height set further down (inside `children`) has nothing\n * non-`auto` to resolve against, and a chain of plain `<div>`s does not propagate a\n * parent's height to its children on its own. Off by default: every existing consumer\n * relies on the host hugging its content, and turning this on for all of them would\n * change how much space they take up.\n */\n fillHeight?: boolean;\n /**\n * Where the shadow host sits in the page's stacking order. The shadow tree is isolated, so\n * a z-index inside it never reaches the page: wrap a `Sidebar` in `layer=\"sidebar\"`, or the\n * page paints over its edge toggle and anything else that overhangs it.\n */\n layer?: MalachiteLayer;\n}\n\n/**\n * MalachiteContext provides a Shadow DOM context with theme setup for Malachite components.\n * Use this to wrap groups of Malachite components instead of each component managing its own Shadow DOM.\n *\n * @example\n * <MalachiteContext>\n * <Button variant=\"filled\">Click me</Button>\n * <Card>\n * <CardContent>Hello world</CardContent>\n * </Card>\n * </MalachiteContext>\n */\nexport const MalachiteContext: React.FC<MalachiteContextProps> = ({\n children,\n className = '',\n fillHeight = false,\n layer = 'page',\n}) => {\n return (\n <ShadowRootWrapper\n fillHeight={fillHeight}\n hostStyle={{ ...LAYER_HOST_STYLE[layer], ...(fillHeight ? { height: '100%' } : {}) }}\n >\n <div className={className} style={fillHeight ? { height: '100%' } : undefined}>\n {children}\n </div>\n </ShadowRootWrapper>\n );\n};\n\nexport default MalachiteContext;\n"],"names":["LAYER_HOST_STYLE","SIDEBAR_Z_INDEX","MalachiteContext","children","className","fillHeight","layer","jsx","ShadowRootWrapper"],"mappings":";;;AAMA,MAAMA,IAAgE;AAAA,EAClE,MAAM,CAAA;AAAA,EACN,SAAS,EAAE,UAAU,YAAY,QAAQC,EAAA;AAC7C,GAmCaC,IAAoD,CAAC;AAAA,EAC9D,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,OAAAC,IAAQ;AACZ,MAEQ,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACG,YAAAH;AAAA,IACA,WAAW,EAAE,GAAGL,EAAiBM,CAAK,GAAG,GAAID,IAAa,EAAE,QAAQ,OAAA,IAAW,GAAC;AAAA,IAEhF,UAAA,gBAAAE,EAAC,OAAA,EAAI,WAAAH,GAAsB,OAAOC,IAAa,EAAE,QAAQ,WAAW,QAC/D,UAAAF,EAAA,CACL;AAAA,EAAA;AAAA;"}
1
+ {"version":3,"file":"MalachiteContext.js","sources":["../../src/components/MalachiteContext.tsx"],"sourcesContent":["import React from 'react';\nimport { ShadowRootWrapper } from '../ShadowRootWrapper';\nimport { SIDEBAR_Z_INDEX } from './sidebarContext';\n\ntype MalachiteLayer = 'page' | 'sidebar';\n\nconst LAYER_HOST_STYLE: Record<MalachiteLayer, React.CSSProperties> = {\n page: {},\n sidebar: { position: 'relative', zIndex: SIDEBAR_Z_INDEX },\n};\n\ninterface MalachiteContextProps {\n children: React.ReactNode;\n className?: string;\n /**\n * Stretches the shadow host, and every plain div between it and `children`, to 100% of\n * the height available from this component's own parent. Without it, the host sizes to\n * its content: a percentage height set further down (inside `children`) has nothing\n * non-`auto` to resolve against, and a chain of plain `<div>`s does not propagate a\n * parent's height to its children on its own. Off by default: every existing consumer\n * relies on the host hugging its content, and turning this on for all of them would\n * change how much space they take up.\n */\n fillHeight?: boolean;\n /**\n * Where the shadow host sits in the page's stacking order. The shadow tree is isolated, so\n * a z-index inside it never reaches the page: wrap a `Sidebar` in `layer=\"sidebar\"`, or the\n * page paints over its edge toggle and anything else that overhangs it.\n */\n layer?: MalachiteLayer;\n /**\n * Set `false` to skip Malachite's font injection entirely, for a consumer that loads Inter\n * (and any other family it uses) itself. Defaults to on.\n */\n injectFonts?: boolean;\n}\n\n/**\n * MalachiteContext provides a Shadow DOM context with theme setup for Malachite components.\n * Use this to wrap groups of Malachite components instead of each component managing its own Shadow DOM.\n *\n * @example\n * <MalachiteContext>\n * <Button variant=\"filled\">Click me</Button>\n * <Card>\n * <CardContent>Hello world</CardContent>\n * </Card>\n * </MalachiteContext>\n */\nexport const MalachiteContext: React.FC<MalachiteContextProps> = ({\n children,\n className = '',\n fillHeight = false,\n layer = 'page',\n injectFonts,\n}) => {\n return (\n <ShadowRootWrapper\n injectFonts={injectFonts}\n fillHeight={fillHeight}\n hostStyle={{ ...LAYER_HOST_STYLE[layer], ...(fillHeight ? { height: '100%' } : {}) }}\n >\n <div className={className} style={fillHeight ? { height: '100%' } : undefined}>\n {children}\n </div>\n </ShadowRootWrapper>\n );\n};\n\nexport default MalachiteContext;\n"],"names":["LAYER_HOST_STYLE","SIDEBAR_Z_INDEX","MalachiteContext","children","className","fillHeight","layer","injectFonts","jsx","ShadowRootWrapper"],"mappings":";;;AAMA,MAAMA,IAAgE;AAAA,EAClE,MAAM,CAAA;AAAA,EACN,SAAS,EAAE,UAAU,YAAY,QAAQC,EAAA;AAC7C,GAwCaC,IAAoD,CAAC;AAAA,EAC9D,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,OAAAC,IAAQ;AAAA,EACR,aAAAC;AACJ,MAEQ,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACG,aAAAF;AAAA,IACA,YAAAF;AAAA,IACA,WAAW,EAAE,GAAGL,EAAiBM,CAAK,GAAG,GAAID,IAAa,EAAE,QAAQ,OAAA,IAAW,GAAC;AAAA,IAEhF,UAAA,gBAAAG,EAAC,OAAA,EAAI,WAAAJ,GAAsB,OAAOC,IAAa,EAAE,QAAQ,WAAW,QAC/D,UAAAF,EAAA,CACL;AAAA,EAAA;AAAA;"}
@@ -1,130 +1,139 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { useId as B, useState as W, useRef as v, useEffect as ie } from "react";
3
- import { createPortal as ne } from "react-dom";
4
- import { ShadowRootWrapper as oe } from "../ShadowRootWrapper.js";
5
- import se from "./CalloutStrip.js";
6
- import ce from "./CustomIcons/ArrowLeftIcon.js";
7
- import de from "./CustomIcons/DismissIcon.js";
8
- import N from "./Typography/EllipsisText.js";
9
- import { afterNextPaint as me } from "./afterNextPaint.js";
10
- import { useOverlayBehaviour as pe, OVERLAY_ICON_BUTTON_CLASSES as j } from "./overlayBehaviour.js";
11
- import { OVERLAY_ELEVATED_ATTR as xe, overlayIdentity as H } from "./portalOverlay.js";
12
- const x = 200, fe = "360px", U = ({
2
+ import { useId as F, useState as m, useCallback as ue, useMemo as he, useRef as y, useEffect as be } from "react";
3
+ import { createPortal as ve } from "react-dom";
4
+ import { ShadowRootWrapper as Ne } from "../ShadowRootWrapper.js";
5
+ import ge from "./CalloutStrip.js";
6
+ import we from "./CustomIcons/ArrowLeftIcon.js";
7
+ import ye from "./CustomIcons/DismissIcon.js";
8
+ import Te from "./SidePanelTabs.js";
9
+ import T from "./Typography/EllipsisText.js";
10
+ import { afterNextPaint as Se } from "./afterNextPaint.js";
11
+ import { useOverlayBehaviour as $e, OVERLAY_ICON_BUTTON_CLASSES as G } from "./overlayBehaviour.js";
12
+ import { OVERLAY_ELEVATED_ATTR as Ce, overlayIdentity as K } from "./portalOverlay.js";
13
+ import { SidePanelTabsContext as q } from "./sidePanelTabsContext.js";
14
+ const h = 200, Ie = "360px", J = ({
13
15
  bodyPadding: r,
14
- callouts: a,
16
+ callouts: t,
15
17
  calloutId: i,
16
18
  renderLink: o,
17
- children: m
19
+ stableGutter: b = !1,
20
+ scrollerRef: p,
21
+ children: s
18
22
  }) => {
19
- const c = !!(a != null && a.length);
23
+ const d = !!(t != null && t.length);
20
24
  return /* @__PURE__ */ l(
21
25
  "div",
22
26
  {
23
- className: `min-h-0 flex-1 overflow-y-auto ${r && !c ? "px-[28px]" : ""}`,
27
+ ref: p,
28
+ className: `min-h-0 flex-1 overflow-y-auto ${b ? "[scrollbar-gutter:stable]" : ""} ${r && !d ? "px-[28px]" : ""}`,
24
29
  children: [
25
- a == null ? void 0 : a.map((s, d) => /* @__PURE__ */ e(
26
- se,
30
+ t == null ? void 0 : t.map((x, f) => /* @__PURE__ */ e(
31
+ ge,
27
32
  {
28
- id: i ? `${i}-${d}` : void 0,
29
- type: s.type,
30
- message: s.message,
33
+ id: i ? `${i}-${f}` : void 0,
34
+ type: x.type,
35
+ message: x.message,
31
36
  renderLink: o
32
37
  },
33
- d
38
+ f
34
39
  )),
35
- r ? /* @__PURE__ */ e("div", { className: c ? "p-[28px]" : "py-[28px]", children: m }) : m
40
+ r ? /* @__PURE__ */ e("div", { className: d ? "p-[28px]" : "py-[28px]", children: s }) : s
36
41
  ]
37
42
  }
38
43
  );
39
- }, g = (r) => typeof r == "number" ? `${r}px` : r, ue = (r) => {
44
+ }, S = (r) => typeof r == "number" ? `${r}px` : r, Pe = (r) => {
40
45
  r.key === "Enter" && r.target instanceof HTMLInputElement && r.preventDefault();
41
- }, X = "col-start-2 row-span-3 grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-subgrid", he = ({ onSubmit: r, children: a }) => r ? /* @__PURE__ */ e(
46
+ }, Q = "col-start-2 row-span-3 grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-subgrid", ke = ({ onSubmit: r, children: t }) => r ? /* @__PURE__ */ e(
42
47
  "form",
43
48
  {
44
49
  noValidate: !0,
45
- className: X,
50
+ className: Q,
46
51
  onSubmit: (i) => {
47
52
  i.preventDefault(), i.stopPropagation(), r(i);
48
53
  },
49
- children: a
54
+ children: t
50
55
  }
51
- ) : /* @__PURE__ */ e("div", { className: X, children: a }), Ce = ({
56
+ ) : /* @__PURE__ */ e("div", { className: Q, children: t }), Ee = ({
52
57
  open: r,
53
- onClose: a,
58
+ onClose: t,
54
59
  title: i,
55
60
  subtitle: o,
56
- subtitlePlacement: m = "inline",
57
- titleExtra: c,
61
+ subtitlePlacement: b = "inline",
62
+ titleExtra: p,
58
63
  description: s,
59
64
  toolbar: d,
60
- headerDivider: Y = !1,
61
- icon: w,
62
- headerExtra: y,
63
- footer: f,
64
- onSubmit: $,
65
- onBack: T,
66
- maxWidth: u = 1080,
67
- "aria-label": F,
68
- "aria-labelledby": I,
69
- bodyPadding: K = !0,
70
- stacking: q = "default",
71
- callouts: h,
72
- renderLink: G,
73
- aside: t,
74
- children: J
65
+ toolbarPadding: x = "default",
66
+ headerDivider: f = !1,
67
+ icon: $,
68
+ headerExtra: C,
69
+ footer: v,
70
+ onSubmit: I,
71
+ onBack: P,
72
+ maxWidth: N = 1080,
73
+ "aria-label": Z,
74
+ "aria-labelledby": k,
75
+ bodyPadding: ee = !0,
76
+ stacking: re = "default",
77
+ callouts: g,
78
+ renderLink: le,
79
+ aside: a,
80
+ children: te
75
81
  }) => {
76
- const S = B(), E = B(), [C, k] = W(!1), [Q, _] = W(!1), p = v(null), n = v(null), P = v(null), {
77
- ref: Z,
78
- isTopmost: ee,
79
- zIndex: re,
80
- elevated: le
81
- } = pe({
82
+ const E = F(), [_, ae] = m(null), [ie, A] = m(0), R = ue(() => (A((c) => c + 1), () => A((c) => c - 1)), []), [L, ne] = m(null), oe = he(
83
+ () => ({ stripSlot: _, scroller: L, registerTabs: R }),
84
+ [_, L, R]
85
+ ), z = F(), [D, M] = m(!1), [se, O] = m(!1), u = y(null), n = y(null), V = y(null), {
86
+ ref: ce,
87
+ isTopmost: de,
88
+ zIndex: me,
89
+ elevated: pe
90
+ } = $e({
82
91
  open: r,
83
- onClose: a,
84
- elevated: q === "above-app-overlays",
85
- hostRef: P
92
+ onClose: t,
93
+ elevated: re === "above-app-overlays",
94
+ hostRef: V
86
95
  });
87
- if (ie(() => (r ? (_(!0), n.current && (clearTimeout(n.current), n.current = null), me(p, () => k(!0))) : (k(!1), n.current = setTimeout(() => {
88
- n.current = null, _(!1);
89
- }, x)), () => {
90
- p.current !== null && (cancelAnimationFrame(p.current), p.current = null), n.current && (clearTimeout(n.current), n.current = null);
91
- }), [r]), !Q)
96
+ if (be(() => (r ? (O(!0), n.current && (clearTimeout(n.current), n.current = null), Se(u, () => M(!0))) : (M(!1), n.current = setTimeout(() => {
97
+ n.current = null, O(!1);
98
+ }, h)), () => {
99
+ u.current !== null && (cancelAnimationFrame(u.current), u.current = null), n.current && (clearTimeout(n.current), n.current = null);
100
+ }), [r]), !se)
92
101
  return null;
93
- const A = h == null ? void 0 : h.filter((V) => V.message.trim()), b = `calc(${g(u)} - 2px)`, R = Y ? "border-0 border-b border-solid border-[var(--malachite-card-border)]" : "", ae = t ? /* @__PURE__ */ l(
102
+ const B = g == null ? void 0 : g.filter((c) => c.message.trim()), w = `calc(${S(N)} - 2px)`, W = f ? "border-0 border-b border-solid border-[var(--malachite-card-border)]" : "", xe = a ? /* @__PURE__ */ l(
94
103
  "aside",
95
104
  {
96
- "aria-label": t.title,
105
+ "aria-label": a.title,
97
106
  className: "col-start-1 row-span-3 grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-subgrid overflow-hidden border-0 border-r border-solid border-[var(--malachite-card-border)]",
98
107
  children: [
99
108
  /* @__PURE__ */ l(
100
109
  "div",
101
110
  {
102
- className: `flex min-w-0 items-center gap-[8px] px-[20px] py-[18px] ${R}`,
111
+ className: `flex min-w-0 items-center gap-[8px] px-[20px] py-[18px] ${W}`,
103
112
  children: [
104
113
  /* @__PURE__ */ e("span", { className: "flex min-w-0 shrink-0", children: /* @__PURE__ */ e(
105
- N,
114
+ T,
106
115
  {
107
- tooltip: t.title,
116
+ tooltip: a.title,
108
117
  tooltipWhenTruncated: !0,
109
118
  tooltipPlacement: "bottom",
110
119
  className: "min-w-0 text-[length:var(--malachite-font-size-15,15px)] font-semibold",
111
- children: t.title
120
+ children: a.title
112
121
  }
113
122
  ) }),
114
- t.headerExtra ? /* @__PURE__ */ e("span", { className: "ml-auto flex shrink-0 items-center", children: t.headerExtra }) : null
123
+ a.headerExtra ? /* @__PURE__ */ e("span", { className: "ml-auto flex shrink-0 items-center", children: a.headerExtra }) : null
115
124
  ]
116
125
  }
117
126
  ),
118
- /* @__PURE__ */ e("div", { className: `flex min-h-0 flex-col ${t.footer ? "" : "row-span-2"}`, children: /* @__PURE__ */ e(U, { bodyPadding: t.bodyPadding ?? !0, children: t.children }) }),
119
- t.footer ? /* @__PURE__ */ e("div", { className: "border-0 border-t border-solid border-[var(--malachite-card-border)] px-[24px] py-[16px]", children: t.footer }) : null
127
+ /* @__PURE__ */ e("div", { className: `flex min-h-0 flex-col ${a.footer ? "" : "row-span-2"}`, children: /* @__PURE__ */ e(J, { bodyPadding: a.bodyPadding ?? !0, children: a.children }) }),
128
+ a.footer ? /* @__PURE__ */ e("div", { className: "border-0 border-t border-solid border-[var(--malachite-card-border)] px-[24px] py-[16px]", children: a.footer }) : null
120
129
  ]
121
130
  }
122
- ) : null, L = m === "below" && !!o, z = /* @__PURE__ */ e(
131
+ ) : null, j = b === "below" && !!o, H = /* @__PURE__ */ e(
123
132
  "span",
124
133
  {
125
- className: L ? "flex min-w-0 shrink" : "flex min-w-0 max-w-full shrink-0",
134
+ className: j ? "flex min-w-0 shrink" : "flex min-w-0 max-w-full shrink-0",
126
135
  children: /* @__PURE__ */ e(
127
- N,
136
+ T,
128
137
  {
129
138
  tooltip: i,
130
139
  tooltipWhenTruncated: !0,
@@ -134,8 +143,8 @@ const x = 200, fe = "360px", U = ({
134
143
  }
135
144
  )
136
145
  }
137
- ), D = o ? /* @__PURE__ */ e(
138
- N,
146
+ ), U = o ? /* @__PURE__ */ e(
147
+ T,
139
148
  {
140
149
  tooltip: o,
141
150
  tooltipWhenTruncated: !0,
@@ -144,106 +153,106 @@ const x = 200, fe = "360px", U = ({
144
153
  className: "min-w-0 text-[13px]",
145
154
  children: o
146
155
  }
147
- ) : null, O = c ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: c }) : null, M = y ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-baseline", children: y }) : null;
148
- return ne(
156
+ ) : null, X = p ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: p }) : null, Y = C ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-baseline", children: C }) : null;
157
+ return ve(
149
158
  // Host carries the stacking context — ShadowRootWrapper's `isolation` would
150
159
  // otherwise flatten our z-index and let sticky page elements paint over us.
151
160
  /* @__PURE__ */ e(
152
- oe,
161
+ Ne,
153
162
  {
154
- hostRef: P,
155
- hostStyle: { position: "relative", zIndex: re },
156
- hostProps: le ? { ...H("sidepanel"), [xe]: "" } : H("sidepanel"),
157
- children: /* @__PURE__ */ l("div", { className: "fixed inset-0 z-[1000]", children: [
163
+ hostRef: V,
164
+ hostStyle: { position: "relative", zIndex: me },
165
+ hostProps: pe ? { ...K("sidepanel"), [Ce]: "" } : K("sidepanel"),
166
+ children: /* @__PURE__ */ e(q.Provider, { value: null, children: /* @__PURE__ */ l("div", { className: "fixed inset-0 z-[1000]", children: [
158
167
  /* @__PURE__ */ e(
159
168
  "div",
160
169
  {
161
170
  "aria-hidden": "true",
162
- onClick: a,
163
- className: `absolute inset-0 bg-[var(--malachite-overlay-scrim)] transition-opacity duration-200 ease-in-out ${C ? "opacity-100" : "opacity-0"}`
171
+ onClick: t,
172
+ className: `absolute inset-0 bg-[var(--malachite-overlay-scrim)] transition-opacity duration-200 ease-in-out ${D ? "opacity-100" : "opacity-0"}`
164
173
  }
165
174
  ),
166
175
  /* @__PURE__ */ l(
167
176
  "div",
168
177
  {
169
- ref: Z,
178
+ ref: ce,
170
179
  role: "dialog",
171
- "aria-modal": ee ? "true" : void 0,
180
+ "aria-modal": de ? "true" : void 0,
172
181
  "aria-describedby": [
173
- ...(A ?? []).map((V, te) => `${S}-${te}`),
174
- s ? E : null
182
+ ...(B ?? []).map((c, fe) => `${E}-${fe}`),
183
+ s ? z : null
175
184
  ].filter(Boolean).join(" ") || void 0,
176
185
  tabIndex: -1,
177
- "aria-label": I ? void 0 : F ?? (typeof i == "string" ? i : void 0),
178
- "aria-labelledby": I,
186
+ "aria-label": k ? void 0 : Z ?? (typeof i == "string" ? i : void 0),
187
+ "aria-labelledby": k,
179
188
  className: "absolute top-[8px] right-[8px] bottom-[8px] grid grid-rows-[auto_minmax(0,1fr)_auto] overflow-x-auto overflow-y-hidden rounded-[20px] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] text-[var(--malachite-card-foreground)] outline-none [box-shadow:var(--malachite-shadow-lg)]",
180
189
  style: {
181
- width: `min(calc(100% - 16px), ${t ? `calc(2 * ${g(u)})` : g(u)})`,
190
+ width: `min(calc(100% - 16px), ${a ? `calc(2 * ${S(N)})` : S(N)})`,
182
191
  // Inline: Tailwind translate utilities silently break inside
183
192
  // shadow roots (see CLAUDE.md Shadow DOM caveats).
184
- transform: C ? "translateX(0)" : "translateX(calc(100% + 16px))",
185
- transition: `transform ${x}ms ease-in-out, width ${x}ms ease-in-out, grid-template-columns ${x}ms ease-in-out`,
193
+ transform: D ? "translateX(0)" : "translateX(calc(100% + 16px))",
194
+ transition: `transform ${h}ms ease-in-out, width ${h}ms ease-in-out, grid-template-columns ${h}ms ease-in-out`,
186
195
  // The panel's own column is the width it has without an aside: `maxWidth`
187
196
  // less the 1px border either side, so opening the aside never widens it.
188
197
  // With an aside neither column gives way, so a narrow window scrolls the
189
198
  // panel instead. Both templates share one shape so the minimums animate
190
199
  // with the width rather than overflowing mid-transition.
191
- gridTemplateColumns: t ? `minmax(${fe}, 1fr) minmax(${b}, ${b})` : `minmax(0px, 1fr) minmax(0px, ${b})`
200
+ gridTemplateColumns: a ? `minmax(${Ie}, 1fr) minmax(${w}, ${w})` : `minmax(0px, 1fr) minmax(0px, ${w})`
192
201
  },
193
202
  children: [
194
- ae,
195
- /* @__PURE__ */ l(he, { onSubmit: $, children: [
203
+ xe,
204
+ /* @__PURE__ */ l(ke, { onSubmit: I, children: [
196
205
  /* @__PURE__ */ l(
197
206
  "div",
198
207
  {
199
- className: `flex flex-col gap-[20px] px-[20px] py-[18px] ${R}`,
208
+ className: `flex flex-col gap-[20px] px-[20px] py-[18px] ${W}`,
200
209
  children: [
201
210
  /* @__PURE__ */ l("div", { className: "flex items-center gap-[12px]", children: [
202
- T ? /* @__PURE__ */ e(
211
+ P ? /* @__PURE__ */ e(
203
212
  "button",
204
213
  {
205
214
  type: "button",
206
215
  "aria-label": "Back",
207
- onClick: T,
208
- className: j,
209
- children: /* @__PURE__ */ e(ce, { size: 16 })
216
+ onClick: P,
217
+ className: G,
218
+ children: /* @__PURE__ */ e(we, { size: 16 })
210
219
  }
211
220
  ) : null,
212
- w ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: w }) : null,
213
- L ? /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-[12px]", children: [
221
+ $ ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: $ }) : null,
222
+ j ? /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-[12px]", children: [
214
223
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
215
224
  /* @__PURE__ */ l("div", { className: "flex min-w-0 items-baseline gap-[8px]", children: [
216
- z,
217
- O
225
+ H,
226
+ X
218
227
  ] }),
219
- D
228
+ U
220
229
  ] }),
221
- M
230
+ Y
222
231
  ] }) : /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-baseline gap-[12px]", children: [
223
232
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-baseline gap-[8px]", children: [
224
233
  /* @__PURE__ */ l("div", { className: "flex min-w-0 items-baseline gap-[8px]", children: [
225
- z,
226
- D
234
+ H,
235
+ U
227
236
  ] }),
228
- O
237
+ X
229
238
  ] }),
230
- M
239
+ Y
231
240
  ] }),
232
241
  /* @__PURE__ */ e(
233
242
  "button",
234
243
  {
235
244
  type: "button",
236
245
  "aria-label": "Close",
237
- onClick: a,
238
- className: j,
239
- children: /* @__PURE__ */ e(de, { size: 10 })
246
+ onClick: t,
247
+ className: G,
248
+ children: /* @__PURE__ */ e(ye, { size: 10 })
240
249
  }
241
250
  )
242
251
  ] }),
243
252
  s ? /* @__PURE__ */ e(
244
253
  "div",
245
254
  {
246
- id: E,
255
+ id: z,
247
256
  className: "text-[13px] leading-[1.6] text-[var(--malachite-text-secondary)]",
248
257
  children: s
249
258
  }
@@ -251,39 +260,49 @@ const x = 200, fe = "360px", U = ({
251
260
  ]
252
261
  }
253
262
  ),
254
- /* @__PURE__ */ l("div", { className: `flex min-h-0 flex-col ${f ? "" : "row-span-2"}`, children: [
263
+ /* @__PURE__ */ l("div", { className: `flex min-h-0 flex-col ${v ? "" : "row-span-2"}`, children: [
255
264
  d ? /* @__PURE__ */ e(
256
265
  "div",
257
266
  {
258
- className: "shrink-0 px-[16px] pt-[16px] pb-[8px]",
259
- onKeyDown: $ ? ue : void 0,
267
+ className: `shrink-0 pt-[16px] pb-[8px] ${x === "body" ? "px-[28px]" : "px-[16px]"}`,
268
+ onKeyDown: I ? Pe : void 0,
260
269
  children: d
261
270
  }
262
271
  ) : null,
263
272
  /* @__PURE__ */ e(
264
- U,
273
+ "div",
274
+ {
275
+ ref: ae,
276
+ className: "shrink-0 px-[28px] empty:hidden"
277
+ }
278
+ ),
279
+ /* @__PURE__ */ e(
280
+ J,
265
281
  {
266
- bodyPadding: K,
267
- callouts: A,
268
- calloutId: S,
269
- renderLink: G,
270
- children: J
282
+ bodyPadding: ee,
283
+ callouts: B,
284
+ calloutId: E,
285
+ renderLink: le,
286
+ stableGutter: ie > 0,
287
+ scrollerRef: ne,
288
+ children: /* @__PURE__ */ e(q.Provider, { value: oe, children: te })
271
289
  }
272
290
  )
273
291
  ] }),
274
- f ? /* @__PURE__ */ e("div", { className: "border-0 border-t border-solid border-[var(--malachite-card-border)] px-[24px] py-[16px]", children: f }) : null
292
+ v ? /* @__PURE__ */ e("div", { className: "border-0 border-t border-solid border-[var(--malachite-card-border)] px-[24px] py-[16px]", children: v }) : null
275
293
  ] })
276
294
  ]
277
295
  }
278
296
  )
279
- ] })
297
+ ] }) })
280
298
  }
281
299
  ),
282
300
  document.body
283
301
  );
284
302
  };
303
+ Ee.Tabs = Te;
285
304
  export {
286
- Ce as SidePanel,
287
- Ce as default
305
+ Ee as SidePanel,
306
+ Ee as default
288
307
  };
289
308
  //# sourceMappingURL=SidePanel.js.map