@fluid-topics/ft-tabs 1.1.78 → 1.1.79

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,10 @@
1
+ import { FtBaseTabs } from "./ft-base-tabs";
2
+ import { ClassInfo } from "lit/directives/class-map.js";
3
+ export interface FtdsTabsProperties {
4
+ sideIcon?: boolean;
5
+ }
6
+ export declare class FtdsTabs extends FtBaseTabs implements FtdsTabsProperties {
7
+ sideIcon: boolean;
8
+ static styles: import("lit").CSSResult[];
9
+ get tabsClasses(): ClassInfo;
10
+ }
@@ -0,0 +1,35 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { FtBaseTabs } from "./ft-base-tabs";
8
+ import { safariEllipsisFix } from "@fluid-topics/ft-wc-utils";
9
+ import { designSystemStyles } from "./ftds-tabs.styles";
10
+ import { property } from "lit/decorators.js";
11
+ class FtdsTabs extends FtBaseTabs {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.sideIcon = false;
15
+ }
16
+ get tabsClasses() {
17
+ return {
18
+ "ft-tabs": true,
19
+ "ft-tabs--collapsed": this.collapsible && this.activeIndex == null,
20
+ "ft-tabs--horizontal": this.horizontal,
21
+ "ft-tabs--reverse": this.contentBefore,
22
+ "ft-tabs--dense": this.dense,
23
+ ["ft-tabs--align-" + this.alignTabs]: true,
24
+ "ft-tabs--side-icon": this.sideIcon
25
+ };
26
+ }
27
+ }
28
+ FtdsTabs.styles = [
29
+ safariEllipsisFix,
30
+ designSystemStyles
31
+ ];
32
+ __decorate([
33
+ property({ type: Boolean })
34
+ ], FtdsTabs.prototype, "sideIcon", void 0);
35
+ export { FtdsTabs };
@@ -0,0 +1,12 @@
1
+ export declare const FtdsTabsCssVariables: {
2
+ horizontalButtonsWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
3
+ horizontalDenseButtonsWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
4
+ widthWhenHorizontalAndOpen: import("@fluid-topics/ft-wc-utils").FtCssVariable;
5
+ colorSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
6
+ colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
7
+ backgroundPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
8
+ color: import("@fluid-topics/ft-wc-utils").FtCssVariable;
9
+ colorDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
10
+ focusBorderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
11
+ };
12
+ export declare const designSystemStyles: import("lit").CSSResult;
@@ -0,0 +1,154 @@
1
+ import { css } from "lit";
2
+ import { FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
3
+ import { foundation } from "@fluid-topics/design-system-variables/build/generated/ts/foundation";
4
+ export const FtdsTabsCssVariables = {
5
+ horizontalButtonsWidth: FtCssVariableFactory.create("--ft-tabs-horizontal-buttons-width", "Width of the tab buttons (N/A for vertical justified tabs)", "SIZE", "100px"),
6
+ horizontalDenseButtonsWidth: FtCssVariableFactory.create("--ft-tabs-horizontal-dense-buttons-width", "Width of the tab buttons when dense (N/A for vertical justified tabs)", "SIZE", "56px"),
7
+ widthWhenHorizontalAndOpen: FtCssVariableFactory.create("--ft-tabs-width-when-horizontal-and-open", "Width of the component when set to horizontal and open", "SIZE", "100%"),
8
+ colorSurface: FtCssVariableFactory.create("--ft-tabs-color-surface", "", "COLOR", "#FFFFFF"),
9
+ colorPrimary: FtCssVariableFactory.create("--ft-tabs-color-primary", "", "COLOR", foundation.colorBrand0),
10
+ backgroundPrimary: FtCssVariableFactory.create("--ft-tabs-background-primary", "", "COLOR", foundation.colorBrand10),
11
+ color: FtCssVariableFactory.create("--ft-tabs-color", "", "COLOR", foundation.colorGray200),
12
+ colorDisabled: FtCssVariableFactory.create("--ft-tabs-color-disabled", "", "COLOR", foundation.colorGray60),
13
+ focusBorderColor: FtCssVariableFactory.create("--ft-tabs-focus-border-color", "", "COLOR", foundation.colorCyan70),
14
+ };
15
+ // language=CSS
16
+ export const designSystemStyles = css `
17
+ .ft-tabs {
18
+ display: flex;
19
+ flex-direction: column;
20
+ background-color: ${FtdsTabsCssVariables.colorSurface};
21
+ height: 100%;
22
+ }
23
+
24
+ .ft-tabs--horizontal {
25
+ -webkit-transition: width 200ms ease-in-out;
26
+ -moz-transition: width 200ms ease-in-out;
27
+ -o-transition: width 200ms ease-in-out;
28
+ transition: width 200ms ease-in-out;
29
+ width: ${FtdsTabsCssVariables.widthWhenHorizontalAndOpen};
30
+ }
31
+
32
+ .ft-tabs--horizontal.ft-tabs--collapsed {
33
+ width: ${FtdsTabsCssVariables.horizontalButtonsWidth};
34
+ }
35
+
36
+ .ft-tabs--horizontal.ft-tabs--dense.ft-tabs--collapsed {
37
+ width: ${FtdsTabsCssVariables.horizontalDenseButtonsWidth};
38
+ }
39
+
40
+ .ft-tabs--horizontal {
41
+ flex-direction: row;
42
+ }
43
+
44
+ .ft-tabs--reverse {
45
+ flex-direction: column-reverse;
46
+ }
47
+
48
+ .ft-tabs--horizontal.ft-tabs--reverse {
49
+ flex-direction: row-reverse;
50
+ }
51
+
52
+ [role="tablist"] {
53
+ flex-shrink: 0;
54
+ flex-grow: 0;
55
+ display: flex;
56
+ position: relative;
57
+ flex-wrap: wrap;
58
+ }
59
+
60
+ .ft-tabs--horizontal [role="tablist"] {
61
+ flex-direction: column;
62
+ }
63
+
64
+ .ft-tabs--align-end [role="tablist"],
65
+ .ft-tabs--align-right [role="tablist"] {
66
+ justify-content: flex-end;
67
+ }
68
+
69
+ .ft-tabs--align-justify [role="tablist"] {
70
+ justify-content: space-evenly;
71
+ }
72
+
73
+ [role='tab'] {
74
+ position: relative;
75
+ display: flex;
76
+ overflow: hidden;
77
+ flex-direction: column;
78
+ align-items: center;
79
+ justify-content: center;
80
+ padding: 8px 16px;
81
+ background: none;
82
+ box-shadow: 0px 0px 0px transparent;
83
+ border: 3px solid transparent;
84
+ text-shadow: 0px 0px 0px transparent;
85
+ cursor: pointer;
86
+ outline: none;
87
+ font-size: 16px;
88
+ line-height: 1;
89
+ color: ${FtdsTabsCssVariables.color};
90
+ }
91
+
92
+ [role='tab']:focus {
93
+ border: 3px solid ${FtdsTabsCssVariables.focusBorderColor};
94
+ border-radius: 3px;
95
+ }
96
+
97
+ .ft-tabs--side-icon [role='tab'] {
98
+ flex-direction: row;
99
+ }
100
+
101
+ .ft-tabs--horizontal [role='tab'] {
102
+ width: ${FtdsTabsCssVariables.horizontalButtonsWidth};
103
+ }
104
+
105
+ .ft-tabs--horizontal.ft-tabs--dense [role='tab'] {
106
+ width: ${FtdsTabsCssVariables.horizontalDenseButtonsWidth};
107
+ }
108
+
109
+ [role='tab'][aria-selected='true'] {
110
+ color: ${FtdsTabsCssVariables.colorPrimary};
111
+ background-color: ${FtdsTabsCssVariables.backgroundPrimary};
112
+ }
113
+
114
+ [role='tab'][disabled] {
115
+ color: ${FtdsTabsCssVariables.colorDisabled};
116
+ }
117
+
118
+ .ft-tabs--align-justify [role='tab'],
119
+ .ft-tabs--align-justify .ft-tabs--tab-tooltip,
120
+ .ft-tabs--align-justify .ft-tabs--tab-tooltip::part(container) {
121
+ display: flex;
122
+ flex-grow: 1;
123
+ }
124
+
125
+ [role='tab'] .ft-tabs--tab-label {
126
+ width: 100%;
127
+ white-space: nowrap;
128
+ overflow: hidden;
129
+ text-overflow: ellipsis;
130
+ }
131
+
132
+ [role='tab']:not(.ft-tabs--tab-with-label) .ft-tabs--tab-label,
133
+ .ft-tabs--dense .ft-tabs--tab-with-icon .ft-tabs--tab-label {
134
+ display: none;
135
+ }
136
+
137
+ [role='tab']:not(.ft-tabs--tab-with-icon) .ft-tabs--tab-icon {
138
+ display: none;
139
+ }
140
+
141
+ .ft-tabs--active-tab-indicator {
142
+ position: absolute;
143
+ height: 3px;
144
+ border-radius: 2px;
145
+ background-color: ${FtdsTabsCssVariables.colorPrimary};
146
+ transition: width 200ms ease, left 200ms ease, top 200ms ease;
147
+ }
148
+
149
+ .ft-tabs--content {
150
+ flex-shrink: 1;
151
+ flex-grow: 1;
152
+ overflow: auto;
153
+ }
154
+ `;
package/build/index.d.ts CHANGED
@@ -2,5 +2,7 @@ export * from "./ft-tab.styles";
2
2
  export * from "./ft-tab.properties";
3
3
  export * from "./ft-tab";
4
4
  export * from "./ft-tabs.styles";
5
- export * from "./ft-tabs.properties";
6
5
  export * from "./ft-tabs";
6
+ export * from "./ft-base-tabs";
7
+ export * from "./ftds-tabs.styles";
8
+ export * from "./ftds-tabs";
package/build/index.js CHANGED
@@ -1,11 +1,15 @@
1
1
  import { customElement } from "@fluid-topics/ft-wc-utils";
2
2
  import { FtTab } from "./ft-tab";
3
3
  import { FtTabs } from "./ft-tabs";
4
+ import { FtdsTabs } from "./ftds-tabs";
4
5
  export * from "./ft-tab.styles";
5
6
  export * from "./ft-tab.properties";
6
7
  export * from "./ft-tab";
7
8
  export * from "./ft-tabs.styles";
8
- export * from "./ft-tabs.properties";
9
9
  export * from "./ft-tabs";
10
+ export * from "./ft-base-tabs";
11
+ export * from "./ftds-tabs.styles";
12
+ export * from "./ftds-tabs";
10
13
  customElement("ft-tab")(FtTab);
11
14
  customElement("ft-tabs")(FtTabs);
15
+ customElement("ftds-tabs")(FtdsTabs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-tabs",
3
- "version": "1.1.78",
3
+ "version": "1.1.79",
4
4
  "description": "Generic tabs component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-icon": "1.1.78",
23
- "@fluid-topics/ft-ripple": "1.1.78",
24
- "@fluid-topics/ft-tooltip": "1.1.78",
25
- "@fluid-topics/ft-typography": "1.1.78",
26
- "@fluid-topics/ft-wc-utils": "1.1.78",
22
+ "@fluid-topics/ft-icon": "1.1.79",
23
+ "@fluid-topics/ft-ripple": "1.1.79",
24
+ "@fluid-topics/ft-tooltip": "1.1.79",
25
+ "@fluid-topics/ft-typography": "1.1.79",
26
+ "@fluid-topics/ft-wc-utils": "1.1.79",
27
27
  "lit": "3.1.0"
28
28
  },
29
- "gitHead": "b4f44baf8cd02d5ef4ba2fd616f0aa9483a8a027"
29
+ "gitHead": "83d2a7107ad2642bf0d22e15afdcabc32c258f7a"
30
30
  }
@@ -1,15 +0,0 @@
1
- export declare enum FtTabsAlignment {
2
- left = "left",
3
- right = "right",
4
- start = "start",
5
- end = "end",
6
- justify = "justify"
7
- }
8
- export interface FtTabsProperties {
9
- dense: boolean;
10
- collapsible: boolean;
11
- horizontal: boolean;
12
- contentBefore: boolean;
13
- activeIndex?: number;
14
- alignTabs: FtTabsAlignment;
15
- }
@@ -1,8 +0,0 @@
1
- export var FtTabsAlignment;
2
- (function (FtTabsAlignment) {
3
- FtTabsAlignment["left"] = "left";
4
- FtTabsAlignment["right"] = "right";
5
- FtTabsAlignment["start"] = "start";
6
- FtTabsAlignment["end"] = "end";
7
- FtTabsAlignment["justify"] = "justify";
8
- })(FtTabsAlignment || (FtTabsAlignment = {}));