@stackone/malachite 2.105.0 → 2.106.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.
- package/COMPONENTS.md +1 -1
- package/dist/components/Accordion.js +80 -79
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Button.js +53 -58
- package/dist/components/Button.js.map +1 -1
- package/dist/components/ButtonList.js +10 -10
- package/dist/components/ButtonList.js.map +1 -1
- package/dist/components/FilterSearch.js +392 -355
- package/dist/components/FilterSearch.js.map +1 -1
- package/dist/components/FilterSearchPanel.js +167 -0
- package/dist/components/FilterSearchPanel.js.map +1 -0
- package/dist/components/LinkCard.js +78 -55
- package/dist/components/LinkCard.js.map +1 -1
- package/dist/components/SegmentedControl.js +25 -23
- package/dist/components/SegmentedControl.js.map +1 -1
- package/dist/components/Surface.js +45 -44
- package/dist/components/Surface.js.map +1 -1
- package/dist/components/Timeline.js +77 -66
- package/dist/components/Timeline.js.map +1 -1
- package/dist/components/chromeStyles.js +4 -2
- package/dist/components/chromeStyles.js.map +1 -1
- package/dist/components/filterSearchModel.js +32 -31
- package/dist/components/filterSearchModel.js.map +1 -1
- package/dist/components/focusRing.js +16 -9
- package/dist/components/focusRing.js.map +1 -1
- package/dist/index.d.ts +18 -9
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { paintOnChild } from './asChild';\nimport { FOCUS_RING_INSET, FOCUS_RING_INSET_OVERLAY_HIDDEN } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport type SurfaceTone = 'default' | 'highlight';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely. A flat, default-tone `clip` card clips at its border.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n /**\n * `false` drops the elevation shadow, for a card that sits flat on its ground.\n * Default: `true`, or `false` with `tone=\"highlight\"`.\n */\n shadow?: boolean;\n /**\n * `highlight` paints the warm ground with no border and no shadow, for a static block that\n * stands out from the page, such as a hero or a guide's section header. Its ground is too\n * close to `Surface.Row`'s hover for clickable rows inside it.\n */\n tone?: SurfaceTone;\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `tint` paints it\n * without the accent bar, for a menu whose choice is already marked inside the row;\n * `announce` leaves the visual to a control inside the row and only sets the ARIA state.\n * Defaults to `announce` under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'tint' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success` and `error` are for a row that carries\n * an outcome, where the result belongs to the whole line rather than to one cell in it.\n */\n tone?: 'default' | 'muted' | 'success' | 'error';\n /** `compact` is an 8px by 16px inset the row owns. */\n inset?: 'none' | 'compact';\n /** `false` leaves the hover to something inside the row. */\n hover?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst ROW_HOVER_CLASSES =\n 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]';\n\nconst INSET_CLASSES: Record<NonNullable<SurfaceRowChromeProps['inset']>, string> = {\n none: '',\n // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** The row's indicator, before the children. With this or `dimmed`, pass one child. */\n leading?: React.ReactNode;\n /** Fades the children, not `leading` or `trailing`. */\n dimmed?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `-1` takes the row out of the Tab order, for a roving radio group. */\n tabIndex?: number;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background)]',\n error: 'bg-[var(--malachite-tag-error-background)]',\n};\n\n/**\n * The text an outcome tone carries with it, through the same context channel a selected row\n * uses, so `Typography` inside the row follows the tint instead of staying near-black on it.\n * `color` as well, for row content that is not Typography.\n *\n * Only the outcome tones. `muted` dims its subject rather than recolouring it, and its\n * foreground is the ordinary one.\n */\nconst TONE_FOREGROUNDS: Partial<Record<NonNullable<SurfaceRowProps['tone']>, string>> = {\n success: 'var(--malachite-tag-success-foreground)',\n error: 'var(--malachite-tag-error-foreground)',\n};\n\nexport interface SurfaceRowAsChildProps extends SurfaceRowChromeProps {\n asChild: true;\n children: React.ReactElement;\n}\n\nexport type AnySurfaceRowProps = SurfaceRowProps | SurfaceRowAsChildProps;\n\n// Not `group-hover` or `group-has-[:focus-visible]`: WebKit never applies the first (its\n// `@media (hover: hover)` nested in the group selector) nor the second inside a shadow root,\n// so the control stayed hidden in Safari. An open menu takes focus out of the row into a\n// portal, and would otherwise lose its trigger.\nconst REVEALED_ON_INTERACTION =\n 'opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100';\n\nconst selectsTextIn = (row: Element): boolean => {\n const root = row.getRootNode();\n const ownSelection = (root as Partial<Pick<Document, 'getSelection'>>).getSelection?.();\n const selection = ownSelection ?? row.ownerDocument.getSelection();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n for (let index = 0; index < selection.rangeCount; index += 1) {\n if (selection.getRangeAt(index).intersectsNode(row)) {\n return true;\n }\n }\n return false;\n};\n\nconst forwardedClick = (event: MouseEvent): MouseEvent =>\n new (event.constructor as typeof MouseEvent)('click', event);\n\nconst TRIPLE_SHADOW =\n '0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)';\n\n/**\n * A single full-bleed row inside a <Surface>. Owns the row chrome — hover\n * highlight, colour transition and an optional bottom divider — so consumers\n * compose their own content inside without re-implementing design-system styling.\n * Pass `onClick`/`href` to make the entire row clickable (rendered as a real\n * button/anchor, so keyboard navigation works natively).\n */\nconst SurfaceRow: React.FC<AnySurfaceRowProps> = (props) => {\n const {\n children,\n divider = false,\n disabled = false,\n hover: hoverable = true,\n selected,\n selection,\n tone = 'default',\n inset = 'none',\n className = '',\n style,\n } = props;\n const asChild = props.asChild === true;\n const {\n onClick,\n href: rawHref,\n target,\n rel,\n trailing,\n revealTrailing,\n leading,\n dimmed,\n role,\n } = asChild ? ({} as SurfaceRowProps) : (props as SurfaceRowProps);\n // A rejected href (e.g. `javascript:`) leaves the row a button or a plain row, never an anchor.\n const href = safeHref(rawHref);\n const ariaLabel = asChild ? undefined : (props as SurfaceRowProps)['aria-label'];\n const ariaLabelledBy = asChild ? undefined : (props as SurfaceRowProps)['aria-labelledby'];\n const tabIndex = asChild ? undefined : (props as SurfaceRowProps).tabIndex;\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover = disabled && (interactive || asChild) ? '' : hoverable ? ROW_HOVER_CLASSES : '';\n\n // A class, not an inline colour, which would outrank the hover utility. It replaces the\n // button reset's `bg-transparent` rather than joining it: same specificity, so the winner\n // would be whichever Tailwind emitted last.\n const tinted = tone !== 'default';\n const toneClass = TONE_CLASSES[tone];\n\n const hasTrailing = !asChild && isRenderableNode(trailing);\n const insetClass = INSET_CLASSES[inset];\n const controlPadding = insetClass ? '' : 'p-0';\n\n const chromeClasses = [\n 'w-full text-left border-0',\n toneClass,\n divider ? 'border-b border-solid border-[var(--malachite-card-border)]' : '',\n hover,\n ]\n .filter(Boolean)\n .join(' ');\n\n const controlReset = [\n 'appearance-none',\n tinted ? '' : 'bg-transparent',\n disabled ? '' : 'cursor-pointer',\n ];\n const rowClasses = (control: string[]) =>\n [chromeClasses, ...control, insetClass, className].filter(Boolean).join(' ');\n\n const paints = selection ? selection !== 'announce' : role !== 'checkbox';\n const accent = selection !== 'tint';\n\n const forwards = hasTrailing && Boolean(onClick) && !href && !disabled;\n const rowRef = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLButtonElement>(null);\n const pressLeftPadding = useRef(false);\n const startPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current = event.target !== event.currentTarget;\n };\n const trackPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current ||= event.target !== event.currentTarget;\n };\n useEffect(() => {\n const row = rowRef.current;\n if (!forwards || !row) {\n return undefined;\n }\n const forwardPaddingClick = (event: MouseEvent) => {\n const leftPadding = pressLeftPadding.current;\n pressLeftPadding.current = false;\n const control = controlRef.current;\n if (\n !control ||\n event.target !== row ||\n leftPadding ||\n (event.detail <= 1 && !event.shiftKey && selectsTextIn(row))\n ) {\n return;\n }\n event.stopPropagation();\n control.focus({ preventScroll: true });\n control.dispatchEvent(forwardedClick(event));\n };\n row.addEventListener('click', forwardPaddingClick);\n return () => row.removeEventListener('click', forwardPaddingClick);\n }, [forwards]);\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n ...(accent ? { boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}` } : {}),\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, rowClasses([]), rowStyle);\n }\n\n // The set goes here, not on the wrapper: `radio` and `checkbox` make their\n // descendants presentational, which would bury a control in the trailing slot.\n const controlAria = {\n role,\n tabIndex,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n };\n\n const hasLeading = isRenderableNode(leading);\n const boxed = leading !== undefined || dimmed !== undefined;\n const content = boxed ? (\n <span className=\"flex w-full min-w-0 items-center gap-[12px]\">\n {hasLeading && <span className=\"shrink-0 flex items-center\">{leading}</span>}\n <span\n className={`grid flex-1 min-w-0 grid-cols-[minmax(0,1fr)] transition-opacity ${dimmed ? 'opacity-60' : ''}`}\n >\n {children}\n </span>\n </span>\n ) : (\n children\n );\n\n if (hasTrailing) {\n const focusRing = disabled ? null : (\n <span\n aria-hidden=\"true\"\n data-malachite-row-ring=\"\"\n className={FOCUS_RING_INSET_OVERLAY_HIDDEN}\n />\n );\n const rowControlClasses = [\n ...controlReset,\n 'outline-none border-0 p-0 flex-1 min-w-0 text-left',\n ]\n .filter(Boolean)\n .join(' ');\n const anchor = Boolean(href) && !disabled;\n const control = anchor ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${rowControlClasses} no-underline text-inherit`}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </a>\n ) : onClick ? (\n <button\n ref={controlRef}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={rowControlClasses}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </button>\n ) : (\n <div className=\"flex-1 min-w-0\" data-malachite-row-control=\"\" {...rowFallbackAria}>\n {content}\n </div>\n );\n\n return (\n <div\n className={[\n chromeClasses,\n 'relative flex items-center',\n forwards ? 'cursor-pointer' : '',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n data-malachite-row=\"\"\n data-disabled={disabled ? '' : undefined}\n ref={rowRef}\n role={forwards ? 'presentation' : undefined}\n onPointerDownCapture={forwards ? startPress : undefined}\n onPointerUpCapture={forwards ? trackPress : undefined}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${forwards ? 'cursor-default' : ''} ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n data-malachite-row-slot=\"\"\n >\n {trailing}\n </div>\n </div>\n );\n }\n\n const classes = rowClasses(\n interactive ? [...controlReset, controlPadding, FOCUS_RING_INSET] : [],\n );\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${classes} no-underline text-inherit ${boxed ? 'block' : ''}`}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </a>\n );\n }\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={classes}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {content}\n </div>\n );\n};\n\nexport interface SurfaceExpandableRowProps {\n /** The row itself, laid out across the line. May hold its own controls. */\n header: React.ReactNode;\n /** The body, rendered beneath the row while it is open. */\n children?: React.ReactNode;\n expanded: boolean;\n /** Omit for a row that cannot open. The arrow's space is still reserved, so a list of\n * rows stays in one column whether or not each one has a body. */\n onToggle?: (expanded: boolean) => void;\n /**\n * Pins the row while its body scrolls, so a long body never leaves the reader without\n * the line it belongs to. Offset by whatever is already pinned above it.\n */\n sticky?: boolean;\n stickyTopOffset?: number;\n divider?: boolean;\n tone?: SurfaceRowProps['tone'];\n /** Names the disclosure control, which is otherwise only an arrow. */\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Stops a click inside it from toggling the row, for the cells that hold controls.\n *\n * Explicit rather than sniffing the event's target for an interactive ancestor: a control\n * rendering into a shadow root retargets the event to its host, so the sniff would miss\n * exactly the components most likely to sit in a row.\n */\nconst ExpandableRowControls: React.FC<{\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ children, className = '', style }) => (\n <div className={className} style={style} onClick={(event) => event.stopPropagation()}>\n {children}\n </div>\n);\n\n/**\n * A row that opens to reveal a body, for a line that carries its own controls.\n *\n * Not `Accordion`: that puts its header inside the toggle button, so a header holding a\n * dropdown or a second button is invalid. Here the row surface takes the click and a cell\n * opts out with `ExpandableRow.Controls`, while the arrow stays a real button so the\n * keyboard reaches it.\n */\n/**\n * The space before the header: the arrow's own inset, its glyph and the gap after it.\n * Exported so a consumer aligning a column header above these rows offsets by the same\n * amount instead of guessing at it.\n */\nexport const EXPANDABLE_ROW_LEAD_PX = 39;\n\nconst SurfaceExpandableRow: React.FC<SurfaceExpandableRowProps> & {\n Controls: typeof ExpandableRowControls;\n} = Object.assign(\n ({\n header,\n children,\n expanded,\n onToggle,\n sticky = false,\n stickyTopOffset = 0,\n divider = false,\n tone = 'default',\n 'aria-label': ariaLabel,\n className = '',\n style,\n }: SurfaceExpandableRowProps) => {\n const bodyId = React.useId();\n const toggle = onToggle ? () => onToggle(!expanded) : undefined;\n\n return (\n // The hover is the header's, not the row's: the row holds the open body too, which is\n // not a target, and tinting it washes out everything in it.\n <SurfaceRow\n divider={divider}\n tone={tone}\n hover={false}\n className={className}\n style={style}\n >\n {/* `group` so the arrow takes its hover state from the whole header line. */}\n <div\n className={`group flex items-center w-full ${ROW_HOVER_CLASSES} ${\n toggle ? 'cursor-pointer' : ''\n } ${\n sticky && expanded\n ? 'sticky z-[1] bg-[var(--malachite-card-background)]'\n : ''\n }`}\n style={sticky && expanded ? { top: stickyTopOffset } : undefined}\n // Presentational: the arrow below is the keyboard control, and this only\n // widens the pointer target.\n onClick={toggle}\n role=\"presentation\"\n >\n {/* Reserved whether or not this row opens, so a list stays in one column.\n The inset and gap match Accordion's header. */}\n <span className=\"shrink-0 flex items-center pl-[16px] pr-[12px]\">\n {toggle && (\n <button\n type=\"button\"\n className={`appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${FOCUS_RING_INSET}`}\n aria-expanded={expanded}\n aria-controls={bodyId}\n aria-label={ariaLabel}\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n >\n <DisclosureArrow expanded={expanded} />\n </button>\n )}\n </span>\n {header}\n </div>\n {expanded && <div id={bodyId}>{children}</div>}\n </SurfaceRow>\n );\n },\n { Controls: ExpandableRowControls },\n);\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<AnySurfaceRowProps>;\n ExpandableRow: typeof SurfaceExpandableRow;\n}\n\nconst SURFACE_TONE_CLASSES: Record<SurfaceTone, string> = {\n default:\n 'bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]',\n highlight: 'bg-[var(--malachite-card-warm-background,rgb(244,242,240))]',\n};\n\nconst FLAT_CLIP_RING =\n \"relative after:pointer-events-none after:absolute after:-inset-px after:z-[9] after:rounded-[inherit] after:border after:border-solid after:[border-color:inherit] after:content-['']\";\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n tone = 'default',\n shadow = tone !== 'highlight',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const clipsToBorder = overflow === 'clip' && !shadow && tone === 'default';\n const overflowClass = clipsToBorder\n ? 'overflow-visible'\n : overflow === 'clip'\n ? 'overflow-clip'\n : overflow === 'visible'\n ? 'overflow-visible'\n : 'overflow-hidden';\n return (\n <div\n className={`w-full rounded-[var(--malachite-radius-xxl,14px)] ${overflowClass} ${SURFACE_TONE_CLASSES[tone]} ${padding ? 'py-3 px-4' : ''} ${clipsToBorder ? FLAT_CLIP_RING : ''} ${className}`}\n style={{\n ...(shadow ? { boxShadow: TRIPLE_SHADOW } : {}),\n ...(clipsToBorder\n ? { clipPath: 'inset(0 round var(--malachite-radius-xxl, 14px))' }\n : {}),\n ...FOREGROUND_RESET,\n ...style,\n }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["ROW_HOVER_CLASSES","INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","selectsTextIn","row","root","selection","_a","index","forwardedClick","event","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","hoverable","selected","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","leading","dimmed","role","href","safeHref","ariaLabel","ariaLabelledBy","tabIndex","interactive","hover","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlReset","rowClasses","control","paints","accent","forwards","rowRef","useRef","controlRef","pressLeftPadding","startPress","trackPress","useEffect","forwardPaddingClick","leftPadding","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","controlAria","hasLeading","boxed","content","jsxs","jsx","focusRing","FOCUS_RING_INSET_OVERLAY_HIDDEN","rowControlClasses","resolveRel","classes","FOCUS_RING_INSET","ExpandableRowControls","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","SURFACE_TONE_CLASSES","FLAT_CLIP_RING","Surface","padding","overflow","shadow","clipsToBorder","FOREGROUND_RESET"],"mappings":";;;;;;;;;AA4EA,MAAMA,KACF,6EAEEC,KAA6E;AAAA,EAC/E,MAAM;AAAA;AAAA,EAEN,SAAS;AACb,GAyCMC,KAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,KAAkF;AAAA,EACpF,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,KACF,0KAEEC,KAAgB,CAACC,MAA0B;;AAC7C,QAAMC,IAAOD,EAAI,YAAA,GAEXE,MADgBC,IAAAF,EAAiD,iBAAjD,gBAAAE,EAAA,KAAAF,OACYD,EAAI,cAAc,aAAA;AACpD,MAAI,CAACE,KAAaA,EAAU;AACxB,WAAO;AAEX,WAASE,IAAQ,GAAGA,IAAQF,EAAU,YAAYE,KAAS;AACvD,QAAIF,EAAU,WAAWE,CAAK,EAAE,eAAeJ,CAAG;AAC9C,aAAO;AAGf,SAAO;AACX,GAEMK,KAAiB,CAACC,MACpB,IAAKA,EAAM,YAAkC,SAASA,CAAK,GAEzDC,KACF,yGASEC,KAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,OAAOC,IAAY;AAAA,IACnB,UAAAC;AAAA,IACA,WAAAZ;AAAA,IACA,MAAA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,SAAAsF,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,MAAAlF,IAAO;AAAA,EACP,QAAAmF,IAASnF,MAAS;AAAA,EAClB,MAAAa;AAAA,EACA,cAAcG;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAf,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAoB;AAEhB,QAAMiF,IAAgBF,MAAa,UAAU,CAACC,KAAUnF,MAAS;AAQjE,SACI,gBAAA2D;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,qDATGyB,IAChB,qBACAF,MAAa,SACX,kBACAA,MAAa,YACX,qBACA,iBAG2E,IAAIJ,GAAqB9E,CAAI,CAAC,IAAIiF,IAAU,cAAc,EAAE,IAAIG,IAAgBL,KAAiB,EAAE,IAAI7E,CAAS;AAAA,MAC7L,OAAO;AAAA,QACH,GAAIiF,IAAS,EAAE,WAAW3F,GAAA,IAAkB,CAAA;AAAA,QAC5C,GAAI4F,IACE,EAAE,UAAU,mDAAA,IACZ,CAAA;AAAA,QACN,GAAGC;AAAA,QACH,GAAGlF;AAAA,MAAA;AAAA,MAEP,MAAAU;AAAA,MACA,cAAYG;AAAA,MACZ,mBAAiBC;AAAA,MAEhB,UAAAtB;AAAA,IAAA;AAAA,EAAA;AAGb;AAEAqF,GAAQ,MAAMvF;AACduF,GAAQ,gBAAgBZ;"}
|
|
1
|
+
{"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { paintOnChild } from './asChild';\nimport { ROW_HOVER } from './chromeStyles';\nimport { FOCUS_RING_INSET, FOCUS_RING_INSET_OVERLAY_HIDDEN } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport type SurfaceTone = 'default' | 'highlight';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely. A flat, default-tone `clip` card clips at its border.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n /**\n * `false` drops the elevation shadow, for a card that sits flat on its ground.\n * Default: `true`, or `false` with `tone=\"highlight\"`.\n */\n shadow?: boolean;\n /**\n * `highlight` paints the warm ground with no border and no shadow, for a static block that\n * stands out from the page, such as a hero or a guide's section header. Its ground is too\n * close to `Surface.Row`'s hover for clickable rows inside it.\n */\n tone?: SurfaceTone;\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `tint` paints it\n * without the accent bar, for a menu whose choice is already marked inside the row;\n * `announce` leaves the visual to a control inside the row and only sets the ARIA state.\n * Defaults to `announce` under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'tint' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success` and `error` are for a row that carries\n * an outcome, where the result belongs to the whole line rather than to one cell in it.\n */\n tone?: 'default' | 'muted' | 'success' | 'error';\n /** `compact` is an 8px by 16px inset the row owns. */\n inset?: 'none' | 'compact';\n /** `false` leaves the hover to something inside the row. */\n hover?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst INSET_CLASSES: Record<NonNullable<SurfaceRowChromeProps['inset']>, string> = {\n none: '',\n // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** The row's indicator, before the children. With this or `dimmed`, pass one child. */\n leading?: React.ReactNode;\n /** Fades the children, not `leading` or `trailing`. */\n dimmed?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `-1` takes the row out of the Tab order, for a roving radio group. */\n tabIndex?: number;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background)]',\n error: 'bg-[var(--malachite-tag-error-background)]',\n};\n\n/**\n * The text an outcome tone carries with it, through the same context channel a selected row\n * uses, so `Typography` inside the row follows the tint instead of staying near-black on it.\n * `color` as well, for row content that is not Typography.\n *\n * Only the outcome tones. `muted` dims its subject rather than recolouring it, and its\n * foreground is the ordinary one.\n */\nconst TONE_FOREGROUNDS: Partial<Record<NonNullable<SurfaceRowProps['tone']>, string>> = {\n success: 'var(--malachite-tag-success-foreground)',\n error: 'var(--malachite-tag-error-foreground)',\n};\n\nexport interface SurfaceRowAsChildProps extends SurfaceRowChromeProps {\n asChild: true;\n children: React.ReactElement;\n}\n\nexport type AnySurfaceRowProps = SurfaceRowProps | SurfaceRowAsChildProps;\n\n// Not `group-hover` or `group-has-[:focus-visible]`: WebKit never applies the first (its\n// `@media (hover: hover)` nested in the group selector) nor the second inside a shadow root,\n// so the control stayed hidden in Safari. An open menu takes focus out of the row into a\n// portal, and would otherwise lose its trigger.\nconst REVEALED_ON_INTERACTION =\n 'opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100';\n\nconst selectsTextIn = (row: Element): boolean => {\n const root = row.getRootNode();\n const ownSelection = (root as Partial<Pick<Document, 'getSelection'>>).getSelection?.();\n const selection = ownSelection ?? row.ownerDocument.getSelection();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n for (let index = 0; index < selection.rangeCount; index += 1) {\n if (selection.getRangeAt(index).intersectsNode(row)) {\n return true;\n }\n }\n return false;\n};\n\nconst forwardedClick = (event: MouseEvent): MouseEvent =>\n new (event.constructor as typeof MouseEvent)('click', event);\n\nconst TRIPLE_SHADOW =\n '0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)';\n\n/**\n * A single full-bleed row inside a <Surface>. Owns the row chrome — hover\n * highlight, colour transition and an optional bottom divider — so consumers\n * compose their own content inside without re-implementing design-system styling.\n * Pass `onClick`/`href` to make the entire row clickable (rendered as a real\n * button/anchor, so keyboard navigation works natively).\n */\nconst SurfaceRow: React.FC<AnySurfaceRowProps> = (props) => {\n const {\n children,\n divider = false,\n disabled = false,\n hover: hoverable = true,\n selected,\n selection,\n tone = 'default',\n inset = 'none',\n className = '',\n style,\n } = props;\n const asChild = props.asChild === true;\n const {\n onClick,\n href: rawHref,\n target,\n rel,\n trailing,\n revealTrailing,\n leading,\n dimmed,\n role,\n } = asChild ? ({} as SurfaceRowProps) : (props as SurfaceRowProps);\n // A rejected href (e.g. `javascript:`) leaves the row a button or a plain row, never an anchor.\n const href = safeHref(rawHref);\n const ariaLabel = asChild ? undefined : (props as SurfaceRowProps)['aria-label'];\n const ariaLabelledBy = asChild ? undefined : (props as SurfaceRowProps)['aria-labelledby'];\n const tabIndex = asChild ? undefined : (props as SurfaceRowProps).tabIndex;\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover = disabled && (interactive || asChild) ? '' : hoverable ? ROW_HOVER : '';\n\n // A class, not an inline colour, which would outrank the hover utility. It replaces the\n // button reset's `bg-transparent` rather than joining it: same specificity, so the winner\n // would be whichever Tailwind emitted last.\n const tinted = tone !== 'default';\n const toneClass = TONE_CLASSES[tone];\n\n const hasTrailing = !asChild && isRenderableNode(trailing);\n const insetClass = INSET_CLASSES[inset];\n const controlPadding = insetClass ? '' : 'p-0';\n\n const chromeClasses = [\n 'w-full text-left border-0',\n toneClass,\n divider ? 'border-b border-solid border-[var(--malachite-card-border)]' : '',\n hover,\n ]\n .filter(Boolean)\n .join(' ');\n\n const controlReset = [\n 'appearance-none',\n tinted ? '' : 'bg-transparent',\n disabled ? '' : 'cursor-pointer',\n ];\n const rowClasses = (control: string[]) =>\n [chromeClasses, ...control, insetClass, className].filter(Boolean).join(' ');\n\n const paints = selection ? selection !== 'announce' : role !== 'checkbox';\n const accent = selection !== 'tint';\n\n const forwards = hasTrailing && Boolean(onClick) && !href && !disabled;\n const rowRef = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLButtonElement>(null);\n const pressLeftPadding = useRef(false);\n const startPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current = event.target !== event.currentTarget;\n };\n const trackPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current ||= event.target !== event.currentTarget;\n };\n useEffect(() => {\n const row = rowRef.current;\n if (!forwards || !row) {\n return undefined;\n }\n const forwardPaddingClick = (event: MouseEvent) => {\n const leftPadding = pressLeftPadding.current;\n pressLeftPadding.current = false;\n const control = controlRef.current;\n if (\n !control ||\n event.target !== row ||\n leftPadding ||\n (event.detail <= 1 && !event.shiftKey && selectsTextIn(row))\n ) {\n return;\n }\n event.stopPropagation();\n control.focus({ preventScroll: true });\n control.dispatchEvent(forwardedClick(event));\n };\n row.addEventListener('click', forwardPaddingClick);\n return () => row.removeEventListener('click', forwardPaddingClick);\n }, [forwards]);\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n ...(accent ? { boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}` } : {}),\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, rowClasses([]), rowStyle);\n }\n\n // The set goes here, not on the wrapper: `radio` and `checkbox` make their\n // descendants presentational, which would bury a control in the trailing slot.\n const controlAria = {\n role,\n tabIndex,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n };\n\n const hasLeading = isRenderableNode(leading);\n const boxed = leading !== undefined || dimmed !== undefined;\n const content = boxed ? (\n <span className=\"flex w-full min-w-0 items-center gap-[12px]\">\n {hasLeading && <span className=\"shrink-0 flex items-center\">{leading}</span>}\n <span\n className={`grid flex-1 min-w-0 grid-cols-[minmax(0,1fr)] transition-opacity ${dimmed ? 'opacity-60' : ''}`}\n >\n {children}\n </span>\n </span>\n ) : (\n children\n );\n\n if (hasTrailing) {\n const focusRing = disabled ? null : (\n <span\n aria-hidden=\"true\"\n data-malachite-row-ring=\"\"\n className={FOCUS_RING_INSET_OVERLAY_HIDDEN}\n />\n );\n const rowControlClasses = [\n ...controlReset,\n 'outline-none border-0 p-0 flex-1 min-w-0 text-left',\n ]\n .filter(Boolean)\n .join(' ');\n const anchor = Boolean(href) && !disabled;\n const control = anchor ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${rowControlClasses} no-underline text-inherit`}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </a>\n ) : onClick ? (\n <button\n ref={controlRef}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={rowControlClasses}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </button>\n ) : (\n <div className=\"flex-1 min-w-0\" data-malachite-row-control=\"\" {...rowFallbackAria}>\n {content}\n </div>\n );\n\n return (\n <div\n className={[\n chromeClasses,\n 'relative flex items-center',\n forwards ? 'cursor-pointer' : '',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n data-malachite-row=\"\"\n data-disabled={disabled ? '' : undefined}\n ref={rowRef}\n role={forwards ? 'presentation' : undefined}\n onPointerDownCapture={forwards ? startPress : undefined}\n onPointerUpCapture={forwards ? trackPress : undefined}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${forwards ? 'cursor-default' : ''} ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n data-malachite-row-slot=\"\"\n >\n {trailing}\n </div>\n </div>\n );\n }\n\n const classes = rowClasses(\n interactive ? [...controlReset, controlPadding, FOCUS_RING_INSET] : [],\n );\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${classes} no-underline text-inherit ${boxed ? 'block' : ''}`}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </a>\n );\n }\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={classes}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {content}\n </div>\n );\n};\n\nexport interface SurfaceExpandableRowProps {\n /** The row itself, laid out across the line. May hold its own controls. */\n header: React.ReactNode;\n /** The body, rendered beneath the row while it is open. */\n children?: React.ReactNode;\n expanded: boolean;\n /** Omit for a row that cannot open. The arrow's space is still reserved, so a list of\n * rows stays in one column whether or not each one has a body. */\n onToggle?: (expanded: boolean) => void;\n /**\n * Pins the row while its body scrolls, so a long body never leaves the reader without\n * the line it belongs to. Offset by whatever is already pinned above it.\n */\n sticky?: boolean;\n stickyTopOffset?: number;\n divider?: boolean;\n tone?: SurfaceRowProps['tone'];\n /** Names the disclosure control, which is otherwise only an arrow. */\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Stops a click inside it from toggling the row, for the cells that hold controls.\n *\n * Explicit rather than sniffing the event's target for an interactive ancestor: a control\n * rendering into a shadow root retargets the event to its host, so the sniff would miss\n * exactly the components most likely to sit in a row.\n */\nconst ExpandableRowControls: React.FC<{\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ children, className = '', style }) => (\n <div className={className} style={style} onClick={(event) => event.stopPropagation()}>\n {children}\n </div>\n);\n\n/**\n * A row that opens to reveal a body, for a line that carries its own controls.\n *\n * Not `Accordion`: that puts its header inside the toggle button, so a header holding a\n * dropdown or a second button is invalid. Here the row surface takes the click and a cell\n * opts out with `ExpandableRow.Controls`, while the arrow stays a real button so the\n * keyboard reaches it.\n */\n/**\n * The space before the header: the arrow's own inset, its glyph and the gap after it.\n * Exported so a consumer aligning a column header above these rows offsets by the same\n * amount instead of guessing at it.\n */\nexport const EXPANDABLE_ROW_LEAD_PX = 39;\n\nconst SurfaceExpandableRow: React.FC<SurfaceExpandableRowProps> & {\n Controls: typeof ExpandableRowControls;\n} = Object.assign(\n ({\n header,\n children,\n expanded,\n onToggle,\n sticky = false,\n stickyTopOffset = 0,\n divider = false,\n tone = 'default',\n 'aria-label': ariaLabel,\n className = '',\n style,\n }: SurfaceExpandableRowProps) => {\n const bodyId = React.useId();\n const toggle = onToggle ? () => onToggle(!expanded) : undefined;\n\n return (\n // The hover is the header's, not the row's: the row holds the open body too, which is\n // not a target, and tinting it washes out everything in it.\n <SurfaceRow\n divider={divider}\n tone={tone}\n hover={false}\n className={className}\n style={style}\n >\n {/* `group` so the arrow takes its hover state from the whole header line. */}\n <div\n className={`group flex items-center w-full ${ROW_HOVER} ${\n toggle ? 'cursor-pointer' : ''\n } ${\n sticky && expanded\n ? 'sticky z-[1] bg-[var(--malachite-card-background)]'\n : ''\n }`}\n style={sticky && expanded ? { top: stickyTopOffset } : undefined}\n // Presentational: the arrow below is the keyboard control, and this only\n // widens the pointer target.\n onClick={toggle}\n role=\"presentation\"\n >\n {/* Reserved whether or not this row opens, so a list stays in one column.\n The inset and gap match Accordion's header. */}\n <span className=\"shrink-0 flex items-center pl-[16px] pr-[12px]\">\n {toggle && (\n <button\n type=\"button\"\n className={`appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${FOCUS_RING_INSET}`}\n aria-expanded={expanded}\n aria-controls={bodyId}\n aria-label={ariaLabel}\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n >\n <DisclosureArrow expanded={expanded} />\n </button>\n )}\n </span>\n {header}\n </div>\n {expanded && <div id={bodyId}>{children}</div>}\n </SurfaceRow>\n );\n },\n { Controls: ExpandableRowControls },\n);\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<AnySurfaceRowProps>;\n ExpandableRow: typeof SurfaceExpandableRow;\n}\n\nconst SURFACE_TONE_CLASSES: Record<SurfaceTone, string> = {\n default:\n 'bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]',\n highlight: 'bg-[var(--malachite-card-warm-background,rgb(244,242,240))]',\n};\n\nconst FLAT_CLIP_RING =\n \"relative after:pointer-events-none after:absolute after:-inset-px after:z-[9] after:rounded-[inherit] after:border after:border-solid after:[border-color:inherit] after:content-['']\";\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n tone = 'default',\n shadow = tone !== 'highlight',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const clipsToBorder = overflow === 'clip' && !shadow && tone === 'default';\n const overflowClass = clipsToBorder\n ? 'overflow-visible'\n : overflow === 'clip'\n ? 'overflow-clip'\n : overflow === 'visible'\n ? 'overflow-visible'\n : 'overflow-hidden';\n return (\n <div\n className={`w-full rounded-[var(--malachite-radius-xxl,14px)] ${overflowClass} ${SURFACE_TONE_CLASSES[tone]} ${padding ? 'py-3 px-4' : ''} ${clipsToBorder ? FLAT_CLIP_RING : ''} ${className}`}\n style={{\n ...(shadow ? { boxShadow: TRIPLE_SHADOW } : {}),\n ...(clipsToBorder\n ? { clipPath: 'inset(0 round var(--malachite-radius-xxl, 14px))' }\n : {}),\n ...FOREGROUND_RESET,\n ...style,\n }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","selectsTextIn","row","root","selection","_a","index","forwardedClick","event","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","hoverable","selected","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","leading","dimmed","role","href","safeHref","ariaLabel","ariaLabelledBy","tabIndex","interactive","hover","ROW_HOVER","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlReset","rowClasses","control","paints","accent","forwards","rowRef","useRef","controlRef","pressLeftPadding","startPress","trackPress","useEffect","forwardPaddingClick","leftPadding","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","controlAria","hasLeading","boxed","content","jsxs","jsx","focusRing","FOCUS_RING_INSET_OVERLAY_HIDDEN","rowControlClasses","resolveRel","classes","FOCUS_RING_INSET","ExpandableRowControls","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","SURFACE_TONE_CLASSES","FLAT_CLIP_RING","Surface","padding","overflow","shadow","clipsToBorder","FOREGROUND_RESET"],"mappings":";;;;;;;;;;AA6EA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA;AAAA,EAEN,SAAS;AACb,GAyCMC,KAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,KAAkF;AAAA,EACpF,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,KACF,0KAEEC,KAAgB,CAACC,MAA0B;;AAC7C,QAAMC,IAAOD,EAAI,YAAA,GAEXE,MADgBC,IAAAF,EAAiD,iBAAjD,gBAAAE,EAAA,KAAAF,OACYD,EAAI,cAAc,aAAA;AACpD,MAAI,CAACE,KAAaA,EAAU;AACxB,WAAO;AAEX,WAASE,IAAQ,GAAGA,IAAQF,EAAU,YAAYE,KAAS;AACvD,QAAIF,EAAU,WAAWE,CAAK,EAAE,eAAeJ,CAAG;AAC9C,aAAO;AAGf,SAAO;AACX,GAEMK,KAAiB,CAACC,MACpB,IAAKA,EAAM,YAAkC,SAASA,CAAK,GAEzDC,KACF,yGASEC,KAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,OAAOC,IAAY;AAAA,IACnB,UAAAC;AAAA,IACA,WAAAZ;AAAA,IACA,MAAAa,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA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IAASpF,MAAS;AAAA,EAClB,MAAAa;AAAA,EACA,cAAcG;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAf,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAoB;AAEhB,QAAMkF,IAAgBF,MAAa,UAAU,CAACC,KAAUpF,MAAS;AAQjE,SACI,gBAAA4D;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,qDATGyB,IAChB,qBACAF,MAAa,SACX,kBACAA,MAAa,YACX,qBACA,iBAG2E,IAAIJ,GAAqB/E,CAAI,CAAC,IAAIkF,IAAU,cAAc,EAAE,IAAIG,IAAgBL,KAAiB,EAAE,IAAI9E,CAAS;AAAA,MAC7L,OAAO;AAAA,QACH,GAAIkF,IAAS,EAAE,WAAW5F,GAAA,IAAkB,CAAA;AAAA,QAC5C,GAAI6F,IACE,EAAE,UAAU,mDAAA,IACZ,CAAA;AAAA,QACN,GAAGC;AAAA,QACH,GAAGnF;AAAA,MAAA;AAAA,MAEP,MAAAU;AAAA,MACA,cAAYG;AAAA,MACZ,mBAAiBC;AAAA,MAEhB,UAAAtB;AAAA,IAAA;AAAA,EAAA;AAGb;AAEAsF,GAAQ,MAAMxF;AACdwF,GAAQ,gBAAgBZ;"}
|
|
@@ -1,59 +1,66 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useId as z } from "react";
|
|
3
|
+
import { Tag as I } from "./Tag.js";
|
|
4
|
+
import o from "./Typography/Text.js";
|
|
5
|
+
import { getFontWeight as _, getFontFamily as j } from "./Typography/textStyles.js";
|
|
6
|
+
import { devWarning as F } from "./devWarning.js";
|
|
7
|
+
const p = {
|
|
6
8
|
neutral: "var(--malachite-text-secondary, rgb(123, 123, 123))",
|
|
7
9
|
info: "var(--malachite-text-info, rgb(12, 88, 174))",
|
|
8
10
|
success: "var(--malachite-text-success, rgb(2, 122, 66))",
|
|
9
11
|
warning: "var(--malachite-text-warning, rgb(150, 88, 10))",
|
|
10
12
|
error: "var(--malachite-text-error, rgb(237, 53, 54))"
|
|
11
|
-
},
|
|
12
|
-
fontFamily:
|
|
13
|
-
fontWeight:
|
|
13
|
+
}, E = {
|
|
14
|
+
fontFamily: j("mono"),
|
|
15
|
+
fontWeight: _("semi-bold"),
|
|
14
16
|
fontSize: "0.92em",
|
|
15
17
|
wordSpacing: "-0.25em",
|
|
16
18
|
marginLeft: "0.08em"
|
|
17
|
-
},
|
|
19
|
+
}, O = /* @__PURE__ */ e(
|
|
18
20
|
"svg",
|
|
19
21
|
{
|
|
20
22
|
"data-timeline-skipped": "",
|
|
21
23
|
width: "14",
|
|
22
24
|
height: "14",
|
|
23
25
|
viewBox: "0 0 24 24",
|
|
24
|
-
className: "block
|
|
26
|
+
className: "block",
|
|
27
|
+
style: { color: p.neutral },
|
|
25
28
|
children: /* @__PURE__ */ e(
|
|
26
29
|
"path",
|
|
27
30
|
{
|
|
28
|
-
|
|
29
|
-
d: "
|
|
30
|
-
fill: "none",
|
|
31
|
-
stroke: "currentColor",
|
|
32
|
-
strokeWidth: "2.4",
|
|
33
|
-
strokeLinecap: "round",
|
|
34
|
-
strokeLinejoin: "round"
|
|
31
|
+
fill: "currentColor",
|
|
32
|
+
d: "M5.15 9.85l6 6a1.2 1.2 0 0 0 1.7 0l6-6A1.2 1.2 0 0 0 17.15 8.15L12 13.3 6.85 8.15A1.2 1.2 0 0 0 5.15 9.85Z"
|
|
35
33
|
}
|
|
36
34
|
)
|
|
37
35
|
}
|
|
38
|
-
),
|
|
36
|
+
), W = ({
|
|
39
37
|
title: n,
|
|
40
|
-
titleCode:
|
|
41
|
-
time:
|
|
42
|
-
tone:
|
|
43
|
-
marker:
|
|
44
|
-
icon:
|
|
45
|
-
skipped:
|
|
46
|
-
stopped:
|
|
47
|
-
stoppedLabel:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
titleCode: t,
|
|
39
|
+
time: l,
|
|
40
|
+
tone: c,
|
|
41
|
+
marker: h,
|
|
42
|
+
icon: f,
|
|
43
|
+
skipped: s = !1,
|
|
44
|
+
stopped: g = !1,
|
|
45
|
+
stoppedLabel: m,
|
|
46
|
+
skippedLabel: d,
|
|
47
|
+
meta: w = [],
|
|
48
|
+
children: u,
|
|
49
|
+
className: v = ""
|
|
51
50
|
}) => {
|
|
52
|
-
const
|
|
53
|
-
|
|
51
|
+
const y = z();
|
|
52
|
+
if (s && g) {
|
|
53
|
+
const r = typeof n == "string" ? n : "";
|
|
54
|
+
F(
|
|
55
|
+
`Timeline.Item.skipped+stopped:${r || y}`,
|
|
56
|
+
`Timeline.Item${r ? ` "${r}"` : " (with a non-string title)"} got both \`skipped\` and \`stopped\`; a step that never ran can't be the one the flow ended on, so the badge is dropped.`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
const x = g && !s, i = c ?? (x ? "error" : "neutral"), N = s ? O : h, T = !s && !!h, b = t == null ? void 0 : t.trim();
|
|
60
|
+
return /* @__PURE__ */ a(
|
|
54
61
|
"li",
|
|
55
62
|
{
|
|
56
|
-
className: `relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${
|
|
63
|
+
className: `relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${v}`,
|
|
57
64
|
children: [
|
|
58
65
|
/* @__PURE__ */ e(
|
|
59
66
|
"span",
|
|
@@ -67,40 +74,44 @@ const f = {
|
|
|
67
74
|
"span",
|
|
68
75
|
{
|
|
69
76
|
"aria-hidden": "true",
|
|
70
|
-
className: `flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${
|
|
71
|
-
children:
|
|
77
|
+
className: `flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${T ? "" : "border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]"}`,
|
|
78
|
+
children: N || (f ? /* @__PURE__ */ e(
|
|
72
79
|
"span",
|
|
73
80
|
{
|
|
74
81
|
"data-timeline-icon": i,
|
|
75
82
|
className: "flex h-[14px] w-[14px] items-center justify-center overflow-hidden [&>*]:max-h-full [&>*]:max-w-full [&_svg]:max-h-[14px] [&_svg]:max-w-[14px]",
|
|
76
|
-
style: { color:
|
|
77
|
-
children:
|
|
83
|
+
style: { color: p[i] },
|
|
84
|
+
children: f
|
|
78
85
|
}
|
|
79
86
|
) : /* @__PURE__ */ e(
|
|
80
87
|
"span",
|
|
81
88
|
{
|
|
82
89
|
"data-timeline-dot": i,
|
|
83
90
|
className: "h-[8px] w-[8px] rounded-full",
|
|
84
|
-
style: { backgroundColor:
|
|
91
|
+
style: { backgroundColor: p[i] }
|
|
85
92
|
}
|
|
86
93
|
))
|
|
87
94
|
}
|
|
88
95
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]", children: [
|
|
97
|
+
/* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-[12px]", children: [
|
|
98
|
+
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]", children: [
|
|
99
|
+
/* @__PURE__ */ a(o, { size: "small", fontWeight: "bold", className: "min-w-0 leading-[18px]", children: [
|
|
93
100
|
n,
|
|
94
|
-
|
|
101
|
+
b && /* @__PURE__ */ a($, { children: [
|
|
95
102
|
n ? " " : null,
|
|
96
|
-
/* @__PURE__ */ e("span", { translate: "no", style:
|
|
103
|
+
/* @__PURE__ */ e("span", { translate: "no", style: E, children: b })
|
|
97
104
|
] })
|
|
98
105
|
] }),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
s && /* @__PURE__ */ a("span", { className: "sr-only", children: [
|
|
107
|
+
", ",
|
|
108
|
+
(d == null ? void 0 : d.trim()) || "skipped"
|
|
109
|
+
] }),
|
|
110
|
+
x && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
|
|
111
|
+
x && /* @__PURE__ */ e(
|
|
112
|
+
I,
|
|
102
113
|
{
|
|
103
|
-
value: (
|
|
114
|
+
value: (m == null ? void 0 : m.trim()) || "Stopped here",
|
|
104
115
|
type: "error",
|
|
105
116
|
fontSize: "xsmall",
|
|
106
117
|
textTransform: "none",
|
|
@@ -108,53 +119,53 @@ const f = {
|
|
|
108
119
|
}
|
|
109
120
|
)
|
|
110
121
|
] }),
|
|
111
|
-
(
|
|
112
|
-
(
|
|
113
|
-
|
|
122
|
+
(l || l === 0) && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
|
|
123
|
+
(l || l === 0) && /* @__PURE__ */ e(
|
|
124
|
+
o,
|
|
114
125
|
{
|
|
115
126
|
size: "xsmall",
|
|
116
127
|
color: "secondary",
|
|
117
128
|
font: "mono",
|
|
118
129
|
wrap: !1,
|
|
119
130
|
className: "pt-[2px]",
|
|
120
|
-
children:
|
|
131
|
+
children: l
|
|
121
132
|
}
|
|
122
133
|
)
|
|
123
134
|
] }),
|
|
124
|
-
|
|
135
|
+
w.length > 0 && /* @__PURE__ */ e("dl", { className: "m-0 flex flex-wrap gap-x-[18px] gap-y-[6px] leading-[16px]", children: w.map((r, S) => /* @__PURE__ */ a(
|
|
125
136
|
"div",
|
|
126
137
|
{
|
|
127
138
|
className: "flex min-w-0 items-baseline gap-[3px]",
|
|
128
139
|
children: [
|
|
129
|
-
/* @__PURE__ */ e("dt", { className: "flex", children: /* @__PURE__ */ e(
|
|
130
|
-
/* @__PURE__ */ e("dd", { className: "m-0 flex min-w-0 [overflow-wrap:anywhere]", children: /* @__PURE__ */ e(
|
|
140
|
+
/* @__PURE__ */ e("dt", { className: "flex", children: /* @__PURE__ */ e(o, { size: "xsmall", color: "secondary", children: r.label }) }),
|
|
141
|
+
/* @__PURE__ */ e("dd", { className: "m-0 flex min-w-0 [overflow-wrap:anywhere]", children: /* @__PURE__ */ e(o, { size: "xsmall", font: "mono", children: r.value }) })
|
|
131
142
|
]
|
|
132
143
|
},
|
|
133
|
-
`${
|
|
144
|
+
`${r.label}-${S}`
|
|
134
145
|
)) }),
|
|
135
|
-
|
|
146
|
+
u
|
|
136
147
|
] })
|
|
137
148
|
]
|
|
138
149
|
}
|
|
139
150
|
);
|
|
140
|
-
},
|
|
151
|
+
}, A = ({
|
|
141
152
|
children: n,
|
|
142
|
-
className:
|
|
143
|
-
"aria-label":
|
|
144
|
-
"aria-labelledby":
|
|
153
|
+
className: t = "",
|
|
154
|
+
"aria-label": l,
|
|
155
|
+
"aria-labelledby": c
|
|
145
156
|
}) => /* @__PURE__ */ e(
|
|
146
157
|
"ol",
|
|
147
158
|
{
|
|
148
159
|
role: "list",
|
|
149
|
-
"aria-label":
|
|
150
|
-
"aria-labelledby":
|
|
151
|
-
className: `m-0 list-none p-0 ${
|
|
160
|
+
"aria-label": l,
|
|
161
|
+
"aria-labelledby": c,
|
|
162
|
+
className: `m-0 list-none p-0 ${t}`,
|
|
152
163
|
children: n
|
|
153
164
|
}
|
|
154
165
|
);
|
|
155
|
-
|
|
166
|
+
A.Item = W;
|
|
156
167
|
export {
|
|
157
|
-
|
|
158
|
-
|
|
168
|
+
A as Timeline,
|
|
169
|
+
A as default
|
|
159
170
|
};
|
|
160
171
|
//# sourceMappingURL=Timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.js","sources":["../../src/components/Timeline.tsx"],"sourcesContent":["import React from 'react';\nimport Tag from './Tag';\nimport Text from './Typography/Text';\nimport { getFontFamily, getFontWeight } from './Typography/textStyles';\n\nexport type TimelineTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';\n\nexport interface TimelineProps {\n children: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface TimelineMetaEntry {\n label: string;\n value: React.ReactNode;\n}\n\nexport interface TimelineItemProps {\n title: React.ReactNode;\n /**\n * Code set after the title in the mono face, as one phrase with it, e.g. `title=\"n8n called\"`\n * with `titleCode=\"Salesforce | Delete contact\"`.\n */\n titleCode?: string;\n /** When the step happened, shown at the right of the title, e.g. `+6 ms`. */\n time?: React.ReactNode;\n /**\n * Paints the dot or the `icon`: `error` on a `stopped` step, else `neutral`, unless set. Colour\n * alone, so the title has to say what happened. Ignored when `marker` is set.\n */\n tone?: TimelineTone;\n /** Replaces the ringed dot with a 24px circle of its own, e.g. the caller's logo at size 24. Decorative: hidden from assistive tech. */\n marker?: React.ReactNode;\n /**\n * A 12-14px glyph drawn inside the ring in place of the dot, e.g. `<McpIcon size={13} />`, painted\n * by `tone` through `currentColor`. Use a filled glyph: inside the shadow root every unmarked svg\n * path is filled, so a stroke-only icon turns solid.\n * Decorative: hidden from assistive tech, so the title has to say what it stands for.\n * Precedence: `skipped`, then `marker`, then `icon`, then the dot.\n */\n icon?: React.ReactNode;\n /** A step that never ran: a grey chevron replaces the dot, `tone`, `marker` and `icon`. */\n skipped?: boolean;\n /** Marks the step the flow ended on, with a badge after the title. */\n stopped?: boolean;\n /** The badge's text when `stopped`. Empty falls back to \"Stopped here\". */\n stoppedLabel?: string;\n /** Label and value pairs in a wrapping row under the title. */\n meta?: readonly TimelineMetaEntry[];\n /**\n * The step's detail, below the title: tags, copy, payloads. Each child is a row of its own, 8px\n * apart, and unstyled, so wrap copy in `Typography.Text`.\n */\n children?: React.ReactNode;\n className?: string;\n}\n\n// The light theme's values as fallbacks: the dot paints before the theme reaches `:host`.\nconst DOT_COLOR: Record<TimelineTone, string> = {\n neutral: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n info: 'var(--malachite-text-info, rgb(12, 88, 174))',\n success: 'var(--malachite-text-success, rgb(2, 122, 66))',\n warning: 'var(--malachite-text-warning, rgb(150, 88, 10))',\n error: 'var(--malachite-text-error, rgb(237, 53, 54))',\n};\n\n// Mono runs wider than Inter, so it sits a touch under the title, at 0.92em of whatever size the\n// title is, and colour is the title's. A mono space is as wide as a letter, about twice the\n// title's, so the word spacing closes it to match, and a hair of margin evens the gap before it.\nconst TITLE_CODE_STYLE: React.CSSProperties = {\n fontFamily: getFontFamily('mono'),\n fontWeight: getFontWeight('semi-bold'),\n fontSize: '0.92em',\n wordSpacing: '-0.25em',\n marginLeft: '0.08em',\n};\n\n// Stroked, so it opts out of the global path fill reset.\nconst SKIPPED_MARK = (\n <svg\n data-timeline-skipped=\"\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n className=\"block text-[var(--malachite-text-placeholder,rgb(187,187,187))]\"\n >\n <path\n data-malachite-shape=\"\"\n d=\"M6 9l6 6 6-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.4\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nconst Item: React.FC<TimelineItemProps> = ({\n title,\n titleCode,\n time,\n tone,\n marker,\n icon,\n skipped = false,\n stopped = false,\n stoppedLabel,\n meta = [],\n children,\n className = '',\n}) => {\n const dotTone = tone ?? (stopped ? 'error' : 'neutral');\n const shownMarker = skipped ? SKIPPED_MARK : marker;\n const code = titleCode?.trim();\n return (\n <li\n className={`relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${className}`}\n >\n <span\n data-timeline-line=\"\"\n aria-hidden=\"true\"\n className=\"absolute start-[11px] top-[26px] bottom-[2px] w-[2px] bg-[var(--malachite-card-border,rgb(232,232,232))]\"\n />\n <span\n aria-hidden=\"true\"\n // The ring's border would cut into a marker, so a marker gets the full 24px circle instead.\n className={`flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${shownMarker ? '' : 'border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]'}`}\n >\n {shownMarker ||\n (icon ? (\n <span\n data-timeline-icon={dotTone}\n className=\"flex h-[14px] w-[14px] items-center justify-center overflow-hidden [&>*]:max-h-full [&>*]:max-w-full [&_svg]:max-h-[14px] [&_svg]:max-w-[14px]\"\n style={{ color: DOT_COLOR[dotTone] }}\n >\n {icon}\n </span>\n ) : (\n <span\n data-timeline-dot={dotTone}\n className=\"h-[8px] w-[8px] rounded-full\"\n style={{ backgroundColor: DOT_COLOR[dotTone] }}\n />\n ))}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]\">\n <div className=\"flex items-start justify-between gap-[12px]\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]\">\n <Text size=\"small\" fontWeight=\"bold\" className=\"min-w-0 leading-[18px]\">\n {title}\n {code && (\n <>\n {title ? ' ' : null}\n <span translate=\"no\" style={TITLE_CODE_STYLE}>\n {code}\n </span>\n </>\n )}\n </Text>\n {stopped && <span className=\"sr-only\">, </span>}\n {stopped && (\n <Tag\n value={stoppedLabel?.trim() || 'Stopped here'}\n type=\"error\"\n fontSize=\"xsmall\"\n textTransform=\"none\"\n paddingSize=\"compact\"\n />\n )}\n </div>\n {(time || time === 0) && <span className=\"sr-only\">, </span>}\n {(time || time === 0) && (\n <Text\n size=\"xsmall\"\n color=\"secondary\"\n font=\"mono\"\n wrap={false}\n className=\"pt-[2px]\"\n >\n {time}\n </Text>\n )}\n </div>\n {meta.length > 0 && (\n <dl className=\"m-0 flex flex-wrap gap-x-[18px] gap-y-[6px] leading-[16px]\">\n {meta.map((entry, index) => (\n <div\n key={`${entry.label}-${index}`}\n className=\"flex min-w-0 items-baseline gap-[3px]\"\n >\n <dt className=\"flex\">\n <Text size=\"xsmall\" color=\"secondary\">\n {entry.label}\n </Text>\n </dt>\n <dd className=\"m-0 flex min-w-0 [overflow-wrap:anywhere]\">\n <Text size=\"xsmall\" font=\"mono\">\n {entry.value}\n </Text>\n </dd>\n </div>\n ))}\n </dl>\n )}\n {children}\n </div>\n </li>\n );\n};\n\n/** A vertical sequence of steps, each with a dot on a connecting line, a title, its timing and a body. */\nconst Timeline: React.FC<TimelineProps> & { Item: typeof Item } = ({\n children,\n className = '',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}) => (\n <ol\n // list-style: none strips list semantics in WebKit, so VoiceOver would not announce the steps.\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`m-0 list-none p-0 ${className}`}\n >\n {children}\n </ol>\n);\n\nTimeline.Item = Item;\n\nexport default Timeline;\nexport { Timeline };\n"],"names":["DOT_COLOR","TITLE_CODE_STYLE","getFontFamily","getFontWeight","SKIPPED_MARK","jsx","Item","title","titleCode","time","tone","marker","icon","skipped","stopped","stoppedLabel","meta","children","className","dotTone","shownMarker","code","jsxs","Text","Fragment","Tag","entry","index","Timeline","ariaLabel","ariaLabelledBy"],"mappings":";;;;AA4DA,MAAMA,IAA0C;AAAA,EAC5C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAKMC,IAAwC;AAAA,EAC1C,YAAYC,EAAc,MAAM;AAAA,EAChC,YAAYC,EAAc,WAAW;AAAA,EACrC,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAChB,GAGMC,IACF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,yBAAsB;AAAA,IACtB,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,WAAU;AAAA,IAEV,UAAA,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,wBAAqB;AAAA,QACrB,GAAE;AAAA,QACF,MAAK;AAAA,QACL,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA,MAAA;AAAA,IAAA;AAAA,EACnB;AACJ,GAGEC,IAAoC,CAAC;AAAA,EACvC,OAAAC;AAAA,EACA,WAAAC;AAAA,E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K,QACpB,UAAAG,EAAM,MAAA,CACX,EAAA,CACJ;AAAA,cAAA;AAAA,YAAA;AAAA,YAZK,GAAGA,EAAM,KAAK,IAAIC,CAAK;AAAA,UAAA,CAcnC,GACL;AAAA,UAEHV;AAAA,QAAA,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ,GAGMW,IAA4D,CAAC;AAAA,EAC/D,UAAAX;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAcW;AAAA,EACd,mBAAmBC;AACvB,MACI,gBAAAzB;AAAA,EAAC;AAAA,EAAA;AAAA,IAEG,MAAK;AAAA,IACL,cAAYwB;AAAA,IACZ,mBAAiBC;AAAA,IACjB,WAAW,qBAAqBZ,CAAS;AAAA,IAExC,UAAAD;AAAA,EAAA;AACL;AAGJW,EAAS,OAAOtB;"}
|
|
1
|
+
{"version":3,"file":"Timeline.js","sources":["../../src/components/Timeline.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport Tag from './Tag';\nimport Text from './Typography/Text';\nimport { getFontFamily, getFontWeight } from './Typography/textStyles';\nimport { devWarning } from './devWarning';\n\nexport type TimelineTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';\n\nexport interface TimelineProps {\n children: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface TimelineMetaEntry {\n label: string;\n value: React.ReactNode;\n}\n\nexport interface TimelineItemProps {\n title: React.ReactNode;\n /**\n * Code set after the title in the mono face, as one phrase with it, e.g. `title=\"n8n called\"`\n * with `titleCode=\"Salesforce | Delete contact\"`.\n */\n titleCode?: string;\n /** When the step happened, shown at the right of the title, e.g. `+6 ms`. */\n time?: React.ReactNode;\n /**\n * Paints the dot or the `icon`: `error` on a `stopped` step, else `neutral`, unless set. Colour\n * alone, so the title has to say what happened. Ignored when `skipped` or `marker` is set.\n */\n tone?: TimelineTone;\n /** Replaces the ringed dot with a 24px circle of its own, e.g. the caller's logo at size 24. Decorative: hidden from assistive tech. */\n marker?: React.ReactNode;\n /**\n * A 12-14px glyph drawn inside the ring in place of the dot, e.g. `<McpIcon size={13} />`, painted\n * by `tone` through `currentColor`. Use a filled glyph: inside the shadow root every unmarked svg\n * path is filled, so a stroke-only icon turns solid.\n * Decorative: hidden from assistive tech, so the title has to say what it stands for.\n * Precedence: `skipped`, then `marker`, then `icon`, then the dot.\n */\n icon?: React.ReactNode;\n /** A step that never ran: a grey chevron replaces the dot, `tone`, `marker` and `icon`. Wins over `stopped`. */\n skipped?: boolean;\n /** Marks the step the flow ended on, with a badge after the title. Ignored when `skipped`. */\n stopped?: boolean;\n /** The badge's text when `stopped`. Empty falls back to \"Stopped here\". */\n stoppedLabel?: string;\n /** Read to assistive tech after the title when `skipped`. Empty falls back to \"skipped\". */\n skippedLabel?: string;\n /** Label and value pairs in a wrapping row under the title. */\n meta?: readonly TimelineMetaEntry[];\n /**\n * The step's detail, below the title: tags, copy, payloads. Each child is a row of its own, 8px\n * apart, and unstyled, so wrap copy in `Typography.Text`.\n */\n children?: React.ReactNode;\n className?: string;\n}\n\n// The light theme's values as fallbacks: the dot paints before the theme reaches `:host`.\nconst DOT_COLOR: Record<TimelineTone, string> = {\n neutral: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n info: 'var(--malachite-text-info, rgb(12, 88, 174))',\n success: 'var(--malachite-text-success, rgb(2, 122, 66))',\n warning: 'var(--malachite-text-warning, rgb(150, 88, 10))',\n error: 'var(--malachite-text-error, rgb(237, 53, 54))',\n};\n\n// Mono runs wider than Inter, so it sits a touch under the title, at 0.92em of whatever size the\n// title is, and colour is the title's. A mono space is as wide as a letter, about twice the\n// title's, so the word spacing closes it to match, and a hair of margin evens the gap before it.\nconst TITLE_CODE_STYLE: React.CSSProperties = {\n fontFamily: getFontFamily('mono'),\n fontWeight: getFontWeight('semi-bold'),\n fontSize: '0.92em',\n wordSpacing: '-0.25em',\n marginLeft: '0.08em',\n};\n\nconst SKIPPED_MARK = (\n <svg\n data-timeline-skipped=\"\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n className=\"block\"\n style={{ color: DOT_COLOR.neutral }}\n >\n <path\n fill=\"currentColor\"\n d=\"M5.15 9.85l6 6a1.2 1.2 0 0 0 1.7 0l6-6A1.2 1.2 0 0 0 17.15 8.15L12 13.3 6.85 8.15A1.2 1.2 0 0 0 5.15 9.85Z\"\n />\n </svg>\n);\n\nconst Item: React.FC<TimelineItemProps> = ({\n title,\n titleCode,\n time,\n tone,\n marker,\n icon,\n skipped = false,\n stopped = false,\n stoppedLabel,\n skippedLabel,\n meta = [],\n children,\n className = '',\n}) => {\n const id = useId();\n if (skipped && stopped) {\n const name = typeof title === 'string' ? title : '';\n devWarning(\n `Timeline.Item.skipped+stopped:${name || id}`,\n `Timeline.Item${name ? ` \"${name}\"` : ' (with a non-string title)'} got both \\`skipped\\` and \\`stopped\\`; a step that never ran can't be the one the flow ended on, so the badge is dropped.`,\n );\n }\n const isStopped = stopped && !skipped;\n const dotTone = tone ?? (isStopped ? 'error' : 'neutral');\n const shownMarker = skipped ? SKIPPED_MARK : marker;\n const ringless = !skipped && Boolean(marker);\n const code = titleCode?.trim();\n return (\n <li\n className={`relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${className}`}\n >\n <span\n data-timeline-line=\"\"\n aria-hidden=\"true\"\n className=\"absolute start-[11px] top-[26px] bottom-[2px] w-[2px] bg-[var(--malachite-card-border,rgb(232,232,232))]\"\n />\n <span\n aria-hidden=\"true\"\n // The ring's border would cut into a marker, so a marker gets the full 24px circle instead.\n className={`flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${ringless ? '' : 'border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]'}`}\n >\n {shownMarker ||\n (icon ? (\n <span\n data-timeline-icon={dotTone}\n className=\"flex h-[14px] w-[14px] items-center justify-center overflow-hidden [&>*]:max-h-full [&>*]:max-w-full [&_svg]:max-h-[14px] [&_svg]:max-w-[14px]\"\n style={{ color: DOT_COLOR[dotTone] }}\n >\n {icon}\n </span>\n ) : (\n <span\n data-timeline-dot={dotTone}\n className=\"h-[8px] w-[8px] rounded-full\"\n style={{ backgroundColor: DOT_COLOR[dotTone] }}\n />\n ))}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]\">\n <div className=\"flex items-start justify-between gap-[12px]\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]\">\n <Text size=\"small\" fontWeight=\"bold\" className=\"min-w-0 leading-[18px]\">\n {title}\n {code && (\n <>\n {title ? ' ' : null}\n <span translate=\"no\" style={TITLE_CODE_STYLE}>\n {code}\n </span>\n </>\n )}\n </Text>\n {skipped && (\n <span className=\"sr-only\">, {skippedLabel?.trim() || 'skipped'}</span>\n )}\n {isStopped && <span className=\"sr-only\">, </span>}\n {isStopped && (\n <Tag\n value={stoppedLabel?.trim() || 'Stopped here'}\n type=\"error\"\n fontSize=\"xsmall\"\n textTransform=\"none\"\n paddingSize=\"compact\"\n />\n )}\n </div>\n {(time || time === 0) && <span className=\"sr-only\">, </span>}\n {(time || time === 0) && (\n <Text\n size=\"xsmall\"\n color=\"secondary\"\n font=\"mono\"\n wrap={false}\n className=\"pt-[2px]\"\n >\n {time}\n </Text>\n )}\n </div>\n {meta.length > 0 && (\n <dl className=\"m-0 flex flex-wrap gap-x-[18px] gap-y-[6px] leading-[16px]\">\n {meta.map((entry, index) => (\n <div\n key={`${entry.label}-${index}`}\n className=\"flex min-w-0 items-baseline gap-[3px]\"\n >\n <dt className=\"flex\">\n <Text size=\"xsmall\" color=\"secondary\">\n {entry.label}\n </Text>\n </dt>\n <dd className=\"m-0 flex min-w-0 [overflow-wrap:anywhere]\">\n <Text size=\"xsmall\" font=\"mono\">\n {entry.value}\n </Text>\n </dd>\n </div>\n ))}\n </dl>\n )}\n {children}\n </div>\n </li>\n );\n};\n\n/** A vertical sequence of steps, each with a dot on a connecting line, a title, its timing and a body. */\nconst Timeline: React.FC<TimelineProps> & { Item: typeof Item } = ({\n children,\n className = '',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}) => (\n <ol\n // list-style: none strips list semantics in WebKit, so VoiceOver would not announce the steps.\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`m-0 list-none p-0 ${className}`}\n >\n {children}\n </ol>\n);\n\nTimeline.Item = Item;\n\nexport default Timeline;\nexport { Timeline };\n"],"names":["DOT_COLOR","TITLE_CODE_STYLE","getFontFamily","getFontWeight","SKIPPED_MARK","jsx","Item","title","titleCode","time","tone","marker","icon","skipped","stopped","stoppedLabel","skippedLabel","meta","children","className","id","useId","name","devWarning","isStopped","dotTone","shownMarker","ringless","code","jsxs","Text","Fragment","Tag","entry","index","Timeline","ariaLabel","ariaLabelledBy"],"mappings":";;;;;;AA+DA,MAAMA,IAA0C;AAAA,EAC5C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAKMC,IAAwC;AAAA,EAC1C,YAAYC,EAAc,MAAM;AAAA,EAChC,YAAYC,EAAc,WAAW;AAAA,EACrC,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAChB,GAEMC,IACF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,yBAAsB;AAAA,IACtB,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,OAAO,EAAE,OAAOL,EAAU,QAAA;AAAA,IAE1B,UAAA,gBAAAK;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,GAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EACN;AACJ,GAGEC,IAAoC,CAAC;AAAA,EACvC,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;A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,UACCQ,EAAK,SAAS,KACX,gBAAAZ,EAAC,MAAA,EAAG,WAAU,8DACT,UAAAY,EAAK,IAAI,CAACgB,GAAOC,MACd,gBAAAL;AAAA,YAAC;AAAA,YAAA;AAAA,cAEG,WAAU;AAAA,cAEV,UAAA;AAAA,gBAAA,gBAAAxB,EAAC,MAAA,EAAG,WAAU,QACV,UAAA,gBAAAA,EAACyB,GAAA,EAAK,MAAK,UAAS,OAAM,aACrB,UAAAG,EAAM,MAAA,CACX,GACJ;AAAA,gBACA,gBAAA5B,EAAC,MAAA,EAAG,WAAU,6CACV,UAAA,gBAAAA,EAACyB,GAAA,EAAK,MAAK,UAAS,MAAK,QACpB,UAAAG,EAAM,MAAA,CACX,EAAA,CACJ;AAAA,cAAA;AAAA,YAAA;AAAA,YAZK,GAAGA,EAAM,KAAK,IAAIC,CAAK;AAAA,UAAA,CAcnC,GACL;AAAA,UAEHhB;AAAA,QAAA,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ,GAGMiB,IAA4D,CAAC;AAAA,EAC/D,UAAAjB;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAciB;AAAA,EACd,mBAAmBC;AACvB,MACI,gBAAAhC;AAAA,EAAC;AAAA,EAAA;AAAA,IAEG,MAAK;AAAA,IACL,cAAY+B;AAAA,IACZ,mBAAiBC;AAAA,IACjB,WAAW,qBAAqBlB,CAAS;AAAA,IAExC,UAAAD;AAAA,EAAA;AACL;AAGJiB,EAAS,OAAO7B;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
const r = "border-[var(--malachite-card-border,rgb(232,232,232))]", o = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
1
|
+
const r = "border-[var(--malachite-card-border,rgb(232,232,232))]", o = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden", t = "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]", a = "var(--malachite-buttonlist-hover-background,rgb(245,245,245))";
|
|
2
2
|
export {
|
|
3
3
|
r as BORDER,
|
|
4
|
-
o as NO_SCROLLBAR
|
|
4
|
+
o as NO_SCROLLBAR,
|
|
5
|
+
t as ROW_HOVER,
|
|
6
|
+
a as ROW_HOVER_COLOR
|
|
5
7
|
};
|
|
6
8
|
//# sourceMappingURL=chromeStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chromeStyles.js","sources":["../../src/components/chromeStyles.ts"],"sourcesContent":["export const BORDER = 'border-[var(--malachite-card-border,rgb(232,232,232))]';\n\nexport const NO_SCROLLBAR = '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden';\n"],"names":["BORDER","NO_SCROLLBAR"],"mappings":"AAAO,MAAMA,IAAS,0DAETC,IAAe;"}
|
|
1
|
+
{"version":3,"file":"chromeStyles.js","sources":["../../src/components/chromeStyles.ts"],"sourcesContent":["export const BORDER = 'border-[var(--malachite-card-border,rgb(232,232,232))]';\n\nexport const NO_SCROLLBAR = '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden';\n\nexport const ROW_HOVER =\n 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]';\n\nexport const ROW_HOVER_COLOR = 'var(--malachite-buttonlist-hover-background,rgb(245,245,245))';\n"],"names":["BORDER","NO_SCROLLBAR","ROW_HOVER","ROW_HOVER_COLOR"],"mappings":"AAAO,MAAMA,IAAS,0DAETC,IAAe,wDAEfC,IACT,8FAESC,IAAkB;"}
|