@hashicorp/design-system-components 3.0.2 → 3.1.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 +51 -0
- package/NEW-COMPONENT-CHECKLIST.md +70 -51
- package/addon/components/hds/breadcrumb/item.hbs +33 -13
- package/addon/components/hds/button/index.ts +1 -1
- package/addon/components/hds/code-block/copy-button.hbs +13 -0
- package/addon/components/hds/code-block/description.hbs +8 -0
- package/addon/components/hds/code-block/index.hbs +30 -0
- package/addon/components/hds/code-block/index.js +162 -0
- package/addon/components/hds/code-block/title.hbs +8 -0
- package/app/components/hds/code-block/copy-button.js +6 -0
- package/app/components/hds/code-block/description.js +6 -0
- package/app/components/hds/code-block/index.js +6 -0
- package/app/components/hds/code-block/title.js +6 -0
- package/app/styles/@hashicorp/design-system-components.scss +1 -0
- package/app/styles/components/code-block/index.scss +249 -0
- package/app/styles/components/code-block/theme.scss +159 -0
- package/package.json +48 -64
- package/tsconfig.declarations.json +10 -0
- package/tsconfig.json +1 -0
- package/types/dummy/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 3.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
`CodeBlock` - Added new component
|
|
8
|
+
|
|
9
|
+
<small>[#1687](https://github.com/hashicorp/design-system/pull/1687)</small>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
Upgraded the following dependencies:
|
|
16
|
+
|
|
17
|
+
- `@ember/test-waiters` from `3.0.2` to `3.1.0`
|
|
18
|
+
- `ember-cli-htmlbars` from `6.2.0` to `6.3.0`
|
|
19
|
+
- `ember-focus-trap` from `1.0.2` to `1.1.0`
|
|
20
|
+
- `ember-keyboard` from `8.2.0` to `8.2.1`
|
|
21
|
+
- `sass` from `1.62.1` to `1.69.5`
|
|
22
|
+
|
|
23
|
+
<small>[#1756](https://github.com/hashicorp/design-system/pull/1756)</small>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
`Breadcrumb` - Added support for external links
|
|
28
|
+
|
|
29
|
+
<small>[#1774](https://github.com/hashicorp/design-system/pull/1774)</small>
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
Upgraded the following dependencies:
|
|
34
|
+
|
|
35
|
+
- `ember-cached-decorator-polyfill` from `0.1.4` to `1.0.2`
|
|
36
|
+
- `ember-cli-babel` from `7.26.11` to `8.2.0`
|
|
37
|
+
- `ember-cli-sass` from `10.0.1` to `11.0.1`
|
|
38
|
+
- `ember-composable-helpers` from `4.5.0` to `5.0.0`
|
|
39
|
+
|
|
40
|
+
<small>[#1761](https://github.com/hashicorp/design-system/pull/1761)</small>
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
`Button` - Fixed `HdsInteractiveSignature` type import
|
|
45
|
+
|
|
46
|
+
<small>[#1769](https://github.com/hashicorp/design-system/pull/1769)</small>
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
**🔄 Updated dependencies:**
|
|
51
|
+
|
|
52
|
+
- @hashicorp/ember-flight-icons@4.0.2
|
|
53
|
+
|
|
3
54
|
## 3.0.2
|
|
4
55
|
|
|
5
56
|
### Patch Changes
|
|
@@ -1,70 +1,89 @@
|
|
|
1
1
|
# New Component Checklist
|
|
2
2
|
|
|
3
|
-
This is the
|
|
3
|
+
This is the checklist the HDS team uses for any new component project. All new components will have their own feature branch, and any PR that adds an item from the checklist should target the feature branch, and not `main`.
|
|
4
4
|
|
|
5
5
|
## Pre-Flight Checklist
|
|
6
|
-
Update this list and these links as appropriate.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
- [Component Requirement Document (CRD)](https://docs.google.com/document/d/1kGcdfnb_z5tVUUvkSJGQPOssNd1yl2SVyd7bqk1KXII/): This file should exist before any design explorations or code is written.
|
|
10
|
-
- ["System of Systems" Storybook](https://unofficial-design-system-search.vercel.app) (storybook of storybooks): use for reference, to consider existing features that we might need to replicate in the component.
|
|
7
|
+
The following should be available as resources for the Project Kickoff.
|
|
11
8
|
|
|
9
|
+
- [Component Audit](https://www.figma.com/file/wPDhYo23Rk5WDZ5lHC04W3/Component-Audits-FY24?type=design&t=yWY94cHxIGiat5L7-6): This audit is performed by HDS Ambassadors and should be **complete** before the kickoff.
|
|
10
|
+
- [Component Requirement Document (CRD)](https://docs.google.com/document/d/1kGcdfnb_z5tVUUvkSJGQPOssNd1yl2SVyd7bqk1KXII/): This file should be started before the kickoff and include an early estimate of scope and any open questions that need to be answered during the kickoff.
|
|
11
|
+
|
|
12
|
+
## Project Kickoff
|
|
13
|
+
|
|
14
|
+
A project kickoff will be scheduled before the project start date. The kickoff will be used to align on project scope, timelines, and milestones and as a space to discuss any open questions. In attendance should be Design System team leadership, lead Designer and Engineer on the project, and Design/Engineer buddies (if applicable).
|
|
12
15
|
|
|
13
16
|
## Design Checklist
|
|
14
|
-
The design checklist has
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
+
The design checklist has 4 primary parts:
|
|
18
|
+
1. component design
|
|
19
|
+
2. testing
|
|
17
20
|
3. documentation
|
|
18
|
-
4. release
|
|
19
|
-
5. testing
|
|
21
|
+
4. final release
|
|
20
22
|
|
|
21
|
-
The design process is largely cyclical, so some
|
|
23
|
+
The design process is largely cyclical, so some steps may be repeated until final approval.
|
|
22
24
|
|
|
23
|
-
### Component
|
|
25
|
+
### Component Design
|
|
24
26
|
- [ ] [create a branch](https://help.figma.com/hc/en-us/articles/360063144053-Create-branches-and-merge-changes#Create_a_branch) in the [product components ui kit](https://www.figma.com/file/noyY6dUMDYjmySpHcMjhkN/HDS-Product---Components)
|
|
25
27
|
- [ ] add a new page for the component, as needed
|
|
26
|
-
- [ ] copy & paste the [
|
|
27
|
-
- [ ]
|
|
28
|
-
- [ ]
|
|
28
|
+
- [ ] copy & paste the [new component template](https://www.figma.com/file/noyY6dUMDYjmySpHcMjhkN/HDS-Product---Components?type=design&node-id=46856-287&mode=design&t=V4zCk5Jv07PcHYzZ-4) to the new page
|
|
29
|
+
- [ ] set the position of this frame to 0, 0
|
|
30
|
+
- [ ] update the status badge in the banner to "In progress"
|
|
29
31
|
- [ ] change "{Component name}" to the name of the component
|
|
30
|
-
- [ ] delete the
|
|
31
|
-
- [ ]
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
- [ ]
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
- [ ] delete the figma tips frame, if not needed
|
|
33
|
+
- [ ] design and build the component, taking into account existing [foundations](https://www.figma.com/file/oQsMzMMnynfPWpMEt91OpH/HDS-Product---Foundations?node-id=2916%3A4) and patterns, as well as the findings from the audit and requirements from the CRD
|
|
34
|
+
- artifacts should include:
|
|
35
|
+
- component explorations
|
|
36
|
+
- examples in context
|
|
37
|
+
- built component
|
|
38
|
+
- [ ] review with situationally appropriate stakeholders and iterate
|
|
39
|
+
- reviewers should include:
|
|
40
|
+
- HDS designers and manager
|
|
41
|
+
- engineering partner(s)
|
|
42
|
+
- a11y SME
|
|
43
|
+
- other external stakeholders as defined during the kickoff
|
|
44
|
+
- consider also including the design ambassadors
|
|
45
|
+
- reviews should include checks for:
|
|
46
|
+
- alignment to Helios design vision
|
|
47
|
+
- ux solution
|
|
48
|
+
- fulfillment of requirements from the audit and CRD
|
|
49
|
+
- a11y conformance
|
|
50
|
+
- alignment to code API
|
|
51
|
+
- consistent naming conventions
|
|
52
|
+
- token usage
|
|
53
|
+
- [ ] have HDS designers test the component and iterate, as necessary
|
|
54
|
+
- [ ] add a variety of examples to the stickersheet
|
|
55
|
+
- make sure the component instances can be easily selected and other layers are locked
|
|
56
|
+
- [ ] add any necessary figma tips
|
|
57
|
+
- [ ] request a final branch review from HDS designers
|
|
58
|
+
- [ ] sync with your engineering partner
|
|
59
|
+
- let them know it's been approved and answer any remaining questions
|
|
60
|
+
|
|
61
|
+
### Component Testing
|
|
62
|
+
- [ ] prepare for testing
|
|
63
|
+
- [ ] lock the components
|
|
64
|
+
- [ ] change the badge in the banner to "Experimental"
|
|
56
65
|
- [ ] merge the branch
|
|
57
|
-
- [ ] publish the
|
|
58
|
-
- Important: do not communicate this release to consumers yet
|
|
59
|
-
- [ ]
|
|
60
|
-
- [ ] add a new page to the [playground](https://www.figma.com/file/95YqaJF4TNV72ucXbyC7A0/Playground?node-id=302%3A10) file and prepare a frame for each ambassador to test
|
|
66
|
+
- [ ] publish the component
|
|
67
|
+
- Important: do not communicate this release to consumers yet (this will be done later in the process)
|
|
68
|
+
- [ ] add a new page to the [playground](https://www.figma.com/file/JnkAC69NeUX83Pug32o7Mr/%F0%9F%AA%81-Playground-FY24?type=design&node-id=302-10&mode=design&t=Ov4rEelxWK7rxLdI-0) file and prepare a frame for each ambassador
|
|
61
69
|
- provide a variety (basic to complex) of screenshots to recreate based on real world examples from the audit
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
- [ ]
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
- [ ] ask ambassadors to test the component
|
|
71
|
+
- depending on the complexity, we usually give them 3-4 days to complete the testing
|
|
72
|
+
- [ ] if iterations are needed, work through the process until approved (don't forget to branch!)
|
|
73
|
+
|
|
74
|
+
### Documentation
|
|
75
|
+
- [ ] while the component is being tested, write the documentation
|
|
76
|
+
- artifacts should include:
|
|
77
|
+
- design guidelines
|
|
78
|
+
- specifications
|
|
79
|
+
- relevant accessibility details
|
|
80
|
+
|
|
81
|
+
### Release in Figma
|
|
82
|
+
Once ambassadors have tested the component and iterations are approved, prepare for a final release of the component.
|
|
83
|
+
|
|
84
|
+
- [ ] add a changelog entry to [CHANGELOG-FIGMA-COMPONENTS.md](https://github.com/hashicorp/design-system/blob/main/packages/components/CHANGELOG-FIGMA-COMPONENTS.md)
|
|
85
|
+
- [ ] if changes were made, publish the component
|
|
86
|
+
- [ ] once the code has been released, communicate the release in the slack channel [#team-design-systems](https://hashicorp.slack.com/archives/C7KTUHNUS)
|
|
68
87
|
|
|
69
88
|
|
|
70
89
|
## Engineering Checklist
|
|
@@ -13,18 +13,38 @@
|
|
|
13
13
|
<span class="hds-breadcrumb__text">{{@text}}</span>
|
|
14
14
|
</div>
|
|
15
15
|
{{else}}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
{{#if @isRouteExternal}}
|
|
17
|
+
<LinkToExternal
|
|
18
|
+
class="hds-breadcrumb__link"
|
|
19
|
+
@current-when={{@current-when}}
|
|
20
|
+
@models={{hds-link-to-models @model @models}}
|
|
21
|
+
@query={{hds-link-to-query @query}}
|
|
22
|
+
@replace={{@replace}}
|
|
23
|
+
@route={{@route}}
|
|
24
|
+
>
|
|
25
|
+
{{#if @icon}}
|
|
26
|
+
<div class="hds-breadcrumb__icon">
|
|
27
|
+
<FlightIcon @name={{@icon}} @size="16" @stretched={{true}} />
|
|
28
|
+
</div>
|
|
29
|
+
{{/if}}
|
|
30
|
+
<span class="hds-breadcrumb__text">{{@text}}</span>
|
|
31
|
+
</LinkToExternal>
|
|
32
|
+
{{else}}
|
|
33
|
+
<LinkTo
|
|
34
|
+
class="hds-breadcrumb__link"
|
|
35
|
+
@current-when={{@current-when}}
|
|
36
|
+
@models={{hds-link-to-models @model @models}}
|
|
37
|
+
@query={{hds-link-to-query @query}}
|
|
38
|
+
@replace={{@replace}}
|
|
39
|
+
@route={{@route}}
|
|
40
|
+
>
|
|
41
|
+
{{#if @icon}}
|
|
42
|
+
<div class="hds-breadcrumb__icon">
|
|
43
|
+
<FlightIcon @name={{@icon}} @size="16" @stretched={{true}} />
|
|
44
|
+
</div>
|
|
45
|
+
{{/if}}
|
|
46
|
+
<span class="hds-breadcrumb__text">{{@text}}</span>
|
|
47
|
+
</LinkTo>
|
|
48
|
+
{{/if}}
|
|
29
49
|
{{/if}}
|
|
30
50
|
</li>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import Component from '@glimmer/component';
|
|
7
7
|
import { assert } from '@ember/debug';
|
|
8
|
-
import { HdsInteractiveSignature } from '../interactive';
|
|
8
|
+
import { type HdsInteractiveSignature } from '../interactive';
|
|
9
9
|
|
|
10
10
|
export const DEFAULT_SIZE = 'medium';
|
|
11
11
|
export const DEFAULT_COLOR = 'primary';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<div class={{this.classNames}} ...attributes>
|
|
7
|
+
<div class="hds-code-block__header">
|
|
8
|
+
{{~yield (hash Title=(component "hds/code-block/title"))~}}
|
|
9
|
+
{{~yield (hash Description=(component "hds/code-block/description"))~}}
|
|
10
|
+
</div>
|
|
11
|
+
<div class="hds-code-block__body">
|
|
12
|
+
<pre
|
|
13
|
+
class="hds-code-block__code"
|
|
14
|
+
{{style maxHeight=@maxHeight}}
|
|
15
|
+
data-line={{@highlightLines}}
|
|
16
|
+
id={{this.preCodeId}}
|
|
17
|
+
tabindex="0"
|
|
18
|
+
>
|
|
19
|
+
{{~! ~}}
|
|
20
|
+
<code {{did-insert this.setPrismCode}} {{did-update this.setPrismCode this.code @language}}>
|
|
21
|
+
{{~this.prismCode~}}
|
|
22
|
+
</code>
|
|
23
|
+
{{~! ~}}
|
|
24
|
+
</pre>
|
|
25
|
+
|
|
26
|
+
{{#if @hasCopyButton}}
|
|
27
|
+
<Hds::CodeBlock::CopyButton @targetToCopy="#{{this.preCodeId}}" aria-describedby={{this.preCodeId}} />
|
|
28
|
+
{{/if}}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { action } from '@ember/object';
|
|
8
|
+
import { tracked } from '@glimmer/tracking';
|
|
9
|
+
import { assert } from '@ember/debug';
|
|
10
|
+
import { htmlSafe } from '@ember/template';
|
|
11
|
+
import { guidFor } from '@ember/object/internals';
|
|
12
|
+
|
|
13
|
+
import Prism from 'prismjs';
|
|
14
|
+
|
|
15
|
+
import 'prismjs/plugins/line-numbers/prism-line-numbers';
|
|
16
|
+
import 'prismjs/plugins/line-highlight/prism-line-highlight';
|
|
17
|
+
|
|
18
|
+
import 'prismjs/components/prism-bash';
|
|
19
|
+
import 'prismjs/components/prism-go';
|
|
20
|
+
import 'prismjs/components/prism-hcl';
|
|
21
|
+
import 'prismjs/components/prism-json';
|
|
22
|
+
import 'prismjs/components/prism-log';
|
|
23
|
+
import 'prismjs/components/prism-shell-session';
|
|
24
|
+
import 'prismjs/components/prism-yaml';
|
|
25
|
+
|
|
26
|
+
// These imports are required to overcome a global variable clash in Helios website
|
|
27
|
+
// where language import are overriden by the Prism instance in `CodeBlock`
|
|
28
|
+
// Note that `prism-handlebars` is dependant on `prism-markup-templating`
|
|
29
|
+
import 'prismjs/components/prism-markup-templating';
|
|
30
|
+
import 'prismjs/components/prism-handlebars';
|
|
31
|
+
|
|
32
|
+
export default class HdsCodeBlockIndexComponent extends Component {
|
|
33
|
+
@tracked prismCode = '';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Generates a unique ID for the code content
|
|
37
|
+
*
|
|
38
|
+
* @param preCodeId
|
|
39
|
+
*/
|
|
40
|
+
preCodeId = 'pre-code-' + guidFor(this);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param code
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @description code text content for the CodeBlock
|
|
46
|
+
*/
|
|
47
|
+
get code() {
|
|
48
|
+
const code = this.args.value;
|
|
49
|
+
|
|
50
|
+
assert(
|
|
51
|
+
'@code for "Hds::CodeBlock" must have a valid value',
|
|
52
|
+
code !== undefined
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
if (Prism?.plugins?.NormalizeWhitespace) {
|
|
56
|
+
return Prism.plugins.NormalizeWhitespace.normalize(code);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return code;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param language
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @default undefined
|
|
66
|
+
* @description name of coding language used within CodeBlock for syntax highlighting
|
|
67
|
+
*/
|
|
68
|
+
get language() {
|
|
69
|
+
return this.args.language ?? undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @param hasLineNumbers
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
* @default true
|
|
76
|
+
* @description Displays line numbers if true
|
|
77
|
+
*/
|
|
78
|
+
get hasLineNumbers() {
|
|
79
|
+
return this.args.hasLineNumbers ?? true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @param isStandalone
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
* @default true
|
|
86
|
+
* @description Make CodeBlock container corners appear rounded
|
|
87
|
+
*/
|
|
88
|
+
get isStandalone() {
|
|
89
|
+
return this.args.isStandalone ?? true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @param hasLineWrapping
|
|
94
|
+
* @type {boolean}
|
|
95
|
+
* @default false
|
|
96
|
+
* @description Make text content wrap on multiple lines
|
|
97
|
+
*/
|
|
98
|
+
get hasLineWrapping() {
|
|
99
|
+
return this.args.hasLineWrapping ?? false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@action
|
|
103
|
+
setPrismCode(element) {
|
|
104
|
+
const code = this.code;
|
|
105
|
+
const language = this.language;
|
|
106
|
+
const grammar = Prism.languages[language];
|
|
107
|
+
|
|
108
|
+
if (code) {
|
|
109
|
+
if (language && grammar) {
|
|
110
|
+
this.prismCode = htmlSafe(Prism.highlight(code, grammar, language));
|
|
111
|
+
} else {
|
|
112
|
+
this.prismCode = htmlSafe(Prism.util.encode(code));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Force prism-line-numbers plugin initialization, required for Prism.highlight usage
|
|
116
|
+
// See https://github.com/PrismJS/prism/issues/1234
|
|
117
|
+
Prism.hooks.run('complete', {
|
|
118
|
+
code,
|
|
119
|
+
element,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Force prism-line-highlight plugin initialization
|
|
123
|
+
// Context: https://github.com/hashicorp/design-system/pull/1749#discussion_r1374288785
|
|
124
|
+
if (this.args.highlightLines) {
|
|
125
|
+
setTimeout(() => {
|
|
126
|
+
// we piggy-back on the plugin's `resize` event listener to trigger a new call of the `highlightLines` function: https://github.com/PrismJS/prism/blob/master/plugins/line-highlight/prism-line-highlight.js#L337
|
|
127
|
+
if (window) window.dispatchEvent(new Event('resize'));
|
|
128
|
+
}, 100);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get the class names to apply to the component.
|
|
135
|
+
* @method classNames
|
|
136
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
137
|
+
*/
|
|
138
|
+
get classNames() {
|
|
139
|
+
// Currently there is only one theme so the class name is hard-coded.
|
|
140
|
+
// In the future, additional themes such as a "light" theme could be added.
|
|
141
|
+
let classes = ['hds-code-block', 'hds-code-block--theme-dark'];
|
|
142
|
+
|
|
143
|
+
if (this.language) {
|
|
144
|
+
classes.push(`language-${this.language}`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (this.isStandalone === true) {
|
|
148
|
+
classes.push('hds-code-block--is-standalone');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (this.hasLineWrapping === true) {
|
|
152
|
+
classes.push('hds-code-block--has-line-wrapping');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Note: Prism.js is using the specific class name "line-numbers" to determine implementation of line numbers in the UI
|
|
156
|
+
if (this.hasLineNumbers || this.args.highlightLines) {
|
|
157
|
+
classes.push('line-numbers');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return classes.join(' ');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
// CODE-BLOCK
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@use "../../mixins/focus-ring" as *;
|
|
12
|
+
|
|
13
|
+
// Note: "theme" contains just color variables and syntax highlighting styles
|
|
14
|
+
@import "theme";
|
|
15
|
+
|
|
16
|
+
// DIMENSIONS
|
|
17
|
+
$code-block-line-numbers-width: 49px; // 3em ≈ 49px
|
|
18
|
+
$code-block-code-padding: 16px;
|
|
19
|
+
|
|
20
|
+
// CODE-BLOCK PARENT/WRAPPER
|
|
21
|
+
|
|
22
|
+
.hds-code-block {
|
|
23
|
+
position: relative;
|
|
24
|
+
color: var(--hds-code-block-color-foreground-primary);
|
|
25
|
+
background-color: var(--hds-code-block-color-surface-primary);
|
|
26
|
+
border: 1px solid var(--hds-code-block-color-border-strong);
|
|
27
|
+
|
|
28
|
+
pre,
|
|
29
|
+
code {
|
|
30
|
+
line-height: 1.4286;
|
|
31
|
+
white-space: pre;
|
|
32
|
+
text-align: left;
|
|
33
|
+
text-shadow: none;
|
|
34
|
+
word-wrap: normal;
|
|
35
|
+
word-break: normal;
|
|
36
|
+
word-spacing: normal;
|
|
37
|
+
tab-size: 4;
|
|
38
|
+
hyphens: none;
|
|
39
|
+
|
|
40
|
+
@media print { text-shadow: none; }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// VARIANTS
|
|
45
|
+
|
|
46
|
+
// isStandalone
|
|
47
|
+
.hds-code-block--is-standalone {
|
|
48
|
+
border-radius: 6px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// hasLineWrapping
|
|
52
|
+
.hds-code-block--has-line-wrapping {
|
|
53
|
+
.hds-code-block__code,
|
|
54
|
+
.hds-code-block__code code {
|
|
55
|
+
white-space: pre-wrap;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// CHILD COMPONENTS / ELEMENTS
|
|
60
|
+
|
|
61
|
+
// Header (contains title & description)
|
|
62
|
+
|
|
63
|
+
.hds-code-block__title {
|
|
64
|
+
color: var(--hds-code-block-color-foreground-primary);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.hds-code-block__description {
|
|
68
|
+
color: var(--hds-code-block-color-foreground-faint);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.hds-code-block__header {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
gap: 4px;
|
|
75
|
+
padding: 8px $code-block-code-padding;
|
|
76
|
+
background-color: var(--hds-code-block-color-surface-faint);
|
|
77
|
+
border-bottom: 1px solid var(--hds-code-block-color-border-primary);
|
|
78
|
+
border-top-left-radius: inherit;
|
|
79
|
+
border-top-right-radius: inherit;
|
|
80
|
+
|
|
81
|
+
&:empty {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// we add very basic styling for elements that may be yielded in the "title"/"description" elements
|
|
86
|
+
|
|
87
|
+
strong {
|
|
88
|
+
font-weight: var(--token-typography-font-weight-semibold);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
code,
|
|
92
|
+
pre {
|
|
93
|
+
display: inline;
|
|
94
|
+
font-size: 0.9em; // as discussed with designers, we reduce the size for optical/visual balance
|
|
95
|
+
font-family: var(--token-typography-code-100-font-family);
|
|
96
|
+
line-height: 1em;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Default styling for bare HTML links not using HDS::Link components
|
|
100
|
+
a:not([class*="hds-"]) {
|
|
101
|
+
color: var(--hds-code-block-color-foreground-action);
|
|
102
|
+
|
|
103
|
+
&:focus,
|
|
104
|
+
&:focus-visible {
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
outline: 2px solid var(--token-color-focus-action-internal);
|
|
107
|
+
outline-offset: 1px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:hover {
|
|
111
|
+
color: var(--token-color-foreground-action-hover);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:active {
|
|
115
|
+
color: var(--token-color-foreground-action-active);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.hds-code-block__body {
|
|
121
|
+
position: relative;
|
|
122
|
+
border-radius: inherit;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Code
|
|
126
|
+
.hds-code-block__code {
|
|
127
|
+
@include hds-focus-ring-basic();
|
|
128
|
+
display: block;
|
|
129
|
+
margin: 0;
|
|
130
|
+
padding: $code-block-code-padding;
|
|
131
|
+
overflow: auto;
|
|
132
|
+
font-size: 0.8125rem;
|
|
133
|
+
font-family: var(--hds-typography-code-200);
|
|
134
|
+
border-radius: inherit;
|
|
135
|
+
|
|
136
|
+
::selection {
|
|
137
|
+
color: var(--hds-code-block-color-foreground-selection);
|
|
138
|
+
background-color: var(--hds-code-block-color-surface-selection);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// CopyButton
|
|
143
|
+
.hds-code-block__copy-button {
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 11px; // 12px -1px accounting for border
|
|
146
|
+
right: 12px; // 12px -1px accounting for border
|
|
147
|
+
// Overriding default colors
|
|
148
|
+
color: var(--hds-code-block-color-foreground-primary);
|
|
149
|
+
background-color: var(--hds-code-block-color-surface-faint);
|
|
150
|
+
border: 1px solid var(--hds-code-block-color-border-strong);
|
|
151
|
+
|
|
152
|
+
&:hover,
|
|
153
|
+
&.mock-hover {
|
|
154
|
+
background-color: var(--hds-code-block-color-surface-primary);
|
|
155
|
+
border-color: var(--hds-code-block-color-border-strong);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:active,
|
|
159
|
+
&.mock-active {
|
|
160
|
+
background-color: var(--hds-code-block-color-surface-interactive-active);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:focus,
|
|
164
|
+
&.mock-focus,
|
|
165
|
+
&:focus-visible {
|
|
166
|
+
background-color: var(--hds-code-block-color-surface-faint);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.hds-copy-button--status-success {
|
|
170
|
+
.flight-icon {
|
|
171
|
+
color: var(--hds-code-block-color-foreground-success);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&.hds-copy-button--status-error {
|
|
176
|
+
.flight-icon {
|
|
177
|
+
color: var(--hds-code-block-color-foreground-critical);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.flight-icon { color: var(--hds-code-block-color-foreground-primary); }
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.hds-code-block {
|
|
185
|
+
// LineNumbers plugin styles ---------------
|
|
186
|
+
// Note: Prism.js is using the specific class name "line-numbers" to determine implementation of line numbers in the UI
|
|
187
|
+
&.line-numbers {
|
|
188
|
+
counter-reset: linenumber;
|
|
189
|
+
|
|
190
|
+
.hds-code-block__code {
|
|
191
|
+
position: relative;
|
|
192
|
+
// reserve space for line numbers
|
|
193
|
+
padding-left: calc(#{$code-block-line-numbers-width} + #{$code-block-code-padding});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.line-numbers-rows {
|
|
197
|
+
position: absolute;
|
|
198
|
+
top: 0;
|
|
199
|
+
left: 0;
|
|
200
|
+
min-width: $code-block-line-numbers-width;
|
|
201
|
+
min-height: 100%;
|
|
202
|
+
padding: $code-block-code-padding 0;
|
|
203
|
+
border-right: 1px solid var(--hds-code-block-color-border-primary);
|
|
204
|
+
user-select: none;
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
|
|
207
|
+
> span {
|
|
208
|
+
display: block;
|
|
209
|
+
counter-increment: linenumber;
|
|
210
|
+
|
|
211
|
+
&::before {
|
|
212
|
+
display: block;
|
|
213
|
+
padding-right: $code-block-code-padding;
|
|
214
|
+
text-align: right;
|
|
215
|
+
content: counter(linenumber);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Highlighted Lines
|
|
222
|
+
.line-highlight {
|
|
223
|
+
position: absolute;
|
|
224
|
+
right: 0;
|
|
225
|
+
left: 0;
|
|
226
|
+
// Note: position seems off by a few px although not sure why
|
|
227
|
+
margin-top: -3px;
|
|
228
|
+
background-color: var(--hds-code-block-color-line-highlight);
|
|
229
|
+
border: solid var(--hds-code-block-color-line-highlight-border);
|
|
230
|
+
border-width: 1px 0 1px 4px;
|
|
231
|
+
mix-blend-mode: screen;
|
|
232
|
+
pointer-events: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@media print {
|
|
236
|
+
.line-highlight {
|
|
237
|
+
/*
|
|
238
|
+
* This will prevent browsers from replacing the background color with white.
|
|
239
|
+
* It's necessary because the element is layered on top of the displayed code.
|
|
240
|
+
*/
|
|
241
|
+
-webkit-print-color-adjust: exact;
|
|
242
|
+
color-adjust: exact;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// commmon tokens
|
|
247
|
+
.token.bold { font-weight: bold; }
|
|
248
|
+
.token.italic { font-style: italic; }
|
|
249
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// THEMING
|
|
2
|
+
|
|
3
|
+
.hds-code-block--theme-dark {
|
|
4
|
+
// COLORS
|
|
5
|
+
|
|
6
|
+
// Descriptive color names:
|
|
7
|
+
|
|
8
|
+
--hds-code-block-color-blue: #2d8eff;
|
|
9
|
+
--hds-code-block-color-cyan: #32fff7;
|
|
10
|
+
--hds-code-block-color-green: #86ff13;
|
|
11
|
+
--hds-code-block-color-orange: #ffa800;
|
|
12
|
+
--hds-code-block-color-purple: #c76cff;
|
|
13
|
+
--hds-code-block-color-red: #ff3b20;
|
|
14
|
+
|
|
15
|
+
// Semantic color names:
|
|
16
|
+
|
|
17
|
+
// Base UI colors:
|
|
18
|
+
--hds-code-block-color-foreground-primary: #d5d7db;
|
|
19
|
+
--hds-code-block-color-foreground-faint: #b2b6bd;
|
|
20
|
+
--hds-code-block-color-surface-primary: #0d0e12;
|
|
21
|
+
--hds-code-block-color-surface-faint: #15181e;
|
|
22
|
+
// status ----
|
|
23
|
+
--hds-code-block-color-foreground-success: #009241;
|
|
24
|
+
--hds-code-block-color-foreground-critical: #ef3016;
|
|
25
|
+
// interactive ---
|
|
26
|
+
--hds-code-block-color-foreground-interactive: #dedfe3;
|
|
27
|
+
--hds-code-block-color-foreground-interactive-hover: #fff;
|
|
28
|
+
--hds-code-block-color-foreground-interactive-active: #f1f2f3;
|
|
29
|
+
--hds-code-block-color-surface-interactive-active: #2b303c;
|
|
30
|
+
// actions ---
|
|
31
|
+
--hds-code-block-color-foreground-action: #2b89ff;
|
|
32
|
+
--hds-code-block-color-foreground-action-hover: #389aff;
|
|
33
|
+
--hds-code-block-color-foreground-action-active: #4ca1ff;
|
|
34
|
+
// borders
|
|
35
|
+
--hds-code-block-color-border-strong: rgba(178, 182, 189, 40%); // #b2b6bd66
|
|
36
|
+
--hds-code-block-color-border-primary: rgba(178, 182, 189, 20%); // #b2b6bd33
|
|
37
|
+
// selection
|
|
38
|
+
--hds-code-block-color-foreground-selection: #0d0e12;
|
|
39
|
+
--hds-code-block-color-surface-selection: #86ff13;
|
|
40
|
+
|
|
41
|
+
// CodeBlock UI:
|
|
42
|
+
// lines of code - highlighted ----
|
|
43
|
+
--hds-code-block-color-line-highlight: rgba(0, 74, 222, 20%);
|
|
44
|
+
--hds-code-block-color-line-highlight-border: #1555d4;
|
|
45
|
+
|
|
46
|
+
// Syntax highlighting tokens:
|
|
47
|
+
// general ----
|
|
48
|
+
--hds-code-block-color-token: var(--hds-code-block-color-green);
|
|
49
|
+
// specific ----
|
|
50
|
+
--hds-code-block-color-atrule: var(--hds-code-block-color-blue);
|
|
51
|
+
--hds-code-block-color-code-block-attr-name: var(--hds-code-block-color-blue);
|
|
52
|
+
--hds-code-block-color-attr-value: var(--hds-code-block-color-blue);
|
|
53
|
+
--hds-code-block-color-boolean: var(--hds-code-block-color-purple);
|
|
54
|
+
--hds-code-block-color-builtin: var(--hds-code-block-color-orange);
|
|
55
|
+
--hds-code-block-color-char: var(--hds-code-block-color-orange);
|
|
56
|
+
--hds-code-block-color-class-name: var(--hds-code-block-color-green);
|
|
57
|
+
--hds-code-block-color-comment: var(--hds-code-block-color-foreground-faint);
|
|
58
|
+
--hds-code-block-color-control: var(--hds-code-block-color-cyan);
|
|
59
|
+
--hds-code-block-color-constant: var(--hds-code-block-color-purple);
|
|
60
|
+
--hds-code-block-color-deleted: var(--hds-code-block-color-red);
|
|
61
|
+
--hds-code-block-color-entity: var(--hds-code-block-color-green);
|
|
62
|
+
--hds-code-block-color-function: var(--hds-code-block-color-blue);
|
|
63
|
+
--hds-code-block-color-important: var(--hds-code-block-color-red);
|
|
64
|
+
--hds-code-block-color-keyword: var(--hds-code-block-color-green);
|
|
65
|
+
--hds-code-block-color-namespace: var(--hds-code-block-color-red);
|
|
66
|
+
--hds-code-block-color-number: var(--hds-code-block-color-purple);
|
|
67
|
+
--hds-code-block-color-operator: var(--hds-code-block-color-cyan);
|
|
68
|
+
--hds-code-block-color-prolog: var(--hds-code-block-color-foreground-primary);
|
|
69
|
+
--hds-code-block-color-property: var(--hds-code-block-color-blue);
|
|
70
|
+
--hds-code-block-color-punctuation: var(--hds-code-block-color-foreground-primary);
|
|
71
|
+
--hds-code-block-color-regex: var(--hds-code-block-color-orange);
|
|
72
|
+
--hds-code-block-color-script: var(--hds-code-block-color-foreground-primary);
|
|
73
|
+
--hds-code-block-color-selector: var(--hds-code-block-color-green);
|
|
74
|
+
--hds-code-block-color-string: var(--hds-code-block-color-orange);
|
|
75
|
+
--hds-code-block-color-symbol: var(--hds-code-block-color-orange);
|
|
76
|
+
--hds-code-block-color-tag: var(--hds-code-block-color-green);
|
|
77
|
+
--hds-code-block-color-url: var(--hds-code-block-color-cyan);
|
|
78
|
+
// language-scoped:
|
|
79
|
+
// css ----
|
|
80
|
+
--hds-code-block-color-lang-css: var(--hds-code-block-color-purple);
|
|
81
|
+
--hds-code-block-color-lang-css-token: var(--hds-code-block-color-green);
|
|
82
|
+
--hds-code-block-color-lang-css-atrule: var(--hds-code-block-color-purple);
|
|
83
|
+
--hds-code-block-color-lang-css-entity: var(--hds-code-block-color-blue);
|
|
84
|
+
--hds-code-block-color-lang-css-function: var(--hds-code-block-color-cyan);
|
|
85
|
+
--hds-code-block-color-lang-css-property: var(--hds-code-block-color-cyan);
|
|
86
|
+
--hds-code-block-color-lang-css-punctuation: var(--hds-code-block-color-orange);
|
|
87
|
+
--hds-code-block-color-lang-css-not-atrule: var(--hds-code-block-color-foreground-primary);
|
|
88
|
+
--hds-code-block-color-lang-css-selector: var(--hds-code-block-color-blue);
|
|
89
|
+
--hds-code-block-color-lang-css-url: var(--hds-code-block-color-orange);
|
|
90
|
+
// javascript ----
|
|
91
|
+
--hds-code-block-color-lang-js-constant: var(--hds-code-block-color-orange);
|
|
92
|
+
// markup/html ----
|
|
93
|
+
--hds-code-block-color-lang-markup-attr-value: var(--hds-code-block-color-yellow);
|
|
94
|
+
--hds-code-block-color-lang-markup-entity-named: var(--hds-code-block-color-purple);
|
|
95
|
+
--hds-code-block-color-lang-markup-entity-not-named: var(--hds-code-block-color-green);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
.hds-code-block {
|
|
100
|
+
// Syntax highlighting ----
|
|
101
|
+
|
|
102
|
+
// General tokens
|
|
103
|
+
.token { color: var(--hds-code-block-color-token); }
|
|
104
|
+
|
|
105
|
+
.token.atrule { color: var(--hds-code-block-color-atrule); }
|
|
106
|
+
.token.attr-name { color: var(--hds-code-block-color-attr-name); }
|
|
107
|
+
.token.attr-value { color: var(--hds-code-block-color-attr-value); }
|
|
108
|
+
.token.boolean { color: var(--hds-code-block-color-boolean); }
|
|
109
|
+
.token.builtin { color: var(--hds-code-block-color-builtin); }
|
|
110
|
+
.token.char { color: var(--hds-code-block-color-char); }
|
|
111
|
+
.token.class-name { color: var(--hds-code-block-color-class-name); }
|
|
112
|
+
.token.comment { color: var(--hds-code-block-color-comment); }
|
|
113
|
+
.token.constant { color: var(--hds-code-block-color-constant); }
|
|
114
|
+
.token.deleted { color: var(--hds-code-block-color-deleted); }
|
|
115
|
+
.token.entity { color: var(--hds-code-block-color-entity); }
|
|
116
|
+
.token.function { color: var(--hds-code-block-color-function); }
|
|
117
|
+
.token.important { color: var(--hds-code-block-color-important); }
|
|
118
|
+
.token.keyword { color: var(--hds-code-block-color-keyword); }
|
|
119
|
+
.token.namespace { color: var(--hds-code-block-color-namespace); }
|
|
120
|
+
.token.number { color: var(--hds-code-block-color-number); }
|
|
121
|
+
.token.operator { color: var(--hds-code-block-color-operator); }
|
|
122
|
+
.token.punctuation { color: var(--hds-code-block-color-punctuation); }
|
|
123
|
+
.token.prolog { color: var(--hds-code-block-color-prolog); }
|
|
124
|
+
.token.property { color: var(--hds-code-block-color-property); }
|
|
125
|
+
.token.regex { color: var(--hds-code-block-color-regex); }
|
|
126
|
+
.token.script { color: var(--hds-code-block-color-script); }
|
|
127
|
+
.token.selector { color: var(--hds-code-block-color-selector); }
|
|
128
|
+
.token.string { color: var(--hds-code-block-color-string); }
|
|
129
|
+
.token.symbol { color: var(--hds-code-block-color-symbol); }
|
|
130
|
+
.token.tag { color: var(--hds-code-block-color-tag); }
|
|
131
|
+
.token.url { color: var(--hds-code-block-color-url); }
|
|
132
|
+
.token.variable { color: var(--hds-code-block-color-comment); }
|
|
133
|
+
|
|
134
|
+
// Language-specific
|
|
135
|
+
.language-css {
|
|
136
|
+
color: var(--hds-code-block-color-lang-css);
|
|
137
|
+
|
|
138
|
+
.token { color: var(--hds-code-block-color-lang-css-token); }
|
|
139
|
+
.token.atrule { color: var(--hds-code-block-color-lang-css-atrule); }
|
|
140
|
+
.token.rule:not(.atrule) { color: var(--hds-code-block-color-lang-css-not-atrule); }
|
|
141
|
+
.token.entity { color: var(--hds-code-block-color-lang-css-entity); }
|
|
142
|
+
.token.function { color: var(--hds-code-block-color-lang-css-function); }
|
|
143
|
+
.token.property { color: var(--hds-code-block-color-lang-css-property); }
|
|
144
|
+
.token.punctuation { color: var(--hds-code-block-color-lang-css-punctuatione); }
|
|
145
|
+
.token.selector { color: var(--hds-code-block-color-lang-css-selector); }
|
|
146
|
+
.token.url { color: var(--hds-code-block-color-lang-css-url); }
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.language-javascript {
|
|
150
|
+
.token.constant { color: var(--hds-code-block-color-lang-js-constant); }
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.language-markup,
|
|
154
|
+
.language-html {
|
|
155
|
+
.token.attr-value { color: var(--hds-code-block-color-lang-markup-attr-value); }
|
|
156
|
+
.token.entity.named-entity { color: var(--hds-code-block-color-lang-markup-entity-named); }
|
|
157
|
+
.token.entity:not(.named-entity) { color: var(--hds-code-block-color-lang-markup-entity-not-named); }
|
|
158
|
+
}
|
|
159
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Helios Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -41,101 +41,85 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ember/render-modifiers": "^2.0.5",
|
|
44
|
-
"@ember/test-waiters": "^3.0
|
|
44
|
+
"@ember/test-waiters": "^3.1.0",
|
|
45
45
|
"@hashicorp/design-system-tokens": "^1.9.0",
|
|
46
|
-
"@hashicorp/ember-flight-icons": "^4.0.
|
|
46
|
+
"@hashicorp/ember-flight-icons": "^4.0.2",
|
|
47
47
|
"dialog-polyfill": "^0.5.6",
|
|
48
48
|
"ember-a11y-refocus": "^3.0.2",
|
|
49
49
|
"ember-auto-import": "^2.6.3",
|
|
50
|
-
"ember-cached-decorator-polyfill": "^0.
|
|
51
|
-
"ember-cli-babel": "^
|
|
52
|
-
"ember-cli-htmlbars": "^6.
|
|
53
|
-
"ember-cli-sass": "^
|
|
54
|
-
"ember-composable-helpers": "^
|
|
50
|
+
"ember-cached-decorator-polyfill": "^1.0.2",
|
|
51
|
+
"ember-cli-babel": "^8.2.0",
|
|
52
|
+
"ember-cli-htmlbars": "^6.3.0",
|
|
53
|
+
"ember-cli-sass": "^11.0.1",
|
|
54
|
+
"ember-composable-helpers": "^5.0.0",
|
|
55
55
|
"ember-element-helper": "^0.8.5",
|
|
56
|
-
"ember-focus-trap": "^1.0
|
|
57
|
-
"ember-keyboard": "^8.2.
|
|
56
|
+
"ember-focus-trap": "^1.1.0",
|
|
57
|
+
"ember-keyboard": "^8.2.1",
|
|
58
58
|
"ember-stargate": "^0.4.3",
|
|
59
59
|
"ember-style-modifier": "^3.0.1",
|
|
60
60
|
"ember-truth-helpers": "^3.1.1",
|
|
61
|
-
"
|
|
61
|
+
"prismjs": "^1.29.0",
|
|
62
|
+
"sass": "^1.69.5",
|
|
62
63
|
"tippy.js": "^6.3.7"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
66
|
+
"@babel/core": "^7.23.2",
|
|
67
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
68
|
+
"@babel/plugin-proposal-decorators": "^7.23.2",
|
|
65
69
|
"@ember/optional-features": "^2.0.0",
|
|
66
|
-
"@ember/
|
|
67
|
-
"@
|
|
68
|
-
"@embroider/test-setup": "^2.1.1",
|
|
70
|
+
"@ember/test-helpers": "^3.2.0",
|
|
71
|
+
"@embroider/test-setup": "^3.0.2",
|
|
69
72
|
"@glimmer/component": "^1.1.2",
|
|
70
73
|
"@glimmer/tracking": "^1.1.2",
|
|
71
|
-
"@glint/core": "^1.1
|
|
72
|
-
"@glint/environment-ember-loose": "^1.1
|
|
73
|
-
"@glint/template": "^1.1
|
|
74
|
-
"@percy/cli": "^1.
|
|
74
|
+
"@glint/core": "^1.2.1",
|
|
75
|
+
"@glint/environment-ember-loose": "^1.2.1",
|
|
76
|
+
"@glint/template": "^1.2.1",
|
|
77
|
+
"@percy/cli": "^1.27.3",
|
|
75
78
|
"@percy/ember": "^4.2.0",
|
|
76
|
-
"@tsconfig/ember": "
|
|
77
|
-
"@types/ember": "
|
|
78
|
-
"@types/ember-
|
|
79
|
-
"@types/
|
|
80
|
-
"@types/
|
|
81
|
-
"@types/ember__array": "latest",
|
|
82
|
-
"@types/ember__component": "latest",
|
|
83
|
-
"@types/ember__controller": "latest",
|
|
84
|
-
"@types/ember__debug": "latest",
|
|
85
|
-
"@types/ember__destroyable": "latest",
|
|
86
|
-
"@types/ember__engine": "latest",
|
|
87
|
-
"@types/ember__error": "latest",
|
|
88
|
-
"@types/ember__object": "latest",
|
|
89
|
-
"@types/ember__polyfills": "latest",
|
|
90
|
-
"@types/ember__routing": "latest",
|
|
91
|
-
"@types/ember__runloop": "latest",
|
|
92
|
-
"@types/ember__service": "latest",
|
|
93
|
-
"@types/ember__string": "latest",
|
|
94
|
-
"@types/ember__template": "latest",
|
|
95
|
-
"@types/ember__test": "latest",
|
|
96
|
-
"@types/ember__test-helpers": "latest",
|
|
97
|
-
"@types/ember__utils": "latest",
|
|
98
|
-
"@types/qunit": "latest",
|
|
99
|
-
"@types/rsvp": "latest",
|
|
100
|
-
"babel-eslint": "^10.1.0",
|
|
79
|
+
"@tsconfig/ember": "^3.0.2",
|
|
80
|
+
"@types/ember-qunit": "^6.1.1",
|
|
81
|
+
"@types/ember-resolver": "^9.0.0",
|
|
82
|
+
"@types/qunit": "^2.19.7",
|
|
83
|
+
"@types/rsvp": "^4.0.6",
|
|
101
84
|
"broccoli-asset-rev": "^3.0.0",
|
|
102
|
-
"ember-a11y-testing": "^
|
|
85
|
+
"ember-a11y-testing": "^6.1.1",
|
|
103
86
|
"ember-body-class": "^3.0.0",
|
|
104
|
-
"ember-cli": "~
|
|
105
|
-
"ember-cli-
|
|
87
|
+
"ember-cli": "~5.3.0",
|
|
88
|
+
"ember-cli-clean-css": "^3.0.0",
|
|
89
|
+
"ember-cli-dependency-checker": "^3.3.2",
|
|
106
90
|
"ember-cli-deprecation-workflow": "^2.1.0",
|
|
107
91
|
"ember-cli-inject-live-reload": "^2.1.0",
|
|
108
92
|
"ember-cli-sri": "^2.1.1",
|
|
109
93
|
"ember-cli-string-helpers": "^6.1.0",
|
|
110
94
|
"ember-cli-terser": "^4.0.2",
|
|
111
|
-
"ember-concurrency": "^
|
|
95
|
+
"ember-concurrency": "^3.1.1",
|
|
112
96
|
"ember-load-initializers": "^2.1.2",
|
|
113
|
-
"ember-page-title": "^
|
|
114
|
-
"ember-power-select": "^
|
|
115
|
-
"ember-qunit": "^
|
|
116
|
-
"ember-resolver": "^
|
|
117
|
-
"ember-source": "~
|
|
97
|
+
"ember-page-title": "^8.0.0",
|
|
98
|
+
"ember-power-select": "^7.1.2",
|
|
99
|
+
"ember-qunit": "^8.0.1",
|
|
100
|
+
"ember-resolver": "^11.0.1",
|
|
101
|
+
"ember-source": "~5.3.0",
|
|
118
102
|
"ember-source-channel-url": "^3.0.0",
|
|
119
103
|
"ember-template-lint": "^4.18.2",
|
|
120
|
-
"ember-template-lint-plugin-prettier": "^4.
|
|
121
|
-
"ember-try": "^
|
|
122
|
-
"eslint": "^
|
|
123
|
-
"eslint-config-prettier": "^8.
|
|
124
|
-
"eslint-plugin-ember": "^11.
|
|
104
|
+
"ember-template-lint-plugin-prettier": "^4.2.0",
|
|
105
|
+
"ember-try": "^3.0.0",
|
|
106
|
+
"eslint": "^8.52.0",
|
|
107
|
+
"eslint-config-prettier": "^8.10.0",
|
|
108
|
+
"eslint-plugin-ember": "^11.11.1",
|
|
125
109
|
"eslint-plugin-node": "^11.1.0",
|
|
126
110
|
"eslint-plugin-prettier": "^4.2.1",
|
|
127
|
-
"eslint-plugin-qunit": "^
|
|
111
|
+
"eslint-plugin-qunit": "^8.0.1",
|
|
128
112
|
"loader.js": "^4.7.0",
|
|
129
113
|
"npm-run-all": "^4.1.5",
|
|
130
114
|
"prettier": "^2.8.8",
|
|
131
|
-
"qunit": "^2.
|
|
132
|
-
"qunit-dom": "^
|
|
133
|
-
"sinon": "^
|
|
134
|
-
"stylelint": "^15.
|
|
115
|
+
"qunit": "^2.20.0",
|
|
116
|
+
"qunit-dom": "^3.0.0",
|
|
117
|
+
"sinon": "^17.0.0",
|
|
118
|
+
"stylelint": "^15.11.0",
|
|
135
119
|
"stylelint-config-rational-order": "^0.1.2",
|
|
136
120
|
"stylelint-config-standard-scss": "^5.0.0",
|
|
137
|
-
"typescript": "^5.
|
|
138
|
-
"webpack": "^5.
|
|
121
|
+
"typescript": "^5.2.2",
|
|
122
|
+
"webpack": "^5.89.0"
|
|
139
123
|
},
|
|
140
124
|
"engines": {
|
|
141
125
|
"node": "16.* || >= 18"
|
package/tsconfig.json
CHANGED