|
| 1 | +/* #region List item */ |
| 2 | +:global(.webchat) .send-box-attachment-bar-item { |
| 3 | + display: grid; |
| 4 | + flex-shrink: 0; |
| 5 | + grid-template-rows: auto; |
| 6 | + font-family: var(--webchat__font--primary); |
| 7 | + |
| 8 | + &.send-box-attachment-bar-item--as-list-item { |
| 9 | + border-radius: 4px; |
| 10 | + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.14), 0px 0px 2px rgba(0, 0, 0, 0.12); |
| 11 | + grid-template-areas: 'body auxiliary'; |
| 12 | + grid-template-columns: 1fr auto; |
| 13 | + padding: 2px; |
| 14 | + } |
| 15 | + |
| 16 | + &.send-box-attachment-bar-item--as-thumbnail { |
| 17 | + aspect-ratio: 1 / 1; |
| 18 | + border: solid 1px rgba(0, 0, 0, 0.25); /* Figma has border-width of 0.96px. */ |
| 19 | + border-radius: 8px; /* Figma is 7.68px. */ |
| 20 | + grid-template-areas: 'body'; |
| 21 | + grid-template-columns: auto; |
| 22 | + height: 80px; /* <= 87px would fit white-label design with 3 thumbnails. */ |
| 23 | + overflow: hidden; |
| 24 | + } |
| 25 | +} |
| 26 | +/* #endregion */ |
| 27 | + |
| 28 | +/* #region Delete button */ |
| 29 | +:global(.webchat) .send-box-attachment-bar-item__delete-button { |
| 30 | + /* https://react.fluentui.dev/?path=/docs/theme-colors--docs */ |
| 31 | + appearance: none; |
| 32 | + align-items: center; |
| 33 | + background-color: White; /* Background/colorNeutralBackground1 */ |
| 34 | + border-color: #d1d1d1; /* Stroke/colorNeutralStroke1 */ |
| 35 | + border-radius: 4px; /* BorderRadiusXS is not defined in Fluent UI, guessing it is 4px. */ |
| 36 | + cursor: pointer; |
| 37 | + grid-area: body; |
| 38 | + justify-self: end; |
| 39 | + opacity: 1; |
| 40 | + padding: 0; |
| 41 | + transition: opacity 50ms; /* Assume ultra-fast. */ |
| 42 | + color: #242424; /* Background/colorNeutralForeground1 */ |
| 43 | + --webchat__component-icon--size: 19px; |
| 44 | + |
| 45 | + &:hover { |
| 46 | + background-color: #f5f5f5; /* Background/colorNeutralBackground1Hover */ |
| 47 | + border-color: #c7c7c7; /* Stroke/colorNeutralStroke1Hover */ |
| 48 | + } |
| 49 | + |
| 50 | + &:active { |
| 51 | + background-color: #e0e0e0; /* Background/colorNeutralBackground1Pressed */ |
| 52 | + border-color: #c7c7c7; /* Stroke/colorNeutralStroke1Pressed */ |
| 53 | + } |
| 54 | + |
| 55 | + &:disabled, |
| 56 | + &[aria-disabled='true'] { |
| 57 | + background-color: #f0f0f0; /* Background/colorNeutralBackgroundDisabled */ |
| 58 | + border-color: #e0e0e0; /* Stroke/colorNeutralStrokeDisabled */ |
| 59 | + color: #bdbdbd; /* Stroke/colorNeutralForegroundDisabled */ |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +@media (prefers-color-scheme: dark) { |
| 64 | + :global(.webchat.theme--prefers-color-scheme) .send-box-attachment-bar-item__delete-button { |
| 65 | + background-color: #292929; /* Background/colorNeutralBackground1 */ |
| 66 | + border-color: #666666; /* Stroke/colorNeutralStroke1 */ |
| 67 | + color: #ffffff; /* Background/colorNeutralBackground1 */ |
| 68 | + |
| 69 | + &:hover { |
| 70 | + background-color: #3d3d3d; /* Background/colorNeutralBackground1Hover */ |
| 71 | + border-color: #757575; /* Stroke/colorNeutralStroke1Hover */ |
| 72 | + } |
| 73 | + |
| 74 | + &:active { |
| 75 | + background-color: #1f1f1f; /* Background/colorNeutralBackground1Pressed */ |
| 76 | + border-color: #6b6b6b; /* Stroke/colorNeutralStroke1Pressed */ |
| 77 | + } |
| 78 | + |
| 79 | + &:disabled, |
| 80 | + &[aria-disabled='true'] { |
| 81 | + background-color: #141414; /* Background/colorNeutralBackgroundDisabled */ |
| 82 | + border-color: #424242; /* Stroke/colorNeutralStrokeDisabled */ |
| 83 | + color: #5c5c5c; /* Stroke/colorNeutralForegroundDisabled */ |
| 84 | + } |
| 85 | + } |
| 86 | +} |
| 87 | + |
| 88 | +:global(.webchat) |
| 89 | + .send-box-attachment-bar-item.send-box-attachment-bar-item--as-list-item |
| 90 | + .send-box-attachment-bar-item__delete-button { |
| 91 | + border: 0; |
| 92 | + grid-area: auxiliary; |
| 93 | + height: 24px; |
| 94 | + width: 24px; |
| 95 | + |
| 96 | + .send-box-attachment-bar-item__dismiss-icon { |
| 97 | + --webchat__component-icon--size: 7px; |
| 98 | + --webchat__component-icon--mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"><path d="M0.0885911 0.215694L0.146447 0.146447C0.320013 -0.0271197 0.589437 -0.046405 0.784306 0.0885911L0.853553 0.146447L4 3.293L7.14645 0.146447C7.34171 -0.0488154 7.65829 -0.0488154 7.85355 0.146447C8.04882 0.341709 8.04882 0.658291 7.85355 0.853553L4.707 4L7.85355 7.14645C8.02712 7.32001 8.0464 7.58944 7.91141 7.78431L7.85355 7.85355C7.67999 8.02712 7.41056 8.0464 7.21569 7.91141L7.14645 7.85355L4 4.707L0.853553 7.85355C0.658291 8.04882 0.341709 8.04882 0.146447 7.85355C-0.0488154 7.65829 -0.0488154 7.34171 0.146447 7.14645L3.293 4L0.146447 0.853553C-0.0271197 0.679987 -0.046405 0.410563 0.0885911 0.215694L0.146447 0.146447L0.0885911 0.215694Z"/></svg>'); |
| 99 | + } |
| 100 | +} |
| 101 | + |
| 102 | +:global(.webchat) |
| 103 | + .send-box-attachment-bar-item.send-box-attachment-bar-item--as-thumbnail |
| 104 | + .send-box-attachment-bar-item__delete-button { |
| 105 | + border-style: solid; /* Border color will be set elsewhere. */ |
| 106 | + border-width: 1px; /* Figma has border-width of 0.96px. */ |
| 107 | + grid-area: body; /* This was already set, but keeping for explicitness from original */ |
| 108 | + height: 23px; /* Figma is 23.04px. */ |
| 109 | + margin: 8px; /* Figma is 7.68px. */ |
| 110 | + width: 23px; /* Figma is 23.04px. */ |
| 111 | +} |
| 112 | + |
| 113 | +@media not (prefers-reduced-motion: reduce) { |
| 114 | + :global(.webchat) |
| 115 | + .send-box-attachment-bar-item.send-box-attachment-bar-item--as-thumbnail:not(:hover):not(:focus-within) |
| 116 | + .send-box-attachment-bar-item__delete-button { |
| 117 | + opacity: 0; |
| 118 | + } |
| 119 | +} |
| 120 | +/* #endregion */ |
| 121 | + |
| 122 | +/* #region Preview */ |
| 123 | +:global(.webchat) .send-box-attachment-bar-item__preview { |
| 124 | + align-items: center; |
| 125 | + display: grid; |
| 126 | + grid-area: body; |
| 127 | + overflow: hidden; |
| 128 | +} |
| 129 | + |
| 130 | +:global(.webchat) |
| 131 | + .send-box-attachment-bar-item.send-box-attachment-bar-item--as-list-item |
| 132 | + .send-box-attachment-bar-item__preview { |
| 133 | + padding-inline: 8px; |
| 134 | +} |
| 135 | +/* #endregion */ |
0 commit comments