@hashicorp/design-system-components 1.5.2 → 1.6.1

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 (38) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/NEW-COMPONENT-CHECKLIST.md +5 -2
  3. package/addon/components/hds/flyout/body.hbs +3 -0
  4. package/addon/components/hds/flyout/description.hbs +3 -0
  5. package/addon/components/hds/flyout/header.hbs +14 -0
  6. package/addon/components/hds/flyout/index.hbs +14 -0
  7. package/addon/components/hds/flyout/index.js +107 -0
  8. package/addon/components/hds/pagination/compact/index.hbs +26 -0
  9. package/addon/components/hds/pagination/compact/index.js +87 -0
  10. package/addon/components/hds/pagination/info/index.hbs +7 -0
  11. package/addon/components/hds/pagination/info/index.js +12 -0
  12. package/addon/components/hds/pagination/nav/arrow.hbs +28 -0
  13. package/addon/components/hds/pagination/nav/arrow.js +74 -0
  14. package/addon/components/hds/pagination/nav/ellipsis.hbs +1 -0
  15. package/addon/components/hds/pagination/nav/number.hbs +12 -0
  16. package/addon/components/hds/pagination/nav/number.js +45 -0
  17. package/addon/components/hds/pagination/numbered/index.hbs +65 -0
  18. package/addon/components/hds/pagination/numbered/index.js +327 -0
  19. package/addon/components/hds/pagination/size-selector/index.hbs +10 -0
  20. package/addon/components/hds/pagination/size-selector/index.js +56 -0
  21. package/addon/components/hds/table/index.hbs +1 -1
  22. package/app/components/hds/flyout/body.js +1 -0
  23. package/app/components/hds/flyout/description.js +1 -0
  24. package/app/components/hds/flyout/header.js +1 -0
  25. package/app/components/hds/flyout/index.js +1 -0
  26. package/app/components/hds/pagination/compact/index.js +1 -0
  27. package/app/components/hds/pagination/info.js +1 -0
  28. package/app/components/hds/pagination/nav/arrow.js +1 -0
  29. package/app/components/hds/pagination/nav/ellipsis.js +1 -0
  30. package/app/components/hds/pagination/nav/number.js +1 -0
  31. package/app/components/hds/pagination/numbered/index.js +1 -0
  32. package/app/components/hds/pagination/size-selector.js +1 -0
  33. package/app/styles/@hashicorp/design-system-components.scss +3 -1
  34. package/app/styles/components/flyout.scss +95 -0
  35. package/app/styles/components/pagination.scss +194 -0
  36. package/blueprints/hds-component/files/app/styles/components/__name__.scss +3 -0
  37. package/blueprints/hds-component-test/files/tests/dummy/app/templates/components/__name__.hbs +0 -52
  38. package/package.json +6 -7
@@ -0,0 +1,194 @@
1
+ //
2
+ // PAGINATION
3
+ //
4
+
5
+ @use "../mixins/focus-ring" as *;
6
+
7
+ // custom breakpoint for the pagination, swapping between horizontal and stacked layout
8
+ // notice: the value is based on where the component layout potentially breaks down
9
+
10
+ $pagination-layout-breakpoint: 1000px;
11
+
12
+
13
+ // * Pagination Parent (wrapper) component
14
+ // -------------------------------------------------------------------
15
+
16
+ .hds-pagination {
17
+ display: grid;
18
+ grid-template-areas: "info nav selector";
19
+ grid-template-rows: auto;
20
+ grid-template-columns: 1fr auto 1fr;
21
+ align-items: center;
22
+ margin: 0 auto;
23
+
24
+ @media screen and (max-width: $pagination-layout-breakpoint) {
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ justify-content: center;
28
+ }
29
+ }
30
+
31
+
32
+ // * Sub-component: Info
33
+ // ---------------------------------------
34
+
35
+ .hds-pagination-info {
36
+ grid-area: info;
37
+ justify-self: flex-start;
38
+ margin-right: var(--token-pagination-child-spacing-horizontal);
39
+ white-space: nowrap;
40
+
41
+ @media screen and (max-width: $pagination-layout-breakpoint) {
42
+ margin-top: var(--token-pagination-child-spacing-vertical);
43
+ margin-left: var(--token-pagination-child-spacing-horizontal);
44
+ }
45
+ }
46
+
47
+
48
+ // * Sub-components: Arrow/Number/Ellipsis (aka "navigation controls")
49
+ // -------------------------------------------------------------------
50
+
51
+ .hds-pagination-nav {
52
+ display: flex;
53
+ grid-area: nav;
54
+
55
+ @media screen and (max-width: $pagination-layout-breakpoint) {
56
+ justify-content: center;
57
+ order: -1;
58
+ // Force nav to occupy a full row so other components will wrap:
59
+ width: 100%;
60
+ }
61
+ }
62
+
63
+ .hds-pagination-nav__page-list {
64
+ display: flex;
65
+ margin: 0;
66
+ padding: 0;
67
+ }
68
+
69
+ .hds-pagination-nav__page-item { list-style-type: none; }
70
+
71
+ // "controls" are "prev/next" (`arrow`) and "page" numbers (`number`)
72
+ .hds-pagination-nav__control {
73
+ display: flex;
74
+ align-items: center;
75
+ height: var(--token-pagination-nav-control-height);
76
+ // border width is subtracted from padding:
77
+ padding: 0 calc(var(--token-pagination-nav-control-padding-horizontal) - 1px);
78
+ color: var(--token-color-foreground-primary);
79
+ text-decoration: none;
80
+ background-color: transparent;
81
+ border: 1px solid transparent;
82
+
83
+ @include hds-focus-ring-with-pseudo-element(
84
+ $top: var(--token-pagination-nav-control-focus-inset),
85
+ $right: var(--token-pagination-nav-control-focus-inset),
86
+ $bottom: var(--token-pagination-nav-control-focus-inset),
87
+ $left: var(--token-pagination-nav-control-focus-inset),
88
+ );
89
+
90
+ &:hover,
91
+ &.mock-hover {
92
+ color: var(--token-color-foreground-action-hover);
93
+ }
94
+
95
+ &:active,
96
+ &.mock-active {
97
+ color: var(--token-color-foreground-action-active);
98
+ }
99
+ }
100
+
101
+ // only the "Previous" & "Next" (`Arrow`) controls can be disabled
102
+ .hds-pagination-nav__arrow {
103
+ // notice: when `@disabled={{true}}` is applied, the code always renders a `<button>` element
104
+ // so no need to add the [disabled] selector here (elsewhere it's done to cover the `a[disabled]` case)
105
+ &:disabled,
106
+ &.mock-disabled {
107
+ color: var(--token-color-foreground-disabled);
108
+ cursor: not-allowed;
109
+ }
110
+ }
111
+
112
+ .hds-pagination-nav__arrow--direction-prev {
113
+ flex-direction: row;
114
+ justify-content: flex-start;
115
+
116
+ .hds-pagination-nav__arrow-label {
117
+ margin-left: var(--token-pagination-nav-control-icon-spacing);
118
+ }
119
+ }
120
+
121
+ .hds-pagination-nav__arrow--direction-next {
122
+ flex-direction: row-reverse;
123
+ justify-content: flex-end;
124
+
125
+ .hds-pagination-nav__arrow-label {
126
+ margin-right: 6px;
127
+ }
128
+ }
129
+
130
+ .hds-pagination-nav__number--is-selected {
131
+ position: relative;
132
+ color: var(--token-color-foreground-action);
133
+
134
+ &:hover {
135
+ color: var(--token-color-foreground-action-hover);
136
+ }
137
+
138
+ &:active {
139
+ color: var(--token-color-foreground-action-active);
140
+ }
141
+
142
+ // indicator underline
143
+ // notice: in all these calculations we have to take in account that there's a 1px transparent border
144
+ &::after { // notice: we use the `::before` for the focus
145
+ position: absolute;
146
+ right: calc(var(--token-pagination-nav-indicator-spacing) - 1px);
147
+ bottom: -1px;
148
+ left: calc(var(--token-pagination-nav-indicator-spacing) - 1px);
149
+ height: var(--token-pagination-nav-indicator-height);
150
+ margin: 0 auto;
151
+ background-color: currentColor;
152
+ border-radius: 2px;
153
+ content: "";
154
+ }
155
+ }
156
+
157
+ .hds-pagination-nav__ellipsis {
158
+ display: flex;
159
+ align-items: center;
160
+ height: var(--token-pagination-nav-control-height);
161
+ padding: 0 var(--token-pagination-nav-control-padding-horizontal);
162
+ color: var(--token-color-foreground-faint);
163
+ }
164
+
165
+
166
+ // * Sub-component: SizeSelector
167
+ // -------------------------------------------------------------------
168
+
169
+ .hds-pagination-size-selector {
170
+ display: flex;
171
+ grid-area: selector;
172
+ align-items: center;
173
+ justify-self: flex-end;
174
+ margin-left: var(--token-pagination-child-spacing-horizontal);
175
+
176
+ @media screen and (max-width: $pagination-layout-breakpoint) {
177
+ margin-top: var(--token-pagination-child-spacing-vertical);
178
+ margin-right: var(--token-pagination-child-spacing-horizontal);
179
+ }
180
+
181
+ > label { white-space: nowrap; }
182
+
183
+ // notice: this is an `Form::Select::Base` component, slightly customized
184
+ > select {
185
+ height: 28px;
186
+ margin-left: 12px;
187
+ padding: 0 24px 0 8px;
188
+ // font styles for this select differ from standard `Form::Select::Base` styles
189
+ font-size: var(--token-typography-body-100-font-size);
190
+ font-family: var(--token-typography-body-100-font-family);
191
+ line-height: var(--token-typography-body-100-line-height);
192
+ background-position: center right 5px;
193
+ }
194
+ }
@@ -2,3 +2,6 @@
2
2
  // <%= folderizedModuleName %>
3
3
  //
4
4
 
5
+ .hds-<%= kebabizedModuleName %> {
6
+ // add the component styles here
7
+ }
@@ -2,58 +2,6 @@
2
2
 
3
3
  <h2 class="dummy-h2"><%= columnizedModuleName %></h2>
4
4
 
5
- {{! ADD YOUR CONTENT BELOW }}
6
- {{! Please follow as much as possible what it's already done in other components. }}
7
- {{! You can start by copy&pasting it, if you want, and then adapt it according to your needs. }}
8
- {{! Once done, please remove these comments (they're created by the generator). }}
9
-
10
- <section>
11
- <h3 class="dummy-h3" id="overview"><a href="#overview" class="dummy-link-section">§</a> Overview</h3>
12
-
13
- {{! ADD YOUR CONTENT HERE }}
14
-
15
- </section>
16
-
17
- <section>
18
- <h3 class="dummy-h3" id="component-api"><a href="#component-api" class="dummy-link-section">§</a> Component API</h3>
19
- <p class="dummy-paragraph" id="component-api-<%= kebabizedModuleName %>">
20
- Here is the API for the component:
21
- </p>
22
- <dl class="dummy-component-props" aria-labelledby="component-api-<%= kebabizedModuleName %>">
23
-
24
- {{! ADD YOUR CONTENT HERE }}
25
-
26
- </dl>
27
- </section>
28
-
29
- <section>
30
- <h3 class="dummy-h3" id="how-to-use"><a href="#how-to-use" class="dummy-link-section">§</a> How to use</h3>
31
-
32
- {{! ADD YOUR CONTENT HERE }}
33
-
34
- </section>
35
-
36
- <section>
37
- <h3 class="dummy-h3" id="design-guidelines"><a href="#design-guidelines" class="dummy-link-section">§</a> Design guidelines</h3>
38
- {{! UNCOMMENT THIS BLOCK (once the link and/or the image are available) }}
39
- {{!
40
- <div class="dummy-design-guidelines">
41
- <p class="dummy-paragraph">
42
- <a href="[ADD THE LINK TO THE FIGMA FILE/PAGE HERE!]" target="_blank" rel="noopener noreferrer">Figma UI Kit</a>
43
- </p>
44
- <br />
45
- <img class="dummy-figma-docs" src="/assets/images/<%= kebabizedModuleName %>-design-usage.png" alt="" role="none" />
46
- </div>
47
- }}
48
- </section>
49
-
50
- <section>
51
- <h3 class="dummy-h3" id="accessibility"><a href="#accessibility" class="dummy-link-section">§</a> Accessibility</h3>
52
-
53
- {{! ADD YOUR CONTENT HERE }}
54
-
55
- </section>
56
-
57
5
  <section data-test-percy>
58
6
  <h3 class="dummy-h3" id="showcase"><a href="#showcase" class="dummy-link-section">§</a> Showcase</h3>
59
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "1.5.2",
3
+ "version": "1.6.1",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -37,7 +37,7 @@
37
37
  "test:ember:percy": "percy exec ember test"
38
38
  },
39
39
  "dependencies": {
40
- "@hashicorp/design-system-tokens": "^1.3.1",
40
+ "@hashicorp/design-system-tokens": "^1.4.0",
41
41
  "@hashicorp/ember-flight-icons": "^3.0.2",
42
42
  "dialog-polyfill": "^0.5.6",
43
43
  "ember-auto-import": "^2.4.2",
@@ -59,11 +59,10 @@
59
59
  "@embroider/test-setup": "^1.8.3",
60
60
  "@glimmer/component": "^1.1.2",
61
61
  "@glimmer/tracking": "^1.1.2",
62
- "@percy/cli": "^1.17.0",
63
- "@percy/ember": "^4.0.0",
62
+ "@percy/cli": "^1.18.0",
63
+ "@percy/ember": "^4.1.0",
64
64
  "babel-eslint": "^10.1.0",
65
65
  "broccoli-asset-rev": "^3.0.0",
66
- "ember-a11y-refocus": "^2.1.0",
67
66
  "ember-a11y-testing": "^5.0.0",
68
67
  "ember-cli": "~4.7.0",
69
68
  "ember-cli-clipboard": "^1.0.0",
@@ -78,8 +77,8 @@
78
77
  "ember-load-initializers": "^2.1.2",
79
78
  "ember-page-title": "^7.0.0",
80
79
  "ember-power-select": "^6.0.0",
81
- "ember-prism": "^0.12.0",
82
- "ember-qunit": "^5.1.5",
80
+ "ember-prism": "^0.13.0",
81
+ "ember-qunit": "^6.1.1",
83
82
  "ember-resolver": "^8.0.3",
84
83
  "ember-source": "~4.8.1",
85
84
  "ember-source-channel-url": "^3.0.0",