@stoplight/ui-kit 3.0.0-beta.37 → 3.0.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TableOfContents/index.d.ts +3 -0
- package/TableOfContents/index.js +45 -6
- package/TableOfContents/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/_blueprint.scss +4 -4
- package/styles/blueprint/_variables.scss +3 -1
- package/styles/blueprint/select/blueprint-select.scss +8 -0
- package/styles/blueprint/select/components/_index.scss +6 -0
- package/styles/blueprint/select/components/omnibar/_omnibar.scss +63 -0
- package/styles/blueprint/select/components/select/_multi-select.scss +17 -0
- package/styles/blueprint/select/components/select/_select.scss +31 -0
- package/styles/blueprint/src/_reset.scss +43 -0
- package/styles/blueprint/src/_typography.scss +459 -0
- package/styles/blueprint/src/accessibility/_focus-states.scss +17 -0
- package/styles/blueprint/src/blueprint-hi-contrast.scss +22 -0
- package/styles/blueprint/src/blueprint.scss +16 -0
- package/styles/blueprint/src/common/_color-aliases.scss +43 -0
- package/styles/blueprint/src/common/_colors.scss +116 -0
- package/styles/blueprint/src/common/_flex.scss +49 -0
- package/styles/blueprint/src/common/_mixins.scss +128 -0
- package/styles/blueprint/src/common/_react-transition.scss +117 -0
- package/styles/blueprint/src/common/_variables.scss +131 -0
- package/styles/blueprint/src/components/_index.scss +38 -0
- package/styles/blueprint/src/components/alert/_alert.scss +33 -0
- package/styles/blueprint/src/components/breadcrumbs/_breadcrumbs.scss +142 -0
- package/styles/blueprint/src/components/button/_button-group.scss +240 -0
- package/styles/blueprint/src/components/button/_button.scss +206 -0
- package/styles/blueprint/src/components/button/_common.scss +507 -0
- package/styles/blueprint/src/components/callout/_callout.scss +99 -0
- package/styles/blueprint/src/components/card/_card.scss +91 -0
- package/styles/blueprint/src/components/collapse/_collapse.scss +20 -0
- package/styles/blueprint/src/components/context-menu/_context-menu.scss +10 -0
- package/styles/blueprint/src/components/dialog/_dialog.scss +146 -0
- package/styles/blueprint/src/components/divider/_divider.scss +19 -0
- package/styles/blueprint/src/components/drawer/_drawer.scss +232 -0
- package/styles/blueprint/src/components/editable-text/_editable-text.scss +156 -0
- package/styles/blueprint/src/components/forms/_common.scss +239 -0
- package/styles/blueprint/src/components/forms/_control-group.scss +276 -0
- package/styles/blueprint/src/components/forms/_controls.scss +526 -0
- package/styles/blueprint/src/components/forms/_file-input.scss +155 -0
- package/styles/blueprint/src/components/forms/_form-group.scss +111 -0
- package/styles/blueprint/src/components/forms/_index.scss +20 -0
- package/styles/blueprint/src/components/forms/_input-group.scss +247 -0
- package/styles/blueprint/src/components/forms/_input.scss +115 -0
- package/styles/blueprint/src/components/forms/_label.scss +114 -0
- package/styles/blueprint/src/components/forms/_numeric-input.scss +40 -0
- package/styles/blueprint/src/components/hotkeys/_hotkeys.scss +50 -0
- package/styles/blueprint/src/components/html-select/_common.scss +52 -0
- package/styles/blueprint/src/components/html-select/_html-select.scss +104 -0
- package/styles/blueprint/src/components/html-table/_html-table.scss +208 -0
- package/styles/blueprint/src/components/icon/_icon.scss +79 -0
- package/styles/blueprint/src/components/menu/_common.scss +172 -0
- package/styles/blueprint/src/components/menu/_menu.scss +197 -0
- package/styles/blueprint/src/components/menu/_submenu.scss +41 -0
- package/styles/blueprint/src/components/navbar/_navbar.scss +117 -0
- package/styles/blueprint/src/components/non-ideal-state/_non-ideal-state.scss +43 -0
- package/styles/blueprint/src/components/overflow-list/_overflow-list.scss +13 -0
- package/styles/blueprint/src/components/overlay/_overlay.scss +94 -0
- package/styles/blueprint/src/components/panel-stack/_panel-stack.scss +103 -0
- package/styles/blueprint/src/components/popover/_common.scss +171 -0
- package/styles/blueprint/src/components/popover/_popover.scss +127 -0
- package/styles/blueprint/src/components/portal/_portal.scss +15 -0
- package/styles/blueprint/src/components/progress-bar/_common.scss +9 -0
- package/styles/blueprint/src/components/progress-bar/_progress-bar.scss +98 -0
- package/styles/blueprint/src/components/skeleton/_common.scss +8 -0
- package/styles/blueprint/src/components/skeleton/_skeleton.scss +64 -0
- package/styles/blueprint/src/components/slider/_common.scss +48 -0
- package/styles/blueprint/src/components/slider/_slider.scss +216 -0
- package/styles/blueprint/src/components/spinner/_spinner.scss +65 -0
- package/styles/blueprint/src/components/tabs/_tabs.scss +199 -0
- package/styles/blueprint/src/components/tag/_common.scss +202 -0
- package/styles/blueprint/src/components/tag/_tag.scss +75 -0
- package/styles/blueprint/src/components/tag-input/_tag-input.scss +165 -0
- package/styles/blueprint/src/components/toast/_toast.scss +203 -0
- package/styles/blueprint/src/components/tooltip/_common.scss +11 -0
- package/styles/blueprint/src/components/tooltip/_tooltip.scss +61 -0
- package/styles/blueprint/src/components/tree/_tree.scss +194 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright 2018 Palantir Technologies, Inc. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License, Version 2.0.
|
|
3
|
+
|
|
4
|
+
@import "../forms/common";
|
|
5
|
+
|
|
6
|
+
%pt-select {
|
|
7
|
+
@include pt-button-base();
|
|
8
|
+
@include pt-button();
|
|
9
|
+
|
|
10
|
+
// stylelint-disable property-no-vendor-prefix
|
|
11
|
+
-moz-appearance: none;
|
|
12
|
+
-webkit-appearance: none;
|
|
13
|
+
border-radius: $pt-border-radius;
|
|
14
|
+
height: $pt-button-height;
|
|
15
|
+
padding: 0 ($input-padding-horizontal * 2.5) 0 $input-padding-horizontal;
|
|
16
|
+
// fill parent container
|
|
17
|
+
width: 100%;
|
|
18
|
+
// stylelint-enable property-no-vendor-prefix
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
%pt-select-minimal {
|
|
22
|
+
@include pt-button-minimal();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
%pt-select-large {
|
|
26
|
+
font-size: $pt-font-size-large;
|
|
27
|
+
height: $pt-button-height-large;
|
|
28
|
+
padding-right: $input-padding-horizontal * 3.5;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
%pt-dark-select {
|
|
32
|
+
@include pt-dark-button();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
%pt-select-disabled {
|
|
36
|
+
background-color: $button-background-color-disabled;
|
|
37
|
+
box-shadow: none;
|
|
38
|
+
color: $button-color-disabled;
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
%pt-select-arrow {
|
|
43
|
+
color: $pt-icon-color;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
position: absolute;
|
|
46
|
+
right: $input-padding-horizontal * 0.7;
|
|
47
|
+
top: ($pt-button-height - $pt-icon-size-standard) * 0.5;
|
|
48
|
+
|
|
49
|
+
&.#{$ns}-disabled {
|
|
50
|
+
color: $pt-icon-color-disabled;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License, Version 2.0.
|
|
3
|
+
|
|
4
|
+
@import "../../common/variables";
|
|
5
|
+
@import "../popover/common";
|
|
6
|
+
@import "./common";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
HTML select
|
|
10
|
+
|
|
11
|
+
Markup:
|
|
12
|
+
<div class="#{$ns}-select {{.modifier}}">
|
|
13
|
+
<select {{:modifier}}>
|
|
14
|
+
<option selected>Choose an item...</option>
|
|
15
|
+
<option value="1">One</option>
|
|
16
|
+
<option value="2">Two</option>
|
|
17
|
+
<option value="3">Three</option>
|
|
18
|
+
<option value="4">Four</option>
|
|
19
|
+
</select>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
:disabled - Disabled. Also add <code>.#{$ns}-disabled</code> to <code>.#{$ns}-select</code> for icon coloring (not shown below).
|
|
23
|
+
.#{$ns}-fill - Expand to fill parent container
|
|
24
|
+
.#{$ns}-large - Large size
|
|
25
|
+
.#{$ns}-minimal - Minimal appearance
|
|
26
|
+
|
|
27
|
+
Styleguide select
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
.#{$ns}-html-select,
|
|
31
|
+
.#{$ns}-select {
|
|
32
|
+
display: inline-block;
|
|
33
|
+
letter-spacing: normal;
|
|
34
|
+
position: relative;
|
|
35
|
+
vertical-align: middle;
|
|
36
|
+
|
|
37
|
+
select {
|
|
38
|
+
@extend %pt-select;
|
|
39
|
+
|
|
40
|
+
&:disabled {
|
|
41
|
+
@extend %pt-select-disabled;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&::-ms-expand {
|
|
45
|
+
// IE11 styling to hide the arrow
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.#{$ns}-icon {
|
|
51
|
+
@extend %pt-select-arrow;
|
|
52
|
+
@include pt-icon-colors();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.#{$ns}-minimal select {
|
|
56
|
+
@extend %pt-select-minimal;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.#{$ns}-large {
|
|
60
|
+
select {
|
|
61
|
+
@extend %pt-select-large;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&::after, // CSS support
|
|
65
|
+
.#{$ns}-icon {
|
|
66
|
+
right: $pt-grid-size * 1.2;
|
|
67
|
+
top: ($pt-button-height-large - $pt-icon-size-standard) * 0.5;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.#{$ns}-fill {
|
|
72
|
+
&,
|
|
73
|
+
select {
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.#{$ns}-dark & {
|
|
79
|
+
select {
|
|
80
|
+
@extend %pt-dark-select;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
option {
|
|
84
|
+
background-color: $dark-popover-background-color;
|
|
85
|
+
color: $pt-dark-text-color;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
option:disabled {
|
|
89
|
+
color: $pt-dark-text-color-disabled;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&::after {
|
|
93
|
+
color: $pt-dark-icon-color;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.#{$ns}-select {
|
|
99
|
+
&::after {
|
|
100
|
+
@extend %pt-select-arrow;
|
|
101
|
+
@include pt-icon();
|
|
102
|
+
content: $pt-icon-double-caret-vertical;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License, Version 2.0.
|
|
3
|
+
|
|
4
|
+
@import "../../common/variables";
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
Tables
|
|
8
|
+
|
|
9
|
+
Markup:
|
|
10
|
+
<table class="#{$ns}-html-table {{.modifier}}">
|
|
11
|
+
<thead>
|
|
12
|
+
<tr>
|
|
13
|
+
<th>Project</th>
|
|
14
|
+
<th>Description</th>
|
|
15
|
+
<th>Technologies</th>
|
|
16
|
+
</tr>
|
|
17
|
+
</thead>
|
|
18
|
+
<tbody>
|
|
19
|
+
<tr>
|
|
20
|
+
<td>Blueprint</td>
|
|
21
|
+
<td>CSS framework and UI toolkit</td>
|
|
22
|
+
<td>Sass, TypeScript, React</td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr>
|
|
25
|
+
<td>TSLint</td>
|
|
26
|
+
<td>Static analysis linter for TypeScript</td>
|
|
27
|
+
<td>TypeScript</td>
|
|
28
|
+
</tr>
|
|
29
|
+
<tr>
|
|
30
|
+
<td>Plottable</td>
|
|
31
|
+
<td>Composable charting library built on top of D3</td>
|
|
32
|
+
<td>SVG, TypeScript, D3</td>
|
|
33
|
+
</tr>
|
|
34
|
+
</tbody>
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
.#{$ns}-html-table-bordered - Bordered appearance
|
|
38
|
+
.#{$ns}-html-table-condensed - Condensed smaller appearance
|
|
39
|
+
.#{$ns}-html-table-striped - Striped appearance
|
|
40
|
+
.#{$ns}-interactive - Enables hover styles on rows
|
|
41
|
+
.#{$ns}-small - Small, condensed appearance for this element _and all child elements_
|
|
42
|
+
|
|
43
|
+
Styleguide html-table
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
$table-row-height: $pt-grid-size * 4 !default;
|
|
47
|
+
$table-row-height-small: $pt-grid-size * 3 !default;
|
|
48
|
+
$table-border-width: 1px !default;
|
|
49
|
+
$table-border-color: $pt-divider-black !default;
|
|
50
|
+
$dark-table-border-color: $pt-dark-divider-white !default;
|
|
51
|
+
|
|
52
|
+
// placeholder for extending inside running-text (see typography)
|
|
53
|
+
%html-table {
|
|
54
|
+
border-spacing: 0;
|
|
55
|
+
font-size: $pt-font-size;
|
|
56
|
+
|
|
57
|
+
th,
|
|
58
|
+
td {
|
|
59
|
+
padding: centered-text($table-row-height);
|
|
60
|
+
text-align: left;
|
|
61
|
+
vertical-align: top;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
th {
|
|
65
|
+
color: $pt-heading-color;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
td {
|
|
70
|
+
color: $pt-text-color;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
tbody tr:first-child {
|
|
74
|
+
th,
|
|
75
|
+
td {
|
|
76
|
+
box-shadow: inset 0 $table-border-width 0 0 $table-border-color;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// a bunch of deep compound selectors ahead, but there's not really a better way to do this right now
|
|
81
|
+
// stylelint-disable selector-max-compound-selectors
|
|
82
|
+
.#{$ns}-dark & {
|
|
83
|
+
th {
|
|
84
|
+
color: $pt-dark-heading-color;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
td {
|
|
88
|
+
color: $pt-dark-text-color;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
tbody tr:first-child {
|
|
92
|
+
th,
|
|
93
|
+
td {
|
|
94
|
+
box-shadow: inset 0 $table-border-width 0 0 $dark-table-border-color;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// stylelint-enable selector-max-compound-selectors
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
table.#{$ns}-html-table {
|
|
102
|
+
@extend %html-table;
|
|
103
|
+
|
|
104
|
+
&.#{$ns}-html-table-condensed,
|
|
105
|
+
&.#{$ns}-small {
|
|
106
|
+
$small-vertical-padding: centered-text($table-row-height-small);
|
|
107
|
+
|
|
108
|
+
th,
|
|
109
|
+
td {
|
|
110
|
+
padding-bottom: $small-vertical-padding;
|
|
111
|
+
padding-top: $small-vertical-padding;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&.#{$ns}-html-table-striped {
|
|
116
|
+
tbody tr:nth-child(odd) td {
|
|
117
|
+
background: rgba($gray5, 0.15);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Borders are applied as box-shadows (at the top and left borders of a cell) for better color control.
|
|
122
|
+
&.#{$ns}-html-table-bordered {
|
|
123
|
+
th:not(:first-child) {
|
|
124
|
+
box-shadow: inset $table-border-width 0 0 0 $table-border-color;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
tbody tr td {
|
|
128
|
+
box-shadow: inset 0 $table-border-width 0 0 $table-border-color;
|
|
129
|
+
|
|
130
|
+
&:not(:first-child) {
|
|
131
|
+
box-shadow: inset $table-border-width $table-border-width 0 0 $table-border-color;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&.#{$ns}-html-table-striped {
|
|
136
|
+
tbody tr:not(:first-child) td {
|
|
137
|
+
box-shadow: none;
|
|
138
|
+
|
|
139
|
+
&:not(:first-child) {
|
|
140
|
+
box-shadow: inset $table-border-width 0 0 0 $table-border-color;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&.#{$ns}-interactive {
|
|
147
|
+
tbody tr {
|
|
148
|
+
&:hover td {
|
|
149
|
+
background-color: rgba($gray5, 0.3);
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&:active td {
|
|
154
|
+
background-color: rgba($gray5, 0.4);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.#{$ns}-dark & {
|
|
160
|
+
// stylelint-disable selector-max-compound-selectors
|
|
161
|
+
&.#{$ns}-html-table-striped {
|
|
162
|
+
tbody tr:nth-child(odd) td {
|
|
163
|
+
background: rgba($gray1, 0.15);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Borders are applied as box-shadows (at the top and left borders of a cell) for better color control.
|
|
168
|
+
&.#{$ns}-html-table-bordered {
|
|
169
|
+
th:not(:first-child) {
|
|
170
|
+
box-shadow: inset $table-border-width 0 0 0 $dark-table-border-color;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
tbody tr td {
|
|
174
|
+
box-shadow: inset 0 $table-border-width 0 0 $dark-table-border-color;
|
|
175
|
+
|
|
176
|
+
&:not(:first-child) {
|
|
177
|
+
box-shadow: inset $table-border-width $table-border-width 0 0 $dark-table-border-color;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.#{$ns}-html-table-striped {
|
|
182
|
+
tbody tr:not(:first-child) td {
|
|
183
|
+
box-shadow: inset $table-border-width 0 0 0 $dark-table-border-color;
|
|
184
|
+
|
|
185
|
+
// easier than the alternative...
|
|
186
|
+
// stylelint-disable max-nesting-depth
|
|
187
|
+
&:first-child {
|
|
188
|
+
box-shadow: none;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&.#{$ns}-interactive {
|
|
195
|
+
tbody tr {
|
|
196
|
+
&:hover td {
|
|
197
|
+
background-color: rgba($gray1, 0.3);
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&:active td {
|
|
202
|
+
background-color: rgba($gray1, 0.4);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// stylelint-enable selector-max-compound-selectors
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License, Version 2.0.
|
|
3
|
+
|
|
4
|
+
@import "~@blueprintjs/icons/src/icons";
|
|
5
|
+
|
|
6
|
+
// the icon class which will contain an SVG icon
|
|
7
|
+
.#{$ns}-icon {
|
|
8
|
+
// ensure icons sit inline with text & isolate svg from surrounding elements
|
|
9
|
+
// (vertical alignment in flow is usually off due to svg - not an issue with flex.)
|
|
10
|
+
display: inline-block;
|
|
11
|
+
// respect dimensions exactly
|
|
12
|
+
flex: 0 0 auto;
|
|
13
|
+
// sit nicely with inline text
|
|
14
|
+
vertical-align: text-bottom;
|
|
15
|
+
|
|
16
|
+
&:not(:empty)::before {
|
|
17
|
+
// clear font icon when there's an <svg> image
|
|
18
|
+
/* stylelint-disable */
|
|
19
|
+
content: "" !important; // fallback for IE11
|
|
20
|
+
content: unset !important;
|
|
21
|
+
/* stylelint-enable */
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> svg {
|
|
25
|
+
// prevent extra vertical whitespace
|
|
26
|
+
display: block;
|
|
27
|
+
|
|
28
|
+
// inherit text color unless explicit fill is set
|
|
29
|
+
&:not([fill]) {
|
|
30
|
+
fill: currentColor;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// intent support for both SVG and legacy font icons
|
|
36
|
+
#{$icon-classes} {
|
|
37
|
+
@each $intent, $color in $pt-intent-text-colors {
|
|
38
|
+
&.#{$ns}-intent-#{$intent} {
|
|
39
|
+
color: $color;
|
|
40
|
+
|
|
41
|
+
.#{$ns}-dark & {
|
|
42
|
+
color: map-get($pt-dark-intent-text-colors, $intent);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//
|
|
49
|
+
// LEGACY icon font styles
|
|
50
|
+
//
|
|
51
|
+
|
|
52
|
+
span.#{$ns}-icon-standard {
|
|
53
|
+
@include pt-icon($pt-icon-size-standard);
|
|
54
|
+
display: inline-block;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
span.#{$ns}-icon-large {
|
|
58
|
+
@include pt-icon($pt-icon-size-large);
|
|
59
|
+
display: inline-block;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// only apply icon font styles when <svg> image is not present
|
|
63
|
+
span.#{$ns}-icon:empty {
|
|
64
|
+
font-family: $icons20-family;
|
|
65
|
+
font-size: inherit;
|
|
66
|
+
font-style: normal;
|
|
67
|
+
font-weight: 400;
|
|
68
|
+
line-height: 1;
|
|
69
|
+
|
|
70
|
+
&::before {
|
|
71
|
+
@include pt-icon-font-smoothing();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@each $name, $content in $icons {
|
|
76
|
+
.#{$ns}-icon-#{$name}::before {
|
|
77
|
+
content: $content;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License, Version 2.0.
|
|
3
|
+
|
|
4
|
+
$half-grid-size: $pt-grid-size * 0.5 !default;
|
|
5
|
+
|
|
6
|
+
$menu-item-border-radius: $pt-border-radius - 1 !default;
|
|
7
|
+
|
|
8
|
+
// Set line-height of menu items to be a multiple of the font size. This is
|
|
9
|
+
// needed because if the line-height does not extend far enough past the font's
|
|
10
|
+
// baseline, clipping will occur when the .#{$ns}-text-overflow-ellipsis class is
|
|
11
|
+
// applied to it (#2177). Also, line-height should be an even value, or content
|
|
12
|
+
// will be misaligned by one pixel (Chrome quirk).
|
|
13
|
+
$menu-item-line-height-factor: 1.4;
|
|
14
|
+
$menu-item-line-height: round($pt-font-size * $menu-item-line-height-factor);
|
|
15
|
+
$menu-item-line-height-large: round($pt-font-size-large * $menu-item-line-height-factor);
|
|
16
|
+
|
|
17
|
+
$menu-min-width: $pt-grid-size * 18 !default;
|
|
18
|
+
$menu-item-padding: ($pt-button-height - $pt-icon-size-standard) * 0.5 !default;
|
|
19
|
+
$menu-item-padding-large: ($pt-button-height-large - $pt-icon-size-large) * 0.5 !default;
|
|
20
|
+
$menu-item-padding-vertical: ($pt-button-height - $menu-item-line-height) * 0.5 !default;
|
|
21
|
+
$menu-item-padding-vertical-large:
|
|
22
|
+
($pt-button-height-large - $menu-item-line-height-large) * 0.5 !default;
|
|
23
|
+
|
|
24
|
+
$menu-background-color: $white !default;
|
|
25
|
+
$dark-menu-background-color: $dark-gray4 !default;
|
|
26
|
+
|
|
27
|
+
$menu-item-color-hover: $minimal-button-background-color-hover !default;
|
|
28
|
+
$menu-item-color-active: $minimal-button-background-color-active !default;
|
|
29
|
+
$dark-menu-item-color-hover: $dark-minimal-button-background-color-hover !default;
|
|
30
|
+
$dark-menu-item-color-active: $dark-minimal-button-background-color-active !default;
|
|
31
|
+
|
|
32
|
+
// customize modifier classes with params.
|
|
33
|
+
// setting modifier to "" will generally apply it as default styles due to & selectors
|
|
34
|
+
@mixin menu-item($disabled-selector: ".#{$ns}-disabled", $hover-selector: ":hover") {
|
|
35
|
+
@include pt-flex-container(row, $menu-item-padding);
|
|
36
|
+
align-items: flex-start;
|
|
37
|
+
border-radius: $menu-item-border-radius;
|
|
38
|
+
color: inherit;
|
|
39
|
+
line-height: $menu-item-line-height;
|
|
40
|
+
padding: $menu-item-padding-vertical $menu-item-padding;
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
user-select: none;
|
|
43
|
+
|
|
44
|
+
> .#{$ns}-fill {
|
|
45
|
+
word-break: break-word;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&#{$hover-selector} {
|
|
49
|
+
background-color: $menu-item-color-hover;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&#{$disabled-selector} {
|
|
55
|
+
background-color: inherit;
|
|
56
|
+
color: $pt-text-color-disabled;
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.#{$ns}-dark & {
|
|
61
|
+
@include dark-menu-item($disabled-selector, $hover-selector);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@mixin dark-menu-item($disabled-selector: ".#{$ns}-disabled", $hover-selector: ":hover") {
|
|
66
|
+
color: inherit;
|
|
67
|
+
|
|
68
|
+
&#{$hover-selector} {
|
|
69
|
+
background-color: $dark-menu-item-color-hover;
|
|
70
|
+
color: inherit;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&#{$disabled-selector} {
|
|
74
|
+
background-color: inherit;
|
|
75
|
+
color: $pt-dark-text-color-disabled;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@mixin menu-item-intent($text-colors: $pt-intent-text-colors) {
|
|
80
|
+
@each $intent, $color in $text-colors {
|
|
81
|
+
&.#{$ns}-intent-#{$intent} {
|
|
82
|
+
color: $color;
|
|
83
|
+
|
|
84
|
+
.#{$ns}-icon {
|
|
85
|
+
color: inherit;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&::before,
|
|
89
|
+
&::after,
|
|
90
|
+
.#{$ns}-menu-item-label {
|
|
91
|
+
color: $color;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:hover,
|
|
95
|
+
&.#{$ns}-active {
|
|
96
|
+
background-color: nth(map-get($button-intents, $intent), 1);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:active {
|
|
100
|
+
background-color: nth(map-get($button-intents, $intent), 2);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:hover,
|
|
104
|
+
&:active,
|
|
105
|
+
&.#{$ns}-active {
|
|
106
|
+
&,
|
|
107
|
+
&::before,
|
|
108
|
+
&::after,
|
|
109
|
+
.#{$ns}-menu-item-label {
|
|
110
|
+
color: $white;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@mixin menu-item-large() {
|
|
118
|
+
font-size: $pt-font-size-large;
|
|
119
|
+
line-height: $menu-item-line-height-large;
|
|
120
|
+
padding: $menu-item-padding-vertical-large $menu-item-padding;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@mixin menu-divider() {
|
|
124
|
+
border-top: 1px solid $pt-divider-black;
|
|
125
|
+
display: block;
|
|
126
|
+
margin: $half-grid-size;
|
|
127
|
+
|
|
128
|
+
.#{$ns}-dark & {
|
|
129
|
+
border-top-color: $pt-dark-divider-white;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@mixin menu-header($heading-selector: null) {
|
|
134
|
+
@include menu-divider();
|
|
135
|
+
cursor: default;
|
|
136
|
+
padding-left: $menu-item-padding - $half-grid-size;
|
|
137
|
+
|
|
138
|
+
@if $heading-selector != null {
|
|
139
|
+
&:first-of-type {
|
|
140
|
+
border-top: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
#{$heading-selector} {
|
|
144
|
+
@include menu-heading();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&:first-of-type #{$heading-selector} {
|
|
148
|
+
padding-top: 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@mixin menu-heading() {
|
|
154
|
+
@include heading-typography();
|
|
155
|
+
@include overflow-ellipsis();
|
|
156
|
+
// a little extra space to avoid clipping descenders (because overflow hidden)
|
|
157
|
+
line-height: $pt-icon-size-standard + 1px;
|
|
158
|
+
margin: 0;
|
|
159
|
+
padding: $pt-grid-size $menu-item-padding 0 1px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@mixin menu-header-large($heading-selector) {
|
|
163
|
+
#{$heading-selector} {
|
|
164
|
+
font-size: $pt-grid-size * 1.8;
|
|
165
|
+
padding-bottom: $pt-grid-size * 0.5;
|
|
166
|
+
padding-top: $pt-grid-size * 1.5;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&:first-of-type #{$heading-selector} {
|
|
170
|
+
padding-top: 0;
|
|
171
|
+
}
|
|
172
|
+
}
|