@hashicorp/design-system-components 5.0.0 → 5.1.0-rc-20251125151324

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.
Files changed (76) hide show
  1. package/declarations/components/hds/advanced-table/index.d.ts +10 -0
  2. package/declarations/components/hds/dropdown/list-item/checkbox.d.ts +1 -0
  3. package/declarations/components/hds/dropdown/list-item/radio.d.ts +1 -0
  4. package/declarations/components/hds/filter-bar/dropdown.d.ts +38 -0
  5. package/declarations/components/hds/filter-bar/filter-group/checkbox.d.ts +21 -0
  6. package/declarations/components/hds/filter-bar/filter-group/date.d.ts +47 -0
  7. package/declarations/components/hds/filter-bar/filter-group/generic.d.ts +24 -0
  8. package/declarations/components/hds/filter-bar/filter-group/index.d.ts +51 -0
  9. package/declarations/components/hds/filter-bar/filter-group/numerical.d.ts +45 -0
  10. package/declarations/components/hds/filter-bar/filter-group/radio.d.ts +21 -0
  11. package/declarations/components/hds/filter-bar/index.d.ts +48 -0
  12. package/declarations/components/hds/filter-bar/tabs/index.d.ts +43 -0
  13. package/declarations/components/hds/filter-bar/tabs/panel.d.ts +28 -0
  14. package/declarations/components/hds/filter-bar/tabs/tab.d.ts +34 -0
  15. package/declarations/components/hds/filter-bar/types.d.ts +86 -0
  16. package/declarations/components/hds/form/text-input/field.d.ts +1 -1
  17. package/declarations/components.d.ts +12 -0
  18. package/declarations/template-registry.d.ts +33 -0
  19. package/dist/_app_/components/hds/filter-bar/dropdown.js +1 -0
  20. package/dist/_app_/components/hds/filter-bar/filter-group/checkbox.js +1 -0
  21. package/dist/_app_/components/hds/filter-bar/filter-group/date.js +1 -0
  22. package/dist/_app_/components/hds/filter-bar/filter-group/generic.js +1 -0
  23. package/dist/_app_/components/hds/filter-bar/filter-group/numerical.js +1 -0
  24. package/dist/_app_/components/hds/filter-bar/filter-group/radio.js +1 -0
  25. package/dist/_app_/components/hds/filter-bar/filter-group.js +1 -0
  26. package/dist/_app_/components/hds/filter-bar/tabs/panel.js +1 -0
  27. package/dist/_app_/components/hds/filter-bar/tabs/tab.js +1 -0
  28. package/dist/_app_/components/hds/filter-bar/tabs.js +1 -0
  29. package/dist/_app_/components/hds/filter-bar.js +1 -0
  30. package/dist/components/hds/advanced-table/index.js +10 -1
  31. package/dist/components/hds/advanced-table/index.js.map +1 -1
  32. package/dist/components/hds/dropdown/list-item/checkbox.js.map +1 -1
  33. package/dist/components/hds/dropdown/list-item/radio.js.map +1 -1
  34. package/dist/components/hds/filter-bar/dropdown.js +120 -0
  35. package/dist/components/hds/filter-bar/dropdown.js.map +1 -0
  36. package/dist/components/hds/filter-bar/filter-group/checkbox.js +40 -0
  37. package/dist/components/hds/filter-bar/filter-group/checkbox.js.map +1 -0
  38. package/dist/components/hds/filter-bar/filter-group/date.js +164 -0
  39. package/dist/components/hds/filter-bar/filter-group/date.js.map +1 -0
  40. package/dist/components/hds/filter-bar/filter-group/generic.js +43 -0
  41. package/dist/components/hds/filter-bar/filter-group/generic.js.map +1 -0
  42. package/dist/components/hds/filter-bar/filter-group/index.js +226 -0
  43. package/dist/components/hds/filter-bar/filter-group/index.js.map +1 -0
  44. package/dist/components/hds/filter-bar/filter-group/numerical.js +163 -0
  45. package/dist/components/hds/filter-bar/filter-group/numerical.js.map +1 -0
  46. package/dist/components/hds/filter-bar/filter-group/radio.js +40 -0
  47. package/dist/components/hds/filter-bar/filter-group/radio.js.map +1 -0
  48. package/dist/components/hds/filter-bar/index.js +237 -0
  49. package/dist/components/hds/filter-bar/index.js.map +1 -0
  50. package/dist/components/hds/filter-bar/tabs/index.js +181 -0
  51. package/dist/components/hds/filter-bar/tabs/index.js.map +1 -0
  52. package/dist/components/hds/filter-bar/tabs/panel.js +67 -0
  53. package/dist/components/hds/filter-bar/tabs/panel.js.map +1 -0
  54. package/dist/components/hds/filter-bar/tabs/tab.js +98 -0
  55. package/dist/components/hds/filter-bar/tabs/tab.js.map +1 -0
  56. package/dist/components/hds/filter-bar/types.js +35 -0
  57. package/dist/components/hds/filter-bar/types.js.map +1 -0
  58. package/dist/components.js +12 -0
  59. package/dist/components.js.map +1 -1
  60. package/dist/helpers/hds-link-to-query.js +0 -1
  61. package/dist/helpers/hds-link-to-query.js.map +1 -1
  62. package/dist/styles/@hashicorp/design-system-components.css +319 -1555
  63. package/dist/styles/@hashicorp/design-system-components.scss +1 -0
  64. package/dist/styles/components/advanced-table.scss +67 -1
  65. package/dist/styles/components/app-header.scss +6 -9
  66. package/dist/styles/components/filter-bar.scss +164 -0
  67. package/dist/styles/components/side-nav/header.scss +4 -12
  68. package/dist/styles/mixins/_interactive-dark-theme.scss +7 -4
  69. package/package.json +12 -1
  70. package/translations/hds/components/advanced-table/en-us.yaml +3 -0
  71. package/translations/hds/components/filter-bar/date/en-us.yaml +18 -0
  72. package/translations/hds/components/filter-bar/en-us.yaml +9 -0
  73. package/translations/hds/components/filter-bar/filter-group/en-us.yaml +1 -0
  74. package/translations/hds/components/filter-bar/filter-group/numerical/en-us.yaml +15 -0
  75. package/translations/hds/components/filter-bar/filter-options/en-us.yaml +1 -0
  76. package/translations/hds/components/filter-bar/filters-dropdown/en-us.yaml +7 -0
@@ -36,6 +36,7 @@
36
36
  @use "../components/disclosure-primitive";
37
37
  @use "../components/dismiss-button";
38
38
  @use "../components/dropdown";
39
+ @use "../components/filter-bar";
39
40
  @use "../components/flyout";
40
41
  @use "../components/form"; // multiple components
41
42
  @use "../components/icon";
@@ -415,7 +415,8 @@ $hds-advanced-table-drag-preview-background-color: rgba(204, 227, 254, 30%);
415
415
  }
416
416
  }
417
417
 
418
- .hds-advanced-table__th-context-menu .hds-dropdown-toggle-icon {
418
+ .hds-advanced-table__th-context-menu .hds-dropdown-toggle-icon,
419
+ .hds-advanced-table__th-filter-menu .hds-dropdown-toggle-icon {
419
420
  width: $hds-advanced-table-button-size;
420
421
  height: $hds-advanced-table-button-size;
421
422
  margin: -2px 0;
@@ -504,6 +505,25 @@ $hds-advanced-table-drag-preview-background-color: rgba(204, 227, 254, 30%);
504
505
  align-self: flex-start;
505
506
  }
506
507
 
508
+ .hds-advanced-table__th-filter-menu--active {
509
+ position: relative;
510
+
511
+ &::before {
512
+ position: absolute;
513
+ top: -4px;
514
+ right: -4px;
515
+ width: 6px;
516
+ height: 6px;
517
+ background-color: var(--token-color-foreground-action);
518
+ border-radius: 50%;
519
+ content: "";
520
+ }
521
+ }
522
+
523
+ .hds-advanced-table__clear-filters-button {
524
+ margin-bottom: 16px;
525
+ }
526
+
507
527
  // ----------------------------------------------------------------
508
528
 
509
529
  // TABLE BODY
@@ -745,3 +765,49 @@ $hds-advanced-table-drag-preview-background-color: rgba(204, 227, 254, 30%);
745
765
  border-radius: var(--token-border-radius-medium);
746
766
  box-shadow: var(--token-elevation-mid-box-shadow);
747
767
  }
768
+
769
+ // ----------------------------------------------------------------
770
+
771
+ // FILTER BAR
772
+ .hds-advanced-table__actions .hds-filter-bar {
773
+ border-bottom: none;
774
+ border-radius: $hds-advanced-table-border-radius $hds-advanced-table-border-radius 0 0;
775
+ }
776
+
777
+ .hds-advanced-table__actions + .hds-advanced-table__container {
778
+ border-top-left-radius: 0;
779
+ border-top-right-radius: 0;
780
+
781
+ .hds-advanced-table__thead .hds-advanced-table__tr:first-of-type .hds-advanced-table__th {
782
+ &:first-child {
783
+ border-top-left-radius: 0;
784
+ }
785
+
786
+ &:last-child {
787
+ border-top-right-radius: 0;
788
+ }
789
+ }
790
+ }
791
+
792
+ /// ----------------------------------------------------------------
793
+
794
+ // EMPTY STATE
795
+ .hds-advanced-table__empty-state {
796
+ display: flex;
797
+ align-items: center;
798
+ justify-content: center;
799
+ height: 400px;
800
+ background-color: var(--token-color-surface-primary);
801
+ border: 1px solid var(--token-color-border-primary);
802
+ border-bottom-right-radius: $hds-advanced-table-border-radius;
803
+ border-bottom-left-radius: $hds-advanced-table-border-radius;
804
+ }
805
+
806
+ .hds-advanced-table__empty-state__content {
807
+ max-width: 450px;
808
+ }
809
+
810
+ .hds-advanced-table:not(:has(+ .hds-advanced-table__empty-state)) {
811
+ border-bottom-right-radius: 0;
812
+ border-bottom-left-radius: 0;
813
+ }
@@ -106,16 +106,13 @@
106
106
  }
107
107
 
108
108
  // Dropdown & Button color theming overrides
109
+ // Note: We need to apply dark theme styles to .hds-dropdown-toggle-button & .hds-dropdown-toggle-icon
110
+ // so we use a partial classname selector to cover both cases
111
+
109
112
  .hds-button,
110
- .hds-dropdown-toggle-button,
111
- .hds-dropdown-toggle-icon {
112
- // Apply dark theme to child interactive components not within a nested dropdown
113
- &:not(
114
- .hds-dropdown * *,
115
- .ember-basic-dropdown-trigger * *,
116
- .ember-basic-dropdown-content * *,
117
- .hds-dialog-primitive__wrapper *
118
- ) {
113
+ button[class*="hds-dropdown-toggle"] {
114
+ // Apply dark theme to child interactive components not within a nested content container
115
+ &:not(.hds-dropdown__content *, .ember-basic-dropdown-content *, .hds-dialog-primitive__wrapper *) {
119
116
  @include hds-interactive-dark-theme();
120
117
 
121
118
  // disabled state:
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ //
7
+ // FILTER BAR
8
+ //
9
+
10
+ .hds-filter-bar {
11
+ display: grid;
12
+ gap: 8px;
13
+ padding: 8px;
14
+ background-color: var(--token-color-surface-faint);
15
+ border: 1px solid var(--token-color-border-primary);
16
+ border-radius: var(--token-border-radius-medium);
17
+ }
18
+
19
+ .hds-filter-bar__filters {
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ gap: 8px 12px;
23
+ align-items: end;
24
+ padding-top: 8px;
25
+ border-top: 1px solid var(--token-color-border-primary);
26
+ }
27
+
28
+ .hds-filter-bar__actions__right {
29
+ margin-left: auto;
30
+ }
31
+
32
+ .hds-filter-bar__search {
33
+ --token-form-control-padding: 3px;
34
+ }
35
+
36
+ // FILTER BAR > DROPDOWN
37
+
38
+ .hds-filter-bar__dropdown .hds-dropdown__list,
39
+ .hds-filter-bar__dropdown .hds-dropdown-list-item {
40
+ padding: 0;
41
+ }
42
+
43
+ // FILTER BAR > TABS
44
+
45
+ .hds-filter-bar__tabs {
46
+ display: flex;
47
+ }
48
+
49
+ .hds-filter-bar__tabs__list {
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: 4px;
53
+ width: 50%;
54
+ padding: 8px;
55
+ list-style: none;
56
+ background-color: var(--token-color-surface-faint);
57
+ border-right: 1px solid var(--token-color-border-primary);
58
+ border-top-left-radius: var(--token-border-radius-medium);
59
+ }
60
+
61
+ .hds-filter-bar__tabs__tab__button {
62
+ display: flex;
63
+ gap: 16px;
64
+ align-items: center;
65
+ width: 100%;
66
+ padding: 8px 12px;
67
+ color: var(--token-color-foreground-primary);
68
+ text-align: left;
69
+ background-color: transparent;
70
+ border: none;
71
+ border-radius: var(--token-border-radius-small);
72
+
73
+ &.mock-hover,
74
+ &:hover {
75
+ background-color: var(--token-color-surface-interactive-hover);
76
+ cursor: pointer;
77
+ }
78
+
79
+ &.mock-active,
80
+ &:active {
81
+ background-color: var(--token-color-surface-interactive-active);
82
+ }
83
+ }
84
+
85
+ .hds-filter-bar__tabs__tab__text {
86
+ width: 100%;
87
+ }
88
+
89
+ .hds-filter-bar__tabs__tab--is-selected .hds-filter-bar__tabs__tab__button {
90
+ color: var(--token-color-foreground-action);
91
+ background-color: var(--token-color-surface-strong);
92
+
93
+ &.mock-hover,
94
+ &:hover {
95
+ background-color: var(--token-color-palette-neutral-200);
96
+ }
97
+
98
+ &.mock-active,
99
+ &:active {
100
+ background-color: var(--token-color-palette-neutral-300);
101
+ }
102
+ }
103
+
104
+ .hds-filter-bar__tabs__panel:not([hidden]) {
105
+ display: flex;
106
+ flex-direction: column;
107
+ gap: 8px;
108
+ width: 50%;
109
+ padding: 16px 0;
110
+ background-color: var(--token-color-surface-primary);
111
+ border-top-right-radius: var(--token-border-radius-medium);
112
+ }
113
+
114
+ // FILTER BAR > FILTER GROUP
115
+
116
+ .hds-filter-bar__filter-group .hds-form-field--layout-flag {
117
+ padding: 8px 12px;
118
+ }
119
+
120
+ .hds-filter-bar__filter-group__search {
121
+ padding: 0 16px 16px 16px;
122
+ border-bottom: 1px solid var(--token-color-border-primary);
123
+ }
124
+
125
+ .hds-filter-bar__filter-group__list {
126
+ display: flex;
127
+ flex-direction: column;
128
+ gap: 4px;
129
+ margin: 0;
130
+ padding: 0;
131
+ overflow-y: auto;
132
+ list-style: none;
133
+ overscroll-behavior: contain;
134
+ }
135
+
136
+ .hds-filter-bar__filter-group__fields {
137
+ padding: 0 16px;
138
+
139
+ .hds-filter-bar__filter-group__field,
140
+ .hds-filter-bar__filter-group__field[type="date"],
141
+ .hds-filter-bar__filter-group__field[type="time"] {
142
+ width: 100%;
143
+ }
144
+ }
145
+
146
+ .hds-filter-bar__filter-group__numerical,
147
+ .hds-filter-bar__filter-group__date {
148
+ display: flex;
149
+ flex-direction: column;
150
+ gap: 8px;
151
+ }
152
+
153
+ .hds-filter-bar__filter-group__selection-option {
154
+ display: block;
155
+ padding: 8px 16px;
156
+
157
+ &--hidden {
158
+ display: none;
159
+ }
160
+ }
161
+
162
+ .hds-filter-bar__filter-group__clear {
163
+ padding: 4px;
164
+ }
@@ -69,21 +69,13 @@
69
69
  }
70
70
 
71
71
  // Dropdown & Button color theming overrides
72
- .hds-side-nav__dropdown, // deprecated classname
73
- .hds-side-nav,
74
- .hds-side-nav-header {
72
+
73
+ .hds-side-nav {
75
74
  .hds-button,
76
- .hds-dropdown-toggle-button,
77
- .hds-dropdown-toggle-icon {
75
+ button[class*="hds-dropdown-toggle"] {
78
76
  // Apply dark theme to child interactive components not within a nested dropdown
79
- &:not(
80
- .hds-dropdown * *,
81
- .ember-basic-dropdown-trigger * *,
82
- .ember-basic-dropdown-content * *,
83
- .hds-dialog-primitive__wrapper *
84
- ) {
77
+ &:not(.hds-dropdown__content *, .ember-basic-dropdown-content *, .hds-dialog-primitive__wrapper *) {
85
78
  @include hds-interactive-dark-theme();
86
-
87
79
  // disabled state:
88
80
  &:disabled,
89
81
  &[disabled],
@@ -61,11 +61,14 @@ $hds-interactive-dark-theme-focus-ring-action-box-shadow:
61
61
  &.mock-focus {
62
62
  @include hds-focus-ring-with-pseudo-element($top: -1px, $right: -1px, $bottom: -1px, $left: -1px);
63
63
 
64
- color: var(--token-color-foreground-high-contrast);
65
- background-color: var(--token-color-palette-neutral-700);
64
+ // See: https://sass-lang.com/d/mixed-decls
65
+ & {
66
+ color: var(--token-color-foreground-high-contrast);
67
+ background-color: var(--token-color-palette-neutral-700);
66
68
 
67
- @if ($add-visible-border) {
68
- border-color: $hds-interactive-dark-theme-color-focus-action-internal;
69
+ @if ($add-visible-border) {
70
+ border-color: $hds-interactive-dark-theme-color-focus-action-internal;
71
+ }
69
72
  }
70
73
 
71
74
  // focus ring:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "5.0.0",
3
+ "version": "5.1.0-rc-20251125151324",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -219,6 +219,17 @@
219
219
  "./components/hds/dropdown/toggle/button.js": "./dist/_app_/components/hds/dropdown/toggle/button.js",
220
220
  "./components/hds/dropdown/toggle/chevron.js": "./dist/_app_/components/hds/dropdown/toggle/chevron.js",
221
221
  "./components/hds/dropdown/toggle/icon.js": "./dist/_app_/components/hds/dropdown/toggle/icon.js",
222
+ "./components/hds/filter-bar/dropdown.js": "./dist/_app_/components/hds/filter-bar/dropdown.js",
223
+ "./components/hds/filter-bar/filter-group/checkbox.js": "./dist/_app_/components/hds/filter-bar/filter-group/checkbox.js",
224
+ "./components/hds/filter-bar/filter-group/date.js": "./dist/_app_/components/hds/filter-bar/filter-group/date.js",
225
+ "./components/hds/filter-bar/filter-group/generic.js": "./dist/_app_/components/hds/filter-bar/filter-group/generic.js",
226
+ "./components/hds/filter-bar/filter-group.js": "./dist/_app_/components/hds/filter-bar/filter-group.js",
227
+ "./components/hds/filter-bar/filter-group/numerical.js": "./dist/_app_/components/hds/filter-bar/filter-group/numerical.js",
228
+ "./components/hds/filter-bar/filter-group/radio.js": "./dist/_app_/components/hds/filter-bar/filter-group/radio.js",
229
+ "./components/hds/filter-bar.js": "./dist/_app_/components/hds/filter-bar.js",
230
+ "./components/hds/filter-bar/tabs.js": "./dist/_app_/components/hds/filter-bar/tabs.js",
231
+ "./components/hds/filter-bar/tabs/panel.js": "./dist/_app_/components/hds/filter-bar/tabs/panel.js",
232
+ "./components/hds/filter-bar/tabs/tab.js": "./dist/_app_/components/hds/filter-bar/tabs/tab.js",
222
233
  "./components/hds/flyout.js": "./dist/_app_/components/hds/flyout.js",
223
234
  "./components/hds/form/character-count.js": "./dist/_app_/components/hds/form/character-count.js",
224
235
  "./components/hds/form/checkbox/base.js": "./dist/_app_/components/hds/form/checkbox/base.js",
@@ -1 +1,4 @@
1
1
  reordered-message: Moved {columnLabel} column to position {newPosition}
2
+ empty-state:
3
+ title: No data available
4
+ description: There is currently no data to display in the table.
@@ -0,0 +1,18 @@
1
+ date:
2
+ label: Date is
3
+ datetime:
4
+ label: Datetime is
5
+ time:
6
+ label: Time is
7
+ selector-input:
8
+ default-value: Pick a selector
9
+ before: Before
10
+ exactly: Exactly
11
+ after: After
12
+ between: Between
13
+ value-input:
14
+ placeholder: Enter a date
15
+ between-value-inputs:
16
+ start-placeholder: Start
17
+ end-placeholder: End
18
+ clear: Clear filter
@@ -0,0 +1,9 @@
1
+ search:
2
+ aria-label: Search filters
3
+ placeholder: Search
4
+ filter-text:
5
+ numerical-filter:
6
+ separator: and
7
+ date-filter:
8
+ separator: and
9
+ no-filters-applied: No filters applied
@@ -0,0 +1 @@
1
+ clear: Clear selection
@@ -0,0 +1,15 @@
1
+ label: Number is
2
+ selector-input:
3
+ default-value: Pick a selector
4
+ less-than: Less than (<)
5
+ less-than-or-equal-to: Less than or equal to (≤)
6
+ equal-to: Equal to (=)
7
+ greater-than-or-equal-to: Greater than or equal to (≥)
8
+ greater-than: Greater than (>)
9
+ between: Between
10
+ value-input:
11
+ placeholder: Enter a value
12
+ between-value-inputs:
13
+ start-placeholder: Start
14
+ end-placeholder: End
15
+ clear: Clear filter
@@ -0,0 +1 @@
1
+ search-input-placeholder: "Search"
@@ -0,0 +1,7 @@
1
+ apply: Apply filters
2
+ clear: Clear all filters
3
+ expand-collapse-button:
4
+ expand: Expand filters
5
+ collapse: Collapse filters
6
+ selected-filters: Filters selected
7
+ toggle-button: Filters