@broxus/react-uikit 0.5.1 → 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.
@@ -0,0 +1,216 @@
1
+ // Name: Tab
2
+ // Description: Component to create a tabbed navigation
3
+ //
4
+ // Component: `uk-tab`
5
+ //
6
+ // Modifiers: `uk-tab-bottom`
7
+ // `uk-tab-left`
8
+ // `uk-tab-right`
9
+ //
10
+ // States: `uk-active`
11
+ // `uk-disabled`
12
+ //
13
+ // ========================================================================
14
+
15
+
16
+ // Variables
17
+ // ========================================================================
18
+
19
+ @import '../../styles/variables.scss';
20
+
21
+
22
+ /* ========================================================================
23
+ Component: Tab
24
+ ========================================================================== */
25
+
26
+ /*
27
+ * 1. Allow items to wrap into the next line
28
+ * 2. Gutter
29
+ * 3. Reset list
30
+ */
31
+
32
+ .uk-tab {
33
+ display: flex;
34
+
35
+ /* 1 */
36
+ flex-wrap: wrap;
37
+ list-style: none;
38
+
39
+ /* 2 */
40
+ margin-left: calc(var(--tab-margin-horizontal) * -1);
41
+
42
+ /* 3 */
43
+ padding: 0;
44
+ @if mixin-exists(hook-tab) {
45
+ @include hook-tab;
46
+ }
47
+ }
48
+
49
+ /*
50
+ * 1. Space is allocated solely based on content dimensions: 0 0 auto
51
+ * 2. Gutter
52
+ * 3. Create position context for dropdowns
53
+ */
54
+
55
+ .uk-tab > * {
56
+ /* 1 */
57
+ flex: none;
58
+
59
+ /* 2 */
60
+ padding-left: var(--tab-margin-horizontal);
61
+
62
+ /* 3 */
63
+ position: relative;
64
+ }
65
+
66
+
67
+ /* Items
68
+ ========================================================================== */
69
+
70
+ /*
71
+ * Items must target `a` elements to exclude other elements (e.g. dropdowns)
72
+ * 1. Center content vertically, e.g. an icon
73
+ * 2. Imitate white space gap when using flexbox
74
+ * 3. Center content if a width is set
75
+ * 4. Style
76
+ */
77
+
78
+ .uk-tab > * > a {
79
+ /* 1 */
80
+ align-items: center;
81
+
82
+ /* 4 */
83
+ color: var(--tab-item-color);
84
+
85
+ /* 2 */
86
+ column-gap: 0.25em;
87
+
88
+ /* 4 */
89
+ display: flex;
90
+
91
+ /* 3 */
92
+ justify-content: center;
93
+
94
+ /* 4 */
95
+ padding: var(--tab-item-padding-vertical) var(--tab-item-padding-horizontal);
96
+ @if mixin-exists(hook-tab-item) {
97
+ @include hook-tab-item;
98
+ }
99
+ }
100
+
101
+ /* Hover */
102
+ .uk-tab > * > a:hover {
103
+ color: var(--tab-item-hover-color);
104
+ text-decoration: var(--tab-item-hover-text-decoration);
105
+ @if mixin-exists(hook-tab-item-hover) {
106
+ @include hook-tab-item-hover;
107
+ }
108
+ }
109
+
110
+ /* Active */
111
+ .uk-tab > .uk-active > a {
112
+ color: var(--tab-item-active-color);
113
+ @if mixin-exists(hook-tab-item-active) {
114
+ @include hook-tab-item-active;
115
+ }
116
+ }
117
+
118
+ /* Disabled */
119
+ .uk-tab > .uk-disabled > a {
120
+ color: var(--tab-item-disabled-color);
121
+ @if mixin-exists(hook-tab-item-disabled) {
122
+ @include hook-tab-item-disabled;
123
+ }
124
+ }
125
+
126
+
127
+ /* Position modifier
128
+ ========================================================================== */
129
+
130
+ /*
131
+ * Bottom
132
+ */
133
+
134
+ .uk-tab-bottom {
135
+ @if mixin-exists(hook-tab-bottom) {
136
+ @include hook-tab-bottom;
137
+ }
138
+ }
139
+
140
+ .uk-tab-bottom > * > a {
141
+ @if mixin-exists(hook-tab-bottom-item) {
142
+ @include hook-tab-bottom-item;
143
+ }
144
+ }
145
+
146
+ /*
147
+ * Left + Right
148
+ * 1. Reset Gutter
149
+ */
150
+
151
+ .uk-tab-left,
152
+ .uk-tab-right {
153
+ flex-direction: column;
154
+
155
+ /* 1 */
156
+ margin-left: 0;
157
+ }
158
+
159
+ /* 1 */
160
+ .uk-tab-left > *,
161
+ .uk-tab-right > * { padding-left: 0; }
162
+
163
+ .uk-tab-left {
164
+ @if mixin-exists(hook-tab-left) {
165
+ @include hook-tab-left;
166
+ }
167
+ }
168
+
169
+ .uk-tab-right {
170
+ @if mixin-exists(hook-tab-right) {
171
+ @include hook-tab-right;
172
+ }
173
+ }
174
+
175
+ .uk-tab-left > * > a {
176
+ justify-content: left;
177
+ @if mixin-exists(hook-tab-left-item) {
178
+ @include hook-tab-left-item;
179
+ }
180
+ }
181
+
182
+ .uk-tab-right > * > a {
183
+ justify-content: left;
184
+ @if mixin-exists(hook-tab-right-item) {
185
+ @include hook-tab-right-item;
186
+ }
187
+ }
188
+
189
+
190
+ // Hooks
191
+ // ========================================================================
192
+
193
+ @if mixin-exists(hook-tab-misc) {
194
+ @include hook-tab-misc;
195
+ }
196
+
197
+
198
+ // Vars
199
+ // ========================================================================
200
+
201
+ :root {
202
+ --tab-margin-horizontal: #{$tab-margin-horizontal};
203
+ --tab-item-padding-horizontal: #{$tab-item-padding-horizontal};
204
+ --tab-item-padding-vertical: #{$tab-item-padding-vertical};
205
+ --tab-item-color: var(--global-muted-color);
206
+ --tab-item-hover-color: var(--global-color);
207
+ --tab-item-hover-text-decoration: #{$tab-item-hover-text-decoration};
208
+ --tab-item-active-color: var(--global-primary-background);
209
+ --tab-item-disabled-color: var(--global-muted-color);
210
+
211
+ // Inverse
212
+ --inverse-tab-item-color: var(--inverse-global-muted-color);
213
+ --inverse-tab-item-hover-color: var(--inverse-global-color);
214
+ --inverse-tab-item-active-color: var(--inverse-global-emphasis-color);
215
+ --inverse-tab-item-disabled-color: var(--inverse-global-muted-color);
216
+ }
@@ -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
 
@@ -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;