@aquera/nile-elements 0.0.20 → 0.0.21
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/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +3 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +3 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js +2 -5
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +8 -16
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js +80 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.d.ts +55 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js +129 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/nile-tab-group.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/nile-tab-group.css.js +245 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/nile-tab-group.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/nile-tab-group.d.ts +82 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/nile-tab-group.js +392 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-group/nile-tab-group.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/nile-tab-panel.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/nile-tab-panel.css.js +32 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/nile-tab-panel.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/nile-tab-panel.d.ts +38 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/nile-tab-panel.js +71 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab-panel/nile-tab-panel.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +460 -86
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +2 -5
- package/dist/nile-calendar/nile-calendar.esm.js +8 -16
- package/dist/nile-tab/index.cjs.js +2 -0
- package/dist/nile-tab/index.cjs.js.map +1 -0
- package/dist/nile-tab/index.esm.js +1 -0
- package/dist/nile-tab/nile-tab.cjs.js +2 -0
- package/dist/nile-tab/nile-tab.cjs.js.map +1 -0
- package/dist/nile-tab/nile-tab.css.cjs.js +2 -0
- package/dist/nile-tab/nile-tab.css.cjs.js.map +1 -0
- package/dist/nile-tab/nile-tab.css.esm.js +68 -0
- package/dist/nile-tab/nile-tab.esm.js +21 -0
- package/dist/nile-tab-group/index.cjs.js +2 -0
- package/dist/nile-tab-group/index.cjs.js.map +1 -0
- package/dist/nile-tab-group/index.esm.js +1 -0
- package/dist/nile-tab-group/nile-tab-group.cjs.js +2 -0
- package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -0
- package/dist/nile-tab-group/nile-tab-group.css.cjs.js +2 -0
- package/dist/nile-tab-group/nile-tab-group.css.cjs.js.map +1 -0
- package/dist/nile-tab-group/nile-tab-group.css.esm.js +233 -0
- package/dist/nile-tab-group/nile-tab-group.esm.js +43 -0
- package/dist/nile-tab-panel/index.cjs.js +2 -0
- package/dist/nile-tab-panel/index.cjs.js.map +1 -0
- package/dist/nile-tab-panel/index.esm.js +1 -0
- package/dist/nile-tab-panel/nile-tab-panel.cjs.js +2 -0
- package/dist/nile-tab-panel/nile-tab-panel.cjs.js.map +1 -0
- package/dist/nile-tab-panel/nile-tab-panel.css.cjs.js +2 -0
- package/dist/nile-tab-panel/nile-tab-panel.css.cjs.js.map +1 -0
- package/dist/nile-tab-panel/nile-tab-panel.css.esm.js +20 -0
- package/dist/nile-tab-panel/nile-tab-panel.esm.js +6 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +2 -5
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
- package/dist/src/nile-calendar/nile-calendar.js +8 -16
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-tab/index.d.ts +1 -0
- package/dist/src/nile-tab/index.js +2 -0
- package/dist/src/nile-tab/index.js.map +1 -0
- package/dist/src/nile-tab/nile-tab.css.d.ts +12 -0
- package/dist/src/nile-tab/nile-tab.css.js +80 -0
- package/dist/src/nile-tab/nile-tab.css.js.map +1 -0
- package/dist/src/nile-tab/nile-tab.d.ts +55 -0
- package/dist/src/nile-tab/nile-tab.js +129 -0
- package/dist/src/nile-tab/nile-tab.js.map +1 -0
- package/dist/src/nile-tab-group/index.d.ts +1 -0
- package/dist/src/nile-tab-group/index.js +2 -0
- package/dist/src/nile-tab-group/index.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.css.d.ts +12 -0
- package/dist/src/nile-tab-group/nile-tab-group.css.js +245 -0
- package/dist/src/nile-tab-group/nile-tab-group.css.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.d.ts +82 -0
- package/dist/src/nile-tab-group/nile-tab-group.js +392 -0
- package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -0
- package/dist/src/nile-tab-panel/index.d.ts +1 -0
- package/dist/src/nile-tab-panel/index.js +2 -0
- package/dist/src/nile-tab-panel/index.js.map +1 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.css.d.ts +12 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.css.js +32 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.css.js.map +1 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.d.ts +38 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.js +71 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/nile-calendar/nile-calendar.css.ts +2 -5
- package/src/nile-calendar/nile-calendar.ts +9 -16
- package/src/nile-tab/index.ts +1 -0
- package/src/nile-tab/nile-tab.css.ts +82 -0
- package/src/nile-tab/nile-tab.ts +129 -0
- package/src/nile-tab-group/index.ts +1 -0
- package/src/nile-tab-group/nile-tab-group.css.ts +247 -0
- package/src/nile-tab-group/nile-tab-group.ts +441 -0
- package/src/nile-tab-panel/index.ts +1 -0
- package/src/nile-tab-panel/nile-tab-panel.css.ts +34 -0
- package/src/nile-tab-panel/nile-tab-panel.ts +74 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { css } from 'lit-element';
|
8
|
+
/**
|
9
|
+
* TabGroup CSS
|
10
|
+
*/
|
11
|
+
export const styles = css `
|
12
|
+
[hidden] {
|
13
|
+
display: none !important;
|
14
|
+
}
|
15
|
+
|
16
|
+
:host {
|
17
|
+
--indicator-color: var(--nile-colors-primary-600);
|
18
|
+
--track-color: #e5e9eb;
|
19
|
+
--track-width: 1px;
|
20
|
+
|
21
|
+
display: block;
|
22
|
+
}
|
23
|
+
|
24
|
+
.tab-group {
|
25
|
+
display: flex;
|
26
|
+
border-radius: 0;
|
27
|
+
}
|
28
|
+
|
29
|
+
.tab-group__tabs {
|
30
|
+
display: flex;
|
31
|
+
position: relative;
|
32
|
+
gap: 24px;
|
33
|
+
}
|
34
|
+
|
35
|
+
.tab-group__indicator {
|
36
|
+
position: absolute;
|
37
|
+
transition: 0.3s translate ease, 0.3s width ease;
|
38
|
+
}
|
39
|
+
|
40
|
+
.tab-group--has-scroll-controls .tab-group__nav-container {
|
41
|
+
position: relative;
|
42
|
+
padding: 0 10px;
|
43
|
+
}
|
44
|
+
|
45
|
+
.tab-group__body {
|
46
|
+
display: block;
|
47
|
+
overflow: auto;
|
48
|
+
}
|
49
|
+
|
50
|
+
.tab-group__scroll-button {
|
51
|
+
display: flex;
|
52
|
+
align-items: center;
|
53
|
+
justify-content: center;
|
54
|
+
position: absolute;
|
55
|
+
top: 0;
|
56
|
+
bottom: 0;
|
57
|
+
width: 20px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.tab-group__scroll-button--start {
|
61
|
+
left: 0;
|
62
|
+
}
|
63
|
+
|
64
|
+
.tab-group__scroll-button--end {
|
65
|
+
right: 0;
|
66
|
+
}
|
67
|
+
|
68
|
+
.tab-group--rtl .tab-group__scroll-button--start {
|
69
|
+
left: auto;
|
70
|
+
right: 0;
|
71
|
+
}
|
72
|
+
|
73
|
+
.tab-group--rtl .tab-group__scroll-button--end {
|
74
|
+
left: 0;
|
75
|
+
right: auto;
|
76
|
+
}
|
77
|
+
|
78
|
+
/*
|
79
|
+
* Top
|
80
|
+
*/
|
81
|
+
|
82
|
+
.tab-group--top {
|
83
|
+
flex-direction: column;
|
84
|
+
}
|
85
|
+
|
86
|
+
.tab-group--top .tab-group__nav-container {
|
87
|
+
order: 1;
|
88
|
+
}
|
89
|
+
|
90
|
+
.tab-group--top .tab-group__nav {
|
91
|
+
display: flex;
|
92
|
+
overflow-x: auto;
|
93
|
+
|
94
|
+
/* Hide scrollbar in Firefox */
|
95
|
+
scrollbar-width: none;
|
96
|
+
}
|
97
|
+
|
98
|
+
/* Hide scrollbar in Chrome/Safari */
|
99
|
+
.tab-group--top .tab-group__nav::-webkit-scrollbar {
|
100
|
+
width: 0;
|
101
|
+
height: 0;
|
102
|
+
}
|
103
|
+
|
104
|
+
.tab-group--top .tab-group__tabs {
|
105
|
+
flex: 1 1 auto;
|
106
|
+
position: relative;
|
107
|
+
flex-direction: row;
|
108
|
+
border-bottom: solid var(--track-width) var(--track-color);
|
109
|
+
}
|
110
|
+
|
111
|
+
.tab-group--top .tab-group__indicator {
|
112
|
+
bottom: calc(-1 * var(--track-width));
|
113
|
+
border-bottom: solid 3px var(--indicator-color);
|
114
|
+
}
|
115
|
+
|
116
|
+
.tab-group--top .tab-group__body {
|
117
|
+
order: 2;
|
118
|
+
}
|
119
|
+
|
120
|
+
.tab-group--top ::slotted(nile-tab-panel) {
|
121
|
+
--padding: 10px 0;
|
122
|
+
}
|
123
|
+
|
124
|
+
/*
|
125
|
+
* Bottom
|
126
|
+
*/
|
127
|
+
|
128
|
+
.tab-group--bottom {
|
129
|
+
flex-direction: column;
|
130
|
+
}
|
131
|
+
|
132
|
+
.tab-group--bottom .tab-group__nav-container {
|
133
|
+
order: 2;
|
134
|
+
}
|
135
|
+
|
136
|
+
.tab-group--bottom .tab-group__nav {
|
137
|
+
display: flex;
|
138
|
+
overflow-x: auto;
|
139
|
+
|
140
|
+
/* Hide scrollbar in Firefox */
|
141
|
+
scrollbar-width: none;
|
142
|
+
}
|
143
|
+
|
144
|
+
/* Hide scrollbar in Chrome/Safari */
|
145
|
+
.tab-group--bottom .tab-group__nav::-webkit-scrollbar {
|
146
|
+
width: 0;
|
147
|
+
height: 0;
|
148
|
+
}
|
149
|
+
|
150
|
+
.tab-group--bottom .tab-group__tabs {
|
151
|
+
flex: 1 1 auto;
|
152
|
+
position: relative;
|
153
|
+
flex-direction: row;
|
154
|
+
border-top: solid var(--track-width) var(--track-color);
|
155
|
+
}
|
156
|
+
|
157
|
+
.tab-group--bottom .tab-group__indicator {
|
158
|
+
top: calc(-1 * var(--track-width));
|
159
|
+
border-top: solid var(--track-width) var(--indicator-color);
|
160
|
+
}
|
161
|
+
|
162
|
+
.tab-group--bottom .tab-group__body {
|
163
|
+
order: 1;
|
164
|
+
}
|
165
|
+
|
166
|
+
.tab-group--bottom ::slotted(nile-tab-panel) {
|
167
|
+
--padding: 10px 0;
|
168
|
+
}
|
169
|
+
|
170
|
+
/*
|
171
|
+
* Start
|
172
|
+
*/
|
173
|
+
|
174
|
+
.tab-group--start {
|
175
|
+
flex-direction: row;
|
176
|
+
}
|
177
|
+
|
178
|
+
.tab-group--start .tab-group__nav-container {
|
179
|
+
order: 1;
|
180
|
+
}
|
181
|
+
|
182
|
+
.tab-group--start .tab-group__tabs {
|
183
|
+
flex: 0 0 auto;
|
184
|
+
flex-direction: column;
|
185
|
+
border-inline-end: solid var(--track-width) var(--track-color);
|
186
|
+
}
|
187
|
+
|
188
|
+
.tab-group--start .tab-group__indicator {
|
189
|
+
right: calc(-1 * var(--track-width));
|
190
|
+
border-right: solid var(--track-width) var(--indicator-color);
|
191
|
+
}
|
192
|
+
|
193
|
+
.tab-group--start.tab-group--rtl .tab-group__indicator {
|
194
|
+
right: auto;
|
195
|
+
left: calc(-1 * var(--track-width));
|
196
|
+
}
|
197
|
+
|
198
|
+
.tab-group--start .tab-group__body {
|
199
|
+
flex: 1 1 auto;
|
200
|
+
order: 2;
|
201
|
+
}
|
202
|
+
|
203
|
+
.tab-group--start ::slotted(nile-tab-panel) {
|
204
|
+
--padding: 0 10px;
|
205
|
+
}
|
206
|
+
|
207
|
+
/*
|
208
|
+
* End
|
209
|
+
*/
|
210
|
+
|
211
|
+
.tab-group--end {
|
212
|
+
flex-direction: row;
|
213
|
+
}
|
214
|
+
|
215
|
+
.tab-group--end .tab-group__nav-container {
|
216
|
+
order: 2;
|
217
|
+
}
|
218
|
+
|
219
|
+
.tab-group--end .tab-group__tabs {
|
220
|
+
flex: 0 0 auto;
|
221
|
+
flex-direction: column;
|
222
|
+
border-left: solid var(--track-width) var(--track-color);
|
223
|
+
}
|
224
|
+
|
225
|
+
.tab-group--end .tab-group__indicator {
|
226
|
+
left: calc(-1 * var(--track-width));
|
227
|
+
border-inline-start: solid var(--track-width) var(--indicator-color);
|
228
|
+
}
|
229
|
+
|
230
|
+
.tab-group--end.tab-group--rtl .tab-group__indicator {
|
231
|
+
right: calc(-1 * var(--track-width));
|
232
|
+
left: auto;
|
233
|
+
}
|
234
|
+
|
235
|
+
.tab-group--end .tab-group__body {
|
236
|
+
flex: 1 1 auto;
|
237
|
+
order: 1;
|
238
|
+
}
|
239
|
+
|
240
|
+
.tab-group--end ::slotted(nile-tab-panel) {
|
241
|
+
--padding: 0 10px;
|
242
|
+
}
|
243
|
+
`;
|
244
|
+
export default [styles];
|
245
|
+
//# sourceMappingURL=nile-tab-group.css.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-tab-group.css.js","sourceRoot":"","sources":["../../../src/nile-tab-group/nile-tab-group.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwOxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * TabGroup CSS\n */\nexport const styles = css`\n [hidden] {\n display: none !important;\n }\n\n :host {\n --indicator-color: var(--nile-colors-primary-600);\n --track-color: #e5e9eb;\n --track-width: 1px;\n\n display: block;\n }\n\n .tab-group {\n display: flex;\n border-radius: 0;\n }\n\n .tab-group__tabs {\n display: flex;\n position: relative;\n gap: 24px;\n }\n\n .tab-group__indicator {\n position: absolute;\n transition: 0.3s translate ease, 0.3s width ease;\n }\n\n .tab-group--has-scroll-controls .tab-group__nav-container {\n position: relative;\n padding: 0 10px;\n }\n\n .tab-group__body {\n display: block;\n overflow: auto;\n }\n\n .tab-group__scroll-button {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 20px;\n }\n\n .tab-group__scroll-button--start {\n left: 0;\n }\n\n .tab-group__scroll-button--end {\n right: 0;\n }\n\n .tab-group--rtl .tab-group__scroll-button--start {\n left: auto;\n right: 0;\n }\n\n .tab-group--rtl .tab-group__scroll-button--end {\n left: 0;\n right: auto;\n }\n\n /*\n * Top\n */\n\n .tab-group--top {\n flex-direction: column;\n }\n\n .tab-group--top .tab-group__nav-container {\n order: 1;\n }\n\n .tab-group--top .tab-group__nav {\n display: flex;\n overflow-x: auto;\n\n /* Hide scrollbar in Firefox */\n scrollbar-width: none;\n }\n\n /* Hide scrollbar in Chrome/Safari */\n .tab-group--top .tab-group__nav::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n\n .tab-group--top .tab-group__tabs {\n flex: 1 1 auto;\n position: relative;\n flex-direction: row;\n border-bottom: solid var(--track-width) var(--track-color);\n }\n\n .tab-group--top .tab-group__indicator {\n bottom: calc(-1 * var(--track-width));\n border-bottom: solid 3px var(--indicator-color);\n }\n\n .tab-group--top .tab-group__body {\n order: 2;\n }\n\n .tab-group--top ::slotted(nile-tab-panel) {\n --padding: 10px 0;\n }\n\n /*\n * Bottom\n */\n\n .tab-group--bottom {\n flex-direction: column;\n }\n\n .tab-group--bottom .tab-group__nav-container {\n order: 2;\n }\n\n .tab-group--bottom .tab-group__nav {\n display: flex;\n overflow-x: auto;\n\n /* Hide scrollbar in Firefox */\n scrollbar-width: none;\n }\n\n /* Hide scrollbar in Chrome/Safari */\n .tab-group--bottom .tab-group__nav::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n\n .tab-group--bottom .tab-group__tabs {\n flex: 1 1 auto;\n position: relative;\n flex-direction: row;\n border-top: solid var(--track-width) var(--track-color);\n }\n\n .tab-group--bottom .tab-group__indicator {\n top: calc(-1 * var(--track-width));\n border-top: solid var(--track-width) var(--indicator-color);\n }\n\n .tab-group--bottom .tab-group__body {\n order: 1;\n }\n\n .tab-group--bottom ::slotted(nile-tab-panel) {\n --padding: 10px 0;\n }\n\n /*\n * Start\n */\n\n .tab-group--start {\n flex-direction: row;\n }\n\n .tab-group--start .tab-group__nav-container {\n order: 1;\n }\n\n .tab-group--start .tab-group__tabs {\n flex: 0 0 auto;\n flex-direction: column;\n border-inline-end: solid var(--track-width) var(--track-color);\n }\n\n .tab-group--start .tab-group__indicator {\n right: calc(-1 * var(--track-width));\n border-right: solid var(--track-width) var(--indicator-color);\n }\n\n .tab-group--start.tab-group--rtl .tab-group__indicator {\n right: auto;\n left: calc(-1 * var(--track-width));\n }\n\n .tab-group--start .tab-group__body {\n flex: 1 1 auto;\n order: 2;\n }\n\n .tab-group--start ::slotted(nile-tab-panel) {\n --padding: 0 10px;\n }\n\n /*\n * End\n */\n\n .tab-group--end {\n flex-direction: row;\n }\n\n .tab-group--end .tab-group__nav-container {\n order: 2;\n }\n\n .tab-group--end .tab-group__tabs {\n flex: 0 0 auto;\n flex-direction: column;\n border-left: solid var(--track-width) var(--track-color);\n }\n\n .tab-group--end .tab-group__indicator {\n left: calc(-1 * var(--track-width));\n border-inline-start: solid var(--track-width) var(--indicator-color);\n }\n\n .tab-group--end.tab-group--rtl .tab-group__indicator {\n right: calc(-1 * var(--track-width));\n left: auto;\n }\n\n .tab-group--end .tab-group__body {\n flex: 1 1 auto;\n order: 1;\n }\n\n .tab-group--end ::slotted(nile-tab-panel) {\n --padding: 0 10px;\n }\n`;\n\nexport default [styles];\n"]}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { TemplateResult } from 'lit-element';
|
8
|
+
import '../nile-icon-button/nile-icon-button';
|
9
|
+
import NileElement from '../internal/nile-element';
|
10
|
+
import type { CSSResultGroup } from 'lit';
|
11
|
+
/**
|
12
|
+
* Nile icon component.
|
13
|
+
*
|
14
|
+
* @tag nile-tab-group
|
15
|
+
*
|
16
|
+
* @slot - Used for grouping tab panels in the tab group. Must be `<nile-tab-panel>` elements.
|
17
|
+
* @slot nav - Used for grouping tabs in the tab group. Must be `<nile-tab>` elements.
|
18
|
+
*
|
19
|
+
* @event {{ name: String }} nile-tab-show - Emitted when a tab is shown.
|
20
|
+
* @event {{ name: String }} nile-tab-hide - Emitted when a tab is hidden.
|
21
|
+
*
|
22
|
+
* @csspart base - The component's base wrapper.
|
23
|
+
* @csspart nav - The tab group's navigation container where tabs are slotted in.
|
24
|
+
* @csspart tabs - The container that wraps the tabs.
|
25
|
+
* @csspart active-tab-indicator - The line that highlights the currently selected tab.
|
26
|
+
* @csspart body - The tab group's body where tab panels are slotted in.
|
27
|
+
* @csspart scroll-button - The previous/next scroll buttons that show when tabs are scrollable, an `<nile-icon-button>`.
|
28
|
+
* @csspart scroll-button--start - The starting scroll button.
|
29
|
+
* @csspart scroll-button--end - The ending scroll button.
|
30
|
+
* @csspart scroll-button__base - The scroll button's exported `base` part.
|
31
|
+
*
|
32
|
+
* @cssproperty --indicator-color - The color of the active tab indicator.
|
33
|
+
* @cssproperty --track-color - The color of the indicator's track (the line that separates tabs from panels).
|
34
|
+
* @cssproperty --track-width - The width of the indicator's track (the line that separates tabs from panels).
|
35
|
+
*
|
36
|
+
*/
|
37
|
+
export declare class NileTabGroup extends NileElement {
|
38
|
+
static styles: CSSResultGroup;
|
39
|
+
private activeTab?;
|
40
|
+
private mutationObserver;
|
41
|
+
private resizeObserver;
|
42
|
+
private tabs;
|
43
|
+
private panels;
|
44
|
+
tabGroup: HTMLElement;
|
45
|
+
body: HTMLSlotElement;
|
46
|
+
nav: HTMLElement;
|
47
|
+
indicator: HTMLElement;
|
48
|
+
private hasScrollControls;
|
49
|
+
/** The placement of the tabs. */
|
50
|
+
placement: 'top' | 'bottom' | 'start' | 'end';
|
51
|
+
/**
|
52
|
+
* When set to auto, navigating tabs with the arrow keys will instantly show the corresponding tab panel. When set to
|
53
|
+
* manual, the tab will receive focus but will not show until the user presses spacebar or enter.
|
54
|
+
*/
|
55
|
+
activation: 'auto' | 'manual';
|
56
|
+
/** Disables the scroll arrows that appear when tabs overflow. */
|
57
|
+
noScrollControls: boolean;
|
58
|
+
connectedCallback(): void;
|
59
|
+
disconnectedCallback(): void;
|
60
|
+
private getAllTabs;
|
61
|
+
private getAllPanels;
|
62
|
+
private getActiveTab;
|
63
|
+
private handleClick;
|
64
|
+
private handleKeyDown;
|
65
|
+
private handleScrollToStart;
|
66
|
+
private handleScrollToEnd;
|
67
|
+
private setActiveTab;
|
68
|
+
private setAriaLabels;
|
69
|
+
private repositionIndicator;
|
70
|
+
private syncTabsAndPanels;
|
71
|
+
updateScrollControls(): void;
|
72
|
+
syncIndicator(): void;
|
73
|
+
/** Shows the specified tab panel. */
|
74
|
+
show(panel: string): void;
|
75
|
+
render(): TemplateResult<1>;
|
76
|
+
}
|
77
|
+
export default NileTabGroup;
|
78
|
+
declare global {
|
79
|
+
interface HTMLElementTagNameMap {
|
80
|
+
'nile-tab-group': NileTabGroup;
|
81
|
+
}
|
82
|
+
}
|