@fluid-topics/ft-card 2.0.37 → 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.
@@ -1,233 +0,0 @@
1
- import { css } from "lit";
2
- import { card, link, } from "@fluid-topics/design-system-variables";
3
- import { FtdsTypographyVariants } from "@fluid-topics/ft-typography";
4
- import { FtRippleCssVariables } from "@fluid-topics/ft-ripple";
5
- export const FtdsCardCssVariables = {
6
- ...card,
7
- };
8
- export const FtdsCardTypographies = {
9
- header: FtdsTypographyVariants.body1semibold,
10
- };
11
- // language=CSS
12
- export const designSystemStyles = css `
13
- :host {
14
- display: block;
15
- height: stretch;
16
- }
17
-
18
- #container {
19
- position: relative;
20
- overflow: hidden;
21
- border-radius: ${card.borderRadius};
22
- display: flex;
23
- align-items: stretch;
24
- height: stretch;
25
- }
26
-
27
- #container.ftds-card--clickable {
28
- cursor: pointer;
29
- }
30
-
31
- #container:focus-visible,
32
- #container:has(a:focus-visible) {
33
- outline: ${card.focusOutlineWidth} solid ${card.focusFocusRingColor};
34
- outline-offset: ${card.focusOutlineOffset};
35
- border-radius: ${card.borderRadius};
36
- }
37
-
38
- #container:focus {
39
- outline: none;
40
- }
41
-
42
- #container:focus-visible {
43
- outline: 2px solid ${card.focusFocusRingColor};
44
- outline-offset: 2px;
45
- }
46
-
47
- #header a {
48
- text-decoration: none;
49
- color: ${link.neutralDefaultColor};
50
- }
51
-
52
- #header a:focus {
53
- outline: none;
54
- }
55
-
56
- #header a:before {
57
- content: "";
58
- position: absolute;
59
- inset: 0;
60
- }
61
-
62
- #main {
63
- min-width: 0;
64
- flex-grow: 1;
65
- display: flex;
66
- flex-direction: column;
67
- }
68
-
69
- #header {
70
- display: flex;
71
- justify-content: space-between;
72
-
73
- #header-title {
74
- min-width: 0;
75
- padding: ${card.headerTitleVerticalPadding} ${card.headerTitleHorizontalPadding};
76
- }
77
-
78
- ftds-typography, a {
79
- display: -webkit-box;
80
- overflow: hidden;
81
- -webkit-box-orient: vertical;
82
- text-overflow: ellipsis;
83
- word-break: break-word;
84
- -webkit-line-clamp: 2;
85
- }
86
-
87
- #header-actions {
88
- padding: ${card.headerActionVerticalPadding} ${card.headerActionHorizontalPadding} ${card.headerActionVerticalPadding} 0;
89
-
90
- slot[name="header-actions"] {
91
- display: flex;
92
- gap: ${card.headerActionGap};
93
- }
94
- }
95
- }
96
-
97
- .ftds-card--header-border #header {
98
- border-bottom: ${card.internalBorderWidth} solid ${card.internalBorderColor};
99
- }
100
-
101
- .ftds-card--no-header #header {
102
- display: none;
103
- }
104
-
105
- .ftds-card--no-header-actions #header-actions {
106
- display: none;
107
- }
108
-
109
- #body {
110
- padding: 0 ${card.bodyHorizontalPadding} ${card.bodyVerticalPadding} ${card.bodyHorizontalPadding};
111
- flex-grow: 1;
112
- }
113
-
114
- .ftds-card--header-border #body, .ftds-card--no-header #body {
115
- padding: ${card.bodyVerticalPadding} ${card.bodyHorizontalPadding};
116
- }
117
-
118
- .ftds-card--no-body #body {
119
- display: none;
120
- }
121
-
122
- #footer {
123
- border-top: ${card.internalBorderWidth} solid ${card.internalBorderColor};
124
- display: flex;
125
- justify-content: space-between;
126
- align-items: center;
127
-
128
- #footer-text {
129
- padding: ${card.footerContentVerticalPadding} ${card.footerContentHorizontalPadding};
130
-
131
- slot[name="footer"] {
132
- display: flex;
133
- align-items: center;
134
- }
135
- }
136
-
137
- #footer-actions {
138
- padding: ${card.footerActionVerticalPadding} ${card.footerActionHorizontalPadding} ${card.footerActionVerticalPadding} 0;
139
-
140
- slot[name="footer-actions"] {
141
- display: flex;
142
- gap: ${card.footerActionGap};
143
-
144
- }
145
- }
146
- }
147
-
148
- .ftds-card--no-footer #footer {
149
- display: none;
150
- }
151
-
152
- .ftds-card--no-body.ftds-card--no-header #footer {
153
- border-top: none;
154
- }
155
-
156
- .ftds-card--no-footer-actions #footer-actions {
157
- display: none;
158
- }
159
-
160
- #side-bar {
161
- padding: ${card.sideBarVerticalPadding} ${card.sideBarHorizontalPadding};
162
- border-left: ${card.internalBorderWidth} solid ${card.internalBorderColor};
163
-
164
- slot[name="side-bar"] {
165
- display: flex;
166
- flex-direction: column;
167
- gap: ${card.sideBarGap};
168
- }
169
- }
170
-
171
- .ftds-card--no-side-bar #side-bar {
172
- display: none;
173
- }
174
-
175
-
176
- /* SPECIFICATIONS FOR INTERACTIVE CARDS */
177
- /* selectable selected */
178
- #container.ftds-card--selected {
179
- background-color: ${card.selectableSelectedBackgroundColor};
180
- border: ${card.selectableSelectedBorderWidth} solid ${card.selectableSelectedBorderColor};
181
-
182
- .ftds-card--header-border #header {
183
- border-bottom: ${card.selectableSelectedBorderWidth} solid ${card.selectableSelectedBorderColor};;
184
- }
185
-
186
- ft-ripple {
187
- ${FtRippleCssVariables.color.set(card.selectableSelectedStateLayerColor)};
188
- ${FtRippleCssVariables.opacityContentOnSurfaceSelected.set(card.selectableSelectedDefaultStateLayerOpacity)};
189
- ${FtRippleCssVariables.opacityContentOnSurfaceFocused.set(card.selectableSelectedFocusStateLayerOpacity)};
190
- ${FtRippleCssVariables.opacityContentOnSurfaceHover.set(card.selectableSelectedHoverStateLayerOpacity)};
191
- }
192
- }
193
-
194
- /* selectable unselected */
195
- #container.ftds-card--selectable:not(.ftds-card--selected) {
196
- background-color: ${card.selectableUnselectedDefaultBackgroundColor};
197
- border: ${card.selectableUnselectedBorderWidth} solid ${card.selectableUnselectedDefaultBorderColor};
198
-
199
- ft-ripple {
200
- ${FtRippleCssVariables.color.set(card.selectableUnselectedStateLayerColor)};
201
- ${FtRippleCssVariables.opacityContentOnSurfaceFocused.set(card.selectableUnselectedFocusStateLayerOpacity)};
202
- ${FtRippleCssVariables.opacityContentOnSurfaceHover.set(card.selectableUnselectedHoverStateLayerOpacity)};
203
- }
204
- }
205
-
206
- #container.ftds-card--selectable:not(.ftds-card--selected):hover {
207
- border: ${card.selectableUnselectedBorderWidth} solid ${card.selectableUnselectedHoverBorderColor};
208
- }
209
-
210
- #container.ftds-card--selectable:not(.ftds-card--selected):focus {
211
- border: ${card.selectableUnselectedBorderWidth} solid ${card.selectableUnselectedFocusBorderColor};
212
- }
213
-
214
- /* not selectable */
215
- #container:not(.ftds-card--selectable) {
216
- background-color: ${card.nonSelectableDefaultBackgroundColor};
217
- border: ${card.nonSelectableBorderWidth} solid ${card.nonSelectableDefaultBorderColor};
218
-
219
- ft-ripple {
220
- ${FtRippleCssVariables.color.set(card.nonSelectableStateLayerColor)};
221
- ${FtRippleCssVariables.opacityContentOnSurfaceFocused.set(card.nonSelectableFocusStateLayerOpacity)};
222
- ${FtRippleCssVariables.opacityContentOnSurfaceHover.set(card.nonSelectableHoverStateLayerOpacity)};
223
- }
224
- }
225
-
226
- #container.ftds-card--clickable:not(.ftds-card--selectable):hover {
227
- border: ${card.nonSelectableBorderWidth} solid ${card.nonSelectableHoverBorderColor};
228
- }
229
-
230
- #container.ftds-card--clickable:not(.ftds-card--selectable):focus {
231
- border: ${card.nonSelectableBorderWidth} solid ${card.nonSelectableFocusBorderColor};
232
- }
233
- `;