budibase/packages/standard-components/node_modules/@spectrum-css/treeview/index.css

233 lines
6.4 KiB
CSS

/*
Copyright 2019 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
.spectrum-TreeView {
--spectrum-treeview-item-min-height: var(--spectrum-global-dimension-size-400);
--spectrum-treeview-item-padding-y: var(--spectrum-global-dimension-size-75);
--spectrum-treeview-item-icon-margin-right: var(--spectrum-global-dimension-size-125);
--spectrum-treeview-item-affordance-width: var(--spectrum-global-dimension-size-400);
--spectrum-treeview-item-indentation: var(--spectrum-global-dimension-size-200);
--spectrum-treeview-heading-font-weight: var(--spectrum-global-font-weight-bold);
--spectrum-treeview-item-hover-offset: var(--spectrum-global-dimension-size-25);
--spectrum-treeview-item-border-size-selected: var(--spectrum-alias-border-size-thin);
--spectrum-treeview-item-height-layers: var(--spectrum-global-dimension-size-550);
}
.spectrum-TreeView {
display: block;
position: relative;
padding: 0;
list-style: none;
outline: none;
user-select: none;
}
.spectrum-TreeView-item {
/* Don't let child treeviews that are open spill out */
overflow: hidden;
&.is-open {
> .spectrum-TreeView-itemLink > .spectrum-TreeView-itemIndicator {
/* Rotate the chevron */
transform: logical rotate(90deg);
}
> .spectrum-TreeView {
/* Open the treeview */
block-size: auto;
visibility: visible;
}
}
&.is-drop-target {
.spectrum-TreeView-itemLink {
&:before {
border-width: var(--spectrum-treeview-item-border-size);
}
}
}
&.is-selected {
.spectrum-TreeView-itemLink:not(:focus-ring) {
&:before {
border-width: var(--spectrum-treeview-item-border-size-selected);
}
}
}
}
.spectrum-TreeView-itemLabel {
overflow: hidden;
text-overflow: ellipsis;
}
.spectrum-TreeView-itemLink {
display: flex;
flex-direction: row;
align-items: center;
box-sizing: border-box;
cursor: pointer;
padding-block: var(--spectrum-treeview-item-padding-y);
padding-inline: var(--spectrum-treeview-item-affordance-width);
text-decoration: none;
height: var(--spectrum-treeview-item-min-height);
/* Prevent weirdness that can cause the vertical bar to fall down */
white-space: nowrap;
overflow: hidden;
outline: none;
.spectrum-TreeView-itemIcon {
vertical-align: top;
margin-inline-end: var(--spectrum-treeview-item-icon-margin-right);
}
&:before {
content: '';
box-sizing: border-box;
position: absolute;
inset-inline-start: var(--spectrum-treeview-item-border-size);
inset-inline-end: 0;
block-size: calc(var(--spectrum-treeview-item-height) - var(--spectrum-treeview-item-hover-offset) * 2);
border-style: solid;
border-color: transparent;
border-width: var(--spectrum-treeview-item-border-size) 0 var(--spectrum-treeview-item-border-size) 0;
background-color: transparent;
}
&:focus-ring {
&:before {
border-width: var(--spectrum-treeview-item-border-size);
}
}
}
.spectrum-TreeView--standalone {
.spectrum-TreeView-itemLink {
&:before {
border-radius: var(--spectrum-treeview-item-border-radius);
border-width: var(--spectrum-treeview-item-border-size);
}
}
}
.spectrum-TreeView--thumbnail {
.spectrum-TreeView-itemThumbnail {
margin-inline-end: var(--spectrum-treeview-item-icon-margin-right);
}
.spectrum-TreeView-itemLink {
height: var(--spectrum-treeview-item-height-layers);
&:before {
block-size: var(--spectrum-treeview-item-height-layers);
}
}
}
.spectrum-TreeView-itemIndicator {
display: block;
box-sizing: content-box;
float: inline-start;
position: relative;
/* make sure hover doesn't block clicks on chevron */
z-index: 1;
inset-inline-start: var(--spectrum-global-dimension-size-125);
inset-block-start: calc(-1 * var(--spectrum-global-dimension-size-65));
margin-inline-start: calc(-1 * var(--spectrum-global-dimension-size-500));
margin-block-end: calc(-1 * var(--spectrum-global-dimension-size-125));
margin-inline-end: var(--spectrum-global-dimension-size-85);
padding-inline: var(--spectrum-global-dimension-size-150);
padding-block: var(--spectrum-global-dimension-size-125);
transform: logical rotate(0deg);
transition: transform ease var(--spectrum-global-animation-duration-100);
pointer-events: all !important;
}
/* Close nested treeviews by default */
.spectrum-TreeView .spectrum-TreeView {
/* Don't be a highlight container stealer */
position: static;
padding-inline-start: var(--spectrum-treeview-item-indentation);
/* Be hidden */
block-size: 0;
visibility: hidden;
}
.spectrum-TreeView-item--indent1 {
padding-inline-start: var(--spectrum-treeview-item-indentation);
}
.spectrum-TreeView-item--indent2 {
padding-inline-start: calc(2 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent3 {
padding-inline-start: calc(3 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent4 {
padding-inline-start: calc(4 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent5 {
padding-inline-start: calc(5 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent6 {
padding-inline-start: calc(6 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent7 {
padding-inline-start: calc(7 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent8 {
padding-inline-start: calc(8 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent9 {
padding-inline-start: calc(9 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-item--indent10 {
padding-inline-start: calc(10 * var(--spectrum-treeview-item-indentation));
}
.spectrum-TreeView-heading {
padding: var(--spectrum-treeview-item-padding-y);
font-weight: var(--spectrum-treeview-heading-font-weight);
&:not(:first-child) {
margin-block-start: var(--spectrum-global-dimension-size-200);
}
}