@fluid-topics/ft-tabs 1.1.42 → 1.1.43

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.
@@ -1,11 +1,15 @@
1
1
  export declare enum FtTabsAlignment {
2
2
  left = "left",
3
3
  right = "right",
4
+ start = "start",
5
+ end = "end",
4
6
  justify = "justify"
5
7
  }
6
8
  export interface FtTabsProperties {
7
9
  dense: boolean;
10
+ collapsible: boolean;
11
+ horizontal: boolean;
8
12
  contentBefore: boolean;
9
- activeIndex: number;
13
+ activeIndex?: number;
10
14
  alignTabs: FtTabsAlignment;
11
15
  }
@@ -2,5 +2,7 @@ export var FtTabsAlignment;
2
2
  (function (FtTabsAlignment) {
3
3
  FtTabsAlignment["left"] = "left";
4
4
  FtTabsAlignment["right"] = "right";
5
+ FtTabsAlignment["start"] = "start";
6
+ FtTabsAlignment["end"] = "end";
5
7
  FtTabsAlignment["justify"] = "justify";
6
8
  })(FtTabsAlignment || (FtTabsAlignment = {}));
@@ -1,4 +1,7 @@
1
1
  export declare const FtTabsCssVariables: {
2
+ buttonsWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
3
+ denseButtonsWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
4
+ widthWhenHorizontalAndOpen: import("@fluid-topics/ft-wc-utils").FtCssVariable;
2
5
  colorSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
3
6
  colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
4
7
  colorOnSurfaceMedium: import("@fluid-topics/ft-wc-utils").FtCssVariable;
@@ -1,6 +1,9 @@
1
1
  import { css } from "lit";
2
2
  import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
3
3
  export const FtTabsCssVariables = {
4
+ buttonsWidth: FtCssVariableFactory.create("--ft-tabs-horizontal-button-width", "Width of the tab buttons (N/A for vertical justified tabs)", "SIZE", "100px"),
5
+ denseButtonsWidth: FtCssVariableFactory.create("--ft-tabs-dense-horizontal-button-width", "Width of the tab buttons when dense (N/A for vertical justified tabs)", "SIZE", "56px"),
6
+ widthWhenHorizontalAndOpen: FtCssVariableFactory.create("--ft-tabs-width-when-horizontal-and-open", "Width of the component when set to horizontal and open", "SIZE", "100%"),
4
7
  colorSurface: FtCssVariableFactory.external(designSystemVariables.colorSurface, "Design system"),
5
8
  colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
6
9
  colorOnSurfaceMedium: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
@@ -15,10 +18,34 @@ export const styles = css `
15
18
  height: 100%;
16
19
  }
17
20
 
21
+ .ft-tabs--horizontal {
22
+ -webkit-transition: width 200ms ease-in-out;
23
+ -moz-transition: width 200ms ease-in-out;
24
+ -o-transition: width 200ms ease-in-out;
25
+ transition: width 200ms ease-in-out;
26
+ width: ${FtTabsCssVariables.widthWhenHorizontalAndOpen};
27
+ }
28
+
29
+ .ft-tabs--horizontal.ft-tabs--collapsed {
30
+ width: ${FtTabsCssVariables.buttonsWidth};
31
+ }
32
+
33
+ .ft-tabs--horizontal.ft-tabs--dense.ft-tabs--collapsed {
34
+ width: ${FtTabsCssVariables.denseButtonsWidth};
35
+ }
36
+
37
+ .ft-tabs--horizontal {
38
+ flex-direction: row;
39
+ }
40
+
18
41
  .ft-tabs--reverse {
19
42
  flex-direction: column-reverse;
20
43
  }
21
44
 
45
+ .ft-tabs--horizontal.ft-tabs--reverse {
46
+ flex-direction: row-reverse;
47
+ }
48
+
22
49
  [role="tablist"] {
23
50
  flex-shrink: 0;
24
51
  flex-grow: 0;
@@ -27,11 +54,16 @@ export const styles = css `
27
54
  flex-wrap: wrap;
28
55
  }
29
56
 
30
- .ft-tabs--align-right {
57
+ .ft-tabs--horizontal [role="tablist"] {
58
+ flex-direction: column;
59
+ }
60
+
61
+ .ft-tabs--align-end [role="tablist"],
62
+ .ft-tabs--align-right [role="tablist"] {
31
63
  justify-content: flex-end;
32
64
  }
33
65
 
34
- .ft-tabs--align-justify {
66
+ .ft-tabs--align-justify [role="tablist"] {
35
67
  justify-content: space-evenly;
36
68
  }
37
69
 
@@ -52,6 +84,15 @@ export const styles = css `
52
84
  font-size: 16px;
53
85
  line-height: 1;
54
86
  color: ${FtTabsCssVariables.colorOnSurfaceMedium};
87
+ width: ${FtTabsCssVariables.buttonsWidth};
88
+ }
89
+
90
+ .ft-tabs--dense [role='tab'] {
91
+ width: ${FtTabsCssVariables.denseButtonsWidth};
92
+ }
93
+
94
+ .ft-tabs--align-justify:not(.ft-tabs--horizontal) [role='tab'] {
95
+ width: unset;
55
96
  }
56
97
 
57
98
  [role='tab'][aria-selected='true'] {
@@ -63,14 +104,12 @@ export const styles = css `
63
104
  }
64
105
 
65
106
  .ft-tabs--align-justify [role='tab'],
66
- .ft-tabs--align-justify .ft-tabs--tab-tooltip {
107
+ .ft-tabs--align-justify .ft-tabs--tab-tooltip,
108
+ .ft-tabs--align-justify .ft-tabs--tab-tooltip::part(container) {
109
+ display: flex;
67
110
  flex-grow: 1;
68
111
  }
69
112
 
70
- .ft-tabs--align-justify .ft-tabs--tab-tooltip [role='tab'] {
71
- width: 100%;
72
- }
73
-
74
113
  [role='tab'] .ft-tabs--tab-label {
75
114
  width: 100%;
76
115
  white-space: nowrap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-tabs",
3
- "version": "1.1.42",
3
+ "version": "1.1.43",
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.42",
23
- "@fluid-topics/ft-ripple": "1.1.42",
24
- "@fluid-topics/ft-tooltip": "1.1.42",
25
- "@fluid-topics/ft-typography": "1.1.42",
26
- "@fluid-topics/ft-wc-utils": "1.1.42",
22
+ "@fluid-topics/ft-icon": "1.1.43",
23
+ "@fluid-topics/ft-ripple": "1.1.43",
24
+ "@fluid-topics/ft-tooltip": "1.1.43",
25
+ "@fluid-topics/ft-typography": "1.1.43",
26
+ "@fluid-topics/ft-wc-utils": "1.1.43",
27
27
  "lit": "3.1.0"
28
28
  },
29
- "gitHead": "057e1248874a9a814a34e0bf75329f963744a5ff"
29
+ "gitHead": "c6f6bcb506f87c05a46c67d364abc285eec41894"
30
30
  }