diff --git a/src/components/table/_table.scss b/src/components/table/_table.scss index ba2cfd0..a5b8aac 100644 --- a/src/components/table/_table.scss +++ b/src/components/table/_table.scss @@ -208,6 +208,91 @@ width: 80%; } +/* ===============Mobile Layout================== */ +.cmp-adaptiveform-table__mobile-bar { + display: none; +} + +.cmp-adaptiveform-table__mobile-bar-btn--filter.is-active { + color: $focus-ring-color; + font-weight: 600; +} + +.cmp-adaptiveform-table__sort-scrim { + display: none; + position: fixed; + inset: 0; + background-color: rgba(0, 0, 0, 0.45); + z-index: 1000; + align-items: flex-end; +} + +.cmp-adaptiveform-table__sort-scrim.is-open { + display: flex; +} + +.cmp-adaptiveform-table__sort-sheet { + width: 100%; + background: $white; + border-radius: 1rem 1rem 0 0; + padding-bottom: 2rem; + max-height: 80vh; + overflow-y: auto; + transform: translateY(100%); + transition: transform 0.25s ease-out; +} + +.cmp-adaptiveform-table__sort-scrim.is-open .cmp-adaptiveform-table__sort-sheet { + transform: translateY(0); +} + +.cmp-adaptiveform-table__sort-sheet-handle { + width: 2.5rem; + height: 0.25rem; + background: $silver; + border-radius: 0.125rem; + margin: 0.75rem auto 1rem; +} + +.cmp-adaptiveform-table__sort-sheet-title { + font-size: $font-sm; + color: #6b6b6b; + padding: 0.5rem 1rem; + border-bottom: 1px solid #f0f0f0; + margin: 0; +} + +.cmp-adaptiveform-table__sort-options { + list-style: none; + margin: 0; + padding: 0; +} + +.cmp-adaptiveform-table__sort-option { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.875rem 1rem; + font-size: $font-md; + cursor: pointer; + border-bottom: 1px solid #f5f5f5; +} + +.cmp-adaptiveform-table__sort-option:hover { + background-color: #f9f9f9; +} + +.cmp-adaptiveform-table__sort-option[aria-selected="true"] { + font-weight: 600; +} + +.cmp-adaptiveform-table__sort-option-indicator { + color: #505050; + font-size: $font-sm; + min-width: 1rem; + text-align: right; +} + /* ===============Responsive================== */ @media (max-width: 768px) { .cmp-adaptiveform-table__widget { @@ -218,4 +303,116 @@ .cmp-adaptiveform-tablehead { padding: 0.5rem; } + + .cmp-adaptiveform-table__widget, + .cmp-adaptiveform-table__head, + .cmp-adaptiveform-table__body, + .cmp-adaptiveform-tableheader, + .cmp-adaptiveform-tablerow, + .cmp-adaptiveform-tablecell, + .cmp-adaptiveform-tablehead { + display: block; + width: auto; + } + + .cmp-adaptiveform-table__widget .cmp-adaptiveform-table__head { + position: absolute; + top: -9999px; + left: -9999px; + } + + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablerow { + display: block; + border: 1px solid #dddddd; + border-radius: 4px; + margin-bottom: 1rem; + padding: 0.25rem 0.5rem; + font-size: $font-sm; + } + + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablecell { + display: block; + border: none; + border-bottom: 1px solid #f0f0f0; + position: relative; + padding: 0.5rem 0.5rem 0.5rem 45%; + text-align: left; + min-height: 1.5rem; + } + + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablerow > .cmp-adaptiveform-tablecell:last-child { + border: none; + } + + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablecell::before { + content: attr(data-label); + position: absolute; + left: 0.5rem; + top: 0.5rem; + width: 40%; + padding-right: 0.5rem; + font-weight: 600; + white-space: normal; + overflow-wrap: break-word; + box-sizing: border-box; + } + + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablecell:not([data-label])::before, + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablecell[data-label=""]::before { + content: none; + } + + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablecell:not([data-label]), + .cmp-adaptiveform-table__body .cmp-adaptiveform-tablecell[data-label=""] { + padding-left: 0.5rem; + } + + .cmp-adaptiveform-table__mobile-bar { + display: flex; + align-items: center; + border-top: 1px solid #e0e0e0; + padding: 0.25rem 0; + } + + .cmp-adaptiveform-table__mobile-bar-btn { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + gap: 0.375rem; + background: none; + border: none; + cursor: pointer; + font-size: $font-sm; + color: #333333; + padding: 0.625rem 0; + } + + .cmp-adaptiveform-table__mobile-bar-btn:focus-visible { + outline: 2px solid $focus-ring-color; + outline-offset: 1px; + } + + .cmp-adaptiveform-table__mobile-bar-btn:disabled { + color: #aaaaaa; + cursor: default; + } + + .cmp-adaptiveform-table__mobile-bar-divider { + width: 1px; + height: 1.25rem; + background: #e0e0e0; + } + + .cmp-adaptiveform-tablecell.cmp-adaptiveform-tablecell--with-row-controls { + display: block; + margin: 0; + border: none; + } + + .cmp-adaptiveform-tablerow__runtime-controls { + display: flex; + justify-content: flex-end; + margin-top: 0.5rem; + } }