@fluid-topics/ftds-tabs 2.1.0

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,18 @@
1
+ export interface FtdsTabsProperties {
2
+ activeIndex?: number;
3
+ alignTabs: FtdsTabsAlignment;
4
+ structure?: FtdsTabsStructure;
5
+ }
6
+ export declare enum FtdsTabsStructure {
7
+ topIcon = "top-icon",
8
+ sideIcon = "side-icon",
9
+ labelOnly = "label-only",
10
+ iconOnly = "icon-only"
11
+ }
12
+ export declare enum FtdsTabsAlignment {
13
+ left = "left",
14
+ right = "right",
15
+ start = "start",
16
+ end = "end",
17
+ justify = "justify"
18
+ }
@@ -0,0 +1,15 @@
1
+ export var FtdsTabsStructure;
2
+ (function (FtdsTabsStructure) {
3
+ FtdsTabsStructure["topIcon"] = "top-icon";
4
+ FtdsTabsStructure["sideIcon"] = "side-icon";
5
+ FtdsTabsStructure["labelOnly"] = "label-only";
6
+ FtdsTabsStructure["iconOnly"] = "icon-only";
7
+ })(FtdsTabsStructure || (FtdsTabsStructure = {}));
8
+ export var FtdsTabsAlignment;
9
+ (function (FtdsTabsAlignment) {
10
+ FtdsTabsAlignment["left"] = "left";
11
+ FtdsTabsAlignment["right"] = "right";
12
+ FtdsTabsAlignment["start"] = "start";
13
+ FtdsTabsAlignment["end"] = "end";
14
+ FtdsTabsAlignment["justify"] = "justify";
15
+ })(FtdsTabsAlignment || (FtdsTabsAlignment = {}));
@@ -0,0 +1,2 @@
1
+ export { tabs as FtdsTabsCssVariables } from "@fluid-topics/design-system-variables";
2
+ export declare const designSystemStyles: import("lit").CSSResult;
@@ -0,0 +1,182 @@
1
+ import { css } from "lit";
2
+ import { tabs } from "@fluid-topics/design-system-variables";
3
+ import { setVariable } from "@fluid-topics/ft-wc-utils";
4
+ import { FtRippleCssVariables } from "@fluid-topics/ft-ripple/build/ft-ripple.styles";
5
+ export { tabs as FtdsTabsCssVariables } from "@fluid-topics/design-system-variables";
6
+ // language=CSS
7
+ export const designSystemStyles = css `
8
+ .ftds-tabs {
9
+ display: flex;
10
+ flex-direction: column;
11
+ height: 100%;
12
+ }
13
+
14
+ .ftds-tabs.ftds-tabs--horizontal {
15
+ flex-direction: row;
16
+ }
17
+
18
+ [role="tablist"] {
19
+ flex-shrink: 0;
20
+ flex-grow: 0;
21
+ display: flex;
22
+ flex-direction: row;
23
+ position: relative;
24
+ flex-wrap: wrap;
25
+ border-bottom: ${tabs.offBorderBottomWidth} solid ${tabs.offBorderBottomColor};
26
+ }
27
+
28
+ .ftds-tabs--horizontal [role="tablist"] {
29
+ flex-direction: column;
30
+ border-bottom: unset;
31
+ border-right: ${tabs.offBorderBottomWidth} solid ${tabs.offBorderBottomColor};
32
+ }
33
+
34
+ .ftds-tabs--align-end [role="tablist"],
35
+ .ftds-tabs--align-right [role="tablist"] {
36
+ justify-content: flex-end;
37
+ }
38
+
39
+ .ftds-tabs--align-justify [role="tablist"] {
40
+ justify-content: space-evenly;
41
+ }
42
+
43
+ [role='tab'] {
44
+ position: relative;
45
+ display: flex;
46
+ overflow: hidden;
47
+ flex-direction: column;
48
+ align-items: center;
49
+ justify-content: center;
50
+ padding: ${tabs.withLabelVerticalPadding} ${tabs.withLabelHorizontalPadding};
51
+ background: none;
52
+ box-shadow: 0px 0px 0px transparent;
53
+ text-shadow: 0px 0px 0px transparent;
54
+ cursor: pointer;
55
+ outline: none;
56
+ font-size: 16px;
57
+ line-height: 1;
58
+ color: ${tabs.offColor};
59
+ border-radius: ${tabs.topLeftBorderRadius} ${tabs.topRightBorderRadius} 0 0;
60
+ border: 0;
61
+ gap: ${tabs.verticalGap} ${tabs.horizontalGap};
62
+ z-index: 0;
63
+ }
64
+
65
+ .ftds-tabs--horizontal [role="tab"] {
66
+ border-radius: ${tabs.topRightBorderRadius} 0 0 ${tabs.topLeftBorderRadius};
67
+ }
68
+
69
+ .ftds-tabs--horizontal.ftds-tabs--side-icon [role="tab"],
70
+ .ftds-tabs--horizontal.ftds-tabs--label-only [role="tab"] {
71
+ align-items: flex-end;
72
+ justify-content: end;
73
+ }
74
+
75
+ .ftds-tabs--icon-only [role='tab'] {
76
+ padding: ${tabs.iconOnlyVerticalPadding} ${tabs.iconOnlyHorizontalPadding};
77
+ }
78
+
79
+ [role='tab'] ft-ripple {
80
+ ${setVariable(FtRippleCssVariables.color, tabs.onStateLayerColor)};
81
+ }
82
+
83
+ [role='tab']:focus-visible {
84
+ outline: ${tabs.focusOutlineWidth} solid ${tabs.focusFocusRingColor};
85
+ outline-offset: calc(${tabs.focusOutlineWidth} * -1);
86
+ border-radius: ${tabs.focusOutlineWidth};
87
+ }
88
+
89
+ [role='tab']::before {
90
+ content: "";
91
+ position: absolute;
92
+ top: 0;
93
+ left: 0;
94
+ width: 100%;
95
+ height: 100%;
96
+ z-index: -1;
97
+ background-color: ${tabs.offStateLayerColor};
98
+ opacity: ${tabs.offDefaultStateLayerOpacity};
99
+ }
100
+
101
+ [role='tab']:focus-visible::before {
102
+ background-color: ${tabs.offStateLayerColor};
103
+ opacity: ${tabs.offFocusStateLayerOpacity};
104
+ }
105
+
106
+ [role='tab']:hover::before {
107
+ background-color: ${tabs.offStateLayerColor};
108
+ opacity: ${tabs.offHoverStateLayerOpacity};
109
+ }
110
+
111
+ [role='tab'][disabled] {
112
+ opacity: ${tabs.offDisabledComponentOpacity};
113
+ }
114
+
115
+ .ftds-tabs--side-icon [role='tab'] {
116
+ flex-direction: row;
117
+ }
118
+
119
+ [role='tab'][aria-selected='true'] {
120
+ color: ${tabs.onColor};
121
+ }
122
+
123
+ [role='tab'][aria-selected='true']::before {
124
+ background-color: ${tabs.onStateLayerColor};
125
+ opacity: ${tabs.onDefaultStateLayerOpacity};
126
+ }
127
+
128
+ [role='tab'][aria-selected='true']:active::before {
129
+ background-color: ${tabs.onStateLayerColor};
130
+ opacity: ${tabs.onActiveStateLayerOpacity};
131
+ }
132
+
133
+ [role='tab'][aria-selected='true']:hover::before {
134
+ background-color: ${tabs.onStateLayerColor};
135
+ opacity: ${tabs.onHoverStateLayerOpacity};
136
+ }
137
+
138
+ [role='tab'][aria-selected='true']:focus-visible::before {
139
+ background-color: ${tabs.onStateLayerColor};
140
+ opacity: ${tabs.onFocusStateLayerOpacity};
141
+ }
142
+
143
+ .ftds-tabs--align-justify [role='tab'],
144
+ .ftds-tabs--align-justify .ftds-tabs--tab-tooltip,
145
+ .ftds-tabs--align-justify .ftds-tabs--tab-tooltip::part(container) {
146
+ display: flex;
147
+ flex-grow: 1;
148
+ }
149
+
150
+ [role='tab'] .ftds-tabs--tab-label {
151
+ white-space: nowrap;
152
+ overflow: hidden;
153
+ text-overflow: ellipsis;
154
+ }
155
+
156
+ [role='tab']:not(.ftds-tabs--tab-with-label) .ftds-tabs--tab-label,
157
+ .ftds-tabs--icon-only .ftds-tabs--tab-with-icon .ftds-tabs--tab-label {
158
+ display: none;
159
+ }
160
+
161
+ [role='tab']:not(.ftds-tabs--tab-with-icon) .ftds-tabs--tab-icon,
162
+ .ftds-tabs--label-only .ftds-tabs--tab-with-label .ftds-tabs--tab-icon {
163
+ display: none;
164
+ }
165
+
166
+ .ftds-tabs--active-tab-indicator {
167
+ position: absolute;
168
+ border-radius: 0;
169
+ background-color: ${tabs.onActiveTabIndicatorColor};
170
+ transition: width 200ms ease, left 200ms ease, top 200ms ease;
171
+ }
172
+
173
+ .ftds-tabs--content {
174
+ flex-shrink: 1;
175
+ flex-grow: 1;
176
+ overflow: auto;
177
+ }
178
+
179
+ .ftds-tabs--horizontal .ftds-tabs--content {
180
+ overflow: unset;
181
+ }
182
+ `;
@@ -0,0 +1,7 @@
1
+ export * from "./ftds-tabs.styles";
2
+ export * from "./ftds-tabs.properties";
3
+ export * from "./ftds-tabs";
4
+ export * from "./ftds-tab.styles";
5
+ export * from "./ftds-tab.properties";
6
+ export * from "./ftds-tab";
7
+ import "./define";
package/build/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export * from "./ftds-tabs.styles";
2
+ export * from "./ftds-tabs.properties";
3
+ export * from "./ftds-tabs";
4
+ export * from "./ftds-tab.styles";
5
+ export * from "./ftds-tab.properties";
6
+ export * from "./ftds-tab";
7
+ import "./define";
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@fluid-topics/ftds-tabs",
3
+ "version": "2.1.0",
4
+ "description": "The design system tabs component",
5
+ "keywords": [
6
+ "Lit"
7
+ ],
8
+ "author": "Fluid Topics <devtopics@antidot.net>",
9
+ "license": "ISC",
10
+ "main": "build/index.js",
11
+ "web": "build/ftds-tabs.min.js",
12
+ "typings": "build/index",
13
+ "files": [
14
+ "build/**/*.js",
15
+ "build/**/*.ts"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
+ },
21
+ "dependencies": {
22
+ "@fluid-topics/ft-ripple": "2.1.0",
23
+ "@fluid-topics/ft-tooltip": "2.1.0",
24
+ "@fluid-topics/ft-wc-utils": "2.1.0",
25
+ "@fluid-topics/ftds-icon": "2.1.0",
26
+ "@fluid-topics/ftds-typography": "2.1.0",
27
+ "lit": "3.1.0"
28
+ },
29
+ "devDependencies": {
30
+ "@fluid-topics/ft-wc-test-utils": "2.1.0"
31
+ },
32
+ "gitHead": "4727cf19d04236ad1d2b2cb43ce1c46298834c7e"
33
+ }