@hashicorp/design-system-components 2.6.0 → 2.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1421](https://github.com/hashicorp/design-system/pull/1421) [`b8a45d6e7`](https://github.com/hashicorp/design-system/commit/b8a45d6e7ade6e973b2a860444d80d9216e3ab5c) Thanks [@didoo](https://github.com/didoo)! - `Table` - Exposed the internal sorting properties and methods `setSortBy`, `sortBy` and `sortOrder`
8
+
9
+ - [#1377](https://github.com/hashicorp/design-system/pull/1377) [`437c253dd`](https://github.com/hashicorp/design-system/commit/437c253dd6106d616ed8f83c060adb12ac83acac) Thanks [@jorytindall](https://github.com/jorytindall)! - Adds `PageHeader` component
10
+
11
+ - [#1393](https://github.com/hashicorp/design-system/pull/1393) [`38fb21e60`](https://github.com/hashicorp/design-system/commit/38fb21e6091c739f621e967e23d4c8b2794c9575) Thanks [@alex-ju](https://github.com/alex-ju)! - Add `Separator` component
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1415](https://github.com/hashicorp/design-system/pull/1415) [`555c86d3f`](https://github.com/hashicorp/design-system/commit/555c86d3fde07109775a61523f7b26444fc9ee62) Thanks [@didoo](https://github.com/didoo)! - `Hds::Table` - Changed the way in which the column `@width` defined by the user is applied
16
+
17
+ - Updated dependencies []:
18
+ - @hashicorp/ember-flight-icons@3.0.5
19
+
3
20
  ## 2.6.0
4
21
 
5
22
  ### Minor Changes
@@ -0,0 +1,5 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <div class="hds-page-header__actions" ...attributes>{{yield}}</div>
@@ -0,0 +1,5 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <div class="hds-page-header__badges-wrapper" ...attributes>{{yield}}</div>
@@ -0,0 +1,5 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <p class="hds-foreground-primary hds-typography-body-200 hds-page-header__description" ...attributes>{{yield}}</p>
@@ -0,0 +1,28 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <header class="hds-page-header" ...attributes>
6
+ {{yield (hash Breadcrumb=(component "hds/yield"))}}
7
+ <div class="hds-page-header__body">
8
+ {{yield (hash IconTile=(component "hds/icon-tile" size="medium"))}}
9
+ <div class="hds-page-header__main">
10
+ <div class="hds-page-header__content">
11
+ <div class="hds-page-header__title-main">
12
+ {{yield (hash Title=(component "hds/page-header/title"))}}
13
+ {{yield (hash Badges=(component "hds/page-header/badges"))}}
14
+ </div>
15
+ <div class="hds-page-header__metadata">
16
+ {{yield
17
+ (hash
18
+ Subtitle=(component "hds/page-header/subtitle")
19
+ Description=(component "hds/page-header/description")
20
+ Generic=(component "hds/yield")
21
+ )
22
+ }}
23
+ </div>
24
+ </div>
25
+ {{yield (hash Actions=(component "hds/page-header/actions"))}}
26
+ </div>
27
+ </div>
28
+ </header>
@@ -0,0 +1,5 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <p class="hds-foreground-faint hds-typography-body-200 hds-page-header__subtitle" ...attributes>{{yield}}</p>
@@ -0,0 +1,5 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <h1 class="hds-foreground-strong hds-typography-display-500 hds-page-header__title" ...attributes>{{yield}}</h1>
@@ -0,0 +1,5 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <hr class={{this.classNames}} ...attributes />
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ import Component from '@glimmer/component';
7
+ import { assert } from '@ember/debug';
8
+
9
+ export const DEFAULT_SPACING = '24';
10
+ export const SPACING = ['24', '0'];
11
+
12
+ export default class HdsSeparatorIndexComponent extends Component {
13
+ /**
14
+ * Sets the margin for the separator
15
+ * Accepted values: 24, 0
16
+ *
17
+ * @param spacing
18
+ * @type {string}
19
+ * @default 'default'
20
+ */
21
+ get spacing() {
22
+ let { spacing = DEFAULT_SPACING } = this.args;
23
+
24
+ assert(
25
+ `@spacing for "Hds::Separator" must be one of the following: ${SPACING.join(
26
+ ', '
27
+ )}; received: ${spacing}`,
28
+ SPACING.includes(spacing)
29
+ );
30
+
31
+ return spacing;
32
+ }
33
+
34
+ /**
35
+ * Get the class names to apply to the component.
36
+ * @method classNames
37
+ * @return {string} The "class" attribute to apply to the component.
38
+ */
39
+ get classNames() {
40
+ let classes = ['hds-separator'];
41
+
42
+ // add a class based on the @spacing argument
43
+ classes.push(`hds-separator--spacing-${this.spacing}`);
44
+
45
+ return classes.join(' ');
46
+ }
47
+ }
@@ -28,7 +28,14 @@
28
28
  </Hds::Table::Tr>
29
29
  {{else}}
30
30
  {{yield
31
- (hash Tr=(component "hds/table/tr") Th=(component "hds/table/th") ThSort=(component "hds/table/th-sort"))
31
+ (hash
32
+ Tr=(component "hds/table/tr")
33
+ Th=(component "hds/table/th")
34
+ ThSort=(component "hds/table/th-sort")
35
+ sortBy=this.sortBy
36
+ sortOrder=this.sortOrder
37
+ setSortBy=this.setSortBy
38
+ )
32
39
  to="head"
33
40
  }}
34
41
  {{/if}}
@@ -57,6 +64,8 @@
57
64
  Tr=(component "hds/table/tr")
58
65
  Th=(component "hds/table/th" scope="row")
59
66
  Td=(component "hds/table/td" align=@align)
67
+ sortBy=this.sortBy
68
+ sortOrder=this.sortOrder
60
69
  )
61
70
  to="body"
62
71
  }}
@@ -2,7 +2,13 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <th class={{this.classNames}} aria-sort={{this.ariaSort}} {{style width=@width}} ...attributes scope="col">
5
+ <th
6
+ class={{this.classNames}}
7
+ aria-sort={{this.ariaSort}}
8
+ {{style width=@width minWidth=@width}}
9
+ ...attributes
10
+ scope="col"
11
+ >
6
12
  <button type="button" {{on "click" this.onClick}}>
7
13
  <div class="hds-table__th-sort--button-content">
8
14
  <span class="hds-typography-body-200 hds-font-weight-semibold">{{yield}}</span>
@@ -2,6 +2,6 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <th class={{this.classNames}} {{style width=@width}} ...attributes scope={{(or @scope "col")}}>
5
+ <th class={{this.classNames}} {{style width=@width minWidth=@width}} ...attributes scope={{(or @scope "col")}}>
6
6
  {{yield}}
7
7
  </th>
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/page-header/actions';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/page-header/badges';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/page-header/description';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/page-header/index';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/page-header/subtitle';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/page-header/title';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/separator/index';
@@ -31,9 +31,11 @@
31
31
  @use "../components/link"; // multiple components
32
32
  @use "../components/menu-primitive";
33
33
  @use "../components/modal";
34
+ @use "../components/page-header";
34
35
  @use "../components/pagination";
35
36
  @use "../components/reveal";
36
37
  @use "../components/segmented-group";
38
+ @use "../components/separator";
37
39
  @use "../components/side-nav";
38
40
  @use "../components/stepper";
39
41
  @use "../components/table";
@@ -51,8 +53,8 @@
51
53
  margin: -1px !important;
52
54
  padding: 0 !important;
53
55
  overflow: hidden !important;
54
- white-space: nowrap !important; /* 3 */
56
+ white-space: nowrap !important; /* 3 */
55
57
  border: 0 !important;
56
58
  clip: rect(1px, 1px, 1px, 1px) !important; /* 1 */
57
- clip-path: inset(50%) !important; /* 2 */
59
+ clip-path: inset(50%) !important; /* 2 */
58
60
  }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ //
7
+ // PAGEHEADER
8
+ //
9
+
10
+ .hds-page-header {
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 16px;
14
+ container-type: inline-size;
15
+ }
16
+
17
+ .hds-page-header__body {
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 8px 16px;
21
+
22
+ .hds-icon-tile {
23
+ flex-shrink: 0;
24
+ }
25
+
26
+ @container (min-width: 400px) {
27
+ flex-direction: row;
28
+ }
29
+ }
30
+
31
+ .hds-page-header__main {
32
+ display: flex;
33
+ flex-direction: column;
34
+ flex-grow: 1;
35
+ gap: 16px;
36
+ align-items: start;
37
+ justify-content: start;
38
+
39
+ @container (min-width: 768px) {
40
+ flex-direction: row;
41
+ justify-content: space-between;
42
+ }
43
+ }
44
+
45
+ .hds-page-header__content {
46
+ display: flex;
47
+ flex-direction: column;
48
+ flex-grow: 1;
49
+ gap: 8px;
50
+ }
51
+
52
+ .hds-page-header__title-main {
53
+ display: flex;
54
+ flex-direction: row;
55
+ flex-wrap: wrap;
56
+ gap: 8px 16px;
57
+ align-items: center;
58
+ }
59
+
60
+ .hds-page-header__badges-wrapper {
61
+ display: flex;
62
+ flex-wrap: wrap;
63
+ gap: 8px;
64
+ }
65
+
66
+ .hds-page-header__metadata {
67
+ display: flex;
68
+ flex-direction: column;
69
+ gap: 4px;
70
+ }
71
+
72
+ .hds-page-header__actions {
73
+ display: flex;
74
+ flex-direction: row;
75
+ flex-shrink: 0;
76
+ flex-wrap: wrap;
77
+ gap: 16px;
78
+ align-items: center;
79
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ //
7
+ // SEPARATOR
8
+ //
9
+
10
+ .hds-separator {
11
+ border: none;
12
+ border-top: 1px solid var(--token-color-border-primary);
13
+ }
14
+
15
+ .hds-separator--spacing-24 {
16
+ margin: 24px 0;
17
+ }
18
+
19
+ .hds-separator--spacing-0 {
20
+ margin: 0;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@ember/render-modifiers": "^2.0.5",
41
41
  "@hashicorp/design-system-tokens": "^1.5.0",
42
- "@hashicorp/ember-flight-icons": "^3.0.4",
42
+ "@hashicorp/ember-flight-icons": "^3.0.5",
43
43
  "dialog-polyfill": "^0.5.6",
44
44
  "ember-a11y-refocus": "^3.0.2",
45
45
  "ember-auto-import": "^2.6.0",