@broxus/react-uikit 0.5.0 → 0.5.2

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.
@@ -22,6 +22,7 @@ export * from './components/Tile';
22
22
  export * from './components/Card';
23
23
  export * from './components/Nav';
24
24
  export * from './components/Navbar';
25
+ export * from './components/Subnav';
25
26
  export * from './components/Breadcrumb';
26
27
  export * from './components/Tabs';
27
28
  export * from './components/Dotnav';
package/dist/cjs/index.js CHANGED
@@ -38,6 +38,7 @@ __exportStar(require("./components/Tile"), exports);
38
38
  __exportStar(require("./components/Card"), exports);
39
39
  __exportStar(require("./components/Nav"), exports);
40
40
  __exportStar(require("./components/Navbar"), exports);
41
+ __exportStar(require("./components/Subnav"), exports);
41
42
  __exportStar(require("./components/Breadcrumb"), exports);
42
43
  __exportStar(require("./components/Tabs"), exports);
43
44
  __exportStar(require("./components/Dotnav"), exports);
@@ -43,7 +43,7 @@
43
43
  // Navs
44
44
  @import 'nav.scss';
45
45
  @import 'navbar.scss'; // After: Card, Grid, Nav, Icon, Search
46
- // @import 'subnav.scss';
46
+ @import 'subnav.scss';
47
47
  @import 'breadcrumb.scss';
48
48
 
49
49
  // @import 'pagination.scss';
@@ -59,7 +59,7 @@
59
59
  // Navs
60
60
  @import 'nav.scss';
61
61
  @import 'navbar.scss'; // After: Card, Grid, Nav, Icon, Search
62
- // @import 'subnav.scss';
62
+ @import 'subnav.scss';
63
63
  @import 'breadcrumb.scss';
64
64
 
65
65
  // @import 'pagination.scss';
@@ -2073,6 +2073,60 @@
2073
2073
 
2074
2074
  @mixin hook-switcher-misc() {}
2075
2075
 
2076
+ @mixin hook-tab() {}
2077
+ @mixin hook-tab-item() {}
2078
+ @mixin hook-tab-item-hover() {}
2079
+ @mixin hook-tab-item-active() {}
2080
+ @mixin hook-tab-item-disabled() {}
2081
+ @mixin hook-tab-bottom() {}
2082
+ @mixin hook-tab-bottom-item() {}
2083
+ @mixin hook-tab-left() {}
2084
+ @mixin hook-tab-left-item() {}
2085
+ @mixin hook-tab-right() {}
2086
+ @mixin hook-tab-right-item() {}
2087
+ @mixin hook-tab-misc() {}
2088
+ @mixin hook-inverse-tab() {}
2089
+ @mixin hook-inverse-tab-item() {}
2090
+ @mixin hook-inverse-tab-item-hover() {}
2091
+ @mixin hook-inverse-tab-item-active() {}
2092
+ @mixin hook-inverse-tab-item-disabled() {}
2093
+ @mixin hook-inverse-component-tab() {
2094
+ .uk-tab {
2095
+ @if mixin-exists(hook-inverse-tab) {
2096
+ @include hook-inverse-tab;
2097
+ }
2098
+ }
2099
+
2100
+ .uk-tab > * > a {
2101
+ color: var(--inverse-tab-item-color);
2102
+ @if mixin-exists(hook-inverse-tab-item) {
2103
+ @include hook-inverse-tab-item;
2104
+ }
2105
+ }
2106
+
2107
+ .uk-tab > * > a:hover {
2108
+ color: var(--inverse-tab-item-hover-color);
2109
+ @if mixin-exists(hook-inverse-tab-item-hover) {
2110
+ @include hook-inverse-tab-item-hover;
2111
+ }
2112
+ }
2113
+
2114
+ .uk-tab > .uk-active > a {
2115
+ color: var(--inverse-tab-item-active-color);
2116
+ @if mixin-exists(hook-inverse-tab-item-active) {
2117
+ @include hook-inverse-tab-item-active;
2118
+ }
2119
+ }
2120
+
2121
+ .uk-tab > .uk-disabled > a {
2122
+ color: var(--inverse-tab-item-disabled-color);
2123
+ @if mixin-exists(hook-inverse-tab-item-disabled) {
2124
+ @include hook-inverse-tab-item-disabled;
2125
+ }
2126
+ }
2127
+
2128
+ }
2129
+
2076
2130
  @mixin hook-tabs() {}
2077
2131
  @mixin hook-tabs-tab() {}
2078
2132
  @mixin hook-tabs-tab-hover() {}
@@ -2353,6 +2407,7 @@
2353
2407
  @include hook-inverse-component-breadcrumb;
2354
2408
 
2355
2409
  @include hook-inverse-component-pagination;
2410
+ @include hook-inverse-component-tab;
2356
2411
  @include hook-inverse-component-tabs;
2357
2412
  @include hook-inverse-component-table;
2358
2413
 
@@ -1,258 +1 @@
1
- // Name: Subnav
2
- // Description: Component to create a sub navigation
3
- //
4
- // Component: `uk-subnav`
5
- //
6
- // Modifiers: `uk-subnav-divider`
7
- // `uk-subnav-pill`
8
- //
9
- // States: `uk-active`
10
- // `uk-first-column`
11
- //
12
- // ========================================================================
13
-
14
-
15
- // Variables
16
- // ========================================================================
17
-
18
- @import 'variables.scss';
19
-
20
-
21
- /* ========================================================================
22
- Component: Subnav
23
- ========================================================================== */
24
-
25
- /*
26
- * 1. Allow items to wrap into the next line
27
- * 2. Center items vertically if they have a different height
28
- * 3. Gutter
29
- * 4. Reset list
30
- */
31
-
32
- .uk-subnav {
33
- /* 2 */
34
- align-items: center;
35
- display: flex;
36
-
37
- /* 1 */
38
- flex-wrap: wrap;
39
- list-style: none;
40
-
41
- /* 3 */
42
- margin-left: calc(var(--subnav-margin-horizontal) * -1);
43
-
44
- /* 4 */
45
- padding: 0;
46
- @if mixin-exists(hook-subnav) {
47
- @include hook-subnav;
48
- }
49
- }
50
-
51
- /*
52
- * 1. Space is allocated solely based on content dimensions: 0 0 auto
53
- * 2. Gutter
54
- * 3. Create position context for dropdowns
55
- */
56
-
57
- .uk-subnav > * {
58
- /* 1 */
59
- flex: none;
60
-
61
- /* 2 */
62
- padding-left: var(--subnav-margin-horizontal);
63
-
64
- /* 3 */
65
- position: relative;
66
- }
67
-
68
-
69
- /* Items
70
- ========================================================================== */
71
-
72
- /*
73
- * Items must target `a` elements to exclude other elements (e.g. dropdowns)
74
- * Using `:first-child` instead of `a` to support `span` elements for text
75
- * 1. Center content vertically, e.g. an icon
76
- * 2. Imitate white space gap when using flexbox
77
- * 3. Style
78
- */
79
-
80
- .uk-subnav > * > :first-child {
81
- align-items: center;
82
-
83
- /* 3 */
84
- color: var(--subnav-item-color);
85
-
86
- /* 2 */
87
- column-gap: 0.25em;
88
-
89
- /* 1 */
90
- display: flex;
91
- @if mixin-exists(hook-subnav-item) {
92
- @include hook-subnav-item;
93
- }
94
- }
95
-
96
- /* Hover + Focus */
97
- .uk-subnav > * > a:hover,
98
- .uk-subnav > * > a:focus {
99
- color: var(--subnav-item-hover-color);
100
- outline: none;
101
- text-decoration: var(--subnav-item-hover-text-decoration);
102
- @if mixin-exists(hook-subnav-item-hover) {
103
- @include hook-subnav-item-hover;
104
- }
105
- }
106
-
107
- /* Active */
108
- .uk-subnav > .uk-active > a {
109
- color: var(--subnav-item-active-color);
110
- @if mixin-exists(hook-subnav-item-active) {
111
- @include hook-subnav-item-active;
112
- }
113
- }
114
-
115
-
116
- /* Divider modifier
117
- ========================================================================== */
118
-
119
- /*
120
- * Set gutter
121
- */
122
-
123
- .uk-subnav-divider {
124
- margin-left: calc((var(--subnav-divider-margin-horizontal) * 2 + var(--subnav-divider-border-width)) * -1);
125
- }
126
-
127
- /*
128
- * Align items and divider vertically
129
- */
130
-
131
- .uk-subnav-divider > * {
132
- align-items: center;
133
- display: flex;
134
- }
135
-
136
- /*
137
- * Divider
138
- * 1. `nth-child` makes it also work without JS if it's only one row
139
- */
140
-
141
- .uk-subnav-divider > ::before {
142
- border-left: var(--subnav-divider-border-width) solid transparent;
143
- content: '';
144
- height: var(--subnav-divider-border-height);
145
- margin-left: calc(var(--subnav-divider-margin-horizontal) - var(subnav-margin-horizontal));
146
- margin-right: var(--subnav-divider-margin-horizontal);
147
- }
148
-
149
- /* 1 */
150
- .uk-subnav-divider > :nth-child(n+2):not(.uk-first-column)::before {
151
- border-left-color: var(--subnav-divider-border);
152
- @if mixin-exists(hook-subnav-divider) {
153
- @include hook-subnav-divider;
154
- }
155
- }
156
-
157
-
158
- /* Pill modifier
159
- ========================================================================== */
160
-
161
- .uk-subnav-pill > * > :first-child {
162
- background: var(--subnav-pill-item-background);
163
- color: var(--subnav-pill-item-color);
164
- padding: var(--subnav-pill-item-padding-vertical) var(--subnav-pill-item-padding-horizontal);
165
- @if mixin-exists(hook-subnav-pill-item) {
166
- @include hook-subnav-pill-item;
167
- }
168
- }
169
-
170
- /* Hover + Focus */
171
- .uk-subnav-pill > * > a:hover,
172
- .uk-subnav-pill > * > a:focus {
173
- background-color: var(--subnav-pill-item-hover-background);
174
- color: var(--subnav-pill-item-hover-color);
175
- @if mixin-exists(hook-subnav-pill-item-hover) {
176
- @include hook-subnav-pill-item-hover;
177
- }
178
- }
179
-
180
- /* OnClick */
181
- .uk-subnav-pill > * > a:active {
182
- background-color: var(--subnav-pill-item-onclick-background);
183
- color: var(--subnav-pill-item-onclick-color);
184
- @if mixin-exists(hook-subnav-pill-item-onclick) {
185
- @include hook-subnav-pill-item-onclick;
186
- }
187
- }
188
-
189
- /* Active */
190
- .uk-subnav-pill > .uk-active > a {
191
- background-color: var(--subnav-pill-item-active-background);
192
- color: var(--subnav-pill-item-active-color);
193
- @if mixin-exists(hook-subnav-pill-item-active) {
194
- @include hook-subnav-pill-item-active;
195
- }
196
- }
197
-
198
-
199
- /* Disabled
200
- * The same for all style modifiers
201
- ========================================================================== */
202
-
203
- .uk-subnav > .uk-disabled > a {
204
- color: var(--subnav-item-disabled-color);
205
- @if mixin-exists(hook-subnav-item-disabled) {
206
- @include hook-subnav-item-disabled;
207
- }
208
- }
209
-
210
-
211
- // Hooks
212
- // ========================================================================
213
-
214
- @if mixin-exists(hook-subnav-misc) {
215
- @include hook-subnav-misc;
216
- }
217
-
218
-
219
- // Vars
220
- // ========================================================================
221
-
222
- :root {
223
- --subnav-margin-horizontal: #{$subnav-margin-horizontal};
224
- --subnav-item-color: var(--global-muted-color);
225
- --subnav-item-hover-color: var(--global-color);
226
- --subnav-item-hover-text-decoration: #{$subnav-item-hover-text-decoration};
227
- --subnav-item-active-color: var(--global-emphasis-color);
228
- --subnav-divider-margin-horizontal: #{$subnav-margin-horizontal};
229
- --subnav-divider-border-height: #{$subnav-divider-border-height};
230
- --subnav-divider-border-width: var(--global-border-width);
231
- --subnav-divider-border: var(--global-border);
232
- --subnav-pill-item-padding-vertical: #{$subnav-pill-item-padding-vertical};
233
- --subnav-pill-item-padding-horizontal: #{$subnav-pill-item-padding-horizontal};
234
- --subnav-pill-item-background: #{$subnav-pill-item-background};
235
- --subnav-pill-item-color: #{$subnav-item-color};
236
- --subnav-pill-item-hover-background: var(--global-muted-background);
237
- --subnav-pill-item-hover-color: var(--global-color);
238
- --subnav-pill-item-onclick-background: #{$subnav-pill-item-hover-background};
239
- --subnav-pill-item-onclick-color: #{$subnav-pill-item-hover-color};
240
- --subnav-pill-item-active-background: var(--global-primary-background);
241
- --subnav-pill-item-active-color: var(--global-inverse-color);
242
- --subnav-item-disabled-color: var(--global-muted-color);
243
-
244
- // Inverse
245
- --inverse-subnav-item-color: var(--inverse-global-muted-color);
246
- --inverse-subnav-item-hover-color: var(--inverse-global-color);
247
- --inverse-subnav-item-active-color: var(--inverse-global-emphasis-color);
248
- --inverse-subnav-divider-border: var(--inverse-global-border);
249
- --inverse-subnav-pill-item-background: #{$inverse-subnav-pill-item-background};
250
- --inverse-subnav-pill-item-color: var(--inverse-global-muted-color);
251
- --inverse-subnav-pill-item-hover-background: var(--inverse-global-muted-background);
252
- --inverse-subnav-pill-item-hover-color: var(--inverse-global-color);
253
- --inverse-subnav-pill-item-onclick-background: #{$inverse-subnav-pill-item-hover-background};
254
- --inverse-subnav-pill-item-onclick-color: #{$inverse-subnav-pill-item-hover-color};
255
- --inverse-subnav-pill-item-active-background: var(--inverse-global-primary-background);
256
- --inverse-subnav-pill-item-active-color: var(--inverse-global-inverse-color);
257
- --inverse-subnav-item-disabled-color: var(--inverse-global-muted-color);
258
- }
1
+ @import '../components/Subnav/index.scss';
@@ -1586,7 +1586,7 @@ $inverse-subnav-pill-item-active-color: $inverse-global-
1586
1586
  $inverse-subnav-item-disabled-color: $inverse-global-muted-color !default;
1587
1587
 
1588
1588
 
1589
- // Tab
1589
+ // Switch
1590
1590
  // ========================================================================
1591
1591
 
1592
1592
  $switch-background: darken($global-muted-background, 20%) !default;
@@ -1605,6 +1605,25 @@ $switch-handle-offset: 2px !default;
1605
1605
  // Tab
1606
1606
  // ========================================================================
1607
1607
 
1608
+ $tab-margin-horizontal: 20px !default;
1609
+ $tab-item-padding-horizontal: 10px !default;
1610
+ $tab-item-padding-vertical: 5px !default;
1611
+ $tab-item-color: $global-muted-color !default;
1612
+ $tab-item-hover-color: $global-color !default;
1613
+ $tab-item-hover-text-decoration: none !default;
1614
+ $tab-item-active-color: $global-primary-background !default;
1615
+ $tab-item-disabled-color: $global-muted-color !default;
1616
+
1617
+ // Inverse
1618
+ $inverse-tab-item-color: $inverse-global-muted-color !default;
1619
+ $inverse-tab-item-hover-color: $inverse-global-color !default;
1620
+ $inverse-tab-item-active-color: $inverse-global-emphasis-color !default;
1621
+ $inverse-tab-item-disabled-color: $inverse-global-muted-color !default;
1622
+
1623
+
1624
+ // Tabs
1625
+ // ========================================================================
1626
+
1608
1627
  $tabs-margin-horizontal: 20px !default;
1609
1628
  $tabs-margin-vertical: 10px !default;
1610
1629
  $tabs-tab-padding-horizontal: 15px !default;