@cfpb/cfpb-design-system 3.14.0 → 4.0.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 +35 -1
- package/dist/base/index.css +1 -1
- package/dist/base/index.css.map +2 -2
- package/dist/base/index.js.map +1 -1
- package/dist/components/cfpb-buttons/index.css +1 -1
- package/dist/components/cfpb-buttons/index.css.map +2 -2
- package/dist/components/cfpb-buttons/index.js.map +1 -1
- package/dist/components/cfpb-expandables/index.css +1 -1
- package/dist/components/cfpb-expandables/index.css.map +2 -2
- package/dist/components/cfpb-expandables/index.js +1 -1
- package/dist/components/cfpb-expandables/index.js.map +4 -4
- package/dist/components/cfpb-forms/index.css +1 -1
- package/dist/components/cfpb-forms/index.css.map +2 -2
- package/dist/components/cfpb-forms/index.js +1 -1
- package/dist/components/cfpb-forms/index.js.map +4 -4
- package/dist/elements/cfpb-button/index.js +3 -3
- package/dist/elements/cfpb-button/index.js.map +3 -3
- package/dist/elements/cfpb-file-upload/index.js +4 -3
- package/dist/elements/cfpb-file-upload/index.js.map +4 -4
- package/dist/index.css +1 -1
- package/dist/index.css.map +2 -2
- package/dist/index.js +4 -4
- package/dist/index.js.map +3 -3
- package/package.json +2 -1
- package/src/abstracts/vars.scss +1 -1
- package/src/base/base.scss +5 -0
- package/src/base/font.scss +11 -13
- package/src/components/cfpb-buttons/button.scss +1 -1
- package/src/components/cfpb-expandables/summary-minimal.scss +5 -0
- package/src/components/cfpb-expandables/summary.scss +10 -2
- package/src/components/cfpb-forms/search-input.scss +4 -7
- package/src/components/cfpb-forms/tag.scss +2 -2
- package/src/components/cfpb-typography/mixins.scss +1 -1
- package/src/elements/cfpb-button/index.js +5 -3
- package/src/elements/cfpb-file-upload/index.js +10 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfpb/cfpb-design-system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "CFPB's UI framework",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.js",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"email": "tech@cfpb.gov",
|
|
13
13
|
"url": "https://cfpb.github.io/design-system"
|
|
14
14
|
},
|
|
15
|
+
"sideEffects": false,
|
|
15
16
|
"publishConfig": {
|
|
16
17
|
"access": "public",
|
|
17
18
|
"registry": "https://registry.npmjs.org/"
|
package/src/abstracts/vars.scss
CHANGED
|
@@ -52,7 +52,7 @@ $size-code: 13px; // Custom size only for Mono code blocks
|
|
|
52
52
|
// Icon variables
|
|
53
53
|
|
|
54
54
|
// Icons' SVG viewbox are a consistent 19px (h) x variable (w).
|
|
55
|
-
// The height matches the 19px rendered canvas of text set in
|
|
55
|
+
// The height matches the 19px rendered canvas of text set in Source Sans 3
|
|
56
56
|
// sized at 16px (19/16 = 1.1875).
|
|
57
57
|
$cf-icon-height: 1.1875em;
|
|
58
58
|
|
package/src/base/base.scss
CHANGED
|
@@ -25,6 +25,11 @@ textarea {
|
|
|
25
25
|
// Must set these explicitly to override Normalize.css's provided default
|
|
26
26
|
// of `font-family: sans-serif;`
|
|
27
27
|
font-family: var(--font-stack);
|
|
28
|
+
|
|
29
|
+
// Characters in some languages, like Chinese, have a larger x-height,
|
|
30
|
+
// which will make the button taller than the input.
|
|
31
|
+
// Fix that by setting the line height on the button and the input.
|
|
32
|
+
line-height: math.div(19px, $base-font-size-px);
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
/*
|
package/src/base/font.scss
CHANGED
|
@@ -5,25 +5,23 @@
|
|
|
5
5
|
========================================================================== */
|
|
6
6
|
|
|
7
7
|
@if $path {
|
|
8
|
+
// Refer to https://fontsource.org/fonts/source-sans-3/install for
|
|
9
|
+
// generating @font-face rules.
|
|
8
10
|
@font-face {
|
|
9
|
-
font-family: '
|
|
10
|
-
src: url('#{$path}/2cd55546-ec00-4af9-aeca-4a3cd186da53.woff2')
|
|
11
|
-
format('woff2');
|
|
11
|
+
font-family: 'Source Sans 3 Variable';
|
|
12
12
|
font-style: normal;
|
|
13
|
-
font-weight: normal;
|
|
14
13
|
font-display: fallback;
|
|
14
|
+
font-weight: 200 900;
|
|
15
|
+
src: url('#{$path}/source-sans-3-latin-wght-normal.woff2')
|
|
16
|
+
format('woff2-variations');
|
|
17
|
+
unicode-range:
|
|
18
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
|
|
19
|
+
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
|
20
|
+
U+2212, U+2215, U+FEFF, U+FFFD;
|
|
15
21
|
}
|
|
16
22
|
|
|
17
|
-
@font-face {
|
|
18
|
-
font-family: 'Avenir Next';
|
|
19
|
-
src: url('#{$path}/627fbb5a-3bae-4cd9-b617-2f923e29d55e.woff2')
|
|
20
|
-
format('woff2');
|
|
21
|
-
font-style: normal;
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
font-display: fallback;
|
|
24
|
-
}
|
|
25
23
|
:root {
|
|
26
|
-
--font-stack: '
|
|
24
|
+
--font-stack: 'Source Sans 3 Variable', arial, sans-serif;
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
}
|
|
@@ -34,13 +34,13 @@ input.a-btn::-moz-focus-inner {
|
|
|
34
34
|
cursor: pointer;
|
|
35
35
|
font-size: math.div($btn-font-size, $base-font-size-px) + em;
|
|
36
36
|
font-weight: 500;
|
|
37
|
-
line-height: normal;
|
|
38
37
|
text-align: center;
|
|
39
38
|
text-decoration: none;
|
|
40
39
|
transition: background-color 0.1s;
|
|
41
40
|
width: fit-content;
|
|
42
41
|
height: fit-content;
|
|
43
42
|
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
44
|
|
|
45
45
|
&,
|
|
46
46
|
&:link,
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
&__btn {
|
|
17
17
|
position: relative;
|
|
18
18
|
z-index: 2;
|
|
19
|
-
display:
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: math.div(5px, $base-font-size-px) + rem;
|
|
20
23
|
width: 100%;
|
|
21
24
|
padding-top: 15px;
|
|
22
25
|
padding-bottom: 15px;
|
|
@@ -26,6 +29,11 @@
|
|
|
26
29
|
color: var(--pacific);
|
|
27
30
|
background: #fff;
|
|
28
31
|
|
|
32
|
+
svg {
|
|
33
|
+
// Prevent icon from shrinking when button wraps.
|
|
34
|
+
flex: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
&:focus {
|
|
30
38
|
outline: 1px dotted var(--pacific);
|
|
31
39
|
outline-offset: 1px;
|
|
@@ -42,7 +50,7 @@
|
|
|
42
50
|
right: 0;
|
|
43
51
|
|
|
44
52
|
// 4px is needed because the 2px movement of the content's bounding box.
|
|
45
|
-
top: calc(-100% +
|
|
53
|
+
top: calc(-100% + 4px);
|
|
46
54
|
|
|
47
55
|
/* TODO: stylelint wants to convert rgba to rgb. Investigate why. */
|
|
48
56
|
/* stylelint-disable */
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
left: 10px;
|
|
18
18
|
align-self: center;
|
|
19
19
|
cursor: pointer;
|
|
20
|
+
line-height: math.div(
|
|
21
|
+
14.4px,
|
|
22
|
+
$base-font-size-px
|
|
23
|
+
); // 9px vertically centers icon.
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
input[type='search'] {
|
|
@@ -97,13 +101,6 @@
|
|
|
97
101
|
display: block;
|
|
98
102
|
}
|
|
99
103
|
|
|
100
|
-
button[type='submit'] {
|
|
101
|
-
// Characters in some languages, like Chinese, have a larger x-height,
|
|
102
|
-
// which will make the button taller than the input.
|
|
103
|
-
// Fix that by setting the line height on the button.
|
|
104
|
-
line-height: math.div(19px, $base-font-size-px);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
104
|
// Tablet and above.
|
|
108
105
|
@include respond-to-min($bp-sm-min) {
|
|
109
106
|
flex-direction: row;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
// Filter tags appear in filtered contexts, often as part of multiselects.
|
|
7
7
|
.a-tag-filter {
|
|
8
|
+
line-height: math.div(19px, $base-font-size-px);
|
|
9
|
+
|
|
8
10
|
display: flex;
|
|
9
11
|
gap: math.div(10px, $btn-font-size) + rem;
|
|
10
12
|
|
|
@@ -48,8 +50,6 @@ a.a-tag-filter {
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
a.a-tag-filter {
|
|
51
|
-
line-height: normal;
|
|
52
|
-
|
|
53
53
|
// Colors for :link, :visited, :hover, :focus, :active.
|
|
54
54
|
@include u-link-colors(
|
|
55
55
|
var(--black),
|
|
@@ -48,7 +48,9 @@ export class CfpbButton extends LitElement {
|
|
|
48
48
|
</button>
|
|
49
49
|
`;
|
|
50
50
|
}
|
|
51
|
-
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
static init() {
|
|
53
|
+
window.customElements.get('cfpb-button') ||
|
|
54
|
+
window.customElements.define('cfpb-button', CfpbButton);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { html, LitElement, css, unsafeCSS } from 'lit';
|
|
2
2
|
import { ref, createRef } from 'lit/directives/ref.js';
|
|
3
3
|
import styles from './cfpb-file-upload.component.scss';
|
|
4
|
+
import { CfpbButton } from '../cfpb-button';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
*
|
|
@@ -96,7 +97,13 @@ export class CfpbFileUpload extends LitElement {
|
|
|
96
97
|
</div>
|
|
97
98
|
`;
|
|
98
99
|
}
|
|
99
|
-
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
static init() {
|
|
102
|
+
// Initialize internal button.
|
|
103
|
+
CfpbButton.init();
|
|
104
|
+
|
|
105
|
+
// Initialize parent file upload.
|
|
106
|
+
window.customElements.get('cfpb-file-upload') ||
|
|
107
|
+
window.customElements.define('cfpb-file-upload', CfpbFileUpload);
|
|
108
|
+
}
|
|
109
|
+
}
|