@wwtdev/bsds-css 2.15.0 → 2.17.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,324 @@
1
+ /* ------ WRAPPER ------ */
2
+
3
+ .bs-table-wrap {
4
+ display: flex;
5
+ flex-direction: column;
6
+ overflow: hidden;
7
+ }
8
+
9
+ :where(.bs-table-wrap) {
10
+ font-size: var(--bs-text-sm);
11
+ color: var(--bs-table-cell-ink, var(--bs-ink-light));
12
+ border-radius: var(--bs-space-2);
13
+ border: 1px solid var(--bs-border-base);
14
+ }
15
+
16
+ :where(.bs-table-wrap-header, .bs-table-wrap-footer) {
17
+ padding-block: var(--bs-space-3);
18
+ padding-inline: var(--bs-table-cell-padding);
19
+ background: var(--bs-bg-medium);
20
+ border-color: inherit;
21
+ }
22
+
23
+ :where(.bs-table-wrap-header) {
24
+ border-bottom-width: 1px;
25
+ }
26
+
27
+ :where(.bs-table-wrap-footer) {
28
+ border-top-width: 1px;
29
+ }
30
+
31
+
32
+ /* ------ TABLE ------ */
33
+
34
+ .bs-table-scroll-wrap {
35
+ flex: 1;
36
+ border-color: inherit;
37
+ overflow: auto;
38
+ overscroll-behavior: none;
39
+ }
40
+
41
+ .bs-table {
42
+ display: grid;
43
+ grid-template-columns: var(--bs-table-col-widths);
44
+ }
45
+
46
+ :where(.bs-table) {
47
+ border-color: inherit;
48
+ }
49
+
50
+ /* ------ HEADER ROWGROUP ------ */
51
+
52
+ .bs-table-header-rowgroup {
53
+ grid-column: 1 / -1;
54
+ grid-row: span var(--bs-table-header-row-count);
55
+ display: grid;
56
+ grid-template-columns: subgrid;
57
+ grid-template-rows: subgrid;
58
+ border-color: inherit;
59
+ }
60
+
61
+ .bs-table-header-rowgroup-freeze {
62
+ position: sticky;
63
+ top: 0;
64
+ z-index: 1;
65
+
66
+ .bs-table:not(.bs-table-border-none) & {
67
+ box-shadow: 0 3px 0 rgba(0, 0, 0, .03);
68
+ }
69
+ }
70
+
71
+ /* ------ BODY ROWGROUP ------ */
72
+
73
+ .bs-table-body-rowgroup {
74
+ grid-column: 1 / -1;
75
+ grid-row: span var(--bs-table-body-row-count);
76
+ display: grid;
77
+ grid-template-columns: subgrid;
78
+ grid-template-rows: subgrid;
79
+ border-color: inherit;
80
+ }
81
+
82
+ /* ------ FOOTER ROWGROUP ------ */
83
+
84
+ .bs-table-footer-rowgroup {
85
+ grid-column: 1 / -1;
86
+ grid-row: span var(--bs-table-footer-row-count);
87
+ display: grid;
88
+ grid-template-columns: subgrid;
89
+ grid-template-rows: subgrid;
90
+ border-color: inherit;
91
+ }
92
+
93
+ .bs-table-footer-rowgroup-freeze {
94
+ position: sticky;
95
+ bottom: 0;
96
+
97
+ .bs-table:not(.bs-table-border-none) & {
98
+ box-shadow: 0 -3px 0 rgba(0, 0, 0, .03);
99
+ }
100
+ }
101
+
102
+ /* ------ ROWS ------ */
103
+
104
+ .bs-table-row {
105
+ grid-column: 1 / -1;
106
+ }
107
+
108
+ :where(.bs-table-row) {
109
+ background: var(--bs-bg-base);
110
+ border-color: inherit;
111
+ }
112
+
113
+ :where(.bs-table-header-rowgroup .bs-table-row) {
114
+ background: var(--bs-bg-light);
115
+ }
116
+
117
+ :where(.bs-table-row:has(.bs-table-head-cell, .bs-table-cell)) {
118
+ display: grid;
119
+ grid-template-columns: subgrid;
120
+ }
121
+
122
+ /* ------ FROZEN COLS ------ */
123
+
124
+ .bs-table-cols-frozen-left {
125
+ position: sticky;
126
+ left: 0;
127
+ grid-column: span var(--bs-table-frozen-left-count);
128
+ display: grid;
129
+ grid-template-columns: subgrid;
130
+ background: inherit;
131
+ border-color: inherit;
132
+
133
+ .bs-table:not(.bs-table-border-none) & {
134
+ box-shadow: 3px 0 0 rgba(0, 0, 0, .03);
135
+ }
136
+ }
137
+
138
+ .bs-table-cols-frozen-right {
139
+ position: sticky;
140
+ right: 0;
141
+ grid-column: span var(--bs-table-frozen-right-count);
142
+ display: grid;
143
+ grid-template-columns: subgrid;
144
+ background: inherit;
145
+ border-color: inherit;
146
+
147
+ .bs-table:not(.bs-table-border-none) & {
148
+ box-shadow: -3px 0 0 rgba(0, 0, 0, .03);
149
+ }
150
+ }
151
+
152
+ /* ------ CELLS ------ */
153
+
154
+ :where(.bs-table-head-cell) {
155
+ color: var(--bs-table-head-cell-ink, var(--bs-ink-base));
156
+ font-weight: var(--bs-font-bold);
157
+ border-color: inherit;
158
+ }
159
+
160
+ /* Couldn't use :where due to Blue Steel reset styles on <button> imposing font-size.
161
+ Adding inherit in case consumer does custom header cell styles */
162
+ .bs-table-head-cell .bs-sort-toggle {
163
+ font-size: inherit;
164
+ font-weight: var(--bs-font-bold);
165
+ color: inherit;
166
+ line-height: inherit;
167
+ letter-spacing: inherit;
168
+ }
169
+
170
+ :where(.bs-table-cell) {
171
+ border-color: inherit;
172
+ }
173
+
174
+ /* ------ PROP: CELL-PADDING ------ */
175
+
176
+ :root {
177
+ --bs-table-cell-padding-xs: var(--bs-space-2);
178
+ --bs-table-cell-padding-sm: var(--bs-space-3);
179
+ --bs-table-cell-padding-md: var(--bs-space-4);
180
+ --bs-table-cell-padding-lg: var(--bs-space-6);
181
+ --bs-table-cell-padding-xl: var(--bs-space-8);
182
+ }
183
+
184
+ :where(.bs-table-head-cell, .bs-table-cell) {
185
+ padding: var(--bs-table-cell-padding);
186
+ }
187
+
188
+ /* ------ PROP: TRUNCATE ------ */
189
+
190
+ :where(.bs-table-truncate):where(.bs-table-head-cell, .bs-table-cell) {
191
+ overflow: hidden;
192
+ text-overflow: ellipsis;
193
+ white-space: nowrap;
194
+ }
195
+
196
+
197
+ /* ------ PROP: STRIPED ROWS ------ */
198
+
199
+ :where(.bs-table-striped .bs-table-body-rowgroup .bs-table-row:nth-child(even)) {
200
+ background: var(--bs-bg-light);
201
+ }
202
+
203
+
204
+ /* ------ PROP: ROW HOVER ------ */
205
+
206
+ :where(.bs-table-row-hover .bs-table-body-rowgroup .bs-table-row:hover) {
207
+ background: var(--bs-table-row-hover, var(--bs-bg-light));
208
+ transition: background-color 200ms;
209
+ }
210
+
211
+
212
+ /* ------ PROP: BORDERS ------ */
213
+
214
+ /* -- borders="rows" -- */
215
+ :where(.bs-table-border-rows) :where(.bs-table-row) {
216
+ border-bottom-width: 1px;
217
+ }
218
+
219
+ /* -- borders="cols" -- */
220
+ /* setting following cell's left border instead of each cell's right, so Table's left/right border is easier for consumer to override with utility classes */
221
+ :where(.bs-table-border-cols) :where(.bs-table-head-cell + .bs-table-head-cell, .bs-table-cell + .bs-table-cell) {
222
+ border-left-width: 1px;
223
+ }
224
+
225
+ .bs-table-border-cols .bs-table-header-rowgroup {
226
+ border-bottom-width: 1px;
227
+ }
228
+
229
+ /* -- borders="grid" -- */
230
+ :where(.bs-table-border-grid) :where(.bs-table-row) {
231
+ border-bottom-width: 1px;
232
+ }
233
+
234
+ /* setting following cell's left border instead of each cell's right, so Table's left/right border is easier for consumer to override with utility classes */
235
+ :where(.bs-table-border-grid) :where(.bs-table-head-cell + .bs-table-head-cell, .bs-table-cell + .bs-table-cell) {
236
+ border-left-width: 1px;
237
+ }
238
+
239
+ /* -- borders="frozen" -- */
240
+ .bs-table-border-frozen .bs-table-header-rowgroup-freeze {
241
+ border-bottom-width: 1px;
242
+ }
243
+
244
+ /* -- frozen col and footer-rowgroup sections will always show border, unless borders="none" -- */
245
+ /* (header-rowgroup is not included below since TableRow bottom border covers most cases) */
246
+ .bs-table:not(.bs-table-border-none) .bs-table-cols-frozen-left {
247
+ border-right-width: 1px;
248
+ }
249
+
250
+ .bs-table:not(.bs-table-border-none) .bs-table-cols-frozen-right {
251
+ border-left-width: 1px;
252
+ }
253
+
254
+ .bs-table:not(.bs-table-border-none) .bs-table-footer-rowgroup-freeze {
255
+ border-top-width: 1px;
256
+ }
257
+
258
+ /* turn off last row's bottom border, since it would double-up with Table's border */
259
+ :where(.bs-table-body-rowgroup, .bs-table-footer-rowgroup) .bs-table-row:last-of-type {
260
+ border-bottom-width: 0;
261
+ }
262
+
263
+
264
+ /* ------ TABLE COLUMN RESIZER ------ */
265
+
266
+ .bs-table-col-resizer {
267
+ position: fixed; /* fixed instead of absolute, due to using coordinates from .getBoundingClientRect() */
268
+ top: 0;
269
+ left: -8px;
270
+ bottom: 0;
271
+ width: 15px; /* includes 5px resizer handle width + 5px of extra hover target area on left and right of handle */
272
+ cursor: col-resize;
273
+ touch-action: none;
274
+ z-index: var(--bs-table-col-resizer-z, 10);
275
+ transform: translate(var(--bs-table-col-resizer-x), var(--bs-table-col-resizer-y));
276
+
277
+ /* resizer handle and vertical line set-up */
278
+ &:before,
279
+ &::after {
280
+ content: "";
281
+ position: absolute;
282
+ top: 0;
283
+ left: 0;
284
+ background: var(--bs-table-col-resizer-color, var(--bs-blue-base));
285
+ }
286
+
287
+ /* resizer handle */
288
+ &::after {
289
+ left: 5px;
290
+ width: 5px;
291
+ height: var(--bs-table-col-resizer-handle-height);
292
+ }
293
+
294
+ /* resizer vertical line/tail */
295
+ &::before {
296
+ left: 7px;
297
+ width: 1px;
298
+ height: var(--bs-table-col-resizer-tail-height);
299
+ display: none;
300
+ }
301
+
302
+ &.bs-table-col-resizer-active::before {
303
+ display: block;
304
+ }
305
+ }
306
+
307
+ /* ------ SORT TOGGLE ------ */
308
+
309
+ /* Override Blue Steel CSS: It adds "relative" to buttons by default, which was causing an overlap issue when a Table with frozen, sortable cols scrolled horizontally */
310
+ .bs-sort-toggle {
311
+ position: static;
312
+ }
313
+
314
+ /* Using :where to lower specificity so consumers can use utility classes to override */
315
+ :where(.bs-sort-toggle) {
316
+ display: inline-flex;
317
+ align-items: center;
318
+ gap: var(--bs-space-2);
319
+ cursor: pointer;
320
+ }
321
+
322
+ :where(.bs-sort-toggle .bs-icon) {
323
+ flex-shrink: 0;
324
+ }
@@ -41,8 +41,8 @@
41
41
  /* Active States */
42
42
  :where(.bs-tooltip:not([data-position])):hover :where(.bs-tooltip-text),
43
43
  :where(.bs-tooltip[data-position="top"]):hover :where(.bs-tooltip-text),
44
- :where(.bs-tooltip:not([data-position])):focus-within :where(.bs-tooltip-text),
45
- :where(.bs-tooltip[data-position="top"]):focus-within :where(.bs-tooltip-text),
44
+ :where(.bs-tooltip:not([data-position])):has(:focus-visible) :where(.bs-tooltip-text),
45
+ :where(.bs-tooltip[data-position="top"]):has(:focus-visible) :where(.bs-tooltip-text),
46
46
  :where(.bs-tooltip:not([data-position]))[data-shown] :where(.bs-tooltip-text),
47
47
  :where(.bs-tooltip[data-position="top"])[data-shown] :where(.bs-tooltip-text) {
48
48
  opacity: 1;
@@ -59,7 +59,7 @@
59
59
 
60
60
  /* Active States */
61
61
  :where(.bs-tooltip[data-position="bottom"]):hover :where(.bs-tooltip-text),
62
- :where(.bs-tooltip[data-position="bottom"]):focus-within :where(.bs-tooltip-text),
62
+ :where(.bs-tooltip[data-position="bottom"]):has(:focus-visible) :where(.bs-tooltip-text),
63
63
  :where(.bs-tooltip[data-position="bottom"])[data-shown] :where(.bs-tooltip-text) {
64
64
  opacity: 1;
65
65
  transform: translateX(-50%) scale(1);
@@ -75,7 +75,7 @@
75
75
 
76
76
  /* Active States */
77
77
  :where(.bs-tooltip[data-position="left"]):hover :where(.bs-tooltip-text),
78
- :where(.bs-tooltip[data-position="left"]):focus-within :where(.bs-tooltip-text),
78
+ :where(.bs-tooltip[data-position="left"]):has(:focus-visible) :where(.bs-tooltip-text),
79
79
  :where(.bs-tooltip[data-position="left"])[data-shown] :where(.bs-tooltip-text) {
80
80
  opacity: 1;
81
81
  transform: translateY(-50%) scale(1);
@@ -90,7 +90,7 @@
90
90
  }
91
91
 
92
92
  :where(.bs-tooltip[data-position="right"]):hover :where(.bs-tooltip-text),
93
- :where(.bs-tooltip[data-position="right"]):focus-within :where(.bs-tooltip-text),
93
+ :where(.bs-tooltip[data-position="right"]):has(:focus-visible) :where(.bs-tooltip-text),
94
94
  :where(.bs-tooltip[data-position="right"])[data-shown] :where(.bs-tooltip-text) {
95
95
  opacity: 1;
96
96
  transform: translateY(-50%) scale(1);
@@ -130,10 +130,10 @@
130
130
  :where(.bs-tooltip[data-position="top-right"]):hover :where(.bs-tooltip-text),
131
131
  :where(.bs-tooltip[data-position="bottom-left"]):hover :where(.bs-tooltip-text),
132
132
  :where(.bs-tooltip[data-position="bottom-right"]):hover :where(.bs-tooltip-text),
133
- :where(.bs-tooltip[data-position="top-left"]):focus-within :where(.bs-tooltip-text),
134
- :where(.bs-tooltip[data-position="top-right"]):focus-within :where(.bs-tooltip-text),
135
- :where(.bs-tooltip[data-position="bottom-left"]):focus-within :where(.bs-tooltip-text),
136
- :where(.bs-tooltip[data-position="bottom-right"]):focus-within :where(.bs-tooltip-text),
133
+ :where(.bs-tooltip[data-position="top-left"]):has(:focus-visible) :where(.bs-tooltip-text),
134
+ :where(.bs-tooltip[data-position="top-right"]):has(:focus-visible) :where(.bs-tooltip-text),
135
+ :where(.bs-tooltip[data-position="bottom-left"]):has(:focus-visible) :where(.bs-tooltip-text),
136
+ :where(.bs-tooltip[data-position="bottom-right"]):has(:focus-visible) :where(.bs-tooltip-text),
137
137
  :where(.bs-tooltip[data-position="top-left"]:not([data-shown="false"]))[data-shown] :where(.bs-tooltip-text),
138
138
  :where(.bs-tooltip[data-position="top-right"]:not([data-shown="false"]))[data-shown] :where(.bs-tooltip-text),
139
139
  :where(.bs-tooltip[data-position="bottom-left"]:not([data-shown="false"]))[data-shown] :where(.bs-tooltip-text),
@@ -148,12 +148,28 @@ Don't display unless data-shown is present
148
148
  This must go last to properly override the other classes
149
149
  */
150
150
  :where(.bs-tooltip[data-disabled]:not([data-disabled="false"]):not([data-shown])):hover :where(.bs-tooltip-text),
151
- :where(.bs-tooltip[data-disabled]:not([data-disabled="false"]):not([data-shown])):focus-within :where(.bs-tooltip-text) {
151
+ :where(.bs-tooltip[data-disabled]:not([data-disabled="false"]):not([data-shown])):has(:focus-visible) :where(.bs-tooltip-text) {
152
152
  opacity: 0;
153
153
  transform: scale(0);
154
154
  }
155
155
  :where(.bs-tooltip[data-shown="false"][data-disabled]:not([data-disabled="false"])):hover :where(.bs-tooltip-text),
156
- :where(.bs-tooltip[data-shown="false"][data-disabled]:not([data-disabled="false"])):focus-within :where(.bs-tooltip-text) {
156
+ :where(.bs-tooltip[data-shown="false"][data-disabled]:not([data-disabled="false"])):has(:focus-visible) :where(.bs-tooltip-text) {
157
157
  opacity: 0;
158
158
  transform: scale(0);
159
159
  }
160
+
161
+ /* -------------------- COMPONENT-SPECIFIC STYLES -------------------- */
162
+ .bs-tooltip :where(.bs-tooltip-text.escaped) {
163
+ opacity: 0;
164
+ transform: scale(0.5);
165
+ }
166
+
167
+ .bs-tooltip :where(.bs-tooltip-text.escaped-x) {
168
+ opacity: 0;
169
+ transform: translateX(-50%) scale(0.5);
170
+ }
171
+
172
+ .bs-tooltip :where(.bs-tooltip-text.escaped-y) {
173
+ opacity: 0;
174
+ transform: translateY(-50%) scale(0.5);
175
+ }