UNPKG

@chatui/core

Version:

The React library for Chatbot UI

309 lines (270 loc) 5.14 kB
.Modal, .Popup { position: fixed; top: 0; right: 0; bottom: 0; left: 0; height: 100%; z-index: @zindex-modal; display: flex; align-items: center; justify-content: center; outline: 0; } .Modal { &.active { .Modal-dialog { opacity: @modal-show-opacity; transform: @modal-show-transform; } } } .Modal-dialog { position: relative; z-index: @zindex-modal; overflow: hidden; width: 296px; max-width: 90vw; border-radius: var(--radius-md); background: @modal-bg; opacity: @modal-opacity; transition: @modal-transition; transform: @modal-fade-transform; font-size: var(--font-size-body); &[data-has-avatar='true'] { padding-top: 26px; overflow: visible; background-image: linear-gradient(to bottom, rgba(255, 255, 255, 75%) 0%, rgba(255, 255, 255, 75%) 120px), linear-gradient(to bottom, var(--brand-1) 0%, var(--color-fill-1) 120px); } } .Modal-avatar { background-image: var(--avatar), linear-gradient(-51deg, rgba(255, 255, 255, 50%) 0%, rgba(255, 255, 255, 80%) 100%), linear-gradient(-51deg, var(--brand-1) 0%, var(--brand-1) 100%); background-repeat: no-repeat; background-size: cover; box-sizing: border-box; border-radius: 50%; width: 54px; height: 54px; position: absolute; left: 50%; top: -20px; transform: translateX(-50%); } .Modal-header { position: relative; padding: 20px 20px 8px; } .Modal-body { padding: 20px 20px 18px; color: var(--color-text-2); font-size: var(--font-size-body); .Modal-header + & { padding-top: 0; } &[data-align="left"] { text-align: left; } &[data-align="center"] { text-align: center; } } .Modal-footer { display: flex; padding: 0 20px 20px; } .Modal-footer--h { .Btn { flex: 1; } .Btn + .Btn { margin-left: 12px; } } .Modal-footer--v { flex-direction: column; .Btn + .Btn { margin-top: 12px; } } // Popup .Popup { align-items: flex-end; &.active { .Popup-dialog { opacity: 1; transform: translate3d(0, 0, 0); } } } .Popup-content { display: flex; flex-direction: column; height: 100%; max-height: 90vh; } .Popup-dialog { position: relative; z-index: @zindex-popup; overflow: hidden; width: 100%; border-radius: var(--radius-md) var(--radius-md) 0 0; background: @popup-bg; opacity: 0; transform: translate3d(0, 100%, 0); transition: 0.3s; &[data-bg-color="gray"] { background: var(--color-fill-2); } &[data-height="80"] { height: 80vh; } &[data-height="60"] { height: 60vh; } &[data-height="40"] { height: 40vh; } } .Popup-header { position: relative; padding: 8px 40px; &[data-has-sub-title="false"] { padding: 10px 40px; } &[data-has-logo='true'] { text-align: center; } } .Popup-headerText { position: relative; display: inline-block; max-width: 100%; text-align: center; vertical-align: top; } .Popup-logo { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); height: 45Px; margin-right: 10Px; border-radius: var(--radius-md); object-fit: cover; } .Modal-title, .Popup-title { margin: @popup-title-margin; color: @popup-title-color; font-size: @popup-title-font-size; font-weight: 500; text-align: center; } .Popup-title, .Popup-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .Popup-title { min-height: 27Px; } .Popup-subtitle { margin: 0; color: var(--color-text-2); font-size: 12px; font-weight: 400; text-align: center; } .Popup[data-elder-mode='true'] { .Modal-title, .Popup-title { font-size: 21Px; } } .Modal-close, .Popup-close { position: absolute; color: @popup-close-color; } .Btn.Modal-close { top: 10px; right: 10px; color: var(--color-text-3); font-size: 20px; } .Popup { .Popup-close { right: 10px; top: 50%; transform: translateY(-50%); padding: 6Px; font-size: 16Px; background: var(--color-fill-2); } } .Popup-body { flex: 1; min-height: 0; &.overflow { max-height: @popup-max-height; overflow-y: auto; -webkit-overflow-scrolling: touch; } } .Popup-footer { position: relative; display: flex; flex-direction: column; padding: 8px var(--gutter); padding-bottom: calc(8px + var(--safe-bottom)); background: var(--color-fill-1); .Btn + .Btn { margin-top: @popup-btn-y-spacing; } } .Popup-footer--h { flex-direction: row; .Btn + .Btn { margin-top: 0; margin-left: @popup-btn-x-spacing; } } .Popup-actionsDesc { margin-bottom: 8px; color: var(--color-text-3); font-size: 12px; text-align: center; } .Tabs.Popup-tabs { .Tabs-nav { position: absolute; top: 0; left: 6px; right: 48px; } .Tabs-content { padding: 0 var(--gutter); } } .S--modalOpen, .S--modalOpen .MessageContainer > .PullToRefresh { overflow: hidden; } .S--wide { .Popup { align-items: center; } .Popup-dialog { width: @popup-wide-width; border-radius: @modal-border-radius; } .Popup-footer--v { padding-bottom: 12px; } }