|
| 1 | +import { makeStyles, tokens } from '@fluentui/react-components' |
| 2 | + |
| 3 | +export const useTargetBadgeStyles = makeStyles({ |
| 4 | + badge: { |
| 5 | + display: 'inline-flex', |
| 6 | + alignItems: 'center', |
| 7 | + gap: tokens.spacingHorizontalXS, |
| 8 | + padding: `2px ${tokens.spacingHorizontalS}`, |
| 9 | + borderRadius: tokens.borderRadiusMedium, |
| 10 | + border: `1px solid ${tokens.colorNeutralStroke1}`, |
| 11 | + backgroundColor: tokens.colorNeutralBackground1, |
| 12 | + cursor: 'help', |
| 13 | + minWidth: 0, |
| 14 | + maxWidth: '100%', |
| 15 | + }, |
| 16 | + badgeText: { |
| 17 | + overflow: 'hidden', |
| 18 | + textOverflow: 'ellipsis', |
| 19 | + whiteSpace: 'nowrap', |
| 20 | + minWidth: 0, |
| 21 | + }, |
| 22 | + // Applied to the Fluent Tooltip's `content` slot (the actual surface |
| 23 | + // that renders the white/dark popover with the arrow). Fluent caps |
| 24 | + // surface max-width at 240px by default, which truncates anything |
| 25 | + // wider than a short label. We override here so the surface grows |
| 26 | + // with its content, capped only by the viewport. |
| 27 | + tooltipSurface: { |
| 28 | + maxWidth: 'min(800px, calc(100vw - 64px))', |
| 29 | + width: 'max-content', |
| 30 | + minWidth: '420px', |
| 31 | + }, |
| 32 | + tooltipBody: { |
| 33 | + display: 'flex', |
| 34 | + flexDirection: 'column', |
| 35 | + gap: tokens.spacingVerticalS, |
| 36 | + width: '100%', |
| 37 | + boxSizing: 'border-box', |
| 38 | + }, |
| 39 | + tooltipHeader: { |
| 40 | + display: 'flex', |
| 41 | + flexDirection: 'column', |
| 42 | + gap: tokens.spacingVerticalXXS, |
| 43 | + }, |
| 44 | + tooltipSection: { |
| 45 | + display: 'flex', |
| 46 | + flexDirection: 'column', |
| 47 | + gap: tokens.spacingVerticalXXS, |
| 48 | + minWidth: 0, |
| 49 | + }, |
| 50 | + sectionLabel: { |
| 51 | + fontSize: tokens.fontSizeBase100, |
| 52 | + fontWeight: tokens.fontWeightSemibold, |
| 53 | + color: tokens.colorNeutralForeground3, |
| 54 | + textTransform: 'uppercase', |
| 55 | + letterSpacing: '0.05em', |
| 56 | + }, |
| 57 | + endpointText: { |
| 58 | + fontFamily: tokens.fontFamilyMonospace, |
| 59 | + fontSize: tokens.fontSizeBase200, |
| 60 | + overflowWrap: 'anywhere', |
| 61 | + }, |
| 62 | + flagsRow: { |
| 63 | + display: 'flex', |
| 64 | + flexWrap: 'wrap', |
| 65 | + gap: tokens.spacingHorizontalXS, |
| 66 | + }, |
| 67 | + paramsBlock: { |
| 68 | + margin: 0, |
| 69 | + padding: tokens.spacingHorizontalXS, |
| 70 | + backgroundColor: tokens.colorNeutralBackground2, |
| 71 | + borderRadius: tokens.borderRadiusSmall, |
| 72 | + fontFamily: tokens.fontFamilyMonospace, |
| 73 | + fontSize: tokens.fontSizeBase200, |
| 74 | + whiteSpace: 'pre-wrap', |
| 75 | + wordBreak: 'normal', |
| 76 | + overflowWrap: 'anywhere', |
| 77 | + maxHeight: '200px', |
| 78 | + maxWidth: '100%', |
| 79 | + overflowY: 'auto', |
| 80 | + overflowX: 'auto', |
| 81 | + boxSizing: 'border-box', |
| 82 | + }, |
| 83 | +}) |
0 commit comments