import PropTypes from 'prop-types'; import { Center } from '@astryxdesign/core/Center'; import { DT, soft } from './tokens'; // ============================================================================ // Shared DT primitives — the tiny components that every DT-styled operator // page used to redeclare verbatim at the top of its own file. // // They were byte-identical in all 6 copies, so the duplication bought nothing // and made the pages drift apart whenever one was tweaked. `deliveries.js` is // the visual reference for both (see root CLAUDE.md §6). // ============================================================================ // Soft popup surface. Under MUI this was a `PaperComponent` handed to every // Autocomplete; Astryx's Selector/Typeahead own their own popup chrome, so // this now only serves the few hand-rolled dropdowns that remain. Kept as a // style object rather than a component for exactly that reason. export const softPopupStyle = { marginTop: 6, background: DT.surface, borderRadius: DT.radiusInner + 'px', boxShadow: DT.shadowPop, border: `1px solid ${DT.borderSubtle}`, overflow: 'hidden' }; // Scroll container for a table. Astryx's Table renders a bare with no // sticky-header or max-height affordance (MUI's TableContainer used to provide that), // so pages wrap it in this. The brand-red scrollbar can't be expressed inline // — ::-webkit-scrollbar-* are pseudo-elements — hence the one-time
{children}
); TableScroll.propTypes = { maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), children: PropTypes.node }; // Colored icon chip — flips between filled and soft based on `selected`. // Astryx's own `Avatar` is for people (src / initials / status corner), so a // tinted `Center` is the right primitive for an icon swatch. The accent is a // caller-supplied hex, hence the inline style. export const AccentAvatar = ({ color, selected, size = 24, children }) => (
{children}
); AccentAvatar.propTypes = { color: PropTypes.string, selected: PropTypes.bool, size: PropTypes.number, children: PropTypes.node };