@hashicorp/design-system-components 4.23.1 → 4.24.0-rc-20250923215537
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.
- package/declarations/components/hds/advanced-table/index.d.ts +13 -3
- package/declarations/components/hds/advanced-table/models/column.d.ts +9 -2
- package/declarations/components/hds/advanced-table/models/row.d.ts +5 -1
- package/declarations/components/hds/advanced-table/models/table.d.ts +13 -2
- package/declarations/components/hds/advanced-table/td.d.ts +1 -1
- package/declarations/components/hds/advanced-table/th-context-menu.d.ts +16 -7
- package/declarations/components/hds/advanced-table/th-reorder-drop-target.d.ts +32 -0
- package/declarations/components/hds/advanced-table/th-reorder-handle.d.ts +24 -0
- package/declarations/components/hds/advanced-table/th-resize-handle.d.ts +2 -1
- package/declarations/components/hds/advanced-table/th-sort.d.ts +11 -3
- package/declarations/components/hds/advanced-table/th.d.ts +11 -4
- package/declarations/components/hds/advanced-table/tr.d.ts +7 -1
- package/declarations/components/hds/advanced-table/types.d.ts +15 -0
- package/declarations/components/hds/advanced-table/utils.d.ts +5 -0
- package/declarations/components/hds/dropdown/toggle/icon.d.ts +1 -1
- package/declarations/components/hds/flyout/index.d.ts +4 -1
- package/declarations/components/hds/form/index.d.ts +1 -1
- package/declarations/components/hds/form/key-value-inputs/index.d.ts +4 -4
- package/declarations/components/hds/form/radio-card/index.d.ts +2 -2
- package/declarations/components/hds/modal/index.d.ts +4 -2
- package/declarations/components/hds/popover-primitive/index.d.ts +3 -0
- package/declarations/components/hds/separator/index.d.ts +1 -1
- package/declarations/components/hds/stepper/list/step.d.ts +1 -1
- package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
- package/declarations/components/hds/table/index.d.ts +5 -5
- package/declarations/components/hds/table/td.d.ts +1 -1
- package/declarations/components/hds/table/th-sort.d.ts +1 -1
- package/declarations/components/hds/table/th.d.ts +1 -1
- package/declarations/template-registry.d.ts +6 -0
- package/dist/_app_/components/hds/advanced-table/th-reorder-drop-target.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-reorder-handle.js +1 -0
- package/dist/_app_/components/hds/advanced-table/utils.js +1 -0
- package/dist/components/hds/advanced-table/index.js +77 -17
- package/dist/components/hds/advanced-table/index.js.map +1 -1
- package/dist/components/hds/advanced-table/models/column.js +58 -13
- package/dist/components/hds/advanced-table/models/column.js.map +1 -1
- package/dist/components/hds/advanced-table/models/row.js +38 -3
- package/dist/components/hds/advanced-table/models/row.js.map +1 -1
- package/dist/components/hds/advanced-table/models/table.js +146 -2
- package/dist/components/hds/advanced-table/models/table.js.map +1 -1
- package/dist/components/hds/advanced-table/td.js.map +1 -1
- package/dist/components/hds/advanced-table/th-context-menu.js +124 -50
- package/dist/components/hds/advanced-table/th-context-menu.js.map +1 -1
- package/dist/components/hds/advanced-table/th-reorder-drop-target.js +133 -0
- package/dist/components/hds/advanced-table/th-reorder-drop-target.js.map +1 -0
- package/dist/components/hds/advanced-table/th-reorder-handle.js +104 -0
- package/dist/components/hds/advanced-table/th-reorder-handle.js.map +1 -0
- package/dist/components/hds/advanced-table/th-resize-handle.js +44 -21
- package/dist/components/hds/advanced-table/th-resize-handle.js.map +1 -1
- package/dist/components/hds/advanced-table/th-sort.js +20 -8
- package/dist/components/hds/advanced-table/th-sort.js.map +1 -1
- package/dist/components/hds/advanced-table/th.js +19 -7
- package/dist/components/hds/advanced-table/th.js.map +1 -1
- package/dist/components/hds/advanced-table/tr.js +1 -1
- package/dist/components/hds/advanced-table/tr.js.map +1 -1
- package/dist/components/hds/advanced-table/types.js +6 -1
- package/dist/components/hds/advanced-table/types.js.map +1 -1
- package/dist/components/hds/advanced-table/utils.js +23 -0
- package/dist/components/hds/advanced-table/utils.js.map +1 -0
- package/dist/components/hds/dropdown/toggle/icon.js.map +1 -1
- package/dist/components/hds/flyout/index.js +29 -6
- package/dist/components/hds/flyout/index.js.map +1 -1
- package/dist/components/hds/form/index.js.map +1 -1
- package/dist/components/hds/form/key-value-inputs/index.js.map +1 -1
- package/dist/components/hds/form/radio-card/index.js.map +1 -1
- package/dist/components/hds/modal/index.js +51 -37
- package/dist/components/hds/modal/index.js.map +1 -1
- package/dist/components/hds/popover-primitive/index.js +51 -35
- package/dist/components/hds/popover-primitive/index.js.map +1 -1
- package/dist/components/hds/separator/index.js.map +1 -1
- package/dist/components/hds/stepper/list/step.js.map +1 -1
- package/dist/components/hds/table/index.js.map +1 -1
- package/dist/components/hds/table/td.js.map +1 -1
- package/dist/components/hds/table/th-sort.js.map +1 -1
- package/dist/components/hds/table/th.js.map +1 -1
- package/dist/components.js +1 -1
- package/dist/styles/@hashicorp/design-system-components.css +196 -62
- package/dist/styles/components/advanced-table.scss +155 -6
- package/dist/styles/mixins/_focus-ring.scss +43 -0
- package/package.json +5 -2
- package/translations/hds/components/advanced-table/en-us.yaml +1 -0
- package/translations/hds/components/advanced-table/th-context-menu/en-us.yaml +3 -0
- package/translations/hds/components/advanced-table/th-reorder-handle/en-us.yaml +2 -0
|
@@ -23,6 +23,7 @@ $hds-advanced-table-cell-padding-medium: 14px 16px 13px 16px; // the 1px differe
|
|
|
23
23
|
$hds-advanced-table-cell-padding-short: 6px 16px 5px 16px; // the 1px difference is to account for the bottom border
|
|
24
24
|
$hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px difference is to account for the bottom border
|
|
25
25
|
$hds-advanced-table-button-size: 24px; // the size of the buttons and dropdown triggers in the header cell
|
|
26
|
+
$hds-advanced-table-drag-preview-background-color: rgba(204, 227, 254, 30%);
|
|
26
27
|
|
|
27
28
|
// ADVANCED TABLE
|
|
28
29
|
|
|
@@ -111,6 +112,76 @@ $hds-advanced-table-button-size: 24px; // the size of the buttons and dropdown t
|
|
|
111
112
|
z-index: 1;
|
|
112
113
|
isolation: isolate;
|
|
113
114
|
}
|
|
115
|
+
|
|
116
|
+
&:hover,
|
|
117
|
+
&.mock-hover,
|
|
118
|
+
&:focus-within {
|
|
119
|
+
.hds-advanced-table__th-reorder-handle {
|
|
120
|
+
visibility: visible;
|
|
121
|
+
opacity: 1;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&.hds-advanced-table__th--is-being-dragged .hds-advanced-table__th-reorder-handle {
|
|
126
|
+
opacity: 0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.hds-advanced-table__th-reorder-drop-target {
|
|
131
|
+
position: absolute;
|
|
132
|
+
top: 0;
|
|
133
|
+
right: 0;
|
|
134
|
+
left: 0;
|
|
135
|
+
z-index: 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// is being dragged
|
|
139
|
+
.hds-advanced-table__th-reorder-drop-target--is-being-dragged {
|
|
140
|
+
background-color: var(--token-color-surface-primary);
|
|
141
|
+
opacity: 0.5;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// is dragging over
|
|
145
|
+
.hds-advanced-table__th-reorder-drop-target--is-dragging-over {
|
|
146
|
+
position: absolute;
|
|
147
|
+
top: 0;
|
|
148
|
+
right: 0;
|
|
149
|
+
left: 0;
|
|
150
|
+
z-index: 1;
|
|
151
|
+
|
|
152
|
+
&::after {
|
|
153
|
+
position: absolute;
|
|
154
|
+
top: 0;
|
|
155
|
+
bottom: 0;
|
|
156
|
+
width: 4px;
|
|
157
|
+
background-color: var(--token-color-palette-blue-300);
|
|
158
|
+
content: "";
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// dragging over left
|
|
164
|
+
.hds-advanced-table__th-reorder-drop-target--is-dragging-over--left::after {
|
|
165
|
+
left: 0;
|
|
166
|
+
transform: translateX(-3px);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// dragging over left and is first
|
|
170
|
+
.hds-advanced-table__th-reorder-drop-target--is-dragging-over--left.hds-advanced-table__th-reorder-drop-target--is-first::after {
|
|
171
|
+
border-radius: $hds-advanced-table-inner-border-radius 0 0 $hds-advanced-table-inner-border-radius;
|
|
172
|
+
transform: translateX(0);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// dragging over right
|
|
176
|
+
.hds-advanced-table__th-reorder-drop-target--is-dragging-over--right::after {
|
|
177
|
+
right: 0;
|
|
178
|
+
transform: translateX(3px);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// dragging over right and is last
|
|
182
|
+
.hds-advanced-table__th-reorder-drop-target--is-dragging-over--right.hds-advanced-table__th-reorder-drop-target--is-last::after {
|
|
183
|
+
border-radius: 0 $hds-advanced-table-inner-border-radius $hds-advanced-table-inner-border-radius 0;
|
|
184
|
+
transform: translateX(0);
|
|
114
185
|
}
|
|
115
186
|
|
|
116
187
|
.hds-advanced-table__th-resize-handle {
|
|
@@ -218,6 +289,14 @@ $hds-advanced-table-button-size: 24px; // the size of the buttons and dropdown t
|
|
|
218
289
|
}
|
|
219
290
|
}
|
|
220
291
|
|
|
292
|
+
.hds-advanced-table__scroll-indicator-top {
|
|
293
|
+
top: 0;
|
|
294
|
+
width: 100%;
|
|
295
|
+
height: 8px;
|
|
296
|
+
// the rgb value is equivalent to neutral/600, need to use rgba for the right opacity
|
|
297
|
+
background: linear-gradient(to top, rgba(59, 61, 69, 0%) 0%, rgba(59, 61, 69, 8%) 100%);
|
|
298
|
+
}
|
|
299
|
+
|
|
221
300
|
// Resizable columns
|
|
222
301
|
&.hds-advanced-table__thead--has-resizable-columns {
|
|
223
302
|
.hds-advanced-table__th .hds-advanced-table__th-content-text {
|
|
@@ -237,6 +316,11 @@ $hds-advanced-table-button-size: 24px; // the size of the buttons and dropdown t
|
|
|
237
316
|
background-color: var(--token-color-surface-strong);
|
|
238
317
|
// need to subtract width of cell top border for default state, otherwise border of header+cell is 3.5px
|
|
239
318
|
border-bottom: calc(3px - #{$hds-advanced-table-border-width} / 2) solid $hds-advanced-table-border-color;
|
|
319
|
+
|
|
320
|
+
.hds-advanced-table__scroll-indicator-top {
|
|
321
|
+
top: unset;
|
|
322
|
+
bottom: -11px;
|
|
323
|
+
}
|
|
240
324
|
}
|
|
241
325
|
|
|
242
326
|
&.hds-advanced-table__thead--is-pinned {
|
|
@@ -270,6 +354,67 @@ $hds-advanced-table-button-size: 24px; // the size of the buttons and dropdown t
|
|
|
270
354
|
min-width: 0;
|
|
271
355
|
}
|
|
272
356
|
|
|
357
|
+
.hds-advanced-table__th-reorder-handle {
|
|
358
|
+
position: absolute;
|
|
359
|
+
bottom: 0;
|
|
360
|
+
left: 50%;
|
|
361
|
+
z-index: 2;
|
|
362
|
+
display: flex;
|
|
363
|
+
flex-direction: column;
|
|
364
|
+
align-items: center;
|
|
365
|
+
justify-content: center;
|
|
366
|
+
width: 24px;
|
|
367
|
+
height: 24px;
|
|
368
|
+
transform: translateX(-50%) translateY(50%);
|
|
369
|
+
visibility: hidden;
|
|
370
|
+
opacity: 0;
|
|
371
|
+
|
|
372
|
+
.hds-advanced-table__th-reorder-handle__inner {
|
|
373
|
+
display: flex;
|
|
374
|
+
align-items: center;
|
|
375
|
+
justify-content: center;
|
|
376
|
+
width: 24px;
|
|
377
|
+
height: 16px;
|
|
378
|
+
color: var(--token-color-foreground-faint);
|
|
379
|
+
background-color: var(--token-color-surface-interactive);
|
|
380
|
+
border: 1px solid var(--token-color-border-primary);
|
|
381
|
+
border-radius: var(--token-border-radius-small);
|
|
382
|
+
box-shadow: var(--token-elevation-low-box-shadow);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.hds-icon {
|
|
386
|
+
width: 12px;
|
|
387
|
+
height: 12px;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
&:hover,
|
|
391
|
+
&.mock-hover {
|
|
392
|
+
cursor: grab;
|
|
393
|
+
|
|
394
|
+
.hds-advanced-table__th-reorder-handle__inner {
|
|
395
|
+
background-color: var(--token-color-surface-interactive-hover);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
&:active,
|
|
400
|
+
&.mock-active {
|
|
401
|
+
cursor: grabbing;
|
|
402
|
+
|
|
403
|
+
.hds-advanced-table__th-reorder-handle__inner {
|
|
404
|
+
background-color: var(--token-color-surface-interactive-hover);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
&:focus,
|
|
409
|
+
&.mock-focus {
|
|
410
|
+
@include hds-focus-ring-with-pseudo-element-focus-always-visible($position: absolute, $top: 3px, $bottom: 3px);
|
|
411
|
+
|
|
412
|
+
.hds-advanced-table__th-reorder-handle__inner {
|
|
413
|
+
background-color: var(--token-color-surface-interactive);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
273
418
|
.hds-advanced-table__th-context-menu .hds-dropdown-toggle-icon {
|
|
274
419
|
width: $hds-advanced-table-button-size;
|
|
275
420
|
height: $hds-advanced-table-button-size;
|
|
@@ -585,14 +730,18 @@ $hds-advanced-table-button-size: 24px; // the size of the buttons and dropdown t
|
|
|
585
730
|
background: linear-gradient(to right, rgba(59, 61, 69, 0%) 0%, rgba(59, 61, 69, 8%) 100%);
|
|
586
731
|
}
|
|
587
732
|
|
|
588
|
-
.hds-advanced-table__scroll-indicator-top {
|
|
589
|
-
height: 8px;
|
|
590
|
-
// the rgb value is equivalent to neutral/600, need to use rgba for the right opacity
|
|
591
|
-
background: linear-gradient(to top, rgba(59, 61, 69, 0%) 0%, rgba(59, 61, 69, 8%) 100%);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
733
|
.hds-advanced-table__scroll-indicator-bottom {
|
|
595
734
|
height: 8px;
|
|
596
735
|
// the rgb value is equivalent to neutral/600, need to use rgba for the right opacity
|
|
597
736
|
background: linear-gradient(to bottom, rgba(59, 61, 69, 0%) 0%, rgba(59, 61, 69, 8%) 100%);
|
|
598
737
|
}
|
|
738
|
+
|
|
739
|
+
.hds-advanced-table__th-reorder-drag-preview {
|
|
740
|
+
position: absolute;
|
|
741
|
+
top: -9999px;
|
|
742
|
+
left: -9999px;
|
|
743
|
+
background-color: $hds-advanced-table-drag-preview-background-color;
|
|
744
|
+
border: 5px solid var(--token-color-focus-action-external);
|
|
745
|
+
border-radius: var(--token-border-radius-medium);
|
|
746
|
+
box-shadow: var(--token-elevation-mid-box-shadow);
|
|
747
|
+
}
|
|
@@ -83,3 +83,46 @@
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
// This mixin is used for the _rare_ cases where we want the focus ring to be visible when the user clicks the element (not just if they focus it with a keyboard).
|
|
88
|
+
@mixin hds-focus-ring-with-pseudo-element-focus-always-visible(
|
|
89
|
+
$top: 0,
|
|
90
|
+
$right: 0,
|
|
91
|
+
$bottom: 0,
|
|
92
|
+
$left: 0,
|
|
93
|
+
$radius: 5px,
|
|
94
|
+
$color: action,
|
|
95
|
+
$position: relative
|
|
96
|
+
) {
|
|
97
|
+
position: $position;
|
|
98
|
+
outline-style: solid; // used to avoid double outline+focus-ring in Safari (see https://github.com/hashicorp/design-system-components/issues/161#issuecomment-1031548656)
|
|
99
|
+
outline-color: transparent;
|
|
100
|
+
isolation: isolate; // used to create a new stacking context (needed to have the pseudo element below text/icon but not the parent container)
|
|
101
|
+
|
|
102
|
+
&::before {
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: $top;
|
|
105
|
+
right: $right;
|
|
106
|
+
bottom: $bottom;
|
|
107
|
+
left: $left;
|
|
108
|
+
z-index: -1;
|
|
109
|
+
border-radius: $radius;
|
|
110
|
+
content: "";
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// default focus for browsers that still rely on ":focus"
|
|
114
|
+
&:focus,
|
|
115
|
+
&.mock-focus {
|
|
116
|
+
&::before {
|
|
117
|
+
box-shadow: var(--token-focus-ring-#{$color}-box-shadow);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// remove the focus ring on "active + focused" state (by design)
|
|
122
|
+
&:focus:active,
|
|
123
|
+
&.mock-focus.mock-active {
|
|
124
|
+
&::before {
|
|
125
|
+
box-shadow: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.24.0-rc-20250923215537",
|
|
4
4
|
"description": "Helios Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@embroider/macros": "^1.18.1",
|
|
36
36
|
"@embroider/util": "^1.13.4",
|
|
37
37
|
"@floating-ui/dom": "^1.6.12",
|
|
38
|
-
"@hashicorp/design-system-tokens": "
|
|
38
|
+
"@hashicorp/design-system-tokens": "3.0.0-rc-20250923215537",
|
|
39
39
|
"@hashicorp/flight-icons": "^3.13.0",
|
|
40
40
|
"@lezer/highlight": "^1.2.1",
|
|
41
41
|
"@nullvoxpopuli/ember-composable-helpers": "^5.2.11",
|
|
@@ -138,11 +138,14 @@
|
|
|
138
138
|
"./components/hds/advanced-table/th-button-sort.js": "./dist/_app_/components/hds/advanced-table/th-button-sort.js",
|
|
139
139
|
"./components/hds/advanced-table/th-button-tooltip.js": "./dist/_app_/components/hds/advanced-table/th-button-tooltip.js",
|
|
140
140
|
"./components/hds/advanced-table/th-context-menu.js": "./dist/_app_/components/hds/advanced-table/th-context-menu.js",
|
|
141
|
+
"./components/hds/advanced-table/th-reorder-drop-target.js": "./dist/_app_/components/hds/advanced-table/th-reorder-drop-target.js",
|
|
142
|
+
"./components/hds/advanced-table/th-reorder-handle.js": "./dist/_app_/components/hds/advanced-table/th-reorder-handle.js",
|
|
141
143
|
"./components/hds/advanced-table/th-resize-handle.js": "./dist/_app_/components/hds/advanced-table/th-resize-handle.js",
|
|
142
144
|
"./components/hds/advanced-table/th-selectable.js": "./dist/_app_/components/hds/advanced-table/th-selectable.js",
|
|
143
145
|
"./components/hds/advanced-table/th-sort.js": "./dist/_app_/components/hds/advanced-table/th-sort.js",
|
|
144
146
|
"./components/hds/advanced-table/th.js": "./dist/_app_/components/hds/advanced-table/th.js",
|
|
145
147
|
"./components/hds/advanced-table/tr.js": "./dist/_app_/components/hds/advanced-table/tr.js",
|
|
148
|
+
"./components/hds/advanced-table/utils.js": "./dist/_app_/components/hds/advanced-table/utils.js",
|
|
146
149
|
"./components/hds/alert/description.js": "./dist/_app_/components/hds/alert/description.js",
|
|
147
150
|
"./components/hds/alert.js": "./dist/_app_/components/hds/alert.js",
|
|
148
151
|
"./components/hds/alert/title.js": "./dist/_app_/components/hds/alert/title.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
reordered-message: Moved {columnLabel} column to position {newPosition}
|