@hashicorp/design-system-components 2.0.0 → 2.2.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 +72 -20
- package/HOW-TO-TEST-A-COMPONENT-IN-CLOUD-UI.md +28 -3
- package/addon/components/hds/app-frame/index.hbs +24 -0
- package/addon/components/hds/app-frame/index.js +52 -0
- package/addon/components/hds/app-frame/parts/footer.hbs +7 -0
- package/addon/components/hds/{empty-state → app-frame/parts}/header.hbs +2 -2
- package/addon/components/hds/{empty-state/body.hbs → app-frame/parts/main.hbs} +2 -2
- package/addon/components/hds/app-frame/parts/modals.hbs +6 -0
- package/addon/components/hds/{empty-state/footer.hbs → app-frame/parts/sidebar.hbs} +2 -2
- package/addon/components/hds/application-state/body.hbs +13 -0
- package/addon/components/hds/application-state/footer.hbs +7 -0
- package/addon/components/hds/application-state/footer.js +35 -0
- package/addon/components/hds/application-state/header.hbs +20 -0
- package/addon/components/hds/application-state/index.hbs +13 -0
- package/addon/components/hds/dropdown/footer.hbs +5 -0
- package/addon/components/hds/dropdown/header.hbs +5 -0
- package/addon/components/hds/dropdown/index.hbs +2 -2
- package/addon/components/hds/dropdown/index.js +18 -2
- package/addon/components/hds/dropdown/list-item/checkbox.hbs +5 -0
- package/addon/components/hds/dropdown/list-item/checkbox.js +5 -0
- package/addon/components/hds/dropdown/list-item/checkmark.hbs +5 -0
- package/addon/components/hds/dropdown/list-item/checkmark.js +5 -0
- package/addon/components/hds/dropdown/list-item/radio.hbs +5 -0
- package/addon/components/hds/dropdown/list-item/radio.js +5 -0
- package/addon/components/hds/dropdown/toggle/chevron.hbs +5 -0
- package/addon/components/hds/flyout/footer.hbs +7 -0
- package/addon/components/hds/flyout/index.hbs +1 -0
- package/addon/components/hds/side-nav/base.hbs +14 -0
- package/addon/components/hds/side-nav/{home-link.js → header/home-link.js} +2 -2
- package/addon/components/hds/side-nav/{icon-button.hbs → header/icon-button.hbs} +1 -1
- package/addon/components/hds/side-nav/{icon-button.js → header/icon-button.js} +2 -2
- package/addon/components/hds/side-nav/{header.hbs → header/index.hbs} +2 -2
- package/addon/components/hds/side-nav/index.hbs +40 -0
- package/addon/components/hds/side-nav/index.js +107 -0
- package/addon/components/hds/side-nav/list/index.hbs +2 -0
- package/addon/components/hds/side-nav/portal/index.hbs +12 -0
- package/addon/components/hds/side-nav/portal/target.hbs +14 -0
- package/addon/components/hds/side-nav/portal/target.js +156 -0
- package/app/components/hds/{empty-state/body.js → app-frame/index.js} +1 -1
- package/app/components/hds/app-frame/parts/footer.js +6 -0
- package/app/components/hds/app-frame/parts/header.js +6 -0
- package/app/components/hds/{empty-state/footer.js → app-frame/parts/main.js} +1 -1
- package/app/components/hds/app-frame/parts/modals.js +6 -0
- package/app/components/hds/app-frame/parts/sidebar.js +6 -0
- package/app/components/hds/application-state/body.js +6 -0
- package/app/components/hds/application-state/footer.js +6 -0
- package/app/components/hds/application-state/header.js +6 -0
- package/app/components/hds/application-state/index.js +6 -0
- package/app/components/hds/dropdown/footer.js +5 -0
- package/app/components/hds/dropdown/header.js +5 -0
- package/app/components/hds/dropdown/list-item/checkbox.js +5 -0
- package/app/components/hds/dropdown/list-item/checkmark.js +5 -0
- package/app/components/hds/dropdown/list-item/radio.js +5 -0
- package/app/components/hds/{side-nav/wrapper.js → flyout/footer.js} +1 -1
- package/app/components/hds/side-nav/base.js +6 -0
- package/app/components/hds/side-nav/{home-link.js → header/home-link.js} +1 -1
- package/app/components/hds/side-nav/{icon-button.js → header/icon-button.js} +1 -1
- package/app/components/hds/{empty-state → side-nav}/index.js +1 -1
- package/app/components/hds/{empty-state/header.js → side-nav/portal/index.js} +1 -1
- package/app/components/hds/side-nav/portal/target.js +6 -0
- package/app/styles/@hashicorp/design-system-components.scss +2 -1
- package/app/styles/@hashicorp/design-system-power-select-overrides.scss +33 -3
- package/app/styles/components/app-frame.scss +60 -0
- package/app/styles/components/application-state.scss +55 -0
- package/app/styles/components/dropdown.scss +11 -0
- package/app/styles/components/flyout.scss +15 -1
- package/app/styles/components/form/checkbox.scss +1 -1
- package/app/styles/components/form/radio.scss +1 -1
- package/app/styles/components/form/text-input.scss +1 -1
- package/app/styles/components/form/textarea.scss +2 -1
- package/app/styles/components/side-nav/a11y-refocus.scss +30 -0
- package/app/styles/components/side-nav/content.scss +156 -0
- package/app/styles/components/side-nav/header.scss +102 -0
- package/app/styles/components/side-nav/index.scss +10 -0
- package/app/styles/components/side-nav/main.scss +202 -0
- package/app/styles/components/side-nav/vars.scss +36 -0
- package/blueprints/hds-component-test/files/tests/integration/components/hds/__name__/index-test.js +14 -11
- package/package.json +6 -4
- package/addon/components/hds/empty-state/index.hbs +0 -13
- package/addon/components/hds/side-nav/wrapper.hbs +0 -18
- package/app/styles/components/empty-state.scss +0 -37
- package/app/styles/components/side-nav.scss +0 -275
- /package/addon/components/hds/side-nav/{home-link.hbs → header/home-link.hbs} +0 -0
- /package/app/components/hds/side-nav/{header.js → header/index.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1284](https://github.com/hashicorp/design-system/pull/1284) [`050a2afa5`](https://github.com/hashicorp/design-system/commit/050a2afa5bd539e15ff21728bb6ac27ac2b90dc6) Thanks [@didoo](https://github.com/didoo)! - Added `AppFrame` component
|
|
8
|
+
|
|
9
|
+
- [#1321](https://github.com/hashicorp/design-system/pull/1321) [`6cb5f55b1`](https://github.com/hashicorp/design-system/commit/6cb5f55b1a47d9718960e17c68c7ad3b8bcad04c) Thanks [@didoo](https://github.com/didoo)! - Extracted `Hds::SideNav::Base` from the `Hds::SideNav` component
|
|
10
|
+
|
|
11
|
+
- [#1304](https://github.com/hashicorp/design-system/pull/1304) [`038d8306a`](https://github.com/hashicorp/design-system/commit/038d8306aee38711ba846e4d7272d237b93733e5) Thanks [@didoo](https://github.com/didoo)! - Extended the `Hds::SideNav` component to support responsiveness (animation/transition) and content portaling by adapting existing implementation for Cloud UI
|
|
12
|
+
|
|
13
|
+
- [#1315](https://github.com/hashicorp/design-system/pull/1315) [`e900dbcca`](https://github.com/hashicorp/design-system/commit/e900dbcca7df1592559245e2b2031d0b2a9ec617) Thanks [@didoo](https://github.com/didoo)! - Added a `@isInline` argument to the `Hds::Dropdown` component
|
|
14
|
+
|
|
15
|
+
- [#1309](https://github.com/hashicorp/design-system/pull/1309) [`ef7eeff66`](https://github.com/hashicorp/design-system/commit/ef7eeff66d1d9b81b53cf082085eb1fa636263ef) Thanks [@jorytindall](https://github.com/jorytindall)! - Add `Hds::Flyout::Footer` as generic block to `Hds::Flyout`
|
|
16
|
+
|
|
17
|
+
- [#1317](https://github.com/hashicorp/design-system/pull/1317) [`fa3a328a1`](https://github.com/hashicorp/design-system/commit/fa3a328a1806af8482bcedee002c8bc3232f3968) Thanks [@didoo](https://github.com/didoo)! - Changed order of "modal" container element in the DOM for the `AppFrame` component
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#1312](https://github.com/hashicorp/design-system/pull/1312) [`cd1527ef5`](https://github.com/hashicorp/design-system/commit/cd1527ef5de743e1fdf9b982bff7aa1bbc18ac54) Thanks [@alex-ju](https://github.com/alex-ju)! - Add `min-height` to `Hds::Textarea`
|
|
22
|
+
|
|
23
|
+
- [#1313](https://github.com/hashicorp/design-system/pull/1313) [`5a2f5778d`](https://github.com/hashicorp/design-system/commit/5a2f5778d5e1d57a7d0d080f01319492e1a5a8b7) Thanks [@didoo](https://github.com/didoo)! - Added design tokens for `SideNav` component
|
|
24
|
+
|
|
25
|
+
- [#1306](https://github.com/hashicorp/design-system/pull/1306) [`e993f6c42`](https://github.com/hashicorp/design-system/commit/e993f6c42a502f4d43cce2e1e7b1a7a8cfd90cdd) Thanks [@alex-ju](https://github.com/alex-ju)! - Fix `PowerSelectMultiple` style overrides when search is enabled
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`5a2f5778d`](https://github.com/hashicorp/design-system/commit/5a2f5778d5e1d57a7d0d080f01319492e1a5a8b7)]:
|
|
28
|
+
- @hashicorp/design-system-tokens@1.4.2
|
|
29
|
+
|
|
30
|
+
## 2.1.0
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- [#1258](https://github.com/hashicorp/design-system/pull/1258) [`3466d2279`](https://github.com/hashicorp/design-system/commit/3466d2279191504442029976a4e18d3ca99015bf) Thanks [@MelSumner](https://github.com/MelSumner)! - Adds Hds::ApplicationState component
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- [#1291](https://github.com/hashicorp/design-system/pull/1291) [`b2c21a86e`](https://github.com/hashicorp/design-system/commit/b2c21a86ee681d53e728fa5c52192b9003762ea9) Thanks [@didoo](https://github.com/didoo)! - Fixed missing inset shadow for `TextInput`, `Textarea`, `Checkbox`, `Radio`, `PowerSelect` overrides
|
|
39
|
+
|
|
3
40
|
## 2.0.0
|
|
4
41
|
|
|
5
42
|
### Major Changes
|
|
@@ -29,11 +66,22 @@
|
|
|
29
66
|
|
|
30
67
|
**Note:** If test assertions are relying on these class names, tests will fail. If extensions/overrides have been applied to these classes, they will suffer visual changes.
|
|
31
68
|
|
|
32
|
-
### Minor Changes
|
|
33
|
-
|
|
34
69
|
- [#1266](https://github.com/hashicorp/design-system/pull/1266) [`082842b59`](https://github.com/hashicorp/design-system/commit/082842b59321f843c4955e4cdaf2ce2674a8913d) Thanks [@alex-ju](https://github.com/alex-ju)! - Add `@icon`, `@count`, `@badge` and `@badgeCount` to `Dropdown::Toggle::Button`
|
|
35
70
|
|
|
36
|
-
|
|
71
|
+
`Hds::Dropdown::Toggle::Button` and `Hds::Dropdown::Toggle::Icon` now share the chevron element. As a result, we renamed internal CSS classes as follows:
|
|
72
|
+
|
|
73
|
+
- `hds-button__text` → `hds-dropdown-toggle-button__text`
|
|
74
|
+
- `hds-button__icon` → `hds-dropdown-toggle-chevron`
|
|
75
|
+
|
|
76
|
+
The icon element within `Hds::Dropdown::Toggle::Icon` no longer has the `hds-dropdown-toggle-icon__chevron` class and it's currently wrapped in the `hds-dropdown-toggle-chevron` container, similar to `Hds::Dropdown::Toggle::Button`.
|
|
77
|
+
|
|
78
|
+
The `Hds::Dropdown::Toggle::Icon` now has a solid border, for consistency with `Hds::Dropdown::Toggle::Button` and the secondary style of `Hds::Button`.
|
|
79
|
+
|
|
80
|
+
**Note:** If test assertions are relying on these class names, tests will fail. If extensions/overrides have been applied to these classes, they will suffer visual changes.
|
|
81
|
+
|
|
82
|
+
### Minor Changes
|
|
83
|
+
|
|
84
|
+
- [#1276](https://github.com/hashicorp/design-system/pull/1276) [`5ad29412d`](https://github.com/hashicorp/design-system/commit/5ad29412d2edc0cc4265d3c0bbbf388e821f1cc7) Thanks [@alex-ju](https://github.com/alex-ju)! - Allow small `@size` on `Dropdown::Toggle::Icon`
|
|
37
85
|
|
|
38
86
|
- [#1262](https://github.com/hashicorp/design-system/pull/1262) [`3eb78b8de`](https://github.com/hashicorp/design-system/commit/3eb78b8de7c678cff977c9d3a677c47a3216caad) Thanks [@alex-ju](https://github.com/alex-ju)! - Add new `@listPositions` for `Dropdown` as follows:
|
|
39
87
|
|
|
@@ -426,32 +474,34 @@ This release signifies the first major release of the HashiCorp Design System. M
|
|
|
426
474
|
|
|
427
475
|
### Minor Changes (Some Breaking)
|
|
428
476
|
|
|
429
|
-
- [#217](https://github.com/hashicorp/design-system/pull/217) [`210edd17`](https://github.com/hashicorp/design-system/commit/210edd17431e6e3097260aed0df5a8902f93b7f7) Thanks [@didoo](https://github.com/didoo)!
|
|
477
|
+
- [#217](https://github.com/hashicorp/design-system/pull/217) [`210edd17`](https://github.com/hashicorp/design-system/commit/210edd17431e6e3097260aed0df5a8902f93b7f7) Thanks [@didoo](https://github.com/didoo)!
|
|
478
|
+
|
|
479
|
+
#### Interactive
|
|
430
480
|
|
|
431
|
-
|
|
481
|
+
- Introduced `<Hds::Interactive>` (a generic, "utility" component used internally by all the interactive elements like buttons and links)
|
|
432
482
|
|
|
433
|
-
|
|
483
|
+
#### Button
|
|
434
484
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
485
|
+
- updated the button API to handle also links as `<a>`/`<LinkTo/LinkToExternal>`
|
|
486
|
+
- it can be used in place of the `<Hds::Link/LinkTo::CTA>` component (see below)
|
|
487
|
+
- when the button is a link - the text is underlined for differentiation with a normal button - ⚠️ **Visual change!** - the button responds to `space` key event
|
|
488
|
+
- removed the `@type` argument from the API in favour of the `type` native attribute - 🚨 **Breaking change!**
|
|
439
489
|
|
|
440
|
-
|
|
490
|
+
#### Link/LinkTo::CTA
|
|
441
491
|
|
|
442
|
-
|
|
492
|
+
- removed the `<Hds::Link/LinkTo::CTA>` component, in favour of `<Hds::Button>` component (see above) - 🚨 **Breaking change!**
|
|
443
493
|
|
|
444
|
-
|
|
494
|
+
#### Link::Inline
|
|
445
495
|
|
|
446
|
-
|
|
496
|
+
- added the `<Hds::Link::Inline>` component (with API very similar to the `<Hds::Link::Standalone>`)
|
|
447
497
|
|
|
448
|
-
|
|
498
|
+
#### Dropdown
|
|
449
499
|
|
|
450
|
-
|
|
500
|
+
- Updated the `Dropdown::ListItem::Interactive` to use the new `<Hds::Interactive>` component
|
|
451
501
|
|
|
452
|
-
|
|
502
|
+
#### Alert/Toast components
|
|
453
503
|
|
|
454
|
-
|
|
504
|
+
- Removed the `<LinkTo::Standalone>` action (now you can use directly `<Link::Standalone>`)
|
|
455
505
|
|
|
456
506
|
## 0.11.2
|
|
457
507
|
|
|
@@ -471,9 +521,11 @@ This release signifies the first major release of the HashiCorp Design System. M
|
|
|
471
521
|
|
|
472
522
|
### Minor Changes (Some Breaking)
|
|
473
523
|
|
|
474
|
-
- [#245](https://github.com/hashicorp/design-system/pull/245) [`c6de1018`](https://github.com/hashicorp/design-system/commit/c6de101880ec1c21971e3775e1a21b6cb9e69757) Thanks [@didoo](https://github.com/didoo)!
|
|
524
|
+
- [#245](https://github.com/hashicorp/design-system/pull/245) [`c6de1018`](https://github.com/hashicorp/design-system/commit/c6de101880ec1c21971e3775e1a21b6cb9e69757) Thanks [@didoo](https://github.com/didoo)!
|
|
525
|
+
- Added `Alert` component
|
|
475
526
|
- Added `Toast` component
|
|
476
|
-
- [#259](https://github.com/hashicorp/design-system/pull/259) [`478b3069`](https://github.com/hashicorp/design-system/commit/478b3069e800cf2ccefba9b5475c72b024e25d16) Thanks [@didoo](https://github.com/didoo)!
|
|
527
|
+
- [#259](https://github.com/hashicorp/design-system/pull/259) [`478b3069`](https://github.com/hashicorp/design-system/commit/478b3069e800cf2ccefba9b5475c72b024e25d16) Thanks [@didoo](https://github.com/didoo)!
|
|
528
|
+
- removed autofocus on first item for `Disclosure` component (and as a result also for `Breadcrumb` and `Dropdown` components) (🚨 Breaking)
|
|
477
529
|
- updated focus state treatment for `Dropdown` component (🚨 Breaking)
|
|
478
530
|
|
|
479
531
|
### Patch Changes
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# How to test a component in Cloud UI
|
|
2
2
|
|
|
3
|
-
To test a
|
|
3
|
+
To test a component that is under development (or because it’s new or has been modified) you have a few options:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- you can use your local environment as source for the `@hashicorp/design-system-components` package
|
|
6
|
+
- you can install the `@hashicorp/design-system-components` package using a branch available on GitHub
|
|
7
|
+
|
|
8
|
+
This is the case when the component has not yet been released as an npm package, of course.
|
|
9
|
+
|
|
10
|
+
## Using your local environment (via symlink)
|
|
11
|
+
|
|
12
|
+
This approach is the preferable one, if there is an ongoing development of the component and you want to see the changes reflected immediately in the application (automatically rebuilt/refreshed whenever you save the HDS files).
|
|
13
|
+
|
|
14
|
+
### Prepare the Cloud UI project
|
|
6
15
|
|
|
7
16
|
For simplicity, you will need three CLI/terminal windows/tabs opened.
|
|
8
17
|
|
|
@@ -13,7 +22,7 @@ In in the first terminal window go the folder containing your local version of t
|
|
|
13
22
|
- run `rm -fr node_modules/` to start from a blank slate
|
|
14
23
|
- run `yarn` to make sure all the packages are installed
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
### Replace the installed `@hashicorp/design-system-components` package in Cloud UI with the local one
|
|
17
26
|
|
|
18
27
|
In the second terminal window:
|
|
19
28
|
|
|
@@ -52,3 +61,19 @@ Everything should work and you should be able to do whatever you need to do in t
|
|
|
52
61
|
- run `rm design-system-components` (no need for the `-fr` option, it's a symlink file not a folder)
|
|
53
62
|
- go to the root of the Cloud UI project
|
|
54
63
|
- run `yarn` to reinstall all the missing packages (including `@hashicorp/design-system-components` from NPM)
|
|
64
|
+
|
|
65
|
+
## Using a remote branch (via GitHub)
|
|
66
|
+
|
|
67
|
+
This approach is more suitable for one-off testing before releasing a package, less so for ongoing development.
|
|
68
|
+
|
|
69
|
+
### Override the package resolution in the `package.json` file in the root
|
|
70
|
+
|
|
71
|
+
You can override every dependency declared in the engines' `package.json` files with a single entry in the `package.json` file in the root of the project folder, by adding this line to the `"resolutions"` block:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
"@hashicorp/design-system-components": "https://github.com/hashicorp/design-system#head=BRANCH-NAME&workspace=@hashicorp/design-system-components"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Once done run `yarn install` to use the "remote" version of the package, update the `node_modules` and the `yarn.lock` file.
|
|
78
|
+
|
|
79
|
+
**IMPORTANT**: the way in which yarn works in this case is that it resolves in a hash referencing a commit in `yarn.lock`; so if you make changes to the branch, they’re not reflected in the local `node_modules` unless you change the hash manually in the `yarn.lock` to point to another commit, and re-run the `yarn install` command.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
<div class="hds-app-frame" ...attributes>
|
|
6
|
+
{{#if this.hasHeader}}
|
|
7
|
+
{{yield (hash Header=(component "hds/app-frame/parts/header"))}}
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if this.hasSidebar}}
|
|
10
|
+
{{yield (hash Sidebar=(component "hds/app-frame/parts/sidebar"))}}
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{!
|
|
13
|
+
IMPORTANT: since the modals may be injected via portal or `in-element` with code that lives in the "main" container,
|
|
14
|
+
the "modal" container needs to be present in the DOM _before_ the "main" block, otherwise it may cause errors
|
|
15
|
+
where the target DOM element is not found (for example in tests where the modal may be immediately opened on first render).
|
|
16
|
+
}}
|
|
17
|
+
{{#if this.hasModals}}
|
|
18
|
+
{{yield (hash Modals=(component "hds/app-frame/parts/modals"))}}
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{yield (hash Main=(component "hds/app-frame/parts/main"))}}
|
|
21
|
+
{{#if this.hasFooter}}
|
|
22
|
+
{{yield (hash Footer=(component "hds/app-frame/parts/footer"))}}
|
|
23
|
+
{{/if}}
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
|
|
8
|
+
export default class HdsAppFrameIndexComponent extends Component {
|
|
9
|
+
/**
|
|
10
|
+
* Indicates if the "header" container should be displayed
|
|
11
|
+
*
|
|
12
|
+
* @param hasHeader
|
|
13
|
+
* @type {boolean}
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
get hasHeader() {
|
|
17
|
+
return this.args.hasHeader ?? true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Indicates if the "sidebar" container should be displayed
|
|
22
|
+
*
|
|
23
|
+
* @param hasSidebar
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
get hasSidebar() {
|
|
28
|
+
return this.args.hasSidebar ?? true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Indicates if the "footer" container should be displayed
|
|
33
|
+
*
|
|
34
|
+
* @param hasFooter
|
|
35
|
+
* @type {boolean}
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
get hasFooter() {
|
|
39
|
+
return this.args.hasFooter ?? true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Indicates if the "modals" container should be displayed
|
|
44
|
+
*
|
|
45
|
+
* @param hasModals
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
get hasModals() {
|
|
50
|
+
return this.args.hasModals ?? true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
<div class="hds-application-state__body" ...attributes>
|
|
6
|
+
{{#if (has-block)}}
|
|
7
|
+
{{yield}}
|
|
8
|
+
{{else}}
|
|
9
|
+
<p class="hds-application-state__body-text hds-typography-body-300">
|
|
10
|
+
{{@text}}
|
|
11
|
+
</p>
|
|
12
|
+
{{/if}}
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
|
|
8
|
+
export default class HdsApplicationStateFooterComponent extends Component {
|
|
9
|
+
/**
|
|
10
|
+
* Indicate if the footer should have a top border or not.
|
|
11
|
+
*
|
|
12
|
+
* @param hasDivider
|
|
13
|
+
* @type {boolean}
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
get hasDivider() {
|
|
17
|
+
return this.args.hasDivider || false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get the class names to apply to the component.
|
|
22
|
+
* @method classNames
|
|
23
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
24
|
+
*/
|
|
25
|
+
get classNames() {
|
|
26
|
+
let classes = ['hds-application-state__footer'];
|
|
27
|
+
|
|
28
|
+
// add a class based on the existence of @hasDivider argument
|
|
29
|
+
if (this.hasDivider) {
|
|
30
|
+
classes.push(`hds-application-state__footer--has-divider`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return classes.join(' ');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
<div class="hds-application-state__header" ...attributes>
|
|
6
|
+
{{#if @icon}}
|
|
7
|
+
<div class="hds-application-state__icon">
|
|
8
|
+
<FlightIcon @name={{@icon}} @size="24" />
|
|
9
|
+
</div>
|
|
10
|
+
{{/if}}
|
|
11
|
+
<div class="hds-application-state__title hds-typography-display-400 hds-font-weight-semibold">
|
|
12
|
+
{{@title}}
|
|
13
|
+
</div>
|
|
14
|
+
{{#if @errorCode}}
|
|
15
|
+
<div class="hds-application-state__error-code hds-typography-body-100 hds-font-weight-medium">
|
|
16
|
+
Error
|
|
17
|
+
{{@errorCode}}
|
|
18
|
+
</div>
|
|
19
|
+
{{/if}}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
<div class="hds-application-state" ...attributes>
|
|
6
|
+
{{yield
|
|
7
|
+
(hash
|
|
8
|
+
Header=(component "hds/application-state/header")
|
|
9
|
+
Body=(component "hds/application-state/body")
|
|
10
|
+
Footer=(component "hds/application-state/footer")
|
|
11
|
+
)
|
|
12
|
+
}}
|
|
13
|
+
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Copyright (c) HashiCorp, Inc.
|
|
3
3
|
SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
}}
|
|
5
|
-
<Hds::Disclosure class=
|
|
5
|
+
<Hds::Disclosure class={{this.classNames}} @onClose={{@onClose}} ...attributes>
|
|
6
6
|
<:toggle as |t|>
|
|
7
7
|
{{yield
|
|
8
8
|
(hash
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}}
|
|
13
13
|
</:toggle>
|
|
14
14
|
<:content as |c|>
|
|
15
|
-
<div class={{this.
|
|
15
|
+
<div class={{this.classNamesContent}} {{style width=@width height=@height}}>
|
|
16
16
|
{{yield (hash Header=(component "hds/dropdown/header"))}}
|
|
17
17
|
<ul class="hds-dropdown__list" {{did-insert this.didInsertList}}>
|
|
18
18
|
{{yield
|
|
@@ -39,11 +39,27 @@ export default class HdsDropdownIndexComponent extends Component {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Get the class names to apply to the
|
|
42
|
+
* Get the class names to apply to the element
|
|
43
43
|
* @method classNames
|
|
44
|
-
* @return {string} The "class" attribute to apply to the
|
|
44
|
+
* @return {string} The "class" attribute to apply to the root element
|
|
45
45
|
*/
|
|
46
46
|
get classNames() {
|
|
47
|
+
let classes = ['hds-dropdown'];
|
|
48
|
+
|
|
49
|
+
// add a class based on the @isInline argument
|
|
50
|
+
if (this.args.isInline) {
|
|
51
|
+
classes.push('hds-dropdown--is-inline');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return classes.join(' ');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get the class names to apply to the content
|
|
59
|
+
* @method classNamesContent
|
|
60
|
+
* @return {string} The "class" attribute to apply to the disclosed content
|
|
61
|
+
*/
|
|
62
|
+
get classNamesContent() {
|
|
47
63
|
let classes = ['hds-dropdown__content'];
|
|
48
64
|
|
|
49
65
|
// add a class based on the @listPosition argument
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
1
6
|
<li class="hds-dropdown-list-item hds-dropdown-list-item--variant-checkbox">
|
|
2
7
|
<Hds::Form::Checkbox::Base class="hds-dropdown-list-item__control" id={{this.id}} @value={{@value}} ...attributes />
|
|
3
8
|
{{#if @icon}}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
1
6
|
<li class="hds-dropdown-list-item hds-dropdown-list-item--variant-radio">
|
|
2
7
|
<Hds::Form::Radio::Base class="hds-dropdown-list-item__control" id={{this.id}} @value={{@value}} ...attributes />
|
|
3
8
|
{{#if @icon}}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
{{yield (hash Header=(component "hds/flyout/header" id=this.id onDismiss=this.onDismiss))}}
|
|
13
13
|
{{yield (hash Description=(component "hds/flyout/description"))}}
|
|
14
14
|
{{yield (hash Body=(component "hds/flyout/body"))}}
|
|
15
|
+
{{yield (hash Footer=(component "hds/flyout/footer" onDismiss=this.onDismiss))}}
|
|
15
16
|
</dialog>
|
|
16
17
|
{{#if this.isOpen}}
|
|
17
18
|
<div class="hds-flyout__overlay"></div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="hds-side-nav" ...attributes>
|
|
2
|
+
<div class="hds-side-nav__wrapper">
|
|
3
|
+
{{yield to="root"}}
|
|
4
|
+
<div class="hds-side-nav__wrapper-header">
|
|
5
|
+
{{yield to="header"}}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="hds-side-nav__wrapper-body">
|
|
8
|
+
{{yield to="body"}}
|
|
9
|
+
</div>
|
|
10
|
+
<div class="hds-side-nav__wrapper-footer">
|
|
11
|
+
{{yield to="footer"}}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import Component from '@glimmer/component';
|
|
7
7
|
import { assert } from '@ember/debug';
|
|
8
8
|
|
|
9
|
-
export default class
|
|
9
|
+
export default class HdsSideNavHeaderHomeLinkComponent extends Component {
|
|
10
10
|
/**
|
|
11
11
|
* @param ariaLabel
|
|
12
12
|
* @type {string}
|
|
@@ -16,7 +16,7 @@ export default class HdsSideNavHomeLinkComponent extends Component {
|
|
|
16
16
|
let { ariaLabel } = this.args;
|
|
17
17
|
|
|
18
18
|
assert(
|
|
19
|
-
'@ariaLabel for "Hds::SideNav::HomeLink" must have a valid value',
|
|
19
|
+
'@ariaLabel for "Hds::SideNav::Header::HomeLink" ("Logo") must have a valid value',
|
|
20
20
|
ariaLabel !== undefined
|
|
21
21
|
);
|
|
22
22
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import Component from '@glimmer/component';
|
|
7
7
|
import { assert } from '@ember/debug';
|
|
8
8
|
|
|
9
|
-
export default class
|
|
9
|
+
export default class HdsSideNavHeaderIconButtonComponent extends Component {
|
|
10
10
|
/**
|
|
11
11
|
* @param ariaLabel
|
|
12
12
|
* @type {string}
|
|
@@ -16,7 +16,7 @@ export default class HdsSideNavIconButtonComponent extends Component {
|
|
|
16
16
|
let { ariaLabel } = this.args;
|
|
17
17
|
|
|
18
18
|
assert(
|
|
19
|
-
'@ariaLabel for "Hds::SideNav::IconButton" must have a valid value',
|
|
19
|
+
'@ariaLabel for "Hds::SideNav::Header::IconButton" must have a valid value',
|
|
20
20
|
ariaLabel !== undefined
|
|
21
21
|
);
|
|
22
22
|
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
}}
|
|
5
5
|
|
|
6
6
|
<div class="hds-side-nav-header" ...attributes>
|
|
7
|
-
<div class="hds-side-nav-header__logo">
|
|
7
|
+
<div class="hds-side-nav-header__logo-container">
|
|
8
8
|
{{yield to="logo"}}
|
|
9
9
|
</div>
|
|
10
|
-
<div class="hds-side-nav-header__actions">
|
|
10
|
+
<div class="hds-side-nav-header__actions-container hds-side-nav-hide-when-minimized">
|
|
11
11
|
{{yield to="actions"}}
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|