/* wave 41 lane stylesheet: field-ui. Kept separate so no lane edits index.css. Tokens live in index.css :root and customer-grid/theme.ts -- declare there, consume here. */ /* --------------------------------------------------------------------------- W41-T27 (owner instructions 2 and 8) -- "Hide fields" becomes the Fields manager. Everything below is ADDITIVE and scoped: `.cg-fields-manager` is worn only by the manager mount, and the badge modifiers only ever appear beside a `.cg-preset-tag` base that index.css already owns. No rule here restyles an existing selector, so a surface this ticket never opened cannot change shape. --------------------------------------------------------------------------- */ /* THE WIDTH, and it is the only thing that sets one. `.cg-pop` declares a min-width and no width at all, and `OverlaySurface` sets left/top/max-* but never width, so the popover is shrink-to-fit and this child is what it fits to. ⛔ NOT ON `filter-kit/Popover.tsx`: that component is shared with Filter, Sort and Group, and two of this panel's four mounts (the two permissioning rooms) are not inside a Popover at all, so a width set there would widen three unrelated builders and still miss the settings list. The viewport clamp mirrors `.cg-pop--measures` -- the overlay's own max-width would otherwise clip the row rather than let it reflow on a narrow window. ⭐⭐ 520px IS DERIVED FROM THE WORST ROW, NOT PICKED. No gate in this repo measures painted layout, so the number had to be arithmetic. R5's own motivating example is Supplier, which wears all five new elements at once, and `.cg-check-label` is `flex: 1 1 auto` with `text-overflow: ellipsis` -- it absorbs the ENTIRE squeeze, so an under-sized panel truncates the field NAME, which is the one thing the row is about. Measured at --lp-fs-4xs / 600, padding included: grip 14 + checkbox 15 + type icon 14 = 43 `Pre-set` 46 + `Shared by Karen` 89 + mark 12 + `Shared values` 78 + owner (capped 96, typical 27) = 266 eight inter-item gaps at the manager's 6px = 48 row padding 8 + 8 = 16 total 373 At 400px that leaves the field name 27px, i.e. an ellipsis. ⭐⭐ RE-DERIVED AT 620, because the tally above budgets the TWO variable items at their typical size instead of the size THIS WAVE will actually produce, and both land on the same row. The owner is counted at its typical 27px though its own rule caps it at 96, and the audience at `Shared by Karen` (89) though W41-T06 gives Supplier the owner `Karen Ganley`, which renders `Shared by Karen Ganley` (~130). Substituting both: 43 + [origin 46 + audience 130 + mark 12 + values 78 + owner 96 + delete 14] + nine 6px gaps 54 + row padding 16 = 489 which leaves the name 31px at 520 -- an ellipsis on the EXACT row the PRD names as QA moment 1, "the Fields manager showing Supplier with all three badges and an owner". 620 leaves it 131px and is still well under the 780px `.cg-pop--measures` sets as the house maximum for a wide panel. ⚠ The five badges are only partly mutually exclusive, which is why the worst case is real rather than theoretical: a USER column has a long audience but no origin or values chip, and a plain pre-set has both of those but the SHORT audience `Everyone`. A pre-set shared to named people carries all five at once, and that is precisely what Supplier becomes the moment lane A lands. */ .cg-fields-manager { width: min(620px, calc(100vw - 32px)); min-width: min(620px, calc(100vw - 32px)); } /* THE PAIR, not `width` alone, mirroring `.cg-pop--measures` exactly rather than approximately. `.cg-pop` is an abspos shrink-to-fit box whose used width is `min(max(min-content, available), preferred)`: `width` sets the preferred term and `min-width` sets the min-content contribution. Only the pair holds the panel open when the trigger sits near the right edge and `available` goes small, which is where a toolbar popover actually lives. */ /* THE FIELD NAME IS THE ROW'S SUBJECT AND MUST NEVER REACH ZERO. `.cg-check-label` is the only `flex: 1 1 auto` item here, so it absorbs every squeeze the badges apply -- correct until it absorbs all of it and the panel is a column of ellipses. A floor makes the ROW overflow instead of the NAME vanishing, which is the honest failure: a name you can partly read beats a name that is gone. Arithmetic sizes the common case; this is what holds when a display name is longer than any tally predicted. */ .cg-fields-manager .cg-check-label { min-width: 9ch; } /* ...and the second half of the same arithmetic: the row's 9px gap is right for four children and costs 72px across nine, which is a fifth of the width instruction 2 just bought. 6px is this surface's own sub-rhythm, not a new one -- `.cg-pop-head` and `.cg-pop-title` are already built on it. ⛔ SCOPED UNDER `.cg-fields-manager`, so this is the NEW surface declaring its own spacing rather than a restyle of the checkbox row: the two permissioning rooms and every other `.cg-check-row` in the product keep 9px, untouched. */ .cg-fields-manager .cg-check-row { gap: 6px; } /* R5's three badges ride the `.cg-preset-tag` family (DESIGN 4: new chrome joins the existing rhythm, never a new control shape), so these modifiers set colour and nothing else -- the geometry, the radius and the scale token stay the base rule's. The precedent is `.cg-scope-tag`, which differentiates the Cohort-only chip in this same row by wash alone. ⚠ ONE FAMILY IS THE POINT, not a limitation. The three answer three axes of ONE classification, and their TEXT is what tells them apart; three invented hues would read as three unrelated statuses in a palette where hue already means something (green filter, yellow sort, purple group). */ /* Badge 1, ORIGIN. Base look unchanged -- the same word must look the same whether C1 produced it or the C8 fallback did. `help` is the cursor for a mark that carries a tooltip naming which lock it is (DESIGN 4, the three locks). */ .cg-field-origin { cursor: help; } /* Badge 2, AUDIENCE. Same wash, stronger ink: reach is the one axis worth reading first in a row that may carry three chips. */ /* BOUNDED, because `Shared by ` is the ONE chip on this row whose width is user data. Every other is a fixed string, and every new item is `flex: 0 0 auto`, so nothing shrinks and an unbounded name decides on its own whether the row fits. Nothing is lost: the share mark beside it carries the full wording in `title`. */ .cg-field-audience { color: var(--lp-blue-solid); max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* Badge 3, VALUES. The yellow stratum, which is already this product's colour for the overlay/shared layer (`--lp-yellow-tint` is documented in index.css as "the overlay/note stratum's wash"), so `Shared values` is tinted by what it describes. */ .cg-field-values { background: var(--lp-yellow-tint); color: var(--lp-yellow-deep); } /* Owner instruction 8 -- the share mark. Quiet at rest and full on row hover, which is the pattern `.cg-field-grip` already set in this list: a column of marks down a 20-field panel competes with the checkboxes for the same glance, and this one only matters once you have decided to ask about a row. Opacity, never display, so nothing shifts sideways under the pointer as you move down the list. */ .cg-field-share { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--lp-muted); opacity: 0.6; cursor: help; transition: opacity 0.12s ease; } .cg-check-row:hover .cg-field-share { opacity: 1; } /* R3 -- the owner. Muted and truncating: it is an attribution, not the row's subject, and a long username must never push the badges off the end of a row whose label is the thing being read. `flex: 0 0 auto` is load-bearing for that -- `.cg-check-label` is `flex: 1 1 auto` and takes the squeeze, which is the behaviour this row wants. */ .cg-field-owner { flex: 0 0 auto; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--lp-fs-4xs); color: var(--lp-muted); cursor: help; } /* --------------------------------------------------------------------------- W41-T28 (owner instructions 2 and 15) -- a field says where it is used, and warns before it breaks a rule. Two elements, both ADDITIVE, both scoped under `.cg-fields-manager`, and neither restyles a selector T27 or index.css already owns. The scope is not tidiness: the two permissioning rooms mount this same panel with `sharedSections={false}`, and a permission editor row is not a field manager row -- it is choosing a field, not auditing one. --------------------------------------------------------------------------- */ /* ⭐⭐ NOT A `.cg-preset-tag`, AND THAT IS CONTRACT C1 RATHER THAN TASTE. `class` is the ONE producer of the badges, so a fourth tinted chip in the same family would read as a fourth axis of the classification and quietly give the row a badge no `field_class()` call produced. Usage is METADATA about the column, like the owner attribution beside it, so it takes the owner's look: muted, small, no wash. Same reason it sits after the owner and not among the badges. ⭐ AND IT IS THE CHEAPEST FORM THAT SAYS IT. T27 derived 620px from a worst row spending 489px, leaving the field NAME 131px -- and `.cg-check-label` is the only `flex: 1 1 auto` item, so everything added here comes out of the name. A mark plus a digit is ~21px where the chip form `2 uses` is ~43px; at `min-width: 9ch` (~64px at the inherited size) the chip form would have put the worst row within a few px of overflowing the panel. The breakdown costs nothing because it rides `title` and `aria-label`. */ .cg-fields-manager .cg-field-usage { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; font-size: var(--lp-fs-4xs); font-weight: 600; color: var(--lp-muted); cursor: help; } /* R8 / instruction 15 -- the permission-rule mark. Three things make it DISTINCT from the usage count beside it and from every badge in the row: it is the only element here in the destructive colour, it is a mark with NO number (it warns, it does not tally), and its words name a consequence rather than a fact. ⛔ NO HOVER FADE, deliberately breaking the pattern `.cg-field-share` set two rules up. That mark is an explanation you go looking for; this one is a caution you must see BEFORE you reach for the delete button four items to its right. A warning that is 60% opaque until you point at it is not a warning. ⚠ `--lp-red-deep`, NEVER `--lp-red`. index.css documents the latter as FILL only at 1.94:1, and this is a 1.2px stroke -- the token that looks right in a swatch is the one that disappears at this weight. */ .cg-fields-manager .cg-field-permrule { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--lp-red-deep); cursor: help; } /* --------------------------------------------------------------------------- W41-T29 (owner instructions 2, 15 and 24) -- deleting a field names who loses it, a pre-set says it cannot be deleted, and a shared field is handed back rather than destroyed. Two elements, both ADDITIVE, both scoped, and neither restyles a selector index.css or T27/T28 already own. `.cg-check-del` keeps every declaration it had; the remove variant is a MODIFIER beside it, which is what makes the removal wear the delete affordance's geometry (hover reveal, the `margin-left: auto` slot, the focus ring, the arm) without wearing its colour. --------------------------------------------------------------------------- */ /* R6(a) -- THE PRE-SET REFUSAL MARK, standing in the delete button's slot. ⭐ `margin-left: auto` IS THE POINT, NOT A NUDGE. `.cg-check-del` carries it, so the mark occupies exactly the position the button it replaces would have, and a pre-set row does not reflow the badges to its left the way a simply absent control would. ⭐ AND IT COSTS THE WIDTH BUDGET NOTHING. T27 derived 620px from a worst row spending 489px and T28 took that to 534px; this mark is 13px of glyph in a slot that already held a 14px trash icon, so the worst row is unchanged and the field name keeps every pixel it had. The refusal itself rides `title` and `aria-label`, which is where a sentence belongs on a row this tight. ⛔ NOT THE DESTRUCTIVE COLOUR. It is a statement about the column's definition, not a warning about an act, so it takes the muted tone the origin and owner marks wear. `--lp-red-deep` is spent on the permission-rule warning one ticket back, and two red things in one row would flatten both. ⚠ NO HOVER FADE, unlike `.cg-field-share`: an explanation you go looking for may hide until pointed at, and this one answers "where did my Delete go", which is a question asked by someone who is already looking at the row. */ .cg-fields-manager .cg-field-nodelete { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; color: var(--lp-muted); cursor: help; } /* R6(b) -- THE REMOVE VARIANT of the delete affordance. ⛔ COLOUR IS THE ONLY THING IT CHANGES, and that is the whole design: dropping a share destroys no definition and no values, so it must not borrow the vocabulary of an act that does. Everything else -- the slot, the reveal, the focus ring, the armed weight and nowrap -- is inherited unchanged, because it IS the same affordance in the same place and a second geometry would read as a second kind of control. ⚠ THE OVERRIDE HAS TO NAME BOTH STATES `.cg-check-del` REDS. index.css turns the button `--cg-danger` on `:hover` AND on `.is-armed`, in one rule; a modifier that only answered the resting colour would go red the instant a pointer touched it, which is the exact wrong signal on a non-destructive act. ⚠ `--lp-blue-solid` IS THE HOUSE ACTION COLOUR, not a new one, and it is the same token the focus ring two rules up is mixed from. */ .cg-fields-manager .cg-check-del--remove:hover, .cg-fields-manager .cg-check-del--remove.is-armed { color: var(--lp-blue-solid); } /* --------------------------------------------------------------------------- W41-T30 (owner instruction 2, R3) -- the manager acts on many fields at once. Four additions, all scoped under `.cg-fields-manager`, none restyling a selector index.css or T27/T28/T29 already own. The bulk bar is not a new control shape (DESIGN 4): it is a second `.cg-pop-footer.cg-fields-footer` tray holding `.cg-link-btn` quiet buttons, i.e. the exact family the Show all / Hide all pair below it has worn since item 12. ⭐⭐ AND IT COSTS THE ROW WIDTH BUDGET NOTHING, WHICH IS WHY IT IS SHAPED THIS WAY. T27 derived 620px from a worst row spending 489px and T28 took that to 534px, leaving the field NAME 86px against `.cg-check-label`'s `min-width: 9ch` (~64px) floor: 22px of slack on the whole row. A per-row selection checkbox is the obvious design and it does NOT FIT: a 15px box plus the manager's 6px gap is 21px, which is every pixel of that slack and would leave the name 65px against a 64px floor, i.e. an overflow on the first display name longer than the tally predicted. THE SELECTION CONTROL THEREFORE OCCUPIES THE GRIP'S SLOT INSTEAD OF ITS OWN: `.cg-field-pick` is 14x18px, byte-for-byte the box `.cg-field-grip` declares (index.css:1866), and the grip is absent while select mode is on. Worst row stays 534px, the name keeps all 86px, the panel width is untouched at 620px and no re-derivation of it was needed. ⚠ THE TRADE IS STATED, NOT HIDDEN: drag and keyboard reorder (owner item 23) are suspended while select mode is on, because their handle is the slot the selection borrowed. `Done` gives it straight back. --------------------------------------------------------------------------- */ /* THE SELECTION CONTROL, in the grip's slot and at the grip's exact box. ⛔ A