@fluid-topics/ft-tabs 0.3.12 → 0.3.13

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,2 @@
1
+ export declare const FtTabCssVariables: {};
2
+ //# sourceMappingURL=ft-tab.css.d.ts.map
@@ -0,0 +1,2 @@
1
+ export const FtTabCssVariables = {};
2
+ //# sourceMappingURL=ft-tab.css.js.map
package/build/ft-tab.d.ts CHANGED
@@ -1,12 +1,7 @@
1
1
  import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
2
2
  import { PropertyValues } from "lit";
3
- import { FtIconVariants } from "@fluid-topics/ft-icon";
4
- export interface FtTabProperties {
5
- label?: string;
6
- icon?: string;
7
- disabled?: boolean;
8
- iconVariant?: FtIconVariants;
9
- }
3
+ import { FtTabProperties } from "./ft-tab.properties";
4
+ import { FtIconVariants } from "@fluid-topics/ft-icon/build/ft-icon.properties";
10
5
  export declare class FtTab extends FtLitElement implements FtTabProperties {
11
6
  static elementDefinitions: ElementDefinitionsMap;
12
7
  label: string;
package/build/ft-tab.js CHANGED
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { FtLitElement } from "@fluid-topics/ft-wc-utils";
8
8
  import { html, unsafeCSS } from "lit";
9
9
  import { property } from "lit/decorators.js";
10
- import { FtIconVariants } from "@fluid-topics/ft-icon";
10
+ import { FtIconVariants } from "@fluid-topics/ft-icon/build/ft-icon.properties";
11
11
  export class FtTab extends FtLitElement {
12
12
  constructor() {
13
13
  super(...arguments);
@@ -0,0 +1,8 @@
1
+ import { FtIconVariants } from "@fluid-topics/ft-icon/build/ft-icon.properties";
2
+ export interface FtTabProperties {
3
+ label?: string;
4
+ icon?: string;
5
+ disabled?: boolean;
6
+ iconVariant?: FtIconVariants;
7
+ }
8
+ //# sourceMappingURL=ft-tab.properties.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ft-tab.properties.js.map
@@ -0,0 +1,8 @@
1
+ export declare const FtTabsCssVariables: {
2
+ colorSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
3
+ colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
4
+ colorOnSurfaceMedium: import("@fluid-topics/ft-wc-utils").FtCssVariable;
5
+ colorOnSurfaceDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
6
+ };
7
+ export declare const styles: import("lit").CSSResult;
8
+ //# sourceMappingURL=ft-tabs.css.d.ts.map
@@ -0,0 +1,99 @@
1
+ import { css } from "lit";
2
+ import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
3
+ export const FtTabsCssVariables = {
4
+ colorSurface: FtCssVariableFactory.external(designSystemVariables.colorSurface, "Design system"),
5
+ colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
6
+ colorOnSurfaceMedium: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
7
+ colorOnSurfaceDisabled: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
8
+ };
9
+ // language=CSS
10
+ export const styles = css `
11
+ .ft-tabs {
12
+ display: flex;
13
+ flex-direction: column;
14
+ background-color: ${FtTabsCssVariables.colorSurface};
15
+ height: 100%;
16
+ }
17
+
18
+ .ft-tabs--reverse {
19
+ flex-direction: column-reverse;
20
+ }
21
+
22
+ [role="tablist"] {
23
+ flex-shrink: 0;
24
+ flex-grow: 0;
25
+ display: flex;
26
+ position: relative;
27
+ flex-wrap: wrap;
28
+ }
29
+
30
+ .ft-tabs--align-right {
31
+ justify-content: flex-end;
32
+ }
33
+
34
+ .ft-tabs--align-justify {
35
+ justify-content: space-evenly;
36
+ }
37
+
38
+ [role='tab'] {
39
+ position: relative;
40
+ display: flex;
41
+ overflow: hidden;
42
+ flex-direction: column;
43
+ align-items: center;
44
+ justify-content: center;
45
+ padding: 8px 16px;
46
+ background: none;
47
+ box-shadow: 0px 0px 0px transparent;
48
+ border: 0px solid transparent;
49
+ text-shadow: 0px 0px 0px transparent;
50
+ cursor: pointer;
51
+ outline: none;
52
+ font-size: 16px;
53
+ line-height: 1;
54
+ color: ${FtTabsCssVariables.colorOnSurfaceMedium};
55
+ }
56
+
57
+ [role='tab'][aria-selected='true'] {
58
+ color: ${FtTabsCssVariables.colorPrimary};
59
+ }
60
+
61
+ [role='tab'][disabled] {
62
+ color: ${FtTabsCssVariables.colorOnSurfaceDisabled};
63
+ }
64
+
65
+ .ft-tabs--align-justify [role='tab'] {
66
+ flex-grow: 1;
67
+ }
68
+
69
+ [role='tab'] .ft-tabs--tab-label {
70
+ width: 100%;
71
+ white-space: nowrap;
72
+ overflow: hidden;
73
+ text-overflow: ellipsis;
74
+ }
75
+
76
+ [role='tab']:not(.ft-tabs--tab-with-label) .ft-tabs--tab-label,
77
+ .ft-tabs--dense .ft-tabs--tab-with-icon .ft-tabs--tab-label {
78
+ display: none;
79
+ }
80
+
81
+ [role='tab']:not(.ft-tabs--tab-with-icon) .ft-tabs--tab-icon {
82
+ display: none;
83
+ }
84
+
85
+ .ft-tabs--active-tab-indicator {
86
+ position: absolute;
87
+ height: 3px;
88
+ border-radius: 2px;
89
+ background-color: ${FtTabsCssVariables.colorPrimary};
90
+ transition: width 200ms ease, left 200ms ease, top 200ms ease;
91
+ }
92
+
93
+ .ft-tabs--content {
94
+ flex-shrink: 1;
95
+ flex-grow: 1;
96
+ overflow: auto;
97
+ }
98
+ `;
99
+ //# sourceMappingURL=ft-tabs.css.js.map
@@ -1,22 +1,6 @@
1
1
  import { PropertyValues } from "lit";
2
2
  import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
3
- export declare enum FtTabsAlignment {
4
- left = "left",
5
- right = "right",
6
- justify = "justify"
7
- }
8
- export interface FtTabsProperties {
9
- dense: boolean;
10
- contentBefore: boolean;
11
- activeIndex: number;
12
- alignTabs: FtTabsAlignment;
13
- }
14
- export declare const FtTabsCssVariables: {
15
- colorSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
16
- colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
17
- colorOnSurfaceMedium: import("@fluid-topics/ft-wc-utils").FtCssVariable;
18
- colorOnSurfaceDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
19
- };
3
+ import { FtTabsAlignment, FtTabsProperties } from "./ft-tabs.properties";
20
4
  export declare class IndexChangeEvent extends CustomEvent<number> {
21
5
  constructor(index: number);
22
6
  }
package/build/ft-tabs.js CHANGED
@@ -4,27 +4,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { css, html } from "lit";
7
+ import { html } from "lit";
8
8
  import { property, query, state } from "lit/decorators.js";
9
9
  import { repeat } from "lit/directives/repeat.js";
10
10
  import { classMap } from "lit/directives/class-map.js";
11
- import { Debouncer, designSystemVariables, FtCssVariableFactory, FtLitElement } from "@fluid-topics/ft-wc-utils";
11
+ import { Debouncer, FtLitElement } from "@fluid-topics/ft-wc-utils";
12
12
  import { FtTab } from "./ft-tab";
13
13
  import { FtRipple } from "@fluid-topics/ft-ripple";
14
14
  import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
15
15
  import { FtIcon } from "@fluid-topics/ft-icon";
16
- export var FtTabsAlignment;
17
- (function (FtTabsAlignment) {
18
- FtTabsAlignment["left"] = "left";
19
- FtTabsAlignment["right"] = "right";
20
- FtTabsAlignment["justify"] = "justify";
21
- })(FtTabsAlignment || (FtTabsAlignment = {}));
22
- export const FtTabsCssVariables = {
23
- colorSurface: FtCssVariableFactory.external(designSystemVariables.colorSurface, "Design system"),
24
- colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
25
- colorOnSurfaceMedium: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
26
- colorOnSurfaceDisabled: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
27
- };
16
+ import { FtTabsAlignment } from "./ft-tabs.properties";
17
+ import { styles } from "./ft-tabs.css";
28
18
  export class IndexChangeEvent extends CustomEvent {
29
19
  constructor(index) {
30
20
  super("index-change", { detail: index });
@@ -71,7 +61,7 @@ export class FtTabs extends FtLitElement {
71
61
  <ft-icon class="ft-tabs--tab-icon" part="tab-icon" variant="${tab.iconVariant}">
72
62
  ${tab.icon}
73
63
  </ft-icon>
74
- <ft-typography class="ft-tabs--tab-label"
64
+ <ft-typography class="ft-tabs--tab-label"
75
65
  part="tab-label"
76
66
  variant="${FtTypographyVariants.body2}">
77
67
  ${tab.label}
@@ -137,95 +127,7 @@ FtTabs.elementDefinitions = {
137
127
  "ft-icon": FtIcon,
138
128
  };
139
129
  // language=CSS
140
- FtTabs.styles = css `
141
- .ft-tabs {
142
- display: flex;
143
- flex-direction: column;
144
- background-color: ${FtTabsCssVariables.colorSurface};
145
- height: 100%;
146
- }
147
-
148
- .ft-tabs--reverse {
149
- flex-direction: column-reverse;
150
- }
151
-
152
- [role="tablist"] {
153
- flex-shrink: 0;
154
- flex-grow: 0;
155
- display: flex;
156
- position: relative;
157
- flex-wrap: wrap;
158
- }
159
-
160
- .ft-tabs--align-right {
161
- justify-content: flex-end;
162
- }
163
-
164
- .ft-tabs--align-justify {
165
- justify-content: space-evenly;
166
- }
167
-
168
- [role='tab'] {
169
- position: relative;
170
- display: flex;
171
- overflow: hidden;
172
- flex-direction: column;
173
- align-items: center;
174
- justify-content: center;
175
- padding: 8px 16px;
176
- background: none;
177
- box-shadow: 0px 0px 0px transparent;
178
- border: 0px solid transparent;
179
- text-shadow: 0px 0px 0px transparent;
180
- cursor: pointer;
181
- outline: none;
182
- font-size: 16px;
183
- line-height: 1;
184
- color: ${FtTabsCssVariables.colorOnSurfaceMedium};
185
- }
186
-
187
- [role='tab'][aria-selected='true'] {
188
- color: ${FtTabsCssVariables.colorPrimary};
189
- }
190
-
191
- [role='tab'][disabled] {
192
- color: ${FtTabsCssVariables.colorOnSurfaceDisabled};
193
- }
194
-
195
- .ft-tabs--align-justify [role='tab'] {
196
- flex-grow: 1;
197
- }
198
-
199
- [role='tab'] .ft-tabs--tab-label {
200
- width: 100%;
201
- white-space: nowrap;
202
- overflow: hidden;
203
- text-overflow: ellipsis;
204
- }
205
-
206
- [role='tab']:not(.ft-tabs--tab-with-label) .ft-tabs--tab-label,
207
- .ft-tabs--dense .ft-tabs--tab-with-icon .ft-tabs--tab-label {
208
- display: none;
209
- }
210
-
211
- [role='tab']:not(.ft-tabs--tab-with-icon) .ft-tabs--tab-icon {
212
- display: none;
213
- }
214
-
215
- .ft-tabs--active-tab-indicator {
216
- position: absolute;
217
- height: 3px;
218
- border-radius: 2px;
219
- background-color: ${FtTabsCssVariables.colorPrimary};
220
- transition: width 200ms ease, left 200ms ease, top 200ms ease;
221
- }
222
-
223
- .ft-tabs--content {
224
- flex-shrink: 1;
225
- flex-grow: 1;
226
- overflow: auto;
227
- }
228
- `;
130
+ FtTabs.styles = styles;
229
131
  __decorate([
230
132
  property({ type: Boolean })
231
133
  ], FtTabs.prototype, "dense", void 0);