@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,240 @@
|
|
|
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 "../forms/common";
|
|
6
|
+
@import "./common";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Button groups
|
|
10
|
+
|
|
11
|
+
Markup:
|
|
12
|
+
<div class="#{$ns}-button-group {{.modifier}}">
|
|
13
|
+
<button type="button" class="#{$ns}-button #{$ns}-intent-success">Save</button>
|
|
14
|
+
<button type="button" class="#{$ns}-button #{$ns}-intent-success #{$ns}-icon-caret-down"></button>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="#{$ns}-button-group {{.modifier}}">
|
|
17
|
+
<a class="#{$ns}-button #{$ns}-icon-database" tabindex="0" role="button">Queries</a>
|
|
18
|
+
<a class="#{$ns}-button #{$ns}-icon-function" tabindex="0" role="button">Functions</a>
|
|
19
|
+
<a class="#{$ns}-button" tabindex="0" role="button">
|
|
20
|
+
Options <span class="#{$ns}-icon-standard #{$ns}-icon-caret-down #{$ns}-align-right"></span>
|
|
21
|
+
</a>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="#{$ns}-button-group {{.modifier}}">
|
|
24
|
+
<a class="#{$ns}-button #{$ns}-icon-chart" tabindex="0" role="button"></a>
|
|
25
|
+
<a class="#{$ns}-button #{$ns}-icon-control" tabindex="0" role="button"></a>
|
|
26
|
+
<a class="#{$ns}-button #{$ns}-icon-graph" tabindex="0" role="button"></a>
|
|
27
|
+
<a class="#{$ns}-button #{$ns}-icon-camera" tabindex="0" role="button"></a>
|
|
28
|
+
<a class="#{$ns}-button #{$ns}-icon-map" tabindex="0" role="button"></a>
|
|
29
|
+
<a class="#{$ns}-button #{$ns}-icon-code" tabindex="0" role="button"></a>
|
|
30
|
+
<a class="#{$ns}-button #{$ns}-icon-th" tabindex="0" role="button"></a>
|
|
31
|
+
<a class="#{$ns}-button #{$ns}-icon-time" tabindex="0" role="button"></a>
|
|
32
|
+
<a class="#{$ns}-button #{$ns}-icon-compressed" tabindex="0" role="button"></a>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
.#{$ns}-fill - Buttons expand equally to fill container
|
|
36
|
+
.#{$ns}-large - Use large buttons
|
|
37
|
+
.#{$ns}-minimal - Use minimal buttons
|
|
38
|
+
.#{$ns}-vertical - Vertical layout
|
|
39
|
+
|
|
40
|
+
Styleguide button-group
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
.#{$ns}-button-group {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
|
|
46
|
+
.#{$ns}-button {
|
|
47
|
+
// ensure button can never be smaller than its default size
|
|
48
|
+
flex: 0 0 auto;
|
|
49
|
+
position: relative;
|
|
50
|
+
z-index: index($control-group-stack, "button-default");
|
|
51
|
+
|
|
52
|
+
// the ordering of these z-index CSS rules is particular because of CSS
|
|
53
|
+
// selector specificity. specifically, disabled styles should have
|
|
54
|
+
// precedence over hover and active styles to prevent mouse interactions on
|
|
55
|
+
// disabled buttons from reordering elements in the stack.
|
|
56
|
+
|
|
57
|
+
&:focus {
|
|
58
|
+
z-index: index($control-group-stack, "button-focus");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
z-index: index($control-group-stack, "button-hover");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:active,
|
|
66
|
+
&.#{$ns}-active {
|
|
67
|
+
z-index: index($control-group-stack, "button-active");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:disabled,
|
|
71
|
+
&.#{$ns}-disabled {
|
|
72
|
+
z-index: index($control-group-stack, "button-disabled");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[class*="#{$ns}-intent-"] {
|
|
76
|
+
z-index: index($control-group-stack, "intent-button-default");
|
|
77
|
+
|
|
78
|
+
&:focus {
|
|
79
|
+
z-index: index($control-group-stack, "intent-button-focus");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
z-index: index($control-group-stack, "intent-button-hover");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:active,
|
|
87
|
+
&.#{$ns}-active {
|
|
88
|
+
z-index: index($control-group-stack, "intent-button-active");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&:disabled,
|
|
92
|
+
&.#{$ns}-disabled {
|
|
93
|
+
z-index: index($control-group-stack, "intent-button-disabled");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// support wrapping buttons in a tooltip, which adds a wrapper element
|
|
99
|
+
&:not(.#{$ns}-minimal) {
|
|
100
|
+
> .#{$ns}-popover-wrapper:not(:first-child) .#{$ns}-button,
|
|
101
|
+
> .#{$ns}-button:not(:first-child) {
|
|
102
|
+
border-bottom-left-radius: 0;
|
|
103
|
+
border-top-left-radius: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
> .#{$ns}-popover-wrapper:not(:last-child) .#{$ns}-button,
|
|
107
|
+
> .#{$ns}-button:not(:last-child) {
|
|
108
|
+
border-bottom-right-radius: 0;
|
|
109
|
+
border-top-right-radius: 0;
|
|
110
|
+
margin-right: -$button-border-width;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.#{$ns}-minimal {
|
|
115
|
+
.#{$ns}-button {
|
|
116
|
+
@include pt-button-minimal();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.#{$ns}-popover-wrapper,
|
|
121
|
+
.#{$ns}-popover-target {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex: 1 1 auto;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/*
|
|
127
|
+
Responsive
|
|
128
|
+
|
|
129
|
+
Markup:
|
|
130
|
+
<div class="#{$ns}-button-group #{$ns}-large #{$ns}-fill">
|
|
131
|
+
<a class="#{$ns}-button #{$ns}-intent-primary #{$ns}-fixed" tabindex="0" role="button">Start</a>
|
|
132
|
+
<a class="#{$ns}-button #{$ns}-intent-primary" tabindex="0" role="button">Left</a>
|
|
133
|
+
<a class="#{$ns}-button #{$ns}-intent-primary #{$ns}-active" tabindex="0" role="button">Middle</a>
|
|
134
|
+
<a class="#{$ns}-button #{$ns}-intent-primary" tabindex="0" role="button">Right</a>
|
|
135
|
+
<a class="#{$ns}-button #{$ns}-intent-primary #{$ns}-fixed" tabindex="0" role="button">End</a>
|
|
136
|
+
</div>
|
|
137
|
+
<br />
|
|
138
|
+
<div class="#{$ns}-button-group #{$ns}-fill">
|
|
139
|
+
<button class="#{$ns}-button #{$ns}-icon-arrow-left"></button>
|
|
140
|
+
<button class="#{$ns}-button #{$ns}-fill">Middle</button>
|
|
141
|
+
<button class="#{$ns}-button #{$ns}-icon-arrow-right"></button>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
Styleguide button-group}-fill
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
&.#{$ns}-fill {
|
|
148
|
+
display: flex;
|
|
149
|
+
width: 100%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.#{$ns}-button.#{$ns}-fill,
|
|
153
|
+
&.#{$ns}-fill .#{$ns}-button:not(.#{$ns}-fixed) {
|
|
154
|
+
flex: 1 1 auto;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/*
|
|
158
|
+
Vertical button groups
|
|
159
|
+
|
|
160
|
+
Markup:
|
|
161
|
+
<div class="#{$ns}-button-group #{$ns}-vertical">
|
|
162
|
+
<a class="#{$ns}-button #{$ns}-icon-search-template" role="button" tabindex="0"></a>
|
|
163
|
+
<a class="#{$ns}-button #{$ns}-icon-zoom-in" role="button" tabindex="0"></a>
|
|
164
|
+
<a class="#{$ns}-button #{$ns}-icon-zoom-out" role="button" tabindex="0"></a>
|
|
165
|
+
<a class="#{$ns}-button #{$ns}-icon-zoom-to-fit" role="button" tabindex="0"></a>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="#{$ns}-button-group #{$ns}-vertical">
|
|
168
|
+
<button type="button" class="#{$ns}-button #{$ns}-active">Home</button>
|
|
169
|
+
<button type="button" class="#{$ns}-button">Pages</button>
|
|
170
|
+
<button type="button" class="#{$ns}-button">Blog</button>
|
|
171
|
+
<button type="button" class="#{$ns}-button">Calendar</button>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="#{$ns}-button-group #{$ns}-vertical #{$ns}-align-left #{$ns}-large">
|
|
174
|
+
<button type="button" class="#{$ns}-button #{$ns}-intent-primary #{$ns}-icon-document">Text</button>
|
|
175
|
+
<button type="button" class="#{$ns}-button #{$ns}-intent-primary #{$ns}-icon-media #{$ns}-active">Media</button>
|
|
176
|
+
<button type="button" class="#{$ns}-button #{$ns}-intent-primary #{$ns}-icon-link">Sources</button>
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
Styleguide button-group-vertical
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
&.#{$ns}-vertical {
|
|
183
|
+
align-items: stretch;
|
|
184
|
+
flex-direction: column;
|
|
185
|
+
vertical-align: top;
|
|
186
|
+
|
|
187
|
+
&.#{$ns}-fill {
|
|
188
|
+
height: 100%;
|
|
189
|
+
width: unset;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.#{$ns}-button {
|
|
193
|
+
// we never want that margin-right when vertical
|
|
194
|
+
margin-right: 0 !important; // stylelint-disable-line declaration-no-important
|
|
195
|
+
// needed to ensure buttons take up the full width when wrapped in a Popover:
|
|
196
|
+
width: 100%;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:not(.#{$ns}-minimal) {
|
|
200
|
+
> .#{$ns}-popover-wrapper:first-child .#{$ns}-button,
|
|
201
|
+
> .#{$ns}-button:first-child {
|
|
202
|
+
border-radius: $pt-border-radius $pt-border-radius 0 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
> .#{$ns}-popover-wrapper:last-child .#{$ns}-button,
|
|
206
|
+
> .#{$ns}-button:last-child {
|
|
207
|
+
border-radius: 0 0 $pt-border-radius $pt-border-radius;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
> .#{$ns}-popover-wrapper:not(:last-child) .#{$ns}-button,
|
|
211
|
+
> .#{$ns}-button:not(:last-child) {
|
|
212
|
+
margin-bottom: -$button-border-width;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&.#{$ns}-align-left .#{$ns}-button {
|
|
218
|
+
text-align: left;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.#{$ns}-dark & {
|
|
222
|
+
// support wrapping buttons in a Blueprint.Tooltip, which adds a wrapper element
|
|
223
|
+
// in dark theme, we adjust the spacing between buttons for best visual results
|
|
224
|
+
&:not(.#{$ns}-minimal) {
|
|
225
|
+
// deeply nested selector necessary to target the appropriate popover
|
|
226
|
+
// wrapper, yet ensure we only style buttons within the target.
|
|
227
|
+
> .#{$ns}-popover-wrapper:not(:last-child) .#{$ns}-button,
|
|
228
|
+
> .#{$ns}-button:not(:last-child) {
|
|
229
|
+
margin-right: $button-border-width;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&.#{$ns}-vertical {
|
|
234
|
+
> .#{$ns}-popover-wrapper:not(:last-child) .#{$ns}-button,
|
|
235
|
+
> .#{$ns}-button:not(:last-child) {
|
|
236
|
+
margin-bottom: $button-border-width;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
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 "./common";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Button
|
|
9
|
+
|
|
10
|
+
Markup:
|
|
11
|
+
<a role="button" class="#{$ns}-button {{.modifier}}" {{:modifier}} tabindex="0">Anchor</a>
|
|
12
|
+
<button type="button" class="#{$ns}-button #{$ns}-icon-add {{.modifier}}" {{:modifier}}>Button</button>
|
|
13
|
+
|
|
14
|
+
:disabled - Disabled state
|
|
15
|
+
.#{$ns}-active - Active appearance
|
|
16
|
+
.#{$ns}-disabled - Disabled appearance
|
|
17
|
+
.#{$ns}-intent-primary - Primary intent
|
|
18
|
+
.#{$ns}-intent-success - Success intent
|
|
19
|
+
.#{$ns}-intent-warning - Warning intent
|
|
20
|
+
.#{$ns}-intent-danger - Danger intent
|
|
21
|
+
.#{$ns}-minimal - More subtle appearance
|
|
22
|
+
.#{$ns}-outlined - Subtle yet structured appearance
|
|
23
|
+
.#{$ns}-large - Larger size
|
|
24
|
+
.#{$ns}-small - Smaller size
|
|
25
|
+
.#{$ns}-fill - Fill parent container
|
|
26
|
+
|
|
27
|
+
Styleguide button
|
|
28
|
+
*/
|
|
29
|
+
.#{$ns}-button {
|
|
30
|
+
@include pt-button-base();
|
|
31
|
+
@include pt-button-height($pt-button-height);
|
|
32
|
+
|
|
33
|
+
&:empty {
|
|
34
|
+
// override padding from other modifiers (for CSS icon support)
|
|
35
|
+
// stylelint-disable-next-line declaration-no-important
|
|
36
|
+
padding: 0 !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:disabled,
|
|
40
|
+
&.#{$ns}-disabled {
|
|
41
|
+
cursor: not-allowed;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.#{$ns}-fill {
|
|
45
|
+
display: flex;
|
|
46
|
+
width: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.#{$ns}-align-right,
|
|
50
|
+
.#{$ns}-align-right & {
|
|
51
|
+
text-align: right;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.#{$ns}-align-left,
|
|
55
|
+
.#{$ns}-align-left & {
|
|
56
|
+
text-align: left;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// default styles
|
|
60
|
+
&:not([class*="#{$ns}-intent-"]) {
|
|
61
|
+
@include pt-button();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// intents
|
|
65
|
+
@each $intent, $colors in $button-intents {
|
|
66
|
+
&.#{$ns}-intent-#{$intent} {
|
|
67
|
+
@include pt-button-intent($colors...);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&[class*="#{$ns}-intent-"] .#{$ns}-button-spinner .#{$ns}-spinner-head {
|
|
72
|
+
stroke: $white;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// size modifiers
|
|
76
|
+
&.#{$ns}-large,
|
|
77
|
+
.#{$ns}-large & {
|
|
78
|
+
@include pt-button-height-large();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.#{$ns}-small,
|
|
82
|
+
.#{$ns}-small & {
|
|
83
|
+
@include pt-button-height-small();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// loading state
|
|
87
|
+
&.#{$ns}-loading {
|
|
88
|
+
position: relative;
|
|
89
|
+
|
|
90
|
+
&[class*="#{$ns}-icon-"]::before {
|
|
91
|
+
visibility: hidden;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.#{$ns}-button-spinner {
|
|
95
|
+
margin: 0;
|
|
96
|
+
// spinner appears centered within button
|
|
97
|
+
position: absolute;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
> :not(.#{$ns}-button-spinner) {
|
|
101
|
+
visibility: hidden;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// icons
|
|
106
|
+
&[class*="#{$ns}-icon-"] {
|
|
107
|
+
&::before {
|
|
108
|
+
@include pt-icon();
|
|
109
|
+
color: $pt-icon-color;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
#{$icon-classes} {
|
|
114
|
+
color: $pt-icon-color;
|
|
115
|
+
|
|
116
|
+
&.#{$ns}-align-right {
|
|
117
|
+
margin-left: $button-icon-spacing;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// button with SVG icon only (no text or children)
|
|
122
|
+
.#{$ns}-icon:first-child:last-child,
|
|
123
|
+
// if loading, then it contains exactly [spinner, icon]
|
|
124
|
+
.#{$ns}-spinner + .#{$ns}-icon:last-child {
|
|
125
|
+
// center icon horizontally. this works for large buttons too.
|
|
126
|
+
margin: 0 (-($pt-button-height - $pt-icon-size-standard) * 0.5);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// dark theme
|
|
130
|
+
.#{$ns}-dark & {
|
|
131
|
+
&:not([class*="#{$ns}-intent-"]) {
|
|
132
|
+
@include pt-dark-button();
|
|
133
|
+
|
|
134
|
+
&[class*="#{$ns}-icon-"]::before {
|
|
135
|
+
color: $pt-dark-icon-color;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
#{$icon-classes} {
|
|
139
|
+
color: $pt-dark-icon-color;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&[class*="#{$ns}-intent-"] {
|
|
144
|
+
@include pt-dark-button-intent();
|
|
145
|
+
|
|
146
|
+
.#{$ns}-button-spinner .#{$ns}-spinner-head {
|
|
147
|
+
stroke: $dark-progress-head-color;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// disabled and intent button icon should use same color as text
|
|
153
|
+
&:disabled,
|
|
154
|
+
&.#{$ns}-disabled,
|
|
155
|
+
&[class*="#{$ns}-intent-"] {
|
|
156
|
+
&::before,
|
|
157
|
+
#{$icon-classes} {
|
|
158
|
+
// stylelint-disable-next-line declaration-no-important
|
|
159
|
+
color: inherit !important;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// minimal must come last to override all default styles
|
|
164
|
+
&.#{$ns}-minimal {
|
|
165
|
+
@include pt-button-minimal();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// outline is based on the styles of minimal
|
|
169
|
+
&.#{$ns}-outlined {
|
|
170
|
+
@include pt-button-minimal();
|
|
171
|
+
@include pt-button-outlined();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
a.#{$ns}-button {
|
|
176
|
+
text-align: center;
|
|
177
|
+
text-decoration: none;
|
|
178
|
+
transition: none;
|
|
179
|
+
|
|
180
|
+
&,
|
|
181
|
+
&:hover,
|
|
182
|
+
&:active {
|
|
183
|
+
// override global 'a' styles
|
|
184
|
+
color: $pt-text-color;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&.#{$ns}-disabled {
|
|
188
|
+
color: $button-color-disabled;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.#{$ns}-button-text {
|
|
193
|
+
// default: don't grow to fill but allow shrinking as necessary
|
|
194
|
+
flex: 0 1 auto;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// when alignment is set, grow to fill and inherit `text-align` set on `.#{$ns}-button`
|
|
198
|
+
.#{$ns}-button,
|
|
199
|
+
.#{$ns}-button-group {
|
|
200
|
+
&.#{$ns}-align-left,
|
|
201
|
+
&.#{$ns}-align-right {
|
|
202
|
+
.#{$ns}-button-text {
|
|
203
|
+
flex: 1 1 auto;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|